From c5158d8fd12cd6a61e3101f531ee9af9d3fa8220 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 17:44:07 +0800 Subject: [PATCH 001/105] chore: merge from CPython 3.12 --- c-api/arg.po | 368 ++-- c-api/bool.po | 50 +- c-api/bytes.po | 106 +- c-api/call.po | 194 +- c-api/code.po | 234 +- c-api/dict.po | 99 +- c-api/exceptions.po | 811 +++---- c-api/frame.po | 58 +- c-api/function.po | 101 +- c-api/gcsupport.po | 126 +- c-api/import.po | 64 +- c-api/init.po | 826 ++++--- c-api/init_config.po | 520 +++-- c-api/intro.po | 5 +- c-api/long.po | 141 +- c-api/none.po | 15 +- c-api/object.po | 52 +- c-api/perfmaps.po | 84 + c-api/refcounting.po | 130 +- c-api/slice.po | 12 +- c-api/stable.po | 194 +- c-api/structures.po | 751 ++++--- c-api/sys.po | 166 +- c-api/tuple.po | 4 +- c-api/type.po | 351 ++- c-api/typeobj.po | 1445 +++++++------ c-api/unicode.po | 1261 +++++------ c-api/veryhigh.po | 82 +- distributing/index.po | 103 +- extending/building.po | 112 +- extending/newtypes.po | 199 +- extending/newtypes_tutorial.po | 172 +- extending/windows.po | 10 +- faq/design.po | 330 +-- howto/argparse.po | 36 +- howto/clinic.po | 746 +++---- howto/enum.po | 466 ++-- howto/functional.po | 27 +- howto/logging-cookbook.po | 6 +- howto/logging.po | 458 ++-- howto/perf_profiling.po | 151 ++ howto/regex.po | 404 ++-- install/index.po | 470 ++-- installing/index.po | 84 +- library/__main__.po | 6 +- library/_thread.po | 77 +- library/argparse.po | 506 ++--- library/ast.po | 318 +-- library/asyncio-eventloop.po | 873 ++++---- library/asyncio-policy.po | 104 +- library/asyncio-runner.po | 73 +- library/asyncio-stream.po | 51 +- library/asyncio-subprocess.po | 80 +- library/asyncio-task.po | 461 ++-- library/atexit.po | 32 +- library/bisect.po | 58 +- library/calendar.po | 142 +- library/collections.abc.po | 99 +- library/collections.po | 326 +-- library/concurrent.futures.po | 133 +- library/configparser.po | 76 +- library/contextlib.po | 218 +- library/csv.po | 186 +- library/ctypes.po | 905 ++++---- library/curses.po | 951 ++++---- library/dataclasses.po | 153 +- library/datetime.po | 829 +++---- library/decimal.po | 48 +- library/difflib.po | 234 +- library/dis.po | 1237 +++++++---- library/doctest.po | 534 ++--- library/email.charset.po | 12 +- library/email.po | 13 +- library/email.policy.po | 186 +- library/email.utils.po | 103 +- library/enum.po | 287 ++- library/fcntl.po | 72 +- library/fractions.po | 65 +- library/ftplib.po | 149 +- library/functions.po | 604 +++--- library/functools.po | 178 +- library/gc.po | 7 +- library/glob.po | 5 +- library/gzip.po | 52 +- library/hashlib.po | 272 ++- library/html.entities.po | 18 +- library/http.client.po | 235 +- library/http.po | 119 +- library/http.server.po | 59 +- library/imaplib.po | 204 +- library/imghdr.po | 8 +- library/importlib.metadata.po | 99 +- library/importlib.po | 657 ++---- library/importlib.resources.abc.po | 55 +- library/importlib.resources.po | 138 +- library/inspect.po | 504 +++-- library/itertools.po | 317 +-- library/locale.po | 91 +- library/logging.config.po | 275 ++- library/logging.handlers.po | 58 +- library/logging.po | 718 ++++--- library/math.po | 246 ++- library/mmap.po | 28 +- library/multiprocessing.po | 1158 +++++----- library/nntplib.po | 164 +- library/optparse.po | 6 +- library/os.path.po | 141 +- library/os.po | 2200 ++++++++++--------- library/pathlib.po | 680 +++--- library/pdb.po | 166 +- library/pkgutil.po | 113 +- library/platform.po | 104 +- library/poplib.po | 96 +- library/pprint.po | 51 +- library/random.po | 252 ++- library/re.po | 581 ++--- library/reprlib.po | 82 +- library/runpy.po | 54 +- library/shlex.po | 156 +- library/shutil.po | 302 +-- library/smtplib.po | 236 +- library/socket.po | 759 ++++--- library/socketserver.po | 127 +- library/sqlite3.po | 1020 +++++---- library/ssl.po | 1172 +++++----- library/statistics.po | 138 +- library/stdtypes.po | 2239 +++++++++---------- library/string.po | 14 +- library/struct.po | 11 +- library/subprocess.po | 618 +++--- library/sys.po | 928 ++++---- library/sysconfig.po | 4 +- library/syslog.po | 68 +- library/tarfile.po | 582 ++--- library/tempfile.po | 269 ++- library/test.po | 540 ++--- library/threading.po | 406 ++-- library/token.po | 22 +- library/tokenize.po | 35 +- library/traceback.po | 146 +- library/tty.po | 28 +- library/turtle.po | 858 ++++---- library/types.po | 183 +- library/typing.po | 1239 +++++------ library/unicodedata.po | 12 +- library/unittest.mock.po | 728 +++---- library/unittest.po | 1158 +++++----- library/urllib.error.po | 24 +- library/uuid.po | 93 +- library/venv.po | 153 +- library/warnings.po | 61 +- library/wave.po | 111 +- library/webbrowser.po | 183 +- library/xml.etree.elementtree.po | 211 +- library/xml.sax.utils.po | 25 +- library/zipapp.po | 102 +- library/zipfile.po | 149 +- library/zipimport.po | 57 +- library/zoneinfo.po | 6 +- license.po | 99 +- reference/compound_stmts.po | 992 +++++---- reference/datamodel.po | 1352 ++++++------ reference/executionmodel.po | 248 ++- reference/expressions.po | 849 ++++---- reference/import.po | 390 ++-- reference/lexical_analysis.po | 523 ++--- reference/simple_stmts.po | 640 +++--- tutorial/classes.po | 89 +- tutorial/floatingpoint.po | 177 +- tutorial/interpreter.po | 24 +- tutorial/introduction.po | 9 +- tutorial/stdlib.po | 82 +- using/cmdline.po | 358 +-- using/configure.po | 679 +++--- using/mac.po | 12 +- using/unix.po | 76 +- using/windows.po | 705 +++--- whatsnew/2.0.po | 10 +- whatsnew/2.3.po | 8 +- whatsnew/2.7.po | 502 ++--- whatsnew/3.0.po | 10 +- whatsnew/3.10.po | 1022 +++++---- whatsnew/3.11.po | 1612 +++++++------- whatsnew/3.12.po | 3225 ++++++++++++++++++++++++++++ whatsnew/3.2.po | 917 ++++---- whatsnew/3.3.po | 1086 +++++----- whatsnew/3.4.po | 58 +- whatsnew/3.5.po | 8 +- whatsnew/3.6.po | 28 +- whatsnew/3.7.po | 16 +- whatsnew/3.8.po | 465 ++-- whatsnew/index.po | 4 +- 192 files changed, 36115 insertions(+), 27749 deletions(-) create mode 100644 c-api/perfmaps.po create mode 100644 howto/perf_profiling.po create mode 100644 whatsnew/3.12.po diff --git a/c-api/arg.po b/c-api/arg.po index ee0b42c42f..93eca4f729 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-24 00:13+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgid "" "`PyUnicode_FSConverter` as *converter*." msgstr "" -#: ../../c-api/arg.rst:96 ../../c-api/arg.rst:164 +#: ../../c-api/arg.rst:96 msgid "" "Previously, :exc:`TypeError` was raised when embedded null code points were " "encountered in the Python string." @@ -178,7 +178,7 @@ msgid "" "encoding." msgstr "" -#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:544 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]" @@ -276,77 +276,22 @@ msgid "" "`PyObject*`." msgstr "" -#: ../../c-api/arg.rst:170 -msgid "``u`` (:class:`str`) [const Py_UNICODE \\*]" -msgstr "``u`` (:class:`str`) [const Py_UNICODE \\*]" - -#: ../../c-api/arg.rst:156 -msgid "" -"Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of " -"Unicode characters. You must pass the address of a :c:type:`Py_UNICODE` " -"pointer variable, which will be filled with the pointer to an existing " -"Unicode buffer. Please note that the width of a :c:type:`Py_UNICODE` " -"character depends on compilation options (it is either 16 or 32 bits). The " -"Python string must not contain embedded null code points; if it does, a :exc:" -"`ValueError` exception is raised." -msgstr "" - -#: ../../c-api/arg.rst:171 ../../c-api/arg.rst:180 ../../c-api/arg.rst:188 -#: ../../c-api/arg.rst:196 -msgid "" -"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" -"func:`PyUnicode_AsWideCharString`." -msgstr "" - -#: ../../c-api/arg.rst:179 -msgid "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" -msgstr "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" - -#: ../../c-api/arg.rst:173 -msgid "" -"This variant on ``u`` stores into two C variables, the first one a pointer " -"to a Unicode data buffer, the second one its length. This variant allows " -"null code points." -msgstr "" - -#: ../../c-api/arg.rst:187 -msgid "``Z`` (:class:`str` or ``None``) [const Py_UNICODE \\*]" -msgstr "``Z`` (:class:`str` 或 ``None``) [const Py_UNICODE \\*]" - -#: ../../c-api/arg.rst:182 -msgid "" -"Like ``u``, but the Python object may also be ``None``, in which case the :c:" -"type:`Py_UNICODE` pointer is set to ``NULL``." -msgstr "" - -#: ../../c-api/arg.rst:195 -msgid "" -"``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \\*, :c:type:" -"`Py_ssize_t`]" -msgstr "" - -#: ../../c-api/arg.rst:190 -msgid "" -"Like ``u#``, but the Python object may also be ``None``, in which case the :" -"c:type:`Py_UNICODE` pointer is set to ``NULL``." -msgstr "" - -#: ../../c-api/arg.rst:200 +#: ../../c-api/arg.rst:158 msgid "``U`` (:class:`str`) [PyObject \\*]" msgstr "``U`` (:class:`str`) [PyObject \\*]" -#: ../../c-api/arg.rst:198 +#: ../../c-api/arg.rst:156 msgid "" "Requires that the Python object is a Unicode object, without attempting any " "conversion. Raises :exc:`TypeError` if the object is not a Unicode object. " "The C variable may also be declared as :c:expr:`PyObject*`." msgstr "" -#: ../../c-api/arg.rst:206 +#: ../../c-api/arg.rst:164 msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" msgstr "``w*`` (可讀寫 :term:`bytes-like object`) [Py_buffer]" -#: ../../c-api/arg.rst:203 +#: ../../c-api/arg.rst:161 msgid "" "This format accepts any object which implements the read-write buffer " "interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " @@ -354,17 +299,17 @@ msgid "" "`PyBuffer_Release` when it is done with the buffer." msgstr "" -#: ../../c-api/arg.rst:223 +#: ../../c-api/arg.rst:181 msgid "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" msgstr "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" -#: ../../c-api/arg.rst:209 +#: ../../c-api/arg.rst:167 msgid "" "This variant on ``s`` is used for encoding Unicode into a character buffer. " "It only works for encoded data without embedded NUL bytes." msgstr "" -#: ../../c-api/arg.rst:212 +#: ../../c-api/arg.rst:170 msgid "" "This format requires two arguments. The first is only used as input, and " "must be a :c:expr:`const char*` which points to the name of an encoding as a " @@ -375,7 +320,7 @@ msgid "" "The text will be encoded in the encoding specified by the first argument." msgstr "" -#: ../../c-api/arg.rst:220 +#: ../../c-api/arg.rst:178 msgid "" ":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy " "the encoded data into this buffer and adjust *\\*buffer* to reference the " @@ -383,33 +328,33 @@ msgid "" "`PyMem_Free` to free the allocated buffer after use." msgstr "" -#: ../../c-api/arg.rst:228 +#: ../../c-api/arg.rst:186 msgid "" "``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " "\\*encoding, char \\*\\*buffer]" msgstr "" -#: ../../c-api/arg.rst:226 +#: ../../c-api/arg.rst:184 msgid "" "Same as ``es`` except that byte string objects are passed through without " "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -#: ../../c-api/arg.rst:259 +#: ../../c-api/arg.rst:217 msgid "" "``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" "`Py_ssize_t` \\*buffer_length]" msgstr "" -#: ../../c-api/arg.rst:231 +#: ../../c-api/arg.rst:189 msgid "" "This variant on ``s#`` is used for encoding Unicode into a character buffer. " "Unlike the ``es`` format, this variant allows input data which contains NUL " "characters." msgstr "" -#: ../../c-api/arg.rst:235 +#: ../../c-api/arg.rst:193 msgid "" "It requires three arguments. The first is only used as input, and must be " "a :c:expr:`const char*` which points to the name of an encoding as a NUL-" @@ -422,11 +367,11 @@ msgid "" "will be set to the number of bytes in the output buffer." msgstr "" -#: ../../c-api/arg.rst:245 +#: ../../c-api/arg.rst:203 msgid "There are two modes of operation:" msgstr "" -#: ../../c-api/arg.rst:247 +#: ../../c-api/arg.rst:205 msgid "" "If *\\*buffer* points a ``NULL`` pointer, the function will allocate a " "buffer of the needed size, copy the encoded data into this buffer and set " @@ -435,7 +380,7 @@ msgid "" "after usage." msgstr "" -#: ../../c-api/arg.rst:252 +#: ../../c-api/arg.rst:210 msgid "" "If *\\*buffer* points to a non-``NULL`` pointer (an already allocated " "buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and " @@ -444,62 +389,68 @@ msgid "" "the buffer is not large enough, a :exc:`ValueError` will be set." msgstr "" -#: ../../c-api/arg.rst:258 +#: ../../c-api/arg.rst:216 msgid "" "In both cases, *\\*buffer_length* is set to the length of the encoded data " "without the trailing NUL byte." msgstr "" -#: ../../c-api/arg.rst:264 +#: ../../c-api/arg.rst:222 msgid "" "``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " "\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" -#: ../../c-api/arg.rst:262 +#: ../../c-api/arg.rst:220 msgid "" "Same as ``es#`` except that byte string objects are passed through without " "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -#: ../../c-api/arg.rst:267 +#: ../../c-api/arg.rst:224 +msgid "" +"``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy " +"``Py_UNICODE*`` representation." +msgstr "" + +#: ../../c-api/arg.rst:230 msgid "Numbers" msgstr "數字" -#: ../../c-api/arg.rst:271 +#: ../../c-api/arg.rst:234 msgid "``b`` (:class:`int`) [unsigned char]" msgstr "``b`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:270 +#: ../../c-api/arg.rst:233 msgid "" "Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" "c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:275 ../../c-api/arg.rst:615 +#: ../../c-api/arg.rst:238 ../../c-api/arg.rst:578 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:274 +#: ../../c-api/arg.rst:237 msgid "" "Convert a Python integer to a tiny int without overflow checking, stored in " "a C :c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:609 +#: ../../c-api/arg.rst:241 ../../c-api/arg.rst:572 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" -#: ../../c-api/arg.rst:278 +#: ../../c-api/arg.rst:241 msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" -#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:618 +#: ../../c-api/arg.rst:245 ../../c-api/arg.rst:581 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" -#: ../../c-api/arg.rst:281 +#: ../../c-api/arg.rst:244 msgid "" "Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." @@ -507,57 +458,57 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:285 ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:566 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" -#: ../../c-api/arg.rst:285 +#: ../../c-api/arg.rst:248 msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:289 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:584 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" -#: ../../c-api/arg.rst:288 +#: ../../c-api/arg.rst:251 msgid "" "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:292 ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:575 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" -#: ../../c-api/arg.rst:292 +#: ../../c-api/arg.rst:255 msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" -#: ../../c-api/arg.rst:296 ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:587 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" -#: ../../c-api/arg.rst:295 +#: ../../c-api/arg.rst:258 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:299 ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:590 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" -#: ../../c-api/arg.rst:299 +#: ../../c-api/arg.rst:262 msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" -#: ../../c-api/arg.rst:303 ../../c-api/arg.rst:630 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:593 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" -#: ../../c-api/arg.rst:302 +#: ../../c-api/arg.rst:265 msgid "" "Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." @@ -565,82 +516,82 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:633 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:596 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:306 +#: ../../c-api/arg.rst:269 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." msgstr "將一個 Python 整數轉換成 C 的 :c:type:`Py_ssize_t`。" -#: ../../c-api/arg.rst:313 +#: ../../c-api/arg.rst:276 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" msgstr "``c``\\ (:class:`bytes` 或長度為 1 的 :class:`bytearray`)[char]" -#: ../../c-api/arg.rst:309 +#: ../../c-api/arg.rst:272 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " "object of length 1, to a C :c:expr:`char`." msgstr "" -#: ../../c-api/arg.rst:312 +#: ../../c-api/arg.rst:275 msgid "Allow :class:`bytearray` objects." msgstr "允許 :class:`bytearray` 物件。" -#: ../../c-api/arg.rst:317 ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:604 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" -#: ../../c-api/arg.rst:316 +#: ../../c-api/arg.rst:279 msgid "" "Convert a Python character, represented as a :class:`str` object of length " "1, to a C :c:expr:`int`." msgstr "" -#: ../../c-api/arg.rst:320 ../../c-api/arg.rst:647 +#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:610 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" -#: ../../c-api/arg.rst:320 +#: ../../c-api/arg.rst:283 msgid "Convert a Python floating point number to a C :c:expr:`float`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" -#: ../../c-api/arg.rst:323 ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:286 ../../c-api/arg.rst:607 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" -#: ../../c-api/arg.rst:323 +#: ../../c-api/arg.rst:286 msgid "Convert a Python floating point number to a C :c:expr:`double`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`double`。" -#: ../../c-api/arg.rst:326 +#: ../../c-api/arg.rst:289 msgid "``D`` (:class:`complex`) [Py_complex]" msgstr "``D`` (:class:`complex`) [Py_complex]" -#: ../../c-api/arg.rst:326 +#: ../../c-api/arg.rst:289 msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" -#: ../../c-api/arg.rst:329 +#: ../../c-api/arg.rst:292 msgid "Other objects" msgstr "其他物件" -#: ../../c-api/arg.rst:334 ../../c-api/arg.rst:658 +#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:621 msgid "``O`` (object) [PyObject \\*]" msgstr "``O``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:332 +#: ../../c-api/arg.rst:295 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " "program thus receives the actual object that was passed. The object's " "reference count is not increased. The pointer stored is not ``NULL``." msgstr "" -#: ../../c-api/arg.rst:341 +#: ../../c-api/arg.rst:304 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:337 +#: ../../c-api/arg.rst:300 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -649,11 +600,11 @@ msgid "" "required type, :exc:`TypeError` is raised." msgstr "" -#: ../../c-api/arg.rst:366 ../../c-api/arg.rst:672 +#: ../../c-api/arg.rst:329 ../../c-api/arg.rst:635 msgid "``O&`` (object) [*converter*, *anything*]" msgstr "``O&``\\ (物件)[*converter*, *anything*]" -#: ../../c-api/arg.rst:346 +#: ../../c-api/arg.rst:309 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -661,7 +612,7 @@ msgid "" "*converter* function in turn is called as follows::" msgstr "" -#: ../../c-api/arg.rst:353 +#: ../../c-api/arg.rst:316 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" "expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " @@ -671,7 +622,7 @@ msgid "" "unmodified." msgstr "" -#: ../../c-api/arg.rst:359 +#: ../../c-api/arg.rst:322 msgid "" "If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " "second time if the argument parsing eventually fails, giving the converter a " @@ -680,15 +631,15 @@ msgid "" "value as in the original call." msgstr "" -#: ../../c-api/arg.rst:365 +#: ../../c-api/arg.rst:328 msgid "``Py_CLEANUP_SUPPORTED`` was added." msgstr "加入 ``Py_CLEANUP_SUPPORTED``。" -#: ../../c-api/arg.rst:375 +#: ../../c-api/arg.rst:338 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:369 +#: ../../c-api/arg.rst:332 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -697,18 +648,18 @@ msgid "" "how Python tests values for truth." msgstr "" -#: ../../c-api/arg.rst:380 ../../c-api/arg.rst:675 +#: ../../c-api/arg.rst:343 ../../c-api/arg.rst:638 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:341 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " "units in *items*. Format units for sequences may be nested." msgstr "" -#: ../../c-api/arg.rst:382 +#: ../../c-api/arg.rst:345 msgid "" "It is possible to pass \"long\" integers (integers whose value exceeds the " "platform's :const:`LONG_MAX`) however no proper range checking is done --- " @@ -717,17 +668,17 @@ msgid "" "downcasts in C --- your mileage may vary)." msgstr "" -#: ../../c-api/arg.rst:388 +#: ../../c-api/arg.rst:351 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" msgstr "" -#: ../../c-api/arg.rst:396 +#: ../../c-api/arg.rst:359 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:392 +#: ../../c-api/arg.rst:355 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -736,11 +687,11 @@ msgid "" "corresponding C variable(s)." msgstr "" -#: ../../c-api/arg.rst:405 +#: ../../c-api/arg.rst:368 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:399 +#: ../../c-api/arg.rst:362 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -748,35 +699,35 @@ msgid "" "be specified before ``$`` in the format string." msgstr "" -#: ../../c-api/arg.rst:410 +#: ../../c-api/arg.rst:373 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:408 +#: ../../c-api/arg.rst:371 msgid "" "The list of format units ends here; the string after the colon is used as " "the function name in error messages (the \"associated value\" of the " "exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" -#: ../../c-api/arg.rst:415 +#: ../../c-api/arg.rst:378 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:413 +#: ../../c-api/arg.rst:376 msgid "" "The list of format units ends here; the string after the semicolon is used " "as the error message *instead* of the default error message. ``:`` and ``;" "`` mutually exclude each other." msgstr "" -#: ../../c-api/arg.rst:417 +#: ../../c-api/arg.rst:380 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not decrement their reference count!" msgstr "" -#: ../../c-api/arg.rst:420 +#: ../../c-api/arg.rst:383 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -786,7 +737,7 @@ msgid "" "unit in that case." msgstr "" -#: ../../c-api/arg.rst:426 +#: ../../c-api/arg.rst:389 msgid "" "For the conversion to succeed, the *arg* object must match the format and " "the format must be exhausted. On success, the ``PyArg_Parse*`` functions " @@ -796,24 +747,24 @@ msgid "" "the following format units are left untouched." msgstr "" -#: ../../c-api/arg.rst:435 +#: ../../c-api/arg.rst:398 msgid "API Functions" msgstr "API 函式" -#: ../../c-api/arg.rst:439 +#: ../../c-api/arg.rst:402 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " "and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:446 +#: ../../c-api/arg.rst:409 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:452 +#: ../../c-api/arg.rst:415 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -822,26 +773,26 @@ msgid "" "success; on failure, it returns false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:459 +#: ../../c-api/arg.rst:422 msgid "" "Added support for :ref:`positional-only parameters `." msgstr "" -#: ../../c-api/arg.rst:466 +#: ../../c-api/arg.rst:429 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:472 +#: ../../c-api/arg.rst:435 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: ../../c-api/arg.rst:482 +#: ../../c-api/arg.rst:445 msgid "" "Function used to deconstruct the argument lists of \"old-style\" functions " "--- these are functions which use the :const:`METH_OLDARGS` parameter " @@ -852,7 +803,7 @@ msgid "" "continue to be used for that purpose." msgstr "" -#: ../../c-api/arg.rst:493 +#: ../../c-api/arg.rst:456 msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " @@ -870,23 +821,23 @@ msgid "" "if there was a failure." msgstr "" -#: ../../c-api/arg.rst:508 +#: ../../c-api/arg.rst:471 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`_weakref` helper module for weak references::" msgstr "" -#: ../../c-api/arg.rst:524 +#: ../../c-api/arg.rst:487 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: ../../c-api/arg.rst:532 +#: ../../c-api/arg.rst:495 msgid "Building values" msgstr "" -#: ../../c-api/arg.rst:536 +#: ../../c-api/arg.rst:499 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -894,7 +845,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: ../../c-api/arg.rst:541 +#: ../../c-api/arg.rst:504 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -903,7 +854,7 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: ../../c-api/arg.rst:547 +#: ../../c-api/arg.rst:510 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " @@ -914,7 +865,7 @@ msgid "" "`Py_BuildValue` returns." msgstr "" -#: ../../c-api/arg.rst:555 +#: ../../c-api/arg.rst:518 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -922,155 +873,155 @@ msgid "" "be passed." msgstr "" -#: ../../c-api/arg.rst:559 +#: ../../c-api/arg.rst:522 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: ../../c-api/arg.rst:565 +#: ../../c-api/arg.rst:528 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:564 +#: ../../c-api/arg.rst:527 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: ../../c-api/arg.rst:570 +#: ../../c-api/arg.rst:533 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:568 +#: ../../c-api/arg.rst:531 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:574 +#: ../../c-api/arg.rst:537 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:573 +#: ../../c-api/arg.rst:536 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:541 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:577 +#: ../../c-api/arg.rst:540 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:581 ../../c-api/arg.rst:597 +#: ../../c-api/arg.rst:544 ../../c-api/arg.rst:560 msgid "Same as ``s``." msgstr "和 ``s`` 相同。" -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:547 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:584 ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:547 ../../c-api/arg.rst:563 msgid "Same as ``s#``." msgstr "和 ``s#`` 相同。" -#: ../../c-api/arg.rst:589 +#: ../../c-api/arg.rst:552 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:550 msgid "" "Convert a null-terminated :c:expr:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:594 +#: ../../c-api/arg.rst:557 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:592 +#: ../../c-api/arg.rst:555 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:597 +#: ../../c-api/arg.rst:560 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:563 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:566 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:606 +#: ../../c-api/arg.rst:569 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:606 +#: ../../c-api/arg.rst:569 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:609 +#: ../../c-api/arg.rst:572 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:575 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:615 +#: ../../c-api/arg.rst:578 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:618 +#: ../../c-api/arg.rst:581 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:584 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:587 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:590 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:630 +#: ../../c-api/arg.rst:593 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:633 +#: ../../c-api/arg.rst:596 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。" -#: ../../c-api/arg.rst:637 +#: ../../c-api/arg.rst:600 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" -#: ../../c-api/arg.rst:636 +#: ../../c-api/arg.rst:599 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." @@ -1078,7 +1029,7 @@ msgstr "" "將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`bytes`。" -#: ../../c-api/arg.rst:640 +#: ../../c-api/arg.rst:603 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." @@ -1086,23 +1037,23 @@ msgstr "" "將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`str`。" -#: ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:607 msgid "Convert a C :c:expr:`double` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:647 +#: ../../c-api/arg.rst:610 msgid "Convert a C :c:expr:`float` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:650 +#: ../../c-api/arg.rst:613 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:650 +#: ../../c-api/arg.rst:613 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" -#: ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:616 msgid "" "Pass a Python object untouched (except for its reference count, which is " "incremented by one). If the object passed in is a ``NULL`` pointer, it is " @@ -1112,26 +1063,26 @@ msgid "" "raised yet, :exc:`SystemError` is set." msgstr "" -#: ../../c-api/arg.rst:661 +#: ../../c-api/arg.rst:624 msgid "``S`` (object) [PyObject \\*]" msgstr "``S``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:661 +#: ../../c-api/arg.rst:624 msgid "Same as ``O``." msgstr "和 ``O`` 相同。" -#: ../../c-api/arg.rst:666 +#: ../../c-api/arg.rst:629 msgid "``N`` (object) [PyObject \\*]" msgstr "``N``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:664 +#: ../../c-api/arg.rst:627 msgid "" "Same as ``O``, except it doesn't increment the reference count on the " "object. Useful when the object is created by a call to an object constructor " "in the argument list." msgstr "" -#: ../../c-api/arg.rst:669 +#: ../../c-api/arg.rst:632 msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:expr:" @@ -1139,41 +1090,50 @@ msgid "" "``NULL`` if an error occurred." msgstr "" -#: ../../c-api/arg.rst:675 +#: ../../c-api/arg.rst:638 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:678 +#: ../../c-api/arg.rst:641 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:678 +#: ../../c-api/arg.rst:641 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:683 +#: ../../c-api/arg.rst:646 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:681 +#: ../../c-api/arg.rst:644 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: ../../c-api/arg.rst:685 +#: ../../c-api/arg.rst:648 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: ../../c-api/arg.rst:690 +#: ../../c-api/arg.rst:653 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" + +#~ msgid "``u`` (:class:`str`) [const Py_UNICODE \\*]" +#~ msgstr "``u`` (:class:`str`) [const Py_UNICODE \\*]" + +#~ msgid "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" +#~ msgstr "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" + +#~ msgid "``Z`` (:class:`str` or ``None``) [const Py_UNICODE \\*]" +#~ msgstr "``Z`` (:class:`str` 或 ``None``) [const Py_UNICODE \\*]" diff --git a/c-api/bool.po b/c-api/bool.po index adbf711b69..7df696275f 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-06-29 12:56+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-12-09 20:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,9 +27,10 @@ msgid "Boolean Objects" msgstr "Boolean(布林)物件" #: ../../c-api/bool.rst:8 +#, fuzzy msgid "" "Booleans in Python are implemented as a subclass of integers. There are " -"only two booleans, :const:`Py_False` and :const:`Py_True`. As such, the " +"only two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the " "normal creation and deletion functions don't apply to booleans. The " "following macros are available, however." msgstr "" @@ -45,37 +46,50 @@ msgstr "" "如果 *o* 的型別為 :c:data:`PyBool_Type` 則回傳真值。此函式總是會成功執行。" #: ../../c-api/bool.rst:22 +#, fuzzy msgid "" -"The Python ``False`` object. This object has no methods. It needs to be " -"treated just like any other object with respect to reference counts." +"The Python ``False`` object. This object has no methods and is `immortal " +"`_." msgstr "" "Python 的 ``False`` 物件。此物件沒有任何方法。在參照 (reference) 計數上必須有" "著和其他物件一樣的處理方式。" -#: ../../c-api/bool.rst:28 +#: ../../c-api/bool.rst:25 +msgid ":c:data:`Py_False` is immortal." +msgstr "" + +#: ../../c-api/bool.rst:31 +#, fuzzy msgid "" -"The Python ``True`` object. This object has no methods. It needs to be " -"treated just like any other object with respect to reference counts." +"The Python ``True`` object. This object has no methods and is `immortal " +"`_." msgstr "" "Python 的 ``True`` 物件。此物件沒有任何方法。在參照計數上必須有著和其他物件一" "樣的處理方式。" #: ../../c-api/bool.rst:34 -msgid "" -"Return :const:`Py_False` from a function, properly incrementing its " -"reference count." -msgstr "從函式回傳 :const:`Py_False`\\ ,並適當的增加它的參照計數。" +msgid ":c:data:`Py_True` is immortal." +msgstr "" #: ../../c-api/bool.rst:40 -msgid "" -"Return :const:`Py_True` from a function, properly incrementing its reference " -"count." -msgstr "從函式回傳 :const:`Py_True`\\ ,並適當的增加它的參照計數。" +#, fuzzy +msgid "Return :c:data:`Py_False` from a function." +msgstr "從函式回傳 :const:`Py_False`\\ ,並適當的增加它的參照計數。" -#: ../../c-api/bool.rst:46 +#: ../../c-api/bool.rst:45 +msgid "Return :c:data:`Py_True` from a function." +msgstr "" + +#: ../../c-api/bool.rst:50 +#, fuzzy msgid "" -"Return a new reference to :const:`Py_True` or :const:`Py_False` depending on " -"the truth value of *v*." +"Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value " +"of *v*." msgstr "" "根據 *v* 的實際值來回傳一個 :const:`Py_True` 或者 :const:`Py_False` 的新參" "照。" + +#~ msgid "" +#~ "Return :const:`Py_True` from a function, properly incrementing its " +#~ "reference count." +#~ msgstr "從函式回傳 :const:`Py_True`\\ ,並適當的增加它的參照計數。" diff --git a/c-api/bytes.po b/c-api/bytes.po index 040ce445e5..a6831b0f60 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,187 +74,187 @@ msgid "" "allowed:" msgstr "" -#: ../../c-api/bytes.rst:68 +#: ../../c-api/bytes.rst:65 msgid "Format Characters" msgstr "" -#: ../../c-api/bytes.rst:68 +#: ../../c-api/bytes.rst:65 msgid "Type" msgstr "" -#: ../../c-api/bytes.rst:68 +#: ../../c-api/bytes.rst:65 msgid "Comment" msgstr "" -#: ../../c-api/bytes.rst:70 +#: ../../c-api/bytes.rst:67 msgid ":attr:`%%`" msgstr ":attr:`%%`" -#: ../../c-api/bytes.rst:70 +#: ../../c-api/bytes.rst:67 msgid "*n/a*" msgstr "*n/a*" -#: ../../c-api/bytes.rst:70 +#: ../../c-api/bytes.rst:67 msgid "The literal % character." msgstr "" -#: ../../c-api/bytes.rst:72 +#: ../../c-api/bytes.rst:69 msgid ":attr:`%c`" msgstr ":attr:`%c`" -#: ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:75 ../../c-api/bytes.rst:93 -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:69 ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:93 msgid "int" msgstr "int" -#: ../../c-api/bytes.rst:72 +#: ../../c-api/bytes.rst:69 msgid "A single byte, represented as a C int." msgstr "" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:72 msgid ":attr:`%d`" msgstr ":attr:`%d`" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:72 msgid "Equivalent to ``printf(\"%d\")``. [1]_" msgstr "等價於 ``printf(\"%d\")``. [1]_" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:75 msgid ":attr:`%u`" msgstr ":attr:`%u`" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:75 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:75 msgid "Equivalent to ``printf(\"%u\")``. [1]_" msgstr "等價於 ``printf(\"%u\")``. [1]_" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:78 msgid ":attr:`%ld`" msgstr ":attr:`%ld`" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:78 msgid "long" msgstr "long" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:78 msgid "Equivalent to ``printf(\"%ld\")``. [1]_" msgstr "等價於 ``printf(\"%ld\")``. [1]_" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:81 msgid ":attr:`%lu`" msgstr ":attr:`%lu`" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:81 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:81 msgid "Equivalent to ``printf(\"%lu\")``. [1]_" msgstr "等價於 ``printf(\"%lu\")``. [1]_" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:84 msgid ":attr:`%zd`" msgstr ":attr:`%zd`" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:84 msgid ":c:type:`\\ Py_ssize_t`" msgstr ":c:type:`\\ Py_ssize_t`" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:84 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" msgstr "等價於 ``printf(\"%zd\")``. [1]_" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:87 msgid ":attr:`%zu`" msgstr ":attr:`%zu`" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:87 msgid "size_t" msgstr "size_t" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:87 msgid "Equivalent to ``printf(\"%zu\")``. [1]_" msgstr "等價於 ``printf(\"%zu\")``. [1]_" -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:90 msgid ":attr:`%i`" msgstr ":attr:`%i`" -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:90 msgid "Equivalent to ``printf(\"%i\")``. [1]_" msgstr "等價於 ``printf(\"%i\")``. [1]_" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:93 msgid ":attr:`%x`" msgstr ":attr:`%x`" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:93 msgid "Equivalent to ``printf(\"%x\")``. [1]_" msgstr "等價於 ``printf(\"%x\")``. [1]_" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:96 msgid ":attr:`%s`" msgstr ":attr:`%s`" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:96 msgid "const char\\*" msgstr "const char\\*" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:96 msgid "A null-terminated C character array." msgstr "" -#: ../../c-api/bytes.rst:102 +#: ../../c-api/bytes.rst:99 msgid ":attr:`%p`" msgstr ":attr:`%p`" -#: ../../c-api/bytes.rst:102 +#: ../../c-api/bytes.rst:99 msgid "const void\\*" msgstr "const void\\*" -#: ../../c-api/bytes.rst:102 +#: ../../c-api/bytes.rst:99 msgid "" "The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " "``0x`` regardless of what the platform's ``printf`` yields." msgstr "" -#: ../../c-api/bytes.rst:111 +#: ../../c-api/bytes.rst:108 msgid "" "An unrecognized format character causes all the rest of the format string to " "be copied as-is to the result object, and any extra arguments discarded." msgstr "" -#: ../../c-api/bytes.rst:114 +#: ../../c-api/bytes.rst:111 msgid "" "For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag " "has effect even when a precision is given." msgstr "" -#: ../../c-api/bytes.rst:120 +#: ../../c-api/bytes.rst:117 msgid "" "Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/bytes.rst:126 +#: ../../c-api/bytes.rst:123 msgid "" "Return the bytes representation of object *o* that implements the buffer " "protocol." msgstr "" -#: ../../c-api/bytes.rst:132 +#: ../../c-api/bytes.rst:129 msgid "Return the length of the bytes in bytes object *o*." msgstr "" -#: ../../c-api/bytes.rst:137 +#: ../../c-api/bytes.rst:134 msgid "Similar to :c:func:`PyBytes_Size`, but without error checking." msgstr "" -#: ../../c-api/bytes.rst:142 +#: ../../c-api/bytes.rst:139 msgid "" "Return a pointer to the contents of *o*. The pointer refers to the internal " "buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in the " @@ -265,24 +265,24 @@ msgid "" "`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`." msgstr "" -#: ../../c-api/bytes.rst:154 +#: ../../c-api/bytes.rst:151 msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking." msgstr "" -#: ../../c-api/bytes.rst:159 +#: ../../c-api/bytes.rst:156 msgid "" "Return the null-terminated contents of the object *obj* through the output " "variables *buffer* and *length*." msgstr "" -#: ../../c-api/bytes.rst:162 +#: ../../c-api/bytes.rst:159 msgid "" "If *length* is ``NULL``, the bytes object may not contain embedded null " "bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is " "raised." msgstr "" -#: ../../c-api/bytes.rst:166 +#: ../../c-api/bytes.rst:163 msgid "" "The buffer refers to an internal buffer of *obj*, which includes an " "additional null byte at the end (not counted in *length*). The data must " @@ -292,13 +292,13 @@ msgid "" "returns ``-1`` and raises :exc:`TypeError`." msgstr "" -#: ../../c-api/bytes.rst:173 +#: ../../c-api/bytes.rst:170 msgid "" "Previously, :exc:`TypeError` was raised when embedded null bytes were " "encountered in the bytes object." msgstr "" -#: ../../c-api/bytes.rst:180 +#: ../../c-api/bytes.rst:177 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*; the caller will own the new reference. The reference " @@ -307,14 +307,14 @@ msgid "" "of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set." msgstr "" -#: ../../c-api/bytes.rst:189 +#: ../../c-api/bytes.rst:186 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*. This version decrements the reference count of " "*newpart*." msgstr "" -#: ../../c-api/bytes.rst:196 +#: ../../c-api/bytes.rst:193 msgid "" "A way to resize a bytes object even though it is \"immutable\". Only use " "this to build up a brand new bytes object; don't use this if the bytes may " diff --git a/c-api/call.po b/c-api/call.po index eea2f85bc5..8b9dc86bd7 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,7 +109,17 @@ msgstr "" "一個支援 vectorcall 的類別\\ **必須**\\ 也實作具有相同語義的 :c:member:" "`~PyTypeObject.tp_call`。" -#: ../../c-api/call.rst:60 +#: ../../c-api/call.rst:62 +msgid "" +"The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " +"when the class's :py:meth:`~object.__call__` method is reassigned. (This " +"internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it " +"behave differently than the vectorcall function.) In earlier Python " +"versions, vectorcall should only be used with :const:`immutable " +"` or static types." +msgstr "" + +#: ../../c-api/call.rst:69 msgid "" "A class should not implement vectorcall if that would be slower than " "*tp_call*. For example, if the callee needs to convert the arguments to an " @@ -120,7 +130,7 @@ msgstr "" "果被呼叫者需要將引數轉換為 args tuple(引數元組)和 kwargs dict(關鍵字引數字" "典),那麼實作 vectorcall 就沒有意義。" -#: ../../c-api/call.rst:65 +#: ../../c-api/call.rst:74 msgid "" "Classes can implement the vectorcall protocol by enabling the :const:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting :c:member:`~PyTypeObject." @@ -132,26 +142,26 @@ msgstr "" "`~PyTypeObject.tp_vectorcall_offset` 設定為物件結構中有出現 *vectorcallfunc* " "的 offset 來實作 vectorcall 協定。這是一個指向具有以下簽章之函式的指標:" -#: ../../c-api/call.rst:73 +#: ../../c-api/call.rst:82 msgid "*callable* is the object being called." msgstr "*callable* 是指被呼叫的物件。" -#: ../../c-api/call.rst:75 +#: ../../c-api/call.rst:84 msgid "" "*args* is a C array consisting of the positional arguments followed by the" msgstr "*args* 是一個 C 語言陣列 (array),包含位置引數與後面" -#: ../../c-api/call.rst:75 +#: ../../c-api/call.rst:84 msgid "" "values of the keyword arguments. This can be *NULL* if there are no " "arguments." msgstr "關鍵字引數的值。如果沒有引數,這個值可以是 *NULL*。" -#: ../../c-api/call.rst:79 +#: ../../c-api/call.rst:88 msgid "*nargsf* is the number of positional arguments plus possibly the" msgstr "*nargsf* 是位置引數的數量加上可能會有的" -#: ../../c-api/call.rst:78 +#: ../../c-api/call.rst:87 msgid "" ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." @@ -159,11 +169,11 @@ msgstr "" ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" "置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" -#: ../../c-api/call.rst:85 +#: ../../c-api/call.rst:94 msgid "*kwnames* is a tuple containing the names of the keyword arguments;" msgstr "*kwnames* 是一個包含所有關鍵字引數名稱的 tuple;" -#: ../../c-api/call.rst:82 +#: ../../c-api/call.rst:91 msgid "" "in other words, the keys of the kwargs dict. These names must be strings " "(instances of ``str`` or a subclass) and they must be unique. If there are " @@ -173,7 +183,7 @@ msgstr "" "例),並且它們必須是不重複的。如果沒有關鍵字引數,那麼 *kwnames* 可以用 " "*NULL* 代替。" -#: ../../c-api/call.rst:89 +#: ../../c-api/call.rst:98 msgid "" "If this flag is set in a vectorcall *nargsf* argument, the callee is allowed " "to temporarily change ``args[-1]``. In other words, *args* points to " @@ -184,7 +194,7 @@ msgstr "" "``args[-1]`` 的值。換句話說,*args* 指向向量中的引數 1(不是 0)。被呼叫方必" "須在回傳之前還原 ``args[-1]`` 的值。" -#: ../../c-api/call.rst:94 +#: ../../c-api/call.rst:103 msgid "" "For :c:func:`PyObject_VectorcallMethod`, this flag means instead that " "``args[0]`` may be changed." @@ -192,7 +202,7 @@ msgstr "" "對於 :c:func:`PyObject_VectorcallMethod`,這個旗標的改變意味著可能是 " "``args[0]`` 被改變。" -#: ../../c-api/call.rst:97 +#: ../../c-api/call.rst:106 msgid "" "Whenever they can do so cheaply (without additional allocation), callers are " "encouraged to use :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " @@ -204,7 +214,7 @@ msgstr "" "法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 *self* " "引數)。" -#: ../../c-api/call.rst:102 +#: ../../c-api/call.rst:111 msgid "" "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " @@ -213,7 +223,7 @@ msgstr "" "要呼叫一個實作了 vectorcall 的物件,請就像其他可呼叫物件一樣使用\\ :ref:`呼" "叫 API` 中的函式。:c:func:`PyObject_Vectorcall` 通常是最有效率的。" -#: ../../c-api/call.rst:109 +#: ../../c-api/call.rst:118 msgid "" "In CPython 3.8, the vectorcall API and related functions were available " "provisionally under names with a leading underscore: " @@ -232,11 +242,11 @@ msgstr "" "``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的新名" "稱的別名。" -#: ../../c-api/call.rst:121 +#: ../../c-api/call.rst:130 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/call.rst:123 +#: ../../c-api/call.rst:132 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" @@ -246,7 +256,7 @@ msgstr "" "使用 *tp_call* 的呼叫會使用 :c:func:`Py_EnterRecursiveCall` 和 :c:func:" "`Py_LeaveRecursiveCall`。" -#: ../../c-api/call.rst:128 +#: ../../c-api/call.rst:137 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " @@ -255,11 +265,11 @@ msgstr "" "為保證效率,這不適用於使用 vectorcall 的呼叫:被呼叫方在需要時應當使用 " "*Py_EnterRecursiveCall* 和 *Py_LeaveRecursiveCall*。" -#: ../../c-api/call.rst:134 +#: ../../c-api/call.rst:143 msgid "Vectorcall Support API" msgstr "Vectorcall 支援 API" -#: ../../c-api/call.rst:138 +#: ../../c-api/call.rst:147 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" @@ -268,13 +278,13 @@ msgstr "" "\n" "::" -#: ../../c-api/call.rst:144 +#: ../../c-api/call.rst:153 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "然而,應使用 ``PyVectorcall_NARGS`` 函式以便將來需要擴充。" -#: ../../c-api/call.rst:151 +#: ../../c-api/call.rst:160 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -285,7 +295,7 @@ msgstr "" "*NULL*。否則,回傳儲存在 *op* 中的 vectorcall 函式指標。這個函式不會引發例" "外。" -#: ../../c-api/call.rst:156 +#: ../../c-api/call.rst:165 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." @@ -293,7 +303,7 @@ msgstr "" "這大多在檢查 *op* 是否支援 vectorcall 時能派上用場,可以透過檢查 " "``PyVectorcall_Function(op) != NULL`` 來達成。" -#: ../../c-api/call.rst:163 +#: ../../c-api/call.rst:172 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." @@ -301,7 +311,7 @@ msgstr "" "呼叫 *callable* 的 :c:type:`vectorcallfunc`,其位置引數和關鍵字引數分別以 " "tuple 和 dict 格式給定。" -#: ../../c-api/call.rst:166 +#: ../../c-api/call.rst:175 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -312,11 +322,11 @@ msgstr "" "用於 ``tp_call`` 的實作。它不會檢查 :const:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" "並且它不會退回 (fall back) 使用 ``tp_call``。" -#: ../../c-api/call.rst:177 +#: ../../c-api/call.rst:186 msgid "Object Calling API" msgstr "物件呼叫 API" -#: ../../c-api/call.rst:179 +#: ../../c-api/call.rst:188 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -327,133 +337,133 @@ msgstr "" "的慣用形式 – 可以是 *tp_call* 或 vectorcall。為了儘可能減少轉換的進行,請選擇" "一個適合你所擁有資料格式的函式。" -#: ../../c-api/call.rst:185 +#: ../../c-api/call.rst:194 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "下表總結了可用的函式;請參閱各個說明文件以瞭解詳情。" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:198 msgid "Function" msgstr "函式" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:198 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:198 msgid "args" msgstr "args" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:198 msgid "kwargs" msgstr "kwargs" -#: ../../c-api/call.rst:191 +#: ../../c-api/call.rst:200 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../c-api/call.rst:191 ../../c-api/call.rst:193 ../../c-api/call.rst:195 -#: ../../c-api/call.rst:197 ../../c-api/call.rst:199 ../../c-api/call.rst:203 -#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 +#: ../../c-api/call.rst:200 ../../c-api/call.rst:202 ../../c-api/call.rst:204 +#: ../../c-api/call.rst:206 ../../c-api/call.rst:208 ../../c-api/call.rst:212 +#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:191 +#: ../../c-api/call.rst:200 msgid "tuple" msgstr "tuple" -#: ../../c-api/call.rst:191 ../../c-api/call.rst:213 +#: ../../c-api/call.rst:200 ../../c-api/call.rst:222 msgid "dict/``NULL``" msgstr "dict/``NULL``" -#: ../../c-api/call.rst:193 +#: ../../c-api/call.rst:202 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" -#: ../../c-api/call.rst:193 ../../c-api/call.rst:195 ../../c-api/call.rst:197 -#: ../../c-api/call.rst:199 ../../c-api/call.rst:201 ../../c-api/call.rst:203 -#: ../../c-api/call.rst:205 ../../c-api/call.rst:207 ../../c-api/call.rst:209 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:212 +#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 msgid "---" msgstr "---" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:204 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:195 ../../c-api/call.rst:209 +#: ../../c-api/call.rst:204 ../../c-api/call.rst:218 msgid "1 object" msgstr "一個物件" -#: ../../c-api/call.rst:197 +#: ../../c-api/call.rst:206 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:197 +#: ../../c-api/call.rst:206 msgid "tuple/``NULL``" msgstr "tuple/``NULL``" -#: ../../c-api/call.rst:199 +#: ../../c-api/call.rst:208 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:199 ../../c-api/call.rst:201 +#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 msgid "format" msgstr "format" -#: ../../c-api/call.rst:201 +#: ../../c-api/call.rst:210 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:201 +#: ../../c-api/call.rst:210 msgid "obj + ``char*``" msgstr "物件 + ``char*``" -#: ../../c-api/call.rst:203 +#: ../../c-api/call.rst:212 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 +#: ../../c-api/call.rst:212 ../../c-api/call.rst:214 msgid "variadic" msgstr "可變引數" -#: ../../c-api/call.rst:205 +#: ../../c-api/call.rst:214 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:205 ../../c-api/call.rst:207 ../../c-api/call.rst:209 +#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 msgid "obj + name" msgstr "物件 + 名稱" -#: ../../c-api/call.rst:207 +#: ../../c-api/call.rst:216 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:209 +#: ../../c-api/call.rst:218 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:211 +#: ../../c-api/call.rst:220 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 +#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 ../../c-api/call.rst:224 msgid "vectorcall" msgstr "vectorcall" -#: ../../c-api/call.rst:213 +#: ../../c-api/call.rst:222 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:215 +#: ../../c-api/call.rst:224 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:215 +#: ../../c-api/call.rst:224 msgid "arg + name" msgstr "引數 + 名稱" -#: ../../c-api/call.rst:221 +#: ../../c-api/call.rst:230 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." @@ -461,7 +471,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數及由" "字典 *kwargs* 所給定的關鍵字引數。" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:233 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." @@ -469,22 +479,22 @@ msgstr "" "*args* 必須不為 *NULL*;如果不需要引數,請使用一個空 tuple。如果不需要關鍵字" "引數,則 *kwargs* 可以為 *NULL*。" -#: ../../c-api/call.rst:227 ../../c-api/call.rst:239 ../../c-api/call.rst:250 -#: ../../c-api/call.rst:261 ../../c-api/call.rst:273 ../../c-api/call.rst:293 -#: ../../c-api/call.rst:312 ../../c-api/call.rst:326 ../../c-api/call.rst:335 -#: ../../c-api/call.rst:347 ../../c-api/call.rst:360 ../../c-api/call.rst:394 +#: ../../c-api/call.rst:236 ../../c-api/call.rst:248 ../../c-api/call.rst:259 +#: ../../c-api/call.rst:270 ../../c-api/call.rst:282 ../../c-api/call.rst:302 +#: ../../c-api/call.rst:321 ../../c-api/call.rst:335 ../../c-api/call.rst:344 +#: ../../c-api/call.rst:356 ../../c-api/call.rst:369 ../../c-api/call.rst:403 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "成功時回傳結果,或在失敗時引發一個例外並回傳 *NULL*。" -#: ../../c-api/call.rst:230 +#: ../../c-api/call.rst:239 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "這等價於 Python 運算式 ``callable(*args, **kwargs)``。" -#: ../../c-api/call.rst:236 +#: ../../c-api/call.rst:245 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." @@ -492,7 +502,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並不附帶任何引數。這是不帶引數呼叫 " "Python 可呼叫物件的最有效方式。" -#: ../../c-api/call.rst:247 +#: ../../c-api/call.rst:256 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." @@ -500,7 +510,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並附帶正好一個位置引數 *arg* 而沒有關" "鍵字引數。" -#: ../../c-api/call.rst:258 +#: ../../c-api/call.rst:267 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." @@ -508,11 +518,11 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數。如" "果不需要傳入引數,則 *args* 可以為 *NULL*。" -#: ../../c-api/call.rst:264 ../../c-api/call.rst:276 +#: ../../c-api/call.rst:273 ../../c-api/call.rst:285 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "這等價於 Python 運算式 ``callable(*args)``。" -#: ../../c-api/call.rst:269 +#: ../../c-api/call.rst:278 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -523,7 +533,7 @@ msgstr "" "用 :c:func:`Py_BuildValue` 風格的格式字串來描述。格式可以為 *NULL*,表示沒有" "提供任何引數。" -#: ../../c-api/call.rst:278 +#: ../../c-api/call.rst:287 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." @@ -531,11 +541,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:281 +#: ../../c-api/call.rst:290 msgid "The type of *format* was changed from ``char *``." msgstr "這個 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:287 +#: ../../c-api/call.rst:296 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " @@ -544,17 +554,17 @@ msgstr "" "呼叫 *obj* 物件中名為 *name* 的 method 並附帶數量可變的 C 引數。這些 C 引數" "由 :c:func:`Py_BuildValue` 格式字串來描述,並應當生成一個 tuple。" -#: ../../c-api/call.rst:291 +#: ../../c-api/call.rst:300 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "格式可以為 *NULL*,表示沒有提供任何引數。" -#: ../../c-api/call.rst:296 +#: ../../c-api/call.rst:305 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:299 +#: ../../c-api/call.rst:308 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." @@ -562,11 +572,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:302 +#: ../../c-api/call.rst:311 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:308 +#: ../../c-api/call.rst:317 msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " @@ -575,13 +585,13 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` " "引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。" -#: ../../c-api/call.rst:315 +#: ../../c-api/call.rst:324 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:321 +#: ../../c-api/call.rst:330 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -592,7 +602,7 @@ msgstr "" "Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些" "引數是以位置在 *NULL* 後面、且數量可變的參數來提供。" -#: ../../c-api/call.rst:332 +#: ../../c-api/call.rst:341 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." @@ -600,7 +610,7 @@ msgstr "" "不附帶任何引數地呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 " "*name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:343 +#: ../../c-api/call.rst:352 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " @@ -609,7 +619,7 @@ msgstr "" "附帶一個位置引數 *arg* 地呼叫 Python 物件 *obj* 中的一個 method,其中 method " "名稱由 *name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:355 +#: ../../c-api/call.rst:364 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " @@ -619,7 +629,7 @@ msgstr "" "的相同。如果 *callable* 支援 vectorcall_,則它會直接呼叫存放在 *callable* 中" "的 vectorcall 函式。" -#: ../../c-api/call.rst:367 +#: ../../c-api/call.rst:376 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " @@ -628,7 +638,7 @@ msgstr "" "附帶與在 vectorcall_ 協定中傳入的相同位置引數來呼叫 *callable*,但會加上以字" "典 *kwdict* 格式傳入的關鍵字引數。*args* 陣列將只包含位置引數。" -#: ../../c-api/call.rst:371 +#: ../../c-api/call.rst:380 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -638,7 +648,7 @@ msgstr "" "無論內部使用了哪一種協定,都會需要進行引數的轉換。因此,此函式應該只有在呼叫" "方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。" -#: ../../c-api/call.rst:381 +#: ../../c-api/call.rst:390 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -656,7 +666,7 @@ msgstr "" "加上 :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" "`PyObject_Vectorcall` 中一樣被傳入。" -#: ../../c-api/call.rst:390 +#: ../../c-api/call.rst:399 msgid "" "If the object has the :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." @@ -664,11 +674,11 @@ msgstr "" "如果物件具有 :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " "向量作為引數來呼叫 unbound method(未繫結方法)物件。" -#: ../../c-api/call.rst:401 +#: ../../c-api/call.rst:410 msgid "Call Support API" msgstr "呼叫支援 API" -#: ../../c-api/call.rst:405 +#: ../../c-api/call.rst:414 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/code.po b/c-api/code.po index 490f8bcfa6..6bc8294dfa 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,79 +54,103 @@ msgstr "" #: ../../c-api/code.rst:38 msgid "" "Return a new code object. If you need a dummy code object to create a " -"frame, use :c:func:`PyCode_NewEmpty` instead. Calling :c:func:`PyCode_New` " -"directly will bind you to a precise Python version since the definition of " -"the bytecode changes often. The many arguments of this function are inter-" -"dependent in complex ways, meaning that subtle changes to values are likely " -"to result in incorrect execution or VM crashes. Use this function only with " -"extreme care." +"frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: ../../c-api/code.rst:45 ../../c-api/code.rst:55 +#: ../../c-api/code.rst:41 +msgid "" +"Since the definition of the bytecode changes often, calling :c:func:" +"`PyCode_New` directly can bind you to a precise Python version." +msgstr "" + +#: ../../c-api/code.rst:44 +msgid "" +"The many arguments of this function are inter-dependent in complex ways, " +"meaning that subtle changes to values are likely to result in incorrect " +"execution or VM crashes. Use this function only with extreme care." +msgstr "" + +#: ../../c-api/code.rst:48 ../../c-api/code.rst:68 msgid "Added ``exceptiontable`` parameter." msgstr "" -#: ../../c-api/code.rst:50 +#: ../../c-api/code.rst:55 +msgid "" +"Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " +"is deprecated, but will remain available until the signature changes again." +msgstr "" + +#: ../../c-api/code.rst:61 msgid "" "Similar to :c:func:`PyCode_New`, but with an extra \"posonlyargcount\" for " "positional-only arguments. The same caveats that apply to ``PyCode_New`` " "also apply to this function." msgstr "" -#: ../../c-api/code.rst:60 +#: ../../c-api/code.rst:66 +msgid "as ``PyCode_NewWithPosOnlyArgs``" +msgstr "" + +#: ../../c-api/code.rst:73 +msgid "" +"Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " +"deprecated, but will remain available until the signature changes again." +msgstr "" + +#: ../../c-api/code.rst:79 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: ../../c-api/code.rst:66 +#: ../../c-api/code.rst:85 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../c-api/code.rst:69 +#: ../../c-api/code.rst:88 msgid "" "For efficiently iterating over the line numbers in a code object, use `the " "API described in PEP 626 `_." msgstr "" -#: ../../c-api/code.rst:74 +#: ../../c-api/code.rst:93 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: ../../c-api/code.rst:78 +#: ../../c-api/code.rst:97 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:84 +#: ../../c-api/code.rst:103 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:89 +#: ../../c-api/code.rst:108 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: ../../c-api/code.rst:97 +#: ../../c-api/code.rst:116 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:106 +#: ../../c-api/code.rst:125 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -134,13 +158,165 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:115 +#: ../../c-api/code.rst:134 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the free " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" +#: ../../c-api/code.rst:142 +msgid "" +"Register *callback* as a code object watcher for the current interpreter. " +"Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +#: ../../c-api/code.rst:151 +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " +"``-1`` and set an exception on error (e.g. if the given *watcher_id* was " +"never registered.)" +msgstr "" + +#: ../../c-api/code.rst:160 +msgid "" +"Enumeration of possible code object watcher events: - " +"``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" +msgstr "" + +#: ../../c-api/code.rst:168 +msgid "Type of a code object watcher callback function." +msgstr "" + +#: ../../c-api/code.rst:170 +msgid "" +"If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " +"`co` has been fully initialized. Otherwise, the callback is invoked before " +"the destruction of *co* takes place, so the prior state of *co* can be " +"inspected." +msgstr "" + +#: ../../c-api/code.rst:175 +msgid "" +"If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " +"to the about-to-be-destroyed code object will resurrect it and prevent it " +"from being freed at this time. When the resurrected object is destroyed " +"later, any watcher callbacks active at that time will be called again." +msgstr "" + +#: ../../c-api/code.rst:180 +msgid "" +"Users of this API should not rely on internal runtime implementation " +"details. Such details may include, but are not limited to, the exact order " +"and timing of creation and destruction of code objects. While changes in " +"these details may result in differences observable by watchers (including " +"whether a callback is invoked or not), it does not change the semantics of " +"the Python code being executed." +msgstr "" + +#: ../../c-api/code.rst:187 +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +#: ../../c-api/code.rst:191 +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + +#: ../../c-api/code.rst:201 +msgid "Extra information" +msgstr "" + +#: ../../c-api/code.rst:203 +msgid "" +"To support low-level extensions to frame evaluation, such as external just-" +"in-time compilers, it is possible to attach arbitrary extra data to code " +"objects." +msgstr "" + +#: ../../c-api/code.rst:207 +msgid "" +"These functions are part of the unstable C API tier: this functionality is a " +"CPython implementation detail, and the API may change without deprecation " +"warnings." +msgstr "" + +#: ../../c-api/code.rst:213 +msgid "Return a new an opaque index value used to adding data to code objects." +msgstr "" + +#: ../../c-api/code.rst:215 +msgid "" +"You generally call this function once (per interpreter) and use the result " +"with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " +"individual code objects." +msgstr "" + +#: ../../c-api/code.rst:219 +msgid "" +"If *free* is not ``NULL``: when a code object is deallocated, *free* will be " +"called on non-``NULL`` data stored under the new index. Use :c:func:" +"`Py_DecRef` when storing :c:type:`PyObject`." +msgstr "" + +#: ../../c-api/code.rst:225 +msgid "as ``_PyEval_RequestCodeExtraIndex``" +msgstr "" + +#: ../../c-api/code.rst:229 +msgid "" +"Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " +"is deprecated, but will be available until the API changes." +msgstr "" + +#: ../../c-api/code.rst:235 +msgid "" +"Set *extra* to the extra data stored under the given index. Return 0 on " +"success. Set an exception and return -1 on failure." +msgstr "" + +#: ../../c-api/code.rst:238 +msgid "" +"If no data was set under the index, set *extra* to ``NULL`` and return 0 " +"without setting an exception." +msgstr "" + +#: ../../c-api/code.rst:243 +msgid "as ``_PyCode_GetExtra``" +msgstr "" + +#: ../../c-api/code.rst:247 +msgid "" +"Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " +"but will be available until the API changes." +msgstr "" + +#: ../../c-api/code.rst:253 +msgid "" +"Set the extra data stored under the given index to *extra*. Return 0 on " +"success. Set an exception and return -1 on failure." +msgstr "" + +#: ../../c-api/code.rst:258 +msgid "as ``_PyCode_SetExtra``" +msgstr "" + +#: ../../c-api/code.rst:262 +msgid "" +"Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " +"but will be available until the API changes." +msgstr "" + #: ../../c-api/code.rst:3 msgid "object" msgstr "object(物件)" @@ -152,3 +328,23 @@ msgstr "code(程式碼)" #: ../../c-api/code.rst:3 msgid "code object" msgstr "code object(程式碼物件)" + +#: ../../c-api/code.rst:51 +msgid "PyCode_New" +msgstr "" + +#: ../../c-api/code.rst:64 +msgid "PyCode_NewWithPosOnlyArgs" +msgstr "" + +#: ../../c-api/code.rst:223 +msgid "_PyEval_RequestCodeExtraIndex" +msgstr "" + +#: ../../c-api/code.rst:241 +msgid "_PyCode_GetExtra" +msgstr "" + +#: ../../c-api/code.rst:256 +msgid "_PyCode_SetExtra" +msgstr "" diff --git a/c-api/dict.po b/c-api/dict.po index 8673ea6315..60751f08db 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-25 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -239,6 +239,103 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" +#: ../../c-api/dict.rst:249 +msgid "" +"Register *callback* as a dictionary watcher. Return a non-negative integer " +"id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " +"of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +#: ../../c-api/dict.rst:258 +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " +"given *watcher_id* was never registered.)" +msgstr "" + +#: ../../c-api/dict.rst:266 +msgid "" +"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" +"func:`PyDict_AddWatcher` will be called when *dict* is modified or " +"deallocated. Return ``0`` on success or ``-1`` on error." +msgstr "" + +#: ../../c-api/dict.rst:274 +msgid "" +"Mark dictionary *dict* as no longer watched. The callback granted " +"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " +"*dict* is modified or deallocated. The dict must previously have been " +"watched by this watcher. Return ``0`` on success or ``-1`` on error." +msgstr "" + +#: ../../c-api/dict.rst:283 +msgid "" +"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " +"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " +"``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or " +"``PyDict_EVENT_DEALLOCATED``." +msgstr "" + +#: ../../c-api/dict.rst:291 +msgid "Type of a dict watcher callback function." +msgstr "" + +#: ../../c-api/dict.rst:293 +msgid "" +"If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " +"*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " +"or ``PyDict_EVENT_MODIFIED``, *new_value* will be the new value for *key*. " +"If *event* is ``PyDict_EVENT_DELETED``, *key* is being deleted from the " +"dictionary and *new_value* will be ``NULL``." +msgstr "" + +#: ../../c-api/dict.rst:299 +msgid "" +"``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " +"dict is merged into it. To maintain efficiency of this operation, per-key " +"``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single " +"``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." +msgstr "" + +#: ../../c-api/dict.rst:305 +msgid "" +"The callback may inspect but must not modify *dict*; doing so could have " +"unpredictable effects, including infinite recursion. Do not trigger Python " +"code execution in the callback, as it could modify the dict as a side effect." +msgstr "" + +#: ../../c-api/dict.rst:309 +msgid "" +"If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " +"callback to the about-to-be-destroyed dictionary will resurrect it and " +"prevent it from being freed at this time. When the resurrected object is " +"destroyed later, any watcher callbacks active at that time will be called " +"again." +msgstr "" + +#: ../../c-api/dict.rst:315 +msgid "" +"Callbacks occur before the notified modification to *dict* takes place, so " +"the prior state of *dict* can be inspected." +msgstr "" + +#: ../../c-api/dict.rst:318 +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +#: ../../c-api/dict.rst:322 +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + #: ../../c-api/dict.rst:8 msgid "object" msgstr "object(物件)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 270e3feb1e..e8927e1dda 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,22 +92,28 @@ msgstr "" #: ../../c-api/exceptions.rst:63 msgid "" -"If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, :" -"data:`sys.last_value` and :data:`sys.last_traceback` will be set to the " -"type, value and traceback of the printed exception, respectively." +"If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set " +"to the printed exception. For backwards compatibility, the deprecated " +"variables :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." +"last_traceback` are also set to the type, value and traceback of this " +"exception, respectively." msgstr "" -#: ../../c-api/exceptions.rst:70 +#: ../../c-api/exceptions.rst:69 +msgid "The setting of :data:`sys.last_exc` was added." +msgstr "" + +#: ../../c-api/exceptions.rst:75 msgid "Alias for ``PyErr_PrintEx(1)``." msgstr "``PyErr_PrintEx(1)`` 的別名。" -#: ../../c-api/exceptions.rst:75 +#: ../../c-api/exceptions.rst:80 msgid "" "Call :func:`sys.unraisablehook` using the current exception and *obj* " "argument." msgstr "" -#: ../../c-api/exceptions.rst:78 +#: ../../c-api/exceptions.rst:83 msgid "" "This utility function prints a warning message to ``sys.stderr`` when an " "exception has been set but it is impossible for the interpreter to actually " @@ -115,29 +121,35 @@ msgid "" "an :meth:`__del__` method." msgstr "" -#: ../../c-api/exceptions.rst:83 +#: ../../c-api/exceptions.rst:88 msgid "" "The function is called with a single argument *obj* that identifies the " "context in which the unraisable exception occurred. If possible, the repr of " "*obj* will be printed in the warning message." msgstr "" -#: ../../c-api/exceptions.rst:87 +#: ../../c-api/exceptions.rst:92 msgid "An exception must be set when calling this function." msgstr "" -#: ../../c-api/exceptions.rst:91 +#: ../../c-api/exceptions.rst:96 +msgid "" +"Print the standard traceback display of ``exc`` to ``sys.stderr``, including " +"chained exceptions and notes." +msgstr "" + +#: ../../c-api/exceptions.rst:102 msgid "Raising exceptions" msgstr "" -#: ../../c-api/exceptions.rst:93 +#: ../../c-api/exceptions.rst:104 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " "for use in a ``return`` statement." msgstr "" -#: ../../c-api/exceptions.rst:100 +#: ../../c-api/exceptions.rst:111 msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " @@ -146,13 +158,13 @@ msgid "" "``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:108 +#: ../../c-api/exceptions.rst:119 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: ../../c-api/exceptions.rst:114 +#: ../../c-api/exceptions.rst:125 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -160,31 +172,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:123 +#: ../../c-api/exceptions.rst:134 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/exceptions.rst:131 +#: ../../c-api/exceptions.rst:142 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:136 +#: ../../c-api/exceptions.rst:147 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: ../../c-api/exceptions.rst:143 +#: ../../c-api/exceptions.rst:154 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: ../../c-api/exceptions.rst:152 +#: ../../c-api/exceptions.rst:163 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -198,7 +210,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:166 +#: ../../c-api/exceptions.rst:177 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -206,21 +218,21 @@ msgid "" "is used to define the :attr:`filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:175 +#: ../../c-api/exceptions.rst:186 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: ../../c-api/exceptions.rst:184 +#: ../../c-api/exceptions.rst:195 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:191 +#: ../../c-api/exceptions.rst:202 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`GetLastError` " @@ -233,44 +245,44 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:200 ../../c-api/exceptions.rst:208 -#: ../../c-api/exceptions.rst:217 ../../c-api/exceptions.rst:225 -#: ../../c-api/exceptions.rst:233 ../../c-api/exceptions.rst:243 +#: ../../c-api/exceptions.rst:211 ../../c-api/exceptions.rst:219 +#: ../../c-api/exceptions.rst:228 ../../c-api/exceptions.rst:236 +#: ../../c-api/exceptions.rst:244 ../../c-api/exceptions.rst:254 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:205 +#: ../../c-api/exceptions.rst:216 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:213 +#: ../../c-api/exceptions.rst:224 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " "filename is given as a C string. *filename* is decoded from the filesystem " "encoding (:func:`os.fsdecode`)." msgstr "" -#: ../../c-api/exceptions.rst:222 +#: ../../c-api/exceptions.rst:233 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " "additional parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:230 +#: ../../c-api/exceptions.rst:241 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:240 +#: ../../c-api/exceptions.rst:251 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:248 +#: ../../c-api/exceptions.rst:259 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -278,13 +290,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:258 +#: ../../c-api/exceptions.rst:269 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:266 +#: ../../c-api/exceptions.rst:277 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -292,19 +304,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:276 +#: ../../c-api/exceptions.rst:287 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:284 +#: ../../c-api/exceptions.rst:295 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:290 +#: ../../c-api/exceptions.rst:301 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -312,11 +324,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:297 +#: ../../c-api/exceptions.rst:308 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:299 +#: ../../c-api/exceptions.rst:310 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -332,7 +344,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:314 +#: ../../c-api/exceptions.rst:325 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -342,7 +354,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:321 +#: ../../c-api/exceptions.rst:332 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -351,14 +363,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:327 +#: ../../c-api/exceptions.rst:338 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:334 +#: ../../c-api/exceptions.rst:345 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -366,31 +378,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:345 +#: ../../c-api/exceptions.rst:356 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:352 +#: ../../c-api/exceptions.rst:363 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:361 +#: ../../c-api/exceptions.rst:372 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:368 +#: ../../c-api/exceptions.rst:379 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:372 +#: ../../c-api/exceptions.rst:383 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -399,11 +411,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:378 +#: ../../c-api/exceptions.rst:389 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:382 +#: ../../c-api/exceptions.rst:393 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -411,14 +423,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:401 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:397 +#: ../../c-api/exceptions.rst:408 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -426,7 +438,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:405 +#: ../../c-api/exceptions.rst:416 +msgid "" +"Return the exception currently being raised, clearing the error indicator at " +"the same time." +msgstr "" + +#: ../../c-api/exceptions.rst:419 +msgid "" +"This function is used by code that needs to catch exceptions, or code that " +"needs to save and restore the error indicator temporarily." +msgstr "" + +#: ../../c-api/exceptions.rst:422 ../../c-api/exceptions.rst:466 +msgid "For example::" +msgstr "" + +#: ../../c-api/exceptions.rst:432 +msgid "" +":c:func:`PyErr_GetHandledException`, to save the exception currently being " +"handled." +msgstr "" + +#: ../../c-api/exceptions.rst:440 +msgid "" +"Set *exc* as the exception currently being raised, clearing the existing " +"exception if one is set." +msgstr "" + +#: ../../c-api/exceptions.rst:445 +msgid "This call steals a reference to *exc*, which must be a valid exception." +msgstr "" + +#: ../../c-api/exceptions.rst:454 +msgid "Use :c:func:`PyErr_GetRaisedException` instead." +msgstr "" + +#: ../../c-api/exceptions.rst:456 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -435,34 +483,43 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:412 +#: ../../c-api/exceptions.rst:463 +msgid "" +"This function is normally only used by legacy code that needs to catch " +"exceptions or save and restore the error indicator temporarily." +msgstr "" + +#: ../../c-api/exceptions.rst:482 +msgid "Use :c:func:`PyErr_SetRaisedException` instead." +msgstr "" + +#: ../../c-api/exceptions.rst:484 msgid "" -"This function is normally only used by code that needs to catch exceptions " -"or by code that needs to save and restore the error indicator temporarily, e." -"g.::" +"Set the error indicator from the three objects, *type*, *value*, and " +"*traceback*, clearing the existing exception if one is set. If the objects " +"are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type " +"and non-``NULL`` value or traceback. The exception type should be a class. " +"Do not pass an invalid exception type or value. (Violating these rules will " +"cause subtle problems later.) This call takes away a reference to each " +"object: you must own a reference to each object before the call and after " +"the call you no longer own these references. (If you don't understand this, " +"don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:427 +#: ../../c-api/exceptions.rst:498 msgid "" -"Set the error indicator from the three objects. If the error indicator is " -"already set, it is cleared first. If the objects are ``NULL``, the error " -"indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or " -"traceback. The exception type should be a class. Do not pass an invalid " -"exception type or value. (Violating these rules will cause subtle problems " -"later.) This call takes away a reference to each object: you must own a " -"reference to each object before the call and after the call you no longer " -"own these references. (If you don't understand this, don't use this " -"function. I warned you.)" +"This function is normally only used by legacy code that needs to save and " +"restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " +"the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:439 +#: ../../c-api/exceptions.rst:507 msgid "" -"This function is normally only used by code that needs to save and restore " -"the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the " -"current error indicator." +"Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" +"normalization." msgstr "" -#: ../../c-api/exceptions.rst:446 +#: ../../c-api/exceptions.rst:510 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -472,14 +529,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:454 +#: ../../c-api/exceptions.rst:518 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:465 +#: ../../c-api/exceptions.rst:529 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -487,7 +544,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:472 +#: ../../c-api/exceptions.rst:536 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -495,14 +552,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:481 +#: ../../c-api/exceptions.rst:545 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:488 +#: ../../c-api/exceptions.rst:552 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -510,7 +567,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:497 +#: ../../c-api/exceptions.rst:561 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -520,7 +577,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:506 +#: ../../c-api/exceptions.rst:570 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -528,7 +585,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:516 +#: ../../c-api/exceptions.rst:580 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -538,7 +595,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:525 +#: ../../c-api/exceptions.rst:589 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -546,22 +603,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:532 +#: ../../c-api/exceptions.rst:596 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:540 +#: ../../c-api/exceptions.rst:604 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:550 +#: ../../c-api/exceptions.rst:614 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:552 +#: ../../c-api/exceptions.rst:616 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -569,7 +626,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:621 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -578,44 +635,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:563 +#: ../../c-api/exceptions.rst:627 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:566 +#: ../../c-api/exceptions.rst:630 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:570 +#: ../../c-api/exceptions.rst:634 msgid "" "The default Python signal handler for :const:`SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:581 +#: ../../c-api/exceptions.rst:645 msgid "" "Simulate the effect of a :const:`SIGINT` signal arriving. This is equivalent " "to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:585 ../../c-api/exceptions.rst:612 +#: ../../c-api/exceptions.rst:649 ../../c-api/exceptions.rst:676 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:595 +#: ../../c-api/exceptions.rst:659 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:599 +#: ../../c-api/exceptions.rst:663 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -623,27 +680,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:604 +#: ../../c-api/exceptions.rst:668 msgid "" "If the given signal isn't handled by Python (it was set to :data:`signal." "SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:607 +#: ../../c-api/exceptions.rst:671 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:620 +#: ../../c-api/exceptions.rst:684 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:624 +#: ../../c-api/exceptions.rst:688 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -651,15 +708,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:629 +#: ../../c-api/exceptions.rst:693 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:634 +#: ../../c-api/exceptions.rst:698 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:638 +#: ../../c-api/exceptions.rst:702 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -668,7 +725,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:644 +#: ../../c-api/exceptions.rst:708 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -678,31 +735,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:717 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:661 +#: ../../c-api/exceptions.rst:725 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:665 +#: ../../c-api/exceptions.rst:729 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:672 +#: ../../c-api/exceptions.rst:736 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:678 +#: ../../c-api/exceptions.rst:742 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -710,98 +767,118 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:686 +#: ../../c-api/exceptions.rst:750 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:757 msgid "" "Return the cause (either an exception instance, or :const:`None`, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:700 +#: ../../c-api/exceptions.rst:764 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or :const:`None`. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:704 +#: ../../c-api/exceptions.rst:768 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:710 +#: ../../c-api/exceptions.rst:773 +msgid "Return :attr:`~BaseException.args` of exception *ex*." +msgstr "" + +#: ../../c-api/exceptions.rst:778 +msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." +msgstr "" + +#: ../../c-api/exceptions.rst:782 +msgid "" +"Implement part of the interpreter's implementation of :keyword:`!except*`. " +"*orig* is the original exception that was caught, and *excs* is the list of " +"the exceptions that need to be raised. This list contains the the unhandled " +"part of *orig*, if any, as well as the exceptions that were raised from the :" +"keyword:`!except*` clauses (so they have a different traceback from *orig*) " +"and those that were reraised (and have the same traceback as *orig*). Return " +"the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " +"if there is nothing to reraise." +msgstr "" + +#: ../../c-api/exceptions.rst:796 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:712 +#: ../../c-api/exceptions.rst:798 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:716 +#: ../../c-api/exceptions.rst:802 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:723 +#: ../../c-api/exceptions.rst:809 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:729 +#: ../../c-api/exceptions.rst:815 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:735 +#: ../../c-api/exceptions.rst:821 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:743 +#: ../../c-api/exceptions.rst:829 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:750 +#: ../../c-api/exceptions.rst:836 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:758 +#: ../../c-api/exceptions.rst:844 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:765 +#: ../../c-api/exceptions.rst:851 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:771 +#: ../../c-api/exceptions.rst:857 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:864 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:780 +#: ../../c-api/exceptions.rst:866 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -811,42 +888,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:789 +#: ../../c-api/exceptions.rst:875 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:791 +#: ../../c-api/exceptions.rst:877 msgid "" "If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " "overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" "exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:795 +#: ../../c-api/exceptions.rst:881 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:799 +#: ../../c-api/exceptions.rst:885 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:803 ../../c-api/exceptions.rst:811 -msgid "This function is now also available in the limited API." +#: ../../c-api/exceptions.rst:889 ../../c-api/exceptions.rst:897 +msgid "" +"This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:808 +#: ../../c-api/exceptions.rst:894 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:900 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -855,13 +934,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:822 +#: ../../c-api/exceptions.rst:908 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:825 +#: ../../c-api/exceptions.rst:911 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -869,30 +948,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:831 +#: ../../c-api/exceptions.rst:917 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:835 +#: ../../c-api/exceptions.rst:921 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:840 +#: ../../c-api/exceptions.rst:926 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:847 +#: ../../c-api/exceptions.rst:933 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:935 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -900,451 +979,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:910 ../../c-api/exceptions.rst:1043 -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1174 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:910 ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1174 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:910 ../../c-api/exceptions.rst:1043 -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:1174 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:912 +#: ../../c-api/exceptions.rst:998 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:912 +#: ../../c-api/exceptions.rst:998 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:912 ../../c-api/exceptions.rst:914 -#: ../../c-api/exceptions.rst:916 ../../c-api/exceptions.rst:962 -#: ../../c-api/exceptions.rst:974 +#: ../../c-api/exceptions.rst:998 ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1002 ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1060 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:914 +#: ../../c-api/exceptions.rst:1000 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:914 +#: ../../c-api/exceptions.rst:1000 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:1002 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:1002 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:918 +#: ../../c-api/exceptions.rst:1004 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:918 +#: ../../c-api/exceptions.rst:1004 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:920 +#: ../../c-api/exceptions.rst:1006 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:920 +#: ../../c-api/exceptions.rst:1006 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:1008 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:1008 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:924 +#: ../../c-api/exceptions.rst:1010 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:924 +#: ../../c-api/exceptions.rst:1010 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:1012 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:1012 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:928 +#: ../../c-api/exceptions.rst:1014 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:928 +#: ../../c-api/exceptions.rst:1014 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:930 +#: ../../c-api/exceptions.rst:1016 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:930 +#: ../../c-api/exceptions.rst:1016 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:932 +#: ../../c-api/exceptions.rst:1018 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:932 +#: ../../c-api/exceptions.rst:1018 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:1020 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:1020 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:936 +#: ../../c-api/exceptions.rst:1022 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:936 +#: ../../c-api/exceptions.rst:1022 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:1024 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:1024 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:1026 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:1026 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:942 +#: ../../c-api/exceptions.rst:1028 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:942 +#: ../../c-api/exceptions.rst:1028 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:944 +#: ../../c-api/exceptions.rst:1030 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:944 +#: ../../c-api/exceptions.rst:1030 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:946 +#: ../../c-api/exceptions.rst:1032 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:946 +#: ../../c-api/exceptions.rst:1032 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:948 +#: ../../c-api/exceptions.rst:1034 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:948 +#: ../../c-api/exceptions.rst:1034 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:950 +#: ../../c-api/exceptions.rst:1036 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:950 +#: ../../c-api/exceptions.rst:1036 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:952 +#: ../../c-api/exceptions.rst:1038 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:952 +#: ../../c-api/exceptions.rst:1038 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:954 +#: ../../c-api/exceptions.rst:1040 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:954 +#: ../../c-api/exceptions.rst:1040 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:956 +#: ../../c-api/exceptions.rst:1042 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:956 +#: ../../c-api/exceptions.rst:1042 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:958 +#: ../../c-api/exceptions.rst:1044 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:958 +#: ../../c-api/exceptions.rst:1044 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:960 +#: ../../c-api/exceptions.rst:1046 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:960 +#: ../../c-api/exceptions.rst:1046 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:962 +#: ../../c-api/exceptions.rst:1048 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:962 +#: ../../c-api/exceptions.rst:1048 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:1050 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:1050 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:966 +#: ../../c-api/exceptions.rst:1052 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:966 +#: ../../c-api/exceptions.rst:1052 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:968 +#: ../../c-api/exceptions.rst:1054 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:968 +#: ../../c-api/exceptions.rst:1054 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:970 +#: ../../c-api/exceptions.rst:1056 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:970 +#: ../../c-api/exceptions.rst:1056 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:972 +#: ../../c-api/exceptions.rst:1058 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:972 +#: ../../c-api/exceptions.rst:1058 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:974 +#: ../../c-api/exceptions.rst:1060 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:974 +#: ../../c-api/exceptions.rst:1060 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:976 +#: ../../c-api/exceptions.rst:1062 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:976 +#: ../../c-api/exceptions.rst:1062 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:978 +#: ../../c-api/exceptions.rst:1064 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:978 +#: ../../c-api/exceptions.rst:1064 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:980 +#: ../../c-api/exceptions.rst:1066 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:980 +#: ../../c-api/exceptions.rst:1066 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:982 +#: ../../c-api/exceptions.rst:1068 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:982 +#: ../../c-api/exceptions.rst:1068 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:984 +#: ../../c-api/exceptions.rst:1070 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:984 +#: ../../c-api/exceptions.rst:1070 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:986 +#: ../../c-api/exceptions.rst:1072 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:986 +#: ../../c-api/exceptions.rst:1072 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:988 +#: ../../c-api/exceptions.rst:1074 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:988 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:990 +#: ../../c-api/exceptions.rst:1076 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:990 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:992 +#: ../../c-api/exceptions.rst:1078 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:992 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:994 +#: ../../c-api/exceptions.rst:1080 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:994 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:996 +#: ../../c-api/exceptions.rst:1082 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:996 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:1084 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1086 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1088 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1090 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1090 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1092 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1092 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1094 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1094 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1096 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1096 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1098 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1098 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1100 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1100 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1102 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1102 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1105 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1364,58 +1443,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1115 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1118 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1121 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1131 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1133 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1135 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1135 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1138 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1055 ../../c-api/exceptions.rst:1116 +#: ../../c-api/exceptions.rst:1141 ../../c-api/exceptions.rst:1202 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1144 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1147 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1153 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1155 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1423,393 +1502,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1176 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1176 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1176 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1178 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1178 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1180 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1180 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1182 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1182 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1184 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1184 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1186 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1186 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1188 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1188 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1104 +#: ../../c-api/exceptions.rst:1190 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1104 +#: ../../c-api/exceptions.rst:1190 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1192 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1192 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1108 +#: ../../c-api/exceptions.rst:1194 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1108 +#: ../../c-api/exceptions.rst:1194 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1196 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1196 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1205 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:150 +#: ../../c-api/exceptions.rst:161 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 -#: ../../c-api/exceptions.rst:591 +#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 +#: ../../c-api/exceptions.rst:655 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 -#: ../../c-api/exceptions.rst:591 +#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 +#: ../../c-api/exceptions.rst:655 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 +#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:545 ../../c-api/exceptions.rst:576 -#: ../../c-api/exceptions.rst:591 +#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 +#: ../../c-api/exceptions.rst:655 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:854 +#: ../../c-api/exceptions.rst:940 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1123 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1123 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1123 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1160 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/frame.po b/c-api/frame.po index eac5123f52..a3847b001a 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-23 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -87,7 +87,7 @@ msgstr "" msgid "Get the *frame* code." msgstr "" -#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:104 +#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:125 msgid "Return a :term:`strong reference`." msgstr "" @@ -119,9 +119,61 @@ msgid "Returns -1 if ``frame.f_lasti`` is ``None``." msgstr "" #: ../../c-api/frame.rst:102 +msgid "Get the variable *name* of *frame*." +msgstr "" + +#: ../../c-api/frame.rst:104 +msgid "Return a :term:`strong reference` to the variable value on success." +msgstr "" + +#: ../../c-api/frame.rst:105 +msgid "" +"Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." +msgstr "" + +#: ../../c-api/frame.rst:106 +msgid "Raise an exception and return ``NULL`` on error." +msgstr "" + +#: ../../c-api/frame.rst:108 +msgid "*name* type must be a :class:`str`." +msgstr "" + +#: ../../c-api/frame.rst:115 +msgid "" +"Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " +"encoded in UTF-8." +msgstr "" + +#: ../../c-api/frame.rst:123 msgid "Get the *frame*'s ``f_locals`` attribute (:class:`dict`)." msgstr "" -#: ../../c-api/frame.rst:111 +#: ../../c-api/frame.rst:132 msgid "Return the line number that *frame* is currently executing." msgstr "" + +#: ../../c-api/frame.rst:137 +msgid "Internal Frames" +msgstr "" + +#: ../../c-api/frame.rst:139 +msgid "Unless using :pep:`523`, you will not need this." +msgstr "" + +#: ../../c-api/frame.rst:143 +msgid "The interpreter's internal frame representation." +msgstr "" + +#: ../../c-api/frame.rst:149 +msgid "Return a :term:`strong reference` to the code object for the frame." +msgstr "" + +#: ../../c-api/frame.rst:156 +msgid "Return the byte offset into the last executed instruction." +msgstr "" + +#: ../../c-api/frame.rst:163 +msgid "" +"Return the currently executing line number, or -1 if there is no line number." +msgstr "" diff --git a/c-api/function.po b/c-api/function.po index 5f74d6ab78..b5179761a8 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-11-12 15:45+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -120,12 +120,23 @@ msgid "" msgstr "" "設定函式物件 *op* 的引數預設值。*defaults* 必須是 ``Py_None`` 或一個 tuple。" -#: ../../c-api/function.rst:83 ../../c-api/function.rst:97 -#: ../../c-api/function.rst:111 +#: ../../c-api/function.rst:83 ../../c-api/function.rst:106 +#: ../../c-api/function.rst:120 msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." msgstr "引發 :exc:`SystemError` 且在失敗時回傳 ``-1``。" #: ../../c-api/function.rst:88 +#, fuzzy +msgid "Set the vectorcall field of a given function object *func*." +msgstr "回傳與程式碼物件相關的函式物件 *op*。" + +#: ../../c-api/function.rst:90 +msgid "" +"Warning: extensions using this API must preserve the behavior of the " +"unaltered (default) vectorcall function!" +msgstr "" + +#: ../../c-api/function.rst:97 msgid "" "Return the closure associated with the function object *op*. This can be " "``NULL`` or a tuple of cell objects." @@ -133,7 +144,7 @@ msgstr "" "回傳與函式物件 *op* 相關聯的閉包,這可以是個 ``NULL`` 或是一個包含 cell 物件" "的 tuple。" -#: ../../c-api/function.rst:94 +#: ../../c-api/function.rst:103 msgid "" "Set the closure associated with the function object *op*. *closure* must be " "``Py_None`` or a tuple of cell objects." @@ -141,19 +152,97 @@ msgstr "" "設定與函式物件 *op* 相關聯的閉包,*closure* 必須是 ``Py_None`` 或是一個包含 " "cell 物件的 tuple。" -#: ../../c-api/function.rst:102 +#: ../../c-api/function.rst:111 msgid "" "Return the annotations of the function object *op*. This can be a mutable " "dictionary or ``NULL``." msgstr "" "回傳函式物件 *op* 的標註,這可以是一個可變動的 (mutable) 字典或 ``NULL``。" -#: ../../c-api/function.rst:108 +#: ../../c-api/function.rst:117 msgid "" "Set the annotations for the function object *op*. *annotations* must be a " "dictionary or ``Py_None``." msgstr "設定函式物件 *op* 的標註,*annotations* 必須是一個字典或 ``Py_None``。" +#: ../../c-api/function.rst:125 +msgid "" +"Register *callback* as a function watcher for the current interpreter. " +"Return an ID which may be passed to :c:func:`PyFunction_ClearWatcher`. In " +"case of error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +#: ../../c-api/function.rst:135 +msgid "" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyFunction_AddWatcher` for the current interpreter. Return ``0`` on " +"success, or ``-1`` and set an exception on error (e.g. if the given " +"*watcher_id* was never registered.)" +msgstr "" + +#: ../../c-api/function.rst:145 +msgid "" +"Enumeration of possible function watcher events: - " +"``PyFunction_EVENT_CREATE`` - ``PyFunction_EVENT_DESTROY`` - " +"``PyFunction_EVENT_MODIFY_CODE`` - ``PyFunction_EVENT_MODIFY_DEFAULTS`` - " +"``PyFunction_EVENT_MODIFY_KWDEFAULTS``" +msgstr "" + +#: ../../c-api/function.rst:157 +msgid "Type of a function watcher callback function." +msgstr "" + +#: ../../c-api/function.rst:159 +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE`` or ``PyFunction_EVENT_DESTROY`` " +"then *new_value* will be ``NULL``. Otherwise, *new_value* will hold a :term:" +"`borrowed reference` to the new value that is about to be stored in *func* " +"for the attribute that is being modified." +msgstr "" + +#: ../../c-api/function.rst:164 +msgid "" +"The callback may inspect but must not modify *func*; doing so could have " +"unpredictable effects, including infinite recursion." +msgstr "" + +#: ../../c-api/function.rst:167 +msgid "" +"If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " +"after `func` has been fully initialized. Otherwise, the callback is invoked " +"before the modification to *func* takes place, so the prior state of *func* " +"can be inspected. The runtime is permitted to optimize away the creation of " +"function objects when possible. In such cases no event will be emitted. " +"Although this creates the possibility of an observable difference of runtime " +"behavior depending on optimization decisions, it does not change the " +"semantics of the Python code being executed." +msgstr "" + +#: ../../c-api/function.rst:176 +msgid "" +"If *event* is ``PyFunction_EVENT_DESTROY``, Taking a reference in the " +"callback to the about-to-be-destroyed function will resurrect it, preventing " +"it from being freed at this time. When the resurrected object is destroyed " +"later, any watcher callbacks active at that time will be called again." +msgstr "" + +#: ../../c-api/function.rst:181 +msgid "" +"If the callback sets an exception, it must return ``-1``; this exception " +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +msgstr "" + +#: ../../c-api/function.rst:185 +msgid "" +"There may already be a pending exception set on entry to the callback. In " +"this case, the callback should return ``0`` with the same exception still " +"set. This means the callback may not call any other API that can set an " +"exception unless it saves and clears the exception state first, and restores " +"it before returning." +msgstr "" + #: ../../c-api/function.rst:8 msgid "object" msgstr "object(物件)" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index b72a71fa7d..b0340c8cdd 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-29 00:08+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,11 +25,11 @@ msgstr "" #: ../../c-api/gcsupport.rst:8 msgid "" "Python's support for detecting and collecting garbage which involves " -"circular references requires support from object types which are \"containers" -"\" for other objects which may also be containers. Types which do not store " -"references to other objects, or which only store references to atomic types " -"(such as numbers or strings), do not need to provide any explicit support " -"for garbage collection." +"circular references requires support from object types which are " +"\"containers\" for other objects which may also be containers. Types which " +"do not store references to other objects, or which only store references to " +"atomic types (such as numbers or strings), do not need to provide any " +"explicit support for garbage collection." msgstr "" #: ../../c-api/gcsupport.rst:15 @@ -105,20 +105,42 @@ msgid "" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:65 +#: ../../c-api/gcsupport.rst:64 msgid "" "Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" "const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:71 +#: ../../c-api/gcsupport.rst:69 +msgid "" +"Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size* bytes at " +"the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " +"The allocated memory is initialized to zeros, except for the :c:type:`Python " +"object header `." +msgstr "" + +#: ../../c-api/gcsupport.rst:75 +msgid "" +"The extra data will be deallocated with the object, but otherwise it is not " +"managed by Python." +msgstr "" + +#: ../../c-api/gcsupport.rst:79 +msgid "" +"The function is marked as unstable because the final mechanism for reserving " +"extra data after an instance is not yet decided. For allocating a variable " +"number of fields, prefer using :c:type:`PyVarObject` and :c:member:" +"`~PyTypeObject.tp_itemsize` instead." +msgstr "" + +#: ../../c-api/gcsupport.rst:90 msgid "" "Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" -#: ../../c-api/gcsupport.rst:77 +#: ../../c-api/gcsupport.rst:96 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -127,45 +149,45 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:86 +#: ../../c-api/gcsupport.rst:105 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:89 +#: ../../c-api/gcsupport.rst:108 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:94 +#: ../../c-api/gcsupport.rst:113 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:97 +#: ../../c-api/gcsupport.rst:116 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:104 +#: ../../c-api/gcsupport.rst:123 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:107 +#: ../../c-api/gcsupport.rst:126 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:114 +#: ../../c-api/gcsupport.rst:133 msgid "" "Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" "func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:120 +#: ../../c-api/gcsupport.rst:139 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -175,19 +197,19 @@ msgid "" "handler become invalid." msgstr "" -#: ../../c-api/gcsupport.rst:129 +#: ../../c-api/gcsupport.rst:148 msgid "" "The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" -#: ../../c-api/gcsupport.rst:132 +#: ../../c-api/gcsupport.rst:151 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" msgstr "" -#: ../../c-api/gcsupport.rst:137 +#: ../../c-api/gcsupport.rst:156 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -197,13 +219,13 @@ msgid "" "users will need to write their own visitor functions." msgstr "" -#: ../../c-api/gcsupport.rst:144 +#: ../../c-api/gcsupport.rst:163 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" msgstr "" -#: ../../c-api/gcsupport.rst:149 +#: ../../c-api/gcsupport.rst:168 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -213,7 +235,7 @@ msgid "" "returned immediately." msgstr "" -#: ../../c-api/gcsupport.rst:156 +#: ../../c-api/gcsupport.rst:175 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -221,20 +243,20 @@ msgid "" "exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:163 +#: ../../c-api/gcsupport.rst:182 msgid "" "If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " "*arg*. If *visit* returns a non-zero value, then return it. Using this " "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" -#: ../../c-api/gcsupport.rst:176 +#: ../../c-api/gcsupport.rst:195 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" -#: ../../c-api/gcsupport.rst:182 +#: ../../c-api/gcsupport.rst:201 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -244,23 +266,23 @@ msgid "" "in a reference cycle." msgstr "" -#: ../../c-api/gcsupport.rst:191 +#: ../../c-api/gcsupport.rst:210 msgid "Controlling the Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:193 +#: ../../c-api/gcsupport.rst:212 msgid "" "The C-API provides the following functions for controlling garbage " "collection runs." msgstr "" -#: ../../c-api/gcsupport.rst:198 +#: ../../c-api/gcsupport.rst:217 msgid "" "Perform a full garbage collection, if the garbage collector is enabled. " "(Note that :func:`gc.collect` runs it unconditionally.)" msgstr "" -#: ../../c-api/gcsupport.rst:201 +#: ../../c-api/gcsupport.rst:220 msgid "" "Returns the number of collected + unreachable objects which cannot be " "collected. If the garbage collector is disabled or already collecting, " @@ -268,20 +290,58 @@ msgid "" "data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" -#: ../../c-api/gcsupport.rst:211 +#: ../../c-api/gcsupport.rst:230 msgid "" "Enable the garbage collector: similar to :func:`gc.enable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:219 +#: ../../c-api/gcsupport.rst:238 msgid "" "Disable the garbage collector: similar to :func:`gc.disable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:227 +#: ../../c-api/gcsupport.rst:246 msgid "" "Query the state of the garbage collector: similar to :func:`gc.isenabled`. " "Returns the current state, 0 for disabled and 1 for enabled." msgstr "" + +#: ../../c-api/gcsupport.rst:253 +msgid "Querying Garbage Collector State" +msgstr "" + +#: ../../c-api/gcsupport.rst:255 +msgid "" +"The C-API provides the following interface for querying information about " +"the garbage collector." +msgstr "" + +#: ../../c-api/gcsupport.rst:260 +msgid "" +"Run supplied *callback* on all live GC-capable objects. *arg* is passed " +"through to all invocations of *callback*." +msgstr "" + +#: ../../c-api/gcsupport.rst:264 +msgid "" +"If new objects are (de)allocated by the callback it is undefined if they " +"will be visited." +msgstr "" + +#: ../../c-api/gcsupport.rst:267 +msgid "" +"Garbage collection is disabled during operation. Explicitly running a " +"collection in the callback may lead to undefined behaviour e.g. visiting the " +"same objects multiple times or not at all." +msgstr "" + +#: ../../c-api/gcsupport.rst:275 +msgid "" +"Type of the visitor function to be passed to :c:func:" +"`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " +"``PyUnstable_GC_VisitObjects``. Return ``0`` to continue iteration, return " +"``1`` to stop iteration. Other return values are reserved for now so " +"behavior on returning anything else is undefined." +msgstr "" diff --git a/c-api/import.po b/c-api/import.po index 7ebef9c479..da7fc7d292 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -175,24 +175,36 @@ msgid "" "`PyImport_ExecCodeModuleWithPathnames`." msgstr "" -#: ../../c-api/import.rst:156 +#: ../../c-api/import.rst:153 +msgid "" +"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :" +"class:`~importlib.machinery.ModuleSpec` for alternatives." +msgstr "" + +#: ../../c-api/import.rst:161 msgid "" "Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " "of the module object is set to *pathname* if it is non-``NULL``." msgstr "" -#: ../../c-api/import.rst:159 +#: ../../c-api/import.rst:164 msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr "也請見 :c:func:`PyImport_ExecCodeModuleWithPathnames`\\ 。" -#: ../../c-api/import.rst:164 +#: ../../c-api/import.rst:169 msgid "" "Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" -#: ../../c-api/import.rst:173 +#: ../../c-api/import.rst:175 +msgid "" +"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery." +"ModuleSpec` for alternatives." +msgstr "" + +#: ../../c-api/import.rst:182 msgid "" "Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " "*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " @@ -200,44 +212,48 @@ msgid "" "set to ``NULL``." msgstr "" -#: ../../c-api/import.rst:179 +#: ../../c-api/import.rst:188 msgid "" -"Uses :func:`imp.source_from_cache()` in calculating the source path if only " +"Uses :func:`!imp.source_from_cache()` in calculating the source path if only " "the bytecode path is provided." msgstr "" -#: ../../c-api/import.rst:186 +#: ../../c-api/import.rst:191 +msgid "No longer uses the removed :mod:`!imp` module." +msgstr "" + +#: ../../c-api/import.rst:197 msgid "" "Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` " "file). The magic number should be present in the first four bytes of the " "bytecode file, in little-endian byte order. Returns ``-1`` on error." msgstr "" -#: ../../c-api/import.rst:190 +#: ../../c-api/import.rst:201 msgid "Return value of ``-1`` upon failure." msgstr "當失敗時回傳 ``-1``。" -#: ../../c-api/import.rst:196 +#: ../../c-api/import.rst:207 msgid "" "Return the magic tag string for :pep:`3147` format Python bytecode file " "names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " "authoritative and should be used instead of this function." msgstr "" -#: ../../c-api/import.rst:204 +#: ../../c-api/import.rst:215 msgid "" "Return the dictionary used for the module administration (a.k.a. ``sys." "modules``). Note that this is a per-interpreter variable." msgstr "" -#: ../../c-api/import.rst:209 +#: ../../c-api/import.rst:220 msgid "" "Return the already imported module with the given name. If the module has " "not been imported yet then returns ``NULL`` but does not set an error. " "Returns ``NULL`` and sets an error if the lookup failed." msgstr "" -#: ../../c-api/import.rst:217 +#: ../../c-api/import.rst:228 msgid "" "Return a finder object for a :data:`sys.path`/:attr:`pkg.__path__` item " "*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " @@ -248,7 +264,7 @@ msgid "" "path_importer_cache`. Return a new reference to the finder object." msgstr "" -#: ../../c-api/import.rst:228 +#: ../../c-api/import.rst:239 msgid "" "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " "module is not found, and ``-1`` with an exception set if the initialization " @@ -257,17 +273,17 @@ msgid "" "the module if it was already imported.)" msgstr "" -#: ../../c-api/import.rst:236 +#: ../../c-api/import.rst:247 msgid "The ``__file__`` attribute is no longer set on the module." msgstr "" -#: ../../c-api/import.rst:242 +#: ../../c-api/import.rst:253 msgid "" "Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." msgstr "" -#: ../../c-api/import.rst:250 +#: ../../c-api/import.rst:261 msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the " @@ -275,13 +291,13 @@ msgid "" "h`, is::" msgstr "" -#: ../../c-api/import.rst:262 +#: ../../c-api/import.rst:273 msgid "" "The new ``is_package`` field indicates whether the module is a package or " "not. This replaces setting the ``size`` field to a negative value." msgstr "" -#: ../../c-api/import.rst:268 +#: ../../c-api/import.rst:279 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -290,7 +306,7 @@ msgid "" "frozen modules." msgstr "" -#: ../../c-api/import.rst:276 +#: ../../c-api/import.rst:287 msgid "" "Add a single module to the existing table of built-in modules. This is a " "convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " @@ -300,7 +316,7 @@ msgid "" "before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/import.rst:286 +#: ../../c-api/import.rst:297 msgid "" "Structure describing a single entry in the list of built-in modules. Each " "of these structures gives the name and initialization function for a module " @@ -310,7 +326,7 @@ msgid "" "structure is defined in :file:`Include/import.h` as::" msgstr "" -#: ../../c-api/import.rst:301 +#: ../../c-api/import.rst:312 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " "array must end with a sentinel entry which contains ``NULL`` for the :attr:" @@ -321,7 +337,7 @@ msgid "" "`Py_Initialize`." msgstr "" -#: ../../c-api/import.rst:308 +#: ../../c-api/import.rst:319 msgid "" "If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " "or :c:func:`PyImport_ExtendInittab` must be called before each Python " @@ -356,6 +372,6 @@ msgstr "__import__" msgid "compile" msgstr "compile(編譯)" -#: ../../c-api/import.rst:248 +#: ../../c-api/import.rst:259 msgid "freeze utility" msgstr "freeze utility(凍結工具)" diff --git a/c-api/init.po b/c-api/init.po index 0d787b5573..ba68de5e17 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -195,108 +195,178 @@ msgstr "" #: ../../c-api/init.rst:86 msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"bytes_warning` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:90 +msgid "" "Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" "class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " "or equal to ``2``." msgstr "" -#: ../../c-api/init.rst:90 +#: ../../c-api/init.rst:94 msgid "Set by the :option:`-b` option." msgstr "由 :option:`-b` 選項設定。" -#: ../../c-api/init.rst:94 +#: ../../c-api/init.rst:100 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"parser_debug` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:104 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." msgstr "" -#: ../../c-api/init.rst:97 +#: ../../c-api/init.rst:107 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" -#: ../../c-api/init.rst:102 +#: ../../c-api/init.rst:114 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"write_bytecode` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:118 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" -#: ../../c-api/init.rst:105 +#: ../../c-api/init.rst:121 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" "由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。" -#: ../../c-api/init.rst:110 +#: ../../c-api/init.rst:128 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"pathconfig_warnings` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:132 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." msgstr "" -#: ../../c-api/init.rst:113 +#: ../../c-api/init.rst:135 msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" -#: ../../c-api/init.rst:117 +#: ../../c-api/init.rst:141 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " +"see :ref:`Python Initialization Configuration `." +msgstr "" + +#: ../../c-api/init.rst:146 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" "如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。" -#: ../../c-api/init.rst:120 +#: ../../c-api/init.rst:149 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" -#: ../../c-api/init.rst:125 +#: ../../c-api/init.rst:156 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"use_environment` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:160 msgid "" "Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" -#: ../../c-api/init.rst:128 +#: ../../c-api/init.rst:163 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" -#: ../../c-api/init.rst:132 +#: ../../c-api/init.rst:169 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"inspect` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:173 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " "when :data:`sys.stdin` does not appear to be a terminal." msgstr "" -#: ../../c-api/init.rst:136 +#: ../../c-api/init.rst:177 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。" -#: ../../c-api/init.rst:141 +#: ../../c-api/init.rst:184 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"interactive` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:188 msgid "Set by the :option:`-i` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:145 +#: ../../c-api/init.rst:194 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"isolated` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:198 msgid "" "Run Python in isolated mode. In isolated mode :data:`sys.path` contains " "neither the script's directory nor the user's site-packages directory." msgstr "" -#: ../../c-api/init.rst:148 +#: ../../c-api/init.rst:201 msgid "Set by the :option:`-I` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:154 +#: ../../c-api/init.rst:209 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " +"Initialization Configuration `." +msgstr "" + +#: ../../c-api/init.rst:213 msgid "" "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " "handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " "for the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/init.rst:158 +#: ../../c-api/init.rst:217 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." @@ -304,31 +374,45 @@ msgstr "" "如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設" "為 ``1``。" -#: ../../c-api/init.rst:161 +#: ../../c-api/init.rst:220 msgid "See :pep:`529` for more details." msgstr "更多詳情請見 :pep:`529`\\ 。" -#: ../../c-api/init.rst:163 ../../c-api/init.rst:175 +#: ../../c-api/init.rst:222 ../../c-api/init.rst:240 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/init.rst:167 +#: ../../c-api/init.rst:228 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"legacy_windows_stdio` should be used instead, see :ref:`Python " +"Initialization Configuration `." +msgstr "" + +#: ../../c-api/init.rst:232 msgid "" "If the flag is non-zero, use :class:`io.FileIO` instead of :class:" "`WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" -#: ../../c-api/init.rst:170 +#: ../../c-api/init.rst:235 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init.rst:173 +#: ../../c-api/init.rst:238 msgid "See :pep:`528` for more details." msgstr "更多詳情請見 :pep:`528`\\ 。" -#: ../../c-api/init.rst:179 +#: ../../c-api/init.rst:246 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"site_import` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:250 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -336,17 +420,24 @@ msgid "" "main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init.rst:184 +#: ../../c-api/init.rst:255 msgid "Set by the :option:`-S` option." msgstr "由 :option:`-S` 選項設定。" -#: ../../c-api/init.rst:188 +#: ../../c-api/init.rst:261 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"user_site_directory` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:265 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" -#: ../../c-api/init.rst:191 +#: ../../c-api/init.rst:268 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." @@ -354,32 +445,60 @@ msgstr "" "由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" -#: ../../c-api/init.rst:196 +#: ../../c-api/init.rst:275 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"optimization_level` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:279 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。" -#: ../../c-api/init.rst:201 +#: ../../c-api/init.rst:286 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"quiet` should be used instead, see :ref:`Python Initialization Configuration " +"`." +msgstr "" + +#: ../../c-api/init.rst:290 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -#: ../../c-api/init.rst:203 +#: ../../c-api/init.rst:292 msgid "Set by the :option:`-q` option." msgstr "由 :option:`-q` 選項設定。" -#: ../../c-api/init.rst:209 +#: ../../c-api/init.rst:300 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"buffered_stdio` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:304 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "" -#: ../../c-api/init.rst:211 +#: ../../c-api/init.rst:306 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。" -#: ../../c-api/init.rst:216 +#: ../../c-api/init.rst:313 +msgid "" +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"verbose` should be used instead, see :ref:`Python Initialization " +"Configuration `." +msgstr "" + +#: ../../c-api/init.rst:317 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. If greater or equal " @@ -387,24 +506,24 @@ msgid "" "for a module. Also provides information on module cleanup at exit." msgstr "" -#: ../../c-api/init.rst:221 +#: ../../c-api/init.rst:322 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。" -#: ../../c-api/init.rst:226 +#: ../../c-api/init.rst:329 msgid "Initializing and finalizing the interpreter" msgstr "" -#: ../../c-api/init.rst:244 +#: ../../c-api/init.rst:347 msgid "" "Initialize the Python interpreter. In an application embedding Python, " "this should be called before using any other Python/C API functions; see :" "ref:`Before Python Initialization ` for the few exceptions." msgstr "" -#: ../../c-api/init.rst:248 +#: ../../c-api/init.rst:351 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " "the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " @@ -414,27 +533,33 @@ msgid "" "There is no return value; it is a fatal error if the initialization fails." msgstr "" -#: ../../c-api/init.rst:257 +#: ../../c-api/init.rst:359 ../../c-api/init.rst:373 +msgid "" +"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:" +"`Python Initialization Configuration `." +msgstr "" + +#: ../../c-api/init.rst:363 msgid "" "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " "will also affect non-Python uses of the console using the C Runtime." msgstr "" -#: ../../c-api/init.rst:263 +#: ../../c-api/init.rst:369 msgid "" "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " "*initsigs* is ``0``, it skips initialization registration of signal " "handlers, which might be useful when Python is embedded." msgstr "" -#: ../../c-api/init.rst:270 +#: ../../c-api/init.rst:379 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " "false until :c:func:`Py_Initialize` is called again." msgstr "" -#: ../../c-api/init.rst:277 +#: ../../c-api/init.rst:386 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " "of Python/C API functions, and destroy all sub-interpreters (see :c:func:" @@ -446,7 +571,7 @@ msgid "" "(flushing buffered data), ``-1`` is returned." msgstr "" -#: ../../c-api/init.rst:286 +#: ../../c-api/init.rst:395 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -457,7 +582,7 @@ msgid "" "Python before exiting from the application." msgstr "" -#: ../../c-api/init.rst:294 +#: ../../c-api/init.rst:403 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`__del__` methods) " @@ -472,7 +597,7 @@ msgid "" "than once." msgstr "" -#: ../../c-api/init.rst:305 +#: ../../c-api/init.rst:414 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -480,68 +605,68 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "_PySys_ClearAuditHooks``。" -#: ../../c-api/init.rst:311 +#: ../../c-api/init.rst:420 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" -#: ../../c-api/init.rst:316 +#: ../../c-api/init.rst:425 msgid "Process-wide parameters" msgstr "" -#: ../../c-api/init.rst:326 +#: ../../c-api/init.rst:435 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors` should be used " "instead, see :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:331 +#: ../../c-api/init.rst:440 msgid "" "This function should be called before :c:func:`Py_Initialize`, if it is " "called at all. It specifies which encoding and error handling to use with " "standard IO, with the same meanings as in :func:`str.encode`." msgstr "" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:444 msgid "" "It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to " "control IO encoding when the environment variable does not work." msgstr "" -#: ../../c-api/init.rst:338 +#: ../../c-api/init.rst:447 msgid "" "*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` " "and/or default values (depending on other settings)." msgstr "" -#: ../../c-api/init.rst:342 +#: ../../c-api/init.rst:451 msgid "" "Note that :data:`sys.stderr` always uses the \"backslashreplace\" error " "handler, regardless of this (or any other) setting." msgstr "" -#: ../../c-api/init.rst:345 +#: ../../c-api/init.rst:454 msgid "" "If :c:func:`Py_FinalizeEx` is called, this function will need to be called " "again in order to affect subsequent calls to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:348 +#: ../../c-api/init.rst:457 msgid "" "Returns ``0`` if successful, a nonzero value on error (e.g. calling after " "the interpreter has already been initialized)." msgstr "" -#: ../../c-api/init.rst:363 +#: ../../c-api/init.rst:472 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:367 +#: ../../c-api/init.rst:476 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -555,33 +680,33 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:378 ../../c-api/init.rst:529 ../../c-api/init.rst:644 -#: ../../c-api/init.rst:680 ../../c-api/init.rst:706 +#: ../../c-api/init.rst:487 ../../c-api/init.rst:638 ../../c-api/init.rst:753 +#: ../../c-api/init.rst:789 ../../c-api/init.rst:815 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" -#: ../../c-api/init.rst:388 +#: ../../c-api/init.rst:497 msgid "" "Return the program name set with :c:func:`Py_SetProgramName`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: ../../c-api/init.rst:392 ../../c-api/init.rst:411 ../../c-api/init.rst:452 -#: ../../c-api/init.rst:471 ../../c-api/init.rst:495 ../../c-api/init.rst:718 +#: ../../c-api/init.rst:501 ../../c-api/init.rst:520 ../../c-api/init.rst:561 +#: ../../c-api/init.rst:580 ../../c-api/init.rst:604 ../../c-api/init.rst:827 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "" -#: ../../c-api/init.rst:395 ../../c-api/init.rst:414 ../../c-api/init.rst:455 -#: ../../c-api/init.rst:474 ../../c-api/init.rst:500 ../../c-api/init.rst:721 +#: ../../c-api/init.rst:504 ../../c-api/init.rst:523 ../../c-api/init.rst:564 +#: ../../c-api/init.rst:583 ../../c-api/init.rst:609 ../../c-api/init.rst:830 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:401 +#: ../../c-api/init.rst:510 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -595,7 +720,7 @@ msgid "" "also the next function." msgstr "" -#: ../../c-api/init.rst:420 +#: ../../c-api/init.rst:529 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -609,7 +734,7 @@ msgid "" "on Unix." msgstr "" -#: ../../c-api/init.rst:430 +#: ../../c-api/init.rst:539 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -618,7 +743,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:436 +#: ../../c-api/init.rst:545 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -632,7 +757,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:447 +#: ../../c-api/init.rst:556 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -640,7 +765,7 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:465 +#: ../../c-api/init.rst:574 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -649,7 +774,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:485 +#: ../../c-api/init.rst:594 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:func:`Py_SetProgramName` above) and some environment " @@ -662,7 +787,7 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:511 +#: ../../c-api/init.rst:620 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -670,7 +795,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:516 +#: ../../c-api/init.rst:625 msgid "" "Set the default module search path. If this function is called before :c:" "func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a " @@ -681,7 +806,7 @@ msgid "" "on Windows." msgstr "" -#: ../../c-api/init.rst:524 +#: ../../c-api/init.rst:633 msgid "" "This also causes :data:`sys.executable` to be set to the program full path " "(see :c:func:`Py_GetProgramFullPath`) and for :data:`sys.prefix` and :data:" @@ -689,25 +814,25 @@ msgid "" "required after calling :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:532 +#: ../../c-api/init.rst:641 msgid "" "The path argument is copied internally, so the caller may free it after the " "call completes." msgstr "" -#: ../../c-api/init.rst:535 +#: ../../c-api/init.rst:644 msgid "" "The program full path is now used for :data:`sys.executable`, instead of the " "program name." msgstr "" -#: ../../c-api/init.rst:544 +#: ../../c-api/init.rst:653 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: ../../c-api/init.rst:551 +#: ../../c-api/init.rst:660 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -716,11 +841,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:556 +#: ../../c-api/init.rst:665 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:563 +#: ../../c-api/init.rst:672 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -731,42 +856,42 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:574 +#: ../../c-api/init.rst:683 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: ../../c-api/init.rst:576 +#: ../../c-api/init.rst:685 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:580 +#: ../../c-api/init.rst:689 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:586 +#: ../../c-api/init.rst:695 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: ../../c-api/init.rst:593 ../../c-api/init.rst:607 +#: ../../c-api/init.rst:702 ../../c-api/init.rst:716 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:600 +#: ../../c-api/init.rst:709 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: ../../c-api/init.rst:619 +#: ../../c-api/init.rst:728 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -774,7 +899,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:624 +#: ../../c-api/init.rst:733 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -785,34 +910,34 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:632 +#: ../../c-api/init.rst:741 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: ../../c-api/init.rst:636 +#: ../../c-api/init.rst:745 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:639 +#: ../../c-api/init.rst:748 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:647 ../../c-api/init.rst:683 +#: ../../c-api/init.rst:756 ../../c-api/init.rst:792 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:651 +#: ../../c-api/init.rst:760 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " @@ -820,46 +945,46 @@ msgid "" "`_." msgstr "" -#: ../../c-api/init.rst:656 +#: ../../c-api/init.rst:765 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:672 +#: ../../c-api/init.rst:781 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:676 +#: ../../c-api/init.rst:785 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:686 +#: ../../c-api/init.rst:795 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:693 +#: ../../c-api/init.rst:802 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:697 +#: ../../c-api/init.rst:806 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:701 +#: ../../c-api/init.rst:810 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -867,18 +992,18 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:714 +#: ../../c-api/init.rst:823 msgid "" "Return the default \"home\", that is, the value set by a previous call to :c:" "func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` " "environment variable if it is set." msgstr "" -#: ../../c-api/init.rst:728 +#: ../../c-api/init.rst:837 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:735 +#: ../../c-api/init.rst:844 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -890,7 +1015,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:745 +#: ../../c-api/init.rst:854 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -900,7 +1025,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:756 +#: ../../c-api/init.rst:865 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -908,32 +1033,32 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:762 +#: ../../c-api/init.rst:871 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:764 +#: ../../c-api/init.rst:873 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:773 +#: ../../c-api/init.rst:882 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:783 +#: ../../c-api/init.rst:892 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:787 +#: ../../c-api/init.rst:896 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:908 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -944,7 +1069,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:808 +#: ../../c-api/init.rst:917 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -954,11 +1079,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:819 +#: ../../c-api/init.rst:928 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:821 +#: ../../c-api/init.rst:930 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -968,7 +1093,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:828 +#: ../../c-api/init.rst:937 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -979,14 +1104,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:836 +#: ../../c-api/init.rst:945 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:850 +#: ../../c-api/init.rst:959 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -995,11 +1120,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:860 +#: ../../c-api/init.rst:969 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:862 +#: ../../c-api/init.rst:971 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1008,7 +1133,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:868 +#: ../../c-api/init.rst:977 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1025,7 +1150,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:883 +#: ../../c-api/init.rst:992 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1038,17 +1163,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:896 +#: ../../c-api/init.rst:1005 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:898 +#: ../../c-api/init.rst:1007 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:903 +#: ../../c-api/init.rst:1012 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1056,7 +1181,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:908 +#: ../../c-api/init.rst:1017 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1064,49 +1189,49 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:916 +#: ../../c-api/init.rst:1025 msgid "" "This data structure represents the state of a single thread. The only " "public data member is :attr:`interp` (:c:expr:`PyInterpreterState *`), which " "points to this thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:929 +#: ../../c-api/init.rst:1038 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:931 +#: ../../c-api/init.rst:1040 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:933 +#: ../../c-api/init.rst:1042 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:936 +#: ../../c-api/init.rst:1045 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:940 +#: ../../c-api/init.rst:1049 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:950 +#: ../../c-api/init.rst:1059 msgid "" "Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. " "This function can be called without holding the GIL, and therefore can be " "used to avoid calls to the locking API when running single-threaded." msgstr "" -#: ../../c-api/init.rst:954 +#: ../../c-api/init.rst:1063 msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" -#: ../../c-api/init.rst:962 +#: ../../c-api/init.rst:1071 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1114,7 +1239,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:970 +#: ../../c-api/init.rst:1079 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1122,8 +1247,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:976 ../../c-api/init.rst:1022 ../../c-api/init.rst:1304 -#: ../../c-api/init.rst:1342 +#: ../../c-api/init.rst:1085 ../../c-api/init.rst:1131 +#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1451 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1132,27 +1257,27 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:984 +#: ../../c-api/init.rst:1093 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:991 +#: ../../c-api/init.rst:1100 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:996 +#: ../../c-api/init.rst:1105 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1001 +#: ../../c-api/init.rst:1110 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1165,7 +1290,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1011 +#: ../../c-api/init.rst:1120 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1175,13 +1300,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1018 +#: ../../c-api/init.rst:1127 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1030 +#: ../../c-api/init.rst:1139 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1189,13 +1314,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1035 +#: ../../c-api/init.rst:1144 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1041 +#: ../../c-api/init.rst:1150 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1203,7 +1328,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1049 +#: ../../c-api/init.rst:1158 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1214,13 +1339,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1061 +#: ../../c-api/init.rst:1170 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1067 +#: ../../c-api/init.rst:1176 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1228,7 +1353,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1075 +#: ../../c-api/init.rst:1184 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1236,40 +1361,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1083 +#: ../../c-api/init.rst:1192 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1089 +#: ../../c-api/init.rst:1198 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1095 +#: ../../c-api/init.rst:1204 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1097 +#: ../../c-api/init.rst:1206 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1099 +#: ../../c-api/init.rst:1208 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1105 +#: ../../c-api/init.rst:1214 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1109 +#: ../../c-api/init.rst:1218 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1277,13 +1402,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:1223 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1117 +#: ../../c-api/init.rst:1226 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1291,40 +1416,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1122 +#: ../../c-api/init.rst:1231 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1129 +#: ../../c-api/init.rst:1238 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1136 +#: ../../c-api/init.rst:1245 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1139 +#: ../../c-api/init.rst:1248 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1146 +#: ../../c-api/init.rst:1255 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1153 +#: ../../c-api/init.rst:1262 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " @@ -1332,119 +1457,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1161 +#: ../../c-api/init.rst:1270 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1163 +#: ../../c-api/init.rst:1272 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1166 +#: ../../c-api/init.rst:1275 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`\\ 。" -#: ../../c-api/init.rst:1168 ../../c-api/init.rst:1177 -#: ../../c-api/init.rst:1186 +#: ../../c-api/init.rst:1277 ../../c-api/init.rst:1286 +#: ../../c-api/init.rst:1295 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1175 +#: ../../c-api/init.rst:1284 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1184 +#: ../../c-api/init.rst:1293 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1193 +#: ../../c-api/init.rst:1302 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1195 +#: ../../c-api/init.rst:1304 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1202 +#: ../../c-api/init.rst:1311 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1205 +#: ../../c-api/init.rst:1314 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:1322 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1215 +#: ../../c-api/init.rst:1324 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1218 ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1327 ../../c-api/init.rst:1337 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1225 +#: ../../c-api/init.rst:1334 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1235 +#: ../../c-api/init.rst:1344 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1239 +#: ../../c-api/init.rst:1348 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1246 +#: ../../c-api/init.rst:1355 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1248 +#: ../../c-api/init.rst:1357 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1251 +#: ../../c-api/init.rst:1360 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1254 +#: ../../c-api/init.rst:1363 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1259 +#: ../../c-api/init.rst:1368 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1261 ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:1370 ../../c-api/init.rst:1378 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1267 +#: ../../c-api/init.rst:1376 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1276 +#: ../../c-api/init.rst:1385 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1453,7 +1578,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1285 +#: ../../c-api/init.rst:1394 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1465,33 +1590,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1293 +#: ../../c-api/init.rst:1402 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1299 +#: ../../c-api/init.rst:1408 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1310 ../../c-api/init.rst:1348 +#: ../../c-api/init.rst:1419 ../../c-api/init.rst:1457 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1315 +#: ../../c-api/init.rst:1424 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1321 +#: ../../c-api/init.rst:1430 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1500,41 +1625,41 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1327 +#: ../../c-api/init.rst:1436 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1333 +#: ../../c-api/init.rst:1442 msgid "" "Acquire the global interpreter lock. The lock must have been created " "earlier. If this thread already has the lock, a deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1445 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." msgstr "" -#: ../../c-api/init.rst:1356 +#: ../../c-api/init.rst:1465 msgid "" "Release the global interpreter lock. The lock must have been created " "earlier." msgstr "" -#: ../../c-api/init.rst:1358 +#: ../../c-api/init.rst:1467 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." msgstr "" -#: ../../c-api/init.rst:1367 +#: ../../c-api/init.rst:1476 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1369 +#: ../../c-api/init.rst:1478 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1542,7 +1667,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1374 +#: ../../c-api/init.rst:1483 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1553,14 +1678,14 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1381 +#: ../../c-api/init.rst:1490 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1395 +#: ../../c-api/init.rst:1504 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1573,7 +1698,7 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1405 +#: ../../c-api/init.rst:1514 msgid "" "The return value points to the first thread state created in the new sub-" "interpreter. This thread state is made in the current thread state. Note " @@ -1587,11 +1712,11 @@ msgid "" "state on entry.)" msgstr "" -#: ../../c-api/init.rst:1420 +#: ../../c-api/init.rst:1529 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1422 +#: ../../c-api/init.rst:1531 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1599,7 +1724,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1428 +#: ../../c-api/init.rst:1537 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1611,7 +1736,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1439 +#: ../../c-api/init.rst:1548 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1621,7 +1746,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1453 +#: ../../c-api/init.rst:1562 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1633,11 +1758,11 @@ msgid "" "point." msgstr "" -#: ../../c-api/init.rst:1463 +#: ../../c-api/init.rst:1572 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1465 +#: ../../c-api/init.rst:1574 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1650,7 +1775,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1475 +#: ../../c-api/init.rst:1584 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1659,7 +1784,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1481 +#: ../../c-api/init.rst:1590 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -1671,25 +1796,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1492 +#: ../../c-api/init.rst:1601 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1603 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1503 +#: ../../c-api/init.rst:1612 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1507 +#: ../../c-api/init.rst:1616 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -1697,17 +1822,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1512 +#: ../../c-api/init.rst:1621 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1513 +#: ../../c-api/init.rst:1622 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1516 +#: ../../c-api/init.rst:1625 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -1715,20 +1840,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1521 +#: ../../c-api/init.rst:1630 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1524 +#: ../../c-api/init.rst:1633 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1529 +#: ../../c-api/init.rst:1638 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -1738,7 +1863,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1536 +#: ../../c-api/init.rst:1645 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -1746,18 +1871,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1547 +#: ../../c-api/init.rst:1656 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1552 +#: ../../c-api/init.rst:1661 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1556 +#: ../../c-api/init.rst:1665 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -1767,7 +1892,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1566 +#: ../../c-api/init.rst:1675 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -1778,66 +1903,66 @@ msgid "" "or :const:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1684 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1684 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1577 +#: ../../c-api/init.rst:1686 msgid ":const:`PyTrace_CALL`" msgstr ":const:`PyTrace_CALL`" -#: ../../c-api/init.rst:1577 ../../c-api/init.rst:1582 -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1686 ../../c-api/init.rst:1691 +#: ../../c-api/init.rst:1702 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1688 msgid ":const:`PyTrace_EXCEPTION`" msgstr ":const:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1688 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1691 msgid ":const:`PyTrace_LINE`" msgstr ":const:`PyTrace_LINE`" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1693 msgid ":const:`PyTrace_RETURN`" msgstr ":const:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1693 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1587 +#: ../../c-api/init.rst:1696 msgid ":const:`PyTrace_C_CALL`" msgstr ":const:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1589 -#: ../../c-api/init.rst:1591 +#: ../../c-api/init.rst:1696 ../../c-api/init.rst:1698 +#: ../../c-api/init.rst:1700 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1589 +#: ../../c-api/init.rst:1698 msgid ":const:`PyTrace_C_EXCEPTION`" msgstr ":const:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1591 +#: ../../c-api/init.rst:1700 msgid ":const:`PyTrace_C_RETURN`" msgstr ":const:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1702 msgid ":const:`PyTrace_OPCODE`" msgstr ":const:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1598 +#: ../../c-api/init.rst:1707 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -1846,7 +1971,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1607 +#: ../../c-api/init.rst:1716 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -1858,7 +1983,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1618 +#: ../../c-api/init.rst:1727 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -1866,31 +1991,31 @@ msgid "" "*0* on that frame." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1734 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1631 +#: ../../c-api/init.rst:1740 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1637 +#: ../../c-api/init.rst:1746 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1752 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1649 +#: ../../c-api/init.rst:1758 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -1898,7 +2023,7 @@ msgid "" "attr:`f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1657 +#: ../../c-api/init.rst:1766 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -1908,15 +2033,29 @@ msgid "" "`PyTrace_LINE` :const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1664 +#: ../../c-api/init.rst:1773 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1666 ../../c-api/init.rst:1680 +#: ../../c-api/init.rst:1775 ../../c-api/init.rst:1782 +#: ../../c-api/init.rst:1801 ../../c-api/init.rst:1808 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1671 +#: ../../c-api/init.rst:1779 +msgid "" +"Like :c:func:`PyEval_SetProfile` but sets the profile function in all " +"running threads belonging to the current interpreter instead of the setting " +"it only on the current thread." +msgstr "" + +#: ../../c-api/init.rst:1784 +msgid "" +"As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " +"while setting the profile functions in all threads." +msgstr "" + +#: ../../c-api/init.rst:1792 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -1927,52 +2066,65 @@ msgid "" "parameter." msgstr "" -#: ../../c-api/init.rst:1678 +#: ../../c-api/init.rst:1799 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1686 +#: ../../c-api/init.rst:1805 +msgid "" +"Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " +"threads belonging to the current interpreter instead of the setting it only " +"on the current thread." +msgstr "" + +#: ../../c-api/init.rst:1810 +msgid "" +"As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " +"while setting the trace functions in all threads." +msgstr "" + +#: ../../c-api/init.rst:1819 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:1691 +#: ../../c-api/init.rst:1824 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:1696 +#: ../../c-api/init.rst:1829 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:1701 +#: ../../c-api/init.rst:1834 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1839 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:1712 +#: ../../c-api/init.rst:1845 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:1718 +#: ../../c-api/init.rst:1851 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1858 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:1729 +#: ../../c-api/init.rst:1862 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -1982,19 +2134,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:1736 +#: ../../c-api/init.rst:1869 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:1739 +#: ../../c-api/init.rst:1872 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:1743 +#: ../../c-api/init.rst:1876 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2002,22 +2154,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:1751 +#: ../../c-api/init.rst:1884 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:1753 +#: ../../c-api/init.rst:1886 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:1759 +#: ../../c-api/init.rst:1892 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1897 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2025,52 +2177,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:1769 +#: ../../c-api/init.rst:1902 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:1775 +#: ../../c-api/init.rst:1908 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:1780 +#: ../../c-api/init.rst:1913 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:1782 +#: ../../c-api/init.rst:1915 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:1789 +#: ../../c-api/init.rst:1922 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1929 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1935 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1940 msgid "Methods" msgstr "" -#: ../../c-api/init.rst:1809 +#: ../../c-api/init.rst:1942 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2078,13 +2230,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:1817 +#: ../../c-api/init.rst:1950 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:1823 +#: ../../c-api/init.rst:1956 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2093,7 +2245,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:1832 +#: ../../c-api/init.rst:1965 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2102,31 +2254,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:1841 +#: ../../c-api/init.rst:1974 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:1848 +#: ../../c-api/init.rst:1981 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1989 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:1991 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:1863 +#: ../../c-api/init.rst:1996 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2135,181 +2287,181 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:2001 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:386 ../../c-api/init.rst:461 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:495 ../../c-api/init.rst:570 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/init.rst:231 +#: ../../c-api/init.rst:334 msgid "PyEval_InitThreads()" msgstr "PyEval_InitThreads()" -#: ../../c-api/init.rst:231 +#: ../../c-api/init.rst:334 msgid "modules (in module sys)" msgstr "modules(sys 模組中)" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 -#: ../../c-api/init.rst:945 ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 +#: ../../c-api/init.rst:1054 ../../c-api/init.rst:1496 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:480 ../../c-api/init.rst:506 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:231 +#: ../../c-api/init.rst:334 msgid "PySys_SetArgv()" msgstr "PySys_SetArgv()" -#: ../../c-api/init.rst:231 +#: ../../c-api/init.rst:334 msgid "PySys_SetArgvEx()" msgstr "PySys_SetArgvEx()" -#: ../../c-api/init.rst:231 ../../c-api/init.rst:1416 ../../c-api/init.rst:1451 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1525 ../../c-api/init.rst:1560 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/init.rst:321 ../../c-api/init.rst:358 ../../c-api/init.rst:1416 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1525 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/init.rst:321 ../../c-api/init.rst:358 ../../c-api/init.rst:614 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:723 msgid "main()" msgstr "main()" -#: ../../c-api/init.rst:321 +#: ../../c-api/init.rst:430 msgid "stdin" msgstr "stdin" -#: ../../c-api/init.rst:321 +#: ../../c-api/init.rst:430 msgid "stdout" msgstr "stdout" -#: ../../c-api/init.rst:321 +#: ../../c-api/init.rst:430 msgid "sdterr" msgstr "sdterr" -#: ../../c-api/init.rst:358 ../../c-api/init.rst:506 +#: ../../c-api/init.rst:467 ../../c-api/init.rst:615 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/init.rst:461 +#: ../../c-api/init.rst:570 msgid "executable (in module sys)" msgstr "executable(sys 模組中)" -#: ../../c-api/init.rst:480 +#: ../../c-api/init.rst:589 msgid "Py_SetPath()" msgstr "Py_SetPath()" -#: ../../c-api/init.rst:549 ../../c-api/init.rst:591 ../../c-api/init.rst:605 +#: ../../c-api/init.rst:658 ../../c-api/init.rst:700 ../../c-api/init.rst:714 msgid "version (in module sys)" msgstr "version(sys 模組中)" -#: ../../c-api/init.rst:561 +#: ../../c-api/init.rst:670 msgid "platform (in module sys)" msgstr "platform(sys 模組中)" -#: ../../c-api/init.rst:578 +#: ../../c-api/init.rst:687 msgid "copyright (in module sys)" msgstr "copyright(sys 模組中)" -#: ../../c-api/init.rst:614 +#: ../../c-api/init.rst:723 msgid "Py_FatalError()" msgstr "Py_FatalError()" -#: ../../c-api/init.rst:614 +#: ../../c-api/init.rst:723 msgid "argv (in module sys)" msgstr "argv(sys 模組中)" -#: ../../c-api/init.rst:730 +#: ../../c-api/init.rst:839 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../c-api/init.rst:730 +#: ../../c-api/init.rst:839 msgid "interpreter lock" msgstr "interpreter lock(直譯器鎖)" -#: ../../c-api/init.rst:730 +#: ../../c-api/init.rst:839 msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" -#: ../../c-api/init.rst:743 +#: ../../c-api/init.rst:852 msgid "setswitchinterval() (in module sys)" msgstr "setswitchinterval() (sys 模組中)" -#: ../../c-api/init.rst:752 +#: ../../c-api/init.rst:861 msgid "PyThreadState" msgstr "PyThreadState" -#: ../../c-api/init.rst:779 +#: ../../c-api/init.rst:888 msgid "Py_BEGIN_ALLOW_THREADS" msgstr "Py_BEGIN_ALLOW_THREADS" -#: ../../c-api/init.rst:779 +#: ../../c-api/init.rst:888 msgid "Py_END_ALLOW_THREADS" msgstr "Py_END_ALLOW_THREADS" -#: ../../c-api/init.rst:795 ../../c-api/init.rst:923 +#: ../../c-api/init.rst:904 ../../c-api/init.rst:1032 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:795 ../../c-api/init.rst:923 +#: ../../c-api/init.rst:904 ../../c-api/init.rst:1032 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:923 +#: ../../c-api/init.rst:1032 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:923 +#: ../../c-api/init.rst:1032 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:945 +#: ../../c-api/init.rst:1054 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1496 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1496 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1496 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1446 +#: ../../c-api/init.rst:1555 msgid "close() (in module os)" msgstr "close()(sys 模組中)" -#: ../../c-api/init.rst:1501 +#: ../../c-api/init.rst:1610 msgid "Py_AddPendingCall()" msgstr "Py_AddPendingCall()" diff --git a/c-api/init_config.po b/c-api/init_config.po index b64558dbbb..6100d52668 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-19 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -338,7 +338,7 @@ msgid "" msgstr "" #: ../../c-api/init_config.rst:288 ../../c-api/init_config.rst:679 -#: ../../c-api/init_config.rst:721 ../../c-api/init_config.rst:1150 +#: ../../c-api/init_config.rst:721 ../../c-api/init_config.rst:1174 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" @@ -346,7 +346,7 @@ msgstr "" msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:846 +#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:866 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" @@ -372,7 +372,7 @@ msgid "" "variable value." msgstr "" -#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:859 +#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:880 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." @@ -381,11 +381,11 @@ msgstr "" #: ../../c-api/init_config.rst:310 ../../c-api/init_config.rst:618 #: ../../c-api/init_config.rst:625 ../../c-api/init_config.rst:692 #: ../../c-api/init_config.rst:801 ../../c-api/init_config.rst:815 -#: ../../c-api/init_config.rst:829 ../../c-api/init_config.rst:862 -#: ../../c-api/init_config.rst:876 ../../c-api/init_config.rst:936 -#: ../../c-api/init_config.rst:985 ../../c-api/init_config.rst:1045 -#: ../../c-api/init_config.rst:1085 ../../c-api/init_config.rst:1114 -#: ../../c-api/init_config.rst:1187 +#: ../../c-api/init_config.rst:829 ../../c-api/init_config.rst:883 +#: ../../c-api/init_config.rst:897 ../../c-api/init_config.rst:957 +#: ../../c-api/init_config.rst:1009 ../../c-api/init_config.rst:1069 +#: ../../c-api/init_config.rst:1109 ../../c-api/init_config.rst:1138 +#: ../../c-api/init_config.rst:1225 msgid "Default: ``0``." msgstr "預設:\\ ``0``。" @@ -403,7 +403,7 @@ msgid "" "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:1161 +#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:1199 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" @@ -479,7 +479,7 @@ msgid "" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:381 ../../c-api/init_config.rst:1249 +#: ../../c-api/init_config.rst:381 ../../c-api/init_config.rst:1287 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." @@ -594,7 +594,7 @@ msgid "" "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: ../../c-api/init_config.rst:487 ../../c-api/init_config.rst:965 +#: ../../c-api/init_config.rst:487 ../../c-api/init_config.rst:986 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -680,10 +680,10 @@ msgstr "" #: ../../c-api/init_config.rst:544 ../../c-api/init_config.rst:571 #: ../../c-api/init_config.rst:583 ../../c-api/init_config.rst:591 #: ../../c-api/init_config.rst:699 ../../c-api/init_config.rst:708 -#: ../../c-api/init_config.rst:790 ../../c-api/init_config.rst:906 -#: ../../c-api/init_config.rst:1004 ../../c-api/init_config.rst:1022 -#: ../../c-api/init_config.rst:1036 ../../c-api/init_config.rst:1053 -#: ../../c-api/init_config.rst:1066 ../../c-api/init_config.rst:1074 +#: ../../c-api/init_config.rst:790 ../../c-api/init_config.rst:927 +#: ../../c-api/init_config.rst:1028 ../../c-api/init_config.rst:1046 +#: ../../c-api/init_config.rst:1060 ../../c-api/init_config.rst:1077 +#: ../../c-api/init_config.rst:1090 ../../c-api/init_config.rst:1098 msgid "Default: ``NULL``." msgstr "預設值:\\ ``NULL``\\ 。" @@ -731,8 +731,8 @@ msgstr ":data:`sys.base_exec_prefix`\\ 。" #: ../../c-api/init_config.rst:573 ../../c-api/init_config.rst:585 #: ../../c-api/init_config.rst:593 ../../c-api/init_config.rst:701 -#: ../../c-api/init_config.rst:710 ../../c-api/init_config.rst:923 -#: ../../c-api/init_config.rst:1006 +#: ../../c-api/init_config.rst:710 ../../c-api/init_config.rst:944 +#: ../../c-api/init_config.rst:1030 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" @@ -769,7 +769,7 @@ msgid "stdin is always opened in buffered mode." msgstr "" #: ../../c-api/init_config.rst:605 ../../c-api/init_config.rst:638 -#: ../../c-api/init_config.rst:1102 ../../c-api/init_config.rst:1219 +#: ../../c-api/init_config.rst:1126 ../../c-api/init_config.rst:1257 msgid "Default: ``1``." msgstr "預設值:\\ ``1``\\ 。" @@ -1039,9 +1039,9 @@ msgstr "" msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:792 ../../c-api/init_config.rst:888 -#: ../../c-api/init_config.rst:908 ../../c-api/init_config.rst:994 -#: ../../c-api/init_config.rst:1024 +#: ../../c-api/init_config.rst:792 ../../c-api/init_config.rst:909 +#: ../../c-api/init_config.rst:929 ../../c-api/init_config.rst:1018 +#: ../../c-api/init_config.rst:1048 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" @@ -1077,8 +1077,8 @@ msgstr "" msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:821 ../../c-api/init_config.rst:971 -#: ../../c-api/init_config.rst:992 ../../c-api/init_config.rst:1171 +#: ../../c-api/init_config.rst:821 ../../c-api/init_config.rst:992 +#: ../../c-api/init_config.rst:1016 ../../c-api/init_config.rst:1209 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" @@ -1091,87 +1091,115 @@ msgid "Incremented by the :option:`-i` command line option." msgstr "" #: ../../c-api/init_config.rst:833 +msgid "" +"Configures the :ref:`integer string conversion length limitation " +"`. An initial value of ``-1`` means the value will be " +"taken from the command line or environment or otherwise default to 4300 (:" +"data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables the " +"limitation. Values greater than zero but less than 640 (:data:`sys.int_info." +"str_digits_check_threshold`) are unsupported and will produce an error." +msgstr "" + +#: ../../c-api/init_config.rst:841 +msgid "" +"Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " +"the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." +msgstr "" + +#: ../../c-api/init_config.rst:844 +msgid "" +"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." +"default_max_str_digits`) in isolated mode." +msgstr "" + +#: ../../c-api/init_config.rst:851 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:835 +#: ../../c-api/init_config.rst:853 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " -"unsafe path to :data:`sys.path` at Python startup." +"unsafe path to :data:`sys.path` at Python startup, such as the current " +"directory, the script's directory or an empty string." msgstr "" -#: ../../c-api/init_config.rst:838 ../../c-api/init_config.rst:1469 -msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." +#: ../../c-api/init_config.rst:857 +#, fuzzy +msgid "" +"Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " +"environment variables." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:839 +#: ../../c-api/init_config.rst:859 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:841 +#: ../../c-api/init_config.rst:861 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:844 +#: ../../c-api/init_config.rst:864 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: ../../c-api/init_config.rst:848 -msgid "See also :c:member:`PyPreConfig.isolated`." -msgstr "也請見 :c:member:`PyPreConfig.isolated`\\ 。" +#: ../../c-api/init_config.rst:868 +msgid "" +"See also the :ref:`Isolated Configuration ` and :c:" +"member:`PyPreConfig.isolated`." +msgstr "" -#: ../../c-api/init_config.rst:852 +#: ../../c-api/init_config.rst:873 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`io.WindowsConsoleIO` " "for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`." msgstr "" -#: ../../c-api/init_config.rst:856 +#: ../../c-api/init_config.rst:877 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:864 +#: ../../c-api/init_config.rst:885 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:868 +#: ../../c-api/init_config.rst:889 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:871 +#: ../../c-api/init_config.rst:892 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:873 +#: ../../c-api/init_config.rst:894 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:880 +#: ../../c-api/init_config.rst:901 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:882 +#: ../../c-api/init_config.rst:903 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:884 +#: ../../c-api/init_config.rst:905 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" -"`configure --with-platlibdir option <--with-platlibdir>` (default: ``\"lib" -"\"``, or ``\"DLLs\"`` on Windows)." +"`configure --with-platlibdir option <--with-platlibdir>` (default: " +"``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: ../../c-api/init_config.rst:892 +#: ../../c-api/init_config.rst:913 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -1179,21 +1207,21 @@ msgid "" "and virtual environments." msgstr "" -#: ../../c-api/init_config.rst:901 +#: ../../c-api/init_config.rst:922 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.path.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:904 +#: ../../c-api/init_config.rst:925 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:934 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:915 +#: ../../c-api/init_config.rst:936 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -1201,41 +1229,41 @@ msgid "" "to ``1``." msgstr "" -#: ../../c-api/init_config.rst:920 +#: ../../c-api/init_config.rst:941 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:927 +#: ../../c-api/init_config.rst:948 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:929 +#: ../../c-api/init_config.rst:950 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:930 +#: ../../c-api/init_config.rst:951 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:931 +#: ../../c-api/init_config.rst:952 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:933 +#: ../../c-api/init_config.rst:954 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:940 +#: ../../c-api/init_config.rst:961 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:943 +#: ../../c-api/init_config.rst:964 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1244,362 +1272,389 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:950 +#: ../../c-api/init_config.rst:971 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:953 ../../c-api/init_config.rst:1206 -#: ../../c-api/init_config.rst:1225 +#: ../../c-api/init_config.rst:974 ../../c-api/init_config.rst:1244 +#: ../../c-api/init_config.rst:1263 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:959 +#: ../../c-api/init_config.rst:980 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:961 +#: ../../c-api/init_config.rst:982 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:973 +#: ../../c-api/init_config.rst:994 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:979 +#: ../../c-api/init_config.rst:1000 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:982 +#: ../../c-api/init_config.rst:1003 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:989 +#: ../../c-api/init_config.rst:1006 +msgid "" +"Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " +"must be defined)." +msgstr "" + +#: ../../c-api/init_config.rst:1013 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: ../../c-api/init_config.rst:996 +#: ../../c-api/init_config.rst:1020 msgid "Now also applies on Windows." msgstr "" -#: ../../c-api/init_config.rst:1001 +#: ../../c-api/init_config.rst:1025 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:1010 +#: ../../c-api/init_config.rst:1034 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1013 +#: ../../c-api/init_config.rst:1037 msgid "If :func:`Py_SetProgramName` has been called, use its argument." msgstr "" -#: ../../c-api/init_config.rst:1014 +#: ../../c-api/init_config.rst:1038 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1015 +#: ../../c-api/init_config.rst:1039 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1017 +#: ../../c-api/init_config.rst:1041 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:1019 +#: ../../c-api/init_config.rst:1043 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:1028 +#: ../../c-api/init_config.rst:1052 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1031 +#: ../../c-api/init_config.rst:1055 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1034 +#: ../../c-api/init_config.rst:1058 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1040 +#: ../../c-api/init_config.rst:1064 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1043 +#: ../../c-api/init_config.rst:1067 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:1049 +#: ../../c-api/init_config.rst:1073 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:1051 ../../c-api/init_config.rst:1072 +#: ../../c-api/init_config.rst:1075 ../../c-api/init_config.rst:1096 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1057 +#: ../../c-api/init_config.rst:1081 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: ../../c-api/init_config.rst:1061 +#: ../../c-api/init_config.rst:1085 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: ../../c-api/init_config.rst:1064 +#: ../../c-api/init_config.rst:1088 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。" -#: ../../c-api/init_config.rst:1070 +#: ../../c-api/init_config.rst:1094 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1078 +#: ../../c-api/init_config.rst:1102 msgid "Show total reference count at exit?" msgstr "" -#: ../../c-api/init_config.rst:1080 +#: ../../c-api/init_config.rst:1104 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1082 +#: ../../c-api/init_config.rst:1106 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1089 +#: ../../c-api/init_config.rst:1113 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1115 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1094 +#: ../../c-api/init_config.rst:1118 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1097 +#: ../../c-api/init_config.rst:1121 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1099 +#: ../../c-api/init_config.rst:1123 msgid "" ":data:`sys.flags.no_site` is set to the inverted value of :c:member:" "`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1106 +#: ../../c-api/init_config.rst:1130 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1109 +#: ../../c-api/init_config.rst:1133 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1112 +#: ../../c-api/init_config.rst:1136 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1119 +#: ../../c-api/init_config.rst:1143 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" -"data:`sys.stderr` (but :data:`sys.stderr` always uses ``\"backslashreplace" -"\"`` error handler)." +"data:`sys.stderr` (but :data:`sys.stderr` always uses " +"``\"backslashreplace\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1123 +#: ../../c-api/init_config.rst:1147 msgid "" "If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " "and *errors* arguments if they are not ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:1126 +#: ../../c-api/init_config.rst:1150 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1129 +#: ../../c-api/init_config.rst:1153 msgid "Default encoding:" msgstr "" -#: ../../c-api/init_config.rst:1131 +#: ../../c-api/init_config.rst:1155 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1132 +#: ../../c-api/init_config.rst:1156 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: ../../c-api/init_config.rst:1134 +#: ../../c-api/init_config.rst:1158 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1136 +#: ../../c-api/init_config.rst:1160 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: ../../c-api/init_config.rst:1137 +#: ../../c-api/init_config.rst:1161 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1139 +#: ../../c-api/init_config.rst:1163 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1143 +#: ../../c-api/init_config.rst:1167 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1145 +#: ../../c-api/init_config.rst:1169 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1147 +#: ../../c-api/init_config.rst:1171 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1154 +#: ../../c-api/init_config.rst:1178 +msgid "Enable compatibility mode with the perf profiler?" +msgstr "" + +#: ../../c-api/init_config.rst:1180 +msgid "" +"If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " +"more information." +msgstr "" + +#: ../../c-api/init_config.rst:1183 +msgid "" +"Set by :option:`-X perf <-X>` command line option and by the :envvar:" +"`PYTHONPERFSUPPORT` environment variable." +msgstr "" + +#: ../../c-api/init_config.rst:1186 +#, fuzzy +msgid "Default: ``-1``." +msgstr "預設值:\\ ``1``\\ 。" + +#: ../../c-api/init_config.rst:1192 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1156 +#: ../../c-api/init_config.rst:1194 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1159 +#: ../../c-api/init_config.rst:1197 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1165 +#: ../../c-api/init_config.rst:1203 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1167 +#: ../../c-api/init_config.rst:1205 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1169 +#: ../../c-api/init_config.rst:1207 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1175 +#: ../../c-api/init_config.rst:1213 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1179 +#: ../../c-api/init_config.rst:1217 msgid "" -"If greater or equal to ``2``, print a message for each file that is checked " -"for when searching for a module. Also provides information on module cleanup " -"at exit." +"If greater than or equal to ``2``, print a message for each file that is " +"checked for when searching for a module. Also provides information on module " +"cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1183 +#: ../../c-api/init_config.rst:1221 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1185 -msgid "Set to the :envvar:`PYTHONVERBOSE` environment variable value." +#: ../../c-api/init_config.rst:1223 +msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1191 +#: ../../c-api/init_config.rst:1229 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1194 +#: ../../c-api/init_config.rst:1232 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1199 +#: ../../c-api/init_config.rst:1237 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1202 +#: ../../c-api/init_config.rst:1240 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1210 +#: ../../c-api/init_config.rst:1248 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1213 +#: ../../c-api/init_config.rst:1251 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1216 +#: ../../c-api/init_config.rst:1254 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1223 +#: ../../c-api/init_config.rst:1261 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1227 +#: ../../c-api/init_config.rst:1265 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1607,29 +1662,29 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1232 +#: ../../c-api/init_config.rst:1270 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1237 +#: ../../c-api/init_config.rst:1275 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1241 +#: ../../c-api/init_config.rst:1279 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1243 +#: ../../c-api/init_config.rst:1281 msgid "Function to initialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1247 +#: ../../c-api/init_config.rst:1285 msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:1252 +#: ../../c-api/init_config.rst:1290 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1638,17 +1693,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1259 +#: ../../c-api/init_config.rst:1297 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1262 +#: ../../c-api/init_config.rst:1300 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1290 +#: ../../c-api/init_config.rst:1328 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1657,18 +1712,18 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1353 +#: ../../c-api/init_config.rst:1391 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1355 +#: ../../c-api/init_config.rst:1393 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1360 +#: ../../c-api/init_config.rst:1398 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1676,115 +1731,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1365 +#: ../../c-api/init_config.rst:1403 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1373 +#: ../../c-api/init_config.rst:1411 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1375 +#: ../../c-api/init_config.rst:1413 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1379 +#: ../../c-api/init_config.rst:1417 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1382 +#: ../../c-api/init_config.rst:1420 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1391 +#: ../../c-api/init_config.rst:1429 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1393 +#: ../../c-api/init_config.rst:1431 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1395 +#: ../../c-api/init_config.rst:1433 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1397 +#: ../../c-api/init_config.rst:1435 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1398 +#: ../../c-api/init_config.rst:1436 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1399 +#: ../../c-api/init_config.rst:1437 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1400 +#: ../../c-api/init_config.rst:1438 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1439 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1402 +#: ../../c-api/init_config.rst:1440 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1403 +#: ../../c-api/init_config.rst:1441 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1405 +#: ../../c-api/init_config.rst:1443 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1406 +#: ../../c-api/init_config.rst:1444 msgid "" -"(Windows only) Application paths in the registry under \"Software\\Python" -"\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE " -"(where X.Y is the Python version)." +"(Windows only) Application paths in the registry under " +"\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " +"HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1410 +#: ../../c-api/init_config.rst:1448 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1412 +#: ../../c-api/init_config.rst:1450 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1451 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1414 +#: ../../c-api/init_config.rst:1452 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1415 +#: ../../c-api/init_config.rst:1453 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1416 +#: ../../c-api/init_config.rst:1454 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1417 +#: ../../c-api/init_config.rst:1455 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -1792,11 +1847,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1419 +#: ../../c-api/init_config.rst:1457 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1421 +#: ../../c-api/init_config.rst:1459 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1805,7 +1860,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1427 +#: ../../c-api/init_config.rst:1465 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1815,52 +1870,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1434 +#: ../../c-api/init_config.rst:1472 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1437 +#: ../../c-api/init_config.rst:1475 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1479 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1443 +#: ../../c-api/init_config.rst:1481 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1446 +#: ../../c-api/init_config.rst:1484 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1448 +#: ../../c-api/init_config.rst:1486 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1450 +#: ../../c-api/init_config.rst:1488 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1452 +#: ../../c-api/init_config.rst:1490 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1454 +#: ../../c-api/init_config.rst:1492 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -1869,172 +1924,170 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1460 +#: ../../c-api/init_config.rst:1498 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1462 +#: ../../c-api/init_config.rst:1500 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1463 +#: ../../c-api/init_config.rst:1501 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1502 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1466 +#: ../../c-api/init_config.rst:1504 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1468 +#: ../../c-api/init_config.rst:1506 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1470 +#: ../../c-api/init_config.rst:1507 +msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." +msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" + +#: ../../c-api/init_config.rst:1508 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1471 +#: ../../c-api/init_config.rst:1509 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1473 +#: ../../c-api/init_config.rst:1511 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:1478 +#: ../../c-api/init_config.rst:1516 msgid "Py_RunMain()" msgstr "Py_RunMain()" -#: ../../c-api/init_config.rst:1482 +#: ../../c-api/init_config.rst:1520 msgid "" "Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" "member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." "run_module`) specified on the command line or in the configuration." msgstr "" -#: ../../c-api/init_config.rst:1487 +#: ../../c-api/init_config.rst:1525 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:1489 +#: ../../c-api/init_config.rst:1527 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:1492 +#: ../../c-api/init_config.rst:1530 msgid "" "See :ref:`Python Configuration ` for an example of " "customized Python always running in isolated mode using :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1498 +#: ../../c-api/init_config.rst:1536 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1540 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1504 +#: ../../c-api/init_config.rst:1542 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1546 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1548 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1513 +#: ../../c-api/init_config.rst:1551 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1515 +#: ../../c-api/init_config.rst:1553 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1554 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1555 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1518 +#: ../../c-api/init_config.rst:1556 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1521 +#: ../../c-api/init_config.rst:1559 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1561 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1524 +#: ../../c-api/init_config.rst:1562 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1563 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1564 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1528 +#: ../../c-api/init_config.rst:1566 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1529 +#: ../../c-api/init_config.rst:1567 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1568 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1532 +#: ../../c-api/init_config.rst:1570 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1534 +#: ../../c-api/init_config.rst:1572 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1536 -msgid "" -":c:member:`PyConfig._isolated_interpreter`: if non-zero, disallow threads, " -"subprocesses and fork." -msgstr "" - -#: ../../c-api/init_config.rst:1541 +#: ../../c-api/init_config.rst:1577 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1543 +#: ../../c-api/init_config.rst:1579 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2043,14 +2096,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1549 +#: ../../c-api/init_config.rst:1585 msgid "" -"It may become possible to calculatin the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1553 +#: ../../c-api/init_config.rst:1589 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2058,8 +2111,11 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1558 +#: ../../c-api/init_config.rst:1594 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" + +#~ msgid "See also :c:member:`PyPreConfig.isolated`." +#~ msgstr "也請見 :c:member:`PyPreConfig.isolated`\\ 。" diff --git a/c-api/intro.po b/c-api/intro.po index 53da61fda7..800bb19eab 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -271,9 +271,10 @@ msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" #: ../../c-api/intro.rst:155 +#, fuzzy msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " -"command line (i.e. if ``Py_IgnoreEnvironmentFlag`` is set)." +"command line (see :c:member:`PyConfig.use_environment`)." msgstr "" "類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E`\\ (即如果設定了 " "``Py_IgnoreEnvironmentFlag``\\ )則回傳 ``NULL``。" diff --git a/c-api/long.po b/c-api/long.po index 35b37d7483..647b941dcc 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 15:31+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -108,64 +108,66 @@ msgstr "" #: ../../c-api/long.rst:86 msgid "" "Return a new :c:type:`PyLongObject` based on the string value in *str*, " -"which is interpreted according to the radix in *base*. If *pend* is non-" -"``NULL``, *\\*pend* will point to the first character in *str* which follows " -"the representation of the number. If *base* is ``0``, *str* is interpreted " -"using the :ref:`integers` definition; in this case, leading zeros in a non-" -"zero decimal number raises a :exc:`ValueError`. If *base* is not ``0``, it " -"must be between ``2`` and ``36``, inclusive. Leading spaces and single " -"underscores after a base specifier and between digits are ignored. If there " -"are no digits, :exc:`ValueError` will be raised." +"which is interpreted according to the radix in *base*, or ``NULL`` on " +"failure. If *pend* is non-``NULL``, *\\*pend* will point to the end of " +"*str* on success or to the first character that could not be processed on " +"error. If *base* is ``0``, *str* is interpreted using the :ref:`integers` " +"definition; in this case, leading zeros in a non-zero decimal number raises " +"a :exc:`ValueError`. If *base* is not ``0``, it must be between ``2`` and " +"``36``, inclusive. Leading and trailing whitespace and single underscores " +"after a base specifier and between digits are ignored. If there are no " +"digits or *str* is not NULL-terminated following the digits and trailing " +"whitespace, :exc:`ValueError` will be raised." msgstr "" -#: ../../c-api/long.rst:96 +#: ../../c-api/long.rst:97 msgid "" "Python methods :meth:`int.to_bytes` and :meth:`int.from_bytes` to convert a :" "c:type:`PyLongObject` to/from an array of bytes in base ``256``. You can " "call those from C using :c:func:`PyObject_CallMethod`." msgstr "" -#: ../../c-api/long.rst:103 +#: ../../c-api/long.rst:104 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " "value." msgstr "" -#: ../../c-api/long.rst:111 +#: ../../c-api/long.rst:112 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" -#: ../../c-api/long.rst:122 ../../c-api/long.rst:140 +#: ../../c-api/long.rst:123 ../../c-api/long.rst:141 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:126 +#: ../../c-api/long.rst:127 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long`." msgstr "" -#: ../../c-api/long.rst:129 ../../c-api/long.rst:149 ../../c-api/long.rst:170 -#: ../../c-api/long.rst:190 ../../c-api/long.rst:213 +#: ../../c-api/long.rst:130 ../../c-api/long.rst:150 ../../c-api/long.rst:171 +#: ../../c-api/long.rst:191 ../../c-api/long.rst:214 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:131 ../../c-api/long.rst:151 ../../c-api/long.rst:172 -#: ../../c-api/long.rst:194 ../../c-api/long.rst:278 ../../c-api/long.rst:298 +#: ../../c-api/long.rst:132 ../../c-api/long.rst:152 ../../c-api/long.rst:173 +#: ../../c-api/long.rst:195 ../../c-api/long.rst:279 ../../c-api/long.rst:299 msgid "Use :meth:`~object.__index__` if available." msgstr "" -#: ../../c-api/long.rst:134 ../../c-api/long.rst:154 ../../c-api/long.rst:175 -#: ../../c-api/long.rst:197 ../../c-api/long.rst:281 ../../c-api/long.rst:301 +#: ../../c-api/long.rst:135 ../../c-api/long.rst:155 ../../c-api/long.rst:176 +#: ../../c-api/long.rst:198 ../../c-api/long.rst:282 ../../c-api/long.rst:302 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" -#: ../../c-api/long.rst:144 +#: ../../c-api/long.rst:145 msgid "" "If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" "`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -173,20 +175,20 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:163 ../../c-api/long.rst:181 +#: ../../c-api/long.rst:164 ../../c-api/long.rst:182 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:167 +#: ../../c-api/long.rst:168 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long long`." msgstr "" -#: ../../c-api/long.rst:185 +#: ../../c-api/long.rst:186 msgid "" "If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" "`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " @@ -194,133 +196,133 @@ msgid "" "occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:207 +#: ../../c-api/long.rst:208 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:210 +#: ../../c-api/long.rst:211 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." msgstr "" -#: ../../c-api/long.rst:222 +#: ../../c-api/long.rst:223 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:225 +#: ../../c-api/long.rst:226 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:228 +#: ../../c-api/long.rst:229 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:238 +#: ../../c-api/long.rst:239 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:241 +#: ../../c-api/long.rst:242 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: ../../c-api/long.rst:244 +#: ../../c-api/long.rst:245 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:253 +#: ../../c-api/long.rst:254 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:256 +#: ../../c-api/long.rst:257 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" "c:expr:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:259 +#: ../../c-api/long.rst:260 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:262 +#: ../../c-api/long.rst:263 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:268 +#: ../../c-api/long.rst:269 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:272 +#: ../../c-api/long.rst:273 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:275 +#: ../../c-api/long.rst:276 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:287 +#: ../../c-api/long.rst:288 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:292 +#: ../../c-api/long.rst:293 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:295 +#: ../../c-api/long.rst:296 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:307 +#: ../../c-api/long.rst:308 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:310 +#: ../../c-api/long.rst:311 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`double`." msgstr "" -#: ../../c-api/long.rst:313 +#: ../../c-api/long.rst:314 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:318 +#: ../../c-api/long.rst:319 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " @@ -328,11 +330,44 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:323 +#: ../../c-api/long.rst:324 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" +#: ../../c-api/long.rst:329 +msgid "Return 1 if *op* is compact, 0 otherwise." +msgstr "" + +#: ../../c-api/long.rst:331 +msgid "" +"This function makes it possible for performance-critical code to implement a " +"“fast path” for small integers. For compact values use :c:func:" +"`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:" +"`PyLong_As* ` function or :c:func:`calling " +"` :meth:`int.to_bytes`." +msgstr "" + +#: ../../c-api/long.rst:337 +msgid "The speedup is expected to be negligible for most users." +msgstr "" + +#: ../../c-api/long.rst:339 +msgid "" +"Exactly what values are considered compact is an implementation detail and " +"is subject to change." +msgstr "" + +#: ../../c-api/long.rst:344 +msgid "" +"If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " +"return its value." +msgstr "" + +#: ../../c-api/long.rst:347 +msgid "Otherwise, the return value is undefined." +msgstr "" + #: ../../c-api/long.rst:8 msgid "object" msgstr "object(物件)" @@ -345,23 +380,23 @@ msgstr "long integer(長整数)" msgid "integer" msgstr "integer(整数)" -#: ../../c-api/long.rst:118 +#: ../../c-api/long.rst:119 msgid "LONG_MAX" msgstr "LONG_MAX" -#: ../../c-api/long.rst:118 ../../c-api/long.rst:160 ../../c-api/long.rst:203 -#: ../../c-api/long.rst:218 ../../c-api/long.rst:234 ../../c-api/long.rst:250 +#: ../../c-api/long.rst:119 ../../c-api/long.rst:161 ../../c-api/long.rst:204 +#: ../../c-api/long.rst:219 ../../c-api/long.rst:235 ../../c-api/long.rst:251 msgid "OverflowError (built-in exception)" msgstr "OverflowError(内建例外)" -#: ../../c-api/long.rst:203 +#: ../../c-api/long.rst:204 msgid "PY_SSIZE_T_MAX" msgstr "PY_SSIZE_T_MAX" -#: ../../c-api/long.rst:218 +#: ../../c-api/long.rst:219 msgid "ULONG_MAX" msgstr "ULONG_MAX" -#: ../../c-api/long.rst:234 +#: ../../c-api/long.rst:235 msgid "SIZE_MAX" msgstr "SIZE_MAX" diff --git a/c-api/none.po b/c-api/none.po index 16eabb2287..307ddcb7d4 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,14 +34,15 @@ msgstr "" #: ../../c-api/none.rst:18 msgid "" "The Python ``None`` object, denoting lack of value. This object has no " -"methods. It needs to be treated just like any other object with respect to " -"reference counts." +"methods and is `immortal `_." msgstr "" -#: ../../c-api/none.rst:25 -msgid "" -"Properly handle returning :c:data:`Py_None` from within a C function (that " -"is, increment the reference count of ``None`` and return it.)" +#: ../../c-api/none.rst:21 +msgid ":c:data:`Py_None` is immortal." +msgstr "" + +#: ../../c-api/none.rst:26 +msgid "Return :c:data:`Py_None` from a function." msgstr "" #: ../../c-api/none.rst:8 diff --git a/c-api/object.po b/c-api/object.po index 8ddc04da21..56c73da748 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-25 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -414,6 +414,56 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" +#: ../../c-api/object.rst:405 +msgid "Get a pointer to subclass-specific data reserved for *cls*." +msgstr "" + +#: ../../c-api/object.rst:407 +msgid "" +"The object *o* must be an instance of *cls*, and *cls* must have been " +"created using negative :c:member:`PyType_Spec.basicsize`. Python does not " +"check this." +msgstr "" + +#: ../../c-api/object.rst:411 +msgid "On error, set an exception and return ``NULL``." +msgstr "" + +#: ../../c-api/object.rst:417 +msgid "" +"Return the size of the instance memory space reserved for *cls*, i.e. the " +"size of the memory :c:func:`PyObject_GetTypeData` returns." +msgstr "" + +#: ../../c-api/object.rst:420 +msgid "" +"This may be larger than requested using :c:member:`-PyType_Spec.basicsize " +"`; it is safe to use this larger size (e.g. with :c:" +"func:`!memset`)." +msgstr "" + +#: ../../c-api/object.rst:423 +msgid "" +"The type *cls* **must** have been created using negative :c:member:" +"`PyType_Spec.basicsize`. Python does not check this." +msgstr "" + +#: ../../c-api/object.rst:427 +msgid "On error, set an exception and return a negative value." +msgstr "" + +#: ../../c-api/object.rst:433 +msgid "" +"Get a pointer to per-item data for a class with :const:" +"`Py_TPFLAGS_ITEMS_AT_END`." +msgstr "" + +#: ../../c-api/object.rst:436 +msgid "" +"On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " +"raised if *o* does not have :const:`Py_TPFLAGS_ITEMS_AT_END` set." +msgstr "" + #: ../../c-api/object.rst:197 ../../c-api/object.rst:209 #: ../../c-api/object.rst:234 ../../c-api/object.rst:285 #: ../../c-api/object.rst:319 ../../c-api/object.rst:339 diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po new file mode 100644 index 0000000000..55b594aa05 --- /dev/null +++ b/c-api/perfmaps.po @@ -0,0 +1,84 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../c-api/perfmaps.rst:6 +msgid "Support for Perf Maps" +msgstr "" + +#: ../../c-api/perfmaps.rst:8 +msgid "" +"On supported platforms (as of this writing, only Linux), the runtime can " +"take advantage of *perf map files* to make Python functions visible to an " +"external profiling tool (such as `perf `_). A running process may create a file in the ``/tmp`` " +"directory, which contains entries that can map a section of executable code " +"to a name. This interface is described in the `documentation of the Linux " +"Perf tool `_." +msgstr "" + +#: ../../c-api/perfmaps.rst:16 +msgid "" +"In Python, these helper APIs can be used by libraries and features that rely " +"on generating machine code on the fly." +msgstr "" + +#: ../../c-api/perfmaps.rst:19 +msgid "" +"Note that holding the Global Interpreter Lock (GIL) is not required for " +"these APIs." +msgstr "" + +#: ../../c-api/perfmaps.rst:23 +msgid "" +"Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create " +"a lock to ensure thread-safe writes to the file (provided the writes are " +"done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no " +"need to call this explicitly; just use :c:func:" +"`PyUnstable_WritePerfMapEntry` and it will initialize the state on first " +"call." +msgstr "" + +#: ../../c-api/perfmaps.rst:29 +msgid "" +"Returns ``0`` on success, ``-1`` on failure to create/open the perf map " +"file, or ``-2`` on failure to create a lock. Check ``errno`` for more " +"information about the cause of a failure." +msgstr "" + +#: ../../c-api/perfmaps.rst:35 +msgid "" +"Write one single entry to the ``/tmp/perf-$pid.map`` file. This function is " +"thread safe. Here is what an example entry looks like::" +msgstr "" + +#: ../../c-api/perfmaps.rst:41 +msgid "" +"Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " +"if the perf map file is not already opened. Returns ``0`` on success, or the " +"same error codes as :c:func:`PyUnstable_PerfMapState_Init` on failure." +msgstr "" + +#: ../../c-api/perfmaps.rst:47 +msgid "" +"Close the perf map file opened by :c:func:`PyUnstable_PerfMapState_Init`. " +"This is called by the runtime itself during interpreter shut-down. In " +"general, there shouldn't be a reason to explicitly call this, except to " +"handle specific scenarios such as forking." +msgstr "" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 49e41fff88..e4557fcfda 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-01 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,17 +25,41 @@ msgid "Reference Counting" msgstr "參照計數" #: ../../c-api/refcounting.rst:10 +#, fuzzy msgid "" -"The macros in this section are used for managing reference counts of Python " -"objects." +"The functions and macros in this section are used for managing reference " +"counts of Python objects." msgstr "本節中的巨集用於管理 Python 物件的參照計數。" #: ../../c-api/refcounting.rst:16 -msgid "Increment the reference count for object *o*." +#, fuzzy +msgid "Get the reference count of the Python object *o*." msgstr "增加物件 *o* 的參照計數。" #: ../../c-api/refcounting.rst:18 msgid "" +"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +msgstr "" + +#: ../../c-api/refcounting.rst:20 +msgid "The parameter type is no longer :c:expr:`const PyObject*`." +msgstr "" + +#: ../../c-api/refcounting.rst:23 +msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." +msgstr "" + +#: ../../c-api/refcounting.rst:29 +#, fuzzy +msgid "Set the object *o* reference counter to *refcnt*." +msgstr "增加物件 *o* 的參照計數。" + +#: ../../c-api/refcounting.rst:36 +msgid "Increment the reference count for object *o*." +msgstr "增加物件 *o* 的參照計數。" + +#: ../../c-api/refcounting.rst:38 +msgid "" "This function is usually used to convert a :term:`borrowed reference` to a :" "term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " "used to create a new :term:`strong reference`." @@ -44,7 +68,7 @@ msgstr "" "換為\\ :term:`強參照 `。:c:func:`Py_NewRef` 函式可用於建立" "新的\\ :term:`強參照 `。" -#: ../../c-api/refcounting.rst:22 +#: ../../c-api/refcounting.rst:42 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XINCREF`." @@ -52,18 +76,18 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使用 :c:func:" "`Py_XINCREF`。" -#: ../../c-api/refcounting.rst:28 +#: ../../c-api/refcounting.rst:48 msgid "" "Increment the reference count for object *o*. The object may be ``NULL``, " "in which case the macro has no effect." msgstr "" "增加物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用。" -#: ../../c-api/refcounting.rst:31 +#: ../../c-api/refcounting.rst:51 msgid "See also :c:func:`Py_XNewRef`." msgstr "另請見 :c:func:`Py_XNewRef`。" -#: ../../c-api/refcounting.rst:36 +#: ../../c-api/refcounting.rst:56 msgid "" "Create a new :term:`strong reference` to an object: increment the reference " "count of the object *o* and return the object *o*." @@ -71,7 +95,7 @@ msgstr "" "建立對物件的新\\ :term:`強參照 `:增加物件 *o* 的參照計數並" "回傳物件 *o*。" -#: ../../c-api/refcounting.rst:39 +#: ../../c-api/refcounting.rst:59 msgid "" "When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " "should be called on it to decrement the object reference count." @@ -79,7 +103,7 @@ msgstr "" "當不再需要\\ :term:`強參照 `\\ 時,應對其呼叫 :c:func:" "`Py_DECREF` 以減少物件參照計數。" -#: ../../c-api/refcounting.rst:42 +#: ../../c-api/refcounting.rst:62 msgid "" "The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " "``NULL``." @@ -87,37 +111,37 @@ msgstr "" "物件 *o* 不能為 ``NULL``;如果 *o* 可以為 ``NULL``,則使用 :c:func:" "`Py_XNewRef`。" -#: ../../c-api/refcounting.rst:45 +#: ../../c-api/refcounting.rst:65 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/refcounting.rst:50 +#: ../../c-api/refcounting.rst:70 msgid "can be written as::" msgstr "" "可以寫成:\n" "\n" "::" -#: ../../c-api/refcounting.rst:54 +#: ../../c-api/refcounting.rst:74 msgid "See also :c:func:`Py_INCREF`." msgstr "另請參閱 :c:func:`Py_INCREF`\\ 。" -#: ../../c-api/refcounting.rst:61 +#: ../../c-api/refcounting.rst:81 msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." msgstr "與 :c:func:`Py_NewRef` 類似,但物件 *o* 可以為 NULL。" -#: ../../c-api/refcounting.rst:63 +#: ../../c-api/refcounting.rst:83 msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." msgstr "如果物件 *o* 為 ``NULL``,則該函式僅回傳 ``NULL``。" -#: ../../c-api/refcounting.rst:70 +#: ../../c-api/refcounting.rst:90 msgid "Decrement the reference count for object *o*." msgstr "減少物件 *o* 的參照計數。" -#: ../../c-api/refcounting.rst:72 +#: ../../c-api/refcounting.rst:92 msgid "" "If the reference count reaches zero, the object's type's deallocation " "function (which must not be ``NULL``) is invoked." @@ -125,14 +149,14 @@ msgstr "" "如果參照計數達到零,則調用物件之型別的釋放函式 (deallocation function)(不得" "為 ``NULL``)。" -#: ../../c-api/refcounting.rst:75 +#: ../../c-api/refcounting.rst:95 msgid "" "This function is usually used to delete a :term:`strong reference` before " "exiting its scope." msgstr "" "此函式通常用於在退出作用域之前刪除\\ :term:`強參照 `。" -#: ../../c-api/refcounting.rst:78 +#: ../../c-api/refcounting.rst:98 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XDECREF`." @@ -140,7 +164,7 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改用 :c:func:" "`Py_XDECREF`。" -#: ../../c-api/refcounting.rst:83 +#: ../../c-api/refcounting.rst:103 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." "g. when a class instance with a :meth:`__del__` method is deallocated). " @@ -159,7 +183,7 @@ msgstr "" "除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數呼叫 :c:func:" "`Py_DECREF`。" -#: ../../c-api/refcounting.rst:95 +#: ../../c-api/refcounting.rst:115 msgid "" "Decrement the reference count for object *o*. The object may be ``NULL``, " "in which case the macro has no effect; otherwise the effect is the same as " @@ -168,7 +192,7 @@ msgstr "" "減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否" "則效果與 :c:func:`Py_DECREF` 相同,且使得應用了相同的警告。" -#: ../../c-api/refcounting.rst:102 +#: ../../c-api/refcounting.rst:122 msgid "" "Decrement the reference count for object *o*. The object may be ``NULL``, " "in which case the macro has no effect; otherwise the effect is the same as " @@ -179,17 +203,23 @@ msgid "" msgstr "" "減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否" "則,效果與 :c:func:`Py_DECREF` 相同,只是引數也設定為 ``NULL``。:c:func:" -"`Py_DECREF` 的警告不適用於傳遞的物件,因為巨集在遞減其參照計數之前小心地使用臨" -"時變數並將參數設定為 ``NULL``。" +"`Py_DECREF` 的警告不適用於傳遞的物件,因為巨集在遞減其參照計數之前小心地使用" +"臨時變數並將參數設定為 ``NULL``。" -#: ../../c-api/refcounting.rst:109 +#: ../../c-api/refcounting.rst:129 msgid "" "It is a good idea to use this macro whenever decrementing the reference " "count of an object that might be traversed during garbage collection." msgstr "" "每當要減少垃圾收集期間可能被遍歷到之物件的參照計數時,使用此巨集是個好主意。" -#: ../../c-api/refcounting.rst:114 +#: ../../c-api/refcounting.rst:132 +msgid "" +"The macro argument is now only evaluated once. If the argument has side " +"effects, these are no longer duplicated." +msgstr "" + +#: ../../c-api/refcounting.rst:139 msgid "" "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." @@ -197,7 +227,7 @@ msgstr "" "增加物件 *o* 的參照計數。:c:func:`Py_XINCREF` 的函式版本。它可用於 Python 的" "執行環境動態嵌入。" -#: ../../c-api/refcounting.rst:120 +#: ../../c-api/refcounting.rst:145 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." @@ -205,12 +235,44 @@ msgstr "" "減少物件 *o* 的參照計數。:c:func:`Py_XDECREF` 的函式版本。它可用於 Python 的" "執行環境動態嵌入。" -#: ../../c-api/refcounting.rst:124 +#: ../../c-api/refcounting.rst:151 +msgid "" +"Macro safely decrementing the `dst` reference count and setting `dst` to " +"`src`." +msgstr "" + +#: ../../c-api/refcounting.rst:154 +msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" +msgstr "" + +#: ../../c-api/refcounting.rst:159 +msgid "The safe way is::" +msgstr "" + +#: ../../c-api/refcounting.rst:163 +msgid "" +"That arranges to set `dst` to `src` _before_ decrementing reference count of " +"*dst* old value, so that any code triggered as a side-effect of `dst` " +"getting torn down no longer believes `dst` points to a valid object." +msgstr "" + +#: ../../c-api/refcounting.rst:169 ../../c-api/refcounting.rst:181 msgid "" -"The following functions or macros are only for use within the interpreter " -"core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:" -"`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`." +"The macro arguments are now only evaluated once. If an argument has side " +"effects, these are no longer duplicated." msgstr "" -"以下函式或巨集僅在直譯器核心內使用::c:func:`_Py_Dealloc`、:c:func:" -"`_Py_ForgetReference`、:c:func:`_Py_NewReference` 以及全域變數 :c:data:" -"`_Py_RefTotal`。" + +#: ../../c-api/refcounting.rst:176 +msgid "" +"Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " +"of :c:func:`Py_DECREF`." +msgstr "" + +#~ msgid "" +#~ "The following functions or macros are only for use within the interpreter " +#~ "core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:" +#~ "`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`." +#~ msgstr "" +#~ "以下函式或巨集僅在直譯器核心內使用::c:func:`_Py_Dealloc`、:c:func:" +#~ "`_Py_ForgetReference`、:c:func:`_Py_NewReference` 以及全域變數 :c:data:" +#~ "`_Py_RefTotal`。" diff --git a/c-api/slice.po b/c-api/slice.po index 0fc9b0940c..a21104570f 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,7 +139,11 @@ msgstr "" #: ../../c-api/slice.rst:121 msgid "" -"The Python ``Ellipsis`` object. This object has no methods. It needs to be " -"treated just like any other object with respect to reference counts. Like :" -"c:data:`Py_None` it is a singleton object." +"The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" +"`Py_None`, it is an `immortal `_. " +"singleton object." +msgstr "" + +#: ../../c-api/slice.rst:125 +msgid ":c:data:`Py_Ellipsis` is immortal." msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po index 7f3ce71770..36d158b8b1 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,12 +24,12 @@ msgid "C API Stability" msgstr "C API 穩定性" #: ../../c-api/stable.rst:9 +#, fuzzy msgid "" -"Python's C API is covered by the Backwards Compatibility Policy, :pep:`387`. " -"While the C API will change with every minor release (e.g. from 3.9 to " -"3.10), most changes will be source-compatible, typically by only adding new " -"API. Changing existing API or removing API is only done after a deprecation " -"period or to fix serious issues." +"Unless documented otherwise, Python's C API is covered by the Backwards " +"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " +"(typically by only adding new API). Changing existing API or removing API is " +"only done after a deprecation period or to fix serious issues." msgstr "" "Python 的 C API 被包含在向後相容性策略 :pep:`387` 中。雖然 C API 會隨著每個次" "要版本(例如從 3.9 到 3.10)而變化,但大多數變化都是與原始碼相容的,通常只是" @@ -49,57 +49,101 @@ msgstr "" "行,反之亦然,但 3.9.x 和 3.10.x 就需要分別編譯。" #: ../../c-api/stable.rst:21 +msgid "There are two tiers of C API with different stability exepectations:" +msgstr "" + +#: ../../c-api/stable.rst:23 +msgid "" +":ref:`Unstable API `, may change in minor versions without a " +"deprecation period. It is marked by the ``PyUnstable`` prefix in names." +msgstr "" + +#: ../../c-api/stable.rst:25 +msgid "" +":ref:`Limited API `, is compatible across several minor " +"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " +"exposed from ``Python.h``." +msgstr "" + +#: ../../c-api/stable.rst:29 +msgid "These are discussed in more detail below." +msgstr "" + +#: ../../c-api/stable.rst:31 +#, fuzzy msgid "" "Names prefixed by an underscore, such as ``_Py_InternalState``, are private " -"API that can change without notice even in patch releases." +"API that can change without notice even in patch releases. If you need to " +"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use " +"case." msgstr "" "帶有底線前綴的名稱是私有 API (private API),像是 ``_Py_InternalState``,即使" "在補丁版本 (patch release) 中也可能被更改,不會另行通知。" -#: ../../c-api/stable.rst:26 -msgid "Stable Application Binary Interface" -msgstr "穩定的應用程式二進位介面" +#: ../../c-api/stable.rst:40 +msgid "Unstable C API" +msgstr "" -#: ../../c-api/stable.rst:28 +#: ../../c-api/stable.rst:44 msgid "" -"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " -"Extensions that only use the Limited API can be compiled once and work with " -"multiple versions of Python. Contents of the Limited API are :ref:`listed " -"below `." +"Any API named with the ``PyUnstable`` prefix exposes CPython implementation " +"details, and may change in every minor release (e.g. from 3.9 to 3.10) " +"without any deprecation warnings. However, it will not change in a bugfix " +"release (e.g. from 3.10.0 to 3.10.1)." msgstr "" -"Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。" -"僅使用受限 API 的擴充可以只編譯一次就使用於多個版本的 Python。受限 API 的內容" -"\\ :ref:`列在下方 `。" -#: ../../c-api/stable.rst:33 +#: ../../c-api/stable.rst:49 msgid "" -"To enable this, Python provides a *Stable ABI*: a set of symbols that will " -"remain compatible across Python 3.x versions. The Stable ABI contains " -"symbols exposed in the Limited API, but also other ones – for example, " -"functions necessary to support older versions of the Limited API." +"It is generally intended for specialized, low-level tools like debuggers." msgstr "" -"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python " -"3.x 版本之間保持相容的符號。穩定 ABI 被包含在受限 API 中開放的符號,但也包含" -"其他符號 - 例如,支援舊版受限 API 所必需的函式。" -#: ../../c-api/stable.rst:38 +#: ../../c-api/stable.rst:51 msgid "" -"(For simplicity, this document talks about *extensions*, but the Limited API " +"Projects that use this API are expected to follow CPython development and " +"spend extra effort adjusting to changes." +msgstr "" + +#: ../../c-api/stable.rst:56 +msgid "Stable Application Binary Interface" +msgstr "穩定的應用程式二進位介面" + +#: ../../c-api/stable.rst:58 +#, fuzzy +msgid "" +"For simplicity, this document talks about *extensions*, but the Limited API " "and Stable ABI work the same way for all uses of the API – for example, " -"embedding Python.)" +"embedding Python." msgstr "" "(為簡單起見,本文件討論\\ *擴充 (extension)*,但受限 API 和穩定 ABI 在所有 " "API 使用方式中都以相同的方式運作 -- 例如在嵌入式 Python (embedding Python) " "中。)" -#: ../../c-api/stable.rst:44 +#: ../../c-api/stable.rst:65 +#, fuzzy +msgid "Limited C API" +msgstr "受限 API 注意事項" + +#: ../../c-api/stable.rst:67 +#, fuzzy +msgid "" +"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " +"Extensions that only use the Limited API can be compiled once and work with " +"multiple versions of Python. Contents of the Limited API are :ref:`listed " +"below `." +msgstr "" +"Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。" +"僅使用受限 API 的擴充可以只編譯一次就使用於多個版本的 Python。受限 API 的內容" +"\\ :ref:`列在下方 `。" + +#: ../../c-api/stable.rst:74 msgid "" "Define this macro before including ``Python.h`` to opt in to only use the " "Limited API, and to select the Limited API version." msgstr "" "在包含 ``Python.h`` 之前定義此巨集以選擇只使用受限 API,並挑選受限 API 版本。" -#: ../../c-api/stable.rst:47 +#: ../../c-api/stable.rst:77 msgid "" "Define ``Py_LIMITED_API`` to the value of :c:data:`PY_VERSION_HEX` " "corresponding to the lowest Python version your extension supports. The " @@ -111,7 +155,7 @@ msgstr "" "`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 Python 3 版" "本一起使用,並且可以使用過去版本有引入的受限 API。" -#: ../../c-api/stable.rst:53 +#: ../../c-api/stable.rst:83 msgid "" "Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum " "minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when " @@ -121,7 +165,7 @@ msgstr "" "代表 Python 3.10 的 ``0x030A0000``\\ ),以便在使用未來的 Python 版本進行編譯" "時仍保持穩定性。" -#: ../../c-api/stable.rst:57 +#: ../../c-api/stable.rst:87 msgid "" "You can also define ``Py_LIMITED_API`` to ``3``. This works the same as " "``0x03020000`` (Python 3.2, the version that introduced Limited API)." @@ -129,7 +173,28 @@ msgstr "" "你還可以將 ``Py_LIMITED_API`` 定義為 ``3``,這與 ``0x03020000``\\ (Python " "3.2,引入了受限 API 的版本)相同。" -#: ../../c-api/stable.rst:60 +#: ../../c-api/stable.rst:94 +msgid "Stable ABI" +msgstr "" + +#: ../../c-api/stable.rst:96 +msgid "" +"To enable this, Python provides a *Stable ABI*: a set of symbols that will " +"remain compatible across Python 3.x versions." +msgstr "" + +#: ../../c-api/stable.rst:99 +#, fuzzy +msgid "" +"The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " +"older versions of the Limited API." +msgstr "" +"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python " +"3.x 版本之間保持相容的符號。穩定 ABI 被包含在受限 API 中開放的符號,但也包含" +"其他符號 - 例如,支援舊版受限 API 所必需的函式。" + +#: ../../c-api/stable.rst:103 msgid "" "On Windows, extensions that use the Stable ABI should be linked against " "``python3.dll`` rather than a version-specific library such as ``python39." @@ -138,7 +203,7 @@ msgstr "" "在 Windows 上,使用穩定 ABI 的擴充應該連接到 ``python3.dll`` 而不是特定版本的" "函式庫,例如 ``python39.dll``。" -#: ../../c-api/stable.rst:64 +#: ../../c-api/stable.rst:107 msgid "" "On some platforms, Python will look for and load shared library files named " "with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such " @@ -151,7 +216,7 @@ msgstr "" "用者(或者打包工具)身上,例如使用 3.10+ 受限 API 建置的擴充不會為較低版本的 " "Python 所安裝。" -#: ../../c-api/stable.rst:71 +#: ../../c-api/stable.rst:114 msgid "" "All functions in the Stable ABI are present as functions in Python's shared " "library, not solely as macros. This makes them usable from languages that " @@ -160,18 +225,18 @@ msgstr "" "穩定 ABI 中的所有函式都作為函式存在於 Python 的共享函式庫中,而不僅是作為巨" "集。這使得它們可被用於不使用 C 預處理器 (preprocessor) 的語言。" -#: ../../c-api/stable.rst:77 +#: ../../c-api/stable.rst:120 msgid "Limited API Scope and Performance" msgstr "受限 API 範圍和性能" -#: ../../c-api/stable.rst:79 +#: ../../c-api/stable.rst:122 msgid "" "The goal for the Limited API is to allow everything that is possible with " "the full C API, but possibly with a performance penalty." msgstr "" "受限 API 的目標是允許使用完整的 C API 進行所有可能的操作,但可能會降低性能。" -#: ../../c-api/stable.rst:82 +#: ../../c-api/stable.rst:125 msgid "" "For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro " "variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it " @@ -181,7 +246,7 @@ msgstr "" "`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list 物件的特定" "版本實作細節。" -#: ../../c-api/stable.rst:87 +#: ../../c-api/stable.rst:130 msgid "" "Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " "replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " @@ -192,7 +257,7 @@ msgstr "" "``Py_LIMITED_API`` 會禁用嵌入,從而隨著 Python 資料結構的改進而提高穩定性,但" "可能會降低性能。" -#: ../../c-api/stable.rst:92 +#: ../../c-api/stable.rst:135 msgid "" "By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " "a Limited API extension with a version-specific ABI. This can improve " @@ -206,22 +271,23 @@ msgstr "" "將產生一個擴充,可以在特定版本的擴充不可用的地方發布 — 例如,用於即將發布的 " "Python 版本的預發布版本 (prerelease)。" -#: ../../c-api/stable.rst:101 +#: ../../c-api/stable.rst:144 msgid "Limited API Caveats" msgstr "受限 API 注意事項" -#: ../../c-api/stable.rst:103 +#: ../../c-api/stable.rst:146 +#, fuzzy msgid "" "Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " -"that code conforms to the Limited API or the Stable ABI. ``Py_LIMITED_API`` " -"only covers definitions, but an API also includes other issues, such as " -"expected semantics." +"that code conforms to the :ref:`Limited API ` or the :ref:" +"`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but " +"an API also includes other issues, such as expected semantics." msgstr "" "請注意,使用 ``Py_LIMITED_API`` 進行編譯\\ *不*\\ 完全保證程式碼符合受限 API " "或穩定 ABI。``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他問題,例如預期的" "語義 (semantic)。" -#: ../../c-api/stable.rst:108 +#: ../../c-api/stable.rst:151 msgid "" "One issue that ``Py_LIMITED_API`` does not guard against is calling a " "function with arguments that are invalid in a lower Python version. For " @@ -235,7 +301,7 @@ msgstr "" "現在代表選擇預設行為,但在 Python 3.8 中,引數將被直接使用,導致 ``NULL`` 取" "消參照 (dereference) 且崩潰 (crash)。類似的引數適用於結構 (struct) 的欄位。" -#: ../../c-api/stable.rst:115 +#: ../../c-api/stable.rst:158 msgid "" "Another issue is that some struct fields are currently not hidden when " "``Py_LIMITED_API`` is defined, even though they're part of the Limited API." @@ -243,7 +309,7 @@ msgstr "" "另一個問題是,當有定義 ``Py_LIMITED_API`` 時,一些結構欄位目前不會被隱藏,即" "使它們是受限 API 的一部分。" -#: ../../c-api/stable.rst:118 +#: ../../c-api/stable.rst:161 msgid "" "For these reasons, we recommend testing an extension with *all* minor Python " "versions it supports, and preferably to build with the *lowest* such version." @@ -251,7 +317,7 @@ msgstr "" "出於這些原因,我們建議要以它支援的\\ *所有*\\ 次要 Python 版本來測試擴充,並" "且最好使用\\ *最低*\\ 版本進行建置。" -#: ../../c-api/stable.rst:121 +#: ../../c-api/stable.rst:164 msgid "" "We also recommend reviewing documentation of all used API to check if it is " "explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " @@ -262,7 +328,7 @@ msgstr "" "義 ``Py_LIMITED_API``,一些私有聲明也會因為技術原因(或者甚至是無意地,例如臭" "蟲)而被公開出來。" -#: ../../c-api/stable.rst:126 +#: ../../c-api/stable.rst:169 msgid "" "Also note that the Limited API is not necessarily stable: compiling with " "``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " @@ -274,22 +340,23 @@ msgstr "" "行編譯意味著擴充將能以 Python 3.12 運行,但不一定能以 Python 3.12 *編譯*。特" "別是如果穩定 ABI 保持穩定,部分受限 API 可能會被棄用和刪除。" -#: ../../c-api/stable.rst:136 +#: ../../c-api/stable.rst:179 msgid "Platform Considerations" msgstr "平台注意事項" -#: ../../c-api/stable.rst:138 +#: ../../c-api/stable.rst:181 +#, fuzzy msgid "" "ABI stability depends not only on Python, but also on the compiler used, " -"lower-level libraries and compiler options. For the purposes of the Stable " -"ABI, these details define a “platform”. They usually depend on the OS type " -"and processor architecture" +"lower-level libraries and compiler options. For the purposes of the :ref:" +"`Stable ABI `, these details define a “platform”. They usually " +"depend on the OS type and processor architecture" msgstr "" "ABI 穩定性不僅取決於 Python,還取決於使用的編譯器、低階函式庫和編譯器選項。出" "於穩定 ABI 的目的,這些細節定義了一個「平台」。它們通常取決於作業系統種類和處" "理器架構" -#: ../../c-api/stable.rst:143 +#: ../../c-api/stable.rst:186 msgid "" "It is the responsibility of each particular distributor of Python to ensure " "that all Python versions on a particular platform are built in a way that " @@ -300,10 +367,17 @@ msgstr "" "定 ABI 的方式建置。``python.org`` 和許多第三方發布者發布的 Windows 和 macOS " "版本就是這種情況。" -#: ../../c-api/stable.rst:153 +#: ../../c-api/stable.rst:196 msgid "Contents of Limited API" msgstr "受限 API 的內容" -#: ../../c-api/stable.rst:156 -msgid "Currently, the Limited API includes the following items:" +#: ../../c-api/stable.rst:199 +#, fuzzy +msgid "" +"Currently, the :ref:`Limited API ` includes the following " +"items:" msgstr "目前,受限 API 包括以下項目:" + +#: ../../c-api/stable.rst:42 +msgid "PyUnstable" +msgstr "" diff --git a/c-api/structures.po b/c-api/structures.po index 0eecdf3696..4afd722458 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,10 +40,12 @@ msgid "" "beginning of the object's representation in memory. These are represented " "by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are " "defined, in turn, by the expansions of some macros also used, whether " -"directly or indirectly, in the definition of all other Python objects." +"directly or indirectly, in the definition of all other Python objects. " +"Additional macros can be found under :ref:`reference counting " +"`." msgstr "" -#: ../../c-api/structures.rst:25 +#: ../../c-api/structures.rst:26 msgid "" "All object types are extensions of this type. This is a type which contains " "the information Python needs to treat a pointer to an object as an object. " @@ -54,7 +56,7 @@ msgid "" "macros :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." msgstr "" -#: ../../c-api/structures.rst:37 +#: ../../c-api/structures.rst:38 msgid "" "This is an extension of :c:type:`PyObject` that adds the :attr:`ob_size` " "field. This is only used for objects that have some notion of *length*. " @@ -63,135 +65,114 @@ msgid "" "and :c:macro:`Py_SIZE`." msgstr "" -#: ../../c-api/structures.rst:46 +#: ../../c-api/structures.rst:47 msgid "" "This is a macro used when declaring new types which represent objects " "without a varying length. The PyObject_HEAD macro expands to::" msgstr "" -#: ../../c-api/structures.rst:51 +#: ../../c-api/structures.rst:52 msgid "See documentation of :c:type:`PyObject` above." msgstr "" -#: ../../c-api/structures.rst:56 +#: ../../c-api/structures.rst:57 msgid "" "This is a macro used when declaring new types which represent objects with a " "length that varies from instance to instance. The PyObject_VAR_HEAD macro " "expands to::" msgstr "" -#: ../../c-api/structures.rst:62 +#: ../../c-api/structures.rst:63 msgid "See documentation of :c:type:`PyVarObject` above." msgstr "" -#: ../../c-api/structures.rst:67 +#: ../../c-api/structures.rst:68 msgid "" "Test if the *x* object is the *y* object, the same as ``x is y`` in Python." msgstr "" -#: ../../c-api/structures.rst:74 +#: ../../c-api/structures.rst:75 msgid "" "Test if an object is the ``None`` singleton, the same as ``x is None`` in " "Python." msgstr "" -#: ../../c-api/structures.rst:82 +#: ../../c-api/structures.rst:83 msgid "" "Test if an object is the ``True`` singleton, the same as ``x is True`` in " "Python." msgstr "" -#: ../../c-api/structures.rst:90 +#: ../../c-api/structures.rst:91 msgid "" "Test if an object is the ``False`` singleton, the same as ``x is False`` in " "Python." msgstr "" -#: ../../c-api/structures.rst:98 +#: ../../c-api/structures.rst:99 msgid "Get the type of the Python object *o*." msgstr "" -#: ../../c-api/structures.rst:100 +#: ../../c-api/structures.rst:101 msgid "Return a :term:`borrowed reference`." msgstr "" -#: ../../c-api/structures.rst:102 +#: ../../c-api/structures.rst:103 msgid "Use the :c:func:`Py_SET_TYPE` function to set an object type." msgstr "" -#: ../../c-api/structures.rst:104 +#: ../../c-api/structures.rst:105 msgid "" ":c:func:`Py_TYPE()` is changed to an inline static function. The parameter " "type is no longer :c:expr:`const PyObject*`." msgstr "" -#: ../../c-api/structures.rst:111 +#: ../../c-api/structures.rst:112 msgid "" "Return non-zero if the object *o* type is *type*. Return zero otherwise. " "Equivalent to: ``Py_TYPE(o) == type``." msgstr "" -#: ../../c-api/structures.rst:119 +#: ../../c-api/structures.rst:120 msgid "Set the object *o* type to *type*." msgstr "" -#: ../../c-api/structures.rst:126 -msgid "Get the reference count of the Python object *o*." -msgstr "" - -#: ../../c-api/structures.rst:128 -msgid "" -"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." -msgstr "" - -#: ../../c-api/structures.rst:130 -msgid "The parameter type is no longer :c:expr:`const PyObject*`." -msgstr "" - -#: ../../c-api/structures.rst:133 -msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." -msgstr "" - -#: ../../c-api/structures.rst:139 -msgid "Set the object *o* reference counter to *refcnt*." -msgstr "" - -#: ../../c-api/structures.rst:146 +#: ../../c-api/structures.rst:127 msgid "Get the size of the Python object *o*." msgstr "" -#: ../../c-api/structures.rst:148 +#: ../../c-api/structures.rst:129 msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size." msgstr "" -#: ../../c-api/structures.rst:150 +#: ../../c-api/structures.rst:131 msgid "" ":c:func:`Py_SIZE()` is changed to an inline static function. The parameter " "type is no longer :c:expr:`const PyVarObject*`." msgstr "" -#: ../../c-api/structures.rst:157 +#: ../../c-api/structures.rst:138 msgid "Set the object *o* size to *size*." msgstr "" -#: ../../c-api/structures.rst:164 +#: ../../c-api/structures.rst:145 msgid "" "This is a macro which expands to initialization values for a new :c:type:" "`PyObject` type. This macro expands to::" msgstr "" -#: ../../c-api/structures.rst:173 +#: ../../c-api/structures.rst:154 msgid "" "This is a macro which expands to initialization values for a new :c:type:" "`PyVarObject` type, including the :attr:`ob_size` field. This macro expands " "to::" msgstr "" -#: ../../c-api/structures.rst:182 +#: ../../c-api/structures.rst:163 msgid "Implementing functions and methods" msgstr "" -#: ../../c-api/structures.rst:186 +#: ../../c-api/structures.rst:167 msgid "" "Type of the functions used to implement most Python callables in C. " "Functions of this type take two :c:expr:`PyObject*` parameters and return " @@ -201,58 +182,58 @@ msgid "" "reference." msgstr "" -#: ../../c-api/structures.rst:193 +#: ../../c-api/structures.rst:174 msgid "The function signature is::" msgstr "" -#: ../../c-api/structures.rst:200 +#: ../../c-api/structures.rst:181 msgid "" "Type of the functions used to implement Python callables in C with " "signature :const:`METH_VARARGS | METH_KEYWORDS`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:211 +#: ../../c-api/structures.rst:192 msgid "" "Type of the functions used to implement Python callables in C with " "signature :const:`METH_FASTCALL`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:221 +#: ../../c-api/structures.rst:202 msgid "" "Type of the functions used to implement Python callables in C with " "signature :const:`METH_FASTCALL | METH_KEYWORDS`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:232 +#: ../../c-api/structures.rst:213 msgid "" "Type of the functions used to implement Python callables in C with " "signature :const:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`. The function " "signature is::" msgstr "" -#: ../../c-api/structures.rst:247 +#: ../../c-api/structures.rst:228 msgid "" "Structure used to describe a method of an extension type. This structure " "has four fields:" msgstr "" -#: ../../c-api/structures.rst:252 +#: ../../c-api/structures.rst:233 msgid "name of the method" msgstr "" -#: ../../c-api/structures.rst:256 +#: ../../c-api/structures.rst:237 msgid "pointer to the C implementation" msgstr "" -#: ../../c-api/structures.rst:260 +#: ../../c-api/structures.rst:241 msgid "flags bits indicating how the call should be constructed" msgstr "" -#: ../../c-api/structures.rst:264 ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:245 msgid "points to the contents of the docstring" msgstr "" -#: ../../c-api/structures.rst:266 +#: ../../c-api/structures.rst:247 msgid "" "The :c:member:`ml_meth` is a C function pointer. The functions may be of " "different types, but they always return :c:expr:`PyObject*`. If the " @@ -262,18 +243,18 @@ msgid "" "implementation uses the specific C type of the *self* object." msgstr "" -#: ../../c-api/structures.rst:273 +#: ../../c-api/structures.rst:254 msgid "" "The :c:member:`ml_flags` field is a bitfield which can include the following " "flags. The individual flags indicate either a calling convention or a " "binding convention." msgstr "" -#: ../../c-api/structures.rst:277 +#: ../../c-api/structures.rst:258 msgid "There are these calling conventions:" msgstr "" -#: ../../c-api/structures.rst:281 +#: ../../c-api/structures.rst:262 msgid "" "This is the typical calling convention, where the methods have the type :c:" "type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " @@ -283,7 +264,7 @@ msgid "" "func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" -#: ../../c-api/structures.rst:291 +#: ../../c-api/structures.rst:272 msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " @@ -292,7 +273,7 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:300 +#: ../../c-api/structures.rst:281 msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " @@ -301,11 +282,11 @@ msgid "" "the array)." msgstr "" -#: ../../c-api/structures.rst:310 -msgid "``METH_FASTCALL`` is now part of the stable ABI." +#: ../../c-api/structures.rst:291 +msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." msgstr "" -#: ../../c-api/structures.rst:315 +#: ../../c-api/structures.rst:296 msgid "" "Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " "methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " @@ -317,21 +298,21 @@ msgid "" "arguments." msgstr "" -#: ../../c-api/structures.rst:330 +#: ../../c-api/structures.rst:311 msgid "" "Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " "class*, that is, the class that contains the method in question. The " "defining class might be a superclass of ``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:334 +#: ../../c-api/structures.rst:315 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:343 +#: ../../c-api/structures.rst:324 msgid "" "Methods without parameters don't need to check whether arguments are given " "if they are listed with the :const:`METH_NOARGS` flag. They need to be of " @@ -340,13 +321,13 @@ msgid "" "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:349 +#: ../../c-api/structures.rst:330 msgid "" "The function must have 2 parameters. Since the second parameter is unused, :" "c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" -#: ../../c-api/structures.rst:355 +#: ../../c-api/structures.rst:336 msgid "" "Methods with a single object argument can be listed with the :const:`METH_O` " "flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " @@ -355,7 +336,7 @@ msgid "" "argument." msgstr "" -#: ../../c-api/structures.rst:361 +#: ../../c-api/structures.rst:342 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -363,27 +344,27 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:371 +#: ../../c-api/structures.rst:352 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:381 +#: ../../c-api/structures.rst:362 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:385 +#: ../../c-api/structures.rst:366 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:391 +#: ../../c-api/structures.rst:372 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " @@ -396,352 +377,546 @@ msgid "" "calls." msgstr "" -#: ../../c-api/structures.rst:403 +#: ../../c-api/structures.rst:384 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:407 +#: ../../c-api/structures.rst:388 msgid "" "Structure which describes an attribute of a type which corresponds to a C " -"struct member. Its fields are:" +"struct member. Its fields are, in order:" msgstr "" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 -msgid "Field" +#: ../../c-api/structures.rst:393 +msgid "" +"Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 -msgid "C Type" -msgstr "C Type" +#: ../../c-api/structures.rst:396 +msgid "The string should be static, no copy is made of it." +msgstr "" -#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 -msgid "Meaning" +#: ../../c-api/structures.rst:400 +msgid "" +"The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:413 -msgid ":attr:`name`" -msgstr ":attr:`name`" +#: ../../c-api/structures.rst:404 +msgid "" +"The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " +"possible values." +msgstr "" -#: ../../c-api/structures.rst:413 ../../c-api/structures.rst:426 -#: ../../c-api/structures.rst:442 ../../c-api/structures.rst:509 -#: ../../c-api/structures.rst:517 -msgid "const char \\*" -msgstr "const char \\*" +#: ../../c-api/structures.rst:409 +msgid "" +"Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." +msgstr "" #: ../../c-api/structures.rst:413 -msgid "name of the member" +msgid "" +"The docstring, or NULL. The string should be static, no copy is made of it. " +"Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:415 -msgid ":attr:`!type`" -msgstr ":attr:`!type`" +#: ../../c-api/structures.rst:417 +msgid "" +"By default (when :c:member:`flags` is ``0``), members allow both read and " +"write access. Use the :c:macro:`Py_READONLY` flag for read-only access. " +"Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:`Py_READONLY`. " +"Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:`T_OBJECT`) members can " +"be deleted." +msgstr "" + +#: ../../c-api/structures.rst:426 +msgid "" +"For heap-allocated types (created using :c:func:`PyType_FromSpec` or " +"similar), ``PyMemberDef`` may contain a definition for the special member " +"``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject." +"tp_vectorcall_offset` in type objects. These must be defined with " +"``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" +msgstr "" -#: ../../c-api/structures.rst:415 ../../c-api/structures.rst:422 #: ../../c-api/structures.rst:438 -msgid "int" -msgstr "int" +msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" +msgstr "" -#: ../../c-api/structures.rst:415 -msgid "the type of the member in the C struct" +#: ../../c-api/structures.rst:440 +msgid "" +"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" +"`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " +"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " +"extensions are strongly encouraged to use :const:`Py_TPFLAGS_MANAGED_DICT` " +"and :const:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:418 -msgid ":attr:`offset`" -msgstr ":attr:`offset`" +#: ../../c-api/structures.rst:448 +msgid "" +"``PyMemberDef`` is always available. Previously, it required including " +"``\"structmember.h\"``." +msgstr "" -#: ../../c-api/structures.rst:418 ../../c-api/structures.rst:454 -msgid "Py_ssize_t" -msgstr "Py_ssize_t" +#: ../../c-api/structures.rst:453 +msgid "" +"Get an attribute belonging to the object at address *obj_addr*. The " +"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." +msgstr "" -#: ../../c-api/structures.rst:418 +#: ../../c-api/structures.rst:459 msgid "" -"the offset in bytes that the member is located on the type's object struct" +"``PyMember_GetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:422 -msgid ":attr:`flags`" -msgstr ":attr:`flags`" +#: ../../c-api/structures.rst:464 +msgid "" +"Set an attribute belonging to the object at address *obj_addr* to object " +"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " +"``0`` if successful and a negative value on failure." +msgstr "" -#: ../../c-api/structures.rst:422 -msgid "flag bits indicating if the field should be read-only or writable" +#: ../../c-api/structures.rst:470 +msgid "" +"``PyMember_SetOne`` is always available. Previously, it required including " +"``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:426 -msgid ":attr:`doc`" -msgstr ":attr:`doc`" +#: ../../c-api/structures.rst:476 +msgid "Member flags" +msgstr "" -#: ../../c-api/structures.rst:430 -msgid "" -":attr:`!type` can be one of many ``T_`` macros corresponding to various C " -"types. When the member is accessed in Python, it will be converted to the " -"equivalent Python type." +#: ../../c-api/structures.rst:478 +msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:435 -msgid "Macro name" +#: ../../c-api/structures.rst:482 +msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:435 -msgid "C type" +#: ../../c-api/structures.rst:486 +msgid "" +"Emit an ``object.__getattr__`` :ref:`audit event ` before " +"reading." msgstr "" -#: ../../c-api/structures.rst:437 -msgid "T_SHORT" -msgstr "T_SHORT" +#: ../../c-api/structures.rst:491 +msgid "" +"Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " +"entry indicates an offset from the subclass-specific data, rather than from " +"``PyObject``." +msgstr "" -#: ../../c-api/structures.rst:437 -msgid "short" +#: ../../c-api/structures.rst:495 +msgid "" +"Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " +"negative :c:member:`~PyTypeDef.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:438 -msgid "T_INT" -msgstr "T_INT" +#: ../../c-api/structures.rst:500 +msgid "" +"This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" +"`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" +"c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." +msgstr "" -#: ../../c-api/structures.rst:439 -msgid "T_LONG" -msgstr "T_LONG" +#: ../../c-api/structures.rst:512 +msgid "" +"The :const:`!RESTRICTED`, :const:`!READ_RESTRICTED` and :const:`!" +"WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " +"deprecated. :const:`!READ_RESTRICTED` and :const:`!RESTRICTED` are " +"equivalent to :const:`Py_AUDIT_READ`; :const:`!WRITE_RESTRICTED` does " +"nothing." +msgstr "" -#: ../../c-api/structures.rst:439 -msgid "long" -msgstr "long" +#: ../../c-api/structures.rst:523 +msgid "" +"The :const:`!READONLY` macro was renamed to :const:`Py_READONLY`. The :const:" +"`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new names " +"are now always available. Previously, these required ``#include " +"\"structmember.h\"``. The header is still available and it provides the old " +"names." +msgstr "" -#: ../../c-api/structures.rst:440 -msgid "T_FLOAT" -msgstr "T_FLOAT" +#: ../../c-api/structures.rst:532 +msgid "Member types" +msgstr "" -#: ../../c-api/structures.rst:440 -msgid "float" -msgstr "float" +#: ../../c-api/structures.rst:534 +msgid "" +":c:member:`PyMemberDef.type` can be one of the following macros " +"corresponding to various C types. When the member is accessed in Python, it " +"will be converted to the equivalent Python type. When it is set from Python, " +"it will be converted back to the C type. If that is not possible, an " +"exception such as :exc:`TypeError` or :exc:`ValueError` is raised." +msgstr "" -#: ../../c-api/structures.rst:441 -msgid "T_DOUBLE" -msgstr "T_DOUBLE" +#: ../../c-api/structures.rst:542 +msgid "" +"Unless marked (D), attributes defined this way cannot be deleted using e.g. :" +"keyword:`del` or :py:func:`delattr`." +msgstr "" -#: ../../c-api/structures.rst:441 -msgid "double" -msgstr "double" +#: ../../c-api/structures.rst:546 +msgid "Macro name" +msgstr "" -#: ../../c-api/structures.rst:442 -msgid "T_STRING" -msgstr "T_STRING" +#: ../../c-api/structures.rst:546 +msgid "C type" +msgstr "" -#: ../../c-api/structures.rst:443 -msgid "T_OBJECT" -msgstr "T_OBJECT" +#: ../../c-api/structures.rst:546 +msgid "Python type" +msgstr "" -#: ../../c-api/structures.rst:443 ../../c-api/structures.rst:444 -msgid "PyObject \\*" -msgstr "PyObject \\*" +#: ../../c-api/structures.rst:548 +msgid ":c:expr:`char`" +msgstr "" -#: ../../c-api/structures.rst:444 -msgid "T_OBJECT_EX" -msgstr "T_OBJECT_EX" +#: ../../c-api/structures.rst:548 ../../c-api/structures.rst:549 +#: ../../c-api/structures.rst:550 ../../c-api/structures.rst:551 +#: ../../c-api/structures.rst:552 ../../c-api/structures.rst:553 +#: ../../c-api/structures.rst:554 ../../c-api/structures.rst:555 +#: ../../c-api/structures.rst:556 ../../c-api/structures.rst:557 +#: ../../c-api/structures.rst:558 +msgid ":py:class:`int`" +msgstr "" -#: ../../c-api/structures.rst:445 -msgid "T_CHAR" -msgstr "T_CHAR" +#: ../../c-api/structures.rst:549 +msgid ":c:expr:`short`" +msgstr "" -#: ../../c-api/structures.rst:445 ../../c-api/structures.rst:446 -#: ../../c-api/structures.rst:451 -msgid "char" -msgstr "char" +#: ../../c-api/structures.rst:550 +msgid ":c:expr:`int`" +msgstr "" -#: ../../c-api/structures.rst:446 -msgid "T_BYTE" -msgstr "T_BYTE" +#: ../../c-api/structures.rst:551 +msgid ":c:expr:`long`" +msgstr "" -#: ../../c-api/structures.rst:447 -msgid "T_UBYTE" -msgstr "T_UBYTE" +#: ../../c-api/structures.rst:552 +#, fuzzy +msgid ":c:expr:`long long`" +msgstr "long long" -#: ../../c-api/structures.rst:447 -msgid "unsigned char" +#: ../../c-api/structures.rst:553 +#, fuzzy +msgid ":c:expr:`unsigned char`" msgstr "unsigned char" -#: ../../c-api/structures.rst:448 -msgid "T_UINT" -msgstr "T_UINT" - -#: ../../c-api/structures.rst:448 -msgid "unsigned int" +#: ../../c-api/structures.rst:554 +#, fuzzy +msgid ":c:expr:`unsigned int`" msgstr "unsigned int" -#: ../../c-api/structures.rst:449 -msgid "T_USHORT" -msgstr "T_USHORT" - -#: ../../c-api/structures.rst:449 -msgid "unsigned short" +#: ../../c-api/structures.rst:555 +#, fuzzy +msgid ":c:expr:`unsigned short`" msgstr "unsigned short" -#: ../../c-api/structures.rst:450 -msgid "T_ULONG" -msgstr "T_ULONG" - -#: ../../c-api/structures.rst:450 -msgid "unsigned long" +#: ../../c-api/structures.rst:556 +#, fuzzy +msgid ":c:expr:`unsigned long`" msgstr "unsigned long" -#: ../../c-api/structures.rst:451 -msgid "T_BOOL" -msgstr "T_BOOL" +#: ../../c-api/structures.rst:557 +#, fuzzy +msgid ":c:expr:`unsigned long long`" +msgstr "unsigned long long" -#: ../../c-api/structures.rst:452 -msgid "T_LONGLONG" -msgstr "T_LONGLONG" +#: ../../c-api/structures.rst:558 +#, fuzzy +msgid ":c:expr:`Py_ssize_t`" +msgstr "Py_ssize_t" -#: ../../c-api/structures.rst:452 -msgid "long long" -msgstr "long long" +#: ../../c-api/structures.rst:559 +msgid ":c:expr:`float`" +msgstr "" -#: ../../c-api/structures.rst:453 -msgid "T_ULONGLONG" -msgstr "T_ULONGLONG" +#: ../../c-api/structures.rst:559 ../../c-api/structures.rst:560 +msgid ":py:class:`float`" +msgstr "" -#: ../../c-api/structures.rst:453 -msgid "unsigned long long" -msgstr "unsigned long long" +#: ../../c-api/structures.rst:560 +msgid ":c:expr:`double`" +msgstr "" -#: ../../c-api/structures.rst:454 -msgid "T_PYSSIZET" -msgstr "T_PYSSIZET" +#: ../../c-api/structures.rst:561 +msgid ":c:expr:`char` (written as 0 or 1)" +msgstr "" -#: ../../c-api/structures.rst:457 -msgid "" -":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:" -"`T_OBJECT` returns ``None`` if the member is ``NULL`` and :c:macro:" -"`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use :c:macro:" -"`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX` " -"handles use of the :keyword:`del` statement on that attribute more correctly " -"than :c:macro:`T_OBJECT`." +#: ../../c-api/structures.rst:561 +msgid ":py:class:`bool`" msgstr "" -#: ../../c-api/structures.rst:464 -msgid "" -":attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` " -"for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:" -"macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8. Only :c:" -"macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They " -"are set to ``NULL``)." +#: ../../c-api/structures.rst:563 +#, fuzzy +msgid ":c:expr:`const char *` (*)" +msgstr "const char \\*" + +#: ../../c-api/structures.rst:563 ../../c-api/structures.rst:564 +msgid ":py:class:`str` (RO)" msgstr "" -#: ../../c-api/structures.rst:472 -msgid "" -"Heap allocated types (created using :c:func:`PyType_FromSpec` or similar), " -"``PyMemberDef`` may contain definitions for the special members " -"``__dictoffset__``, ``__weaklistoffset__`` and ``__vectorcalloffset__``, " -"corresponding to :c:member:`~PyTypeObject.tp_dictoffset`, :c:member:" -"`~PyTypeObject.tp_weaklistoffset` and :c:member:`~PyTypeObject." -"tp_vectorcall_offset` in type objects. These must be defined with " -"``T_PYSSIZET`` and ``READONLY``, for example::" +#: ../../c-api/structures.rst:564 +#, fuzzy +msgid ":c:expr:`const char[]` (*)" +msgstr "const char \\*" + +#: ../../c-api/structures.rst:565 +msgid ":c:expr:`char` (0-127)" msgstr "" -#: ../../c-api/structures.rst:489 -msgid "" -"Get an attribute belonging to the object at address *obj_addr*. The " -"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." +#: ../../c-api/structures.rst:565 +msgid ":py:class:`str` (**)" msgstr "" -#: ../../c-api/structures.rst:496 -msgid "" -"Set an attribute belonging to the object at address *obj_addr* to object " -"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " -"``0`` if successful and a negative value on failure." +#: ../../c-api/structures.rst:566 +#, fuzzy +msgid ":c:expr:`PyObject *`" +msgstr "PyObject \\*" + +#: ../../c-api/structures.rst:566 +msgid ":py:class:`object` (D)" msgstr "" -#: ../../c-api/structures.rst:503 +#: ../../c-api/structures.rst:569 msgid "" -"Structure to define property-like access for a type. See also description of " -"the :c:member:`PyTypeObject.tp_getset` slot." +"(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " +"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " +"string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:509 -msgid "name" +#: ../../c-api/structures.rst:574 +msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:509 -msgid "attribute name" +#: ../../c-api/structures.rst:576 +msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:511 -msgid "get" +#: ../../c-api/structures.rst:578 +msgid "" +"(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " +"``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:511 -msgid "getter" +#: ../../c-api/structures.rst:604 +msgid "" +"In previous versions, the macros were only available with ``#include " +"\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " +"``T_INT``). The header is still available and contains the old names, along " +"with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:511 -msgid "C function to get the attribute" +#: ../../c-api/structures.rst:612 +msgid "" +"Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " +"in surprising behavior in Python: deleting the attribute effectively sets it " +"to ``None``." msgstr "" -#: ../../c-api/structures.rst:513 -msgid "set" +#: ../../c-api/structures.rst:618 +msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:513 -msgid "setter" +#: ../../c-api/structures.rst:621 +msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:513 +#: ../../c-api/structures.rst:625 msgid "" -"optional C function to set or delete the attribute, if omitted the attribute " -"is readonly" +"Structure to define property-like access for a type. See also description of " +"the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:517 -msgid "doc" +#: ../../c-api/structures.rst:630 +msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:517 -msgid "optional docstring" +#: ../../c-api/structures.rst:634 +msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:519 -msgid "closure" +#: ../../c-api/structures.rst:638 +msgid "" +"Optional C function to set or delete the attribute, if omitted the attribute " +"is readonly." msgstr "" -#: ../../c-api/structures.rst:519 -msgid "void \\*" -msgstr "void \\*" +#: ../../c-api/structures.rst:642 +msgid "optional docstring" +msgstr "" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:646 msgid "" -"optional function pointer, providing additional data for getter and setter" +"Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:524 +#: ../../c-api/structures.rst:648 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:529 +#: ../../c-api/structures.rst:653 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:656 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:537 +#: ../../c-api/structures.rst:661 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" -#: ../../c-api/structures.rst:369 ../../c-api/structures.rst:379 +#: ../../c-api/structures.rst:350 ../../c-api/structures.rst:360 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/structures.rst:369 +#: ../../c-api/structures.rst:350 msgid "classmethod" msgstr "classmethod" -#: ../../c-api/structures.rst:379 +#: ../../c-api/structures.rst:360 msgid "staticmethod" msgstr "staticmethod" + +#: ../../c-api/structures.rst:505 +msgid "READ_RESTRICTED" +msgstr "" + +#: ../../c-api/structures.rst:505 +msgid "WRITE_RESTRICTED" +msgstr "" + +#: ../../c-api/structures.rst:505 +msgid "RESTRICTED" +msgstr "" + +#: ../../c-api/structures.rst:518 +msgid "READONLY" +msgstr "" + +#: ../../c-api/structures.rst:581 +msgid "T_BYTE" +msgstr "T_BYTE" + +#: ../../c-api/structures.rst:581 +msgid "T_SHORT" +msgstr "T_SHORT" + +#: ../../c-api/structures.rst:581 +msgid "T_INT" +msgstr "T_INT" + +#: ../../c-api/structures.rst:581 +msgid "T_LONG" +msgstr "T_LONG" + +#: ../../c-api/structures.rst:581 +msgid "T_LONGLONG" +msgstr "T_LONGLONG" + +#: ../../c-api/structures.rst:581 +msgid "T_UBYTE" +msgstr "T_UBYTE" + +#: ../../c-api/structures.rst:581 +msgid "T_USHORT" +msgstr "T_USHORT" + +#: ../../c-api/structures.rst:581 +msgid "T_UINT" +msgstr "T_UINT" + +#: ../../c-api/structures.rst:581 +msgid "T_ULONG" +msgstr "T_ULONG" + +#: ../../c-api/structures.rst:581 +#, fuzzy +msgid "T_ULONGULONG" +msgstr "T_ULONGLONG" + +#: ../../c-api/structures.rst:581 +msgid "T_PYSSIZET" +msgstr "T_PYSSIZET" + +#: ../../c-api/structures.rst:581 +msgid "T_FLOAT" +msgstr "T_FLOAT" + +#: ../../c-api/structures.rst:581 +msgid "T_DOUBLE" +msgstr "T_DOUBLE" + +#: ../../c-api/structures.rst:581 +msgid "T_BOOL" +msgstr "T_BOOL" + +#: ../../c-api/structures.rst:581 +msgid "T_CHAR" +msgstr "T_CHAR" + +#: ../../c-api/structures.rst:581 +msgid "T_STRING" +msgstr "T_STRING" + +#: ../../c-api/structures.rst:581 +#, fuzzy +msgid "T_STRING_INPLACE" +msgstr "T_STRING" + +#: ../../c-api/structures.rst:581 +msgid "T_OBJECT_EX" +msgstr "T_OBJECT_EX" + +#: ../../c-api/structures.rst:581 +msgid "structmember.h" +msgstr "" + +#~ msgid "C Type" +#~ msgstr "C Type" + +#~ msgid ":attr:`name`" +#~ msgstr ":attr:`name`" + +#~ msgid ":attr:`!type`" +#~ msgstr ":attr:`!type`" + +#~ msgid "int" +#~ msgstr "int" + +#~ msgid ":attr:`offset`" +#~ msgstr ":attr:`offset`" + +#~ msgid ":attr:`flags`" +#~ msgstr ":attr:`flags`" + +#~ msgid ":attr:`doc`" +#~ msgstr ":attr:`doc`" + +#~ msgid "long" +#~ msgstr "long" + +#~ msgid "float" +#~ msgstr "float" + +#~ msgid "double" +#~ msgstr "double" + +#~ msgid "T_OBJECT" +#~ msgstr "T_OBJECT" + +#~ msgid "char" +#~ msgstr "char" + +#~ msgid "void \\*" +#~ msgstr "void \\*" diff --git a/c-api/sys.po b/c-api/sys.po index fc9b3843eb..559dca616f 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,13 +39,17 @@ msgstr "" msgid "" "Return true (nonzero) if the standard I/O file *fp* with name *filename* is " "deemed interactive. This is the case for files for which " -"``isatty(fileno(fp))`` is true. If the global flag :c:data:" -"`Py_InteractiveFlag` is true, this function also returns true if the " -"*filename* pointer is ``NULL`` or if the name is equal to one of the strings " -"``''`` or ``'???'``." +"``isatty(fileno(fp))`` is true. If the :c:member:`PyConfig.interactive` is " +"non-zero, this function also returns true if the *filename* pointer is " +"``NULL`` or if the name is equal to one of the strings ``''`` or " +"``'???'``." msgstr "" -#: ../../c-api/sys.rst:31 +#: ../../c-api/sys.rst:28 +msgid "This function must not be called before Python is initialized." +msgstr "" + +#: ../../c-api/sys.rst:33 msgid "" "Function to prepare some internal state before a process fork. This should " "be called before calling :c:func:`fork` or any similar function that clones " @@ -53,14 +57,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:37 +#: ../../c-api/sys.rst:39 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" -#: ../../c-api/sys.rst:47 +#: ../../c-api/sys.rst:49 msgid "" "Function to update some internal state after a process fork. This should be " "called from the parent process after calling :c:func:`fork` or any similar " @@ -69,14 +73,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:54 +#: ../../c-api/sys.rst:56 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" -#: ../../c-api/sys.rst:64 +#: ../../c-api/sys.rst:66 msgid "" "Function to update internal interpreter state after a process fork. This " "must be called from the child process after calling :c:func:`fork`, or any " @@ -85,21 +89,21 @@ msgid "" "systems where :c:func:`fork` is defined." msgstr "" -#: ../../c-api/sys.rst:71 +#: ../../c-api/sys.rst:73 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" -#: ../../c-api/sys.rst:79 +#: ../../c-api/sys.rst:81 msgid "" ":func:`os.register_at_fork` allows registering custom Python functions to be " "called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" "c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../c-api/sys.rst:86 +#: ../../c-api/sys.rst:88 msgid "" "Function to update some internal state after a process fork; this should be " "called in the new process if the Python interpreter will continue to be " @@ -107,11 +111,11 @@ msgid "" "not need to be called." msgstr "" -#: ../../c-api/sys.rst:91 +#: ../../c-api/sys.rst:93 msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." msgstr "" -#: ../../c-api/sys.rst:97 +#: ../../c-api/sys.rst:99 msgid "" "Return true when the interpreter runs out of stack space. This is a " "reliable check, but is only available when :const:`USE_STACKCHECK` is " @@ -120,7 +124,7 @@ msgid "" "should never change the definition in your own code." msgstr "" -#: ../../c-api/sys.rst:106 +#: ../../c-api/sys.rst:108 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " "around either :c:func:`sigaction` or :c:func:`signal`. Do not call those " @@ -128,7 +132,7 @@ msgid "" "expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:114 +#: ../../c-api/sys.rst:116 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " "handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:" @@ -136,21 +140,21 @@ msgid "" "`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:122 +#: ../../c-api/sys.rst:124 msgid "" "This function should not be called directly: use the :c:type:`PyConfig` API " "with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" "`Python is preinitialized `." msgstr "" -#: ../../c-api/sys.rst:126 ../../c-api/sys.rst:193 +#: ../../c-api/sys.rst:128 ../../c-api/sys.rst:195 msgid "" "This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" "func:`Py_PreInitialize` function." msgstr "" -#: ../../c-api/sys.rst:130 +#: ../../c-api/sys.rst:132 msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " @@ -160,57 +164,57 @@ msgid "" "instead of decoding them." msgstr "" -#: ../../c-api/sys.rst:137 +#: ../../c-api/sys.rst:139 msgid "" "Return a pointer to a newly allocated wide character string, use :c:func:" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " "number of wide characters excluding the null character into ``*size``" msgstr "" -#: ../../c-api/sys.rst:141 +#: ../../c-api/sys.rst:143 msgid "" "Return ``NULL`` on decoding error or memory allocation error. If *size* is " "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " "``(size_t)-2`` on decoding error." msgstr "" -#: ../../c-api/sys.rst:145 ../../c-api/sys.rst:185 +#: ../../c-api/sys.rst:147 ../../c-api/sys.rst:187 msgid "" "The :term:`filesystem encoding and error handler` are selected by :c:func:" "`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" "`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" -#: ../../c-api/sys.rst:149 +#: ../../c-api/sys.rst:151 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "" -#: ../../c-api/sys.rst:152 +#: ../../c-api/sys.rst:154 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." msgstr "" -#: ../../c-api/sys.rst:157 +#: ../../c-api/sys.rst:159 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" -#: ../../c-api/sys.rst:162 ../../c-api/sys.rst:204 +#: ../../c-api/sys.rst:164 ../../c-api/sys.rst:206 msgid "" "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " "`." msgstr "" -#: ../../c-api/sys.rst:166 +#: ../../c-api/sys.rst:168 msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:data:" -"`Py_LegacyWindowsFSEncodingFlag` is zero;" +"The function now uses the UTF-8 encoding on Windows if :c:member:`PyConfig." +"legacy_windows_fs_encoding` is zero;" msgstr "" -#: ../../c-api/sys.rst:173 +#: ../../c-api/sys.rst:175 msgid "" "Encode a wide character string to the :term:`filesystem encoding and error " "handler`. If the error handler is :ref:`surrogateescape error handler " @@ -218,42 +222,42 @@ msgid "" "converted to bytes 0x80..0xFF." msgstr "" -#: ../../c-api/sys.rst:178 +#: ../../c-api/sys.rst:180 msgid "" "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " "to free the memory. Return ``NULL`` on encoding error or memory allocation " "error." msgstr "" -#: ../../c-api/sys.rst:182 +#: ../../c-api/sys.rst:184 msgid "" "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " "success, or set to the index of the invalid character on encoding error." msgstr "" -#: ../../c-api/sys.rst:189 +#: ../../c-api/sys.rst:191 msgid "" "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " "to a wide character string." msgstr "" -#: ../../c-api/sys.rst:199 +#: ../../c-api/sys.rst:201 msgid "" "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " "functions." msgstr "" -#: ../../c-api/sys.rst:208 +#: ../../c-api/sys.rst:210 msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:data:" -"`Py_LegacyWindowsFSEncodingFlag` is zero." +"The function now uses the UTF-8 encoding on Windows if :c:member:`PyConfig." +"legacy_windows_fs_encoding` is zero." msgstr "" -#: ../../c-api/sys.rst:216 +#: ../../c-api/sys.rst:218 msgid "System Functions" msgstr "系統函式" -#: ../../c-api/sys.rst:218 +#: ../../c-api/sys.rst:220 msgid "" "These are utility functions that make functionality from the :mod:`sys` " "module accessible to C code. They all work with the current interpreter " @@ -261,43 +265,43 @@ msgid "" "state structure." msgstr "" -#: ../../c-api/sys.rst:224 +#: ../../c-api/sys.rst:226 msgid "" "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " "not exist, without setting an exception." msgstr "" -#: ../../c-api/sys.rst:229 +#: ../../c-api/sys.rst:231 msgid "" "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " "case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " "on error." msgstr "" -#: ../../c-api/sys.rst:235 +#: ../../c-api/sys.rst:237 msgid "" "Reset :data:`sys.warnoptions` to an empty list. This function may be called " "prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:240 ../../c-api/sys.rst:251 +#: ../../c-api/sys.rst:242 ../../c-api/sys.rst:253 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "warnoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:244 +#: ../../c-api/sys.rst:246 msgid "" "Append *s* to :data:`sys.warnoptions`. This function must be called prior " "to :c:func:`Py_Initialize` in order to affect the warnings filter list." msgstr "" -#: ../../c-api/sys.rst:255 +#: ../../c-api/sys.rst:257 msgid "Append *unicode* to :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/sys.rst:257 +#: ../../c-api/sys.rst:259 msgid "" "Note: this function is not currently usable from outside the CPython " "implementation, as it must be called prior to the implicit import of :mod:" @@ -306,7 +310,7 @@ msgid "" "Unicode objects." msgstr "" -#: ../../c-api/sys.rst:267 +#: ../../c-api/sys.rst:269 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -314,20 +318,20 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/sys.rst:272 +#: ../../c-api/sys.rst:274 msgid "" "Set :data:`sys.path` to a list object of paths found in *path* which should " "be a list of paths separated with the platform's search path delimiter (``:" "`` on Unix, ``;`` on Windows)." msgstr "" -#: ../../c-api/sys.rst:280 +#: ../../c-api/sys.rst:282 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." msgstr "" -#: ../../c-api/sys.rst:283 +#: ../../c-api/sys.rst:285 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -338,58 +342,58 @@ msgid "" "of digits for very large numbers." msgstr "" -#: ../../c-api/sys.rst:291 +#: ../../c-api/sys.rst:293 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." msgstr "" -#: ../../c-api/sys.rst:296 +#: ../../c-api/sys.rst:298 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:301 +#: ../../c-api/sys.rst:303 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " "length." msgstr "" -#: ../../c-api/sys.rst:309 +#: ../../c-api/sys.rst:311 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:316 +#: ../../c-api/sys.rst:318 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "xoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:320 +#: ../../c-api/sys.rst:322 msgid "" "Parse *s* as a set of :option:`-X` options and add them to the current " "options mapping as returned by :c:func:`PySys_GetXOptions`. This function " "may be called prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:330 +#: ../../c-api/sys.rst:332 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." msgstr "" -#: ../../c-api/sys.rst:339 +#: ../../c-api/sys.rst:341 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: ../../c-api/sys.rst:342 +#: ../../c-api/sys.rst:344 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " @@ -400,23 +404,23 @@ msgid "" "leaks.)" msgstr "" -#: ../../c-api/sys.rst:350 +#: ../../c-api/sys.rst:352 msgid "" "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:353 +#: ../../c-api/sys.rst:355 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: ../../c-api/sys.rst:359 +#: ../../c-api/sys.rst:361 msgid "" "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: ../../c-api/sys.rst:365 +#: ../../c-api/sys.rst:367 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " "on success and non-zero on failure. If the runtime has been initialized, " @@ -424,14 +428,14 @@ msgid "" "all interpreters created by the runtime." msgstr "" -#: ../../c-api/sys.rst:371 +#: ../../c-api/sys.rst:373 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -#: ../../c-api/sys.rst:375 +#: ../../c-api/sys.rst:377 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -439,7 +443,7 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: ../../c-api/sys.rst:380 +#: ../../c-api/sys.rst:382 msgid "" "The hook function is of type :c:expr:`int (*)(const char *event, PyObject " "*args, void *userData)`, where *args* is guaranteed to be a :c:type:" @@ -447,21 +451,21 @@ msgid "" "Python interpreter that raised the event." msgstr "" -#: ../../c-api/sys.rst:385 +#: ../../c-api/sys.rst:387 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:390 +#: ../../c-api/sys.rst:392 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" -#: ../../c-api/sys.rst:392 +#: ../../c-api/sys.rst:394 msgid "" "If the interpreter is initialized, this function raises a auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -470,11 +474,11 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" -#: ../../c-api/sys.rst:404 +#: ../../c-api/sys.rst:406 msgid "Process Control" msgstr "行程(Process)控制" -#: ../../c-api/sys.rst:411 +#: ../../c-api/sys.rst:413 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " @@ -484,29 +488,29 @@ msgid "" "file:`core` file." msgstr "" -#: ../../c-api/sys.rst:418 +#: ../../c-api/sys.rst:420 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: ../../c-api/sys.rst:422 +#: ../../c-api/sys.rst:424 msgid "Log the function name automatically." msgstr "" -#: ../../c-api/sys.rst:432 +#: ../../c-api/sys.rst:434 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" "`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" -#: ../../c-api/sys.rst:436 +#: ../../c-api/sys.rst:438 msgid "Errors from finalization no longer ignored." msgstr "" -#: ../../c-api/sys.rst:446 +#: ../../c-api/sys.rst:448 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -518,18 +522,18 @@ msgid "" "should be called by *func*." msgstr "" -#: ../../c-api/sys.rst:409 +#: ../../c-api/sys.rst:411 msgid "abort()" msgstr "abort()" -#: ../../c-api/sys.rst:428 ../../c-api/sys.rst:442 +#: ../../c-api/sys.rst:430 ../../c-api/sys.rst:444 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/sys.rst:428 +#: ../../c-api/sys.rst:430 msgid "exit()" msgstr "exit()" -#: ../../c-api/sys.rst:442 +#: ../../c-api/sys.rst:444 msgid "cleanup functions" msgstr "cleanup functions(清理函式)" diff --git a/c-api/tuple.po b/c-api/tuple.po index 8af7013abf..cdf2960082 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,7 +82,7 @@ msgstr "" msgid "" "Return the slice of the tuple pointed to by *p* between *low* and *high*, or " "``NULL`` on failure. This is the equivalent of the Python expression " -"``p[low:high]``. Indexing from the end of the list is not supported." +"``p[low:high]``. Indexing from the end of the tuple is not supported." msgstr "" #: ../../c-api/tuple.rst:77 diff --git a/c-api/type.po b/c-api/type.po index af47243515..3dd387dfde 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,7 +55,8 @@ msgid "" "Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " "function is primarily meant for use with ``Py_LIMITED_API``; the individual " "flag bits are guaranteed to be stable across Python releases, but access to :" -"c:member:`~PyTypeObject.tp_flags` itself is not part of the limited API." +"c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited " +"API `." msgstr "" #: ../../c-api/type.rst:49 @@ -64,49 +65,119 @@ msgstr "" #: ../../c-api/type.rst:55 msgid "" +"Return the type object's internal namespace, which is otherwise only exposed " +"via a read-only proxy (``cls.__dict__``). This is a replacement for " +"accessing :c:member:`~PyTypeObject.tp_dict` directly. The returned " +"dictionary must be treated as read-only." +msgstr "" + +#: ../../c-api/type.rst:60 +msgid "" +"This function is meant for specific embedding and language-binding cases, " +"where direct access to the dict is necessary and indirect access (e.g. via " +"the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." +msgstr "" + +#: ../../c-api/type.rst:64 +msgid "" +"Extension modules should continue to use ``tp_dict``, directly or " +"indirectly, when setting up their own types." +msgstr "" + +#: ../../c-api/type.rst:72 +msgid "" "Invalidate the internal lookup cache for the type and all of its subtypes. " "This function must be called after any manual modification of the attributes " "or base classes of the type." msgstr "" -#: ../../c-api/type.rst:62 +#: ../../c-api/type.rst:79 +msgid "" +"Register *callback* as a type watcher. Return a non-negative integer ID " +"which must be passed to future calls to :c:func:`PyType_Watch`. In case of " +"error (e.g. no more watcher IDs available), return ``-1`` and set an " +"exception." +msgstr "" + +#: ../../c-api/type.rst:89 +msgid "" +"Clear watcher identified by *watcher_id* (previously returned from :c:func:" +"`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " +"*watcher_id* was never registered.)" +msgstr "" + +#: ../../c-api/type.rst:93 +msgid "" +"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " +"that was not returned to it by a previous call to :c:func:" +"`PyType_AddWatcher`." +msgstr "" + +#: ../../c-api/type.rst:102 +msgid "" +"Mark *type* as watched. The callback granted *watcher_id* by :c:func:" +"`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " +"reports a change to *type*. (The callback may be called only once for a " +"series of consecutive modifications to *type*, if :c:func:`PyType_Lookup` is " +"not called on *type* between the modifications; this is an implementation " +"detail and subject to change.)" +msgstr "" + +#: ../../c-api/type.rst:109 +msgid "" +"An extension should never call ``PyType_Watch`` with a *watcher_id* that was " +"not returned to it by a previous call to :c:func:`PyType_AddWatcher`." +msgstr "" + +#: ../../c-api/type.rst:117 +msgid "Type of a type-watcher callback function." +msgstr "" + +#: ../../c-api/type.rst:119 +msgid "" +"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be " +"called on *type* or any type in its MRO; violating this rule could cause " +"infinite recursion." +msgstr "" + +#: ../../c-api/type.rst:128 msgid "" "Return non-zero if the type object *o* sets the feature *feature*. Type " "features are denoted by single bit flags." msgstr "" -#: ../../c-api/type.rst:68 +#: ../../c-api/type.rst:134 msgid "" "Return true if the type object includes support for the cycle detector; this " "tests the type flag :const:`Py_TPFLAGS_HAVE_GC`." msgstr "" -#: ../../c-api/type.rst:74 +#: ../../c-api/type.rst:140 msgid "Return true if *a* is a subtype of *b*." msgstr "" -#: ../../c-api/type.rst:76 +#: ../../c-api/type.rst:142 msgid "" "This function only checks for actual subtypes, which means that :meth:" "`~class.__subclasscheck__` is not called on *b*. Call :c:func:" "`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do." msgstr "" -#: ../../c-api/type.rst:84 +#: ../../c-api/type.rst:150 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " "object. Use Python's default memory allocation mechanism to allocate a new " "instance and initialize all its contents to ``NULL``." msgstr "" -#: ../../c-api/type.rst:90 +#: ../../c-api/type.rst:156 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " "object. Create a new instance using the type's :c:member:`~PyTypeObject." "tp_alloc` slot." msgstr "" -#: ../../c-api/type.rst:95 +#: ../../c-api/type.rst:161 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -114,7 +185,7 @@ msgid "" "and sets an exception on error." msgstr "" -#: ../../c-api/type.rst:101 +#: ../../c-api/type.rst:167 msgid "" "If some of the base classes implements the GC protocol and the provided type " "does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " @@ -124,19 +195,19 @@ msgid "" "implementing the :c:member:`~PyTypeObject.tp_traverse` handle." msgstr "" -#: ../../c-api/type.rst:111 +#: ../../c-api/type.rst:177 msgid "" "Return the type's name. Equivalent to getting the type's ``__name__`` " "attribute." msgstr "" -#: ../../c-api/type.rst:117 +#: ../../c-api/type.rst:183 msgid "" "Return the type's qualified name. Equivalent to getting the type's " "``__qualname__`` attribute." msgstr "" -#: ../../c-api/type.rst:124 +#: ../../c-api/type.rst:190 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -144,30 +215,30 @@ msgid "" "result pointer into the appropriate function type." msgstr "" -#: ../../c-api/type.rst:130 +#: ../../c-api/type.rst:196 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: ../../c-api/type.rst:134 +#: ../../c-api/type.rst:200 msgid "" ":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " "limited to :ref:`heap types `." msgstr "" -#: ../../c-api/type.rst:140 +#: ../../c-api/type.rst:206 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/type.rst:143 ../../c-api/type.rst:163 +#: ../../c-api/type.rst:209 ../../c-api/type.rst:229 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:146 +#: ../../c-api/type.rst:212 msgid "" "This function is usually used to get the module in which a method is " "defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " @@ -178,31 +249,31 @@ msgid "" "``PyCMethod`` cannot be used." msgstr "" -#: ../../c-api/type.rst:159 +#: ../../c-api/type.rst:225 msgid "" "Return the state of the module object associated with the given type. This " "is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" "func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:166 +#: ../../c-api/type.rst:232 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: ../../c-api/type.rst:173 +#: ../../c-api/type.rst:239 msgid "" "Find the first superclass whose module was created from the given :c:type:" "`PyModuleDef` *def*, and return that module." msgstr "" -#: ../../c-api/type.rst:176 +#: ../../c-api/type.rst:242 msgid "" "If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:178 +#: ../../c-api/type.rst:244 msgid "" "This function is intended to be used together with :c:func:" "`PyModule_GetState()` to get module state from slot methods (such as :c:" @@ -211,23 +282,49 @@ msgid "" "type:`PyCMethod` calling convention." msgstr "" -#: ../../c-api/type.rst:188 +#: ../../c-api/type.rst:254 +msgid "Attempt to assign a version tag to the given type." +msgstr "" + +#: ../../c-api/type.rst:256 +msgid "" +"Returns 1 if the type already had a valid version tag or a new one was " +"assigned, or 0 if a new tag could not be assigned." +msgstr "" + +#: ../../c-api/type.rst:263 msgid "Creating Heap-Allocated Types" msgstr "" -#: ../../c-api/type.rst:190 +#: ../../c-api/type.rst:265 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: ../../c-api/type.rst:195 +#: ../../c-api/type.rst:270 +msgid "" +"Create and return a :ref:`heap type ` from the *spec* (see :" +"const:`Py_TPFLAGS_HEAPTYPE`)." +msgstr "" + +#: ../../c-api/type.rst:273 +msgid "" +"The metaclass *metaclass* is used to construct the resulting type object. " +"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " +"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." +msgstr "" + +#: ../../c-api/type.rst:277 msgid "" -"Creates and returns a :ref:`heap type ` from the *spec* (:const:" -"`Py_TPFLAGS_HEAPTYPE`)." +"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " +"supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, " +"other ``PyType_From*`` functions allow such metaclasses. They ignore " +"``tp_new``, which may result in incomplete initialization. This is " +"deprecated and in Python 3.14+ such metaclasses will not be supported.)" msgstr "" -#: ../../c-api/type.rst:198 +#: ../../c-api/type.rst:284 msgid "" "The *bases* argument can be used to specify base classes; it can either be " "only one class or a tuple of classes. If *bases* is ``NULL``, the " @@ -236,7 +333,7 @@ msgid "" "derives from :class:`object`." msgstr "" -#: ../../c-api/type.rst:204 +#: ../../c-api/type.rst:290 msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " @@ -245,65 +342,178 @@ msgid "" "subclasses; it must be specified for each class individually." msgstr "" -#: ../../c-api/type.rst:211 +#: ../../c-api/type.rst:297 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: ../../c-api/type.rst:217 +#: ../../c-api/type.rst:299 +msgid "" +"Note that this function does *not* fully match the behavior of calling :py:" +"class:`type() ` or using the :keyword:`class` statement. With user-" +"provided base types or metaclasses, prefer :ref:`calling ` :py:" +"class:`type` (or the metaclass) over ``PyType_From*`` functions. " +"Specifically:" +msgstr "" + +#: ../../c-api/type.rst:306 +msgid "" +":py:meth:`~object.__new__` is not called on the new class (and it must be " +"set to ``type.__new__``)." +msgstr "" + +#: ../../c-api/type.rst:308 +msgid ":py:meth:`~object.__init__` is not called on the new class." +msgstr "" + +#: ../../c-api/type.rst:309 +msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." +msgstr "" + +#: ../../c-api/type.rst:310 +msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." +msgstr "" + +#: ../../c-api/type.rst:316 +#, fuzzy +msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." +msgstr "等價於 ``PyType_FromModuleAndSpec(NULL, spec, bases)``\\ 。" + +#: ../../c-api/type.rst:322 msgid "" "The function now accepts a single class as the *bases* argument and ``NULL`` " "as the ``tp_doc`` slot." msgstr "" -#: ../../c-api/type.rst:222 -msgid "Equivalent to ``PyType_FromModuleAndSpec(NULL, spec, bases)``." +#: ../../c-api/type.rst:327 ../../c-api/type.rst:344 +msgid "" +"The function now finds and uses a metaclass corresponding to the provided " +"base classes. Previously, only :class:`type` instances were returned." +msgstr "" + +#: ../../c-api/type.rst:330 ../../c-api/type.rst:347 ../../c-api/type.rst:363 +msgid "" +"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " +"may result in incomplete initialization. Creating classes whose metaclass " +"overrides :c:member:`~PyTypeObject.tp_new` is deprecated and in Python 3.14+ " +"it will be no longer allowed." +msgstr "" + +#: ../../c-api/type.rst:338 +#, fuzzy +msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." msgstr "等價於 ``PyType_FromModuleAndSpec(NULL, spec, bases)``\\ 。" -#: ../../c-api/type.rst:228 -msgid "Equivalent to ``PyType_FromSpecWithBases(spec, NULL)``." +#: ../../c-api/type.rst:355 +#, fuzzy +msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." msgstr "等價於 ``PyType_FromSpecWithBases(spec, NULL)``\\ 。" -#: ../../c-api/type.rst:232 +#: ../../c-api/type.rst:359 +msgid "" +"The function now finds and uses a metaclass corresponding to the base " +"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " +"instances were returned." +msgstr "" + +#: ../../c-api/type.rst:380 msgid "Structure defining a type's behavior." msgstr "" -#: ../../c-api/type.rst:236 +#: ../../c-api/type.rst:384 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: ../../c-api/type.rst:241 +#: ../../c-api/type.rst:388 +msgid "" +"If positive, specifies the size of the instance in bytes. It is used to set :" +"c:member:`PyTypeObject.tp_basicsize`." +msgstr "" + +#: ../../c-api/type.rst:391 +msgid "" +"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " +"inherited." +msgstr "" + +#: ../../c-api/type.rst:394 msgid "" -"Size of the instance in bytes, used to set :c:member:`PyTypeObject." -"tp_basicsize` and :c:member:`PyTypeObject.tp_itemsize`." +"If negative, the absolute value specifies how much space instances of the " +"class need *in addition* to the superclass. Use :c:func:" +"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved " +"this way." msgstr "" -#: ../../c-api/type.rst:247 +#: ../../c-api/type.rst:401 +msgid "Previously, this field could not be negative." +msgstr "" + +#: ../../c-api/type.rst:405 +msgid "" +"Size of one element of a variable-size type, in bytes. Used to set :c:member:" +"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." +msgstr "" + +#: ../../c-api/type.rst:409 +msgid "" +"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " +"arbitrary variable-sized classes is dangerous, since some types use a fixed " +"offset for variable-sized memory, which can then overlap fixed-sized memory " +"used by a subclass. To help prevent mistakes, inheriting ``itemsize`` is " +"only possible in the following situations:" +msgstr "" + +#: ../../c-api/type.rst:416 +msgid "" +"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." +msgstr "" + +#: ../../c-api/type.rst:418 +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " +"the memory layout of the base class is known." +msgstr "" + +#: ../../c-api/type.rst:420 +msgid "" +"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " +"subclass does not access the instance's memory directly." +msgstr "" + +#: ../../c-api/type.rst:423 +msgid "With the :const:`Py_TPFLAGS_ITEMS_AT_END` flag." +msgstr "" + +#: ../../c-api/type.rst:427 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: ../../c-api/type.rst:249 +#: ../../c-api/type.rst:429 msgid "" "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" "`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: ../../c-api/type.rst:254 +#: ../../c-api/type.rst:434 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: ../../c-api/type.rst:259 +#: ../../c-api/type.rst:437 +msgid "Each slot ID should be specified at most once." +msgstr "" + +#: ../../c-api/type.rst:447 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: ../../c-api/type.rst:264 +#: ../../c-api/type.rst:452 msgid "A slot ID." msgstr "" -#: ../../c-api/type.rst:266 +#: ../../c-api/type.rst:454 msgid "" "Slot IDs are named like the field names of the structures :c:type:" "`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" @@ -311,90 +521,91 @@ msgid "" "prefix. For example, use:" msgstr "" -#: ../../c-api/type.rst:272 +#: ../../c-api/type.rst:460 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: ../../c-api/type.rst:273 +#: ../../c-api/type.rst:461 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: ../../c-api/type.rst:274 +#: ../../c-api/type.rst:462 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: ../../c-api/type.rst:276 +#: ../../c-api/type.rst:464 msgid "" "The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" "type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:279 +#: ../../c-api/type.rst:467 msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/type.rst:280 +#: ../../c-api/type.rst:468 msgid ":c:member:`~PyTypeObject.tp_mro`" msgstr ":c:member:`~PyTypeObject.tp_mro`" -#: ../../c-api/type.rst:281 +#: ../../c-api/type.rst:469 msgid ":c:member:`~PyTypeObject.tp_cache`" msgstr ":c:member:`~PyTypeObject.tp_cache`" -#: ../../c-api/type.rst:282 +#: ../../c-api/type.rst:470 msgid ":c:member:`~PyTypeObject.tp_subclasses`" msgstr ":c:member:`~PyTypeObject.tp_subclasses`" -#: ../../c-api/type.rst:283 +#: ../../c-api/type.rst:471 msgid ":c:member:`~PyTypeObject.tp_weaklist`" msgstr ":c:member:`~PyTypeObject.tp_weaklist`" -#: ../../c-api/type.rst:284 +#: ../../c-api/type.rst:472 msgid ":c:member:`~PyTypeObject.tp_vectorcall`" msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" -#: ../../c-api/type.rst:285 +#: ../../c-api/type.rst:473 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (see :ref:`PyMemberDef " -"`)" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :const:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead)" msgstr "" -#: ../../c-api/type.rst:287 +#: ../../c-api/type.rst:475 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (see :ref:`PyMemberDef `)" +":c:member:`~PyTypeObject.tp_dictoffset` (use :const:" +"`Py_TPFLAGS_MANAGED_DICT` instead)" msgstr "" -#: ../../c-api/type.rst:289 +#: ../../c-api/type.rst:477 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " "`)" msgstr "" -#: ../../c-api/type.rst:292 +#: ../../c-api/type.rst:480 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :py:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:299 +#: ../../c-api/type.rst:487 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:301 +#: ../../c-api/type.rst:489 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." -"bf_releasebuffer` are now available under the limited API." +"bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:308 +#: ../../c-api/type.rst:496 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:311 +#: ../../c-api/type.rst:499 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 0222bc21c1..a7bad0c437 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,7 +62,7 @@ msgstr "" msgid "PyTypeObject Slot [#slots]_" msgstr "" -#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:199 +#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:201 msgid ":ref:`Type `" msgstr "" @@ -129,7 +129,7 @@ msgstr ":c:member:`~PyTypeObject.tp_basicsize`" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 #: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 #: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 -#: ../../c-api/typeobj.rst:414 +#: ../../c-api/typeobj.rst:416 msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" @@ -142,7 +142,7 @@ msgid ":c:member:`~PyTypeObject.tp_dealloc`" msgstr ":c:member:`~PyTypeObject.tp_dealloc`" #: ../../c-api/typeobj.rst:50 ../../c-api/typeobj.rst:142 -#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:344 +#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:346 msgid ":c:type:`destructor`" msgstr ":c:type:`destructor`" @@ -154,7 +154,7 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall_offset`" msgid "(:c:member:`~PyTypeObject.tp_getattr`)" msgstr "(:c:member:`~PyTypeObject.tp_getattr`)" -#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:368 +#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:370 msgid ":c:type:`getattrfunc`" msgstr ":c:type:`getattrfunc`" @@ -173,7 +173,7 @@ msgstr "G" msgid "(:c:member:`~PyTypeObject.tp_setattr`)" msgstr "(:c:member:`~PyTypeObject.tp_setattr`)" -#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:373 +#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:375 msgid ":c:type:`setattrfunc`" msgstr ":c:type:`setattrfunc`" @@ -205,7 +205,7 @@ msgid ":c:member:`~PyTypeObject.tp_repr`" msgstr ":c:member:`~PyTypeObject.tp_repr`" #: ../../c-api/typeobj.rst:62 ../../c-api/typeobj.rst:74 -#: ../../c-api/typeobj.rst:366 +#: ../../c-api/typeobj.rst:368 msgid ":c:type:`reprfunc`" msgstr ":c:type:`reprfunc`" @@ -241,7 +241,7 @@ msgstr ":c:type:`PyMappingMethods` *" msgid ":c:member:`~PyTypeObject.tp_hash`" msgstr ":c:member:`~PyTypeObject.tp_hash`" -#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:402 +#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:404 msgid ":c:type:`hashfunc`" msgstr ":c:type:`hashfunc`" @@ -253,8 +253,8 @@ msgstr "__hash__" msgid ":c:member:`~PyTypeObject.tp_call`" msgstr ":c:member:`~PyTypeObject.tp_call`" -#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:235 -#: ../../c-api/typeobj.rst:238 ../../c-api/typeobj.rst:438 +#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:237 +#: ../../c-api/typeobj.rst:240 ../../c-api/typeobj.rst:440 msgid ":c:type:`ternaryfunc`" msgstr ":c:type:`ternaryfunc`" @@ -274,7 +274,7 @@ msgstr "__str__" msgid ":c:member:`~PyTypeObject.tp_getattro`" msgstr ":c:member:`~PyTypeObject.tp_getattro`" -#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:379 +#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:381 msgid ":c:type:`getattrofunc`" msgstr ":c:type:`getattrofunc`" @@ -282,7 +282,7 @@ msgstr ":c:type:`getattrofunc`" msgid ":c:member:`~PyTypeObject.tp_setattro`" msgstr ":c:member:`~PyTypeObject.tp_setattro`" -#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:384 +#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:386 msgid ":c:type:`setattrofunc`" msgstr ":c:type:`setattrofunc`" @@ -321,7 +321,7 @@ msgstr "__doc__" msgid ":c:member:`~PyTypeObject.tp_traverse`" msgstr ":c:member:`~PyTypeObject.tp_traverse`" -#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:348 +#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:350 msgid ":c:type:`traverseproc`" msgstr ":c:type:`traverseproc`" @@ -330,7 +330,7 @@ msgid ":c:member:`~PyTypeObject.tp_clear`" msgstr ":c:member:`~PyTypeObject.tp_clear`" #: ../../c-api/typeobj.rst:90 ../../c-api/typeobj.rst:130 -#: ../../c-api/typeobj.rst:246 ../../c-api/typeobj.rst:427 +#: ../../c-api/typeobj.rst:248 ../../c-api/typeobj.rst:429 msgid ":c:type:`inquiry`" msgstr ":c:type:`inquiry`" @@ -338,7 +338,7 @@ msgstr ":c:type:`inquiry`" msgid ":c:member:`~PyTypeObject.tp_richcompare`" msgstr ":c:member:`~PyTypeObject.tp_richcompare`" -#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:404 +#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:406 msgid ":c:type:`richcmpfunc`" msgstr ":c:type:`richcmpfunc`" @@ -347,14 +347,15 @@ msgid "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" msgstr "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" #: ../../c-api/typeobj.rst:99 -msgid ":c:member:`~PyTypeObject.tp_weaklistoffset`" +#, fuzzy +msgid "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" msgstr ":c:member:`~PyTypeObject.tp_weaklistoffset`" #: ../../c-api/typeobj.rst:101 msgid ":c:member:`~PyTypeObject.tp_iter`" msgstr ":c:member:`~PyTypeObject.tp_iter`" -#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:410 +#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:412 msgid ":c:type:`getiterfunc`" msgstr ":c:type:`getiterfunc`" @@ -366,7 +367,7 @@ msgstr "__iter__" msgid ":c:member:`~PyTypeObject.tp_iternext`" msgstr ":c:member:`~PyTypeObject.tp_iternext`" -#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:412 +#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:414 msgid ":c:type:`iternextfunc`" msgstr ":c:type:`iternextfunc`" @@ -416,15 +417,15 @@ msgstr ":c:member:`~PyTypeObject.tp_dict`" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 #: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 -#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:138 -#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:339 -#: ../../c-api/typeobj.rst:354 ../../c-api/typeobj.rst:366 -#: ../../c-api/typeobj.rst:368 ../../c-api/typeobj.rst:379 -#: ../../c-api/typeobj.rst:390 ../../c-api/typeobj.rst:402 -#: ../../c-api/typeobj.rst:404 ../../c-api/typeobj.rst:410 +#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:140 +#: ../../c-api/typeobj.rst:341 ../../c-api/typeobj.rst:356 +#: ../../c-api/typeobj.rst:368 ../../c-api/typeobj.rst:370 +#: ../../c-api/typeobj.rst:381 ../../c-api/typeobj.rst:392 +#: ../../c-api/typeobj.rst:404 ../../c-api/typeobj.rst:406 #: ../../c-api/typeobj.rst:412 ../../c-api/typeobj.rst:414 -#: ../../c-api/typeobj.rst:429 ../../c-api/typeobj.rst:433 -#: ../../c-api/typeobj.rst:438 ../../c-api/typeobj.rst:444 +#: ../../c-api/typeobj.rst:416 ../../c-api/typeobj.rst:431 +#: ../../c-api/typeobj.rst:435 ../../c-api/typeobj.rst:440 +#: ../../c-api/typeobj.rst:446 msgid ":c:type:`PyObject` *" msgstr ":c:type:`PyObject` *" @@ -436,7 +437,7 @@ msgstr "__dict__" msgid ":c:member:`~PyTypeObject.tp_descr_get`" msgstr ":c:member:`~PyTypeObject.tp_descr_get`" -#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:390 +#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:392 msgid ":c:type:`descrgetfunc`" msgstr ":c:type:`descrgetfunc`" @@ -448,7 +449,7 @@ msgstr "__get__" msgid ":c:member:`~PyTypeObject.tp_descr_set`" msgstr ":c:member:`~PyTypeObject.tp_descr_set`" -#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:396 +#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:398 msgid ":c:type:`descrsetfunc`" msgstr ":c:type:`descrsetfunc`" @@ -457,14 +458,15 @@ msgid "__set__, __delete__" msgstr "__set__, __delete__" #: ../../c-api/typeobj.rst:120 -msgid ":c:member:`~PyTypeObject.tp_dictoffset`" +#, fuzzy +msgid "(:c:member:`~PyTypeObject.tp_dictoffset`)" msgstr ":c:member:`~PyTypeObject.tp_dictoffset`" #: ../../c-api/typeobj.rst:122 msgid ":c:member:`~PyTypeObject.tp_init`" msgstr ":c:member:`~PyTypeObject.tp_init`" -#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:360 +#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:362 msgid ":c:type:`initproc`" msgstr ":c:type:`initproc`" @@ -476,7 +478,7 @@ msgstr "__init__" msgid ":c:member:`~PyTypeObject.tp_alloc`" msgstr ":c:member:`~PyTypeObject.tp_alloc`" -#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:339 +#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:341 msgid ":c:type:`allocfunc`" msgstr ":c:type:`allocfunc`" @@ -484,7 +486,7 @@ msgstr ":c:type:`allocfunc`" msgid ":c:member:`~PyTypeObject.tp_new`" msgstr ":c:member:`~PyTypeObject.tp_new`" -#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:354 +#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:356 msgid ":c:type:`newfunc`" msgstr ":c:type:`newfunc`" @@ -496,7 +498,7 @@ msgstr "__new__" msgid ":c:member:`~PyTypeObject.tp_free`" msgstr ":c:member:`~PyTypeObject.tp_free`" -#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:346 +#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:348 msgid ":c:type:`freefunc`" msgstr ":c:type:`freefunc`" @@ -532,6 +534,12 @@ msgstr "[:c:member:`~PyTypeObject.tp_cache`]" msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:138 +#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:346 +#: ../../c-api/typeobj.rst:348 ../../c-api/typeobj.rst:429 +msgid "void *" +msgstr "void *" + #: ../../c-api/typeobj.rst:138 msgid "__subclasses__" msgstr "__subclasses__" @@ -568,541 +576,544 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../c-api/typeobj.rst:153 +#: ../../c-api/typeobj.rst:150 +#, fuzzy +msgid "[:c:member:`~PyTypeObject.tp_watched`]" +msgstr "[:c:member:`~PyTypeObject.tp_cache`]" + +#: ../../c-api/typeobj.rst:150 +msgid "char" +msgstr "" + +#: ../../c-api/typeobj.rst:155 msgid "" "**()**: A slot name in parentheses indicates it is (effectively) deprecated." msgstr "" -#: ../../c-api/typeobj.rst:155 +#: ../../c-api/typeobj.rst:157 msgid "" "**<>**: Names in angle brackets should be initially set to ``NULL`` and " "treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:158 +#: ../../c-api/typeobj.rst:160 msgid "**[]**: Names in square brackets are for internal use only." msgstr "" -#: ../../c-api/typeobj.rst:160 +#: ../../c-api/typeobj.rst:162 msgid "" "**** (as a prefix) means the field is required (must be non-``NULL``)." msgstr "" -#: ../../c-api/typeobj.rst:162 +#: ../../c-api/typeobj.rst:164 msgid "Columns:" msgstr "" -#: ../../c-api/typeobj.rst:164 +#: ../../c-api/typeobj.rst:166 msgid "**\"O\"**: set on :c:type:`PyBaseObject_Type`" msgstr "" -#: ../../c-api/typeobj.rst:166 +#: ../../c-api/typeobj.rst:168 msgid "**\"T\"**: set on :c:type:`PyType_Type`" msgstr "" -#: ../../c-api/typeobj.rst:168 +#: ../../c-api/typeobj.rst:170 msgid "**\"D\"**: default (if slot is set to ``NULL``)" msgstr "" -#: ../../c-api/typeobj.rst:178 +#: ../../c-api/typeobj.rst:180 msgid "**\"I\"**: inheritance" msgstr "" -#: ../../c-api/typeobj.rst:187 +#: ../../c-api/typeobj.rst:189 msgid "" "Note that some slots are effectively inherited through the normal attribute " "lookup chain." msgstr "" -#: ../../c-api/typeobj.rst:193 +#: ../../c-api/typeobj.rst:195 msgid "sub-slots" msgstr "" -#: ../../c-api/typeobj.rst:199 +#: ../../c-api/typeobj.rst:201 msgid "Slot" msgstr "" -#: ../../c-api/typeobj.rst:199 +#: ../../c-api/typeobj.rst:201 msgid "special methods" msgstr "" -#: ../../c-api/typeobj.rst:202 +#: ../../c-api/typeobj.rst:204 msgid ":c:member:`~PyAsyncMethods.am_await`" msgstr ":c:member:`~PyAsyncMethods.am_await`" -#: ../../c-api/typeobj.rst:202 ../../c-api/typeobj.rst:204 -#: ../../c-api/typeobj.rst:206 ../../c-api/typeobj.rst:240 -#: ../../c-api/typeobj.rst:242 ../../c-api/typeobj.rst:244 -#: ../../c-api/typeobj.rst:248 ../../c-api/typeobj.rst:275 -#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:289 -#: ../../c-api/typeobj.rst:429 +#: ../../c-api/typeobj.rst:204 ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:208 ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:244 ../../c-api/typeobj.rst:246 +#: ../../c-api/typeobj.rst:250 ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:281 ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:431 msgid ":c:type:`unaryfunc`" msgstr ":c:type:`unaryfunc`" -#: ../../c-api/typeobj.rst:202 +#: ../../c-api/typeobj.rst:204 msgid "__await__" msgstr "__await__" -#: ../../c-api/typeobj.rst:204 +#: ../../c-api/typeobj.rst:206 msgid ":c:member:`~PyAsyncMethods.am_aiter`" msgstr ":c:member:`~PyAsyncMethods.am_aiter`" -#: ../../c-api/typeobj.rst:204 +#: ../../c-api/typeobj.rst:206 msgid "__aiter__" msgstr "__aiter__" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:208 msgid ":c:member:`~PyAsyncMethods.am_anext`" msgstr ":c:member:`~PyAsyncMethods.am_anext`" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:208 msgid "__anext__" msgstr "__anext__" -#: ../../c-api/typeobj.rst:208 +#: ../../c-api/typeobj.rst:210 msgid ":c:member:`~PyAsyncMethods.am_send`" msgstr ":c:member:`~PyAsyncMethods.am_send`" -#: ../../c-api/typeobj.rst:208 +#: ../../c-api/typeobj.rst:210 msgid ":c:type:`sendfunc`" msgstr ":c:type:`sendfunc`" -#: ../../c-api/typeobj.rst:212 +#: ../../c-api/typeobj.rst:214 msgid ":c:member:`~PyNumberMethods.nb_add`" msgstr ":c:member:`~PyNumberMethods.nb_add`" -#: ../../c-api/typeobj.rst:212 ../../c-api/typeobj.rst:215 -#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:220 -#: ../../c-api/typeobj.rst:222 ../../c-api/typeobj.rst:225 -#: ../../c-api/typeobj.rst:227 ../../c-api/typeobj.rst:230 -#: ../../c-api/typeobj.rst:232 ../../c-api/typeobj.rst:250 -#: ../../c-api/typeobj.rst:253 ../../c-api/typeobj.rst:255 -#: ../../c-api/typeobj.rst:258 ../../c-api/typeobj.rst:260 -#: ../../c-api/typeobj.rst:263 ../../c-api/typeobj.rst:265 -#: ../../c-api/typeobj.rst:268 ../../c-api/typeobj.rst:270 -#: ../../c-api/typeobj.rst:273 ../../c-api/typeobj.rst:281 -#: ../../c-api/typeobj.rst:283 ../../c-api/typeobj.rst:285 -#: ../../c-api/typeobj.rst:287 ../../c-api/typeobj.rst:291 -#: ../../c-api/typeobj.rst:294 ../../c-api/typeobj.rst:300 -#: ../../c-api/typeobj.rst:309 ../../c-api/typeobj.rst:320 -#: ../../c-api/typeobj.rst:433 +#: ../../c-api/typeobj.rst:214 ../../c-api/typeobj.rst:217 +#: ../../c-api/typeobj.rst:219 ../../c-api/typeobj.rst:222 +#: ../../c-api/typeobj.rst:224 ../../c-api/typeobj.rst:227 +#: ../../c-api/typeobj.rst:229 ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:234 ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:255 ../../c-api/typeobj.rst:257 +#: ../../c-api/typeobj.rst:260 ../../c-api/typeobj.rst:262 +#: ../../c-api/typeobj.rst:265 ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:270 ../../c-api/typeobj.rst:272 +#: ../../c-api/typeobj.rst:275 ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:285 ../../c-api/typeobj.rst:287 +#: ../../c-api/typeobj.rst:289 ../../c-api/typeobj.rst:293 +#: ../../c-api/typeobj.rst:296 ../../c-api/typeobj.rst:302 +#: ../../c-api/typeobj.rst:311 ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:435 msgid ":c:type:`binaryfunc`" msgstr ":c:type:`binaryfunc`" -#: ../../c-api/typeobj.rst:212 +#: ../../c-api/typeobj.rst:214 msgid "__add__ __radd__" msgstr "__add__ __radd__" -#: ../../c-api/typeobj.rst:215 +#: ../../c-api/typeobj.rst:217 msgid ":c:member:`~PyNumberMethods.nb_inplace_add`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_add`" -#: ../../c-api/typeobj.rst:215 ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:322 msgid "__iadd__" msgstr "__iadd__" -#: ../../c-api/typeobj.rst:217 +#: ../../c-api/typeobj.rst:219 msgid ":c:member:`~PyNumberMethods.nb_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_subtract`" -#: ../../c-api/typeobj.rst:217 +#: ../../c-api/typeobj.rst:219 msgid "__sub__ __rsub__" msgstr "__sub__ __rsub__" -#: ../../c-api/typeobj.rst:220 +#: ../../c-api/typeobj.rst:222 msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_subtract`" -#: ../../c-api/typeobj.rst:220 +#: ../../c-api/typeobj.rst:222 msgid "__isub__" msgstr "__isub__" -#: ../../c-api/typeobj.rst:222 +#: ../../c-api/typeobj.rst:224 msgid ":c:member:`~PyNumberMethods.nb_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_multiply`" -#: ../../c-api/typeobj.rst:222 +#: ../../c-api/typeobj.rst:224 msgid "__mul__ __rmul__" msgstr "__mul__ __rmul__" -#: ../../c-api/typeobj.rst:225 +#: ../../c-api/typeobj.rst:227 msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_multiply`" -#: ../../c-api/typeobj.rst:225 ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:227 ../../c-api/typeobj.rst:324 msgid "__imul__" msgstr "__imul__" -#: ../../c-api/typeobj.rst:227 +#: ../../c-api/typeobj.rst:229 msgid ":c:member:`~PyNumberMethods.nb_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_remainder`" -#: ../../c-api/typeobj.rst:227 +#: ../../c-api/typeobj.rst:229 msgid "__mod__ __rmod__" msgstr "__mod__ __rmod__" -#: ../../c-api/typeobj.rst:230 +#: ../../c-api/typeobj.rst:232 msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_remainder`" -#: ../../c-api/typeobj.rst:230 +#: ../../c-api/typeobj.rst:232 msgid "__imod__" msgstr "__imod__" -#: ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:234 msgid ":c:member:`~PyNumberMethods.nb_divmod`" msgstr ":c:member:`~PyNumberMethods.nb_divmod`" -#: ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:234 msgid "__divmod__ __rdivmod__" msgstr "__divmod__ __rdivmod__" -#: ../../c-api/typeobj.rst:235 +#: ../../c-api/typeobj.rst:237 msgid ":c:member:`~PyNumberMethods.nb_power`" msgstr ":c:member:`~PyNumberMethods.nb_power`" -#: ../../c-api/typeobj.rst:235 +#: ../../c-api/typeobj.rst:237 msgid "__pow__ __rpow__" msgstr "__pow__ __rpow__" -#: ../../c-api/typeobj.rst:238 +#: ../../c-api/typeobj.rst:240 msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_power`" -#: ../../c-api/typeobj.rst:238 +#: ../../c-api/typeobj.rst:240 msgid "__ipow__" msgstr "__ipow__" -#: ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:242 msgid ":c:member:`~PyNumberMethods.nb_negative`" msgstr ":c:member:`~PyNumberMethods.nb_negative`" -#: ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:242 msgid "__neg__" msgstr "__neg__" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:244 msgid ":c:member:`~PyNumberMethods.nb_positive`" msgstr ":c:member:`~PyNumberMethods.nb_positive`" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:244 msgid "__pos__" msgstr "__pos__" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:246 msgid ":c:member:`~PyNumberMethods.nb_absolute`" msgstr ":c:member:`~PyNumberMethods.nb_absolute`" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:246 msgid "__abs__" msgstr "__abs__" -#: ../../c-api/typeobj.rst:246 +#: ../../c-api/typeobj.rst:248 msgid ":c:member:`~PyNumberMethods.nb_bool`" msgstr ":c:member:`~PyNumberMethods.nb_bool`" -#: ../../c-api/typeobj.rst:246 +#: ../../c-api/typeobj.rst:248 msgid "__bool__" msgstr "__bool__" -#: ../../c-api/typeobj.rst:248 +#: ../../c-api/typeobj.rst:250 msgid ":c:member:`~PyNumberMethods.nb_invert`" msgstr ":c:member:`~PyNumberMethods.nb_invert`" -#: ../../c-api/typeobj.rst:248 +#: ../../c-api/typeobj.rst:250 msgid "__invert__" msgstr "__invert__" -#: ../../c-api/typeobj.rst:250 +#: ../../c-api/typeobj.rst:252 msgid ":c:member:`~PyNumberMethods.nb_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_lshift`" -#: ../../c-api/typeobj.rst:250 +#: ../../c-api/typeobj.rst:252 msgid "__lshift__ __rlshift__" msgstr "__lshift__ __rlshift__" -#: ../../c-api/typeobj.rst:253 +#: ../../c-api/typeobj.rst:255 msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_lshift`" -#: ../../c-api/typeobj.rst:253 +#: ../../c-api/typeobj.rst:255 msgid "__ilshift__" msgstr "__ilshift__" -#: ../../c-api/typeobj.rst:255 +#: ../../c-api/typeobj.rst:257 msgid ":c:member:`~PyNumberMethods.nb_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_rshift`" -#: ../../c-api/typeobj.rst:255 +#: ../../c-api/typeobj.rst:257 msgid "__rshift__ __rrshift__" msgstr "__rshift__ __rrshift__" -#: ../../c-api/typeobj.rst:258 +#: ../../c-api/typeobj.rst:260 msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_rshift`" -#: ../../c-api/typeobj.rst:258 +#: ../../c-api/typeobj.rst:260 msgid "__irshift__" msgstr "__irshift__" -#: ../../c-api/typeobj.rst:260 +#: ../../c-api/typeobj.rst:262 msgid ":c:member:`~PyNumberMethods.nb_and`" msgstr ":c:member:`~PyNumberMethods.nb_and`" -#: ../../c-api/typeobj.rst:260 +#: ../../c-api/typeobj.rst:262 msgid "__and__ __rand__" msgstr "__and__ __rand__" -#: ../../c-api/typeobj.rst:263 +#: ../../c-api/typeobj.rst:265 msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_and`" -#: ../../c-api/typeobj.rst:263 +#: ../../c-api/typeobj.rst:265 msgid "__iand__" msgstr "__iand__" -#: ../../c-api/typeobj.rst:265 +#: ../../c-api/typeobj.rst:267 msgid ":c:member:`~PyNumberMethods.nb_xor`" msgstr ":c:member:`~PyNumberMethods.nb_xor`" -#: ../../c-api/typeobj.rst:265 +#: ../../c-api/typeobj.rst:267 msgid "__xor__ __rxor__" msgstr "__xor__ __rxor__" -#: ../../c-api/typeobj.rst:268 +#: ../../c-api/typeobj.rst:270 msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_xor`" -#: ../../c-api/typeobj.rst:268 +#: ../../c-api/typeobj.rst:270 msgid "__ixor__" msgstr "__ixor__" -#: ../../c-api/typeobj.rst:270 +#: ../../c-api/typeobj.rst:272 msgid ":c:member:`~PyNumberMethods.nb_or`" msgstr ":c:member:`~PyNumberMethods.nb_or`" -#: ../../c-api/typeobj.rst:270 +#: ../../c-api/typeobj.rst:272 msgid "__or__ __ror__" msgstr "__or__ __ror__" -#: ../../c-api/typeobj.rst:273 +#: ../../c-api/typeobj.rst:275 msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_or`" -#: ../../c-api/typeobj.rst:273 +#: ../../c-api/typeobj.rst:275 msgid "__ior__" msgstr "__ior__" -#: ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:277 msgid ":c:member:`~PyNumberMethods.nb_int`" msgstr ":c:member:`~PyNumberMethods.nb_int`" -#: ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:277 msgid "__int__" msgstr "__int__" -#: ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:279 msgid ":c:member:`~PyNumberMethods.nb_reserved`" msgstr ":c:member:`~PyNumberMethods.nb_reserved`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:277 -#: ../../c-api/typeobj.rst:344 ../../c-api/typeobj.rst:346 -#: ../../c-api/typeobj.rst:427 -msgid "void *" -msgstr "void *" - -#: ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:281 msgid ":c:member:`~PyNumberMethods.nb_float`" msgstr ":c:member:`~PyNumberMethods.nb_float`" -#: ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:281 msgid "__float__" msgstr "__float__" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:283 msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_floor_divide`" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:283 msgid "__floordiv__" msgstr "__floordiv__" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:285 msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:285 msgid "__ifloordiv__" msgstr "__ifloordiv__" -#: ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:287 msgid ":c:member:`~PyNumberMethods.nb_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_true_divide`" -#: ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:287 msgid "__truediv__" msgstr "__truediv__" -#: ../../c-api/typeobj.rst:287 +#: ../../c-api/typeobj.rst:289 msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" -#: ../../c-api/typeobj.rst:287 +#: ../../c-api/typeobj.rst:289 msgid "__itruediv__" msgstr "__itruediv__" -#: ../../c-api/typeobj.rst:289 +#: ../../c-api/typeobj.rst:291 msgid ":c:member:`~PyNumberMethods.nb_index`" msgstr ":c:member:`~PyNumberMethods.nb_index`" -#: ../../c-api/typeobj.rst:289 +#: ../../c-api/typeobj.rst:291 msgid "__index__" msgstr "__index__" -#: ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:293 msgid ":c:member:`~PyNumberMethods.nb_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_matrix_multiply`" -#: ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:293 msgid "__matmul__ __rmatmul__" msgstr "__matmul__ __rmatmul__" -#: ../../c-api/typeobj.rst:294 +#: ../../c-api/typeobj.rst:296 msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" -#: ../../c-api/typeobj.rst:294 +#: ../../c-api/typeobj.rst:296 msgid "__imatmul__" msgstr "__imatmul__" -#: ../../c-api/typeobj.rst:298 +#: ../../c-api/typeobj.rst:300 msgid ":c:member:`~PyMappingMethods.mp_length`" msgstr ":c:member:`~PyMappingMethods.mp_length`" -#: ../../c-api/typeobj.rst:298 ../../c-api/typeobj.rst:307 -#: ../../c-api/typeobj.rst:414 +#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:416 msgid ":c:type:`lenfunc`" msgstr ":c:type:`lenfunc`" -#: ../../c-api/typeobj.rst:298 ../../c-api/typeobj.rst:307 +#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:309 msgid "__len__" msgstr "__len__" -#: ../../c-api/typeobj.rst:300 +#: ../../c-api/typeobj.rst:302 msgid ":c:member:`~PyMappingMethods.mp_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_subscript`" -#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:313 +#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:315 msgid "__getitem__" msgstr "__getitem__" -#: ../../c-api/typeobj.rst:302 +#: ../../c-api/typeobj.rst:304 msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" -#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:460 +#: ../../c-api/typeobj.rst:304 ../../c-api/typeobj.rst:462 msgid ":c:type:`objobjargproc`" msgstr ":c:type:`objobjargproc`" -#: ../../c-api/typeobj.rst:302 +#: ../../c-api/typeobj.rst:304 msgid "__setitem__, __delitem__" msgstr "__setitem__, __delitem__" -#: ../../c-api/typeobj.rst:307 +#: ../../c-api/typeobj.rst:309 msgid ":c:member:`~PySequenceMethods.sq_length`" msgstr ":c:member:`~PySequenceMethods.sq_length`" -#: ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:311 msgid ":c:member:`~PySequenceMethods.sq_concat`" msgstr ":c:member:`~PySequenceMethods.sq_concat`" -#: ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:311 msgid "__add__" msgstr "__add__" -#: ../../c-api/typeobj.rst:311 +#: ../../c-api/typeobj.rst:313 msgid ":c:member:`~PySequenceMethods.sq_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_repeat`" -#: ../../c-api/typeobj.rst:311 ../../c-api/typeobj.rst:313 -#: ../../c-api/typeobj.rst:322 ../../c-api/typeobj.rst:444 +#: ../../c-api/typeobj.rst:313 ../../c-api/typeobj.rst:315 +#: ../../c-api/typeobj.rst:324 ../../c-api/typeobj.rst:446 msgid ":c:type:`ssizeargfunc`" msgstr ":c:type:`ssizeargfunc`" -#: ../../c-api/typeobj.rst:311 +#: ../../c-api/typeobj.rst:313 msgid "__mul__" msgstr "__mul__" -#: ../../c-api/typeobj.rst:313 +#: ../../c-api/typeobj.rst:315 msgid ":c:member:`~PySequenceMethods.sq_item`" msgstr ":c:member:`~PySequenceMethods.sq_item`" -#: ../../c-api/typeobj.rst:315 +#: ../../c-api/typeobj.rst:317 msgid ":c:member:`~PySequenceMethods.sq_ass_item`" msgstr ":c:member:`~PySequenceMethods.sq_ass_item`" -#: ../../c-api/typeobj.rst:315 ../../c-api/typeobj.rst:449 +#: ../../c-api/typeobj.rst:317 ../../c-api/typeobj.rst:451 msgid ":c:type:`ssizeobjargproc`" msgstr ":c:type:`ssizeobjargproc`" -#: ../../c-api/typeobj.rst:315 +#: ../../c-api/typeobj.rst:317 msgid "__setitem__ __delitem__" msgstr "__setitem__ __delitem__" -#: ../../c-api/typeobj.rst:318 +#: ../../c-api/typeobj.rst:320 msgid ":c:member:`~PySequenceMethods.sq_contains`" msgstr ":c:member:`~PySequenceMethods.sq_contains`" -#: ../../c-api/typeobj.rst:318 ../../c-api/typeobj.rst:455 +#: ../../c-api/typeobj.rst:320 ../../c-api/typeobj.rst:457 msgid ":c:type:`objobjproc`" msgstr ":c:type:`objobjproc`" -#: ../../c-api/typeobj.rst:318 +#: ../../c-api/typeobj.rst:320 msgid "__contains__" msgstr "__contains__" -#: ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:322 msgid ":c:member:`~PySequenceMethods.sq_inplace_concat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_concat`" -#: ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:324 msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_repeat`" -#: ../../c-api/typeobj.rst:326 +#: ../../c-api/typeobj.rst:328 msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" -#: ../../c-api/typeobj.rst:326 +#: ../../c-api/typeobj.rst:328 msgid ":c:func:`getbufferproc`" msgstr ":c:func:`getbufferproc`" -#: ../../c-api/typeobj.rst:328 +#: ../../c-api/typeobj.rst:330 msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" -#: ../../c-api/typeobj.rst:328 +#: ../../c-api/typeobj.rst:330 msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" -#: ../../c-api/typeobj.rst:334 +#: ../../c-api/typeobj.rst:336 msgid "slot typedefs" msgstr "" -#: ../../c-api/typeobj.rst:337 +#: ../../c-api/typeobj.rst:339 msgid "typedef" msgstr "typedef" -#: ../../c-api/typeobj.rst:337 +#: ../../c-api/typeobj.rst:339 msgid "Parameter Types" msgstr "" -#: ../../c-api/typeobj.rst:337 +#: ../../c-api/typeobj.rst:339 msgid "Return Type" msgstr "" -#: ../../c-api/typeobj.rst:344 ../../c-api/typeobj.rst:346 -#: ../../c-api/typeobj.rst:422 +#: ../../c-api/typeobj.rst:346 ../../c-api/typeobj.rst:348 +#: ../../c-api/typeobj.rst:424 msgid "void" msgstr "void" @@ -1110,20 +1121,20 @@ msgstr "void" msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:348 -#: ../../c-api/typeobj.rst:360 ../../c-api/typeobj.rst:373 -#: ../../c-api/typeobj.rst:384 ../../c-api/typeobj.rst:396 -#: ../../c-api/typeobj.rst:416 ../../c-api/typeobj.rst:427 -#: ../../c-api/typeobj.rst:449 ../../c-api/typeobj.rst:455 -#: ../../c-api/typeobj.rst:460 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:350 +#: ../../c-api/typeobj.rst:362 ../../c-api/typeobj.rst:375 +#: ../../c-api/typeobj.rst:386 ../../c-api/typeobj.rst:398 +#: ../../c-api/typeobj.rst:418 ../../c-api/typeobj.rst:429 +#: ../../c-api/typeobj.rst:451 ../../c-api/typeobj.rst:457 +#: ../../c-api/typeobj.rst:462 msgid "int" msgstr "int" -#: ../../c-api/typeobj.rst:402 +#: ../../c-api/typeobj.rst:404 msgid "Py_hash_t" msgstr "Py_hash_t" -#: ../../c-api/typeobj.rst:416 +#: ../../c-api/typeobj.rst:418 msgid ":c:type:`getbufferproc`" msgstr ":c:type:`getbufferproc`" @@ -1131,30 +1142,30 @@ msgstr ":c:type:`getbufferproc`" msgid ":c:type:`Py_buffer` *" msgstr ":c:type:`Py_buffer` *" -#: ../../c-api/typeobj.rst:422 +#: ../../c-api/typeobj.rst:424 msgid ":c:type:`releasebufferproc`" msgstr ":c:type:`releasebufferproc`" -#: ../../c-api/typeobj.rst:467 +#: ../../c-api/typeobj.rst:469 msgid "See :ref:`slot-typedefs` below for more detail." msgstr "更多細節請見下方的 :ref:`slot-typedefs`。" -#: ../../c-api/typeobj.rst:471 +#: ../../c-api/typeobj.rst:473 msgid "PyTypeObject Definition" msgstr "" -#: ../../c-api/typeobj.rst:473 +#: ../../c-api/typeobj.rst:475 msgid "" "The structure definition for :c:type:`PyTypeObject` can be found in :file:" "`Include/object.h`. For convenience of reference, this repeats the " "definition found there:" msgstr "" -#: ../../c-api/typeobj.rst:483 +#: ../../c-api/typeobj.rst:485 msgid "PyObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:485 +#: ../../c-api/typeobj.rst:487 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" "attr:`ob_size` field is used for dynamic types (created by :func:`type_new`, " @@ -1163,7 +1174,7 @@ msgid "" "that its instances (i.e. type objects) *must* have the :attr:`ob_size` field." msgstr "" -#: ../../c-api/typeobj.rst:494 +#: ../../c-api/typeobj.rst:496 msgid "" "This is the type object's reference count, initialized to ``1`` by the " "``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " @@ -1173,46 +1184,48 @@ msgid "" "as references." msgstr "" -#: ../../c-api/typeobj.rst:501 ../../c-api/typeobj.rst:524 -#: ../../c-api/typeobj.rst:546 ../../c-api/typeobj.rst:560 -#: ../../c-api/typeobj.rst:604 ../../c-api/typeobj.rst:647 -#: ../../c-api/typeobj.rst:705 ../../c-api/typeobj.rst:743 -#: ../../c-api/typeobj.rst:763 ../../c-api/typeobj.rst:780 -#: ../../c-api/typeobj.rst:798 ../../c-api/typeobj.rst:822 -#: ../../c-api/typeobj.rst:839 ../../c-api/typeobj.rst:851 -#: ../../c-api/typeobj.rst:863 ../../c-api/typeobj.rst:896 -#: ../../c-api/typeobj.rst:914 ../../c-api/typeobj.rst:934 -#: ../../c-api/typeobj.rst:955 ../../c-api/typeobj.rst:981 -#: ../../c-api/typeobj.rst:1000 ../../c-api/typeobj.rst:1016 -#: ../../c-api/typeobj.rst:1053 ../../c-api/typeobj.rst:1064 -#: ../../c-api/typeobj.rst:1074 ../../c-api/typeobj.rst:1084 -#: ../../c-api/typeobj.rst:1098 ../../c-api/typeobj.rst:1116 -#: ../../c-api/typeobj.rst:1139 ../../c-api/typeobj.rst:1186 -#: ../../c-api/typeobj.rst:1201 ../../c-api/typeobj.rst:1220 -#: ../../c-api/typeobj.rst:1250 ../../c-api/typeobj.rst:1272 -#: ../../c-api/typeobj.rst:1288 ../../c-api/typeobj.rst:1356 -#: ../../c-api/typeobj.rst:1423 ../../c-api/typeobj.rst:1482 -#: ../../c-api/typeobj.rst:1512 ../../c-api/typeobj.rst:1544 -#: ../../c-api/typeobj.rst:1567 ../../c-api/typeobj.rst:1580 -#: ../../c-api/typeobj.rst:1595 ../../c-api/typeobj.rst:1609 -#: ../../c-api/typeobj.rst:1639 ../../c-api/typeobj.rst:1659 -#: ../../c-api/typeobj.rst:1685 ../../c-api/typeobj.rst:1703 -#: ../../c-api/typeobj.rst:1736 ../../c-api/typeobj.rst:1787 -#: ../../c-api/typeobj.rst:1804 ../../c-api/typeobj.rst:1845 -#: ../../c-api/typeobj.rst:1867 ../../c-api/typeobj.rst:1899 -#: ../../c-api/typeobj.rst:1927 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1959 -#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:1983 -#: ../../c-api/typeobj.rst:2029 ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526 +#: ../../c-api/typeobj.rst:548 ../../c-api/typeobj.rst:562 +#: ../../c-api/typeobj.rst:606 ../../c-api/typeobj.rst:649 +#: ../../c-api/typeobj.rst:707 ../../c-api/typeobj.rst:748 +#: ../../c-api/typeobj.rst:765 ../../c-api/typeobj.rst:782 +#: ../../c-api/typeobj.rst:800 ../../c-api/typeobj.rst:824 +#: ../../c-api/typeobj.rst:841 ../../c-api/typeobj.rst:853 +#: ../../c-api/typeobj.rst:865 ../../c-api/typeobj.rst:898 +#: ../../c-api/typeobj.rst:916 ../../c-api/typeobj.rst:936 +#: ../../c-api/typeobj.rst:957 ../../c-api/typeobj.rst:983 +#: ../../c-api/typeobj.rst:1002 ../../c-api/typeobj.rst:1018 +#: ../../c-api/typeobj.rst:1054 ../../c-api/typeobj.rst:1065 +#: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1085 +#: ../../c-api/typeobj.rst:1099 ../../c-api/typeobj.rst:1117 +#: ../../c-api/typeobj.rst:1140 ../../c-api/typeobj.rst:1155 +#: ../../c-api/typeobj.rst:1168 ../../c-api/typeobj.rst:1190 +#: ../../c-api/typeobj.rst:1234 ../../c-api/typeobj.rst:1255 +#: ../../c-api/typeobj.rst:1274 ../../c-api/typeobj.rst:1304 +#: ../../c-api/typeobj.rst:1326 ../../c-api/typeobj.rst:1352 +#: ../../c-api/typeobj.rst:1420 ../../c-api/typeobj.rst:1487 +#: ../../c-api/typeobj.rst:1546 ../../c-api/typeobj.rst:1582 +#: ../../c-api/typeobj.rst:1607 ../../c-api/typeobj.rst:1630 +#: ../../c-api/typeobj.rst:1643 ../../c-api/typeobj.rst:1658 +#: ../../c-api/typeobj.rst:1672 ../../c-api/typeobj.rst:1702 +#: ../../c-api/typeobj.rst:1734 ../../c-api/typeobj.rst:1760 +#: ../../c-api/typeobj.rst:1778 ../../c-api/typeobj.rst:1807 +#: ../../c-api/typeobj.rst:1851 ../../c-api/typeobj.rst:1868 +#: ../../c-api/typeobj.rst:1909 ../../c-api/typeobj.rst:1931 +#: ../../c-api/typeobj.rst:1963 ../../c-api/typeobj.rst:1991 +#: ../../c-api/typeobj.rst:2004 ../../c-api/typeobj.rst:2014 +#: ../../c-api/typeobj.rst:2031 ../../c-api/typeobj.rst:2048 +#: ../../c-api/typeobj.rst:2062 ../../c-api/typeobj.rst:2108 +#: ../../c-api/typeobj.rst:2131 msgid "**Inheritance:**" msgstr "" -#: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:562 -#: ../../c-api/typeobj.rst:606 +#: ../../c-api/typeobj.rst:505 ../../c-api/typeobj.rst:564 +#: ../../c-api/typeobj.rst:608 msgid "This field is not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:508 +#: ../../c-api/typeobj.rst:510 msgid "" "This is the type's type, in other words its metatype. It is initialized by " "the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " @@ -1224,7 +1237,7 @@ msgid "" "doing anything else. This is typically done like this::" msgstr "" -#: ../../c-api/typeobj.rst:519 +#: ../../c-api/typeobj.rst:521 msgid "" "This should be done before any instances of the type are created. :c:func:" "`PyType_Ready` checks if :attr:`ob_type` is ``NULL``, and if so, initializes " @@ -1232,22 +1245,22 @@ msgid "" "will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:526 ../../c-api/typeobj.rst:707 -#: ../../c-api/typeobj.rst:824 ../../c-api/typeobj.rst:916 -#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:1546 -#: ../../c-api/typeobj.rst:1569 ../../c-api/typeobj.rst:1687 -#: ../../c-api/typeobj.rst:1705 ../../c-api/typeobj.rst:1789 -#: ../../c-api/typeobj.rst:1901 ../../c-api/typeobj.rst:2031 +#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:709 +#: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:918 +#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1609 +#: ../../c-api/typeobj.rst:1632 ../../c-api/typeobj.rst:1762 +#: ../../c-api/typeobj.rst:1780 ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1965 ../../c-api/typeobj.rst:2110 msgid "This field is inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:532 +#: ../../c-api/typeobj.rst:534 msgid "" "These fields are only present when the macro ``Py_TRACE_REFS`` is defined " "(see the :option:`configure --with-trace-refs option <--with-trace-refs>`)." msgstr "" -#: ../../c-api/typeobj.rst:535 +#: ../../c-api/typeobj.rst:537 msgid "" "Their initialization to ``NULL`` is taken care of by the " "``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects " @@ -1256,7 +1269,7 @@ msgid "" "object into a doubly linked list of *all* live objects on the heap." msgstr "" -#: ../../c-api/typeobj.rst:541 +#: ../../c-api/typeobj.rst:543 msgid "" "This could be used for various debugging purposes; currently the only uses " "are the :func:`sys.getobjects` function and to print the objects that are " @@ -1264,26 +1277,26 @@ msgid "" "`PYTHONDUMPREFS` is set." msgstr "" -#: ../../c-api/typeobj.rst:548 +#: ../../c-api/typeobj.rst:550 msgid "These fields are not inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:552 +#: ../../c-api/typeobj.rst:554 msgid "PyVarObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:556 +#: ../../c-api/typeobj.rst:558 msgid "" "For :ref:`statically allocated type objects `, this should be " "initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." msgstr "" -#: ../../c-api/typeobj.rst:566 +#: ../../c-api/typeobj.rst:568 msgid "PyTypeObject Slots" msgstr "" -#: ../../c-api/typeobj.rst:568 +#: ../../c-api/typeobj.rst:570 msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " @@ -1291,7 +1304,7 @@ msgid "" "`PyBaseObject_Type` and :c:type:`PyType_Type` effectively act as defaults.)" msgstr "" -#: ../../c-api/typeobj.rst:575 +#: ../../c-api/typeobj.rst:577 msgid "" "Pointer to a NUL-terminated string containing the name of the type. For " "types that are accessible as module globals, the string should be the full " @@ -1303,14 +1316,14 @@ msgid "" "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" -#: ../../c-api/typeobj.rst:583 +#: ../../c-api/typeobj.rst:585 msgid "" "For :ref:`dynamically allocated type objects `, this should just " "be the type name, and the module name explicitly stored in the type dict as " "the value for key ``'__module__'``." msgstr "" -#: ../../c-api/typeobj.rst:588 +#: ../../c-api/typeobj.rst:590 msgid "" "For :ref:`statically allocated type objects `, the *tp_name* " "field should contain a dot. Everything before the last dot is made " @@ -1318,7 +1331,7 @@ msgid "" "last dot is made accessible as the :attr:`~definition.__name__` attribute." msgstr "" -#: ../../c-api/typeobj.rst:594 +#: ../../c-api/typeobj.rst:596 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " "made accessible as the :attr:`~definition.__name__` attribute, and the :attr:" @@ -1328,19 +1341,19 @@ msgid "" "created with pydoc." msgstr "" -#: ../../c-api/typeobj.rst:600 +#: ../../c-api/typeobj.rst:602 msgid "" "This field must not be ``NULL``. It is the only required field in :c:func:" "`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." "tp_itemsize`)." msgstr "" -#: ../../c-api/typeobj.rst:612 +#: ../../c-api/typeobj.rst:614 msgid "" "These fields allow calculating the size in bytes of instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:614 +#: ../../c-api/typeobj.rst:616 msgid "" "There are two kinds of types: types with fixed-length instances have a zero :" "c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length " @@ -1349,7 +1362,7 @@ msgid "" "in :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:619 +#: ../../c-api/typeobj.rst:621 msgid "" "For a type with variable-length instances, the instances must have an :attr:" "`ob_size` field, and the instance size is :c:member:`~PyTypeObject." @@ -1363,7 +1376,7 @@ msgid "" "instances, yet those instances have a meaningful :attr:`ob_size` field)." msgstr "" -#: ../../c-api/typeobj.rst:630 +#: ../../c-api/typeobj.rst:632 msgid "" "The basic size includes the fields in the instance declared by the macro :c:" "macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to " @@ -1375,7 +1388,7 @@ msgid "" "size." msgstr "" -#: ../../c-api/typeobj.rst:638 +#: ../../c-api/typeobj.rst:640 msgid "" "A note about alignment: if the variable items require a particular " "alignment, this should be taken care of by the value of :c:member:" @@ -1386,12 +1399,12 @@ msgid "" "alignment requirement for ``double``)." msgstr "" -#: ../../c-api/typeobj.rst:645 +#: ../../c-api/typeobj.rst:647 msgid "" "For any type with variable-length instances, this field must not be ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:649 +#: ../../c-api/typeobj.rst:651 msgid "" "These fields are inherited separately by subtypes. If the base type has a " "non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to " @@ -1399,7 +1412,7 @@ msgid "" "subtype (though this depends on the implementation of the base type)." msgstr "" -#: ../../c-api/typeobj.rst:657 +#: ../../c-api/typeobj.rst:659 msgid "" "A pointer to the instance destructor function. This function must be " "defined unless the type guarantees that its instances will never be " @@ -1407,7 +1420,7 @@ msgid "" "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:663 +#: ../../c-api/typeobj.rst:665 msgid "" "The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" "`Py_XDECREF` macros when the new reference count is zero. At this point, " @@ -1425,14 +1438,14 @@ msgid "" "allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/typeobj.rst:678 +#: ../../c-api/typeobj.rst:680 msgid "" "If the type supports garbage collection (has the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack` " "before clearing any member fields." msgstr "" -#: ../../c-api/typeobj.rst:690 +#: ../../c-api/typeobj.rst:692 msgid "" "Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " @@ -1440,28 +1453,28 @@ msgid "" "recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:712 +#: ../../c-api/typeobj.rst:714 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:717 +#: ../../c-api/typeobj.rst:719 msgid "" "This field is only used if the flag :const:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:721 +#: ../../c-api/typeobj.rst:723 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :const:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:725 +#: ../../c-api/typeobj.rst:727 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1469,35 +1482,35 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:732 +#: ../../c-api/typeobj.rst:734 msgid "" -"It is not recommended for :ref:`mutable heap types ` to " -"implement the vectorcall protocol. When a user sets :attr:`__call__` in " -"Python code, only *tp_call* is updated, likely making it inconsistent with " -"the vectorcall function." +"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " +"used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:739 +#: ../../c-api/typeobj.rst:740 msgid "" -"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " -"used for printing to a file. In Python 3.0 to 3.7, it was unused." +"Before version 3.12, it was not recommended for :ref:`mutable heap types " +"` to implement the vectorcall protocol. When a user sets :attr:" +"`~type.__call__` in Python code, only *tp_call* is updated, likely making it " +"inconsistent with the vectorcall function. Since 3.12, setting ``__call__`` " +"will disable vectorcall optimization by clearing the :const:" +"`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: ../../c-api/typeobj.rst:745 +#: ../../c-api/typeobj.rst:750 msgid "" "This field is always inherited. However, the :const:" -"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " -"the subclass won't use :ref:`vectorcall `, except when :c:func:" -"`PyVectorcall_Call` is explicitly called. This is in particular the case for " -"types without the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag set (including " -"subclasses defined in Python)." +"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " +"then the subclass won't use :ref:`vectorcall `, except when :c:" +"func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: ../../c-api/typeobj.rst:757 +#: ../../c-api/typeobj.rst:759 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:759 +#: ../../c-api/typeobj.rst:761 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1505,11 +1518,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:765 ../../c-api/typeobj.rst:957 +#: ../../c-api/typeobj.rst:767 ../../c-api/typeobj.rst:959 msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:767 +#: ../../c-api/typeobj.rst:769 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1518,12 +1531,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:774 ../../c-api/typeobj.rst:970 +#: ../../c-api/typeobj.rst:776 ../../c-api/typeobj.rst:972 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:776 +#: ../../c-api/typeobj.rst:778 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1531,11 +1544,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:782 ../../c-api/typeobj.rst:983 +#: ../../c-api/typeobj.rst:784 ../../c-api/typeobj.rst:985 msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:784 +#: ../../c-api/typeobj.rst:786 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1544,34 +1557,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:791 +#: ../../c-api/typeobj.rst:793 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:795 +#: ../../c-api/typeobj.rst:797 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:800 +#: ../../c-api/typeobj.rst:802 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:808 +#: ../../c-api/typeobj.rst:810 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:811 +#: ../../c-api/typeobj.rst:813 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:815 +#: ../../c-api/typeobj.rst:817 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1580,87 +1593,88 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:938 -#: ../../c-api/typeobj.rst:963 ../../c-api/typeobj.rst:989 -#: ../../c-api/typeobj.rst:1031 ../../c-api/typeobj.rst:1491 -#: ../../c-api/typeobj.rst:1643 ../../c-api/typeobj.rst:1664 -#: ../../c-api/typeobj.rst:1755 ../../c-api/typeobj.rst:1791 -#: ../../c-api/typeobj.rst:1809 ../../c-api/typeobj.rst:1851 -#: ../../c-api/typeobj.rst:1872 ../../c-api/typeobj.rst:1903 +#: ../../c-api/typeobj.rst:828 ../../c-api/typeobj.rst:940 +#: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:991 +#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1555 +#: ../../c-api/typeobj.rst:1589 ../../c-api/typeobj.rst:1706 +#: ../../c-api/typeobj.rst:1739 ../../c-api/typeobj.rst:1814 +#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1873 +#: ../../c-api/typeobj.rst:1915 ../../c-api/typeobj.rst:1936 +#: ../../c-api/typeobj.rst:1967 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:828 +#: ../../c-api/typeobj.rst:830 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:835 +#: ../../c-api/typeobj.rst:837 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:841 +#: ../../c-api/typeobj.rst:843 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:847 +#: ../../c-api/typeobj.rst:849 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:853 +#: ../../c-api/typeobj.rst:855 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:859 +#: ../../c-api/typeobj.rst:861 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:865 +#: ../../c-api/typeobj.rst:867 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:875 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:876 +#: ../../c-api/typeobj.rst:878 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:880 +#: ../../c-api/typeobj.rst:882 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:884 +#: ../../c-api/typeobj.rst:886 msgid "" "When this field is not set (*and* :attr:`tp_richcompare` is not set), an " "attempt to take the hash of the object raises :exc:`TypeError`. This is the " "same as setting it to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:888 +#: ../../c-api/typeobj.rst:890 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1671,11 +1685,11 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:898 ../../c-api/typeobj.rst:1484 +#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1548 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:900 +#: ../../c-api/typeobj.rst:902 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1684,14 +1698,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:908 +#: ../../c-api/typeobj.rst:910 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:921 +#: ../../c-api/typeobj.rst:923 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1700,11 +1714,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:926 +#: ../../c-api/typeobj.rst:928 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:930 +#: ../../c-api/typeobj.rst:932 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1712,28 +1726,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:940 +#: ../../c-api/typeobj.rst:942 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:946 +#: ../../c-api/typeobj.rst:948 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:948 +#: ../../c-api/typeobj.rst:950 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:952 +#: ../../c-api/typeobj.rst:954 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:959 +#: ../../c-api/typeobj.rst:961 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1742,15 +1756,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:965 +#: ../../c-api/typeobj.rst:967 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:972 +#: ../../c-api/typeobj.rst:974 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:976 +#: ../../c-api/typeobj.rst:978 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1758,7 +1772,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:985 +#: ../../c-api/typeobj.rst:987 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1767,24 +1781,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:991 +#: ../../c-api/typeobj.rst:993 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:996 +#: ../../c-api/typeobj.rst:998 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:1002 +#: ../../c-api/typeobj.rst:1004 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1008 +#: ../../c-api/typeobj.rst:1010 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1796,7 +1810,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1018 +#: ../../c-api/typeobj.rst:1020 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1808,20 +1822,21 @@ msgid "" "and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :const:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:" "`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in " -"the subtype exist and have ``NULL`` values." +"the subtype exist and have ``NULL`` values. .. XXX are most flag bits " +"*really* inherited individually?" msgstr "" -#: ../../c-api/typeobj.rst:1033 +#: ../../c-api/typeobj.rst:1034 msgid "" ":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1036 +#: ../../c-api/typeobj.rst:1037 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1038 +#: ../../c-api/typeobj.rst:1039 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1830,7 +1845,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1045 +#: ../../c-api/typeobj.rst:1046 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1841,32 +1856,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1055 ../../c-api/typeobj.rst:1066 -#: ../../c-api/typeobj.rst:1076 ../../c-api/typeobj.rst:1086 -#: ../../c-api/typeobj.rst:1118 +#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1067 +#: ../../c-api/typeobj.rst:1077 ../../c-api/typeobj.rst:1087 +#: ../../c-api/typeobj.rst:1119 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1060 +#: ../../c-api/typeobj.rst:1061 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1071 +#: ../../c-api/typeobj.rst:1072 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1081 +#: ../../c-api/typeobj.rst:1082 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1091 +#: ../../c-api/typeobj.rst:1092 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " @@ -1876,13 +1891,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1358 -#: ../../c-api/typeobj.rst:1425 +#: ../../c-api/typeobj.rst:1101 ../../c-api/typeobj.rst:1422 +#: ../../c-api/typeobj.rst:1489 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1102 +#: ../../c-api/typeobj.rst:1103 msgid "" "The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" "attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" @@ -1891,48 +1906,99 @@ msgid "" "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1112 +#: ../../c-api/typeobj.rst:1113 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1123 +#: ../../c-api/typeobj.rst:1124 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1125 +#: ../../c-api/typeobj.rst:1126 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1127 +#: ../../c-api/typeobj.rst:1128 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1130 +#: ../../c-api/typeobj.rst:1131 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1133 +#: ../../c-api/typeobj.rst:1134 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1141 +#: ../../c-api/typeobj.rst:1142 msgid "" "This flag is never inherited by types without the :const:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1158 +#: ../../c-api/typeobj.rst:1148 +msgid "" +"This bit indicates that instances of the class have a ``__dict__`` " +"attribute, and that the space for the dictionary is managed by the VM." +msgstr "" + +#: ../../c-api/typeobj.rst:1151 +msgid "If this flag is set, :const:`Py_TPFLAGS_HAVE_GC` should also be set." +msgstr "" + +#: ../../c-api/typeobj.rst:1157 +msgid "" +"This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " +"field is set in a superclass." +msgstr "" + +#: ../../c-api/typeobj.rst:1163 +msgid "" +"This bit indicates that instances of the class should be weakly " +"referenceable." +msgstr "" + +#: ../../c-api/typeobj.rst:1170 +msgid "" +"This flag is inherited unless the :c:member:`~PyTypeObject." +"tp_weaklistoffset` field is set in a superclass." +msgstr "" + +#: ../../c-api/typeobj.rst:1176 +msgid "" +"Only usable with variable-size types, i.e. ones with non-zero :c:member:" +"`~PyObject.tp_itemsize`." +msgstr "" + +#: ../../c-api/typeobj.rst:1179 +msgid "" +"Indicates that the variable-sized portion of an instance of this type is at " +"the end of the instance's memory area, at an offset of :c:expr:`Py_TYPE(obj)-" +">tp_basicsize` (which may be different in each subclass)." +msgstr "" + +#: ../../c-api/typeobj.rst:1184 +msgid "" +"When setting this flag, be sure that all superclasses either use this memory " +"layout, or are not variable-sized. Python does not check this." +msgstr "" + +#: ../../c-api/typeobj.rst:1192 +msgid "This flag is inherited." +msgstr "" + +#: ../../c-api/typeobj.rst:1206 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -1942,81 +2008,91 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1169 +#: ../../c-api/typeobj.rst:1217 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1174 +#: ../../c-api/typeobj.rst:1222 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1182 +#: ../../c-api/typeobj.rst:1230 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1188 +#: ../../c-api/typeobj.rst:1236 +#, fuzzy msgid "" -"This bit is inherited for types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` " -"flag set, if :c:member:`~PyTypeObject.tp_call` is also inherited." +"This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." +msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" + +#: ../../c-api/typeobj.rst:1243 +msgid "" +"This flag is now removed from a class when the class's :py:meth:`~object." +"__call__` method is reassigned." +msgstr "" + +#: ../../c-api/typeobj.rst:1246 +msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1196 +#: ../../c-api/typeobj.rst:1250 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1198 +#: ../../c-api/typeobj.rst:1252 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1203 +#: ../../c-api/typeobj.rst:1257 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1209 +#: ../../c-api/typeobj.rst:1263 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1213 +#: ../../c-api/typeobj.rst:1267 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1216 +#: ../../c-api/typeobj.rst:1270 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1222 +#: ../../c-api/typeobj.rst:1276 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1229 +#: ../../c-api/typeobj.rst:1283 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1240 +#: ../../c-api/typeobj.rst:1294 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2024,23 +2100,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1247 ../../c-api/typeobj.rst:1269 +#: ../../c-api/typeobj.rst:1301 ../../c-api/typeobj.rst:1323 msgid "" ":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " "exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1306 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1255 ../../c-api/typeobj.rst:1277 +#: ../../c-api/typeobj.rst:1309 ../../c-api/typeobj.rst:1331 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1262 +#: ../../c-api/typeobj.rst:1316 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2048,37 +2124,49 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1274 +#: ../../c-api/typeobj.rst:1328 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1284 +#: ../../c-api/typeobj.rst:1338 +msgid "" +"Internal. Do not set or unset this flag. To indicate that a class has " +"changed call :c:func:`PyType_Modified`" +msgstr "" + +#: ../../c-api/typeobj.rst:1342 +msgid "" +"This flag is present in header files, but is an internal feature and should " +"not be used. It will be removed in a future version of CPython" +msgstr "" + +#: ../../c-api/typeobj.rst:1348 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1290 +#: ../../c-api/typeobj.rst:1354 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1295 +#: ../../c-api/typeobj.rst:1359 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1300 ../../c-api/typeobj.rst:1420 +#: ../../c-api/typeobj.rst:1364 ../../c-api/typeobj.rst:1484 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1303 +#: ../../c-api/typeobj.rst:1367 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2088,7 +2176,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1318 +#: ../../c-api/typeobj.rst:1382 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2096,14 +2184,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1322 +#: ../../c-api/typeobj.rst:1386 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1327 +#: ../../c-api/typeobj.rst:1391 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2132,14 +2220,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1351 +#: ../../c-api/typeobj.rst:1415 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1360 +#: ../../c-api/typeobj.rst:1424 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2147,14 +2235,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1368 +#: ../../c-api/typeobj.rst:1432 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " "is::" msgstr "" -#: ../../c-api/typeobj.rst:1373 +#: ../../c-api/typeobj.rst:1437 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2169,7 +2257,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1383 +#: ../../c-api/typeobj.rst:1447 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2177,7 +2265,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1397 +#: ../../c-api/typeobj.rst:1461 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be decremented " @@ -2192,7 +2280,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1408 +#: ../../c-api/typeobj.rst:1472 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2200,7 +2288,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1414 +#: ../../c-api/typeobj.rst:1478 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2210,7 +2298,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1427 +#: ../../c-api/typeobj.rst:1491 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2218,18 +2306,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1435 +#: ../../c-api/typeobj.rst:1499 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1439 +#: ../../c-api/typeobj.rst:1503 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1442 +#: ../../c-api/typeobj.rst:1506 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2237,74 +2325,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1447 +#: ../../c-api/typeobj.rst:1511 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1451 +#: ../../c-api/typeobj.rst:1515 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1451 +#: ../../c-api/typeobj.rst:1515 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1517 msgid ":const:`Py_LT`" msgstr ":const:`Py_LT`" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1517 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1455 +#: ../../c-api/typeobj.rst:1519 msgid ":const:`Py_LE`" msgstr ":const:`Py_LE`" -#: ../../c-api/typeobj.rst:1455 +#: ../../c-api/typeobj.rst:1519 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1521 msgid ":const:`Py_EQ`" msgstr ":const:`Py_EQ`" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1521 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:1523 msgid ":const:`Py_NE`" msgstr ":const:`Py_NE`" -#: ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:1523 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1461 +#: ../../c-api/typeobj.rst:1525 msgid ":const:`Py_GT`" msgstr ":const:`Py_GT`" -#: ../../c-api/typeobj.rst:1461 +#: ../../c-api/typeobj.rst:1525 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1527 msgid ":const:`Py_GE`" msgstr ":const:`Py_GE`" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1527 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1466 +#: ../../c-api/typeobj.rst:1530 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1470 +#: ../../c-api/typeobj.rst:1534 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2312,15 +2400,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1476 +#: ../../c-api/typeobj.rst:1540 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1478 +#: ../../c-api/typeobj.rst:1542 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1550 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2328,7 +2416,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1493 +#: ../../c-api/typeobj.rst:1557 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2336,7 +2424,13 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1502 +#: ../../c-api/typeobj.rst:1566 +msgid "" +"While this field is still supported, :const:`Py_TPFLAGS_MANAGED_WEAKREF` " +"should be used instead, if at all possible." +msgstr "" + +#: ../../c-api/typeobj.rst:1569 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2346,13 +2440,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1509 +#: ../../c-api/typeobj.rst:1576 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1514 +#: ../../c-api/typeobj.rst:1579 +msgid "" +"It is an error to set both the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit and :" +"c:member:`~PyTypeObject.tp_weaklist`." +msgstr "" + +#: ../../c-api/typeobj.rst:1584 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2361,48 +2461,32 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1519 -msgid "" -"When a type defined by a class statement has no :attr:`~object.__slots__` " -"declaration, and none of its base types are weakly referenceable, the type " -"is made weakly referenceable by adding a weak reference list head slot to " -"the instance layout and setting the :c:member:`~PyTypeObject." -"tp_weaklistoffset` of that slot's offset." -msgstr "" - -#: ../../c-api/typeobj.rst:1524 -msgid "" -"When a type's :attr:`__slots__` declaration contains a slot named :attr:" -"`__weakref__`, that slot becomes the weak reference list head for instances " -"of the type, and the slot's offset is stored in the type's :c:member:" -"`~PyTypeObject.tp_weaklistoffset`." -msgstr "" - -#: ../../c-api/typeobj.rst:1529 +#: ../../c-api/typeobj.rst:1591 msgid "" -"When a type's :attr:`__slots__` declaration does not contain a slot named :" -"attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." -"tp_weaklistoffset` from its base type." +"If the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" +"`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." +"tp_weaklistoffset` will be set to a negative value, to indicate that it is " +"unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1599 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1603 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1551 +#: ../../c-api/typeobj.rst:1614 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1556 +#: ../../c-api/typeobj.rst:1619 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2410,74 +2494,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1624 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1565 +#: ../../c-api/typeobj.rst:1628 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1574 +#: ../../c-api/typeobj.rst:1637 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1577 +#: ../../c-api/typeobj.rst:1640 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1582 +#: ../../c-api/typeobj.rst:1645 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1651 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1592 +#: ../../c-api/typeobj.rst:1655 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1597 +#: ../../c-api/typeobj.rst:1660 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1666 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1606 +#: ../../c-api/typeobj.rst:1669 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1674 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1617 +#: ../../c-api/typeobj.rst:1680 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2485,7 +2569,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1625 +#: ../../c-api/typeobj.rst:1688 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2493,7 +2577,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1630 +#: ../../c-api/typeobj.rst:1693 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2501,74 +2585,95 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1636 +#: ../../c-api/typeobj.rst:1699 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1641 +#: ../../c-api/typeobj.rst:1704 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1645 +#: ../../c-api/typeobj.rst:1708 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1651 +#: ../../c-api/typeobj.rst:1714 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1653 +#: ../../c-api/typeobj.rst:1716 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " "attributes for the type. Once :c:func:`PyType_Ready` has initialized the " "type, extra attributes for the type may be added to this dictionary only if " -"they don't correspond to overloaded operations (like :meth:`__add__`)." +"they don't correspond to overloaded operations (like :meth:`__add__`). Once " +"initialization for the type has finished, this field should be treated as " +"read-only." +msgstr "" + +#: ../../c-api/typeobj.rst:1724 +msgid "" +"Some types may not store their dictionary in this slot. Use :c:func:" +"`PyType_GetDict` to retreive the dictionary for an arbitrary type." +msgstr "" + +#: ../../c-api/typeobj.rst:1730 +msgid "" +"Internals detail: For static builtin types, this is always ``NULL``. " +"Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" +"func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1661 +#: ../../c-api/typeobj.rst:1736 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1741 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1671 +#: ../../c-api/typeobj.rst:1746 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1677 +#: ../../c-api/typeobj.rst:1752 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1679 ../../c-api/typeobj.rst:1695 -#: ../../c-api/typeobj.rst:1770 ../../c-api/typeobj.rst:1800 -#: ../../c-api/typeobj.rst:1824 +#: ../../c-api/typeobj.rst:1754 ../../c-api/typeobj.rst:1770 +#: ../../c-api/typeobj.rst:1834 ../../c-api/typeobj.rst:1864 +#: ../../c-api/typeobj.rst:1888 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1692 +#: ../../c-api/typeobj.rst:1767 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1699 +#: ../../c-api/typeobj.rst:1774 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1710 +#: ../../c-api/typeobj.rst:1785 +msgid "" +"While this field is still supported, :const:`Py_TPFLAGS_MANAGED_DICT` should " +"be used instead, if at all possible." +msgstr "" + +#: ../../c-api/typeobj.rst:1788 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2576,29 +2681,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1715 +#: ../../c-api/typeobj.rst:1793 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1796 msgid "" -"If the value of this field is greater than zero, it specifies the offset " -"from the start of the instance structure. If the value is less than zero, " -"it specifies the offset from the *end* of the instance structure. A " -"negative offset is more expensive to use, and should only be used when the " -"instance structure contains a variable-length part. This is used for " -"example to add an instance variable dictionary to subtypes of :class:`str` " -"or :class:`tuple`. Note that the :c:member:`~PyTypeObject.tp_basicsize` " -"field should account for the dictionary added to the end in that case, even " -"though the dictionary is not included in the basic object layout. On a " -"system with a pointer size of 4 bytes, :c:member:`~PyTypeObject." -"tp_dictoffset` should be set to ``-4`` to indicate that the dictionary is at " -"the very end of the structure." +"The value specifies the offset of the dictionary from the start of the " +"instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1798 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2607,49 +2702,38 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1738 -msgid "" -"This field is inherited by subtypes, but see the rules listed below. A " -"subtype may override this offset; this means that the subtype instances " -"store the dictionary at a difference offset than the base type. Since the " -"dictionary is always found via :c:member:`~PyTypeObject.tp_dictoffset`, this " -"should not be a problem." -msgstr "" - -#: ../../c-api/typeobj.rst:1743 +#: ../../c-api/typeobj.rst:1804 msgid "" -"When a type defined by a class statement has no :attr:`~object.__slots__` " -"declaration, and none of its base types has an instance variable dictionary, " -"a dictionary slot is added to the instance layout and the :c:member:" -"`~PyTypeObject.tp_dictoffset` is set to that slot's offset." +"It is an error to set both the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit and :" +"c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1748 +#: ../../c-api/typeobj.rst:1809 msgid "" -"When a type defined by a class statement has a :attr:`__slots__` " -"declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " -"from its base type." +"This field is inherited by subtypes. A subtype should not override this " +"offset; doing so could be unsafe, if C code tries to access the dictionary " +"at the previous offset. To properly support inheritance, use :const:" +"`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1751 +#: ../../c-api/typeobj.rst:1816 msgid "" -"(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " -"declaration does not have the expected effect, it just causes confusion. " -"Maybe this should be added as a feature just like :attr:`__weakref__` " -"though.)" +"This slot has no default. For :ref:`static types `, if the " +"field is ``NULL`` then no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1757 +#: ../../c-api/typeobj.rst:1819 msgid "" -"This slot has no default. For :ref:`static types `, if the " -"field is ``NULL`` then no :attr:`__dict__` gets created for instances." +"If the :const:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " +"will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1763 +#: ../../c-api/typeobj.rst:1827 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1765 +#: ../../c-api/typeobj.rst:1829 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2657,14 +2741,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1774 +#: ../../c-api/typeobj.rst:1838 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1842 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2676,43 +2760,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1785 +#: ../../c-api/typeobj.rst:1849 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1857 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1862 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1870 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1811 +#: ../../c-api/typeobj.rst:1875 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1815 +#: ../../c-api/typeobj.rst:1879 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1822 +#: ../../c-api/typeobj.rst:1886 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1828 +#: ../../c-api/typeobj.rst:1892 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2721,7 +2805,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1834 +#: ../../c-api/typeobj.rst:1898 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2733,20 +2817,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1906 msgid "" "Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " "instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1847 +#: ../../c-api/typeobj.rst:1911 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1917 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2754,39 +2838,39 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1861 +#: ../../c-api/typeobj.rst:1925 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1865 +#: ../../c-api/typeobj.rst:1929 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1869 +#: ../../c-api/typeobj.rst:1933 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1938 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1878 +#: ../../c-api/typeobj.rst:1942 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1883 +#: ../../c-api/typeobj.rst:1947 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1885 +#: ../../c-api/typeobj.rst:1949 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2798,90 +2882,111 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1895 +#: ../../c-api/typeobj.rst:1959 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1905 +#: ../../c-api/typeobj.rst:1969 msgid "" "This slot has no default. If this field is ``NULL``, :const:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1911 +#: ../../c-api/typeobj.rst:1975 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1977 ../../c-api/typeobj.rst:2001 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1916 +#: ../../c-api/typeobj.rst:1980 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1923 +#: ../../c-api/typeobj.rst:1987 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1929 ../../c-api/typeobj.rst:1952 -#: ../../c-api/typeobj.rst:1961 ../../c-api/typeobj.rst:1971 -#: ../../c-api/typeobj.rst:1985 +#: ../../c-api/typeobj.rst:1993 ../../c-api/typeobj.rst:2016 +#: ../../c-api/typeobj.rst:2033 ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2064 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1934 +#: ../../c-api/typeobj.rst:1998 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:2006 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1948 +#: ../../c-api/typeobj.rst:2012 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1957 -msgid "List of weak references to subclasses. Internal use only." +#: ../../c-api/typeobj.rst:2021 +msgid "" +"A collection of subclasses. Internal use only. May be an invalid pointer." +msgstr "" + +#: ../../c-api/typeobj.rst:2023 +msgid "" +"To get a list of subclasses, call the Python method :py:meth:`~class." +"__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:1966 +#: ../../c-api/typeobj.rst:2028 +msgid "" +"For some types, this field does not hold a valid :c:expr:`PyObject*`. The " +"type was changed to :c:expr:`void*` to indicate this." +msgstr "" + +#: ../../c-api/typeobj.rst:2038 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1976 +#: ../../c-api/typeobj.rst:2043 +msgid "" +"Internals detail: For the static builtin types this is always ``NULL``, even " +"if weakrefs are added. Instead, the weakrefs for each are stored on " +"``PyInterpreterState``. Use the public C-API or the internal " +"``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." +msgstr "" + +#: ../../c-api/typeobj.rst:2055 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1981 +#: ../../c-api/typeobj.rst:2060 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1990 +#: ../../c-api/typeobj.rst:2069 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1994 +#: ../../c-api/typeobj.rst:2073 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2891,14 +2996,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2001 +#: ../../c-api/typeobj.rst:2080 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2018 +#: ../../c-api/typeobj.rst:2097 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -2911,18 +3016,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2037 +#: ../../c-api/typeobj.rst:2116 msgid "" "Before version 3.8 it was necessary to set the :const:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2041 +#: ../../c-api/typeobj.rst:2120 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2046 +#: ../../c-api/typeobj.rst:2125 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2930,61 +3035,65 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2133 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2056 +#: ../../c-api/typeobj.rst:2135 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2062 +#: ../../c-api/typeobj.rst:2140 +msgid "Internal. Do not use." +msgstr "" + +#: ../../c-api/typeobj.rst:2148 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:2150 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2068 +#: ../../c-api/typeobj.rst:2154 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2070 +#: ../../c-api/typeobj.rst:2156 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2072 +#: ../../c-api/typeobj.rst:2158 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2074 +#: ../../c-api/typeobj.rst:2160 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2078 +#: ../../c-api/typeobj.rst:2164 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " -"` as an opaque struct, any extension modules using static types must " -"be compiled for a specific Python minor version." +"` as an opaque struct, any extension modules using static " +"types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2086 +#: ../../c-api/typeobj.rst:2172 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2088 +#: ../../c-api/typeobj.rst:2174 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2992,29 +3101,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2093 +#: ../../c-api/typeobj.rst:2179 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" -"func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, or :c:func:" -"`PyType_FromModuleAndSpec`." +"func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" +"`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2101 +#: ../../c-api/typeobj.rst:2187 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2108 +#: ../../c-api/typeobj.rst:2194 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2114 ../../c-api/typeobj.rst:2438 +#: ../../c-api/typeobj.rst:2200 ../../c-api/typeobj.rst:2524 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2161 +#: ../../c-api/typeobj.rst:2247 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3024,30 +3133,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2170 +#: ../../c-api/typeobj.rst:2256 msgid "" "The :c:data:`nb_reserved` field should always be ``NULL``. It was " "previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2215 +#: ../../c-api/typeobj.rst:2301 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2222 +#: ../../c-api/typeobj.rst:2308 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2227 +#: ../../c-api/typeobj.rst:2313 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2233 +#: ../../c-api/typeobj.rst:2319 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3055,7 +3164,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2241 +#: ../../c-api/typeobj.rst:2327 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3065,17 +3174,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2252 +#: ../../c-api/typeobj.rst:2338 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2259 +#: ../../c-api/typeobj.rst:2345 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2264 +#: ../../c-api/typeobj.rst:2350 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3083,21 +3192,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2271 +#: ../../c-api/typeobj.rst:2357 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2277 +#: ../../c-api/typeobj.rst:2363 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2283 +#: ../../c-api/typeobj.rst:2369 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3106,7 +3215,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2289 +#: ../../c-api/typeobj.rst:2375 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -3114,7 +3223,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2296 +#: ../../c-api/typeobj.rst:2382 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3123,14 +3232,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2305 +#: ../../c-api/typeobj.rst:2391 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2398 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3140,7 +3249,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2321 +#: ../../c-api/typeobj.rst:2407 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3150,72 +3259,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2332 +#: ../../c-api/typeobj.rst:2418 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2340 +#: ../../c-api/typeobj.rst:2426 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2346 ../../c-api/typeobj.rst:2395 -#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2460 -#: ../../c-api/typeobj.rst:2472 ../../c-api/typeobj.rst:2481 +#: ../../c-api/typeobj.rst:2432 ../../c-api/typeobj.rst:2481 +#: ../../c-api/typeobj.rst:2535 ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2558 ../../c-api/typeobj.rst:2567 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2350 +#: ../../c-api/typeobj.rst:2436 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2354 +#: ../../c-api/typeobj.rst:2440 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2357 +#: ../../c-api/typeobj.rst:2443 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2359 +#: ../../c-api/typeobj.rst:2445 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2361 +#: ../../c-api/typeobj.rst:2447 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2363 +#: ../../c-api/typeobj.rst:2449 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2451 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2368 +#: ../../c-api/typeobj.rst:2454 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2371 +#: ../../c-api/typeobj.rst:2457 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2375 +#: ../../c-api/typeobj.rst:2461 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3223,7 +3332,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2380 +#: ../../c-api/typeobj.rst:2466 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3232,19 +3341,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2387 +#: ../../c-api/typeobj.rst:2473 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2390 +#: ../../c-api/typeobj.rst:2476 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2399 +#: ../../c-api/typeobj.rst:2485 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3252,15 +3361,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2404 +#: ../../c-api/typeobj.rst:2490 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2406 +#: ../../c-api/typeobj.rst:2492 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2408 +#: ../../c-api/typeobj.rst:2494 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3268,68 +3377,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2414 +#: ../../c-api/typeobj.rst:2500 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2419 +#: ../../c-api/typeobj.rst:2505 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2427 +#: ../../c-api/typeobj.rst:2513 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2435 +#: ../../c-api/typeobj.rst:2521 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2539 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2456 +#: ../../c-api/typeobj.rst:2542 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2464 +#: ../../c-api/typeobj.rst:2550 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2467 +#: ../../c-api/typeobj.rst:2553 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2476 +#: ../../c-api/typeobj.rst:2562 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2485 +#: ../../c-api/typeobj.rst:2571 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2580 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2584 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3343,80 +3452,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2508 +#: ../../c-api/typeobj.rst:2594 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2515 +#: ../../c-api/typeobj.rst:2601 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2519 +#: ../../c-api/typeobj.rst:2605 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2523 +#: ../../c-api/typeobj.rst:2609 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2527 +#: ../../c-api/typeobj.rst:2613 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2531 ../../c-api/typeobj.rst:2540 +#: ../../c-api/typeobj.rst:2617 ../../c-api/typeobj.rst:2626 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2535 ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2621 ../../c-api/typeobj.rst:2632 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2542 +#: ../../c-api/typeobj.rst:2628 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2549 +#: ../../c-api/typeobj.rst:2635 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2553 +#: ../../c-api/typeobj.rst:2639 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2557 +#: ../../c-api/typeobj.rst:2643 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2561 +#: ../../c-api/typeobj.rst:2647 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2565 +#: ../../c-api/typeobj.rst:2651 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2569 +#: ../../c-api/typeobj.rst:2655 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2573 +#: ../../c-api/typeobj.rst:2659 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2587 +#: ../../c-api/typeobj.rst:2673 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2603 +#: ../../c-api/typeobj.rst:2689 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2605 +#: ../../c-api/typeobj.rst:2691 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3424,46 +3533,46 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2610 +#: ../../c-api/typeobj.rst:2696 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2627 +#: ../../c-api/typeobj.rst:2713 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2671 +#: ../../c-api/typeobj.rst:2757 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2698 +#: ../../c-api/typeobj.rst:2782 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:data:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2717 +#: ../../c-api/typeobj.rst:2801 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2728 +#: ../../c-api/typeobj.rst:2812 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: ../../c-api/typeobj.rst:806 ../../c-api/typeobj.rst:871 +#: ../../c-api/typeobj.rst:808 ../../c-api/typeobj.rst:873 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/typeobj.rst:806 +#: ../../c-api/typeobj.rst:808 msgid "repr" msgstr "repr" -#: ../../c-api/typeobj.rst:871 +#: ../../c-api/typeobj.rst:873 msgid "hash" msgstr "hash(雜湊)" diff --git a/c-api/unicode.po b/c-api/unicode.po index 6228afd92d..e2ec742945 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,153 +40,121 @@ msgstr "" #: ../../c-api/unicode.rst:20 msgid "" -":c:expr:`Py_UNICODE*` and UTF-8 representations are created on demand and " -"cached in the Unicode object. The :c:expr:`Py_UNICODE*` representation is " -"deprecated and inefficient." +"UTF-8 representation is created on demand and cached in the Unicode object." msgstr "" -#: ../../c-api/unicode.rst:24 +#: ../../c-api/unicode.rst:23 msgid "" -"Due to the transition between the old APIs and the new APIs, Unicode objects " -"can internally be in two states depending on how they were created:" +"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 " +"with deprecated APIs. See :pep:`623` for more information." msgstr "" -#: ../../c-api/unicode.rst:27 -msgid "" -"\"canonical\" Unicode objects are all objects created by a non-deprecated " -"Unicode API. They use the most efficient representation allowed by the " -"implementation." -msgstr "" - -#: ../../c-api/unicode.rst:31 -msgid "" -"\"legacy\" Unicode objects have been created through one of the deprecated " -"APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the :c:expr:" -"`Py_UNICODE*` representation; you will have to call :c:func:" -"`PyUnicode_READY` on them before calling any other API." -msgstr "" - -#: ../../c-api/unicode.rst:37 -msgid "" -"The \"legacy\" Unicode object will be removed in Python 3.12 with deprecated " -"APIs. All Unicode objects will be \"canonical\" since then. See :pep:`623` " -"for more information." -msgstr "" - -#: ../../c-api/unicode.rst:43 +#: ../../c-api/unicode.rst:29 msgid "Unicode Type" msgstr "" -#: ../../c-api/unicode.rst:45 +#: ../../c-api/unicode.rst:31 msgid "" "These are the basic Unicode object types used for the Unicode implementation " "in Python:" msgstr "" -#: ../../c-api/unicode.rst:52 +#: ../../c-api/unicode.rst:38 msgid "" "These types are typedefs for unsigned integer types wide enough to contain " "characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with " "single Unicode characters, use :c:type:`Py_UCS4`." msgstr "" -#: ../../c-api/unicode.rst:61 +#: ../../c-api/unicode.rst:47 msgid "" "This is a typedef of :c:expr:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform." msgstr "" -#: ../../c-api/unicode.rst:64 +#: ../../c-api/unicode.rst:50 msgid "" "In previous versions, this was a 16-bit type or a 32-bit type depending on " "whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " "build time." msgstr "" -#: ../../c-api/unicode.rst:74 +#: ../../c-api/unicode.rst:60 msgid "" "These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " "almost all cases, they shouldn't be used directly, since all API functions " "that deal with Unicode objects take and return :c:type:`PyObject` pointers." msgstr "" -#: ../../c-api/unicode.rst:83 +#: ../../c-api/unicode.rst:69 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " "It is exposed to Python code as ``str``." msgstr "" -#: ../../c-api/unicode.rst:87 +#: ../../c-api/unicode.rst:73 msgid "" "The following APIs are C macros and static inlined functions for fast checks " "and access to internal read-only data of Unicode objects:" msgstr "" -#: ../../c-api/unicode.rst:92 +#: ../../c-api/unicode.rst:78 msgid "" "Return true if the object *o* is a Unicode object or an instance of a " "Unicode subtype. This function always succeeds." msgstr "" -#: ../../c-api/unicode.rst:98 +#: ../../c-api/unicode.rst:84 msgid "" "Return true if the object *o* is a Unicode object, but not an instance of a " "subtype. This function always succeeds." msgstr "" -#: ../../c-api/unicode.rst:104 -msgid "" -"Ensure the string object *o* is in the \"canonical\" representation. This " -"is required before using any of the access macros described below." +#: ../../c-api/unicode.rst:90 +msgid "Returns ``0``. This API is kept only for backward compatibility." msgstr "" -#: ../../c-api/unicode.rst:109 -msgid "" -"Returns ``0`` on success and ``-1`` with an exception set on failure, which " -"in particular happens if memory allocation fails." +#: ../../c-api/unicode.rst:94 +msgid "This API does nothing since Python 3.12." msgstr "" -#: ../../c-api/unicode.rst:115 -msgid "This API will be removed with :c:func:`PyUnicode_FromUnicode`." -msgstr "" - -#: ../../c-api/unicode.rst:120 +#: ../../c-api/unicode.rst:100 msgid "" "Return the length of the Unicode string, in code points. *o* has to be a " "Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:130 +#: ../../c-api/unicode.rst:110 msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " "canonical representation has the correct character size; use :c:func:" -"`PyUnicode_KIND` to select the right macro. Make sure :c:func:" -"`PyUnicode_READY` has been called before accessing this." +"`PyUnicode_KIND` to select the right function." msgstr "" -#: ../../c-api/unicode.rst:144 +#: ../../c-api/unicode.rst:122 msgid "Return values of the :c:func:`PyUnicode_KIND` macro." msgstr "" -#: ../../c-api/unicode.rst:149 -msgid "``PyUnicode_WCHAR_KIND`` is deprecated." +#: ../../c-api/unicode.rst:126 +#, fuzzy +msgid "``PyUnicode_WCHAR_KIND`` has been removed." msgstr "``PyUnicode_WCHAR_KIND`` 已棄用。" -#: ../../c-api/unicode.rst:154 +#: ../../c-api/unicode.rst:132 msgid "" "Return one of the PyUnicode kind constants (see above) that indicate how " "many bytes per character this Unicode object uses to store its data. *o* " "has to be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:165 +#: ../../c-api/unicode.rst:141 msgid "" "Return a void pointer to the raw Unicode buffer. *o* has to be a Unicode " "object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:174 +#: ../../c-api/unicode.rst:150 msgid "" "Write into a canonical representation *data* (as obtained with :c:func:" "`PyUnicode_DATA`). This function performs no sanity checks, and is intended " @@ -196,142 +164,97 @@ msgid "" "written to that location." msgstr "" -#: ../../c-api/unicode.rst:187 +#: ../../c-api/unicode.rst:163 msgid "" "Read a code point from a canonical representation *data* (as obtained with :" "c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" -#: ../../c-api/unicode.rst:195 +#: ../../c-api/unicode.rst:171 msgid "" "Read a character from a Unicode object *o*, which must be in the " "\"canonical\" representation. This is less efficient than :c:func:" "`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" -#: ../../c-api/unicode.rst:204 +#: ../../c-api/unicode.rst:180 msgid "" "Return the maximum code point that is suitable for creating another string " "based on *o*, which must be in the \"canonical\" representation. This is " "always an approximation but more efficient than iterating over the string." msgstr "" -#: ../../c-api/unicode.rst:213 -msgid "" -"Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " -"code units (this includes surrogate pairs as 2 units). *o* has to be a " -"Unicode object (not checked)." -msgstr "" - -#: ../../c-api/unicode.rst:219 ../../c-api/unicode.rst:229 -#: ../../c-api/unicode.rst:761 -msgid "" -"Part of the old-style Unicode API, please migrate to using :c:func:" -"`PyUnicode_GET_LENGTH`." -msgstr "" - -#: ../../c-api/unicode.rst:224 -msgid "" -"Return the size of the deprecated :c:type:`Py_UNICODE` representation in " -"bytes. *o* has to be a Unicode object (not checked)." -msgstr "" - -#: ../../c-api/unicode.rst:235 -msgid "" -"Return a pointer to a :c:type:`Py_UNICODE` representation of the object. " -"The returned buffer is always terminated with an extra null code point. It " -"may also contain embedded null code points, which would cause the string to " -"be truncated when used in most C functions. The ``AS_DATA`` form casts the " -"pointer to :c:expr:`const char *`. The *o* argument has to be a Unicode " -"object (not checked)." -msgstr "" - -#: ../../c-api/unicode.rst:242 -msgid "" -"This function is now inefficient -- because in many cases the :c:type:" -"`Py_UNICODE` representation does not exist and needs to be created -- and " -"can fail (return ``NULL`` with an exception set). Try to port the code to " -"use the new :c:func:`PyUnicode_nBYTE_DATA` macros or use :c:func:" -"`PyUnicode_WRITE` or :c:func:`PyUnicode_READ`." -msgstr "" - -#: ../../c-api/unicode.rst:251 -msgid "" -"Part of the old-style Unicode API, please migrate to using the :c:func:" -"`PyUnicode_nBYTE_DATA` family of macros." -msgstr "" - -#: ../../c-api/unicode.rst:256 +#: ../../c-api/unicode.rst:189 msgid "" "Return ``1`` if the string is a valid identifier according to the language " "definition, section :ref:`identifiers`. Return ``0`` otherwise." msgstr "" -#: ../../c-api/unicode.rst:259 +#: ../../c-api/unicode.rst:192 msgid "" "The function does not call :c:func:`Py_FatalError` anymore if the string is " "not ready." msgstr "" -#: ../../c-api/unicode.rst:265 +#: ../../c-api/unicode.rst:198 msgid "Unicode Character Properties" msgstr "" -#: ../../c-api/unicode.rst:267 +#: ../../c-api/unicode.rst:200 msgid "" "Unicode provides many different character properties. The most often needed " "ones are available through these macros which are mapped to C functions " "depending on the Python configuration." msgstr "" -#: ../../c-api/unicode.rst:274 +#: ../../c-api/unicode.rst:207 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." msgstr "" -#: ../../c-api/unicode.rst:279 +#: ../../c-api/unicode.rst:212 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." msgstr "" -#: ../../c-api/unicode.rst:284 +#: ../../c-api/unicode.rst:217 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." msgstr "" -#: ../../c-api/unicode.rst:289 +#: ../../c-api/unicode.rst:222 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." msgstr "" -#: ../../c-api/unicode.rst:294 +#: ../../c-api/unicode.rst:227 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." msgstr "" -#: ../../c-api/unicode.rst:299 +#: ../../c-api/unicode.rst:232 msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." msgstr "" -#: ../../c-api/unicode.rst:304 +#: ../../c-api/unicode.rst:237 msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." msgstr "" -#: ../../c-api/unicode.rst:309 +#: ../../c-api/unicode.rst:242 msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." msgstr "" -#: ../../c-api/unicode.rst:314 +#: ../../c-api/unicode.rst:247 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." msgstr "" -#: ../../c-api/unicode.rst:319 +#: ../../c-api/unicode.rst:252 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." msgstr "" -#: ../../c-api/unicode.rst:324 +#: ../../c-api/unicode.rst:257 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a printable character. " "Nonprintable characters are those characters defined in the Unicode " @@ -342,92 +265,93 @@ msgid "" "to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../c-api/unicode.rst:333 +#: ../../c-api/unicode.rst:266 msgid "These APIs can be used for fast direct character conversions:" msgstr "" -#: ../../c-api/unicode.rst:338 +#: ../../c-api/unicode.rst:271 msgid "Return the character *ch* converted to lower case." msgstr "" -#: ../../c-api/unicode.rst:340 ../../c-api/unicode.rst:348 -#: ../../c-api/unicode.rst:356 +#: ../../c-api/unicode.rst:273 ../../c-api/unicode.rst:281 +#: ../../c-api/unicode.rst:289 msgid "This function uses simple case mappings." msgstr "" -#: ../../c-api/unicode.rst:346 +#: ../../c-api/unicode.rst:279 msgid "Return the character *ch* converted to upper case." msgstr "" -#: ../../c-api/unicode.rst:354 +#: ../../c-api/unicode.rst:287 msgid "Return the character *ch* converted to title case." msgstr "" -#: ../../c-api/unicode.rst:362 +#: ../../c-api/unicode.rst:295 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " -"``-1`` if this is not possible. This macro does not raise exceptions." +"``-1`` if this is not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:368 +#: ../../c-api/unicode.rst:301 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " -"if this is not possible. This macro does not raise exceptions." +"if this is not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:374 +#: ../../c-api/unicode.rst:307 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " -"not possible. This macro does not raise exceptions." +"not possible. This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:378 +#: ../../c-api/unicode.rst:311 msgid "These APIs can be used to work with surrogates:" msgstr "" -#: ../../c-api/unicode.rst:382 +#: ../../c-api/unicode.rst:315 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:386 +#: ../../c-api/unicode.rst:319 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" -#: ../../c-api/unicode.rst:390 +#: ../../c-api/unicode.rst:323 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" -#: ../../c-api/unicode.rst:394 +#: ../../c-api/unicode.rst:327 msgid "" -"Join two surrogate characters and return a single Py_UCS4 value. *high* and " -"*low* are respectively the leading and trailing surrogates in a surrogate " -"pair." +"Join two surrogate characters and return a single :c:type:`Py_UCS4` value. " +"*high* and *low* are respectively the leading and trailing surrogates in a " +"surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " +"be in the range [0xDC00; 0xDFFF]." msgstr "" -#: ../../c-api/unicode.rst:400 +#: ../../c-api/unicode.rst:334 msgid "Creating and accessing Unicode strings" msgstr "" -#: ../../c-api/unicode.rst:402 +#: ../../c-api/unicode.rst:336 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" msgstr "" -#: ../../c-api/unicode.rst:407 +#: ../../c-api/unicode.rst:341 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " "to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" -#: ../../c-api/unicode.rst:411 +#: ../../c-api/unicode.rst:345 msgid "" "This is the recommended way to allocate a new Unicode object. Objects " "created using this function are not resizable." msgstr "" -#: ../../c-api/unicode.rst:420 +#: ../../c-api/unicode.rst:354 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -435,7 +359,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: ../../c-api/unicode.rst:425 +#: ../../c-api/unicode.rst:359 msgid "" "If necessary, the input *buffer* is copied and transformed into the " "canonical representation. For example, if the *buffer* is a UCS4 string (:c:" @@ -443,342 +367,412 @@ msgid "" "range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" -#: ../../c-api/unicode.rst:436 +#: ../../c-api/unicode.rst:370 msgid "" "Create a Unicode object from the char buffer *u*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " -"object. If the buffer is not ``NULL``, the return value might be a shared " -"object, i.e. modification of the data is not allowed." +"object. The return value might be a shared object, i.e. modification of the " +"data is not allowed." msgstr "" -#: ../../c-api/unicode.rst:441 -msgid "" -"If *u* is ``NULL``, this function behaves like :c:func:" -"`PyUnicode_FromUnicode` with the buffer set to ``NULL``. This usage is " -"deprecated in favor of :c:func:`PyUnicode_New`, and will be removed in " -"Python 3.12." +#: ../../c-api/unicode.rst:376 +msgid "This function raises :exc:`SystemError` when:" +msgstr "" + +#: ../../c-api/unicode.rst:378 +msgid "*size* < 0," +msgstr "" + +#: ../../c-api/unicode.rst:379 +msgid "*u* is ``NULL`` and *size* > 0" msgstr "" -#: ../../c-api/unicode.rst:448 +#: ../../c-api/unicode.rst:381 +msgid "*u* == ``NULL`` with *size* > 0 is not allowed anymore." +msgstr "" + +#: ../../c-api/unicode.rst:387 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer *u*." msgstr "" -#: ../../c-api/unicode.rst:454 +#: ../../c-api/unicode.rst:393 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " "return a string with the values formatted into it. The variable arguments " "must be C types and must correspond exactly to the format characters in the " -"*format* ASCII-encoded string. The following format characters are allowed:" +"*format* ASCII-encoded string." msgstr "" -#: ../../c-api/unicode.rst:469 -msgid "Format Characters" +#: ../../c-api/unicode.rst:399 +msgid "" +"A conversion specifier contains two or more characters and has the following " +"components, which must occur in this order:" msgstr "" -#: ../../c-api/unicode.rst:469 -msgid "Type" +#: ../../c-api/unicode.rst:402 +msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../c-api/unicode.rst:469 -msgid "Comment" +#: ../../c-api/unicode.rst:404 +msgid "" +"Conversion flags (optional), which affect the result of some conversion " +"types." msgstr "" -#: ../../c-api/unicode.rst:471 -msgid ":attr:`%%`" -msgstr ":attr:`%%`" +#: ../../c-api/unicode.rst:407 +msgid "" +"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " +"actual width is given in the next argument, which must be of type :c:expr:" +"`int`, and the object to convert comes after the minimum field width and " +"optional precision." +msgstr "" -#: ../../c-api/unicode.rst:471 -msgid "*n/a*" -msgstr "*n/a*" +#: ../../c-api/unicode.rst:412 +msgid "" +"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " +"specified as ``'*'`` (an asterisk), the actual precision is given in the " +"next argument, which must be of type :c:expr:`int`, and the value to convert " +"comes after the precision." +msgstr "" -#: ../../c-api/unicode.rst:471 -msgid "The literal % character." +#: ../../c-api/unicode.rst:417 +msgid "Length modifier (optional)." msgstr "" -#: ../../c-api/unicode.rst:473 -msgid ":attr:`%c`" -msgstr ":attr:`%c`" +#: ../../c-api/unicode.rst:419 +msgid "Conversion type." +msgstr "" -#: ../../c-api/unicode.rst:473 ../../c-api/unicode.rst:476 -#: ../../c-api/unicode.rst:509 ../../c-api/unicode.rst:512 -msgid "int" -msgstr "int" +#: ../../c-api/unicode.rst:421 +msgid "The conversion flag characters are:" +msgstr "" -#: ../../c-api/unicode.rst:473 -msgid "A single character, represented as a C int." +#: ../../c-api/unicode.rst:426 +msgid "Flag" msgstr "" -#: ../../c-api/unicode.rst:476 -msgid ":attr:`%d`" -msgstr ":attr:`%d`" +#: ../../c-api/unicode.rst:426 +msgid "Meaning" +msgstr "" -#: ../../c-api/unicode.rst:476 -msgid "Equivalent to ``printf(\"%d\")``. [1]_" -msgstr "等價於 ``printf(\"%d\")``. [1]_" +#: ../../c-api/unicode.rst:428 +msgid "``0``" +msgstr "" -#: ../../c-api/unicode.rst:479 -msgid ":attr:`%u`" -msgstr ":attr:`%u`" +#: ../../c-api/unicode.rst:428 +msgid "The conversion will be zero padded for numeric values." +msgstr "" -#: ../../c-api/unicode.rst:479 -msgid "unsigned int" -msgstr "unsigned int" +#: ../../c-api/unicode.rst:430 +msgid "``-``" +msgstr "" -#: ../../c-api/unicode.rst:479 -msgid "Equivalent to ``printf(\"%u\")``. [1]_" -msgstr "等價於 ``printf(\"%u\")``. [1]_" +#: ../../c-api/unicode.rst:430 +msgid "" +"The converted value is left adjusted (overrides the ``0`` flag if both are " +"given)." +msgstr "" -#: ../../c-api/unicode.rst:482 -msgid ":attr:`%ld`" -msgstr ":attr:`%ld`" +#: ../../c-api/unicode.rst:434 +msgid "" +"The length modifiers for following integer conversions (``d``, ``i``, ``o``, " +"``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " +"default):" +msgstr "" -#: ../../c-api/unicode.rst:482 ../../c-api/unicode.rst:485 -msgid "long" -msgstr "long" +#: ../../c-api/unicode.rst:441 +msgid "Modifier" +msgstr "" -#: ../../c-api/unicode.rst:482 -msgid "Equivalent to ``printf(\"%ld\")``. [1]_" -msgstr "等價於 ``printf(\"%ld\")``. [1]_" +#: ../../c-api/unicode.rst:441 +msgid "Types" +msgstr "" -#: ../../c-api/unicode.rst:485 -msgid ":attr:`%li`" -msgstr ":attr:`%li`" +#: ../../c-api/unicode.rst:443 +msgid "``l``" +msgstr "" -#: ../../c-api/unicode.rst:485 -msgid "Equivalent to ``printf(\"%li\")``. [1]_" -msgstr "等價於 ``printf(\"%li\")``. [1]_" +#: ../../c-api/unicode.rst:443 +msgid ":c:expr:`long` or :c:expr:`unsigned long`" +msgstr "" -#: ../../c-api/unicode.rst:488 -msgid ":attr:`%lu`" -msgstr ":attr:`%lu`" +#: ../../c-api/unicode.rst:445 +msgid "``ll``" +msgstr "" -#: ../../c-api/unicode.rst:488 -msgid "unsigned long" -msgstr "unsigned long" +#: ../../c-api/unicode.rst:445 +msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" +msgstr "" -#: ../../c-api/unicode.rst:488 -msgid "Equivalent to ``printf(\"%lu\")``. [1]_" -msgstr "等價於 ``printf(\"%lu\")``. [1]_" +#: ../../c-api/unicode.rst:447 +msgid "``j``" +msgstr "" -#: ../../c-api/unicode.rst:491 -msgid ":attr:`%lld`" -msgstr ":attr:`%lld`" +#: ../../c-api/unicode.rst:447 +msgid ":c:expr:`intmax_t` or :c:expr:`uintmax_t`" +msgstr "" -#: ../../c-api/unicode.rst:491 ../../c-api/unicode.rst:494 -msgid "long long" -msgstr "long long" +#: ../../c-api/unicode.rst:449 +msgid "``z``" +msgstr "" -#: ../../c-api/unicode.rst:491 -msgid "Equivalent to ``printf(\"%lld\")``. [1]_" -msgstr "等價於 ``printf(\"%lld\")``. [1]_" +#: ../../c-api/unicode.rst:449 +msgid ":c:expr:`size_t` or :c:expr:`ssize_t`" +msgstr "" -#: ../../c-api/unicode.rst:494 -msgid ":attr:`%lli`" -msgstr ":attr:`%lli`" +#: ../../c-api/unicode.rst:451 +msgid "``t``" +msgstr "" -#: ../../c-api/unicode.rst:494 -msgid "Equivalent to ``printf(\"%lli\")``. [1]_" -msgstr "等價於 ``printf(\"%lli\")``. [1]_" +#: ../../c-api/unicode.rst:451 +msgid ":c:expr:`ptrdiff_t`" +msgstr "" -#: ../../c-api/unicode.rst:497 -msgid ":attr:`%llu`" -msgstr ":attr:`%llu`" +#: ../../c-api/unicode.rst:454 +msgid "" +"The length modifier ``l`` for following conversions ``s`` or ``V`` specify " +"that the type of the argument is :c:expr:`const wchar_t*`." +msgstr "" -#: ../../c-api/unicode.rst:497 -msgid "unsigned long long" -msgstr "unsigned long long" +#: ../../c-api/unicode.rst:457 +msgid "The conversion specifiers are:" +msgstr "" -#: ../../c-api/unicode.rst:497 -msgid "Equivalent to ``printf(\"%llu\")``. [1]_" -msgstr "等價於 ``printf(\"%llu\")``. [1]_" +#: ../../c-api/unicode.rst:463 +msgid "Conversion Specifier" +msgstr "" -#: ../../c-api/unicode.rst:500 -msgid ":attr:`%zd`" -msgstr ":attr:`%zd`" +#: ../../c-api/unicode.rst:464 +msgid "Type" +msgstr "" -#: ../../c-api/unicode.rst:500 ../../c-api/unicode.rst:503 -msgid ":c:type:`\\ Py_ssize_t`" -msgstr ":c:type:`\\ Py_ssize_t`" +#: ../../c-api/unicode.rst:465 +msgid "Comment" +msgstr "" -#: ../../c-api/unicode.rst:500 -msgid "Equivalent to ``printf(\"%zd\")``. [1]_" -msgstr "等價於 ``printf(\"%zd\")``. [1]_" +#: ../../c-api/unicode.rst:467 +msgid "``%``" +msgstr "" -#: ../../c-api/unicode.rst:503 -msgid ":attr:`%zi`" -msgstr ":attr:`%zi`" +#: ../../c-api/unicode.rst:468 +msgid "*n/a*" +msgstr "*n/a*" -#: ../../c-api/unicode.rst:503 -msgid "Equivalent to ``printf(\"%zi\")``. [1]_" -msgstr "等價於 ``printf(\"%zi\")``. [1]_" +#: ../../c-api/unicode.rst:469 +msgid "The literal ``%`` character." +msgstr "" -#: ../../c-api/unicode.rst:506 -msgid ":attr:`%zu`" -msgstr ":attr:`%zu`" +#: ../../c-api/unicode.rst:471 +msgid "``d``, ``i``" +msgstr "" -#: ../../c-api/unicode.rst:506 -msgid "size_t" -msgstr "size_t" +#: ../../c-api/unicode.rst:472 ../../c-api/unicode.rst:476 +#: ../../c-api/unicode.rst:480 ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:488 +msgid "Specified by the length modifier" +msgstr "" -#: ../../c-api/unicode.rst:506 -msgid "Equivalent to ``printf(\"%zu\")``. [1]_" -msgstr "等價於 ``printf(\"%zu\")``. [1]_" +#: ../../c-api/unicode.rst:473 +msgid "The decimal representation of a signed C integer." +msgstr "" -#: ../../c-api/unicode.rst:509 -msgid ":attr:`%i`" -msgstr ":attr:`%i`" +#: ../../c-api/unicode.rst:475 +msgid "``u``" +msgstr "" -#: ../../c-api/unicode.rst:509 -msgid "Equivalent to ``printf(\"%i\")``. [1]_" -msgstr "等價於 ``printf(\"%i\")``. [1]_" +#: ../../c-api/unicode.rst:477 +msgid "The decimal representation of an unsigned C integer." +msgstr "" -#: ../../c-api/unicode.rst:512 -msgid ":attr:`%x`" -msgstr ":attr:`%x`" +#: ../../c-api/unicode.rst:479 +msgid "``o``" +msgstr "" -#: ../../c-api/unicode.rst:512 -msgid "Equivalent to ``printf(\"%x\")``. [1]_" -msgstr "等價於 ``printf(\"%x\")``. [1]_" +#: ../../c-api/unicode.rst:481 +msgid "The octal representation of an unsigned C integer." +msgstr "" -#: ../../c-api/unicode.rst:515 -msgid ":attr:`%s`" -msgstr ":attr:`%s`" +#: ../../c-api/unicode.rst:483 +msgid "``x``" +msgstr "" -#: ../../c-api/unicode.rst:515 -msgid "const char\\*" -msgstr "const char\\*" +#: ../../c-api/unicode.rst:485 +msgid "The hexadecimal representation of an unsigned C integer (lowercase)." +msgstr "" -#: ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:487 +msgid "``X``" +msgstr "" + +#: ../../c-api/unicode.rst:489 +msgid "The hexadecimal representation of an unsigned C integer (uppercase)." +msgstr "" + +#: ../../c-api/unicode.rst:491 +msgid "``c``" +msgstr "" + +#: ../../c-api/unicode.rst:492 +msgid ":c:expr:`int`" +msgstr "" + +#: ../../c-api/unicode.rst:493 +msgid "A single character." +msgstr "" + +#: ../../c-api/unicode.rst:495 +msgid "``s``" +msgstr "" + +#: ../../c-api/unicode.rst:496 +msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" +msgstr "" + +#: ../../c-api/unicode.rst:497 msgid "A null-terminated C character array." msgstr "" -#: ../../c-api/unicode.rst:518 -msgid ":attr:`%p`" -msgstr ":attr:`%p`" +#: ../../c-api/unicode.rst:499 +msgid "``p``" +msgstr "" -#: ../../c-api/unicode.rst:518 -msgid "const void\\*" +#: ../../c-api/unicode.rst:500 +#, fuzzy +msgid ":c:expr:`const void*`" msgstr "const void\\*" -#: ../../c-api/unicode.rst:518 +#: ../../c-api/unicode.rst:501 msgid "" -"The hex representation of a C pointer. Mostly equivalent to " +"The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " "``0x`` regardless of what the platform's ``printf`` yields." msgstr "" -#: ../../c-api/unicode.rst:526 -msgid ":attr:`%A`" -msgstr ":attr:`%A`" +#: ../../c-api/unicode.rst:506 +msgid "``A``" +msgstr "" -#: ../../c-api/unicode.rst:526 ../../c-api/unicode.rst:529 -#: ../../c-api/unicode.rst:538 ../../c-api/unicode.rst:541 -msgid "PyObject\\*" +#: ../../c-api/unicode.rst:507 ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:521 ../../c-api/unicode.rst:525 +#, fuzzy +msgid ":c:expr:`PyObject*`" msgstr "PyObject\\*" -#: ../../c-api/unicode.rst:526 +#: ../../c-api/unicode.rst:508 msgid "The result of calling :func:`ascii`." msgstr "" -#: ../../c-api/unicode.rst:529 -msgid ":attr:`%U`" -msgstr ":attr:`%U`" +#: ../../c-api/unicode.rst:510 +msgid "``U``" +msgstr "" -#: ../../c-api/unicode.rst:529 +#: ../../c-api/unicode.rst:512 msgid "A Unicode object." msgstr "一 Unicode 物件。" -#: ../../c-api/unicode.rst:531 -msgid ":attr:`%V`" -msgstr ":attr:`%V`" +#: ../../c-api/unicode.rst:514 +msgid "``V``" +msgstr "" -#: ../../c-api/unicode.rst:531 -msgid "PyObject\\*, const char\\*" -msgstr "PyObject\\*, const char\\*" +#: ../../c-api/unicode.rst:515 +msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" +msgstr "" -#: ../../c-api/unicode.rst:531 +#: ../../c-api/unicode.rst:516 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:538 -msgid ":attr:`%S`" -msgstr ":attr:`%S`" +#: ../../c-api/unicode.rst:520 +msgid "``S``" +msgstr "" -#: ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:522 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "" -#: ../../c-api/unicode.rst:541 -msgid ":attr:`%R`" -msgstr ":attr:`%R`" - -#: ../../c-api/unicode.rst:541 -msgid "The result of calling :c:func:`PyObject_Repr`." +#: ../../c-api/unicode.rst:524 +msgid "``R``" msgstr "" -#: ../../c-api/unicode.rst:545 -msgid "" -"An unrecognized format character causes all the rest of the format string to " -"be copied as-is to the result string, and any extra arguments discarded." +#: ../../c-api/unicode.rst:526 +msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "" -#: ../../c-api/unicode.rst:549 +#: ../../c-api/unicode.rst:529 msgid "" "The width formatter unit is number of characters rather than bytes. The " -"precision formatter unit is number of bytes for ``\"%s\"`` and ``\"%V\"`` " -"(if the ``PyObject*`` argument is ``NULL``), and a number of characters for " +"precision formatter unit is number of bytes or :c:expr:`wchar_t` items (if " +"the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " +"``PyObject*`` argument is ``NULL``), and a number of characters for " "``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the " "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:555 +#: ../../c-api/unicode.rst:537 msgid "" -"For integer specifiers (d, u, ld, li, lu, lld, lli, llu, zd, zi, zu, i, x): " -"the 0-conversion flag has effect even when a precision is given." +"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " +"is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " +"``X``)." msgstr "" -#: ../../c-api/unicode.rst:558 +#: ../../c-api/unicode.rst:541 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "" -#: ../../c-api/unicode.rst:561 +#: ../../c-api/unicode.rst:544 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "" -#: ../../c-api/unicode.rst:564 +#: ../../c-api/unicode.rst:547 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" -#: ../../c-api/unicode.rst:571 +#: ../../c-api/unicode.rst:551 +msgid "" +"Support for conversion specifiers ``o`` and ``X``. Support for length " +"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " +"conversions. Length modifier ``l`` is now applied to conversion specifiers " +"``s`` and ``V``. Support for variable width and precision ``*``. Support for " +"flag ``-``." +msgstr "" + +#: ../../c-api/unicode.rst:559 +msgid "" +"An unrecognized format character now sets a :exc:`SystemError`. In previous " +"versions it caused all the rest of the format string to be copied as-is to " +"the result string, and any extra arguments discarded." +msgstr "" + +#: ../../c-api/unicode.rst:566 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/unicode.rst:577 +#: ../../c-api/unicode.rst:572 msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " "the reference with incremented refcount." msgstr "" -#: ../../c-api/unicode.rst:581 +#: ../../c-api/unicode.rst:576 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: ../../c-api/unicode.rst:587 +#: ../../c-api/unicode.rst:582 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:589 +#: ../../c-api/unicode.rst:584 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -786,23 +780,23 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:595 +#: ../../c-api/unicode.rst:590 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:598 +#: ../../c-api/unicode.rst:593 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." msgstr "" -#: ../../c-api/unicode.rst:604 +#: ../../c-api/unicode.rst:599 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:615 +#: ../../c-api/unicode.rst:610 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:" @@ -810,52 +804,52 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:626 +#: ../../c-api/unicode.rst:621 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:" "start+length]``." msgstr "" -#: ../../c-api/unicode.rst:629 +#: ../../c-api/unicode.rst:624 msgid "" "Fail if *fill_char* is bigger than the string maximum character, or if the " "string has more than 1 reference." msgstr "" -#: ../../c-api/unicode.rst:632 +#: ../../c-api/unicode.rst:627 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:641 +#: ../../c-api/unicode.rst:636 msgid "" "Write a character to a string. The string must have been created through :c:" "func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " "the string must not be shared, or have been hashed yet." msgstr "" -#: ../../c-api/unicode.rst:645 +#: ../../c-api/unicode.rst:640 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " "not out of bounds, and that the object can be modified safely (i.e. that it " "its reference count is one)." msgstr "" -#: ../../c-api/unicode.rst:654 +#: ../../c-api/unicode.rst:649 msgid "" "Read a character from a string. This function checks that *unicode* is a " "Unicode object and the index is not out of bounds, in contrast to :c:func:" "`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" -#: ../../c-api/unicode.rst:664 +#: ../../c-api/unicode.rst:659 msgid "" "Return a substring of *str*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported." msgstr "" -#: ../../c-api/unicode.rst:673 +#: ../../c-api/unicode.rst:668 msgid "" "Copy the string *u* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -863,7 +857,7 @@ msgid "" "*u*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:683 +#: ../../c-api/unicode.rst:678 msgid "" "Copy the string *u* into a new UCS4 buffer that is allocated using :c:func:" "`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -871,91 +865,17 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:692 -msgid "Deprecated Py_UNICODE APIs" -msgstr "" - -#: ../../c-api/unicode.rst:696 -msgid "" -"These API functions are deprecated with the implementation of :pep:`393`. " -"Extension modules can continue using them, as they will not be removed in " -"Python 3.x, but need to be aware that their use can now cause performance " -"and memory hits." -msgstr "" - -#: ../../c-api/unicode.rst:703 -msgid "" -"Create a Unicode object from the Py_UNICODE buffer *u* of the given size. " -"*u* may be ``NULL`` which causes the contents to be undefined. It is the " -"user's responsibility to fill in the needed data. The buffer is copied into " -"the new object." -msgstr "" - -#: ../../c-api/unicode.rst:708 -msgid "" -"If the buffer is not ``NULL``, the return value might be a shared object. " -"Therefore, modification of the resulting Unicode object is only allowed when " -"*u* is ``NULL``." -msgstr "" - -#: ../../c-api/unicode.rst:712 -msgid "" -"If the buffer is ``NULL``, :c:func:`PyUnicode_READY` must be called once the " -"string content has been filled before using any of the access macros such " -"as :c:func:`PyUnicode_KIND`." -msgstr "" - -#: ../../c-api/unicode.rst:719 -msgid "" -"Part of the old-style Unicode API, please migrate to using :c:func:" -"`PyUnicode_FromKindAndData`, :c:func:`PyUnicode_FromWideChar`, or :c:func:" -"`PyUnicode_New`." -msgstr "" - -#: ../../c-api/unicode.rst:724 -msgid "" -"Return a read-only pointer to the Unicode object's internal :c:type:" -"`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:expr:" -"`Py_UNICODE*` representation of the object if it is not yet available. The " -"buffer is always terminated with an extra null code point. Note that the " -"resulting :c:type:`Py_UNICODE` string may also contain embedded null code " -"points, which would cause the string to be truncated when used in most C " -"functions." -msgstr "" - -#: ../../c-api/unicode.rst:735 ../../c-api/unicode.rst:751 -msgid "" -"Part of the old-style Unicode API, please migrate to using :c:func:" -"`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, :c:func:" -"`PyUnicode_ReadChar` or similar new APIs." -msgstr "" - -#: ../../c-api/unicode.rst:740 -msgid "" -"Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` " -"array length (excluding the extra null terminator) in *size*. Note that the " -"resulting :c:expr:`Py_UNICODE*` string may contain embedded null code " -"points, which would cause the string to be truncated when used in most C " -"functions." -msgstr "" - -#: ../../c-api/unicode.rst:756 -msgid "" -"Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " -"code units (this includes surrogate pairs as 2 units)." -msgstr "" - -#: ../../c-api/unicode.rst:765 +#: ../../c-api/unicode.rst:687 msgid "Locale Encoding" msgstr "" -#: ../../c-api/unicode.rst:767 +#: ../../c-api/unicode.rst:689 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: ../../c-api/unicode.rst:774 +#: ../../c-api/unicode.rst:696 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " "locale encoding on other platforms. The supported error handlers are " @@ -964,22 +884,21 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:781 +#: ../../c-api/unicode.rst:703 msgid "" -"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from :c:" -"data:`Py_FileSystemDefaultEncoding` (the locale encoding read at Python " -"startup)." +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" +"term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:785 ../../c-api/unicode.rst:821 +#: ../../c-api/unicode.rst:706 ../../c-api/unicode.rst:741 msgid "This function ignores the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/unicode.rst:789 ../../c-api/unicode.rst:892 +#: ../../c-api/unicode.rst:710 ../../c-api/unicode.rst:807 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" -#: ../../c-api/unicode.rst:793 +#: ../../c-api/unicode.rst:714 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -987,13 +906,13 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:802 +#: ../../c-api/unicode.rst:723 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`strlen`." msgstr "" -#: ../../c-api/unicode.rst:810 +#: ../../c-api/unicode.rst:731 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " @@ -1002,17 +921,17 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:817 +#: ../../c-api/unicode.rst:738 msgid "" -"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to :c:data:" -"`Py_FileSystemDefaultEncoding` (the locale encoding read at Python startup)." +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" +"`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:825 ../../c-api/unicode.rst:928 +#: ../../c-api/unicode.rst:745 ../../c-api/unicode.rst:838 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" -#: ../../c-api/unicode.rst:829 +#: ../../c-api/unicode.rst:749 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1020,21 +939,24 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:838 +#: ../../c-api/unicode.rst:758 msgid "File System Encoding" msgstr "" -#: ../../c-api/unicode.rst:840 +#: ../../c-api/unicode.rst:760 msgid "" -"To encode and decode file names and other environment strings, :c:data:" -"`Py_FileSystemDefaultEncoding` should be used as the encoding, and :c:data:" -"`Py_FileSystemDefaultEncodeErrors` should be used as the error handler (:pep:" -"`383` and :pep:`529`). To encode file names to :class:`bytes` during " -"argument parsing, the ``\"O&\"`` converter should be used, passing :c:func:" -"`PyUnicode_FSConverter` as the conversion function:" +"Functions encoding to and decoding from the :term:`filesystem encoding and " +"error handler` (:pep:`383` and :pep:`529`)." msgstr "" -#: ../../c-api/unicode.rst:849 +#: ../../c-api/unicode.rst:763 +msgid "" +"To encode file names to :class:`bytes` during argument parsing, the " +"``\"O&\"`` converter should be used, passing :c:func:`PyUnicode_FSConverter` " +"as the conversion function:" +msgstr "" + +#: ../../c-api/unicode.rst:769 msgid "" "ParseTuple converter: encode :class:`str` objects -- obtained directly or " "through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" @@ -1043,18 +965,18 @@ msgid "" "is no longer used." msgstr "" -#: ../../c-api/unicode.rst:857 ../../c-api/unicode.rst:874 +#: ../../c-api/unicode.rst:777 ../../c-api/unicode.rst:794 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../c-api/unicode.rst:860 +#: ../../c-api/unicode.rst:780 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:866 +#: ../../c-api/unicode.rst:786 msgid "" "ParseTuple converter: decode :class:`bytes` objects -- obtained either " "directly or indirectly through the :class:`os.PathLike` interface -- to :" @@ -1063,72 +985,64 @@ msgid "" "which must be released when it is no longer used." msgstr "" -#: ../../c-api/unicode.rst:880 +#: ../../c-api/unicode.rst:800 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:882 ../../c-api/unicode.rst:903 -#: ../../c-api/unicode.rst:919 -msgid "" -"If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the " -"locale encoding." -msgstr "" - -#: ../../c-api/unicode.rst:885 +#: ../../c-api/unicode.rst:802 msgid "" -":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " -"locale encoding and cannot be modified later. If you need to decode a string " -"from the current locale encoding, use :c:func:" +"If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:894 ../../c-api/unicode.rst:908 -#: ../../c-api/unicode.rst:932 -msgid "Use :c:data:`Py_FileSystemDefaultEncodeErrors` error handler." +#: ../../c-api/unicode.rst:809 ../../c-api/unicode.rst:822 +#: ../../c-api/unicode.rst:842 +msgid "" +"The :term:`filesystem error handler ` " +"is now used." msgstr "" -#: ../../c-api/unicode.rst:900 +#: ../../c-api/unicode.rst:816 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:906 +#: ../../c-api/unicode.rst:819 msgid "" -"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length." +"If the string length is known, use :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" -#: ../../c-api/unicode.rst:914 +#: ../../c-api/unicode.rst:829 msgid "" -"Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the :" -"c:data:`Py_FileSystemDefaultEncodeErrors` error handler, and return :class:" -"`bytes`. Note that the resulting :class:`bytes` object may contain null " -"bytes." +"Encode a Unicode object to the :term:`filesystem encoding and error " +"handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " +"object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:922 +#: ../../c-api/unicode.rst:833 msgid "" -":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " -"locale encoding and cannot be modified later. If you need to encode a string " -"to the current locale encoding, use :c:func:`PyUnicode_EncodeLocale`." +"If you need to encode a string to the current locale encoding, use :c:func:" +"`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:936 +#: ../../c-api/unicode.rst:847 msgid "wchar_t Support" msgstr "" -#: ../../c-api/unicode.rst:938 +#: ../../c-api/unicode.rst:849 msgid ":c:expr:`wchar_t` support for platforms which support it:" msgstr "" -#: ../../c-api/unicode.rst:942 +#: ../../c-api/unicode.rst:853 msgid "" "Create a Unicode object from the :c:expr:`wchar_t` buffer *w* of the given " "*size*. Passing ``-1`` as the *size* indicates that the function must itself " "compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" -#: ../../c-api/unicode.rst:950 +#: ../../c-api/unicode.rst:861 msgid "" "Copy the Unicode object contents into the :c:expr:`wchar_t` buffer *w*. At " "most *size* :c:expr:`wchar_t` characters are copied (excluding a possibly " @@ -1141,7 +1055,7 @@ msgid "" "would cause the string to be truncated when used with most C functions." msgstr "" -#: ../../c-api/unicode.rst:963 +#: ../../c-api/unicode.rst:874 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " @@ -1152,70 +1066,66 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:971 +#: ../../c-api/unicode.rst:882 msgid "" -"Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:" -"`PyMem_Free` to free it) on success. On error, returns ``NULL`` and " -"*\\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation is " -"failed." +"Returns a buffer allocated by :c:func:`PyMem_New` (use :c:func:`PyMem_Free` " +"to free it) on success. On error, returns ``NULL`` and *\\*size* is " +"undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" -#: ../../c-api/unicode.rst:978 +#: ../../c-api/unicode.rst:889 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:986 +#: ../../c-api/unicode.rst:897 msgid "Built-in Codecs" msgstr "" -#: ../../c-api/unicode.rst:988 +#: ../../c-api/unicode.rst:899 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:991 +#: ../../c-api/unicode.rst:902 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:995 +#: ../../c-api/unicode.rst:906 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " -"encoding file names. This uses the variable :c:data:" -"`Py_FileSystemDefaultEncoding` internally. This variable should be treated " -"as read-only: on some systems, it will be a pointer to a static string, on " -"others, it will change at run-time (such as when the application invokes " -"setlocale)." +"encoding file names. This uses the :term:`filesystem encoding and error " +"handler` internally." msgstr "" -#: ../../c-api/unicode.rst:1003 +#: ../../c-api/unicode.rst:911 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:1007 +#: ../../c-api/unicode.rst:915 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:1012 +#: ../../c-api/unicode.rst:920 msgid "Generic Codecs" msgstr "" -#: ../../c-api/unicode.rst:1014 +#: ../../c-api/unicode.rst:922 msgid "These are the generic codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1020 +#: ../../c-api/unicode.rst:928 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *s*. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1224,7 +1134,7 @@ msgid "" "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:938 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1233,21 +1143,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1038 +#: ../../c-api/unicode.rst:946 msgid "UTF-8 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1040 +#: ../../c-api/unicode.rst:948 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1045 +#: ../../c-api/unicode.rst:953 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1052 +#: ../../c-api/unicode.rst:960 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1255,14 +1165,14 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1060 +#: ../../c-api/unicode.rst:968 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1067 +#: ../../c-api/unicode.rst:975 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1271,13 +1181,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1073 +#: ../../c-api/unicode.rst:981 msgid "" "In the case of an error, ``NULL`` is returned with an exception set and no " "*size* is stored." msgstr "" -#: ../../c-api/unicode.rst:1076 +#: ../../c-api/unicode.rst:984 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 " @@ -1286,40 +1196,40 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1083 ../../c-api/unicode.rst:1096 +#: ../../c-api/unicode.rst:991 ../../c-api/unicode.rst:1004 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: ../../c-api/unicode.rst:1086 -msgid "This function is a part of the :ref:`limited API `." +#: ../../c-api/unicode.rst:994 +msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1092 +#: ../../c-api/unicode.rst:1000 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: ../../c-api/unicode.rst:1101 +#: ../../c-api/unicode.rst:1009 msgid "UTF-32 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1011 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1109 +#: ../../c-api/unicode.rst:1017 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:1113 ../../c-api/unicode.rst:1163 +#: ../../c-api/unicode.rst:1021 ../../c-api/unicode.rst:1071 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1120 +#: ../../c-api/unicode.rst:1028 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 " @@ -1327,21 +1237,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1033 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1128 ../../c-api/unicode.rst:1179 +#: ../../c-api/unicode.rst:1036 ../../c-api/unicode.rst:1087 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1130 ../../c-api/unicode.rst:1181 +#: ../../c-api/unicode.rst:1038 ../../c-api/unicode.rst:1089 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1136 +#: ../../c-api/unicode.rst:1044 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1350,29 +1260,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1145 +#: ../../c-api/unicode.rst:1053 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:1151 +#: ../../c-api/unicode.rst:1059 msgid "UTF-16 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1153 +#: ../../c-api/unicode.rst:1061 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1159 +#: ../../c-api/unicode.rst:1067 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:1170 +#: ../../c-api/unicode.rst:1078 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 " @@ -1381,13 +1291,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1176 +#: ../../c-api/unicode.rst:1084 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1187 +#: ../../c-api/unicode.rst:1095 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1397,28 +1307,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1196 +#: ../../c-api/unicode.rst:1104 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:1202 +#: ../../c-api/unicode.rst:1110 msgid "UTF-7 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1204 +#: ../../c-api/unicode.rst:1112 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1117 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:1216 +#: ../../c-api/unicode.rst:1124 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1426,99 +1336,99 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1223 +#: ../../c-api/unicode.rst:1131 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1225 +#: ../../c-api/unicode.rst:1133 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1231 +#: ../../c-api/unicode.rst:1139 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:1237 +#: ../../c-api/unicode.rst:1145 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:1243 +#: ../../c-api/unicode.rst:1151 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1245 +#: ../../c-api/unicode.rst:1153 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1251 +#: ../../c-api/unicode.rst:1159 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:1257 +#: ../../c-api/unicode.rst:1165 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:1263 +#: ../../c-api/unicode.rst:1171 msgid "Latin-1 Codecs" msgstr "" -#: ../../c-api/unicode.rst:1265 +#: ../../c-api/unicode.rst:1173 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:1271 +#: ../../c-api/unicode.rst:1179 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:1277 +#: ../../c-api/unicode.rst:1185 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:1283 +#: ../../c-api/unicode.rst:1191 msgid "ASCII Codecs" msgstr "" -#: ../../c-api/unicode.rst:1285 +#: ../../c-api/unicode.rst:1193 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1291 +#: ../../c-api/unicode.rst:1199 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:1297 +#: ../../c-api/unicode.rst:1205 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:1303 +#: ../../c-api/unicode.rst:1211 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1305 +#: ../../c-api/unicode.rst:1213 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 " @@ -1528,18 +1438,18 @@ msgid "" "well." msgstr "" -#: ../../c-api/unicode.rst:1311 +#: ../../c-api/unicode.rst:1219 msgid "These are the mapping codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1316 +#: ../../c-api/unicode.rst:1224 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:1320 +#: ../../c-api/unicode.rst:1228 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 " @@ -1549,14 +1459,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1331 +#: ../../c-api/unicode.rst:1239 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:1335 +#: ../../c-api/unicode.rst:1243 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1564,41 +1474,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1341 +#: ../../c-api/unicode.rst:1249 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1345 +#: ../../c-api/unicode.rst:1253 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:1349 +#: ../../c-api/unicode.rst:1257 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:1352 +#: ../../c-api/unicode.rst:1260 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:1356 +#: ../../c-api/unicode.rst:1264 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:1361 +#: ../../c-api/unicode.rst:1269 msgid "MBCS codecs for Windows" msgstr "" -#: ../../c-api/unicode.rst:1363 +#: ../../c-api/unicode.rst:1271 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 " @@ -1606,13 +1516,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1370 +#: ../../c-api/unicode.rst:1278 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:1377 +#: ../../c-api/unicode.rst:1285 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1620,44 +1530,44 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1385 +#: ../../c-api/unicode.rst:1293 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:1392 +#: ../../c-api/unicode.rst:1300 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:1400 +#: ../../c-api/unicode.rst:1308 msgid "Methods & Slots" msgstr "" -#: ../../c-api/unicode.rst:1406 +#: ../../c-api/unicode.rst:1314 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1408 +#: ../../c-api/unicode.rst:1316 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:1412 +#: ../../c-api/unicode.rst:1320 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: ../../c-api/unicode.rst:1417 +#: ../../c-api/unicode.rst:1325 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1422 +#: ../../c-api/unicode.rst:1330 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1666,27 +1576,27 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1430 +#: ../../c-api/unicode.rst:1338 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:1437 +#: ../../c-api/unicode.rst:1345 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1444 +#: ../../c-api/unicode.rst:1352 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:1452 +#: ../../c-api/unicode.rst:1360 msgid "" "Return the first position of *substr* in ``str[start:end]`` using the given " "*direction* (*direction* == ``1`` means to do a forward search, *direction* " @@ -1695,7 +1605,7 @@ msgid "" "indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1462 +#: ../../c-api/unicode.rst:1370 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, " @@ -1704,36 +1614,36 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1470 +#: ../../c-api/unicode.rst:1378 msgid "*start* and *end* are now adjusted to behave like ``str[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1477 +#: ../../c-api/unicode.rst:1385 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:1484 +#: ../../c-api/unicode.rst:1392 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:1491 +#: ../../c-api/unicode.rst:1399 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1494 +#: ../../c-api/unicode.rst:1402 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1500 +#: ../../c-api/unicode.rst:1408 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 " @@ -1741,51 +1651,51 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1505 +#: ../../c-api/unicode.rst:1413 msgid "This function does not raise exceptions." msgstr "" -#: ../../c-api/unicode.rst:1510 +#: ../../c-api/unicode.rst:1418 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1512 +#: ../../c-api/unicode.rst:1420 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1513 +#: ../../c-api/unicode.rst:1421 msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1514 +#: ../../c-api/unicode.rst:1422 msgid ":const:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1516 +#: ../../c-api/unicode.rst:1424 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:1522 +#: ../../c-api/unicode.rst:1430 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1528 +#: ../../c-api/unicode.rst:1436 msgid "" "Check whether *element* is contained in *container* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1531 +#: ../../c-api/unicode.rst:1439 msgid "" "*element* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1537 +#: ../../c-api/unicode.rst:1445 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 " @@ -1798,10 +1708,145 @@ msgid "" "the object after the call if and only if you owned it before the call.)" msgstr "" -#: ../../c-api/unicode.rst:1550 +#: ../../c-api/unicode.rst:1458 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, returning either a new Unicode string object that " "has been interned, or a new (\"owned\") reference to an earlier interned " "string object with the same value." msgstr "" + +#~ msgid ":attr:`%%`" +#~ msgstr ":attr:`%%`" + +#~ msgid ":attr:`%c`" +#~ msgstr ":attr:`%c`" + +#~ msgid "int" +#~ msgstr "int" + +#~ msgid ":attr:`%d`" +#~ msgstr ":attr:`%d`" + +#~ msgid "Equivalent to ``printf(\"%d\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%d\")``. [1]_" + +#~ msgid ":attr:`%u`" +#~ msgstr ":attr:`%u`" + +#~ msgid "unsigned int" +#~ msgstr "unsigned int" + +#~ msgid "Equivalent to ``printf(\"%u\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%u\")``. [1]_" + +#~ msgid ":attr:`%ld`" +#~ msgstr ":attr:`%ld`" + +#~ msgid "long" +#~ msgstr "long" + +#~ msgid "Equivalent to ``printf(\"%ld\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%ld\")``. [1]_" + +#~ msgid ":attr:`%li`" +#~ msgstr ":attr:`%li`" + +#~ msgid "Equivalent to ``printf(\"%li\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%li\")``. [1]_" + +#~ msgid ":attr:`%lu`" +#~ msgstr ":attr:`%lu`" + +#~ msgid "unsigned long" +#~ msgstr "unsigned long" + +#~ msgid "Equivalent to ``printf(\"%lu\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%lu\")``. [1]_" + +#~ msgid ":attr:`%lld`" +#~ msgstr ":attr:`%lld`" + +#~ msgid "long long" +#~ msgstr "long long" + +#~ msgid "Equivalent to ``printf(\"%lld\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%lld\")``. [1]_" + +#~ msgid ":attr:`%lli`" +#~ msgstr ":attr:`%lli`" + +#~ msgid "Equivalent to ``printf(\"%lli\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%lli\")``. [1]_" + +#~ msgid ":attr:`%llu`" +#~ msgstr ":attr:`%llu`" + +#~ msgid "unsigned long long" +#~ msgstr "unsigned long long" + +#~ msgid "Equivalent to ``printf(\"%llu\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%llu\")``. [1]_" + +#~ msgid ":attr:`%zd`" +#~ msgstr ":attr:`%zd`" + +#~ msgid ":c:type:`\\ Py_ssize_t`" +#~ msgstr ":c:type:`\\ Py_ssize_t`" + +#~ msgid "Equivalent to ``printf(\"%zd\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%zd\")``. [1]_" + +#~ msgid ":attr:`%zi`" +#~ msgstr ":attr:`%zi`" + +#~ msgid "Equivalent to ``printf(\"%zi\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%zi\")``. [1]_" + +#~ msgid ":attr:`%zu`" +#~ msgstr ":attr:`%zu`" + +#~ msgid "size_t" +#~ msgstr "size_t" + +#~ msgid "Equivalent to ``printf(\"%zu\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%zu\")``. [1]_" + +#~ msgid ":attr:`%i`" +#~ msgstr ":attr:`%i`" + +#~ msgid "Equivalent to ``printf(\"%i\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%i\")``. [1]_" + +#~ msgid ":attr:`%x`" +#~ msgstr ":attr:`%x`" + +#~ msgid "Equivalent to ``printf(\"%x\")``. [1]_" +#~ msgstr "等價於 ``printf(\"%x\")``. [1]_" + +#~ msgid ":attr:`%s`" +#~ msgstr ":attr:`%s`" + +#~ msgid "const char\\*" +#~ msgstr "const char\\*" + +#~ msgid ":attr:`%p`" +#~ msgstr ":attr:`%p`" + +#~ msgid ":attr:`%A`" +#~ msgstr ":attr:`%A`" + +#~ msgid ":attr:`%U`" +#~ msgstr ":attr:`%U`" + +#~ msgid ":attr:`%V`" +#~ msgstr ":attr:`%V`" + +#~ msgid "PyObject\\*, const char\\*" +#~ msgstr "PyObject\\*, const char\\*" + +#~ msgid ":attr:`%S`" +#~ msgstr ":attr:`%S`" + +#~ msgid ":attr:`%R`" +#~ msgstr ":attr:`%R`" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 38bf7fc8ee..f5e19d4699 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,8 +65,8 @@ msgstr "" #: ../../c-api/veryhigh.rst:40 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``1``, but exit the process, as long as " -"``Py_InspectFlag`` is not set." +"function will not return ``1``, but exit the process, as long as :c:member:" +"`PyConfig.inspect` is zero." msgstr "" #: ../../c-api/veryhigh.rst:47 @@ -120,8 +120,8 @@ msgstr "" #: ../../c-api/veryhigh.rst:96 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``-1``, but exit the process, as long as " -"``Py_InspectFlag`` is not set." +"function will not return ``-1``, but exit the process, as long as :c:member:" +"`PyConfig.inspect` is zero." msgstr "" #: ../../c-api/veryhigh.rst:103 @@ -199,7 +199,13 @@ msgid "" "the Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:173 +#: ../../c-api/veryhigh.rst:170 ../../c-api/veryhigh.rst:194 +msgid "" +"This function is only called from the :ref:`main interpreter `." +msgstr "" + +#: ../../c-api/veryhigh.rst:177 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -210,26 +216,26 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: ../../c-api/veryhigh.rst:182 +#: ../../c-api/veryhigh.rst:186 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/veryhigh.rst:185 +#: ../../c-api/veryhigh.rst:189 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" "c:func:`PyMem_Realloc`." msgstr "" -#: ../../c-api/veryhigh.rst:192 +#: ../../c-api/veryhigh.rst:200 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:198 +#: ../../c-api/veryhigh.rst:206 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -238,31 +244,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: ../../c-api/veryhigh.rst:204 +#: ../../c-api/veryhigh.rst:212 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:210 +#: ../../c-api/veryhigh.rst:218 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:216 +#: ../../c-api/veryhigh.rst:224 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:222 +#: ../../c-api/veryhigh.rst:230 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:228 +#: ../../c-api/veryhigh.rst:236 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -271,19 +277,19 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:237 +#: ../../c-api/veryhigh.rst:245 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:243 +#: ../../c-api/veryhigh.rst:251 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:249 +#: ../../c-api/veryhigh.rst:257 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " @@ -294,7 +300,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:257 +#: ../../c-api/veryhigh.rst:265 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -303,20 +309,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:268 +#: ../../c-api/veryhigh.rst:276 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:275 +#: ../../c-api/veryhigh.rst:283 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:282 +#: ../../c-api/veryhigh.rst:290 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -325,13 +331,13 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:291 +#: ../../c-api/veryhigh.rst:299 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:297 +#: ../../c-api/veryhigh.rst:305 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -341,39 +347,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:304 +#: ../../c-api/veryhigh.rst:312 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:311 +#: ../../c-api/veryhigh.rst:319 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:319 +#: ../../c-api/veryhigh.rst:327 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:335 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:336 +#: ../../c-api/veryhigh.rst:344 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:343 +#: ../../c-api/veryhigh.rst:351 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -381,40 +387,40 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:348 +#: ../../c-api/veryhigh.rst:356 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :attr:`cf_flags` is treated " "as equal to ``0``, and any modification due to ``from __future__ import`` is " "discarded." msgstr "" -#: ../../c-api/veryhigh.rst:354 +#: ../../c-api/veryhigh.rst:362 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:358 +#: ../../c-api/veryhigh.rst:366 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:361 +#: ../../c-api/veryhigh.rst:369 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in *cf_flags*." msgstr "" -#: ../../c-api/veryhigh.rst:364 +#: ../../c-api/veryhigh.rst:372 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:370 +#: ../../c-api/veryhigh.rst:378 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." msgstr "" -#: ../../c-api/veryhigh.rst:317 ../../c-api/veryhigh.rst:325 -#: ../../c-api/veryhigh.rst:334 +#: ../../c-api/veryhigh.rst:325 ../../c-api/veryhigh.rst:333 +#: ../../c-api/veryhigh.rst:342 msgid "Py_CompileString()" msgstr "Py_CompileString()" diff --git a/distributing/index.po b/distributing/index.po index cf04835f33..10483abed9 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -85,13 +85,13 @@ msgstr "" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用" #: ../../distributing/index.rst:37 +#, fuzzy msgid "" "the `Python Packaging Authority `__ are the group of " "developers and documentation authors responsible for the maintenance and " "evolution of the standard packaging tools and the associated metadata and " "file format standards. They maintain a variety of tools, documentation and " -"issue trackers on both `GitHub `__ and `Bitbucket " -"`__." +"issue trackers on `GitHub `__." msgstr "" "`Python 封裝管理站 (Python Packaging Authority) `__ 是" "一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" @@ -99,28 +99,30 @@ msgstr "" "pypa>`__ 和 `Bitbucket `__ 這兩個平台上維護各種" "工具、說明文件及問題追蹤系統。" -#: ../../distributing/index.rst:44 +#: ../../distributing/index.rst:43 +#, fuzzy msgid "" -":mod:`distutils` is the original build and distribution system first added " -"to the Python standard library in 1998. While direct use of :mod:`distutils` " -"is being phased out, it still laid the foundation for the current packaging " -"and distribution infrastructure, and it not only remains part of the " -"standard library, but its name lives on in other ways (such as the name of " -"the mailing list used to coordinate Python packaging standards development)." +"``distutils`` is the original build and distribution system first added to " +"the Python standard library in 1998. While direct use of ``distutils`` is " +"being phased out, it still laid the foundation for the current packaging and " +"distribution infrastructure, and it not only remains part of the standard " +"library, but its name lives on in other ways (such as the name of the " +"mailing list used to coordinate Python packaging standards development)." msgstr "" ":mod:`distutils` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" "庫。雖然直接使用 :mod:`distutils` 的方式已經被逐步淘汰,它仍然是現今封裝和發" "布的基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式" "存活著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" -#: ../../distributing/index.rst:51 +#: ../../distributing/index.rst:50 +#, fuzzy msgid "" -"`setuptools`_ is a (largely) drop-in replacement for :mod:`distutils` first " -"published in 2004. Its most notable addition over the unmodified :mod:" -"`distutils` tools was the ability to declare dependencies on other packages. " -"It is currently recommended as a more regularly updated alternative to :mod:" -"`distutils` that offers consistent support for more recent packaging " -"standards across a wide range of Python versions." +"`setuptools`_ is a (largely) drop-in replacement for ``distutils`` first " +"published in 2004. Its most notable addition over the unmodified " +"``distutils`` tools was the ability to declare dependencies on other " +"packages. It is currently recommended as a more regularly updated " +"alternative to ``distutils`` that offers consistent support for more recent " +"packaging standards across a wide range of Python versions." msgstr "" "`setuptools`_ 是 :mod:`distutils` 的一個(主要的)偶然出現的替代品,它於 " "2004 年首次被發布。相較於未修改的 :mod:`distutils` 工具,它最值得注意的新功" @@ -128,10 +130,11 @@ msgstr "" "`distutils` 的一個替代方案,因其更新較為頻繁,且能在各個廣泛的 Python 版本之" "間,為較新的封裝標準提供一致性的支援。" -#: ../../distributing/index.rst:57 +#: ../../distributing/index.rst:56 +#, fuzzy msgid "" "`wheel`_ (in this context) is a project that adds the ``bdist_wheel`` " -"command to :mod:`distutils`/`setuptools`_. This produces a cross platform " +"command to ``distutils``/`setuptools`_. This produces a cross platform " "binary packaging format (called \"wheels\" or \"wheel files\" and defined " "in :pep:`427`) that allows Python libraries, even those including binary " "extensions, to be installed on a system without needing to be built locally." @@ -141,11 +144,11 @@ msgstr "" "「wheel 檔案」,並於 :pep:`427` 中被定義),它可讓 Python 函式庫,甚至那些包" "含二進制擴充的函式庫,可以在系統中被安裝,但不需要在本機進行建置。" -#: ../../distributing/index.rst:68 +#: ../../distributing/index.rst:67 msgid "Open source licensing and collaboration" msgstr "開源授權與協同合作" -#: ../../distributing/index.rst:70 +#: ../../distributing/index.rst:69 msgid "" "In most parts of the world, software is automatically covered by copyright. " "This means that other developers require explicit permission to copy, use, " @@ -154,7 +157,7 @@ msgstr "" "在世界上多數地方,軟體會自動受版權所保護。這代表著其他開發人員需要明確的許" "可,才能複製、使用、修改和重新發布軟體。" -#: ../../distributing/index.rst:74 +#: ../../distributing/index.rst:73 msgid "" "Open source licensing is a way of explicitly granting such permission in a " "relatively consistent way, allowing developers to share and collaborate " @@ -166,7 +169,7 @@ msgstr "" "為各種問題提供免費可用的共通解決方案,來達到高效率的共享和協作。這使得許多開" "發人員可以自由地將更多時間專注於處理他們在特定情況中遇到的相對獨特的問題。" -#: ../../distributing/index.rst:80 +#: ../../distributing/index.rst:79 msgid "" "The distribution tools provided with Python are designed to make it " "reasonably straightforward for developers to make their own contributions " @@ -175,7 +178,7 @@ msgstr "" "Python 所提供的發布工具,被設計為讓開發人員能夠以合理的直觀方式,對該公用軟體" "庫回饋他們自己的貢獻,前提是他們願意這樣做。" -#: ../../distributing/index.rst:84 +#: ../../distributing/index.rst:83 msgid "" "The same distribution tools can also be used to distribute software within " "an organisation, regardless of whether that software is published as open " @@ -183,11 +186,11 @@ msgid "" msgstr "" "同一個發布工具也可用於在組織內發布軟體,不論該軟體是否有作為開源軟體被發布。" -#: ../../distributing/index.rst:90 +#: ../../distributing/index.rst:89 msgid "Installing the tools" msgstr "安裝工具" -#: ../../distributing/index.rst:92 +#: ../../distributing/index.rst:91 msgid "" "The standard library does not include build tools that support modern Python " "packaging standards, as the core development team has found that it is " @@ -197,7 +200,7 @@ msgstr "" "標準函式庫並不包含那些支援現代 Python 封裝標準的建置工具,因為核心開發團隊發" "現,提供始終可運作的標準工具是很重要的,即使它們是在舊版的 Python 上運作。" -#: ../../distributing/index.rst:97 +#: ../../distributing/index.rst:96 msgid "" "The currently recommended build and distribution tools can be installed by " "invoking the ``pip`` module at the command line::" @@ -206,7 +209,7 @@ msgstr "" "\n" "::" -#: ../../distributing/index.rst:104 +#: ../../distributing/index.rst:103 msgid "" "For POSIX users (including macOS and Linux users), these instructions assume " "the use of a :term:`virtual environment`." @@ -214,7 +217,7 @@ msgstr "" "對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),這些教學皆假設有使用 :" "term:`virtual environment`\\ 。" -#: ../../distributing/index.rst:107 +#: ../../distributing/index.rst:106 msgid "" "For Windows users, these instructions assume that the option to adjust the " "system PATH environment variable was selected when installing Python." @@ -222,60 +225,60 @@ msgstr "" "對於 Windows 使用者,這些教學皆假設在安裝 Python 時,「可調整系統 PATH 環境變" "數」的選項已被選取。" -#: ../../distributing/index.rst:111 +#: ../../distributing/index.rst:110 msgid "" "The Python Packaging User Guide includes more details on the `currently " "recommended tools`_." msgstr "Python 封裝使用者指南包含了關於\\ `當今推薦工具`_\\ 的更多細節。" -#: ../../distributing/index.rst:123 +#: ../../distributing/index.rst:122 msgid "Reading the Python Packaging User Guide" msgstr "閱讀 Python 封裝使用者指南" -#: ../../distributing/index.rst:125 +#: ../../distributing/index.rst:124 msgid "" "The Python Packaging User Guide covers the various key steps and elements " "involved in creating and publishing a project:" msgstr "" "Python 封裝使用者指南涵蓋了關於建立和發布一個專案的各項關鍵步驟和元素:" -#: ../../distributing/index.rst:128 +#: ../../distributing/index.rst:127 msgid "`Project structure`_" msgstr "`專案結構`_" -#: ../../distributing/index.rst:129 +#: ../../distributing/index.rst:128 msgid "`Building and packaging the project`_" msgstr "`專案建置與封裝`_" -#: ../../distributing/index.rst:130 +#: ../../distributing/index.rst:129 msgid "`Uploading the project to the Python Package Index`_" msgstr "`上傳專案至 Python 套件索引 (Python Package Index)`_" -#: ../../distributing/index.rst:131 +#: ../../distributing/index.rst:130 msgid "`The .pypirc file`_" msgstr "`.pypirc 檔案`_" -#: ../../distributing/index.rst:140 +#: ../../distributing/index.rst:139 msgid "How do I...?" msgstr "我該如何...?" -#: ../../distributing/index.rst:142 +#: ../../distributing/index.rst:141 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../distributing/index.rst:145 +#: ../../distributing/index.rst:144 msgid "... choose a name for my project?" msgstr "...為我的專案選擇一個名稱?" -#: ../../distributing/index.rst:147 +#: ../../distributing/index.rst:146 msgid "This isn't an easy topic, but here are a few tips:" msgstr "這不是一個簡單的題目,但這裡有一些提示:" -#: ../../distributing/index.rst:149 +#: ../../distributing/index.rst:148 msgid "check the Python Package Index to see if the name is already in use" msgstr "檢查 Python 套件索引,看看該名稱是否已被使用" -#: ../../distributing/index.rst:150 +#: ../../distributing/index.rst:149 msgid "" "check popular hosting sites like GitHub, Bitbucket, etc to see if there is " "already a project with that name" @@ -283,11 +286,11 @@ msgstr "" "檢查常用的代管網站,像是 GitHub、Bitbucket 等,看看是否已經有一個使用該名稱的" "專案" -#: ../../distributing/index.rst:152 +#: ../../distributing/index.rst:151 msgid "check what comes up in a web search for the name you're considering" msgstr "檢查您正在考慮的名稱在網路搜尋中會出現的內容" -#: ../../distributing/index.rst:153 +#: ../../distributing/index.rst:152 msgid "" "avoid particularly common words, especially ones with multiple meanings, as " "they can make it difficult for users to find your software when searching " @@ -296,11 +299,11 @@ msgstr "" "避免使用特別常見的單字,尤其是那些有多重含義的單字,因為它們會讓使用者在搜尋" "你的軟體時時很難找到它" -#: ../../distributing/index.rst:159 +#: ../../distributing/index.rst:158 msgid "... create and distribute binary extensions?" msgstr "...建立和發布二進制擴充?" -#: ../../distributing/index.rst:161 +#: ../../distributing/index.rst:160 msgid "" "This is actually quite a complex topic, with a variety of alternatives " "available depending on exactly what you're aiming to achieve. See the Python " @@ -309,7 +312,7 @@ msgstr "" "實際上這是一個非常複雜的題目,因為有各式各樣的替代方案可使用,取決於您確實想" "要達成的目標。更多的資訊和建議,請參閱 Python 封裝使用者指南。" -#: ../../distributing/index.rst:167 +#: ../../distributing/index.rst:166 msgid "" "`Python Packaging User Guide: Binary Extensions `__" @@ -317,14 +320,14 @@ msgstr "" "`Python 封裝使用者指南:二進制擴充 `__" -#: ../../distributing/index.rst:116 +#: ../../distributing/index.rst:115 msgid "Python Package Index (PyPI)" msgstr "Python Package Index (PyPI)" -#: ../../distributing/index.rst:116 +#: ../../distributing/index.rst:115 msgid "PyPI" msgstr "PyPI" -#: ../../distributing/index.rst:116 +#: ../../distributing/index.rst:115 msgid "(see Python Package Index (PyPI))" msgstr "(請見 Python Package Index (PyPI))" diff --git a/extending/building.po b/extending/building.po index 21d87e0430..35f84eb250 100644 --- a/extending/building.po +++ b/extending/building.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgstr "" msgid "" "To be importable, the shared library must be available on :envvar:" "`PYTHONPATH`, and must be named after the module name, with an appropriate " -"extension. When using distutils, the correct filename is generated " +"extension. When using setuptools, the correct filename is generated " "automatically." msgstr "" @@ -65,110 +65,14 @@ msgid "" "in one library\"* section in :pep:`489` for details." msgstr "" -#: ../../extending/building.rst:49 -msgid "Building C and C++ Extensions with distutils" +#: ../../extending/building.rst:51 +msgid "Building C and C++ Extensions with setuptools" msgstr "" #: ../../extending/building.rst:53 msgid "" -"Extension modules can be built using distutils, which is included in " -"Python. Since distutils also supports creation of binary packages, users " -"don't necessarily need a compiler and distutils to install the extension." -msgstr "" - -#: ../../extending/building.rst:57 -msgid "" -"A distutils package contains a driver script, :file:`setup.py`. This is a " -"plain Python file, which, in the most simple case, could look like this:" -msgstr "" - -#: ../../extending/building.rst:73 -msgid "With this :file:`setup.py`, and a file :file:`demo.c`, running ::" -msgstr "" - -#: ../../extending/building.rst:77 -msgid "" -"will compile :file:`demo.c`, and produce an extension module named ``demo`` " -"in the :file:`build` directory. Depending on the system, the module file " -"will end up in a subdirectory :file:`build/lib.system`, and may have a name " -"like :file:`demo.so` or :file:`demo.pyd`." -msgstr "" - -#: ../../extending/building.rst:82 -msgid "" -"In the :file:`setup.py`, all execution is performed by calling the ``setup`` " -"function. This takes a variable number of keyword arguments, of which the " -"example above uses only a subset. Specifically, the example specifies meta-" -"information to build packages, and it specifies the contents of the " -"package. Normally, a package will contain additional modules, like Python " -"source modules, documentation, subpackages, etc. Please refer to the " -"distutils documentation in :ref:`distutils-index` to learn more about the " -"features of distutils; this section explains building extension modules only." -msgstr "" - -#: ../../extending/building.rst:91 -msgid "" -"It is common to pre-compute arguments to :func:`setup`, to better structure " -"the driver script. In the example above, the ``ext_modules`` argument to :" -"func:`~distutils.core.setup` is a list of extension modules, each of which " -"is an instance of the :class:`~distutils.extension.Extension`. In the " -"example, the instance defines an extension named ``demo`` which is build by " -"compiling a single source file, :file:`demo.c`." -msgstr "" - -#: ../../extending/building.rst:99 -msgid "" -"In many cases, building an extension is more complex, since additional " -"preprocessor defines and libraries may be needed. This is demonstrated in " -"the example below." -msgstr "" - -#: ../../extending/building.rst:127 -msgid "" -"In this example, :func:`~distutils.core.setup` is called with additional " -"meta-information, which is recommended when distribution packages have to be " -"built. For the extension itself, it specifies preprocessor defines, include " -"directories, library directories, and libraries. Depending on the compiler, " -"distutils passes this information in different ways to the compiler. For " -"example, on Unix, this may result in the compilation commands ::" -msgstr "" - -#: ../../extending/building.rst:139 -msgid "" -"These lines are for demonstration purposes only; distutils users should " -"trust that distutils gets the invocations right." -msgstr "" - -#: ../../extending/building.rst:146 -msgid "Distributing your extension modules" -msgstr "" - -#: ../../extending/building.rst:148 -msgid "" -"When an extension has been successfully built, there are three ways to use " -"it." -msgstr "" - -#: ../../extending/building.rst:150 -msgid "" -"End-users will typically want to install the module, they do so by running ::" -msgstr "" - -#: ../../extending/building.rst:154 -msgid "" -"Module maintainers should produce source packages; to do so, they run ::" -msgstr "" - -#: ../../extending/building.rst:158 -msgid "" -"In some cases, additional files need to be included in a source " -"distribution; this is done through a :file:`MANIFEST.in` file; see :ref:" -"`manifest` for details." -msgstr "" - -#: ../../extending/building.rst:161 -msgid "" -"If the source distribution has been built successfully, maintainers can also " -"create binary distributions. Depending on the platform, one of the following " -"commands can be used to do so. ::" +"Python 3.12 and newer no longer come with distutils. Please refer to the " +"``setuptools`` documentation at https://setuptools.readthedocs.io/en/latest/" +"setuptools.html to learn more about how build and distribute C/C++ " +"extensions with setuptools." msgstr "" diff --git a/extending/newtypes.po b/extending/newtypes.po index 382aefd1d4..763762fed1 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -286,54 +286,14 @@ msgstr "" msgid "" "For each entry in the table, a :term:`descriptor` will be constructed and " "added to the type which will be able to extract a value from the instance " -"structure. The :attr:`type` field should contain one of the type codes " -"defined in the :file:`structmember.h` header; the value will be used to " -"determine how to convert Python values to and from C values. The :attr:" -"`flags` field is used to store flags which control how the attribute can be " -"accessed." +"structure. The :attr:`type` field should contain a type code like :c:macro:" +"`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be used to determine " +"how to convert Python values to and from C values. The :attr:`flags` field " +"is used to store flags which control how the attribute can be accessed: you " +"can set it to :c:macro:`Py_READONLY` to prevent Python code from setting it." msgstr "" -#: ../../extending/newtypes.rst:294 -msgid "" -"The following flag constants are defined in :file:`structmember.h`; they may " -"be combined using bitwise-OR." -msgstr "" - -#: ../../extending/newtypes.rst:298 -msgid "Constant" -msgstr "常數" - -#: ../../extending/newtypes.rst:298 -msgid "Meaning" -msgstr "" - -#: ../../extending/newtypes.rst:300 -msgid ":const:`READONLY`" -msgstr ":const:`READONLY`" - -#: ../../extending/newtypes.rst:300 -msgid "Never writable." -msgstr "" - -#: ../../extending/newtypes.rst:302 -msgid ":const:`PY_AUDIT_READ`" -msgstr ":const:`PY_AUDIT_READ`" - -#: ../../extending/newtypes.rst:302 -msgid "" -"Emit an ``object.__getattr__`` :ref:`audit events ` before " -"reading." -msgstr "" - -#: ../../extending/newtypes.rst:307 -msgid "" -":const:`RESTRICTED`, :const:`READ_RESTRICTED` and :const:`WRITE_RESTRICTED` " -"are deprecated. However, :const:`READ_RESTRICTED` is an alias for :const:" -"`PY_AUDIT_READ`, so fields that specify either :const:`RESTRICTED` or :const:" -"`READ_RESTRICTED` will also raise an audit event." -msgstr "" - -#: ../../extending/newtypes.rst:320 +#: ../../extending/newtypes.rst:295 msgid "" "An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` " "table to build descriptors that are used at runtime is that any attribute " @@ -343,17 +303,17 @@ msgid "" "`__doc__` attribute." msgstr "" -#: ../../extending/newtypes.rst:326 +#: ../../extending/newtypes.rst:301 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " "with a :attr:`name` value of ``NULL`` is required." msgstr "" -#: ../../extending/newtypes.rst:340 +#: ../../extending/newtypes.rst:315 msgid "Type-specific Attribute Management" msgstr "" -#: ../../extending/newtypes.rst:342 +#: ../../extending/newtypes.rst:317 msgid "" "For simplicity, only the :c:expr:`char\\*` version will be demonstrated " "here; the type of the name parameter is the only difference between the :c:" @@ -364,21 +324,21 @@ msgid "" "functionality, you'll understand what needs to be done." msgstr "" -#: ../../extending/newtypes.rst:350 +#: ../../extending/newtypes.rst:325 msgid "" "The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " "requires an attribute look-up. It is called in the same situations where " "the :meth:`__getattr__` method of a class would be called." msgstr "" -#: ../../extending/newtypes.rst:354 +#: ../../extending/newtypes.rst:329 msgid "Here is an example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../extending/newtypes.rst:370 +#: ../../extending/newtypes.rst:345 msgid "" "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" "`__setattr__` or :meth:`__delattr__` method of a class instance would be " @@ -388,11 +348,11 @@ msgid "" "should be set to ``NULL``. ::" msgstr "" -#: ../../extending/newtypes.rst:384 +#: ../../extending/newtypes.rst:359 msgid "Object Comparison" msgstr "" -#: ../../extending/newtypes.rst:390 +#: ../../extending/newtypes.rst:365 msgid "" "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " "comparisons are needed. It is analogous to the :ref:`rich comparison " @@ -400,7 +360,7 @@ msgid "" "`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." msgstr "" -#: ../../extending/newtypes.rst:395 +#: ../../extending/newtypes.rst:370 msgid "" "This function is called with two Python objects and the operator as " "arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, " @@ -411,23 +371,23 @@ msgid "" "should be tried, or ``NULL`` if an exception was set." msgstr "" -#: ../../extending/newtypes.rst:403 +#: ../../extending/newtypes.rst:378 msgid "" "Here is a sample implementation, for a datatype that is considered equal if " "the size of an internal pointer is equal::" msgstr "" -#: ../../extending/newtypes.rst:433 +#: ../../extending/newtypes.rst:408 msgid "Abstract Protocol Support" msgstr "" -#: ../../extending/newtypes.rst:435 +#: ../../extending/newtypes.rst:410 msgid "" "Python supports a variety of *abstract* 'protocols;' the specific interfaces " "provided to use these interfaces are documented in :ref:`abstract`." msgstr "" -#: ../../extending/newtypes.rst:439 +#: ../../extending/newtypes.rst:414 msgid "" "A number of these abstract interfaces were defined early in the development " "of the Python implementation. In particular, the number, mapping, and " @@ -442,7 +402,7 @@ msgid "" "slot, but a slot may still be unfilled.) ::" msgstr "" -#: ../../extending/newtypes.rst:454 +#: ../../extending/newtypes.rst:429 msgid "" "If you wish your object to be able to act like a number, a sequence, or a " "mapping object, then you place the address of a structure that implements " @@ -453,13 +413,13 @@ msgid "" "distribution. ::" msgstr "" -#: ../../extending/newtypes.rst:463 +#: ../../extending/newtypes.rst:438 msgid "" "This function, if you choose to provide it, should return a hash number for " "an instance of your data type. Here is a simple example::" msgstr "" -#: ../../extending/newtypes.rst:476 +#: ../../extending/newtypes.rst:451 msgid "" ":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " "Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " @@ -467,7 +427,7 @@ msgid "" "computation is successful, as seen above." msgstr "" -#: ../../extending/newtypes.rst:485 +#: ../../extending/newtypes.rst:460 msgid "" "This function is called when an instance of your data type is \"called\", " "for example, if ``obj1`` is an instance of your data type and the Python " @@ -475,23 +435,23 @@ msgid "" "handler is invoked." msgstr "" -#: ../../extending/newtypes.rst:489 +#: ../../extending/newtypes.rst:464 msgid "This function takes three arguments:" msgstr "" -#: ../../extending/newtypes.rst:491 +#: ../../extending/newtypes.rst:466 msgid "" "*self* is the instance of the data type which is the subject of the call. If " "the call is ``obj1('hello')``, then *self* is ``obj1``." msgstr "" -#: ../../extending/newtypes.rst:494 +#: ../../extending/newtypes.rst:469 msgid "" "*args* is a tuple containing the arguments to the call. You can use :c:func:" "`PyArg_ParseTuple` to extract the arguments." msgstr "" -#: ../../extending/newtypes.rst:497 +#: ../../extending/newtypes.rst:472 msgid "" "*kwds* is a dictionary of keyword arguments that were passed. If this is non-" "``NULL`` and you support keyword arguments, use :c:func:" @@ -500,11 +460,11 @@ msgid "" "`TypeError` with a message saying that keyword arguments are not supported." msgstr "" -#: ../../extending/newtypes.rst:503 +#: ../../extending/newtypes.rst:478 msgid "Here is a toy ``tp_call`` implementation::" msgstr "" -#: ../../extending/newtypes.rst:529 +#: ../../extending/newtypes.rst:504 msgid "" "These functions provide support for the iterator protocol. Both handlers " "take exactly one parameter, the instance for which they are being called, " @@ -515,21 +475,21 @@ msgid "" "__next__` method." msgstr "" -#: ../../extending/newtypes.rst:536 +#: ../../extending/newtypes.rst:511 msgid "" "Any :term:`iterable` object must implement the :c:member:`~PyTypeObject." "tp_iter` handler, which must return an :term:`iterator` object. Here the " "same guidelines apply as for Python classes:" msgstr "" -#: ../../extending/newtypes.rst:540 +#: ../../extending/newtypes.rst:515 msgid "" "For collections (such as lists and tuples) which can support multiple " "independent iterators, a new iterator should be created and returned by each " "call to :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: ../../extending/newtypes.rst:543 +#: ../../extending/newtypes.rst:518 msgid "" "Objects which can only be iterated over once (usually due to side effects of " "iteration, such as file objects) can implement :c:member:`~PyTypeObject." @@ -537,7 +497,7 @@ msgid "" "therefore implement the :c:member:`~PyTypeObject.tp_iternext` handler." msgstr "" -#: ../../extending/newtypes.rst:548 +#: ../../extending/newtypes.rst:523 msgid "" "Any :term:`iterator` object should implement both :c:member:`~PyTypeObject." "tp_iter` and :c:member:`~PyTypeObject.tp_iternext`. An iterator's :c:member:" @@ -552,64 +512,45 @@ msgid "" "``NULL``." msgstr "" -#: ../../extending/newtypes.rst:564 +#: ../../extending/newtypes.rst:539 msgid "Weak Reference Support" msgstr "" -#: ../../extending/newtypes.rst:566 +#: ../../extending/newtypes.rst:541 msgid "" "One of the goals of Python's weak reference implementation is to allow any " "type to participate in the weak reference mechanism without incurring the " "overhead on performance-critical objects (such as numbers)." msgstr "" -#: ../../extending/newtypes.rst:571 +#: ../../extending/newtypes.rst:546 msgid "Documentation for the :mod:`weakref` module." msgstr "" -#: ../../extending/newtypes.rst:573 -msgid "" -"For an object to be weakly referencable, the extension type must do two " -"things:" -msgstr "" - -#: ../../extending/newtypes.rst:575 -msgid "" -"Include a :c:expr:`PyObject*` field in the C object structure dedicated to " -"the weak reference mechanism. The object's constructor should leave it " -"``NULL`` (which is automatic when using the default :c:member:`~PyTypeObject." -"tp_alloc`)." -msgstr "" - -#: ../../extending/newtypes.rst:580 +#: ../../extending/newtypes.rst:548 msgid "" -"Set the :c:member:`~PyTypeObject.tp_weaklistoffset` type member to the " -"offset of the aforementioned field in the C object structure, so that the " -"interpreter knows how to access and modify that field." +"For an object to be weakly referencable, the extension type must set the " +"``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags` " +"field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should " +"be left as zero." msgstr "" -#: ../../extending/newtypes.rst:584 +#: ../../extending/newtypes.rst:553 msgid "" -"Concretely, here is how a trivial object structure would be augmented with " -"the required field::" -msgstr "" - -#: ../../extending/newtypes.rst:592 -msgid "And the corresponding member in the statically declared type object::" +"Concretely, here is how the statically declared type object would look::" msgstr "" -#: ../../extending/newtypes.rst:600 +#: ../../extending/newtypes.rst:562 msgid "" "The only further addition is that ``tp_dealloc`` needs to clear any weak " -"references (by calling :c:func:`PyObject_ClearWeakRefs`) if the field is non-" -"``NULL``::" +"references (by calling :c:func:`PyObject_ClearWeakRefs`)::" msgstr "" -#: ../../extending/newtypes.rst:616 +#: ../../extending/newtypes.rst:576 msgid "More Suggestions" msgstr "" -#: ../../extending/newtypes.rst:618 +#: ../../extending/newtypes.rst:578 msgid "" "In order to learn how to implement any specific method for your new data " "type, get the :term:`CPython` source code. Go to the :file:`Objects` " @@ -618,27 +559,27 @@ msgid "" "function you want to implement." msgstr "" -#: ../../extending/newtypes.rst:624 +#: ../../extending/newtypes.rst:584 msgid "" "When you need to verify that an object is a concrete instance of the type " "you are implementing, use the :c:func:`PyObject_TypeCheck` function. A " "sample of its use might be something like the following::" msgstr "" -#: ../../extending/newtypes.rst:635 +#: ../../extending/newtypes.rst:595 msgid "Download CPython source releases." msgstr "" -#: ../../extending/newtypes.rst:635 +#: ../../extending/newtypes.rst:595 msgid "https://www.python.org/downloads/source/" msgstr "https://www.python.org/downloads/source/" -#: ../../extending/newtypes.rst:637 +#: ../../extending/newtypes.rst:597 msgid "" "The CPython project on GitHub, where the CPython source code is developed." msgstr "" -#: ../../extending/newtypes.rst:638 +#: ../../extending/newtypes.rst:598 msgid "https://github.com/python/cpython" msgstr "https://github.com/python/cpython" @@ -686,22 +627,26 @@ msgstr "built-in function(內建函式)" msgid "repr" msgstr "repr" -#: ../../extending/newtypes.rst:313 -msgid "READONLY" -msgstr "READONLY" +#~ msgid "Constant" +#~ msgstr "常數" + +#~ msgid ":const:`READONLY`" +#~ msgstr ":const:`READONLY`" + +#~ msgid ":const:`PY_AUDIT_READ`" +#~ msgstr ":const:`PY_AUDIT_READ`" + +#~ msgid "READONLY" +#~ msgstr "READONLY" -#: ../../extending/newtypes.rst:313 -msgid "READ_RESTRICTED" -msgstr "READ_RESTRICTED" +#~ msgid "READ_RESTRICTED" +#~ msgstr "READ_RESTRICTED" -#: ../../extending/newtypes.rst:313 -msgid "WRITE_RESTRICTED" -msgstr "WRITE_RESTRICTED" +#~ msgid "WRITE_RESTRICTED" +#~ msgstr "WRITE_RESTRICTED" -#: ../../extending/newtypes.rst:313 -msgid "RESTRICTED" -msgstr "RESTRICTED" +#~ msgid "RESTRICTED" +#~ msgstr "RESTRICTED" -#: ../../extending/newtypes.rst:313 -msgid "PY_AUDIT_READ" -msgstr "PY_AUDIT_READ" +#~ msgid "PY_AUDIT_READ" +#~ msgstr "PY_AUDIT_READ" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 71a39814a0..292f9b70d5 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-07 00:27+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -280,16 +280,6 @@ msgid "This version of the module has a number of changes." msgstr "" #: ../../extending/newtypes_tutorial.rst:242 -msgid "We've added an extra include::" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:246 -msgid "" -"This include provides declarations that we use to handle attributes, as " -"described a bit later." -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:249 msgid "" "The :class:`Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " @@ -297,21 +287,21 @@ msgid "" "integer." msgstr "" -#: ../../extending/newtypes_tutorial.rst:253 +#: ../../extending/newtypes_tutorial.rst:246 msgid "The object structure is updated accordingly::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:262 +#: ../../extending/newtypes_tutorial.rst:255 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:273 +#: ../../extending/newtypes_tutorial.rst:266 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:277 +#: ../../extending/newtypes_tutorial.rst:270 msgid "" "This method first clears the reference counts of the two Python attributes. :" "c:func:`Py_XDECREF` correctly handles the case where its argument is " @@ -322,7 +312,7 @@ msgid "" "instance of a subclass." msgstr "" -#: ../../extending/newtypes_tutorial.rst:286 +#: ../../extending/newtypes_tutorial.rst:279 msgid "" "The explicit cast to ``destructor`` above is needed because we defined " "``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " @@ -331,17 +321,17 @@ msgid "" "oriented polymorphism, in C!" msgstr "" -#: ../../extending/newtypes_tutorial.rst:292 +#: ../../extending/newtypes_tutorial.rst:285 msgid "" "We want to make sure that the first and last names are initialized to empty " "strings, so we provide a ``tp_new`` implementation::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:316 +#: ../../extending/newtypes_tutorial.rst:309 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:320 +#: ../../extending/newtypes_tutorial.rst:313 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" @@ -352,7 +342,7 @@ msgid "" "attributes to non-``NULL`` default values." msgstr "" -#: ../../extending/newtypes_tutorial.rst:328 +#: ../../extending/newtypes_tutorial.rst:321 msgid "" "``tp_new`` is passed the type being instantiated (not necessarily " "``CustomType``, if a subclass is instantiated) and any arguments passed when " @@ -362,25 +352,25 @@ msgid "" "k.a. ``tp_init`` in C or ``__init__`` in Python) methods." msgstr "" -#: ../../extending/newtypes_tutorial.rst:336 +#: ../../extending/newtypes_tutorial.rst:329 msgid "" "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " "it itself." msgstr "" -#: ../../extending/newtypes_tutorial.rst:339 +#: ../../extending/newtypes_tutorial.rst:332 msgid "" "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " "slot to allocate memory::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:344 +#: ../../extending/newtypes_tutorial.rst:337 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." "tp_alloc` result against ``NULL`` before proceeding." msgstr "" -#: ../../extending/newtypes_tutorial.rst:348 +#: ../../extending/newtypes_tutorial.rst:341 msgid "" "We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " "Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " @@ -388,7 +378,7 @@ msgid "" "allocation strategy." msgstr "" -#: ../../extending/newtypes_tutorial.rst:354 +#: ../../extending/newtypes_tutorial.rst:347 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " "that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:" @@ -401,17 +391,17 @@ msgid "" "subclasses without getting a :exc:`TypeError`.)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:364 +#: ../../extending/newtypes_tutorial.rst:357 msgid "" "We also define an initialization function which accepts arguments to provide " "initial values for our instance::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:393 +#: ../../extending/newtypes_tutorial.rst:386 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:397 +#: ../../extending/newtypes_tutorial.rst:390 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" "`__init__` method. It is used to initialize an object after it's created. " @@ -419,7 +409,7 @@ msgid "" "return either ``0`` on success or ``-1`` on error." msgstr "" -#: ../../extending/newtypes_tutorial.rst:402 +#: ../../extending/newtypes_tutorial.rst:395 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " @@ -430,7 +420,7 @@ msgid "" "``first`` member like this::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:416 +#: ../../extending/newtypes_tutorial.rst:409 msgid "" "But this would be risky. Our type doesn't restrict the type of the " "``first`` member, so it could be any kind of object. It could have a " @@ -440,49 +430,49 @@ msgid "" "accesses and modifies our object." msgstr "" -#: ../../extending/newtypes_tutorial.rst:423 +#: ../../extending/newtypes_tutorial.rst:416 msgid "" "To be paranoid and protect ourselves against this possibility, we almost " "always reassign members before decrementing their reference counts. When " "don't we have to do this?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:427 +#: ../../extending/newtypes_tutorial.rst:420 msgid "when we absolutely know that the reference count is greater than 1;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:429 +#: ../../extending/newtypes_tutorial.rst:422 msgid "" "when we know that deallocation of the object [#]_ will neither release the :" "term:`GIL` nor cause any calls back into our type's code;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:432 +#: ../../extending/newtypes_tutorial.rst:425 msgid "" "when decrementing a reference count in a :c:member:`~PyTypeObject." "tp_dealloc` handler on a type which doesn't support cyclic garbage " "collection [#]_." msgstr "" -#: ../../extending/newtypes_tutorial.rst:435 +#: ../../extending/newtypes_tutorial.rst:428 msgid "" "We want to expose our instance variables as attributes. There are a number " "of ways to do that. The simplest way is to define member definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:448 +#: ../../extending/newtypes_tutorial.rst:441 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:452 +#: ../../extending/newtypes_tutorial.rst:445 msgid "" "Each member definition has a member name, type, offset, access flags and " "documentation string. See the :ref:`Generic-Attribute-Management` section " "below for details." msgstr "" -#: ../../extending/newtypes_tutorial.rst:456 +#: ../../extending/newtypes_tutorial.rst:449 msgid "" "A disadvantage of this approach is that it doesn't provide a way to restrict " "the types of objects that can be assigned to the Python attributes. We " @@ -493,13 +483,13 @@ msgid "" "deleted." msgstr "" -#: ../../extending/newtypes_tutorial.rst:463 +#: ../../extending/newtypes_tutorial.rst:456 msgid "" "We define a single method, :meth:`Custom.name()`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:480 +#: ../../extending/newtypes_tutorial.rst:473 msgid "" "The method is implemented as a C function that takes a :class:`Custom` (or :" "class:`Custom` subclass) instance as the first argument. Methods always " @@ -509,7 +499,7 @@ msgid "" "method is equivalent to the Python method:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:492 +#: ../../extending/newtypes_tutorial.rst:485 msgid "" "Note that we have to check for the possibility that our :attr:`first` and :" "attr:`last` members are ``NULL``. This is because they can be deleted, in " @@ -518,23 +508,23 @@ msgid "" "We'll see how to do that in the next section." msgstr "" -#: ../../extending/newtypes_tutorial.rst:498 +#: ../../extending/newtypes_tutorial.rst:491 msgid "" "Now that we've defined the method, we need to create an array of method " "definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:508 +#: ../../extending/newtypes_tutorial.rst:501 msgid "" "(note that we used the :const:`METH_NOARGS` flag to indicate that the method " "is expecting no arguments other than *self*)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:511 +#: ../../extending/newtypes_tutorial.rst:504 msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:515 +#: ../../extending/newtypes_tutorial.rst:508 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " @@ -542,22 +532,22 @@ msgid "" "to add the :const:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:522 +#: ../../extending/newtypes_tutorial.rst:515 msgid "" "We rename :c:func:`PyInit_custom` to :c:func:`PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" -#: ../../extending/newtypes_tutorial.rst:526 +#: ../../extending/newtypes_tutorial.rst:519 msgid "Finally, we update our :file:`setup.py` file to build the new module:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:539 +#: ../../extending/newtypes_tutorial.rst:532 msgid "Providing finer control over data attributes" msgstr "" -#: ../../extending/newtypes_tutorial.rst:541 +#: ../../extending/newtypes_tutorial.rst:534 msgid "" "In this section, we'll provide finer control over how the :attr:`first` and :" "attr:`last` attributes are set in the :class:`Custom` example. In the " @@ -566,14 +556,14 @@ msgid "" "make sure that these attributes always contain strings." msgstr "" -#: ../../extending/newtypes_tutorial.rst:550 +#: ../../extending/newtypes_tutorial.rst:543 msgid "" "To provide greater control, over the :attr:`first` and :attr:`last` " "attributes, we'll use custom getter and setter functions. Here are the " "functions for getting and setting the :attr:`first` attribute::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:581 +#: ../../extending/newtypes_tutorial.rst:574 msgid "" "The getter function is passed a :class:`Custom` object and a \"closure\", " "which is a void pointer. In this case, the closure is ignored. (The " @@ -583,7 +573,7 @@ msgid "" "data in the closure.)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:587 +#: ../../extending/newtypes_tutorial.rst:580 msgid "" "The setter function is passed the :class:`Custom` object, the new value, and " "the closure. The new value may be ``NULL``, in which case the attribute is " @@ -591,32 +581,32 @@ msgid "" "or if its new value is not a string." msgstr "" -#: ../../extending/newtypes_tutorial.rst:592 +#: ../../extending/newtypes_tutorial.rst:585 msgid "We create an array of :c:type:`PyGetSetDef` structures::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:602 +#: ../../extending/newtypes_tutorial.rst:595 msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:606 +#: ../../extending/newtypes_tutorial.rst:599 msgid "" "The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " "mentioned above. In this case, we aren't using a closure, so we just pass " "``NULL``." msgstr "" -#: ../../extending/newtypes_tutorial.rst:609 +#: ../../extending/newtypes_tutorial.rst:602 msgid "We also remove the member definitions for these attributes::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:617 +#: ../../extending/newtypes_tutorial.rst:610 msgid "" "We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only " "allow strings [#]_ to be passed::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:646 +#: ../../extending/newtypes_tutorial.rst:639 msgid "" "With these changes, we can assure that the ``first`` and ``last`` members " "are never ``NULL`` so we can remove checks for ``NULL`` values in almost all " @@ -626,25 +616,25 @@ msgid "" "possibility that the initialization of these members failed in ``tp_new``." msgstr "" -#: ../../extending/newtypes_tutorial.rst:653 +#: ../../extending/newtypes_tutorial.rst:646 msgid "" "We also rename the module initialization function and module name in the " "initialization function, as we did before, and we add an extra definition to " "the :file:`setup.py` file." msgstr "" -#: ../../extending/newtypes_tutorial.rst:659 +#: ../../extending/newtypes_tutorial.rst:652 msgid "Supporting cyclic garbage collection" msgstr "" -#: ../../extending/newtypes_tutorial.rst:661 +#: ../../extending/newtypes_tutorial.rst:654 msgid "" "Python has a :term:`cyclic garbage collector (GC) ` that " "can identify unneeded objects even when their reference counts are not zero. " "This can happen when objects are involved in cycles. For example, consider:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:671 +#: ../../extending/newtypes_tutorial.rst:664 msgid "" "In this example, we create a list that contains itself. When we delete it, " "it still has a reference from itself. Its reference count doesn't drop to " @@ -652,7 +642,7 @@ msgid "" "out that the list is garbage and free it." msgstr "" -#: ../../extending/newtypes_tutorial.rst:676 +#: ../../extending/newtypes_tutorial.rst:669 msgid "" "In the second version of the :class:`Custom` example, we allowed any kind of " "object to be stored in the :attr:`first` or :attr:`last` attributes [#]_. " @@ -661,7 +651,7 @@ msgid "" "reasons, :class:`Custom` objects can participate in cycles:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:690 +#: ../../extending/newtypes_tutorial.rst:683 msgid "" "To allow a :class:`Custom` instance participating in a reference cycle to be " "properly detected and collected by the cyclic GC, our :class:`Custom` type " @@ -669,13 +659,13 @@ msgid "" "slots:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:697 +#: ../../extending/newtypes_tutorial.rst:690 msgid "" "First, the traversal method lets the cyclic GC know about subobjects that " "could participate in cycles::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:717 +#: ../../extending/newtypes_tutorial.rst:710 msgid "" "For each subobject that can participate in cycles, we need to call the :c:" "func:`visit` function, which is passed to the traversal method. The :c:func:" @@ -684,26 +674,26 @@ msgid "" "be returned if it is non-zero." msgstr "" -#: ../../extending/newtypes_tutorial.rst:723 +#: ../../extending/newtypes_tutorial.rst:716 msgid "" "Python provides a :c:func:`Py_VISIT` macro that automates calling visit " "functions. With :c:func:`Py_VISIT`, we can minimize the amount of " "boilerplate in ``Custom_traverse``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:736 +#: ../../extending/newtypes_tutorial.rst:729 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " "arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." msgstr "" -#: ../../extending/newtypes_tutorial.rst:739 +#: ../../extending/newtypes_tutorial.rst:732 msgid "" "Second, we need to provide a method for clearing any subobjects that can " "participate in cycles::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:750 +#: ../../extending/newtypes_tutorial.rst:743 msgid "" "Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " "safe way to clear data attributes of arbitrary types while decrementing " @@ -713,18 +703,18 @@ msgid "" "again (*especially* if there is a reference cycle)." msgstr "" -#: ../../extending/newtypes_tutorial.rst:758 +#: ../../extending/newtypes_tutorial.rst:751 msgid "You could emulate :c:func:`Py_CLEAR` by writing::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:765 +#: ../../extending/newtypes_tutorial.rst:758 msgid "" "Nevertheless, it is much easier and less error-prone to always use :c:func:" "`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the " "expense of robustness!" msgstr "" -#: ../../extending/newtypes_tutorial.rst:769 +#: ../../extending/newtypes_tutorial.rst:762 msgid "" "The deallocator ``Custom_dealloc`` may call arbitrary code when clearing " "attributes. It means the circular GC can be triggered inside the function. " @@ -734,12 +724,12 @@ msgid "" "`PyObject_GC_UnTrack` and ``Custom_clear``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:784 +#: ../../extending/newtypes_tutorial.rst:777 msgid "" "Finally, we add the :const:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:788 +#: ../../extending/newtypes_tutorial.rst:781 msgid "" "That's pretty much it. If we had written custom :c:member:`~PyTypeObject." "tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify " @@ -747,11 +737,11 @@ msgid "" "automatically provided." msgstr "" -#: ../../extending/newtypes_tutorial.rst:794 +#: ../../extending/newtypes_tutorial.rst:787 msgid "Subclassing other types" msgstr "" -#: ../../extending/newtypes_tutorial.rst:796 +#: ../../extending/newtypes_tutorial.rst:789 msgid "" "It is possible to create new extension types that are derived from existing " "types. It is easiest to inherit from the built in types, since an extension " @@ -759,7 +749,7 @@ msgid "" "share these :c:type:`PyTypeObject` structures between extension modules." msgstr "" -#: ../../extending/newtypes_tutorial.rst:801 +#: ../../extending/newtypes_tutorial.rst:794 msgid "" "In this example we will create a :class:`SubList` type that inherits from " "the built-in :class:`list` type. The new type will be completely compatible " @@ -767,34 +757,34 @@ msgid "" "that increases an internal counter:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:821 +#: ../../extending/newtypes_tutorial.rst:814 msgid "" "As you can see, the source code closely resembles the :class:`Custom` " "examples in previous sections. We will break down the main differences " "between them. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:829 +#: ../../extending/newtypes_tutorial.rst:822 msgid "" "The primary difference for derived type objects is that the base type's " "object structure must be the first value. The base type will already " "include the :c:func:`PyObject_HEAD` at the beginning of its structure." msgstr "" -#: ../../extending/newtypes_tutorial.rst:833 +#: ../../extending/newtypes_tutorial.rst:826 msgid "" "When a Python object is a :class:`SubList` instance, its ``PyObject *`` " "pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " "*``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:845 +#: ../../extending/newtypes_tutorial.rst:838 msgid "" "We see above how to call through to the :attr:`__init__` method of the base " "type." msgstr "" -#: ../../extending/newtypes_tutorial.rst:848 +#: ../../extending/newtypes_tutorial.rst:841 msgid "" "This pattern is important when writing a type with custom :c:member:" "`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. " @@ -803,7 +793,7 @@ msgid "" "the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: ../../extending/newtypes_tutorial.rst:854 +#: ../../extending/newtypes_tutorial.rst:847 msgid "" "The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject." "tp_base` specifying the type's concrete base class. Due to cross-platform " @@ -812,7 +802,7 @@ msgid "" "function::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:882 +#: ../../extending/newtypes_tutorial.rst:875 msgid "" "Before calling :c:func:`PyType_Ready`, the type structure must have the :c:" "member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an " @@ -821,29 +811,29 @@ msgid "" "from the base type will be inherited." msgstr "" -#: ../../extending/newtypes_tutorial.rst:888 +#: ../../extending/newtypes_tutorial.rst:881 msgid "" "After that, calling :c:func:`PyType_Ready` and adding the type object to the " "module is the same as with the basic :class:`Custom` examples." msgstr "" -#: ../../extending/newtypes_tutorial.rst:893 +#: ../../extending/newtypes_tutorial.rst:886 msgid "Footnotes" msgstr "註解" -#: ../../extending/newtypes_tutorial.rst:894 +#: ../../extending/newtypes_tutorial.rst:887 msgid "" "This is true when we know that the object is a basic type, like a string or " "a float." msgstr "" -#: ../../extending/newtypes_tutorial.rst:897 +#: ../../extending/newtypes_tutorial.rst:890 msgid "" "We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in " "this example, because our type doesn't support garbage collection." msgstr "" -#: ../../extending/newtypes_tutorial.rst:900 +#: ../../extending/newtypes_tutorial.rst:893 msgid "" "We now know that the first and last members are strings, so perhaps we could " "be less careful about decrementing their reference counts, however, we " @@ -853,7 +843,7 @@ msgid "" "objects." msgstr "" -#: ../../extending/newtypes_tutorial.rst:906 +#: ../../extending/newtypes_tutorial.rst:899 msgid "" "Also, even with our attributes restricted to strings instances, the user " "could pass arbitrary :class:`str` subclasses and therefore still create " diff --git a/extending/windows.po b/extending/windows.po index 41fd62bce3..d91bf2c5d8 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,10 +57,10 @@ msgstr "" #: ../../extending/windows.rst:36 msgid "" "There are two approaches to building extension modules on Windows, just as " -"there are on Unix: use the :mod:`distutils` package to control the build " -"process, or do things manually. The distutils approach works well for most " -"extensions; documentation on using :mod:`distutils` to build and package " -"extension modules is available in :ref:`distutils-index`. If you find you " +"there are on Unix: use the ``setuptools`` package to control the build " +"process, or do things manually. The setuptools approach works well for most " +"extensions; documentation on using ``setuptools`` to build and package " +"extension modules is available in :ref:`setuptools-index`. If you find you " "really need to do things manually, it may be instructive to study the " "project file for the :source:`winsound ` standard " "library module." diff --git a/faq/design.po b/faq/design.po index b53394862b..c131170b6d 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-18 13:10+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -235,15 +235,16 @@ msgstr "" "綴 ``m_``,所以這種明確性在那些語言也是很好用的。" #: ../../faq/design.rst:127 +#, fuzzy msgid "" "Second, it means that no special syntax is necessary if you want to " "explicitly reference or call the method from a particular class. In C++, if " "you want to use a method from a base class which is overridden in a derived " "class, you have to use the ``::`` operator -- in Python you can write " "``baseclass.methodname(self, )``. This is particularly " -"useful for :meth:`__init__` methods, and in general in cases where a derived " -"class method wants to extend the base class method of the same name and thus " -"has to call the base class method somehow." +"useful for :meth:`~object.__init__` methods, and in general in cases where a " +"derived class method wants to extend the base class method of the same name " +"and thus has to call the base class method somehow." msgstr "" "第二,當你想明確地使用或呼叫在某個類別裡的方法的時候,你不需要特殊的語法。在 " "C++ 裡,如果你想用一個在繼承類別時被覆寫的基底類別方法,必須要用 ``::`` 運算" @@ -424,17 +425,18 @@ msgid "How fast are exceptions?" msgstr "例外處理有多快?" #: ../../faq/design.rst:235 +#, fuzzy msgid "" -"A try/except block is extremely efficient if no exceptions are raised. " -"Actually catching an exception is expensive. In versions of Python prior to " -"2.0 it was common to use this idiom::" +"A :keyword:`try`/:keyword:`except` block is extremely efficient if no " +"exceptions are raised. Actually catching an exception is expensive. In " +"versions of Python prior to 2.0 it was common to use this idiom::" msgstr "" "如果沒有例外被丟出,一個 try/except 區塊是非常有效率的。事實上,抓捕例外要付" "出昂貴的代價。在 Python 2.0 以前,這樣使用是相當常見的:\n" "\n" "::" -#: ../../faq/design.rst:245 +#: ../../faq/design.rst:246 msgid "" "This only made sense when you expected the dict to have the key almost all " "the time. If that wasn't the case, you coded it like this::" @@ -444,7 +446,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:253 +#: ../../faq/design.rst:254 msgid "" "For this specific case, you could also use ``value = dict.setdefault(key, " "getvalue(key))``, but only if the ``getvalue()`` call is cheap enough " @@ -454,11 +456,11 @@ msgstr "" "getvalue(key))``,不過只有在 ``getvalue()`` 代價不大的時候才能用,畢竟他每次" "都會被執行。" -#: ../../faq/design.rst:259 +#: ../../faq/design.rst:260 msgid "Why isn't there a switch or case statement in Python?" msgstr "為什麼 Python 內沒有 switch 或 case 陳述式?" -#: ../../faq/design.rst:261 +#: ../../faq/design.rst:262 msgid "" "You can do this easily enough with a sequence of ``if... elif... elif... " "else``. For literal values, or constants within a namespace, you can also " @@ -467,7 +469,7 @@ msgstr "" "你可以用一連串的 ``if... elif... elif... else`` 來輕易達成相同的效果。對於單" "純的值或是在命名空間內的常數,你也可以使用 ``match ... case`` 陳述式。" -#: ../../faq/design.rst:265 +#: ../../faq/design.rst:266 msgid "" "For cases where you need to choose from a very large number of " "possibilities, you can create a dictionary mapping case values to functions " @@ -477,7 +479,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:276 +#: ../../faq/design.rst:277 msgid "" "For calling methods on objects, you can simplify yet further by using the :" "func:`getattr` built-in to retrieve methods with a particular name::" @@ -487,7 +489,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:288 +#: ../../faq/design.rst:289 msgid "" "It's suggested that you use a prefix for the method names, such as " "``visit_`` in this example. Without such a prefix, if values are coming " @@ -497,13 +499,13 @@ msgstr "" "我們建議在方法名稱加上前綴,以這個例子來說是 像是 ``visit_``。沒有前綴的話," "一旦收到從不信任來源的值,攻擊者便可以隨意呼叫在你的專案內的方法。" -#: ../../faq/design.rst:294 +#: ../../faq/design.rst:295 msgid "" "Can't you emulate threads in the interpreter instead of relying on an OS-" "specific thread implementation?" msgstr "為何不能在直譯器上模擬執行緒,而要使用作業系統的特定實作方式?" -#: ../../faq/design.rst:296 +#: ../../faq/design.rst:297 msgid "" "Answer 1: Unfortunately, the interpreter pushes at least one C stack frame " "for each Python stack frame. Also, extensions can call back into Python at " @@ -514,7 +516,7 @@ msgstr "" "的堆疊框。同時,擴充套件可以隨時呼叫 Python,因此完整的實作必須要支援 C 的執" "行緒。" -#: ../../faq/design.rst:301 +#: ../../faq/design.rst:302 msgid "" "Answer 2: Fortunately, there is `Stackless Python `_, which has a completely redesigned " @@ -523,11 +525,11 @@ msgstr "" "答案二:幸運地,`無堆疊 (Stackless) Python `_ 完全重新設計了直譯器迴圈,並避免了 C 堆疊。" -#: ../../faq/design.rst:306 +#: ../../faq/design.rst:307 msgid "Why can't lambda expressions contain statements?" msgstr "為何 lambda 運算式不能包含陳述式?" -#: ../../faq/design.rst:308 +#: ../../faq/design.rst:309 msgid "" "Python lambda expressions cannot contain statements because Python's " "syntactic framework can't handle statements nested inside expressions. " @@ -540,7 +542,7 @@ msgstr "" "立功能的 lambda,Python 的 lambda 只是一個在你懶得定義函式時可用的一個簡寫表" "達法。" -#: ../../faq/design.rst:314 +#: ../../faq/design.rst:315 msgid "" "Functions are already first class objects in Python, and can be declared in " "a local scope. Therefore the only advantage of using a lambda instead of a " @@ -553,11 +555,11 @@ msgstr "" "宣告。因此唯一用 lambda 而非區域性的函式的優點就是你不需要多想一個函式名稱 — " "但這樣就會是一個區域變數被指定成函式物件(和 lambda 運算式的結果同類)!" -#: ../../faq/design.rst:322 +#: ../../faq/design.rst:323 msgid "Can Python be compiled to machine code, C or some other language?" msgstr "Python 可以被編譯成機器語言、C 語言或其他種語言嗎?" -#: ../../faq/design.rst:324 +#: ../../faq/design.rst:325 msgid "" "`Cython `_ compiles a modified version of Python with " "optional annotations into C extensions. `Nuitka `_ " @@ -568,11 +570,11 @@ msgstr "" "本。 `Nuitka `_ 是一個有潛力編譯器,可以把 Python 編" "譯成 C++,他的目標是支援完整的 Python 語言。" -#: ../../faq/design.rst:331 +#: ../../faq/design.rst:332 msgid "How does Python manage memory?" msgstr "Python 如何管理記憶體?" -#: ../../faq/design.rst:333 +#: ../../faq/design.rst:334 msgid "" "The details of Python memory management depend on the implementation. The " "standard implementation of Python, :term:`CPython`, uses reference counting " @@ -588,7 +590,7 @@ msgstr "" "件。 :mod:`gc` 模組提供了可以執行垃圾收集、抓取除錯統計數據和調整收集器參數的" "函式。" -#: ../../faq/design.rst:341 +#: ../../faq/design.rst:342 msgid "" "Other implementations (such as `Jython `_ or `PyPy " "`_), however, can rely on a different mechanism such " @@ -600,7 +602,7 @@ msgstr "" "www.pypy.org>`_)中,會使用像是成熟的垃圾收集器等不同機制。如果你的 Python 程" "式碼的表現取決於參照計次的實作,這個相異處會導致一些微小的移植問題。" -#: ../../faq/design.rst:347 +#: ../../faq/design.rst:348 msgid "" "In some Python implementations, the following code (which is fine in " "CPython) will probably run out of file descriptors::" @@ -610,18 +612,19 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:354 +#: ../../faq/design.rst:355 +#, fuzzy msgid "" "Indeed, using CPython's reference counting and destructor scheme, each new " -"assignment to *f* closes the previous file. With a traditional GC, however, " -"those file objects will only get collected (and closed) at varying and " -"possibly long intervals." +"assignment to ``f`` closes the previous file. With a traditional GC, " +"however, those file objects will only get collected (and closed) at varying " +"and possibly long intervals." msgstr "" "實際上,使用 CPython 的參照計次和解構方案 (destructor scheme),每個對\\ " "*f*\\ 的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 (GC) 的話,這些檔" "案物件只會在不固定且有可能很長的時間後被收集(並關閉)。" -#: ../../faq/design.rst:359 +#: ../../faq/design.rst:360 msgid "" "If you want to write code that will work with any Python implementation, you " "should explicitly close the file or use the :keyword:`with` statement; this " @@ -633,11 +636,11 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:369 +#: ../../faq/design.rst:370 msgid "Why doesn't CPython use a more traditional garbage collection scheme?" msgstr "為何 CPython 不使用更多傳統的垃圾回收機制?" -#: ../../faq/design.rst:371 +#: ../../faq/design.rst:372 msgid "" "For one thing, this is not a C standard feature and hence it's not portable. " "(Yes, we know about the Boehm GC library. It has bits of assembler code for " @@ -649,14 +652,16 @@ msgstr "" "庫。他有可相容於\\ *大多數*\\ 平台的組合語言程式碼,但依然不是全部,而即便它" "大多數是通透的,也並不完全,要讓它跟 Python 相容還是需要做一些修補。)" -#: ../../faq/design.rst:377 +#: ../../faq/design.rst:378 +#, fuzzy msgid "" "Traditional GC also becomes a problem when Python is embedded into other " "applications. While in a standalone Python it's fine to replace the " -"standard malloc() and free() with versions provided by the GC library, an " -"application embedding Python may want to have its *own* substitute for " -"malloc() and free(), and may not want Python's. Right now, CPython works " -"with anything that implements malloc() and free() properly." +"standard ``malloc()`` and ``free()`` with versions provided by the GC " +"library, an application embedding Python may want to have its *own* " +"substitute for ``malloc()`` and ``free()``, and may not want Python's. " +"Right now, CPython works with anything that implements ``malloc()`` and " +"``free()`` properly." msgstr "" "傳統的垃圾收集 (GC) 在 Python 被嵌入其他應用程式時也成了一個問題。在獨立的 " "Python 程式裡當然可以把標準的 malloc() 和 free() 換成 GC 函式庫提供的其他版" @@ -664,11 +669,11 @@ msgstr "" "代品,而不是用 Python 的。以現在來說,CPython 和實作 malloc() 和 free() 的程" "式相處融洽。" -#: ../../faq/design.rst:386 +#: ../../faq/design.rst:387 msgid "Why isn't all memory freed when CPython exits?" msgstr "當 CPython 結束時,為何所有的記憶體不會被釋放?" -#: ../../faq/design.rst:388 +#: ../../faq/design.rst:389 msgid "" "Objects referenced from the global namespaces of Python modules are not " "always deallocated when Python exits. This may happen if there are circular " @@ -682,7 +687,7 @@ msgstr "" "(例如:像是 Purify 之類的工具會抱怨)。然而,Python 在關閉的時候會積極清理記" "憶體並嘗試刪除每個物件。" -#: ../../faq/design.rst:395 +#: ../../faq/design.rst:396 msgid "" "If you want to force Python to delete certain things on deallocation use " "the :mod:`atexit` module to run a function that will force those deletions." @@ -690,38 +695,40 @@ msgstr "" "如果你想要強迫 Python 在釋放記憶體時刪除特定的東西,你可以用 :mod:`atexit` 模" "組來執行會強制刪除的函式。" -#: ../../faq/design.rst:400 +#: ../../faq/design.rst:401 msgid "Why are there separate tuple and list data types?" msgstr "為何要把元組 (tuple) 和串列 (list) 分成兩個資料型態?" -#: ../../faq/design.rst:402 +#: ../../faq/design.rst:403 +#, fuzzy msgid "" "Lists and tuples, while similar in many respects, are generally used in " "fundamentally different ways. Tuples can be thought of as being similar to " -"Pascal records or C structs; they're small collections of related data which " -"may be of different types which are operated on as a group. For example, a " -"Cartesian coordinate is appropriately represented as a tuple of two or three " -"numbers." +"Pascal ``records`` or C ``structs``; they're small collections of related " +"data which may be of different types which are operated on as a group. For " +"example, a Cartesian coordinate is appropriately represented as a tuple of " +"two or three numbers." msgstr "" "串列和元組在很多方面相當相似,但通常用在完全不同的地方。元組可以想成 Pascal " "的紀錄 (record) 或是 C 的結構 (struct),是一小群相關聯但可能是不同型別的資料" "集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個有" "二或三個值的元組。" -#: ../../faq/design.rst:409 +#: ../../faq/design.rst:410 +#, fuzzy msgid "" "Lists, on the other hand, are more like arrays in other languages. They " "tend to hold a varying number of objects all of which have the same type and " -"which are operated on one-by-one. For example, ``os.listdir('.')`` returns " -"a list of strings representing the files in the current directory. " -"Functions which operate on this output would generally not break if you " -"added another file or two to the directory." +"which are operated on one-by-one. For example, :func:`os.listdir('.') ` returns a list of strings representing the files in the current " +"directory. Functions which operate on this output would generally not break " +"if you added another file or two to the directory." msgstr "" "另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為" "逐項操作。舉例來說,``os.listdir('.')`` 回傳當下目錄裡的檔案,以包含字串的串" "列表示。如果你新增了幾個檔案到這個目錄,一般來說操作結果的函式也會正常運作。" -#: ../../faq/design.rst:416 +#: ../../faq/design.rst:418 msgid "" "Tuples are immutable, meaning that once a tuple has been created, you can't " "replace any of its elements with a new value. Lists are mutable, meaning " @@ -733,11 +740,11 @@ msgstr "" "可變,所以你可以改變裡面的元素。只有不可變的元素可以成為字典的鍵,所以只能把" "元組當成鍵,而串列則不行。" -#: ../../faq/design.rst:423 +#: ../../faq/design.rst:425 msgid "How are lists implemented in CPython?" msgstr "串列 (list) 在 CPython 中是怎麼實作的?" -#: ../../faq/design.rst:425 +#: ../../faq/design.rst:427 msgid "" "CPython's lists are really variable-length arrays, not Lisp-style linked " "lists. The implementation uses a contiguous array of references to other " @@ -748,13 +755,13 @@ msgstr "" "接串列 (linked list)。實作上,他是一個連續的物件參照 (reference) 陣列,並把指" "向此陣列的指標 (pointer) 和陣列長度存在串列的標頭結構內。" -#: ../../faq/design.rst:429 +#: ../../faq/design.rst:431 msgid "" "This makes indexing a list ``a[i]`` an operation whose cost is independent " "of the size of the list or the value of the index." msgstr "因此,用索引來找串列特定項 ``a[i]`` 的代價和串列大小或是索引值無關。" -#: ../../faq/design.rst:432 +#: ../../faq/design.rst:434 msgid "" "When items are appended or inserted, the array of references is resized. " "Some cleverness is applied to improve the performance of appending items " @@ -765,11 +772,11 @@ msgstr "" "用一些巧妙的方法,當陣列必須變大時,會多收集一些額外的空間,接下來幾次新增時" "就不需要再調整大小了。" -#: ../../faq/design.rst:439 +#: ../../faq/design.rst:441 msgid "How are dictionaries implemented in CPython?" msgstr "字典 (dictionaries) 在 CPython 中是怎麼實作的?" -#: ../../faq/design.rst:441 +#: ../../faq/design.rst:443 msgid "" "CPython's dictionaries are implemented as resizable hash tables. Compared " "to B-trees, this gives better performance for lookup (the most common " @@ -779,17 +786,18 @@ msgstr "" "CPython 的字典是用可調整大小的雜湊表 (hash table) 實作的。比起 B 樹 (B-" "tree),在搜尋(目前為止最常見的操作)方面有更好的表現,實作上也較為簡單。" -#: ../../faq/design.rst:445 +#: ../../faq/design.rst:447 +#, fuzzy msgid "" "Dictionaries work by computing a hash code for each key stored in the " "dictionary using the :func:`hash` built-in function. The hash code varies " -"widely depending on the key and a per-process seed; for example, \"Python\" " -"could hash to -539294296 while \"python\", a string that differs by a single " -"bit, could hash to 1142331976. The hash code is then used to calculate a " -"location in an internal array where the value will be stored. Assuming that " -"you're storing keys that all have different hash values, this means that " -"dictionaries take constant time -- O(1), in Big-O notation -- to retrieve a " -"key." +"widely depending on the key and a per-process seed; for example, " +"``'Python'`` could hash to ``-539294296`` while ``'python'``, a string that " +"differs by a single bit, could hash to ``1142331976``. The hash code is " +"then used to calculate a location in an internal array where the value will " +"be stored. Assuming that you're storing keys that all have different hash " +"values, this means that dictionaries take constant time -- O(1), in Big-O " +"notation -- to retrieve a key." msgstr "" "字典利用內建 :func:`hash` 函式,對每個鍵做雜湊計算。雜湊結果依據鍵的值和個別" "執行緒 (processes) 的種子而有相當大的差距。例如,\"Python\" 的雜湊是 " @@ -797,11 +805,11 @@ msgstr "" "值在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要常數時間 — " "用大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" -#: ../../faq/design.rst:456 +#: ../../faq/design.rst:458 msgid "Why must dictionary keys be immutable?" msgstr "為何字典的鍵一定是不可變的?" -#: ../../faq/design.rst:458 +#: ../../faq/design.rst:460 msgid "" "The hash table implementation of dictionaries uses a hash value calculated " "from the key value to find the key. If the key were a mutable object, its " @@ -819,7 +827,7 @@ msgstr "" "值不同的緣故,你找不到他。而如果你嘗試用舊的值去尋找,也一樣找不到,因為他的" "雜湊結果和原先物件不同。" -#: ../../faq/design.rst:467 +#: ../../faq/design.rst:469 msgid "" "If you want a dictionary indexed with a list, simply convert the list to a " "tuple first; the function ``tuple(L)`` creates a tuple with the same entries " @@ -829,11 +837,11 @@ msgstr "" "如果你想要用串列作為字典的索引,把他轉換成元組即可。``tuple(L)`` 函式會建立一" "個和串列 ``L`` 一樣內容的元組。而元組是不可變的,所以可以用來當成字典的鍵。" -#: ../../faq/design.rst:471 +#: ../../faq/design.rst:473 msgid "Some unacceptable solutions that have been proposed:" msgstr "也有人提出一些不能接受的方法:" -#: ../../faq/design.rst:473 +#: ../../faq/design.rst:475 msgid "" "Hash lists by their address (object ID). This doesn't work because if you " "construct a new list with the same value it won't be found; e.g.::" @@ -843,7 +851,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:479 +#: ../../faq/design.rst:481 msgid "" "would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " "used in the second line differs from that in the first line. In other " @@ -853,7 +861,7 @@ msgstr "" "這將會導致 :exc:`KeyError` 例外,因為 ``[1, 2]`` 的 id 在第一行和第二行是不同" "的。換句話說,字典的鍵應該要用 ``==`` 來做比較,而不是用 :keyword:`is`。" -#: ../../faq/design.rst:483 +#: ../../faq/design.rst:485 msgid "" "Make a copy when using a list as a key. This doesn't work because the list, " "being a mutable object, could contain a reference to itself, and then the " @@ -862,7 +870,7 @@ msgstr "" "複製一個串列作為鍵。這一樣不會成功,因為串列是可變的,他可以包含自己的參照," "所以複製會形成一個無窮迴圈。" -#: ../../faq/design.rst:487 +#: ../../faq/design.rst:489 msgid "" "Allow lists as keys but tell the user not to modify them. This would allow " "a class of hard-to-track bugs in programs when you forgot or modified a list " @@ -873,7 +881,7 @@ msgstr "" "產生一種難以追蹤的 bug。他同時也違背了一項字典的重要定則:在 ``d.keys()`` 的" "每個值都可以當成字典的鍵。" -#: ../../faq/design.rst:492 +#: ../../faq/design.rst:494 msgid "" "Mark lists as read-only once they are used as a dictionary key. The problem " "is that it's not just the top-level object that could change its value; you " @@ -886,14 +894,15 @@ msgstr "" "值,就像用元組包含串列來做為鍵。把一個物件當成鍵,需要將從他開始可以接觸到的" "所有物件都標記成只能讀取 — 所以再一次,自己參照自己的物件會導致無窮迴圈。" -#: ../../faq/design.rst:498 +#: ../../faq/design.rst:500 +#, fuzzy msgid "" "There is a trick to get around this if you need to, but use it at your own " "risk: You can wrap a mutable structure inside a class instance which has " -"both a :meth:`__eq__` and a :meth:`__hash__` method. You must then make " -"sure that the hash value for all such wrapper objects that reside in a " -"dictionary (or other hash based structure), remain fixed while the object is " -"in the dictionary (or other structure). ::" +"both a :meth:`~object.__eq__` and a :meth:`~object.__hash__` method. You " +"must then make sure that the hash value for all such wrapper objects that " +"reside in a dictionary (or other hash based structure), remain fixed while " +"the object is in the dictionary (or other structure). ::" msgstr "" "如果你需要的話,這裡有個小技巧可以幫你,但請自己承擔風險:你可以把一個可變物" "件包裝進一個有 :meth:`__eq__` 和 :meth:`__hash__` 方法的類別實例。只要這種包" @@ -902,7 +911,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:522 +#: ../../faq/design.rst:525 msgid "" "Note that the hash computation is complicated by the possibility that some " "members of the list may be unhashable and also by the possibility of " @@ -911,7 +920,7 @@ msgstr "" "請注意,雜湊的計算可能變得複雜,因為有串列成員不可雜湊 (unhashable) 和算術溢" "位的可能性。" -#: ../../faq/design.rst:526 +#: ../../faq/design.rst:529 msgid "" "Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1." "__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == " @@ -924,22 +933,23 @@ msgstr "" "__hash__()``),這個事實必須要成立。如果無法滿足這項限制,那字典和其他用雜湊" "為基底的結構會出現不正常的行為。" -#: ../../faq/design.rst:531 +#: ../../faq/design.rst:534 +#, fuzzy msgid "" -"In the case of ListWrapper, whenever the wrapper object is in a dictionary " -"the wrapped list must not change to avoid anomalies. Don't do this unless " -"you are prepared to think hard about the requirements and the consequences " -"of not meeting them correctly. Consider yourself warned." +"In the case of :class:`!ListWrapper`, whenever the wrapper object is in a " +"dictionary the wrapped list must not change to avoid anomalies. Don't do " +"this unless you are prepared to think hard about the requirements and the " +"consequences of not meeting them correctly. Consider yourself warned." msgstr "" "至於 ListWrapper,只要這個包裝過的物件在字典中,裡面的串列就不能改變以避免不" "正常的事情發生。除非你已經謹慎思考過你的需求和無法滿足條件的後果,不然請不要" "這麼做。請自行注意。" -#: ../../faq/design.rst:538 +#: ../../faq/design.rst:541 msgid "Why doesn't list.sort() return the sorted list?" msgstr "為何 list.sort() 不是回傳排序過的串列?" -#: ../../faq/design.rst:540 +#: ../../faq/design.rst:543 msgid "" "In situations where performance matters, making a copy of the list just to " "sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in " @@ -952,7 +962,7 @@ msgstr "" "列裡做排序。為了提醒你這件事,他不會回傳排序過的串列。這樣一來,當你需要排序" "過和未排序過的串列時,你就不會被誤導而不小心覆蓋掉串列。" -#: ../../faq/design.rst:546 +#: ../../faq/design.rst:549 msgid "" "If you want to return a new list, use the built-in :func:`sorted` function " "instead. This function creates a new list from a provided iterable, sorts " @@ -965,11 +975,11 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:556 +#: ../../faq/design.rst:559 msgid "How do you specify and enforce an interface spec in Python?" msgstr "如何在 Python 中指定和強制使用一個介面規範 (interface spec)?" -#: ../../faq/design.rst:558 +#: ../../faq/design.rst:561 msgid "" "An interface specification for a module as provided by languages such as C++ " "and Java describes the prototypes for the methods and functions of the " @@ -979,7 +989,7 @@ msgstr "" "像是 C++ 和 Java 等語言提供了模組的介面規範,他描述了該模組的方法和函式的原" "型。很多人認為這種在編譯時強制執行的介面規範在建構大型程式時十分有幫助。" -#: ../../faq/design.rst:563 +#: ../../faq/design.rst:566 msgid "" "Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base " "Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` " @@ -994,13 +1004,13 @@ msgstr "" "系列好用的抽象基底類別,像是 :class:`~collections.abc.Iterable`、:class:" "`~collections.abc.Container` 和 :class:`~collections.abc.MutableMapping`。" -#: ../../faq/design.rst:570 +#: ../../faq/design.rst:573 msgid "" "For Python, many of the advantages of interface specifications can be " "obtained by an appropriate test discipline for components." msgstr "對 Python 來說,很多介面規範的優點可以用對元件適當的測試規則來達到。" -#: ../../faq/design.rst:573 +#: ../../faq/design.rst:576 msgid "" "A good test suite for a module can both provide a regression test and serve " "as a module interface specification and a set of examples. Many Python " @@ -1017,15 +1027,17 @@ msgstr "" "模擬來獨立測試。:mod:`doctest` 和 :mod:`unittest` 模組或第三方的測試框架可以" "用來建構詳盡徹底的測試套件來測試模組裡的每一行程式碼。" -#: ../../faq/design.rst:581 +#: ../../faq/design.rst:584 +#, fuzzy msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " "be better because an interface specification cannot test certain properties " -"of a program. For example, the :meth:`append` method is expected to add new " -"elements to the end of some internal list; an interface specification cannot " -"test that your :meth:`append` implementation will actually do this " -"correctly, but it's trivial to check this property in a test suite." +"of a program. For example, the :meth:`list.append` method is expected to " +"add new elements to the end of some internal list; an interface " +"specification cannot test that your :meth:`list.append` implementation will " +"actually do this correctly, but it's trivial to check this property in a " +"test suite." msgstr "" "就像介面規範一樣,一個適當的測試規則在建造大型又複雜的 Python 應用程式時可以" "幫上忙。事實上,他可能可以有更好的表現,因為介面規範無法測試程式的特定屬性。" @@ -1033,7 +1045,7 @@ msgstr "" "規範沒辦法測試你的 :meth:`append` 是不是真的有正確的實作,但這在測試套件裡是" "件很簡單的事。" -#: ../../faq/design.rst:589 +#: ../../faq/design.rst:592 msgid "" "Writing test suites is very helpful, and you might want to design your code " "to make it easily tested. One increasingly popular technique, test-driven " @@ -1045,18 +1057,20 @@ msgstr "" "(test-driven development) 是一個越來越受歡迎的設計方法,他要求先完成部分的測" "試套件,再去撰寫真的要用的程式碼。當然 Python 也允許你草率地不寫任何測試。" -#: ../../faq/design.rst:597 +#: ../../faq/design.rst:600 msgid "Why is there no goto?" msgstr "為何沒有 goto 語法?" -#: ../../faq/design.rst:599 +#: ../../faq/design.rst:602 +#, fuzzy msgid "" "In the 1970s people realized that unrestricted goto could lead to messy " "\"spaghetti\" code that was hard to understand and revise. In a high-level " "language, it is also unneeded as long as there are ways to branch (in " -"Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` " -"expressions) and loop (with ``while`` and ``for`` statements, possibly " -"containing ``continue`` and ``break``)." +"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, " +"and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:" +"`while` and :keyword:`for` statements, possibly containing :keyword:" +"`continue` and :keyword:`break`)." msgstr "" "在 1970 年代,人們了解到沒有限制的 goto 會導致混亂、難以理解和修改的「義大利" "麵」程式碼 (\"spaghetti\" code)。在高階語言裡,這也是不需要的,因為有方法可以" @@ -1064,11 +1078,12 @@ msgstr "" "else`` 運算式)和迴圈(用 ``while`` 和 ``for`` 陳述式,可能會有 ``continue`` " "和 ``break``)。" -#: ../../faq/design.rst:606 +#: ../../faq/design.rst:609 +#, fuzzy msgid "" "One can also use exceptions to provide a \"structured goto\" that works even " "across function calls. Many feel that exceptions can conveniently emulate " -"all reasonable uses of the \"go\" or \"goto\" constructs of C, Fortran, and " +"all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and " "other languages. For example::" msgstr "" "我們也可以用例外來做「結構化的 goto」,這甚至可以跨函式呼叫。很多人覺得例外可" @@ -1077,17 +1092,18 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:622 +#: ../../faq/design.rst:625 +#, fuzzy msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " -"considered an abuse of goto anyway. Use sparingly." +"considered an abuse of ``goto`` anyway. Use sparingly." msgstr "這依然不能讓你跳進迴圈內,這通常被認為是對 goto 的濫用。請小心使用。" -#: ../../faq/design.rst:627 +#: ../../faq/design.rst:630 msgid "Why can't raw strings (r-strings) end with a backslash?" msgstr "為何純字串 (r-string) 不能以反斜線結尾?" -#: ../../faq/design.rst:629 +#: ../../faq/design.rst:632 msgid "" "More precisely, they can't end with an odd number of backslashes: the " "unpaired backslash at the end escapes the closing quote character, leaving " @@ -1096,7 +1112,7 @@ msgstr "" "更精確地來說,他不能以奇數個反斜線結尾:尾端未配對的反斜線會使結尾的引號被轉" "義 (escapes),變成一個未結束的字串。" -#: ../../faq/design.rst:633 +#: ../../faq/design.rst:636 msgid "" "Raw strings were designed to ease creating input for processors (chiefly " "regular expression engines) that want to do their own backslash escape " @@ -1110,7 +1126,7 @@ msgstr "" "此。相對地,他讓你用一個反斜線轉義引號。這些規則在他們預想的目的上正常地運" "作。" -#: ../../faq/design.rst:640 +#: ../../faq/design.rst:643 msgid "" "If you're trying to build Windows pathnames, note that all Windows system " "calls accept forward slashes too::" @@ -1119,7 +1135,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:645 +#: ../../faq/design.rst:648 msgid "" "If you're trying to build a pathname for a DOS command, try e.g. one of ::" msgstr "" @@ -1127,14 +1143,15 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:653 +#: ../../faq/design.rst:656 msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "為何 Python 沒有屬性賦值的 with 陳述式?" -#: ../../faq/design.rst:655 +#: ../../faq/design.rst:658 +#, fuzzy msgid "" -"Python has a 'with' statement that wraps the execution of a block, calling " -"code on the entrance and exit from the block. Some languages have a " +"Python has a :keyword:`with` statement that wraps the execution of a block, " +"calling code on the entrance and exit from the block. Some languages have a " "construct that looks like this::" msgstr "" "Python 的 with 陳述式包裝了一區塊程式的執行,在進入和離開該區塊時執行程式碼。" @@ -1142,11 +1159,11 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:663 +#: ../../faq/design.rst:666 msgid "In Python, such a construct would be ambiguous." msgstr "但在 Python,這種結構是模糊的。" -#: ../../faq/design.rst:665 +#: ../../faq/design.rst:668 msgid "" "Other languages, such as Object Pascal, Delphi, and C++, use static types, " "so it's possible to know, in an unambiguous way, what member is being " @@ -1157,7 +1174,7 @@ msgstr "" "以清楚地知道是哪一個成員被指派值。這是靜態型別的重點 — 在編譯的時候,編譯器" "\\ *永遠*\\ 都知道每個變數的作用域 (scope)。" -#: ../../faq/design.rst:670 +#: ../../faq/design.rst:673 msgid "" "Python uses dynamic types. It is impossible to know in advance which " "attribute will be referenced at runtime. Member attributes may be added or " @@ -1169,45 +1186,47 @@ msgstr "" "員屬性可能在執行時從物件中被新增或移除。這使得如果簡單來看的話,我們無法得知" "以下哪個屬性會被使用:區域的、全域的、或是成員屬性?" -#: ../../faq/design.rst:676 +#: ../../faq/design.rst:679 msgid "For instance, take the following incomplete snippet::" msgstr "" "以下列不完整的程式碼為例:\n" "\n" "::" -#: ../../faq/design.rst:682 +#: ../../faq/design.rst:685 +#, fuzzy msgid "" -"The snippet assumes that \"a\" must have a member attribute called \"x\". " +"The snippet assumes that ``a`` must have a member attribute called ``x``. " "However, there is nothing in Python that tells the interpreter this. What " -"should happen if \"a\" is, let us say, an integer? If there is a global " -"variable named \"x\", will it be used inside the with block? As you see, " -"the dynamic nature of Python makes such choices much harder." +"should happen if ``a`` is, let us say, an integer? If there is a global " +"variable named ``x``, will it be used inside the :keyword:`with` block? As " +"you see, the dynamic nature of Python makes such choices much harder." msgstr "" "這段程式碼假設「a」有一個叫做「x」的成員屬性。然後,Python 裡並沒有任何跡象告" "訴直譯器這件事。在假設「a」是一個整數的話,那會發生什麼事?如果有一個全域變數" "稱為「x」,那在這個 with 區塊會被使用嗎?如你所見,Python 動態的天性使得這種" "選擇更加困難。" -#: ../../faq/design.rst:688 +#: ../../faq/design.rst:691 +#, fuzzy msgid "" -"The primary benefit of \"with\" and similar language features (reduction of " -"code volume) can, however, easily be achieved in Python by assignment. " -"Instead of::" +"The primary benefit of :keyword:`with` and similar language features " +"(reduction of code volume) can, however, easily be achieved in Python by " +"assignment. Instead of::" msgstr "" "然而,with 陳述式或類似的語言特性(減少程式碼量)的主要好處可以透過賦值來達" "成。相較於這樣寫:\n" "\n" "::" -#: ../../faq/design.rst:695 +#: ../../faq/design.rst:698 msgid "write this::" msgstr "" "應該寫成這樣:\n" "\n" "::" -#: ../../faq/design.rst:702 +#: ../../faq/design.rst:705 msgid "" "This also has the side-effect of increasing execution speed because name " "bindings are resolved at run-time in Python, and the second version only " @@ -1216,26 +1235,35 @@ msgstr "" "這也有提升執行速度的副作用,因為 Python 的名稱綁定解析會在執行的時候發生,而" "第二版只需要執行解析一次即可。" -#: ../../faq/design.rst:708 +#: ../../faq/design.rst:709 +msgid "" +"Similar proposals that would introduce syntax to further reduce code volume, " +"such as using a 'leading dot', have been rejected in favour of explicitness " +"(see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." +msgstr "" + +#: ../../faq/design.rst:715 msgid "Why don't generators support the with statement?" msgstr "為何產生器 (generator) 不支援 with 陳述式?" -#: ../../faq/design.rst:710 +#: ../../faq/design.rst:717 +#, fuzzy msgid "" "For technical reasons, a generator used directly as a context manager would " "not work correctly. When, as is most common, a generator is used as an " -"iterator run to completion, no closing is needed. When it is, wrap it as " -"\"contextlib.closing(generator)\" in the 'with' statement." +"iterator run to completion, no closing is needed. When it is, wrap it as :" +"func:`contextlib.closing(generator) ` in the :keyword:" +"`with` statement." msgstr "" "出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常來" "說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你需" "要的話,你可以在 with 陳述式裡用「contextlib.closing(generator)」來包裝他。" -#: ../../faq/design.rst:717 +#: ../../faq/design.rst:725 msgid "Why are colons required for the if/while/def/class statements?" msgstr "為何 if、while、def、class 陳述式裡需要冒號?" -#: ../../faq/design.rst:719 +#: ../../faq/design.rst:727 msgid "" "The colon is required primarily to enhance readability (one of the results " "of the experimental ABC language). Consider this::" @@ -1244,14 +1272,14 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:725 +#: ../../faq/design.rst:733 msgid "versus ::" msgstr "" "以及:\n" "\n" "::" -#: ../../faq/design.rst:730 +#: ../../faq/design.rst:738 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " "colon sets off the example in this FAQ answer; it's a standard usage in " @@ -1260,7 +1288,7 @@ msgstr "" "注意第二個例子稍微易讀一些的原因。可以更進一步觀察,一個冒號是如何放在這個 " "FAQ 答案的例子裡的,這是標準的英文用法。" -#: ../../faq/design.rst:733 +#: ../../faq/design.rst:741 msgid "" "Another minor reason is that the colon makes it easier for editors with " "syntax highlighting; they can look for colons to decide when indentation " @@ -1270,11 +1298,11 @@ msgstr "" "另一個小原因是冒號會使編輯器更容易做語法突顯,他們只需要看冒號的位置就可以決" "定是否需要更多縮排,而不用做更多繁複精密的程式碼剖析。" -#: ../../faq/design.rst:739 +#: ../../faq/design.rst:747 msgid "Why does Python allow commas at the end of lists and tuples?" msgstr "為何 Python 允許在串列和元組末端加上逗號?" -#: ../../faq/design.rst:741 +#: ../../faq/design.rst:749 msgid "" "Python lets you add a trailing comma at the end of lists, tuples, and " "dictionaries::" @@ -1283,11 +1311,11 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:752 +#: ../../faq/design.rst:760 msgid "There are several reasons to allow this." msgstr "這有許多原因可被允許。" -#: ../../faq/design.rst:754 +#: ../../faq/design.rst:762 msgid "" "When you have a literal value for a list, tuple, or dictionary spread across " "multiple lines, it's easier to add more elements because you don't have to " @@ -1297,7 +1325,7 @@ msgstr "" "當你要把串列、元組或字典的值寫成多行時,這樣做會讓你新增元素時較為方便,因為" "你不需要在前一行加上逗號。這幾行的值也可以被重新排序,而不會導致語法錯誤。" -#: ../../faq/design.rst:759 +#: ../../faq/design.rst:767 msgid "" "Accidentally omitting the comma can lead to errors that are hard to " "diagnose. For example::" @@ -1306,7 +1334,7 @@ msgstr "" "\n" "::" -#: ../../faq/design.rst:769 +#: ../../faq/design.rst:777 msgid "" "This list looks like it has four elements, but it actually contains three: " "\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source " @@ -1315,7 +1343,7 @@ msgstr "" "這個串列看起來有四個元素,但他其實只有三個:「fee」、「fiefoo」、「fum」。永" "遠記得加上逗號以避免這種錯誤。" -#: ../../faq/design.rst:772 +#: ../../faq/design.rst:780 msgid "" "Allowing the trailing comma may also make programmatic code generation " "easier." diff --git a/howto/argparse.po b/howto/argparse.po index ed45cbc336..4cf5f8be9d 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgid "author" msgstr "作者" #: ../../howto/argparse.rst:7 -msgid "Tshepang Lekhonkhobe" -msgstr "Tshepang Lekhonkhobe" +msgid "Tshepang Mbambo" +msgstr "" #: ../../howto/argparse.rst:11 msgid "" @@ -514,11 +514,22 @@ msgid "" "display *more* text instead::" msgstr "" -#: ../../howto/argparse.rst:670 +#: ../../howto/argparse.rst:672 +msgid "Specifying ambiguous arguments" +msgstr "" + +#: ../../howto/argparse.rst:674 +msgid "" +"When there is ambiguity in deciding whether an argument is positional or for " +"an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " +"that everything after that is a positional argument::" +msgstr "" + +#: ../../howto/argparse.rst:699 msgid "Conflicting options" msgstr "" -#: ../../howto/argparse.rst:672 +#: ../../howto/argparse.rst:701 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" @@ -528,20 +539,20 @@ msgid "" "``--quiet`` option, which will be the opposite of the ``--verbose`` one::" msgstr "" -#: ../../howto/argparse.rst:698 +#: ../../howto/argparse.rst:727 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" msgstr "" -#: ../../howto/argparse.rst:716 +#: ../../howto/argparse.rst:745 msgid "" "That should be easy to follow. I've added that last output so you can see " "the sort of flexibility you get, i.e. mixing long form options with short " "form ones." msgstr "" -#: ../../howto/argparse.rst:720 +#: ../../howto/argparse.rst:749 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" @@ -551,18 +562,18 @@ msgstr "" "\n" "::" -#: ../../howto/argparse.rst:741 +#: ../../howto/argparse.rst:770 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " "tells us that we can either use ``-v`` or ``-q``, but not both at the same " "time:" msgstr "" -#: ../../howto/argparse.rst:763 +#: ../../howto/argparse.rst:792 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:765 +#: ../../howto/argparse.rst:794 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " @@ -570,3 +581,6 @@ msgid "" msgstr "" ":mod:`argparse` 模組提供了比這裡展示更多的功能。它的文件是非常全面詳細且充滿" "了例子。通過本教學,你應該比較容易消化它們了。" + +#~ msgid "Tshepang Lekhonkhobe" +#~ msgstr "Tshepang Lekhonkhobe" diff --git a/howto/clinic.po b/howto/clinic.po index a9b49c94fd..fbeec38dc0 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-18 15:00+0000\n" +"POT-Creation-Date: 2023-07-19 00:54+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -561,67 +561,77 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:545 +msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" +msgstr "" + +#: ../../howto/clinic.rst:549 +msgid "" +"If it does, you'll have to run ``Tools/scripts/generate_global_objects.py`` " +"to regenerate the list of precompiled identifiers at this point." +msgstr "" + +#: ../../howto/clinic.rst:553 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:549 +#: ../../howto/clinic.rst:557 msgid "" "Well, except for one difference: ``inspect.signature()`` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:552 +#: ../../howto/clinic.rst:560 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:556 +#: ../../howto/clinic.rst:564 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:560 +#: ../../howto/clinic.rst:568 msgid "How to use symbolic default values" msgstr "" -#: ../../howto/clinic.rst:562 +#: ../../howto/clinic.rst:570 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:565 +#: ../../howto/clinic.rst:573 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:566 +#: ../../howto/clinic.rst:574 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:567 +#: ../../howto/clinic.rst:575 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:568 +#: ../../howto/clinic.rst:576 msgid "" "Simple symbolic constants like ``sys.maxsize``, which must start with the " "name of the module" msgstr "" -#: ../../howto/clinic.rst:571 +#: ../../howto/clinic.rst:579 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:576 +#: ../../howto/clinic.rst:584 msgid "How to to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:578 +#: ../../howto/clinic.rst:586 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -633,19 +643,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:586 +#: ../../howto/clinic.rst:594 msgid "" "For example, if we wanted to rename the C function names generated for " "``pickle.Pickler.dump``, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:594 +#: ../../howto/clinic.rst:602 msgid "" "The base function would now be named ``pickler_dumper()``, and the impl " "function would now be named ``pickler_dumper_impl()``." msgstr "" -#: ../../howto/clinic.rst:598 +#: ../../howto/clinic.rst:606 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -653,21 +663,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:612 +#: ../../howto/clinic.rst:620 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be ``file``, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:615 +#: ../../howto/clinic.rst:623 msgid "You can use this to rename the ``self`` parameter too!" msgstr "" -#: ../../howto/clinic.rst:619 +#: ../../howto/clinic.rst:627 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:621 +#: ../../howto/clinic.rst:629 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -676,17 +686,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:627 +#: ../../howto/clinic.rst:635 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:632 +#: ../../howto/clinic.rst:640 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:634 +#: ../../howto/clinic.rst:642 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -697,7 +707,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:641 +#: ../../howto/clinic.rst:649 msgid "" "While functions using this approach can often be converted to use :c:func:" "`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -711,7 +721,7 @@ msgid "" "pass in ``x`` you may not pass in ``y`` either.)" msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:661 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -721,7 +731,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:661 +#: ../../howto/clinic.rst:669 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -732,7 +742,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:670 +#: ../../howto/clinic.rst:678 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -741,11 +751,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:699 +#: ../../howto/clinic.rst:707 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:701 +#: ../../howto/clinic.rst:709 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -758,34 +768,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:712 +#: ../../howto/clinic.rst:720 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:715 +#: ../../howto/clinic.rst:723 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:718 +#: ../../howto/clinic.rst:726 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:720 +#: ../../howto/clinic.rst:728 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:725 +#: ../../howto/clinic.rst:733 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:727 +#: ../../howto/clinic.rst:735 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -794,38 +804,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:734 +#: ../../howto/clinic.rst:742 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:738 +#: ../../howto/clinic.rst:746 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:739 +#: ../../howto/clinic.rst:747 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:742 +#: ../../howto/clinic.rst:750 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:746 +#: ../../howto/clinic.rst:754 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:757 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -833,17 +843,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:755 +#: ../../howto/clinic.rst:763 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1329 +#: ../../howto/clinic.rst:771 ../../howto/clinic.rst:1335 msgid "``c_default``" msgstr "``c_default``" -#: ../../howto/clinic.rst:759 +#: ../../howto/clinic.rst:767 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -851,27 +861,37 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:768 +#: ../../howto/clinic.rst:776 msgid "``annotation``" msgstr "``annotation``" -#: ../../howto/clinic.rst:766 +#: ../../howto/clinic.rst:774 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:770 +#: ../../howto/clinic.rst:782 +#, fuzzy +msgid "``unused``" +msgstr "``unsigned_char``" + +#: ../../howto/clinic.rst:779 +msgid "" +"Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." +msgstr "" + +#: ../../howto/clinic.rst:781 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:790 msgid "``accept``" msgstr "``accept``" -#: ../../howto/clinic.rst:774 +#: ../../howto/clinic.rst:785 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -879,68 +899,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:790 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:784 +#: ../../howto/clinic.rst:795 msgid "``bitwise``" msgstr "``bitwise``" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:793 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1343 +#: ../../howto/clinic.rst:800 ../../howto/clinic.rst:1349 msgid "``converter``" msgstr "``converter``" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:798 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:794 +#: ../../howto/clinic.rst:805 msgid "``encoding``" msgstr "``encoding``" -#: ../../howto/clinic.rst:792 +#: ../../howto/clinic.rst:803 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:798 +#: ../../howto/clinic.rst:809 msgid "``subclass_of``" msgstr "``subclass_of``" -#: ../../howto/clinic.rst:797 +#: ../../howto/clinic.rst:808 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1315 +#: ../../howto/clinic.rst:814 ../../howto/clinic.rst:1321 msgid "``type``" msgstr "``type``" -#: ../../howto/clinic.rst:801 +#: ../../howto/clinic.rst:812 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:809 +#: ../../howto/clinic.rst:820 msgid "``zeroes``" msgstr "``zeroes``" -#: ../../howto/clinic.rst:806 +#: ../../howto/clinic.rst:817 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -948,7 +968,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:811 +#: ../../howto/clinic.rst:822 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific ``PyArg_ParseTuple`` *format " @@ -959,350 +979,354 @@ msgid "" "least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:819 +#: ../../howto/clinic.rst:830 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:835 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:835 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:836 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:836 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:837 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:837 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:838 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:827 +#: ../../howto/clinic.rst:838 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:839 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:828 +#: ../../howto/clinic.rst:839 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:840 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:840 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:841 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:841 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:842 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:831 +#: ../../howto/clinic.rst:842 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:843 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:843 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:844 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:844 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:845 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:845 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:846 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:846 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:847 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:847 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:848 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:848 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:849 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:849 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:850 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:850 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:851 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:851 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:852 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:852 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:853 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:853 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:854 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:854 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:855 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:855 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:856 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:856 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:857 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:857 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:858 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:858 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:859 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:859 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:860 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:860 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:861 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:861 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:862 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:862 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:863 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:863 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:864 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:853 -msgid "``Py_UNICODE``" -msgstr "``Py_UNICODE``" +#: ../../howto/clinic.rst:867 +#, fuzzy +msgid "``wchar_t``" +msgstr "``char``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:865 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:854 -msgid "``Py_UNICODE(zeroes=True)``" -msgstr "``Py_UNICODE(zeroes=True)``" +#: ../../howto/clinic.rst:868 +#, fuzzy +msgid "``wchar_t(zeroes=True)``" +msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:866 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:866 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:867 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:867 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:868 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:868 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:869 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:869 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:870 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:870 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:871 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:860 -msgid "``Py_UNICODE(accept={str, NoneType})``" -msgstr "``Py_UNICODE(accept={str, NoneType})``" +#: ../../howto/clinic.rst:874 +#, fuzzy +msgid "``wchar_t(accept={str, NoneType})``" +msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:872 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:861 -msgid "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" -msgstr "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" +#: ../../howto/clinic.rst:875 +#, fuzzy +msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" +msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:873 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:873 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:874 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:874 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:875 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:875 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:878 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:880 +#: ../../howto/clinic.rst:891 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1311,7 +1335,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:886 +#: ../../howto/clinic.rst:897 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1319,11 +1343,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:904 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:895 +#: ../../howto/clinic.rst:906 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1331,17 +1355,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:902 +#: ../../howto/clinic.rst:913 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:904 +#: ../../howto/clinic.rst:915 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:907 +#: ../../howto/clinic.rst:918 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1352,7 +1376,7 @@ msgid "" "units that start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:926 msgid "" "When using ``subclass_of``, you may also want to use the other custom " "argument for ``object()``: ``type``, which lets you set the type actually " @@ -1361,7 +1385,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:932 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a " @@ -1374,31 +1398,31 @@ msgid "" "strings for parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:945 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:947 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:956 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:964 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:958 +#: ../../howto/clinic.rst:969 msgid "How to use the ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:960 +#: ../../howto/clinic.rst:971 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1408,11 +1432,11 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:969 +#: ../../howto/clinic.rst:980 msgid "How to use expressions as default values" msgstr "" -#: ../../howto/clinic.rst:971 +#: ../../howto/clinic.rst:982 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1420,11 +1444,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:976 +#: ../../howto/clinic.rst:987 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:982 +#: ../../howto/clinic.rst:993 msgid "" "``sys.maxsize`` can have different values on different platforms. Therefore " "Argument Clinic can't simply evaluate that expression locally and hard-code " @@ -1432,14 +1456,14 @@ msgid "" "at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:987 +#: ../../howto/clinic.rst:998 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " "module has an attribute called \"``max_widgets``\", you may simply use it:" msgstr "" -#: ../../howto/clinic.rst:995 +#: ../../howto/clinic.rst:1006 msgid "" "If the symbol isn't found in the current module, it fails over to looking in " "``sys.modules``. That's how it can find ``sys.maxsize`` for example. " @@ -1448,7 +1472,7 @@ msgid "" "Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1000 +#: ../../howto/clinic.rst:1011 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1456,7 +1480,7 @@ msgid "" "expression in C, using the ``c_default`` parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1009 +#: ../../howto/clinic.rst:1020 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1464,38 +1488,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1014 +#: ../../howto/clinic.rst:1025 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1018 +#: ../../howto/clinic.rst:1029 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1019 +#: ../../howto/clinic.rst:1030 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1020 +#: ../../howto/clinic.rst:1031 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1021 +#: ../../howto/clinic.rst:1032 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1022 +#: ../../howto/clinic.rst:1033 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1026 +#: ../../howto/clinic.rst:1037 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1028 +#: ../../howto/clinic.rst:1039 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1505,38 +1529,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1036 +#: ../../howto/clinic.rst:1047 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1040 +#: ../../howto/clinic.rst:1051 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1044 +#: ../../howto/clinic.rst:1055 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1068 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1061 +#: ../../howto/clinic.rst:1072 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1075 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1549,135 +1573,127 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1084 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1087 +#: ../../howto/clinic.rst:1098 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1090 -msgid "" -"(There's also an experimental ``NoneType`` converter, which lets you return " -"``Py_None`` on success or ``NULL`` on failure, without having to increment " -"the reference count on ``Py_None``. I'm not sure it adds enough clarity to " -"be worth using.)" -msgstr "" - -#: ../../howto/clinic.rst:1095 +#: ../../howto/clinic.rst:1101 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1101 +#: ../../howto/clinic.rst:1107 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1103 +#: ../../howto/clinic.rst:1109 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1107 +#: ../../howto/clinic.rst:1113 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1115 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1111 +#: ../../howto/clinic.rst:1117 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1113 +#: ../../howto/clinic.rst:1119 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1115 +#: ../../howto/clinic.rst:1121 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1117 +#: ../../howto/clinic.rst:1123 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1120 +#: ../../howto/clinic.rst:1126 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1122 +#: ../../howto/clinic.rst:1128 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1131 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1139 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1143 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1140 +#: ../../howto/clinic.rst:1146 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1145 +#: ../../howto/clinic.rst:1151 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1147 +#: ../../howto/clinic.rst:1153 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1157 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1158 +#: ../../howto/clinic.rst:1164 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1162 +#: ../../howto/clinic.rst:1168 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1173 +#: ../../howto/clinic.rst:1179 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1175 +#: ../../howto/clinic.rst:1181 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1688,13 +1704,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1184 +#: ../../howto/clinic.rst:1190 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1187 +#: ../../howto/clinic.rst:1193 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1702,18 +1718,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1203 +#: ../../howto/clinic.rst:1209 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1225 +#: ../../howto/clinic.rst:1231 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1227 +#: ../../howto/clinic.rst:1233 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1723,25 +1739,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1233 +#: ../../howto/clinic.rst:1239 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1245 +#: ../../howto/clinic.rst:1251 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1255 +#: ../../howto/clinic.rst:1261 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1261 +#: ../../howto/clinic.rst:1267 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1749,13 +1765,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1266 +#: ../../howto/clinic.rst:1272 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1269 +#: ../../howto/clinic.rst:1275 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1764,15 +1780,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1284 +#: ../../howto/clinic.rst:1290 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1288 +#: ../../howto/clinic.rst:1294 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1290 +#: ../../howto/clinic.rst:1296 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1781,7 +1797,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1296 +#: ../../howto/clinic.rst:1302 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1790,7 +1806,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1302 +#: ../../howto/clinic.rst:1308 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1799,50 +1815,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1309 +#: ../../howto/clinic.rst:1315 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1313 +#: ../../howto/clinic.rst:1319 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1319 +#: ../../howto/clinic.rst:1325 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1318 +#: ../../howto/clinic.rst:1324 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1324 +#: ../../howto/clinic.rst:1330 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1322 +#: ../../howto/clinic.rst:1328 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1327 +#: ../../howto/clinic.rst:1333 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1340 +#: ../../howto/clinic.rst:1346 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1332 +#: ../../howto/clinic.rst:1338 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1853,37 +1869,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1343 +#: ../../howto/clinic.rst:1349 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1348 +#: ../../howto/clinic.rst:1354 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1352 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1354 +#: ../../howto/clinic.rst:1360 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1357 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1356 +#: ../../howto/clinic.rst:1362 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1367 +#: ../../howto/clinic.rst:1373 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1892,25 +1908,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1373 +#: ../../howto/clinic.rst:1379 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1380 +#: ../../howto/clinic.rst:1386 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1382 +#: ../../howto/clinic.rst:1388 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1386 +#: ../../howto/clinic.rst:1392 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1919,59 +1935,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1395 +#: ../../howto/clinic.rst:1401 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1403 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1409 +#: ../../howto/clinic.rst:1415 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1412 +#: ../../howto/clinic.rst:1418 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1417 +#: ../../howto/clinic.rst:1423 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1419 +#: ../../howto/clinic.rst:1425 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1428 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1426 +#: ../../howto/clinic.rst:1432 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1434 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1430 +#: ../../howto/clinic.rst:1436 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1432 +#: ../../howto/clinic.rst:1438 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1980,11 +1996,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1440 +#: ../../howto/clinic.rst:1446 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1442 +#: ../../howto/clinic.rst:1448 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1993,7 +2009,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1448 +#: ../../howto/clinic.rst:1454 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2005,15 +2021,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1457 +#: ../../howto/clinic.rst:1463 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1484 +#: ../../howto/clinic.rst:1490 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1460 +#: ../../howto/clinic.rst:1466 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2021,7 +2037,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1475 +#: ../../howto/clinic.rst:1481 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2034,45 +2050,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1518 +#: ../../howto/clinic.rst:1524 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1487 +#: ../../howto/clinic.rst:1493 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1492 ../../howto/clinic.rst:1567 -#: ../../howto/clinic.rst:1645 +#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1573 +#: ../../howto/clinic.rst:1651 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1491 +#: ../../howto/clinic.rst:1497 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1594 -#: ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1504 ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1654 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1495 +#: ../../howto/clinic.rst:1501 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1580 -#: ../../howto/clinic.rst:1674 +#: ../../howto/clinic.rst:1515 ../../howto/clinic.rst:1586 +#: ../../howto/clinic.rst:1680 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1501 +#: ../../howto/clinic.rst:1507 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2081,65 +2097,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1514 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1514 ../../howto/clinic.rst:1607 -#: ../../howto/clinic.rst:1678 +#: ../../howto/clinic.rst:1520 ../../howto/clinic.rst:1613 +#: ../../howto/clinic.rst:1684 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1512 +#: ../../howto/clinic.rst:1518 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1518 ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1524 ../../howto/clinic.rst:1647 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1523 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1520 +#: ../../howto/clinic.rst:1526 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1522 +#: ../../howto/clinic.rst:1528 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1528 +#: ../../howto/clinic.rst:1534 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1538 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1539 +#: ../../howto/clinic.rst:1545 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1543 +#: ../../howto/clinic.rst:1549 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1552 +#: ../../howto/clinic.rst:1558 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2148,25 +2164,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1559 +#: ../../howto/clinic.rst:1565 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1569 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1566 +#: ../../howto/clinic.rst:1572 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1570 +#: ../../howto/clinic.rst:1576 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2174,17 +2190,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1576 +#: ../../howto/clinic.rst:1582 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1586 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1589 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2194,14 +2210,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1592 +#: ../../howto/clinic.rst:1598 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1597 +#: ../../howto/clinic.rst:1603 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2210,18 +2226,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1610 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1624 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1616 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2231,137 +2247,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1617 +#: ../../howto/clinic.rst:1623 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1620 +#: ../../howto/clinic.rst:1626 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1626 +#: ../../howto/clinic.rst:1632 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1634 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1630 +#: ../../howto/clinic.rst:1636 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1642 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1638 +#: ../../howto/clinic.rst:1644 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1647 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1650 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1654 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1657 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1660 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1656 +#: ../../howto/clinic.rst:1662 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1665 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1666 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1667 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1668 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1663 +#: ../../howto/clinic.rst:1669 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1664 +#: ../../howto/clinic.rst:1670 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1672 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1672 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1670 +#: ../../howto/clinic.rst:1676 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1675 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1678 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1677 +#: ../../howto/clinic.rst:1683 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1686 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1692 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1696 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1697 +#: ../../howto/clinic.rst:1703 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2369,35 +2385,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1701 +#: ../../howto/clinic.rst:1707 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1710 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1710 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1713 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1713 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1709 +#: ../../howto/clinic.rst:1715 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1716 +#: ../../howto/clinic.rst:1722 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2406,36 +2422,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1723 +#: ../../howto/clinic.rst:1729 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1725 +#: ../../howto/clinic.rst:1731 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1736 +#: ../../howto/clinic.rst:1742 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1745 +#: ../../howto/clinic.rst:1751 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1759 +#: ../../howto/clinic.rst:1765 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1772 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2443,27 +2459,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1777 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1774 +#: ../../howto/clinic.rst:1780 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1782 +#: ../../howto/clinic.rst:1788 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1786 +#: ../../howto/clinic.rst:1792 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2471,24 +2487,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1790 +#: ../../howto/clinic.rst:1796 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1798 +#: ../../howto/clinic.rst:1804 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1804 +#: ../../howto/clinic.rst:1810 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1806 +#: ../../howto/clinic.rst:1812 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2496,7 +2512,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1811 +#: ../../howto/clinic.rst:1817 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/howto/enum.po b/howto/enum.po index c011dd64cc..f70425dcdf 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-10 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,37 +50,39 @@ msgstr "" #: ../../howto/enum.rst:39 msgid "" -"Because Enums are used to represent constants we recommend using UPPER_CASE " -"names for members, and will be using that style in our examples." +"Because Enums are used to represent constants, and to help avoid issues with " +"name clashes between mixin-class methods/attributes and enum names, we " +"strongly recommend using UPPER_CASE names for members, and will be using " +"that style in our examples." msgstr "" -#: ../../howto/enum.rst:42 +#: ../../howto/enum.rst:44 msgid "" "Depending on the nature of the enum a member's value may or may not be " "important, but either way that value can be used to get the corresponding " "member::" msgstr "" -#: ../../howto/enum.rst:49 +#: ../../howto/enum.rst:51 msgid "" "As you can see, the ``repr()`` of a member shows the enum name, the member " "name, and the value. The ``str()`` of a member shows only the enum name and " "member name::" msgstr "" -#: ../../howto/enum.rst:56 +#: ../../howto/enum.rst:58 msgid "The *type* of an enumeration member is the enum it belongs to::" msgstr "" -#: ../../howto/enum.rst:63 +#: ../../howto/enum.rst:65 msgid "Enum members have an attribute that contains just their :attr:`name`::" msgstr "" -#: ../../howto/enum.rst:68 +#: ../../howto/enum.rst:70 msgid "Likewise, they have an attribute for their :attr:`value`::" msgstr "" -#: ../../howto/enum.rst:74 +#: ../../howto/enum.rst:76 msgid "" "Unlike many languages that treat enumerations solely as name/value pairs, " "Python Enums can have behavior added. For example, :class:`datetime.date` " @@ -91,21 +93,21 @@ msgid "" "instance and return the matching enum member::" msgstr "" -#: ../../howto/enum.rst:86 +#: ../../howto/enum.rst:88 msgid "The complete :class:`Weekday` enum now looks like this::" msgstr "" -#: ../../howto/enum.rst:101 +#: ../../howto/enum.rst:103 msgid "Now we can find out what today is! Observe::" msgstr "" -#: ../../howto/enum.rst:107 +#: ../../howto/enum.rst:109 msgid "" "Of course, if you're reading this on some other day, you'll see that day " "instead." msgstr "" -#: ../../howto/enum.rst:109 +#: ../../howto/enum.rst:111 msgid "" "This :class:`Weekday` enum is great if our variable only needs one day, but " "what if we need several? Maybe we're writing a function to plot chores " @@ -113,70 +115,70 @@ msgid "" "different type of :class:`Enum`::" msgstr "" -#: ../../howto/enum.rst:124 +#: ../../howto/enum.rst:126 msgid "" "We've changed two things: we're inherited from :class:`Flag`, and the values " "are all powers of 2." msgstr "" -#: ../../howto/enum.rst:127 +#: ../../howto/enum.rst:129 msgid "" "Just like the original :class:`Weekday` enum above, we can have a single " "selection::" msgstr "" -#: ../../howto/enum.rst:133 +#: ../../howto/enum.rst:135 msgid "" "But :class:`Flag` also allows us to combine several members into a single " "variable::" msgstr "" -#: ../../howto/enum.rst:140 +#: ../../howto/enum.rst:142 msgid "You can even iterate over a :class:`Flag` variable::" msgstr "" -#: ../../howto/enum.rst:147 +#: ../../howto/enum.rst:149 msgid "Okay, let's get some chores set up::" msgstr "" -#: ../../howto/enum.rst:155 +#: ../../howto/enum.rst:157 msgid "And a function to display the chores for a given day::" msgstr "" -#: ../../howto/enum.rst:164 +#: ../../howto/enum.rst:167 msgid "" "In cases where the actual values of the members do not matter, you can save " "yourself some work and use :func:`auto()` for the values::" msgstr "" -#: ../../howto/enum.rst:183 +#: ../../howto/enum.rst:186 msgid "Programmatic access to enumeration members and their attributes" msgstr "" -#: ../../howto/enum.rst:185 +#: ../../howto/enum.rst:188 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -#: ../../howto/enum.rst:194 +#: ../../howto/enum.rst:197 msgid "If you want to access enum members by *name*, use item access::" msgstr "" -#: ../../howto/enum.rst:201 +#: ../../howto/enum.rst:204 msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" msgstr "" -#: ../../howto/enum.rst:211 +#: ../../howto/enum.rst:214 msgid "Duplicating enum members and values" msgstr "" -#: ../../howto/enum.rst:213 +#: ../../howto/enum.rst:216 msgid "Having two enum members with the same name is invalid::" msgstr "" -#: ../../howto/enum.rst:223 +#: ../../howto/enum.rst:226 msgid "" "However, an enum member can have other names associated with it. Given two " "entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " @@ -185,112 +187,112 @@ msgid "" "member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" -#: ../../howto/enum.rst:244 +#: ../../howto/enum.rst:247 msgid "" "Attempting to create a member with the same name as an already defined " "attribute (another member, a method, etc.) or attempting to create an " "attribute with the same name as a member is not allowed." msgstr "" -#: ../../howto/enum.rst:250 +#: ../../howto/enum.rst:253 msgid "Ensuring unique enumeration values" msgstr "" -#: ../../howto/enum.rst:252 +#: ../../howto/enum.rst:255 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, you can use the :func:`unique` decorator::" msgstr "" -#: ../../howto/enum.rst:269 +#: ../../howto/enum.rst:272 msgid "Using automatic values" msgstr "" -#: ../../howto/enum.rst:271 +#: ../../howto/enum.rst:274 msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "" -#: ../../howto/enum.rst:282 +#: ../../howto/enum.rst:285 msgid "" "The values are chosen by :func:`_generate_next_value_`, which can be " "overridden::" msgstr "" -#: ../../howto/enum.rst:300 +#: ../../howto/enum.rst:304 msgid "" "The :meth:`_generate_next_value_` method must be defined before any members." msgstr "" -#: ../../howto/enum.rst:303 +#: ../../howto/enum.rst:307 msgid "Iteration" msgstr "" -#: ../../howto/enum.rst:305 +#: ../../howto/enum.rst:309 msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "" -#: ../../howto/enum.rst:312 +#: ../../howto/enum.rst:316 msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " "aren't shown." msgstr "" -#: ../../howto/enum.rst:314 +#: ../../howto/enum.rst:318 msgid "" "The special attribute ``__members__`` is a read-only ordered mapping of " "names to members. It includes all names defined in the enumeration, " "including the aliases::" msgstr "" -#: ../../howto/enum.rst:326 +#: ../../howto/enum.rst:330 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " "to the enumeration members. For example, finding all the aliases::" msgstr "" -#: ../../howto/enum.rst:334 +#: ../../howto/enum.rst:338 msgid "" "Aliases for flags include values with multiple flags set, such as ``3``, and " "no flags set, i.e. ``0``." msgstr "" -#: ../../howto/enum.rst:339 +#: ../../howto/enum.rst:343 msgid "Comparisons" msgstr "" -#: ../../howto/enum.rst:341 +#: ../../howto/enum.rst:345 msgid "Enumeration members are compared by identity::" msgstr "" -#: ../../howto/enum.rst:350 +#: ../../howto/enum.rst:354 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" -#: ../../howto/enum.rst:358 +#: ../../howto/enum.rst:362 msgid "Equality comparisons are defined though::" msgstr "" -#: ../../howto/enum.rst:367 +#: ../../howto/enum.rst:371 msgid "" "Comparisons against non-enumeration values will always compare not equal " "(again, :class:`IntEnum` was explicitly designed to behave differently, see " "below)::" msgstr "" -#: ../../howto/enum.rst:376 +#: ../../howto/enum.rst:380 msgid "" "It is possible to reload modules -- if a reloaded module contains enums, " "they will be recreated, and the new members may not compare identical/equal " "to the original members." msgstr "" -#: ../../howto/enum.rst:381 +#: ../../howto/enum.rst:385 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:383 +#: ../../howto/enum.rst:387 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -299,17 +301,17 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:389 +#: ../../howto/enum.rst:393 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:409 +#: ../../howto/enum.rst:413 msgid "Then::" msgstr "" -#: ../../howto/enum.rst:418 +#: ../../howto/enum.rst:422 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -319,35 +321,35 @@ msgid "" "names listed in :attr:`_ignore_`." msgstr "" -#: ../../howto/enum.rst:425 +#: ../../howto/enum.rst:429 msgid "" "Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " "then any value(s) given to the enum member will be passed into those " "methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:431 +#: ../../howto/enum.rst:435 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:433 +#: ../../howto/enum.rst:437 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:440 +#: ../../howto/enum.rst:444 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:450 +#: ../../howto/enum.rst:454 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:461 +#: ../../howto/enum.rst:465 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -355,56 +357,78 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:468 +#: ../../howto/enum.rst:474 +msgid "Dataclass support" +msgstr "" + +#: ../../howto/enum.rst:476 +msgid "" +"When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." +"__repr__` omits the inherited class' name. For example::" +msgstr "" + +#: ../../howto/enum.rst:492 +msgid "" +"Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" +"`repr`." +msgstr "" + +#: ../../howto/enum.rst:495 +msgid "" +"Only the dataclass fields are shown in the value area, not the dataclass' " +"name." +msgstr "" + +#: ../../howto/enum.rst:501 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:470 +#: ../../howto/enum.rst:503 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:477 +#: ../../howto/enum.rst:510 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:483 +#: ../../howto/enum.rst:516 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:486 +#: ../../howto/enum.rst:519 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:495 +#: ../../howto/enum.rst:528 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:500 +#: ../../howto/enum.rst:533 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:535 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:512 +#: ../../howto/enum.rst:545 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:515 +#: ../../howto/enum.rst:548 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -416,14 +440,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:531 +#: ../../howto/enum.rst:564 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:568 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -432,14 +456,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:545 +#: ../../howto/enum.rst:578 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:549 +#: ../../howto/enum.rst:582 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -447,7 +471,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:556 +#: ../../howto/enum.rst:589 msgid "The complete signature is::" msgstr "" @@ -455,7 +479,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:568 +#: ../../howto/enum.rst:601 msgid "What the new enum class will record as its name." msgstr "" @@ -463,21 +487,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:570 +#: ../../howto/enum.rst:603 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:575 +#: ../../howto/enum.rst:608 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:579 +#: ../../howto/enum.rst:612 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:583 +#: ../../howto/enum.rst:616 msgid "or a mapping::" msgstr "" @@ -485,7 +509,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:587 +#: ../../howto/enum.rst:620 msgid "name of module where new enum class can be found." msgstr "" @@ -493,7 +517,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:622 msgid "where in module new enum class can be found." msgstr "" @@ -501,7 +525,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:591 +#: ../../howto/enum.rst:624 msgid "type to mix in to new enum class." msgstr "" @@ -509,23 +533,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:593 +#: ../../howto/enum.rst:626 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:595 +#: ../../howto/enum.rst:628 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:600 +#: ../../howto/enum.rst:633 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:603 +#: ../../howto/enum.rst:636 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:605 +#: ../../howto/enum.rst:638 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -533,22 +557,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:626 +#: ../../howto/enum.rst:659 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:639 +#: ../../howto/enum.rst:672 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:650 +#: ../../howto/enum.rst:683 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:652 +#: ../../howto/enum.rst:685 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -556,11 +580,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:661 +#: ../../howto/enum.rst:694 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:663 +#: ../../howto/enum.rst:696 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -570,60 +594,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:671 +#: ../../howto/enum.rst:704 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:674 +#: ../../howto/enum.rst:707 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:681 +#: ../../howto/enum.rst:714 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:697 +#: ../../howto/enum.rst:730 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:713 +#: ../../howto/enum.rst:747 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:718 +#: ../../howto/enum.rst:752 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:726 +#: ../../howto/enum.rst:760 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:737 +#: ../../howto/enum.rst:771 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:743 +#: ../../howto/enum.rst:777 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:752 +#: ../../howto/enum.rst:786 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:754 +#: ../../howto/enum.rst:788 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -633,29 +657,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:763 +#: ../../howto/enum.rst:797 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:777 +#: ../../howto/enum.rst:811 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:789 +#: ../../howto/enum.rst:823 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:803 +#: ../../howto/enum.rst:837 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:813 +#: ../../howto/enum.rst:847 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -666,42 +690,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:823 +#: ../../howto/enum.rst:857 msgid "Others" msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:859 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:831 +#: ../../howto/enum.rst:865 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:834 +#: ../../howto/enum.rst:868 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:836 +#: ../../howto/enum.rst:870 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:839 +#: ../../howto/enum.rst:873 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:842 +#: ../../howto/enum.rst:876 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -709,184 +733,188 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:846 +#: ../../howto/enum.rst:880 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:849 -msgid "A ``data type`` is a mixin that defines :meth:`__new__`." +#: ../../howto/enum.rst:883 +msgid "" +"A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" +"`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:850 +#: ../../howto/enum.rst:885 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:853 +#: ../../howto/enum.rst:888 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:858 +#: ../../howto/enum.rst:893 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:864 +#: ../../howto/enum.rst:899 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:866 +#: ../../howto/enum.rst:901 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:870 +#: ../../howto/enum.rst:905 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:897 +#: ../../howto/enum.rst:932 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:900 +#: ../../howto/enum.rst:935 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:902 +#: ../../howto/enum.rst:937 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:905 +#: ../../howto/enum.rst:940 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:946 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:948 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:949 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:916 +#: ../../howto/enum.rst:951 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:918 +#: ../../howto/enum.rst:953 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:921 +#: ../../howto/enum.rst:956 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:923 +#: ../../howto/enum.rst:958 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:929 +#: ../../howto/enum.rst:964 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:932 +#: ../../howto/enum.rst:967 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:970 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:936 +#: ../../howto/enum.rst:971 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:938 +#: ../../howto/enum.rst:973 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:956 +#: ../../howto/enum.rst:991 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:961 +#: ../../howto/enum.rst:996 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:963 +#: ../../howto/enum.rst:998 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:1005 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:1007 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " "behavior, being able to access one member directly from another is useful, " -"and is supported." +"and is supported; however, in order to avoid name clashes between member " +"names and attributes/methods from mixed-in classes, upper-case names are " +"strongly recommended." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:1018 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:983 +#: ../../howto/enum.rst:1020 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:995 +#: ../../howto/enum.rst:1032 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:997 +#: ../../howto/enum.rst:1034 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -895,137 +923,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1006 +#: ../../howto/enum.rst:1043 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1047 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1049 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1023 +#: ../../howto/enum.rst:1060 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1025 +#: ../../howto/enum.rst:1062 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1043 +#: ../../howto/enum.rst:1080 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1045 +#: ../../howto/enum.rst:1082 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1056 +#: ../../howto/enum.rst:1093 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1058 +#: ../../howto/enum.rst:1095 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1059 +#: ../../howto/enum.rst:1096 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1060 +#: ../../howto/enum.rst:1097 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1065 +#: ../../howto/enum.rst:1102 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1074 +#: ../../howto/enum.rst:1111 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1079 +#: ../../howto/enum.rst:1116 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1090 +#: ../../howto/enum.rst:1127 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1133 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1105 +#: ../../howto/enum.rst:1142 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1108 +#: ../../howto/enum.rst:1145 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1146 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1147 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1151 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1112 +#: ../../howto/enum.rst:1149 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1113 +#: ../../howto/enum.rst:1150 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1114 +#: ../../howto/enum.rst:1151 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1153 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1124 +#: ../../howto/enum.rst:1161 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1126 +#: ../../howto/enum.rst:1163 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1131 +#: ../../howto/enum.rst:1168 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1170 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1036,11 +1064,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1179 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1144 +#: ../../howto/enum.rst:1181 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1049,11 +1077,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1187 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1152 +#: ../../howto/enum.rst:1189 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1062,37 +1090,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1158 +#: ../../howto/enum.rst:1195 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1197 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1166 +#: ../../howto/enum.rst:1203 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1205 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1174 +#: ../../howto/enum.rst:1211 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1221 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1224 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1100,149 +1128,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1231 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1233 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1199 +#: ../../howto/enum.rst:1236 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1200 +#: ../../howto/enum.rst:1237 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1238 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1239 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1205 +#: ../../howto/enum.rst:1242 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1248 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1213 +#: ../../howto/enum.rst:1250 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1225 +#: ../../howto/enum.rst:1262 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1264 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1274 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1290 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1255 +#: ../../howto/enum.rst:1292 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1267 +#: ../../howto/enum.rst:1304 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1306 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1286 +#: ../../howto/enum.rst:1323 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1296 +#: ../../howto/enum.rst:1333 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1315 +#: ../../howto/enum.rst:1352 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1321 +#: ../../howto/enum.rst:1358 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1360 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1357 +#: ../../howto/enum.rst:1394 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1359 +#: ../../howto/enum.rst:1396 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1384 +#: ../../howto/enum.rst:1421 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1390 +#: ../../howto/enum.rst:1427 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1392 +#: ../../howto/enum.rst:1429 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1421 +#: ../../howto/enum.rst:1458 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1423 +#: ../../howto/enum.rst:1460 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1442 +#: ../../howto/enum.rst:1479 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1444 +#: ../../howto/enum.rst:1481 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/functional.po b/howto/functional.po index 15e07c0c89..1c932c9fb7 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1333,15 +1333,22 @@ msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." msgstr "https://en.wikipedia.org/wiki/Coroutine: Coroutines 的條目。" #: ../../howto/functional.rst:1226 +#, fuzzy +msgid "" +"https://en.wikipedia.org/wiki/Partial_application: Entry for the concept of " +"partial function application." +msgstr "https://en.wikipedia.org/wiki/Currying: currying 概念的條目。" + +#: ../../howto/functional.rst:1228 msgid "" "https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." msgstr "https://en.wikipedia.org/wiki/Currying: currying 概念的條目。" -#: ../../howto/functional.rst:1229 +#: ../../howto/functional.rst:1231 msgid "Python-specific" msgstr "" -#: ../../howto/functional.rst:1231 +#: ../../howto/functional.rst:1233 msgid "" "https://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" "reference:`Text Processing in Python` discusses functional programming for " @@ -1349,7 +1356,7 @@ msgid "" "Text Processing\"." msgstr "" -#: ../../howto/functional.rst:1236 +#: ../../howto/functional.rst:1238 msgid "" "Mertz also wrote a 3-part series of articles on functional programming for " "IBM's DeveloperWorks site; see `part 1 `__," msgstr "" -#: ../../howto/functional.rst:1244 +#: ../../howto/functional.rst:1246 msgid "Python documentation" msgstr "Python 說明文件" -#: ../../howto/functional.rst:1246 +#: ../../howto/functional.rst:1248 msgid "Documentation for the :mod:`itertools` module." msgstr ":mod:`itertools` 模組的說明文件。" -#: ../../howto/functional.rst:1248 +#: ../../howto/functional.rst:1250 msgid "Documentation for the :mod:`functools` module." msgstr ":mod:`functools` 模組的說明文件。" -#: ../../howto/functional.rst:1250 +#: ../../howto/functional.rst:1252 msgid "Documentation for the :mod:`operator` module." msgstr ":mod:`operator` 模組的說明文件。" -#: ../../howto/functional.rst:1252 +#: ../../howto/functional.rst:1254 msgid ":pep:`289`: \"Generator Expressions\"" msgstr "" -#: ../../howto/functional.rst:1254 +#: ../../howto/functional.rst:1256 msgid "" ":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " "generator features in Python 2.5." diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 1f76b5a68b..87eca2f103 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-30 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1867,7 +1867,7 @@ msgstr "" #: ../../howto/logging-cookbook.rst:3635 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " -"detault to use the older :rfc:`3164`, which hails from 2001. When " +"default to use the older :rfc:`3164`, which hails from 2001. When " "``logging`` was added to Python in 2003, it supported the earlier (and only " "existing) protocol at the time. Since RFC5424 came out, as there has not " "been widespread deployment of it in syslog servers, the :class:`~logging." @@ -1941,7 +1941,7 @@ msgstr "" #: ../../howto/logging-cookbook.rst:3825 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " -"which writes to ``sys.stderr`` makes mutiple writes, each of which results " +"which writes to ``sys.stderr`` makes multiple writes, each of which results " "in a separate logged line (for example, the last three lines above). To get " "around this problem, you need to buffer things and only output log lines " "when newlines are seen. Let's use a slghtly better implementation of " diff --git a/howto/logging.po b/howto/logging.po index f5a44dfb74..0de5cf099e 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-11 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,11 +31,17 @@ msgstr "作者" msgid "Vinay Sajip " msgstr "Vinay Sajip " -#: ../../howto/logging.rst:12 +#: ../../howto/logging.rst:11 +msgid "" +"This page contains tutorial information. For links to reference information " +"and a logging cookbook, please see :ref:`tutorial-ref-links`." +msgstr "" + +#: ../../howto/logging.rst:15 msgid "Basic Logging Tutorial" msgstr "基礎 Logging 指南" -#: ../../howto/logging.rst:14 +#: ../../howto/logging.rst:17 msgid "" "Logging is a means of tracking events that happen when some software runs. " "The software's developer adds logging calls to their code to indicate that " @@ -50,11 +56,11 @@ msgstr "" "述。這段訊息可能包含一些因為此事件發生而改變的資料。開發者也可以指派事件的重" "要程度,重要程度有時候也會被稱作 *程度* 或是 *嚴重性* 。" -#: ../../howto/logging.rst:23 +#: ../../howto/logging.rst:26 msgid "When to use logging" msgstr "什麼時候使用 logging" -#: ../../howto/logging.rst:25 +#: ../../howto/logging.rst:28 msgid "" "Logging provides a set of convenience functions for simple logging usage. " "These are :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and :" @@ -62,164 +68,164 @@ msgid "" "which states, for each of a set of common tasks, the best tool to use for it." msgstr "" -#: ../../howto/logging.rst:31 +#: ../../howto/logging.rst:34 msgid "Task you want to perform" msgstr "" -#: ../../howto/logging.rst:31 +#: ../../howto/logging.rst:34 msgid "The best tool for the task" msgstr "" -#: ../../howto/logging.rst:33 +#: ../../howto/logging.rst:36 msgid "" "Display console output for ordinary usage of a command line script or program" msgstr "" -#: ../../howto/logging.rst:33 +#: ../../howto/logging.rst:36 msgid ":func:`print`" msgstr ":func:`print`" -#: ../../howto/logging.rst:37 +#: ../../howto/logging.rst:40 msgid "" "Report events that occur during normal operation of a program (e.g. for " "status monitoring or fault investigation)" msgstr "" -#: ../../howto/logging.rst:37 +#: ../../howto/logging.rst:40 msgid "" ":func:`logging.info` (or :func:`logging.debug` for very detailed output for " "diagnostic purposes)" msgstr "" -#: ../../howto/logging.rst:42 +#: ../../howto/logging.rst:45 msgid "Issue a warning regarding a particular runtime event" msgstr "" -#: ../../howto/logging.rst:42 +#: ../../howto/logging.rst:45 msgid "" ":func:`warnings.warn` in library code if the issue is avoidable and the " "client application should be modified to eliminate the warning" msgstr "" -#: ../../howto/logging.rst:47 +#: ../../howto/logging.rst:50 msgid "" ":func:`logging.warning` if there is nothing the client application can do " "about the situation, but the event should still be noted" msgstr "" -#: ../../howto/logging.rst:52 +#: ../../howto/logging.rst:55 msgid "Report an error regarding a particular runtime event" msgstr "" -#: ../../howto/logging.rst:52 +#: ../../howto/logging.rst:55 msgid "Raise an exception" msgstr "" -#: ../../howto/logging.rst:55 +#: ../../howto/logging.rst:58 msgid "" "Report suppression of an error without raising an exception (e.g. error " "handler in a long-running server process)" msgstr "" -#: ../../howto/logging.rst:55 +#: ../../howto/logging.rst:58 msgid "" ":func:`logging.error`, :func:`logging.exception` or :func:`logging.critical` " "as appropriate for the specific error and application domain" msgstr "" -#: ../../howto/logging.rst:62 +#: ../../howto/logging.rst:65 msgid "" "The logging functions are named after the level or severity of the events " "they are used to track. The standard levels and their applicability are " "described below (in increasing order of severity):" msgstr "" -#: ../../howto/logging.rst:69 ../../howto/logging.rst:863 +#: ../../howto/logging.rst:72 ../../howto/logging.rst:866 msgid "Level" msgstr "" -#: ../../howto/logging.rst:69 +#: ../../howto/logging.rst:72 msgid "When it's used" msgstr "" -#: ../../howto/logging.rst:71 ../../howto/logging.rst:873 +#: ../../howto/logging.rst:74 ../../howto/logging.rst:876 msgid "``DEBUG``" msgstr "``DEBUG``" -#: ../../howto/logging.rst:71 +#: ../../howto/logging.rst:74 msgid "" "Detailed information, typically of interest only when diagnosing problems." msgstr "" -#: ../../howto/logging.rst:74 ../../howto/logging.rst:871 +#: ../../howto/logging.rst:77 ../../howto/logging.rst:874 msgid "``INFO``" msgstr "``INFO``" -#: ../../howto/logging.rst:74 +#: ../../howto/logging.rst:77 msgid "Confirmation that things are working as expected." msgstr "" -#: ../../howto/logging.rst:77 ../../howto/logging.rst:869 +#: ../../howto/logging.rst:80 ../../howto/logging.rst:872 msgid "``WARNING``" msgstr "``WARNING``" -#: ../../howto/logging.rst:77 +#: ../../howto/logging.rst:80 msgid "" "An indication that something unexpected happened, or indicative of some " "problem in the near future (e.g. 'disk space low'). The software is still " "working as expected." msgstr "" -#: ../../howto/logging.rst:82 ../../howto/logging.rst:867 +#: ../../howto/logging.rst:85 ../../howto/logging.rst:870 msgid "``ERROR``" msgstr "``ERROR``" -#: ../../howto/logging.rst:82 +#: ../../howto/logging.rst:85 msgid "" "Due to a more serious problem, the software has not been able to perform " "some function." msgstr "" -#: ../../howto/logging.rst:85 ../../howto/logging.rst:865 +#: ../../howto/logging.rst:88 ../../howto/logging.rst:868 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../howto/logging.rst:85 +#: ../../howto/logging.rst:88 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." msgstr "" -#: ../../howto/logging.rst:89 +#: ../../howto/logging.rst:92 msgid "" "The default level is ``WARNING``, which means that only events of this level " "and above will be tracked, unless the logging package is configured to do " "otherwise." msgstr "" -#: ../../howto/logging.rst:93 +#: ../../howto/logging.rst:96 msgid "" "Events that are tracked can be handled in different ways. The simplest way " "of handling tracked events is to print them to the console. Another common " "way is to write them to a disk file." msgstr "" -#: ../../howto/logging.rst:101 +#: ../../howto/logging.rst:104 msgid "A simple example" msgstr "一個簡單範例" -#: ../../howto/logging.rst:103 +#: ../../howto/logging.rst:106 msgid "A very simple example is::" msgstr "" "一個非常簡單的例子是:\n" "\n" "::" -#: ../../howto/logging.rst:109 +#: ../../howto/logging.rst:112 msgid "If you type these lines into a script and run it, you'll see:" msgstr "" -#: ../../howto/logging.rst:115 +#: ../../howto/logging.rst:118 msgid "" "printed out on the console. The ``INFO`` message doesn't appear because the " "default level is ``WARNING``. The printed message includes the indication of " @@ -229,11 +235,11 @@ msgid "" "need that; formatting options will also be explained later." msgstr "" -#: ../../howto/logging.rst:124 +#: ../../howto/logging.rst:127 msgid "Logging to a file" msgstr "" -#: ../../howto/logging.rst:126 +#: ../../howto/logging.rst:129 msgid "" "A very common situation is that of recording logging events in a file, so " "let's look at that next. Be sure to try the following in a newly started " @@ -241,7 +247,7 @@ msgid "" "above::" msgstr "" -#: ../../howto/logging.rst:137 +#: ../../howto/logging.rst:140 msgid "" "The *encoding* argument was added. In earlier Python versions, or if not " "specified, the encoding used is the default value used by :func:`open`. " @@ -250,38 +256,38 @@ msgid "" "values and the default, see the documentation for :func:`open`." msgstr "" -#: ../../howto/logging.rst:144 +#: ../../howto/logging.rst:147 msgid "" "And now if we open the file and look at what we have, we should find the log " "messages:" msgstr "" -#: ../../howto/logging.rst:154 +#: ../../howto/logging.rst:157 msgid "" "This example also shows how you can set the logging level which acts as the " "threshold for tracking. In this case, because we set the threshold to " "``DEBUG``, all of the messages were printed." msgstr "" -#: ../../howto/logging.rst:158 +#: ../../howto/logging.rst:161 msgid "" "If you want to set the logging level from a command-line option such as:" msgstr "" -#: ../../howto/logging.rst:164 +#: ../../howto/logging.rst:167 msgid "" "and you have the value of the parameter passed for ``--log`` in some " "variable *loglevel*, you can use::" msgstr "" -#: ../../howto/logging.rst:169 +#: ../../howto/logging.rst:172 msgid "" "to get the value which you'll pass to :func:`basicConfig` via the *level* " "argument. You may want to error check any user input value, perhaps as in " "the following example::" msgstr "" -#: ../../howto/logging.rst:181 +#: ../../howto/logging.rst:184 msgid "" "The call to :func:`basicConfig` should come *before* any calls to :func:" "`debug`, :func:`info`, etc. Otherwise, those functions will call :func:" @@ -290,7 +296,7 @@ msgid "" "anything: subsequent calls are effectively no-ops." msgstr "" -#: ../../howto/logging.rst:187 +#: ../../howto/logging.rst:190 msgid "" "If you run the above script several times, the messages from successive runs " "are appended to the file *example.log*. If you want each run to start " @@ -298,27 +304,27 @@ msgid "" "*filemode* argument, by changing the call in the above example to::" msgstr "" -#: ../../howto/logging.rst:194 +#: ../../howto/logging.rst:197 msgid "" "The output will be the same as before, but the log file is no longer " "appended to, so the messages from earlier runs are lost." msgstr "" -#: ../../howto/logging.rst:199 +#: ../../howto/logging.rst:202 msgid "Logging from multiple modules" msgstr "" -#: ../../howto/logging.rst:201 +#: ../../howto/logging.rst:204 msgid "" "If your program consists of multiple modules, here's an example of how you " "could organize logging in it::" msgstr "" -#: ../../howto/logging.rst:225 +#: ../../howto/logging.rst:228 msgid "If you run *myapp.py*, you should see this in *myapp.log*:" msgstr "" -#: ../../howto/logging.rst:233 +#: ../../howto/logging.rst:236 msgid "" "which is hopefully what you were expecting to see. You can generalize this " "to multiple modules, using the pattern in *mylib.py*. Note that for this " @@ -329,21 +335,21 @@ msgid "" "advanced-tutorial`." msgstr "" -#: ../../howto/logging.rst:243 +#: ../../howto/logging.rst:246 msgid "Logging variable data" msgstr "" -#: ../../howto/logging.rst:245 +#: ../../howto/logging.rst:248 msgid "" "To log variable data, use a format string for the event description message " "and append the variable data as arguments. For example::" msgstr "" -#: ../../howto/logging.rst:251 +#: ../../howto/logging.rst:254 msgid "will display:" msgstr "" -#: ../../howto/logging.rst:257 +#: ../../howto/logging.rst:260 msgid "" "As you can see, merging of variable data into the event description message " "uses the old, %-style of string formatting. This is for backwards " @@ -353,21 +359,21 @@ msgid "" "tutorial: see :ref:`formatting-styles` for more information." msgstr "" -#: ../../howto/logging.rst:266 +#: ../../howto/logging.rst:269 msgid "Changing the format of displayed messages" msgstr "" -#: ../../howto/logging.rst:268 +#: ../../howto/logging.rst:271 msgid "" "To change the format which is used to display messages, you need to specify " "the format you want to use::" msgstr "" -#: ../../howto/logging.rst:277 +#: ../../howto/logging.rst:280 msgid "which would print:" msgstr "" -#: ../../howto/logging.rst:285 +#: ../../howto/logging.rst:288 msgid "" "Notice that the 'root' which appeared in earlier examples has disappeared. " "For a full set of things that can appear in format strings, you can refer to " @@ -377,42 +383,42 @@ msgid "" "This is described in the next section." msgstr "" -#: ../../howto/logging.rst:294 +#: ../../howto/logging.rst:297 msgid "Displaying the date/time in messages" msgstr "" -#: ../../howto/logging.rst:296 +#: ../../howto/logging.rst:299 msgid "" "To display the date and time of an event, you would place '%(asctime)s' in " "your format string::" msgstr "" -#: ../../howto/logging.rst:303 +#: ../../howto/logging.rst:306 msgid "which should print something like this:" msgstr "" -#: ../../howto/logging.rst:309 +#: ../../howto/logging.rst:312 msgid "" "The default format for date/time display (shown above) is like ISO8601 or :" "rfc:`3339`. If you need more control over the formatting of the date/time, " "provide a *datefmt* argument to ``basicConfig``, as in this example::" msgstr "" -#: ../../howto/logging.rst:317 +#: ../../howto/logging.rst:320 msgid "which would display something like this:" msgstr "" -#: ../../howto/logging.rst:323 +#: ../../howto/logging.rst:326 msgid "" "The format of the *datefmt* argument is the same as supported by :func:`time." "strftime`." msgstr "" -#: ../../howto/logging.rst:328 +#: ../../howto/logging.rst:331 msgid "Next Steps" msgstr "" -#: ../../howto/logging.rst:330 +#: ../../howto/logging.rst:333 msgid "" "That concludes the basic tutorial. It should be enough to get you up and " "running with logging. There's a lot more that the logging package offers, " @@ -421,7 +427,7 @@ msgid "" "of your favourite beverage and carry on." msgstr "" -#: ../../howto/logging.rst:336 +#: ../../howto/logging.rst:339 msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " @@ -430,50 +436,50 @@ msgid "" "should receive help before too long." msgstr "" -#: ../../howto/logging.rst:342 +#: ../../howto/logging.rst:345 msgid "" "Still here? You can carry on reading the next few sections, which provide a " "slightly more advanced/in-depth tutorial than the basic one above. After " "that, you can take a look at the :ref:`logging-cookbook`." msgstr "" -#: ../../howto/logging.rst:350 +#: ../../howto/logging.rst:353 msgid "Advanced Logging Tutorial" msgstr "" -#: ../../howto/logging.rst:352 +#: ../../howto/logging.rst:355 msgid "" "The logging library takes a modular approach and offers several categories " "of components: loggers, handlers, filters, and formatters." msgstr "" -#: ../../howto/logging.rst:355 +#: ../../howto/logging.rst:358 msgid "Loggers expose the interface that application code directly uses." msgstr "" -#: ../../howto/logging.rst:356 +#: ../../howto/logging.rst:359 msgid "" "Handlers send the log records (created by loggers) to the appropriate " "destination." msgstr "" -#: ../../howto/logging.rst:358 +#: ../../howto/logging.rst:361 msgid "" "Filters provide a finer grained facility for determining which log records " "to output." msgstr "" -#: ../../howto/logging.rst:360 +#: ../../howto/logging.rst:363 msgid "Formatters specify the layout of log records in the final output." msgstr "" -#: ../../howto/logging.rst:362 +#: ../../howto/logging.rst:365 msgid "" "Log event information is passed between loggers, handlers, filters and " "formatters in a :class:`LogRecord` instance." msgstr "" -#: ../../howto/logging.rst:365 +#: ../../howto/logging.rst:368 msgid "" "Logging is performed by calling methods on instances of the :class:`Logger` " "class (hereafter called :dfn:`loggers`). Each instance has a name, and they " @@ -484,19 +490,19 @@ msgid "" "originates." msgstr "" -#: ../../howto/logging.rst:372 +#: ../../howto/logging.rst:375 msgid "" "A good convention to use when naming loggers is to use a module-level " "logger, in each module which uses logging, named as follows::" msgstr "" -#: ../../howto/logging.rst:377 +#: ../../howto/logging.rst:380 msgid "" "This means that logger names track the package/module hierarchy, and it's " "intuitively obvious where events are logged just from the logger name." msgstr "" -#: ../../howto/logging.rst:380 +#: ../../howto/logging.rst:383 msgid "" "The root of the hierarchy of loggers is called the root logger. That's the " "logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :" @@ -505,7 +511,7 @@ msgid "" "root logger's name is printed as 'root' in the logged output." msgstr "" -#: ../../howto/logging.rst:386 +#: ../../howto/logging.rst:389 msgid "" "It is, of course, possible to log messages to different destinations. " "Support is included in the package for writing log messages to files, HTTP " @@ -516,7 +522,7 @@ msgid "" "built-in handler classes." msgstr "" -#: ../../howto/logging.rst:393 +#: ../../howto/logging.rst:396 msgid "" "By default, no destination is set for any logging messages. You can specify " "a destination (such as console or file) by using :func:`basicConfig` as in " @@ -528,32 +534,32 @@ msgid "" "message output." msgstr "" -#: ../../howto/logging.rst:401 +#: ../../howto/logging.rst:404 msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "" -#: ../../howto/logging.rst:407 +#: ../../howto/logging.rst:410 msgid "" "You can change this by passing a format string to :func:`basicConfig` with " "the *format* keyword argument. For all options regarding how a format string " "is constructed, see :ref:`formatter-objects`." msgstr "" -#: ../../howto/logging.rst:412 +#: ../../howto/logging.rst:415 msgid "Logging Flow" msgstr "" -#: ../../howto/logging.rst:414 +#: ../../howto/logging.rst:417 msgid "" "The flow of log event information in loggers and handlers is illustrated in " "the following diagram." msgstr "" -#: ../../howto/logging.rst:421 +#: ../../howto/logging.rst:424 msgid "Loggers" msgstr "" -#: ../../howto/logging.rst:423 +#: ../../howto/logging.rst:426 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -563,17 +569,17 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:429 +#: ../../howto/logging.rst:432 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." msgstr "" -#: ../../howto/logging.rst:432 +#: ../../howto/logging.rst:435 msgid "These are the most common configuration methods:" msgstr "" -#: ../../howto/logging.rst:434 +#: ../../howto/logging.rst:437 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -582,32 +588,32 @@ msgid "" "messages and will ignore DEBUG messages." msgstr "" -#: ../../howto/logging.rst:440 +#: ../../howto/logging.rst:443 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " "in :ref:`handler-basic`." msgstr "" -#: ../../howto/logging.rst:444 +#: ../../howto/logging.rst:447 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " "in :ref:`filter`." msgstr "" -#: ../../howto/logging.rst:448 +#: ../../howto/logging.rst:451 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" -#: ../../howto/logging.rst:451 +#: ../../howto/logging.rst:454 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" -#: ../../howto/logging.rst:453 +#: ../../howto/logging.rst:456 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -620,14 +626,14 @@ msgid "" "exception information." msgstr "" -#: ../../howto/logging.rst:463 +#: ../../howto/logging.rst:466 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " "along with it. Call this method only from an exception handler." msgstr "" -#: ../../howto/logging.rst:467 +#: ../../howto/logging.rst:470 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -635,7 +641,7 @@ msgid "" "levels." msgstr "" -#: ../../howto/logging.rst:471 +#: ../../howto/logging.rst:474 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -647,7 +653,7 @@ msgid "" "descendants of ``foo``." msgstr "" -#: ../../howto/logging.rst:479 +#: ../../howto/logging.rst:482 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -659,7 +665,7 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:487 +#: ../../howto/logging.rst:490 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -669,11 +675,11 @@ msgid "" "attribute of a logger to ``False``.)" msgstr "" -#: ../../howto/logging.rst:498 +#: ../../howto/logging.rst:501 msgid "Handlers" msgstr "" -#: ../../howto/logging.rst:500 +#: ../../howto/logging.rst:503 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -686,14 +692,14 @@ msgid "" "of a specific severity to a specific location." msgstr "" -#: ../../howto/logging.rst:510 +#: ../../howto/logging.rst:513 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" "`FileHandler` in its examples." msgstr "" -#: ../../howto/logging.rst:514 +#: ../../howto/logging.rst:517 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -701,7 +707,7 @@ msgid "" "not creating custom handlers) are the following configuration methods:" msgstr "" -#: ../../howto/logging.rst:519 +#: ../../howto/logging.rst:522 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " @@ -711,19 +717,19 @@ msgid "" "on." msgstr "" -#: ../../howto/logging.rst:525 +#: ../../howto/logging.rst:528 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." msgstr "" -#: ../../howto/logging.rst:528 +#: ../../howto/logging.rst:531 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." msgstr "" -#: ../../howto/logging.rst:531 +#: ../../howto/logging.rst:534 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -731,11 +737,11 @@ msgid "" "behavior that child classes can use (or override)." msgstr "" -#: ../../howto/logging.rst:538 +#: ../../howto/logging.rst:541 msgid "Formatters" msgstr "" -#: ../../howto/logging.rst:540 +#: ../../howto/logging.rst:543 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -745,20 +751,20 @@ msgid "" "string and a style indicator." msgstr "" -#: ../../howto/logging.rst:549 +#: ../../howto/logging.rst:552 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -#: ../../howto/logging.rst:556 +#: ../../howto/logging.rst:559 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " "``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " "used." msgstr "" -#: ../../howto/logging.rst:559 +#: ../../howto/logging.rst:562 msgid "" "If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" @@ -768,18 +774,18 @@ msgid "" "should conform to what is expected by :meth:`string.Template.substitute`." msgstr "" -#: ../../howto/logging.rst:566 +#: ../../howto/logging.rst:569 msgid "Added the ``style`` parameter." msgstr "新增 ``style`` 參數。" -#: ../../howto/logging.rst:569 +#: ../../howto/logging.rst:572 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " "that order::" msgstr "" -#: ../../howto/logging.rst:575 +#: ../../howto/logging.rst:578 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -790,68 +796,68 @@ msgid "" "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -#: ../../howto/logging.rst:585 +#: ../../howto/logging.rst:588 msgid "Configuring Logging" msgstr "" -#: ../../howto/logging.rst:589 +#: ../../howto/logging.rst:592 msgid "Programmers can configure logging in three ways:" msgstr "" -#: ../../howto/logging.rst:591 +#: ../../howto/logging.rst:594 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." msgstr "" -#: ../../howto/logging.rst:593 +#: ../../howto/logging.rst:596 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" -#: ../../howto/logging.rst:595 +#: ../../howto/logging.rst:598 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "" -#: ../../howto/logging.rst:598 +#: ../../howto/logging.rst:601 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " "console handler, and a simple formatter using Python code::" msgstr "" -#: ../../howto/logging.rst:628 +#: ../../howto/logging.rst:631 msgid "" "Running this module from the command line produces the following output:" msgstr "" -#: ../../howto/logging.rst:639 +#: ../../howto/logging.rst:642 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " "being the names of the objects::" msgstr "" -#: ../../howto/logging.rst:658 +#: ../../howto/logging.rst:661 msgid "Here is the logging.conf file:" msgstr "" -#: ../../howto/logging.rst:690 +#: ../../howto/logging.rst:693 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "" -#: ../../howto/logging.rst:701 +#: ../../howto/logging.rst:704 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " "ability of noncoders to easily modify the logging properties." msgstr "" -#: ../../howto/logging.rst:705 +#: ../../howto/logging.rst:708 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -862,7 +868,7 @@ msgid "" "information, and specify ``False`` for this parameter if you wish." msgstr "" -#: ../../howto/logging.rst:713 +#: ../../howto/logging.rst:716 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -871,7 +877,7 @@ msgid "" "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -#: ../../howto/logging.rst:723 +#: ../../howto/logging.rst:726 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -882,7 +888,7 @@ msgid "" "path)." msgstr "" -#: ../../howto/logging.rst:731 +#: ../../howto/logging.rst:734 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -897,23 +903,23 @@ msgid "" "a socket, or use whatever approach makes sense for your application." msgstr "" -#: ../../howto/logging.rst:743 +#: ../../howto/logging.rst:746 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -#: ../../howto/logging.rst:767 +#: ../../howto/logging.rst:770 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." msgstr "" -#: ../../howto/logging.rst:771 +#: ../../howto/logging.rst:774 msgid "What happens if no configuration is provided" msgstr "" -#: ../../howto/logging.rst:773 +#: ../../howto/logging.rst:776 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " @@ -921,27 +927,27 @@ msgid "" "circumstances is dependent on the Python version." msgstr "" -#: ../../howto/logging.rst:778 +#: ../../howto/logging.rst:781 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:780 +#: ../../howto/logging.rst:783 msgid "" "If *logging.raiseExceptions* is ``False`` (production mode), the event is " "silently dropped." msgstr "" -#: ../../howto/logging.rst:783 +#: ../../howto/logging.rst:786 msgid "" "If *logging.raiseExceptions* is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -#: ../../howto/logging.rst:786 +#: ../../howto/logging.rst:789 msgid "In Python 3.2 and later, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:788 +#: ../../howto/logging.rst:791 msgid "" "The event is output using a 'handler of last resort', stored in ``logging." "lastResort``. This internal handler is not associated with any logger, and " @@ -953,17 +959,17 @@ msgid "" "severities will be output." msgstr "" -#: ../../howto/logging.rst:797 +#: ../../howto/logging.rst:800 msgid "" "To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to " "``None``." msgstr "" -#: ../../howto/logging.rst:802 +#: ../../howto/logging.rst:805 msgid "Configuring Logging for a Library" msgstr "" -#: ../../howto/logging.rst:804 +#: ../../howto/logging.rst:807 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -974,7 +980,7 @@ msgid "" "is regarded as the best default behaviour." msgstr "" -#: ../../howto/logging.rst:812 +#: ../../howto/logging.rst:815 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -986,7 +992,7 @@ msgid "" "to those handlers, as normal." msgstr "" -#: ../../howto/logging.rst:821 +#: ../../howto/logging.rst:824 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -997,14 +1003,14 @@ msgid "" "etc. then the code::" msgstr "" -#: ../../howto/logging.rst:832 +#: ../../howto/logging.rst:835 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " "just 'foo'." msgstr "" -#: ../../howto/logging.rst:836 +#: ../../howto/logging.rst:839 msgid "" "It is strongly advised that you *do not log to the root logger* in your " "library. Instead, use a logger with a unique and easily identifiable name, " @@ -1014,7 +1020,7 @@ msgid "" "library as they wish." msgstr "" -#: ../../howto/logging.rst:843 +#: ../../howto/logging.rst:846 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1025,11 +1031,11 @@ msgid "" "carry out unit tests and deliver logs which suit their requirements." msgstr "" -#: ../../howto/logging.rst:854 +#: ../../howto/logging.rst:857 msgid "Logging Levels" msgstr "" -#: ../../howto/logging.rst:856 +#: ../../howto/logging.rst:859 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1038,39 +1044,39 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../howto/logging.rst:863 +#: ../../howto/logging.rst:866 msgid "Numeric value" msgstr "" -#: ../../howto/logging.rst:865 +#: ../../howto/logging.rst:868 msgid "50" msgstr "50" -#: ../../howto/logging.rst:867 +#: ../../howto/logging.rst:870 msgid "40" msgstr "40" -#: ../../howto/logging.rst:869 +#: ../../howto/logging.rst:872 msgid "30" msgstr "30" -#: ../../howto/logging.rst:871 +#: ../../howto/logging.rst:874 msgid "20" msgstr "20" -#: ../../howto/logging.rst:873 +#: ../../howto/logging.rst:876 msgid "10" msgstr "10" -#: ../../howto/logging.rst:875 +#: ../../howto/logging.rst:878 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../howto/logging.rst:875 +#: ../../howto/logging.rst:878 msgid "0" msgstr "0" -#: ../../howto/logging.rst:878 +#: ../../howto/logging.rst:881 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1080,14 +1086,14 @@ msgid "" "basic mechanism controlling the verbosity of logging output." msgstr "" -#: ../../howto/logging.rst:885 +#: ../../howto/logging.rst:888 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." "LogRecord` instance is created from the logging message." msgstr "" -#: ../../howto/logging.rst:889 +#: ../../howto/logging.rst:892 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1104,7 +1110,7 @@ msgid "" "at which point the passing to ancestor handlers stops)." msgstr "" -#: ../../howto/logging.rst:903 +#: ../../howto/logging.rst:906 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1114,11 +1120,11 @@ msgid "" "`~Handler.emit`." msgstr "" -#: ../../howto/logging.rst:912 +#: ../../howto/logging.rst:915 msgid "Custom Levels" msgstr "" -#: ../../howto/logging.rst:914 +#: ../../howto/logging.rst:917 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1131,27 +1137,27 @@ msgid "" "given numeric value might mean different things for different libraries." msgstr "" -#: ../../howto/logging.rst:927 +#: ../../howto/logging.rst:930 msgid "Useful Handlers" msgstr "" -#: ../../howto/logging.rst:929 +#: ../../howto/logging.rst:932 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" msgstr "" -#: ../../howto/logging.rst:932 +#: ../../howto/logging.rst:935 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." msgstr "" -#: ../../howto/logging.rst:935 +#: ../../howto/logging.rst:938 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" -#: ../../howto/logging.rst:937 +#: ../../howto/logging.rst:940 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1159,61 +1165,61 @@ msgid "" "`~handlers.TimedRotatingFileHandler`." msgstr "" -#: ../../howto/logging.rst:942 +#: ../../howto/logging.rst:945 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -#: ../../howto/logging.rst:945 +#: ../../howto/logging.rst:948 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." msgstr "" -#: ../../howto/logging.rst:948 +#: ../../howto/logging.rst:951 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:951 +#: ../../howto/logging.rst:954 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:954 +#: ../../howto/logging.rst:957 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." msgstr "" -#: ../../howto/logging.rst:957 +#: ../../howto/logging.rst:960 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." msgstr "" -#: ../../howto/logging.rst:960 +#: ../../howto/logging.rst:963 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." msgstr "" -#: ../../howto/logging.rst:963 +#: ../../howto/logging.rst:966 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." msgstr "" -#: ../../howto/logging.rst:966 +#: ../../howto/logging.rst:969 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." msgstr "" -#: ../../howto/logging.rst:969 +#: ../../howto/logging.rst:972 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1221,13 +1227,13 @@ msgid "" "support the underlying mechanism used." msgstr "" -#: ../../howto/logging.rst:974 +#: ../../howto/logging.rst:977 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../howto/logging.rst:977 +#: ../../howto/logging.rst:980 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " @@ -1236,15 +1242,15 @@ msgid "" "more information." msgstr "" -#: ../../howto/logging.rst:983 +#: ../../howto/logging.rst:986 msgid "The :class:`NullHandler` class." msgstr "" -#: ../../howto/logging.rst:986 +#: ../../howto/logging.rst:989 msgid "The :class:`~handlers.QueueHandler` class." msgstr "" -#: ../../howto/logging.rst:989 +#: ../../howto/logging.rst:992 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1252,14 +1258,14 @@ msgid "" "module, :mod:`logging.config`, for configuration functionality.)" msgstr "" -#: ../../howto/logging.rst:994 +#: ../../howto/logging.rst:997 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " "for use with the % operator and a dictionary." msgstr "" -#: ../../howto/logging.rst:998 +#: ../../howto/logging.rst:1001 msgid "" "For formatting multiple messages in a batch, instances of :class:`~handlers." "BufferingFormatter` can be used. In addition to the format string (which is " @@ -1267,7 +1273,7 @@ msgid "" "trailer format strings." msgstr "" -#: ../../howto/logging.rst:1003 +#: ../../howto/logging.rst:1006 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1277,18 +1283,18 @@ msgid "" "value, the message is not processed further." msgstr "" -#: ../../howto/logging.rst:1010 +#: ../../howto/logging.rst:1013 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " "children are allowed through the filter, and all others dropped." msgstr "" -#: ../../howto/logging.rst:1018 +#: ../../howto/logging.rst:1021 msgid "Exceptions raised during logging" msgstr "" -#: ../../howto/logging.rst:1020 +#: ../../howto/logging.rst:1023 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1296,7 +1302,7 @@ msgid "" "errors - do not cause the application using logging to terminate prematurely." msgstr "" -#: ../../howto/logging.rst:1025 +#: ../../howto/logging.rst:1028 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1304,7 +1310,7 @@ msgid "" "handleError` method." msgstr "" -#: ../../howto/logging.rst:1030 +#: ../../howto/logging.rst:1033 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1312,7 +1318,7 @@ msgid "" "the exception is swallowed." msgstr "" -#: ../../howto/logging.rst:1035 +#: ../../howto/logging.rst:1038 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1320,11 +1326,11 @@ msgid "" "production usage." msgstr "" -#: ../../howto/logging.rst:1045 +#: ../../howto/logging.rst:1048 msgid "Using arbitrary objects as messages" msgstr "" -#: ../../howto/logging.rst:1047 +#: ../../howto/logging.rst:1050 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -1336,11 +1342,11 @@ msgid "" "the wire." msgstr "" -#: ../../howto/logging.rst:1058 +#: ../../howto/logging.rst:1061 msgid "Optimization" msgstr "" -#: ../../howto/logging.rst:1060 +#: ../../howto/logging.rst:1063 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -1351,13 +1357,13 @@ msgid "" "code like this::" msgstr "" -#: ../../howto/logging.rst:1072 +#: ../../howto/logging.rst:1075 msgid "" "so that if the logger's threshold is set above ``DEBUG``, the calls to :func:" "`expensive_func1` and :func:`expensive_func2` are never made." msgstr "" -#: ../../howto/logging.rst:1075 +#: ../../howto/logging.rst:1078 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -1369,7 +1375,7 @@ msgid "" "while the application is running (which is not all that common)." msgstr "" -#: ../../howto/logging.rst:1084 +#: ../../howto/logging.rst:1087 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -1377,82 +1383,94 @@ msgid "" "you don't need:" msgstr "" -#: ../../howto/logging.rst:1090 +#: ../../howto/logging.rst:1093 msgid "What you don't want to collect" msgstr "" -#: ../../howto/logging.rst:1090 +#: ../../howto/logging.rst:1093 msgid "How to avoid collecting it" msgstr "" -#: ../../howto/logging.rst:1092 +#: ../../howto/logging.rst:1095 msgid "Information about where calls were made from." msgstr "" -#: ../../howto/logging.rst:1092 +#: ../../howto/logging.rst:1095 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -#: ../../howto/logging.rst:1098 +#: ../../howto/logging.rst:1101 msgid "Threading information." msgstr "" -#: ../../howto/logging.rst:1098 +#: ../../howto/logging.rst:1101 msgid "Set ``logging.logThreads`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1100 +#: ../../howto/logging.rst:1103 msgid "Current process ID (:func:`os.getpid`)" msgstr "" -#: ../../howto/logging.rst:1100 +#: ../../howto/logging.rst:1103 msgid "Set ``logging.logProcesses`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1102 +#: ../../howto/logging.rst:1105 msgid "" "Current process name when using ``multiprocessing`` to manage multiple " "processes." msgstr "" -#: ../../howto/logging.rst:1102 +#: ../../howto/logging.rst:1105 msgid "Set ``logging.logMultiprocessing`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1106 +#: ../../howto/logging.rst:1108 +msgid "Current :class:`asyncio.Task` name when using ``asyncio``." +msgstr "" + +#: ../../howto/logging.rst:1108 +msgid "Set ``logging.logAsyncioTasks`` to ``False``." +msgstr "" + +#: ../../howto/logging.rst:1112 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " "won't take up any memory." msgstr "" -#: ../../howto/logging.rst:1113 +#: ../../howto/logging.rst:1119 +msgid "Other resources" +msgstr "" + +#: ../../howto/logging.rst:1124 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging.rst:1113 +#: ../../howto/logging.rst:1124 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging.rst:1116 +#: ../../howto/logging.rst:1127 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging.rst:1116 +#: ../../howto/logging.rst:1127 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging.rst:1119 +#: ../../howto/logging.rst:1130 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging.rst:1119 +#: ../../howto/logging.rst:1130 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging.rst:1121 +#: ../../howto/logging.rst:1132 msgid ":ref:`A logging cookbook `" msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po new file mode 100644 index 0000000000..3fb4ec18fe --- /dev/null +++ b/howto/perf_profiling.po @@ -0,0 +1,151 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../howto/perf_profiling.rst:7 +msgid "Python support for the Linux ``perf`` profiler" +msgstr "" + +#: ../../howto/perf_profiling.rst:0 +msgid "author" +msgstr "" + +#: ../../howto/perf_profiling.rst:9 +msgid "Pablo Galindo" +msgstr "" + +#: ../../howto/perf_profiling.rst:11 +msgid "" +"`The Linux perf profiler `_ is a very powerful " +"tool that allows you to profile and obtain information about the performance " +"of your application. ``perf`` also has a very vibrant ecosystem of tools " +"that aid with the analysis of the data that it produces." +msgstr "" + +#: ../../howto/perf_profiling.rst:17 +msgid "" +"The main problem with using the ``perf`` profiler with Python applications " +"is that ``perf`` only gets information about native symbols, that is, the " +"names of functions and procedures written in C. This means that the names " +"and file names of Python functions in your code will not appear in the " +"output of ``perf``." +msgstr "" + +#: ../../howto/perf_profiling.rst:22 +msgid "" +"Since Python 3.12, the interpreter can run in a special mode that allows " +"Python functions to appear in the output of the ``perf`` profiler. When this " +"mode is enabled, the interpreter will interpose a small piece of code " +"compiled on the fly before the execution of every Python function and it " +"will teach ``perf`` the relationship between this piece of code and the " +"associated Python function using :doc:`perf map files <../c-api/perfmaps>`." +msgstr "" + +#: ../../howto/perf_profiling.rst:31 +msgid "" +"Support for the ``perf`` profiler is currently only available for Linux on " +"select architectures. Check the output of the ``configure`` build step or " +"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to " +"see if your system is supported." +msgstr "" + +#: ../../howto/perf_profiling.rst:36 +msgid "For example, consider the following script:" +msgstr "" + +#: ../../howto/perf_profiling.rst:55 +msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" +msgstr "" + +#: ../../howto/perf_profiling.rst:59 +msgid "Then we can use ``perf report`` to analyze the data:" +msgstr "" + +#: ../../howto/perf_profiling.rst:100 +msgid "" +"As you can see, the Python functions are not shown in the output, only " +"``_Py_Eval_EvalFrameDefault`` (the function that evaluates the Python " +"bytecode) shows up. Unfortunately that's not very useful because all Python " +"functions use the same C function to evaluate bytecode so we cannot know " +"which Python function corresponds to which bytecode-evaluating function." +msgstr "" + +#: ../../howto/perf_profiling.rst:105 +msgid "" +"Instead, if we run the same experiment with ``perf`` support enabled we get:" +msgstr "" + +#: ../../howto/perf_profiling.rst:152 +msgid "How to enable ``perf`` profiling support" +msgstr "" + +#: ../../howto/perf_profiling.rst:154 +msgid "" +"``perf`` profiling support can be enabled either from the start using the " +"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-" +"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :" +"func:`sys.deactivate_stack_trampoline`." +msgstr "" + +#: ../../howto/perf_profiling.rst:160 +msgid "" +"The :mod:`!sys` functions take precedence over the :option:`!-X` option, " +"the :option:`!-X` option takes precedence over the environment variable." +msgstr "" + +#: ../../howto/perf_profiling.rst:163 +msgid "Example, using the environment variable::" +msgstr "" + +#: ../../howto/perf_profiling.rst:169 +msgid "Example, using the :option:`!-X` option::" +msgstr "" + +#: ../../howto/perf_profiling.rst:174 +msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" +msgstr "" + +#: ../../howto/perf_profiling.rst:186 +msgid "...then::" +msgstr "" + +#: ../../howto/perf_profiling.rst:193 +msgid "How to obtain the best results" +msgstr "" + +#: ../../howto/perf_profiling.rst:195 +msgid "" +"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" +"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " +"using only the frame pointer and not on DWARF debug information. This is " +"because as the code that is interposed to allow ``perf`` support is " +"dynamically generated it doesn't have any DWARF debugging information " +"available." +msgstr "" + +#: ../../howto/perf_profiling.rst:202 +msgid "" +"You can check if your system has been compiled with this flag by running::" +msgstr "" + +#: ../../howto/perf_profiling.rst:206 +msgid "" +"If you don't see any output it means that your interpreter has not been " +"compiled with frame pointers and therefore it may not be able to show Python " +"functions in the output of ``perf``." +msgstr "" diff --git a/howto/regex.po b/howto/regex.po index 8790db2968..9d51ba84f5 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -225,8 +225,8 @@ msgstr "``\\s``" #: ../../howto/regex.rst:137 msgid "" -"Matches any whitespace character; this is equivalent to the class ``[ \\t\\n" -"\\r\\f\\v]``." +"Matches any whitespace character; this is equivalent to the class " +"``[ \\t\\n\\r\\f\\v]``." msgstr "" #: ../../howto/regex.rst:142 @@ -633,13 +633,13 @@ msgid "" "for a complete listing." msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:418 -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 +#: ../../howto/regex.rst:1060 msgid "Method/Attribute" msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:418 -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 +#: ../../howto/regex.rst:1060 msgid "Purpose" msgstr "" @@ -688,20 +688,16 @@ msgstr "" #: ../../howto/regex.rst:380 msgid "" "You can learn about this by interactively experimenting with the :mod:`re` " -"module. If you have :mod:`tkinter` available, you may also want to look at :" -"source:`Tools/demo/redemo.py`, a demonstration program included with the " -"Python distribution. It allows you to enter REs and strings, and displays " -"whether the RE matches or fails. :file:`redemo.py` can be quite useful when " -"trying to debug a complicated RE." +"module." msgstr "" -#: ../../howto/regex.rst:387 +#: ../../howto/regex.rst:383 msgid "" "This HOWTO uses the standard Python interpreter for its examples. First, run " "the Python interpreter, import the :mod:`re` module, and compile a RE::" msgstr "" -#: ../../howto/regex.rst:395 +#: ../../howto/regex.rst:391 msgid "" "Now, you can try matching various strings against the RE ``[a-z]+``. An " "empty string shouldn't match at all, since ``+`` means 'one or more " @@ -710,57 +706,57 @@ msgid "" "print the result of :meth:`!match` to make this clear. ::" msgstr "" -#: ../../howto/regex.rst:405 +#: ../../howto/regex.rst:401 msgid "" "Now, let's try it on a string that it should match, such as ``tempo``. In " "this case, :meth:`~re.Pattern.match` will return a :ref:`match object `, so you should store the result in a variable for later use. ::" msgstr "" -#: ../../howto/regex.rst:413 +#: ../../howto/regex.rst:409 msgid "" "Now you can query the :ref:`match object ` for information " "about the matching string. Match object instances also have several methods " "and attributes; the most important ones are:" msgstr "" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:416 msgid "``group()``" msgstr "``group()``" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:416 msgid "Return the string matched by the RE" msgstr "" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:418 msgid "``start()``" msgstr "``start()``" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:418 msgid "Return the starting position of the match" msgstr "" -#: ../../howto/regex.rst:424 +#: ../../howto/regex.rst:420 msgid "``end()``" msgstr "``end()``" -#: ../../howto/regex.rst:424 +#: ../../howto/regex.rst:420 msgid "Return the ending position of the match" msgstr "" -#: ../../howto/regex.rst:426 +#: ../../howto/regex.rst:422 msgid "``span()``" msgstr "``span()``" -#: ../../howto/regex.rst:426 +#: ../../howto/regex.rst:422 msgid "Return a tuple containing the (start, end) positions of the match" msgstr "" -#: ../../howto/regex.rst:430 +#: ../../howto/regex.rst:426 msgid "Trying these methods will soon clarify their meaning::" msgstr "" -#: ../../howto/regex.rst:439 +#: ../../howto/regex.rst:435 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -772,20 +768,20 @@ msgid "" "case. ::" msgstr "" -#: ../../howto/regex.rst:456 +#: ../../howto/regex.rst:452 msgid "" "In actual programs, the most common style is to store the :ref:`match object " "` in a variable, and then check if it was ``None``. This " "usually looks like::" msgstr "" -#: ../../howto/regex.rst:467 +#: ../../howto/regex.rst:463 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" msgstr "" -#: ../../howto/regex.rst:474 +#: ../../howto/regex.rst:470 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -794,7 +790,7 @@ msgid "" "`SyntaxError`. See :ref:`the-backslash-plague`." msgstr "" -#: ../../howto/regex.rst:480 +#: ../../howto/regex.rst:476 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " @@ -802,11 +798,11 @@ msgid "" "`iterator`::" msgstr "" -#: ../../howto/regex.rst:496 +#: ../../howto/regex.rst:492 msgid "Module-Level Functions" msgstr "" -#: ../../howto/regex.rst:498 +#: ../../howto/regex.rst:494 msgid "" "You don't have to create a pattern object and call its methods; the :mod:" "`re` module also provides top-level functions called :func:`~re.match`, :" @@ -816,7 +812,7 @@ msgid "" "``None`` or a :ref:`match object ` instance. ::" msgstr "" -#: ../../howto/regex.rst:510 +#: ../../howto/regex.rst:506 msgid "" "Under the hood, these functions simply create a pattern object for you and " "call the appropriate method on it. They also store the compiled object in a " @@ -824,7 +820,7 @@ msgid "" "again and again." msgstr "" -#: ../../howto/regex.rst:515 +#: ../../howto/regex.rst:511 msgid "" "Should you use these module-level functions, or should you get the pattern " "and call its methods yourself? If you're accessing a regex within a loop, " @@ -832,11 +828,11 @@ msgid "" "not much difference thanks to the internal cache." msgstr "" -#: ../../howto/regex.rst:523 +#: ../../howto/regex.rst:519 msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:525 +#: ../../howto/regex.rst:521 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -848,72 +844,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:533 +#: ../../howto/regex.rst:529 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:533 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:533 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:535 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:535 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:543 +#: ../../howto/regex.rst:539 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:543 +#: ../../howto/regex.rst:539 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:542 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:542 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:544 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:544 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:550 +#: ../../howto/regex.rst:546 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:550 +#: ../../howto/regex.rst:546 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:553 +#: ../../howto/regex.rst:549 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:553 +#: ../../howto/regex.rst:549 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:562 +#: ../../howto/regex.rst:558 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -922,20 +918,20 @@ msgid "" "z]`` or ``[A-Z]`` are used in combination with the :const:`IGNORECASE` flag, " "they will match the 52 ASCII letters and 4 additional non-ASCII letters: " "'İ' (U+0130, Latin capital letter I with dot above), 'ı' (U+0131, Latin " -"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and 'K' (U" -"+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " +"small letter dotless i), 'ſ' (U+017F, Latin small letter long s) and " +"'K' (U+212A, Kelvin sign). ``Spam`` will match ``'Spam'``, ``'spam'``, " "``'spAM'``, or ``'ſpam'`` (the latter is matched only in Unicode mode). This " "lowercasing doesn't take the current locale into account; it will if you " "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:580 +#: ../../howto/regex.rst:576 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:583 +#: ../../howto/regex.rst:579 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -954,13 +950,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:605 +#: ../../howto/regex.rst:601 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:608 +#: ../../howto/regex.rst:604 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -971,20 +967,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:621 +#: ../../howto/regex.rst:617 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:629 +#: ../../howto/regex.rst:625 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:638 +#: ../../howto/regex.rst:634 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -996,45 +992,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:647 +#: ../../howto/regex.rst:643 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:660 +#: ../../howto/regex.rst:656 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:666 +#: ../../howto/regex.rst:662 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:672 +#: ../../howto/regex.rst:668 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:674 +#: ../../howto/regex.rst:670 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:682 +#: ../../howto/regex.rst:678 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:684 +#: ../../howto/regex.rst:680 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:687 +#: ../../howto/regex.rst:683 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1046,11 +1042,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:703 +#: ../../howto/regex.rst:699 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:696 +#: ../../howto/regex.rst:692 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1060,17 +1056,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:702 +#: ../../howto/regex.rst:698 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:718 +#: ../../howto/regex.rst:714 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:706 +#: ../../howto/regex.rst:702 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1078,37 +1074,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:710 +#: ../../howto/regex.rst:706 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:718 +#: ../../howto/regex.rst:714 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:732 +#: ../../howto/regex.rst:728 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:721 +#: ../../howto/regex.rst:717 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:731 +#: ../../howto/regex.rst:727 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:738 +#: ../../howto/regex.rst:734 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:735 +#: ../../howto/regex.rst:731 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1117,19 +1113,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:741 +#: ../../howto/regex.rst:737 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:741 +#: ../../howto/regex.rst:737 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:776 +#: ../../howto/regex.rst:772 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:744 +#: ../../howto/regex.rst:740 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1137,45 +1133,45 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:749 +#: ../../howto/regex.rst:745 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:760 +#: ../../howto/regex.rst:756 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " -"literals and regular expression sequences. In Python's string literals, ``" -"\\b`` is the backspace character, ASCII value 8. If you're not using raw " +"literals and regular expression sequences. In Python's string literals, " +"``\\b`` is the backspace character, ASCII value 8. If you're not using raw " "strings, then Python will convert the ``\\b`` to a backspace, and your RE " "won't match as you expect it to. The following example looks the same as our " "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:774 +#: ../../howto/regex.rst:770 msgid "" -"Second, inside a character class, where there's no use for this assertion, ``" -"\\b`` represents the backspace character, for compatibility with Python's " +"Second, inside a character class, where there's no use for this assertion, " +"``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:781 +#: ../../howto/regex.rst:777 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:779 +#: ../../howto/regex.rst:775 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:784 +#: ../../howto/regex.rst:780 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:786 +#: ../../howto/regex.rst:782 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1184,14 +1180,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:799 +#: ../../howto/regex.rst:795 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:803 +#: ../../howto/regex.rst:799 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1201,7 +1197,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:814 +#: ../../howto/regex.rst:810 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1213,27 +1209,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:830 +#: ../../howto/regex.rst:826 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:843 +#: ../../howto/regex.rst:839 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:849 +#: ../../howto/regex.rst:845 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:855 +#: ../../howto/regex.rst:851 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1244,11 +1240,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:863 +#: ../../howto/regex.rst:859 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:869 +#: ../../howto/regex.rst:865 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1256,11 +1252,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:875 +#: ../../howto/regex.rst:871 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:877 +#: ../../howto/regex.rst:873 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1269,18 +1265,18 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:883 +#: ../../howto/regex.rst:879 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " -"single-keystroke metacharacters or new special sequences beginning with ``" -"\\`` without making Perl's regular expressions confusingly different from " +"single-keystroke metacharacters or new special sequences beginning with " +"``\\`` without making Perl's regular expressions confusingly different from " "standard REs. If they chose ``&`` as a new metacharacter, for example, old " "expressions would be assuming that ``&`` was a regular character and " "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:890 +#: ../../howto/regex.rst:886 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1291,20 +1287,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:898 +#: ../../howto/regex.rst:894 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:903 +#: ../../howto/regex.rst:899 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:906 +#: ../../howto/regex.rst:902 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1312,7 +1308,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:918 +#: ../../howto/regex.rst:914 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1325,13 +1321,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:927 +#: ../../howto/regex.rst:923 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:930 +#: ../../howto/regex.rst:926 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1343,52 +1339,52 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:945 +#: ../../howto/regex.rst:941 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:952 +#: ../../howto/regex.rst:948 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:963 +#: ../../howto/regex.rst:959 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:966 +#: ../../howto/regex.rst:962 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " "name instead of the number. This is another Python extension: ``(?P=name)`` " "indicates that the contents of the group called *name* should again be " "matched at the current point. The regular expression for finding doubled " -"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?P\\w+)\\s" -"+(?P=word)\\b``::" +"words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?" +"P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:979 +#: ../../howto/regex.rst:975 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:981 +#: ../../howto/regex.rst:977 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:989 +#: ../../howto/regex.rst:985 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:985 +#: ../../howto/regex.rst:981 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1397,18 +1393,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:994 +#: ../../howto/regex.rst:990 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:988 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:996 +#: ../../howto/regex.rst:992 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1416,15 +1412,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:997 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:1003 +#: ../../howto/regex.rst:999 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1005 +#: ../../howto/regex.rst:1001 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1434,24 +1430,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1012 +#: ../../howto/regex.rst:1008 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1015 +#: ../../howto/regex.rst:1011 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1015 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1021 +#: ../../howto/regex.rst:1017 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1462,18 +1458,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1029 +#: ../../howto/regex.rst:1025 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1031 +#: ../../howto/regex.rst:1027 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1035 +#: ../../howto/regex.rst:1031 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1481,75 +1477,75 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1040 +#: ../../howto/regex.rst:1036 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1042 +#: ../../howto/regex.rst:1038 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " -"``bat`` doesn't match at this point, try the rest of the pattern; if ``bat" -"$`` does match, the whole pattern will fail. The trailing ``$`` is required " -"to ensure that something like ``sample.batch``, where the extension only " -"starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that the " -"pattern works when there are multiple dots in the filename." +"``bat`` doesn't match at this point, try the rest of the pattern; if " +"``bat$`` does match, the whole pattern will fail. The trailing ``$`` is " +"required to ensure that something like ``sample.batch``, where the extension " +"only starts with ``bat``, will be allowed. The ``[^.]*`` makes sure that " +"the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1049 +#: ../../howto/regex.rst:1045 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1053 +#: ../../howto/regex.rst:1049 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1053 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1059 +#: ../../howto/regex.rst:1055 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1066 +#: ../../howto/regex.rst:1062 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1066 +#: ../../howto/regex.rst:1062 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1069 +#: ../../howto/regex.rst:1065 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1069 +#: ../../howto/regex.rst:1065 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1072 +#: ../../howto/regex.rst:1068 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1072 +#: ../../howto/regex.rst:1068 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1079 +#: ../../howto/regex.rst:1075 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1081 +#: ../../howto/regex.rst:1077 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1559,7 +1555,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1092 +#: ../../howto/regex.rst:1088 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1567,7 +1563,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1097 +#: ../../howto/regex.rst:1093 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1576,7 +1572,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1109 +#: ../../howto/regex.rst:1105 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1584,17 +1580,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1121 +#: ../../howto/regex.rst:1117 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1133 +#: ../../howto/regex.rst:1129 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1135 +#: ../../howto/regex.rst:1131 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1602,57 +1598,57 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1142 +#: ../../howto/regex.rst:1138 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1146 +#: ../../howto/regex.rst:1142 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1150 +#: ../../howto/regex.rst:1146 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1159 +#: ../../howto/regex.rst:1155 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1168 +#: ../../howto/regex.rst:1164 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1175 +#: ../../howto/regex.rst:1171 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " -"converted to a carriage return, and so forth. Unknown escapes such as ``" -"\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with the " -"substring matched by the corresponding group in the RE. This lets you " +"converted to a carriage return, and so forth. Unknown escapes such as " +"``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced with " +"the substring matched by the corresponding group in the RE. This lets you " "incorporate portions of the original text in the resulting replacement " "string." msgstr "" -#: ../../howto/regex.rst:1182 +#: ../../howto/regex.rst:1178 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1189 +#: ../../howto/regex.rst:1185 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1664,7 +1660,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1206 +#: ../../howto/regex.rst:1202 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1673,13 +1669,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1212 +#: ../../howto/regex.rst:1208 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1224 +#: ../../howto/regex.rst:1220 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1689,11 +1685,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1232 +#: ../../howto/regex.rst:1228 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1234 +#: ../../howto/regex.rst:1230 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1701,11 +1697,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1240 +#: ../../howto/regex.rst:1236 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1242 +#: ../../howto/regex.rst:1238 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1717,7 +1713,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1250 +#: ../../howto/regex.rst:1246 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1730,7 +1726,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1259 +#: ../../howto/regex.rst:1255 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1739,17 +1735,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1265 +#: ../../howto/regex.rst:1261 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1270 +#: ../../howto/regex.rst:1266 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1272 +#: ../../howto/regex.rst:1268 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1759,13 +1755,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1283 +#: ../../howto/regex.rst:1279 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1291 +#: ../../howto/regex.rst:1287 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1777,18 +1773,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1300 +#: ../../howto/regex.rst:1296 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1306 +#: ../../howto/regex.rst:1302 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1308 +#: ../../howto/regex.rst:1304 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1797,7 +1793,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1322 +#: ../../howto/regex.rst:1318 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1807,7 +1803,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1329 +#: ../../howto/regex.rst:1325 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1816,7 +1812,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1338 +#: ../../howto/regex.rst:1334 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1826,11 +1822,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1346 +#: ../../howto/regex.rst:1342 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1348 +#: ../../howto/regex.rst:1344 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1838,14 +1834,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1353 +#: ../../howto/regex.rst:1349 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1357 +#: ../../howto/regex.rst:1353 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1856,15 +1852,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1374 +#: ../../howto/regex.rst:1370 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1380 +#: ../../howto/regex.rst:1376 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1382 +#: ../../howto/regex.rst:1378 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1872,7 +1868,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1387 +#: ../../howto/regex.rst:1383 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/install/index.po b/install/index.po index e3ffd716df..3658d32d30 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-17 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,14 +49,14 @@ msgid "" "you almost certainly want that document rather than this one." msgstr "" -#: ../../distutils/_setuptools_disclaimer.rst:3 +#: ../../install/index.rst:28 msgid "" "This document is being retained solely until the ``setuptools`` " "documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " "independently covers all of the relevant information currently included here." msgstr "" -#: ../../install/index.rst:30 +#: ../../install/index.rst:34 msgid "" "This guide only covers the basic tools for building and distributing " "extensions that are provided as part of this version of Python. Third party " @@ -65,11 +65,11 @@ msgid "" "recommendations/>`__ in the Python Packaging User Guide for more information." msgstr "" -#: ../../install/index.rst:41 +#: ../../install/index.rst:45 msgid "Introduction" msgstr "簡介" -#: ../../install/index.rst:43 +#: ../../install/index.rst:47 msgid "" "In Python 2.0, the ``distutils`` API was first added to the standard " "library. This provided Linux distro maintainers with a standard way of " @@ -78,7 +78,7 @@ msgid "" "systems." msgstr "" -#: ../../install/index.rst:48 +#: ../../install/index.rst:52 msgid "" "In the many years since Python 2.0 was released, tightly coupling the build " "system and package installer to the language runtime release cycle has " @@ -87,22 +87,22 @@ msgid "" "than using ``distutils`` directly." msgstr "" -#: ../../install/index.rst:54 +#: ../../install/index.rst:58 msgid "" "See :ref:`installing-index` and :ref:`distributing-index` for more details." msgstr "" -#: ../../install/index.rst:56 +#: ../../install/index.rst:60 msgid "" "This legacy documentation is being retained only until we're confident that " "the ``setuptools`` documentation covers everything needed." msgstr "" -#: ../../install/index.rst:62 +#: ../../install/index.rst:66 msgid "Distutils based source distributions" msgstr "" -#: ../../install/index.rst:64 +#: ../../install/index.rst:68 msgid "" "If you download a module source distribution, you can tell pretty quickly if " "it was packaged and distributed in the standard way, i.e. using the " @@ -116,13 +116,13 @@ msgid "" "simple matter of running one command from a terminal::" msgstr "" -#: ../../install/index.rst:77 +#: ../../install/index.rst:81 msgid "" "For Windows, this command should be run from a command prompt window (:" "menuselection:`Start --> Accessories`)::" msgstr "" -#: ../../install/index.rst:82 +#: ../../install/index.rst:86 msgid "" "If all these things are true, then you already know how to build and install " "the modules you've just downloaded: Run the command above. Unless you need " @@ -131,22 +131,22 @@ msgid "" "you need to get out of this manual." msgstr "" -#: ../../install/index.rst:92 +#: ../../install/index.rst:96 msgid "Standard Build and Install" msgstr "" -#: ../../install/index.rst:94 +#: ../../install/index.rst:98 msgid "" "As described in section :ref:`inst-new-standard`, building and installing a " "module distribution using the Distutils is usually one simple command to run " "from a terminal::" msgstr "" -#: ../../install/index.rst:104 +#: ../../install/index.rst:108 msgid "Platform variations" msgstr "" -#: ../../install/index.rst:106 +#: ../../install/index.rst:110 msgid "" "You should always run the setup command from the distribution root " "directory, i.e. the top-level subdirectory that the module source " @@ -155,7 +155,7 @@ msgid "" "thing to do is::" msgstr "" -#: ../../install/index.rst:115 +#: ../../install/index.rst:119 msgid "" "On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded " "the archive file to :file:`C:\\\\Temp`, then it would unpack into :file:`C:\\" @@ -165,11 +165,11 @@ msgid "" "command prompt window and run::" msgstr "" -#: ../../install/index.rst:129 +#: ../../install/index.rst:133 msgid "Splitting the job up" msgstr "" -#: ../../install/index.rst:131 +#: ../../install/index.rst:135 msgid "" "Running ``setup.py install`` builds and installs all modules in one run. If " "you prefer to work incrementally---especially useful if you want to " @@ -181,13 +181,13 @@ msgid "" "privileges)." msgstr "" -#: ../../install/index.rst:139 +#: ../../install/index.rst:143 msgid "" "For example, you can build everything in one step, and then install " "everything in a second step, by invoking the setup script twice::" msgstr "" -#: ../../install/index.rst:145 +#: ../../install/index.rst:149 msgid "" "If you do this, you will notice that running the :command:`install` command " "first runs the :command:`build` command, which---in this case---quickly " @@ -195,7 +195,7 @@ msgid "" "directory is up-to-date." msgstr "" -#: ../../install/index.rst:150 +#: ../../install/index.rst:154 msgid "" "You may not need this ability to break things down often if all you do is " "install modules downloaded off the 'net, but it's very handy for more " @@ -203,11 +203,11 @@ msgid "" "extensions, you'll run lots of individual Distutils commands on their own." msgstr "" -#: ../../install/index.rst:159 +#: ../../install/index.rst:163 msgid "How building works" msgstr "" -#: ../../install/index.rst:161 +#: ../../install/index.rst:165 msgid "" "As implied above, the :command:`build` command is responsible for putting " "the files to install into a *build directory*. By default, this is :file:" @@ -216,18 +216,18 @@ msgid "" "directory with the :option:`!--build-base` option. For example::" msgstr "" -#: ../../install/index.rst:169 +#: ../../install/index.rst:173 msgid "" "(Or you could do this permanently with a directive in your system or " "personal Distutils configuration file; see section :ref:`inst-config-" "files`.) Normally, this isn't necessary." msgstr "" -#: ../../install/index.rst:173 +#: ../../install/index.rst:177 msgid "The default layout for the build tree is as follows::" msgstr "" -#: ../../install/index.rst:180 +#: ../../install/index.rst:184 msgid "" "where ```` expands to a brief description of the current OS/hardware " "platform and Python version. The first form, with just a :file:`lib` " @@ -241,18 +241,18 @@ msgid "" "Python and extensions) that will be installed." msgstr "" -#: ../../install/index.rst:190 +#: ../../install/index.rst:194 msgid "" "In the future, more directories will be added to handle Python scripts, " "documentation, binary executables, and whatever else is needed to handle the " "job of installing Python modules and applications." msgstr "" -#: ../../install/index.rst:198 +#: ../../install/index.rst:202 msgid "How installation works" msgstr "" -#: ../../install/index.rst:200 +#: ../../install/index.rst:204 msgid "" "After the :command:`build` command runs (whether you run it explicitly, or " "the :command:`install` command does it for you), the work of the :command:" @@ -261,7 +261,7 @@ msgid "" "installation directory." msgstr "" -#: ../../install/index.rst:206 +#: ../../install/index.rst:210 msgid "" "If you don't choose an installation directory---i.e., if you just run " "``setup.py install``\\ ---then the :command:`install` command installs to " @@ -272,69 +272,69 @@ msgid "" "pure\"):" msgstr "" -#: ../../install/index.rst:216 +#: ../../install/index.rst:220 msgid "Platform" msgstr "平台" -#: ../../install/index.rst:216 +#: ../../install/index.rst:220 msgid "Standard installation location" msgstr "" -#: ../../install/index.rst:216 +#: ../../install/index.rst:220 msgid "Default value" msgstr "" -#: ../../install/index.rst:216 ../../install/index.rst:742 -#: ../../install/index.rst:754 +#: ../../install/index.rst:220 ../../install/index.rst:746 +#: ../../install/index.rst:758 msgid "Notes" msgstr "註解" -#: ../../install/index.rst:218 +#: ../../install/index.rst:222 msgid "Unix (pure)" msgstr "" -#: ../../install/index.rst:218 ../../install/index.rst:431 +#: ../../install/index.rst:222 ../../install/index.rst:435 msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:218 ../../install/index.rst:220 +#: ../../install/index.rst:222 ../../install/index.rst:224 msgid ":file:`/usr/local/lib/python{X.Y}/site-packages`" msgstr ":file:`/usr/local/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:218 ../../install/index.rst:220 -#: ../../install/index.rst:744 +#: ../../install/index.rst:222 ../../install/index.rst:224 +#: ../../install/index.rst:748 msgid "\\(1)" msgstr "\\(1)" -#: ../../install/index.rst:220 +#: ../../install/index.rst:224 msgid "Unix (non-pure)" msgstr "" -#: ../../install/index.rst:220 ../../install/index.rst:432 +#: ../../install/index.rst:224 ../../install/index.rst:436 msgid ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" msgstr ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:222 +#: ../../install/index.rst:226 msgid "Windows" msgstr "Windows" -#: ../../install/index.rst:222 ../../install/index.rst:483 +#: ../../install/index.rst:226 ../../install/index.rst:487 msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" -#: ../../install/index.rst:222 +#: ../../install/index.rst:226 msgid ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" msgstr ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" -#: ../../install/index.rst:222 ../../install/index.rst:746 +#: ../../install/index.rst:226 ../../install/index.rst:750 msgid "\\(2)" msgstr "\\(2)" -#: ../../install/index.rst:225 ../../install/index.rst:766 +#: ../../install/index.rst:229 ../../install/index.rst:770 msgid "Notes:" msgstr "註解:" -#: ../../install/index.rst:228 +#: ../../install/index.rst:232 msgid "" "Most Linux distributions include Python as a standard part of the system, " "so :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` " @@ -343,13 +343,13 @@ msgid "" "local`." msgstr "" -#: ../../install/index.rst:234 +#: ../../install/index.rst:238 msgid "" "The default installation directory on Windows was :file:`C:\\\\Program " "Files\\\\Python` under Python 1.6a1, 1.5.2, and earlier." msgstr "" -#: ../../install/index.rst:237 +#: ../../install/index.rst:241 msgid "" ":file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that " "Python is installed to, and where it finds its libraries at run-time. They " @@ -364,7 +364,7 @@ msgid "" "find out my :file:`{prefix}` and :file:`{exec-prefix}`:" msgstr "" -#: ../../install/index.rst:259 +#: ../../install/index.rst:263 msgid "" "A few other placeholders are used in this document: :file:`{X.Y}` stands for " "the version of Python, for example ``3.2``; :file:`{abiflags}` will be " @@ -375,7 +375,7 @@ msgid "" "``python3.2`` on UNIX will typically use ``Python32`` on Windows." msgstr "" -#: ../../install/index.rst:267 +#: ../../install/index.rst:271 msgid "" "If you don't want to install modules to the standard location, or if you " "don't have permission to write there, then you need to read about alternate " @@ -384,11 +384,11 @@ msgid "" "install` on custom installations." msgstr "" -#: ../../install/index.rst:277 +#: ../../install/index.rst:281 msgid "Alternate Installation" msgstr "" -#: ../../install/index.rst:279 +#: ../../install/index.rst:283 msgid "" "Often, it is necessary or desirable to install modules to a location other " "than the standard location for third-party Python modules. For example, on " @@ -400,7 +400,7 @@ msgid "" "actually upgrading." msgstr "" -#: ../../install/index.rst:287 +#: ../../install/index.rst:291 msgid "" "The Distutils :command:`install` command is designed to make installing " "module distributions to an alternate location simple and painless. The " @@ -411,7 +411,7 @@ msgid "" "sections applies to you." msgstr "" -#: ../../install/index.rst:295 +#: ../../install/index.rst:299 msgid "" "Note that the various alternate installation schemes are mutually exclusive: " "you can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-" @@ -419,18 +419,18 @@ msgid "" "mix from these groups." msgstr "" -#: ../../install/index.rst:304 +#: ../../install/index.rst:308 msgid "Alternate installation: the user scheme" msgstr "" -#: ../../install/index.rst:306 +#: ../../install/index.rst:310 msgid "" "This scheme is designed to be the most convenient solution for users that " "don't have write permission to the global site-packages directory or don't " "want to install into it. It is enabled with a simple option::" msgstr "" -#: ../../install/index.rst:312 +#: ../../install/index.rst:316 msgid "" "Files will be installed into subdirectories of :data:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " @@ -438,75 +438,75 @@ msgid "" "`site.USER_SITE`). Here are the values for UNIX, including macOS:" msgstr "" -#: ../../install/index.rst:318 ../../install/index.rst:329 -#: ../../install/index.rst:380 ../../install/index.rst:429 -#: ../../install/index.rst:481 ../../install/index.rst:506 -#: ../../install/index.rst:742 ../../install/index.rst:754 +#: ../../install/index.rst:322 ../../install/index.rst:333 +#: ../../install/index.rst:384 ../../install/index.rst:433 +#: ../../install/index.rst:485 ../../install/index.rst:510 +#: ../../install/index.rst:746 ../../install/index.rst:758 msgid "Type of file" msgstr "" -#: ../../install/index.rst:318 ../../install/index.rst:329 -#: ../../install/index.rst:380 ../../install/index.rst:429 -#: ../../install/index.rst:481 +#: ../../install/index.rst:322 ../../install/index.rst:333 +#: ../../install/index.rst:384 ../../install/index.rst:433 +#: ../../install/index.rst:485 msgid "Installation directory" msgstr "" -#: ../../install/index.rst:320 ../../install/index.rst:331 -#: ../../install/index.rst:382 ../../install/index.rst:483 +#: ../../install/index.rst:324 ../../install/index.rst:335 +#: ../../install/index.rst:386 ../../install/index.rst:487 msgid "modules" msgstr "模組" -#: ../../install/index.rst:320 +#: ../../install/index.rst:324 msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:321 ../../install/index.rst:332 -#: ../../install/index.rst:383 ../../install/index.rst:433 -#: ../../install/index.rst:484 ../../install/index.rst:511 +#: ../../install/index.rst:325 ../../install/index.rst:336 +#: ../../install/index.rst:387 ../../install/index.rst:437 +#: ../../install/index.rst:488 ../../install/index.rst:515 msgid "scripts" msgstr "" -#: ../../install/index.rst:321 +#: ../../install/index.rst:325 msgid ":file:`{userbase}/bin`" msgstr ":file:`{userbase}/bin`" -#: ../../install/index.rst:322 ../../install/index.rst:333 -#: ../../install/index.rst:384 ../../install/index.rst:434 -#: ../../install/index.rst:485 ../../install/index.rst:512 +#: ../../install/index.rst:326 ../../install/index.rst:337 +#: ../../install/index.rst:388 ../../install/index.rst:438 +#: ../../install/index.rst:489 ../../install/index.rst:516 msgid "data" msgstr "" -#: ../../install/index.rst:322 ../../install/index.rst:333 +#: ../../install/index.rst:326 ../../install/index.rst:337 msgid ":file:`{userbase}`" msgstr ":file:`{userbase}`" -#: ../../install/index.rst:323 ../../install/index.rst:334 -#: ../../install/index.rst:385 ../../install/index.rst:435 -#: ../../install/index.rst:486 ../../install/index.rst:513 +#: ../../install/index.rst:327 ../../install/index.rst:338 +#: ../../install/index.rst:389 ../../install/index.rst:439 +#: ../../install/index.rst:490 ../../install/index.rst:517 msgid "C headers" msgstr "" -#: ../../install/index.rst:323 +#: ../../install/index.rst:327 msgid ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" msgstr ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" -#: ../../install/index.rst:326 +#: ../../install/index.rst:330 msgid "And here are the values used on Windows:" msgstr "" -#: ../../install/index.rst:331 +#: ../../install/index.rst:335 msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" -#: ../../install/index.rst:332 +#: ../../install/index.rst:336 msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" -#: ../../install/index.rst:334 +#: ../../install/index.rst:338 msgid ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" -#: ../../install/index.rst:337 +#: ../../install/index.rst:341 msgid "" "The advantage of using this scheme compared to the other ones described " "below is that the user site-packages directory is under normal conditions " @@ -515,7 +515,7 @@ msgid "" "file:`setup.py` script to finalize the installation." msgstr "" -#: ../../install/index.rst:343 +#: ../../install/index.rst:347 msgid "" "The :command:`build_ext` command also has a ``--user`` option to add :file:" "`{userbase}/include` to the compiler search path for header files and :file:" @@ -523,11 +523,11 @@ msgid "" "runtime search path for shared C libraries (rpath)." msgstr "" -#: ../../install/index.rst:352 +#: ../../install/index.rst:356 msgid "Alternate installation: the home scheme" msgstr "" -#: ../../install/index.rst:354 +#: ../../install/index.rst:358 msgid "" "The idea behind the \"home scheme\" is that you build and maintain a " "personal stash of Python modules. This scheme's name is derived from the " @@ -537,18 +537,18 @@ msgid "" "operating system they are installing for." msgstr "" -#: ../../install/index.rst:361 +#: ../../install/index.rst:365 msgid "Installing a new module distribution is as simple as ::" msgstr "" -#: ../../install/index.rst:365 +#: ../../install/index.rst:369 msgid "" "where you can supply any directory you like for the :option:`!--home` " "option. On Unix, lazy typists can just type a tilde (``~``); the :command:" "`install` command will expand this to your home directory::" msgstr "" -#: ../../install/index.rst:371 +#: ../../install/index.rst:375 msgid "" "To make Python find the distributions installed with this scheme, you may " "have to :ref:`modify Python's search path ` or edit :mod:" @@ -556,38 +556,38 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../install/index.rst:376 +#: ../../install/index.rst:380 msgid "" "The :option:`!--home` option defines the installation base directory. Files " "are installed to the following directories under the installation base as " "follows:" msgstr "" -#: ../../install/index.rst:382 +#: ../../install/index.rst:386 msgid ":file:`{home}/lib/python`" msgstr ":file:`{home}/lib/python`" -#: ../../install/index.rst:383 +#: ../../install/index.rst:387 msgid ":file:`{home}/bin`" msgstr ":file:`{home}/bin`" -#: ../../install/index.rst:384 +#: ../../install/index.rst:388 msgid ":file:`{home}`" msgstr ":file:`{home}`" -#: ../../install/index.rst:385 +#: ../../install/index.rst:389 msgid ":file:`{home}/include/python/{distname}`" msgstr ":file:`{home}/include/python/{distname}`" -#: ../../install/index.rst:388 +#: ../../install/index.rst:392 msgid "(Mentally replace slashes with backslashes if you're on Windows.)" msgstr "" -#: ../../install/index.rst:394 +#: ../../install/index.rst:398 msgid "Alternate installation: Unix (the prefix scheme)" msgstr "" -#: ../../install/index.rst:396 +#: ../../install/index.rst:400 msgid "" "The \"prefix scheme\" is useful when you wish to use one Python installation " "to perform the build/install (i.e., to run the setup script), but install " @@ -598,7 +598,7 @@ msgid "" "where the prefix scheme will be useful." msgstr "" -#: ../../install/index.rst:403 +#: ../../install/index.rst:407 msgid "" "First, consider that many Linux distributions put Python in :file:`/usr`, " "rather than the more traditional :file:`/usr/local`. This is entirely " @@ -608,7 +608,7 @@ msgid "" "rather than :file:`/usr/lib/python2.{X}`. This can be done with ::" msgstr "" -#: ../../install/index.rst:412 +#: ../../install/index.rst:416 msgid "" "Another possibility is a network filesystem where the name used to write to " "a remote directory is different from the name used to read it: for example, " @@ -618,7 +618,7 @@ msgid "" "{X}`. This could be done with ::" msgstr "" -#: ../../install/index.rst:421 +#: ../../install/index.rst:425 msgid "" "In either case, the :option:`!--prefix` option defines the installation " "base, and the :option:`!--exec-prefix` option defines the platform-specific " @@ -629,34 +629,34 @@ msgid "" "follows:" msgstr "" -#: ../../install/index.rst:431 ../../install/index.rst:508 +#: ../../install/index.rst:435 ../../install/index.rst:512 msgid "Python modules" msgstr "" -#: ../../install/index.rst:432 ../../install/index.rst:509 +#: ../../install/index.rst:436 ../../install/index.rst:513 msgid "extension modules" msgstr "" -#: ../../install/index.rst:433 +#: ../../install/index.rst:437 msgid ":file:`{prefix}/bin`" msgstr ":file:`{prefix}/bin`" -#: ../../install/index.rst:434 ../../install/index.rst:485 +#: ../../install/index.rst:438 ../../install/index.rst:489 msgid ":file:`{prefix}`" msgstr ":file:`{prefix}`" -#: ../../install/index.rst:435 +#: ../../install/index.rst:439 msgid ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" msgstr ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" -#: ../../install/index.rst:438 +#: ../../install/index.rst:442 msgid "" "There is no requirement that :option:`!--prefix` or :option:`!--exec-prefix` " "actually point to an alternate Python installation; if the directories " "listed above do not already exist, they are created at installation time." msgstr "" -#: ../../install/index.rst:442 +#: ../../install/index.rst:446 msgid "" "Incidentally, the real reason the prefix scheme is important is simply that " "a standard Unix installation uses the prefix scheme, but with :option:`!--" @@ -666,7 +666,7 @@ msgid "" "without any other options, you're using it." msgstr "" -#: ../../install/index.rst:449 +#: ../../install/index.rst:453 msgid "" "Note that installing extensions to an alternate Python installation has no " "effect on how those extensions are built: in particular, the Python header " @@ -681,11 +681,11 @@ msgid "" "immaterial.)" msgstr "" -#: ../../install/index.rst:464 +#: ../../install/index.rst:468 msgid "Alternate installation: Windows (the prefix scheme)" msgstr "" -#: ../../install/index.rst:466 +#: ../../install/index.rst:470 msgid "" "Windows has no concept of a user's home directory, and since the standard " "Python installation under Windows is simpler than under Unix, the :option:" @@ -693,13 +693,13 @@ msgid "" "packages in separate locations on Windows. ::" msgstr "" -#: ../../install/index.rst:473 +#: ../../install/index.rst:477 msgid "" "to install modules to the :file:`\\\\Temp\\\\Python` directory on the " "current drive." msgstr "" -#: ../../install/index.rst:475 +#: ../../install/index.rst:479 msgid "" "The installation base is defined by the :option:`!--prefix` option; the :" "option:`!--exec-prefix` option is not supported under Windows, which means " @@ -707,19 +707,19 @@ msgid "" "location. Files are installed as follows:" msgstr "" -#: ../../install/index.rst:484 +#: ../../install/index.rst:488 msgid ":file:`{prefix}\\\\Scripts`" msgstr ":file:`{prefix}\\\\Scripts`" -#: ../../install/index.rst:486 +#: ../../install/index.rst:490 msgid ":file:`{prefix}\\\\Include\\\\{distname}`" msgstr ":file:`{prefix}\\\\Include\\\\{distname}`" -#: ../../install/index.rst:493 +#: ../../install/index.rst:497 msgid "Custom Installation" msgstr "" -#: ../../install/index.rst:495 +#: ../../install/index.rst:499 msgid "" "Sometimes, the alternate installation schemes described in section :ref:" "`inst-alt-install` just don't do what you want. You might want to tweak " @@ -728,46 +728,46 @@ msgid "" "scheme. In either case, you're creating a *custom installation scheme*." msgstr "" -#: ../../install/index.rst:501 +#: ../../install/index.rst:505 msgid "" "To create a custom installation scheme, you start with one of the alternate " "schemes and override some of the installation directories used for the " "various types of files, using these options:" msgstr "" -#: ../../install/index.rst:506 +#: ../../install/index.rst:510 msgid "Override option" msgstr "" -#: ../../install/index.rst:508 +#: ../../install/index.rst:512 msgid "``--install-purelib``" msgstr "``--install-purelib``" -#: ../../install/index.rst:509 +#: ../../install/index.rst:513 msgid "``--install-platlib``" msgstr "``--install-platlib``" -#: ../../install/index.rst:510 +#: ../../install/index.rst:514 msgid "all modules" msgstr "" -#: ../../install/index.rst:510 +#: ../../install/index.rst:514 msgid "``--install-lib``" msgstr "``--install-lib``" -#: ../../install/index.rst:511 +#: ../../install/index.rst:515 msgid "``--install-scripts``" msgstr "``--install-scripts``" -#: ../../install/index.rst:512 +#: ../../install/index.rst:516 msgid "``--install-data``" msgstr "``--install-data``" -#: ../../install/index.rst:513 +#: ../../install/index.rst:517 msgid "``--install-headers``" msgstr "``--install-headers``" -#: ../../install/index.rst:516 +#: ../../install/index.rst:520 msgid "" "These override options can be relative, absolute, or explicitly defined in " "terms of one of the installation base directories. (There are two " @@ -779,7 +779,7 @@ msgid "" "between Python and extension modules.)" msgstr "" -#: ../../install/index.rst:525 +#: ../../install/index.rst:529 msgid "" "For example, say you're installing a module distribution to your home " "directory under Unix---but you want scripts to go in :file:`~/scripts` " @@ -790,7 +790,7 @@ msgid "" "case)::" msgstr "" -#: ../../install/index.rst:534 +#: ../../install/index.rst:538 msgid "" "Another Unix example: suppose your Python installation was built and " "installed with a prefix of :file:`/usr/local/python`, so under a standard " @@ -799,14 +799,14 @@ msgid "" "directory for the :option:`!--install-scripts` option::" msgstr "" -#: ../../install/index.rst:542 +#: ../../install/index.rst:546 msgid "" "(This performs an installation using the \"prefix scheme\", where the prefix " "is whatever your Python interpreter was installed with--- :file:`/usr/local/" "python` in this case.)" msgstr "" -#: ../../install/index.rst:546 +#: ../../install/index.rst:550 msgid "" "If you maintain Python on Windows, you might want third-party modules to " "live in a subdirectory of :file:`{prefix}`, rather than right in :file:" @@ -816,7 +816,7 @@ msgid "" "conveniently be both controlled by one option::" msgstr "" -#: ../../install/index.rst:555 +#: ../../install/index.rst:559 msgid "" "The specified installation directory is relative to :file:`{prefix}`. Of " "course, you also have to ensure that this directory is in Python's module " @@ -825,7 +825,7 @@ msgid "" "modify Python's search path." msgstr "" -#: ../../install/index.rst:561 +#: ../../install/index.rst:565 msgid "" "If you want to define an entire installation scheme, you just have to supply " "all of the installation directory options. The recommended way to do this " @@ -835,18 +835,18 @@ msgid "" "from, you might define the following installation scheme::" msgstr "" -#: ../../install/index.rst:574 +#: ../../install/index.rst:578 msgid "or, equivalently, ::" msgstr "" -#: ../../install/index.rst:582 +#: ../../install/index.rst:586 msgid "" "``$PLAT`` is not (necessarily) an environment variable---it will be expanded " "by the Distutils as it parses your command line options, just as it does " "when parsing your configuration file(s)." msgstr "" -#: ../../install/index.rst:586 +#: ../../install/index.rst:590 msgid "" "Obviously, specifying the entire installation scheme every time you install " "a new module distribution would be very tedious. Thus, you can put these " @@ -854,24 +854,24 @@ msgid "" "files`):" msgstr "" -#: ../../install/index.rst:599 +#: ../../install/index.rst:603 msgid "or, equivalently," msgstr "" -#: ../../install/index.rst:610 +#: ../../install/index.rst:614 msgid "" "Note that these two are *not* equivalent if you supply a different " "installation base directory when you run the setup script. For example, ::" msgstr "" -#: ../../install/index.rst:615 +#: ../../install/index.rst:619 msgid "" "would install pure modules to :file:`/tmp/python/lib` in the first case, and " "to :file:`/tmp/lib` in the second case. (For the second case, you probably " "want to supply an installation base of :file:`/tmp/python`.)" msgstr "" -#: ../../install/index.rst:619 +#: ../../install/index.rst:623 msgid "" "You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample " "configuration file input. These are Distutils configuration variables, " @@ -884,7 +884,7 @@ msgid "" "section :ref:`inst-config-files` for details." msgstr "" -#: ../../install/index.rst:629 +#: ../../install/index.rst:633 msgid "" "When a :ref:`virtual environment ` is activated, any options that " "change the installation path will be ignored from all distutils " @@ -892,11 +892,11 @@ msgid "" "the virtual environment." msgstr "" -#: ../../install/index.rst:643 +#: ../../install/index.rst:647 msgid "Modifying Python's Search Path" msgstr "" -#: ../../install/index.rst:645 +#: ../../install/index.rst:649 msgid "" "When the Python interpreter executes an :keyword:`import` statement, it " "searches for both Python code and extension modules along a search path. A " @@ -905,12 +905,12 @@ msgid "" "module and printing the value of ``sys.path``. ::" msgstr "" -#: ../../install/index.rst:662 +#: ../../install/index.rst:666 msgid "" "The null string in ``sys.path`` represents the current working directory." msgstr "" -#: ../../install/index.rst:664 +#: ../../install/index.rst:668 msgid "" "The expected convention for locally installed packages is to put them in " "the :file:`{...}/site-packages/` directory, but you may want to install " @@ -921,7 +921,7 @@ msgid "" "There are several different ways to add the directory." msgstr "" -#: ../../install/index.rst:672 +#: ../../install/index.rst:676 msgid "" "The most convenient way is to add a path configuration file to a directory " "that's already on Python's path, usually to the :file:`.../site-packages/` " @@ -932,14 +932,14 @@ msgid "" "this mechanism for installing fixed versions of standard modules.)" msgstr "" -#: ../../install/index.rst:680 +#: ../../install/index.rst:684 msgid "" "Paths can be absolute or relative, in which case they're relative to the " "directory containing the :file:`.pth` file. See the documentation of the :" "mod:`site` module for more information." msgstr "" -#: ../../install/index.rst:684 +#: ../../install/index.rst:688 msgid "" "A slightly less convenient way is to edit the :file:`site.py` file in " "Python's standard library, and modify ``sys.path``. :file:`site.py` is " @@ -948,7 +948,7 @@ msgid "" "simply edit :file:`site.py` and add two lines to it:" msgstr "" -#: ../../install/index.rst:695 +#: ../../install/index.rst:699 msgid "" "However, if you reinstall the same minor version of Python (perhaps when " "upgrading from 2.2 to 2.2.2, for example) :file:`site.py` will be " @@ -956,7 +956,7 @@ msgid "" "modified and save a copy before doing the installation." msgstr "" -#: ../../install/index.rst:700 +#: ../../install/index.rst:704 msgid "" "There are two environment variables that can modify ``sys.path``. :envvar:" "`PYTHONHOME` sets an alternate value for the prefix of the Python " @@ -965,7 +965,7 @@ msgid "" "Y/', '/www/python/lib/pythonX.Y/plat-linux2', ...]``." msgstr "" -#: ../../install/index.rst:706 +#: ../../install/index.rst:710 msgid "" "The :envvar:`PYTHONPATH` variable can be set to a list of paths that will be " "added to the beginning of ``sys.path``. For example, if :envvar:" @@ -975,17 +975,17 @@ msgid "" "don't exist.)" msgstr "" -#: ../../install/index.rst:713 +#: ../../install/index.rst:717 msgid "" "Finally, ``sys.path`` is just a regular Python list, so any Python " "application can modify it by adding or removing entries." msgstr "" -#: ../../install/index.rst:720 +#: ../../install/index.rst:724 msgid "Distutils Configuration Files" msgstr "" -#: ../../install/index.rst:722 +#: ../../install/index.rst:726 msgid "" "As mentioned above, you can use Distutils configuration files to record " "personal or site preferences for any Distutils options. That is, any option " @@ -997,76 +997,76 @@ msgid "" "files are overridden by \"later\" files." msgstr "" -#: ../../install/index.rst:735 +#: ../../install/index.rst:739 msgid "Location and names of config files" msgstr "" -#: ../../install/index.rst:737 +#: ../../install/index.rst:741 msgid "" "The names and locations of the configuration files vary slightly across " "platforms. On Unix and macOS, the three configuration files (in the order " "they are processed) are:" msgstr "" -#: ../../install/index.rst:742 ../../install/index.rst:754 +#: ../../install/index.rst:746 ../../install/index.rst:758 msgid "Location and filename" msgstr "" -#: ../../install/index.rst:744 ../../install/index.rst:756 +#: ../../install/index.rst:748 ../../install/index.rst:760 msgid "system" msgstr "" -#: ../../install/index.rst:744 +#: ../../install/index.rst:748 msgid ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" msgstr ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" -#: ../../install/index.rst:746 ../../install/index.rst:758 +#: ../../install/index.rst:750 ../../install/index.rst:762 msgid "personal" msgstr "" -#: ../../install/index.rst:746 +#: ../../install/index.rst:750 msgid ":file:`$HOME/.pydistutils.cfg`" msgstr ":file:`$HOME/.pydistutils.cfg`" -#: ../../install/index.rst:748 ../../install/index.rst:760 +#: ../../install/index.rst:752 ../../install/index.rst:764 msgid "local" msgstr "" -#: ../../install/index.rst:748 ../../install/index.rst:760 +#: ../../install/index.rst:752 ../../install/index.rst:764 msgid ":file:`setup.cfg`" msgstr ":file:`setup.cfg`" -#: ../../install/index.rst:748 ../../install/index.rst:760 +#: ../../install/index.rst:752 ../../install/index.rst:764 msgid "\\(3)" msgstr "\\(3)" -#: ../../install/index.rst:751 +#: ../../install/index.rst:755 msgid "And on Windows, the configuration files are:" msgstr "" -#: ../../install/index.rst:756 +#: ../../install/index.rst:760 msgid ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" msgstr ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" -#: ../../install/index.rst:756 +#: ../../install/index.rst:760 msgid "\\(4)" msgstr "\\(4)" -#: ../../install/index.rst:758 +#: ../../install/index.rst:762 msgid ":file:`%HOME%\\\\pydistutils.cfg`" msgstr ":file:`%HOME%\\\\pydistutils.cfg`" -#: ../../install/index.rst:758 +#: ../../install/index.rst:762 msgid "\\(5)" msgstr "\\(5)" -#: ../../install/index.rst:763 +#: ../../install/index.rst:767 msgid "" "On all platforms, the \"personal\" file can be temporarily disabled by " "passing the ``--no-user-cfg`` option." msgstr "" -#: ../../install/index.rst:769 +#: ../../install/index.rst:773 msgid "" "Strictly speaking, the system-wide configuration file lives in the directory " "where the Distutils are installed; under Python 1.6 and later on Unix, this " @@ -1075,7 +1075,7 @@ msgid "" "configuration file should be put there under Python 1.5.2." msgstr "" -#: ../../install/index.rst:776 +#: ../../install/index.rst:780 msgid "" "On Unix, if the :envvar:`HOME` environment variable is not defined, the " "user's home directory will be determined with the :func:`getpwuid` function " @@ -1083,12 +1083,12 @@ msgid "" "expanduser` function used by Distutils." msgstr "" -#: ../../install/index.rst:782 +#: ../../install/index.rst:786 msgid "" "I.e., in the current directory (usually the location of the setup script)." msgstr "" -#: ../../install/index.rst:785 +#: ../../install/index.rst:789 msgid "" "(See also note (1).) Under Python 1.6 and later, Python's default " "\"installation prefix\" is :file:`C:\\\\Python`, so the system configuration " @@ -1100,7 +1100,7 @@ msgid "" "Windows." msgstr "" -#: ../../install/index.rst:794 +#: ../../install/index.rst:798 msgid "" "On Windows, if the :envvar:`HOME` environment variable is not defined, :" "envvar:`USERPROFILE` then :envvar:`HOMEDRIVE` and :envvar:`HOMEPATH` will be " @@ -1108,11 +1108,11 @@ msgid "" "Distutils." msgstr "" -#: ../../install/index.rst:803 +#: ../../install/index.rst:807 msgid "Syntax of config files" msgstr "" -#: ../../install/index.rst:805 +#: ../../install/index.rst:809 msgid "" "The Distutils configuration files all have the same syntax. The config " "files are grouped into sections. There is one section for each Distutils " @@ -1121,13 +1121,13 @@ msgid "" "``option=value``." msgstr "" -#: ../../install/index.rst:810 +#: ../../install/index.rst:814 msgid "" "For example, the following is a complete config file that just forces all " "commands to run quietly by default:" msgstr "" -#: ../../install/index.rst:818 +#: ../../install/index.rst:822 msgid "" "If this is installed as the system config file, it will affect all " "processing of any Python module distribution by any user on the current " @@ -1137,18 +1137,18 @@ msgid "" "distribution, it affects only that distribution." msgstr "" -#: ../../install/index.rst:825 +#: ../../install/index.rst:829 msgid "" "You could override the default \"build base\" directory and make the :" "command:`build\\*` commands always forcibly rebuild all files with the " "following:" msgstr "" -#: ../../install/index.rst:835 +#: ../../install/index.rst:839 msgid "which corresponds to the command-line arguments ::" msgstr "" -#: ../../install/index.rst:839 +#: ../../install/index.rst:843 msgid "" "except that including the :command:`build` command on the command-line means " "that command will be run. Including a particular command in config files " @@ -1157,29 +1157,29 @@ msgid "" "values from it are run, they will use the values in the config file.)" msgstr "" -#: ../../install/index.rst:845 +#: ../../install/index.rst:849 msgid "" "You can find out the complete list of options for any command using the :" "option:`!--help` option, e.g.::" msgstr "" -#: ../../install/index.rst:850 +#: ../../install/index.rst:854 msgid "" "and you can find out the complete list of global options by using :option:" "`!--help` without a command::" msgstr "" -#: ../../install/index.rst:855 +#: ../../install/index.rst:859 msgid "" "See also the \"Reference\" section of the \"Distributing Python Modules\" " "manual." msgstr "" -#: ../../install/index.rst:861 +#: ../../install/index.rst:865 msgid "Building Extensions: Tips and Tricks" msgstr "" -#: ../../install/index.rst:863 +#: ../../install/index.rst:867 msgid "" "Whenever possible, the Distutils try to use the configuration information " "made available by the Python interpreter used to run the :file:`setup.py` " @@ -1189,11 +1189,11 @@ msgid "" "section discusses how to override the usual Distutils behaviour." msgstr "" -#: ../../install/index.rst:874 +#: ../../install/index.rst:878 msgid "Tweaking compiler/linker flags" msgstr "" -#: ../../install/index.rst:876 +#: ../../install/index.rst:880 msgid "" "Compiling a Python extension written in C or C++ will sometimes require " "specifying custom flags for the compiler and linker in order to use a " @@ -1202,7 +1202,7 @@ msgid "" "you're trying to cross-compile Python." msgstr "" -#: ../../install/index.rst:882 +#: ../../install/index.rst:886 msgid "" "In the most general case, the extension author might have foreseen that " "compiling the extensions would be complicated, and provided a :file:`Setup` " @@ -1211,18 +1211,18 @@ msgid "" "require elaborate sets of compiler flags in order to work." msgstr "" -#: ../../install/index.rst:888 +#: ../../install/index.rst:892 msgid "" "A :file:`Setup` file, if present, is parsed in order to get a list of " "extensions to build. Each line in a :file:`Setup` describes a single " "module. Lines have the following structure::" msgstr "" -#: ../../install/index.rst:895 +#: ../../install/index.rst:899 msgid "Let's examine each of the fields in turn." msgstr "" -#: ../../install/index.rst:897 +#: ../../install/index.rst:901 msgid "" "*module* is the name of the extension module to be built, and should be a " "valid Python identifier. You can't just change this in order to rename a " @@ -1230,7 +1230,7 @@ msgid "" "left alone." msgstr "" -#: ../../install/index.rst:901 +#: ../../install/index.rst:905 msgid "" "*sourcefile* is anything that's likely to be a source code file, at least " "judging by the filename. Filenames ending in :file:`.c` are assumed to be " @@ -1239,38 +1239,38 @@ msgid "" "assumed to be in Objective C." msgstr "" -#: ../../install/index.rst:907 +#: ../../install/index.rst:911 msgid "" "*cpparg* is an argument for the C preprocessor, and is anything starting " "with :option:`!-I`, :option:`!-D`, :option:`!-U` or :option:`!-C`." msgstr "" -#: ../../install/index.rst:910 +#: ../../install/index.rst:914 msgid "" "*library* is anything ending in :file:`.a` or beginning with :option:`!-l` " "or :option:`!-L`." msgstr "" -#: ../../install/index.rst:913 +#: ../../install/index.rst:917 msgid "" "If a particular platform requires a special library on your platform, you " "can add it by editing the :file:`Setup` file and running ``python setup.py " "build``. For example, if the module defined by the line ::" msgstr "" -#: ../../install/index.rst:919 +#: ../../install/index.rst:923 msgid "" "must be linked with the math library :file:`libm.a` on your platform, simply " "add :option:`!-lm` to the line::" msgstr "" -#: ../../install/index.rst:924 +#: ../../install/index.rst:928 msgid "" "Arbitrary switches intended for the compiler or the linker can be supplied " "with the :option:`!-Xcompiler` *arg* and :option:`!-Xlinker` *arg* options::" msgstr "" -#: ../../install/index.rst:929 +#: ../../install/index.rst:933 msgid "" "The next option after :option:`!-Xcompiler` and :option:`!-Xlinker` will be " "appended to the proper command line, so in the above example the compiler " @@ -1281,22 +1281,22 @@ msgid "" "Xcompiler c++``." msgstr "" -#: ../../install/index.rst:936 +#: ../../install/index.rst:940 msgid "" "Compiler flags can also be supplied through setting the :envvar:`CFLAGS` " "environment variable. If set, the contents of :envvar:`CFLAGS` will be " "added to the compiler flags specified in the :file:`Setup` file." msgstr "" -#: ../../install/index.rst:944 +#: ../../install/index.rst:948 msgid "Using non-Microsoft compilers on Windows" msgstr "" -#: ../../install/index.rst:951 +#: ../../install/index.rst:955 msgid "Borland/CodeGear C++" msgstr "" -#: ../../install/index.rst:953 +#: ../../install/index.rst:957 msgid "" "This subsection describes the necessary steps to use Distutils with the " "Borland C++ compiler version 5.5. First you have to know that Borland's " @@ -1307,7 +1307,7 @@ msgid "" "`python25.lib` into the Borland format. You can do this as follows:" msgstr "" -#: ../../install/index.rst:968 +#: ../../install/index.rst:972 msgid "" "The :file:`coff2omf` program comes with the Borland compiler. The file :" "file:`python25.lib` is in the :file:`Libs` directory of your Python " @@ -1315,13 +1315,13 @@ msgid "" "to convert them too." msgstr "" -#: ../../install/index.rst:973 +#: ../../install/index.rst:977 msgid "" "The converted files have to reside in the same directories as the normal " "libraries." msgstr "" -#: ../../install/index.rst:976 +#: ../../install/index.rst:980 msgid "" "How does Distutils manage to use these libraries with their changed names? " "If the extension needs a library (eg. :file:`foo`) Distutils checks first if " @@ -1330,46 +1330,46 @@ msgid "" "it uses the default name (:file:`foo.lib`.) [#]_" msgstr "" -#: ../../install/index.rst:982 +#: ../../install/index.rst:986 msgid "" "To let Distutils compile your extension with Borland C++ you now have to " "type::" msgstr "" -#: ../../install/index.rst:986 +#: ../../install/index.rst:990 msgid "" "If you want to use the Borland C++ compiler as the default, you could " "specify this in your personal or system-wide configuration file for " "Distutils (see section :ref:`inst-config-files`.)" msgstr "" -#: ../../install/index.rst:995 +#: ../../install/index.rst:999 msgid "`C++Builder Compiler `_" msgstr "" -#: ../../install/index.rst:994 +#: ../../install/index.rst:998 msgid "" "Information about the free C++ compiler from Borland, including links to the " "download pages." msgstr "" -#: ../../install/index.rst:998 +#: ../../install/index.rst:1002 msgid "" "`Creating Python Extensions Using Borland's Free Compiler `_" msgstr "" -#: ../../install/index.rst:998 +#: ../../install/index.rst:1002 msgid "" "Document describing how to use Borland's free command-line C++ compiler to " "build Python." msgstr "" -#: ../../install/index.rst:1003 +#: ../../install/index.rst:1007 msgid "GNU C / Cygwin / MinGW" msgstr "" -#: ../../install/index.rst:1005 +#: ../../install/index.rst:1009 msgid "" "This section describes the necessary steps to use Distutils with the GNU C/C+" "+ compilers in their Cygwin and MinGW distributions. [#]_ For a Python " @@ -1377,40 +1377,40 @@ msgid "" "of these following steps." msgstr "" -#: ../../install/index.rst:1010 +#: ../../install/index.rst:1014 msgid "" "Not all extensions can be built with MinGW or Cygwin, but many can. " "Extensions most likely to not work are those that use C++ or depend on " "Microsoft Visual C extensions." msgstr "" -#: ../../install/index.rst:1014 +#: ../../install/index.rst:1018 msgid "To let Distutils compile your extension with Cygwin you have to type::" msgstr "" -#: ../../install/index.rst:1018 +#: ../../install/index.rst:1022 msgid "and for Cygwin in no-cygwin mode [#]_ or for MinGW type::" msgstr "" -#: ../../install/index.rst:1022 +#: ../../install/index.rst:1026 msgid "" "If you want to use any of these options/compilers as default, you should " "consider writing it in your personal or system-wide configuration file for " "Distutils (see section :ref:`inst-config-files`.)" msgstr "" -#: ../../install/index.rst:1027 +#: ../../install/index.rst:1031 msgid "Older Versions of Python and MinGW" msgstr "" -#: ../../install/index.rst:1028 +#: ../../install/index.rst:1032 msgid "" "The following instructions only apply if you're using a version of Python " "inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with " "binutils-2.13.90-20030111-1)." msgstr "" -#: ../../install/index.rst:1032 +#: ../../install/index.rst:1036 msgid "" "These compilers require some special libraries. This task is more complex " "than for Borland's C++, because there is no program to convert the library. " @@ -1419,7 +1419,7 @@ msgid "" "projects/mingw/files/MinGW/Extension/pexports/)." msgstr "" -#: ../../install/index.rst:1045 +#: ../../install/index.rst:1049 msgid "" "The location of an installed :file:`python25.dll` will depend on the " "installation options and the version and language of Windows. In a \"just " @@ -1428,51 +1428,51 @@ msgid "" "directory." msgstr "" -#: ../../install/index.rst:1050 +#: ../../install/index.rst:1054 msgid "" "Then you can create from these information an import library for gcc. ::" msgstr "" -#: ../../install/index.rst:1054 +#: ../../install/index.rst:1058 msgid "" "The resulting library has to be placed in the same directory as :file:" "`python25.lib`. (Should be the :file:`libs` directory under your Python " "installation directory.)" msgstr "" -#: ../../install/index.rst:1058 +#: ../../install/index.rst:1062 msgid "" "If your extension uses other libraries (zlib,...) you might have to convert " "them too. The converted files have to reside in the same directories as the " "normal libraries do." msgstr "" -#: ../../install/index.rst:1065 +#: ../../install/index.rst:1069 msgid "" "`Building Python modules on MS Windows platform with MinGW `_" msgstr "" -#: ../../install/index.rst:1066 +#: ../../install/index.rst:1070 msgid "" "Information about building the required libraries for the MinGW environment." msgstr "" -#: ../../install/index.rst:1070 +#: ../../install/index.rst:1074 msgid "Footnotes" msgstr "註解" -#: ../../install/index.rst:1071 +#: ../../install/index.rst:1075 msgid "" "This also means you could replace all existing COFF-libraries with OMF-" "libraries of the same name." msgstr "" -#: ../../install/index.rst:1074 +#: ../../install/index.rst:1078 msgid "Check https://www.sourceware.org/cygwin/ for more information" msgstr "更多資訊請見 https://www.sourceware.org/cygwin/" -#: ../../install/index.rst:1076 +#: ../../install/index.rst:1080 msgid "" "Then you have no POSIX emulation available, but you also don't need :file:" "`cygwin1.dll`." diff --git a/installing/index.po b/installing/index.po index 3d0984207e..d69f13de70 100644 --- a/installing/index.po +++ b/installing/index.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:37+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -123,13 +123,13 @@ msgstr "" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" #: ../../installing/index.rst:50 +#, fuzzy msgid "" "the `Python Packaging Authority `__ is the group of " "developers and documentation authors responsible for the maintenance and " "evolution of the standard packaging tools and the associated metadata and " "file format standards. They maintain a variety of tools, documentation, and " -"issue trackers on both `GitHub `__ and `Bitbucket " -"`__." +"issue trackers on `GitHub `__." msgstr "" "`Python 封裝管理站 (Python Packaging Authority) `__ 是" "一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" @@ -137,7 +137,7 @@ msgstr "" "pypa>`__ 和 `Bitbucket `__ 這兩個平台上維護各種" "工具、說明文件及問題追蹤系統。" -#: ../../installing/index.rst:57 +#: ../../installing/index.rst:56 msgid "" "``distutils`` is the original build and distribution system first added to " "the Python standard library in 1998. While direct use of ``distutils`` is " @@ -151,12 +151,12 @@ msgstr "" "基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" "著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" -#: ../../installing/index.rst:65 +#: ../../installing/index.rst:64 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." msgstr "對於建立虛擬環境,現在推薦使用 ``venv``。" -#: ../../installing/index.rst:70 +#: ../../installing/index.rst:69 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" @@ -164,17 +164,17 @@ msgstr "" "`Python 封裝使用者指南:建立和使用虛擬環境 `__" -#: ../../installing/index.rst:75 +#: ../../installing/index.rst:74 msgid "Basic usage" msgstr "基本用法" -#: ../../installing/index.rst:77 +#: ../../installing/index.rst:76 msgid "" "The standard packaging tools are all designed to be used from the command " "line." msgstr "標準封裝工具皆是以能從命令列使用的方式被設計的。" -#: ../../installing/index.rst:80 +#: ../../installing/index.rst:79 msgid "" "The following command will install the latest version of a module and its " "dependencies from the Python Package Index::" @@ -184,7 +184,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:87 +#: ../../installing/index.rst:86 msgid "" "For POSIX users (including macOS and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." @@ -192,7 +192,7 @@ msgstr "" "對於 POSIX 使用者(包括 macOS 和 Linux 使用者),本指南中的範例皆假設有使用 :" "term:`virtual environment`\\ 。" -#: ../../installing/index.rst:90 +#: ../../installing/index.rst:89 msgid "" "For Windows users, the examples in this guide assume that the option to " "adjust the system PATH environment variable was selected when installing " @@ -201,7 +201,7 @@ msgstr "" "對於 Windows 使用者,本指南中的範例皆假設在安裝 Python 時,「可調整系統 PATH " "環境變數」的選項已被選取。" -#: ../../installing/index.rst:94 +#: ../../installing/index.rst:93 msgid "" "It's also possible to specify an exact or minimum version directly on the " "command line. When using comparator operators such as ``>``, ``<`` or some " @@ -214,7 +214,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:102 +#: ../../installing/index.rst:101 msgid "" "Normally, if a suitable module is already installed, attempting to install " "it again will have no effect. Upgrading existing modules must be requested " @@ -225,7 +225,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:108 +#: ../../installing/index.rst:107 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " "found in the `Python Packaging User Guide `__." @@ -233,7 +233,7 @@ msgstr "" "關於 ``pip`` 及其能力的更多資訊和資源,可以在 `Python 封裝使用者指南 " "`__\\ 中找到。" -#: ../../installing/index.rst:111 +#: ../../installing/index.rst:110 msgid "" "Creation of virtual environments is done through the :mod:`venv` module. " "Installing packages into an active virtual environment uses the commands " @@ -242,7 +242,7 @@ msgstr "" "虛擬環境的建立是使用 :mod:`venv` 模組來完成。要在一個已啟用的虛擬環境中安裝套" "件,可使用前面展示的指令。" -#: ../../installing/index.rst:117 +#: ../../installing/index.rst:116 msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" @@ -250,19 +250,19 @@ msgstr "" "`Python 封裝使用者指南:安裝 Python 發布套件 `__" -#: ../../installing/index.rst:122 +#: ../../installing/index.rst:121 msgid "How do I ...?" msgstr "我該如何...?" -#: ../../installing/index.rst:124 +#: ../../installing/index.rst:123 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../installing/index.rst:127 +#: ../../installing/index.rst:126 msgid "... install ``pip`` in versions of Python prior to Python 3.4?" msgstr "...在 Python 3.4 之前的 Python 版本中安裝 ``pip``?" -#: ../../installing/index.rst:129 +#: ../../installing/index.rst:128 msgid "" "Python only started bundling ``pip`` with Python 3.4. For earlier versions, " "``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " @@ -271,7 +271,7 @@ msgstr "" "Python 是從 Python 3.4 才開始綁定 ``pip`` 的。對於更早的版本,\\ ``pip`` 需要" "被「自助安裝 (bootstrapped)」,請參考 Python 封裝使用者指南中的說明。" -#: ../../installing/index.rst:135 +#: ../../installing/index.rst:134 msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" @@ -279,11 +279,11 @@ msgstr "" "`Python 封裝使用者指南:安裝套件的需求 `__" -#: ../../installing/index.rst:142 +#: ../../installing/index.rst:141 msgid "... install packages just for the current user?" msgstr "...只為目前的使用者安裝套件?" -#: ../../installing/index.rst:144 +#: ../../installing/index.rst:143 msgid "" "Passing the ``--user`` option to ``python -m pip install`` will install a " "package just for the current user, rather than for all users of the system." @@ -291,11 +291,11 @@ msgstr "" "把 ``--user`` 選項傳給 ``python -m pip install``,這樣將會只為目前使用者而非" "系統的所有使用者安裝套件。" -#: ../../installing/index.rst:149 +#: ../../installing/index.rst:148 msgid "... install scientific Python packages?" msgstr "...安裝科學的 Python 套件?" -#: ../../installing/index.rst:151 +#: ../../installing/index.rst:150 msgid "" "A number of scientific Python packages have complex binary dependencies, and " "aren't currently easy to install using ``pip`` directly. At this point in " @@ -307,7 +307,7 @@ msgstr "" "``pip`` 安裝。目前為止,使用\\ `其他方法 `__\\ 而非嘗試用 ``pip`` 來安裝它們,對使用者來說通常會更簡單。" -#: ../../installing/index.rst:159 +#: ../../installing/index.rst:158 msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" @@ -315,11 +315,11 @@ msgstr "" "`Python 封裝使用者指南:安裝科學套件 `__" -#: ../../installing/index.rst:164 +#: ../../installing/index.rst:163 msgid "... work with multiple versions of Python installed in parallel?" msgstr "...平行安裝多個 Python 版本並使用它們?" -#: ../../installing/index.rst:166 +#: ../../installing/index.rst:165 msgid "" "On Linux, macOS, and other POSIX systems, use the versioned Python commands " "in combination with the ``-m`` switch to run the appropriate copy of " @@ -330,11 +330,11 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:175 +#: ../../installing/index.rst:174 msgid "Appropriately versioned ``pip`` commands may also be available." msgstr "使用帶有合適版本編號的 ``pip`` 指令,也是可行的。" -#: ../../installing/index.rst:177 +#: ../../installing/index.rst:176 msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" @@ -344,15 +344,15 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:194 +#: ../../installing/index.rst:193 msgid "Common installation issues" msgstr "常見的安裝問題" -#: ../../installing/index.rst:197 +#: ../../installing/index.rst:196 msgid "Installing into the system Python on Linux" msgstr "在 Linux 上安裝套件至系統 Python" -#: ../../installing/index.rst:199 +#: ../../installing/index.rst:198 msgid "" "On Linux systems, a Python installation will typically be included as part " "of the distribution. Installing into this Python installation requires root " @@ -364,7 +364,7 @@ msgstr "" "件到這個 Python 版本上需要系統的 root 權限,並且可能會干擾到系統套件管理器的" "運作。如果其他系統組件非預期地以 ``pip`` 被升級,也會干擾這些組件的運作。" -#: ../../installing/index.rst:205 +#: ../../installing/index.rst:204 msgid "" "On such systems, it is often better to use a virtual environment or a per-" "user installation when installing packages with ``pip``." @@ -372,11 +372,11 @@ msgstr "" "在這樣的系統上,以 ``pip`` 安裝套件時,通常較好的方式是使用虛擬環境,或以個別" "使用者安裝。" -#: ../../installing/index.rst:210 +#: ../../installing/index.rst:209 msgid "Pip not installed" msgstr "未安裝 pip" -#: ../../installing/index.rst:212 +#: ../../installing/index.rst:211 msgid "" "It is possible that ``pip`` does not get installed by default. One potential " "fix is::" @@ -385,7 +385,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:216 +#: ../../installing/index.rst:215 msgid "" "There are also additional resources for `installing pip. `__\\ 的資源。" -#: ../../installing/index.rst:221 +#: ../../installing/index.rst:220 msgid "Installing binary extensions" msgstr "安裝二進制擴充 (binary extension)" -#: ../../installing/index.rst:223 +#: ../../installing/index.rst:222 msgid "" "Python has typically relied heavily on source based distribution, with end " "users being expected to compile extension modules from source as part of the " @@ -408,7 +408,7 @@ msgstr "" "Python 基本上相當倚賴以原始碼為基礎的發布方式,也會期望使用者在安裝過程的某個" "階段,從原始碼來編譯擴充模組。" -#: ../../installing/index.rst:227 +#: ../../installing/index.rst:226 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " "ability to publish wheels for at least Windows and macOS through the Python " @@ -420,7 +420,7 @@ msgstr "" "Windows 和 macOS 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能夠" "更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" -#: ../../installing/index.rst:233 +#: ../../installing/index.rst:232 msgid "" "Some of the solutions for installing `scientific software `__ that are not yet available as pre-built ``wheel`` " @@ -431,7 +431,7 @@ msgstr "" "軟體 `__\\ ,這些方案也有助於取得其他" "的二進制擴充,且無需在本機對它們進行建置。" -#: ../../installing/index.rst:240 +#: ../../installing/index.rst:239 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/library/__main__.po b/library/__main__.po index 8c795fcfec..374c60b159 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,8 +196,8 @@ msgstr "" #: ../../library/__main__.rst:180 msgid "" "By proactively following this convention ourselves, our module will have the " -"same behavior when run directly (i.e. ``python3 echo.py``) as it will have " -"if we later package it as a console script entry-point in a pip-installable " +"same behavior when run directly (i.e. ``python echo.py``) as it will have if " +"we later package it as a console script entry-point in a pip-installable " "package." msgstr "" diff --git a/library/_thread.po b/library/_thread.po index e1ba7c80c3..24ba1f1eab 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,52 +78,58 @@ msgid "" msgstr "" #: ../../library/_thread.rst:60 +msgid "" +"Raises an :ref:`auditing event ` ``_thread.start_new_thread`` with " +"arguments ``function``, ``args``, ``kwargs``." +msgstr "" + +#: ../../library/_thread.rst:62 msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." msgstr "" -#: ../../library/_thread.rst:66 +#: ../../library/_thread.rst:68 msgid "" "Simulate the effect of a signal arriving in the main thread. A thread can " "use this function to interrupt the main thread, though there is no guarantee " "that the interruption will happen immediately." msgstr "" -#: ../../library/_thread.rst:70 +#: ../../library/_thread.rst:72 msgid "" "If given, *signum* is the number of the signal to simulate. If *signum* is " "not given, :data:`signal.SIGINT` is simulated." msgstr "" -#: ../../library/_thread.rst:73 +#: ../../library/_thread.rst:75 msgid "" "If the given signal isn't handled by Python (it was set to :data:`signal." "SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing." msgstr "" -#: ../../library/_thread.rst:77 +#: ../../library/_thread.rst:79 msgid "The *signum* argument is added to customize the signal number." msgstr "" -#: ../../library/_thread.rst:81 +#: ../../library/_thread.rst:83 msgid "" "This does not emit the corresponding signal but schedules a call to the " "associated handler (if it exists). If you want to truly emit the signal, " "use :func:`signal.raise_signal`." msgstr "" -#: ../../library/_thread.rst:88 +#: ../../library/_thread.rst:90 msgid "" "Raise the :exc:`SystemExit` exception. When not caught, this will cause the " "thread to exit silently." msgstr "" -#: ../../library/_thread.rst:102 +#: ../../library/_thread.rst:104 msgid "" "Return a new lock object. Methods of locks are described below. The lock " "is initially unlocked." msgstr "" -#: ../../library/_thread.rst:108 +#: ../../library/_thread.rst:110 msgid "" "Return the 'thread identifier' of the current thread. This is a nonzero " "integer. Its value has no direct meaning; it is intended as a magic cookie " @@ -132,7 +138,7 @@ msgid "" "created." msgstr "" -#: ../../library/_thread.rst:116 +#: ../../library/_thread.rst:118 msgid "" "Return the native integral Thread ID of the current thread assigned by the " "kernel. This is a non-negative integer. Its value may be used to uniquely " @@ -140,13 +146,14 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/_thread.rst:121 +#: ../../library/_thread.rst:123 +#, fuzzy msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX." -msgstr "" +"NetBSD, AIX, DragonFlyBSD." +msgstr ":ref:`適用 `:Windows, pthreads。" -#: ../../library/_thread.rst:128 +#: ../../library/_thread.rst:130 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -165,26 +172,26 @@ msgid "" "information)." msgstr "" -#: ../../library/_thread.rst:143 +#: ../../library/_thread.rst:145 msgid ":ref:`Availability `: Windows, pthreads." msgstr ":ref:`適用 `:Windows, pthreads。" -#: ../../library/_thread.rst:145 +#: ../../library/_thread.rst:147 msgid "Unix platforms with POSIX threads support." msgstr "" -#: ../../library/_thread.rst:150 +#: ../../library/_thread.rst:152 msgid "" "The maximum value allowed for the *timeout* parameter of :meth:`Lock." "acquire`. Specifying a timeout greater than this value will raise an :exc:" "`OverflowError`." msgstr "" -#: ../../library/_thread.rst:157 +#: ../../library/_thread.rst:159 msgid "Lock objects have the following methods:" msgstr "" -#: ../../library/_thread.rst:162 +#: ../../library/_thread.rst:164 msgid "" "Without any optional argument, this method acquires the lock " "unconditionally, if necessary waiting until it is released by another thread " @@ -192,7 +199,7 @@ msgid "" "existence)." msgstr "" -#: ../../library/_thread.rst:166 +#: ../../library/_thread.rst:168 msgid "" "If the *blocking* argument is present, the action depends on its value: if " "it is False, the lock is only acquired if it can be acquired immediately " @@ -200,7 +207,7 @@ msgid "" "as above." msgstr "" -#: ../../library/_thread.rst:171 +#: ../../library/_thread.rst:173 msgid "" "If the floating-point *timeout* argument is present and positive, it " "specifies the maximum wait time in seconds before returning. A negative " @@ -208,70 +215,70 @@ msgid "" "*timeout* if *blocking* is False." msgstr "" -#: ../../library/_thread.rst:176 +#: ../../library/_thread.rst:178 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not." msgstr "" -#: ../../library/_thread.rst:179 +#: ../../library/_thread.rst:181 msgid "The *timeout* parameter is new." msgstr "" -#: ../../library/_thread.rst:182 +#: ../../library/_thread.rst:184 msgid "Lock acquires can now be interrupted by signals on POSIX." msgstr "" -#: ../../library/_thread.rst:188 +#: ../../library/_thread.rst:190 msgid "" "Releases the lock. The lock must have been acquired earlier, but not " "necessarily by the same thread." msgstr "" -#: ../../library/_thread.rst:194 +#: ../../library/_thread.rst:196 msgid "" "Return the status of the lock: ``True`` if it has been acquired by some " "thread, ``False`` if not." msgstr "" -#: ../../library/_thread.rst:197 +#: ../../library/_thread.rst:199 msgid "" "In addition to these methods, lock objects can also be used via the :keyword:" "`with` statement, e.g.::" msgstr "" -#: ../../library/_thread.rst:207 +#: ../../library/_thread.rst:209 msgid "**Caveats:**" msgstr "" -#: ../../library/_thread.rst:211 +#: ../../library/_thread.rst:213 msgid "" "Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " "exception will be received by an arbitrary thread. (When the :mod:`signal` " "module is available, interrupts always go to the main thread.)" msgstr "" -#: ../../library/_thread.rst:215 +#: ../../library/_thread.rst:217 msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." msgstr "" -#: ../../library/_thread.rst:218 +#: ../../library/_thread.rst:220 msgid "" "It is not possible to interrupt the :meth:`acquire` method on a lock --- " "the :exc:`KeyboardInterrupt` exception will happen after the lock has been " "acquired." msgstr "" -#: ../../library/_thread.rst:221 +#: ../../library/_thread.rst:223 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" "`try` ... :keyword:`finally` clauses or executing object destructors." msgstr "" -#: ../../library/_thread.rst:226 +#: ../../library/_thread.rst:228 msgid "" "When the main thread exits, it does not do any of its usual cleanup (except " "that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " @@ -306,10 +313,10 @@ msgstr "" msgid "POSIX" msgstr "POSIX" -#: ../../library/_thread.rst:209 +#: ../../library/_thread.rst:211 msgid "module" msgstr "module(模組)" -#: ../../library/_thread.rst:209 +#: ../../library/_thread.rst:211 msgid "signal" msgstr "signal(訊號)" diff --git a/library/argparse.po b/library/argparse.po index 098181663d..94a84572d7 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,7 +57,8 @@ msgstr "" msgid "" "The :mod:`argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " -"for argument specifications and has options that apply the parser as whole::" +"for argument specifications and has options that apply to the parser as " +"whole::" msgstr "" #: ../../library/argparse.rst:41 @@ -188,8 +189,8 @@ msgid "``True`` or ``False``" msgstr "``True`` 或 ``False``" #: ../../library/argparse.rst:72 -msgid "type_" -msgstr "type_" +msgid ":ref:`type `" +msgstr "" #: ../../library/argparse.rst:72 msgid "Automatically convert an argument to the given type" @@ -387,7 +388,7 @@ msgstr "" msgid "*exit_on_error* parameter was added." msgstr "新增 *exit_on_error* 參數。" -#: ../../library/argparse.rst:244 ../../library/argparse.rst:770 +#: ../../library/argparse.rst:244 ../../library/argparse.rst:780 msgid "The following sections describe how each of these are used." msgstr "" @@ -590,7 +591,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: ../../library/argparse.rst:573 +#: ../../library/argparse.rst:574 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -600,17 +601,32 @@ msgid "" "f', 'bar']``." msgstr "" -#: ../../library/argparse.rst:579 +#: ../../library/argparse.rst:580 +msgid "" +":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " +"to read the file containing arguments." +msgstr "" + +#: ../../library/argparse.rst:583 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: ../../library/argparse.rst:584 +#: ../../library/argparse.rst:586 +msgid "" +":class:`ArgumentParser` changed encoding and errors to read arguments files " +"from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to :term:`filesystem encoding and " +"error handler`. Arguments file should be encoded in UTF-8 instead of ANSI " +"Codepage on Windows." +msgstr "" + +#: ../../library/argparse.rst:594 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:586 +#: ../../library/argparse.rst:596 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -622,26 +638,26 @@ msgid "" "supply ``argument_default=SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:606 +#: ../../library/argparse.rst:616 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:608 +#: ../../library/argparse.rst:618 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -#: ../../library/argparse.rst:612 +#: ../../library/argparse.rst:622 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:625 +#: ../../library/argparse.rst:635 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:627 +#: ../../library/argparse.rst:637 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -649,7 +665,7 @@ msgid "" "that is already in use::" msgstr "" -#: ../../library/argparse.rst:639 +#: ../../library/argparse.rst:649 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -657,7 +673,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:655 +#: ../../library/argparse.rst:665 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -665,31 +681,31 @@ msgid "" "option string was overridden." msgstr "" -#: ../../library/argparse.rst:662 +#: ../../library/argparse.rst:672 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:664 +#: ../../library/argparse.rst:674 msgid "" "By default, ArgumentParser objects add an option which simply displays the " "parser's help message. For example, consider a file named ``myprogram.py`` " "containing the following code::" msgstr "" -#: ../../library/argparse.rst:673 +#: ../../library/argparse.rst:683 msgid "" "If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser " "help will be printed:" msgstr "" -#: ../../library/argparse.rst:685 +#: ../../library/argparse.rst:695 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:697 +#: ../../library/argparse.rst:707 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -697,94 +713,94 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: ../../library/argparse.rst:712 +#: ../../library/argparse.rst:722 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:714 +#: ../../library/argparse.rst:724 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "exit with error info." msgstr "" -#: ../../library/argparse.rst:717 +#: ../../library/argparse.rst:727 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:734 +#: ../../library/argparse.rst:744 msgid "The add_argument() method" msgstr "" -#: ../../library/argparse.rst:740 +#: ../../library/argparse.rst:750 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:743 +#: ../../library/argparse.rst:753 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " "or ``-f, --foo``." msgstr "" -#: ../../library/argparse.rst:746 +#: ../../library/argparse.rst:756 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:749 +#: ../../library/argparse.rst:759 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:751 +#: ../../library/argparse.rst:761 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:753 +#: ../../library/argparse.rst:763 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:756 +#: ../../library/argparse.rst:766 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:758 +#: ../../library/argparse.rst:768 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:760 +#: ../../library/argparse.rst:770 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:763 +#: ../../library/argparse.rst:773 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:765 +#: ../../library/argparse.rst:775 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:767 +#: ../../library/argparse.rst:777 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:776 +#: ../../library/argparse.rst:786 msgid "name or flags" msgstr "" -#: ../../library/argparse.rst:778 +#: ../../library/argparse.rst:788 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -793,26 +809,26 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:784 +#: ../../library/argparse.rst:794 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:788 +#: ../../library/argparse.rst:798 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:792 +#: ../../library/argparse.rst:802 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:811 +#: ../../library/argparse.rst:821 msgid "action" msgstr "" -#: ../../library/argparse.rst:813 +#: ../../library/argparse.rst:823 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -822,13 +838,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:819 +#: ../../library/argparse.rst:829 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action. For example::" msgstr "" -#: ../../library/argparse.rst:827 +#: ../../library/argparse.rst:837 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -836,7 +852,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:847 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " @@ -844,7 +860,7 @@ msgid "" "``True`` respectively. For example::" msgstr "" -#: ../../library/argparse.rst:849 +#: ../../library/argparse.rst:859 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -853,7 +869,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: ../../library/argparse.rst:860 +#: ../../library/argparse.rst:870 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -862,17 +878,17 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:872 +#: ../../library/argparse.rst:882 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:880 +#: ../../library/argparse.rst:890 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:882 +#: ../../library/argparse.rst:892 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -880,20 +896,20 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:897 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:897 +#: ../../library/argparse.rst:907 msgid "" "``'extend'`` - This stores a list, and extends each argument value to the " "list. Example usage::" msgstr "" -#: ../../library/argparse.rst:908 +#: ../../library/argparse.rst:918 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " "other object that implements the same interface. The " @@ -901,46 +917,46 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:921 +#: ../../library/argparse.rst:931 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:925 +#: ../../library/argparse.rst:935 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:945 +#: ../../library/argparse.rst:955 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:951 +#: ../../library/argparse.rst:961 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:953 +#: ../../library/argparse.rst:963 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " -"different number of command-line arguments with a single action. The " -"supported values are:" +"different number of command-line arguments with a single action. See also :" +"ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" -#: ../../library/argparse.rst:958 +#: ../../library/argparse.rst:968 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:977 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:972 +#: ../../library/argparse.rst:982 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -950,13 +966,13 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:989 +#: ../../library/argparse.rst:999 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:1006 +#: ../../library/argparse.rst:1016 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -964,14 +980,14 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:1020 +#: ../../library/argparse.rst:1030 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:1032 +#: ../../library/argparse.rst:1042 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -979,11 +995,11 @@ msgid "" "be produced." msgstr "" -#: ../../library/argparse.rst:1040 +#: ../../library/argparse.rst:1050 msgid "const" msgstr "" -#: ../../library/argparse.rst:1042 +#: ../../library/argparse.rst:1052 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -991,7 +1007,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:1046 +#: ../../library/argparse.rst:1056 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1001,7 +1017,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:1054 +#: ../../library/argparse.rst:1064 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1011,17 +1027,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:1061 +#: ../../library/argparse.rst:1071 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:1068 +#: ../../library/argparse.rst:1078 msgid "default" msgstr "" -#: ../../library/argparse.rst:1070 +#: ../../library/argparse.rst:1080 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1031,13 +1047,13 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1084 +#: ../../library/argparse.rst:1094 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not over write it::" msgstr "" -#: ../../library/argparse.rst:1092 +#: ../../library/argparse.rst:1102 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1045,23 +1061,23 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1103 +#: ../../library/argparse.rst:1113 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1124 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1128 +#: ../../library/argparse.rst:1138 msgid "type" msgstr "" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:1140 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1070,13 +1086,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:1136 +#: ../../library/argparse.rst:1146 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:1139 +#: ../../library/argparse.rst:1149 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -1084,22 +1100,22 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1154 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:1160 +#: ../../library/argparse.rst:1170 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1172 +#: ../../library/argparse.rst:1182 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1176 +#: ../../library/argparse.rst:1186 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1107,7 +1123,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1181 +#: ../../library/argparse.rst:1191 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1115,7 +1131,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1186 +#: ../../library/argparse.rst:1196 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses *FileType* and then a subsequent " @@ -1124,17 +1140,17 @@ msgid "" "run and then use the :keyword:`with`-statement to manage the files." msgstr "" -#: ../../library/argparse.rst:1192 +#: ../../library/argparse.rst:1202 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1209 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1201 +#: ../../library/argparse.rst:1211 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1143,26 +1159,26 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1216 +#: ../../library/argparse.rst:1226 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified::" msgstr "" -#: ../../library/argparse.rst:1228 +#: ../../library/argparse.rst:1238 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1231 +#: ../../library/argparse.rst:1241 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1234 +#: ../../library/argparse.rst:1244 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1170,11 +1186,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1243 +#: ../../library/argparse.rst:1253 msgid "required" msgstr "" -#: ../../library/argparse.rst:1245 +#: ../../library/argparse.rst:1255 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1182,24 +1198,24 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1258 +#: ../../library/argparse.rst:1268 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1264 +#: ../../library/argparse.rst:1274 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1271 +#: ../../library/argparse.rst:1281 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1273 +#: ../../library/argparse.rst:1283 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1207,7 +1223,7 @@ msgid "" "each argument::" msgstr "" -#: ../../library/argparse.rst:1293 +#: ../../library/argparse.rst:1303 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1216,23 +1232,23 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1310 +#: ../../library/argparse.rst:1320 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1313 +#: ../../library/argparse.rst:1323 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1338 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1330 +#: ../../library/argparse.rst:1340 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -1244,29 +1260,29 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1354 +#: ../../library/argparse.rst:1364 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1371 +#: ../../library/argparse.rst:1381 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1375 +#: ../../library/argparse.rst:1385 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1394 +#: ../../library/argparse.rst:1404 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1396 +#: ../../library/argparse.rst:1406 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -1276,7 +1292,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1408 +#: ../../library/argparse.rst:1418 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -1288,15 +1304,15 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1425 +#: ../../library/argparse.rst:1435 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1433 +#: ../../library/argparse.rst:1443 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1435 +#: ../../library/argparse.rst:1445 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " @@ -1304,7 +1320,7 @@ msgid "" "add_argument`." msgstr "" -#: ../../library/argparse.rst:1444 +#: ../../library/argparse.rst:1454 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -1313,7 +1329,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1450 +#: ../../library/argparse.rst:1460 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -1321,114 +1337,114 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1455 +#: ../../library/argparse.rst:1465 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1458 +#: ../../library/argparse.rst:1468 msgid "``parser`` - The ArgumentParser object which contains this action." msgstr "" -#: ../../library/argparse.rst:1460 +#: ../../library/argparse.rst:1470 msgid "" "``namespace`` - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1464 +#: ../../library/argparse.rst:1474 msgid "" "``values`` - The associated command-line arguments, with any type " "conversions applied. Type conversions are specified with the type_ keyword " "argument to :meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1478 msgid "" "``option_string`` - The option string that was used to invoke this action. " "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1472 +#: ../../library/argparse.rst:1482 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1475 +#: ../../library/argparse.rst:1485 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1480 +#: ../../library/argparse.rst:1490 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1494 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1487 +#: ../../library/argparse.rst:1497 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1491 +#: ../../library/argparse.rst:1501 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1494 +#: ../../library/argparse.rst:1504 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1499 +#: ../../library/argparse.rst:1509 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1501 +#: ../../library/argparse.rst:1511 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1513 +#: ../../library/argparse.rst:1523 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1530 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1526 +#: ../../library/argparse.rst:1536 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1548 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1540 +#: ../../library/argparse.rst:1550 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -1436,11 +1452,11 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1566 +#: ../../library/argparse.rst:1576 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1568 +#: ../../library/argparse.rst:1578 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -1452,7 +1468,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1606 +#: ../../library/argparse.rst:1616 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -1460,28 +1476,34 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1617 +#: ../../library/argparse.rst:1624 +msgid "" +"See also :ref:`the argparse howto on ambiguous arguments ` for more details." +msgstr "" + +#: ../../library/argparse.rst:1630 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1619 +#: ../../library/argparse.rst:1632 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1634 +#: ../../library/argparse.rst:1647 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1640 +#: ../../library/argparse.rst:1653 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1642 +#: ../../library/argparse.rst:1655 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -1489,39 +1511,39 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1675 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1679 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1669 +#: ../../library/argparse.rst:1682 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1679 +#: ../../library/argparse.rst:1692 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1695 +#: ../../library/argparse.rst:1708 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1698 +#: ../../library/argparse.rst:1711 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1705 +#: ../../library/argparse.rst:1718 msgid "" "Many programs split up their functionality into a number of sub-commands, " "for example, the ``svn`` program can invoke sub-commands like ``svn " @@ -1537,72 +1559,72 @@ msgid "" "can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1717 +#: ../../library/argparse.rst:1730 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1719 +#: ../../library/argparse.rst:1732 msgid "" "title - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1723 +#: ../../library/argparse.rst:1736 msgid "" "description - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1739 msgid "" "prog - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1730 +#: ../../library/argparse.rst:1743 msgid "" "parser_class - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1733 +#: ../../library/argparse.rst:1746 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1736 +#: ../../library/argparse.rst:1749 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1739 +#: ../../library/argparse.rst:1752 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1742 +#: ../../library/argparse.rst:1755 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1744 +#: ../../library/argparse.rst:1757 msgid "" "metavar_ - string presenting available sub-commands in help; by default it " "is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1747 +#: ../../library/argparse.rst:1760 msgid "Some example usage::" msgstr "" "一些使用範例:\n" "\n" "::" -#: ../../library/argparse.rst:1768 +#: ../../library/argparse.rst:1781 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -1612,7 +1634,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1775 +#: ../../library/argparse.rst:1788 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -1621,21 +1643,21 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1811 +#: ../../library/argparse.rst:1824 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1832 +#: ../../library/argparse.rst:1845 msgid "" "Furthermore, ``add_parser`` supports an additional ``aliases`` argument, " "which allows multiple strings to refer to the same subparser. This example, " "like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" msgstr "" -#: ../../library/argparse.rst:1843 +#: ../../library/argparse.rst:1856 msgid "" "One particularly effective way of handling sub-commands is to combine the " "use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " @@ -1643,7 +1665,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1880 +#: ../../library/argparse.rst:1893 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -1653,15 +1675,15 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1896 +#: ../../library/argparse.rst:1909 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1901 +#: ../../library/argparse.rst:1914 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1905 +#: ../../library/argparse.rst:1918 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -1670,22 +1692,22 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1917 +#: ../../library/argparse.rst:1930 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1926 +#: ../../library/argparse.rst:1939 msgid "The *encodings* and *errors* keyword arguments." msgstr "" -#: ../../library/argparse.rst:1931 +#: ../../library/argparse.rst:1944 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1935 +#: ../../library/argparse.rst:1948 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -1694,7 +1716,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1952 +#: ../../library/argparse.rst:1965 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -1705,13 +1727,13 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1978 +#: ../../library/argparse.rst:1991 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1981 +#: ../../library/argparse.rst:1994 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -1719,32 +1741,33 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1989 +#: ../../library/argparse.rst:2002 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:2006 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:2009 +#: ../../library/argparse.rst:2022 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2021 +#: ../../library/argparse.rst:2034 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." -"add_argument_group`." +"add_argument_group`. However, a mutually exclusive group can be added to an " +"argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2025 +#: ../../library/argparse.rst:2057 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -1752,11 +1775,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:2033 +#: ../../library/argparse.rst:2065 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2037 +#: ../../library/argparse.rst:2069 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -1765,72 +1788,72 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2049 +#: ../../library/argparse.rst:2081 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:2057 +#: ../../library/argparse.rst:2089 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:2095 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2074 +#: ../../library/argparse.rst:2106 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:2076 +#: ../../library/argparse.rst:2108 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2082 +#: ../../library/argparse.rst:2114 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2088 +#: ../../library/argparse.rst:2120 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2092 +#: ../../library/argparse.rst:2124 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2097 +#: ../../library/argparse.rst:2129 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:2134 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2107 +#: ../../library/argparse.rst:2139 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2143 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -1841,7 +1864,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2127 +#: ../../library/argparse.rst:2159 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -1849,11 +1872,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2134 +#: ../../library/argparse.rst:2166 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:2170 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -1861,41 +1884,41 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2143 +#: ../../library/argparse.rst:2175 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2147 +#: ../../library/argparse.rst:2179 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2188 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2160 +#: ../../library/argparse.rst:2192 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* before that. The user can override this " "method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2172 +#: ../../library/argparse.rst:2204 msgid "" "This method prints a usage message including the *message* to the standard " "error and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2177 +#: ../../library/argparse.rst:2209 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2182 +#: ../../library/argparse.rst:2214 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -1903,7 +1926,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2187 +#: ../../library/argparse.rst:2219 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -1911,7 +1934,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2192 +#: ../../library/argparse.rst:2224 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -1919,7 +1942,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2207 +#: ../../library/argparse.rst:2239 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -1927,11 +1950,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2217 +#: ../../library/argparse.rst:2249 msgid "Upgrading optparse code" msgstr "" -#: ../../library/argparse.rst:2219 +#: ../../library/argparse.rst:2251 msgid "" "Originally, the :mod:`argparse` module had attempted to maintain " "compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " @@ -1942,47 +1965,47 @@ msgid "" "compatibility." msgstr "" -#: ../../library/argparse.rst:2226 +#: ../../library/argparse.rst:2258 msgid "" "The :mod:`argparse` module improves on the standard library :mod:`optparse` " "module in a number of ways including:" msgstr "" -#: ../../library/argparse.rst:2229 +#: ../../library/argparse.rst:2261 msgid "Handling positional arguments." msgstr "" -#: ../../library/argparse.rst:2230 +#: ../../library/argparse.rst:2262 msgid "Supporting sub-commands." msgstr "" -#: ../../library/argparse.rst:2231 +#: ../../library/argparse.rst:2263 msgid "Allowing alternative option prefixes like ``+`` and ``/``." msgstr "" -#: ../../library/argparse.rst:2232 +#: ../../library/argparse.rst:2264 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" -#: ../../library/argparse.rst:2233 +#: ../../library/argparse.rst:2265 msgid "Producing more informative usage messages." msgstr "" -#: ../../library/argparse.rst:2234 +#: ../../library/argparse.rst:2266 msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" -#: ../../library/argparse.rst:2236 +#: ../../library/argparse.rst:2268 msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" msgstr "" -#: ../../library/argparse.rst:2238 +#: ../../library/argparse.rst:2270 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" -#: ../../library/argparse.rst:2241 +#: ../../library/argparse.rst:2273 msgid "" "Replace ``(options, args) = parser.parse_args()`` with ``args = parser." "parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " @@ -1990,77 +2013,80 @@ msgid "" "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -#: ../../library/argparse.rst:2246 +#: ../../library/argparse.rst:2278 msgid "" "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" -#: ../../library/argparse.rst:2250 +#: ../../library/argparse.rst:2282 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" -#: ../../library/argparse.rst:2253 +#: ../../library/argparse.rst:2285 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -#: ../../library/argparse.rst:2256 +#: ../../library/argparse.rst:2288 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" -#: ../../library/argparse.rst:2260 +#: ../../library/argparse.rst:2292 msgid "" "Replace strings with implicit arguments such as ``%default`` or ``%prog`` " "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" -#: ../../library/argparse.rst:2264 +#: ../../library/argparse.rst:2296 msgid "" "Replace the OptionParser constructor ``version`` argument with a call to " "``parser.add_argument('--version', action='version', version='')``." msgstr "" -#: ../../library/argparse.rst:2268 +#: ../../library/argparse.rst:2300 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2272 +#: ../../library/argparse.rst:2304 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2274 +#: ../../library/argparse.rst:2306 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2279 +#: ../../library/argparse.rst:2311 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:970 +#: ../../library/argparse.rst:980 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:970 ../../library/argparse.rst:1004 -#: ../../library/argparse.rst:1018 +#: ../../library/argparse.rst:980 ../../library/argparse.rst:1014 +#: ../../library/argparse.rst:1028 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:1004 +#: ../../library/argparse.rst:1014 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:1018 +#: ../../library/argparse.rst:1028 msgid "+ (plus)" msgstr "+ (加號)" + +#~ msgid "type_" +#~ msgstr "type_" diff --git a/library/ast.po b/library/ast.po index 87dea82e63..8a7240fb58 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-28 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -523,8 +523,8 @@ msgid "" "``targets``." msgstr "" -#: ../../library/ast.rst:852 ../../library/ast.rst:1139 -#: ../../library/ast.rst:1343 ../../library/ast.rst:1764 +#: ../../library/ast.rst:852 ../../library/ast.rst:1159 +#: ../../library/ast.rst:1363 ../../library/ast.rst:1862 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" @@ -576,21 +576,29 @@ msgstr "" msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:1021 +#: ../../library/ast.rst:1023 +msgid "" +"A :ref:`type alias ` created through the :keyword:`type` " +"statement. ``name`` is the name of the alias, ``type_params`` is a list of :" +"ref:`type parameters `, and ``value`` is the value of the " +"type alias." +msgstr "" + +#: ../../library/ast.rst:1040 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:1025 +#: ../../library/ast.rst:1044 msgid "Imports" msgstr "" -#: ../../library/ast.rst:1029 +#: ../../library/ast.rst:1048 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:1046 +#: ../../library/ast.rst:1065 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -598,68 +606,69 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:1068 +#: ../../library/ast.rst:1087 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:1085 +#: ../../library/ast.rst:1104 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:1088 +#: ../../library/ast.rst:1107 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:1093 +#: ../../library/ast.rst:1112 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:1096 +#: ../../library/ast.rst:1115 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1131 +#: ../../library/ast.rst:1150 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " -"single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds " -"the item to be looped over, again as a single node. ``body`` and ``orelse`` " -"contain lists of nodes to execute. Those in ``orelse`` are executed if the " -"loop finishes normally, rather than via a ``break`` statement." +"single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" +"class:`Subscript` node. ``iter`` holds the item to be looped over, again as " +"a single node. ``body`` and ``orelse`` contain lists of nodes to execute. " +"Those in ``orelse`` are executed if the loop finishes normally, rather than " +"via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1165 +#: ../../library/ast.rst:1185 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1192 +#: ../../library/ast.rst:1212 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1227 +#: ../../library/ast.rst:1247 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1273 +#: ../../library/ast.rst:1293 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: ../../library/ast.rst:1304 +#: ../../library/ast.rst:1324 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -667,14 +676,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1338 +#: ../../library/ast.rst:1358 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1348 +#: ../../library/ast.rst:1368 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -682,18 +691,18 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1381 +#: ../../library/ast.rst:1401 msgid "Pattern matching" msgstr "" -#: ../../library/ast.rst:1386 +#: ../../library/ast.rst:1406 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: ../../library/ast.rst:1392 +#: ../../library/ast.rst:1412 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -701,19 +710,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: ../../library/ast.rst:1397 +#: ../../library/ast.rst:1417 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: ../../library/ast.rst:1400 +#: ../../library/ast.rst:1420 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: ../../library/ast.rst:1443 +#: ../../library/ast.rst:1463 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -721,14 +730,14 @@ msgid "" "equal to the evaluated value." msgstr "" -#: ../../library/ast.rst:1470 +#: ../../library/ast.rst:1490 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: ../../library/ast.rst:1495 +#: ../../library/ast.rst:1515 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -736,7 +745,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: ../../library/ast.rst:1526 +#: ../../library/ast.rst:1546 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -744,7 +753,7 @@ msgid "" "successful." msgstr "" -#: ../../library/ast.rst:1566 +#: ../../library/ast.rst:1586 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -753,7 +762,7 @@ msgid "" "statement documentation." msgstr "" -#: ../../library/ast.rst:1572 +#: ../../library/ast.rst:1592 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -762,7 +771,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: ../../library/ast.rst:1612 +#: ../../library/ast.rst:1632 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -773,21 +782,21 @@ msgid "" "pattern)." msgstr "" -#: ../../library/ast.rst:1619 +#: ../../library/ast.rst:1639 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: ../../library/ast.rst:1623 +#: ../../library/ast.rst:1643 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: ../../library/ast.rst:1676 +#: ../../library/ast.rst:1696 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -795,14 +804,14 @@ msgid "" "and will always succeed." msgstr "" -#: ../../library/ast.rst:1681 +#: ../../library/ast.rst:1701 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: ../../library/ast.rst:1717 +#: ../../library/ast.rst:1737 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -811,151 +820,184 @@ msgid "" "matched against the subject." msgstr "" -#: ../../library/ast.rst:1749 +#: ../../library/ast.rst:1770 +msgid "Type parameters" +msgstr "" + +#: ../../library/ast.rst:1772 +msgid "" +":ref:`Type parameters ` can exist on classes, functions, and " +"type aliases." +msgstr "" + +#: ../../library/ast.rst:1777 +msgid "" +"A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " +"``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" +"`Tuple`, it represents constraints; otherwise it represents the bound." +msgstr "" + +#: ../../library/ast.rst:1800 +msgid "" +"A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " +"specification." +msgstr "" + +#: ../../library/ast.rst:1823 +msgid "" +"A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " +"tuple." +msgstr "" + +#: ../../library/ast.rst:1846 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1753 +#: ../../library/ast.rst:1850 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1755 +#: ../../library/ast.rst:1852 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1756 +#: ../../library/ast.rst:1853 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1757 +#: ../../library/ast.rst:1854 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1758 +#: ../../library/ast.rst:1855 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1760 +#: ../../library/ast.rst:1857 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1769 +#: ../../library/ast.rst:1858 ../../library/ast.rst:2033 +msgid "``type_params`` is a list of :ref:`type parameters `." +msgstr "" + +#: ../../library/ast.rst:1867 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1793 +#: ../../library/ast.rst:1891 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1795 +#: ../../library/ast.rst:1893 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1796 +#: ../../library/ast.rst:1894 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1798 +#: ../../library/ast.rst:1896 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1898 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1807 +#: ../../library/ast.rst:1905 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1813 +#: ../../library/ast.rst:1911 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1857 +#: ../../library/ast.rst:1956 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1872 +#: ../../library/ast.rst:1971 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1897 +#: ../../library/ast.rst:1996 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:1924 +#: ../../library/ast.rst:2023 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:1926 +#: ../../library/ast.rst:2025 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:1927 +#: ../../library/ast.rst:2026 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:1928 +#: ../../library/ast.rst:2027 msgid "" "``keywords`` is a list of :class:`keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:1931 +#: ../../library/ast.rst:2030 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:1933 +#: ../../library/ast.rst:2032 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1962 +#: ../../library/ast.rst:2063 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:1966 +#: ../../library/ast.rst:2067 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:1972 +#: ../../library/ast.rst:2073 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2005 +#: ../../library/ast.rst:2107 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2010 +#: ../../library/ast.rst:2112 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -964,23 +1006,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:2018 +#: ../../library/ast.rst:2120 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:2020 +#: ../../library/ast.rst:2122 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:2025 +#: ../../library/ast.rst:2127 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:2028 +#: ../../library/ast.rst:2130 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -993,14 +1035,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:2038 +#: ../../library/ast.rst:2140 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:2042 +#: ../../library/ast.rst:2144 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -1009,12 +1051,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:2049 +#: ../../library/ast.rst:2151 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:2052 +#: ../../library/ast.rst:2154 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1024,45 +1066,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:2059 +#: ../../library/ast.rst:2161 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2165 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2067 +#: ../../library/ast.rst:2169 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:2073 +#: ../../library/ast.rst:2175 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:2078 +#: ../../library/ast.rst:2180 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:2083 +#: ../../library/ast.rst:2185 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:2091 +#: ../../library/ast.rst:2193 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1070,14 +1112,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:2096 +#: ../../library/ast.rst:2198 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2101 +#: ../../library/ast.rst:2203 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1089,31 +1131,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2111 +#: ../../library/ast.rst:2213 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2114 +#: ../../library/ast.rst:2216 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2118 +#: ../../library/ast.rst:2220 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2121 +#: ../../library/ast.rst:2223 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2124 +#: ../../library/ast.rst:2226 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2130 +#: ../../library/ast.rst:2232 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1121,24 +1163,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2136 +#: ../../library/ast.rst:2238 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2142 +#: ../../library/ast.rst:2244 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2146 +#: ../../library/ast.rst:2248 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2154 +#: ../../library/ast.rst:2256 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1147,77 +1189,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2163 +#: ../../library/ast.rst:2265 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2170 +#: ../../library/ast.rst:2272 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2177 +#: ../../library/ast.rst:2279 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2183 +#: ../../library/ast.rst:2285 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2189 +#: ../../library/ast.rst:2291 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2196 +#: ../../library/ast.rst:2298 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2200 +#: ../../library/ast.rst:2302 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2205 +#: ../../library/ast.rst:2307 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2211 +#: ../../library/ast.rst:2313 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:2315 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2217 +#: ../../library/ast.rst:2319 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2223 +#: ../../library/ast.rst:2325 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1225,13 +1267,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2231 +#: ../../library/ast.rst:2333 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2234 +#: ../../library/ast.rst:2336 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1240,27 +1282,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2240 +#: ../../library/ast.rst:2342 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2252 +#: ../../library/ast.rst:2354 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2256 +#: ../../library/ast.rst:2358 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2260 +#: ../../library/ast.rst:2362 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1268,11 +1310,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2268 +#: ../../library/ast.rst:2370 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2275 +#: ../../library/ast.rst:2377 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1283,7 +1325,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2283 +#: ../../library/ast.rst:2385 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1293,87 +1335,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2290 +#: ../../library/ast.rst:2392 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2297 +#: ../../library/ast.rst:2399 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2299 +#: ../../library/ast.rst:2401 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2304 +#: ../../library/ast.rst:2406 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2311 +#: ../../library/ast.rst:2413 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2316 +#: ../../library/ast.rst:2418 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2325 +#: ../../library/ast.rst:2427 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2329 +#: ../../library/ast.rst:2431 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2336 +#: ../../library/ast.rst:2438 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2342 +#: ../../library/ast.rst:2444 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2347 +#: ../../library/ast.rst:2449 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2352 +#: ../../library/ast.rst:2454 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2356 +#: ../../library/ast.rst:2458 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2361 +#: ../../library/ast.rst:2463 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2363 +#: ../../library/ast.rst:2465 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2369 +#: ../../library/ast.rst:2471 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2372 +#: ../../library/ast.rst:2474 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1381,21 +1423,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2479 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2381 +#: ../../library/ast.rst:2483 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2386 +#: ../../library/ast.rst:2488 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 444b4a9d1d..db76071648 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,100 +103,96 @@ msgid "" "and close an event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:63 +#: ../../library/asyncio-eventloop.rst:62 msgid "" -"In Python versions 3.10.0--3.10.8 and 3.11.0 this function (and other " -"functions which use it implicitly) emitted a :exc:`DeprecationWarning` if " -"there was no running event loop, even if the current loop was set on the " -"policy. In Python versions 3.10.9, 3.11.1 and 3.12 they emit a :exc:" -"`DeprecationWarning` if there is no running event loop and no current loop " -"is set. In some future Python release this will become an error." +"Deprecation warning is emitted if there is no current event loop. In some " +"future Python release this will become an error." msgstr "" -#: ../../library/asyncio-eventloop.rst:74 +#: ../../library/asyncio-eventloop.rst:68 msgid "Set *loop* as the current event loop for the current OS thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:78 +#: ../../library/asyncio-eventloop.rst:72 msgid "Create and return a new event loop object." msgstr "" -#: ../../library/asyncio-eventloop.rst:80 +#: ../../library/asyncio-eventloop.rst:74 msgid "" "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -#: ../../library/asyncio-eventloop.rst:86 +#: ../../library/asyncio-eventloop.rst:80 msgid "Contents" msgstr "目錄" -#: ../../library/asyncio-eventloop.rst:87 +#: ../../library/asyncio-eventloop.rst:81 msgid "This documentation page contains the following sections:" msgstr "" -#: ../../library/asyncio-eventloop.rst:89 +#: ../../library/asyncio-eventloop.rst:83 msgid "" "The `Event Loop Methods`_ section is the reference documentation of the " "event loop APIs;" msgstr "" -#: ../../library/asyncio-eventloop.rst:92 +#: ../../library/asyncio-eventloop.rst:86 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" "meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:96 +#: ../../library/asyncio-eventloop.rst:90 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:99 +#: ../../library/asyncio-eventloop.rst:93 msgid "" "The `Event Loop Implementations`_ section documents the :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -#: ../../library/asyncio-eventloop.rst:102 +#: ../../library/asyncio-eventloop.rst:96 msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "" -#: ../../library/asyncio-eventloop.rst:109 +#: ../../library/asyncio-eventloop.rst:103 msgid "Event Loop Methods" msgstr "" -#: ../../library/asyncio-eventloop.rst:111 +#: ../../library/asyncio-eventloop.rst:105 msgid "Event loops have **low-level** APIs for the following:" msgstr "" -#: ../../library/asyncio-eventloop.rst:119 +#: ../../library/asyncio-eventloop.rst:113 msgid "Running and stopping the loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:123 +#: ../../library/asyncio-eventloop.rst:117 msgid "Run until the *future* (an instance of :class:`Future`) has completed." msgstr "" -#: ../../library/asyncio-eventloop.rst:126 +#: ../../library/asyncio-eventloop.rst:120 msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:129 +#: ../../library/asyncio-eventloop.rst:123 msgid "Return the Future's result or raise its exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:133 +#: ../../library/asyncio-eventloop.rst:127 msgid "Run the event loop until :meth:`stop` is called." msgstr "" -#: ../../library/asyncio-eventloop.rst:135 +#: ../../library/asyncio-eventloop.rst:129 msgid "" "If :meth:`stop` is called before :meth:`run_forever()` is called, the loop " "will poll the I/O selector once with a timeout of zero, run all callbacks " @@ -204,7 +200,7 @@ msgid "" "and then exit." msgstr "" -#: ../../library/asyncio-eventloop.rst:140 +#: ../../library/asyncio-eventloop.rst:134 msgid "" "If :meth:`stop` is called while :meth:`run_forever` is running, the loop " "will run the current batch of callbacks and then exit. Note that new " @@ -213,41 +209,41 @@ msgid "" "called." msgstr "" -#: ../../library/asyncio-eventloop.rst:148 +#: ../../library/asyncio-eventloop.rst:142 msgid "Stop the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:152 +#: ../../library/asyncio-eventloop.rst:146 msgid "Return ``True`` if the event loop is currently running." msgstr "" -#: ../../library/asyncio-eventloop.rst:156 +#: ../../library/asyncio-eventloop.rst:150 msgid "Return ``True`` if the event loop was closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:160 +#: ../../library/asyncio-eventloop.rst:154 msgid "Close the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:162 +#: ../../library/asyncio-eventloop.rst:156 msgid "" "The loop must not be running when this function is called. Any pending " "callbacks will be discarded." msgstr "" -#: ../../library/asyncio-eventloop.rst:165 +#: ../../library/asyncio-eventloop.rst:159 msgid "" "This method clears all queues and shuts down the executor, but does not wait " "for the executor to finish." msgstr "" -#: ../../library/asyncio-eventloop.rst:168 +#: ../../library/asyncio-eventloop.rst:162 msgid "" "This method is idempotent and irreversible. No other methods should be " "called after the event loop is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:173 +#: ../../library/asyncio-eventloop.rst:167 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " "with an :meth:`~agen.aclose()` call. After calling this method, the event " @@ -255,22 +251,22 @@ msgid "" "should be used to reliably finalize all scheduled asynchronous generators." msgstr "" -#: ../../library/asyncio-eventloop.rst:179 +#: ../../library/asyncio-eventloop.rst:173 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" -#: ../../library/asyncio-eventloop.rst:182 -#: ../../library/asyncio-eventloop.rst:1219 -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:176 +#: ../../library/asyncio-eventloop.rst:1236 +#: ../../library/asyncio-eventloop.rst:1639 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-eventloop.rst:194 +#: ../../library/asyncio-eventloop.rst:188 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " @@ -278,220 +274,239 @@ msgid "" "run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" -#: ../../library/asyncio-eventloop.rst:202 +#: ../../library/asyncio-eventloop.rst:194 +msgid "" +"The *timeout* parameter specifies the amount of time (in :class:`float` " +"seconds) the executor will be given to finish joining. With the default, " +"``None``, the executor is allowed an unlimited amount of time." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:199 +msgid "" +"If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " +"default executor is terminated without waiting for its threads to finish " +"joining." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:205 msgid "" "Do not call this method when using :func:`asyncio.run`, as the latter " "handles default executor shutdown automatically." msgstr "" -#: ../../library/asyncio-eventloop.rst:209 +#: ../../library/asyncio-eventloop.rst:210 +#, fuzzy +msgid "Added the *timeout* parameter." +msgstr "加入 *name* 參數。" + +#: ../../library/asyncio-eventloop.rst:214 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:213 +#: ../../library/asyncio-eventloop.rst:218 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:216 +#: ../../library/asyncio-eventloop.rst:221 msgid "" "Return an instance of :class:`asyncio.Handle`, which can be used later to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:219 +#: ../../library/asyncio-eventloop.rst:224 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:222 +#: ../../library/asyncio-eventloop.rst:227 msgid "" "The optional keyword-only *context* argument specifies a custom :class:" "`contextvars.Context` for the *callback* to run in. Callbacks use the " "current context when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:226 +#: ../../library/asyncio-eventloop.rst:231 msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:230 +#: ../../library/asyncio-eventloop.rst:235 msgid "" "A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " "another thread, this function *must* be used, since :meth:`call_soon` is not " "thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:234 +#: ../../library/asyncio-eventloop.rst:239 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:238 +#: ../../library/asyncio-eventloop.rst:243 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:241 -#: ../../library/asyncio-eventloop.rst:291 -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:246 +#: ../../library/asyncio-eventloop.rst:296 +#: ../../library/asyncio-eventloop.rst:316 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:249 +#: ../../library/asyncio-eventloop.rst:254 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:256 +#: ../../library/asyncio-eventloop.rst:261 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:264 +#: ../../library/asyncio-eventloop.rst:269 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:266 +#: ../../library/asyncio-eventloop.rst:271 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:273 +#: ../../library/asyncio-eventloop.rst:278 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:276 -#: ../../library/asyncio-eventloop.rst:308 +#: ../../library/asyncio-eventloop.rst:281 +#: ../../library/asyncio-eventloop.rst:313 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:279 +#: ../../library/asyncio-eventloop.rst:284 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:283 +#: ../../library/asyncio-eventloop.rst:288 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:287 +#: ../../library/asyncio-eventloop.rst:292 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " "context is used when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:295 +#: ../../library/asyncio-eventloop.rst:300 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:302 +#: ../../library/asyncio-eventloop.rst:307 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:306 +#: ../../library/asyncio-eventloop.rst:311 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:315 +#: ../../library/asyncio-eventloop.rst:320 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:327 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:326 +#: ../../library/asyncio-eventloop.rst:331 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:332 +#: ../../library/asyncio-eventloop.rst:337 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:336 +#: ../../library/asyncio-eventloop.rst:341 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:340 +#: ../../library/asyncio-eventloop.rst:345 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:342 +#: ../../library/asyncio-eventloop.rst:347 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:350 +#: ../../library/asyncio-eventloop.rst:355 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:353 +#: ../../library/asyncio-eventloop.rst:358 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:357 +#: ../../library/asyncio-eventloop.rst:362 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:360 +#: ../../library/asyncio-eventloop.rst:365 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:364 +#: ../../library/asyncio-eventloop.rst:369 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:367 +#: ../../library/asyncio-eventloop.rst:372 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:372 +#: ../../library/asyncio-eventloop.rst:377 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:375 +#: ../../library/asyncio-eventloop.rst:380 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -500,82 +515,82 @@ msgid "" "Future`-compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:383 +#: ../../library/asyncio-eventloop.rst:388 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:387 +#: ../../library/asyncio-eventloop.rst:392 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:397 +#: ../../library/asyncio-eventloop.rst:403 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:400 +#: ../../library/asyncio-eventloop.rst:406 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:404 +#: ../../library/asyncio-eventloop.rst:410 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:406 -#: ../../library/asyncio-eventloop.rst:1135 -#: ../../library/asyncio-eventloop.rst:1151 +#: ../../library/asyncio-eventloop.rst:412 +#: ../../library/asyncio-eventloop.rst:1152 +#: ../../library/asyncio-eventloop.rst:1168 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:409 +#: ../../library/asyncio-eventloop.rst:415 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:412 +#: ../../library/asyncio-eventloop.rst:418 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:414 +#: ../../library/asyncio-eventloop.rst:420 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:417 +#: ../../library/asyncio-eventloop.rst:423 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:420 +#: ../../library/asyncio-eventloop.rst:426 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:429 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:425 +#: ../../library/asyncio-eventloop.rst:431 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:428 -#: ../../library/asyncio-eventloop.rst:549 +#: ../../library/asyncio-eventloop.rst:434 +#: ../../library/asyncio-eventloop.rst:566 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:430 +#: ../../library/asyncio-eventloop.rst:436 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -584,11 +599,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:436 +#: ../../library/asyncio-eventloop.rst:442 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:438 +#: ../../library/asyncio-eventloop.rst:444 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -599,7 +614,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:446 +#: ../../library/asyncio-eventloop.rst:452 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -607,7 +622,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:451 +#: ../../library/asyncio-eventloop.rst:457 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -617,7 +632,7 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:459 +#: ../../library/asyncio-eventloop.rst:465 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -628,7 +643,7 @@ msgid "" "*happy_eyeballs_delay* is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:468 +#: ../../library/asyncio-eventloop.rst:474 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -636,61 +651,71 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:476 -#: ../../library/asyncio-eventloop.rst:580 -#: ../../library/asyncio-eventloop.rst:804 +#: ../../library/asyncio-eventloop.rst:482 +#: ../../library/asyncio-eventloop.rst:597 +#: ../../library/asyncio-eventloop.rst:821 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:480 +#: ../../library/asyncio-eventloop.rst:486 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:484 -#: ../../library/asyncio-eventloop.rst:898 +#: ../../library/asyncio-eventloop.rst:490 +#: ../../library/asyncio-eventloop.rst:915 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:488 -#: ../../library/asyncio-eventloop.rst:721 -#: ../../library/asyncio-eventloop.rst:815 -#: ../../library/asyncio-eventloop.rst:902 +#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:738 +#: ../../library/asyncio-eventloop.rst:832 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:498 +msgid "" +"*all_errors* determines what exceptions are raised when a connection cannot " +"be created. By default, only a single ``Exception`` is raised: the first " +"exception if there is only one or all errors have same message, or a single " +"``OSError`` with the error messages combined. When ``all_errors`` is " +"``True``, an ``ExceptionGroup`` will be raised containing all exceptions " +"(even if there is only one)." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:508 +#: ../../library/asyncio-eventloop.rst:750 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:498 +#: ../../library/asyncio-eventloop.rst:512 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:503 -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:517 +#: ../../library/asyncio-eventloop.rst:842 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:507 +#: ../../library/asyncio-eventloop.rst:521 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:509 +#: ../../library/asyncio-eventloop.rst:523 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -701,69 +726,73 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:518 +#: ../../library/asyncio-eventloop.rst:532 msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:522 -#: ../../library/asyncio-eventloop.rst:641 -#: ../../library/asyncio-eventloop.rst:747 -#: ../../library/asyncio-eventloop.rst:782 -#: ../../library/asyncio-eventloop.rst:829 -#: ../../library/asyncio-eventloop.rst:910 +#: ../../library/asyncio-eventloop.rst:536 +#: ../../library/asyncio-eventloop.rst:658 +#: ../../library/asyncio-eventloop.rst:764 +#: ../../library/asyncio-eventloop.rst:799 +#: ../../library/asyncio-eventloop.rst:846 +#: ../../library/asyncio-eventloop.rst:927 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:526 +#: ../../library/asyncio-eventloop.rst:538 +msgid "*all_errors* was added." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:543 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:536 +#: ../../library/asyncio-eventloop.rst:553 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:555 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:542 +#: ../../library/asyncio-eventloop.rst:559 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:544 -#: ../../library/asyncio-eventloop.rst:664 -#: ../../library/asyncio-eventloop.rst:796 +#: ../../library/asyncio-eventloop.rst:561 +#: ../../library/asyncio-eventloop.rst:681 +#: ../../library/asyncio-eventloop.rst:813 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:547 -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:564 +#: ../../library/asyncio-eventloop.rst:640 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:568 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:555 +#: ../../library/asyncio-eventloop.rst:572 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:559 +#: ../../library/asyncio-eventloop.rst:576 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -771,7 +800,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:564 +#: ../../library/asyncio-eventloop.rst:581 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -780,13 +809,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:570 +#: ../../library/asyncio-eventloop.rst:587 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:573 +#: ../../library/asyncio-eventloop.rst:590 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -794,33 +823,33 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:584 +#: ../../library/asyncio-eventloop.rst:601 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:604 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:591 +#: ../../library/asyncio-eventloop.rst:608 msgid "" "The *reuse_address* parameter is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:613 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:600 +#: ../../library/asyncio-eventloop.rst:617 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -828,95 +857,95 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:606 +#: ../../library/asyncio-eventloop.rst:623 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:609 +#: ../../library/asyncio-eventloop.rst:626 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:618 +#: ../../library/asyncio-eventloop.rst:635 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:620 +#: ../../library/asyncio-eventloop.rst:637 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:625 +#: ../../library/asyncio-eventloop.rst:642 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:630 +#: ../../library/asyncio-eventloop.rst:647 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:633 -#: ../../library/asyncio-eventloop.rst:773 -#: ../../library/asyncio-eventloop.rst:1202 +#: ../../library/asyncio-eventloop.rst:650 +#: ../../library/asyncio-eventloop.rst:790 +#: ../../library/asyncio-eventloop.rst:1219 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:652 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:645 +#: ../../library/asyncio-eventloop.rst:662 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:657 +#: ../../library/asyncio-eventloop.rst:674 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:677 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:662 +#: ../../library/asyncio-eventloop.rst:679 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:667 +#: ../../library/asyncio-eventloop.rst:684 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:670 +#: ../../library/asyncio-eventloop.rst:687 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:673 +#: ../../library/asyncio-eventloop.rst:690 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:676 +#: ../../library/asyncio-eventloop.rst:693 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:680 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -924,63 +953,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:702 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:690 +#: ../../library/asyncio-eventloop.rst:707 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:692 +#: ../../library/asyncio-eventloop.rst:709 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:714 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:701 +#: ../../library/asyncio-eventloop.rst:718 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:704 +#: ../../library/asyncio-eventloop.rst:721 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:724 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:712 +#: ../../library/asyncio-eventloop.rst:729 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:717 +#: ../../library/asyncio-eventloop.rst:734 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:725 +#: ../../library/asyncio-eventloop.rst:742 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -988,44 +1017,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:754 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:741 +#: ../../library/asyncio-eventloop.rst:758 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:751 +#: ../../library/asyncio-eventloop.rst:768 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:762 +#: ../../library/asyncio-eventloop.rst:779 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:765 +#: ../../library/asyncio-eventloop.rst:782 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:787 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:777 +#: ../../library/asyncio-eventloop.rst:794 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1033,63 +1062,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:789 +#: ../../library/asyncio-eventloop.rst:806 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:808 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:794 -#: ../../library/asyncio-eventloop.rst:884 +#: ../../library/asyncio-eventloop.rst:811 +#: ../../library/asyncio-eventloop.rst:901 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:799 +#: ../../library/asyncio-eventloop.rst:816 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:808 +#: ../../library/asyncio-eventloop.rst:825 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 +#: ../../library/asyncio-eventloop.rst:828 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:819 +#: ../../library/asyncio-eventloop.rst:836 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:833 +#: ../../library/asyncio-eventloop.rst:850 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:838 +#: ../../library/asyncio-eventloop.rst:855 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:858 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:843 +#: ../../library/asyncio-eventloop.rst:860 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:845 -#: ../../library/asyncio-eventloop.rst:1090 +#: ../../library/asyncio-eventloop.rst:862 +#: ../../library/asyncio-eventloop.rst:1107 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1098,35 +1127,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:852 +#: ../../library/asyncio-eventloop.rst:869 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:856 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:863 +#: ../../library/asyncio-eventloop.rst:880 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:870 +#: ../../library/asyncio-eventloop.rst:887 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:872 +#: ../../library/asyncio-eventloop.rst:889 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:876 +#: ../../library/asyncio-eventloop.rst:893 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1134,80 +1163,80 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:881 +#: ../../library/asyncio-eventloop.rst:898 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:886 +#: ../../library/asyncio-eventloop.rst:903 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:890 +#: ../../library/asyncio-eventloop.rst:907 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:892 +#: ../../library/asyncio-eventloop.rst:909 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:912 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:915 +#: ../../library/asyncio-eventloop.rst:932 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:936 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:925 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:930 +#: ../../library/asyncio-eventloop.rst:947 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:934 -#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:951 +#: ../../library/asyncio-eventloop.rst:1206 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:956 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:959 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:964 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:949 +#: ../../library/asyncio-eventloop.rst:966 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1216,72 +1245,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:958 +#: ../../library/asyncio-eventloop.rst:975 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:961 +#: ../../library/asyncio-eventloop.rst:978 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:963 -#: ../../library/asyncio-eventloop.rst:977 -#: ../../library/asyncio-eventloop.rst:988 -#: ../../library/asyncio-eventloop.rst:1000 -#: ../../library/asyncio-eventloop.rst:1015 -#: ../../library/asyncio-eventloop.rst:1030 -#: ../../library/asyncio-eventloop.rst:1040 -#: ../../library/asyncio-eventloop.rst:1066 -#: ../../library/asyncio-eventloop.rst:1104 +#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:994 +#: ../../library/asyncio-eventloop.rst:1005 +#: ../../library/asyncio-eventloop.rst:1017 +#: ../../library/asyncio-eventloop.rst:1032 +#: ../../library/asyncio-eventloop.rst:1047 +#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:1083 +#: ../../library/asyncio-eventloop.rst:1121 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:965 +#: ../../library/asyncio-eventloop.rst:982 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:972 +#: ../../library/asyncio-eventloop.rst:989 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:975 +#: ../../library/asyncio-eventloop.rst:992 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:983 +#: ../../library/asyncio-eventloop.rst:1000 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:986 +#: ../../library/asyncio-eventloop.rst:1003 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:994 +#: ../../library/asyncio-eventloop.rst:1011 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1015 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1006 +#: ../../library/asyncio-eventloop.rst:1023 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1026 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1290,34 +1319,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1017 -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1034 +#: ../../library/asyncio-eventloop.rst:1085 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1024 +#: ../../library/asyncio-eventloop.rst:1041 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1028 +#: ../../library/asyncio-eventloop.rst:1045 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1053 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1055 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1042 +#: ../../library/asyncio-eventloop.rst:1059 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1325,19 +1354,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1068 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:1074 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1060 +#: ../../library/asyncio-eventloop.rst:1077 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1345,57 +1374,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1092 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1080 +#: ../../library/asyncio-eventloop.rst:1097 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1083 +#: ../../library/asyncio-eventloop.rst:1100 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1085 +#: ../../library/asyncio-eventloop.rst:1102 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1088 +#: ../../library/asyncio-eventloop.rst:1105 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1114 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1101 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1110 +#: ../../library/asyncio-eventloop.rst:1127 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1115 +#: ../../library/asyncio-eventloop.rst:1132 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1119 +#: ../../library/asyncio-eventloop.rst:1136 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:1138 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1403,67 +1432,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1129 +#: ../../library/asyncio-eventloop.rst:1146 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:1150 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1155 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1140 +#: ../../library/asyncio-eventloop.rst:1157 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1144 -#: ../../library/asyncio-eventloop.rst:1160 +#: ../../library/asyncio-eventloop.rst:1161 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1166 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1154 +#: ../../library/asyncio-eventloop.rst:1171 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1173 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1182 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1170 +#: ../../library/asyncio-eventloop.rst:1187 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1175 +#: ../../library/asyncio-eventloop.rst:1192 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1179 +#: ../../library/asyncio-eventloop.rst:1196 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1181 +#: ../../library/asyncio-eventloop.rst:1198 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1471,46 +1500,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1186 +#: ../../library/asyncio-eventloop.rst:1203 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:1214 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1216 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1206 +#: ../../library/asyncio-eventloop.rst:1223 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1227 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1231 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1233 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1278 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1518,17 +1547,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1266 +#: ../../library/asyncio-eventloop.rst:1283 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1268 +#: ../../library/asyncio-eventloop.rst:1285 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1288 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1536,32 +1565,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1280 +#: ../../library/asyncio-eventloop.rst:1297 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1284 +#: ../../library/asyncio-eventloop.rst:1301 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1290 +#: ../../library/asyncio-eventloop.rst:1307 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1292 +#: ../../library/asyncio-eventloop.rst:1309 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1296 +#: ../../library/asyncio-eventloop.rst:1313 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1298 +#: ../../library/asyncio-eventloop.rst:1315 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1570,158 +1599,171 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1323 +msgid "" +"If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" +"`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " +"task or callback handle." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1329 +msgid "" +"The handler may be called in the :class:`~contextvars.Context` of the task " +"or handle where the exception originated." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1334 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1341 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1317 +#: ../../library/asyncio-eventloop.rst:1343 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1347 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1326 +#: ../../library/asyncio-eventloop.rst:1352 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1354 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1357 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1332 +#: ../../library/asyncio-eventloop.rst:1358 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1359 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1360 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1361 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1336 +#: ../../library/asyncio-eventloop.rst:1362 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1363 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1338 +#: ../../library/asyncio-eventloop.rst:1364 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1366 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1366 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1344 +#: ../../library/asyncio-eventloop.rst:1370 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1349 +#: ../../library/asyncio-eventloop.rst:1375 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1353 +#: ../../library/asyncio-eventloop.rst:1379 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1355 +#: ../../library/asyncio-eventloop.rst:1381 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1387 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1391 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1396 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1374 +#: ../../library/asyncio-eventloop.rst:1400 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1402 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1383 +#: ../../library/asyncio-eventloop.rst:1409 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1392 +#: ../../library/asyncio-eventloop.rst:1418 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1395 +#: ../../library/asyncio-eventloop.rst:1421 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1423 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1424 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1401 +#: ../../library/asyncio-eventloop.rst:1427 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1405 +#: ../../library/asyncio-eventloop.rst:1431 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1729,136 +1771,132 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1411 +#: ../../library/asyncio-eventloop.rst:1437 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1440 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1416 +#: ../../library/asyncio-eventloop.rst:1442 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 -msgid "" -"a file-like object representing a pipe to be connected to the subprocess's " -"standard input stream using :meth:`~loop.connect_write_pipe`" +#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1454 +#: ../../library/asyncio-eventloop.rst:1464 +msgid "a file-like object" msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 -#: ../../library/asyncio-eventloop.rst:1433 #: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1455 +#: ../../library/asyncio-eventloop.rst:1465 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 -#: ../../library/asyncio-eventloop.rst:1435 #: ../../library/asyncio-eventloop.rst:1447 +#: ../../library/asyncio-eventloop.rst:1457 +#: ../../library/asyncio-eventloop.rst:1467 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1425 -#: ../../library/asyncio-eventloop.rst:1437 #: ../../library/asyncio-eventloop.rst:1449 +#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1469 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1428 +#: ../../library/asyncio-eventloop.rst:1452 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1430 -msgid "" -"a file-like object representing a pipe to be connected to the subprocess's " -"standard output stream using :meth:`~loop.connect_write_pipe`" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1462 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1442 -msgid "" -"a file-like object representing a pipe to be connected to the subprocess's " -"standard error stream using :meth:`~loop.connect_write_pipe`" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1451 +#: ../../library/asyncio-eventloop.rst:1471 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1454 +#: ../../library/asyncio-eventloop.rst:1474 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1463 +#: ../../library/asyncio-eventloop.rst:1483 +msgid "" +"If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " +"pipe, then the other side of this pipe should be registered with :meth:" +"`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " +"the event loop." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1488 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1491 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1499 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1504 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1482 +#: ../../library/asyncio-eventloop.rst:1507 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1485 +#: ../../library/asyncio-eventloop.rst:1510 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1513 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1493 +#: ../../library/asyncio-eventloop.rst:1518 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1868,105 +1906,110 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1502 +#: ../../library/asyncio-eventloop.rst:1527 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1506 +#: ../../library/asyncio-eventloop.rst:1531 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1536 +msgid "" +"Return the :class:`contextvars.Context` object associated with the handle." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1543 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1516 +#: ../../library/asyncio-eventloop.rst:1548 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1554 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1525 +#: ../../library/asyncio-eventloop.rst:1557 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1529 +#: ../../library/asyncio-eventloop.rst:1561 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1538 +#: ../../library/asyncio-eventloop.rst:1570 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1540 +#: ../../library/asyncio-eventloop.rst:1572 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1576 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1580 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1561 +#: ../../library/asyncio-eventloop.rst:1593 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1566 +#: ../../library/asyncio-eventloop.rst:1598 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1569 +#: ../../library/asyncio-eventloop.rst:1601 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1572 +#: ../../library/asyncio-eventloop.rst:1604 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1577 +#: ../../library/asyncio-eventloop.rst:1609 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1583 +#: ../../library/asyncio-eventloop.rst:1615 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1585 +#: ../../library/asyncio-eventloop.rst:1617 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1588 +#: ../../library/asyncio-eventloop.rst:1620 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1975,98 +2018,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1599 +#: ../../library/asyncio-eventloop.rst:1631 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1603 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1625 +#: ../../library/asyncio-eventloop.rst:1657 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1631 +#: ../../library/asyncio-eventloop.rst:1663 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1667 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1670 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1648 +#: ../../library/asyncio-eventloop.rst:1680 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1650 +#: ../../library/asyncio-eventloop.rst:1682 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1685 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1659 +#: ../../library/asyncio-eventloop.rst:1691 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1661 +#: ../../library/asyncio-eventloop.rst:1693 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1708 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1681 +#: ../../library/asyncio-eventloop.rst:1713 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1715 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1719 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1725 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1727 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1701 +#: ../../library/asyncio-eventloop.rst:1733 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1703 +#: ../../library/asyncio-eventloop.rst:1735 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2074,70 +2117,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1713 +#: ../../library/asyncio-eventloop.rst:1745 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1715 +#: ../../library/asyncio-eventloop.rst:1747 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1771 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1746 +#: ../../library/asyncio-eventloop.rst:1778 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1748 +#: ../../library/asyncio-eventloop.rst:1780 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1776 +#: ../../library/asyncio-eventloop.rst:1808 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1783 +#: ../../library/asyncio-eventloop.rst:1815 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1785 +#: ../../library/asyncio-eventloop.rst:1817 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1823 +#: ../../library/asyncio-eventloop.rst:1855 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1859 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1835 +#: ../../library/asyncio-eventloop.rst:1867 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1837 +#: ../../library/asyncio-eventloop.rst:1869 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1839 +#: ../../library/asyncio-eventloop.rst:1871 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index c45f22e4aa..a8a4efe3ad 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-14 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -117,76 +117,76 @@ msgid "" "interface." msgstr "" -#: ../../library/asyncio-policy.rst:89 ../../library/asyncio-policy.rst:95 +#: ../../library/asyncio-policy.rst:89 ../../library/asyncio-policy.rst:97 msgid "This function is Unix specific." msgstr "" -#: ../../library/asyncio-policy.rst:93 +#: ../../library/asyncio-policy.rst:95 msgid "Set the current child process watcher to *watcher*." msgstr "" -#: ../../library/asyncio-policy.rst:100 +#: ../../library/asyncio-policy.rst:104 msgid "asyncio ships with the following built-in policies:" msgstr "" -#: ../../library/asyncio-policy.rst:105 +#: ../../library/asyncio-policy.rst:109 msgid "" "The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :" "class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-policy.rst:108 +#: ../../library/asyncio-policy.rst:112 msgid "" "There is no need to install the default policy manually. asyncio is " "configured to use the default policy automatically." msgstr "" -#: ../../library/asyncio-policy.rst:113 +#: ../../library/asyncio-policy.rst:117 msgid "On Windows, :class:`ProactorEventLoop` is now used by default." msgstr "" -#: ../../library/asyncio-policy.rst:116 +#: ../../library/asyncio-policy.rst:119 msgid "" -"In Python versions 3.10.9, 3.11.1 and 3.12 the :meth:`get_event_loop` method " -"of the default asyncio policy emits a :exc:`DeprecationWarning` if there is " -"no running event loop and no current loop is set. In some future Python " -"release this will become an error." +"The :meth:`get_event_loop` method of the default asyncio policy now emits a :" +"exc:`DeprecationWarning` if there is no current event loop set and it " +"decides to create one. In some future Python release this will become an " +"error." msgstr "" -#: ../../library/asyncio-policy.rst:124 +#: ../../library/asyncio-policy.rst:128 msgid "" "An alternative event loop policy that uses the :class:`SelectorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:127 ../../library/asyncio-policy.rst:135 +#: ../../library/asyncio-policy.rst:131 ../../library/asyncio-policy.rst:139 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-policy.rst:132 +#: ../../library/asyncio-policy.rst:136 msgid "" "An alternative event loop policy that uses the :class:`ProactorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:141 +#: ../../library/asyncio-policy.rst:145 msgid "Process Watchers" msgstr "" -#: ../../library/asyncio-policy.rst:143 +#: ../../library/asyncio-policy.rst:147 msgid "" "A process watcher allows customization of how an event loop monitors child " "processes on Unix. Specifically, the event loop needs to know when a child " "process has exited." msgstr "" -#: ../../library/asyncio-policy.rst:147 +#: ../../library/asyncio-policy.rst:151 msgid "" "In asyncio, child processes are created with :func:`create_subprocess_exec` " "and :meth:`loop.subprocess_exec` functions." msgstr "" -#: ../../library/asyncio-policy.rst:151 +#: ../../library/asyncio-policy.rst:155 msgid "" "asyncio defines the :class:`AbstractChildWatcher` abstract base class, which " "child watchers should implement, and has four different implementations: :" @@ -195,176 +195,176 @@ msgid "" "`FastChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:157 +#: ../../library/asyncio-policy.rst:161 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-policy.rst:160 +#: ../../library/asyncio-policy.rst:164 msgid "" "The following two functions can be used to customize the child process " "watcher implementation used by the asyncio event loop:" msgstr "" -#: ../../library/asyncio-policy.rst:165 +#: ../../library/asyncio-policy.rst:169 msgid "Return the current child watcher for the current policy." msgstr "" -#: ../../library/asyncio-policy.rst:169 +#: ../../library/asyncio-policy.rst:175 msgid "" "Set the current child watcher to *watcher* for the current policy. " "*watcher* must implement methods defined in the :class:" "`AbstractChildWatcher` base class." msgstr "" -#: ../../library/asyncio-policy.rst:174 +#: ../../library/asyncio-policy.rst:182 msgid "" "Third-party event loops implementations might not support custom child " "watchers. For such event loops, using :func:`set_child_watcher` might be " "prohibited or have no effect." msgstr "" -#: ../../library/asyncio-policy.rst:182 +#: ../../library/asyncio-policy.rst:190 msgid "Register a new child handler." msgstr "" -#: ../../library/asyncio-policy.rst:184 +#: ../../library/asyncio-policy.rst:192 msgid "" "Arrange for ``callback(pid, returncode, *args)`` to be called when a process " "with PID equal to *pid* terminates. Specifying another callback for the " "same process replaces the previous handler." msgstr "" -#: ../../library/asyncio-policy.rst:189 +#: ../../library/asyncio-policy.rst:197 msgid "The *callback* callable must be thread-safe." msgstr "" -#: ../../library/asyncio-policy.rst:193 +#: ../../library/asyncio-policy.rst:201 msgid "Removes the handler for process with PID equal to *pid*." msgstr "" -#: ../../library/asyncio-policy.rst:195 +#: ../../library/asyncio-policy.rst:203 msgid "" "The function returns ``True`` if the handler was successfully removed, " "``False`` if there was nothing to remove." msgstr "" -#: ../../library/asyncio-policy.rst:200 +#: ../../library/asyncio-policy.rst:208 msgid "Attach the watcher to an event loop." msgstr "" -#: ../../library/asyncio-policy.rst:202 +#: ../../library/asyncio-policy.rst:210 msgid "" "If the watcher was previously attached to an event loop, then it is first " "detached before attaching to the new loop." msgstr "" -#: ../../library/asyncio-policy.rst:205 +#: ../../library/asyncio-policy.rst:213 msgid "Note: loop may be ``None``." msgstr "" -#: ../../library/asyncio-policy.rst:209 +#: ../../library/asyncio-policy.rst:217 msgid "Return ``True`` if the watcher is ready to use." msgstr "" -#: ../../library/asyncio-policy.rst:211 +#: ../../library/asyncio-policy.rst:219 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-policy.rst:218 +#: ../../library/asyncio-policy.rst:226 msgid "Close the watcher." msgstr "" -#: ../../library/asyncio-policy.rst:220 +#: ../../library/asyncio-policy.rst:228 msgid "" "This method has to be called to ensure that underlying resources are cleaned-" "up." msgstr "" -#: ../../library/asyncio-policy.rst:225 +#: ../../library/asyncio-policy.rst:236 msgid "" "This implementation starts a new waiting thread for every subprocess spawn." msgstr "" -#: ../../library/asyncio-policy.rst:227 +#: ../../library/asyncio-policy.rst:238 msgid "" "It works reliably even when the asyncio event loop is run in a non-main OS " "thread." msgstr "" -#: ../../library/asyncio-policy.rst:229 +#: ../../library/asyncio-policy.rst:240 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates), but starting a thread per process " "requires extra memory." msgstr "" -#: ../../library/asyncio-policy.rst:232 +#: ../../library/asyncio-policy.rst:243 msgid "This watcher is used by default." msgstr "" -#: ../../library/asyncio-policy.rst:238 +#: ../../library/asyncio-policy.rst:249 msgid "" "This implementation registers a :py:data:`SIGCHLD` signal handler on " "instantiation. That can break third-party code that installs a custom " "handler for :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:242 ../../library/asyncio-policy.rst:260 +#: ../../library/asyncio-policy.rst:253 ../../library/asyncio-policy.rst:273 msgid "" "The watcher avoids disrupting other code spawning processes by polling every " "process explicitly on a :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:245 +#: ../../library/asyncio-policy.rst:256 msgid "" "There is no limitation for running subprocesses from different threads once " "the watcher is installed." msgstr "" -#: ../../library/asyncio-policy.rst:248 +#: ../../library/asyncio-policy.rst:259 msgid "" "The solution is safe but it has a significant overhead when handling a big " "number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)." msgstr "" -#: ../../library/asyncio-policy.rst:256 +#: ../../library/asyncio-policy.rst:269 msgid "" "This implementation uses active event loop from the main thread to handle :" "py:data:`SIGCHLD` signal. If the main thread has no running event loop " "another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)." msgstr "" -#: ../../library/asyncio-policy.rst:263 +#: ../../library/asyncio-policy.rst:276 msgid "" "This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " "*O(N)* complexity but requires a running event loop in the main thread to " "work." msgstr "" -#: ../../library/asyncio-policy.rst:268 +#: ../../library/asyncio-policy.rst:283 msgid "" "This implementation reaps every terminated processes by calling ``os." "waitpid(-1)`` directly, possibly breaking other code spawning processes and " "waiting for their termination." msgstr "" -#: ../../library/asyncio-policy.rst:272 +#: ../../library/asyncio-policy.rst:287 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates)." msgstr "" -#: ../../library/asyncio-policy.rst:275 +#: ../../library/asyncio-policy.rst:290 msgid "" "This solution requires a running event loop in the main thread to work, as :" "class:`SafeChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:280 +#: ../../library/asyncio-policy.rst:297 msgid "" "This implementation polls process file descriptors (pidfds) to await child " "process termination. In some respects, :class:`PidfdChildWatcher` is a " @@ -375,11 +375,11 @@ msgid "" "only work on recent (5.3+) kernels." msgstr "" -#: ../../library/asyncio-policy.rst:294 +#: ../../library/asyncio-policy.rst:311 msgid "Custom Policies" msgstr "" -#: ../../library/asyncio-policy.rst:296 +#: ../../library/asyncio-policy.rst:313 msgid "" "To implement a new event loop policy, it is recommended to subclass :class:" "`DefaultEventLoopPolicy` and override the methods for which custom behavior " diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 191380c38d..94addb4fa3 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,16 +47,16 @@ msgstr "" #: ../../library/asyncio-runner.rst:29 msgid "" "This function runs the passed coroutine, taking care of managing the asyncio " -"event loop, *finalizing asynchronous generators*, and closing the threadpool." +"event loop, *finalizing asynchronous generators*, and closing the executor." msgstr "" -#: ../../library/asyncio-runner.rst:33 ../../library/asyncio-runner.rst:103 +#: ../../library/asyncio-runner.rst:33 ../../library/asyncio-runner.rst:113 msgid "" "This function cannot be called when another asyncio event loop is running in " "the same thread." msgstr "" -#: ../../library/asyncio-runner.rst:36 ../../library/asyncio-runner.rst:73 +#: ../../library/asyncio-runner.rst:36 ../../library/asyncio-runner.rst:83 msgid "" "If *debug* is ``True``, the event loop will be run in debug mode. ``False`` " "disables debug mode explicitly. ``None`` is used to respect the global :ref:" @@ -65,44 +65,57 @@ msgstr "" #: ../../library/asyncio-runner.rst:40 msgid "" -"This function always creates a new event loop and closes it at the end. It " -"should be used as a main entry point for asyncio programs, and should " -"ideally only be called once." +"If *loop_factory* is not ``None``, it is used to create a new event loop; " +"otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " +"end. This function should be used as a main entry point for asyncio " +"programs, and should ideally only be called once. It is recommended to use " +"*loop_factory* to configure the event loop instead of policies." msgstr "" -#: ../../library/asyncio-runner.rst:44 +#: ../../library/asyncio-runner.rst:46 +msgid "" +"The executor is given a timeout duration of 5 minutes to shutdown. If the " +"executor hasn't finished within that duration, a warning is emitted and the " +"executor is closed." +msgstr "" + +#: ../../library/asyncio-runner.rst:50 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-runner.rst:54 +#: ../../library/asyncio-runner.rst:60 msgid "Updated to use :meth:`loop.shutdown_default_executor`." msgstr "" -#: ../../library/asyncio-runner.rst:59 +#: ../../library/asyncio-runner.rst:65 msgid "" "*debug* is ``None`` by default to respect the global debug mode settings." msgstr "" -#: ../../library/asyncio-runner.rst:63 +#: ../../library/asyncio-runner.rst:69 +msgid "Added *loop_factory* parameter." +msgstr "" + +#: ../../library/asyncio-runner.rst:73 msgid "Runner context manager" msgstr "" -#: ../../library/asyncio-runner.rst:67 +#: ../../library/asyncio-runner.rst:77 msgid "" "A context manager that simplifies *multiple* async function calls in the " "same context." msgstr "" -#: ../../library/asyncio-runner.rst:70 +#: ../../library/asyncio-runner.rst:80 msgid "" "Sometimes several top-level async functions should be called in the same :" "ref:`event loop ` and :class:`contextvars.Context`." msgstr "" -#: ../../library/asyncio-runner.rst:77 +#: ../../library/asyncio-runner.rst:87 msgid "" "*loop_factory* could be used for overriding the loop creation. It is the " "responsibility of the *loop_factory* to set the created loop as the current " @@ -110,58 +123,58 @@ msgid "" "event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." msgstr "" -#: ../../library/asyncio-runner.rst:82 +#: ../../library/asyncio-runner.rst:92 msgid "" "Basically, :func:`asyncio.run()` example can be rewritten with the runner " "usage::" msgstr "" -#: ../../library/asyncio-runner.rst:95 +#: ../../library/asyncio-runner.rst:105 msgid "Run a :term:`coroutine ` *coro* in the embedded loop." msgstr "" -#: ../../library/asyncio-runner.rst:97 +#: ../../library/asyncio-runner.rst:107 msgid "Return the coroutine's result or raise its exception." msgstr "" -#: ../../library/asyncio-runner.rst:99 +#: ../../library/asyncio-runner.rst:109 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The runner's default " "context is used if ``None``." msgstr "" -#: ../../library/asyncio-runner.rst:108 +#: ../../library/asyncio-runner.rst:118 msgid "Close the runner." msgstr "" -#: ../../library/asyncio-runner.rst:110 +#: ../../library/asyncio-runner.rst:120 msgid "" "Finalize asynchronous generators, shutdown default executor, close the event " "loop and release embedded :class:`contextvars.Context`." msgstr "" -#: ../../library/asyncio-runner.rst:115 +#: ../../library/asyncio-runner.rst:125 msgid "Return the event loop associated with the runner instance." msgstr "" -#: ../../library/asyncio-runner.rst:119 +#: ../../library/asyncio-runner.rst:129 msgid "" ":class:`Runner` uses the lazy initialization strategy, its constructor " "doesn't initialize underlying low-level structures." msgstr "" -#: ../../library/asyncio-runner.rst:122 +#: ../../library/asyncio-runner.rst:132 msgid "" "Embedded *loop* and *context* are created at the :keyword:`with` body " "entering or the first call of :meth:`run` or :meth:`get_loop`." msgstr "" -#: ../../library/asyncio-runner.rst:127 +#: ../../library/asyncio-runner.rst:137 msgid "Handling Keyboard Interruption" msgstr "" -#: ../../library/asyncio-runner.rst:131 +#: ../../library/asyncio-runner.rst:141 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:" "`KeyboardInterrupt` exception is raised in the main thread by default. " @@ -169,26 +182,26 @@ msgid "" "asyncio internals and can hang the program from exiting." msgstr "" -#: ../../library/asyncio-runner.rst:136 +#: ../../library/asyncio-runner.rst:146 msgid "" "To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " "follows:" msgstr "" -#: ../../library/asyncio-runner.rst:138 +#: ../../library/asyncio-runner.rst:148 msgid "" ":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " "before any user code is executed and removes it when exiting from the " "function." msgstr "" -#: ../../library/asyncio-runner.rst:140 +#: ../../library/asyncio-runner.rst:150 msgid "" "The :class:`~asyncio.Runner` creates the main task for the passed coroutine " "for its execution." msgstr "" -#: ../../library/asyncio-runner.rst:142 +#: ../../library/asyncio-runner.rst:152 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " "handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " @@ -198,7 +211,7 @@ msgid "" "Runner.run` raises :exc:`KeyboardInterrupt`." msgstr "" -#: ../../library/asyncio-runner.rst:148 +#: ../../library/asyncio-runner.rst:158 msgid "" "A user could write a tight loop which cannot be interrupted by :meth:" "`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` " diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index e9721cc7da..bb115ff9cf 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-24 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,6 +109,7 @@ msgstr "移除 *loop* 參數。" #: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 #: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 +#: ../../library/asyncio-stream.rst:368 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" @@ -232,8 +233,9 @@ msgid "" "read :class:`bytes`. If EOF was received and the internal buffer is empty, " "return an empty ``bytes`` object." msgstr "" -"如果沒有設定 *n* 或是被設為 ``-1``,則會持續讀取直到 EOF,然後回傳所有讀取到的 :class:`bytes`。" -"讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" +"如果沒有設定 *n* 或是被設為 ``-1``,則會持續讀取直到 EOF,然後回傳所有讀取到" +"的 :class:`bytes`。讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物" +"件。" #: ../../library/asyncio-stream.rst:216 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." @@ -435,16 +437,23 @@ msgid "" "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:366 +#: ../../library/asyncio-stream.rst:362 +msgid "" +"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " +"to complete before aborting the connection. ``30.0`` seconds if ``None`` " +"(default)." +msgstr "" + +#: ../../library/asyncio-stream.rst:374 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:373 +#: ../../library/asyncio-stream.rst:381 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:375 +#: ../../library/asyncio-stream.rst:383 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -453,22 +462,22 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:383 +#: ../../library/asyncio-stream.rst:391 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:388 +#: ../../library/asyncio-stream.rst:396 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:390 +#: ../../library/asyncio-stream.rst:398 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:414 +#: ../../library/asyncio-stream.rst:422 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -477,18 +486,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:421 +#: ../../library/asyncio-stream.rst:429 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:423 +#: ../../library/asyncio-stream.rst:431 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:457 +#: ../../library/asyncio-stream.rst:465 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -497,11 +506,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:462 +#: ../../library/asyncio-stream.rst:470 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:464 +#: ../../library/asyncio-stream.rst:472 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -509,25 +518,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:503 +#: ../../library/asyncio-stream.rst:511 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:507 +#: ../../library/asyncio-stream.rst:515 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:515 +#: ../../library/asyncio-stream.rst:523 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:517 +#: ../../library/asyncio-stream.rst:525 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -536,7 +545,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:552 +#: ../../library/asyncio-stream.rst:560 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -546,7 +555,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:556 +#: ../../library/asyncio-stream.rst:564 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index f3db72249a..741ac3d74d 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-09 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,24 +244,28 @@ msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "" #: ../../library/asyncio-subprocess.rst:210 -msgid "read data from *stdout* and *stderr*, until EOF is reached;" +msgid "closes *stdin*;" msgstr "" #: ../../library/asyncio-subprocess.rst:211 +msgid "read data from *stdout* and *stderr*, until EOF is reached;" +msgstr "" + +#: ../../library/asyncio-subprocess.rst:212 msgid "wait for process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:213 +#: ../../library/asyncio-subprocess.rst:214 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:216 +#: ../../library/asyncio-subprocess.rst:217 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "" -#: ../../library/asyncio-subprocess.rst:218 +#: ../../library/asyncio-subprocess.rst:219 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -269,7 +273,7 @@ msgid "" "*stdin*." msgstr "" -#: ../../library/asyncio-subprocess.rst:223 +#: ../../library/asyncio-subprocess.rst:224 msgid "" "If it is desired to send data to the process' *stdin*, the process needs to " "be created with ``stdin=PIPE``. Similarly, to get anything other than " @@ -277,71 +281,75 @@ msgid "" "``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" -#: ../../library/asyncio-subprocess.rst:229 +#: ../../library/asyncio-subprocess.rst:230 msgid "" "Note, that the data read is buffered in memory, so do not use this method if " "the data size is large or unlimited." msgstr "" -#: ../../library/asyncio-subprocess.rst:234 +#: ../../library/asyncio-subprocess.rst:235 +msgid "*stdin* gets closed when `input=None` too." +msgstr "" + +#: ../../library/asyncio-subprocess.rst:239 msgid "Sends the signal *signal* to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:238 +#: ../../library/asyncio-subprocess.rst:243 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:245 +#: ../../library/asyncio-subprocess.rst:250 msgid "Stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:247 +#: ../../library/asyncio-subprocess.rst:252 msgid "" "On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:250 +#: ../../library/asyncio-subprocess.rst:255 msgid "" "On Windows the Win32 API function :c:func:`TerminateProcess` is called to " "stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:255 +#: ../../library/asyncio-subprocess.rst:260 msgid "Kill the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:257 +#: ../../library/asyncio-subprocess.rst:262 msgid "" "On POSIX systems this method sends :py:data:`SIGKILL` to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:260 +#: ../../library/asyncio-subprocess.rst:265 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "" -#: ../../library/asyncio-subprocess.rst:264 +#: ../../library/asyncio-subprocess.rst:269 msgid "" "Standard input stream (:class:`StreamWriter`) or ``None`` if the process was " "created with ``stdin=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:269 +#: ../../library/asyncio-subprocess.rst:274 msgid "" "Standard output stream (:class:`StreamReader`) or ``None`` if the process " "was created with ``stdout=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:274 +#: ../../library/asyncio-subprocess.rst:279 msgid "" "Standard error stream (:class:`StreamReader`) or ``None`` if the process was " "created with ``stderr=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:279 +#: ../../library/asyncio-subprocess.rst:284 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " @@ -349,93 +357,93 @@ msgid "" "pausing reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:288 +#: ../../library/asyncio-subprocess.rst:293 msgid "Process identification number (PID)." msgstr "" -#: ../../library/asyncio-subprocess.rst:290 +#: ../../library/asyncio-subprocess.rst:295 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:295 +#: ../../library/asyncio-subprocess.rst:300 msgid "Return code of the process when it exits." msgstr "" -#: ../../library/asyncio-subprocess.rst:297 +#: ../../library/asyncio-subprocess.rst:302 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" -#: ../../library/asyncio-subprocess.rst:299 +#: ../../library/asyncio-subprocess.rst:304 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/asyncio-subprocess.rst:306 +#: ../../library/asyncio-subprocess.rst:311 msgid "Subprocess and Threads" msgstr "子行程與線程" -#: ../../library/asyncio-subprocess.rst:308 +#: ../../library/asyncio-subprocess.rst:313 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." msgstr "" -#: ../../library/asyncio-subprocess.rst:311 +#: ../../library/asyncio-subprocess.rst:316 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" -#: ../../library/asyncio-subprocess.rst:314 +#: ../../library/asyncio-subprocess.rst:319 msgid "" "On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" "`asyncio-watchers` for more info." msgstr "" -#: ../../library/asyncio-subprocess.rst:320 +#: ../../library/asyncio-subprocess.rst:325 msgid "" "UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " "from different threads without any limitation." msgstr "" -#: ../../library/asyncio-subprocess.rst:323 +#: ../../library/asyncio-subprocess.rst:328 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-subprocess.rst:326 +#: ../../library/asyncio-subprocess.rst:331 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." msgstr "" -#: ../../library/asyncio-subprocess.rst:331 +#: ../../library/asyncio-subprocess.rst:336 msgid "" "The :ref:`Concurrency and multithreading in asyncio ` section." msgstr "" -#: ../../library/asyncio-subprocess.rst:336 +#: ../../library/asyncio-subprocess.rst:341 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-subprocess.rst:338 +#: ../../library/asyncio-subprocess.rst:343 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:344 +#: ../../library/asyncio-subprocess.rst:349 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "" -#: ../../library/asyncio-subprocess.rst:371 +#: ../../library/asyncio-subprocess.rst:376 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 f94c61e4ca..b02d2a4542 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-28 07:22+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -228,11 +228,12 @@ msgstr "" #: ../../library/asyncio-task.rst:259 msgid "" -":meth:`asyncio.TaskGroup.create_task` is a newer alternative that allows for " -"convenient waiting for a group of related tasks." +":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging " +"structural concurrency; it allows for waiting for a group of related tasks " +"with strong safety guarantees." msgstr "" -#: ../../library/asyncio-task.rst:264 +#: ../../library/asyncio-task.rst:265 msgid "" "Save a reference to the result of this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -241,25 +242,25 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1013 +#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1076 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:289 ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1083 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" -#: ../../library/asyncio-task.rst:294 +#: ../../library/asyncio-task.rst:295 msgid "Task Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:296 +#: ../../library/asyncio-task.rst:297 msgid "" "Tasks can easily and safely be cancelled. When a task is cancelled, :exc:" "`asyncio.CancelledError` will be raised in the task at the next opportunity." msgstr "" -#: ../../library/asyncio-task.rst:300 +#: ../../library/asyncio-task.rst:301 msgid "" "It is recommended that coroutines use ``try/finally`` blocks to robustly " "perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " @@ -268,7 +269,7 @@ msgid "" "code will not need to be aware of it." msgstr "" -#: ../../library/asyncio-task.rst:306 +#: ../../library/asyncio-task.rst:307 msgid "" "The asyncio components that enable structured concurrency, like :class:" "`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " @@ -279,40 +280,40 @@ msgid "" "``uncancel()`` to completely remove the cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:318 +#: ../../library/asyncio-task.rst:319 msgid "Task Groups" msgstr "" -#: ../../library/asyncio-task.rst:320 +#: ../../library/asyncio-task.rst:321 msgid "" "Task groups combine a task creation API with a convenient and reliable way " "to wait for all tasks in the group to finish." msgstr "" -#: ../../library/asyncio-task.rst:325 +#: ../../library/asyncio-task.rst:326 msgid "" "An :ref:`asynchronous context manager ` holding a " "group of tasks. Tasks can be added to the group using :meth:`create_task`. " "All tasks are awaited when the context manager exits." msgstr "" -#: ../../library/asyncio-task.rst:334 +#: ../../library/asyncio-task.rst:335 msgid "" "Create a task in this task group. The signature matches that of :func:" "`asyncio.create_task`." msgstr "" -#: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 -#: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:653 -#: ../../library/asyncio-task.rst:679 ../../library/asyncio-task.rst:722 -#: ../../library/asyncio-task.rst:816 +#: ../../library/asyncio-task.rst:338 ../../library/asyncio-task.rst:472 +#: ../../library/asyncio-task.rst:645 ../../library/asyncio-task.rst:703 +#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:772 +#: ../../library/asyncio-task.rst:869 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-task.rst:345 +#: ../../library/asyncio-task.rst:346 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -321,7 +322,7 @@ msgid "" "block is exited, no new tasks may be added to the group." msgstr "" -#: ../../library/asyncio-task.rst:352 +#: ../../library/asyncio-task.rst:353 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -333,7 +334,7 @@ msgid "" "bubble out of the containing ``async with`` statement." msgstr "" -#: ../../library/asyncio-task.rst:362 +#: ../../library/asyncio-task.rst:363 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " @@ -341,7 +342,7 @@ msgid "" "their documentation) which is then raised." msgstr "" -#: ../../library/asyncio-task.rst:369 +#: ../../library/asyncio-task.rst:370 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -350,7 +351,7 @@ msgid "" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/asyncio-task.rst:375 +#: ../../library/asyncio-task.rst:376 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -362,68 +363,68 @@ msgid "" "`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." msgstr "" -#: ../../library/asyncio-task.rst:389 +#: ../../library/asyncio-task.rst:390 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:393 +#: ../../library/asyncio-task.rst:394 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:395 +#: ../../library/asyncio-task.rst:396 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:398 +#: ../../library/asyncio-task.rst:399 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:401 +#: ../../library/asyncio-task.rst:402 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:407 +#: ../../library/asyncio-task.rst:408 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 -#: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:717 -#: ../../library/asyncio-task.rst:747 ../../library/asyncio-task.rst:799 -#: ../../library/asyncio-task.rst:822 +#: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 +#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:767 +#: ../../library/asyncio-task.rst:797 ../../library/asyncio-task.rst:849 +#: ../../library/asyncio-task.rst:875 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:430 +#: ../../library/asyncio-task.rst:431 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:434 +#: ../../library/asyncio-task.rst:435 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:437 +#: ../../library/asyncio-task.rst:438 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:440 +#: ../../library/asyncio-task.rst:441 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:444 +#: ../../library/asyncio-task.rst:445 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -431,19 +432,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:449 +#: ../../library/asyncio-task.rst:450 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:452 +#: ../../library/asyncio-task.rst:453 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:455 +#: ../../library/asyncio-task.rst:456 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** " @@ -451,13 +452,17 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:462 +#: ../../library/asyncio-task.rst:463 msgid "" -"A more modern way to create and run tasks concurrently and wait for their " -"completion is :class:`asyncio.TaskGroup`." +"A new alternative to create and run tasks concurrently and wait for their " +"completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " +"safety guarantees than *gather* for scheduling a nesting of subtasks: if a " +"task (or a subtask, a task scheduled by a task) raises an exception, " +"*TaskGroup* will, while *gather* will not, cancel the remaining scheduled " +"tasks)." msgstr "" -#: ../../library/asyncio-task.rst:505 +#: ../../library/asyncio-task.rst:510 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -466,42 +471,96 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:512 +#: ../../library/asyncio-task.rst:517 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:519 +#: ../../library/asyncio-task.rst:524 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:526 +#: ../../library/asyncio-task.rst:533 +msgid "Eager Task Factory" +msgstr "" + +#: ../../library/asyncio-task.rst:537 +msgid "A task factory for eager task execution." +msgstr "" + +#: ../../library/asyncio-task.rst:539 +msgid "" +"When using this factory (via :meth:`loop.set_task_factory(asyncio." +"eager_task_factory) `), coroutines begin execution " +"synchronously during :class:`Task` construction. Tasks are only scheduled on " +"the event loop if they block. This can be a performance improvement as the " +"overhead of loop scheduling is avoided for coroutines that complete " +"synchronously." +msgstr "" + +#: ../../library/asyncio-task.rst:545 +msgid "" +"A common example where this is beneficial is coroutines which employ caching " +"or memoization to avoid actual I/O when possible." +msgstr "" + +#: ../../library/asyncio-task.rst:550 +msgid "" +"Immediate execution of the coroutine is a semantic change. If the coroutine " +"returns or raises, the task is never scheduled to the event loop. If the " +"coroutine execution blocks, the task is scheduled to the event loop. This " +"change may introduce behavior changes to existing applications. For example, " +"the application's task execution order is likely to change." +msgstr "" + +#: ../../library/asyncio-task.rst:561 +msgid "" +"Create an eager task factory, similar to :func:`eager_task_factory`, using " +"the provided *custom_task_constructor* when creating a new task instead of " +"the default :class:`Task`." +msgstr "" + +#: ../../library/asyncio-task.rst:565 +msgid "" +"*custom_task_constructor* must be a *callable* with the signature matching " +"the signature of :class:`Task.__init__ `. The callable must return a :" +"class:`asyncio.Task`-compatible object." +msgstr "" + +#: ../../library/asyncio-task.rst:569 +msgid "" +"This function returns a *callable* intended to be used as a task factory of " +"an event loop via :meth:`loop.set_task_factory(factory) `)." +msgstr "" + +#: ../../library/asyncio-task.rst:576 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:530 +#: ../../library/asyncio-task.rst:580 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:533 ../../library/asyncio-task.rst:699 +#: ../../library/asyncio-task.rst:583 ../../library/asyncio-task.rst:749 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:535 +#: ../../library/asyncio-task.rst:585 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:540 +#: ../../library/asyncio-task.rst:590 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:544 +#: ../../library/asyncio-task.rst:594 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -510,20 +569,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:550 +#: ../../library/asyncio-task.rst:600 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:553 +#: ../../library/asyncio-task.rst:603 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:565 +#: ../../library/asyncio-task.rst:615 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -531,36 +590,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:573 +#: ../../library/asyncio-task.rst:623 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:579 +#: ../../library/asyncio-task.rst:629 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:583 +#: ../../library/asyncio-task.rst:633 msgid "" "An :ref:`asynchronous context manager ` that can be " "used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:587 +#: ../../library/asyncio-task.rst:637 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" -#: ../../library/asyncio-task.rst:592 +#: ../../library/asyncio-task.rst:642 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:601 +#: ../../library/asyncio-task.rst:651 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." @@ -568,228 +627,230 @@ msgid "" "can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:608 +#: ../../library/asyncio-task.rst:658 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" "`TimeoutError` can only be caught *outside* of the context manager." msgstr "" -#: ../../library/asyncio-task.rst:613 +#: ../../library/asyncio-task.rst:663 msgid "Example of catching :exc:`TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:624 +#: ../../library/asyncio-task.rst:674 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:629 +#: ../../library/asyncio-task.rst:679 msgid "" "An :ref:`asynchronous context manager ` for " "cancelling overdue coroutines." msgstr "" -#: ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:682 msgid "" "``when`` should be an absolute time at which the context should time out, as " "measured by the event loop's clock:" msgstr "" -#: ../../library/asyncio-task.rst:635 +#: ../../library/asyncio-task.rst:685 msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: ../../library/asyncio-task.rst:636 +#: ../../library/asyncio-task.rst:686 msgid "" "If ``when < loop.time()``, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: ../../library/asyncio-task.rst:641 +#: ../../library/asyncio-task.rst:691 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:646 +#: ../../library/asyncio-task.rst:696 msgid "Reschedule the timeout." msgstr "" -#: ../../library/asyncio-task.rst:650 +#: ../../library/asyncio-task.rst:700 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:670 +#: ../../library/asyncio-task.rst:720 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:676 +#: ../../library/asyncio-task.rst:726 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:696 +#: ../../library/asyncio-task.rst:746 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:751 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:705 +#: ../../library/asyncio-task.rst:755 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:708 +#: ../../library/asyncio-task.rst:758 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:711 +#: ../../library/asyncio-task.rst:761 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:715 +#: ../../library/asyncio-task.rst:765 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:742 +#: ../../library/asyncio-task.rst:792 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:752 +#: ../../library/asyncio-task.rst:802 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:756 +#: ../../library/asyncio-task.rst:806 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: ../../library/asyncio-task.rst:760 -msgid "" -"The *aws* iterable must not be empty and generators yielding tasks are not " -"accepted." +#: ../../library/asyncio-task.rst:810 +msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:812 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:814 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:768 +#: ../../library/asyncio-task.rst:818 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:771 +#: ../../library/asyncio-task.rst:821 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: ../../library/asyncio-task.rst:775 +#: ../../library/asyncio-task.rst:825 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:781 +#: ../../library/asyncio-task.rst:831 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:781 +#: ../../library/asyncio-task.rst:831 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:833 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:833 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:786 +#: ../../library/asyncio-task.rst:836 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:786 +#: ../../library/asyncio-task.rst:836 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:792 +#: ../../library/asyncio-task.rst:842 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:842 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:796 +#: ../../library/asyncio-task.rst:846 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:802 +#: ../../library/asyncio-task.rst:852 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:807 +#: ../../library/asyncio-task.rst:855 ../../library/asyncio-task.rst:882 +msgid "Added support for generators yielding tasks." +msgstr "" + +#: ../../library/asyncio-task.rst:861 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " -"concurrently. Generators yielding tasks are not accepted as *aws* iterable. " -"Return an iterator of coroutines. Each coroutine returned can be awaited to " -"get the earliest next result from the iterable of the remaining awaitables." +"concurrently. Return an iterator of coroutines. Each coroutine returned can " +"be awaited to get the earliest next result from the iterable of the " +"remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:813 +#: ../../library/asyncio-task.rst:866 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:825 +#: ../../library/asyncio-task.rst:878 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:831 +#: ../../library/asyncio-task.rst:887 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:835 +#: ../../library/asyncio-task.rst:891 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:837 +#: ../../library/asyncio-task.rst:893 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -797,19 +858,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:842 +#: ../../library/asyncio-task.rst:898 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:844 +#: ../../library/asyncio-task.rst:900 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 run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:874 +#: ../../library/asyncio-task.rst:930 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. " @@ -817,7 +878,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:881 +#: ../../library/asyncio-task.rst:937 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 " @@ -825,85 +886,85 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:890 +#: ../../library/asyncio-task.rst:946 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:894 +#: ../../library/asyncio-task.rst:950 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:896 +#: ../../library/asyncio-task.rst:952 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:899 +#: ../../library/asyncio-task.rst:955 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:911 +#: ../../library/asyncio-task.rst:967 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:925 +#: ../../library/asyncio-task.rst:981 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:928 +#: ../../library/asyncio-task.rst:984 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:935 +#: ../../library/asyncio-task.rst:991 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:940 +#: ../../library/asyncio-task.rst:996 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:943 +#: ../../library/asyncio-task.rst:999 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:951 +#: ../../library/asyncio-task.rst:1007 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:954 +#: ../../library/asyncio-task.rst:1010 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:962 +#: ../../library/asyncio-task.rst:1018 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:968 +#: ../../library/asyncio-task.rst:1024 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:972 +#: ../../library/asyncio-task.rst:1028 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:1031 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 " @@ -911,21 +972,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:981 +#: ../../library/asyncio-task.rst:1037 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:986 +#: ../../library/asyncio-task.rst:1042 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:991 +#: ../../library/asyncio-task.rst:1047 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 " @@ -933,20 +994,20 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:996 +#: ../../library/asyncio-task.rst:1052 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:1001 +#: ../../library/asyncio-task.rst:1057 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:1005 +#: ../../library/asyncio-task.rst:1061 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " @@ -954,92 +1015,107 @@ msgid "" "in the copied context." msgstr "" -#: ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:1066 +msgid "" +"An optional keyword-only *eager_start* argument allows eagerly starting the " +"execution of the :class:`asyncio.Task` at task creation time. If set to " +"``True`` and the event loop is running, the task will start executing the " +"coroutine immediately, until the first time the coroutine blocks. If the " +"coroutine returns or raises without blocking, the task will be finished " +"eagerly and will skip scheduling to the event loop." +msgstr "" + +#: ../../library/asyncio-task.rst:1073 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1016 +#: ../../library/asyncio-task.rst:1079 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1025 +#: ../../library/asyncio-task.rst:1086 +#, fuzzy +msgid "Added the *eager_start* parameter." +msgstr "新增 *name* 參數。" + +#: ../../library/asyncio-task.rst:1091 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:1093 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:1032 +#: ../../library/asyncio-task.rst:1098 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1034 +#: ../../library/asyncio-task.rst:1100 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:1038 ../../library/asyncio-task.rst:1052 +#: ../../library/asyncio-task.rst:1104 ../../library/asyncio-task.rst:1118 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1041 +#: ../../library/asyncio-task.rst:1107 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1046 +#: ../../library/asyncio-task.rst:1112 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1048 +#: ../../library/asyncio-task.rst:1114 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:1055 +#: ../../library/asyncio-task.rst:1121 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1060 +#: ../../library/asyncio-task.rst:1126 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1062 ../../library/asyncio-task.rst:1071 +#: ../../library/asyncio-task.rst:1128 ../../library/asyncio-task.rst:1137 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1064 +#: ../../library/asyncio-task.rst:1130 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1069 +#: ../../library/asyncio-task.rst:1135 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1139 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1078 +#: ../../library/asyncio-task.rst:1144 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1080 +#: ../../library/asyncio-task.rst:1146 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, " @@ -1047,15 +1123,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1086 +#: ../../library/asyncio-task.rst:1152 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1088 +#: ../../library/asyncio-task.rst:1154 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1090 +#: ../../library/asyncio-task.rst:1156 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 " @@ -1064,66 +1140,81 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1099 +#: ../../library/asyncio-task.rst:1165 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1101 +#: ../../library/asyncio-task.rst:1167 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1104 +#: ../../library/asyncio-task.rst:1170 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1106 +#: ../../library/asyncio-task.rst:1172 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1111 +#: ../../library/asyncio-task.rst:1177 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1181 +msgid "" +"This will return ``None`` for Tasks which have already completed eagerly. " +"See the :ref:`Eager Task Factory `." +msgstr "" + +#: ../../library/asyncio-task.rst:1188 +msgid "Newly added eager task execution means result may be ``None``." +msgstr "" + +#: ../../library/asyncio-task.rst:1192 +msgid "" +"Return the :class:`contextvars.Context` object associated with the task." +msgstr "" + +#: ../../library/asyncio-task.rst:1199 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1119 +#: ../../library/asyncio-task.rst:1201 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:1127 +#: ../../library/asyncio-task.rst:1209 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1129 +#: ../../library/asyncio-task.rst:1211 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1132 +#: ../../library/asyncio-task.rst:1214 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:1139 +#: ../../library/asyncio-task.rst:1221 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1141 +#: ../../library/asyncio-task.rst:1223 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:1144 +#: ../../library/asyncio-task.rst:1226 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1135,46 +1226,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1154 +#: ../../library/asyncio-task.rst:1236 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1157 +#: ../../library/asyncio-task.rst:1239 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1162 +#: ../../library/asyncio-task.rst:1244 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1283 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1203 +#: ../../library/asyncio-task.rst:1285 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:1209 +#: ../../library/asyncio-task.rst:1291 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1211 +#: ../../library/asyncio-task.rst:1293 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1213 +#: ../../library/asyncio-task.rst:1295 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1218 +#: ../../library/asyncio-task.rst:1300 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1183,7 +1274,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1318 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1192,20 +1283,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1242 +#: ../../library/asyncio-task.rst:1324 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1248 +#: ../../library/asyncio-task.rst:1330 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1252 +#: ../../library/asyncio-task.rst:1334 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1214,7 +1305,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1258 +#: ../../library/asyncio-task.rst:1340 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/atexit.po b/library/atexit.po index b2cc180f45..c51b28b1b6 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-16 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-01-31 07:13+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,7 +82,21 @@ msgid "" "decorator." msgstr "" -#: ../../library/atexit.rst:54 +#: ../../library/atexit.rst:52 +msgid "" +"Starting new threads or calling :func:`os.fork` from a registered function " +"can lead to race condition between the main Python runtime thread freeing " +"thread states while internal :mod:`threading` routines or the new process " +"try to use that state. This can lead to crashes rather than clean shutdown." +msgstr "" + +#: ../../library/atexit.rst:58 +msgid "" +"Attempts to start a new thread or :func:`os.fork` a new process in a " +"registered function now leads to :exc:`RuntimeError`." +msgstr "" + +#: ../../library/atexit.rst:64 msgid "" "Remove *func* from the list of functions to be run at interpreter shutdown. :" "func:`unregister` silently does nothing if *func* was not previously " @@ -92,21 +106,21 @@ msgid "" "references do not need to have matching identities." msgstr "" -#: ../../library/atexit.rst:65 +#: ../../library/atexit.rst:75 msgid "Module :mod:`readline`" msgstr ":mod:`readline` 模組" -#: ../../library/atexit.rst:65 +#: ../../library/atexit.rst:75 msgid "" "Useful example of :mod:`atexit` to read and write :mod:`readline` history " "files." msgstr "" -#: ../../library/atexit.rst:72 +#: ../../library/atexit.rst:82 msgid ":mod:`atexit` Example" msgstr ":mod:`atexit` 範例" -#: ../../library/atexit.rst:74 +#: ../../library/atexit.rst:84 msgid "" "The following simple example demonstrates how a module can initialize a " "counter from a file when it is imported and save the counter's updated value " @@ -114,16 +128,16 @@ msgid "" "making an explicit call into this module at termination. ::" msgstr "" -#: ../../library/atexit.rst:97 +#: ../../library/atexit.rst:107 msgid "" "Positional and keyword arguments may also be passed to :func:`register` to " "be passed along to the registered function when it is called::" msgstr "" -#: ../../library/atexit.rst:109 +#: ../../library/atexit.rst:119 msgid "Usage as a :term:`decorator`::" msgstr "" -#: ../../library/atexit.rst:117 +#: ../../library/atexit.rst:127 msgid "This only works with functions that can be called without arguments." msgstr "" diff --git a/library/bisect.po b/library/bisect.po index 2f30b9cb24..fc08789062 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-22 15:12+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,14 +32,12 @@ msgid "**Source code:** :source:`Lib/bisect.py`" msgstr "**原始碼:**\\ :source:`Lib/bisect.py`" #: ../../library/bisect.rst:14 +#, fuzzy msgid "" "This module provides support for maintaining a list in sorted order without " "having to sort the list after each insertion. For long lists of items with " -"expensive comparison operations, this can be an improvement over the more " -"common approach. The module is called :mod:`bisect` because it uses a basic " -"bisection algorithm to do its work. The source code may be most useful as a " -"working example of the algorithm (the boundary conditions are already " -"right!)." +"expensive comparison operations, this can be an improvement over linear " +"searches or frequent resorting." msgstr "" "這個模組維護一個已經排序過的 list ,當我們每次做完插入後不需要再次排序整個 " "list 。一個很長的 list 的比較操作很花費時間,為了改進這點,這個模組是其中一個" @@ -47,11 +45,22 @@ msgstr "" "算法實作。模組的原始碼是這個演算法的一個完善的實作(邊界條件已經是正確的" "了)。" -#: ../../library/bisect.rst:23 +#: ../../library/bisect.rst:19 +msgid "" +"The module is called :mod:`bisect` because it uses a basic bisection " +"algorithm to do its work. Unlike other bisection tools that search for a " +"specific value, the functions in this module are designed to locate an " +"insertion point. Accordingly, the functions never call an :meth:`__eq__` " +"method to determine whether a value has been found. Instead, the functions " +"only call the :meth:`__lt__` method and will return an insertion point " +"between values in an array." +msgstr "" + +#: ../../library/bisect.rst:29 msgid "The following functions are provided:" msgstr "此模組提供下面的函式:" -#: ../../library/bisect.rst:28 +#: ../../library/bisect.rst:34 msgid "" "Locate the insertion point for *x* in *a* to maintain sorted order. The " "parameters *lo* and *hi* may be used to specify a subset of the list which " @@ -65,16 +74,18 @@ msgstr "" "有 *x* 出現,插入的位置會在所有 *x* 的前面(左邊)。回傳值可以被當作 ``list." "insert()`` 的第一個參數,但列表 *a* 必須先排序過。" -#: ../../library/bisect.rst:35 +#: ../../library/bisect.rst:41 +#, fuzzy 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." +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " +"slice." msgstr "" "回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val < x for val in a[lo : " "i])`` 都在左側且 ``all(val >= x for val in a[i : hi])`` 都在右側。" -#: ../../library/bisect.rst:39 ../../library/bisect.rst:60 +#: ../../library/bisect.rst:46 msgid "" "*key* specifies a :term:`key function` of one argument that is used to " "extract a comparison key from each element in the array. To support " @@ -84,18 +95,19 @@ msgstr "" "所有元素以得到比較值來計算順位。注意此 function 只會套用在陣列中的元素,不會" "套用在 *x*。" -#: ../../library/bisect.rst:43 ../../library/bisect.rst:64 +#: ../../library/bisect.rst:50 +#, fuzzy msgid "" -"If *key* is ``None``, the elements are compared directly with no intervening " -"function call." +"If *key* is ``None``, the elements are compared directly and no key function " +"is called." msgstr "若 *key* 為 ``None``,則排序順位將直接以陣列中元素值決定。" -#: ../../library/bisect.rst:46 ../../library/bisect.rst:67 +#: ../../library/bisect.rst:53 ../../library/bisect.rst:67 #: ../../library/bisect.rst:85 ../../library/bisect.rst:105 msgid "Added the *key* parameter." msgstr "新增 *key* 參數。" -#: ../../library/bisect.rst:53 +#: ../../library/bisect.rst:60 msgid "" "Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point " "which comes after (to the right of) any existing entries of *x* in *a*." @@ -103,11 +115,13 @@ msgstr "" "類似 :py:func:`~bisect.bisect_left`,但回傳的插入位置會在所有 *a* 當中的 *x* " "的後面(右邊)。" -#: ../../library/bisect.rst:56 +#: ../../library/bisect.rst:63 +#, fuzzy 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." +"The returned insertion point *ip* partitions the array *a* into two slices " +"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " +"slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " +"slice." msgstr "" "回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val <= x for val in " "a[lo : i])`` 都在左側且 ``all(val > x for val in a[i : hi])`` 都在右側。" diff --git a/library/calendar.po b/library/calendar.po index 83f49e3f56..a47b51dade 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,30 +50,40 @@ msgstr "" #: ../../library/calendar.rst:33 msgid "" +"Enumeration defining the days of the week as integer constants, from 0 to 6." +msgstr "" + +#: ../../library/calendar.rst:54 +msgid "" +"Enumeration defining months of the year as integer constants, from 1 to 12." +msgstr "" + +#: ../../library/calendar.rst:85 +msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." msgstr "" -#: ../../library/calendar.rst:36 +#: ../../library/calendar.rst:88 msgid "" "A :class:`Calendar` object provides several methods that can be used for " "preparing the calendar data for formatting. This class doesn't do any " "formatting itself. This is the job of subclasses." msgstr "" -#: ../../library/calendar.rst:41 +#: ../../library/calendar.rst:93 msgid ":class:`Calendar` instances have the following methods:" msgstr "" -#: ../../library/calendar.rst:45 +#: ../../library/calendar.rst:97 msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" "`firstweekday` property." msgstr "" -#: ../../library/calendar.rst:52 +#: ../../library/calendar.rst:104 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -81,7 +91,7 @@ msgid "" "month that are required to get a complete week." msgstr "" -#: ../../library/calendar.rst:60 +#: ../../library/calendar.rst:112 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -89,7 +99,7 @@ msgid "" "of the specified month, the day number is ``0``." msgstr "" -#: ../../library/calendar.rst:68 +#: ../../library/calendar.rst:120 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -97,7 +107,7 @@ msgid "" "week day number." msgstr "" -#: ../../library/calendar.rst:76 +#: ../../library/calendar.rst:128 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -105,7 +115,7 @@ msgid "" "month numbers." msgstr "" -#: ../../library/calendar.rst:86 +#: ../../library/calendar.rst:138 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -113,25 +123,25 @@ msgid "" "month, and a day of the week numbers." msgstr "" -#: ../../library/calendar.rst:96 +#: ../../library/calendar.rst:148 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." msgstr "" -#: ../../library/calendar.rst:102 +#: ../../library/calendar.rst:154 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." msgstr "" -#: ../../library/calendar.rst:109 +#: ../../library/calendar.rst:161 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." msgstr "" -#: ../../library/calendar.rst:115 +#: ../../library/calendar.rst:167 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -139,29 +149,29 @@ msgid "" "contains 1--7 days. Days are :class:`datetime.date` objects." msgstr "" -#: ../../library/calendar.rst:123 +#: ../../library/calendar.rst:175 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " "numbers and weekday numbers. Day numbers outside this month are zero." msgstr "" -#: ../../library/calendar.rst:130 +#: ../../library/calendar.rst:182 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " "numbers outside this month are zero." msgstr "" -#: ../../library/calendar.rst:137 +#: ../../library/calendar.rst:189 msgid "This class can be used to generate plain text calendars." msgstr "" -#: ../../library/calendar.rst:139 +#: ../../library/calendar.rst:191 msgid ":class:`TextCalendar` instances have the following methods:" msgstr "" -#: ../../library/calendar.rst:143 +#: ../../library/calendar.rst:195 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -170,11 +180,11 @@ msgid "" "`setfirstweekday` method." msgstr "" -#: ../../library/calendar.rst:152 +#: ../../library/calendar.rst:204 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "" -#: ../../library/calendar.rst:157 +#: ../../library/calendar.rst:209 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -184,32 +194,32 @@ msgid "" "generated is platform-dependent." msgstr "" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:219 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "" -#: ../../library/calendar.rst:172 +#: ../../library/calendar.rst:224 msgid "This class can be used to generate HTML calendars." msgstr "" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:227 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr "" -#: ../../library/calendar.rst:179 +#: ../../library/calendar.rst:231 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." msgstr "" -#: ../../library/calendar.rst:186 +#: ../../library/calendar.rst:238 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" -#: ../../library/calendar.rst:192 +#: ../../library/calendar.rst:244 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -218,86 +228,86 @@ msgid "" "(defaulting to the system default encoding)." msgstr "" -#: ../../library/calendar.rst:199 +#: ../../library/calendar.rst:251 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr "" -#: ../../library/calendar.rst:204 +#: ../../library/calendar.rst:256 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "" -#: ../../library/calendar.rst:208 +#: ../../library/calendar.rst:260 msgid "more styles can be added for each day::" msgstr "" -#: ../../library/calendar.rst:212 +#: ../../library/calendar.rst:264 msgid "Note that the length of this list must be seven items." msgstr "" -#: ../../library/calendar.rst:217 +#: ../../library/calendar.rst:269 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:276 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." msgstr "" -#: ../../library/calendar.rst:232 +#: ../../library/calendar.rst:284 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." msgstr "" -#: ../../library/calendar.rst:240 +#: ../../library/calendar.rst:292 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." msgstr "" -#: ../../library/calendar.rst:248 +#: ../../library/calendar.rst:300 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -#: ../../library/calendar.rst:256 +#: ../../library/calendar.rst:308 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -#: ../../library/calendar.rst:262 +#: ../../library/calendar.rst:314 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " "single CSS class with a space separated list of CSS classes, for example::" msgstr "" -#: ../../library/calendar.rst:268 +#: ../../library/calendar.rst:320 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "" "以下是客製化 :class:`!HTMLCalendar` 的範例:\n" "\n" "::" -#: ../../library/calendar.rst:280 +#: ../../library/calendar.rst:332 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" -#: ../../library/calendar.rst:286 +#: ../../library/calendar.rst:338 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" -#: ../../library/calendar.rst:292 +#: ../../library/calendar.rst:344 msgid "" "The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -305,11 +315,11 @@ msgid "" "thread-safe." msgstr "" -#: ../../library/calendar.rst:298 +#: ../../library/calendar.rst:350 msgid "For simple text calendars this module provides the following functions." msgstr "" -#: ../../library/calendar.rst:302 +#: ../../library/calendar.rst:354 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -317,72 +327,72 @@ msgid "" "provided for convenience. For example, to set the first weekday to Sunday::" msgstr "" -#: ../../library/calendar.rst:313 +#: ../../library/calendar.rst:365 msgid "Returns the current setting for the weekday to start each week." msgstr "" -#: ../../library/calendar.rst:318 +#: ../../library/calendar.rst:370 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "" -#: ../../library/calendar.rst:323 +#: ../../library/calendar.rst:375 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "" -#: ../../library/calendar.rst:326 +#: ../../library/calendar.rst:378 msgid "This function works for ranges spanning a century change." msgstr "" -#: ../../library/calendar.rst:331 +#: ../../library/calendar.rst:383 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." msgstr "" -#: ../../library/calendar.rst:337 +#: ../../library/calendar.rst:389 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "" -#: ../../library/calendar.rst:343 +#: ../../library/calendar.rst:395 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "" -#: ../../library/calendar.rst:349 +#: ../../library/calendar.rst:401 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" -#: ../../library/calendar.rst:356 +#: ../../library/calendar.rst:408 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "" -#: ../../library/calendar.rst:361 +#: ../../library/calendar.rst:413 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`formatmonth` of the :class:`TextCalendar` class." msgstr "" -#: ../../library/calendar.rst:367 +#: ../../library/calendar.rst:419 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "" -#: ../../library/calendar.rst:372 +#: ../../library/calendar.rst:424 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`formatyear` of the :class:`TextCalendar` class." msgstr "" -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:430 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -391,53 +401,53 @@ msgid "" "inverse." msgstr "" -#: ../../library/calendar.rst:385 +#: ../../library/calendar.rst:437 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr "" -#: ../../library/calendar.rst:389 +#: ../../library/calendar.rst:441 msgid "An array that represents the days of the week in the current locale." msgstr "" -#: ../../library/calendar.rst:394 +#: ../../library/calendar.rst:446 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." msgstr "" -#: ../../library/calendar.rst:399 +#: ../../library/calendar.rst:451 msgid "" "An array that represents the months of the year in the current locale. This " "follows normal convention of January being month number 1, so it has a " "length of 13 and ``month_name[0]`` is the empty string." msgstr "" -#: ../../library/calendar.rst:406 +#: ../../library/calendar.rst:458 msgid "" "An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " "it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" -#: ../../library/calendar.rst:418 +#: ../../library/calendar.rst:470 msgid "" "Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." msgstr "" -#: ../../library/calendar.rst:424 +#: ../../library/calendar.rst:476 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:423 +#: ../../library/calendar.rst:475 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "" -#: ../../library/calendar.rst:426 +#: ../../library/calendar.rst:478 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:427 +#: ../../library/calendar.rst:479 msgid "Low-level time related functions." msgstr "" diff --git a/library/collections.abc.po b/library/collections.abc.po index 2912b7540a..e8431a84dd 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -406,11 +406,21 @@ msgstr "``asend``\\ 、\\ ``athrow``" msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``\\ 、\\ ``__aiter__``\\ 、\\ ``__anext__``" -#: ../../library/collections.abc.rst:184 +#: ../../library/collections.abc.rst:180 +#, fuzzy +msgid ":class:`Buffer` [1]_" +msgstr ":class:`Iterator` [1]_" + +#: ../../library/collections.abc.rst:180 +#, fuzzy +msgid "``__buffer__``" +msgstr "``__iter__``" + +#: ../../library/collections.abc.rst:185 msgid "Footnotes" msgstr "註解" -#: ../../library/collections.abc.rst:185 +#: ../../library/collections.abc.rst:186 msgid "" "These ABCs override :meth:`object.__subclasshook__` to support testing an " "interface by verifying the required methods are present and have not been " @@ -418,7 +428,7 @@ msgid "" "interfaces require registration or direct subclassing." msgstr "" -#: ../../library/collections.abc.rst:191 +#: ../../library/collections.abc.rst:192 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " @@ -427,31 +437,31 @@ msgid "" "call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:199 +#: ../../library/collections.abc.rst:200 msgid "Collections Abstract Base Classes -- Detailed Descriptions" msgstr "" -#: ../../library/collections.abc.rst:204 +#: ../../library/collections.abc.rst:205 msgid "ABC for classes that provide the :meth:`__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:208 +#: ../../library/collections.abc.rst:209 msgid "ABC for classes that provide the :meth:`__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:212 +#: ../../library/collections.abc.rst:213 msgid "ABC for classes that provide the :meth:`__len__` method." msgstr "" -#: ../../library/collections.abc.rst:216 +#: ../../library/collections.abc.rst:217 msgid "ABC for classes that provide the :meth:`__call__` method." msgstr "" -#: ../../library/collections.abc.rst:220 +#: ../../library/collections.abc.rst:221 msgid "ABC for classes that provide the :meth:`__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:222 +#: ../../library/collections.abc.rst:223 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " @@ -460,22 +470,22 @@ msgid "" "call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:230 +#: ../../library/collections.abc.rst:231 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:236 +#: ../../library/collections.abc.rst:237 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:242 +#: ../../library/collections.abc.rst:243 msgid "" "ABC for iterable classes that also provide the :meth:`__reversed__` method." msgstr "" -#: ../../library/collections.abc.rst:249 +#: ../../library/collections.abc.rst:250 msgid "" "ABC for generator classes that implement the protocol defined in :pep:`342` " "that extends iterators with the :meth:`~generator.send`, :meth:`~generator." @@ -483,11 +493,11 @@ msgid "" "term:`generator`." msgstr "" -#: ../../library/collections.abc.rst:260 +#: ../../library/collections.abc.rst:261 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:262 +#: ../../library/collections.abc.rst:263 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " @@ -498,37 +508,44 @@ msgid "" "likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:271 +#: ../../library/collections.abc.rst:272 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:278 +#: ../../library/collections.abc.rst:280 +msgid "" +"The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " +"union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " +"use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`." +msgstr "" + +#: ../../library/collections.abc.rst:285 msgid "ABCs for read-only and mutable sets." msgstr "" -#: ../../library/collections.abc.rst:283 +#: ../../library/collections.abc.rst:290 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:290 +#: ../../library/collections.abc.rst:297 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:294 +#: ../../library/collections.abc.rst:301 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`__await__` " "method." msgstr "" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:305 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:302 +#: ../../library/collections.abc.rst:309 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine`) are *awaitables*, even though they do not have an :meth:" @@ -536,7 +553,7 @@ msgid "" "return ``False``. Use :func:`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:312 +#: ../../library/collections.abc.rst:319 msgid "" "ABC for coroutine compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -546,7 +563,7 @@ msgid "" "`coroutine`." msgstr "" -#: ../../library/collections.abc.rst:320 +#: ../../library/collections.abc.rst:327 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine`) are *awaitables*, even though they do not have an :meth:" @@ -554,35 +571,41 @@ msgid "" "return ``False``. Use :func:`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:330 +#: ../../library/collections.abc.rst:337 msgid "" "ABC for classes that provide ``__aiter__`` method. See also the definition " "of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:337 +#: ../../library/collections.abc.rst:344 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:344 +#: ../../library/collections.abc.rst:351 msgid "" "ABC for asynchronous generator classes that implement the protocol defined " "in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:350 +#: ../../library/collections.abc.rst:358 +msgid "" +"ABC for classes that provide the :meth:`~object.__buffer__` method, " +"implementing the :ref:`buffer protocol `. See :pep:`688`." +msgstr "" + +#: ../../library/collections.abc.rst:364 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:352 +#: ../../library/collections.abc.rst:366 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:359 +#: ../../library/collections.abc.rst:373 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -592,11 +615,11 @@ msgid "" "`__and__` and :meth:`isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:388 +#: ../../library/collections.abc.rst:402 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:391 +#: ../../library/collections.abc.rst:405 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an iterable. The class constructor is " @@ -609,14 +632,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:402 +#: ../../library/collections.abc.rst:416 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other " "operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:407 +#: ../../library/collections.abc.rst:421 msgid "" "The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " "value for the set; however, :meth:`__hash__` is not defined because not all " @@ -625,12 +648,12 @@ msgid "" "``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:415 +#: ../../library/collections.abc.rst:429 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:418 +#: ../../library/collections.abc.rst:432 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`\\ 。" diff --git a/library/collections.po b/library/collections.po index bf412f5824..da1341b093 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -351,7 +351,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:244 +#: ../../library/collections.rst:245 msgid "" "A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` " "objects. It is a collection where elements are stored as dictionary keys and " @@ -364,7 +364,7 @@ msgstr "" "計數可以是包含 0 與負數的任何整數值。:class:`Counter` 類別類似其他程式語言中" "的 bags 或 multisets。" -#: ../../library/collections.rst:250 +#: ../../library/collections.rst:251 msgid "" "Elements are counted from an *iterable* or initialized from another " "*mapping* (or counter):" @@ -372,7 +372,7 @@ msgstr "" "被計數的元素來自一個 *iterable* 或是被其他的 *mapping*\\ (或 Counter)初始" "化:" -#: ../../library/collections.rst:258 +#: ../../library/collections.rst:259 msgid "" "Counter objects have a dictionary interface except that they return a zero " "count for missing items instead of raising a :exc:`KeyError`:" @@ -380,7 +380,7 @@ msgstr "" "Counter 物件擁有一個字典的使用介面,除了遇到 Counter 中沒有的值時會回傳計數 " "0 取代 :exc:`KeyError` 這點不同:" -#: ../../library/collections.rst:265 +#: ../../library/collections.rst:266 msgid "" "Setting a count to zero does not remove an element from a counter. Use " "``del`` to remove it entirely:" @@ -388,7 +388,7 @@ msgstr "" "將一個值的計數設為 0 並不會真的從 Counter 中刪除這個元素,要使用 ``del`` 來將" "其刪除:" -#: ../../library/collections.rst:273 +#: ../../library/collections.rst:274 msgid "" "As a :class:`dict` subclass, :class:`Counter` inherited the capability to " "remember insertion order. Math operations on *Counter* objects also " @@ -400,13 +400,13 @@ msgstr "" "對 *Counter* 做數學運算後同樣保留順序性,其結果是依照各個元素在運算元左邊出現" "的時間先後、再按照運算元右邊出現的時間先後來排列。" -#: ../../library/collections.rst:279 +#: ../../library/collections.rst:280 msgid "" "Counter objects support additional methods beyond those available for all " "dictionaries:" msgstr "除了字典原本就有的方法外,Counter 物件額外支援數個新方法:" -#: ../../library/collections.rst:284 +#: ../../library/collections.rst:285 msgid "" "Return an iterator over elements repeating each as many times as its count. " "Elements are returned in the order first encountered. If an element's count " @@ -416,7 +416,7 @@ msgstr "" "依照各元素首次出現的時間先後。如果元素的出現次數小於 1,\\ :meth:`elements` " "方法會忽略這些元素。" -#: ../../library/collections.rst:294 +#: ../../library/collections.rst:295 msgid "" "Return a list of the *n* most common elements and their counts from the most " "common to the least. If *n* is omitted or ``None``, :meth:`most_common` " @@ -427,7 +427,7 @@ msgstr "" "如果 *n* 被省略或者為 ``None``\\ ,\\ :meth:`most_common` 會回傳\\ *所有* " "counter 中的元素。出現次數相同的元素會按照首次出現的時間先後來排列:" -#: ../../library/collections.rst:304 +#: ../../library/collections.rst:305 msgid "" "Elements are subtracted from an *iterable* or from another *mapping* (or " "counter). Like :meth:`dict.update` but subtracts counts instead of " @@ -437,11 +437,11 @@ msgstr "" "似 :meth:`dict.update` 但是是為了減去計數而非取代其值。輸入和輸出都可以是 0 " "或是負數。" -#: ../../library/collections.rst:318 +#: ../../library/collections.rst:319 msgid "Compute the sum of the counts." msgstr "計算總計數值。" -#: ../../library/collections.rst:326 +#: ../../library/collections.rst:327 msgid "" "The usual dictionary methods are available for :class:`Counter` objects " "except for two which work differently for counters." @@ -449,11 +449,11 @@ msgstr "" "通常來說字典方法也可以用於 :class:`Counter` 物件,除了以下兩個作用方式與計數" "器不同。" -#: ../../library/collections.rst:331 +#: ../../library/collections.rst:332 msgid "This class method is not implemented for :class:`Counter` objects." msgstr "此類別方法沒有被實作於 :class:`Counter` 物件中。" -#: ../../library/collections.rst:335 +#: ../../library/collections.rst:336 msgid "" "Elements are counted from an *iterable* or added-in from another *mapping* " "(or counter). Like :meth:`dict.update` but adds counts instead of replacing " @@ -465,7 +465,7 @@ msgstr "" "*iterable* 需要是一串將被計算個數元素的序列,而非元素為 ``(key, value)`` 形式" "的序列。" -#: ../../library/collections.rst:340 +#: ../../library/collections.rst:341 msgid "" "Counters support rich comparison operators for equality, subset, and " "superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of " @@ -476,11 +476,11 @@ msgstr "" "``<``、``<=``、``>``、``>=``。這些檢測會將不存在的元素之計數值當作零,因此 " "``Counter(a=1) == Counter(a=1, b=0)`` 將回傳真值。" -#: ../../library/collections.rst:345 +#: ../../library/collections.rst:346 msgid "Rich comparison operations were added." msgstr "增加了 rich comparison 運算。" -#: ../../library/collections.rst:348 +#: ../../library/collections.rst:349 msgid "" "In equality tests, missing elements are treated as having zero counts. " "Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered " @@ -489,14 +489,14 @@ msgstr "" "在相等性運算中,不存在的元素之計數值會被當作零。在此之前,``Counter(a=3)`` " "和 ``Counter(a=3, b=0)`` 被視為不同。" -#: ../../library/collections.rst:353 +#: ../../library/collections.rst:354 msgid "Common patterns for working with :class:`Counter` objects::" msgstr "" "使用 :class:`Counter` 物件的常見使用模式:\n" "\n" "::" -#: ../../library/collections.rst:365 +#: ../../library/collections.rst:366 msgid "" "Several mathematical operations are provided for combining :class:`Counter` " "objects to produce multisets (counters that have counts greater than zero). " @@ -512,18 +512,18 @@ msgstr "" "含性運算則會比較對應的計數。每一個操作都可以接受輸入帶有正負號的計數,但輸出" "的 Counter 則會將擁有小於或等於 0 計數的元素剔除。" -#: ../../library/collections.rst:390 +#: ../../library/collections.rst:391 msgid "" "Unary addition and subtraction are shortcuts for adding an empty counter or " "subtracting from an empty counter." msgstr "加減法的一元運算子分別是加上空的 Counter 和從空 Counter 減去的簡寫。" -#: ../../library/collections.rst:399 +#: ../../library/collections.rst:400 msgid "" "Added support for unary plus, unary minus, and in-place multiset operations." msgstr "開始支援加減一元運算子和 multiset 的原地 (in-place) 操作。" -#: ../../library/collections.rst:404 +#: ../../library/collections.rst:405 msgid "" "Counters were primarily designed to work with positive integers to represent " "running counts; however, care was taken to not unnecessarily preclude use " @@ -534,7 +534,7 @@ msgstr "" "為負數或為其他型別的案例中,Counter 也小心地被設計成不會預先排除這些特殊元" "素。為了輔助使用於上述案例,這一小節記錄了最小範圍和型別限制。" -#: ../../library/collections.rst:409 +#: ../../library/collections.rst:410 msgid "" "The :class:`Counter` class itself is a dictionary subclass with no " "restrictions on its keys and values. The values are intended to be numbers " @@ -543,13 +543,13 @@ msgstr "" ":class:`Counter` 類別本身是字典的子類別,且不限制其鍵與值。值被用來表示計數," "但實際上你\\ *可以*\\ 儲存任何值。" -#: ../../library/collections.rst:413 +#: ../../library/collections.rst:414 msgid "" "The :meth:`~Counter.most_common` method requires only that the values be " "orderable." msgstr "使用 :meth:`~Counter.most_common` 方法的唯一條件是其值要是可被排序的。" -#: ../../library/collections.rst:415 +#: ../../library/collections.rst:416 msgid "" "For in-place operations such as ``c[key] += 1``, the value type need only " "support addition and subtraction. So fractions, floats, and decimals would " @@ -561,7 +561,7 @@ msgstr "" "數、十進位數與其負值都可以使用。同理,\\ :meth:`~Counter.update` 和 :meth:" "`~Counter.subtract` 也都允許 0 或負值為輸入或輸出。" -#: ../../library/collections.rst:421 +#: ../../library/collections.rst:422 msgid "" "The multiset methods are designed only for use cases with positive values. " "The inputs may be negative or zero, but only outputs with positive values " @@ -571,13 +571,13 @@ msgstr "" "Multiset 相關方法只為了處理正值而設計,其輸入允許是 0 或負值但只有正值會被輸" "出。並無型別限制,但其值的型別須支援加、減及比較運算。" -#: ../../library/collections.rst:426 +#: ../../library/collections.rst:427 msgid "" "The :meth:`~Counter.elements` method requires integer counts. It ignores " "zero and negative counts." msgstr ":meth:`~Counter.elements` 方法需要其計數為正值,如為 0 或負值則忽略。" -#: ../../library/collections.rst:431 +#: ../../library/collections.rst:432 msgid "" "`Bag class `_ in Smalltalk." @@ -585,13 +585,13 @@ msgstr "" "Smalltalk 中的 `Bag class `_\\ 。" -#: ../../library/collections.rst:434 +#: ../../library/collections.rst:435 msgid "" "Wikipedia entry for `Multisets `_." msgstr "" "維基百科上的\\ `多重集合 `_\\ 條目。" -#: ../../library/collections.rst:436 +#: ../../library/collections.rst:437 msgid "" "`C++ multisets `_ tutorial with examples." @@ -599,7 +599,7 @@ msgstr "" "`C++ multisets `_ 教學與範例。" -#: ../../library/collections.rst:439 +#: ../../library/collections.rst:440 msgid "" "For mathematical operations on multisets and their use cases, see *Knuth, " "Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " @@ -608,7 +608,7 @@ msgstr "" "Multiset 的數學運算及其使用時機,參考 *Knuth, Donald. The Art of Computer " "Programming Volume II, Section 4.6.3, Exercise 19*\\ 。" -#: ../../library/collections.rst:443 +#: ../../library/collections.rst:444 msgid "" "To enumerate all distinct multisets of a given size over a given set of " "elements, see :func:`itertools.combinations_with_replacement`::" @@ -618,11 +618,11 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:450 +#: ../../library/collections.rst:451 msgid ":class:`deque` objects" msgstr ":class:`deque` 物件" -#: ../../library/collections.rst:454 +#: ../../library/collections.rst:455 msgid "" "Returns a new deque object initialized left-to-right (using :meth:`append`) " "with data from *iterable*. If *iterable* is not specified, the new deque is " @@ -632,7 +632,7 @@ msgstr "" "meth:`append`\\ )加入來做初始化。如果 *iterable* 並未給定,回傳的則是一個空" "的 deque。" -#: ../../library/collections.rst:457 +#: ../../library/collections.rst:458 msgid "" "Deques are a generalization of stacks and queues (the name is pronounced " "\"deck\" and is short for \"double-ended queue\"). Deques support thread-" @@ -643,7 +643,7 @@ msgstr "" "的一般化。deque 支援執行緒安全 (thread-safe),且能夠有效率地節省記憶體在頭和" "尾加入和移除元素,兩個方向的表現都大致為 O(1) 複雜度。" -#: ../../library/collections.rst:462 +#: ../../library/collections.rst:463 msgid "" "Though :class:`list` objects support similar operations, they are optimized " "for fast fixed-length operations and incur O(n) memory movement costs for " @@ -654,7 +654,7 @@ msgstr "" "變底層資料的長度及位置的 ``pop(0)`` 和 ``insert(0, v)`` 操作,記憶體移動則為 " "O(n) 複雜度。" -#: ../../library/collections.rst:468 +#: ../../library/collections.rst:469 msgid "" "If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary " "length. Otherwise, the deque is bounded to the specified maximum length. " @@ -670,37 +670,37 @@ msgstr "" "Unix ``tail`` filter 類似的功能,可用於追蹤使用者在意的那些最新執行事項或數據" "源。" -#: ../../library/collections.rst:477 +#: ../../library/collections.rst:478 msgid "Deque objects support the following methods:" msgstr "Deque 物件支援以下方法:" -#: ../../library/collections.rst:481 +#: ../../library/collections.rst:482 msgid "Add *x* to the right side of the deque." msgstr "將 *x* 自 deque 的右側加入。" -#: ../../library/collections.rst:486 +#: ../../library/collections.rst:487 msgid "Add *x* to the left side of the deque." msgstr "將 *x* 自 deque 的左側加入。" -#: ../../library/collections.rst:491 +#: ../../library/collections.rst:492 msgid "Remove all elements from the deque leaving it with length 0." msgstr "將所有元素從 deque 中移除,使其長度為 0。" -#: ../../library/collections.rst:496 +#: ../../library/collections.rst:497 msgid "Create a shallow copy of the deque." msgstr "建立一個 deque 的淺複製 (shallow copy)。" -#: ../../library/collections.rst:503 +#: ../../library/collections.rst:504 msgid "Count the number of deque elements equal to *x*." msgstr "計算 deque 內元素為 *x* 的個數。" -#: ../../library/collections.rst:510 +#: ../../library/collections.rst:511 msgid "" "Extend the right side of the deque by appending elements from the iterable " "argument." msgstr "將 iterable 引數加入 deque 的右側。" -#: ../../library/collections.rst:516 +#: ../../library/collections.rst:517 msgid "" "Extend the left side of the deque by appending elements from *iterable*. " "Note, the series of left appends results in reversing the order of elements " @@ -709,7 +709,7 @@ msgstr "" "將 iterable 引數加入 deque 的左側。要注意的是,加入後的元素順序和 iterable 參" "數是相反的。" -#: ../../library/collections.rst:523 +#: ../../library/collections.rst:524 msgid "" "Return the position of *x* in the deque (at or after index *start* and " "before index *stop*). Returns the first match or raises :exc:`ValueError` " @@ -718,11 +718,11 @@ msgstr "" "回傳 deque 中 *x* 的位置(或在索引 *start* 之後、索引 *stop* 之前的位置)。回" "傳第一個匹配的位置,如果沒找到就引發 :exc:`ValueError`\\ 。" -#: ../../library/collections.rst:532 +#: ../../library/collections.rst:533 msgid "Insert *x* into the deque at position *i*." msgstr "在 deque 位置 *i* 中插入 *x*\\ 。" -#: ../../library/collections.rst:534 +#: ../../library/collections.rst:535 msgid "" "If the insertion would cause a bounded deque to grow beyond *maxlen*, an :" "exc:`IndexError` is raised." @@ -730,7 +730,7 @@ msgstr "" "如果此插入操作導致 deque 超過其長度上限 *maxlen* 的話,會引發 :exc:" "`IndexError` 例外。" -#: ../../library/collections.rst:542 +#: ../../library/collections.rst:543 msgid "" "Remove and return an element from the right side of the deque. If no " "elements are present, raises an :exc:`IndexError`." @@ -738,7 +738,7 @@ msgstr "" "移除並回傳 deque 的最右側元素,若本來就沒有任何元素,則會引發 :exc:" "`IndexError`\\ 。" -#: ../../library/collections.rst:548 +#: ../../library/collections.rst:549 msgid "" "Remove and return an element from the left side of the deque. If no elements " "are present, raises an :exc:`IndexError`." @@ -746,24 +746,24 @@ msgstr "" "移除並回傳 deque 的最左側元素,若本來就沒有任何元素,則會引發 :exc:" "`IndexError`\\ 。" -#: ../../library/collections.rst:554 +#: ../../library/collections.rst:555 msgid "" "Remove the first occurrence of *value*. If not found, raises a :exc:" "`ValueError`." msgstr "" "移除第一個出現的 *value*\\ ,如果沒找到的話就引發一個 :exc:`ValueError`\\ 。" -#: ../../library/collections.rst:560 +#: ../../library/collections.rst:561 msgid "Reverse the elements of the deque in-place and then return ``None``." msgstr "將 deque 中的元素原地 (in-place) 倒序排列並回傳 ``None``\\ 。" -#: ../../library/collections.rst:567 +#: ../../library/collections.rst:568 msgid "" "Rotate the deque *n* steps to the right. If *n* is negative, rotate to the " "left." msgstr "將 deque 向右輪轉 *n* 步。若 *n* 為負值則向左輪轉。" -#: ../../library/collections.rst:570 +#: ../../library/collections.rst:571 msgid "" "When the deque is not empty, rotating one step to the right is equivalent to " "``d.appendleft(d.pop())``, and rotating one step to the left is equivalent " @@ -772,15 +772,15 @@ msgstr "" "當 deque 不是空的,向右輪轉一步和 ``d.appendleft(d.pop())`` 有相同意義,而向" "左輪轉亦等價於 ``d.append(d.popleft())``\\ 。" -#: ../../library/collections.rst:575 +#: ../../library/collections.rst:576 msgid "Deque objects also provide one read-only attribute:" msgstr "Deque 物件也提供了一個唯讀屬性:" -#: ../../library/collections.rst:579 +#: ../../library/collections.rst:580 msgid "Maximum size of a deque or ``None`` if unbounded." msgstr "Deque 的最大長度,如果不限制長度的話則為 ``None``\\ 。" -#: ../../library/collections.rst:584 +#: ../../library/collections.rst:585 msgid "" "In addition to the above, deques support iteration, pickling, ``len(d)``, " "``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " @@ -793,7 +793,7 @@ msgstr "" "及像是 ``d[0]`` 的標號引用來取得第一個元素。在兩端做索引存取的複雜度為 O(1) " "但越靠近中間則減慢至 O(n)。若想要隨機而快速的存取,使用 list 會較為合適。" -#: ../../library/collections.rst:590 +#: ../../library/collections.rst:591 msgid "" "Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and " "``__imul__()``." @@ -801,19 +801,19 @@ msgstr "" "自從 3.5 版本起,deque 開始支援 ``__add__()``、``__mul__()`` 和 " "``__imul__()``。" -#: ../../library/collections.rst:593 +#: ../../library/collections.rst:594 msgid "Example:" msgstr "範例:" -#: ../../library/collections.rst:650 +#: ../../library/collections.rst:651 msgid ":class:`deque` Recipes" msgstr ":class:`deque` 用法" -#: ../../library/collections.rst:652 +#: ../../library/collections.rst:653 msgid "This section shows various approaches to working with deques." msgstr "這一章節提供了多種操作 deque 的案例。" -#: ../../library/collections.rst:654 +#: ../../library/collections.rst:655 msgid "" "Bounded length deques provide functionality similar to the ``tail`` filter " "in Unix::" @@ -822,7 +822,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:662 +#: ../../library/collections.rst:663 msgid "" "Another approach to using deques is to maintain a sequence of recently added " "elements by appending to the right and popping to the left::" @@ -831,7 +831,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:677 +#: ../../library/collections.rst:678 msgid "" "A `round-robin scheduler `_ can be implemented with input iterators stored in a :" @@ -848,7 +848,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:696 +#: ../../library/collections.rst:697 msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " "slicing and deletion. For example, a pure Python implementation of ``del " @@ -860,7 +860,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:705 +#: ../../library/collections.rst:706 msgid "" "To implement :class:`deque` slicing, use a similar approach applying :meth:" "`~deque.rotate` to bring a target element to the left side of the deque. " @@ -875,11 +875,11 @@ msgstr "" "就能簡單地實現 Forth 風格的 stack 操作,例如 ``dup``、``drop``、``swap``、" "``over``、``pick``、``rot`` 和 ``roll``。" -#: ../../library/collections.rst:715 +#: ../../library/collections.rst:716 msgid ":class:`defaultdict` objects" msgstr ":class:`defaultdict` 物件" -#: ../../library/collections.rst:719 +#: ../../library/collections.rst:720 msgid "" "Return a new dictionary-like object. :class:`defaultdict` is a subclass of " "the built-in :class:`dict` class. It overrides one method and adds one " @@ -890,7 +890,7 @@ msgstr "" "的子類別。它覆蓋掉了一個方法並添加了一個可寫入的實例變數。其餘功能與 :class:" "`dict` 相同,此文件不再複述。" -#: ../../library/collections.rst:724 +#: ../../library/collections.rst:725 msgid "" "The first argument provides the initial value for the :attr:" "`default_factory` attribute; it defaults to ``None``. All remaining " @@ -901,13 +901,13 @@ msgstr "" "所有其他的引數(包括關鍵字引數)都會被傳遞給 :class:`dict` 的建構函式 " "(constructor)。" -#: ../../library/collections.rst:730 +#: ../../library/collections.rst:731 msgid "" ":class:`defaultdict` objects support the following method in addition to the " "standard :class:`dict` operations:" msgstr ":class:`defaultdict` 物件支援以下 :class:`dict` 所沒有的方法:" -#: ../../library/collections.rst:735 +#: ../../library/collections.rst:736 msgid "" "If the :attr:`default_factory` attribute is ``None``, this raises a :exc:" "`KeyError` exception with the *key* as argument." @@ -915,7 +915,7 @@ msgstr "" "如果 :attr:`default_factory` 屬性為 ``None``,呼叫此方法會引發一個附帶引數 " "*key* 的 :exc:`KeyError` 例外。" -#: ../../library/collections.rst:738 +#: ../../library/collections.rst:739 msgid "" "If :attr:`default_factory` is not ``None``, it is called without arguments " "to provide a default value for the given *key*, this value is inserted in " @@ -925,14 +925,14 @@ msgstr "" "*key* 提供一個預設值,這個值和 *key* 被作為鍵值對來插入到字典中,並且被此方法" "所回傳。" -#: ../../library/collections.rst:742 +#: ../../library/collections.rst:743 msgid "" "If calling :attr:`default_factory` raises an exception this exception is " "propagated unchanged." msgstr "" "如果呼叫 :attr:`default_factory` 時發生例外,則該例外將會保持不變地向外傳遞。" -#: ../../library/collections.rst:745 +#: ../../library/collections.rst:746 msgid "" "This method is called by the :meth:`__getitem__` method of the :class:`dict` " "class when the requested key is not found; whatever it returns or raises is " @@ -942,7 +942,7 @@ msgstr "" "方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:`__getitem__` 所傳" "遞。" -#: ../../library/collections.rst:749 +#: ../../library/collections.rst:750 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" "meth:`__getitem__`. This means that :meth:`get` will, like normal " @@ -953,11 +953,11 @@ msgstr "" "叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設值,而非使" "用 :attr:`default_factory`。" -#: ../../library/collections.rst:755 +#: ../../library/collections.rst:756 msgid ":class:`defaultdict` objects support the following instance variable:" msgstr ":class:`defaultdict` 物件支援以下實例變數:" -#: ../../library/collections.rst:760 +#: ../../library/collections.rst:761 msgid "" "This attribute is used by the :meth:`__missing__` method; it is initialized " "from the first argument to the constructor, if present, or to ``None``, if " @@ -966,16 +966,16 @@ msgstr "" "此屬性為 :meth:`__missing__` 方法所使用。如果有引數被傳入建構函式,則此屬性會" "被初始化成第一個引數,如未提供引數則被初始化為 ``None``。" -#: ../../library/collections.rst:764 ../../library/collections.rst:1180 +#: ../../library/collections.rst:765 ../../library/collections.rst:1182 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "新增合併 (``|``) 和更新 (``|=``) 運算子,請見 :pep:`584`。" -#: ../../library/collections.rst:770 +#: ../../library/collections.rst:771 msgid ":class:`defaultdict` Examples" msgstr ":class:`defaultdict` 範例" -#: ../../library/collections.rst:772 +#: ../../library/collections.rst:773 msgid "" "Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy " "to group a sequence of key-value pairs into a dictionary of lists:" @@ -983,7 +983,7 @@ msgstr "" "使用 :class:`list` 作為 :attr:`~defaultdict.default_factory` 可以很輕鬆地將鍵" "值對序列轉換為包含 list 之字典:" -#: ../../library/collections.rst:783 +#: ../../library/collections.rst:784 msgid "" "When each key is encountered for the first time, it is not already in the " "mapping; so an entry is automatically created using the :attr:`~defaultdict." @@ -1001,7 +1001,7 @@ msgstr "" "會新增另一個值到 list 中。和使用與其等價的 :meth:`dict.setdefault` 相比,這個" "技巧更加快速和簡單:" -#: ../../library/collections.rst:798 +#: ../../library/collections.rst:799 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :" "class:`defaultdict` useful for counting (like a bag or multiset in other " @@ -1010,7 +1010,7 @@ msgstr "" "設定 :attr:`~defaultdict.default_factory` 為 :class:`int` 使得 :class:" "`defaultdict` 可被用於計數(類似其他語言中的 bag 或 multiset):" -#: ../../library/collections.rst:810 +#: ../../library/collections.rst:811 msgid "" "When a letter is first encountered, it is missing from the mapping, so the :" "attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " @@ -1021,7 +1021,7 @@ msgstr "" "default_factory` 函式會呼叫 :func:`int` 來提供一個整數 0 作為預設值。後續的增" "加操作繼續對每個字母做計數。" -#: ../../library/collections.rst:814 +#: ../../library/collections.rst:815 msgid "" "The function :func:`int` which always returns zero is just a special case of " "constant functions. A faster and more flexible way to create constant " @@ -1031,7 +1031,7 @@ msgstr "" "函式 :func:`int` 總是回傳 0,這是常數函式的特殊情況。一個更快、更有彈性的方法" "是使用 lambda 函式來提供任何常數值(不用一定要是 0):" -#: ../../library/collections.rst:826 +#: ../../library/collections.rst:828 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :" "class:`defaultdict` useful for building a dictionary of sets:" @@ -1039,11 +1039,11 @@ msgstr "" "將 :attr:`~defaultdict.default_factory` 設為 :class:`set` 使 :class:" "`defaultdict` 可用於構建一個值為 set 的字典:" -#: ../../library/collections.rst:839 +#: ../../library/collections.rst:841 msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" msgstr ":func:`namedtuple` 擁有具名欄位之 tuple 的工廠函式" -#: ../../library/collections.rst:841 +#: ../../library/collections.rst:843 msgid "" "Named tuples assign meaning to each position in a tuple and allow for more " "readable, self-documenting code. They can be used wherever regular tuples " @@ -1054,7 +1054,7 @@ msgstr "" "件性。它們可以用於任何普通 tuple 可使用的場合,賦予其透過名稱(而非位置索引)" "來存取欄位的能力。" -#: ../../library/collections.rst:847 +#: ../../library/collections.rst:849 msgid "" "Returns a new tuple subclass named *typename*. The new subclass is used to " "create tuple-like objects that have fields accessible by attribute lookup as " @@ -1068,7 +1068,7 @@ msgstr "" "位名 field_names)和一個好用的 :meth:`__repr__` 方法,可將 tuple 內容以 " "``name=value`` 格式列出。" -#: ../../library/collections.rst:853 +#: ../../library/collections.rst:855 msgid "" "The *field_names* are a sequence of strings such as ``['x', 'y']``. " "Alternatively, *field_names* can be a single string with each fieldname " @@ -1077,7 +1077,7 @@ msgstr "" "*field_names* 是一個像 ``['x', 'y']`` 一樣的字串序列。*field_names* 也可以是" "一個用空白或逗號分隔各個欄位名稱的字串,比如 ``'x y'`` 或者 ``'x, y'``。" -#: ../../library/collections.rst:857 +#: ../../library/collections.rst:859 msgid "" "Any valid Python identifier may be used for a fieldname except for names " "starting with an underscore. Valid identifiers consist of letters, digits, " @@ -1089,7 +1089,7 @@ msgstr "" "詞 :mod:`keyword`,例如 *class*、*for*、*return*、*global*、*pass* 或 " "*raise*。" -#: ../../library/collections.rst:863 +#: ../../library/collections.rst:865 msgid "" "If *rename* is true, invalid fieldnames are automatically replaced with " "positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " @@ -1100,7 +1100,7 @@ msgstr "" "'def', 'ghi', 'abc']`` 會被轉換成 ``['abc', '_1', 'ghi', '_3']``,移除了關鍵" "字 ``def`` 和重複欄位名 ``abc``。" -#: ../../library/collections.rst:868 +#: ../../library/collections.rst:870 msgid "" "*defaults* can be ``None`` or an :term:`iterable` of default values. Since " "fields with a default value must come after any fields without a default, " @@ -1114,14 +1114,14 @@ msgstr "" "如 fieldnames 為 ``['x', 'y', 'z']`` 且 defaults 為 ``(1, 2)``,那麼 ``x`` 就" "必須被給定一個引數,``y`` 被預設為 ``1``,``z`` 則被預設為 ``2``。" -#: ../../library/collections.rst:875 +#: ../../library/collections.rst:877 msgid "" "If *module* is defined, the ``__module__`` attribute of the named tuple is " "set to that value." msgstr "" "如果 *module* 值有被定義,named tuple 的 ``__module__`` 屬性就被設定為該值。" -#: ../../library/collections.rst:878 +#: ../../library/collections.rst:880 msgid "" "Named tuple instances do not have per-instance dictionaries, so they are " "lightweight and require no more memory than regular tuples." @@ -1129,17 +1129,17 @@ msgstr "" "Named tuple 實例中沒有字典,所以它們更加輕量,且和一般 tuple 相比佔用更少記憶" "體。" -#: ../../library/collections.rst:881 +#: ../../library/collections.rst:883 msgid "" "To support pickling, the named tuple class should be assigned to a variable " "that matches *typename*." msgstr "要支援 pickle,應將 named tuple 類別賦值給一個符合 *typename* 的變數。" -#: ../../library/collections.rst:884 +#: ../../library/collections.rst:886 msgid "Added support for *rename*." msgstr "新增對於 *rename* 的支援。" -#: ../../library/collections.rst:887 +#: ../../library/collections.rst:889 msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "`." @@ -1147,20 +1147,20 @@ msgstr "" "*verbose* 和 *rename* 參數成為\\ :ref:`僅限關鍵字引數 `\\ 。" -#: ../../library/collections.rst:891 +#: ../../library/collections.rst:893 msgid "Added the *module* parameter." msgstr "新增 *module* 參數。" -#: ../../library/collections.rst:894 +#: ../../library/collections.rst:896 msgid "Removed the *verbose* parameter and the :attr:`_source` attribute." msgstr "移除 *verbose* 參數和 :attr:`_source` 屬性。" -#: ../../library/collections.rst:897 +#: ../../library/collections.rst:899 msgid "" "Added the *defaults* parameter and the :attr:`_field_defaults` attribute." msgstr "新增 *defaults* 參數和 :attr:`_field_defaults` 屬性。" -#: ../../library/collections.rst:917 +#: ../../library/collections.rst:919 msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" @@ -1170,7 +1170,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:933 +#: ../../library/collections.rst:935 msgid "" "In addition to the methods inherited from tuples, named tuples support three " "additional methods and two attributes. To prevent conflicts with field " @@ -1179,22 +1179,22 @@ msgstr "" "除了繼承自 tuple 的方法,named tuple 還支援三個額外的方法和兩個屬性。為了防止" "欄位名稱有衝突,方法和屬性的名稱以底線開頭。" -#: ../../library/collections.rst:939 +#: ../../library/collections.rst:941 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "從已存在的序列或可疊代物件建立一個新實例的類別方法。" -#: ../../library/collections.rst:949 +#: ../../library/collections.rst:951 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " "values:" msgstr "回傳一個將欄位名稱對映至對應值的 :class:`dict`:" -#: ../../library/collections.rst:958 +#: ../../library/collections.rst:960 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "回傳一個 :class:`OrderedDict` 而非 :class:`dict`。" -#: ../../library/collections.rst:961 +#: ../../library/collections.rst:963 msgid "" "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " "Python 3.7, regular dicts are guaranteed to be ordered. If the extra " @@ -1205,7 +1205,7 @@ msgstr "" "dict 已經保證有順序性,如果需要 :class:`OrderedDict` 所專屬的特性,推薦的解法" "是將結果專換成所需的類型:\\ ``OrderedDict(nt._asdict())``\\ 。" -#: ../../library/collections.rst:970 +#: ../../library/collections.rst:972 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" @@ -1214,7 +1214,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:982 +#: ../../library/collections.rst:984 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." @@ -1222,17 +1222,17 @@ msgstr "" "列出 tuple 欄位名稱的字串,用於自我檢查或是從現有 named tuple 建立一個新的 " "named tuple 型別。" -#: ../../library/collections.rst:997 +#: ../../library/collections.rst:999 msgid "Dictionary mapping field names to default values." msgstr "將欄位名稱對映至預設值的字典。" -#: ../../library/collections.rst:1007 +#: ../../library/collections.rst:1009 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "要取得這個名稱存於字串的欄位,要使用 :func:`getattr` 函式:" -#: ../../library/collections.rst:1013 +#: ../../library/collections.rst:1015 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" @@ -1240,7 +1240,7 @@ msgstr "" "(如\\ :ref:`tut-unpacking-arguments`\\ 所述)將一個字典轉換成 named tuple," "要使用 \\*\\* 雙星號運算子:" -#: ../../library/collections.rst:1020 +#: ../../library/collections.rst:1022 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " @@ -1249,7 +1249,7 @@ msgstr "" "因為一個 named tuple 是一個常規的 Python 類別,我們可以很容易的透過子類別來新" "增或更改功能,以下是如何新增一個計算得到的欄位和固定寬度的輸出列印格式:" -#: ../../library/collections.rst:1039 +#: ../../library/collections.rst:1041 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " @@ -1258,7 +1258,7 @@ msgstr "" "上面的子類別將 ``__slots__`` 設定為空 tuple,這樣一來就防止了字典實例被建立," "因而保持了較低的記憶體用量。" -#: ../../library/collections.rst:1042 +#: ../../library/collections.rst:1044 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " @@ -1267,17 +1267,17 @@ msgstr "" "子類別化無法用於增加新的、已被儲存的欄位,應當透過 :attr:`~somenamedtuple." "_fields` 屬性以建立一個新的 named tuple 來實現:" -#: ../../library/collections.rst:1047 +#: ../../library/collections.rst:1049 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "透過直接賦值給 ``__doc__``,可以自訂說明文件字串:" -#: ../../library/collections.rst:1056 +#: ../../library/collections.rst:1058 msgid "Property docstrings became writeable." msgstr "文件字串屬性變成可寫入。" -#: ../../library/collections.rst:1061 +#: ../../library/collections.rst:1063 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " @@ -1288,7 +1288,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:1070 +#: ../../library/collections.rst:1072 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." @@ -1296,7 +1296,7 @@ msgstr "" "關於以 dict 而非 tuple 為底層的可變命名空間,請參考 :meth:`types." "SimpleNamespace`。" -#: ../../library/collections.rst:1073 +#: ../../library/collections.rst:1075 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." @@ -1304,11 +1304,11 @@ msgstr "" ":mod:`dataclasses` 模組提供了一個裝飾器和一些函式,用於自動將被生成的特殊方法" "新增到使用者定義的類別中。" -#: ../../library/collections.rst:1078 +#: ../../library/collections.rst:1080 msgid ":class:`OrderedDict` objects" msgstr ":class:`OrderedDict` 物件" -#: ../../library/collections.rst:1080 +#: ../../library/collections.rst:1082 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " @@ -1319,11 +1319,11 @@ msgstr "" "功能,但由於內建的 :class:`dict` 類別現在已經有記憶插入順序的能力(Python " "3.7 中確保了這種新行為),它們變得不那麼重要了。" -#: ../../library/collections.rst:1086 +#: ../../library/collections.rst:1088 msgid "Some differences from :class:`dict` still remain:" msgstr "仍存在一些與 :class:`dict` 的不同之處:" -#: ../../library/collections.rst:1088 +#: ../../library/collections.rst:1090 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." @@ -1331,7 +1331,7 @@ msgstr "" "常規的 :class:`dict` 被設計成非常擅長於對映相關操作,追蹤插入的順序為次要目" "標。" -#: ../../library/collections.rst:1091 +#: ../../library/collections.rst:1093 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " @@ -1340,7 +1340,7 @@ msgstr "" ":class:`OrderedDict` 則被設計成擅長於重新排序相關的操作,空間效率、疊代速度和" "更新操作的效能則為次要設計目標。" -#: ../../library/collections.rst:1095 +#: ../../library/collections.rst:1097 msgid "" "The :class:`OrderedDict` algorithm can handle frequent reordering operations " "better than :class:`dict`. As shown in the recipes below, this makes it " @@ -1349,12 +1349,12 @@ msgstr "" ":class:`OrderedDict` 比起 :class:`dict` 更適合處理頻繁的重新排序操作,如在下" "方用法中所示,這讓它適合用於多種 LRU cache 的實作中。" -#: ../../library/collections.rst:1099 +#: ../../library/collections.rst:1101 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr ":class:`OrderedDict` 之相等性運算會檢查順序是否相同。" -#: ../../library/collections.rst:1101 +#: ../../library/collections.rst:1103 msgid "" "A regular :class:`dict` can emulate the order sensitive equality test with " "``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." @@ -1362,7 +1362,7 @@ msgstr "" "一個一般的 :class:`dict` 可以用 ``p == q and all(k1 == k2 for k1, k2 in " "zip(p, q))`` 來效仿有檢查順序的相等性運算。" -#: ../../library/collections.rst:1104 +#: ../../library/collections.rst:1106 msgid "" "The :meth:`popitem` method of :class:`OrderedDict` has a different " "signature. It accepts an optional argument to specify which item is popped." @@ -1370,7 +1370,7 @@ msgstr "" ":class:`OrderedDict` 類別的 :meth:`popitem` 方法有不同的函式簽名 " "(signature),它接受傳入一個選擇性引數來指定要移除哪個元素。" -#: ../../library/collections.rst:1107 +#: ../../library/collections.rst:1109 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " "with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." @@ -1378,7 +1378,7 @@ msgstr "" "一個一般的 :class:`dict` 可以用 ``d.popitem()`` 來效仿 OrderedDict 的 ``od." "popitem(last=True)``\\ ,這保證會移除最右邊(最後一個)的元素。" -#: ../../library/collections.rst:1110 +#: ../../library/collections.rst:1112 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " "with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " @@ -1388,7 +1388,7 @@ msgstr "" "OrderedDict 的 ``od.popitem(last=False)``\\ ,若最左邊(第一個)的元素存在," "則將其回傳並移除。" -#: ../../library/collections.rst:1114 +#: ../../library/collections.rst:1116 msgid "" ":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " "reposition an element to an endpoint." @@ -1396,7 +1396,7 @@ msgstr "" ":class:`OrderedDict` 有個 :meth:`move_to_end` 方法可有效率地將一個元素重新排" "列到任一端。" -#: ../../library/collections.rst:1117 +#: ../../library/collections.rst:1119 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " "last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " @@ -1406,7 +1406,7 @@ msgstr "" "``od.move_to_end(k, last=True)``\\ ,這會將該鍵與其對應到的值移動至最右(最後" "面)的位置。" -#: ../../library/collections.rst:1121 +#: ../../library/collections.rst:1123 msgid "" "A regular :class:`dict` does not have an efficient equivalent for " "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " @@ -1416,18 +1416,18 @@ msgstr "" "last=False)`` 等價的有效方式,這是將鍵與其對應到的值移動至最左(最前面)位置" "的方法。" -#: ../../library/collections.rst:1125 +#: ../../library/collections.rst:1127 msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." msgstr "在 Python 3.8 之前,:class:`dict` 並沒有 :meth:`__reversed__` 方法。" -#: ../../library/collections.rst:1130 +#: ../../library/collections.rst:1132 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" "回傳一個 :class:`dict` 子類別的實例,它具有專門用於重新排列字典順序的方法。" -#: ../../library/collections.rst:1137 +#: ../../library/collections.rst:1139 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" @@ -1439,7 +1439,7 @@ msgstr "" "回傳鍵值對,否則就按 :abbr:`FIFO (first-in, first-out)` 先進先出的順序回傳鍵" "值對。" -#: ../../library/collections.rst:1144 +#: ../../library/collections.rst:1146 msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " @@ -1449,7 +1449,7 @@ msgstr "" "設值)則將元素移至右端;如果 *last* 為假值則將元素移至左端。如果 *key* 不存在" "則會引發 :exc:`KeyError`:" -#: ../../library/collections.rst:1161 +#: ../../library/collections.rst:1163 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." @@ -1457,7 +1457,7 @@ msgstr "" "除了普通的對映方法,ordered dictionary 還支援了透過 :func:`reversed` 來做倒序" "疊代。" -#: ../../library/collections.rst:1164 +#: ../../library/collections.rst:1166 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are implemented as ``list(od1.items())==list(od2.items())``. Equality tests " @@ -1471,7 +1471,7 @@ msgstr "" "和其他 :class:`~collections.abc.Mapping` 物件間的相等性運算則像普通字典一樣不" "考慮順序性,這使得 :class:`OrderedDict` 可於任何字典可使用的時機中被替換掉。" -#: ../../library/collections.rst:1171 +#: ../../library/collections.rst:1173 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." @@ -1479,7 +1479,7 @@ msgstr "" ":class:`OrderedDict` 的項 (item)、鍵與值之\\ :term:`視圖 `\\ 現在可透過 :func:`reversed` 來倒序疊代。" -#: ../../library/collections.rst:1175 +#: ../../library/collections.rst:1177 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`update` method." @@ -1487,11 +1487,11 @@ msgstr "" "隨著 :pep:`468` 被核可,被傳入給 :class:`OrderedDict` 建構函式與其 :meth:" "`update` 方法的關鍵字引數之順序被保留了下來。" -#: ../../library/collections.rst:1185 +#: ../../library/collections.rst:1187 msgid ":class:`OrderedDict` Examples and Recipes" msgstr ":class:`OrderedDict` 範例與用法" -#: ../../library/collections.rst:1187 +#: ../../library/collections.rst:1189 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1503,7 +1503,7 @@ msgstr "" "\n" "::" -#: ../../library/collections.rst:1199 +#: ../../library/collections.rst:1201 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" @@ -1511,11 +1511,11 @@ msgstr "" ":class:`OrderedDict` 在實現一個 :func:`functools.lru_cache` 的變形版本時也非" "常有用:" -#: ../../library/collections.rst:1297 +#: ../../library/collections.rst:1300 msgid ":class:`UserDict` objects" msgstr ":class:`UserDict` 物件" -#: ../../library/collections.rst:1299 +#: ../../library/collections.rst:1302 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -1526,7 +1526,7 @@ msgstr "" "`dict` 建立子類別,這個類別的需求已部分被滿足,不過這個類別使用起來更方便,因" "為被包裝的字典可以作為其屬性來存取。" -#: ../../library/collections.rst:1307 +#: ../../library/collections.rst:1310 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" @@ -1538,23 +1538,23 @@ msgstr "" "`data` 屬性來做存取。如果有提供 *initialdata*\\ ,\\ :attr:`data` 屬性會被初" "始化為其值;要注意指到 *initialdata* 的參照不會被保留,使其可被用於其他目的。" -#: ../../library/collections.rst:1313 +#: ../../library/collections.rst:1316 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" "除了支援作為對映所需的方法與操作,\\ :class:`UserDict` 實例提供了以下屬性:" -#: ../../library/collections.rst:1318 +#: ../../library/collections.rst:1321 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "一個真實的字典,用於儲存 :class:`UserDict` 類別的資料內容。" -#: ../../library/collections.rst:1324 +#: ../../library/collections.rst:1327 msgid ":class:`UserList` objects" msgstr ":class:`UserList` 物件" -#: ../../library/collections.rst:1326 +#: ../../library/collections.rst:1329 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -1565,7 +1565,7 @@ msgstr "" "入新方法來定義你所需的一個類似於 list 的類別。如此一來,我們可以為 list 加入" "新的特性。" -#: ../../library/collections.rst:1331 +#: ../../library/collections.rst:1334 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " @@ -1574,7 +1574,7 @@ msgstr "" "因為已經可以直接自 :class:`list` 建立子類別,這個類別的需求已部分被滿足,不過" "這個類別使用起來更方便,因為被包裝的 list 可以作為其屬性來存取。" -#: ../../library/collections.rst:1337 +#: ../../library/collections.rst:1340 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -1587,21 +1587,21 @@ msgstr "" "list ``[]``。\\ *list* 可以是任何 iterable,例如一個真實的 Python list 或是一" "個 :class:`UserList` 物件。" -#: ../../library/collections.rst:1343 +#: ../../library/collections.rst:1346 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "" "除了支援可變序列的方法與操作,\\ :class:`UserList` 實例提供了以下屬性:" -#: ../../library/collections.rst:1348 +#: ../../library/collections.rst:1351 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" "一個真實的 :class:`list` 物件,用於儲存 :class:`UserList` 類別的資料內容。" -#: ../../library/collections.rst:1351 +#: ../../library/collections.rst:1354 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -1615,7 +1615,7 @@ msgstr "" "例,為了達成上述目的,它假設建構函式可傳入單一參數來呼叫,該參數即是做為數據" "來源的一個序列物件。" -#: ../../library/collections.rst:1358 +#: ../../library/collections.rst:1361 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -1625,11 +1625,11 @@ msgstr "" "如果希望一個自此獲得的子類別不遵從上述要求,那所有該類別支援的特殊方法則必須" "被覆寫;請參考原始碼來理解在這情況下哪些方法是必須提供的。" -#: ../../library/collections.rst:1364 +#: ../../library/collections.rst:1367 msgid ":class:`UserString` objects" msgstr ":class:`UserString` 物件" -#: ../../library/collections.rst:1366 +#: ../../library/collections.rst:1369 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -1640,7 +1640,7 @@ msgstr "" "建立子類別,這個類別的需求已經部分被滿足,不過這個類別使用起來更方便,因為被" "包裝的字串可以作為其屬性來存取。" -#: ../../library/collections.rst:1374 +#: ../../library/collections.rst:1377 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -1652,21 +1652,21 @@ msgstr "" "的 :attr:`data` 屬性來做存取。實例內容被初始化為 *seq* 的複製,\\ *seq* 引數" "可以是任何可被內建函式 :func:`str` 轉換成字串的物件。" -#: ../../library/collections.rst:1381 +#: ../../library/collections.rst:1384 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" "除了支援字串的方法和操作以外,\\ :class:`UserString` 實例也提供了以下屬性:" -#: ../../library/collections.rst:1386 +#: ../../library/collections.rst:1389 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" "一個真實的 :class:`str` 物件,用來儲存 :class:`UserString` 類別的資料內容。" -#: ../../library/collections.rst:1389 +#: ../../library/collections.rst:1392 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index be5446b1a5..3ca98642bd 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -288,7 +288,7 @@ msgstr "" "(worker thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:179 -#: ../../library/concurrent.futures.rst:281 +#: ../../library/concurrent.futures.rst:282 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -353,6 +353,7 @@ msgstr "" "或 :class:`Future` 方法將導致死鎖。" #: ../../library/concurrent.futures.rst:244 +#, fuzzy msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -361,9 +362,10 @@ msgid "" "be raised. On Windows, *max_workers* must be less than or equal to ``61``. " "If it is not then :exc:`ValueError` will be raised. If *max_workers* is " "``None``, then the default chosen will be at most ``61``, even if more " -"processors are available. *mp_context* can be a multiprocessing context or " -"None. It will be used to launch the workers. If *mp_context* is ``None`` or " -"not given, the default multiprocessing context is used." +"processors are available. *mp_context* can be a :mod:`multiprocessing` " +"context or ``None``. It will be used to launch the workers. If *mp_context* " +"is ``None`` or not given, the default :mod:`multiprocessing` context is " +"used. See :ref:`multiprocessing-start-methods`." msgstr "" "一個 :class:`Executor` 子類別,它使用了最多有 *max_workers* 個行程的池來非同" "步地執行呼叫。如果 *max_workers* 為 ``None`` 或未給定,它將被預設為機器上的處" @@ -374,7 +376,7 @@ msgstr "" "它將用於啟動 worker。如果 *mp_context* 為 ``None`` 或未給定,則使用預設的 " "multiprocessing 情境。" -#: ../../library/concurrent.futures.rst:257 +#: ../../library/concurrent.futures.rst:258 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -387,7 +389,7 @@ msgstr "" "外,所有當前未定的作業以及任何向池中提交更多作業的嘗試都將引發 :exc:" "`~concurrent.futures.process.BrokenProcessPool`。" -#: ../../library/concurrent.futures.rst:263 +#: ../../library/concurrent.futures.rst:264 msgid "" "*max_tasks_per_child* is an optional argument that specifies the maximum " "number of tasks a single process can execute before it will exit and be " @@ -403,7 +405,7 @@ msgstr "" "數的情況下,將預設使用 \"spawn\" 做為 multiprocessing 啟動方法。此功能與 " "\"fork\" 啟動方法不相容。" -#: ../../library/concurrent.futures.rst:271 +#: ../../library/concurrent.futures.rst:272 msgid "" "When one of the worker processes terminates abruptly, a :exc:" "`BrokenProcessPool` error is now raised. Previously, behaviour was " @@ -414,29 +416,38 @@ msgstr "" "去,此行為是未定義的 (undefined),但對 executor 或其 future 的操作經常會發生" "凍結或死鎖。" -#: ../../library/concurrent.futures.rst:277 +#: ../../library/concurrent.futures.rst:278 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:283 +#: ../../library/concurrent.futures.rst:285 +msgid "" +"The default :mod:`multiprocessing` start method (see :ref:`multiprocessing-" +"start-methods`) will change away from *fork* in Python 3.14. Code that " +"requires *fork* be used for their :class:`ProcessPoolExecutor` should " +"explicitly specify that by passing a ``mp_context=multiprocessing." +"get_context(\"fork\")`` parameter." +msgstr "" + +#: ../../library/concurrent.futures.rst:292 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:291 +#: ../../library/concurrent.futures.rst:299 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:329 +#: ../../library/concurrent.futures.rst:337 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:331 +#: ../../library/concurrent.futures.rst:339 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -444,7 +455,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:336 +#: ../../library/concurrent.futures.rst:344 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -453,7 +464,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:342 +#: ../../library/concurrent.futures.rst:350 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -463,22 +474,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫當前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:349 +#: ../../library/concurrent.futures.rst:357 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:353 +#: ../../library/concurrent.futures.rst:361 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:358 +#: ../../library/concurrent.futures.rst:366 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:363 +#: ../../library/concurrent.futures.rst:371 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -490,19 +501,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:370 -#: ../../library/concurrent.futures.rst:384 +#: ../../library/concurrent.futures.rst:378 +#: ../../library/concurrent.futures.rst:392 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:373 +#: ../../library/concurrent.futures.rst:381 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:377 +#: ../../library/concurrent.futures.rst:385 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -514,11 +525,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:387 +#: ../../library/concurrent.futures.rst:395 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:391 +#: ../../library/concurrent.futures.rst:399 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -527,7 +538,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:403 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -539,19 +550,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:401 +#: ../../library/concurrent.futures.rst:409 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:404 +#: ../../library/concurrent.futures.rst:412 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:417 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -560,7 +571,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:413 +#: ../../library/concurrent.futures.rst:421 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -571,7 +582,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:418 +#: ../../library/concurrent.futures.rst:426 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -580,7 +591,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:422 +#: ../../library/concurrent.futures.rst:430 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -588,20 +599,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:428 +#: ../../library/concurrent.futures.rst:436 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:431 -#: ../../library/concurrent.futures.rst:444 +#: ../../library/concurrent.futures.rst:439 +#: ../../library/concurrent.futures.rst:452 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:434 -#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:442 +#: ../../library/concurrent.futures.rst:455 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -609,18 +620,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:441 +#: ../../library/concurrent.futures.rst:449 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:453 +#: ../../library/concurrent.futures.rst:461 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:457 +#: ../../library/concurrent.futures.rst:465 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -636,7 +647,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:473 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -645,33 +656,33 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:469 +#: ../../library/concurrent.futures.rst:477 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:475 +#: ../../library/concurrent.futures.rst:483 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:475 +#: ../../library/concurrent.futures.rst:483 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:477 +#: ../../library/concurrent.futures.rst:485 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/concurrent.futures.rst:477 +#: ../../library/concurrent.futures.rst:485 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:480 +#: ../../library/concurrent.futures.rst:488 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/concurrent.futures.rst:480 +#: ../../library/concurrent.futures.rst:488 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:" @@ -680,15 +691,15 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:486 +#: ../../library/concurrent.futures.rst:494 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/concurrent.futures.rst:486 +#: ../../library/concurrent.futures.rst:494 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:492 +#: ../../library/concurrent.futures.rst:500 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -708,36 +719,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:506 +#: ../../library/concurrent.futures.rst:514 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:506 +#: ../../library/concurrent.futures.rst:514 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:511 +#: ../../library/concurrent.futures.rst:519 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:517 +#: ../../library/concurrent.futures.rst:525 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:521 +#: ../../library/concurrent.futures.rst:529 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:526 +#: ../../library/concurrent.futures.rst:534 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:531 +#: ../../library/concurrent.futures.rst:539 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -746,13 +757,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:539 +#: ../../library/concurrent.futures.rst:547 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "當前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:548 +#: ../../library/concurrent.futures.rst:556 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " @@ -761,7 +772,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:" "`ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:558 +#: ../../library/concurrent.futures.rst:566 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/configparser.po b/library/configparser.po index 1e61a46282..2b2327006d 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -764,7 +764,7 @@ msgid "" "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:975 ../../library/configparser.rst:1260 +#: ../../library/configparser.rst:975 ../../library/configparser.rst:1238 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." @@ -1024,39 +1024,17 @@ msgid "" msgstr "" #: ../../library/configparser.rst:1215 -msgid "Use :meth:`read_file` instead." -msgstr "" - -#: ../../library/configparser.rst:1218 -msgid "" -":meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``." -msgstr "" - -#: ../../library/configparser.rst:1221 -msgid "" -"For existing code calling :meth:`readfp` with arguments which don't support " -"iteration, the following generator may be used as a wrapper around the file-" -"like object::" -msgstr "" - -#: ../../library/configparser.rst:1231 -msgid "" -"Instead of ``parser.readfp(fp)`` use ``parser." -"read_file(readline_generator(fp))``." -msgstr "" - -#: ../../library/configparser.rst:1237 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1245 +#: ../../library/configparser.rst:1223 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1255 +#: ../../library/configparser.rst:1233 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1064,27 +1042,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1265 +#: ../../library/configparser.rst:1243 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1272 +#: ../../library/configparser.rst:1250 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1276 +#: ../../library/configparser.rst:1254 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1282 +#: ../../library/configparser.rst:1260 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1094,7 +1072,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1289 +#: ../../library/configparser.rst:1267 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1102,32 +1080,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1296 +#: ../../library/configparser.rst:1274 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1300 +#: ../../library/configparser.rst:1278 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1305 +#: ../../library/configparser.rst:1283 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1310 +#: ../../library/configparser.rst:1288 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1314 +#: ../../library/configparser.rst:1292 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1321 +#: ../../library/configparser.rst:1299 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1135,58 +1113,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1329 +#: ../../library/configparser.rst:1307 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1335 +#: ../../library/configparser.rst:1313 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1341 +#: ../../library/configparser.rst:1319 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1348 +#: ../../library/configparser.rst:1326 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1354 +#: ../../library/configparser.rst:1332 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1360 +#: ../../library/configparser.rst:1338 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1366 +#: ../../library/configparser.rst:1344 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1368 +#: ../../library/configparser.rst:1346 msgid "" -"The ``filename`` attribute and :meth:`__init__` argument were renamed to " -"``source`` for consistency." +"The ``filename`` attribute and :meth:`__init__` constructor argument were " +"removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1374 +#: ../../library/configparser.rst:1351 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1375 +#: ../../library/configparser.rst:1352 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/contextlib.po b/library/contextlib.po index 4c5c7b68d8..c4a170b3f8 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,24 +253,38 @@ msgstr "" msgid "This code is equivalent to::" msgstr "" -#: ../../library/contextlib.rst:305 ../../library/contextlib.rst:345 -#: ../../library/contextlib.rst:355 ../../library/contextlib.rst:372 +#: ../../library/contextlib.rst:305 ../../library/contextlib.rst:352 +#: ../../library/contextlib.rst:362 ../../library/contextlib.rst:379 msgid "This context manager is :ref:`reentrant `." msgstr "" -#: ../../library/contextlib.rst:312 +#: ../../library/contextlib.rst:307 +msgid "" +"If the code within the :keyword:`!with` block raises an :exc:" +"`ExceptionGroup`, suppressed exceptions are removed from the group. If any " +"exceptions in the group are not suppressed, a group containing them is re-" +"raised." +msgstr "" + +#: ../../library/contextlib.rst:313 +msgid "" +"``suppress`` now supports suppressing exceptions raised as part of an :exc:" +"`ExceptionGroup`." +msgstr "" + +#: ../../library/contextlib.rst:319 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." msgstr "" -#: ../../library/contextlib.rst:315 +#: ../../library/contextlib.rst:322 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." msgstr "" -#: ../../library/contextlib.rst:318 +#: ../../library/contextlib.rst:325 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -279,17 +293,17 @@ msgid "" "`with` statement::" msgstr "" -#: ../../library/contextlib.rst:328 +#: ../../library/contextlib.rst:335 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" msgstr "" -#: ../../library/contextlib.rst:335 +#: ../../library/contextlib.rst:342 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" -#: ../../library/contextlib.rst:340 +#: ../../library/contextlib.rst:347 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -297,13 +311,13 @@ msgid "" "it is still a useful approach for many utility scripts." msgstr "" -#: ../../library/contextlib.rst:352 +#: ../../library/contextlib.rst:359 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." msgstr "" -#: ../../library/contextlib.rst:362 +#: ../../library/contextlib.rst:369 msgid "" "Non parallel-safe context manager to change the current working directory. " "As this changes a global state, the working directory, it is not suitable " @@ -313,63 +327,63 @@ msgid "" "when this context manager is active." msgstr "" -#: ../../library/contextlib.rst:369 +#: ../../library/contextlib.rst:376 msgid "" "This is a simple wrapper around :func:`~os.chdir`, it changes the current " "working directory upon entering and restores the old one on exit." msgstr "" -#: ../../library/contextlib.rst:379 +#: ../../library/contextlib.rst:386 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" -#: ../../library/contextlib.rst:381 +#: ../../library/contextlib.rst:388 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "exception handling even when used as a decorator." msgstr "" -#: ../../library/contextlib.rst:385 +#: ../../library/contextlib.rst:392 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." msgstr "" -#: ../../library/contextlib.rst:388 +#: ../../library/contextlib.rst:395 msgid "Example of ``ContextDecorator``::" msgstr "" "``ContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:401 ../../library/contextlib.rst:473 +#: ../../library/contextlib.rst:408 ../../library/contextlib.rst:480 msgid "The class can then be used like this::" msgstr "" -#: ../../library/contextlib.rst:419 +#: ../../library/contextlib.rst:426 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "" -#: ../../library/contextlib.rst:425 +#: ../../library/contextlib.rst:432 msgid "``ContextDecorator`` lets you instead write::" msgstr "" -#: ../../library/contextlib.rst:431 +#: ../../library/contextlib.rst:438 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." msgstr "" -#: ../../library/contextlib.rst:434 +#: ../../library/contextlib.rst:441 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" msgstr "" -#: ../../library/contextlib.rst:447 +#: ../../library/contextlib.rst:454 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -377,38 +391,38 @@ msgid "" "explicit :keyword:`!with` statement inside the function should be used." msgstr "" -#: ../../library/contextlib.rst:457 +#: ../../library/contextlib.rst:464 msgid "" "Similar to :class:`ContextDecorator` but only for asynchronous functions." msgstr "" -#: ../../library/contextlib.rst:459 +#: ../../library/contextlib.rst:466 msgid "Example of ``AsyncContextDecorator``::" msgstr "" "``AsyncContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:498 +#: ../../library/contextlib.rst:505 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " "are optional or otherwise driven by input data." msgstr "" -#: ../../library/contextlib.rst:502 +#: ../../library/contextlib.rst:509 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "" -#: ../../library/contextlib.rst:511 +#: ../../library/contextlib.rst:518 msgid "" "The :meth:`__enter__` method returns the :class:`ExitStack` instance, and " "performs no additional operations." msgstr "" -#: ../../library/contextlib.rst:514 +#: ../../library/contextlib.rst:521 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -416,14 +430,14 @@ msgid "" "invoked implicitly when the context stack instance is garbage collected." msgstr "" -#: ../../library/contextlib.rst:519 +#: ../../library/contextlib.rst:526 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " "correctly." msgstr "" -#: ../../library/contextlib.rst:523 +#: ../../library/contextlib.rst:530 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -433,7 +447,7 @@ msgid "" "updated state." msgstr "" -#: ../../library/contextlib.rst:530 +#: ../../library/contextlib.rst:537 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -441,74 +455,74 @@ msgid "" "in application specific ways." msgstr "" -#: ../../library/contextlib.rst:539 +#: ../../library/contextlib.rst:546 msgid "" "Enters a new context manager and adds its :meth:`__exit__` method to the " "callback stack. The return value is the result of the context manager's own :" "meth:`__enter__` method." msgstr "" -#: ../../library/contextlib.rst:543 +#: ../../library/contextlib.rst:550 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." msgstr "" -#: ../../library/contextlib.rst:546 +#: ../../library/contextlib.rst:553 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " "context manager." msgstr "" -#: ../../library/contextlib.rst:552 +#: ../../library/contextlib.rst:559 msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." msgstr "" -#: ../../library/contextlib.rst:554 +#: ../../library/contextlib.rst:561 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`__enter__` implementation with a context manager's own :meth:" "`__exit__` method." msgstr "" -#: ../../library/contextlib.rst:558 +#: ../../library/contextlib.rst:565 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`__exit__` " "method and adds it directly to the callback stack." msgstr "" -#: ../../library/contextlib.rst:562 +#: ../../library/contextlib.rst:569 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`__exit__` methods can." msgstr "" -#: ../../library/contextlib.rst:565 +#: ../../library/contextlib.rst:572 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:570 +#: ../../library/contextlib.rst:577 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "" -#: ../../library/contextlib.rst:573 +#: ../../library/contextlib.rst:580 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." msgstr "" -#: ../../library/contextlib.rst:576 +#: ../../library/contextlib.rst:583 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:581 +#: ../../library/contextlib.rst:588 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -516,76 +530,76 @@ msgid "" "at the end of a :keyword:`with` statement)." msgstr "" -#: ../../library/contextlib.rst:586 +#: ../../library/contextlib.rst:593 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" -#: ../../library/contextlib.rst:600 +#: ../../library/contextlib.rst:607 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " "registered, the arguments passed in will indicate that no exception occurred." msgstr "" -#: ../../library/contextlib.rst:607 +#: ../../library/contextlib.rst:614 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " "context managers, as well as having coroutines for cleanup logic." msgstr "" -#: ../../library/contextlib.rst:612 +#: ../../library/contextlib.rst:619 msgid "" "The :meth:`close` method is not implemented, :meth:`aclose` must be used " "instead." msgstr "" -#: ../../library/contextlib.rst:617 +#: ../../library/contextlib.rst:624 msgid "" "Similar to :meth:`enter_context` but expects an asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:620 +#: ../../library/contextlib.rst:627 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " "asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:626 +#: ../../library/contextlib.rst:633 msgid "" "Similar to :meth:`push` but expects either an asynchronous context manager " "or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:631 +#: ../../library/contextlib.rst:638 msgid "Similar to :meth:`callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:635 +#: ../../library/contextlib.rst:642 msgid "Similar to :meth:`close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:637 +#: ../../library/contextlib.rst:644 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:649 +#: ../../library/contextlib.rst:656 msgid "Examples and Recipes" msgstr "" -#: ../../library/contextlib.rst:651 +#: ../../library/contextlib.rst:658 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:656 +#: ../../library/contextlib.rst:663 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:658 +#: ../../library/contextlib.rst:665 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -595,18 +609,18 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:673 +#: ../../library/contextlib.rst:680 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:679 +#: ../../library/contextlib.rst:686 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:681 +#: ../../library/contextlib.rst:688 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -615,7 +629,7 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:696 +#: ../../library/contextlib.rst:703 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -626,29 +640,29 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:706 +#: ../../library/contextlib.rst:713 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:708 +#: ../../library/contextlib.rst:715 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:712 +#: ../../library/contextlib.rst:719 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:752 +#: ../../library/contextlib.rst:759 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "" -#: ../../library/contextlib.rst:754 +#: ../../library/contextlib.rst:761 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -656,57 +670,57 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:768 +#: ../../library/contextlib.rst:775 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:772 +#: ../../library/contextlib.rst:779 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:784 +#: ../../library/contextlib.rst:791 msgid "" "This allows the intended cleanup up behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:787 +#: ../../library/contextlib.rst:794 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:805 +#: ../../library/contextlib.rst:812 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:820 +#: ../../library/contextlib.rst:827 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:826 +#: ../../library/contextlib.rst:833 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:828 +#: ../../library/contextlib.rst:835 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:831 +#: ../../library/contextlib.rst:838 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -715,15 +729,15 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:852 +#: ../../library/contextlib.rst:859 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:858 +#: ../../library/contextlib.rst:865 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:865 +#: ../../library/contextlib.rst:872 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -731,21 +745,21 @@ msgid "" "explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:873 +#: ../../library/contextlib.rst:880 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../library/contextlib.rst:873 +#: ../../library/contextlib.rst:880 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../library/contextlib.rst:879 +#: ../../library/contextlib.rst:886 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:881 +#: ../../library/contextlib.rst:888 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -753,32 +767,32 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:887 +#: ../../library/contextlib.rst:894 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:891 +#: ../../library/contextlib.rst:898 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:895 +#: ../../library/contextlib.rst:902 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:923 +#: ../../library/contextlib.rst:930 msgid "Reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:925 +#: ../../library/contextlib.rst:932 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -786,21 +800,21 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:930 +#: ../../library/contextlib.rst:937 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " "very simple example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:949 +#: ../../library/contextlib.rst:956 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:953 +#: ../../library/contextlib.rst:960 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -808,35 +822,35 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:962 +#: ../../library/contextlib.rst:969 msgid "Reusable context managers" msgstr "" -#: ../../library/contextlib.rst:964 +#: ../../library/contextlib.rst:971 msgid "" -"Distinct from both single use and reentrant context managers are \"reusable" -"\" context managers (or, to be completely explicit, \"reusable, but not " -"reentrant\" context managers, since reentrant context managers are also " -"reusable). These context managers support being used multiple times, but " -"will fail (or otherwise not work correctly) if the specific context manager " -"instance has already been used in a containing with statement." +"Distinct from both single use and reentrant context managers are " +"\"reusable\" context managers (or, to be completely explicit, \"reusable, " +"but not reentrant\" context managers, since reentrant context managers are " +"also reusable). These context managers support being used multiple times, " +"but will fail (or otherwise not work correctly) if the specific context " +"manager instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:971 +#: ../../library/contextlib.rst:978 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:975 +#: ../../library/contextlib.rst:982 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:1006 +#: ../../library/contextlib.rst:1013 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -844,7 +858,7 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:1011 +#: ../../library/contextlib.rst:1018 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" diff --git a/library/csv.po b/library/csv.po index 5657cfc9d3..d1f8db2843 100644 --- a/library/csv.po +++ b/library/csv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,8 +97,8 @@ msgid "" "into floats)." msgstr "" -#: ../../library/csv.rst:75 ../../library/csv.rst:105 ../../library/csv.rst:176 -#: ../../library/csv.rst:212 +#: ../../library/csv.rst:75 ../../library/csv.rst:105 ../../library/csv.rst:178 +#: ../../library/csv.rst:216 msgid "A short usage example::" msgstr "" "一個簡短的用法範例:\n" @@ -191,15 +191,21 @@ msgid "" "`reader` instance." msgstr "" -#: ../../library/csv.rst:170 +#: ../../library/csv.rst:170 ../../library/csv.rst:214 +msgid "" +"If the argument passed to *fieldnames* is an iterator, it will be coerced to " +"a :class:`list`." +msgstr "" + +#: ../../library/csv.rst:172 msgid "Returned rows are now of type :class:`OrderedDict`." msgstr "" -#: ../../library/csv.rst:173 +#: ../../library/csv.rst:175 msgid "Returned rows are now of type :class:`dict`." msgstr "" -#: ../../library/csv.rst:194 +#: ../../library/csv.rst:196 msgid "" "Create an object which operates like a regular writer but maps dictionaries " "onto output rows. The *fieldnames* parameter is a :mod:`sequence " @@ -215,13 +221,13 @@ msgid "" "`writer` instance." msgstr "" -#: ../../library/csv.rst:209 +#: ../../library/csv.rst:211 msgid "" "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " "of the :class:`DictWriter` class is not optional." msgstr "" -#: ../../library/csv.rst:228 +#: ../../library/csv.rst:232 msgid "" "The :class:`Dialect` class is a container class whose attributes contain " "information for how to handle doublequotes, whitespace, delimiters, etc. Due " @@ -230,49 +236,49 @@ msgid "" "`reader` and :class:`writer` instances behave." msgstr "" -#: ../../library/csv.rst:234 +#: ../../library/csv.rst:238 msgid "" "All available :class:`Dialect` names are returned by :func:`list_dialects`, " "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" -#: ../../library/csv.rst:247 +#: ../../library/csv.rst:251 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." msgstr "" -#: ../../library/csv.rst:253 +#: ../../library/csv.rst:257 msgid "" "The :class:`excel_tab` class defines the usual properties of an Excel-" "generated TAB-delimited file. It is registered with the dialect name " "``'excel-tab'``." msgstr "" -#: ../../library/csv.rst:259 +#: ../../library/csv.rst:263 msgid "" "The :class:`unix_dialect` class defines the usual properties of a CSV file " "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " "quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" -#: ../../library/csv.rst:268 +#: ../../library/csv.rst:272 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." msgstr "" -#: ../../library/csv.rst:270 +#: ../../library/csv.rst:274 msgid "The :class:`Sniffer` class provides two methods:" msgstr "" -#: ../../library/csv.rst:274 +#: ../../library/csv.rst:278 msgid "" "Analyze the given *sample* and return a :class:`Dialect` subclass reflecting " "the parameters found. If the optional *delimiters* parameter is given, it " "is interpreted as a string containing possible valid delimiter characters." msgstr "" -#: ../../library/csv.rst:282 +#: ../../library/csv.rst:286 msgid "" "Analyze the sample text (presumed to be in CSV format) and return :const:" "`True` if the first row appears to be a series of column headers. Inspecting " @@ -280,56 +286,58 @@ msgid "" "sample contains a header:" msgstr "" -#: ../../library/csv.rst:287 +#: ../../library/csv.rst:291 msgid "the second through n-th rows contain numeric values" msgstr "" -#: ../../library/csv.rst:288 +#: ../../library/csv.rst:292 msgid "" "the second through n-th rows contain strings where at least one value's " "length differs from that of the putative header of that column." msgstr "" -#: ../../library/csv.rst:291 +#: ../../library/csv.rst:295 msgid "" "Twenty rows after the first row are sampled; if more than half of columns + " "rows meet the criteria, :const:`True` is returned." msgstr "" -#: ../../library/csv.rst:296 +#: ../../library/csv.rst:300 msgid "" "This method is a rough heuristic and may produce both false positives and " "negatives." msgstr "" -#: ../../library/csv.rst:299 +#: ../../library/csv.rst:303 msgid "An example for :class:`Sniffer` use::" msgstr "" -#: ../../library/csv.rst:308 +#: ../../library/csv.rst:312 msgid "The :mod:`csv` module defines the following constants:" msgstr "" -#: ../../library/csv.rst:312 +#: ../../library/csv.rst:316 msgid "Instructs :class:`writer` objects to quote all fields." msgstr "" -#: ../../library/csv.rst:317 +#: ../../library/csv.rst:321 msgid "" "Instructs :class:`writer` objects to only quote those fields which contain " "special characters such as *delimiter*, *quotechar* or any of the characters " "in *lineterminator*." msgstr "" -#: ../../library/csv.rst:324 +#: ../../library/csv.rst:328 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." msgstr "" -#: ../../library/csv.rst:326 -msgid "Instructs the reader to convert all non-quoted fields to type *float*." +#: ../../library/csv.rst:330 +msgid "" +"Instructs :class:`reader` objects to convert all non-quoted fields to type " +"*float*." msgstr "" -#: ../../library/csv.rst:331 +#: ../../library/csv.rst:335 msgid "" "Instructs :class:`writer` objects to never quote fields. When the current " "*delimiter* occurs in output data it is preceded by the current *escapechar* " @@ -337,25 +345,51 @@ msgid "" "if any characters that require escaping are encountered." msgstr "" -#: ../../library/csv.rst:336 +#: ../../library/csv.rst:340 msgid "" -"Instructs :class:`reader` to perform no special processing of quote " +"Instructs :class:`reader` objects to perform no special processing of quote " "characters." msgstr "" -#: ../../library/csv.rst:338 +#: ../../library/csv.rst:344 +msgid "" +"Instructs :class:`writer` objects to quote all fields which are not " +"``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " +"value is ``None`` an empty (unquoted) string is written." +msgstr "" + +#: ../../library/csv.rst:348 +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) field as " +"None and to otherwise behave as :data:`QUOTE_ALL`." +msgstr "" + +#: ../../library/csv.rst:353 +msgid "" +"Instructs :class:`writer` objects to always place quotes around fields which " +"are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " +"field value is ``None`` an empty (unquoted) string is written." +msgstr "" + +#: ../../library/csv.rst:357 +msgid "" +"Instructs :class:`reader` objects to interpret an empty (unquoted) string as " +"``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." +msgstr "" + +#: ../../library/csv.rst:360 msgid "The :mod:`csv` module defines the following exception:" msgstr "" -#: ../../library/csv.rst:343 +#: ../../library/csv.rst:365 msgid "Raised by any of the functions when an error is detected." msgstr "" -#: ../../library/csv.rst:348 +#: ../../library/csv.rst:370 msgid "Dialects and Formatting Parameters" msgstr "" -#: ../../library/csv.rst:350 +#: ../../library/csv.rst:372 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " @@ -368,16 +402,16 @@ msgid "" "attributes defined below for the :class:`Dialect` class." msgstr "" -#: ../../library/csv.rst:360 +#: ../../library/csv.rst:382 msgid "Dialects support the following attributes:" msgstr "" -#: ../../library/csv.rst:365 +#: ../../library/csv.rst:387 msgid "" "A one-character string used to separate fields. It defaults to ``','``." msgstr "" -#: ../../library/csv.rst:370 +#: ../../library/csv.rst:392 msgid "" "Controls how instances of *quotechar* appearing inside a field should " "themselves be quoted. When :const:`True`, the character is doubled. When :" @@ -385,13 +419,13 @@ msgid "" "defaults to :const:`True`." msgstr "" -#: ../../library/csv.rst:375 +#: ../../library/csv.rst:397 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" -#: ../../library/csv.rst:381 +#: ../../library/csv.rst:403 msgid "" "A one-character string used by the writer to escape the *delimiter* if " "*quoting* is set to :const:`QUOTE_NONE` and the *quotechar* if *doublequote* " @@ -400,64 +434,64 @@ msgid "" "escaping." msgstr "" -#: ../../library/csv.rst:386 +#: ../../library/csv.rst:408 msgid "An empty *escapechar* is not allowed." msgstr "" -#: ../../library/csv.rst:391 +#: ../../library/csv.rst:413 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." msgstr "" -#: ../../library/csv.rst:396 +#: ../../library/csv.rst:418 msgid "" "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " "as end-of-line, and ignores *lineterminator*. This behavior may change in " "the future." msgstr "" -#: ../../library/csv.rst:403 +#: ../../library/csv.rst:425 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or *quotechar*, or which contain new-line " "characters. It defaults to ``'\"'``." msgstr "" -#: ../../library/csv.rst:407 +#: ../../library/csv.rst:429 msgid "An empty *quotechar* is not allowed." msgstr "" -#: ../../library/csv.rst:412 +#: ../../library/csv.rst:434 msgid "" "Controls when quotes should be generated by the writer and recognised by the " "reader. It can take on any of the :const:`QUOTE_\\*` constants (see " "section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`." msgstr "" -#: ../../library/csv.rst:419 +#: ../../library/csv.rst:441 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`." msgstr "" -#: ../../library/csv.rst:425 +#: ../../library/csv.rst:447 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" -#: ../../library/csv.rst:429 +#: ../../library/csv.rst:451 msgid "Reader Objects" msgstr "" -#: ../../library/csv.rst:431 +#: ../../library/csv.rst:453 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" msgstr "" -#: ../../library/csv.rst:436 +#: ../../library/csv.rst:458 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " @@ -465,35 +499,35 @@ msgid "" "should call this as ``next(reader)``." msgstr "" -#: ../../library/csv.rst:442 +#: ../../library/csv.rst:464 msgid "Reader objects have the following public attributes:" msgstr "" -#: ../../library/csv.rst:446 +#: ../../library/csv.rst:468 msgid "A read-only description of the dialect in use by the parser." msgstr "" -#: ../../library/csv.rst:451 +#: ../../library/csv.rst:473 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." msgstr "" -#: ../../library/csv.rst:455 +#: ../../library/csv.rst:477 msgid "DictReader objects have the following public attribute:" msgstr "" -#: ../../library/csv.rst:459 +#: ../../library/csv.rst:481 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." msgstr "" -#: ../../library/csv.rst:466 +#: ../../library/csv.rst:488 msgid "Writer Objects" msgstr "" -#: ../../library/csv.rst:468 +#: ../../library/csv.rst:490 msgid "" ":class:`Writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " @@ -505,66 +539,66 @@ msgid "" "complex numbers at all)." msgstr "" -#: ../../library/csv.rst:479 +#: ../../library/csv.rst:501 msgid "" "Write the *row* parameter to the writer's file object, formatted according " "to the current :class:`Dialect`. Return the return value of the call to the " "*write* method of the underlying file object." msgstr "" -#: ../../library/csv.rst:483 +#: ../../library/csv.rst:505 msgid "Added support of arbitrary iterables." msgstr "" -#: ../../library/csv.rst:488 +#: ../../library/csv.rst:510 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " "dialect." msgstr "" -#: ../../library/csv.rst:492 +#: ../../library/csv.rst:514 msgid "Writer objects have the following public attribute:" msgstr "" -#: ../../library/csv.rst:497 +#: ../../library/csv.rst:519 msgid "A read-only description of the dialect in use by the writer." msgstr "" -#: ../../library/csv.rst:500 +#: ../../library/csv.rst:522 msgid "DictWriter objects have the following public method:" msgstr "" -#: ../../library/csv.rst:505 +#: ../../library/csv.rst:527 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" -#: ../../library/csv.rst:510 +#: ../../library/csv.rst:532 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." msgstr "" -#: ../../library/csv.rst:518 +#: ../../library/csv.rst:540 msgid "Examples" msgstr "範例" -#: ../../library/csv.rst:520 +#: ../../library/csv.rst:542 msgid "The simplest example of reading a CSV file::" msgstr "" -#: ../../library/csv.rst:528 +#: ../../library/csv.rst:550 msgid "Reading a file with an alternate format::" msgstr "" -#: ../../library/csv.rst:536 +#: ../../library/csv.rst:558 msgid "The corresponding simplest possible writing example is::" msgstr "" -#: ../../library/csv.rst:543 +#: ../../library/csv.rst:565 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into unicode using the system default encoding (see :func:" @@ -572,33 +606,33 @@ msgid "" "``encoding`` argument of open::" msgstr "" -#: ../../library/csv.rst:554 +#: ../../library/csv.rst:576 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." msgstr "" -#: ../../library/csv.rst:557 +#: ../../library/csv.rst:579 msgid "Registering a new dialect::" msgstr "" -#: ../../library/csv.rst:564 +#: ../../library/csv.rst:586 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "" -#: ../../library/csv.rst:576 +#: ../../library/csv.rst:598 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "" -#: ../../library/csv.rst:585 +#: ../../library/csv.rst:607 msgid "Footnotes" msgstr "註解" -#: ../../library/csv.rst:586 +#: ../../library/csv.rst:608 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` " diff --git a/library/ctypes.po b/library/ctypes.po index b957dddc42..5a8a4bff37 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-26 04:11+0800\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -155,37 +155,37 @@ msgstr "" #: ../../library/ctypes.rst:152 msgid "" "You can call these functions like any other Python callable. This example " -"uses the ``time()`` function, which returns system time in seconds since the " -"Unix epoch, and the ``GetModuleHandleA()`` function, which returns a win32 " -"module handle." +"uses the ``rand()`` function, which takes no arguments and returns a pseudo-" +"random integer::" msgstr "" -#: ../../library/ctypes.rst:157 +#: ../../library/ctypes.rst:158 msgid "" -"This example calls both functions with a ``NULL`` pointer (``None`` should " -"be used as the ``NULL`` pointer)::" +"On Windows, you can call the ``GetModuleHandleA()`` function, which returns " +"a win32 module handle (passing ``None`` as single argument to call it with a " +"``NULL`` pointer)::" msgstr "" -#: ../../library/ctypes.rst:166 +#: ../../library/ctypes.rst:165 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" -#: ../../library/ctypes.rst:181 +#: ../../library/ctypes.rst:180 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." msgstr "" -#: ../../library/ctypes.rst:184 +#: ../../library/ctypes.rst:183 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" -#: ../../library/ctypes.rst:194 +#: ../../library/ctypes.rst:193 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -193,7 +193,7 @@ msgid "" "library calls)." msgstr "" -#: ../../library/ctypes.rst:199 +#: ../../library/ctypes.rst:198 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -204,250 +204,261 @@ msgid "" "the C type." msgstr "" -#: ../../library/ctypes.rst:206 +#: ../../library/ctypes.rst:205 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2159 +#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2198 msgid "Fundamental data types" msgstr "" -#: ../../library/ctypes.rst:215 +#: ../../library/ctypes.rst:214 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:217 msgid "ctypes type" msgstr "" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:217 msgid "C type" msgstr "" -#: ../../library/ctypes.rst:218 +#: ../../library/ctypes.rst:217 msgid "Python type" msgstr "" -#: ../../library/ctypes.rst:220 +#: ../../library/ctypes.rst:219 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:220 +#: ../../library/ctypes.rst:219 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:220 +#: ../../library/ctypes.rst:219 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:222 +#: ../../library/ctypes.rst:221 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:222 ../../library/ctypes.rst:226 +#: ../../library/ctypes.rst:221 ../../library/ctypes.rst:225 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:222 +#: ../../library/ctypes.rst:221 msgid "1-character bytes object" msgstr "" -#: ../../library/ctypes.rst:224 +#: ../../library/ctypes.rst:223 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:224 +#: ../../library/ctypes.rst:223 msgid ":c:expr:`wchar_t`" msgstr ":c:expr:`wchar_t`" -#: ../../library/ctypes.rst:224 +#: ../../library/ctypes.rst:223 msgid "1-character string" msgstr "" -#: ../../library/ctypes.rst:226 +#: ../../library/ctypes.rst:225 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:226 ../../library/ctypes.rst:228 -#: ../../library/ctypes.rst:230 ../../library/ctypes.rst:232 -#: ../../library/ctypes.rst:234 ../../library/ctypes.rst:236 -#: ../../library/ctypes.rst:238 ../../library/ctypes.rst:240 -#: ../../library/ctypes.rst:242 ../../library/ctypes.rst:244 -#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:225 ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:229 ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:233 ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:237 ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:241 ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:246 ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:251 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:227 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:227 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/ctypes.rst:230 +#: ../../library/ctypes.rst:229 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:230 +#: ../../library/ctypes.rst:229 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:231 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:231 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/ctypes.rst:234 +#: ../../library/ctypes.rst:233 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:234 +#: ../../library/ctypes.rst:233 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:235 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:235 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:238 +#: ../../library/ctypes.rst:237 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:238 +#: ../../library/ctypes.rst:237 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:239 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:239 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/ctypes.rst:242 +#: ../../library/ctypes.rst:241 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:242 +#: ../../library/ctypes.rst:241 msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" -#: ../../library/ctypes.rst:244 +#: ../../library/ctypes.rst:243 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:244 +#: ../../library/ctypes.rst:243 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:246 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:247 +#: ../../library/ctypes.rst:246 msgid ":c:expr:`size_t`" msgstr ":c:expr:`size_t`" -#: ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:248 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:248 msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" -#: ../../library/ctypes.rst:252 +#: ../../library/ctypes.rst:251 +#, fuzzy +msgid ":class:`c_time_t`" +msgstr ":class:`c_size_t`" + +#: ../../library/ctypes.rst:251 +#, fuzzy +msgid ":c:type:`time_t`" +msgstr ":c:expr:`size_t`" + +#: ../../library/ctypes.rst:253 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:252 +#: ../../library/ctypes.rst:253 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:252 ../../library/ctypes.rst:254 -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:257 msgid "float" msgstr "float" -#: ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:255 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:254 +#: ../../library/ctypes.rst:255 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:257 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:257 msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:259 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:259 msgid ":c:expr:`char *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:258 +#: ../../library/ctypes.rst:259 msgid "bytes object or ``None``" msgstr "" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:261 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:261 msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:260 +#: ../../library/ctypes.rst:261 msgid "string or ``None``" msgstr "字串或 ``None``" -#: ../../library/ctypes.rst:262 +#: ../../library/ctypes.rst:263 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:262 +#: ../../library/ctypes.rst:263 msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:262 +#: ../../library/ctypes.rst:263 msgid "int or ``None``" msgstr "" -#: ../../library/ctypes.rst:266 +#: ../../library/ctypes.rst:267 msgid "The constructor accepts any object with a truth value." msgstr "" -#: ../../library/ctypes.rst:268 +#: ../../library/ctypes.rst:269 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" msgstr "" -#: ../../library/ctypes.rst:279 +#: ../../library/ctypes.rst:280 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" -#: ../../library/ctypes.rst:291 +#: ../../library/ctypes.rst:292 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " @@ -455,7 +466,7 @@ msgid "" "Python bytes objects are immutable)::" msgstr "" -#: ../../library/ctypes.rst:311 +#: ../../library/ctypes.rst:312 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -465,7 +476,7 @@ msgid "" "``value`` property::" msgstr "" -#: ../../library/ctypes.rst:335 +#: ../../library/ctypes.rst:336 msgid "" "The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " "function (which is still available as an alias). To create a mutable memory " @@ -473,29 +484,29 @@ msgid "" "the :func:`create_unicode_buffer` function." msgstr "" -#: ../../library/ctypes.rst:344 +#: ../../library/ctypes.rst:345 msgid "Calling functions, continued" msgstr "" -#: ../../library/ctypes.rst:346 +#: ../../library/ctypes.rst:347 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " "from within *IDLE* or *PythonWin*::" msgstr "" -#: ../../library/ctypes.rst:366 +#: ../../library/ctypes.rst:367 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" -#: ../../library/ctypes.rst:378 +#: ../../library/ctypes.rst:379 msgid "Calling variadic functions" msgstr "" -#: ../../library/ctypes.rst:380 +#: ../../library/ctypes.rst:381 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -504,23 +515,23 @@ msgid "" "functions." msgstr "" -#: ../../library/ctypes.rst:385 +#: ../../library/ctypes.rst:386 msgid "" "On those platforms it is required to specify the *argtypes* attribute for " "the regular, non-variadic, function arguments:" msgstr "" -#: ../../library/ctypes.rst:392 +#: ../../library/ctypes.rst:393 msgid "" "Because specifying the attribute does not inhibit portability it is advised " "to always specify ``argtypes`` for all variadic functions." msgstr "" -#: ../../library/ctypes.rst:399 +#: ../../library/ctypes.rst:400 msgid "Calling functions with your own custom data types" msgstr "" -#: ../../library/ctypes.rst:401 +#: ../../library/ctypes.rst:402 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " "of your own classes be used as function arguments. :mod:`ctypes` looks for " @@ -528,24 +539,24 @@ msgid "" "Of course, it must be one of integer, string, or bytes::" msgstr "" -#: ../../library/ctypes.rst:416 +#: ../../library/ctypes.rst:417 msgid "" "If you don't want to store the instance's data in the :attr:`_as_parameter_` " "instance variable, you could define a :class:`property` which makes the " "attribute available on request." msgstr "" -#: ../../library/ctypes.rst:424 +#: ../../library/ctypes.rst:425 msgid "Specifying the required argument types (function prototypes)" msgstr "" -#: ../../library/ctypes.rst:426 +#: ../../library/ctypes.rst:427 msgid "" "It is possible to specify the required argument types of functions exported " "from DLLs by setting the :attr:`argtypes` attribute." msgstr "" -#: ../../library/ctypes.rst:429 +#: ../../library/ctypes.rst:430 msgid "" ":attr:`argtypes` must be a sequence of C data types (the ``printf`` function " "is probably not a good example here, because it takes a variable number and " @@ -553,14 +564,14 @@ msgid "" "hand this is quite handy to experiment with this feature)::" msgstr "" -#: ../../library/ctypes.rst:440 +#: ../../library/ctypes.rst:441 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " "types::" msgstr "" -#: ../../library/ctypes.rst:452 +#: ../../library/ctypes.rst:453 msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`from_param` class method for them to be able to " @@ -573,31 +584,48 @@ msgid "" "an object with an :attr:`_as_parameter_` attribute." msgstr "" -#: ../../library/ctypes.rst:466 +#: ../../library/ctypes.rst:467 msgid "Return types" msgstr "" -#: ../../library/ctypes.rst:468 +#: ../../library/ctypes.rst:477 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " "return types can be specified by setting the :attr:`restype` attribute of " "the function object." msgstr "" -#: ../../library/ctypes.rst:472 +#: ../../library/ctypes.rst:481 +msgid "" +"The C prototype of ``time()`` is ``time_t time(time_t *)``. Because " +"``time_t`` might be of a different type than the default return type " +"``int``, you should specify the ``restype``::" +msgstr "" + +#: ../../library/ctypes.rst:487 +msgid "The argument types can be specified using ``argtypes``::" +msgstr "" + +#: ../../library/ctypes.rst:491 +msgid "" +"To call the function with a ``NULL`` pointer as first argument, use " +"``None``::" +msgstr "" + +#: ../../library/ctypes.rst:496 msgid "" "Here is a more advanced example, it uses the ``strchr`` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" -#: ../../library/ctypes.rst:485 +#: ../../library/ctypes.rst:509 msgid "" "If you want to avoid the ``ord(\"x\")`` calls above, you can set the :attr:" "`argtypes` attribute, and the second argument will be converted from a " -"single character Python bytes object into a C char::" +"single character Python bytes object into a C char:" msgstr "" -#: ../../library/ctypes.rst:503 +#: ../../library/ctypes.rst:528 msgid "" "You can also use a callable Python object (a function or a class for " "example) as the :attr:`restype` attribute, if the foreign function returns " @@ -607,7 +635,7 @@ msgid "" "automatically raise an exception::" msgstr "" -#: ../../library/ctypes.rst:526 +#: ../../library/ctypes.rst:551 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -615,17 +643,17 @@ msgid "" "used, it calls :func:`GetLastError` to retrieve it." msgstr "" -#: ../../library/ctypes.rst:531 +#: ../../library/ctypes.rst:556 msgid "" "Please note that a much more powerful error checking mechanism is available " "through the :attr:`errcheck` attribute; see the reference manual for details." msgstr "" -#: ../../library/ctypes.rst:538 +#: ../../library/ctypes.rst:563 msgid "Passing pointers (or: passing parameters by reference)" msgstr "" -#: ../../library/ctypes.rst:540 +#: ../../library/ctypes.rst:565 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -633,7 +661,7 @@ msgid "" "reference*." msgstr "" -#: ../../library/ctypes.rst:544 +#: ../../library/ctypes.rst:569 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -642,11 +670,11 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" -#: ../../library/ctypes.rst:566 +#: ../../library/ctypes.rst:591 msgid "Structures and unions" msgstr "" -#: ../../library/ctypes.rst:568 +#: ../../library/ctypes.rst:593 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " @@ -654,44 +682,44 @@ msgid "" "a list of *2-tuples*, containing a *field name* and a *field type*." msgstr "" -#: ../../library/ctypes.rst:573 +#: ../../library/ctypes.rst:598 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." msgstr "" -#: ../../library/ctypes.rst:576 +#: ../../library/ctypes.rst:601 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " "constructor::" msgstr "" -#: ../../library/ctypes.rst:596 +#: ../../library/ctypes.rst:621 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." msgstr "" -#: ../../library/ctypes.rst:599 +#: ../../library/ctypes.rst:624 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" msgstr "" -#: ../../library/ctypes.rst:613 +#: ../../library/ctypes.rst:638 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" -#: ../../library/ctypes.rst:618 +#: ../../library/ctypes.rst:643 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information::" msgstr "" -#: ../../library/ctypes.rst:632 +#: ../../library/ctypes.rst:657 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -699,11 +727,11 @@ msgid "" "structures with bit-fields should always be passed to functions by pointer." msgstr "" -#: ../../library/ctypes.rst:638 +#: ../../library/ctypes.rst:663 msgid "Structure/union alignment and byte order" msgstr "" -#: ../../library/ctypes.rst:640 +#: ../../library/ctypes.rst:665 msgid "" "By default, Structure and Union fields are aligned in the same way the C " "compiler does it. It is possible to override this behavior by specifying a :" @@ -712,7 +740,7 @@ msgid "" "This is what ``#pragma pack(n)`` also does in MSVC." msgstr "" -#: ../../library/ctypes.rst:646 +#: ../../library/ctypes.rst:671 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -721,91 +749,91 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:656 +#: ../../library/ctypes.rst:681 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:658 +#: ../../library/ctypes.rst:683 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`_fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:676 +#: ../../library/ctypes.rst:701 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:678 +#: ../../library/ctypes.rst:703 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:680 +#: ../../library/ctypes.rst:705 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:685 +#: ../../library/ctypes.rst:710 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:701 +#: ../../library/ctypes.rst:726 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:707 +#: ../../library/ctypes.rst:732 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:710 +#: ../../library/ctypes.rst:735 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:726 +#: ../../library/ctypes.rst:751 msgid "Pointers" msgstr "" -#: ../../library/ctypes.rst:728 +#: ../../library/ctypes.rst:753 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:736 +#: ../../library/ctypes.rst:761 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:743 +#: ../../library/ctypes.rst:768 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:752 +#: ../../library/ctypes.rst:777 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:764 +#: ../../library/ctypes.rst:789 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:770 +#: ../../library/ctypes.rst:795 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:779 +#: ../../library/ctypes.rst:804 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -814,7 +842,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:785 +#: ../../library/ctypes.rst:810 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -822,23 +850,23 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:801 +#: ../../library/ctypes.rst:826 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:809 +#: ../../library/ctypes.rst:834 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:828 +#: ../../library/ctypes.rst:853 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:830 +#: ../../library/ctypes.rst:855 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type " @@ -849,7 +877,7 @@ msgid "" "accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:851 +#: ../../library/ctypes.rst:876 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the " @@ -857,11 +885,11 @@ msgid "" "will apply the required :func:`byref` conversion in this case automatically." msgstr "" -#: ../../library/ctypes.rst:856 +#: ../../library/ctypes.rst:881 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:863 +#: ../../library/ctypes.rst:888 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -870,11 +898,11 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:875 +#: ../../library/ctypes.rst:900 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:877 +#: ../../library/ctypes.rst:902 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -883,60 +911,60 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:888 +#: ../../library/ctypes.rst:913 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:901 +#: ../../library/ctypes.rst:926 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:903 +#: ../../library/ctypes.rst:928 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:914 +#: ../../library/ctypes.rst:939 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:927 +#: ../../library/ctypes.rst:952 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" "`_fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:939 +#: ../../library/ctypes.rst:964 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:960 +#: ../../library/ctypes.rst:985 msgid "Callback functions" msgstr "" -#: ../../library/ctypes.rst:962 +#: ../../library/ctypes.rst:987 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:965 +#: ../../library/ctypes.rst:990 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:969 +#: ../../library/ctypes.rst:994 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -944,21 +972,21 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:974 +#: ../../library/ctypes.rst:999 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:978 +#: ../../library/ctypes.rst:1003 msgid "" "I will present an example here which uses the standard C library's :c:func:" "`qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:988 +#: ../../library/ctypes.rst:1013 msgid "" ":func:`qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -968,44 +996,44 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:994 +#: ../../library/ctypes.rst:1019 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:1000 +#: ../../library/ctypes.rst:1025 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1010 +#: ../../library/ctypes.rst:1035 msgid "The result::" msgstr "" -#: ../../library/ctypes.rst:1020 +#: ../../library/ctypes.rst:1045 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1035 +#: ../../library/ctypes.rst:1060 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1042 +#: ../../library/ctypes.rst:1067 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1060 +#: ../../library/ctypes.rst:1085 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1064 +#: ../../library/ctypes.rst:1089 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1015,43 +1043,42 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1074 +#: ../../library/ctypes.rst:1099 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1076 +#: ../../library/ctypes.rst:1101 msgid "" "Some shared libraries not only export functions, they also export variables. " -"An example in the Python library itself is the :c:data:`Py_OptimizeFlag`, an " -"integer set to 0, 1, or 2, depending on the :option:`-O` or :option:`-OO` " -"flag given on startup." +"An example in the Python library itself is the :c:data:`Py_Version`, Python " +"runtime version number encoded in a single constant integer." msgstr "" -#: ../../library/ctypes.rst:1081 +#: ../../library/ctypes.rst:1105 msgid "" ":mod:`ctypes` can access values like this with the :meth:`in_dll` class " "methods of the type. *pythonapi* is a predefined symbol giving access to " "the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1090 +#: ../../library/ctypes.rst:1113 msgid "" "If the interpreter would have been started with :option:`-O`, the sample " "would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " "have been specified." msgstr "" -#: ../../library/ctypes.rst:1094 +#: ../../library/ctypes.rst:1117 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1097 +#: ../../library/ctypes.rst:1120 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1099 +#: ../../library/ctypes.rst:1122 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1060,19 +1087,19 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1104 +#: ../../library/ctypes.rst:1127 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1118 +#: ../../library/ctypes.rst:1141 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1125 +#: ../../library/ctypes.rst:1148 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1081,34 +1108,34 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1141 +#: ../../library/ctypes.rst:1164 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1149 +#: ../../library/ctypes.rst:1172 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1151 +#: ../../library/ctypes.rst:1174 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1154 +#: ../../library/ctypes.rst:1177 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1174 +#: ../../library/ctypes.rst:1197 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1182 +#: ../../library/ctypes.rst:1205 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1117,26 +1144,26 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1188 +#: ../../library/ctypes.rst:1211 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1192 +#: ../../library/ctypes.rst:1215 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1204 +#: ../../library/ctypes.rst:1227 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1207 +#: ../../library/ctypes.rst:1230 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1145,16 +1172,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1217 +#: ../../library/ctypes.rst:1240 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1219 +#: ../../library/ctypes.rst:1242 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1221 +#: ../../library/ctypes.rst:1244 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1163,35 +1190,35 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1241 +#: ../../library/ctypes.rst:1264 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1253 +#: ../../library/ctypes.rst:1276 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1261 +#: ../../library/ctypes.rst:1284 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1267 +#: ../../library/ctypes.rst:1290 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1269 +#: ../../library/ctypes.rst:1292 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1272 +#: ../../library/ctypes.rst:1295 msgid "" "The purpose of the :func:`find_library` function is to locate a library in a " "way similar to what the compiler or runtime loader does (on platforms with " @@ -1200,13 +1227,13 @@ msgid "" "the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1278 +#: ../../library/ctypes.rst:1301 msgid "" "The :mod:`ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1286 +#: ../../library/ctypes.rst:1309 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 " @@ -1214,45 +1241,45 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1291 ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1314 ../../library/ctypes.rst:1973 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1293 +#: ../../library/ctypes.rst:1316 msgid "" "On Linux, :func:`find_library` tries to run external programs (``/sbin/" "ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " "returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1297 +#: ../../library/ctypes.rst:1320 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1301 +#: ../../library/ctypes.rst:1324 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../library/ctypes.rst:1312 +#: ../../library/ctypes.rst:1335 msgid "" "On macOS, :func:`find_library` tries several predefined naming schemes and " "paths to locate the library, and returns a full pathname if successful::" msgstr "" -#: ../../library/ctypes.rst:1326 +#: ../../library/ctypes.rst:1349 msgid "" "On Windows, :func:`find_library` searches along the system search path, and " "returns the full pathname, but since there is no predefined naming scheme a " "call like ``find_library(\"c\")`` will fail and return ``None``." msgstr "" -#: ../../library/ctypes.rst:1330 +#: ../../library/ctypes.rst:1353 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -1260,24 +1287,24 @@ msgid "" "library at runtime." msgstr "" -#: ../../library/ctypes.rst:1338 +#: ../../library/ctypes.rst:1361 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1340 +#: ../../library/ctypes.rst:1363 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1346 +#: ../../library/ctypes.rst:1369 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1350 +#: ../../library/ctypes.rst:1373 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -1289,13 +1316,18 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1362 +#: ../../library/ctypes.rst:1385 ../../library/ctypes.rst:1407 +#: ../../library/ctypes.rst:1418 ../../library/ctypes.rst:1435 +msgid "The *name* parameter can now be a :term:`path-like object`." +msgstr "" + +#: ../../library/ctypes.rst:1389 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1368 +#: ../../library/ctypes.rst:1395 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1305,24 +1337,24 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1375 +#: ../../library/ctypes.rst:1402 msgid ":exc:`WindowsError` used to be raised." msgstr "" -#: ../../library/ctypes.rst:1381 +#: ../../library/ctypes.rst:1412 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1385 +#: ../../library/ctypes.rst:1420 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1391 +#: ../../library/ctypes.rst:1426 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 " @@ -1330,11 +1362,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1396 +#: ../../library/ctypes.rst:1431 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1398 +#: ../../library/ctypes.rst:1437 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 " @@ -1344,7 +1376,7 @@ msgid "" "to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1405 +#: ../../library/ctypes.rst:1444 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 " @@ -1352,7 +1384,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1410 +#: ../../library/ctypes.rst:1449 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:" @@ -1362,14 +1394,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1417 +#: ../../library/ctypes.rst:1456 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:1421 +#: ../../library/ctypes.rst:1460 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 :" @@ -1378,39 +1410,39 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1427 +#: ../../library/ctypes.rst:1466 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 " "Win32 API ``LoadLibraryEx`` flags parameter. When omitted, the default is to " -"use the flags that result in the most secure DLL load to avoiding issues " +"use the flags that result in the most secure DLL load, which avoids issues " "such as DLL hijacking. Passing the full path to the DLL is the safest way to " "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1434 +#: ../../library/ctypes.rst:1473 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1480 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:1448 +#: ../../library/ctypes.rst:1487 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:1455 +#: ../../library/ctypes.rst:1494 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:1458 +#: ../../library/ctypes.rst:1497 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 " @@ -1419,21 +1451,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1471 +#: ../../library/ctypes.rst:1510 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1477 +#: ../../library/ctypes.rst:1516 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1482 +#: ../../library/ctypes.rst:1521 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1523 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1441,52 +1473,52 @@ msgid "" "attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1492 +#: ../../library/ctypes.rst:1531 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:1495 +#: ../../library/ctypes.rst:1534 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:1501 +#: ../../library/ctypes.rst:1540 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:1505 +#: ../../library/ctypes.rst:1544 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1510 +#: ../../library/ctypes.rst:1549 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1516 +#: ../../library/ctypes.rst:1555 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1522 +#: ../../library/ctypes.rst:1561 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1528 +#: ../../library/ctypes.rst:1567 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1531 +#: ../../library/ctypes.rst:1570 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1537 +#: ../../library/ctypes.rst:1576 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:expr:" @@ -1494,21 +1526,21 @@ msgid "" "correct :attr:`restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1542 +#: ../../library/ctypes.rst:1581 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1544 +#: ../../library/ctypes.rst:1583 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:1548 +#: ../../library/ctypes.rst:1587 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1517,14 +1549,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1550 +#: ../../library/ctypes.rst:1589 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:1554 +#: ../../library/ctypes.rst:1593 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1533,18 +1565,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1556 +#: ../../library/ctypes.rst:1595 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:1563 +#: ../../library/ctypes.rst:1602 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1565 +#: ../../library/ctypes.rst:1604 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1553,29 +1585,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1613 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1576 +#: ../../library/ctypes.rst:1615 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1618 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1584 +#: ../../library/ctypes.rst:1623 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1587 +#: ../../library/ctypes.rst:1626 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:expr:`int`, and the " @@ -1585,7 +1617,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1596 +#: ../../library/ctypes.rst:1635 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1594,7 +1626,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1602 +#: ../../library/ctypes.rst:1641 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, " @@ -1604,7 +1636,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1609 +#: ../../library/ctypes.rst:1648 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 " @@ -1612,62 +1644,62 @@ msgid "" "adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1616 +#: ../../library/ctypes.rst:1655 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:1623 +#: ../../library/ctypes.rst:1662 msgid "" "*result* is what the foreign function returns, as specified by the :attr:" "`restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1665 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:1630 +#: ../../library/ctypes.rst:1669 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:1634 +#: ../../library/ctypes.rst:1673 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:1641 +#: ../../library/ctypes.rst:1680 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1645 +#: ../../library/ctypes.rst:1684 #, fuzzy msgid "" -"Raises an :ref:`auditing event ` ``ctypes.seh_exception`` with " +"Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " "argument ``code``." msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "seh_exception``。" -#: ../../library/ctypes.rst:1647 +#: ../../library/ctypes.rst:1686 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 " "a suitable Python exception. Further, an auditing event ``ctypes." -"seh_exception`` with argument ``code`` will be raised, allowing an audit " +"set_exception`` with argument ``code`` will be raised, allowing an audit " "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1653 +#: ../../library/ctypes.rst:1692 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1676,18 +1708,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1655 +#: ../../library/ctypes.rst:1694 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:1661 +#: ../../library/ctypes.rst:1700 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1663 +#: ../../library/ctypes.rst:1702 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1698,7 +1730,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1674 +#: ../../library/ctypes.rst:1713 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1707,37 +1739,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1684 +#: ../../library/ctypes.rst:1723 msgid "" "Windows only: The returned function prototype creates functions that use the " "``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:1692 +#: ../../library/ctypes.rst:1731 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:1695 +#: ../../library/ctypes.rst:1734 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:1703 +#: ../../library/ctypes.rst:1742 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1710 +#: ../../library/ctypes.rst:1749 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1717 +#: ../../library/ctypes.rst:1756 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 " @@ -1745,7 +1777,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1766 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* " @@ -1753,85 +1785,85 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1732 +#: ../../library/ctypes.rst:1771 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:1736 +#: ../../library/ctypes.rst:1775 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1739 +#: ../../library/ctypes.rst:1778 msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." msgstr "" -#: ../../library/ctypes.rst:1741 +#: ../../library/ctypes.rst:1780 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:1744 +#: ../../library/ctypes.rst:1783 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1748 +#: ../../library/ctypes.rst:1787 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1748 +#: ../../library/ctypes.rst:1787 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1751 +#: ../../library/ctypes.rst:1790 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1751 +#: ../../library/ctypes.rst:1790 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1754 +#: ../../library/ctypes.rst:1793 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1754 +#: ../../library/ctypes.rst:1793 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1756 +#: ../../library/ctypes.rst:1795 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:1759 +#: ../../library/ctypes.rst:1798 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1761 +#: ../../library/ctypes.rst:1800 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:1772 ../../library/ctypes.rst:1795 +#: ../../library/ctypes.rst:1811 ../../library/ctypes.rst:1834 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1780 +#: ../../library/ctypes.rst:1819 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1786 +#: ../../library/ctypes.rst:1825 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1839,7 +1871,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1804 +#: ../../library/ctypes.rst:1843 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1847,7 +1879,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1809 +#: ../../library/ctypes.rst:1848 msgid "" "Output parameters can be combined with the :attr:`errcheck` protocol to do " "further output processing and error checking. The win32 ``GetWindowRect`` " @@ -1856,7 +1888,7 @@ msgid "" "call failed::" msgstr "" -#: ../../library/ctypes.rst:1822 +#: ../../library/ctypes.rst:1861 msgid "" "If the :attr:`errcheck` function returns the argument tuple it receives " "unchanged, :mod:`ctypes` continues the normal processing it does on the " @@ -1865,17 +1897,17 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1841 +#: ../../library/ctypes.rst:1880 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1845 +#: ../../library/ctypes.rst:1884 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1848 +#: ../../library/ctypes.rst:1887 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1883,30 +1915,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1853 +#: ../../library/ctypes.rst:1892 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1859 +#: ../../library/ctypes.rst:1898 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:1863 +#: ../../library/ctypes.rst:1902 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1867 +#: ../../library/ctypes.rst:1906 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:1873 +#: ../../library/ctypes.rst:1912 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* " @@ -1914,19 +1946,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1881 +#: ../../library/ctypes.rst:1920 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1923 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:1887 +#: ../../library/ctypes.rst:1926 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 " @@ -1935,7 +1967,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1892 +#: ../../library/ctypes.rst:1931 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1943,19 +1975,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1897 +#: ../../library/ctypes.rst:1936 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1900 +#: ../../library/ctypes.rst:1939 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:1903 +#: ../../library/ctypes.rst:1942 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 " @@ -1964,7 +1996,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1909 +#: ../../library/ctypes.rst:1948 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -1972,21 +2004,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1914 +#: ../../library/ctypes.rst:1953 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:1921 +#: ../../library/ctypes.rst:1960 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:1929 +#: ../../library/ctypes.rst:1968 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 " @@ -1994,94 +2026,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1940 +#: ../../library/ctypes.rst:1979 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:1944 +#: ../../library/ctypes.rst:1983 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:1951 +#: ../../library/ctypes.rst:1990 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:1958 +#: ../../library/ctypes.rst:1997 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:1964 +#: ../../library/ctypes.rst:2003 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:1967 +#: ../../library/ctypes.rst:2006 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:1971 +#: ../../library/ctypes.rst:2010 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:1974 +#: ../../library/ctypes.rst:2013 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:1978 +#: ../../library/ctypes.rst:2017 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:1985 +#: ../../library/ctypes.rst:2024 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:1992 +#: ../../library/ctypes.rst:2031 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:1999 +#: ../../library/ctypes.rst:2038 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:2002 +#: ../../library/ctypes.rst:2041 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:2008 +#: ../../library/ctypes.rst:2047 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 " @@ -2089,13 +2121,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2016 +#: ../../library/ctypes.rst:2055 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:2019 +#: ../../library/ctypes.rst:2058 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2103,14 +2135,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2024 +#: ../../library/ctypes.rst:2063 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:2028 +#: ../../library/ctypes.rst:2067 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2118,20 +2150,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2033 +#: ../../library/ctypes.rst:2072 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:2039 +#: ../../library/ctypes.rst:2078 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:2043 +#: ../../library/ctypes.rst:2082 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2139,7 +2171,7 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2048 +#: ../../library/ctypes.rst:2087 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2148,11 +2180,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2054 +#: ../../library/ctypes.rst:2093 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2060 +#: ../../library/ctypes.rst:2099 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 " @@ -2160,7 +2192,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2065 +#: ../../library/ctypes.rst:2104 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2168,11 +2200,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2071 +#: ../../library/ctypes.rst:2110 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2076 +#: ../../library/ctypes.rst:2115 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 " @@ -2182,13 +2214,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2083 +#: ../../library/ctypes.rst:2122 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:2088 +#: ../../library/ctypes.rst:2127 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2197,7 +2229,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2094 ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:2133 ../../library/ctypes.rst:2143 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2205,7 +2237,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2098 +#: ../../library/ctypes.rst:2137 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2213,13 +2245,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2108 +#: ../../library/ctypes.rst:2147 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2111 +#: ../../library/ctypes.rst:2150 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2227,13 +2259,13 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2113 +#: ../../library/ctypes.rst:2152 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2119 +#: ../../library/ctypes.rst:2158 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 " @@ -2241,25 +2273,25 @@ msgid "" "be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2124 +#: ../../library/ctypes.rst:2163 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:2130 +#: ../../library/ctypes.rst:2169 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:2134 +#: ../../library/ctypes.rst:2173 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2138 +#: ../../library/ctypes.rst:2177 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:" @@ -2267,13 +2299,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2145 +#: ../../library/ctypes.rst:2184 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2189 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. " @@ -2281,7 +2313,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2163 +#: ../../library/ctypes.rst:2202 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 " @@ -2290,11 +2322,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2169 +#: ../../library/ctypes.rst:2208 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:2212 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 " @@ -2302,7 +2334,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2178 +#: ../../library/ctypes.rst:2217 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2310,7 +2342,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2184 +#: ../../library/ctypes.rst:2223 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2319,7 +2351,7 @@ msgid "" "receive a Python bytes object, *not* a :class:`c_char_p` instance." msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2231 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 " @@ -2327,25 +2359,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2197 +#: ../../library/ctypes.rst:2236 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2201 +#: ../../library/ctypes.rst:2240 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2208 +#: ../../library/ctypes.rst:2247 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2215 +#: ../../library/ctypes.rst:2254 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2353,178 +2385,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2262 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2229 +#: ../../library/ctypes.rst:2268 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2235 +#: ../../library/ctypes.rst:2274 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2241 +#: ../../library/ctypes.rst:2280 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2248 +#: ../../library/ctypes.rst:2287 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2254 +#: ../../library/ctypes.rst:2293 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2260 +#: ../../library/ctypes.rst:2299 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2266 +#: ../../library/ctypes.rst:2305 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2272 +#: ../../library/ctypes.rst:2311 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2278 +#: ../../library/ctypes.rst:2317 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2284 +#: ../../library/ctypes.rst:2323 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2290 +#: ../../library/ctypes.rst:2329 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2295 +#: ../../library/ctypes.rst:2334 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2302 +#: ../../library/ctypes.rst:2341 +msgid "Represents the C :c:type:`time_t` datatype." +msgstr "" + +#: ../../library/ctypes.rst:2348 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2309 +#: ../../library/ctypes.rst:2355 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2316 +#: ../../library/ctypes.rst:2362 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2322 +#: ../../library/ctypes.rst:2368 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2328 +#: ../../library/ctypes.rst:2374 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2334 +#: ../../library/ctypes.rst:2380 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2340 +#: ../../library/ctypes.rst:2386 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2346 +#: ../../library/ctypes.rst:2392 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2352 +#: ../../library/ctypes.rst:2398 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2358 +#: ../../library/ctypes.rst:2404 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2364 +#: ../../library/ctypes.rst:2410 msgid "" "Represents the C :c:expr:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2371 +#: ../../library/ctypes.rst:2417 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2378 +#: ../../library/ctypes.rst:2424 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2385 +#: ../../library/ctypes.rst:2431 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:2391 +#: ../../library/ctypes.rst:2437 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2394 +#: ../../library/ctypes.rst:2440 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:" @@ -2532,41 +2568,41 @@ msgid "" "also defined." msgstr "" -#: ../../library/ctypes.rst:2402 +#: ../../library/ctypes.rst:2448 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2407 +#: ../../library/ctypes.rst:2453 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2412 +#: ../../library/ctypes.rst:2458 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2418 +#: ../../library/ctypes.rst:2464 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2424 +#: ../../library/ctypes.rst:2470 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2429 +#: ../../library/ctypes.rst:2475 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2431 +#: ../../library/ctypes.rst:2477 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2437 +#: ../../library/ctypes.rst:2483 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2439 +#: ../../library/ctypes.rst:2485 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:" @@ -2574,34 +2610,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2447 +#: ../../library/ctypes.rst:2493 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:2451 +#: ../../library/ctypes.rst:2497 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:2455 +#: ../../library/ctypes.rst:2501 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:2458 +#: ../../library/ctypes.rst:2504 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:2468 +#: ../../library/ctypes.rst:2514 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, " @@ -2609,28 +2645,29 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2519 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:2480 +#: ../../library/ctypes.rst:2526 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." +"`_fields_` is assigned, otherwise it will have no effect. Setting this " +"attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2487 +#: ../../library/ctypes.rst:2534 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:2491 +#: ../../library/ctypes.rst:2538 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 " @@ -2638,11 +2675,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2543 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2509 +#: ../../library/ctypes.rst:2556 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 " @@ -2652,7 +2689,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2521 +#: ../../library/ctypes.rst:2568 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:" @@ -2660,7 +2697,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2526 +#: ../../library/ctypes.rst:2573 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2670,15 +2707,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2537 +#: ../../library/ctypes.rst:2584 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2588 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2590 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 " @@ -2688,34 +2725,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2553 +#: ../../library/ctypes.rst:2600 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:2560 +#: ../../library/ctypes.rst:2607 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2563 +#: ../../library/ctypes.rst:2610 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2569 +#: ../../library/ctypes.rst:2616 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2571 +#: ../../library/ctypes.rst:2618 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:2575 +#: ../../library/ctypes.rst:2622 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 :" @@ -2724,11 +2761,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2585 +#: ../../library/ctypes.rst:2632 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2589 +#: ../../library/ctypes.rst:2636 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.po b/library/curses.po index c26a4aad36..910efc9ac2 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-04 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,7 +80,7 @@ msgid "" "bindings." msgstr "" -#: ../../library/curses.rst:45 +#: ../../library/curses.rst:44 msgid ":ref:`curses-howto`" msgstr ":ref:`curses-howto`" @@ -90,37 +90,30 @@ msgid "" "Raymond." msgstr "" -#: ../../library/curses.rst:47 -msgid "" -"The :source:`Tools/demo/` directory in the Python source distribution " -"contains some example programs using the curses bindings provided by this " -"module." -msgstr "" - -#: ../../library/curses.rst:54 +#: ../../library/curses.rst:51 msgid "Functions" msgstr "函式" -#: ../../library/curses.rst:56 +#: ../../library/curses.rst:53 msgid "The module :mod:`curses` defines the following exception:" msgstr "" -#: ../../library/curses.rst:61 +#: ../../library/curses.rst:58 msgid "Exception raised when a curses library function returns an error." msgstr "" -#: ../../library/curses.rst:65 +#: ../../library/curses.rst:62 msgid "" "Whenever *x* or *y* arguments to a function or a method are optional, they " "default to the current cursor location. Whenever *attr* is optional, it " "defaults to :const:`A_NORMAL`." msgstr "" -#: ../../library/curses.rst:69 +#: ../../library/curses.rst:66 msgid "The module :mod:`curses` defines the following functions:" msgstr "" -#: ../../library/curses.rst:74 +#: ../../library/curses.rst:71 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -128,17 +121,17 @@ msgid "" "and occasionally to change interfaces depending on the line speed." msgstr "" -#: ../../library/curses.rst:82 +#: ../../library/curses.rst:79 msgid "Emit a short attention sound." msgstr "" -#: ../../library/curses.rst:87 +#: ../../library/curses.rst:84 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." msgstr "" -#: ../../library/curses.rst:93 +#: ../../library/curses.rst:90 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -148,7 +141,7 @@ msgid "" "terminal in cbreak mode." msgstr "" -#: ../../library/curses.rst:102 +#: ../../library/curses.rst:99 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -157,7 +150,7 @@ msgid "" "component)." msgstr "" -#: ../../library/curses.rst:110 +#: ../../library/curses.rst:107 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -166,7 +159,7 @@ msgid "" "function." msgstr "" -#: ../../library/curses.rst:119 +#: ../../library/curses.rst:116 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -175,7 +168,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: ../../library/curses.rst:128 +#: ../../library/curses.rst:125 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -183,7 +176,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:136 +#: ../../library/curses.rst:133 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -191,11 +184,11 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:144 +#: ../../library/curses.rst:141 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: ../../library/curses.rst:149 +#: ../../library/curses.rst:146 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -203,7 +196,7 @@ msgid "" "the physical screen to match the virtual screen." msgstr "" -#: ../../library/curses.rst:154 +#: ../../library/curses.rst:151 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -214,24 +207,24 @@ msgid "" "func:`!doupdate`." msgstr "" -#: ../../library/curses.rst:164 +#: ../../library/curses.rst:161 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: ../../library/curses.rst:170 +#: ../../library/curses.rst:167 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: ../../library/curses.rst:175 +#: ../../library/curses.rst:172 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:182 +#: ../../library/curses.rst:179 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -242,20 +235,20 @@ msgid "" "time line editing without touching the rest of the screen." msgstr "" -#: ../../library/curses.rst:192 +#: ../../library/curses.rst:189 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: ../../library/curses.rst:199 +#: ../../library/curses.rst:196 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: ../../library/curses.rst:205 +#: ../../library/curses.rst:202 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -270,51 +263,51 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:216 ../../library/curses.rst:1757 +#: ../../library/curses.rst:213 ../../library/curses.rst:1754 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" -#: ../../library/curses.rst:223 +#: ../../library/curses.rst:220 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: ../../library/curses.rst:229 +#: ../../library/curses.rst:226 msgid "" "Read window related data stored in the file by an earlier :func:`window." "putwin` call. The routine then creates and initializes a new window using " "that data, returning the new window object." msgstr "" -#: ../../library/curses.rst:236 +#: ../../library/curses.rst:233 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: ../../library/curses.rst:240 +#: ../../library/curses.rst:237 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (e.g. xterm-256color)." msgstr "" -#: ../../library/curses.rst:244 +#: ../../library/curses.rst:241 msgid "Extended color support requires ncurses version 6.1 or later." msgstr "" -#: ../../library/curses.rst:250 +#: ../../library/curses.rst:247 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: ../../library/curses.rst:257 +#: ../../library/curses.rst:254 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -322,13 +315,13 @@ msgid "" "capabilities." msgstr "" -#: ../../library/curses.rst:265 +#: ../../library/curses.rst:262 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: ../../library/curses.rst:271 +#: ../../library/curses.rst:268 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -337,7 +330,7 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: ../../library/curses.rst:280 +#: ../../library/curses.rst:277 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " @@ -349,7 +342,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/curses.rst:291 +#: ../../library/curses.rst:288 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -362,31 +355,31 @@ msgid "" "definition." msgstr "" -#: ../../library/curses.rst:304 +#: ../../library/curses.rst:301 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: ../../library/curses.rst:309 +#: ../../library/curses.rst:306 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: ../../library/curses.rst:315 +#: ../../library/curses.rst:312 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: ../../library/curses.rst:321 +#: ../../library/curses.rst:318 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: ../../library/curses.rst:327 +#: ../../library/curses.rst:324 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -397,27 +390,27 @@ msgid "" "character." msgstr "" -#: ../../library/curses.rst:337 +#: ../../library/curses.rst:334 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:344 +#: ../../library/curses.rst:341 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: ../../library/curses.rst:351 +#: ../../library/curses.rst:348 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: ../../library/curses.rst:357 +#: ../../library/curses.rst:354 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -425,7 +418,7 @@ msgid "" "fifth of a second." msgstr "" -#: ../../library/curses.rst:364 +#: ../../library/curses.rst:361 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -434,17 +427,17 @@ msgid "" "never called, no mouse events are ever reported." msgstr "" -#: ../../library/curses.rst:373 +#: ../../library/curses.rst:370 msgid "Sleep for *ms* milliseconds." msgstr "" -#: ../../library/curses.rst:378 +#: ../../library/curses.rst:375 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: ../../library/curses.rst:381 +#: ../../library/curses.rst:378 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -460,35 +453,35 @@ msgid "" "to be displayed." msgstr "" -#: ../../library/curses.rst:397 +#: ../../library/curses.rst:394 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: ../../library/curses.rst:400 +#: ../../library/curses.rst:397 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: ../../library/curses.rst:406 +#: ../../library/curses.rst:403 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: ../../library/curses.rst:413 +#: ../../library/curses.rst:410 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:418 +#: ../../library/curses.rst:415 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: ../../library/curses.rst:423 +#: ../../library/curses.rst:420 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -498,7 +491,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: ../../library/curses.rst:433 +#: ../../library/curses.rst:430 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -507,63 +500,63 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: ../../library/curses.rst:441 +#: ../../library/curses.rst:438 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:446 +#: ../../library/curses.rst:443 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: ../../library/curses.rst:452 +#: ../../library/curses.rst:449 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:458 +#: ../../library/curses.rst:455 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: ../../library/curses.rst:465 +#: ../../library/curses.rst:462 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: ../../library/curses.rst:472 +#: ../../library/curses.rst:469 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: ../../library/curses.rst:479 +#: ../../library/curses.rst:476 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: ../../library/curses.rst:485 +#: ../../library/curses.rst:482 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: ../../library/curses.rst:491 +#: ../../library/curses.rst:488 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: ../../library/curses.rst:497 +#: ../../library/curses.rst:494 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -573,47 +566,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: ../../library/curses.rst:507 +#: ../../library/curses.rst:504 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: ../../library/curses.rst:514 +#: ../../library/curses.rst:511 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: ../../library/curses.rst:519 +#: ../../library/curses.rst:516 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:525 +#: ../../library/curses.rst:522 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:533 +#: ../../library/curses.rst:530 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:539 +#: ../../library/curses.rst:536 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:546 +#: ../../library/curses.rst:543 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: ../../library/curses.rst:552 +#: ../../library/curses.rst:549 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -622,14 +615,14 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: ../../library/curses.rst:561 +#: ../../library/curses.rst:558 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: ../../library/curses.rst:565 +#: ../../library/curses.rst:562 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -639,20 +632,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: ../../library/curses.rst:574 +#: ../../library/curses.rst:571 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: ../../library/curses.rst:581 +#: ../../library/curses.rst:578 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: ../../library/curses.rst:587 +#: ../../library/curses.rst:584 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -660,7 +653,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:595 +#: ../../library/curses.rst:592 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -668,7 +661,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:603 +#: ../../library/curses.rst:600 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -676,7 +669,7 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:611 +#: ../../library/curses.rst:608 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -684,13 +677,13 @@ msgid "" "exact result depending on terminal type." msgstr "" -#: ../../library/curses.rst:619 +#: ../../library/curses.rst:616 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: ../../library/curses.rst:622 +#: ../../library/curses.rst:619 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -700,7 +693,7 @@ msgid "" "typeahead checking." msgstr "" -#: ../../library/curses.rst:631 +#: ../../library/curses.rst:628 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -708,35 +701,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:638 +#: ../../library/curses.rst:635 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: ../../library/curses.rst:642 +#: ../../library/curses.rst:639 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: ../../library/curses.rst:647 +#: ../../library/curses.rst:644 msgid "" "Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " "screen resize." msgstr "" -#: ../../library/curses.rst:654 +#: ../../library/curses.rst:651 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:658 +#: ../../library/curses.rst:655 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:665 +#: ../../library/curses.rst:662 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:671 +#: ../../library/curses.rst:668 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -746,7 +739,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:681 +#: ../../library/curses.rst:678 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -755,7 +748,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: ../../library/curses.rst:690 +#: ../../library/curses.rst:687 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -769,50 +762,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:704 +#: ../../library/curses.rst:701 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:706 +#: ../../library/curses.rst:703 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:713 +#: ../../library/curses.rst:710 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:719 +#: ../../library/curses.rst:716 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:727 +#: ../../library/curses.rst:724 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:735 +#: ../../library/curses.rst:732 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:740 +#: ../../library/curses.rst:737 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:744 +#: ../../library/curses.rst:741 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -822,44 +815,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:754 +#: ../../library/curses.rst:751 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:760 +#: ../../library/curses.rst:757 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:766 +#: ../../library/curses.rst:763 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:772 +#: ../../library/curses.rst:769 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:776 +#: ../../library/curses.rst:773 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:779 +#: ../../library/curses.rst:776 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:785 +#: ../../library/curses.rst:782 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -870,128 +863,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:795 +#: ../../library/curses.rst:792 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:801 +#: ../../library/curses.rst:798 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:803 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:803 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:806 +#: ../../library/curses.rst:803 msgid "Default value" msgstr "" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:805 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:805 msgid "Left side" msgstr "" -#: ../../library/curses.rst:808 ../../library/curses.rst:810 +#: ../../library/curses.rst:805 ../../library/curses.rst:807 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:807 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:810 +#: ../../library/curses.rst:807 msgid "Right side" msgstr "" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:809 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:812 +#: ../../library/curses.rst:809 msgid "Top" msgstr "" -#: ../../library/curses.rst:812 ../../library/curses.rst:814 +#: ../../library/curses.rst:809 ../../library/curses.rst:811 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:811 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:811 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:813 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:813 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:816 +#: ../../library/curses.rst:813 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:815 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:815 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:818 +#: ../../library/curses.rst:815 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:817 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:817 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:820 +#: ../../library/curses.rst:817 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:819 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:819 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:822 +#: ../../library/curses.rst:819 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:828 +#: ../../library/curses.rst:825 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:837 +#: ../../library/curses.rst:834 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1001,45 +994,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:847 +#: ../../library/curses.rst:844 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:853 +#: ../../library/curses.rst:850 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:859 +#: ../../library/curses.rst:856 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:865 +#: ../../library/curses.rst:862 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:870 +#: ../../library/curses.rst:867 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:876 +#: ../../library/curses.rst:873 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:881 +#: ../../library/curses.rst:878 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:887 +#: ../../library/curses.rst:884 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1047,13 +1040,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:895 +#: ../../library/curses.rst:892 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:901 +#: ../../library/curses.rst:898 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1061,11 +1054,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:906 +#: ../../library/curses.rst:903 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:912 +#: ../../library/curses.rst:909 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1073,19 +1066,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:922 +#: ../../library/curses.rst:919 msgid "Clear the window." msgstr "" -#: ../../library/curses.rst:927 +#: ../../library/curses.rst:924 msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." msgstr "" -#: ../../library/curses.rst:932 +#: ../../library/curses.rst:929 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: ../../library/curses.rst:937 +#: ../../library/curses.rst:934 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1093,14 +1086,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:945 +#: ../../library/curses.rst:942 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:954 +#: ../../library/curses.rst:951 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1108,35 +1101,35 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:962 +#: ../../library/curses.rst:959 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: ../../library/curses.rst:967 +#: ../../library/curses.rst:964 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:977 +#: ../../library/curses.rst:974 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: ../../library/curses.rst:982 +#: ../../library/curses.rst:979 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:989 +#: ../../library/curses.rst:986 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:995 +#: ../../library/curses.rst:992 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1144,13 +1137,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1003 +#: ../../library/curses.rst:1000 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1009 +#: ../../library/curses.rst:1006 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1158,19 +1151,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1017 +#: ../../library/curses.rst:1014 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1024 +#: ../../library/curses.rst:1021 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1030 +#: ../../library/curses.rst:1027 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1179,13 +1172,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1039 +#: ../../library/curses.rst:1036 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1046 +#: ../../library/curses.rst:1043 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1195,7 +1188,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1056 +#: ../../library/curses.rst:1053 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1204,7 +1197,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1065 +#: ../../library/curses.rst:1062 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1212,76 +1205,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: ../../library/curses.rst:1073 +#: ../../library/curses.rst:1070 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1080 +#: ../../library/curses.rst:1077 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1086 +#: ../../library/curses.rst:1083 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1093 +#: ../../library/curses.rst:1090 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1097 +#: ../../library/curses.rst:1094 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1102 +#: ../../library/curses.rst:1099 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1107 +#: ../../library/curses.rst:1104 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1114 +#: ../../library/curses.rst:1111 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1119 +#: ../../library/curses.rst:1116 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: ../../library/curses.rst:1124 +#: ../../library/curses.rst:1121 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1126 +#: ../../library/curses.rst:1123 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1132 +#: ../../library/curses.rst:1129 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1139 +#: ../../library/curses.rst:1136 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1289,7 +1282,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1144 +#: ../../library/curses.rst:1141 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1297,7 +1290,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1152 +#: ../../library/curses.rst:1149 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1305,7 +1298,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1157 +#: ../../library/curses.rst:1154 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1313,31 +1306,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1165 +#: ../../library/curses.rst:1162 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1171 +#: ../../library/curses.rst:1168 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1177 +#: ../../library/curses.rst:1174 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1183 +#: ../../library/curses.rst:1180 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1186 +#: ../../library/curses.rst:1183 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1352,7 +1345,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1200 +#: ../../library/curses.rst:1197 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1360,11 +1353,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1208 +#: ../../library/curses.rst:1205 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1213 +#: ../../library/curses.rst:1210 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1374,54 +1367,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1223 +#: ../../library/curses.rst:1220 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1229 +#: ../../library/curses.rst:1226 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1235 +#: ../../library/curses.rst:1232 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1241 ../../library/curses.rst:1248 +#: ../../library/curses.rst:1238 ../../library/curses.rst:1245 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1251 +#: ../../library/curses.rst:1248 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1257 +#: ../../library/curses.rst:1254 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1264 +#: ../../library/curses.rst:1261 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1270 +#: ../../library/curses.rst:1267 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1276 +#: ../../library/curses.rst:1273 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1431,7 +1424,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1286 +#: ../../library/curses.rst:1283 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1439,49 +1432,49 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1293 +#: ../../library/curses.rst:1290 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1299 +#: ../../library/curses.rst:1296 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1306 +#: ../../library/curses.rst:1303 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: ../../library/curses.rst:1311 +#: ../../library/curses.rst:1308 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1313 +#: ../../library/curses.rst:1310 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: ../../library/curses.rst:1318 +#: ../../library/curses.rst:1315 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1324 +#: ../../library/curses.rst:1321 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1331 +#: ../../library/curses.rst:1328 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1336 +#: ../../library/curses.rst:1333 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1489,518 +1482,518 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1341 +#: ../../library/curses.rst:1338 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1347 +#: ../../library/curses.rst:1344 msgid "The maximum number of colors the terminal can support." msgstr "" -#: ../../library/curses.rst:1351 +#: ../../library/curses.rst:1348 msgid "The maximum number of color pairs the terminal can support." msgstr "" -#: ../../library/curses.rst:1353 +#: ../../library/curses.rst:1350 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1357 +#: ../../library/curses.rst:1354 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1357 ../../library/curses.rst:1402 -#: ../../library/curses.rst:1646 ../../library/curses.rst:1738 +#: ../../library/curses.rst:1354 ../../library/curses.rst:1399 +#: ../../library/curses.rst:1643 ../../library/curses.rst:1735 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1359 +#: ../../library/curses.rst:1356 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1361 +#: ../../library/curses.rst:1358 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1363 +#: ../../library/curses.rst:1360 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1365 +#: ../../library/curses.rst:1362 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1367 +#: ../../library/curses.rst:1364 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1369 +#: ../../library/curses.rst:1366 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1371 +#: ../../library/curses.rst:1368 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1373 +#: ../../library/curses.rst:1370 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1372 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1378 +#: ../../library/curses.rst:1375 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1380 +#: ../../library/curses.rst:1377 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1382 +#: ../../library/curses.rst:1379 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1384 +#: ../../library/curses.rst:1381 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1386 +#: ../../library/curses.rst:1383 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1388 +#: ../../library/curses.rst:1385 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1390 +#: ../../library/curses.rst:1387 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1392 +#: ../../library/curses.rst:1389 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1395 +#: ../../library/curses.rst:1392 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1398 +#: ../../library/curses.rst:1395 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1402 +#: ../../library/curses.rst:1399 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1401 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1404 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1410 +#: ../../library/curses.rst:1407 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1414 +#: ../../library/curses.rst:1411 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1417 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1417 msgid "Key" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1419 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1421 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1423 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1425 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1427 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1429 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1434 +#: ../../library/curses.rst:1431 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1436 +#: ../../library/curses.rst:1433 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1438 +#: ../../library/curses.rst:1435 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1441 +#: ../../library/curses.rst:1438 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1443 +#: ../../library/curses.rst:1440 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1445 +#: ../../library/curses.rst:1442 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1444 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1446 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1451 +#: ../../library/curses.rst:1448 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1453 +#: ../../library/curses.rst:1450 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1455 +#: ../../library/curses.rst:1452 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1457 +#: ../../library/curses.rst:1454 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1459 +#: ../../library/curses.rst:1456 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1461 +#: ../../library/curses.rst:1458 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1463 +#: ../../library/curses.rst:1460 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1465 +#: ../../library/curses.rst:1462 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1467 +#: ../../library/curses.rst:1464 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1469 +#: ../../library/curses.rst:1466 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1471 +#: ../../library/curses.rst:1468 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1473 +#: ../../library/curses.rst:1470 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1475 +#: ../../library/curses.rst:1472 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1477 +#: ../../library/curses.rst:1474 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1476 msgid "Print" msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1478 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1480 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1482 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1484 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1486 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1488 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1490 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1492 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1494 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1496 msgid "Close" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1498 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1500 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1502 msgid "Create" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1504 msgid "End" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1506 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1508 msgid "Find" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1510 msgid "Help" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1512 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1514 msgid "Message" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1516 msgid "Move" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1518 msgid "Next" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1520 msgid "Open" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1522 msgid "Options" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1524 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1526 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1528 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1530 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1532 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1534 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1536 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1538 msgid "Save" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1540 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1542 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1544 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1546 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1548 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1550 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1552 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1554 msgid "Select" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1556 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1558 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1560 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1562 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1564 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1566 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1568 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1570 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1572 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1574 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1576 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1578 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1580 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1582 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1584 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1586 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1588 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1590 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1592 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1594 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1596 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1598 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1600 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1602 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1607 +#: ../../library/curses.rst:1604 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1606 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1612 +#: ../../library/curses.rst:1609 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2012,64 +2005,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1618 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1621 ../../library/curses.rst:1764 -#: ../../library/curses.rst:1888 +#: ../../library/curses.rst:1618 ../../library/curses.rst:1761 +#: ../../library/curses.rst:1885 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1620 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1620 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1622 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1622 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1624 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1624 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1626 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1626 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1628 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1628 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1630 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1630 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1636 +#: ../../library/curses.rst:1633 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2077,268 +2070,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1640 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1646 +#: ../../library/curses.rst:1643 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1648 +#: ../../library/curses.rst:1645 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1647 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1649 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1651 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1656 +#: ../../library/curses.rst:1653 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1655 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1660 +#: ../../library/curses.rst:1657 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1662 +#: ../../library/curses.rst:1659 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1664 +#: ../../library/curses.rst:1661 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1666 +#: ../../library/curses.rst:1663 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1668 +#: ../../library/curses.rst:1665 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1670 +#: ../../library/curses.rst:1667 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1672 +#: ../../library/curses.rst:1669 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1674 +#: ../../library/curses.rst:1671 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1673 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1675 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1677 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1682 +#: ../../library/curses.rst:1679 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1684 +#: ../../library/curses.rst:1681 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1683 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1685 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1687 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1689 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1691 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1693 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1695 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1697 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1699 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1701 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1703 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1705 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1707 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1709 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1711 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1713 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1715 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1717 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1719 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1721 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1723 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1728 +#: ../../library/curses.rst:1725 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1727 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1729 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1735 +#: ../../library/curses.rst:1732 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1735 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1737 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1739 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1741 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1743 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1745 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1747 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1752 ../../library/curses.rst:1754 +#: ../../library/curses.rst:1749 ../../library/curses.rst:1751 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1758 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1764 +#: ../../library/curses.rst:1761 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1766 +#: ../../library/curses.rst:1763 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1768 +#: ../../library/curses.rst:1765 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1767 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1772 +#: ../../library/curses.rst:1769 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1774 +#: ../../library/curses.rst:1771 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1776 +#: ../../library/curses.rst:1773 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1778 +#: ../../library/curses.rst:1775 msgid "White" msgstr "白" -#: ../../library/curses.rst:1780 +#: ../../library/curses.rst:1777 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1782 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1793 +#: ../../library/curses.rst:1790 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2348,11 +2341,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1799 +#: ../../library/curses.rst:1796 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1804 +#: ../../library/curses.rst:1801 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2364,15 +2357,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1817 +#: ../../library/curses.rst:1814 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1819 +#: ../../library/curses.rst:1816 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1824 +#: ../../library/curses.rst:1821 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2381,11 +2374,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1830 +#: ../../library/curses.rst:1827 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1832 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2396,167 +2389,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1846 +#: ../../library/curses.rst:1843 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1850 ../../library/curses.rst:1888 +#: ../../library/curses.rst:1847 ../../library/curses.rst:1885 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1850 +#: ../../library/curses.rst:1847 msgid "Action" msgstr "" -#: ../../library/curses.rst:1852 +#: ../../library/curses.rst:1849 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1852 +#: ../../library/curses.rst:1849 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1854 ../../library/curses.rst:1890 +#: ../../library/curses.rst:1851 ../../library/curses.rst:1887 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1851 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1857 +#: ../../library/curses.rst:1854 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1857 +#: ../../library/curses.rst:1854 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1856 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1856 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1862 ../../library/curses.rst:1892 +#: ../../library/curses.rst:1859 ../../library/curses.rst:1889 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1859 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1862 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1862 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1864 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1864 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1866 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1866 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1869 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1869 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1872 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1872 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1877 ../../library/curses.rst:1896 +#: ../../library/curses.rst:1874 ../../library/curses.rst:1893 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1877 +#: ../../library/curses.rst:1874 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1876 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1876 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1881 ../../library/curses.rst:1894 +#: ../../library/curses.rst:1878 ../../library/curses.rst:1891 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1881 +#: ../../library/curses.rst:1878 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1884 +#: ../../library/curses.rst:1881 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1887 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1889 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1891 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1893 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1895 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1895 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1898 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1904 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1910 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/dataclasses.po b/library/dataclasses.po index a8a4db9d6b..c719cb5248 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -672,6 +672,12 @@ msgstr "" "``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中的含義相同。" #: ../../library/dataclasses.rst:404 +msgid "" +"If ``module`` is defined, the ``__module__`` attribute of the dataclass is " +"set to that value. By default, it is set to the module name of the caller." +msgstr "" + +#: ../../library/dataclasses.rst:408 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -683,12 +689,12 @@ msgstr "" "制都可以應用 :func:`dataclass` 函式將該類轉換為資料類。提供此功能是為了方便。" "例如::" -#: ../../library/dataclasses.rst:416 +#: ../../library/dataclasses.rst:420 #, fuzzy msgid "Is equivalent to::" msgstr "相當於::" -#: ../../library/dataclasses.rst:429 +#: ../../library/dataclasses.rst:433 #, fuzzy msgid "" "Creates a new object of the same type as ``obj``, replacing fields with " @@ -700,27 +706,27 @@ msgstr "" "``obj`` 不是資料類,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定欄" "位,則引發:exc:`TypeError`。" -#: ../../library/dataclasses.rst:434 +#: ../../library/dataclasses.rst:438 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " -"method of the dataclass. This ensures that :ref:`__post_init__ `, if present, is also called." +"method of the dataclass. This ensures that :meth:`__post_init__`, if " +"present, is also called." msgstr "" "新回傳的對像是通過呼叫資料類的 :meth:`__init__` 方法建立的。這確保 :meth:" "`__post_init__`(如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:438 +#: ../../library/dataclasses.rst:442 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`replace` so that they can be passed to :meth:`~object." -"__init__` and :ref:`__post_init__ `." +"__init__` and :meth:`__post_init__`." msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:442 +#: ../../library/dataclasses.rst:446 #, fuzzy msgid "" "It is an error for ``changes`` to contain any fields that are defined as " @@ -729,16 +735,16 @@ msgstr "" "``changes`` 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將" "引發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:446 +#: ../../library/dataclasses.rst:450 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" "`replace`. They are not copied from the source object, but rather are " -"initialized in :ref:`__post_init__ `, if they're " -"initialized at all. It is expected that ``init=False`` fields will be " -"rarely and judiciously used. If they are used, it might be wise to have " -"alternate class constructors, or perhaps a custom ``replace()`` (or " -"similarly named) method which handles instance copying." +"initialized in :meth:`__post_init__`, if they're initialized at all. It is " +"expected that ``init=False`` fields will be rarely and judiciously used. If " +"they are used, it might be wise to have alternate class constructors, or " +"perhaps a custom ``replace()`` (or similarly named) method which handles " +"instance copying." msgstr "" "預先警告 ``init=False`` 欄位在呼叫 :func:`replace` 期間是如何工作的。它們不是" "從源物件複製的,而是在 :meth:`__post_init__` 中初始化的,如果它們被初始化的" @@ -746,14 +752,14 @@ msgstr "" "造函式可能是明智的,或者可能是處理實例複製的自定義“replace()”(或類似命名的)" "方法。" -#: ../../library/dataclasses.rst:457 +#: ../../library/dataclasses.rst:461 #, fuzzy msgid "" "Return ``True`` if its parameter is a dataclass or an instance of one, " "otherwise return ``False``." msgstr "如果它的參數是一個資料類或一個實例,則回傳“True”,否則回傳“False”。" -#: ../../library/dataclasses.rst:460 +#: ../../library/dataclasses.rst:464 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -763,12 +769,12 @@ msgstr "" "如果你需要知道一個類是否是資料類的實例(而不是資料類本身),那麼新增一個進一" "步的檢查``not isinstance(obj, type)``::" -#: ../../library/dataclasses.rst:469 +#: ../../library/dataclasses.rst:473 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少預設值或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:473 +#: ../../library/dataclasses.rst:477 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -784,21 +790,21 @@ msgstr "" "例,名稱 _ 用於 :const: `KW_ONLY` 欄位。僅關鍵字欄位表示 :meth:`__init__` 參" "數,在實例化類時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:482 +#: ../../library/dataclasses.rst:486 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位::" -#: ../../library/dataclasses.rst:493 +#: ../../library/dataclasses.rst:497 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`KW_ONLY`." msgstr "在單個資料類中,指定多個型別為 KW_ONLY 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:500 +#: ../../library/dataclasses.rst:504 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -808,21 +814,19 @@ msgstr "" "當在使用 frozen=True 定義的資料類上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:507 +#: ../../library/dataclasses.rst:511 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:509 +#: ../../library/dataclasses.rst:515 #, fuzzy msgid "" -"The generated :meth:`~object.__init__` code will call a method named :meth:`!" -"__post_init__`, if :meth:`!__post_init__` is defined on the class. It will " -"normally be called as ``self.__post_init__()``. However, if any ``InitVar`` " -"fields are defined, they will also be passed to :meth:`!__post_init__` in " -"the order they were defined in the class. If no :meth:`~object.__init__` " -"method is generated, then :meth:`!__post_init__` will not automatically be " -"called." +"When defined on the class, it will be called by the generated :meth:`~object." +"__init__`, normally as ``self.__post_init__()``. However, if any ``InitVar`` " +"fields are defined, they will also be passed to :meth:`__post_init__` in the " +"order they were defined in the class. If no :meth:`~object.__init__` method " +"is generated, then :meth:`__post_init__` will not automatically be called." msgstr "" "生成的 :meth:`__init__` 程式碼將呼叫一個名為 :meth:`__post_init__` 的方法,如" "果 :meth:`__post_init__` 是在類上定義的。它通常被稱為 ``self." @@ -830,7 +834,7 @@ msgstr "" "類中定義的順序傳遞給 :meth:`__post_init__` 。如果沒有生成 :meth:`__init__` 方" "法,那麼 :meth:`__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:517 +#: ../../library/dataclasses.rst:522 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -839,19 +843,19 @@ msgstr "" "在其他用途\\u200b\\u200b中,這允許初始化依賴於一個或多個其他欄位的欄位值。例" "如::" -#: ../../library/dataclasses.rst:529 +#: ../../library/dataclasses.rst:534 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :func:`dataclass` does not " "call base class :meth:`~object.__init__` methods. If the base class has an :" "meth:`~object.__init__` method that has to be called, it is common to call " -"this method in a :meth:`!__post_init__` method::" +"this method in a :meth:`__post_init__` method::" msgstr "" ":func:`dataclass` 生成的:meth:`__init__` 方法不呼叫基底類別:meth:`__init__` " "方法。如果基底類別有一個必須呼叫的 :meth:`__init__` 方法,通常在 :meth:" "`__post_init__` 方法中呼叫此方法::" -#: ../../library/dataclasses.rst:546 +#: ../../library/dataclasses.rst:551 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`~object." @@ -862,22 +866,22 @@ msgstr "" "但是請注意,通常不需要呼叫資料類生成的 :meth:`__init__` 方法,因為派生資料類" "將負責初始化作為資料類本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:550 +#: ../../library/dataclasses.rst:555 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" -"meth:`!__post_init__`. Also see the warning about how :func:`replace` " +"meth:`__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`__post_init__` 的方" "法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:560 #, fuzzy msgid "Class variables" msgstr "類變數" -#: ../../library/dataclasses.rst:557 +#: ../../library/dataclasses.rst:562 #, fuzzy msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " @@ -892,12 +896,12 @@ msgstr "" "一個欄位是一個“ClassVar”,它就被排除在考慮之外,並被資料類機制忽略。模組級 :" "func:`fields` 函式不會回傳此類 ``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:566 +#: ../../library/dataclasses.rst:571 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:568 +#: ../../library/dataclasses.rst:573 #, fuzzy msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " @@ -907,8 +911,7 @@ msgid "" "it is not a true field, it is not returned by the module-level :func:" "`fields` function. Init-only fields are added as parameters to the " "generated :meth:`~object.__init__` method, and are passed to the optional :" -"ref:`__post_init__ ` method. They are not otherwise " -"used by dataclasses." +"meth:`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" ":func:`dataclass` 檢查型別註解的另一個地方是確定欄位是否是僅初始化變數。它通" "過查看欄位的型別是否為“dataclasses.InitVar”型別來執行此操作。如果一個欄位是一" @@ -917,14 +920,14 @@ msgstr "" "meth:`__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。它們不被資料" "類使用。" -#: ../../library/dataclasses.rst:578 +#: ../../library/dataclasses.rst:583 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值::" -#: ../../library/dataclasses.rst:593 +#: ../../library/dataclasses.rst:598 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " @@ -933,12 +936,12 @@ msgstr "" "在這種情況下,:func:`fields` 將為 ``i`` 和 ``j`` 回傳 :class:`Field` 物件,但" "不會為 ``database`` 回傳。" -#: ../../library/dataclasses.rst:597 +#: ../../library/dataclasses.rst:602 #, fuzzy msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:599 +#: ../../library/dataclasses.rst:604 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -952,7 +955,7 @@ msgstr "" "meth:`__setattr__` 和 :meth:`__delattr__` 方法。這些方法在呼叫時會引發:exc:" "`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:605 +#: ../../library/dataclasses.rst:610 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -962,12 +965,12 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:615 #, fuzzy msgid "Inheritance" msgstr "遺產" -#: ../../library/dataclasses.rst:612 +#: ../../library/dataclasses.rst:617 #, fuzzy msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " @@ -985,7 +988,7 @@ msgstr "" "增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄位映射。因為欄" "位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子::" -#: ../../library/dataclasses.rst:632 +#: ../../library/dataclasses.rst:637 #, fuzzy msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " @@ -994,18 +997,18 @@ msgstr "" "最終的欄位列表按順序為“x”、“y”、“z”。 ``x`` 的最終型別是 ``int``,如類 ``C`` " "中指定的那樣。" -#: ../../library/dataclasses.rst:635 +#: ../../library/dataclasses.rst:640 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "為 ``C`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:645 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr ":meth:`__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:642 +#: ../../library/dataclasses.rst:647 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1017,7 +1020,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:648 +#: ../../library/dataclasses.rst:653 #, fuzzy msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " @@ -1026,13 +1029,13 @@ msgstr "" "在此示例中,``Base.y``、``Base.w`` 和``D.t`` 是僅限關鍵字的欄位,``Base.x`` " "和``D.z`` 是常規欄位: :" -#: ../../library/dataclasses.rst:663 +#: ../../library/dataclasses.rst:668 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "為 ``D`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:667 +#: ../../library/dataclasses.rst:672 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1042,19 +1045,19 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:671 +#: ../../library/dataclasses.rst:676 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`~object.__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:681 #, fuzzy msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:678 +#: ../../library/dataclasses.rst:683 #, fuzzy msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " @@ -1064,7 +1067,7 @@ msgstr "" "如果 :func:`field` 指定了 ``default_factory``,當需要該欄位的預設值時,它會以" "零參數呼叫。例如,要建立列表的新實例,請使用:" -#: ../../library/dataclasses.rst:684 +#: ../../library/dataclasses.rst:689 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1077,35 +1080,35 @@ msgstr "" "了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:`__init__ 中呼叫" "`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:691 +#: ../../library/dataclasses.rst:696 #, fuzzy msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:693 +#: ../../library/dataclasses.rst:698 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "Python 將預設成員變數值存儲在類屬性中。考慮這個例子,不使用資料類::" -#: ../../library/dataclasses.rst:708 +#: ../../library/dataclasses.rst:713 #, fuzzy msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "請注意,類“C”的兩個實例共享同一個類變數“x”,正如預期的那樣。" -#: ../../library/dataclasses.rst:711 +#: ../../library/dataclasses.rst:716 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類,*如果*此程式碼有效::" -#: ../../library/dataclasses.rst:719 +#: ../../library/dataclasses.rst:724 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼::" -#: ../../library/dataclasses.rst:730 +#: ../../library/dataclasses.rst:735 #, fuzzy msgid "" "This has the same issue as the original example using class ``C``. That is, " @@ -1125,14 +1128,14 @@ msgstr "" "`TypeError`。假設是如果一個值是不可散列的,那麼它就是可變的。這是一個部分解決" "方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:741 +#: ../../library/dataclasses.rst:746 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法:" -#: ../../library/dataclasses.rst:750 +#: ../../library/dataclasses.rst:755 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " @@ -1142,12 +1145,12 @@ msgstr "" "不再查找和禁止型別為“list”、“dict”或“set”的物件,現在不允許使用不可散列的對像" "作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:757 +#: ../../library/dataclasses.rst:762 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:759 +#: ../../library/dataclasses.rst:764 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1156,7 +1159,7 @@ msgstr "" "指定為 :ref:`descriptor objects ` 作為預設值的欄位具有以下特殊行" "為:" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:767 #, fuzzy msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " @@ -1166,7 +1169,7 @@ msgstr "" "傳遞給資料類的“__init__”方法的欄位值被傳遞給描述器的“__set__”方法,而不是覆蓋" "描述器物件。" -#: ../../library/dataclasses.rst:765 +#: ../../library/dataclasses.rst:770 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " @@ -1176,7 +1179,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的“__get__”或“__set__”方法,而不是回傳" "或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:768 +#: ../../library/dataclasses.rst:773 #, fuzzy msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " @@ -1191,7 +1194,7 @@ msgstr "" "情況下,描述器回傳一個值,它將用作欄位的預設值。另一方面,如果描述器在這種情" "況下引發 :exc:`AttributeError`,則不會為該欄位提供預設值。" -#: ../../library/dataclasses.rst:803 +#: ../../library/dataclasses.rst:808 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/datetime.po b/library/datetime.po index 19083f36a7..c26acf9c84 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -356,8 +356,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:256 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1057 ../../library/datetime.rst:1676 -#: ../../library/datetime.rst:2278 +#: ../../library/datetime.rst:1065 ../../library/datetime.rst:1684 +#: ../../library/datetime.rst:2286 msgid "Class attributes:" msgstr "類別屬性:" @@ -384,7 +384,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:277 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1077 ../../library/datetime.rst:1696 +#: ../../library/datetime.rst:1085 ../../library/datetime.rst:1704 msgid "Instance attributes (read-only):" msgstr "" @@ -421,17 +421,17 @@ msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" #: ../../library/datetime.rst:289 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:1138 msgid "Supported operations:" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1133 +#: ../../library/datetime.rst:1141 msgid "Operation" msgstr "" #: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1133 +#: ../../library/datetime.rst:1141 msgid "Result" msgstr "" @@ -576,7 +576,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:355 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:2499 +#: ../../library/datetime.rst:2515 msgid "Notes:" msgstr "註解:" @@ -650,7 +650,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:422 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1204 ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:1212 ../../library/datetime.rst:1812 msgid "Instance methods:" msgstr "實例方法:" @@ -714,12 +714,12 @@ msgstr "``1 <= month <= 12``" msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:487 ../../library/datetime.rst:847 +#: ../../library/datetime.rst:487 ../../library/datetime.rst:848 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:490 ../../library/datetime.rst:852 +#: ../../library/datetime.rst:490 ../../library/datetime.rst:853 msgid "Other constructors, all class methods:" msgstr "" @@ -798,15 +798,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1081 +#: ../../library/datetime.rst:574 ../../library/datetime.rst:1089 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1086 +#: ../../library/datetime.rst:579 ../../library/datetime.rst:1094 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1091 +#: ../../library/datetime.rst:584 ../../library/datetime.rst:1099 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -830,7 +830,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1139 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1147 msgid "\\(3)" msgstr "\\(3)" @@ -887,14 +887,14 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:640 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:640 ../../library/datetime.rst:1855 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1317 +#: ../../library/datetime.rst:650 ../../library/datetime.rst:1325 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -905,7 +905,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:654 ../../library/datetime.rst:1327 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" @@ -982,7 +982,7 @@ msgstr "" msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:728 ../../library/datetime.rst:1503 +#: ../../library/datetime.rst:728 ../../library/datetime.rst:1511 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" @@ -1020,21 +1020,21 @@ msgstr "用法範例:\\ :class:`date`" msgid "Example of counting days to an event::" msgstr "" -#: ../../library/datetime.rst:772 +#: ../../library/datetime.rst:773 msgid "More examples of working with :class:`date`:" msgstr "更多 :class:`date` 的用法範例:" -#: ../../library/datetime.rst:821 +#: ../../library/datetime.rst:822 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` 物件" -#: ../../library/datetime.rst:823 +#: ../../library/datetime.rst:824 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:826 +#: ../../library/datetime.rst:827 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1042,80 +1042,80 @@ msgid "" "every day." msgstr "" -#: ../../library/datetime.rst:830 +#: ../../library/datetime.rst:831 msgid "Constructor:" msgstr "" -#: ../../library/datetime.rst:834 +#: ../../library/datetime.rst:835 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " "arguments must be integers in the following ranges:" msgstr "" -#: ../../library/datetime.rst:838 +#: ../../library/datetime.rst:839 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "``MINYEAR <= year <= MAXYEAR``," -#: ../../library/datetime.rst:839 +#: ../../library/datetime.rst:840 msgid "``1 <= month <= 12``," msgstr "``1 <= month <= 12``," -#: ../../library/datetime.rst:840 +#: ../../library/datetime.rst:841 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:841 ../../library/datetime.rst:1667 +#: ../../library/datetime.rst:842 ../../library/datetime.rst:1675 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:842 ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:843 ../../library/datetime.rst:1676 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:843 ../../library/datetime.rst:1669 +#: ../../library/datetime.rst:844 ../../library/datetime.rst:1677 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:844 ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:845 ../../library/datetime.rst:1678 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:845 ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:846 ../../library/datetime.rst:1679 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:849 ../../library/datetime.rst:1238 -#: ../../library/datetime.rst:1814 +#: ../../library/datetime.rst:850 ../../library/datetime.rst:1246 +#: ../../library/datetime.rst:1822 msgid "Added the ``fold`` argument." msgstr "新增 ``fold`` 引數。" -#: ../../library/datetime.rst:856 +#: ../../library/datetime.rst:857 msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:858 +#: ../../library/datetime.rst:859 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/datetime.rst:862 +#: ../../library/datetime.rst:863 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "也請見 :meth:`now`\\ 、\\ :meth:`fromtimestamp`\\ 。" -#: ../../library/datetime.rst:864 +#: ../../library/datetime.rst:865 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: ../../library/datetime.rst:869 +#: ../../library/datetime.rst:870 msgid "Return the current local date and time." msgstr "" -#: ../../library/datetime.rst:871 +#: ../../library/datetime.rst:872 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " @@ -1123,28 +1123,28 @@ msgid "" "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" -#: ../../library/datetime.rst:877 +#: ../../library/datetime.rst:878 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:880 +#: ../../library/datetime.rst:881 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:885 +#: ../../library/datetime.rst:886 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:887 +#: ../../library/datetime.rst:888 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: ../../library/datetime.rst:893 +#: ../../library/datetime.rst:894 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1153,6 +1153,10 @@ msgid "" msgstr "" #: ../../library/datetime.rst:901 +msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." +msgstr "" + +#: ../../library/datetime.rst:906 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1160,13 +1164,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:906 +#: ../../library/datetime.rst:911 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:909 +#: ../../library/datetime.rst:914 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1179,7 +1183,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:920 +#: ../../library/datetime.rst:925 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1187,17 +1191,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:927 +#: ../../library/datetime.rst:932 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:932 +#: ../../library/datetime.rst:937 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:935 +#: ../../library/datetime.rst:940 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1205,23 +1209,23 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:940 +#: ../../library/datetime.rst:945 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:944 +#: ../../library/datetime.rst:949 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:949 +#: ../../library/datetime.rst:954 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:954 +#: ../../library/datetime.rst:959 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1230,7 +1234,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:960 +#: ../../library/datetime.rst:965 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1238,7 +1242,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:969 +#: ../../library/datetime.rst:973 +msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." +msgstr "" + +#: ../../library/datetime.rst:978 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1247,63 +1255,64 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:977 +#: ../../library/datetime.rst:986 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " "given :class:`.time` object's. If the *tzinfo* argument is provided, its " "value is used to set the :attr:`.tzinfo` attribute of the result, otherwise " -"the :attr:`~.time.tzinfo` attribute of the *time* argument is used." +"the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the " +"*date* argument is a :class:`.datetime` object, its time components and :" +"attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:984 +#: ../../library/datetime.rst:994 msgid "" "For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." -"time(), d.tzinfo)``. If date is a :class:`.datetime` object, its time " -"components and :attr:`.tzinfo` attributes are ignored." +"time(), d.tzinfo)``." msgstr "" -#: ../../library/datetime.rst:989 +#: ../../library/datetime.rst:997 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:995 +#: ../../library/datetime.rst:1003 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:998 ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1006 ../../library/datetime.rst:1778 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:999 +#: ../../library/datetime.rst:1007 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1000 +#: ../../library/datetime.rst:1008 msgid "Ordinal dates are not currently supported." msgstr "" -#: ../../library/datetime.rst:1001 ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1009 ../../library/datetime.rst:1783 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1003 ../../library/datetime.rst:1432 -#: ../../library/datetime.rst:1777 +#: ../../library/datetime.rst:1011 ../../library/datetime.rst:1440 +#: ../../library/datetime.rst:1785 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:1027 +#: ../../library/datetime.rst:1035 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat()` or :meth:`datetime.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1034 +#: ../../library/datetime.rst:1042 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1311,19 +1320,19 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1043 +#: ../../library/datetime.rst:1051 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1046 +#: ../../library/datetime.rst:1054 msgid "" "If *format* does not contain microseconds or timezone information, this is " "equivalent to::" msgstr "" -#: ../../library/datetime.rst:1050 +#: ../../library/datetime.rst:1058 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1331,44 +1340,44 @@ msgid "" "fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1061 +#: ../../library/datetime.rst:1069 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1067 +#: ../../library/datetime.rst:1075 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1073 +#: ../../library/datetime.rst:1081 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1096 ../../library/datetime.rst:1700 +#: ../../library/datetime.rst:1104 ../../library/datetime.rst:1708 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1101 ../../library/datetime.rst:1106 -#: ../../library/datetime.rst:1705 ../../library/datetime.rst:1710 +#: ../../library/datetime.rst:1109 ../../library/datetime.rst:1114 +#: ../../library/datetime.rst:1713 ../../library/datetime.rst:1718 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1111 ../../library/datetime.rst:1715 +#: ../../library/datetime.rst:1119 ../../library/datetime.rst:1723 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1116 +#: ../../library/datetime.rst:1124 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1726 +#: ../../library/datetime.rst:1130 ../../library/datetime.rst:1734 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1377,38 +1386,38 @@ msgid "" "(later) of the two moments with the same wall time representation." msgstr "" -#: ../../library/datetime.rst:1135 +#: ../../library/datetime.rst:1143 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1135 ../../library/datetime.rst:2334 -#: ../../library/datetime.rst:2339 ../../library/datetime.rst:2351 -#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2416 -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2425 +#: ../../library/datetime.rst:1143 ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2347 ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2364 ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2429 ../../library/datetime.rst:2433 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:1145 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1137 ../../library/datetime.rst:2367 +#: ../../library/datetime.rst:1145 ../../library/datetime.rst:2375 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1139 +#: ../../library/datetime.rst:1147 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:1149 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:1149 msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" msgstr "" -#: ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:1154 msgid "" "datetime2 is a duration of timedelta removed from datetime1, moving forward " "in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " @@ -1419,7 +1428,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1155 +#: ../../library/datetime.rst:1163 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1427,14 +1436,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1160 +#: ../../library/datetime.rst:1168 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1164 +#: ../../library/datetime.rst:1172 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1442,7 +1451,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1169 +#: ../../library/datetime.rst:1177 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1451,20 +1460,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1175 +#: ../../library/datetime.rst:1183 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1178 +#: ../../library/datetime.rst:1186 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1182 +#: ../../library/datetime.rst:1190 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1474,13 +1483,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1188 +#: ../../library/datetime.rst:1196 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1194 +#: ../../library/datetime.rst:1202 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1493,27 +1502,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1208 +#: ../../library/datetime.rst:1216 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1213 +#: ../../library/datetime.rst:1221 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1224 ../../library/datetime.rst:1233 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1222 +#: ../../library/datetime.rst:1230 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1233 +#: ../../library/datetime.rst:1241 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1521,21 +1530,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1244 +#: ../../library/datetime.rst:1252 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:1256 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1252 +#: ../../library/datetime.rst:1260 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1543,7 +1552,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1257 +#: ../../library/datetime.rst:1265 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1552,7 +1561,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1263 +#: ../../library/datetime.rst:1271 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1560,56 +1569,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1268 +#: ../../library/datetime.rst:1276 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1280 +#: ../../library/datetime.rst:1288 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1283 +#: ../../library/datetime.rst:1291 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1290 +#: ../../library/datetime.rst:1298 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1294 ../../library/datetime.rst:1887 -#: ../../library/datetime.rst:1993 ../../library/datetime.rst:2238 -#: ../../library/datetime.rst:2250 ../../library/datetime.rst:2552 +#: ../../library/datetime.rst:1302 ../../library/datetime.rst:1895 +#: ../../library/datetime.rst:2001 ../../library/datetime.rst:2246 +#: ../../library/datetime.rst:2258 ../../library/datetime.rst:2568 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1300 +#: ../../library/datetime.rst:1308 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1304 ../../library/datetime.rst:1897 -#: ../../library/datetime.rst:2047 +#: ../../library/datetime.rst:1312 ../../library/datetime.rst:1905 +#: ../../library/datetime.rst:2055 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1310 +#: ../../library/datetime.rst:1318 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1325 +#: ../../library/datetime.rst:1333 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1619,14 +1628,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1336 +#: ../../library/datetime.rst:1344 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1340 +#: ../../library/datetime.rst:1348 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1635,7 +1644,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1349 +#: ../../library/datetime.rst:1357 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1645,40 +1654,41 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1358 +#: ../../library/datetime.rst:1366 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1363 +#: ../../library/datetime.rst:1371 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1367 +#: ../../library/datetime.rst:1375 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " "the conversion. Since :class:`.datetime` supports wider range of values " "than :c:func:`mktime` on many platforms, this method may raise :exc:" -"`OverflowError` for times far in the past or far in the future." +"`OverflowError` or :exc:`OSError` for times far in the past or far in the " +"future." msgstr "" -#: ../../library/datetime.rst:1374 +#: ../../library/datetime.rst:1382 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1381 +#: ../../library/datetime.rst:1389 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1387 +#: ../../library/datetime.rst:1395 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1686,49 +1696,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1395 +#: ../../library/datetime.rst:1403 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1401 +#: ../../library/datetime.rst:1409 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1407 +#: ../../library/datetime.rst:1415 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1414 +#: ../../library/datetime.rst:1422 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1420 +#: ../../library/datetime.rst:1428 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1422 +#: ../../library/datetime.rst:1430 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1423 +#: ../../library/datetime.rst:1431 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1425 +#: ../../library/datetime.rst:1433 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1436 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1736,99 +1746,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1430 +#: ../../library/datetime.rst:1438 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1440 +#: ../../library/datetime.rst:1448 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1454 ../../library/datetime.rst:1827 +#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1835 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1458 ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1833 +#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1841 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1469 ../../library/datetime.rst:1842 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1472 +#: ../../library/datetime.rst:1480 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1858 +#: ../../library/datetime.rst:1490 ../../library/datetime.rst:1866 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1488 +#: ../../library/datetime.rst:1496 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1494 +#: ../../library/datetime.rst:1502 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1508 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1507 +#: ../../library/datetime.rst:1515 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1514 +#: ../../library/datetime.rst:1522 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1521 +#: ../../library/datetime.rst:1529 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1836,70 +1846,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1528 +#: ../../library/datetime.rst:1536 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1530 +#: ../../library/datetime.rst:1538 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1583 +#: ../../library/datetime.rst:1591 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1630 +#: ../../library/datetime.rst:1638 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1656 +#: ../../library/datetime.rst:1664 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1658 +#: ../../library/datetime.rst:1666 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1663 +#: ../../library/datetime.rst:1671 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1673 +#: ../../library/datetime.rst:1681 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1681 +#: ../../library/datetime.rst:1689 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1686 +#: ../../library/datetime.rst:1694 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1691 +#: ../../library/datetime.rst:1699 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1720 +#: ../../library/datetime.rst:1728 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1734 +#: ../../library/datetime.rst:1742 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1908,7 +1918,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1748 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1922,18 +1932,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1750 +#: ../../library/datetime.rst:1758 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1754 +#: ../../library/datetime.rst:1762 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1756 +#: ../../library/datetime.rst:1764 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1941,35 +1951,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1763 +#: ../../library/datetime.rst:1771 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1767 +#: ../../library/datetime.rst:1775 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1771 +#: ../../library/datetime.rst:1779 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1773 +#: ../../library/datetime.rst:1781 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1799 +#: ../../library/datetime.rst:1807 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1809 +#: ../../library/datetime.rst:1817 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1977,46 +1987,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1820 +#: ../../library/datetime.rst:1828 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1822 +#: ../../library/datetime.rst:1830 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1823 +#: ../../library/datetime.rst:1831 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1824 +#: ../../library/datetime.rst:1832 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1833 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1853 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1864 +#: ../../library/datetime.rst:1872 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1869 +#: ../../library/datetime.rst:1877 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1875 +#: ../../library/datetime.rst:1883 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2130 +#: ../../library/datetime.rst:2138 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2286,7 +2296,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2144 +#: ../../library/datetime.rst:2152 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2295,7 +2305,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2163 +#: ../../library/datetime.rst:2171 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2310,13 +2320,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2185 +#: ../../library/datetime.rst:2193 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2188 +#: ../../library/datetime.rst:2196 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2326,28 +2336,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2202 +#: ../../library/datetime.rst:2210 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2205 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2201 +#: ../../library/datetime.rst:2209 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2208 +#: ../../library/datetime.rst:2216 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2205 +#: ../../library/datetime.rst:2213 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2356,24 +2366,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2223 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2225 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2221 +#: ../../library/datetime.rst:2229 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2228 +#: ../../library/datetime.rst:2236 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2381,25 +2391,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2241 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2244 ../../library/datetime.rst:2255 +#: ../../library/datetime.rst:2252 ../../library/datetime.rst:2263 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2247 +#: ../../library/datetime.rst:2255 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2266 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2408,144 +2418,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2264 +#: ../../library/datetime.rst:2272 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2271 +#: ../../library/datetime.rst:2279 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2275 +#: ../../library/datetime.rst:2283 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2282 +#: ../../library/datetime.rst:2290 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2299 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2301 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2305 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2301 +#: ../../library/datetime.rst:2309 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2313 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2313 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2307 +#: ../../library/datetime.rst:2315 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2307 +#: ../../library/datetime.rst:2315 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2307 +#: ../../library/datetime.rst:2315 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2317 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2317 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2317 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2311 +#: ../../library/datetime.rst:2319 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2311 +#: ../../library/datetime.rst:2319 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2311 +#: ../../library/datetime.rst:2319 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2321 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2321 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2321 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2326 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2320 +#: ../../library/datetime.rst:2328 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2328 +#: ../../library/datetime.rst:2336 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2342 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2342 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2557,11 +2567,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2347 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2339 +#: ../../library/datetime.rst:2347 msgid "Weekday as locale's full name." msgstr "" @@ -2573,42 +2583,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2352 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2352 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2352 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2356 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2356 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2356 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2348 ../../library/datetime.rst:2361 -#: ../../library/datetime.rst:2364 ../../library/datetime.rst:2370 -#: ../../library/datetime.rst:2373 ../../library/datetime.rst:2379 -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2372 ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2405 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2359 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2359 msgid "Month as locale's abbreviated name." msgstr "" @@ -2620,11 +2630,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2364 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2364 msgid "Month as locale's full name." msgstr "" @@ -2636,67 +2646,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2361 +#: ../../library/datetime.rst:2369 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2361 +#: ../../library/datetime.rst:2369 msgid "Month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2361 ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2369 ../../library/datetime.rst:2381 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2372 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2372 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2372 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2367 +#: ../../library/datetime.rst:2375 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2367 +#: ../../library/datetime.rst:2375 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2367 ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2445 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2378 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2378 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2378 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2381 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2381 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2384 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2384 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2708,127 +2718,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2384 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2387 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2387 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2390 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2390 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2390 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2390 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2393 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2393 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2393 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2385 +#: ../../library/datetime.rst:2393 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2566 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2397 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2397 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2459 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2394 ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2402 ../../library/datetime.rst:2594 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2402 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2402 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2405 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2405 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2405 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2408 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2408 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2416 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2416 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2416 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2416 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2424 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2424 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2840,11 +2851,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2421 +#: ../../library/datetime.rst:2429 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2421 +#: ../../library/datetime.rst:2429 msgid "Locale's appropriate date representation." msgstr "" @@ -2860,11 +2871,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2425 +#: ../../library/datetime.rst:2433 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2425 +#: ../../library/datetime.rst:2433 msgid "Locale's appropriate time representation." msgstr "" @@ -2876,69 +2887,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2436 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2436 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2436 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2439 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2445 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2445 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2445 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2450 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2450 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2450 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2453 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2453 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2453 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2453 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2452 +#: ../../library/datetime.rst:2459 ../../library/datetime.rst:2580 +msgid "``%:z``" +msgstr "" + +#: ../../library/datetime.rst:2459 +msgid "" +"UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " +"is naive)." +msgstr "" + +#: ../../library/datetime.rst:2459 +msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" +msgstr "" + +#: ../../library/datetime.rst:2465 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2947,7 +2972,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2470 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2957,40 +2982,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2476 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2479 +msgid "``%:z`` was added." +msgstr "" + +#: ../../library/datetime.rst:2483 msgid "Technical Detail" msgstr "" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2485 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2473 +#: ../../library/datetime.rst:2489 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2477 +#: ../../library/datetime.rst:2493 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2481 +#: ../../library/datetime.rst:2497 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2501 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -2998,14 +3027,14 @@ msgid "" "day." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2505 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2509 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3014,7 +3043,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2502 +#: ../../library/datetime.rst:2518 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3022,37 +3051,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2508 +#: ../../library/datetime.rst:2524 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2527 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2531 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2536 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2540 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2544 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3060,17 +3089,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2551 msgid "" -"For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " -"strings." +"For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " +"by empty strings." msgstr "" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2554 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2557 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3084,7 +3113,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2555 +#: ../../library/datetime.rst:2571 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3092,47 +3121,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2563 +#: ../../library/datetime.rst:2579 +msgid "" +"Behaves exactly as ``%z``, but has a colon separator added between hours, " +"minutes and seconds." +msgstr "" + +#: ../../library/datetime.rst:2583 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2567 +#: ../../library/datetime.rst:2587 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2569 +#: ../../library/datetime.rst:2589 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2590 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2592 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:2596 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:2602 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2587 +#: ../../library/datetime.rst:2607 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3140,22 +3175,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2613 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2618 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2619 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2621 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3164,23 +3199,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2607 +#: ../../library/datetime.rst:2627 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2611 +#: ../../library/datetime.rst:2631 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2285 +#: ../../library/datetime.rst:2293 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2285 +#: ../../library/datetime.rst:2293 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/decimal.po b/library/decimal.po index c2aebf7a69..cd0718f0c6 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-28 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1920,7 +1920,7 @@ msgid "" "to handle the :meth:`~Decimal.quantize` step:" msgstr "" -#: ../../library/decimal.rst:2079 +#: ../../library/decimal.rst:2080 msgid "" "Q. There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " @@ -1928,17 +1928,17 @@ msgid "" "canonical value?" msgstr "" -#: ../../library/decimal.rst:2084 +#: ../../library/decimal.rst:2085 msgid "" "A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" -#: ../../library/decimal.rst:2091 +#: ../../library/decimal.rst:2092 msgid "Q. When does rounding occur in a computation?" msgstr "" -#: ../../library/decimal.rst:2093 +#: ../../library/decimal.rst:2094 msgid "" "A. It occurs *after* the computation. The philosophy of the decimal " "specification is that numbers are considered exact and are created " @@ -1948,13 +1948,13 @@ msgid "" "computation::" msgstr "" -#: ../../library/decimal.rst:2111 +#: ../../library/decimal.rst:2112 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" -#: ../../library/decimal.rst:2114 +#: ../../library/decimal.rst:2115 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " @@ -1962,31 +1962,31 @@ msgid "" "original's two-place significance." msgstr "" -#: ../../library/decimal.rst:2119 +#: ../../library/decimal.rst:2120 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:2129 +#: ../../library/decimal.rst:2130 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" -#: ../../library/decimal.rst:2131 +#: ../../library/decimal.rst:2132 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:2140 +#: ../../library/decimal.rst:2141 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:2143 +#: ../../library/decimal.rst:2144 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. " @@ -1994,14 +1994,14 @@ msgid "" "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" -#: ../../library/decimal.rst:2148 +#: ../../library/decimal.rst:2149 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:2152 +#: ../../library/decimal.rst:2153 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 " @@ -2010,23 +2010,23 @@ msgid "" "haven't been rounded:" msgstr "" -#: ../../library/decimal.rst:2165 +#: ../../library/decimal.rst:2166 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" msgstr "" -#: ../../library/decimal.rst:2174 +#: ../../library/decimal.rst:2175 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" msgstr "" -#: ../../library/decimal.rst:2180 +#: ../../library/decimal.rst:2181 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "" -#: ../../library/decimal.rst:2182 +#: ../../library/decimal.rst:2183 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-" @@ -72,7 +72,7 @@ msgid "" "``False`` when creating the :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:388 +#: ../../library/difflib.rst:55 ../../library/difflib.rst:384 msgid "The *autojunk* parameter." msgstr "*autojunk* 參數。" @@ -92,7 +92,7 @@ msgstr "" msgid "Code" msgstr "" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:498 +#: ../../library/difflib.rst:69 ../../library/difflib.rst:494 msgid "Meaning" msgstr "" @@ -132,7 +132,8 @@ msgstr "" msgid "" "Lines beginning with '``?``' attempt to guide the eye to intraline " "differences, and were not present in either input sequence. These lines can " -"be confusing if the sequences contain tab characters." +"be confusing if the sequences contain whitespace characters, such as spaces, " +"tabs or line breaks." msgstr "" #: ../../library/difflib.rst:87 @@ -226,26 +227,20 @@ msgid "" "`make_file` method." msgstr "" -#: ../../library/difflib.rst:148 -msgid "" -":file:`Tools/scripts/diff.py` is a command-line front-end to this class and " -"contains a good example of its use." -msgstr "" - -#: ../../library/difflib.rst:154 +#: ../../library/difflib.rst:152 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in context diff format." msgstr "" -#: ../../library/difflib.rst:157 +#: ../../library/difflib.rst:155 msgid "" "Context diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in a before/after " "style. The number of context lines is set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:161 +#: ../../library/difflib.rst:159 msgid "" "By default, the diff control lines (those with ``***`` or ``---``) are " "created with a trailing newline. This is helpful so that inputs created " @@ -254,13 +249,13 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:167 ../../library/difflib.rst:298 +#: ../../library/difflib.rst:165 ../../library/difflib.rst:294 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" -#: ../../library/difflib.rst:170 ../../library/difflib.rst:301 +#: ../../library/difflib.rst:168 ../../library/difflib.rst:297 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -269,11 +264,11 @@ msgid "" "default to blanks." msgstr "" -#: ../../library/difflib.rst:193 ../../library/difflib.rst:322 +#: ../../library/difflib.rst:191 ../../library/difflib.rst:318 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "一個更詳盡的範例請見 :ref:`difflib-interface`\\ 。" -#: ../../library/difflib.rst:198 +#: ../../library/difflib.rst:196 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -281,37 +276,37 @@ msgid "" "strings)." msgstr "" -#: ../../library/difflib.rst:202 +#: ../../library/difflib.rst:200 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" -#: ../../library/difflib.rst:205 +#: ../../library/difflib.rst:203 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" -#: ../../library/difflib.rst:208 +#: ../../library/difflib.rst:206 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" -#: ../../library/difflib.rst:224 +#: ../../library/difflib.rst:222 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" -#: ../../library/difflib.rst:227 +#: ../../library/difflib.rst:225 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:230 +#: ../../library/difflib.rst:228 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -322,7 +317,7 @@ msgid "" "this usually works better than using this function." msgstr "" -#: ../../library/difflib.rst:238 +#: ../../library/difflib.rst:236 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -330,33 +325,28 @@ msgid "" "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" -#: ../../library/difflib.rst:243 -msgid "" -":file:`Tools/scripts/ndiff.py` is a command-line front-end to this function." -msgstr "" - -#: ../../library/difflib.rst:261 +#: ../../library/difflib.rst:257 msgid "Return one of the two sequences that generated a delta." msgstr "" -#: ../../library/difflib.rst:263 +#: ../../library/difflib.rst:259 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" -#: ../../library/difflib.rst:267 +#: ../../library/difflib.rst:263 msgid "Example:" msgstr "範例:" -#: ../../library/difflib.rst:284 +#: ../../library/difflib.rst:280 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" -#: ../../library/difflib.rst:287 +#: ../../library/difflib.rst:283 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -364,7 +354,7 @@ msgid "" "set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:292 +#: ../../library/difflib.rst:288 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -373,14 +363,14 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:326 +#: ../../library/difflib.rst:322 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" -#: ../../library/difflib.rst:331 +#: ../../library/difflib.rst:327 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -390,42 +380,42 @@ msgid "" "unknown/inconsistent encodings as *a* and *b*." msgstr "" -#: ../../library/difflib.rst:342 +#: ../../library/difflib.rst:338 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" -#: ../../library/difflib.rst:349 +#: ../../library/difflib.rst:345 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" -#: ../../library/difflib.rst:357 +#: ../../library/difflib.rst:353 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" -#: ../../library/difflib.rst:357 +#: ../../library/difflib.rst:353 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" -#: ../../library/difflib.rst:364 +#: ../../library/difflib.rst:360 msgid "SequenceMatcher Objects" msgstr "SequenceMatcher 物件" -#: ../../library/difflib.rst:366 +#: ../../library/difflib.rst:362 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:371 +#: ../../library/difflib.rst:367 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -434,26 +424,26 @@ msgid "" "ignored. For example, pass::" msgstr "" -#: ../../library/difflib.rst:379 +#: ../../library/difflib.rst:375 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" -#: ../../library/difflib.rst:382 +#: ../../library/difflib.rst:378 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -#: ../../library/difflib.rst:385 +#: ../../library/difflib.rst:381 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" -#: ../../library/difflib.rst:391 +#: ../../library/difflib.rst:387 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -463,19 +453,19 @@ msgid "" "`set_seqs` or :meth:`set_seq2`." msgstr "" -#: ../../library/difflib.rst:398 +#: ../../library/difflib.rst:394 msgid "The *bjunk* and *bpopular* attributes." msgstr "" -#: ../../library/difflib.rst:401 +#: ../../library/difflib.rst:397 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "" -#: ../../library/difflib.rst:405 +#: ../../library/difflib.rst:401 msgid "Set the two sequences to be compared." msgstr "" -#: ../../library/difflib.rst:407 +#: ../../library/difflib.rst:403 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -483,23 +473,23 @@ msgid "" "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -#: ../../library/difflib.rst:415 +#: ../../library/difflib.rst:411 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:421 +#: ../../library/difflib.rst:417 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:427 +#: ../../library/difflib.rst:423 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" -#: ../../library/difflib.rst:429 +#: ../../library/difflib.rst:425 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -511,7 +501,7 @@ msgid "" "that starts earliest in *b*." msgstr "" -#: ../../library/difflib.rst:442 +#: ../../library/difflib.rst:438 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -520,7 +510,7 @@ msgid "" "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -#: ../../library/difflib.rst:449 +#: ../../library/difflib.rst:445 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -528,26 +518,26 @@ msgid "" "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:454 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "" -#: ../../library/difflib.rst:460 +#: ../../library/difflib.rst:456 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" -#: ../../library/difflib.rst:462 +#: ../../library/difflib.rst:458 msgid "Added default arguments." msgstr "新增預設引數。" -#: ../../library/difflib.rst:468 +#: ../../library/difflib.rst:464 msgid "" "Return list of triples describing non-overlapping matching subsequences. " -"Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:j" -"+n]``. The triples are monotonically increasing in *i* and *j*." +"Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" +"j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -#: ../../library/difflib.rst:473 +#: ../../library/difflib.rst:469 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -556,7 +546,7 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" -#: ../../library/difflib.rst:490 +#: ../../library/difflib.rst:486 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -564,104 +554,104 @@ msgid "" "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -#: ../../library/difflib.rst:495 +#: ../../library/difflib.rst:491 msgid "The *tag* values are strings, with these meanings:" msgstr "" -#: ../../library/difflib.rst:498 +#: ../../library/difflib.rst:494 msgid "Value" msgstr "" -#: ../../library/difflib.rst:500 +#: ../../library/difflib.rst:496 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/difflib.rst:500 +#: ../../library/difflib.rst:496 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "" -#: ../../library/difflib.rst:503 +#: ../../library/difflib.rst:499 msgid "``'delete'``" msgstr "``'delete'``" -#: ../../library/difflib.rst:503 +#: ../../library/difflib.rst:499 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:502 msgid "``'insert'``" msgstr "``'insert'``" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:502 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:506 msgid "``'equal'``" msgstr "``'equal'``" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:506 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "" -#: ../../library/difflib.rst:514 +#: ../../library/difflib.rst:510 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/difflib.rst:531 +#: ../../library/difflib.rst:527 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" -#: ../../library/difflib.rst:533 +#: ../../library/difflib.rst:529 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -#: ../../library/difflib.rst:537 +#: ../../library/difflib.rst:533 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "" -#: ../../library/difflib.rst:542 +#: ../../library/difflib.rst:538 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" -#: ../../library/difflib.rst:545 +#: ../../library/difflib.rst:541 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" -#: ../../library/difflib.rst:549 +#: ../../library/difflib.rst:545 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" -#: ../../library/difflib.rst:556 +#: ../../library/difflib.rst:552 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" -#: ../../library/difflib.rst:567 +#: ../../library/difflib.rst:563 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" -#: ../../library/difflib.rst:572 +#: ../../library/difflib.rst:568 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "" -#: ../../library/difflib.rst:575 +#: ../../library/difflib.rst:571 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -669,57 +659,57 @@ msgid "" "as :meth:`ratio`:" msgstr "" -#: ../../library/difflib.rst:592 +#: ../../library/difflib.rst:588 msgid "SequenceMatcher Examples" msgstr "SequenceMatcher 範例" -#: ../../library/difflib.rst:594 +#: ../../library/difflib.rst:590 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" -#: ../../library/difflib.rst:600 +#: ../../library/difflib.rst:596 msgid "" ":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " "sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " "sequences are close matches:" msgstr "" -#: ../../library/difflib.rst:607 +#: ../../library/difflib.rst:603 msgid "" "If you're only interested in where the sequences match, :meth:" "`get_matching_blocks` is handy:" msgstr "" -#: ../../library/difflib.rst:616 +#: ../../library/difflib.rst:612 msgid "" "Note that the last tuple returned by :meth:`get_matching_blocks` is always a " "dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " "tuple element (number of elements matched) is ``0``." msgstr "" -#: ../../library/difflib.rst:620 +#: ../../library/difflib.rst:616 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`get_opcodes`:" msgstr "" -#: ../../library/difflib.rst:631 +#: ../../library/difflib.rst:627 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" -#: ../../library/difflib.rst:635 +#: ../../library/difflib.rst:631 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:643 +#: ../../library/difflib.rst:639 msgid "Differ Objects" msgstr "" -#: ../../library/difflib.rst:645 +#: ../../library/difflib.rst:641 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -729,31 +719,31 @@ msgid "" "longer diff." msgstr "" -#: ../../library/difflib.rst:651 +#: ../../library/difflib.rst:647 msgid "The :class:`Differ` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:657 +#: ../../library/difflib.rst:653 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:660 +#: ../../library/difflib.rst:656 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" -#: ../../library/difflib.rst:664 +#: ../../library/difflib.rst:660 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" -#: ../../library/difflib.rst:668 +#: ../../library/difflib.rst:664 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -761,17 +751,17 @@ msgid "" "*isjunk* parameter for an explanation." msgstr "" -#: ../../library/difflib.rst:674 +#: ../../library/difflib.rst:670 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" -#: ../../library/difflib.rst:679 +#: ../../library/difflib.rst:675 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" -#: ../../library/difflib.rst:681 +#: ../../library/difflib.rst:677 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -780,11 +770,11 @@ msgid "" "IOBase.writelines` method of a file-like object." msgstr "" -#: ../../library/difflib.rst:692 +#: ../../library/difflib.rst:688 msgid "Differ Example" msgstr "" -#: ../../library/difflib.rst:694 +#: ../../library/difflib.rst:690 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " @@ -792,36 +782,46 @@ msgid "" "objects):" msgstr "" -#: ../../library/difflib.rst:713 +#: ../../library/difflib.rst:709 msgid "Next we instantiate a Differ object:" msgstr "" -#: ../../library/difflib.rst:717 +#: ../../library/difflib.rst:713 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" -#: ../../library/difflib.rst:721 +#: ../../library/difflib.rst:717 msgid "Finally, we compare the two:" msgstr "" -#: ../../library/difflib.rst:725 +#: ../../library/difflib.rst:721 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" -#: ../../library/difflib.rst:740 +#: ../../library/difflib.rst:736 msgid "As a single multi-line string it looks like this:" msgstr "" -#: ../../library/difflib.rst:759 +#: ../../library/difflib.rst:755 msgid "A command-line interface to difflib" msgstr "" -#: ../../library/difflib.rst:761 +#: ../../library/difflib.rst:757 msgid "" -"This example shows how to use difflib to create a ``diff``-like utility. It " -"is also contained in the Python source distribution, as :file:`Tools/scripts/" -"diff.py`." +"This example shows how to use difflib to create a ``diff``-like utility." +msgstr "" + +#: ../../library/difflib.rst:762 +#, fuzzy +msgid "ndiff example" +msgstr "" +"舉例來說:\n" +"\n" +"::" + +#: ../../library/difflib.rst:764 +msgid "This example shows how to use :func:`difflib.ndiff`." msgstr "" diff --git a/library/dis.po b/library/dis.po index e387e8f9da..6277450d6e 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-17 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,36 +78,36 @@ msgid "" "`myfunc`:" msgstr "" -#: ../../library/dis.rst:65 +#: ../../library/dis.rst:64 msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:68 +#: ../../library/dis.rst:67 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:72 +#: ../../library/dis.rst:71 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:79 +#: ../../library/dis.rst:78 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:83 +#: ../../library/dis.rst:82 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:87 ../../library/dis.rst:276 +#: ../../library/dis.rst:86 ../../library/dis.rst:274 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -115,71 +115,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:92 +#: ../../library/dis.rst:91 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:96 +#: ../../library/dis.rst:95 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:99 +#: ../../library/dis.rst:98 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:104 +#: ../../library/dis.rst:103 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:109 +#: ../../library/dis.rst:108 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:113 +#: ../../library/dis.rst:112 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:117 +#: ../../library/dis.rst:116 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:122 +#: ../../library/dis.rst:121 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:125 ../../library/dis.rst:166 -#: ../../library/dis.rst:218 +#: ../../library/dis.rst:124 ../../library/dis.rst:164 +#: ../../library/dis.rst:216 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:128 ../../library/dis.rst:221 -#: ../../library/dis.rst:237 ../../library/dis.rst:264 -#: ../../library/dis.rst:285 +#: ../../library/dis.rst:127 ../../library/dis.rst:219 +#: ../../library/dis.rst:235 ../../library/dis.rst:262 +#: ../../library/dis.rst:283 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:131 +#: ../../library/dis.rst:130 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:148 +#: ../../library/dis.rst:146 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:150 +#: ../../library/dis.rst:148 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -187,39 +187,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:156 +#: ../../library/dis.rst:154 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:160 +#: ../../library/dis.rst:158 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:172 +#: ../../library/dis.rst:170 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:176 +#: ../../library/dis.rst:174 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:181 ../../library/dis.rst:212 -#: ../../library/dis.rst:234 ../../library/dis.rst:261 +#: ../../library/dis.rst:179 ../../library/dis.rst:210 +#: ../../library/dis.rst:232 ../../library/dis.rst:259 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:187 +#: ../../library/dis.rst:185 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -227,134 +227,135 @@ msgid "" "a module, it disassembles all functions. For a class, it disassembles all " "methods (including class and static methods). For a code object or sequence " "of raw bytecode, it prints one line per bytecode instruction. It also " -"recursively disassembles nested code objects (the code of comprehensions, " -"generator expressions and nested functions, and the code used for building " -"nested classes). Strings are first compiled to code objects with the :func:" -"`compile` built-in function before being disassembled. If no object is " -"provided, this function disassembles the last traceback." +"recursively disassembles nested code objects. These can include generator " +"expressions, nested functions, the bodies of nested classes, and the code " +"objects used for :ref:`annotation scopes `. Strings are " +"first compiled to code objects with the :func:`compile` built-in function " +"before being disassembled. If no object is provided, this function " +"disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:200 ../../library/dis.rst:231 -#: ../../library/dis.rst:258 +#: ../../library/dis.rst:198 ../../library/dis.rst:229 +#: ../../library/dis.rst:256 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:203 +#: ../../library/dis.rst:201 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:206 +#: ../../library/dis.rst:204 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:209 +#: ../../library/dis.rst:207 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:215 +#: ../../library/dis.rst:213 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:227 +#: ../../library/dis.rst:225 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:244 +#: ../../library/dis.rst:242 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:245 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:248 +#: ../../library/dis.rst:246 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:249 +#: ../../library/dis.rst:247 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:250 +#: ../../library/dis.rst:248 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:251 +#: ../../library/dis.rst:249 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:252 +#: ../../library/dis.rst:250 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:253 +#: ../../library/dis.rst:251 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:255 +#: ../../library/dis.rst:253 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:270 +#: ../../library/dis.rst:268 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:273 +#: ../../library/dis.rst:271 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:281 +#: ../../library/dis.rst:279 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:291 +#: ../../library/dis.rst:289 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:295 +#: ../../library/dis.rst:293 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:298 +#: ../../library/dis.rst:296 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:305 +#: ../../library/dis.rst:303 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:309 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:313 +#: ../../library/dis.rst:311 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -362,105 +363,118 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:320 +#: ../../library/dis.rst:318 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:327 +#: ../../library/dis.rst:325 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:329 +#: ../../library/dis.rst:327 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:334 +#: ../../library/dis.rst:332 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:338 +#: ../../library/dis.rst:336 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:344 +#: ../../library/dis.rst:342 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:349 +#: ../../library/dis.rst:347 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:354 +#: ../../library/dis.rst:352 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:359 +#: ../../library/dis.rst:357 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:365 +#: ../../library/dis.rst:363 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:370 +#: ../../library/dis.rst:368 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:375 +#: ../../library/dis.rst:373 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:380 +#: ../../library/dis.rst:378 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:387 +#: ../../library/dis.rst:385 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:392 +#: ../../library/dis.rst:390 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:402 +#: ../../library/dis.rst:400 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:405 +#: ../../library/dis.rst:403 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:409 +#: ../../library/dis.rst:405 +msgid "" +"In the following, We will refer to the interpreter stack as ``STACK`` and " +"describe operations on it as if it was a Python list. The top of the stack " +"corresponds to ``STACK[-1]`` in this language." +msgstr "" + +#: ../../library/dis.rst:411 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:415 -msgid "Removes the top-of-stack (TOS) item." +#: ../../library/dis.rst:417 +msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:420 +#: ../../library/dis.rst:424 msgid "" -"Push the *i*-th item to the top of the stack. The item is not removed from " -"its original location." +"Removes the top two values from the stack. Equivalent to ``POP_TOP``; " +"``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:428 -msgid "Swap TOS with the item at position *i*." +#: ../../library/dis.rst:433 +msgid "" +"Push the i-th item to the top of the stack without removing it from its " +"original location::" +msgstr "" + +#: ../../library/dis.rst:444 +msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:435 +#: ../../library/dis.rst:453 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -468,188 +482,181 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:440 +#: ../../library/dis.rst:458 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:444 +#: ../../library/dis.rst:462 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:451 +#: ../../library/dis.rst:469 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:453 +#: ../../library/dis.rst:471 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:458 -msgid "Implements ``TOS = +TOS``." +#: ../../library/dis.rst:477 +msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:463 -msgid "Implements ``TOS = -TOS``." +#: ../../library/dis.rst:482 +msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:468 -msgid "Implements ``TOS = not TOS``." +#: ../../library/dis.rst:487 +msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:473 -msgid "Implements ``TOS = ~TOS``." +#: ../../library/dis.rst:492 +msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:478 -msgid "Implements ``TOS = iter(TOS)``." -msgstr "" - -#: ../../library/dis.rst:483 +#: ../../library/dis.rst:497 msgid "" -"If ``TOS`` is a :term:`generator iterator` or :term:`coroutine` object it is " -"left as is. Otherwise, implements ``TOS = iter(TOS)``." +"If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " +"it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:489 +#: ../../library/dis.rst:503 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:491 +#: ../../library/dis.rst:505 msgid "" -"Binary operations remove the top of the stack (TOS) and the second top-most " -"stack item (TOS1) from the stack. They perform the operation, and put the " -"result back on the stack." +"Binary operations remove the top two items from the stack (``STACK[-1]`` and " +"``STACK[-2]``). They perform the operation, then put the result back on the " +"stack." msgstr "" -#: ../../library/dis.rst:495 +#: ../../library/dis.rst:508 msgid "" -"In-place operations are like binary operations, in that they remove TOS and " -"TOS1, and push the result back on the stack, but the operation is done in-" -"place when TOS1 supports it, and the resulting TOS may be (but does not have " -"to be) the original TOS1." +"In-place operations are like binary operations, but the operation is done in-" +"place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " +"(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:503 +#: ../../library/dis.rst:515 msgid "" "Implements the binary and in-place operators (depending on the value of " -"*op*)." +"*op*)::" msgstr "" -#: ../../library/dis.rst:511 -msgid "Implements ``TOS = TOS1[TOS]``." +#: ../../library/dis.rst:527 ../../library/dis.rst:536 +#: ../../library/dis.rst:546 ../../library/dis.rst:554 +#: ../../library/dis.rst:566 ../../library/dis.rst:654 +#: ../../library/dis.rst:664 ../../library/dis.rst:674 +#: ../../library/dis.rst:893 ../../library/dis.rst:903 +#: ../../library/dis.rst:1002 ../../library/dis.rst:1014 +#: ../../library/dis.rst:1026 +msgid "Implements::" msgstr "" -#: ../../library/dis.rst:516 -msgid "Implements ``TOS1[TOS] = TOS2``." -msgstr "" - -#: ../../library/dis.rst:521 -msgid "Implements ``del TOS1[TOS]``." -msgstr "" - -#: ../../library/dis.rst:524 +#: ../../library/dis.rst:577 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:528 +#: ../../library/dis.rst:581 msgid "" -"Implements ``TOS = get_awaitable(TOS)``, where ``get_awaitable(o)`` returns " -"``o`` if ``o`` is a coroutine object or a generator object with the " -"CO_ITERABLE_COROUTINE flag, or resolves ``o.__await__``." +"Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " +"``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " +"generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " +"resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:533 +#: ../../library/dis.rst:586 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:536 -msgid "``1`` After a call to ``__aenter__``" +#: ../../library/dis.rst:589 +msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:537 -msgid "``2`` After a call to ``__aexit__``" +#: ../../library/dis.rst:590 +msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:541 +#: ../../library/dis.rst:594 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:547 -msgid "Implements ``TOS = TOS.__aiter__()``." +#: ../../library/dis.rst:600 +msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:550 +#: ../../library/dis.rst:603 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:557 +#: ../../library/dis.rst:610 msgid "" -"Pushes ``get_awaitable(TOS.__anext__())`` to the stack. See " -"``GET_AWAITABLE`` for details about ``get_awaitable``." +"Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " +"stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:565 +#: ../../library/dis.rst:618 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " -"awaiting a next item. The stack contains the async iterable in TOS1 and the " -"raised exception in TOS. Both are popped. If the exception is not :exc:" -"`StopAsyncIteration`, it is re-raised." +"awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " +"and the raised exception in ``STACK[-1]``. Both are popped. If the exception " +"is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:572 ../../library/dis.rst:650 -#: ../../library/dis.rst:661 +#: ../../library/dis.rst:625 ../../library/dis.rst:730 +#: ../../library/dis.rst:741 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:577 +#: ../../library/dis.rst:631 msgid "" -"Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the " -"stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack." +"Handles an exception raised during a :meth:`~generator.throw` or :meth:" +"`~generator.close` call through the current frame. If ``STACK[-1]`` is an " +"instance of :exc:`StopIteration`, pop three values from the stack and push " +"its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:584 -msgid "**Miscellaneous opcodes**" +#: ../../library/dis.rst:641 +msgid "" +"Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " +"``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:588 -msgid "" -"Implements the expression statement for the interactive mode. TOS is " -"removed from the stack and printed. In non-interactive mode, an expression " -"statement is terminated with :opcode:`POP_TOP`." +#: ../../library/dis.rst:650 +msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:595 -msgid "" -"Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions." +#: ../../library/dis.rst:659 +msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:600 -msgid "" -"Calls ``list.append(TOS1[-i], TOS)``. Used to implement list comprehensions." +#: ../../library/dis.rst:669 +msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:605 -msgid "" -"Calls ``dict.__setitem__(TOS1[-i], TOS1, TOS)``. Used to implement dict " -"comprehensions." +#: ../../library/dis.rst:680 +msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:609 -msgid "Map value is TOS and map key is TOS1. Before, those were reversed." +#: ../../library/dis.rst:683 +msgid "" +"Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " +"reversed." msgstr "" -#: ../../library/dis.rst:612 +#: ../../library/dis.rst:687 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -657,15 +664,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:620 -msgid "Returns with TOS to the caller of the function." +#: ../../library/dis.rst:695 +msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:625 -msgid "Pops TOS and yields it from a :term:`generator`." +#: ../../library/dis.rst:700 +msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:631 +#: ../../library/dis.rst:707 +msgid "Yields ``STACK.pop()`` from a :term:`generator`." +msgstr "" + +#: ../../library/dis.rst:709 +msgid "oparg set to be the stack depth." +msgstr "" + +#: ../../library/dis.rst:712 +msgid "" +"oparg set to be the exception block depth, for efficient closing of " +"generators." +msgstr "" + +#: ../../library/dis.rst:718 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -673,45 +694,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:641 -msgid "" -"Loads all symbols not starting with ``'_'`` directly from the module TOS to " -"the local namespace. The module is popped after loading all names. This " -"opcode implements ``from module import *``." -msgstr "" - -#: ../../library/dis.rst:648 +#: ../../library/dis.rst:728 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:655 +#: ../../library/dis.rst:735 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:666 +#: ../../library/dis.rst:746 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:674 +#: ../../library/dis.rst:754 msgid "" -"Performs exception matching for ``except``. Tests whether the TOS1 is an " -"exception matching TOS. Pops TOS and pushes the boolean result of the test." +"Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " +"is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " +"boolean result of the test." msgstr "" -#: ../../library/dis.rst:681 +#: ../../library/dis.rst:762 msgid "" -"Performs exception matching for ``except*``. Applies ``split(TOS)`` on the " -"exception group representing TOS1." +"Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " +"the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:684 +#: ../../library/dis.rst:765 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -719,16 +734,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:693 -msgid "" -"Combines the raised and reraised exceptions list from TOS, into an exception " -"group to propagate from a try-except* block. Uses the original exception " -"group from TOS1 to reconstruct the structure of reraised exceptions. Pops " -"two items from the stack and pushes the exception to reraise or ``None`` if " -"there isn't one." -msgstr "" - -#: ../../library/dis.rst:703 +#: ../../library/dis.rst:774 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -736,25 +742,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:710 +#: ../../library/dis.rst:781 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:717 +#: ../../library/dis.rst:788 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:725 +#: ../../library/dis.rst:796 msgid "" "Pushes :func:`builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:731 +#: ../../library/dis.rst:802 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -763,422 +769,495 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:742 -msgid "Push ``len(TOS)`` onto the stack." +#: ../../library/dis.rst:813 +msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:749 +#: ../../library/dis.rst:820 msgid "" -"If TOS is an instance of :class:`collections.abc.Mapping` (or, more " -"technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :c:" -"member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, " -"push ``False``." +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " +"more technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :" +"c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:759 +#: ../../library/dis.rst:830 msgid "" -"If TOS is an instance of :class:`collections.abc.Sequence` and is *not* an " -"instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more " -"technically: if it has the :const:`Py_TPFLAGS_SEQUENCE` flag set in its :c:" -"member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. Otherwise, " -"push ``False``." +"If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " +"*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " +"more technically: if it has the :const:`Py_TPFLAGS_SEQUENCE` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:769 +#: ../../library/dis.rst:840 msgid "" -"TOS is a tuple of mapping keys, and TOS1 is the match subject. If TOS1 " -"contains all of the keys in TOS, push a :class:`tuple` containing the " -"corresponding values. Otherwise, push ``None``." +"``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " +"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" +"class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:775 ../../library/dis.rst:1323 +#: ../../library/dis.rst:846 ../../library/dis.rst:1464 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:782 +#: ../../library/dis.rst:853 msgid "" -"Implements ``name = TOS``. *namei* is the index of *name* in the attribute :" -"attr:`co_names` of the code object. The compiler tries to use :opcode:" -"`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." +"Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " +"attribute :attr:`co_names` of the code object. The compiler tries to use :" +"opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:789 +#: ../../library/dis.rst:860 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`co_names` " "attribute of the code object." msgstr "" -#: ../../library/dis.rst:795 +#: ../../library/dis.rst:866 msgid "" -"Unpacks TOS into *count* individual values, which are put onto the stack " -"right-to-left." +"Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " +"stack right-to-left::" msgstr "" -#: ../../library/dis.rst:801 +#: ../../library/dis.rst:874 msgid "" -"Implements assignment with a starred target: Unpacks an iterable in TOS into " -"individual values, where the total number of values can be smaller than the " -"number of items in the iterable: one of the new values will be a list of all " -"leftover items." +"Implements assignment with a starred target: Unpacks an iterable in " +"``STACK[-1]`` into individual values, where the total number of values can " +"be smaller than the number of items in the iterable: one of the new values " +"will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:806 -msgid "" -"The low byte of *counts* is the number of values before the list value, the " -"high byte of *counts* the number of values after it. The resulting values " -"are put onto the stack right-to-left." +#: ../../library/dis.rst:879 +msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:881 msgid "" -"Implements ``TOS.name = TOS1``, where *namei* is the index of name in :attr:" -"`co_names`." +"The number of values before the list value is encoded in the argument of the " +"opcode. The number of values after the list if any is encoded using an " +"``EXTENDED_ARG``. As a consequence, the argument can be seen as a two bytes " +"values where the low byte of *counts* is the number of values before the " +"list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:819 +#: ../../library/dis.rst:887 msgid "" -"Implements ``del TOS.name``, using *namei* as index into :attr:`co_names`." +"The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " +"d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:899 +msgid "where *namei* is the index of name in :attr:`co_names`." +msgstr "" + +#: ../../library/dis.rst:908 +msgid "where *namei* is the index of name into :attr:`co_names`." +msgstr "" + +#: ../../library/dis.rst:913 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:829 +#: ../../library/dis.rst:918 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:834 +#: ../../library/dis.rst:923 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:839 -msgid "Pushes the value associated with ``co_names[namei]`` onto the stack." +#: ../../library/dis.rst:928 +msgid "" +"Pushes the value associated with ``co_names[namei]`` onto the stack. The " +"name is looked up within the locals, then the globals, then the builtins." +msgstr "" + +#: ../../library/dis.rst:934 +msgid "" +"Pushes a reference to the locals dictionary onto the stack. This is used to " +"prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" +"opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:844 +#: ../../library/dis.rst:943 +msgid "" +"Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " +"If the name is not found there, looks it up in the globals and then the " +"builtins, similar to :opcode:`LOAD_GLOBAL`. This is used for loading global " +"variables in :ref:`annotation scopes ` within class " +"bodies." +msgstr "" + +#: ../../library/dis.rst:954 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " -"resulting tuple onto the stack." +"resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:850 +#: ../../library/dis.rst:964 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:855 +#: ../../library/dis.rst:969 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:860 +#: ../../library/dis.rst:974 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " -"that the dictionary holds *count* entries: ``{..., TOS3: TOS2, TOS1: TOS}``." +"that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " +"STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:864 +#: ../../library/dis.rst:978 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:871 +#: ../../library/dis.rst:985 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " -"``TOS1``, pops *count* values to form values in the built dictionary." +"``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:880 +#: ../../library/dis.rst:994 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:1007 +msgid "Used to build lists." +msgstr "" + +#: ../../library/dis.rst:1019 +msgid "Used to build sets." +msgstr "" + +#: ../../library/dis.rst:1031 +msgid "Used to build dicts." +msgstr "" + +#: ../../library/dis.rst:1038 +msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." +msgstr "" + +#: ../../library/dis.rst:1045 msgid "" -"Pops a list from the stack and pushes a tuple containing the same values." +"If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " +"``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:895 -msgid "Calls ``list.extend(TOS1[-i], TOS)``. Used to build lists." +#: ../../library/dis.rst:1048 +msgid "" +"If the low bit of ``namei`` is set, this will attempt to load a method named " +"``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " +"popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method " +"with the correct name, the bytecode pushes the unbound method and " +"``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) " +"by :opcode:`CALL` when calling the unbound method. Otherwise, ``NULL`` and " +"the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:902 -msgid "Calls ``set.update(TOS1[-i], TOS)``. Used to build sets." +#: ../../library/dis.rst:1056 +msgid "" +"If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " +"the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:909 -msgid "Calls ``dict.update(TOS1[-i], TOS)``. Used to build dicts." +#: ../../library/dis.rst:1063 +msgid "" +"This opcode implements :func:`super` (e.g. ``super().method()`` and " +"``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " +"``namei`` is shifted left by 2 bits instead of 1, and instead of expecting a " +"single receiver on the stack, it expects three objects (from top of stack " +"down): ``self`` (the first argument to the current method), ``cls`` (the " +"class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:916 -msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." +#: ../../library/dis.rst:1070 +msgid "" +"The low bit of ``namei`` signals to attempt a method load, as with :opcode:" +"`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:923 -msgid "Replaces TOS with ``getattr(TOS, co_names[namei])``." +#: ../../library/dis.rst:1073 +msgid "" +"The second-low bit of ``namei``, if set, means that this was a two-argument " +"call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:928 +#: ../../library/dis.rst:1081 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:934 +#: ../../library/dis.rst:1087 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:941 +#: ../../library/dis.rst:1094 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:1101 msgid "" -"Imports the module ``co_names[namei]``. TOS and TOS1 are popped and provide " -"the *fromlist* and *level* arguments of :func:`__import__`. The module " -"object is pushed onto the stack. The current namespace is not affected: for " -"a proper import statement, a subsequent :opcode:`STORE_FAST` instruction " -"modifies the namespace." +"Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " +"popped and provide the *fromlist* and *level* arguments of :func:" +"`__import__`. The module object is pushed onto the stack. The current " +"namespace is not affected: for a proper import statement, a subsequent :" +"opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:957 +#: ../../library/dis.rst:1109 msgid "" -"Loads the attribute ``co_names[namei]`` from the module found in TOS. The " -"resulting object is pushed onto the stack, to be subsequently stored by a :" -"opcode:`STORE_FAST` instruction." +"Loads the attribute ``co_names[namei]`` from the module found in " +"``STACK[-1]``. The resulting object is pushed onto the stack, to be " +"subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:964 +#: ../../library/dis.rst:1116 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:969 +#: ../../library/dis.rst:1121 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:976 +#: ../../library/dis.rst:1128 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:983 +#: ../../library/dis.rst:1135 msgid "" -"If TOS is true, increments the bytecode counter by *delta*. TOS is popped." +"If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:990 +#: ../../library/dis.rst:1138 ../../library/dis.rst:1151 msgid "" -"If TOS is true, decrements the bytecode counter by *delta*. TOS is popped." +"The oparg is now a relative delta rather than an absolute target. This " +"opcode is a pseudo-instruction, replaced in final bytecode by the directed " +"versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:997 -msgid "" -"If TOS is false, increments the bytecode counter by *delta*. TOS is popped." +#: ../../library/dis.rst:1143 ../../library/dis.rst:1156 +#: ../../library/dis.rst:1169 ../../library/dis.rst:1183 +msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1004 +#: ../../library/dis.rst:1148 msgid "" -"If TOS is false, decrements the bytecode counter by *delta*. TOS is popped." +"If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1011 +#: ../../library/dis.rst:1161 msgid "" -"If TOS is not ``None``, increments the bytecode counter by *delta*. TOS is " -"popped." +"If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " +"*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1018 +#: ../../library/dis.rst:1164 ../../library/dis.rst:1178 msgid "" -"If TOS is not ``None``, decrements the bytecode counter by *delta*. TOS is " -"popped." +"This opcode is a pseudo-instruction, replaced in final bytecode by the " +"directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1025 +#: ../../library/dis.rst:1175 msgid "" -"If TOS is ``None``, increments the bytecode counter by *delta*. TOS is " -"popped." +"If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " +"``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1188 msgid "" -"If TOS is ``None``, decrements the bytecode counter by *delta*. TOS is " -"popped." +"``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " +"method. If this yields a new value, push it on the stack (leaving the " +"iterator below it). If the iterator indicates it is exhausted then the byte " +"code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1039 -msgid "" -"If TOS is true, increments the bytecode counter by *delta* and leaves TOS on " -"the stack. Otherwise (TOS is false), TOS is popped." +#: ../../library/dis.rst:1193 +msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1044 ../../library/dis.rst:1054 -msgid "The oparg is now a relative delta rather than an absolute target." +#: ../../library/dis.rst:1198 +msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1200 msgid "" -"If TOS is false, increments the bytecode counter by *delta* and leaves TOS " -"on the stack. Otherwise (TOS is true), TOS is popped." +"If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " +"before the global variable." msgstr "" -#: ../../library/dis.rst:1060 +#: ../../library/dis.rst:1206 msgid "" -"TOS is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If " -"this yields a new value, push it on the stack (leaving the iterator below " -"it). If the iterator indicates it is exhausted, TOS is popped, and the byte " -"code counter is incremented by *delta*." +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1068 -msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." +#: ../../library/dis.rst:1208 +msgid "" +"This opcode is now only used in situations where the local variable is " +"guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1214 msgid "" -"If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " -"before the global variable." +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " +"raising an :exc:`UnboundLocalError` if the local variable has not been " +"initialized." msgstr "" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:1222 msgid "" -"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." +"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " +"pushes ``NULL`` onto the stack if the local variable has not been " +"initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1081 -msgid "Stores TOS into the local ``co_varnames[var_num]``." +#: ../../library/dis.rst:1230 +msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1086 +#: ../../library/dis.rst:1235 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1091 +#: ../../library/dis.rst:1240 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1099 +#: ../../library/dis.rst:1248 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1102 +#: ../../library/dis.rst:1251 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1105 ../../library/dis.rst:1114 -#: ../../library/dis.rst:1126 ../../library/dis.rst:1135 -#: ../../library/dis.rst:1146 +#: ../../library/dis.rst:1254 ../../library/dis.rst:1263 +#: ../../library/dis.rst:1285 ../../library/dis.rst:1296 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1111 +#: ../../library/dis.rst:1260 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1120 +#: ../../library/dis.rst:1269 msgid "" -"Much like :opcode:`LOAD_DEREF` but first checks the locals dictionary before " -"consulting the cell. This is used for loading free variables in class " -"bodies." +"Pops a mapping off the stack and looks up the name associated with slot " +"``i`` of the \"fast locals\" storage in this mapping. If the name is not " +"found there, loads it from the cell contained in slot ``i``, similar to :" +"opcode:`LOAD_DEREF`. This is used for loading free variables in class bodies " +"(which previously used :opcode:`!LOAD_CLASSDEREF`) and in :ref:`annotation " +"scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1132 +#: ../../library/dis.rst:1282 msgid "" -"Stores TOS into the cell contained in slot ``i`` of the \"fast locals\" " -"storage." +"Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " +"locals\" storage." msgstr "" -#: ../../library/dis.rst:1141 +#: ../../library/dis.rst:1291 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1152 +#: ../../library/dis.rst:1302 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:1311 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1164 +#: ../../library/dis.rst:1314 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1165 -msgid "1: ``raise TOS`` (raise exception instance or type at ``TOS``)" +#: ../../library/dis.rst:1315 +msgid "" +"1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1166 +#: ../../library/dis.rst:1316 msgid "" -"2: ``raise TOS1 from TOS`` (raise exception instance or type at ``TOS1`` " -"with ``__cause__`` set to ``TOS``)" +"2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " +"``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1172 +#: ../../library/dis.rst:1322 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1177 +#: ../../library/dis.rst:1327 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1178 ../../library/dis.rst:1184 +#: ../../library/dis.rst:1328 ../../library/dis.rst:1334 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1179 +#: ../../library/dis.rst:1329 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1180 ../../library/dis.rst:1187 +#: ../../library/dis.rst:1330 ../../library/dis.rst:1337 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1182 +#: ../../library/dis.rst:1332 msgid "or:" msgstr "" -#: ../../library/dis.rst:1185 +#: ../../library/dis.rst:1335 msgid "``self``" msgstr "" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1336 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1189 +#: ../../library/dis.rst:1339 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1192 +#: ../../library/dis.rst:1342 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1351 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1190,80 +1269,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1216 -msgid "" -"Loads a method named ``co_names[namei]`` from the TOS object. TOS is popped. " -"This bytecode distinguishes two cases: if TOS has a method with the correct " -"name, the bytecode pushes the unbound method and TOS. TOS will be used as " -"the first argument (``self``) by :opcode:`CALL` when calling the unbound " -"method. Otherwise, ``NULL`` and the object return by the attribute lookup " -"are pushed." -msgstr "" - -#: ../../library/dis.rst:1228 -msgid "" -"Prefixes :opcode:`CALL`. Logically this is a no op. It exists to enable " -"effective specialization of calls. ``argc`` is the number of arguments as " -"described in :opcode:`CALL`." -msgstr "" - -#: ../../library/dis.rst:1237 +#: ../../library/dis.rst:1366 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1246 +#: ../../library/dis.rst:1375 msgid "" -"Prefixes :opcode:`PRECALL`. Stores a reference to ``co_consts[consti]`` into " -"an internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must " -"be a tuple of strings." +"Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " +"internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " +"tuple of strings." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1384 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1258 +#: ../../library/dis.rst:1387 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1389 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1390 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1262 +#: ../../library/dis.rst:1391 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1263 -msgid "the code associated with the function (at TOS)" +#: ../../library/dis.rst:1392 +msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1265 +#: ../../library/dis.rst:1394 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1268 -msgid "Qualified name at TOS was removed." +#: ../../library/dis.rst:1397 +msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1405 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " -"``slice(TOS1, TOS)`` is pushed; if it is 3, ``slice(TOS2, TOS1, TOS)`` is " -"pushed. See the :func:`slice` built-in function for more information." +"implements::" +msgstr "" + +#: ../../library/dis.rst:1411 +msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1418 +msgid "See the :func:`slice` built-in function for more information." +msgstr "" + +#: ../../library/dis.rst:1423 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1271,173 +1340,425 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1291 +#: ../../library/dis.rst:1431 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1295 +#: ../../library/dis.rst:1435 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1296 +#: ../../library/dis.rst:1436 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1298 +#: ../../library/dis.rst:1438 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1300 +#: ../../library/dis.rst:1440 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1442 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1305 +#: ../../library/dis.rst:1445 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1313 +#: ../../library/dis.rst:1453 msgid "" -"TOS is a tuple of keyword attribute names, TOS1 is the class being matched " -"against, and TOS2 is the match subject. *count* is the number of positional " -"sub-patterns." +"``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " +"class being matched against, and ``STACK[-3]`` is the match subject. " +"*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1457 msgid "" -"Pop TOS, TOS1, and TOS2. If TOS2 is an instance of TOS1 and has the " -"positional and keyword attributes required by *count* and TOS, push a tuple " -"of extracted attributes. Otherwise, push ``None``." +"Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " +"instance of ``STACK[-2]`` and has the positional and keyword attributes " +"required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. " +"Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1471 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1473 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1334 -msgid "``0`` The start of a function" +#: ../../library/dis.rst:1475 +msgid "" +"``0`` The start of a function, which is neither a generator, coroutine nor " +"an async generator" msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1477 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1478 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1337 +#: ../../library/dis.rst:1479 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1344 +#: ../../library/dis.rst:1486 msgid "" "Create a generator, coroutine, or async generator from the current frame. " +"Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1495 msgid "" -"Sends ``None`` to the sub-generator of this generator. Used in ``yield " +"Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1360 +#: ../../library/dis.rst:1498 msgid "" -"Wraps the value on top of the stack in an ``async_generator_wrapped_value``. " -"Used to yield in async generators." +"If the call raises :exc:`StopIteration`, pop both items, push the " +"exception's ``value`` attribute, and increment the bytecode counter by " +"*delta*." msgstr "" -#: ../../library/dis.rst:1368 +#: ../../library/dis.rst:1507 msgid "" "This is not really an opcode. It identifies the dividing line between " -"opcodes which don't use their argument and those that do (``< " -"HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." +"opcodes in the range [0,255] which don't use their argument and those that " +"do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1372 +#: ../../library/dis.rst:1511 +msgid "" +"If your application uses pseudo instructions, use the :data:`hasarg` " +"collection instead." +msgstr "" + +#: ../../library/dis.rst:1514 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1380 +#: ../../library/dis.rst:1518 +msgid "" +"Pseudo instructions were added to the :mod:`dis` module, and for them it is " +"not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " +"their arg." +msgstr "" + +#: ../../library/dis.rst:1526 +msgid "" +"Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " +"argument and sets ``STACK[-1]`` to the result. Used to implement " +"functionality that is necessary but not performance critical." +msgstr "" + +#: ../../library/dis.rst:1530 ../../library/dis.rst:1580 +msgid "The operand determines which intrinsic function is called:" +msgstr "" + +#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +msgid "Operand" +msgstr "" + +#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +msgid "Description" +msgstr "" + +#: ../../library/dis.rst:1535 +msgid "``INTRINSIC_1_INVALID``" +msgstr "" + +#: ../../library/dis.rst:1535 ../../library/dis.rst:1585 +msgid "Not valid" +msgstr "" + +#: ../../library/dis.rst:1537 +msgid "``INTRINSIC_PRINT``" +msgstr "" + +#: ../../library/dis.rst:1537 +msgid "Prints the argument to standard out. Used in the REPL." +msgstr "" + +#: ../../library/dis.rst:1540 +msgid "``INTRINSIC_IMPORT_STAR``" +msgstr "" + +#: ../../library/dis.rst:1540 +msgid "Performs ``import *`` for the named module." +msgstr "" + +#: ../../library/dis.rst:1543 +msgid "``INTRINSIC_STOPITERATION_ERROR``" +msgstr "" + +#: ../../library/dis.rst:1543 +msgid "Extracts the return value from a ``StopIteration`` exception." +msgstr "" + +#: ../../library/dis.rst:1546 +msgid "``INTRINSIC_ASYNC_GEN_WRAP``" +msgstr "" + +#: ../../library/dis.rst:1546 +msgid "Wraps an aync generator value" +msgstr "" + +#: ../../library/dis.rst:1548 +msgid "``INTRINSIC_UNARY_POSITIVE``" +msgstr "" + +#: ../../library/dis.rst:1548 +msgid "Performs the unary ``+`` operation" +msgstr "" + +#: ../../library/dis.rst:1551 +msgid "``INTRINSIC_LIST_TO_TUPLE``" +msgstr "" + +#: ../../library/dis.rst:1551 +msgid "Converts a list to a tuple" +msgstr "" + +#: ../../library/dis.rst:1553 +msgid "``INTRINSIC_TYPEVAR``" +msgstr "" + +#: ../../library/dis.rst:1553 +msgid "Creates a :class:`typing.TypeVar`" +msgstr "" + +#: ../../library/dis.rst:1555 +msgid "``INTRINSIC_PARAMSPEC``" +msgstr "" + +#: ../../library/dis.rst:1555 +msgid "Creates a :class:`typing.ParamSpec`" +msgstr "" + +#: ../../library/dis.rst:1558 +msgid "``INTRINSIC_TYPEVARTUPLE``" +msgstr "" + +#: ../../library/dis.rst:1558 +msgid "Creates a :class:`typing.TypeVarTuple`" +msgstr "" + +#: ../../library/dis.rst:1561 +msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" +msgstr "" + +#: ../../library/dis.rst:1561 +msgid "Returns :class:`typing.Generic` subscripted with the argument" +msgstr "" + +#: ../../library/dis.rst:1564 +msgid "``INTRINSIC_TYPEALIAS``" +msgstr "" + +#: ../../library/dis.rst:1564 +msgid "" +"Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " +"statement. The argument is a tuple of the type alias's name, type " +"parameters, and value." +msgstr "" + +#: ../../library/dis.rst:1576 +msgid "" +"Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " +"``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " +"implement functionality that is necessary but not performance critical." +msgstr "" + +#: ../../library/dis.rst:1585 +msgid "``INTRINSIC_2_INVALID``" +msgstr "" + +#: ../../library/dis.rst:1587 +msgid "``INTRINSIC_PREP_RERAISE_STAR``" +msgstr "" + +#: ../../library/dis.rst:1587 +msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." +msgstr "" + +#: ../../library/dis.rst:1591 +msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" +msgstr "" + +#: ../../library/dis.rst:1591 +msgid "Creates a :class:`typing.TypeVar` with a bound." +msgstr "" + +#: ../../library/dis.rst:1594 +msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" +msgstr "" + +#: ../../library/dis.rst:1594 +msgid "Creates a :class:`typing.TypeVar` with constraints." +msgstr "" + +#: ../../library/dis.rst:1598 +msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" +msgstr "" + +#: ../../library/dis.rst:1598 +msgid "Sets the ``__type_params__`` attribute of a function." +msgstr "" + +#: ../../library/dis.rst:1605 +msgid "**Pseudo-instructions**" +msgstr "" + +#: ../../library/dis.rst:1607 +msgid "" +"These opcodes do not appear in Python bytecode. They are used by the " +"compiler but are replaced by real opcodes or removed before bytecode is " +"generated." +msgstr "" + +#: ../../library/dis.rst:1612 +msgid "" +"Set up an exception handler for the following code block. If an exception " +"occurs, the value stack level is restored to its current state and control " +"is transferred to the exception handler at ``target``." +msgstr "" + +#: ../../library/dis.rst:1619 +msgid "" +"Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " +"instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " +"an exception occurs, the value stack level and the last instruction on the " +"frame are restored to their current state, and control is transferred to the " +"exception handler at ``target``." +msgstr "" + +#: ../../library/dis.rst:1628 +msgid "" +"Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " +"from the stack before control is transferred to the exception handler at " +"``target``." +msgstr "" + +#: ../../library/dis.rst:1632 +msgid "" +"This variant is used in :keyword:`with` and :keyword:`async with` " +"constructs, which push the return value of the context manager's :meth:" +"`~object.__enter__` or :meth:`~object.__aenter__` to the stack." +msgstr "" + +#: ../../library/dis.rst:1639 +msgid "" +"Marks the end of the code block associated with the last ``SETUP_FINALLY``, " +"``SETUP_CLEANUP`` or ``SETUP_WITH``." +msgstr "" + +#: ../../library/dis.rst:1645 +msgid "" +"Undirected relative jump instructions which are replaced by their directed " +"(forward/backward) counterparts by the assembler." +msgstr "" + +#: ../../library/dis.rst:1650 +msgid "" +"Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " +"flag set in the arg." +msgstr "" + +#: ../../library/dis.rst:1657 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1382 +#: ../../library/dis.rst:1659 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1662 +msgid "" +"The collections now contain pseudo instructions as well. These are opcodes " +"with values ``>= MIN_PSEUDO_OPCODE``." +msgstr "" + +#: ../../library/dis.rst:1668 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1673 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1678 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1402 +#: ../../library/dis.rst:1683 +msgid "Sequence of bytecodes that use their argument." +msgstr "" + +#: ../../library/dis.rst:1690 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1407 +#: ../../library/dis.rst:1695 msgid "" -"Sequence of bytecodes that access a free variable (note that 'free' in this " -"context refers to names in the current scope that are referenced by inner " -"scopes or names in outer scopes that are referenced from this scope. It " -"does *not* include references to global or builtin scopes)." +"Sequence of bytecodes that access a free variable. 'free' in this context " +"refers to names in the current scope that are referenced by inner scopes or " +"names in outer scopes that are referenced from this scope. It does *not* " +"include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1703 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1420 +#: ../../library/dis.rst:1708 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1425 +#: ../../library/dis.rst:1713 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1718 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1435 +#: ../../library/dis.rst:1723 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1274 +#: ../../library/dis.rst:1727 +msgid "Sequence of bytecodes that set an exception handler." +msgstr "" + +#: ../../library/dis.rst:1403 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1274 +#: ../../library/dis.rst:1403 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index 54f2f9ebbe..006c4b0d5e 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -311,7 +311,7 @@ msgid "" "preserve your backslashes exactly as you type them::" msgstr "" -#: ../../library/doctest.rst:357 +#: ../../library/doctest.rst:358 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:366 +#: ../../library/doctest.rst:368 msgid "The starting column doesn't matter::" msgstr "" -#: ../../library/doctest.rst:373 +#: ../../library/doctest.rst:375 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:380 +#: ../../library/doctest.rst:382 msgid "What's the Execution Context?" msgstr "" -#: ../../library/doctest.rst:382 +#: ../../library/doctest.rst:384 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:390 +#: ../../library/doctest.rst:392 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:397 +#: ../../library/doctest.rst:399 msgid "What About Exceptions?" msgstr "" -#: ../../library/doctest.rst:399 +#: ../../library/doctest.rst:401 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:405 +#: ../../library/doctest.rst:407 msgid "Simple example::" msgstr "" "簡單範例:\n" "\n" "::" -#: ../../library/doctest.rst:412 +#: ../../library/doctest.rst:414 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:415 +#: ../../library/doctest.rst:417 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:422 +#: ../../library/doctest.rst:424 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:426 +#: ../../library/doctest.rst:428 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:438 +#: ../../library/doctest.rst:440 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:441 +#: ../../library/doctest.rst:443 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:451 +#: ../../library/doctest.rst:453 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:457 +#: ../../library/doctest.rst:459 msgid "Some details you should read once, but won't need to remember:" msgstr "" -#: ../../library/doctest.rst:459 +#: ../../library/doctest.rst:461 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:466 +#: ../../library/doctest.rst:468 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:472 +#: ../../library/doctest.rst:474 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:476 +#: ../../library/doctest.rst:478 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:484 +#: ../../library/doctest.rst:486 msgid "" "For some exceptions, Python displays the position of the error using ``^`` " "markers and tildes::" msgstr "" -#: ../../library/doctest.rst:493 +#: ../../library/doctest.rst:495 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:508 +#: ../../library/doctest.rst:510 msgid "Option Flags" msgstr "" -#: ../../library/doctest.rst:510 +#: ../../library/doctest.rst:512 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:516 +#: ../../library/doctest.rst:518 msgid "The ``-o`` command line option." msgstr "" -#: ../../library/doctest.rst:519 +#: ../../library/doctest.rst:521 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:525 +#: ../../library/doctest.rst:527 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:537 +#: ../../library/doctest.rst:539 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:546 +#: ../../library/doctest.rst:548 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:557 +#: ../../library/doctest.rst:559 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -537,14 +537,14 @@ msgid "" "matched too much!\" surprises that ``.*`` is prone to in regular expressions." msgstr "" -#: ../../library/doctest.rst:566 +#: ../../library/doctest.rst:568 msgid "" "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:570 +#: ../../library/doctest.rst:572 msgid "" "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:" @@ -554,20 +554,20 @@ msgid "" "these variations will work with the flag specified:" msgstr "" -#: ../../library/doctest.rst:592 +#: ../../library/doctest.rst:594 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 the " "module name is present or matches exactly." msgstr "" -#: ../../library/doctest.rst:596 +#: ../../library/doctest.rst:598 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -#: ../../library/doctest.rst:603 +#: ../../library/doctest.rst:605 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, " @@ -576,32 +576,32 @@ msgid "" "might depend on resources which would be unavailable to the test driver." msgstr "" -#: ../../library/doctest.rst:609 +#: ../../library/doctest.rst:611 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" -#: ../../library/doctest.rst:614 +#: ../../library/doctest.rst:616 msgid "A bitmask or'ing together all the comparison flags above." msgstr "" -#: ../../library/doctest.rst:616 +#: ../../library/doctest.rst:618 msgid "The second group of options controls how test failures are reported:" msgstr "" -#: ../../library/doctest.rst:621 +#: ../../library/doctest.rst:623 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." msgstr "" -#: ../../library/doctest.rst:627 +#: ../../library/doctest.rst:629 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." msgstr "" -#: ../../library/doctest.rst:633 +#: ../../library/doctest.rst:635 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -611,7 +611,7 @@ msgid "" "mismatching column positions." msgstr "" -#: ../../library/doctest.rst:642 +#: ../../library/doctest.rst:644 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -622,7 +622,7 @@ msgid "" "of failures reported; only the output is suppressed." msgstr "" -#: ../../library/doctest.rst:653 +#: ../../library/doctest.rst:655 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 " @@ -630,23 +630,23 @@ msgid "" "first failure won't even produce debugging output." msgstr "" -#: ../../library/doctest.rst:658 +#: ../../library/doctest.rst:660 msgid "" "The doctest command line accepts the option ``-f`` as a shorthand for ``-o " "FAIL_FAST``." msgstr "" -#: ../../library/doctest.rst:666 +#: ../../library/doctest.rst:668 msgid "A bitmask or'ing together all the reporting flags above." msgstr "" -#: ../../library/doctest.rst:669 +#: ../../library/doctest.rst:671 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:675 +#: ../../library/doctest.rst:677 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 :" @@ -655,35 +655,35 @@ msgid "" "be called using the following idiom::" msgstr "" -#: ../../library/doctest.rst:691 +#: ../../library/doctest.rst:693 msgid "Directives" msgstr "" -#: ../../library/doctest.rst:693 +#: ../../library/doctest.rst:695 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:704 +#: ../../library/doctest.rst:706 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:708 +#: ../../library/doctest.rst:710 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:711 +#: ../../library/doctest.rst:713 msgid "For example, this test passes:" msgstr "" -#: ../../library/doctest.rst:720 +#: ../../library/doctest.rst:722 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 " @@ -691,26 +691,26 @@ msgid "" "a directive to do so:" msgstr "" -#: ../../library/doctest.rst:731 +#: ../../library/doctest.rst:733 msgid "" "Multiple directives can be used on a single physical line, separated by " "commas:" msgstr "" -#: ../../library/doctest.rst:740 +#: ../../library/doctest.rst:742 msgid "" "If multiple directive comments are used for a single example, then they are " "combined:" msgstr "" -#: ../../library/doctest.rst:750 +#: ../../library/doctest.rst:752 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:" msgstr "" -#: ../../library/doctest.rst:761 +#: ../../library/doctest.rst:763 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 " @@ -720,11 +720,11 @@ msgid "" "be useful." msgstr "" -#: ../../library/doctest.rst:771 +#: ../../library/doctest.rst:773 msgid "Warnings" msgstr "" -#: ../../library/doctest.rst:773 +#: ../../library/doctest.rst:775 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 " @@ -734,51 +734,51 @@ msgid "" "test like ::" msgstr "" -#: ../../library/doctest.rst:782 +#: ../../library/doctest.rst:784 msgid "is vulnerable! One workaround is to do ::" msgstr "" -#: ../../library/doctest.rst:787 +#: ../../library/doctest.rst:789 msgid "instead. Another is to do ::" msgstr "" -#: ../../library/doctest.rst:793 +#: ../../library/doctest.rst:795 msgid "There are others, but you get the idea." msgstr "" -#: ../../library/doctest.rst:795 +#: ../../library/doctest.rst:797 msgid "Another bad idea is to print things that embed an object address, like" msgstr "" -#: ../../library/doctest.rst:805 +#: ../../library/doctest.rst:807 msgid "" "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" -#: ../../library/doctest.rst:813 +#: ../../library/doctest.rst:815 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:824 +#: ../../library/doctest.rst:826 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:830 +#: ../../library/doctest.rst:832 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." msgstr "" -#: ../../library/doctest.rst:837 +#: ../../library/doctest.rst:839 msgid "Basic API" msgstr "" -#: ../../library/doctest.rst:839 +#: ../../library/doctest.rst:841 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -786,25 +786,25 @@ msgid "" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -#: ../../library/doctest.rst:847 +#: ../../library/doctest.rst:849 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:850 +#: ../../library/doctest.rst:852 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/doctest.rst:853 +#: ../../library/doctest.rst:855 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" msgstr "" -#: ../../library/doctest.rst:856 +#: ../../library/doctest.rst:858 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -814,20 +814,20 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" -#: ../../library/doctest.rst:863 +#: ../../library/doctest.rst:865 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:867 +#: ../../library/doctest.rst:869 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:870 +#: ../../library/doctest.rst:872 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-" @@ -836,7 +836,7 @@ msgid "" "is an error to specify *package* if *module_relative* is ``False``." msgstr "" -#: ../../library/doctest.rst:876 +#: ../../library/doctest.rst:878 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 " @@ -844,7 +844,7 @@ msgid "" "``None``, a new empty dict is used." msgstr "" -#: ../../library/doctest.rst:881 +#: ../../library/doctest.rst:883 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -857,27 +857,27 @@ msgid "" "tested." msgstr "" -#: ../../library/doctest.rst:890 +#: ../../library/doctest.rst:892 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:894 +#: ../../library/doctest.rst:896 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:898 +#: ../../library/doctest.rst:900 msgid "" "Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " "` of option flags. See section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:902 +#: ../../library/doctest.rst:904 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. " @@ -885,33 +885,33 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:907 ../../library/doctest.rst:1047 +#: ../../library/doctest.rst:909 ../../library/doctest.rst:1049 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:911 ../../library/doctest.rst:1051 +#: ../../library/doctest.rst:913 ../../library/doctest.rst:1053 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." msgstr "" -#: ../../library/doctest.rst:917 +#: ../../library/doctest.rst:919 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:920 +#: ../../library/doctest.rst:922 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:924 +#: ../../library/doctest.rst:926 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 " @@ -919,22 +919,22 @@ msgid "" "are searched directly, as if they were docstrings." msgstr "" -#: ../../library/doctest.rst:929 +#: ../../library/doctest.rst:931 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" -#: ../../library/doctest.rst:931 +#: ../../library/doctest.rst:933 msgid "Return ``(failure_count, test_count)``." msgstr "" -#: ../../library/doctest.rst:933 +#: ../../library/doctest.rst:935 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:936 +#: ../../library/doctest.rst:938 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " @@ -944,39 +944,39 @@ msgid "" "class:`DocTestFinder` constructor defaults to true." msgstr "" -#: ../../library/doctest.rst:943 +#: ../../library/doctest.rst:945 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:950 +#: ../../library/doctest.rst:952 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:953 +#: ../../library/doctest.rst:955 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:955 +#: ../../library/doctest.rst:957 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:958 +#: ../../library/doctest.rst:960 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:961 +#: ../../library/doctest.rst:963 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 " @@ -984,16 +984,16 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:965 +#: ../../library/doctest.rst:967 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:971 +#: ../../library/doctest.rst:973 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:973 +#: ../../library/doctest.rst:975 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 " @@ -1002,19 +1002,19 @@ msgid "" "discovery, include a :func:`load_tests` function in your test module::" msgstr "" -#: ../../library/doctest.rst:987 +#: ../../library/doctest.rst:989 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:993 +#: ../../library/doctest.rst:995 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:996 +#: ../../library/doctest.rst:998 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 " @@ -1023,21 +1023,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1002 +#: ../../library/doctest.rst:1004 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1004 +#: ../../library/doctest.rst:1006 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1006 +#: ../../library/doctest.rst:1008 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1009 +#: ../../library/doctest.rst:1011 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1048,14 +1048,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1017 +#: ../../library/doctest.rst:1019 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:1021 +#: ../../library/doctest.rst:1023 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-" @@ -1065,7 +1065,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1028 +#: ../../library/doctest.rst:1030 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 " @@ -1073,7 +1073,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1033 +#: ../../library/doctest.rst:1035 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* " @@ -1081,14 +1081,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1038 ../../library/doctest.rst:1072 +#: ../../library/doctest.rst:1040 ../../library/doctest.rst:1074 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:1042 +#: ../../library/doctest.rst:1044 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1096,17 +1096,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1054 +#: ../../library/doctest.rst:1056 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1060 +#: ../../library/doctest.rst:1062 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1062 +#: ../../library/doctest.rst:1064 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, " @@ -1115,42 +1115,42 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1068 +#: ../../library/doctest.rst:1070 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:1076 +#: ../../library/doctest.rst:1078 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:1079 +#: ../../library/doctest.rst:1081 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:1082 +#: ../../library/doctest.rst:1084 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1085 +#: ../../library/doctest.rst:1087 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1087 +#: ../../library/doctest.rst:1089 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1092 +#: ../../library/doctest.rst:1094 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " @@ -1159,14 +1159,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1098 +#: ../../library/doctest.rst:1100 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:1102 +#: ../../library/doctest.rst:1104 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 :" @@ -1179,23 +1179,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1112 +#: ../../library/doctest.rst:1114 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:1118 +#: ../../library/doctest.rst:1120 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1120 +#: ../../library/doctest.rst:1122 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:1123 +#: ../../library/doctest.rst:1125 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " @@ -1209,17 +1209,17 @@ msgid "" "`doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1134 +#: ../../library/doctest.rst:1136 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:1141 +#: ../../library/doctest.rst:1143 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1143 +#: ../../library/doctest.rst:1145 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 " @@ -1227,85 +1227,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1148 +#: ../../library/doctest.rst:1150 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:1151 +#: ../../library/doctest.rst:1153 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1154 +#: ../../library/doctest.rst:1156 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1157 +#: ../../library/doctest.rst:1159 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1160 +#: ../../library/doctest.rst:1162 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:1164 +#: ../../library/doctest.rst:1166 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1167 +#: ../../library/doctest.rst:1169 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1170 +#: ../../library/doctest.rst:1172 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1173 +#: ../../library/doctest.rst:1175 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1189 +#: ../../library/doctest.rst:1191 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1194 +#: ../../library/doctest.rst:1196 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:1198 +#: ../../library/doctest.rst:1200 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1204 +#: ../../library/doctest.rst:1206 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1210 +#: ../../library/doctest.rst:1212 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 " @@ -1313,57 +1313,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1218 +#: ../../library/doctest.rst:1220 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:1224 +#: ../../library/doctest.rst:1226 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:1231 +#: ../../library/doctest.rst:1233 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:1238 +#: ../../library/doctest.rst:1240 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:1245 +#: ../../library/doctest.rst:1247 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1250 +#: ../../library/doctest.rst:1252 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:1255 +#: ../../library/doctest.rst:1257 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1261 +#: ../../library/doctest.rst:1263 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:1268 +#: ../../library/doctest.rst:1270 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 " @@ -1371,7 +1371,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1276 +#: ../../library/doctest.rst:1278 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 " @@ -1380,20 +1380,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1285 +#: ../../library/doctest.rst:1287 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:1292 +#: ../../library/doctest.rst:1294 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:1298 +#: ../../library/doctest.rst:1300 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 " @@ -1402,11 +1402,11 @@ msgid "" "are set." msgstr "" -#: ../../library/doctest.rst:1307 +#: ../../library/doctest.rst:1309 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1312 +#: ../../library/doctest.rst:1314 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 " @@ -1414,48 +1414,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1317 +#: ../../library/doctest.rst:1319 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:1320 +#: ../../library/doctest.rst:1322 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:1323 +#: ../../library/doctest.rst:1325 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:1326 +#: ../../library/doctest.rst:1328 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:1330 +#: ../../library/doctest.rst:1332 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1335 +#: ../../library/doctest.rst:1337 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:1338 +#: ../../library/doctest.rst:1340 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:1342 +#: ../../library/doctest.rst:1344 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 " @@ -1463,26 +1463,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1346 +#: ../../library/doctest.rst:1348 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1350 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:1352 +#: ../../library/doctest.rst:1354 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1354 +#: ../../library/doctest.rst:1356 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1356 +#: ../../library/doctest.rst:1358 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 " @@ -1491,7 +1491,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1362 +#: ../../library/doctest.rst:1364 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1501,34 +1501,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1373 +#: ../../library/doctest.rst:1375 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1378 +#: ../../library/doctest.rst:1380 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:1382 ../../library/doctest.rst:1450 +#: ../../library/doctest.rst:1384 ../../library/doctest.rst:1452 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1387 +#: ../../library/doctest.rst:1389 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1390 +#: ../../library/doctest.rst:1392 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:1397 +#: ../../library/doctest.rst:1399 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 " @@ -1536,7 +1536,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1404 +#: ../../library/doctest.rst:1406 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 " @@ -1544,17 +1544,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1413 +#: ../../library/doctest.rst:1415 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1418 +#: ../../library/doctest.rst:1420 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1421 +#: ../../library/doctest.rst:1423 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1564,7 +1564,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1427 +#: ../../library/doctest.rst:1429 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 " @@ -1575,14 +1575,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1435 +#: ../../library/doctest.rst:1437 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:1439 +#: ../../library/doctest.rst:1441 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1591,56 +1591,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1445 +#: ../../library/doctest.rst:1447 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:1455 +#: ../../library/doctest.rst:1457 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:1459 +#: ../../library/doctest.rst:1461 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:1466 +#: ../../library/doctest.rst:1468 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:1470 ../../library/doctest.rst:1481 +#: ../../library/doctest.rst:1472 ../../library/doctest.rst:1483 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:1477 +#: ../../library/doctest.rst:1479 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:1488 +#: ../../library/doctest.rst:1490 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:1492 +#: ../../library/doctest.rst:1494 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1648,13 +1648,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1500 +#: ../../library/doctest.rst:1502 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1503 +#: ../../library/doctest.rst:1505 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, " @@ -1662,39 +1662,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1508 +#: ../../library/doctest.rst:1510 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:1512 +#: ../../library/doctest.rst:1514 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:1519 +#: ../../library/doctest.rst:1521 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:1522 +#: ../../library/doctest.rst:1524 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:1529 +#: ../../library/doctest.rst:1531 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1534 +#: ../../library/doctest.rst:1536 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1703,11 +1703,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1541 +#: ../../library/doctest.rst:1543 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1545 +#: ../../library/doctest.rst:1547 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1716,28 +1716,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1554 +#: ../../library/doctest.rst:1556 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:1562 +#: ../../library/doctest.rst:1564 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1564 +#: ../../library/doctest.rst:1566 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1566 +#: ../../library/doctest.rst:1568 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1569 +#: ../../library/doctest.rst:1571 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1745,13 +1745,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1574 +#: ../../library/doctest.rst:1576 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1577 +#: ../../library/doctest.rst:1579 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 " @@ -1759,21 +1759,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1592 +#: ../../library/doctest.rst:1594 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1625 +#: ../../library/doctest.rst:1627 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1631 +#: ../../library/doctest.rst:1633 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1633 +#: ../../library/doctest.rst:1635 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 " @@ -1781,22 +1781,22 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1648 +#: ../../library/doctest.rst:1650 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1658 +#: ../../library/doctest.rst:1660 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:1665 +#: ../../library/doctest.rst:1667 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1667 +#: ../../library/doctest.rst:1669 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 " @@ -1806,17 +1806,17 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" -#: ../../library/doctest.rst:1677 +#: ../../library/doctest.rst:1679 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:1683 +#: ../../library/doctest.rst:1685 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1685 +#: ../../library/doctest.rst:1687 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1824,13 +1824,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1690 +#: ../../library/doctest.rst:1692 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1693 +#: ../../library/doctest.rst:1695 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 " @@ -1842,30 +1842,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1704 +#: ../../library/doctest.rst:1706 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1706 +#: ../../library/doctest.rst:1708 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:1709 +#: ../../library/doctest.rst:1711 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1711 +#: ../../library/doctest.rst:1713 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:1716 +#: ../../library/doctest.rst:1718 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 " @@ -1873,7 +1873,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1724 +#: ../../library/doctest.rst:1726 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1883,89 +1883,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1731 +#: ../../library/doctest.rst:1733 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:1734 +#: ../../library/doctest.rst:1736 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1739 +#: ../../library/doctest.rst:1741 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:1743 +#: ../../library/doctest.rst:1745 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1748 ../../library/doctest.rst:1772 +#: ../../library/doctest.rst:1750 ../../library/doctest.rst:1774 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1753 ../../library/doctest.rst:1777 +#: ../../library/doctest.rst:1755 ../../library/doctest.rst:1779 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1758 +#: ../../library/doctest.rst:1760 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1763 +#: ../../library/doctest.rst:1765 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:1767 +#: ../../library/doctest.rst:1769 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1782 +#: ../../library/doctest.rst:1784 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1789 +#: ../../library/doctest.rst:1791 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1791 +#: ../../library/doctest.rst:1793 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1794 +#: ../../library/doctest.rst:1796 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1796 +#: ../../library/doctest.rst:1798 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1798 +#: ../../library/doctest.rst:1800 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1802 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:1804 +#: ../../library/doctest.rst:1806 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. " @@ -1977,7 +1977,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1812 +#: ../../library/doctest.rst:1814 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 " @@ -1998,13 +1998,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1830 +#: ../../library/doctest.rst:1832 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1833 +#: ../../library/doctest.rst:1835 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2012,7 +2012,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1838 +#: ../../library/doctest.rst:1840 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2020,13 +2020,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1842 +#: ../../library/doctest.rst:1844 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1845 +#: ../../library/doctest.rst:1847 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-" @@ -2034,11 +2034,11 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1867 +#: ../../library/doctest.rst:1869 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1868 +#: ../../library/doctest.rst:1870 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 " @@ -2053,34 +2053,34 @@ msgstr ">>>" msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/doctest.rst:318 ../../library/doctest.rst:554 +#: ../../library/doctest.rst:318 ../../library/doctest.rst:556 msgid "..." msgstr "..." -#: ../../library/doctest.rst:482 +#: ../../library/doctest.rst:484 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/doctest.rst:482 +#: ../../library/doctest.rst:484 msgid "marker" msgstr "marker(標記)" -#: ../../library/doctest.rst:534 +#: ../../library/doctest.rst:536 msgid "" msgstr "" -#: ../../library/doctest.rst:554 ../../library/doctest.rst:684 +#: ../../library/doctest.rst:556 ../../library/doctest.rst:686 msgid "in doctests" msgstr "於 doctests 中" -#: ../../library/doctest.rst:684 +#: ../../library/doctest.rst:686 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/doctest.rst:684 +#: ../../library/doctest.rst:686 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/doctest.rst:684 +#: ../../library/doctest.rst:686 msgid "- (minus)" msgstr "- (減號)" diff --git a/library/email.charset.po b/library/email.charset.po index ebd63c7956..a5110fa22a 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -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/email.po b/library/email.po index 7ec3841877..39e854f2cf 100644 --- a/library/email.po +++ b/library/email.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -188,7 +188,7 @@ msgstr ":mod:`nntplib` 模組" msgid "NNTP (Net News Transport Protocol) client" msgstr "" -#: ../../library/email.rst:149 +#: ../../library/email.rst:148 msgid "Module :mod:`mailbox`" msgstr ":mod:`mailbox` 模組" @@ -198,10 +198,5 @@ msgid "" "using a variety standard formats." msgstr "" -#: ../../library/email.rst:151 -msgid "Module :mod:`smtpd`" -msgstr ":mod:`smtpd` 模組" - -#: ../../library/email.rst:152 -msgid "SMTP server framework (primarily useful for testing)" -msgstr "" +#~ msgid "Module :mod:`smtpd`" +#~ msgstr ":mod:`smtpd` 模組" diff --git a/library/email.policy.po b/library/email.policy.po index 302c403ee8..452fa54120 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,7 +122,7 @@ msgid "" "system:" msgstr "" -#: ../../library/email.policy.rst:113 +#: ../../library/email.policy.rst:114 msgid "" "Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " "correct line separator characters when creating the binary string to feed " @@ -130,7 +130,7 @@ msgid "" "line separators." msgstr "" -#: ../../library/email.policy.rst:118 +#: ../../library/email.policy.rst:119 msgid "" "Some email package methods accept a *policy* keyword argument, allowing the " "policy to be overridden for that method. For example, the following code " @@ -139,20 +139,20 @@ msgid "" "line separators for the platform on which it is running::" msgstr "" -#: ../../library/email.policy.rst:129 +#: ../../library/email.policy.rst:130 msgid "" "Policy objects can also be combined using the addition operator, producing a " "policy object whose settings are a combination of the non-default values of " "the summed objects::" msgstr "" -#: ../../library/email.policy.rst:137 +#: ../../library/email.policy.rst:138 msgid "" "This operation is not commutative; that is, the order in which the objects " "are added matters. To illustrate::" msgstr "" -#: ../../library/email.policy.rst:152 +#: ../../library/email.policy.rst:153 msgid "" "This is the :term:`abstract base class` for all policy classes. It provides " "default implementations for a couple of trivial methods, as well as the " @@ -160,7 +160,7 @@ msgid "" "the constructor semantics." msgstr "" -#: ../../library/email.policy.rst:157 +#: ../../library/email.policy.rst:158 msgid "" "The constructor of a policy class can be passed various keyword arguments. " "The arguments that may be specified are any non-method properties on this " @@ -169,48 +169,48 @@ msgid "" "corresponding attribute." msgstr "" -#: ../../library/email.policy.rst:163 +#: ../../library/email.policy.rst:164 msgid "" "This class defines the following properties, and thus values for the " "following may be passed in the constructor of any policy class:" msgstr "" -#: ../../library/email.policy.rst:169 +#: ../../library/email.policy.rst:170 msgid "" "The maximum length of any line in the serialized output, not counting the " "end of line character(s). Default is 78, per :rfc:`5322`. A value of ``0`` " "or :const:`None` indicates that no line wrapping should be done at all." msgstr "" -#: ../../library/email.policy.rst:177 +#: ../../library/email.policy.rst:178 msgid "" "The string to be used to terminate lines in serialized output. The default " "is ``\\n`` because that's the internal end-of-line discipline used by " "Python, though ``\\r\\n`` is required by the RFCs." msgstr "" -#: ../../library/email.policy.rst:184 +#: ../../library/email.policy.rst:185 msgid "" "Controls the type of Content Transfer Encodings that may be or are required " "to be used. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:190 +#: ../../library/email.policy.rst:191 msgid "``7bit``" msgstr "``7bit``" -#: ../../library/email.policy.rst:190 +#: ../../library/email.policy.rst:191 msgid "" "all data must be \"7 bit clean\" (ASCII-only). This means that where " "necessary data will be encoded using either quoted-printable or base64 " "encoding." msgstr "" -#: ../../library/email.policy.rst:194 +#: ../../library/email.policy.rst:195 msgid "``8bit``" msgstr "``8bit``" -#: ../../library/email.policy.rst:194 +#: ../../library/email.policy.rst:195 msgid "" "data is not constrained to be 7 bit clean. Data in headers is still " "required to be ASCII-only and so will be encoded (see :meth:`fold_binary` " @@ -218,7 +218,7 @@ msgid "" "the ``8bit`` CTE." msgstr "" -#: ../../library/email.policy.rst:200 +#: ../../library/email.policy.rst:201 msgid "" "A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not " "``Generator``, because strings cannot contain binary data. If a " @@ -226,71 +226,71 @@ msgid "" "it will act as if ``cte_type`` is ``7bit``." msgstr "" -#: ../../library/email.policy.rst:208 +#: ../../library/email.policy.rst:209 msgid "" "If :const:`True`, any defects encountered will be raised as errors. If :" "const:`False` (the default), defects will be passed to the :meth:" "`register_defect` method." msgstr "" -#: ../../library/email.policy.rst:215 +#: ../../library/email.policy.rst:216 msgid "" "If :const:`True`, lines starting with *\"From \"* in the body are escaped by " "putting a ``>`` in front of them. This parameter is used when the message is " "being serialized by a generator. Default: :const:`False`." msgstr "" -#: ../../library/email.policy.rst:220 +#: ../../library/email.policy.rst:221 msgid "The *mangle_from_* parameter." msgstr "*mangle_from_* 參數。" -#: ../../library/email.policy.rst:226 +#: ../../library/email.policy.rst:227 msgid "" "A factory function for constructing a new empty message object. Used by the " "parser when building messages. Defaults to ``None``, in which case :class:" "`~email.message.Message` is used." msgstr "" -#: ../../library/email.policy.rst:232 +#: ../../library/email.policy.rst:233 msgid "" "The following :class:`Policy` method is intended to be called by code using " "the email library to create policy instances with custom settings:" msgstr "" -#: ../../library/email.policy.rst:238 +#: ../../library/email.policy.rst:239 msgid "" "Return a new :class:`Policy` instance whose attributes have the same values " "as the current instance, except where those attributes are given new values " "by the keyword arguments." msgstr "" -#: ../../library/email.policy.rst:243 +#: ../../library/email.policy.rst:244 msgid "" "The remaining :class:`Policy` methods are called by the email package code, " "and are not intended to be called by an application using the email package. " "A custom policy must implement all of these methods." msgstr "" -#: ../../library/email.policy.rst:250 +#: ../../library/email.policy.rst:251 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " "*defect* will always be a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:254 +#: ../../library/email.policy.rst:255 msgid "" "The default implementation checks the :attr:`raise_on_defect` flag. If it " "is ``True``, *defect* is raised as an exception. If it is ``False`` (the " "default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" -#: ../../library/email.policy.rst:261 +#: ../../library/email.policy.rst:262 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " "a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:264 +#: ../../library/email.policy.rst:265 msgid "" "The default implementation calls the ``append`` method of the ``defects`` " "attribute of *obj*. When the email package calls :attr:`handle_defect`, " @@ -300,11 +300,11 @@ msgid "" "defects in parsed messages will raise unexpected errors." msgstr "" -#: ../../library/email.policy.rst:274 +#: ../../library/email.policy.rst:275 msgid "Return the maximum allowed number of headers named *name*." msgstr "" -#: ../../library/email.policy.rst:276 +#: ../../library/email.policy.rst:277 msgid "" "Called when a header is added to an :class:`~email.message.EmailMessage` or :" "class:`~email.message.Message` object. If the returned value is not ``0`` " @@ -312,7 +312,7 @@ msgid "" "greater than or equal to the value returned, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/email.policy.rst:282 +#: ../../library/email.policy.rst:283 msgid "" "Because the default behavior of ``Message.__setitem__`` is to append the " "value to the list of headers, it is easy to create duplicate headers without " @@ -322,11 +322,11 @@ msgid "" "faithfully produce as many headers as exist in the message being parsed.)" msgstr "" -#: ../../library/email.policy.rst:290 +#: ../../library/email.policy.rst:291 msgid "The default implementation returns ``None`` for all header names." msgstr "" -#: ../../library/email.policy.rst:295 +#: ../../library/email.policy.rst:296 msgid "" "The email package calls this method with a list of strings, each string " "ending with the line separation characters found in the source being " @@ -336,7 +336,7 @@ msgid "" "the parsed header." msgstr "" -#: ../../library/email.policy.rst:302 +#: ../../library/email.policy.rst:303 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, *name* should be the case preserved name (all characters " @@ -345,16 +345,16 @@ msgid "" "stripped of leading whitespace." msgstr "" -#: ../../library/email.policy.rst:308 +#: ../../library/email.policy.rst:309 msgid "*sourcelines* may contain surrogateescaped binary data." msgstr "" -#: ../../library/email.policy.rst:310 ../../library/email.policy.rst:326 -#: ../../library/email.policy.rst:342 +#: ../../library/email.policy.rst:311 ../../library/email.policy.rst:327 +#: ../../library/email.policy.rst:343 msgid "There is no default implementation" msgstr "" -#: ../../library/email.policy.rst:315 +#: ../../library/email.policy.rst:316 msgid "" "The email package calls this method with the name and value provided by the " "application program when the application program is modifying a ``Message`` " @@ -363,14 +363,14 @@ msgid "" "``Message`` to represent the header." msgstr "" -#: ../../library/email.policy.rst:321 +#: ../../library/email.policy.rst:322 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, the *name* and *value* should be strings or string " "subclasses that do not change the content of the passed in arguments." msgstr "" -#: ../../library/email.policy.rst:331 +#: ../../library/email.policy.rst:332 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` when that header is requested by the application " @@ -381,13 +381,13 @@ msgid "" "returned to the application." msgstr "" -#: ../../library/email.policy.rst:339 +#: ../../library/email.policy.rst:340 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the value returned by the method." msgstr "" -#: ../../library/email.policy.rst:347 +#: ../../library/email.policy.rst:348 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` for a given header. The method should return a " @@ -397,32 +397,32 @@ msgid "" "discussion of the rules for folding email headers." msgstr "" -#: ../../library/email.policy.rst:354 +#: ../../library/email.policy.rst:355 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the string returned by the method." msgstr "" -#: ../../library/email.policy.rst:360 +#: ../../library/email.policy.rst:361 msgid "" "The same as :meth:`fold`, except that the returned value should be a bytes " "object rather than a string." msgstr "" -#: ../../library/email.policy.rst:363 +#: ../../library/email.policy.rst:364 msgid "" "*value* may contain surrogateescaped binary data. These could be converted " "back into binary data in the returned bytes object." msgstr "" -#: ../../library/email.policy.rst:370 +#: ../../library/email.policy.rst:371 msgid "" "This concrete :class:`Policy` provides behavior that is intended to be fully " "compliant with the current email RFCs. These include (but are not limited " "to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" -#: ../../library/email.policy.rst:374 +#: ../../library/email.policy.rst:375 msgid "" "This policy adds new header parsing and folding algorithms. Instead of " "simple strings, headers are ``str`` subclasses with attributes that depend " @@ -430,23 +430,23 @@ msgid "" "implement :rfc:`2047` and :rfc:`5322`." msgstr "" -#: ../../library/email.policy.rst:379 +#: ../../library/email.policy.rst:380 msgid "" "The default value for the :attr:`~email.policy.Policy.message_factory` " "attribute is :class:`~email.message.EmailMessage`." msgstr "" -#: ../../library/email.policy.rst:382 +#: ../../library/email.policy.rst:383 msgid "" "In addition to the settable attributes listed above that apply to all " "policies, this policy adds the following additional attributes:" msgstr "" -#: ../../library/email.policy.rst:385 +#: ../../library/email.policy.rst:386 msgid "[1]_" msgstr "" -#: ../../library/email.policy.rst:390 +#: ../../library/email.policy.rst:391 msgid "" "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " "by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and " @@ -454,7 +454,7 @@ msgid "" "passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." msgstr "" -#: ../../library/email.policy.rst:399 +#: ../../library/email.policy.rst:400 msgid "" "If the value for a header in the ``Message`` object originated from a :mod:" "`~email.parser` (as opposed to being set by a program), this attribute " @@ -462,37 +462,37 @@ msgid "" "transforming the message back into serialized form. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:406 +#: ../../library/email.policy.rst:407 msgid "``none``" msgstr "``none``" -#: ../../library/email.policy.rst:406 +#: ../../library/email.policy.rst:407 msgid "all source values use original folding" msgstr "" -#: ../../library/email.policy.rst:408 +#: ../../library/email.policy.rst:409 msgid "``long``" msgstr "``long``" -#: ../../library/email.policy.rst:408 +#: ../../library/email.policy.rst:409 msgid "" "source values that have any line that is longer than ``max_line_length`` " "will be refolded" msgstr "" -#: ../../library/email.policy.rst:411 +#: ../../library/email.policy.rst:412 msgid "``all``" msgstr "``all``" -#: ../../library/email.policy.rst:411 +#: ../../library/email.policy.rst:412 msgid "all values are refolded." msgstr "" -#: ../../library/email.policy.rst:414 +#: ../../library/email.policy.rst:415 msgid "The default is ``long``." msgstr "預設為 ``long``\\ 。" -#: ../../library/email.policy.rst:419 +#: ../../library/email.policy.rst:420 msgid "" "A callable that takes two arguments, ``name`` and ``value``, where ``name`` " "is a header field name and ``value`` is an unfolded header field value, and " @@ -503,7 +503,7 @@ msgid "" "custom parsing will be added in the future." msgstr "" -#: ../../library/email.policy.rst:430 +#: ../../library/email.policy.rst:431 msgid "" "An object with at least two methods: get_content and set_content. When the :" "meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." @@ -514,20 +514,20 @@ msgid "" "``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." msgstr "" -#: ../../library/email.policy.rst:442 ../../library/email.policy.rst:600 +#: ../../library/email.policy.rst:443 ../../library/email.policy.rst:601 msgid "" "The class provides the following concrete implementations of the abstract " "methods of :class:`Policy`:" msgstr "" -#: ../../library/email.policy.rst:448 +#: ../../library/email.policy.rst:449 msgid "" "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " "attribute of the specialized class used to represent the header with the " "given name." msgstr "" -#: ../../library/email.policy.rst:456 ../../library/email.policy.rst:606 +#: ../../library/email.policy.rst:457 ../../library/email.policy.rst:607 msgid "" "The name is parsed as everything up to the '``:``' and returned unmodified. " "The value is determined by stripping leading whitespace off the remainder of " @@ -535,7 +535,7 @@ msgid "" "trailing carriage return or linefeed characters." msgstr "" -#: ../../library/email.policy.rst:464 +#: ../../library/email.policy.rst:465 msgid "" "The name is returned unchanged. If the input value has a ``name`` attribute " "and it matches *name* ignoring case, the value is returned unchanged. " @@ -544,7 +544,7 @@ msgid "" "``ValueError`` is raised if the input value contains CR or LF characters." msgstr "" -#: ../../library/email.policy.rst:474 +#: ../../library/email.policy.rst:475 msgid "" "If the value has a ``name`` attribute, it is returned to unmodified. " "Otherwise the *name*, and the *value* with any CR or LF characters removed, " @@ -553,7 +553,7 @@ msgid "" "character glyph." msgstr "" -#: ../../library/email.policy.rst:483 +#: ../../library/email.policy.rst:484 msgid "" "Header folding is controlled by the :attr:`refold_source` policy setting. A " "value is considered to be a 'source value' if and only if it does not have a " @@ -565,7 +565,7 @@ msgid "" "current policy." msgstr "" -#: ../../library/email.policy.rst:492 +#: ../../library/email.policy.rst:493 msgid "" "Source values are split into lines using :meth:`~str.splitlines`. If the " "value is not to be refolded, the lines are rejoined using the ``linesep`` " @@ -575,13 +575,13 @@ msgid "" "using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:502 +#: ../../library/email.policy.rst:503 msgid "" "The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " "that the returned value is bytes." msgstr "" -#: ../../library/email.policy.rst:505 +#: ../../library/email.policy.rst:506 msgid "" "If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " "back into bytes. Headers with binary data are not refolded, regardless of " @@ -589,7 +589,7 @@ msgid "" "binary data consists of single byte characters or multibyte characters." msgstr "" -#: ../../library/email.policy.rst:512 +#: ../../library/email.policy.rst:513 msgid "" "The following instances of :class:`EmailPolicy` provide defaults suitable " "for specific application domains. Note that in the future the behavior of " @@ -597,20 +597,20 @@ msgid "" "conform even more closely to the RFCs relevant to their domains." msgstr "" -#: ../../library/email.policy.rst:520 +#: ../../library/email.policy.rst:521 msgid "" "An instance of ``EmailPolicy`` with all defaults unchanged. This policy " -"uses the standard Python ``\\n`` line endings rather than the RFC-correct ``" -"\\r\\n``." +"uses the standard Python ``\\n`` line endings rather than the RFC-correct " +"``\\r\\n``." msgstr "" -#: ../../library/email.policy.rst:527 +#: ../../library/email.policy.rst:528 msgid "" "Suitable for serializing messages in conformance with the email RFCs. Like " "``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" -#: ../../library/email.policy.rst:534 +#: ../../library/email.policy.rst:535 msgid "" "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " "Useful for serializing messages to a message store without using encoded " @@ -619,46 +619,46 @@ msgid "" "SMTP.send_message` method handles this automatically)." msgstr "" -#: ../../library/email.policy.rst:543 +#: ../../library/email.policy.rst:544 msgid "" "Suitable for serializing headers with for use in HTTP traffic. Like " "``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" -#: ../../library/email.policy.rst:549 +#: ../../library/email.policy.rst:550 msgid "" "Convenience instance. The same as ``default`` except that " "``raise_on_defect`` is set to ``True``. This allows any policy to be made " "strict by writing::" msgstr "" -#: ../../library/email.policy.rst:556 +#: ../../library/email.policy.rst:557 msgid "" "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " "of the email package is changed from the Python 3.2 API in the following " "ways:" msgstr "" -#: ../../library/email.policy.rst:559 +#: ../../library/email.policy.rst:560 msgid "" "Setting a header on a :class:`~email.message.Message` results in that header " "being parsed and a header object created." msgstr "" -#: ../../library/email.policy.rst:562 +#: ../../library/email.policy.rst:563 msgid "" "Fetching a header value from a :class:`~email.message.Message` results in " "that header being parsed and a header object created and returned." msgstr "" -#: ../../library/email.policy.rst:566 +#: ../../library/email.policy.rst:567 msgid "" "Any header object, or any header that is refolded due to the policy " "settings, is folded using an algorithm that fully implements the RFC folding " "algorithms, including knowing where encoded words are required and allowed." msgstr "" -#: ../../library/email.policy.rst:571 +#: ../../library/email.policy.rst:572 msgid "" "From the application view, this means that any header obtained through the :" "class:`~email.message.EmailMessage` is a header object with extra " @@ -668,13 +668,13 @@ msgid "" "the unicode string into the correct RFC encoded form." msgstr "" -#: ../../library/email.policy.rst:578 +#: ../../library/email.policy.rst:579 msgid "" "The header objects and their attributes are described in :mod:`~email." "headerregistry`." msgstr "" -#: ../../library/email.policy.rst:585 +#: ../../library/email.policy.rst:586 msgid "" "This concrete :class:`Policy` is the backward compatibility policy. It " "replicates the behavior of the email package in Python 3.2. The :mod:" @@ -683,28 +683,28 @@ msgid "" "of the email package is to maintain compatibility with Python 3.2." msgstr "" -#: ../../library/email.policy.rst:591 +#: ../../library/email.policy.rst:592 msgid "" "The following attributes have values that are different from the :class:" "`Policy` default:" msgstr "" -#: ../../library/email.policy.rst:597 +#: ../../library/email.policy.rst:598 msgid "The default is ``True``." msgstr "" -#: ../../library/email.policy.rst:614 +#: ../../library/email.policy.rst:615 msgid "The name and value are returned unmodified." msgstr "" -#: ../../library/email.policy.rst:619 +#: ../../library/email.policy.rst:620 msgid "" "If the value contains binary data, it is converted into a :class:`~email." "header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " "returned unmodified." msgstr "" -#: ../../library/email.policy.rst:626 +#: ../../library/email.policy.rst:627 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -712,7 +712,7 @@ msgid "" "encoded using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:634 +#: ../../library/email.policy.rst:635 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -722,17 +722,17 @@ msgid "" "and any (RFC invalid) binary data it may contain." msgstr "" -#: ../../library/email.policy.rst:644 +#: ../../library/email.policy.rst:645 msgid "" "An instance of :class:`Compat32`, providing backward compatibility with the " "behavior of the email package in Python 3.2." msgstr "" -#: ../../library/email.policy.rst:649 +#: ../../library/email.policy.rst:650 msgid "Footnotes" msgstr "註解" -#: ../../library/email.policy.rst:650 +#: ../../library/email.policy.rst:651 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." diff --git a/library/email.utils.po b/library/email.utils.po index 7658bb14b4..2918eb0d80 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -38,15 +38,15 @@ msgid "" "return current time. Otherwise *dt* argument should be a :class:`~datetime." "datetime` instance, and it is converted to the local time zone according to " "the system time zone database. If *dt* is naive (that is, ``dt.tzinfo`` is " -"``None``), it is assumed to be in local time. In this case, a positive or " -"zero value for *isdst* causes ``localtime`` to presume initially that summer " -"time (for example, Daylight Saving Time) is or is not (respectively) in " -"effect for the specified time. A negative value for *isdst* causes the " -"``localtime`` to attempt to divine whether summer time is in effect for the " -"specified time." +"``None``), it is assumed to be in local time. The *isdst* parameter is " +"ignored." msgstr "" -#: ../../library/email.utils.rst:32 +#: ../../library/email.utils.rst:26 +msgid "The *isdst* parameter." +msgstr "" + +#: ../../library/email.utils.rst:30 msgid "" "Returns a string suitable for an :rfc:`2822`\\ -compliant :mailheader:" "`Message-ID` header. Optional *idstring* if given, is a string used to " @@ -57,11 +57,11 @@ msgid "" "consistent domain name across multiple hosts." msgstr "" -#: ../../library/email.utils.rst:40 +#: ../../library/email.utils.rst:38 msgid "Added the *domain* keyword." msgstr "新增 *domain* 關鍵字。" -#: ../../library/email.utils.rst:44 +#: ../../library/email.utils.rst:42 msgid "" "The remaining functions are part of the legacy (``Compat32``) email API. " "There is no need to directly use these with the new API, since the parsing " @@ -69,20 +69,20 @@ msgid "" "machinery of the new API." msgstr "" -#: ../../library/email.utils.rst:52 +#: ../../library/email.utils.rst:50 msgid "" "Return a new string with backslashes in *str* replaced by two backslashes, " "and double quotes replaced by backslash-double quote." msgstr "" -#: ../../library/email.utils.rst:58 +#: ../../library/email.utils.rst:56 msgid "" "Return a new string which is an *unquoted* version of *str*. If *str* ends " "and begins with double quotes, they are stripped off. Likewise if *str* " "ends and begins with angle brackets, they are stripped off." msgstr "" -#: ../../library/email.utils.rst:65 +#: ../../library/email.utils.rst:63 msgid "" "Parse address -- which should be the value of some address-containing field " "such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent " @@ -90,7 +90,14 @@ msgid "" "unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." msgstr "" -#: ../../library/email.utils.rst:73 +#: ../../library/email.utils.rst:68 +msgid "" +"For security reasons, addresses that were ambiguous and could parse into " +"multiple different addresses now cause ``('', '')`` to be returned instead " +"of only one of the *potential* addresses." +msgstr "" + +#: ../../library/email.utils.rst:76 msgid "" "The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " "``(realname, email_address)`` and returns the string value suitable for a :" @@ -98,7 +105,7 @@ msgid "" "is false, then the second element is returned unmodified." msgstr "" -#: ../../library/email.utils.rst:78 +#: ../../library/email.utils.rst:81 msgid "" "Optional *charset* is the character set that will be used in the :rfc:`2047` " "encoding of the ``realname`` if the ``realname`` contains non-ASCII " @@ -106,20 +113,50 @@ msgid "" "Charset`. Defaults to ``utf-8``." msgstr "" -#: ../../library/email.utils.rst:83 +#: ../../library/email.utils.rst:86 msgid "Added the *charset* option." msgstr "新增 *charset* 選項。" -#: ../../library/email.utils.rst:89 +#: ../../library/email.utils.rst:92 msgid "" "This method returns a list of 2-tuples of the form returned by " "``parseaddr()``. *fieldvalues* is a sequence of header field values as might " "be returned by :meth:`Message.get_all `. " -"Here's a simple example that gets all the recipients of a message::" +"Here's a simple example that gets all the recipients of a message:" +msgstr "" + +#: ../../library/email.utils.rst:97 +msgid "from email.utils import getaddresses" +msgstr "" + +#: ../../library/email.utils.rst:99 +msgid "" +"tos = msg.get_all('to', []) ccs = msg.get_all('cc', []) resent_tos = msg." +"get_all('resent-to', []) resent_ccs = msg.get_all('resent-cc', []) " +"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" msgstr "" #: ../../library/email.utils.rst:105 msgid "" +"When parsing fails for a single fieldvalue, a 2-tuple of ``('', '')`` is " +"returned in its place. Other errors in parsing the list of addresses such " +"as a fieldvalue seemingly parsing into multiple addresses may result in a " +"list containing a single empty 2-tuple ``[('', '')]`` being returned rather " +"than returning potentially invalid output." +msgstr "" + +#: ../../library/email.utils.rst:112 +msgid "Example malformed input parsing:" +msgstr "" + +#: ../../library/email.utils.rst:120 +msgid "" +"The 2-tuple of ``('', '')`` in the returned values when parsing fails were " +"added as to address a security issue." +msgstr "" + +#: ../../library/email.utils.rst:127 +msgid "" "Attempts to parse a date according to the rules in :rfc:`2822`. however, " "some mailers don't follow that format as specified, so :func:`parsedate` " "tries to guess correctly in such cases. *date* is a string containing an :" @@ -129,7 +166,7 @@ msgid "" "returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." msgstr "" -#: ../../library/email.utils.rst:116 +#: ../../library/email.utils.rst:138 msgid "" "Performs the same function as :func:`parsedate`, but returns either ``None`` " "or a 10-tuple; the first 9 elements make up a tuple that can be passed " @@ -140,7 +177,7 @@ msgid "" "the result tuple are not usable." msgstr "" -#: ../../library/email.utils.rst:126 +#: ../../library/email.utils.rst:148 msgid "" "The inverse of :func:`format_datetime`. Performs the same function as :func:" "`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise " @@ -154,25 +191,25 @@ msgid "" "corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." msgstr "" -#: ../../library/email.utils.rst:142 +#: ../../library/email.utils.rst:164 msgid "" "Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp " "(seconds since the Epoch). If the timezone item in the tuple is ``None``, " "assume local time." msgstr "" -#: ../../library/email.utils.rst:149 +#: ../../library/email.utils.rst:171 msgid "Returns a date string as per :rfc:`2822`, e.g.::" msgstr "" -#: ../../library/email.utils.rst:153 +#: ../../library/email.utils.rst:175 msgid "" "Optional *timeval* if given is a floating point time value as accepted by :" "func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " "used." msgstr "" -#: ../../library/email.utils.rst:157 +#: ../../library/email.utils.rst:179 msgid "" "Optional *localtime* is a flag that when ``True``, interprets *timeval*, and " "returns a date relative to the local timezone instead of UTC, properly " @@ -180,7 +217,7 @@ msgid "" "UTC is used." msgstr "" -#: ../../library/email.utils.rst:162 +#: ../../library/email.utils.rst:184 msgid "" "Optional *usegmt* is a flag that when ``True``, outputs a date string with " "the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. " @@ -188,7 +225,7 @@ msgid "" "*localtime* is ``False``. The default is ``False``." msgstr "" -#: ../../library/email.utils.rst:170 +#: ../../library/email.utils.rst:192 msgid "" "Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is " "a naive datetime, it is assumed to be \"UTC with no information about the " @@ -200,11 +237,11 @@ msgid "" "date headers." msgstr "" -#: ../../library/email.utils.rst:184 +#: ../../library/email.utils.rst:206 msgid "Decode the string *s* according to :rfc:`2231`." msgstr "" -#: ../../library/email.utils.rst:189 +#: ../../library/email.utils.rst:211 msgid "" "Encode the string *s* according to :rfc:`2231`. Optional *charset* and " "*language*, if given is the character set name and language name to use. If " @@ -213,7 +250,7 @@ msgid "" "*language*." msgstr "" -#: ../../library/email.utils.rst:197 +#: ../../library/email.utils.rst:219 msgid "" "When a header parameter is encoded in :rfc:`2231` format, :meth:`Message." "get_param ` may return a 3-tuple containing " @@ -225,23 +262,23 @@ msgid "" "defaults to ``'us-ascii'``." msgstr "" -#: ../../library/email.utils.rst:206 +#: ../../library/email.utils.rst:228 msgid "" "For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is " "not a tuple, it should be a string and it is returned unquoted." msgstr "" -#: ../../library/email.utils.rst:212 +#: ../../library/email.utils.rst:234 msgid "" "Decode parameters list according to :rfc:`2231`. *params* is a sequence of " "2-tuples containing elements of the form ``(content-type, string-value)``." msgstr "" -#: ../../library/email.utils.rst:217 +#: ../../library/email.utils.rst:239 msgid "Footnotes" msgstr "註解" -#: ../../library/email.utils.rst:218 +#: ../../library/email.utils.rst:240 msgid "" "Note that the sign of the timezone offset is the opposite of the sign of the " "``time.timezone`` variable for the same timezone; the latter variable " diff --git a/library/enum.po b/library/enum.po index b5d42bb37a..c9a1dcacc0 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-20 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,68 +210,69 @@ msgstr ":func:`~enum.property`" #: ../../library/enum.rst:121 msgid "" "Allows :class:`Enum` members to have attributes without conflicting with " -"member names." +"member names. The ``value`` and ``name`` attributes are implemented this " +"way." msgstr "" -#: ../../library/enum.rst:124 +#: ../../library/enum.rst:125 msgid ":func:`unique`" msgstr ":func:`unique`" -#: ../../library/enum.rst:126 +#: ../../library/enum.rst:127 msgid "" "Enum class decorator that ensures only one name is bound to any one value." msgstr "" -#: ../../library/enum.rst:128 +#: ../../library/enum.rst:129 msgid ":func:`verify`" msgstr ":func:`verify`" -#: ../../library/enum.rst:130 +#: ../../library/enum.rst:131 msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." msgstr "" -#: ../../library/enum.rst:133 +#: ../../library/enum.rst:134 msgid ":func:`member`" msgstr ":func:`member`" -#: ../../library/enum.rst:135 +#: ../../library/enum.rst:136 msgid "Make ``obj`` a member. Can be used as a decorator." msgstr "" -#: ../../library/enum.rst:137 +#: ../../library/enum.rst:138 msgid ":func:`nonmember`" msgstr ":func:`nonmember`" -#: ../../library/enum.rst:139 +#: ../../library/enum.rst:140 msgid "Do not make ``obj`` a member. Can be used as a decorator." msgstr "" -#: ../../library/enum.rst:141 +#: ../../library/enum.rst:142 msgid ":func:`global_enum`" msgstr ":func:`global_enum`" -#: ../../library/enum.rst:143 +#: ../../library/enum.rst:144 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " "members as belonging to the module instead of its class, and export the enum " "members to the global namespace." msgstr "" -#: ../../library/enum.rst:147 +#: ../../library/enum.rst:148 msgid ":func:`show_flag_values`" msgstr ":func:`show_flag_values`" -#: ../../library/enum.rst:149 +#: ../../library/enum.rst:150 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "" -#: ../../library/enum.rst:152 +#: ../../library/enum.rst:153 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "``Flag``, ``IntFlag``, ``auto``" -#: ../../library/enum.rst:153 +#: ../../library/enum.rst:154 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" @@ -279,18 +280,18 @@ msgstr "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -#: ../../library/enum.rst:158 +#: ../../library/enum.rst:159 msgid "Data Types" msgstr "" -#: ../../library/enum.rst:163 +#: ../../library/enum.rst:164 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" -#: ../../library/enum.rst:167 +#: ../../library/enum.rst:168 msgid "" "*EnumType* is responsible for setting the correct :meth:`!__repr__`, :meth:`!" "__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final " @@ -298,11 +299,11 @@ msgid "" "providing iteration over the enum class, etc." msgstr "" -#: ../../library/enum.rst:174 +#: ../../library/enum.rst:175 msgid "This method is called in two different ways:" msgstr "" -#: ../../library/enum.rst:176 +#: ../../library/enum.rst:177 msgid "to look up an existing member:" msgstr "" @@ -310,7 +311,7 @@ msgstr "" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:178 ../../library/enum.rst:184 +#: ../../library/enum.rst:179 ../../library/enum.rst:185 msgid "The enum class being called." msgstr "" @@ -318,17 +319,17 @@ msgstr "" msgid "value" msgstr "" -#: ../../library/enum.rst:179 +#: ../../library/enum.rst:180 msgid "The value to lookup." msgstr "" -#: ../../library/enum.rst:181 +#: ../../library/enum.rst:182 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" msgstr "" -#: ../../library/enum.rst:185 +#: ../../library/enum.rst:186 msgid "The name of the new Enum to create." msgstr "" @@ -336,7 +337,7 @@ msgstr "" msgid "names" msgstr "" -#: ../../library/enum.rst:186 +#: ../../library/enum.rst:187 msgid "The names/values of the members for the new Enum." msgstr "" @@ -344,7 +345,7 @@ msgstr "" msgid "module" msgstr "模組" -#: ../../library/enum.rst:187 +#: ../../library/enum.rst:188 msgid "The name of the module the new Enum is created in." msgstr "" @@ -352,7 +353,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../library/enum.rst:188 +#: ../../library/enum.rst:189 msgid "The actual location in the module where this Enum can be found." msgstr "" @@ -360,7 +361,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../library/enum.rst:189 +#: ../../library/enum.rst:190 msgid "A mix-in type for the new Enum." msgstr "" @@ -368,7 +369,7 @@ msgstr "" msgid "start" msgstr "" -#: ../../library/enum.rst:190 +#: ../../library/enum.rst:191 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "" @@ -376,89 +377,83 @@ msgstr "" msgid "boundary" msgstr "" -#: ../../library/enum.rst:191 +#: ../../library/enum.rst:192 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "" -#: ../../library/enum.rst:195 +#: ../../library/enum.rst:196 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "" -#: ../../library/enum.rst:203 +#: ../../library/enum.rst:204 msgid "" "In Python 3.12 it will be possible to check for member values and not just " "members; until then, a ``TypeError`` will be raised if a non-Enum-member is " "used in a containment check." msgstr "" -#: ../../library/enum.rst:209 +#: ../../library/enum.rst:210 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" msgstr "" -#: ../../library/enum.rst:217 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises an :exc:" -"`AttributeError`::" -msgstr "" - -#: ../../library/enum.rst:224 +#: ../../library/enum.rst:218 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "" -#: ../../library/enum.rst:231 +#: ../../library/enum.rst:225 msgid "Returns each member in *cls* in definition order::" msgstr "" -#: ../../library/enum.rst:238 +#: ../../library/enum.rst:232 msgid "Returns the number of member in *cls*::" msgstr "" -#: ../../library/enum.rst:245 +#: ../../library/enum.rst:239 msgid "Returns each member in *cls* in reverse definition order::" msgstr "" -#: ../../library/enum.rst:253 +#: ../../library/enum.rst:247 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "" -#: ../../library/enum.rst:257 +#: ../../library/enum.rst:251 msgid "The name used to define the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:264 +#: ../../library/enum.rst:258 msgid "The value given to the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:263 msgid "Enum member values" msgstr "" -#: ../../library/enum.rst:271 +#: ../../library/enum.rst:265 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" -#: ../../library/enum.rst:278 +#: ../../library/enum.rst:272 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:275 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" -#: ../../library/enum.rst:287 +#: ../../library/enum.rst:281 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -468,11 +463,11 @@ msgstr "" msgid "name" msgstr "" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:302 msgid "The name of the member being defined (e.g. 'RED')." msgstr "" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:303 msgid "The start value for the Enum; the default is 1." msgstr "" @@ -480,7 +475,7 @@ msgstr "" msgid "count" msgstr "" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:304 msgid "The number of members currently defined, not including this one." msgstr "" @@ -488,41 +483,41 @@ msgstr "" msgid "last_values" msgstr "" -#: ../../library/enum.rst:310 +#: ../../library/enum.rst:305 msgid "A list of the previous values." msgstr "" -#: ../../library/enum.rst:312 +#: ../../library/enum.rst:307 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "" -#: ../../library/enum.rst:327 +#: ../../library/enum.rst:323 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "" -#: ../../library/enum.rst:332 +#: ../../library/enum.rst:328 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" -#: ../../library/enum.rst:353 +#: ../../library/enum.rst:350 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:368 +#: ../../library/enum.rst:366 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" -#: ../../library/enum.rst:382 +#: ../../library/enum.rst:381 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -534,7 +529,11 @@ msgid "" "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:402 +#: ../../library/enum.rst:399 +msgid "Added :ref:`enum-dataclass-support`" +msgstr "" + +#: ../../library/enum.rst:404 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -542,20 +541,20 @@ msgid "" "enumeration status." msgstr "" -#: ../../library/enum.rst:423 +#: ../../library/enum.rst:425 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:426 +#: ../../library/enum.rst:428 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:433 +#: ../../library/enum.rst:435 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -563,7 +562,7 @@ msgid "" "the enumeration." msgstr "" -#: ../../library/enum.rst:439 +#: ../../library/enum.rst:441 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -571,285 +570,285 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: ../../library/enum.rst:446 +#: ../../library/enum.rst:448 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: ../../library/enum.rst:451 +#: ../../library/enum.rst:453 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:459 +#: ../../library/enum.rst:461 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" -#: ../../library/enum.rst:465 +#: ../../library/enum.rst:467 msgid "Returns *True* if value is in self::" msgstr "" -#: ../../library/enum.rst:485 +#: ../../library/enum.rst:488 msgid "Returns all contained non-alias members::" msgstr "" -#: ../../library/enum.rst:494 +#: ../../library/enum.rst:497 msgid "Aliases are no longer returned during iteration." msgstr "" -#: ../../library/enum.rst:498 +#: ../../library/enum.rst:501 msgid "Returns number of members in flag::" msgstr "" -#: ../../library/enum.rst:507 +#: ../../library/enum.rst:510 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:519 +#: ../../library/enum.rst:522 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:526 +#: ../../library/enum.rst:529 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:535 +#: ../../library/enum.rst:538 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:544 +#: ../../library/enum.rst:547 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:555 +#: ../../library/enum.rst:558 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:560 +#: ../../library/enum.rst:563 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:563 +#: ../../library/enum.rst:566 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:571 +#: ../../library/enum.rst:574 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:584 +#: ../../library/enum.rst:588 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:590 +#: ../../library/enum.rst:594 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:596 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:593 +#: ../../library/enum.rst:597 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:595 +#: ../../library/enum.rst:599 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:602 +#: ../../library/enum.rst:606 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:607 +#: ../../library/enum.rst:611 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:615 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: ../../library/enum.rst:617 +#: ../../library/enum.rst:621 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:620 +#: ../../library/enum.rst:624 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:625 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:623 +#: ../../library/enum.rst:627 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:632 +#: ../../library/enum.rst:636 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:637 +#: ../../library/enum.rst:641 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:653 +#: ../../library/enum.rst:657 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:668 +#: ../../library/enum.rst:672 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: ../../library/enum.rst:685 +#: ../../library/enum.rst:689 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:691 +#: ../../library/enum.rst:695 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:696 +#: ../../library/enum.rst:700 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:713 +#: ../../library/enum.rst:718 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:726 +#: ../../library/enum.rst:732 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:738 +#: ../../library/enum.rst:745 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:754 +#: ../../library/enum.rst:762 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:756 +#: ../../library/enum.rst:764 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:759 +#: ../../library/enum.rst:767 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:765 +#: ../../library/enum.rst:773 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:775 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:776 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:778 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:772 +#: ../../library/enum.rst:780 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:783 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:777 +#: ../../library/enum.rst:785 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:790 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:793 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:796 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:789 +#: ../../library/enum.rst:797 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:802 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:798 +#: ../../library/enum.rst:806 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -860,58 +859,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:814 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:816 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:817 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:818 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:811 +#: ../../library/enum.rst:819 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:824 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:827 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:830 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:836 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:840 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -919,29 +918,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:841 +#: ../../library/enum.rst:849 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:867 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:867 +#: ../../library/enum.rst:875 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:873 +#: ../../library/enum.rst:881 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:887 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -949,41 +948,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:889 +#: ../../library/enum.rst:897 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:904 msgid "Notes" msgstr "" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:906 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:900 +#: ../../library/enum.rst:908 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:911 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:905 +#: ../../library/enum.rst:913 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:916 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:915 +#: ../../library/enum.rst:923 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po index 80626b6778..1e75839965 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,10 +86,18 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:55 +msgid "" +"On Linux >= 4.5, the :mod:`fcntl` module exposes the ``FICLONE`` and " +"``FICLONERANGE`` constants, which allow to share some data of one file with " +"another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " +"XFS). This behavior is commonly referred to as \"copy-on-write\"." +msgstr "" + +#: ../../library/fcntl.rst:61 msgid "The module defines the following functions:" msgstr "" -#: ../../library/fcntl.rst:60 +#: ../../library/fcntl.rst:66 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 " @@ -108,11 +116,11 @@ msgid "" "result in a segmentation violation or a more subtle data corruption." msgstr "" -#: ../../library/fcntl.rst:77 +#: ../../library/fcntl.rst:83 msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:90 +#: ../../library/fcntl.rst:96 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -120,13 +128,13 @@ msgstr "" "引發一個附帶引數 ``fd``、``cmd``、``arg`` 的\\ :ref:`稽核事件 ` " "``fcntl.fcntl``。" -#: ../../library/fcntl.rst:84 +#: ../../library/fcntl.rst:90 msgid "" "This function is identical to the :func:`~fcntl.fcntl` function, except that " "the argument handling is even more complicated." msgstr "" -#: ../../library/fcntl.rst:87 +#: ../../library/fcntl.rst:93 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 " @@ -134,26 +142,26 @@ msgid "" "relevant C header files." msgstr "" -#: ../../library/fcntl.rst:92 +#: ../../library/fcntl.rst:98 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:96 +#: ../../library/fcntl.rst:102 msgid "" "In all but the last case, behaviour is as for the :func:`~fcntl.fcntl` " "function." msgstr "" -#: ../../library/fcntl.rst:99 +#: ../../library/fcntl.rst:105 msgid "" "If a mutable buffer is passed, then the behaviour is determined by the value " "of the *mutate_flag* parameter." msgstr "" -#: ../../library/fcntl.rst:102 +#: ../../library/fcntl.rst:108 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 " @@ -161,7 +169,7 @@ msgid "" "system wants to put there, things should work." msgstr "" -#: ../../library/fcntl.rst:107 +#: ../../library/fcntl.rst:113 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 " @@ -172,18 +180,18 @@ msgid "" "copied back into the supplied buffer." msgstr "" -#: ../../library/fcntl.rst:115 +#: ../../library/fcntl.rst:121 msgid "If the :c:func:`ioctl` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:117 +#: ../../library/fcntl.rst:123 msgid "An example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/fcntl.rst:141 +#: ../../library/fcntl.rst:147 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -191,7 +199,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``request``、``arg`` 的\\ :ref:`稽核事件 " "` ``fcntl.ioctl``。" -#: ../../library/fcntl.rst:135 +#: ../../library/fcntl.rst:141 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 " @@ -199,11 +207,11 @@ msgid "" "function is emulated using :c:func:`fcntl`.)" msgstr "" -#: ../../library/fcntl.rst:140 +#: ../../library/fcntl.rst:146 msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:153 +#: ../../library/fcntl.rst:159 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -211,7 +219,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``operation`` 的\\ :ref:`稽核事件 ` " "``fcntl.flock``。" -#: ../../library/fcntl.rst:147 +#: ../../library/fcntl.rst:153 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." @@ -219,19 +227,19 @@ msgid "" "*cmd* is one of the following values:" msgstr "" -#: ../../library/fcntl.rst:152 +#: ../../library/fcntl.rst:158 msgid ":const:`LOCK_UN` -- unlock" msgstr "" -#: ../../library/fcntl.rst:153 +#: ../../library/fcntl.rst:159 msgid ":const:`LOCK_SH` -- acquire a shared lock" msgstr "" -#: ../../library/fcntl.rst:154 +#: ../../library/fcntl.rst:160 msgid ":const:`LOCK_EX` -- acquire an exclusive lock" msgstr "" -#: ../../library/fcntl.rst:156 +#: ../../library/fcntl.rst:162 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:" @@ -243,34 +251,34 @@ msgid "" "for writing." msgstr "" -#: ../../library/fcntl.rst:165 +#: ../../library/fcntl.rst:171 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:169 +#: ../../library/fcntl.rst:175 msgid ":const:`0` -- relative to the start of the file (:data:`os.SEEK_SET`)" msgstr "" -#: ../../library/fcntl.rst:170 +#: ../../library/fcntl.rst:176 msgid "" ":const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)" msgstr "" -#: ../../library/fcntl.rst:171 +#: ../../library/fcntl.rst:177 msgid ":const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)" msgstr "" -#: ../../library/fcntl.rst:173 +#: ../../library/fcntl.rst:179 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:188 +#: ../../library/fcntl.rst:194 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -278,11 +286,11 @@ msgstr "" "引發一個附帶引數 ``fd``、``cmd``、``len``、``start``、``whence`` 的\\ :ref:`" "稽核事件 ` ``fcntl.lockf``。" -#: ../../library/fcntl.rst:179 +#: ../../library/fcntl.rst:185 msgid "Examples (all on a SVR4 compliant system)::" msgstr "" -#: ../../library/fcntl.rst:189 +#: ../../library/fcntl.rst:195 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. " @@ -290,11 +298,11 @@ msgid "" "therefore using the :func:`flock` call may be better." msgstr "" -#: ../../library/fcntl.rst:200 +#: ../../library/fcntl.rst:206 msgid "Module :mod:`os`" msgstr ":mod:`os` 模組" -#: ../../library/fcntl.rst:198 +#: ../../library/fcntl.rst:204 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/fractions.po b/library/fractions.po index 49dd765e1d..081eb55de5 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -100,69 +100,85 @@ msgid "" "SupportsInt`` instance checks." msgstr "" -#: ../../library/fractions.rst:103 +#: ../../library/fractions.rst:101 +msgid "" +"Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." +msgstr "" + +#: ../../library/fractions.rst:104 +msgid "" +":class:`Fraction` instances now support float-style formatting, with " +"presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " +"``\"G\"`` and ``\"%\"\"``." +msgstr "" + +#: ../../library/fractions.rst:111 msgid "Numerator of the Fraction in lowest term." msgstr "" -#: ../../library/fractions.rst:107 +#: ../../library/fractions.rst:115 msgid "Denominator of the Fraction in lowest term." msgstr "" -#: ../../library/fractions.rst:112 +#: ../../library/fractions.rst:120 msgid "" -"Return a tuple of two integers, whose ratio is equal to the Fraction and " -"with a positive denominator." +"Return a tuple of two integers, whose ratio is equal to the original " +"Fraction. The ratio is in lowest terms and has a positive denominator." +msgstr "" + +#: ../../library/fractions.rst:128 +msgid "Return ``True`` if the Fraction is an integer." msgstr "" -#: ../../library/fractions.rst:119 +#: ../../library/fractions.rst:134 msgid "" "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:125 +#: ../../library/fractions.rst:140 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`float`." msgstr "" -#: ../../library/fractions.rst:131 +#: ../../library/fractions.rst:146 msgid "" "Alternative constructor which only accepts instances of :class:`decimal." "Decimal` or :class:`numbers.Integral`." msgstr "" -#: ../../library/fractions.rst:136 +#: ../../library/fractions.rst:151 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`decimal.Decimal` instance." msgstr "" -#: ../../library/fractions.rst:143 +#: ../../library/fractions.rst:158 msgid "" "Finds and returns the closest :class:`Fraction` to ``self`` that has " "denominator at most max_denominator. This method is useful for finding " "rational approximations to a given floating-point number:" msgstr "" -#: ../../library/fractions.rst:151 +#: ../../library/fractions.rst:166 msgid "or for recovering a rational number that's represented as a float:" msgstr "" -#: ../../library/fractions.rst:164 +#: ../../library/fractions.rst:179 msgid "" "Returns the greatest :class:`int` ``<= self``. This method can also be " "accessed through the :func:`math.floor` function:" msgstr "" -#: ../../library/fractions.rst:174 +#: ../../library/fractions.rst:189 msgid "" "Returns the least :class:`int` ``>= self``. This method can also be " "accessed through the :func:`math.ceil` function." msgstr "" -#: ../../library/fractions.rst:181 +#: ../../library/fractions.rst:196 msgid "" "The first version returns the nearest :class:`int` to ``self``, rounding " "half to even. The second version rounds ``self`` to the nearest multiple of " @@ -171,10 +187,25 @@ msgid "" "func:`round` function." msgstr "" -#: ../../library/fractions.rst:190 +#: ../../library/fractions.rst:204 +msgid "" +"Provides support for float-style formatting of :class:`Fraction` instances " +"via the :meth:`str.format` method, the :func:`format` built-in function, or :" +"ref:`Formatted string literals `. The presentation types " +"``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, ``\"G\"`` and ``\"%" +"\"`` are supported. For these presentation types, formatting for a :class:" +"`Fraction` object ``x`` follows the rules outlined for the :class:`float` " +"type in the :ref:`formatspec` section." +msgstr "" + +#: ../../library/fractions.rst:212 +msgid "Here are some examples::" +msgstr "" + +#: ../../library/fractions.rst:228 msgid "Module :mod:`numbers`" msgstr ":mod:`numbers` 模組" -#: ../../library/fractions.rst:191 +#: ../../library/fractions.rst:229 msgid "The abstract base classes making up the numeric tower." msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index f3f073ac69..7a0f98e809 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,12 +93,12 @@ msgstr ":class:`FTP` 類別支援 :keyword:`with` 陳述式,例如:" msgid "Support for the :keyword:`with` statement was added." msgstr "新增了對 :keyword:`with` 陳述式的支援。" -#: ../../library/ftplib.rst:79 ../../library/ftplib.rst:105 -#: ../../library/ftplib.rst:214 +#: ../../library/ftplib.rst:79 ../../library/ftplib.rst:102 +#: ../../library/ftplib.rst:207 msgid "*source_address* parameter was added." msgstr "新增 *source_address* 參數。" -#: ../../library/ftplib.rst:82 ../../library/ftplib.rst:120 +#: ../../library/ftplib.rst:82 ../../library/ftplib.rst:110 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket. The " @@ -109,7 +109,7 @@ msgstr "" "socket。新增了 *encoding* 參數,預設值從 Latin-1 更改為 UTF-8 以遵循 :rfc:" "`2640`。" -#: ../../library/ftplib.rst:90 +#: ../../library/ftplib.rst:91 msgid "" "A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" "`4217`. Connect as usual to port 21 implicitly securing the FTP control " @@ -126,16 +126,7 @@ msgstr "" "SSLContext` 物件,它允許將 SSL 配置選項、證書和私鑰捆綁到一個(可能長期存在" "的)結構中。最佳實踐請參閱 :ref:`ssl-security`。" -#: ../../library/ftplib.rst:99 -msgid "" -"*keyfile* and *certfile* are a legacy alternative to *context* -- they can " -"point to PEM-formatted private key and certificate chain files " -"(respectively) for the SSL connection." -msgstr "" -"*keyfile* 和 *certfile* 是 *context* 的傳統替代方案 -- 它們可以(分別)指向 " -"SSL 連線的 PEM 格式私鑰和憑證鏈檔案。" - -#: ../../library/ftplib.rst:108 +#: ../../library/ftplib.rst:105 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." @@ -143,39 +134,33 @@ msgstr "" "該類別現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " "Indication* 進行主機名 (hostname) 檢查(參見 :data:`ssl.HAS_SNI`)。" -#: ../../library/ftplib.rst:115 -msgid "" -"*keyfile* and *certfile* are deprecated in favor of *context*. Please use :" -"meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +#: ../../library/ftplib.rst:116 +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "" -"*keyfile* 和 *certfile* 已棄用,取而代之的是 *context*。請改用 :meth:`ssl." -"SSLContext.load_cert_chain`,或讓 :func:`ssl.create_default_context` 為你選擇" -"系統的可信 CA 憑證。" -#: ../../library/ftplib.rst:126 +#: ../../library/ftplib.rst:119 msgid "Here's a sample session using the :class:`FTP_TLS` class::" msgstr "這是一個使用 :class:`FTP_TLS` 類別的範例會話:" -#: ../../library/ftplib.rst:139 +#: ../../library/ftplib.rst:132 msgid "Exception raised when an unexpected reply is received from the server." msgstr "伺服器收到意外回覆時所引發的例外。" -#: ../../library/ftplib.rst:144 +#: ../../library/ftplib.rst:137 msgid "" "Exception raised when an error code signifying a temporary error (response " "codes in the range 400--499) is received." msgstr "" "當收到表示暫時錯誤的錯誤碼(400--499 範圍內的回應狀態碼)時引發的例外。" -#: ../../library/ftplib.rst:150 +#: ../../library/ftplib.rst:143 msgid "" "Exception raised when an error code signifying a permanent error (response " "codes in the range 500--599) is received." msgstr "" "當收到表示永久錯誤的錯誤碼(500--599 範圍內的回應狀態碼)時引發的例外。" -#: ../../library/ftplib.rst:156 +#: ../../library/ftplib.rst:149 msgid "" "Exception raised when a reply is received from the server that does not fit " "the response specifications of the File Transfer Protocol, i.e. begin with a " @@ -184,7 +169,7 @@ msgstr "" "當從伺服器收到不符合檔案傳輸協定回應規範的回覆時引發例外,即 1--5 範圍內的數" "字開頭。" -#: ../../library/ftplib.rst:163 +#: ../../library/ftplib.rst:156 msgid "" "The set of all exceptions (as a tuple) that methods of :class:`FTP` " "instances may raise as a result of problems with the FTP connection (as " @@ -195,11 +180,11 @@ msgstr "" "所有例外集合(元組形式)。該集合包括上面列出的四個例外以及 :exc:`OSError` " "和 :exc:`EOFError`。" -#: ../../library/ftplib.rst:173 +#: ../../library/ftplib.rst:166 msgid "Module :mod:`netrc`" msgstr ":mod:`netrc` 模組" -#: ../../library/ftplib.rst:172 +#: ../../library/ftplib.rst:165 msgid "" "Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " "typically used by FTP clients to load user authentication information before " @@ -208,11 +193,11 @@ msgstr "" ":file:`.netrc` 檔案格式的剖析器。:file:`.netrc` 檔案通常被 FTP 用戶端用來在提" "示使用者之前載入使用者身份驗證資訊。" -#: ../../library/ftplib.rst:180 +#: ../../library/ftplib.rst:173 msgid "FTP Objects" msgstr "FTP 物件" -#: ../../library/ftplib.rst:182 +#: ../../library/ftplib.rst:175 msgid "" "Several methods are available in two flavors: one for handling text files " "and another for binary files. These are named for the command which is used " @@ -223,11 +208,11 @@ msgstr "" "於二進位檔案 (binary files)。這些以在文本檔案的 ``lines`` 或二進位檔案的 " "``binary`` 前使用的命令命名。" -#: ../../library/ftplib.rst:186 +#: ../../library/ftplib.rst:179 msgid ":class:`FTP` instances have the following methods:" msgstr ":class:`FTP` 實例具有以下方法:" -#: ../../library/ftplib.rst:191 +#: ../../library/ftplib.rst:184 msgid "" "Set the instance's debugging level. This controls the amount of debugging " "output printed. The default, ``0``, produces no debugging output. A value " @@ -240,7 +225,7 @@ msgstr "" "``1`` 會產生適量的偵錯輸出,通常是每個請求輸出一行。 ``2`` 或更高的值會產生最" "大量的偵錯輸出,記錄發送和接收控制連線的每個步驟。" -#: ../../library/ftplib.rst:200 +#: ../../library/ftplib.rst:193 msgid "" "Connect to the given host and port. The default port number is ``21``, as " "specified by the FTP protocol specification. It is rarely needed to specify " @@ -259,7 +244,7 @@ msgstr "" "將使用全域預設的超時設定。 *source_address* 是一個 2 元組 ``(host, port)``," "供 socket 在連線之前綁定到它的來源地址。" -#: ../../library/ftplib.rst:223 +#: ../../library/ftplib.rst:216 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -267,7 +252,7 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``ftplib.connect``。" -#: ../../library/ftplib.rst:220 +#: ../../library/ftplib.rst:213 msgid "" "Return the welcome message sent by the server in reply to the initial " "connection. (This message sometimes contains disclaimers or help " @@ -276,7 +261,7 @@ msgstr "" "回傳伺服器為回應初始連線而發送的歡迎訊息。(此訊息有時會包含與使用者相關的免" "責聲明或幫助資訊。)" -#: ../../library/ftplib.rst:227 +#: ../../library/ftplib.rst:220 msgid "" "Log in as the given *user*. The *passwd* and *acct* parameters are optional " "and default to the empty string. If no *user* is specified, it defaults to " @@ -294,18 +279,18 @@ msgstr "" "用戶端登錄後才允許使用。 *acct* 參數提供「帳戶資訊」,但很少有系統實作這一部" "分。" -#: ../../library/ftplib.rst:239 +#: ../../library/ftplib.rst:232 msgid "" "Abort a file transfer that is in progress. Using this does not always work, " "but it's worth a try." msgstr "中止正在進行的檔案傳輸。使用它並不是都會成功,但值得一試。" -#: ../../library/ftplib.rst:245 +#: ../../library/ftplib.rst:238 msgid "" "Send a simple command string to the server and return the response string." msgstr "向伺服器發送一個簡單的命令字串並回傳回應字串。" -#: ../../library/ftplib.rst:258 ../../library/ftplib.rst:267 +#: ../../library/ftplib.rst:251 ../../library/ftplib.rst:260 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." @@ -313,7 +298,7 @@ msgstr "" "引發一個附帶引數 ``self``、``cmd`` 的\\ :ref:`稽核事件 ` ``ftplib." "sendcmd``。" -#: ../../library/ftplib.rst:252 +#: ../../library/ftplib.rst:245 msgid "" "Send a simple command string to the server and handle the response. Return " "nothing if a response code corresponding to success (codes in the range " @@ -322,7 +307,7 @@ msgstr "" "向伺服器發送一個簡單的命令字串並處理回應。如果收到代表成功的回應狀態碼(範圍" "為 200--299 的狀態碼),則不回傳任何內容,否則引發 :exc:`error_reply`。" -#: ../../library/ftplib.rst:261 +#: ../../library/ftplib.rst:254 msgid "" "Retrieve a file in binary transfer mode. *cmd* should be an appropriate " "``RETR`` command: ``'RETR filename'``. The *callback* function is called for " @@ -340,7 +325,7 @@ msgstr "" "最大大小)。會自動選擇一個合理的預設值。*rest* 與 :meth:`transfercmd` 方法中" "的含義相同。" -#: ../../library/ftplib.rst:273 +#: ../../library/ftplib.rst:266 msgid "" "Retrieve a file or directory listing in the encoding specified by the " "*encoding* parameter at initialization. *cmd* should be an appropriate " @@ -358,14 +343,14 @@ msgstr "" "式,其引數包含已經刪除尾隨 CRLF 的一行。預設的 *callback* 會將各行印出到 " "``sys.stdout``。" -#: ../../library/ftplib.rst:286 +#: ../../library/ftplib.rst:279 msgid "" "Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " "Passive mode is on by default." msgstr "" "如果 *val* 為真,則啟用「被動」模式,否則禁用被動模式。被動模式預設開啟。" -#: ../../library/ftplib.rst:292 +#: ../../library/ftplib.rst:285 msgid "" "Store a file in binary transfer mode. *cmd* should be an appropriate " "``STOR`` command: ``\"STOR filename\"``. *fp* is a :term:`file object` " @@ -382,11 +367,11 @@ msgstr "" "*blocksize* 引數預設為 8192。 *callback* 是一個可選的單參數可呼叫物件,會在每" "個區塊發送後呼叫。 *rest* 與 :meth:`transfercmd` 方法中的含義相同。" -#: ../../library/ftplib.rst:300 +#: ../../library/ftplib.rst:293 msgid "*rest* parameter added." msgstr "新增 *rest* 參數。" -#: ../../library/ftplib.rst:306 +#: ../../library/ftplib.rst:299 msgid "" "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " "(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " @@ -399,7 +384,7 @@ msgstr "" "物件 ` *fp* (以二進位模式打開)讀取各行、直到 EOF,以提供要儲存" "的資料。 *callback* 是可選的單參數可呼叫物件,於發送後以各行進行呼叫。" -#: ../../library/ftplib.rst:315 +#: ../../library/ftplib.rst:308 msgid "" "Initiate a transfer over the data connection. If the transfer is active, " "send an ``EPRT`` or ``PORT`` command and the transfer command specified by " @@ -412,7 +397,7 @@ msgstr "" "模式,則發送 ``EPSV`` 或 ``PASV`` 命令、連線、並啟動傳輸命令。無論哪種方式," "都是回傳連線的 socket。" -#: ../../library/ftplib.rst:321 +#: ../../library/ftplib.rst:314 msgid "" "If optional *rest* is given, a ``REST`` command is sent to the server, " "passing *rest* as an argument. *rest* is usually a byte offset into the " @@ -432,7 +417,7 @@ msgstr "" "`error_reply` 例外。如果發生這種情況,只需在沒有 *rest* 引數的情況下呼叫 :" "meth:`transfercmd`。" -#: ../../library/ftplib.rst:334 +#: ../../library/ftplib.rst:327 msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " "expected size of the data. If the expected size could not be computed, " @@ -443,7 +428,7 @@ msgstr "" "無法計算預期大小,則回傳 ``None``。 *cmd* 和 *rest* 與 :meth:`transfercmd` 中" "的含義相同。" -#: ../../library/ftplib.rst:342 +#: ../../library/ftplib.rst:335 msgid "" "List a directory in a standardized format by using ``MLSD`` command (:rfc:" "`3659`). If *path* is omitted the current directory is assumed. *facts* is " @@ -461,7 +446,7 @@ msgstr "" "facts的字典。該字典的內容可能受 *facts* 引數限制,但不保證伺服器會回傳所有請" "求的 facts。" -#: ../../library/ftplib.rst:356 +#: ../../library/ftplib.rst:349 msgid "" "Return a list of file names as returned by the ``NLST`` command. The " "optional *argument* is a directory to list (default is the current server " @@ -471,11 +456,11 @@ msgstr "" "回傳由 ``NLST`` 命令回傳的檔案名稱列表。可選的 *argument* 是要列出的目錄(預" "設為當前伺服器目錄)。多個引數可用於將非標準選項傳遞給 ``NLST`` 命令。" -#: ../../library/ftplib.rst:361 ../../library/ftplib.rst:373 +#: ../../library/ftplib.rst:354 ../../library/ftplib.rst:366 msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "如果你的伺服器支援該命令,:meth:`mlsd` 會提供更好的 API。" -#: ../../library/ftplib.rst:366 +#: ../../library/ftplib.rst:359 msgid "" "Produce a directory listing as returned by the ``LIST`` command, printing it " "to standard output. The optional *argument* is a directory to list (default " @@ -490,11 +475,11 @@ msgstr "" "`retrlines` 的 *callback* 函式;預設印出到 ``sys.stdout``。此方法回傳 " "``None``。" -#: ../../library/ftplib.rst:378 +#: ../../library/ftplib.rst:371 msgid "Rename file *fromname* on the server to *toname*." msgstr "將伺服器上的檔案 *fromname* 重新命名為 *toname*。" -#: ../../library/ftplib.rst:383 +#: ../../library/ftplib.rst:376 msgid "" "Remove the file named *filename* from the server. If successful, returns " "the text of the response, otherwise raises :exc:`error_perm` on permission " @@ -503,23 +488,23 @@ msgstr "" "從伺服器中刪除名為 *filename* 的檔案。如果成功,回傳回應的文字,否則引發 :" "exc:`error_perm` 權限錯誤或在其他錯誤發生時引發 :exc:`error_reply`。" -#: ../../library/ftplib.rst:390 +#: ../../library/ftplib.rst:383 msgid "Set the current directory on the server." msgstr "設定伺服器上的當前目錄。" -#: ../../library/ftplib.rst:395 +#: ../../library/ftplib.rst:388 msgid "Create a new directory on the server." msgstr "在伺服器上建立一個新目錄。" -#: ../../library/ftplib.rst:400 +#: ../../library/ftplib.rst:393 msgid "Return the pathname of the current directory on the server." msgstr "回傳伺服器上當前目錄的路徑名。" -#: ../../library/ftplib.rst:405 +#: ../../library/ftplib.rst:398 msgid "Remove the directory named *dirname* on the server." msgstr "刪除伺服器上名為 *dirname* 的目錄。" -#: ../../library/ftplib.rst:410 +#: ../../library/ftplib.rst:403 msgid "" "Request the size of the file named *filename* on the server. On success, " "the size of the file is returned as an integer, otherwise ``None`` is " @@ -530,7 +515,7 @@ msgstr "" "則回傳 ``None``。請注意,``SIZE`` 命令不是標準化的,但被許多常見的伺服器實作" "支援。" -#: ../../library/ftplib.rst:418 +#: ../../library/ftplib.rst:411 msgid "" "Send a ``QUIT`` command to the server and close the connection. This is the " "\"polite\" way to close a connection, but it may raise an exception if the " @@ -542,7 +527,7 @@ msgstr "" "器對 ``QUIT`` 命令作出錯誤回應,它可能會引發例外。這意味著呼叫 :meth:`close` " "方法使 :class:`FTP` 實例無法用於後續呼叫(見下文)。" -#: ../../library/ftplib.rst:427 +#: ../../library/ftplib.rst:420 msgid "" "Close the connection unilaterally. This should not be applied to an already " "closed connection such as after a successful call to :meth:`~FTP.quit`. " @@ -555,28 +540,28 @@ msgstr "" "或 :meth:`~FTP.quit` 後,你不能通過發出另一個 :meth:`login` 方法重新打開連" "線)。" -#: ../../library/ftplib.rst:435 +#: ../../library/ftplib.rst:428 msgid "FTP_TLS Objects" msgstr "FTP_TLS 物件" -#: ../../library/ftplib.rst:437 +#: ../../library/ftplib.rst:430 msgid "" ":class:`FTP_TLS` class inherits from :class:`FTP`, defining these additional " "objects:" msgstr ":class:`FTP_TLS` 類別繼承自 :class:`FTP`,並另外定義了這些的物件:" -#: ../../library/ftplib.rst:441 +#: ../../library/ftplib.rst:434 msgid "The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`)." msgstr "要使用的 SSL 版本(預設為 :attr:`ssl.PROTOCOL_SSLv23`)。" -#: ../../library/ftplib.rst:445 +#: ../../library/ftplib.rst:438 msgid "" "Set up a secure control connection by using TLS or SSL, depending on what is " "specified in the :attr:`ssl_version` attribute." msgstr "" "根據 :attr:`ssl_version` 屬性中指定的內容,使用 TLS 或 SSL 設定安全控制連線。" -#: ../../library/ftplib.rst:448 +#: ../../library/ftplib.rst:441 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." @@ -584,7 +569,7 @@ msgstr "" "該方法現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " "Indication* 進行主機名檢查(參見 :data:`ssl.HAS_SNI`)。" -#: ../../library/ftplib.rst:455 +#: ../../library/ftplib.rst:448 msgid "" "Revert control channel back to plaintext. This can be useful to take " "advantage of firewalls that know how to handle NAT with non-secure FTP " @@ -593,11 +578,11 @@ msgstr "" "將控制通道恢復為純文本。這對於利用知道如何在不打開固定連接埠的情況下使用非安" "全 (non-secure) FTP 以處理 NAT 的防火牆很有用。" -#: ../../library/ftplib.rst:463 +#: ../../library/ftplib.rst:456 msgid "Set up secure data connection." msgstr "設定安全資料連線。" -#: ../../library/ftplib.rst:467 +#: ../../library/ftplib.rst:460 msgid "Set up clear text data connection." msgstr "設定明文資料 (clear text data) 連線。" @@ -612,3 +597,21 @@ msgstr "protocol(協定)" #: ../../library/ftplib.rst:9 msgid "ftplib (standard module)" msgstr "ftplib(標準模組)" + +#~ msgid "" +#~ "*keyfile* and *certfile* are a legacy alternative to *context* -- they " +#~ "can point to PEM-formatted private key and certificate chain files " +#~ "(respectively) for the SSL connection." +#~ msgstr "" +#~ "*keyfile* 和 *certfile* 是 *context* 的傳統替代方案 -- 它們可以(分別)指" +#~ "向 SSL 連線的 PEM 格式私鑰和憑證鏈檔案。" + +#~ msgid "" +#~ "*keyfile* and *certfile* are deprecated in favor of *context*. Please " +#~ "use :meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." +#~ "create_default_context` select the system's trusted CA certificates for " +#~ "you." +#~ msgstr "" +#~ "*keyfile* 和 *certfile* 已棄用,取而代之的是 *context*。請改用 :meth:`ssl." +#~ "SSLContext.load_cert_chain`,或讓 :func:`ssl.create_default_context` 為你" +#~ "選擇系統的可信 CA 憑證。" diff --git a/library/functions.po b/library/functions.po index 616d69ddfd..21e436efee 100644 --- a/library/functions.po +++ b/library/functions.po @@ -482,19 +482,20 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:140 ../../library/functions.rst:841 -#: ../../library/functions.rst:1158 +#: ../../library/functions.rst:140 ../../library/functions.rst:842 +#: ../../library/functions.rst:1159 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" #: ../../library/functions.rst:145 +#, fuzzy msgid "" "Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " "using the standard :ref:`truth testing procedure `. If *x* is false " "or omitted, this returns ``False``; otherwise, it returns ``True``. The :" "class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). " "It cannot be subclassed further. Its only instances are ``False`` and " -"``True`` (see :ref:`bltin-boolean-values`)." +"``True`` (see :ref:`typebool`)." msgstr "" "回傳一個布林值,即 ``True`` 或者 ``False``。*x* 使用標準的\\ :ref:`真值測試程" "序 `\\ 來轉換。如果 *x* 為假或者被省略,則回傳 ``False``;其他情況回" @@ -502,8 +503,8 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" -#: ../../library/functions.rst:154 ../../library/functions.rst:706 -#: ../../library/functions.rst:930 +#: ../../library/functions.rst:154 ../../library/functions.rst:707 +#: ../../library/functions.rst:931 msgid "*x* is now a positional-only parameter." msgstr "" @@ -913,8 +914,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:399 ../../library/functions.rst:703 -#: ../../library/functions.rst:927 +#: ../../library/functions.rst:399 ../../library/functions.rst:704 +#: ../../library/functions.rst:928 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -1021,7 +1022,7 @@ msgstr "" msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:478 +#: ../../library/functions.rst:479 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1034,7 +1035,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:488 +#: ../../library/functions.rst:489 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1052,7 +1053,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:500 +#: ../../library/functions.rst:501 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1065,14 +1066,14 @@ msgstr "" "meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" "(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:512 +#: ../../library/functions.rst:513 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/functions.rst:524 +#: ../../library/functions.rst:525 msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " @@ -1081,7 +1082,7 @@ msgstr "" "引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," "*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" -#: ../../library/functions.rst:528 +#: ../../library/functions.rst:529 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1107,13 +1108,13 @@ msgstr "" "呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" "域 ` (non-locals)。" -#: ../../library/functions.rst:543 +#: ../../library/functions.rst:544 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:550 +#: ../../library/functions.rst:551 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1124,7 +1125,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:555 +#: ../../library/functions.rst:556 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1135,13 +1136,13 @@ msgstr "" "`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" "func:`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:560 +#: ../../library/functions.rst:561 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "" -#: ../../library/functions.rst:563 +#: ../../library/functions.rst:564 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1149,14 +1150,14 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:566 ../../library/functions.rst:607 +#: ../../library/functions.rst:567 ../../library/functions.rst:608 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" "引發一個附帶引數 ``code_object`` 的\\ :ref:`稽核事件 ` ``exec``。" -#: ../../library/functions.rst:568 ../../library/functions.rst:609 +#: ../../library/functions.rst:569 ../../library/functions.rst:610 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " @@ -1165,7 +1166,7 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發 code compilation 事件。" -#: ../../library/functions.rst:575 +#: ../../library/functions.rst:576 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1185,7 +1186,7 @@ msgstr "" "`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " "``None``。" -#: ../../library/functions.rst:586 +#: ../../library/functions.rst:587 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1204,7 +1205,7 @@ msgstr "" "地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" "件,程式碼就像嵌入在 class 定義中一樣執行。" -#: ../../library/functions.rst:596 +#: ../../library/functions.rst:597 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1217,7 +1218,7 @@ msgstr "" "func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " "*globals* 中來控制可以使用哪些內建程式碼。" -#: ../../library/functions.rst:602 +#: ../../library/functions.rst:603 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " "valid when the *object* is a code object containing free variables. The " @@ -1225,7 +1226,7 @@ msgid "" "referenced by the code object." msgstr "" -#: ../../library/functions.rst:614 +#: ../../library/functions.rst:615 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1234,7 +1235,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:620 +#: ../../library/functions.rst:621 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1245,11 +1246,11 @@ msgstr "" "預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:625 +#: ../../library/functions.rst:626 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:631 +#: ../../library/functions.rst:632 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1261,7 +1262,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個恆等函式,即 *iterable* 中所有假值元" "素會被移除。" -#: ../../library/functions.rst:637 +#: ../../library/functions.rst:638 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1272,7 +1273,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:642 +#: ../../library/functions.rst:643 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1280,11 +1281,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:652 +#: ../../library/functions.rst:653 msgid "Return a floating point number constructed from a number or string *x*." msgstr "回傳從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:654 +#: ../../library/functions.rst:655 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1299,7 +1300,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 ``floatvalue`` 的生成規則:" -#: ../../library/functions.rst:672 +#: ../../library/functions.rst:673 msgid "" "Here ``digit`` is a Unicode decimal digit (character in the Unicode general " "category ``Nd``). Case is not significant, so, for example, \"inf\", " @@ -1310,7 +1311,7 @@ msgstr "" "大小寫都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正" "無窮大。" -#: ../../library/functions.rst:677 +#: ../../library/functions.rst:678 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1320,7 +1321,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:682 +#: ../../library/functions.rst:683 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1329,28 +1330,28 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 :meth:`~object.__float__` 則回退使用 :meth:`~object.__index__`。" -#: ../../library/functions.rst:686 +#: ../../library/functions.rst:687 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:688 +#: ../../library/functions.rst:689 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:701 +#: ../../library/functions.rst:702 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:709 +#: ../../library/functions.rst:710 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" -#: ../../library/functions.rst:719 +#: ../../library/functions.rst:720 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1361,7 +1362,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:724 +#: ../../library/functions.rst:725 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1369,7 +1370,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:727 +#: ../../library/functions.rst:728 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1383,7 +1384,7 @@ msgstr "" "字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " "*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:734 +#: ../../library/functions.rst:735 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1391,7 +1392,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:743 +#: ../../library/functions.rst:744 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1401,7 +1402,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:747 +#: ../../library/functions.rst:748 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1409,7 +1410,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:755 +#: ../../library/functions.rst:756 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1424,7 +1425,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:764 +#: ../../library/functions.rst:765 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1432,7 +1433,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:772 +#: ../../library/functions.rst:773 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1441,7 +1442,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:779 +#: ../../library/functions.rst:780 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1452,7 +1453,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:787 +#: ../../library/functions.rst:788 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1463,7 +1464,8 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:794 +#: ../../library/functions.rst:795 +#, fuzzy msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" @@ -1472,7 +1474,7 @@ msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__ `。" -#: ../../library/functions.rst:801 +#: ../../library/functions.rst:802 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1486,7 +1488,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:808 +#: ../../library/functions.rst:809 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1494,12 +1496,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:813 +#: ../../library/functions.rst:814 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:815 +#: ../../library/functions.rst:816 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1507,7 +1509,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:822 +#: ../../library/functions.rst:823 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1517,7 +1519,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:831 +#: ../../library/functions.rst:832 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1526,20 +1528,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:843 +#: ../../library/functions.rst:844 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:848 +#: ../../library/functions.rst:849 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:854 +#: ../../library/functions.rst:855 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1549,18 +1551,18 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:859 +#: ../../library/functions.rst:860 msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:861 +#: ../../library/functions.rst:862 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:867 +#: ../../library/functions.rst:868 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1573,7 +1575,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:877 +#: ../../library/functions.rst:878 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1581,7 +1583,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:880 +#: ../../library/functions.rst:881 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." @@ -1589,7 +1591,7 @@ msgstr "" "引發一個附帶引數 ``prompt`` 的\\ :ref:`稽核事件 ` ``builtins." "input``。" -#: ../../library/functions.rst:882 +#: ../../library/functions.rst:883 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1597,7 +1599,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:885 +#: ../../library/functions.rst:886 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." @@ -1605,7 +1607,7 @@ msgstr "" "引發一個附帶引數 ``result`` 的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:887 +#: ../../library/functions.rst:888 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1613,7 +1615,7 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:894 +#: ../../library/functions.rst:895 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`~object.__int__`, " @@ -1627,7 +1629,7 @@ msgstr "" "*x* 定義了 :meth:`~object.__index__` 則回傳 ``x.__index__()``。如果 *x* 定義" "了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:901 +#: ../../library/functions.rst:902 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an integer in " @@ -1640,7 +1642,7 @@ msgstr "" "前可以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、" "或在數字間有單一底線。" -#: ../../library/functions.rst:907 +#: ../../library/functions.rst:908 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -1662,11 +1664,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:918 +#: ../../library/functions.rst:919 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:920 +#: ../../library/functions.rst:921 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1678,17 +1680,17 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:933 +#: ../../library/functions.rst:934 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" -#: ../../library/functions.rst:936 +#: ../../library/functions.rst:937 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "" -#: ../../library/functions.rst:939 +#: ../../library/functions.rst:940 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -1698,7 +1700,7 @@ msgid "" "documentation." msgstr "" -#: ../../library/functions.rst:949 +#: ../../library/functions.rst:950 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1738,7 +1740,7 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:981 +#: ../../library/functions.rst:982 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1761,18 +1763,18 @@ msgstr "" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:994 +#: ../../library/functions.rst:995 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:996 +#: ../../library/functions.rst:997 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:1008 +#: ../../library/functions.rst:1009 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 " @@ -1781,13 +1783,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1014 +#: ../../library/functions.rst:1015 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:1023 +#: ../../library/functions.rst:1024 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1795,7 +1797,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1029 +#: ../../library/functions.rst:1030 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 " @@ -1806,7 +1808,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:1035 +#: ../../library/functions.rst:1036 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." @@ -1814,7 +1816,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:1040 +#: ../../library/functions.rst:1041 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -1829,13 +1831,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:1052 +#: ../../library/functions.rst:1053 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:1055 +#: ../../library/functions.rst:1056 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 " @@ -1844,7 +1846,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1060 ../../library/functions.rst:1098 +#: ../../library/functions.rst:1061 ../../library/functions.rst:1099 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 " @@ -1856,7 +1858,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1066 +#: ../../library/functions.rst:1067 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1867,15 +1869,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1071 ../../library/functions.rst:1109 +#: ../../library/functions.rst:1072 ../../library/functions.rst:1110 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1074 ../../library/functions.rst:1112 +#: ../../library/functions.rst:1075 ../../library/functions.rst:1113 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1082 +#: ../../library/functions.rst:1083 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1883,13 +1885,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1090 +#: ../../library/functions.rst:1091 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1093 +#: ../../library/functions.rst:1094 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 " @@ -1898,7 +1900,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1104 +#: ../../library/functions.rst:1105 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1909,7 +1911,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1119 +#: ../../library/functions.rst:1120 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 " @@ -1919,7 +1921,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1126 +#: ../../library/functions.rst:1127 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 " @@ -1928,7 +1930,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1132 +#: ../../library/functions.rst:1133 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." @@ -1936,7 +1938,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1139 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` " @@ -1947,7 +1949,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1149 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." @@ -1955,7 +1957,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1165 +#: ../../library/functions.rst:1166 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 " @@ -1964,7 +1966,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1169 +#: ../../library/functions.rst:1170 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 " @@ -1977,7 +1979,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1176 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. " @@ -1998,71 +2000,71 @@ msgstr "" "getencoding()` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制" "模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1193 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1193 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1195 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1195 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1195 +#: ../../library/functions.rst:1196 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1195 +#: ../../library/functions.rst:1196 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1196 +#: ../../library/functions.rst:1197 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1196 +#: ../../library/functions.rst:1197 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1197 +#: ../../library/functions.rst:1198 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1197 +#: ../../library/functions.rst:1198 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1199 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1198 ../../library/functions.rst:1342 +#: ../../library/functions.rst:1199 ../../library/functions.rst:1343 msgid "binary mode" msgstr "binary mode(二進位模式)" -#: ../../library/functions.rst:1199 +#: ../../library/functions.rst:1200 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1199 +#: ../../library/functions.rst:1200 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1201 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1201 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1204 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 " @@ -2071,7 +2073,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1208 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* " @@ -2082,14 +2084,14 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1217 +#: ../../library/functions.rst:1218 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:1221 +#: ../../library/functions.rst:1222 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 " @@ -2102,7 +2104,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1231 +#: ../../library/functions.rst:1232 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 " @@ -2110,14 +2112,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1236 +#: ../../library/functions.rst:1237 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:1240 +#: ../../library/functions.rst:1241 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 " @@ -2126,7 +2128,7 @@ msgid "" "the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1247 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 " @@ -2135,25 +2137,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1254 +#: ../../library/functions.rst:1255 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:1258 +#: ../../library/functions.rst:1259 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1261 +#: ../../library/functions.rst:1262 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1264 +#: ../../library/functions.rst:1265 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2162,33 +2164,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1271 +#: ../../library/functions.rst:1272 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:1275 +#: ../../library/functions.rst:1276 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1278 +#: ../../library/functions.rst:1279 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1286 +#: ../../library/functions.rst:1287 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " "follows:" msgstr "" -#: ../../library/functions.rst:1290 +#: ../../library/functions.rst:1291 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2199,7 +2201,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1298 +#: ../../library/functions.rst:1299 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2208,7 +2210,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1305 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 " @@ -2216,7 +2218,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1309 +#: ../../library/functions.rst:1310 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 " @@ -2225,11 +2227,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1315 +#: ../../library/functions.rst:1316 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1317 +#: ../../library/functions.rst:1318 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::" @@ -2239,7 +2241,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1330 +#: ../../library/functions.rst:1331 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 " @@ -2254,7 +2256,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1352 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2264,7 +2266,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1355 +#: ../../library/functions.rst:1356 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." @@ -2272,25 +2274,25 @@ msgstr "" "引發一個附帶引數 ``file``、``model``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1358 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1362 +#: ../../library/functions.rst:1363 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1363 +#: ../../library/functions.rst:1364 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1364 +#: ../../library/functions.rst:1365 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1365 +#: ../../library/functions.rst:1366 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2298,11 +2300,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1371 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1374 +#: ../../library/functions.rst:1375 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 :" @@ -2311,15 +2313,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1377 +#: ../../library/functions.rst:1378 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1381 +#: ../../library/functions.rst:1382 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1382 +#: ../../library/functions.rst:1383 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2327,11 +2329,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1385 +#: ../../library/functions.rst:1386 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1390 +#: ../../library/functions.rst:1391 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2342,7 +2344,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1398 +#: ../../library/functions.rst:1399 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) % " @@ -2353,7 +2355,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1403 +#: ../../library/functions.rst:1404 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2366,7 +2368,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1413 +#: ../../library/functions.rst:1414 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 " @@ -2375,29 +2377,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1419 +#: ../../library/functions.rst:1420 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1426 +#: ../../library/functions.rst:1427 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:1431 +#: ../../library/functions.rst:1432 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1438 +#: ../../library/functions.rst:1439 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:1442 +#: ../../library/functions.rst:1443 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* " @@ -2406,7 +2408,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1448 +#: ../../library/functions.rst:1449 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 " @@ -2414,38 +2416,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1453 +#: ../../library/functions.rst:1454 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1458 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1464 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1465 +#: ../../library/functions.rst:1466 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:1469 +#: ../../library/functions.rst:1470 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1486 +#: ../../library/functions.rst:1487 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:1489 +#: ../../library/functions.rst:1490 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 " @@ -2453,14 +2455,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1502 +#: ../../library/functions.rst:1503 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:1506 +#: ../../library/functions.rst:1507 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2468,30 +2470,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1528 +#: ../../library/functions.rst:1529 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:1532 +#: ../../library/functions.rst:1533 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1536 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1544 +#: ../../library/functions.rst:1545 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:1550 +#: ../../library/functions.rst:1551 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 " @@ -2504,7 +2506,7 @@ msgid "" "`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1564 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2512,14 +2514,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1571 +#: ../../library/functions.rst:1572 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:1575 +#: ../../library/functions.rst:1576 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 " @@ -2530,13 +2532,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1584 +#: ../../library/functions.rst:1585 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1589 +#: ../../library/functions.rst:1590 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 " @@ -2545,21 +2547,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1601 +#: ../../library/functions.rst:1602 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:1605 +#: ../../library/functions.rst:1606 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:1612 +#: ../../library/functions.rst:1613 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 " @@ -2568,7 +2570,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1619 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2577,14 +2579,14 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1626 +#: ../../library/functions.rst:1627 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:1635 +#: ../../library/functions.rst:1636 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2597,35 +2599,41 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1646 +msgid "" +"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" +"`~slice.stop`, and :attr:`~slice.step` are hashable)." +msgstr "" + +#: ../../library/functions.rst:1652 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1650 +#: ../../library/functions.rst:1654 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1652 +#: ../../library/functions.rst:1656 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:1656 +#: ../../library/functions.rst:1660 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:1659 +#: ../../library/functions.rst:1663 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1662 +#: ../../library/functions.rst:1666 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 " @@ -2633,7 +2641,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1667 +#: ../../library/functions.rst:1671 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2645,22 +2653,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1676 +#: ../../library/functions.rst:1680 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1680 +#: ../../library/functions.rst:1684 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1682 +#: ../../library/functions.rst:1686 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1689 +#: ../../library/functions.rst:1693 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2668,21 +2676,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1692 +#: ../../library/functions.rst:1696 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:1696 +#: ../../library/functions.rst:1700 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:1700 +#: ../../library/functions.rst:1704 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 " @@ -2691,36 +2699,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1716 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1714 +#: ../../library/functions.rst:1718 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:1729 +#: ../../library/functions.rst:1733 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1731 +#: ../../library/functions.rst:1735 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1737 +#: ../../library/functions.rst:1741 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:1741 +#: ../../library/functions.rst:1745 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 ``''." @@ -2729,31 +2737,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1747 +#: ../../library/functions.rst:1751 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1754 +msgid "" +"Summation of floats switched to an algorithm that gives higher accuracy on " +"most builds." +msgstr "" + +#: ../../library/functions.rst:1761 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:1757 +#: ../../library/functions.rst:1765 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:1761 +#: ../../library/functions.rst:1769 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:1765 +#: ../../library/functions.rst:1773 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2761,7 +2775,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1770 +#: ../../library/functions.rst:1778 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. " @@ -2769,7 +2783,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1775 +#: ../../library/functions.rst:1783 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 " @@ -2777,7 +2791,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1788 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 " @@ -2790,18 +2804,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1790 +#: ../../library/functions.rst:1798 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1797 +#: ../../library/functions.rst:1805 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:1801 +#: ../../library/functions.rst:1809 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2811,7 +2825,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1808 +#: ../../library/functions.rst:1816 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 " @@ -2821,33 +2835,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1815 +#: ../../library/functions.rst:1823 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1825 +#: ../../library/functions.rst:1833 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:1834 +#: ../../library/functions.rst:1842 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:1838 +#: ../../library/functions.rst:1846 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:1842 +#: ../../library/functions.rst:1850 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 " @@ -2860,11 +2874,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1865 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1859 +#: ../../library/functions.rst:1867 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2872,23 +2886,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1872 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1874 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:1873 +#: ../../library/functions.rst:1881 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:1876 +#: ../../library/functions.rst:1884 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2896,54 +2910,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1881 +#: ../../library/functions.rst:1889 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:1885 +#: ../../library/functions.rst:1893 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:1891 +#: ../../library/functions.rst:1899 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1902 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1903 +#: ../../library/functions.rst:1911 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:1906 +#: ../../library/functions.rst:1914 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:1910 +#: ../../library/functions.rst:1918 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:1914 +#: ../../library/functions.rst:1922 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 " @@ -2951,51 +2965,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1919 +#: ../../library/functions.rst:1927 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:1926 +#: ../../library/functions.rst:1934 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:1933 +#: ../../library/functions.rst:1941 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1951 +#: ../../library/functions.rst:1959 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:1955 +#: ../../library/functions.rst:1963 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:1959 +#: ../../library/functions.rst:1967 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:1962 +#: ../../library/functions.rst:1970 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1964 +#: ../../library/functions.rst:1972 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 " @@ -3004,23 +3018,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1970 +#: ../../library/functions.rst:1978 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1981 +#: ../../library/functions.rst:1989 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1993 +#: ../../library/functions.rst:2001 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1996 +#: ../../library/functions.rst:2004 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3032,7 +3046,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2005 +#: ../../library/functions.rst:2013 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3042,7 +3056,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2012 +#: ../../library/functions.rst:2020 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3051,7 +3065,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2018 +#: ../../library/functions.rst:2026 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 " @@ -3059,58 +3073,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2023 +#: ../../library/functions.rst:2031 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2028 +#: ../../library/functions.rst:2036 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2032 +#: ../../library/functions.rst:2040 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:2035 +#: ../../library/functions.rst:2043 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2042 +#: ../../library/functions.rst:2050 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:2046 +#: ../../library/functions.rst:2054 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2049 +#: ../../library/functions.rst:2057 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2053 +#: ../../library/functions.rst:2061 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:2058 +#: ../../library/functions.rst:2066 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2059 +#: ../../library/functions.rst:2067 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 " @@ -3123,106 +3137,106 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:152 ../../library/functions.rst:1832 +#: ../../library/functions.rst:152 ../../library/functions.rst:1840 msgid "type" msgstr "type(型別)" -#: ../../library/functions.rst:571 +#: ../../library/functions.rst:572 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/functions.rst:571 +#: ../../library/functions.rst:572 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:648 +#: ../../library/functions.rst:649 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:648 +#: ../../library/functions.rst:649 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:713 +#: ../../library/functions.rst:714 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:713 ../../library/functions.rst:1721 +#: ../../library/functions.rst:714 ../../library/functions.rst:1725 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:713 +#: ../../library/functions.rst:714 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1160 +#: ../../library/functions.rst:1161 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1160 ../../library/functions.rst:1281 +#: ../../library/functions.rst:1161 ../../library/functions.rst:1282 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1188 +#: ../../library/functions.rst:1189 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1188 +#: ../../library/functions.rst:1189 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1281 +#: ../../library/functions.rst:1282 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "line-buffered I/O" msgstr "line-buffered I/O(列緩衝 I/O)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1342 ../../library/functions.rst:1987 +#: ../../library/functions.rst:1343 ../../library/functions.rst:1995 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1343 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1721 +#: ../../library/functions.rst:1725 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:1832 +#: ../../library/functions.rst:1840 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:1987 +#: ../../library/functions.rst:1995 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:1987 +#: ../../library/functions.rst:1995 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:1987 +#: ../../library/functions.rst:1995 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/functools.po b/library/functools.po index 79f0848646..34a683985e 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,21 +53,21 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:275 +#: ../../library/functools.rst:39 ../../library/functools.rst:290 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/functools.rst:52 ../../library/functools.rst:143 +#: ../../library/functools.rst:52 ../../library/functools.rst:158 msgid "" "The cache is threadsafe so that the wrapped function can be used in multiple " "threads. This means that the underlying data structure will remain coherent " "during concurrent updates." msgstr "" -#: ../../library/functools.rst:56 ../../library/functools.rst:147 +#: ../../library/functools.rst:56 ../../library/functools.rst:162 msgid "" "It is possible for the wrapped function to be called more than once if " "another thread makes an additional call before the initial call has been " @@ -82,8 +82,8 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" -#: ../../library/functools.rst:70 ../../library/functools.rst:127 -#: ../../library/functools.rst:367 +#: ../../library/functools.rst:70 ../../library/functools.rst:142 +#: ../../library/functools.rst:382 msgid "Example::" msgstr "" "範例:\n" @@ -114,12 +114,23 @@ msgstr "" #: ../../library/functools.rst:94 msgid "" +"The *cached_property* does not prevent a possible race condition in multi-" +"threaded usage. The getter function could run more than once on the same " +"instance, with the latest run setting the cached value. If the cached " +"property is idempotent or otherwise not harmful to run more than once on an " +"instance, this is fine. If synchronization is needed, implement the " +"necessary locking inside the decorated getter function or around the cached " +"property access." +msgstr "" + +#: ../../library/functools.rst:102 +msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " "dictionaries. This means that instance dictionaries can take more space " "than usual." msgstr "" -#: ../../library/functools.rst:98 +#: ../../library/functools.rst:106 msgid "" "Also, this decorator requires that the ``__dict__`` attribute on each " "instance be a mutable mapping. This means it will not work with some types, " @@ -129,7 +140,7 @@ msgid "" "such classes don't provide a ``__dict__`` attribute at all)." msgstr "" -#: ../../library/functools.rst:105 +#: ../../library/functools.rst:113 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " "desired, an effect similar to :func:`cached_property` can also be achieved " @@ -138,7 +149,16 @@ msgid "" "`cached_property`." msgstr "" -#: ../../library/functools.rst:115 +#: ../../library/functools.rst:120 +msgid "" +"Prior to Python 3.12, ``cached_property`` included an undocumented lock to " +"ensure that in multi-threaded usage the getter function was guaranteed to " +"run only once per instance. However, the lock was per-property, not per-" +"instance, which could result in unacceptably high lock contention. In Python " +"3.12+ this locking is removed." +msgstr "" + +#: ../../library/functools.rst:130 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" @@ -148,7 +168,7 @@ msgid "" "comparison functions." msgstr "" -#: ../../library/functools.rst:122 +#: ../../library/functools.rst:137 msgid "" "A comparison function is any callable that accepts two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " @@ -156,25 +176,25 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" -#: ../../library/functools.rst:131 +#: ../../library/functools.rst:146 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functools.rst:139 +#: ../../library/functools.rst:154 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " "bound function is periodically called with the same arguments." msgstr "" -#: ../../library/functools.rst:151 +#: ../../library/functools.rst:166 msgid "" "Since a dictionary is used to cache results, the positional and keyword " "arguments to the function must be :term:`hashable`." msgstr "" -#: ../../library/functools.rst:154 +#: ../../library/functools.rst:169 msgid "" "Distinct argument patterns may be considered to be distinct calls with " "separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " @@ -182,20 +202,20 @@ msgid "" "entries." msgstr "" -#: ../../library/functools.rst:159 +#: ../../library/functools.rst:174 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " "*maxsize* at its default value of 128::" msgstr "" -#: ../../library/functools.rst:167 +#: ../../library/functools.rst:182 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." msgstr "" -#: ../../library/functools.rst:170 +#: ../../library/functools.rst:185 msgid "" "If *typed* is set to true, function arguments of different types will be " "cached separately. If *typed* is false, the implementation will usually " @@ -203,7 +223,7 @@ msgid "" "such as *str* and *int* may be cached separately even when *typed* is false.)" msgstr "" -#: ../../library/functools.rst:176 +#: ../../library/functools.rst:191 msgid "" "Note, type specificity applies only to the function's immediate arguments " "rather than their contents. The scalar arguments, ``Decimal(42)`` and " @@ -212,7 +232,7 @@ msgid "" "Fraction(42))`` are treated as equivalent." msgstr "" -#: ../../library/functools.rst:182 +#: ../../library/functools.rst:197 msgid "" "The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " @@ -220,7 +240,7 @@ msgid "" "has no effect." msgstr "" -#: ../../library/functools.rst:187 +#: ../../library/functools.rst:202 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " @@ -228,32 +248,32 @@ msgid "" "*maxsize* and *currsize*." msgstr "" -#: ../../library/functools.rst:192 +#: ../../library/functools.rst:207 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." msgstr "" -#: ../../library/functools.rst:195 +#: ../../library/functools.rst:210 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " "the cache, or for rewrapping the function with a different cache." msgstr "" -#: ../../library/functools.rst:199 +#: ../../library/functools.rst:214 msgid "" "The cache keeps references to the arguments and return values until they age " "out of the cache or until the cache is cleared." msgstr "" -#: ../../library/functools.rst:202 +#: ../../library/functools.rst:217 msgid "" "If a method is cached, the ``self`` instance argument is included in the " "cache. See :ref:`faq-cache-method-calls`" msgstr "" -#: ../../library/functools.rst:205 +#: ../../library/functools.rst:220 msgid "" "An `LRU (least recently used) cache `_ works best when the " @@ -263,7 +283,7 @@ msgid "" "long-running processes such as web servers." msgstr "" -#: ../../library/functools.rst:212 +#: ../../library/functools.rst:227 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " @@ -271,44 +291,44 @@ msgid "" "objects on each call, or impure functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:217 +#: ../../library/functools.rst:232 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:236 +#: ../../library/functools.rst:251 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:256 +#: ../../library/functools.rst:271 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:259 +#: ../../library/functools.rst:274 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:262 +#: ../../library/functools.rst:277 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:267 +#: ../../library/functools.rst:282 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:271 +#: ../../library/functools.rst:286 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:295 +#: ../../library/functools.rst:310 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -317,7 +337,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:304 +#: ../../library/functools.rst:319 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -325,13 +345,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:311 +#: ../../library/functools.rst:326 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:317 +#: ../../library/functools.rst:332 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -340,7 +360,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:333 +#: ../../library/functools.rst:348 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -349,20 +369,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:348 +#: ../../library/functools.rst:363 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:352 +#: ../../library/functools.rst:367 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:355 +#: ../../library/functools.rst:370 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -371,7 +391,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:361 +#: ../../library/functools.rst:376 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -380,7 +400,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:392 +#: ../../library/functools.rst:407 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -393,30 +413,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:401 +#: ../../library/functools.rst:416 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:413 +#: ../../library/functools.rst:428 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:418 +#: ../../library/functools.rst:433 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:421 +#: ../../library/functools.rst:436 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:432 +#: ../../library/functools.rst:447 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -424,36 +444,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:450 +#: ../../library/functools.rst:465 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:467 +#: ../../library/functools.rst:482 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:478 +#: ../../library/functools.rst:493 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:486 +#: ../../library/functools.rst:501 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:500 +#: ../../library/functools.rst:515 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:520 +#: ../../library/functools.rst:535 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -462,42 +482,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:526 +#: ../../library/functools.rst:541 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:541 +#: ../../library/functools.rst:556 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:549 +#: ../../library/functools.rst:564 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:563 +#: ../../library/functools.rst:578 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:566 +#: ../../library/functools.rst:581 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:573 +#: ../../library/functools.rst:588 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:576 +#: ../../library/functools.rst:591 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -505,7 +525,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:594 +#: ../../library/functools.rst:609 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -514,14 +534,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:616 +#: ../../library/functools.rst:631 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:625 +#: ../../library/functools.rst:640 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -535,7 +555,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:635 +#: ../../library/functools.rst:650 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -543,7 +563,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:640 +#: ../../library/functools.rst:655 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -552,7 +572,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:646 +#: ../../library/functools.rst:661 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -561,26 +581,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:652 +#: ../../library/functools.rst:667 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:655 +#: ../../library/functools.rst:670 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:658 +#: ../../library/functools.rst:673 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:661 +#: ../../library/functools.rst:676 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:669 +#: ../../library/functools.rst:684 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -588,42 +608,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:695 +#: ../../library/functools.rst:710 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:703 +#: ../../library/functools.rst:718 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:705 +#: ../../library/functools.rst:720 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:711 +#: ../../library/functools.rst:726 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:717 +#: ../../library/functools.rst:732 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:723 +#: ../../library/functools.rst:738 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:726 +#: ../../library/functools.rst:741 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/gc.po b/library/gc.po index a57922c31c..8eb1ff9977 100644 --- a/library/gc.po +++ b/library/gc.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-21 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -365,9 +365,10 @@ msgstr "" "`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" #: ../../library/gc.rst:261 +#, fuzzy msgid "" -"Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" -"attr:`gc.garbage` anymore." +"Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " +"end up in :attr:`gc.garbage` anymore." msgstr "" "根據 :pep:`442`,帶有 :meth:`__del__` method 的物件最終不會在 :attr:`gc." "garbage` 內。" diff --git a/library/glob.po b/library/glob.po index acdc136f27..6872a85521 100644 --- a/library/glob.po +++ b/library/glob.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 01:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,6 +65,7 @@ msgid "The :mod:`pathlib` module offers high-level path objects." msgstr ":mod:`pathlib` 模組提供高階路徑物件。" #: ../../library/glob.rst:45 +#, fuzzy 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 " @@ -73,7 +74,7 @@ msgid "" "symlinks are included in the results (as in the shell). Whether or not the " "results are sorted depends on the file system. If a file that satisfies " "conditions is removed or added during the call of this function, whether a " -"path name for that file be included is unspecified." +"path name for that file will be included is unspecified." msgstr "" "回傳與 *pathname* 匹配、可能為空的路徑名稱 list,它必須是包含路徑規範的字" "串。 *pathname* 可以是絕對的(如 :file:`/usr/src/Python-1.5/Makefile`)或相對" diff --git a/library/gzip.po b/library/gzip.po index 4a7e6cec21..d70a3c98a7 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -258,11 +258,17 @@ msgstr "" #: ../../library/gzip.rst:174 msgid "" +"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " +"instead." +msgstr "" + +#: ../../library/gzip.rst:178 +msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" -#: ../../library/gzip.rst:181 +#: ../../library/gzip.rst:185 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " @@ -271,18 +277,18 @@ msgid "" "The zlib function is faster." msgstr "" -#: ../../library/gzip.rst:188 +#: ../../library/gzip.rst:192 msgid "Added the *mtime* parameter for reproducible output." msgstr "" -#: ../../library/gzip.rst:190 +#: ../../library/gzip.rst:194 msgid "" "Speed is improved by compressing all data at once instead of in a streamed " "fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." "compress` for better speed." msgstr "" -#: ../../library/gzip.rst:197 +#: ../../library/gzip.rst:201 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -291,82 +297,82 @@ msgid "" "*wbits* set to 31 is faster." msgstr "" -#: ../../library/gzip.rst:204 +#: ../../library/gzip.rst:208 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" -#: ../../library/gzip.rst:211 +#: ../../library/gzip.rst:215 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/gzip.rst:213 +#: ../../library/gzip.rst:217 msgid "Example of how to read a compressed file::" msgstr "" -#: ../../library/gzip.rst:219 +#: ../../library/gzip.rst:223 msgid "Example of how to create a compressed GZIP file::" msgstr "" -#: ../../library/gzip.rst:226 +#: ../../library/gzip.rst:230 msgid "Example of how to GZIP compress an existing file::" msgstr "" -#: ../../library/gzip.rst:234 +#: ../../library/gzip.rst:238 msgid "Example of how to GZIP compress a binary string::" msgstr "" -#: ../../library/gzip.rst:243 +#: ../../library/gzip.rst:247 msgid "Module :mod:`zlib`" msgstr ":mod:`zlib` 模組" -#: ../../library/gzip.rst:243 +#: ../../library/gzip.rst:247 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." msgstr "" -#: ../../library/gzip.rst:250 +#: ../../library/gzip.rst:254 msgid "Command Line Interface" msgstr "" -#: ../../library/gzip.rst:252 +#: ../../library/gzip.rst:256 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:255 +#: ../../library/gzip.rst:259 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:259 +#: ../../library/gzip.rst:263 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:263 +#: ../../library/gzip.rst:267 msgid "Command line options" msgstr "" -#: ../../library/gzip.rst:267 +#: ../../library/gzip.rst:271 msgid "If *file* is not specified, read from :attr:`sys.stdin`." msgstr "" -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:275 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:275 +#: ../../library/gzip.rst:279 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:279 +#: ../../library/gzip.rst:283 msgid "Decompress the given file." msgstr "" -#: ../../library/gzip.rst:283 +#: ../../library/gzip.rst:287 msgid "Show the help message." msgstr "" diff --git a/library/hashlib.po b/library/hashlib.po index 83db565fc5..fe8046db21 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-11 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,25 +116,32 @@ msgstr "" msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" -#: ../../library/hashlib.rst:97 +#: ../../library/hashlib.rst:96 +msgid "" +"For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " +"does not provide we fall back to a verified implementation from the `HACL\\* " +"project`_." +msgstr "" + +#: ../../library/hashlib.rst:102 msgid "Usage" msgstr "用法" -#: ../../library/hashlib.rst:99 +#: ../../library/hashlib.rst:104 msgid "" "To obtain the digest of the byte string ``b\"Nobody inspects the spammish " "repetition\"``::" msgstr "" -#: ../../library/hashlib.rst:111 +#: ../../library/hashlib.rst:116 msgid "More condensed:" msgstr "" -#: ../../library/hashlib.rst:117 +#: ../../library/hashlib.rst:122 msgid "Constructors" msgstr "建構函式" -#: ../../library/hashlib.rst:121 +#: ../../library/hashlib.rst:126 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " @@ -142,25 +149,25 @@ msgid "" "library may offer." msgstr "" -#: ../../library/hashlib.rst:126 +#: ../../library/hashlib.rst:131 msgid "Using :func:`new` with an algorithm name:" msgstr "" -#: ../../library/hashlib.rst:145 +#: ../../library/hashlib.rst:150 msgid "" "Named constructors such as these are faster than passing an algorithm name " "to :func:`new`." msgstr "" -#: ../../library/hashlib.rst:149 +#: ../../library/hashlib.rst:154 msgid "Attributes" msgstr "" -#: ../../library/hashlib.rst:151 +#: ../../library/hashlib.rst:156 msgid "Hashlib provides the following constant module attributes:" msgstr "" -#: ../../library/hashlib.rst:155 +#: ../../library/hashlib.rst:160 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -168,7 +175,7 @@ msgid "" "excludes it." msgstr "" -#: ../../library/hashlib.rst:164 +#: ../../library/hashlib.rst:169 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -177,59 +184,52 @@ msgid "" "(thanks to OpenSSL)." msgstr "" -#: ../../library/hashlib.rst:173 +#: ../../library/hashlib.rst:178 msgid "Hash Objects" msgstr "" -#: ../../library/hashlib.rst:175 +#: ../../library/hashlib.rst:180 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" msgstr "" -#: ../../library/hashlib.rst:180 +#: ../../library/hashlib.rst:185 msgid "The size of the resulting hash in bytes." msgstr "" -#: ../../library/hashlib.rst:184 +#: ../../library/hashlib.rst:189 msgid "The internal block size of the hash algorithm in bytes." msgstr "" -#: ../../library/hashlib.rst:186 +#: ../../library/hashlib.rst:191 msgid "A hash object has the following attributes:" msgstr "" -#: ../../library/hashlib.rst:190 +#: ../../library/hashlib.rst:195 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" -#: ../../library/hashlib.rst:193 +#: ../../library/hashlib.rst:198 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" -#: ../../library/hashlib.rst:198 +#: ../../library/hashlib.rst:203 msgid "A hash object has the following methods:" msgstr "" -#: ../../library/hashlib.rst:203 +#: ../../library/hashlib.rst:208 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" -#: ../../library/hashlib.rst:208 -msgid "" -"The Python GIL is released to allow other threads to run while hash updates " -"on data larger than 2047 bytes is taking place when using hash algorithms " -"supplied by OpenSSL." -msgstr "" - #: ../../library/hashlib.rst:216 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " @@ -359,26 +359,23 @@ msgid "" "digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." msgstr "" -#: ../../library/hashlib.rst:346 -msgid "" -"A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The " -"Python implementation uses an inline version of :mod:`hmac`. It is about " -"three times slower and doesn't release the GIL." +#: ../../library/hashlib.rst:342 +msgid "Function only available when Python is compiled with OpenSSL." msgstr "" -#: ../../library/hashlib.rst:352 +#: ../../library/hashlib.rst:346 msgid "" -"Slow Python implementation of *pbkdf2_hmac* is deprecated. In the future the " -"function will only be available when Python is compiled with OpenSSL." +"Function now only available when Python is built with OpenSSL. The slow pure " +"Python implementation has been removed." msgstr "" -#: ../../library/hashlib.rst:358 +#: ../../library/hashlib.rst:352 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." msgstr "" -#: ../../library/hashlib.rst:361 +#: ../../library/hashlib.rst:355 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " @@ -386,138 +383,138 @@ msgid "" "source, e.g. :func:`os.urandom`." msgstr "" -#: ../../library/hashlib.rst:366 +#: ../../library/hashlib.rst:360 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key." msgstr "" -#: ../../library/hashlib.rst:374 +#: ../../library/hashlib.rst:368 msgid "BLAKE2" msgstr "BLAKE2" -#: ../../library/hashlib.rst:381 +#: ../../library/hashlib.rst:375 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: ../../library/hashlib.rst:384 +#: ../../library/hashlib.rst:378 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: ../../library/hashlib.rst:387 +#: ../../library/hashlib.rst:381 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: ../../library/hashlib.rst:390 +#: ../../library/hashlib.rst:384 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: ../../library/hashlib.rst:393 +#: ../../library/hashlib.rst:387 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." msgstr "" -#: ../../library/hashlib.rst:398 +#: ../../library/hashlib.rst:392 msgid "Creating hash objects" msgstr "" -#: ../../library/hashlib.rst:400 +#: ../../library/hashlib.rst:394 msgid "New hash objects are created by calling constructor functions:" msgstr "" -#: ../../library/hashlib.rst:414 +#: ../../library/hashlib.rst:408 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: ../../library/hashlib.rst:417 +#: ../../library/hashlib.rst:411 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: ../../library/hashlib.rst:420 +#: ../../library/hashlib.rst:414 msgid "*digest_size*: size of output digest in bytes." msgstr "" -#: ../../library/hashlib.rst:422 +#: ../../library/hashlib.rst:416 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:425 +#: ../../library/hashlib.rst:419 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:428 +#: ../../library/hashlib.rst:422 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:431 +#: ../../library/hashlib.rst:425 msgid "The following table shows limits for general parameters (in bytes):" msgstr "" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:428 msgid "Hash" msgstr "" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:428 msgid "digest_size" msgstr "digest_size" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:428 msgid "len(key)" msgstr "len(key)" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:428 msgid "len(salt)" msgstr "len(salt)" -#: ../../library/hashlib.rst:434 +#: ../../library/hashlib.rst:428 msgid "len(person)" msgstr "len(person)" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:430 msgid "BLAKE2b" msgstr "BLAKE2b" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:430 msgid "64" msgstr "64" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:430 msgid "16" msgstr "16" -#: ../../library/hashlib.rst:437 +#: ../../library/hashlib.rst:431 msgid "BLAKE2s" msgstr "BLAKE2s" -#: ../../library/hashlib.rst:437 +#: ../../library/hashlib.rst:431 msgid "32" msgstr "32" -#: ../../library/hashlib.rst:437 +#: ../../library/hashlib.rst:431 msgid "8" msgstr "8" -#: ../../library/hashlib.rst:442 +#: ../../library/hashlib.rst:436 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -527,49 +524,49 @@ msgid "" "the case for *key*.)" msgstr "" -#: ../../library/hashlib.rst:449 +#: ../../library/hashlib.rst:443 msgid "These sizes are available as module `constants`_ described below." msgstr "" -#: ../../library/hashlib.rst:451 +#: ../../library/hashlib.rst:445 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "" -#: ../../library/hashlib.rst:453 +#: ../../library/hashlib.rst:447 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:455 +#: ../../library/hashlib.rst:449 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -#: ../../library/hashlib.rst:458 +#: ../../library/hashlib.rst:452 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:461 +#: ../../library/hashlib.rst:455 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:464 +#: ../../library/hashlib.rst:458 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:466 +#: ../../library/hashlib.rst:460 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:469 +#: ../../library/hashlib.rst:463 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." @@ -579,42 +576,42 @@ msgstr "" msgid "Explanation of tree mode parameters." msgstr "" -#: ../../library/hashlib.rst:476 +#: ../../library/hashlib.rst:470 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:482 +#: ../../library/hashlib.rst:476 msgid "Constants" msgstr "常數" -#: ../../library/hashlib.rst:487 +#: ../../library/hashlib.rst:481 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:493 +#: ../../library/hashlib.rst:487 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:499 +#: ../../library/hashlib.rst:493 msgid "Maximum key size." msgstr "" -#: ../../library/hashlib.rst:505 +#: ../../library/hashlib.rst:499 msgid "Maximum digest size that the hash function can output." msgstr "" -#: ../../library/hashlib.rst:509 +#: ../../library/hashlib.rst:503 msgid "Examples" msgstr "範例" -#: ../../library/hashlib.rst:512 +#: ../../library/hashlib.rst:506 msgid "Simple hashing" msgstr "" -#: ../../library/hashlib.rst:514 +#: ../../library/hashlib.rst:508 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -623,41 +620,41 @@ msgid "" "`digest` (or :meth:`hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:527 +#: ../../library/hashlib.rst:521 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:534 +#: ../../library/hashlib.rst:528 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:547 +#: ../../library/hashlib.rst:542 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:549 +#: ../../library/hashlib.rst:544 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: ../../library/hashlib.rst:563 +#: ../../library/hashlib.rst:558 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:579 +#: ../../library/hashlib.rst:574 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:581 +#: ../../library/hashlib.rst:576 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_)" msgstr "" -#: ../../library/hashlib.rst:665 +#: ../../library/hashlib.rst:660 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:670 +#: ../../library/hashlib.rst:665 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " @@ -735,18 +732,18 @@ msgid "" "information." msgstr "" -#: ../../library/hashlib.rst:693 +#: ../../library/hashlib.rst:688 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:695 +#: ../../library/hashlib.rst:690 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:699 +#: ../../library/hashlib.rst:694 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -756,41 +753,41 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:706 +#: ../../library/hashlib.rst:701 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: ../../library/hashlib.rst:710 +#: ../../library/hashlib.rst:705 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: ../../library/hashlib.rst:724 +#: ../../library/hashlib.rst:719 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:738 +#: ../../library/hashlib.rst:733 msgid "Tree mode" msgstr "" -#: ../../library/hashlib.rst:740 +#: ../../library/hashlib.rst:735 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: ../../library/hashlib.rst:746 +#: ../../library/hashlib.rst:741 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: ../../library/hashlib.rst:776 +#: ../../library/hashlib.rst:771 msgid "Credits" msgstr "" -#: ../../library/hashlib.rst:778 +#: ../../library/hashlib.rst:773 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -798,120 +795,119 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: ../../library/hashlib.rst:783 +#: ../../library/hashlib.rst:778 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: ../../library/hashlib.rst:785 +#: ../../library/hashlib.rst:780 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: ../../library/hashlib.rst:789 +#: ../../library/hashlib.rst:784 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: ../../library/hashlib.rst:791 +#: ../../library/hashlib.rst:786 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: ../../library/hashlib.rst:794 +#: ../../library/hashlib.rst:789 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:798 +#: ../../library/hashlib.rst:793 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:802 +#: ../../library/hashlib.rst:797 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:806 +#: ../../library/hashlib.rst:801 msgid "*Alexandr Sokolovskiy*" msgstr "" -#: ../../library/hashlib.rst:826 +#: ../../library/hashlib.rst:822 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` 模組" -#: ../../library/hashlib.rst:826 +#: ../../library/hashlib.rst:822 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: ../../library/hashlib.rst:829 +#: ../../library/hashlib.rst:825 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/hashlib.rst:829 +#: ../../library/hashlib.rst:825 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: ../../library/hashlib.rst:832 +#: ../../library/hashlib.rst:828 msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" msgstr "" -#: ../../library/hashlib.rst:832 +#: ../../library/hashlib.rst:828 msgid "The FIPS 180-4 publication on Secure Hash Algorithms." msgstr "" -#: ../../library/hashlib.rst:835 +#: ../../library/hashlib.rst:831 msgid "https://csrc.nist.gov/publications/detail/fips/202/final" msgstr "" -#: ../../library/hashlib.rst:835 +#: ../../library/hashlib.rst:831 msgid "The FIPS 202 publication on the SHA-3 Standard." msgstr "" -#: ../../library/hashlib.rst:838 +#: ../../library/hashlib.rst:834 msgid "https://www.blake2.net/" msgstr "https://www.blake2.net/" -#: ../../library/hashlib.rst:838 +#: ../../library/hashlib.rst:834 msgid "Official BLAKE2 website." msgstr "BLAKE2 官方網站。" -#: ../../library/hashlib.rst:842 +#: ../../library/hashlib.rst:838 msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -msgstr "" -"https://en.wikipedia.org/wiki/Cryptographic_hash_function" +msgstr "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -#: ../../library/hashlib.rst:841 +#: ../../library/hashlib.rst:837 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: ../../library/hashlib.rst:845 +#: ../../library/hashlib.rst:841 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "https://www.ietf.org/rfc/rfc8018.txt" -#: ../../library/hashlib.rst:845 +#: ../../library/hashlib.rst:841 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" msgstr "" -#: ../../library/hashlib.rst:847 +#: ../../library/hashlib.rst:843 msgid "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" msgstr "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" -#: ../../library/hashlib.rst:848 +#: ../../library/hashlib.rst:844 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" @@ -933,6 +929,6 @@ msgstr "OpenSSL" msgid "(use in module hashlib)" msgstr "(使用於 hashlib 模組中)" -#: ../../library/hashlib.rst:378 +#: ../../library/hashlib.rst:372 msgid "blake2b, blake2s" msgstr "blake2b, blake2s" diff --git a/library/html.entities.po b/library/html.entities.po index cc26859dfb..274b4ed24c 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:38+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgid "" "This module defines four dictionaries, :data:`html5`, :data:" "`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`." msgstr "" -"該 module(模組)定義了四個字典::data:`html5`、:data:" -"`name2codepoint`、:data:`codepoint2name` 以及 :data:`entitydefs`。" +"該 module(模組)定義了四個字典::data:`html5`、:data:`name2codepoint`、:" +"data:`codepoint2name` 以及 :data:`entitydefs`。" #: ../../library/html.entities.rst:19 msgid "" @@ -46,9 +46,9 @@ msgid "" "unescape`." msgstr "" "將 HTML5 命名字元引用 [#]_ 對映到同等 Unicode 字元的字典,例如 " -"``html5['gt;'] == '>'``。請注意,後面的的分號包含在名稱中(例如 ``'gt;'``" -"),但有些名稱即使沒有分號也會被此標準接受:在這種情況下,名稱可帶有或不帶" -"有 ``';'``。請見 :func:`html.unescape`。" +"``html5['gt;'] == '>'``。請注意,後面的的分號包含在名稱中(例如 ``'gt;'``)," +"但有些名稱即使沒有分號也會被此標準接受:在這種情況下,名稱可帶有或不帶有 " +"``';'``。請見 :func:`html.unescape`。" #: ../../library/html.entities.rst:31 msgid "" @@ -57,11 +57,13 @@ msgid "" msgstr "將 XHTML 1.0 實體定義對映到 ISO Latin-1 中的替換文字的字典。" #: ../../library/html.entities.rst:37 -msgid "A dictionary that maps HTML entity names to the Unicode code points." +#, fuzzy +msgid "A dictionary that maps HTML4 entity names to the Unicode code points." msgstr "將 HTML 實體名稱對映到 Unicode 程式點的字典。" #: ../../library/html.entities.rst:42 -msgid "A dictionary that maps Unicode code points to HTML entity names." +#, fuzzy +msgid "A dictionary that maps Unicode code points to HTML4 entity names." msgstr "將 Unicode 程式點對映到 HTML 實體名稱的字典。" #: ../../library/html.entities.rst:46 diff --git a/library/http.client.po b/library/http.client.po index c365decd35..b4967150dc 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgstr "" #: ../../library/http.client.rst:23 msgid "" -"The `Requests package `_ is " +"The `Requests package `_ is " "recommended for a higher-level HTTP client interface." msgstr "" @@ -94,7 +94,7 @@ msgstr "" msgid "*blocksize* parameter was added." msgstr "新增 *blocksize* 參數。" -#: ../../library/http.client.rst:75 +#: ../../library/http.client.rst:74 msgid "" "A subclass of :class:`HTTPConnection` that uses SSL for communication with " "secure servers. Default port is ``443``. If *context* is specified, it " @@ -102,84 +102,77 @@ msgid "" "options." msgstr "" -#: ../../library/http.client.rst:80 +#: ../../library/http.client.rst:79 msgid "Please read :ref:`ssl-security` for more information on best practices." msgstr "" -#: ../../library/http.client.rst:82 +#: ../../library/http.client.rst:81 msgid "*source_address*, *context* and *check_hostname* were added." msgstr "新增 *source_address*\\ 、\\ *context* 與 *check_hostname*\\ 。" -#: ../../library/http.client.rst:85 +#: ../../library/http.client.rst:84 msgid "" "This class now supports HTTPS virtual hosts if possible (that is, if :data:" "`ssl.HAS_SNI` is true)." msgstr "" -#: ../../library/http.client.rst:89 +#: ../../library/http.client.rst:88 msgid "" "The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are " "no longer supported." msgstr "" -#: ../../library/http.client.rst:93 +#: ../../library/http.client.rst:92 msgid "" "This class now performs all the necessary certificate and hostname checks by " "default. To revert to the previous, unverified, behavior :func:`ssl." "_create_unverified_context` can be passed to the *context* parameter." msgstr "" -#: ../../library/http.client.rst:99 +#: ../../library/http.client.rst:98 msgid "" "This class now enables TLS 1.3 :attr:`ssl.SSLContext.post_handshake_auth` " "for the default *context* or when *cert_file* is passed with a custom " "*context*." msgstr "" -#: ../../library/http.client.rst:104 +#: ../../library/http.client.rst:103 msgid "" "This class now sends an ALPN extension with protocol indicator ``http/1.1`` " "when no *context* is given. Custom *context* should set ALPN protocols with :" "meth:`~ssl.SSLContext.set_alpn_protocol`." msgstr "" -#: ../../library/http.client.rst:111 +#: ../../library/http.client.rst:108 msgid "" -"*key_file* and *cert_file* are deprecated in favor of *context*. Please use :" -"meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +"The deprecated *key_file*, *cert_file* and *check_hostname* parameters have " +"been removed." msgstr "" -#: ../../library/http.client.rst:116 -msgid "" -"The *check_hostname* parameter is also deprecated; the :attr:`ssl.SSLContext." -"check_hostname` attribute of *context* should be used instead." -msgstr "" - -#: ../../library/http.client.rst:123 +#: ../../library/http.client.rst:115 msgid "" "Class whose instances are returned upon successful connection. Not " "instantiated directly by user." msgstr "" -#: ../../library/http.client.rst:126 +#: ../../library/http.client.rst:118 msgid "" "The *strict* parameter was removed. HTTP 0.9 style \"Simple Responses\" are " "no longer supported." msgstr "" -#: ../../library/http.client.rst:130 +#: ../../library/http.client.rst:122 msgid "This module provides the following function:" msgstr "" -#: ../../library/http.client.rst:134 +#: ../../library/http.client.rst:126 msgid "" "Parse the headers from a file pointer *fp* representing a HTTP request/" "response. The file has to be a :class:`BufferedIOBase` reader (i.e. not " "text) and must provide a valid :rfc:`2822` style header." msgstr "" -#: ../../library/http.client.rst:138 +#: ../../library/http.client.rst:130 msgid "" "This function returns an instance of :class:`http.client.HTTPMessage` that " "holds the header fields, but no payload (the same as :attr:`HTTPResponse." @@ -187,7 +180,7 @@ msgid "" "returning, the file pointer *fp* is ready to read the HTTP body." msgstr "" -#: ../../library/http.client.rst:145 +#: ../../library/http.client.rst:137 msgid "" ":meth:`parse_headers` does not parse the start-line of a HTTP message; it " "only parses the ``Name: value`` lines. The file has to be ready to read " @@ -195,46 +188,46 @@ msgid "" "calling the function." msgstr "" -#: ../../library/http.client.rst:150 +#: ../../library/http.client.rst:142 msgid "The following exceptions are raised as appropriate:" msgstr "" -#: ../../library/http.client.rst:155 +#: ../../library/http.client.rst:147 msgid "" "The base class of the other exceptions in this module. It is a subclass of :" "exc:`Exception`." msgstr "" -#: ../../library/http.client.rst:161 ../../library/http.client.rst:172 -#: ../../library/http.client.rst:177 ../../library/http.client.rst:182 -#: ../../library/http.client.rst:187 ../../library/http.client.rst:192 +#: ../../library/http.client.rst:153 ../../library/http.client.rst:164 +#: ../../library/http.client.rst:169 ../../library/http.client.rst:174 +#: ../../library/http.client.rst:179 ../../library/http.client.rst:184 msgid "A subclass of :exc:`HTTPException`." msgstr "" -#: ../../library/http.client.rst:166 +#: ../../library/http.client.rst:158 msgid "" "A subclass of :exc:`HTTPException`, raised if a port is given and is either " "non-numeric or empty." msgstr "" -#: ../../library/http.client.rst:197 ../../library/http.client.rst:202 -#: ../../library/http.client.rst:207 +#: ../../library/http.client.rst:189 ../../library/http.client.rst:194 +#: ../../library/http.client.rst:199 msgid "A subclass of :exc:`ImproperConnectionState`." msgstr "" -#: ../../library/http.client.rst:212 +#: ../../library/http.client.rst:204 msgid "" "A subclass of :exc:`HTTPException`. Raised if a server responds with a HTTP " "status code that we don't understand." msgstr "" -#: ../../library/http.client.rst:218 +#: ../../library/http.client.rst:210 msgid "" "A subclass of :exc:`HTTPException`. Raised if an excessively long line is " "received in the HTTP protocol from the server." msgstr "" -#: ../../library/http.client.rst:224 +#: ../../library/http.client.rst:216 msgid "" "A subclass of :exc:`ConnectionResetError` and :exc:`BadStatusLine`. Raised " "by :meth:`HTTPConnection.getresponse` when the attempt to read the response " @@ -242,46 +235,46 @@ msgid "" "has closed the connection." msgstr "" -#: ../../library/http.client.rst:229 +#: ../../library/http.client.rst:221 msgid "Previously, :exc:`BadStatusLine`\\ ``('')`` was raised." msgstr "" -#: ../../library/http.client.rst:233 +#: ../../library/http.client.rst:225 msgid "The constants defined in this module are:" msgstr "" -#: ../../library/http.client.rst:237 +#: ../../library/http.client.rst:229 msgid "The default port for the HTTP protocol (always ``80``)." msgstr "" -#: ../../library/http.client.rst:241 +#: ../../library/http.client.rst:233 msgid "The default port for the HTTPS protocol (always ``443``)." msgstr "" -#: ../../library/http.client.rst:245 +#: ../../library/http.client.rst:237 msgid "This dictionary maps the HTTP 1.1 status codes to the W3C names." msgstr "" -#: ../../library/http.client.rst:247 +#: ../../library/http.client.rst:239 msgid "" "Example: ``http.client.responses[http.client.NOT_FOUND]`` is ``'Not Found'``." msgstr "" -#: ../../library/http.client.rst:249 +#: ../../library/http.client.rst:241 msgid "" "See :ref:`http-status-codes` for a list of HTTP status codes that are " "available in this module as constants." msgstr "" -#: ../../library/http.client.rst:256 +#: ../../library/http.client.rst:248 msgid "HTTPConnection Objects" msgstr "HTTPConnection 物件" -#: ../../library/http.client.rst:258 +#: ../../library/http.client.rst:250 msgid ":class:`HTTPConnection` instances have the following methods:" msgstr "" -#: ../../library/http.client.rst:264 +#: ../../library/http.client.rst:256 msgid "" "This will send a request to the server using the HTTP request method " "*method* and the request URI *url*. The provided *url* must be an absolute " @@ -290,7 +283,7 @@ msgid "" "methods)." msgstr "" -#: ../../library/http.client.rst:270 +#: ../../library/http.client.rst:262 msgid "" "If *body* is specified, the specified data is sent after the headers are " "finished. It may be a :class:`str`, a :term:`bytes-like object`, an open :" @@ -305,7 +298,7 @@ msgid "" "iterable is exhausted." msgstr "" -#: ../../library/http.client.rst:282 +#: ../../library/http.client.rst:274 msgid "" "The *headers* argument should be a mapping of extra HTTP headers to send " "with the request. A :rfc:`Host header <2616#section-14.23>` must be provided " @@ -314,7 +307,7 @@ msgid "" "methods)." msgstr "" -#: ../../library/http.client.rst:288 +#: ../../library/http.client.rst:280 msgid "" "If *headers* contains neither Content-Length nor Transfer-Encoding, but " "there is a request body, one of those header fields will be added " @@ -327,7 +320,7 @@ msgid "" "Length." msgstr "" -#: ../../library/http.client.rst:300 +#: ../../library/http.client.rst:292 msgid "" "The *encode_chunked* argument is only relevant if Transfer-Encoding is " "specified in *headers*. If *encode_chunked* is ``False``, the " @@ -335,12 +328,12 @@ msgid "" "code. If it is ``True``, the body will be chunk-encoded." msgstr "" -#: ../../library/http.client.rst:305 +#: ../../library/http.client.rst:297 msgid "" "For example, to perform a ``GET`` request to ``https://docs.python.org/3/``::" msgstr "" -#: ../../library/http.client.rst:316 +#: ../../library/http.client.rst:308 msgid "" "Chunked transfer encoding has been added to the HTTP protocol version 1.1. " "Unless the HTTP server is known to handle HTTP 1.1, the caller must either " @@ -348,11 +341,11 @@ msgid "" "that is not also a file as the body representation." msgstr "" -#: ../../library/http.client.rst:322 +#: ../../library/http.client.rst:314 msgid "*body* can now be an iterable." msgstr "" -#: ../../library/http.client.rst:325 +#: ../../library/http.client.rst:317 msgid "" "If neither Content-Length nor Transfer-Encoding are set in *headers*, file " "and iterable *body* objects are now chunk-encoded. The *encode_chunked* " @@ -360,26 +353,26 @@ msgid "" "file objects." msgstr "" -#: ../../library/http.client.rst:334 +#: ../../library/http.client.rst:326 msgid "" "Should be called after a request is sent to get the response from the " "server. Returns an :class:`HTTPResponse` instance." msgstr "" -#: ../../library/http.client.rst:339 +#: ../../library/http.client.rst:331 msgid "" "Note that you must have read the whole response before you can send a new " "request to the server." msgstr "" -#: ../../library/http.client.rst:342 +#: ../../library/http.client.rst:334 msgid "" "If a :exc:`ConnectionError` or subclass is raised, the :class:" "`HTTPConnection` object will be ready to reconnect when a new request is " "sent." msgstr "" -#: ../../library/http.client.rst:350 +#: ../../library/http.client.rst:342 msgid "" "Set the debugging level. The default debug level is ``0``, meaning no " "debugging output is printed. Any value greater than ``0`` will cause all " @@ -387,26 +380,36 @@ msgid "" "is passed to any new :class:`HTTPResponse` objects that are created." msgstr "" -#: ../../library/http.client.rst:360 +#: ../../library/http.client.rst:352 msgid "" "Set the host and the port for HTTP Connect Tunnelling. This allows running " "the connection through a proxy server." msgstr "" -#: ../../library/http.client.rst:363 +#: ../../library/http.client.rst:355 msgid "" -"The host and port arguments specify the endpoint of the tunneled connection " -"(i.e. the address included in the CONNECT request, *not* the address of the " -"proxy server)." +"The *host* and *port* arguments specify the endpoint of the tunneled " +"connection (i.e. the address included in the CONNECT request, *not* the " +"address of the proxy server)." msgstr "" -#: ../../library/http.client.rst:367 +#: ../../library/http.client.rst:359 msgid "" -"The headers argument should be a mapping of extra HTTP headers to send with " -"the CONNECT request." +"The *headers* argument should be a mapping of extra HTTP headers to send " +"with the CONNECT request." msgstr "" -#: ../../library/http.client.rst:370 +#: ../../library/http.client.rst:362 +msgid "" +"As HTTP/1.1 is used for HTTP CONNECT tunnelling request, `as per the RFC " +"`_, a HTTP " +"``Host:`` header must be provided, matching the authority-form of the " +"request target provided as the destination for the CONNECT request. If a " +"HTTP ``Host:`` header is not provided via the headers argument, one is " +"generated and transmitted automatically." +msgstr "" + +#: ../../library/http.client.rst:369 msgid "" "For example, to tunnel through a HTTPS proxy server running locally on port " "8080, we would pass the address of the proxy to the :class:`HTTPSConnection` " @@ -414,14 +417,32 @@ msgid "" "the :meth:`~HTTPConnection.set_tunnel` method::" msgstr "" -#: ../../library/http.client.rst:385 +#: ../../library/http.client.rst:381 +msgid "" +"HTTP CONNECT tunnelling requests use protocol HTTP/1.1, upgraded from " +"protocol HTTP/1.0. ``Host:`` HTTP headers are mandatory for HTTP/1.1, so one " +"will be automatically generated and transmitted if not provided in the " +"headers argument." +msgstr "" + +#: ../../library/http.client.rst:390 +msgid "" +"Returns a dictionary with the headers of the response received from the " +"proxy server to the CONNECT request." +msgstr "" + +#: ../../library/http.client.rst:393 +msgid "If the CONNECT request was not sent, the method returns ``None``." +msgstr "" + +#: ../../library/http.client.rst:400 msgid "" "Connect to the server specified when the object was created. By default, " "this is called automatically when making a request if the client does not " "already have a connection." msgstr "" -#: ../../library/http.client.rst:400 +#: ../../library/http.client.rst:415 msgid "" "Raises an :ref:`auditing event ` ``http.client.connect`` with " "arguments ``self``, ``host``, ``port``." @@ -429,21 +450,21 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``http.client.connect``。" -#: ../../library/http.client.rst:394 +#: ../../library/http.client.rst:409 msgid "Close the connection to the server." msgstr "" -#: ../../library/http.client.rst:399 +#: ../../library/http.client.rst:414 msgid "Buffer size in bytes for sending a file-like message body." msgstr "" -#: ../../library/http.client.rst:404 +#: ../../library/http.client.rst:419 msgid "" "As an alternative to using the :meth:`request` method described above, you " "can also send your request step by step, by using the four functions below." msgstr "" -#: ../../library/http.client.rst:411 +#: ../../library/http.client.rst:426 msgid "" "This should be the first call after the connection to the server has been " "made. It sends a line to the server consisting of the *method* string, the " @@ -453,7 +474,7 @@ msgid "" "with non-False values." msgstr "" -#: ../../library/http.client.rst:421 +#: ../../library/http.client.rst:436 msgid "" "Send an :rfc:`822`\\ -style header to the server. It sends a line to the " "server consisting of the header, a colon and a space, and the first " @@ -461,14 +482,14 @@ msgid "" "consisting of a tab and an argument." msgstr "" -#: ../../library/http.client.rst:429 +#: ../../library/http.client.rst:444 msgid "" "Send a blank line to the server, signalling the end of the headers. The " "optional *message_body* argument can be used to pass a message body " "associated with the request." msgstr "" -#: ../../library/http.client.rst:433 +#: ../../library/http.client.rst:448 msgid "" "If *encode_chunked* is ``True``, the result of each iteration of " "*message_body* will be chunk-encoded as specified in :rfc:`7230`, Section " @@ -481,7 +502,7 @@ msgid "" "the chunk-encoded data immediately after *message_body*." msgstr "" -#: ../../library/http.client.rst:444 +#: ../../library/http.client.rst:459 msgid "" "Due to the chunked encoding specification, empty chunks yielded by an " "iterator body will be ignored by the chunk-encoder. This is to avoid " @@ -489,17 +510,17 @@ msgid "" "malformed encoding." msgstr "" -#: ../../library/http.client.rst:449 +#: ../../library/http.client.rst:464 msgid "Chunked encoding support. The *encode_chunked* parameter was added." msgstr "" -#: ../../library/http.client.rst:456 +#: ../../library/http.client.rst:471 msgid "" "Send data to the server. This should be used directly only after the :meth:" "`endheaders` method has been called and before :meth:`getresponse` is called." msgstr "" -#: ../../library/http.client.rst:471 +#: ../../library/http.client.rst:486 msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." @@ -507,34 +528,34 @@ msgstr "" "引發一個附帶引數 ``self``、``data`` 的\\ :ref:`稽核事件 ` ``http." "client.send``。" -#: ../../library/http.client.rst:466 +#: ../../library/http.client.rst:481 msgid "HTTPResponse Objects" msgstr "HTTPResponse 物件" -#: ../../library/http.client.rst:468 +#: ../../library/http.client.rst:483 msgid "" "An :class:`HTTPResponse` instance wraps the HTTP response from the server. " "It provides access to the request headers and the entity body. The response " "is an iterable object and can be used in a with statement." msgstr "" -#: ../../library/http.client.rst:473 +#: ../../library/http.client.rst:488 msgid "" "The :class:`io.BufferedIOBase` interface is now implemented and all of its " "reader operations are supported." msgstr "" -#: ../../library/http.client.rst:480 +#: ../../library/http.client.rst:495 msgid "Reads and returns the response body, or up to the next *amt* bytes." msgstr "" -#: ../../library/http.client.rst:484 +#: ../../library/http.client.rst:499 msgid "" "Reads up to the next len(b) bytes of the response body into the buffer *b*. " "Returns the number of bytes read." msgstr "" -#: ../../library/http.client.rst:491 +#: ../../library/http.client.rst:506 msgid "" "Return the value of the header *name*, or *default* if there is no header " "matching *name*. If there is more than one header with the name *name*, " @@ -542,87 +563,87 @@ msgid "" "than a single string, its elements are similarly returned joined by commas." msgstr "" -#: ../../library/http.client.rst:498 +#: ../../library/http.client.rst:513 msgid "Return a list of (header, value) tuples." msgstr "" -#: ../../library/http.client.rst:502 +#: ../../library/http.client.rst:517 msgid "Return the ``fileno`` of the underlying socket." msgstr "" -#: ../../library/http.client.rst:506 +#: ../../library/http.client.rst:521 msgid "" "A :class:`http.client.HTTPMessage` instance containing the response " "headers. :class:`http.client.HTTPMessage` is a subclass of :class:`email." "message.Message`." msgstr "" -#: ../../library/http.client.rst:512 +#: ../../library/http.client.rst:527 msgid "" "HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1." msgstr "" -#: ../../library/http.client.rst:516 +#: ../../library/http.client.rst:531 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/http.client.rst:520 +#: ../../library/http.client.rst:535 msgid "" "Headers of the response in the form of an :class:`email.message." "EmailMessage` instance." msgstr "" -#: ../../library/http.client.rst:524 +#: ../../library/http.client.rst:539 msgid "Status code returned by server." msgstr "" -#: ../../library/http.client.rst:528 +#: ../../library/http.client.rst:543 msgid "Reason phrase returned by server." msgstr "" -#: ../../library/http.client.rst:532 +#: ../../library/http.client.rst:547 msgid "" "A debugging hook. If :attr:`debuglevel` is greater than zero, messages will " "be printed to stdout as the response is read and parsed." msgstr "" -#: ../../library/http.client.rst:537 +#: ../../library/http.client.rst:552 msgid "Is ``True`` if the stream is closed." msgstr "" -#: ../../library/http.client.rst:541 +#: ../../library/http.client.rst:556 msgid "Deprecated in favor of :attr:`~HTTPResponse.url`." msgstr "" -#: ../../library/http.client.rst:546 +#: ../../library/http.client.rst:561 msgid "Deprecated in favor of :attr:`~HTTPResponse.headers`." msgstr "" -#: ../../library/http.client.rst:551 +#: ../../library/http.client.rst:566 msgid "Deprecated in favor of :attr:`~HTTPResponse.status`." msgstr "" -#: ../../library/http.client.rst:555 +#: ../../library/http.client.rst:570 msgid "Examples" msgstr "範例" -#: ../../library/http.client.rst:557 +#: ../../library/http.client.rst:572 msgid "Here is an example session that uses the ``GET`` method::" msgstr "" -#: ../../library/http.client.rst:582 +#: ../../library/http.client.rst:597 msgid "" "Here is an example session that uses the ``HEAD`` method. Note that the " "``HEAD`` method never returns any data. ::" msgstr "" -#: ../../library/http.client.rst:597 +#: ../../library/http.client.rst:612 msgid "Here is an example session that uses the ``POST`` method::" msgstr "" -#: ../../library/http.client.rst:613 +#: ../../library/http.client.rst:628 msgid "" "Client side HTTP ``PUT`` requests are very similar to ``POST`` requests. The " "difference lies only on the server side where HTTP servers will allow " @@ -632,11 +653,11 @@ msgid "" "``PUT`` method::" msgstr "" -#: ../../library/http.client.rst:634 +#: ../../library/http.client.rst:649 msgid "HTTPMessage Objects" msgstr "HTTPMessage 物件" -#: ../../library/http.client.rst:636 +#: ../../library/http.client.rst:651 msgid "" "An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP " "response. It is implemented using the :class:`email.message.Message` class." diff --git a/library/http.po b/library/http.po index 0c53ab406f..6172215b0f 100644 --- a/library/http.po +++ b/library/http.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,7 +74,8 @@ msgstr "" ":class:`enum.IntEnum` 的子類別,它定義了一組 HTTP 狀態碼、原理短語 (reason " "phrase) 以及英文長描述。" -#: ../../library/http.rst:34 ../../library/http.rst:146 +#: ../../library/http.rst:34 ../../library/http.rst:157 +#: ../../library/http.rst:171 msgid "Usage::" msgstr "" "用法:\n" @@ -98,11 +99,12 @@ msgstr "" msgid "Code" msgstr "狀態碼" -#: ../../library/http.rst:60 ../../library/http.rst:179 +#: ../../library/http.rst:60 ../../library/http.rst:204 msgid "Enum Name" msgstr "列舉名稱" -#: ../../library/http.rst:60 ../../library/http.rst:179 +#: ../../library/http.rst:60 ../../library/http.rst:148 +#: ../../library/http.rst:204 msgid "Details" msgstr "詳情" @@ -872,17 +874,82 @@ msgid "" msgstr "" "新增 ``103 EARLY_HINTS``、``418 IM_A_TEAPOT`` 與 ``425 TOO_EARLY`` 狀態碼。" -#: ../../library/http.rst:144 +#: ../../library/http.rst:141 +#, fuzzy +msgid "HTTP status category" +msgstr "HTTP 狀態碼" + +#: ../../library/http.rst:145 +msgid "" +"The enum values have several properties to indicate the HTTP status category:" +msgstr "" + +#: ../../library/http.rst:148 +msgid "Property" +msgstr "" + +#: ../../library/http.rst:148 +msgid "Indicates that" +msgstr "" + +#: ../../library/http.rst:150 +msgid "``is_informational``" +msgstr "" + +#: ../../library/http.rst:150 +msgid "``100 <= status <= 199``" +msgstr "" + +#: ../../library/http.rst:150 ../../library/http.rst:151 +#: ../../library/http.rst:152 ../../library/http.rst:153 +#: ../../library/http.rst:154 +#, fuzzy +msgid "HTTP/1.1 :rfc:`7231`, Section 6" +msgstr "HTTP/1.1 :rfc:`7231`,6.2.1 節" + +#: ../../library/http.rst:151 +msgid "``is_success``" +msgstr "" + +#: ../../library/http.rst:151 +msgid "``200 <= status <= 299``" +msgstr "" + +#: ../../library/http.rst:152 +msgid "``is_redirection``" +msgstr "" + +#: ../../library/http.rst:152 +msgid "``300 <= status <= 399``" +msgstr "" + +#: ../../library/http.rst:153 +msgid "``is_client_error``" +msgstr "" + +#: ../../library/http.rst:153 +msgid "``400 <= status <= 499``" +msgstr "" + +#: ../../library/http.rst:154 +msgid "``is_server_error``" +msgstr "" + +#: ../../library/http.rst:154 +msgid "``500 <= status <= 599``" +msgstr "" + +#: ../../library/http.rst:169 msgid "" "A subclass of :class:`enum.StrEnum` that defines a set of HTTP methods and " "descriptions written in English." msgstr ":class:`enum.StrEnum` 的子類別,它定義了一組 HTTP 方法以及英文描述。" -#: ../../library/http.rst:172 +#: ../../library/http.rst:197 msgid "HTTP methods" msgstr "HTTP 方法" -#: ../../library/http.rst:174 +#: ../../library/http.rst:199 msgid "" "Supported, `IANA-registered methods `_ available in :class:`http.HTTPMethod` are:" @@ -890,79 +957,79 @@ msgstr "" ":class:`http.HTTPStatus` 當中,已支援並且有於 `IANA 註冊的狀態碼 `_\\ 有:" -#: ../../library/http.rst:179 +#: ../../library/http.rst:204 msgid "Method" msgstr "方法" -#: ../../library/http.rst:181 +#: ../../library/http.rst:206 msgid "``GET``" msgstr "``GET``" -#: ../../library/http.rst:181 +#: ../../library/http.rst:206 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.1" msgstr "HTTP/1.1 :rfc:`7231`,4.3.1 節" -#: ../../library/http.rst:182 +#: ../../library/http.rst:207 msgid "``HEAD``" msgstr "``HEAD``" -#: ../../library/http.rst:182 +#: ../../library/http.rst:207 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.2" msgstr "HTTP/1.1 :rfc:`7231`,4.3.2 節" -#: ../../library/http.rst:183 +#: ../../library/http.rst:208 msgid "``POST``" msgstr "``POST``" -#: ../../library/http.rst:183 +#: ../../library/http.rst:208 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.3" msgstr "HTTP/1.1 :rfc:`7231`,4.3.3 節" -#: ../../library/http.rst:184 +#: ../../library/http.rst:209 msgid "``PUT``" msgstr "``PUT``" -#: ../../library/http.rst:184 +#: ../../library/http.rst:209 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.4" msgstr "HTTP/1.1 :rfc:`7231`,4.3.4 節" -#: ../../library/http.rst:185 +#: ../../library/http.rst:210 msgid "``DELETE``" msgstr "``DELETE``" -#: ../../library/http.rst:185 +#: ../../library/http.rst:210 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.5" msgstr "HTTP/1.1 :rfc:`7231`,6.3.5 節" -#: ../../library/http.rst:186 +#: ../../library/http.rst:211 msgid "``CONNECT``" msgstr "``CONNECT``" -#: ../../library/http.rst:186 +#: ../../library/http.rst:211 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.6" msgstr "HTTP/1.1 :rfc:`7231`,4.3.6 節" -#: ../../library/http.rst:187 +#: ../../library/http.rst:212 msgid "``OPTIONS``" msgstr "``OPTIONS``" -#: ../../library/http.rst:187 +#: ../../library/http.rst:212 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.7" msgstr "HTTP/1.1 :rfc:`7231`,4.3.7 節" -#: ../../library/http.rst:188 +#: ../../library/http.rst:213 msgid "``TRACE``" msgstr "``TRACE``" -#: ../../library/http.rst:188 +#: ../../library/http.rst:213 msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.8" msgstr "HTTP/1.1 :rfc:`7231`,4.3.8 節" -#: ../../library/http.rst:189 +#: ../../library/http.rst:214 msgid "``PATCH``" msgstr "``PATCH``" -#: ../../library/http.rst:189 +#: ../../library/http.rst:214 msgid "HTTP/1.1 :rfc:`5789`" msgstr "HTTP/1.1 :rfc:`5789`" diff --git a/library/http.server.po b/library/http.server.po index b816644201..4a313cd99e 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -498,20 +498,27 @@ msgid "" "the current directory::" msgstr "" -#: ../../library/http.server.rst:418 +#: ../../library/http.server.rst:417 +msgid "" +":class:`SimpleHTTPRequestHandler` can also be subclassed to enhance " +"behavior, such as using different index file names by overriding the class " +"attribute :attr:`index_pages`." +msgstr "" + +#: ../../library/http.server.rst:423 msgid "" ":mod:`http.server` can also be invoked directly using the :option:`-m` " "switch of the interpreter. Similar to the previous example, this serves " "files relative to the current directory::" msgstr "" -#: ../../library/http.server.rst:424 +#: ../../library/http.server.rst:429 msgid "" "The server listens to port 8000 by default. The default can be overridden by " "passing the desired port number as an argument::" msgstr "" -#: ../../library/http.server.rst:429 +#: ../../library/http.server.rst:434 msgid "" "By default, the server binds itself to all interfaces. The option ``-b/--" "bind`` specifies a specific address to which it should bind. Both IPv4 and " @@ -519,51 +526,51 @@ msgid "" "server to bind to localhost only::" msgstr "" -#: ../../library/http.server.rst:436 +#: ../../library/http.server.rst:441 msgid "``--bind`` argument was introduced." msgstr "" -#: ../../library/http.server.rst:439 +#: ../../library/http.server.rst:444 msgid "``--bind`` argument enhanced to support IPv6" msgstr "" -#: ../../library/http.server.rst:442 +#: ../../library/http.server.rst:447 msgid "" "By default, the server uses the current directory. The option ``-d/--" "directory`` specifies a directory to which it should serve the files. For " "example, the following command uses a specific directory::" msgstr "" -#: ../../library/http.server.rst:448 +#: ../../library/http.server.rst:453 msgid "``--directory`` argument was introduced." msgstr "" -#: ../../library/http.server.rst:451 +#: ../../library/http.server.rst:456 msgid "" "By default, the server is conformant to HTTP/1.0. The option ``-p/--" "protocol`` specifies the HTTP version to which the server is conformant. For " "example, the following command runs an HTTP/1.1 conformant server::" msgstr "" -#: ../../library/http.server.rst:457 +#: ../../library/http.server.rst:462 msgid "``--protocol`` argument was introduced." msgstr "" -#: ../../library/http.server.rst:462 +#: ../../library/http.server.rst:467 msgid "" "This class is used to serve either files or output of CGI scripts from the " "current directory and below. Note that mapping HTTP hierarchic structure to " "local directory structure is exactly as in :class:`SimpleHTTPRequestHandler`." msgstr "" -#: ../../library/http.server.rst:468 +#: ../../library/http.server.rst:473 msgid "" "CGI scripts run by the :class:`CGIHTTPRequestHandler` class cannot execute " "redirects (HTTP code 302), because code 200 (script output follows) is sent " "prior to execution of the CGI script. This pre-empts the status code." msgstr "" -#: ../../library/http.server.rst:473 +#: ../../library/http.server.rst:478 msgid "" "The class will however, run the CGI script, instead of serving it as a file, " "if it guesses it to be a CGI script. Only directory-based CGI are used --- " @@ -571,58 +578,58 @@ msgid "" "denoting CGI scripts." msgstr "" -#: ../../library/http.server.rst:478 +#: ../../library/http.server.rst:483 msgid "" "The :func:`do_GET` and :func:`do_HEAD` functions are modified to run CGI " "scripts and serve the output, instead of serving files, if the request leads " "to somewhere below the ``cgi_directories`` path." msgstr "" -#: ../../library/http.server.rst:482 +#: ../../library/http.server.rst:487 msgid "The :class:`CGIHTTPRequestHandler` defines the following data member:" msgstr "" -#: ../../library/http.server.rst:486 +#: ../../library/http.server.rst:491 msgid "" "This defaults to ``['/cgi-bin', '/htbin']`` and describes directories to " "treat as containing CGI scripts." msgstr "" -#: ../../library/http.server.rst:489 +#: ../../library/http.server.rst:494 msgid "The :class:`CGIHTTPRequestHandler` defines the following method:" msgstr "" -#: ../../library/http.server.rst:493 +#: ../../library/http.server.rst:498 msgid "" "This method serves the ``'POST'`` request type, only allowed for CGI " "scripts. Error 501, \"Can only POST to CGI scripts\", is output when trying " "to POST to a non-CGI url." msgstr "" -#: ../../library/http.server.rst:497 +#: ../../library/http.server.rst:502 msgid "" "Note that CGI scripts will be run with UID of user nobody, for security " "reasons. Problems with the CGI script will be translated to error 403." msgstr "" -#: ../../library/http.server.rst:500 +#: ../../library/http.server.rst:505 msgid "" ":class:`CGIHTTPRequestHandler` can be enabled in the command line by passing " "the ``--cgi`` option::" msgstr "" -#: ../../library/http.server.rst:508 +#: ../../library/http.server.rst:513 msgid "Security Considerations" msgstr "" -#: ../../library/http.server.rst:512 +#: ../../library/http.server.rst:517 msgid "" ":class:`SimpleHTTPRequestHandler` will follow symbolic links when handling " "requests, this makes it possible for files outside of the specified " "directory to be served." msgstr "" -#: ../../library/http.server.rst:516 +#: ../../library/http.server.rst:521 msgid "" "Earlier versions of Python did not scrub control characters from the log " "messages emitted to stderr from ``python -m http.server`` or the default :" @@ -631,7 +638,7 @@ msgid "" "codes to your terminal." msgstr "" -#: ../../library/http.server.rst:522 +#: ../../library/http.server.rst:527 msgid "Control characters are scrubbed in stderr logs." msgstr "" @@ -659,10 +666,10 @@ msgstr "URL(統一資源定位器)" msgid "httpd" msgstr "httpd" -#: ../../library/http.server.rst:510 +#: ../../library/http.server.rst:515 msgid "http.server" msgstr "http.server" -#: ../../library/http.server.rst:510 +#: ../../library/http.server.rst:515 msgid "security" msgstr "security(安全)" diff --git a/library/imaplib.po b/library/imaplib.po index ffca5bf918..d3ee1d4425 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,7 +74,7 @@ msgstr "" msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/imaplib.rst:57 ../../library/imaplib.rst:124 +#: ../../library/imaplib.rst:57 ../../library/imaplib.rst:111 msgid "The optional *timeout* parameter was added." msgstr "新增 *timeout* 選用參數。" @@ -121,70 +121,58 @@ msgstr "" #: ../../library/imaplib.rst:99 msgid "" -"*keyfile* and *certfile* are a legacy alternative to *ssl_context* - they " -"can point to PEM-formatted private key and certificate chain files for the " -"SSL connection. Note that the *keyfile*/*certfile* parameters are mutually " -"exclusive with *ssl_context*, a :class:`ValueError` is raised if *keyfile*/" -"*certfile* is provided along with *ssl_context*." -msgstr "" - -#: ../../library/imaplib.rst:105 -msgid "" "The optional *timeout* parameter specifies a timeout in seconds for the " "connection attempt. If timeout is not given or is None, the global default " "socket timeout is used." msgstr "" -#: ../../library/imaplib.rst:109 +#: ../../library/imaplib.rst:103 msgid "*ssl_context* parameter was added." msgstr "新增 *ssl_context* 參數。" -#: ../../library/imaplib.rst:112 +#: ../../library/imaplib.rst:106 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/imaplib.rst:119 -msgid "" -"*keyfile* and *certfile* are deprecated in favor of *ssl_context*. Please " -"use :meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +#: ../../library/imaplib.rst:114 +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "" -#: ../../library/imaplib.rst:127 +#: ../../library/imaplib.rst:117 msgid "The second subclass allows for connections created by a child process:" msgstr "" -#: ../../library/imaplib.rst:132 +#: ../../library/imaplib.rst:122 msgid "" "This is a subclass derived from :class:`IMAP4` that connects to the ``stdin/" "stdout`` file descriptors created by passing *command* to ``subprocess." "Popen()``." msgstr "" -#: ../../library/imaplib.rst:137 +#: ../../library/imaplib.rst:127 msgid "The following utility functions are defined:" msgstr "" -#: ../../library/imaplib.rst:142 +#: ../../library/imaplib.rst:132 msgid "" "Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local time. " "The return value is a :class:`time.struct_time` tuple or ``None`` if the " "string has wrong format." msgstr "" -#: ../../library/imaplib.rst:148 +#: ../../library/imaplib.rst:138 msgid "" "Converts an integer into a bytes representation using characters from the " "set [``A`` .. ``P``]." msgstr "" -#: ../../library/imaplib.rst:154 +#: ../../library/imaplib.rst:144 msgid "Converts an IMAP4 ``FLAGS`` response to a tuple of individual flags." msgstr "" -#: ../../library/imaplib.rst:159 +#: ../../library/imaplib.rst:149 msgid "" "Convert *date_time* to an IMAP4 ``INTERNALDATE`` representation. The return " "value is a string in the form: ``\"DD-Mmm-YYYY HH:MM:SS +HHMM\"`` (including " @@ -196,7 +184,7 @@ msgid "" "already be in the correct format." msgstr "" -#: ../../library/imaplib.rst:169 +#: ../../library/imaplib.rst:159 msgid "" "Note that IMAP4 message numbers change as the mailbox changes; in " "particular, after an ``EXPUNGE`` command performs deletions the remaining " @@ -204,30 +192,30 @@ msgid "" "the UID command." msgstr "" -#: ../../library/imaplib.rst:173 +#: ../../library/imaplib.rst:163 msgid "" "At the end of the module, there is a test section that contains a more " "extensive example of usage." msgstr "" -#: ../../library/imaplib.rst:179 +#: ../../library/imaplib.rst:169 msgid "" "Documents describing the protocol, sources for servers implementing it, by " "the University of Washington's IMAP Information Center can all be found at " "(**Source Code**) https://github.com/uw-imap/imap (**Not Maintained**)." msgstr "" -#: ../../library/imaplib.rst:187 +#: ../../library/imaplib.rst:177 msgid "IMAP4 Objects" msgstr "IMAP4 物件" -#: ../../library/imaplib.rst:189 +#: ../../library/imaplib.rst:179 msgid "" "All IMAP4rev1 commands are represented by methods of the same name, either " -"upper-case or lower-case." +"uppercase or lowercase." msgstr "" -#: ../../library/imaplib.rst:192 +#: ../../library/imaplib.rst:182 msgid "" "All arguments to commands are converted to strings, except for " "``AUTHENTICATE``, and the last argument to ``APPEND`` which is passed as an " @@ -239,7 +227,7 @@ msgid "" "(eg: ``r'(\\Deleted)'``)." msgstr "" -#: ../../library/imaplib.rst:200 +#: ../../library/imaplib.rst:190 msgid "" "Each command returns a tuple: ``(type, [data, ...])`` where *type* is " "usually ``'OK'`` or ``'NO'``, and *data* is either the text from the command " @@ -248,7 +236,7 @@ msgid "" "response, and the second part contains the data (ie: 'literal' value)." msgstr "" -#: ../../library/imaplib.rst:206 +#: ../../library/imaplib.rst:196 msgid "" "The *message_set* options to commands below is a string specifying one or " "more messages to be acted upon. It may be a simple message number " @@ -257,30 +245,30 @@ msgid "" "an asterisk to indicate an infinite upper bound (``'3:*'``)." msgstr "" -#: ../../library/imaplib.rst:212 +#: ../../library/imaplib.rst:202 msgid "An :class:`IMAP4` instance has the following methods:" msgstr "" -#: ../../library/imaplib.rst:217 +#: ../../library/imaplib.rst:207 msgid "Append *message* to named mailbox." msgstr "" -#: ../../library/imaplib.rst:222 +#: ../../library/imaplib.rst:212 msgid "Authenticate command --- requires response processing." msgstr "" -#: ../../library/imaplib.rst:224 +#: ../../library/imaplib.rst:214 msgid "" "*mechanism* specifies which authentication mechanism is to be used - it " "should appear in the instance variable ``capabilities`` in the form " "``AUTH=mechanism``." msgstr "" -#: ../../library/imaplib.rst:227 +#: ../../library/imaplib.rst:217 msgid "*authobject* must be a callable object::" msgstr "" -#: ../../library/imaplib.rst:231 +#: ../../library/imaplib.rst:221 msgid "" "It will be called to process server continuation responses; the *response* " "argument it is passed will be ``bytes``. It should return ``bytes`` *data* " @@ -288,135 +276,135 @@ msgid "" "``None`` if the client abort response ``*`` should be sent instead." msgstr "" -#: ../../library/imaplib.rst:236 +#: ../../library/imaplib.rst:226 msgid "" "string usernames and passwords are now encoded to ``utf-8`` instead of being " "limited to ASCII." msgstr "" -#: ../../library/imaplib.rst:243 +#: ../../library/imaplib.rst:233 msgid "Checkpoint mailbox on server." msgstr "" -#: ../../library/imaplib.rst:248 +#: ../../library/imaplib.rst:238 msgid "" "Close currently selected mailbox. Deleted messages are removed from writable " "mailbox. This is the recommended command before ``LOGOUT``." msgstr "" -#: ../../library/imaplib.rst:254 +#: ../../library/imaplib.rst:244 msgid "Copy *message_set* messages onto end of *new_mailbox*." msgstr "" -#: ../../library/imaplib.rst:259 +#: ../../library/imaplib.rst:249 msgid "Create new mailbox named *mailbox*." msgstr "" -#: ../../library/imaplib.rst:264 +#: ../../library/imaplib.rst:254 msgid "Delete old mailbox named *mailbox*." msgstr "" -#: ../../library/imaplib.rst:269 +#: ../../library/imaplib.rst:259 msgid "Delete the ACLs (remove any rights) set for who on mailbox." msgstr "" -#: ../../library/imaplib.rst:274 +#: ../../library/imaplib.rst:264 msgid "" "Enable *capability* (see :rfc:`5161`). Most capabilities do not need to be " "enabled. Currently only the ``UTF8=ACCEPT`` capability is supported (see :" "RFC:`6855`)." msgstr "" -#: ../../library/imaplib.rst:278 +#: ../../library/imaplib.rst:268 msgid "The :meth:`enable` method itself, and :RFC:`6855` support." msgstr "" -#: ../../library/imaplib.rst:284 +#: ../../library/imaplib.rst:274 msgid "" "Permanently remove deleted items from selected mailbox. Generates an " "``EXPUNGE`` response for each deleted message. Returned data contains a list " "of ``EXPUNGE`` message numbers in order received." msgstr "" -#: ../../library/imaplib.rst:291 +#: ../../library/imaplib.rst:281 msgid "" "Fetch (parts of) messages. *message_parts* should be a string of message " "part names enclosed within parentheses, eg: ``\"(UID BODY[TEXT])\"``. " "Returned data are tuples of message part envelope and data." msgstr "" -#: ../../library/imaplib.rst:298 +#: ../../library/imaplib.rst:288 msgid "" "Get the ``ACL``\\ s for *mailbox*. The method is non-standard, but is " "supported by the ``Cyrus`` server." msgstr "" -#: ../../library/imaplib.rst:304 +#: ../../library/imaplib.rst:294 msgid "" "Retrieve the specified ``ANNOTATION``\\ s for *mailbox*. The method is non-" "standard, but is supported by the ``Cyrus`` server." msgstr "" -#: ../../library/imaplib.rst:310 +#: ../../library/imaplib.rst:300 msgid "" "Get the ``quota`` *root*'s resource usage and limits. This method is part of " "the IMAP4 QUOTA extension defined in rfc2087." msgstr "" -#: ../../library/imaplib.rst:316 +#: ../../library/imaplib.rst:306 msgid "" "Get the list of ``quota`` ``roots`` for the named *mailbox*. This method is " "part of the IMAP4 QUOTA extension defined in rfc2087." msgstr "" -#: ../../library/imaplib.rst:322 +#: ../../library/imaplib.rst:312 msgid "" "List mailbox names in *directory* matching *pattern*. *directory* defaults " "to the top-level mail folder, and *pattern* defaults to match anything. " "Returned data contains a list of ``LIST`` responses." msgstr "" -#: ../../library/imaplib.rst:329 +#: ../../library/imaplib.rst:319 msgid "" "Identify the client using a plaintext password. The *password* will be " "quoted." msgstr "" -#: ../../library/imaplib.rst:334 +#: ../../library/imaplib.rst:324 msgid "" "Force use of ``CRAM-MD5`` authentication when identifying the client to " "protect the password. Will only work if the server ``CAPABILITY`` response " "includes the phrase ``AUTH=CRAM-MD5``." msgstr "" -#: ../../library/imaplib.rst:341 +#: ../../library/imaplib.rst:331 msgid "Shutdown connection to server. Returns server ``BYE`` response." msgstr "" -#: ../../library/imaplib.rst:343 +#: ../../library/imaplib.rst:333 msgid "The method no longer ignores silently arbitrary exceptions." msgstr "" -#: ../../library/imaplib.rst:349 +#: ../../library/imaplib.rst:339 msgid "" "List subscribed mailbox names in directory matching pattern. *directory* " "defaults to the top level directory and *pattern* defaults to match any " "mailbox. Returned data are tuples of message part envelope and data." msgstr "" -#: ../../library/imaplib.rst:356 +#: ../../library/imaplib.rst:346 msgid "Show my ACLs for a mailbox (i.e. the rights that I have on mailbox)." msgstr "" -#: ../../library/imaplib.rst:361 +#: ../../library/imaplib.rst:351 msgid "Returns IMAP namespaces as defined in :rfc:`2342`." msgstr "" -#: ../../library/imaplib.rst:366 +#: ../../library/imaplib.rst:356 msgid "Send ``NOOP`` to server." msgstr "" -#: ../../library/imaplib.rst:371 +#: ../../library/imaplib.rst:361 msgid "" "Opens socket to *port* at *host*. The optional *timeout* parameter specifies " "a timeout in seconds for the connection attempt. If timeout is not given or " @@ -429,7 +417,7 @@ msgid "" "method." msgstr "" -#: ../../library/imaplib.rst:392 +#: ../../library/imaplib.rst:382 msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." @@ -437,48 +425,48 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``imaplib.open``。" -#: ../../library/imaplib.rst:383 +#: ../../library/imaplib.rst:373 msgid "The *timeout* parameter was added." msgstr "新增 *timeout* 參數。" -#: ../../library/imaplib.rst:388 +#: ../../library/imaplib.rst:378 msgid "" "Fetch truncated part of a message. Returned data is a tuple of message part " "envelope and data." msgstr "" -#: ../../library/imaplib.rst:394 +#: ../../library/imaplib.rst:384 msgid "" "Assume authentication as *user*. Allows an authorised administrator to proxy " "into any user's mailbox." msgstr "" -#: ../../library/imaplib.rst:400 +#: ../../library/imaplib.rst:390 msgid "" "Reads *size* bytes from the remote server. You may override this method." msgstr "" -#: ../../library/imaplib.rst:405 +#: ../../library/imaplib.rst:395 msgid "Reads one line from the remote server. You may override this method." msgstr "" -#: ../../library/imaplib.rst:410 +#: ../../library/imaplib.rst:400 msgid "" "Prompt server for an update. Returned data is ``None`` if no new messages, " "else value of ``RECENT`` response." msgstr "" -#: ../../library/imaplib.rst:416 +#: ../../library/imaplib.rst:406 msgid "Rename mailbox named *oldmailbox* to *newmailbox*." msgstr "" -#: ../../library/imaplib.rst:421 +#: ../../library/imaplib.rst:411 msgid "" "Return data for response *code* if received, or ``None``. Returns the given " "code, instead of the usual type." msgstr "" -#: ../../library/imaplib.rst:427 +#: ../../library/imaplib.rst:417 msgid "" "Search mailbox for matching messages. *charset* may be ``None``, in which " "case no ``CHARSET`` will be specified in the request to the server. The " @@ -488,25 +476,25 @@ msgid "" "`enable` command." msgstr "" -#: ../../library/imaplib.rst:434 +#: ../../library/imaplib.rst:424 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/imaplib.rst:445 +#: ../../library/imaplib.rst:435 msgid "" "Select a mailbox. Returned data is the count of messages in *mailbox* " "(``EXISTS`` response). The default *mailbox* is ``'INBOX'``. If the " "*readonly* flag is set, modifications to the mailbox are not allowed." msgstr "" -#: ../../library/imaplib.rst:452 +#: ../../library/imaplib.rst:442 msgid "Sends ``data`` to the remote server. You may override this method." msgstr "" -#: ../../library/imaplib.rst:465 +#: ../../library/imaplib.rst:455 msgid "" "Raises an :ref:`auditing event ` ``imaplib.send`` with arguments " "``self``, ``data``." @@ -514,42 +502,42 @@ msgstr "" "引發一個附帶引數 ``self``、``data`` 的\\ :ref:`稽核事件 ` " "``imaplib.send``。" -#: ../../library/imaplib.rst:459 +#: ../../library/imaplib.rst:449 msgid "" "Set an ``ACL`` for *mailbox*. The method is non-standard, but is supported " "by the ``Cyrus`` server." msgstr "" -#: ../../library/imaplib.rst:465 +#: ../../library/imaplib.rst:455 msgid "" "Set ``ANNOTATION``\\ s for *mailbox*. The method is non-standard, but is " "supported by the ``Cyrus`` server." msgstr "" -#: ../../library/imaplib.rst:471 +#: ../../library/imaplib.rst:461 msgid "" "Set the ``quota`` *root*'s resource *limits*. This method is part of the " "IMAP4 QUOTA extension defined in rfc2087." msgstr "" -#: ../../library/imaplib.rst:477 +#: ../../library/imaplib.rst:467 msgid "" "Close connection established in ``open``. This method is implicitly called " "by :meth:`IMAP4.logout`. You may override this method." msgstr "" -#: ../../library/imaplib.rst:483 +#: ../../library/imaplib.rst:473 msgid "Returns socket instance used to connect to server." msgstr "" -#: ../../library/imaplib.rst:488 +#: ../../library/imaplib.rst:478 msgid "" "The ``sort`` command is a variant of ``search`` with sorting semantics for " "the results. Returned data contains a space separated list of matching " "message numbers." msgstr "" -#: ../../library/imaplib.rst:492 +#: ../../library/imaplib.rst:482 msgid "" "Sort has two arguments before the *search_criterion* argument(s); a " "parenthesized list of *sort_criteria*, and the searching *charset*. Note " @@ -561,39 +549,39 @@ msgid "" "searching criteria. It then returns the numbers of matching messages." msgstr "" -#: ../../library/imaplib.rst:501 ../../library/imaplib.rst:572 +#: ../../library/imaplib.rst:491 ../../library/imaplib.rst:562 msgid "This is an ``IMAP4rev1`` extension command." msgstr "" -#: ../../library/imaplib.rst:506 +#: ../../library/imaplib.rst:496 msgid "" "Send a ``STARTTLS`` command. The *ssl_context* argument is optional and " "should be a :class:`ssl.SSLContext` object. This will enable encryption on " "the IMAP connection. Please read :ref:`ssl-security` for best practices." msgstr "" -#: ../../library/imaplib.rst:513 +#: ../../library/imaplib.rst:503 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/imaplib.rst:521 +#: ../../library/imaplib.rst:511 msgid "Request named status conditions for *mailbox*." msgstr "" -#: ../../library/imaplib.rst:526 +#: ../../library/imaplib.rst:516 msgid "" "Alters flag dispositions for messages in mailbox. *command* is specified by " "section 6.4.6 of :rfc:`2060` as being one of \"FLAGS\", \"+FLAGS\", or \"-" "FLAGS\", optionally with a suffix of \".SILENT\"." msgstr "" -#: ../../library/imaplib.rst:530 +#: ../../library/imaplib.rst:520 msgid "For example, to set the delete flag on all messages::" msgstr "" -#: ../../library/imaplib.rst:539 +#: ../../library/imaplib.rst:529 msgid "" "Creating flags containing ']' (for example: \"[test]\") violates :rfc:`3501` " "(the IMAP protocol). However, imaplib has historically allowed creation of " @@ -605,24 +593,24 @@ msgid "" "are sent from the server, since this improves real-world compatibility." msgstr "" -#: ../../library/imaplib.rst:551 +#: ../../library/imaplib.rst:541 msgid "Subscribe to new mailbox." msgstr "" -#: ../../library/imaplib.rst:556 +#: ../../library/imaplib.rst:546 msgid "" "The ``thread`` command is a variant of ``search`` with threading semantics " "for the results. Returned data contains a space separated list of thread " "members." msgstr "" -#: ../../library/imaplib.rst:559 +#: ../../library/imaplib.rst:549 msgid "" "Thread members consist of zero or more messages numbers, delimited by " "spaces, indicating successive parent and child." msgstr "" -#: ../../library/imaplib.rst:562 +#: ../../library/imaplib.rst:552 msgid "" "Thread has two arguments before the *search_criterion* argument(s); a " "*threading_algorithm*, and the searching *charset*. Note that unlike " @@ -630,12 +618,12 @@ msgid "" "``uid thread`` command which corresponds to ``thread`` the way that ``uid " "search`` corresponds to ``search``. The ``thread`` command first searches " "the mailbox for messages that match the given searching criteria using the " -"charset argument for the interpretation of strings in the searching " +"*charset* argument for the interpretation of strings in the searching " "criteria. It then returns the matching messages threaded according to the " "specified threading algorithm." msgstr "" -#: ../../library/imaplib.rst:577 +#: ../../library/imaplib.rst:567 msgid "" "Execute command args with messages identified by UID, rather than message " "number. Returns response appropriate to command. At least one argument " @@ -643,11 +631,11 @@ msgid "" "an exception will be raised." msgstr "" -#: ../../library/imaplib.rst:585 +#: ../../library/imaplib.rst:575 msgid "Unsubscribe from old mailbox." msgstr "" -#: ../../library/imaplib.rst:589 +#: ../../library/imaplib.rst:579 msgid "" ":meth:`imaplib.IMAP4.unselect` frees server's resources associated with the " "selected mailbox and returns the server to the authenticated state. This " @@ -655,40 +643,40 @@ msgid "" "that no messages are permanently removed from the currently selected mailbox." msgstr "" -#: ../../library/imaplib.rst:599 +#: ../../library/imaplib.rst:589 msgid "" "Allow simple extension commands notified by server in ``CAPABILITY`` " "response." msgstr "" -#: ../../library/imaplib.rst:602 +#: ../../library/imaplib.rst:592 msgid "The following attributes are defined on instances of :class:`IMAP4`:" msgstr "" -#: ../../library/imaplib.rst:606 +#: ../../library/imaplib.rst:596 msgid "" "The most recent supported protocol in the ``CAPABILITY`` response from the " "server." msgstr "" -#: ../../library/imaplib.rst:612 +#: ../../library/imaplib.rst:602 msgid "" "Integer value to control debugging output. The initialize value is taken " "from the module variable ``Debug``. Values greater than three trace each " "command." msgstr "" -#: ../../library/imaplib.rst:618 +#: ../../library/imaplib.rst:608 msgid "" "Boolean value that is normally ``False``, but is set to ``True`` if an :meth:" "`enable` command is successfully issued for the ``UTF8=ACCEPT`` capability." msgstr "" -#: ../../library/imaplib.rst:628 +#: ../../library/imaplib.rst:618 msgid "IMAP4 Example" msgstr "IMAP4 範例" -#: ../../library/imaplib.rst:630 +#: ../../library/imaplib.rst:620 msgid "" "Here is a minimal example (without error checking) that opens a mailbox and " "retrieves and prints all messages::" diff --git a/library/imghdr.po b/library/imghdr.po index 173fc2b446..80b1b8ded5 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -47,9 +47,9 @@ msgstr "" #: ../../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." +"Test the image data contained in the file named *file* and return a string " +"describing the image type. If *h* is provided, the *file* argument is " +"ignored and *h* is assumed to contain the byte stream to test." msgstr "" #: ../../library/imghdr.rst:28 diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index e5b7252af1..8c6c8be0e3 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-06 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../library/importlib.metadata.rst:5 -msgid "Using :mod:`!importlib.metadata`" +msgid ":mod:`!importlib.metadata` -- Accessing package metadata" msgstr "" #: ../../library/importlib.metadata.rst:11 @@ -31,7 +31,7 @@ msgstr "**原始碼:**\\ :source:`Lib/importlib/metadata/__init__.py`" #: ../../library/importlib.metadata.rst:16 msgid "" -"``importlib_metadata`` is a library that provides access to the metadata of " +"``importlib.metadata`` is a library that provides access to the metadata of " "an installed `Distribution Package `_, such as its entry points or its top-" "level names (`Import Package `_. Specifically, it works with distributions " "with discoverable ``dist-info`` or ``egg-info`` directories, and metadata " @@ -195,38 +195,37 @@ msgid "" "The \"selectable\" entry points were introduced in ``importlib_metadata`` " "3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted no " "parameters and always returned a dictionary of entry points, keyed by group. " -"For compatibility, if no parameters are passed to entry_points, a " -"``SelectableGroups`` object is returned, implementing that dict interface. " -"In the future, calling ``entry_points`` with no parameters will return an " -"``EntryPoints`` object. Users should rely on the selection interface to " -"retrieve entry points by group." +"With ``importlib_metadata`` 5.0 and Python 3.12, ``entry_points`` always " +"returns an ``EntryPoints`` object. See `backports.entry_points_selectable " +"`_ for " +"compatibility options." msgstr "" -#: ../../library/importlib.metadata.rst:189 +#: ../../library/importlib.metadata.rst:188 msgid "Distribution metadata" msgstr "" -#: ../../library/importlib.metadata.rst:191 +#: ../../library/importlib.metadata.rst:190 msgid "" "Every `Distribution Package `_ includes some metadata, which you can extract " "using the ``metadata()`` function::" msgstr "" -#: ../../library/importlib.metadata.rst:197 +#: ../../library/importlib.metadata.rst:196 msgid "" "The keys of the returned data structure, a ``PackageMetadata``, name the " "metadata keywords, and the values are returned unparsed from the " "distribution metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:204 +#: ../../library/importlib.metadata.rst:203 msgid "" "``PackageMetadata`` also presents a ``json`` attribute that returns all the " "metadata in a JSON-compatible form per :PEP:`566`::" msgstr "" -#: ../../library/importlib.metadata.rst:212 +#: ../../library/importlib.metadata.rst:211 msgid "" "The actual type of the object returned by ``metadata()`` is an " "implementation detail and should be accessed only through the interface " @@ -234,32 +233,32 @@ msgid "" "readthedocs.io/en/latest/api.html#importlib_metadata.PackageMetadata>`_." msgstr "" -#: ../../library/importlib.metadata.rst:217 +#: ../../library/importlib.metadata.rst:216 msgid "" "The ``Description`` is now included in the metadata when presented through " "the payload. Line continuation characters have been removed." msgstr "" -#: ../../library/importlib.metadata.rst:221 +#: ../../library/importlib.metadata.rst:220 msgid "The ``json`` attribute was added." msgstr "" -#: ../../library/importlib.metadata.rst:228 +#: ../../library/importlib.metadata.rst:227 msgid "Distribution versions" msgstr "" -#: ../../library/importlib.metadata.rst:230 +#: ../../library/importlib.metadata.rst:229 msgid "" "The ``version()`` function is the quickest way to get a `Distribution " "Package `_'s version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:241 +#: ../../library/importlib.metadata.rst:240 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:243 +#: ../../library/importlib.metadata.rst:242 msgid "" "You can also get the full set of files contained within a distribution. The " "``files()`` function takes a `Distribution Package `_, use " "the ``requires()`` function::" msgstr "" -#: ../../library/importlib.metadata.rst:302 +#: ../../library/importlib.metadata.rst:301 msgid "Mapping import to distribution packages" msgstr "" -#: ../../library/importlib.metadata.rst:304 +#: ../../library/importlib.metadata.rst:303 msgid "" "A convenience method to resolve the `Distribution Package `_ name (or names, " @@ -314,11 +313,18 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: ../../library/importlib.metadata.rst:317 +#: ../../library/importlib.metadata.rst:311 +msgid "" +"Some editable installs, `do not supply top-level names `_, and thus this function is not " +"reliable with such installs." +msgstr "" + +#: ../../library/importlib.metadata.rst:320 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:319 +#: ../../library/importlib.metadata.rst:322 msgid "" "While the above API is the most common and convenient usage, you can get all " "of that information from the ``Distribution`` class. A ``Distribution`` is " @@ -327,30 +333,30 @@ msgid "" "Package>`_. You can get the ``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:328 +#: ../../library/importlib.metadata.rst:331 msgid "" "Thus, an alternative way to get the version number is through the " "``Distribution`` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:334 +#: ../../library/importlib.metadata.rst:337 msgid "" "There are all kinds of additional metadata available on the ``Distribution`` " "instance::" msgstr "" -#: ../../library/importlib.metadata.rst:342 +#: ../../library/importlib.metadata.rst:345 msgid "" "The full set of available metadata is not described here. See the `Core " "metadata specifications `_ for additional details." msgstr "" -#: ../../library/importlib.metadata.rst:347 +#: ../../library/importlib.metadata.rst:350 msgid "Distribution Discovery" msgstr "" -#: ../../library/importlib.metadata.rst:349 +#: ../../library/importlib.metadata.rst:352 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package `_ metadata is not available through :" "data:`sys.path` searches, or package loaders directly, the metadata for a " -"distribution is found through import system `finders`_. To find a " -"distribution package's metadata, ``importlib.metadata`` queries the list of :" -"term:`meta path finders ` on :data:`sys.meta_path`." +"distribution is found through import system :ref:`finders `. To find a distribution package's metadata, ``importlib." +"metadata`` queries the list of :term:`meta path finders ` " +"on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:368 +#: ../../library/importlib.metadata.rst:371 msgid "" -"By default ``importlib_metadata`` installs a finder for distribution " +"By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: ../../library/importlib.metadata.rst:373 +#: ../../library/importlib.metadata.rst:376 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -401,14 +408,14 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:387 +#: ../../library/importlib.metadata.rst:390 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:391 +#: ../../library/importlib.metadata.rst:394 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " diff --git a/library/importlib.po b/library/importlib.po index da4d982a91..aa14f698a5 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -250,33 +250,6 @@ msgstr "" #: ../../library/importlib.rst:132 msgid "" -"Find the loader for a module, optionally within the specified *path*. If the " -"module is in :attr:`sys.modules`, then ``sys.modules[name].__loader__`` is " -"returned (unless the loader would be ``None`` or is not set, in which case :" -"exc:`ValueError` is raised). Otherwise a search using :attr:`sys.meta_path` " -"is done. ``None`` is returned if no loader is found." -msgstr "" - -#: ../../library/importlib.rst:138 -msgid "" -"A dotted name does not have its parents implicitly imported as that requires " -"loading them and that may not be desired. To properly import a submodule you " -"will need to import all parent packages of the submodule and use the correct " -"argument to *path*." -msgstr "" - -#: ../../library/importlib.rst:145 -msgid "" -"If ``__loader__`` is not set, raise :exc:`ValueError`, just like when the " -"attribute is set to ``None``." -msgstr "" - -#: ../../library/importlib.rst:149 -msgid "Use :func:`importlib.util.find_spec` instead." -msgstr "" - -#: ../../library/importlib.rst:154 -msgid "" "Invalidate the internal caches of finders stored at :data:`sys.meta_path`. " "If a finder implements ``invalidate_caches()`` then it will be called to " "perform the invalidation. This function should be called if any modules are " @@ -284,13 +257,13 @@ msgid "" "will notice the new module's existence." msgstr "" -#: ../../library/importlib.rst:162 +#: ../../library/importlib.rst:140 msgid "" "Namespace packages created/installed in a different :data:`sys.path` " "location after the same namespace was already imported are noticed." msgstr "" -#: ../../library/importlib.rst:168 +#: ../../library/importlib.rst:146 msgid "" "Reload a previously imported *module*. The argument must be a module " "object, so it must have been successfully imported before. This is useful " @@ -300,11 +273,11 @@ msgid "" "causes a different object to be placed in :data:`sys.modules`)." msgstr "" -#: ../../library/importlib.rst:175 +#: ../../library/importlib.rst:153 msgid "When :func:`reload` is executed:" msgstr "" -#: ../../library/importlib.rst:177 +#: ../../library/importlib.rst:155 msgid "" "Python module's code is recompiled and the module-level code re-executed, " "defining a new set of objects which are bound to names in the module's " @@ -313,30 +286,30 @@ msgid "" "time." msgstr "" -#: ../../library/importlib.rst:183 +#: ../../library/importlib.rst:161 msgid "" "As with all other objects in Python the old objects are only reclaimed after " "their reference counts drop to zero." msgstr "" -#: ../../library/importlib.rst:186 +#: ../../library/importlib.rst:164 msgid "" "The names in the module namespace are updated to point to any new or changed " "objects." msgstr "" -#: ../../library/importlib.rst:189 +#: ../../library/importlib.rst:167 msgid "" "Other references to the old objects (such as names external to the module) " "are not rebound to refer to the new objects and must be updated in each " "namespace where they occur if that is desired." msgstr "" -#: ../../library/importlib.rst:193 +#: ../../library/importlib.rst:171 msgid "There are a number of other caveats:" msgstr "" -#: ../../library/importlib.rst:195 +#: ../../library/importlib.rst:173 msgid "" "When a module is reloaded, its dictionary (containing the module's global " "variables) is retained. Redefinitions of names will override the old " @@ -348,7 +321,7 @@ msgid "" "if desired::" msgstr "" -#: ../../library/importlib.rst:209 +#: ../../library/importlib.rst:187 msgid "" "It is generally not very useful to reload built-in or dynamically loaded " "modules. Reloading :mod:`sys`, :mod:`__main__`, :mod:`builtins` and other " @@ -357,7 +330,7 @@ msgid "" "when reloaded." msgstr "" -#: ../../library/importlib.rst:215 +#: ../../library/importlib.rst:193 msgid "" "If a module imports objects from another module using :keyword:`from` ... :" "keyword:`import` ..., calling :func:`reload` for the other module does not " @@ -366,7 +339,7 @@ msgid "" "and qualified names (*module.name*) instead." msgstr "" -#: ../../library/importlib.rst:221 +#: ../../library/importlib.rst:199 msgid "" "If a module instantiates instances of a class, reloading the module that " "defines the class does not affect the method definitions of the instances " @@ -374,66 +347,40 @@ msgid "" "derived classes." msgstr "" -#: ../../library/importlib.rst:227 +#: ../../library/importlib.rst:205 msgid "" ":exc:`ModuleNotFoundError` is raised when the module being reloaded lacks a :" "class:`~importlib.machinery.ModuleSpec`." msgstr "" -#: ../../library/importlib.rst:233 +#: ../../library/importlib.rst:211 msgid ":mod:`importlib.abc` -- Abstract base classes related to import" msgstr "" -#: ../../library/importlib.rst:238 +#: ../../library/importlib.rst:216 msgid "**Source code:** :source:`Lib/importlib/abc.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/abc.py`" -#: ../../library/importlib.rst:243 +#: ../../library/importlib.rst:221 msgid "" "The :mod:`importlib.abc` module contains all of the core abstract base " "classes used by :keyword:`import`. Some subclasses of the core abstract base " "classes are also provided to help in implementing the core ABCs." msgstr "" -#: ../../library/importlib.rst:247 +#: ../../library/importlib.rst:225 msgid "ABC hierarchy::" msgstr "" -#: ../../library/importlib.rst:263 -msgid "An abstract base class representing a :term:`finder`." -msgstr "" - -#: ../../library/importlib.rst:265 -msgid "Use :class:`MetaPathFinder` or :class:`PathEntryFinder` instead." -msgstr "" - -#: ../../library/importlib.rst:270 -msgid "" -"An abstract method for finding a :term:`loader` for the specified module. " -"Originally specified in :pep:`302`, this method was meant for use in :data:" -"`sys.meta_path` and in the path-based import subsystem." -msgstr "" - -#: ../../library/importlib.rst:274 -msgid "" -"Returns ``None`` when called instead of raising :exc:`NotImplementedError`." -msgstr "" - -#: ../../library/importlib.rst:278 -msgid "" -"Implement :meth:`MetaPathFinder.find_spec` or :meth:`PathEntryFinder." -"find_spec` instead." -msgstr "" - -#: ../../library/importlib.rst:285 +#: ../../library/importlib.rst:240 msgid "An abstract base class representing a :term:`meta path finder`." msgstr "" -#: ../../library/importlib.rst:289 ../../library/importlib.rst:344 -msgid "No longer a subclass of :class:`Finder`." +#: ../../library/importlib.rst:244 ../../library/importlib.rst:280 +msgid "No longer a subclass of :class:`!Finder`." msgstr "" -#: ../../library/importlib.rst:294 +#: ../../library/importlib.rst:249 msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. If this is a top-level import, *path* will be ``None``. " @@ -445,45 +392,18 @@ msgid "" "implementing concrete ``MetaPathFinders``." msgstr "" -#: ../../library/importlib.rst:308 -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 " -"search for a subpackage or module and *path* will be the value of :attr:" -"`__path__` from the parent package. If a loader cannot be found, ``None`` is " -"returned." -msgstr "" - -#: ../../library/importlib.rst:314 -msgid "" -"If :meth:`find_spec` is defined, backwards-compatible functionality is " -"provided." -msgstr "" - -#: ../../library/importlib.rst:317 -msgid "" -"Returns ``None`` when called instead of raising :exc:`NotImplementedError`. " -"Can use :meth:`find_spec` to provide functionality." -msgstr "" - -#: ../../library/importlib.rst:322 ../../library/importlib.rst:378 -#: ../../library/importlib.rst:386 ../../library/importlib.rst:902 -#: ../../library/importlib.rst:959 -msgid "Use :meth:`find_spec` instead." -msgstr "" - -#: ../../library/importlib.rst:327 +#: ../../library/importlib.rst:263 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:331 +#: ../../library/importlib.rst:267 msgid "Returns ``None`` when called instead of ``NotImplemented``." msgstr "" -#: ../../library/importlib.rst:337 +#: ../../library/importlib.rst:273 msgid "" "An abstract base class representing a :term:`path entry finder`. Though it " "bears some similarities to :class:`MetaPathFinder`, ``PathEntryFinder`` is " @@ -491,7 +411,7 @@ msgid "" "`importlib.machinery.PathFinder`." msgstr "" -#: ../../library/importlib.rst:349 +#: ../../library/importlib.rst:285 msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. The finder will search for the module only within the :" @@ -502,73 +422,42 @@ msgid "" "concrete ``PathEntryFinders``." msgstr "" -#: ../../library/importlib.rst:361 -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 " -"of file system locations contributing to part of a namespace package. The " -"loader may be ``None`` while specifying ``portion`` to signify the " -"contribution of the file system locations to a namespace package. An empty " -"list can be used for ``portion`` to signify the loader is not part of a " -"namespace package. If ``loader`` is ``None`` and ``portion`` is the empty " -"list then no loader or location for a namespace package were found (i.e. " -"failure to find anything for the module)." -msgstr "" - -#: ../../library/importlib.rst:371 -msgid "" -"If :meth:`find_spec` is defined then backwards-compatible functionality is " -"provided." -msgstr "" - -#: ../../library/importlib.rst:374 -msgid "" -"Returns ``(None, [])`` instead of raising :exc:`NotImplementedError`. Uses :" -"meth:`find_spec` when available to provide functionality." -msgstr "" - -#: ../../library/importlib.rst:383 -msgid "" -"A concrete implementation of :meth:`Finder.find_module` which is equivalent " -"to ``self.find_loader(fullname)[0]``." -msgstr "" - -#: ../../library/importlib.rst:391 +#: ../../library/importlib.rst:297 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:399 +#: ../../library/importlib.rst:305 msgid "" "An abstract base class for a :term:`loader`. See :pep:`302` for the exact " "definition for a loader." msgstr "" -#: ../../library/importlib.rst:402 +#: ../../library/importlib.rst:308 msgid "" "Loaders that wish to support resource reading should implement a :meth:" "`get_resource_reader` method as specified by :class:`importlib.resources.abc." "ResourceReader`." msgstr "" -#: ../../library/importlib.rst:406 +#: ../../library/importlib.rst:312 msgid "Introduced the optional :meth:`get_resource_reader` method." msgstr "" -#: ../../library/importlib.rst:411 +#: ../../library/importlib.rst:317 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:417 +#: ../../library/importlib.rst:323 msgid "This method is no longer optional when :meth:`exec_module` is defined." msgstr "" -#: ../../library/importlib.rst:423 +#: ../../library/importlib.rst:329 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 " @@ -576,17 +465,17 @@ msgid "" "`create_module` must be defined." msgstr "" -#: ../../library/importlib.rst:430 +#: ../../library/importlib.rst:336 msgid ":meth:`create_module` must also be defined." msgstr ":meth:`create_module` 也必須被定義。" -#: ../../library/importlib.rst:435 +#: ../../library/importlib.rst:341 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:439 +#: ../../library/importlib.rst:345 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 " @@ -594,51 +483,51 @@ msgid "" "recursion from the import. If the loader inserted a module and the load " "fails, it must be removed by the loader from :data:`sys.modules`; modules " "already in :data:`sys.modules` before the loader began execution should be " -"left alone (see :func:`importlib.util.module_for_loader`)." +"left alone." msgstr "" -#: ../../library/importlib.rst:448 +#: ../../library/importlib.rst:354 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:454 +#: ../../library/importlib.rst:360 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../library/importlib.rst:453 +#: ../../library/importlib.rst:359 msgid "" "The module's fully qualified name. It is ``'__main__'`` for an executed " "module." msgstr "" -#: ../../library/importlib.rst:459 +#: ../../library/importlib.rst:365 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../library/importlib.rst:457 +#: ../../library/importlib.rst:363 msgid "" "The location the :term:`loader` used to load the module. For example, for " "modules loaded from a .py file this is the filename. It is not set on all " "modules (e.g. built-in modules)." msgstr "" -#: ../../library/importlib.rst:463 +#: ../../library/importlib.rst:369 msgid ":attr:`__cached__`" msgstr ":attr:`__cached__`" -#: ../../library/importlib.rst:462 +#: ../../library/importlib.rst:368 msgid "" "The filename of a compiled version of the module's code. It is not set on " "all modules (e.g. built-in modules)." msgstr "" -#: ../../library/importlib.rst:471 +#: ../../library/importlib.rst:377 msgid ":attr:`__path__`" msgstr ":attr:`__path__`" -#: ../../library/importlib.rst:466 +#: ../../library/importlib.rst:372 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The import system passes this attribute " @@ -647,38 +536,38 @@ msgid "" "as an indicator that the module is a package." msgstr "" -#: ../../library/importlib.rst:476 +#: ../../library/importlib.rst:382 msgid ":attr:`__package__`" msgstr ":attr:`__package__`" -#: ../../library/importlib.rst:474 +#: ../../library/importlib.rst:380 msgid "" "The fully qualified name of the package the module is in (or the empty " "string for a top-level module). If the module is a package then this is the " "same as :attr:`__name__`." msgstr "" -#: ../../library/importlib.rst:479 +#: ../../library/importlib.rst:385 msgid ":attr:`__loader__`" msgstr ":attr:`__loader__`" -#: ../../library/importlib.rst:479 +#: ../../library/importlib.rst:385 msgid "The :term:`loader` used to load the module." msgstr "" -#: ../../library/importlib.rst:481 +#: ../../library/importlib.rst:387 msgid "" "When :meth:`exec_module` is available then backwards-compatible " "functionality is provided." msgstr "" -#: ../../library/importlib.rst:484 +#: ../../library/importlib.rst:390 msgid "" "Raise :exc:`ImportError` when called instead of :exc:`NotImplementedError`. " "Functionality provided when :meth:`exec_module` is available." msgstr "" -#: ../../library/importlib.rst:489 +#: ../../library/importlib.rst:395 msgid "" "The recommended API for loading a module is :meth:`exec_module` (and :meth:" "`create_module`). Loaders should implement it instead of :meth:" @@ -687,34 +576,19 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:498 -msgid "" -"A legacy method which when implemented calculates and returns the given " -"module's representation, as a string. The module type's default :meth:" -"`__repr__` will use the result of this method as appropriate." -msgstr "" - -#: ../../library/importlib.rst:504 -msgid "Made optional instead of an abstractmethod." -msgstr "" - -#: ../../library/importlib.rst:507 -msgid "The import machinery now takes care of this automatically." -msgstr "" - -#: ../../library/importlib.rst:513 +#: ../../library/importlib.rst:405 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:517 +#: ../../library/importlib.rst:409 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" "class:`importlib.resources.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:523 +#: ../../library/importlib.rst:415 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 " @@ -724,34 +598,34 @@ msgid "" "attribute or an item from a package's :attr:`__path__`." msgstr "" -#: ../../library/importlib.rst:531 +#: ../../library/importlib.rst:423 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:537 +#: ../../library/importlib.rst:429 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:542 +#: ../../library/importlib.rst:434 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:548 +#: ../../library/importlib.rst:440 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:554 +#: ../../library/importlib.rst:446 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:559 +#: ../../library/importlib.rst:451 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 " @@ -760,23 +634,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:565 ../../library/importlib.rst:574 -#: ../../library/importlib.rst:624 +#: ../../library/importlib.rst:457 ../../library/importlib.rst:466 +#: ../../library/importlib.rst:516 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:570 +#: ../../library/importlib.rst:462 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:579 +#: ../../library/importlib.rst:471 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:581 +#: ../../library/importlib.rst:473 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 " @@ -784,106 +658,106 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:586 +#: ../../library/importlib.rst:478 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:591 +#: ../../library/importlib.rst:483 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:596 +#: ../../library/importlib.rst:488 msgid "Implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:602 +#: ../../library/importlib.rst:494 msgid "Implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:604 +#: ../../library/importlib.rst:496 msgid "use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:610 +#: ../../library/importlib.rst:502 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:616 +#: ../../library/importlib.rst:508 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:620 +#: ../../library/importlib.rst:512 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:630 +#: ../../library/importlib.rst:522 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:634 +#: ../../library/importlib.rst:526 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:641 +#: ../../library/importlib.rst:533 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:645 +#: ../../library/importlib.rst:537 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:649 +#: ../../library/importlib.rst:541 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:651 +#: ../../library/importlib.rst:543 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:656 ../../library/importlib.rst:1104 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:982 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:660 +#: ../../library/importlib.rst:552 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:665 +#: ../../library/importlib.rst:557 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:669 +#: ../../library/importlib.rst:561 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:672 +#: ../../library/importlib.rst:564 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:671 +#: ../../library/importlib.rst:563 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:674 +#: ../../library/importlib.rst:566 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 :" @@ -895,83 +769,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:685 +#: ../../library/importlib.rst:577 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:688 +#: ../../library/importlib.rst:580 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:690 +#: ../../library/importlib.rst:582 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:692 +#: ../../library/importlib.rst:584 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:697 ../../library/importlib.rst:710 +#: ../../library/importlib.rst:589 ../../library/importlib.rst:602 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:702 +#: ../../library/importlib.rst:594 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:705 +#: ../../library/importlib.rst:597 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:715 +#: ../../library/importlib.rst:607 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:719 +#: ../../library/importlib.rst:611 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:723 +#: ../../library/importlib.rst:615 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:728 +#: ../../library/importlib.rst:620 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:732 +#: ../../library/importlib.rst:624 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:738 +#: ../../library/importlib.rst:630 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:740 +#: ../../library/importlib.rst:632 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:745 +#: ../../library/importlib.rst:637 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:749 +#: ../../library/importlib.rst:641 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -980,59 +854,59 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:758 +#: ../../library/importlib.rst:650 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:763 +#: ../../library/importlib.rst:655 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:767 +#: ../../library/importlib.rst:659 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:772 +#: ../../library/importlib.rst:664 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:779 +#: ../../library/importlib.rst:671 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:784 ../../library/importlib.rst:794 +#: ../../library/importlib.rst:676 ../../library/importlib.rst:686 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:789 +#: ../../library/importlib.rst:681 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:799 +#: ../../library/importlib.rst:691 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:696 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:809 +#: ../../library/importlib.rst:701 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:816 +#: ../../library/importlib.rst:708 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1041,57 +915,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:827 +#: ../../library/importlib.rst:719 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:832 ../../library/importlib.rst:846 -#: ../../library/importlib.rst:859 ../../library/importlib.rst:874 +#: ../../library/importlib.rst:724 ../../library/importlib.rst:738 +#: ../../library/importlib.rst:751 ../../library/importlib.rst:766 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:835 +#: ../../library/importlib.rst:727 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:842 +#: ../../library/importlib.rst:734 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:849 +#: ../../library/importlib.rst:741 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:856 +#: ../../library/importlib.rst:748 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:864 +#: ../../library/importlib.rst:756 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:871 +#: ../../library/importlib.rst:763 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:879 +#: ../../library/importlib.rst:771 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1105,47 +979,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:893 +#: ../../library/importlib.rst:785 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:900 -msgid "A legacy wrapper around :meth:`find_spec`." -msgstr "" - -#: ../../library/importlib.rst:907 +#: ../../library/importlib.rst:792 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:912 +#: ../../library/importlib.rst:797 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:915 +#: ../../library/importlib.rst:800 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:922 +#: ../../library/importlib.rst:807 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:810 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:928 +#: ../../library/importlib.rst:813 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. " @@ -1153,7 +1023,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:933 +#: ../../library/importlib.rst:818 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 " @@ -1166,159 +1036,155 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:947 +#: ../../library/importlib.rst:832 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:836 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:957 -msgid "Attempt to find the loader to handle *fullname* within :attr:`path`." -msgstr "" - -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:842 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:968 +#: ../../library/importlib.rst:846 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:973 +#: ../../library/importlib.rst:851 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:979 +#: ../../library/importlib.rst:857 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:987 +#: ../../library/importlib.rst:865 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:991 +#: ../../library/importlib.rst:869 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:995 +#: ../../library/importlib.rst:873 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:999 +#: ../../library/importlib.rst:877 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1003 +#: ../../library/importlib.rst:881 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1007 ../../library/importlib.rst:1050 +#: ../../library/importlib.rst:885 ../../library/importlib.rst:928 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:1012 ../../library/importlib.rst:1055 +#: ../../library/importlib.rst:890 ../../library/importlib.rst:933 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1017 +#: ../../library/importlib.rst:895 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:1020 +#: ../../library/importlib.rst:898 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:1029 +#: ../../library/importlib.rst:907 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1033 +#: ../../library/importlib.rst:911 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:915 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1041 +#: ../../library/importlib.rst:919 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1045 +#: ../../library/importlib.rst:923 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1060 +#: ../../library/importlib.rst:938 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:941 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:1070 +#: ../../library/importlib.rst:948 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1074 +#: ../../library/importlib.rst:952 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1078 +#: ../../library/importlib.rst:956 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1085 +#: ../../library/importlib.rst:963 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:969 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1096 +#: ../../library/importlib.rst:974 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1100 +#: ../../library/importlib.rst:978 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1111 +#: ../../library/importlib.rst:989 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1129 +#: ../../library/importlib.rst:1007 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1331,31 +1197,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1143 +#: ../../library/importlib.rst:1021 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1145 +#: ../../library/importlib.rst:1023 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1150 +#: ../../library/importlib.rst:1028 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1152 +#: ../../library/importlib.rst:1030 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1157 +#: ../../library/importlib.rst:1035 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1159 +#: ../../library/importlib.rst:1037 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1364,11 +1230,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1167 +#: ../../library/importlib.rst:1045 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1169 +#: ../../library/importlib.rst:1047 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1378,66 +1244,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1178 +#: ../../library/importlib.rst:1056 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1184 +#: ../../library/importlib.rst:1062 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1064 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1192 +#: ../../library/importlib.rst:1070 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1194 +#: ../../library/importlib.rst:1072 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1201 +#: ../../library/importlib.rst:1079 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1201 +#: ../../library/importlib.rst:1079 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1206 +#: ../../library/importlib.rst:1084 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1212 +#: ../../library/importlib.rst:1090 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1216 +#: ../../library/importlib.rst:1094 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1221 +#: ../../library/importlib.rst:1099 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:1228 +#: ../../library/importlib.rst:1106 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 " @@ -1447,7 +1313,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1235 +#: ../../library/importlib.rst:1113 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1460,7 +1326,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1245 +#: ../../library/importlib.rst:1123 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 " @@ -1469,18 +1335,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1253 +#: ../../library/importlib.rst:1131 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1257 ../../library/importlib.rst:1273 -#: ../../library/importlib.rst:1423 +#: ../../library/importlib.rst:1135 ../../library/importlib.rst:1151 +#: ../../library/importlib.rst:1240 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1263 +#: ../../library/importlib.rst:1141 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." @@ -1490,25 +1356,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1278 +#: ../../library/importlib.rst:1156 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:1286 +#: ../../library/importlib.rst:1164 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1288 +#: ../../library/importlib.rst:1166 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:1293 +#: ../../library/importlib.rst:1171 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:" @@ -1516,13 +1382,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1301 +#: ../../library/importlib.rst:1179 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1308 +#: ../../library/importlib.rst:1186 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :attr:`sys.modules`, then " @@ -1532,30 +1398,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1315 +#: ../../library/importlib.rst:1193 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1318 +#: ../../library/importlib.rst:1196 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1322 +#: ../../library/importlib.rst:1200 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:1329 +#: ../../library/importlib.rst:1207 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1332 +#: ../../library/importlib.rst:1210 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1563,85 +1429,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1337 +#: ../../library/importlib.rst:1215 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:1345 -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 " -"expected to have a call signature taking two positional arguments (e.g. " -"``load_module(self, module)``) for which the second argument will be the " -"module **object** to be used by the loader. Note that the decorator will not " -"work on static methods because of the assumption of two arguments." -msgstr "" - -#: ../../library/importlib.rst:1354 -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." -"modules` then a new one is constructed. Regardless of where the module came " -"from, :attr:`__loader__` set to **self** and :attr:`__package__` is set " -"based on what :meth:`importlib.abc.InspectLoader.is_package` returns (if " -"available). These attributes are set unconditionally to support reloading." -msgstr "" - -#: ../../library/importlib.rst:1362 -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 " -"initialized module from being in left in :data:`sys.modules`. If the module " -"was already in :data:`sys.modules` then it is left alone." -msgstr "" - -#: ../../library/importlib.rst:1367 -msgid "" -":attr:`__loader__` and :attr:`__package__` are automatically set (when " -"possible)." -msgstr "" - -#: ../../library/importlib.rst:1371 -msgid "" -"Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__` unconditionally " -"to support reloading." -msgstr "" - -#: ../../library/importlib.rst:1375 -msgid "" -"The import machinery now directly performs all the functionality provided by " -"this function." -msgstr "" - -#: ../../library/importlib.rst:1381 -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 " -"already set the decorator does nothing. It is assumed that the first " -"positional argument to the wrapped method (i.e. ``self``) is what :attr:" -"`__loader__` should be set to." -msgstr "" - -#: ../../library/importlib.rst:1388 -msgid "" -"Set ``__loader__`` if set to ``None``, as if the attribute does not exist." -msgstr "" - -#: ../../library/importlib.rst:1392 ../../library/importlib.rst:1401 -msgid "The import machinery takes care of this automatically." -msgstr "" - -#: ../../library/importlib.rst:1397 -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:1406 +#: ../../library/importlib.rst:1223 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 " @@ -1650,7 +1445,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1416 +#: ../../library/importlib.rst:1233 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 " @@ -1658,20 +1453,20 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1428 +#: ../../library/importlib.rst:1245 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:1436 +#: ../../library/importlib.rst:1253 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1439 +#: ../../library/importlib.rst:1256 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 " @@ -1684,7 +1479,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1450 +#: ../../library/importlib.rst:1267 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 " @@ -1693,70 +1488,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1458 +#: ../../library/importlib.rst:1275 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:1465 +#: ../../library/importlib.rst:1282 msgid "" "A class 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:1478 +#: ../../library/importlib.rst:1295 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1481 +#: ../../library/importlib.rst:1298 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1483 +#: ../../library/importlib.rst:1300 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1492 +#: ../../library/importlib.rst:1309 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1494 +#: ../../library/importlib.rst:1311 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:1497 +#: ../../library/importlib.rst:1314 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1520 +#: ../../library/importlib.rst:1337 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1522 +#: ../../library/importlib.rst:1339 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1539 +#: ../../library/importlib.rst:1356 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1541 +#: ../../library/importlib.rst:1358 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1563 +#: ../../library/importlib.rst:1380 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1565 +#: ../../library/importlib.rst:1382 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1770,11 +1565,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1597 +#: ../../library/importlib.rst:1414 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1599 +#: ../../library/importlib.rst:1416 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -1782,10 +1577,10 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:551 +#: ../../library/importlib.rst:443 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:551 +#: ../../library/importlib.rst:443 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index f688a557f9..60a590ab0c 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,32 +66,37 @@ msgid "" msgstr "" #: ../../library/importlib.resources.abc.rst:50 +#: ../../library/importlib.resources.abc.rst:160 +msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." +msgstr "" + +#: ../../library/importlib.resources.abc.rst:53 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:53 +#: ../../library/importlib.resources.abc.rst:56 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:58 +#: ../../library/importlib.resources.abc.rst:61 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:60 +#: ../../library/importlib.resources.abc.rst:63 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:65 +#: ../../library/importlib.resources.abc.rst:68 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:70 +#: ../../library/importlib.resources.abc.rst:73 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 " @@ -99,7 +104,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:76 +#: ../../library/importlib.resources.abc.rst:79 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-" @@ -108,64 +113,68 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:84 +#: ../../library/importlib.resources.abc.rst:87 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:89 +#: ../../library/importlib.resources.abc.rst:92 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:92 +#: ../../library/importlib.resources.abc.rst:95 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:99 +#: ../../library/importlib.resources.abc.rst:102 +msgid "Use :class:`importlib.resources.abc.Traversable` instead." +msgstr "" + +#: ../../library/importlib.resources.abc.rst:105 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:103 +#: ../../library/importlib.resources.abc.rst:109 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:107 +#: ../../library/importlib.resources.abc.rst:113 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:111 +#: ../../library/importlib.resources.abc.rst:117 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:115 -#: ../../library/importlib.resources.abc.rst:119 +#: ../../library/importlib.resources.abc.rst:121 +#: ../../library/importlib.resources.abc.rst:125 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:123 +#: ../../library/importlib.resources.abc.rst:129 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.resources.abc.rst:126 +#: ../../library/importlib.resources.abc.rst:132 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:131 +#: ../../library/importlib.resources.abc.rst:137 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:135 +#: ../../library/importlib.resources.abc.rst:141 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:140 +#: ../../library/importlib.resources.abc.rst:146 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -175,13 +184,13 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.resources.abc.rst:147 +#: ../../library/importlib.resources.abc.rst:153 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:154 +#: ../../library/importlib.resources.abc.rst:163 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/importlib.resources.po b/library/importlib.resources.po index a726bc3717..3cab3729b6 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../library/importlib.resources.rst:2 -msgid ":mod:`importlib.resources` -- Resources" +msgid "" +":mod:`importlib.resources` -- Package resource reading, opening and access" msgstr "" #: ../../library/importlib.resources.rst:7 @@ -28,12 +29,26 @@ msgstr "**原始碼:**\\ :source:`Lib/importlib/resources/__init__.py`" #: ../../library/importlib.resources.rst:13 msgid "" "This module leverages Python's import system to provide access to " -"*resources* within *packages*. If you can import a package, you can access " -"resources within that package. Resources can be opened or read, in either " -"binary or text mode." +"*resources* within *packages*." +msgstr "" + +#: ../../library/importlib.resources.rst:16 +msgid "" +"\"Resources\" are file-like resources associated with a module or package in " +"Python. The resources may be contained directly in a package, within a " +"subdirectory contained in that package, or adjacent to modules outside a " +"package. Resources may be text or binary. As a result, Python module sources " +"(.py) of a package and compilation artifacts (pycache) are technically de-" +"facto resources of that package. In practice, however, resources are " +"primarily those non-Python artifacts exposed specifically by the package " +"author." +msgstr "" + +#: ../../library/importlib.resources.rst:25 +msgid "Resources can be opened or read in either binary or text mode." msgstr "" -#: ../../library/importlib.resources.rst:18 +#: ../../library/importlib.resources.rst:27 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 " @@ -42,7 +57,7 @@ msgid "" "zip file using :py:mod:`zipimport`." msgstr "" -#: ../../library/importlib.resources.rst:26 +#: ../../library/importlib.resources.rst:35 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -52,7 +67,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.resources.rst:34 +#: ../../library/importlib.resources.rst:43 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.resources.rst:40 +#: ../../library/importlib.resources.rst:49 msgid "" ":class:`Loaders ` that wish to support resource " "reading should implement a ``get_resource_reader(fullname)`` method as " "specified by :class:`importlib.resources.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.resources.rst:46 +#: ../../library/importlib.resources.rst:55 msgid "" -"Whenever a function accepts a ``Package`` argument, you can pass in either " -"a :class:`module object ` or a module name as a string. " -"You can only pass module objects whose ``__spec__." -"submodule_search_locations`` is not ``None``." +"Represents an anchor for resources, either a :class:`module object ` or a module name as a string. Defined as ``Union[str, " +"ModuleType]``." msgstr "" -#: ../../library/importlib.resources.rst:51 -msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." +#: ../../library/importlib.resources.rst:61 +msgid "" +"Returns a :class:`~importlib.resources.abc.Traversable` object representing " +"the resource container (think directory) and its resources (think files). A " +"Traversable may contain other containers (think subdirectories)." msgstr "" -#: ../../library/importlib.resources.rst:55 +#: ../../library/importlib.resources.rst:66 msgid "" -"Returns a :class:`~importlib.resources.abc.Traversable` object representing " -"the resource container for the package (think directory) and its resources " -"(think files). A Traversable may contain other containers (think " -"subdirectories)." +"*anchor* is an optional :data:`Anchor`. If the anchor is a package, " +"resources are resolved from that package. If a module, resources are " +"resolved adjacent to that module (in the same package or the package root). " +"If the anchor is omitted, the caller's module is used." msgstr "" -#: ../../library/importlib.resources.rst:60 +#: ../../library/importlib.resources.rst:74 msgid "" -"*package* is either a name or a module object which conforms to the :data:" -"`Package` requirements." +"\"package\" parameter was renamed to \"anchor\". \"anchor\" can now be a non-" +"package module and if omitted will default to the caller's module. " +"\"package\" is still accepted for compatibility but will raise a " +"DeprecationWarning. Consider passing the anchor positionally or using " +"``importlib_resources >= 5.10`` for a compatible interface on older Pythons." msgstr "" -#: ../../library/importlib.resources.rst:67 +#: ../../library/importlib.resources.rst:84 msgid "" "Given a :class:`~importlib.resources.abc.Traversable` object representing a " "file, typically from :func:`importlib.resources.files`, return a context " @@ -101,23 +121,23 @@ msgid "" "a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.resources.rst:72 +#: ../../library/importlib.resources.rst:89 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.resources.rst:75 +#: ../../library/importlib.resources.rst:92 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.resources.rst:82 +#: ../../library/importlib.resources.rst:100 msgid "Deprecated functions" msgstr "已棄用函式" -#: ../../library/importlib.resources.rst:84 +#: ../../library/importlib.resources.rst:102 msgid "" "An older, deprecated set of functions is still available, but is scheduled " "for removal in a future version of Python. The main drawback of these " @@ -125,21 +145,33 @@ msgid "" "are located directly within a *package*." msgstr "" -#: ../../library/importlib.resources.rst:91 +#: ../../library/importlib.resources.rst:109 +msgid "" +"Whenever a function accepts a ``Package`` argument, you can pass in either " +"a :class:`module object ` or a module name as a string. " +"You can only pass module objects whose ``__spec__." +"submodule_search_locations`` is not ``None``." +msgstr "" + +#: ../../library/importlib.resources.rst:114 +msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." +msgstr "" + +#: ../../library/importlib.resources.rst:121 msgid "" "For *resource* arguments of the functions below, you can pass in the name of " "a resource as a string or a :class:`path-like object `." msgstr "" -#: ../../library/importlib.resources.rst:95 +#: ../../library/importlib.resources.rst:125 msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.resources.rst:99 +#: ../../library/importlib.resources.rst:130 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.resources.rst:101 +#: ../../library/importlib.resources.rst:132 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 " @@ -148,22 +180,22 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:109 -#: ../../library/importlib.resources.rst:130 -#: ../../library/importlib.resources.rst:148 -#: ../../library/importlib.resources.rst:167 -#: ../../library/importlib.resources.rst:203 -#: ../../library/importlib.resources.rst:219 +#: ../../library/importlib.resources.rst:140 +#: ../../library/importlib.resources.rst:161 +#: ../../library/importlib.resources.rst:179 +#: ../../library/importlib.resources.rst:198 +#: ../../library/importlib.resources.rst:234 +#: ../../library/importlib.resources.rst:250 msgid "Calls to this function can be replaced by::" msgstr "" -#: ../../library/importlib.resources.rst:116 +#: ../../library/importlib.resources.rst:147 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:119 +#: ../../library/importlib.resources.rst:150 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 " @@ -172,18 +204,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.resources.rst:125 +#: ../../library/importlib.resources.rst:156 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.resources.rst:137 +#: ../../library/importlib.resources.rst:168 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.resources.rst:140 +#: ../../library/importlib.resources.rst:171 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 " @@ -192,13 +224,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.resources.rst:155 +#: ../../library/importlib.resources.rst:186 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.resources.rst:158 +#: ../../library/importlib.resources.rst:189 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 " @@ -208,20 +240,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.resources.rst:174 +#: ../../library/importlib.resources.rst:205 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.resources.rst:178 +#: ../../library/importlib.resources.rst:209 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.resources.rst:181 +#: ../../library/importlib.resources.rst:212 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 " @@ -229,11 +261,11 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.resources.rst:188 +#: ../../library/importlib.resources.rst:219 msgid "Calls to this function can be replaced using :func:`as_file`::" msgstr "" -#: ../../library/importlib.resources.rst:195 +#: ../../library/importlib.resources.rst:226 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. This function does not consider directories to be " @@ -241,14 +273,14 @@ msgid "" "the ``Package`` requirements." msgstr "" -#: ../../library/importlib.resources.rst:210 +#: ../../library/importlib.resources.rst:241 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.resources.rst:214 +#: ../../library/importlib.resources.rst:245 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." diff --git a/library/inspect.po b/library/inspect.po index 474fcd0d1c..e8239b56c7 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -633,97 +633,123 @@ msgstr "" #: ../../library/inspect.rst:346 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " -"defined with an :keyword:`async def` syntax)." +"defined with an :keyword:`async def` syntax), a :func:`functools.partial` " +"wrapping a :term:`coroutine function`, or a sync function marked with :func:" +"`markcoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:351 +#: ../../library/inspect.rst:353 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:358 +#: ../../library/inspect.rst:357 +msgid "" +"Sync functions marked with :func:`markcoroutinefunction` now return ``True``." +msgstr "" + +#: ../../library/inspect.rst:364 +msgid "" +"Decorator to mark a callable as a :term:`coroutine function` if it would not " +"otherwise be detected by :func:`iscoroutinefunction`." +msgstr "" + +#: ../../library/inspect.rst:367 +msgid "" +"This may be of use for sync functions that return a :term:`coroutine`, if " +"the function is passed to an API that requires :func:`iscoroutinefunction`." +msgstr "" + +#: ../../library/inspect.rst:370 +msgid "" +"When possible, using an :keyword:`async def` function is preferred. Also " +"acceptable is calling the function and testing the return with :func:" +"`iscoroutine`." +msgstr "" + +#: ../../library/inspect.rst:379 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: ../../library/inspect.rst:366 +#: ../../library/inspect.rst:387 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:368 +#: ../../library/inspect.rst:389 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators::" msgstr "" -#: ../../library/inspect.rst:385 +#: ../../library/inspect.rst:406 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example::" msgstr "" -#: ../../library/inspect.rst:396 +#: ../../library/inspect.rst:417 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:403 +#: ../../library/inspect.rst:424 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:410 +#: ../../library/inspect.rst:431 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:415 +#: ../../library/inspect.rst:436 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:420 +#: ../../library/inspect.rst:441 msgid "Return ``True`` if the object is a code." msgstr "" -#: ../../library/inspect.rst:425 +#: ../../library/inspect.rst:446 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:430 +#: ../../library/inspect.rst:451 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:432 +#: ../../library/inspect.rst:453 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:440 +#: ../../library/inspect.rst:461 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "" -#: ../../library/inspect.rst:445 +#: ../../library/inspect.rst:466 msgid "Return ``True`` if the object is an abstract base class." msgstr "" -#: ../../library/inspect.rst:450 +#: ../../library/inspect.rst:471 msgid "" "Return ``True`` if the object is a method descriptor, but not if :func:" "`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " "true." msgstr "" -#: ../../library/inspect.rst:454 +#: ../../library/inspect.rst:475 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " "has a :meth:`~object.__get__` method but not a :meth:`~object.__set__` " @@ -731,7 +757,7 @@ msgid "" "__name__` attribute is usually sensible, and :attr:`__doc__` often is." msgstr "" -#: ../../library/inspect.rst:460 +#: ../../library/inspect.rst:481 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " @@ -739,11 +765,11 @@ msgid "" "`__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: ../../library/inspect.rst:468 +#: ../../library/inspect.rst:489 msgid "Return ``True`` if the object is a data descriptor." msgstr "" -#: ../../library/inspect.rst:470 +#: ../../library/inspect.rst:491 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " @@ -754,33 +780,33 @@ msgid "" "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:481 +#: ../../library/inspect.rst:502 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:485 +#: ../../library/inspect.rst:506 msgid "" "getsets are attributes defined in extension modules via :c:type:" "`PyGetSetDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:492 +#: ../../library/inspect.rst:513 msgid "Return ``True`` if the object is a member descriptor." msgstr "" -#: ../../library/inspect.rst:496 +#: ../../library/inspect.rst:517 msgid "" "Member descriptors are attributes defined in extension modules via :c:type:" "`PyMemberDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:504 +#: ../../library/inspect.rst:525 msgid "Retrieving source code" msgstr "" -#: ../../library/inspect.rst:508 +#: ../../library/inspect.rst:529 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -789,11 +815,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:514 +#: ../../library/inspect.rst:535 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:520 +#: ../../library/inspect.rst:541 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 " @@ -802,27 +828,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:529 +#: ../../library/inspect.rst:550 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:536 +#: ../../library/inspect.rst:557 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:542 +#: ../../library/inspect.rst:563 msgid "" "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:550 +#: ../../library/inspect.rst:571 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 " @@ -833,13 +859,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:559 ../../library/inspect.rst:573 +#: ../../library/inspect.rst:580 ../../library/inspect.rst:594 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:566 +#: ../../library/inspect.rst:587 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 " @@ -848,13 +874,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:580 +#: ../../library/inspect.rst:601 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:583 +#: ../../library/inspect.rst:604 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -862,28 +888,28 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:592 +#: ../../library/inspect.rst:613 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:596 +#: ../../library/inspect.rst:617 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:602 +#: ../../library/inspect.rst:623 msgid "Return a :class:`Signature` object for the given ``callable``::" msgstr "" -#: ../../library/inspect.rst:619 +#: ../../library/inspect.rst:640 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:622 +#: ../../library/inspect.rst:643 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -894,7 +920,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:631 +#: ../../library/inspect.rst:652 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -903,39 +929,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:637 +#: ../../library/inspect.rst:658 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:641 +#: ../../library/inspect.rst:662 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:646 +#: ../../library/inspect.rst:667 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:651 +#: ../../library/inspect.rst:672 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:658 +#: ../../library/inspect.rst:679 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:662 +#: ../../library/inspect.rst:683 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -944,54 +970,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:668 +#: ../../library/inspect.rst:689 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:671 +#: ../../library/inspect.rst:692 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:674 +#: ../../library/inspect.rst:695 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:679 +#: ../../library/inspect.rst:700 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:683 +#: ../../library/inspect.rst:704 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:687 ../../library/inspect.rst:1012 +#: ../../library/inspect.rst:708 ../../library/inspect.rst:1034 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:694 +#: ../../library/inspect.rst:715 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:699 +#: ../../library/inspect.rst:720 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:705 +#: ../../library/inspect.rst:726 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -999,7 +1025,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:712 +#: ../../library/inspect.rst:733 msgid "" "Create a new Signature instance based on the instance replace was invoked " "on. It is possible to pass different ``parameters`` and/or " @@ -1008,7 +1034,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:729 +#: ../../library/inspect.rst:751 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1016,139 +1042,139 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:734 +#: ../../library/inspect.rst:756 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:743 +#: ../../library/inspect.rst:765 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:749 +#: ../../library/inspect.rst:771 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:752 +#: ../../library/inspect.rst:774 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:757 +#: ../../library/inspect.rst:779 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:762 +#: ../../library/inspect.rst:784 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:767 +#: ../../library/inspect.rst:789 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:771 +#: ../../library/inspect.rst:793 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:777 +#: ../../library/inspect.rst:799 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:782 +#: ../../library/inspect.rst:804 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:787 +#: ../../library/inspect.rst:809 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:794 +#: ../../library/inspect.rst:816 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:794 +#: ../../library/inspect.rst:816 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:818 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:818 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:801 +#: ../../library/inspect.rst:823 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:823 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:806 +#: ../../library/inspect.rst:828 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:828 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:811 +#: ../../library/inspect.rst:833 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:833 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:816 +#: ../../library/inspect.rst:838 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:838 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:822 +#: ../../library/inspect.rst:844 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:836 +#: ../../library/inspect.rst:858 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:840 +#: ../../library/inspect.rst:862 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:855 +#: ../../library/inspect.rst:877 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1156,94 +1182,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:873 +#: ../../library/inspect.rst:895 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:880 +#: ../../library/inspect.rst:902 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:885 +#: ../../library/inspect.rst:907 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:889 +#: ../../library/inspect.rst:911 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:916 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:899 +#: ../../library/inspect.rst:921 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:905 +#: ../../library/inspect.rst:927 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:910 +#: ../../library/inspect.rst:932 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:915 +#: ../../library/inspect.rst:937 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:919 +#: ../../library/inspect.rst:941 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:921 +#: ../../library/inspect.rst:943 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:924 +#: ../../library/inspect.rst:946 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:959 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:950 +#: ../../library/inspect.rst:972 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:951 +#: ../../library/inspect.rst:973 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:957 +#: ../../library/inspect.rst:979 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:983 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 " @@ -1254,19 +1280,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:994 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:975 +#: ../../library/inspect.rst:997 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:1000 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 " @@ -1281,7 +1307,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:993 +#: ../../library/inspect.rst:1015 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1291,14 +1317,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1022 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:1005 +#: ../../library/inspect.rst:1027 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 " @@ -1306,7 +1332,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1020 +#: ../../library/inspect.rst:1042 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1315,18 +1341,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1027 ../../library/inspect.rst:1037 +#: ../../library/inspect.rst:1049 ../../library/inspect.rst:1059 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1032 +#: ../../library/inspect.rst:1054 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:1042 +#: ../../library/inspect.rst:1064 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 " @@ -1334,7 +1360,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1050 +#: ../../library/inspect.rst:1072 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 " @@ -1347,11 +1373,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1073 +#: ../../library/inspect.rst:1096 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1079 +#: ../../library/inspect.rst:1102 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1363,18 +1389,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1088 +#: ../../library/inspect.rst:1111 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1095 +#: ../../library/inspect.rst:1118 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:1098 +#: ../../library/inspect.rst:1121 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 " @@ -1384,68 +1410,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1105 +#: ../../library/inspect.rst:1128 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1112 +#: ../../library/inspect.rst:1135 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1114 +#: ../../library/inspect.rst:1137 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1117 +#: ../../library/inspect.rst:1140 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:1121 +#: ../../library/inspect.rst:1144 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1146 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:1127 +#: ../../library/inspect.rst:1150 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:1131 +#: ../../library/inspect.rst:1154 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1156 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1158 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1137 +#: ../../library/inspect.rst:1160 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:1140 +#: ../../library/inspect.rst:1163 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()` " @@ -1453,12 +1479,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1167 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1169 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1466,35 +1492,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1174 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1152 +#: ../../library/inspect.rst:1175 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:1155 +#: ../../library/inspect.rst:1178 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:1159 +#: ../../library/inspect.rst:1182 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:1169 +#: ../../library/inspect.rst:1192 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1171 +#: ../../library/inspect.rst:1194 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1502,95 +1528,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1203 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1184 +#: ../../library/inspect.rst:1207 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1189 +#: ../../library/inspect.rst:1212 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1217 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1198 +#: ../../library/inspect.rst:1221 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1203 ../../library/inspect.rst:1242 +#: ../../library/inspect.rst:1226 ../../library/inspect.rst:1265 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1230 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1211 +#: ../../library/inspect.rst:1234 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1214 +#: ../../library/inspect.rst:1237 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1223 +#: ../../library/inspect.rst:1246 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1228 +#: ../../library/inspect.rst:1251 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1233 +#: ../../library/inspect.rst:1256 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1260 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1269 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1274 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1258 +#: ../../library/inspect.rst:1281 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 " @@ -1602,7 +1628,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1266 +#: ../../library/inspect.rst:1289 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 :" @@ -1610,31 +1636,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1278 +#: ../../library/inspect.rst:1301 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:1282 +#: ../../library/inspect.rst:1305 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:1289 +#: ../../library/inspect.rst:1312 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1315 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1297 +#: ../../library/inspect.rst:1320 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1642,19 +1668,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 -#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 +#: ../../library/inspect.rst:1325 ../../library/inspect.rst:1340 +#: ../../library/inspect.rst:1366 ../../library/inspect.rst:1381 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1307 ../../library/inspect.rst:1322 -#: ../../library/inspect.rst:1348 ../../library/inspect.rst:1363 +#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 +#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1335 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1662,11 +1688,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1350 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1331 +#: ../../library/inspect.rst:1354 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 " @@ -1674,14 +1700,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1362 msgid "" "Return a list of :class:`FrameInfo` objects 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:1353 +#: ../../library/inspect.rst:1376 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1689,11 +1715,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1367 +#: ../../library/inspect.rst:1390 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1392 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1701,20 +1727,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1374 +#: ../../library/inspect.rst:1397 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:1380 +#: ../../library/inspect.rst:1403 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1406 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 " @@ -1722,31 +1748,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1389 +#: ../../library/inspect.rst:1412 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:1395 +#: ../../library/inspect.rst:1418 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:1399 +#: ../../library/inspect.rst:1422 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:1425 -msgid "Current State of Generators and Coroutines" +#: ../../library/inspect.rst:1448 +msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1427 +#: ../../library/inspect.rst:1450 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1755,31 +1781,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1458 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1441 ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1464 ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1495 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1438 +#: ../../library/inspect.rst:1461 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1439 +#: ../../library/inspect.rst:1462 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1440 +#: ../../library/inspect.rst:1463 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1441 +#: ../../library/inspect.rst:1464 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1447 +#: ../../library/inspect.rst:1470 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 " @@ -1787,30 +1814,55 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1453 +#: ../../library/inspect.rst:1476 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1454 +#: ../../library/inspect.rst:1477 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1478 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1479 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1460 +#: ../../library/inspect.rst:1485 +msgid "" +"Get current state of an asynchronous generator object. The function is " +"intended to be used with asynchronous iterator objects created by :keyword:" +"`async def` functions which use the :keyword:`yield` statement, but will " +"accept any asynchronous generator-like object that has ``ag_running`` and " +"``ag_frame`` attributes." +msgstr "" + +#: ../../library/inspect.rst:1492 +msgid "AGEN_CREATED: Waiting to start execution." +msgstr "" + +#: ../../library/inspect.rst:1493 +msgid "AGEN_RUNNING: Currently being executed by the interpreter." +msgstr "" + +#: ../../library/inspect.rst:1494 +msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." +msgstr "" + +#: ../../library/inspect.rst:1495 +msgid "AGEN_CLOSED: Execution has completed." +msgstr "" + +#: ../../library/inspect.rst:1499 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:1466 +#: ../../library/inspect.rst:1505 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. " @@ -1818,14 +1870,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1471 +#: ../../library/inspect.rst:1510 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:1477 +#: ../../library/inspect.rst:1516 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 " @@ -1833,72 +1885,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1486 +#: ../../library/inspect.rst:1525 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1532 +msgid "" +"This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " +"for asynchronous generator objects created by :keyword:`async def` functions " +"which use the :keyword:`yield` statement." +msgstr "" + +#: ../../library/inspect.rst:1542 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1544 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1549 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1506 +#: ../../library/inspect.rst:1553 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:1511 +#: ../../library/inspect.rst:1558 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1515 +#: ../../library/inspect.rst:1562 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1566 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1570 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:1528 +#: ../../library/inspect.rst:1575 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:1536 +#: ../../library/inspect.rst:1583 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:1545 +#: ../../library/inspect.rst:1592 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:1552 +#: ../../library/inspect.rst:1599 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1906,24 +1965,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1562 +#: ../../library/inspect.rst:1607 +msgid "Buffer flags" +msgstr "" + +#: ../../library/inspect.rst:1611 +msgid "" +"This is an :class:`enum.IntFlag` that represents the flags that can be " +"passed to the :meth:`~object.__buffer__` method of objects implementing the :" +"ref:`buffer protocol `." +msgstr "" + +#: ../../library/inspect.rst:1615 +msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." +msgstr "" + +#: ../../library/inspect.rst:1642 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1564 +#: ../../library/inspect.rst:1644 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1569 +#: ../../library/inspect.rst:1649 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:1575 +#: ../../library/inspect.rst:1655 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index dea7809614..37ae914ae3 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-25 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,17 +58,17 @@ msgid "**Infinite iterators:**" msgstr "" #: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:72 +#: ../../library/itertools.rst:73 msgid "Iterator" msgstr "" #: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:72 +#: ../../library/itertools.rst:73 msgid "Arguments" msgstr "引數" #: ../../library/itertools.rst:42 ../../library/itertools.rst:52 -#: ../../library/itertools.rst:72 ../../library/itertools.rst:81 +#: ../../library/itertools.rst:73 ../../library/itertools.rst:82 msgid "Results" msgstr "結果" @@ -145,272 +145,291 @@ msgid "``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``" msgstr "``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``" #: ../../library/itertools.rst:55 +#, fuzzy +msgid ":func:`batched`" +msgstr ":func:`tee`" + +#: ../../library/itertools.rst:55 +msgid "p, n" +msgstr "" + +#: ../../library/itertools.rst:55 +#, fuzzy +msgid "(p0, p1, ..., p_n-1), ..." +msgstr "p0, p1, ... plast, p0, p1, ..." + +#: ../../library/itertools.rst:55 +#, fuzzy +msgid "``batched('ABCDEFG', n=3) --> ABC DEF G``" +msgstr "``islice('ABCDEFG', 2, None) --> C D E F G``" + +#: ../../library/itertools.rst:56 msgid ":func:`chain`" msgstr ":func:`chain`" -#: ../../library/itertools.rst:55 ../../library/itertools.rst:66 +#: ../../library/itertools.rst:56 ../../library/itertools.rst:67 msgid "p, q, ..." msgstr "p, q, ..." -#: ../../library/itertools.rst:55 ../../library/itertools.rst:56 +#: ../../library/itertools.rst:56 ../../library/itertools.rst:57 msgid "p0, p1, ... plast, q0, q1, ..." msgstr "p0, p1, ... plast, q0, q1, ..." -#: ../../library/itertools.rst:55 +#: ../../library/itertools.rst:56 msgid "``chain('ABC', 'DEF') --> A B C D E F``" msgstr "``chain('ABC', 'DEF') --> A B C D E F``" -#: ../../library/itertools.rst:56 +#: ../../library/itertools.rst:57 msgid ":func:`chain.from_iterable`" msgstr ":func:`chain.from_iterable`" -#: ../../library/itertools.rst:56 ../../library/itertools.rst:62 +#: ../../library/itertools.rst:57 ../../library/itertools.rst:63 msgid "iterable" msgstr "" -#: ../../library/itertools.rst:56 +#: ../../library/itertools.rst:57 msgid "``chain.from_iterable(['ABC', 'DEF']) --> A B C D E F``" msgstr "``chain.from_iterable(['ABC', 'DEF']) --> A B C D E F``" -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:58 msgid ":func:`compress`" msgstr ":func:`compress`" -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:58 msgid "data, selectors" msgstr "" -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:58 msgid "(d[0] if s[0]), (d[1] if s[1]), ..." msgstr "(d[0] if s[0]), (d[1] if s[1]), ..." -#: ../../library/itertools.rst:57 +#: ../../library/itertools.rst:58 msgid "``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``" msgstr "``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:59 msgid ":func:`dropwhile`" msgstr ":func:`dropwhile`" -#: ../../library/itertools.rst:58 ../../library/itertools.rst:59 -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:59 ../../library/itertools.rst:60 +#: ../../library/itertools.rst:65 msgid "pred, seq" msgstr "pred, seq" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:59 msgid "seq[n], seq[n+1], starting when pred fails" msgstr "" -#: ../../library/itertools.rst:58 +#: ../../library/itertools.rst:59 msgid "``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``" msgstr "``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:60 msgid ":func:`filterfalse`" msgstr ":func:`filterfalse`" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:60 msgid "elements of seq where pred(elem) is false" msgstr "" -#: ../../library/itertools.rst:59 +#: ../../library/itertools.rst:60 msgid "``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``" msgstr "``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:61 msgid ":func:`groupby`" msgstr ":func:`groupby`" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:61 msgid "iterable[, key]" msgstr "iterable[, key]" -#: ../../library/itertools.rst:60 +#: ../../library/itertools.rst:61 msgid "sub-iterators grouped by value of key(v)" msgstr "" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:62 msgid ":func:`islice`" msgstr ":func:`islice`" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:62 msgid "seq, [start,] stop [, step]" msgstr "seq, [start,] stop [, step]" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:62 msgid "elements from seq[start:stop:step]" msgstr "" -#: ../../library/itertools.rst:61 +#: ../../library/itertools.rst:62 msgid "``islice('ABCDEFG', 2, None) --> C D E F G``" msgstr "``islice('ABCDEFG', 2, None) --> C D E F G``" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:63 msgid ":func:`pairwise`" msgstr ":func:`pairwise`" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:63 msgid "(p[0], p[1]), (p[1], p[2])" msgstr "(p[0], p[1]), (p[1], p[2])" -#: ../../library/itertools.rst:62 +#: ../../library/itertools.rst:63 msgid "``pairwise('ABCDEFG') --> AB BC CD DE EF FG``" msgstr "``pairwise('ABCDEFG') --> AB BC CD DE EF FG``" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:64 msgid ":func:`starmap`" msgstr ":func:`starmap`" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:64 msgid "func, seq" msgstr "func, seq" -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:64 msgid "func(\\*seq[0]), func(\\*seq[1]), ..." msgstr "func(\\*seq[0]), func(\\*seq[1]), ..." -#: ../../library/itertools.rst:63 +#: ../../library/itertools.rst:64 msgid "``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000``" msgstr "``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000``" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:65 msgid ":func:`takewhile`" msgstr ":func:`takewhile`" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:65 msgid "seq[0], seq[1], until pred fails" msgstr "seq[0], seq[1], until pred fails" -#: ../../library/itertools.rst:64 +#: ../../library/itertools.rst:65 msgid "``takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4``" msgstr "``takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4``" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:66 msgid ":func:`tee`" msgstr ":func:`tee`" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:66 msgid "it, n" msgstr "it, n" -#: ../../library/itertools.rst:65 +#: ../../library/itertools.rst:66 msgid "it1, it2, ... itn splits one iterator into n" msgstr "" -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:67 msgid ":func:`zip_longest`" msgstr ":func:`zip_longest`" -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:67 msgid "(p[0], q[0]), (p[1], q[1]), ..." msgstr "(p[0], q[0]), (p[1], q[1]), ..." -#: ../../library/itertools.rst:66 +#: ../../library/itertools.rst:67 msgid "``zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-``" msgstr "``zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-``" -#: ../../library/itertools.rst:69 +#: ../../library/itertools.rst:70 msgid "**Combinatoric iterators:**" msgstr "" -#: ../../library/itertools.rst:74 +#: ../../library/itertools.rst:75 msgid ":func:`product`" msgstr ":func:`product`" -#: ../../library/itertools.rst:74 +#: ../../library/itertools.rst:75 msgid "p, q, ... [repeat=1]" msgstr "p, q, ... [repeat=1]" -#: ../../library/itertools.rst:74 +#: ../../library/itertools.rst:75 msgid "cartesian product, equivalent to a nested for-loop" msgstr "" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:76 msgid ":func:`permutations`" msgstr ":func:`permutations`" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:76 msgid "p[, r]" msgstr "p[, r]" -#: ../../library/itertools.rst:75 +#: ../../library/itertools.rst:76 msgid "r-length tuples, all possible orderings, no repeated elements" msgstr "" -#: ../../library/itertools.rst:76 +#: ../../library/itertools.rst:77 msgid ":func:`combinations`" msgstr ":func:`combinations`" -#: ../../library/itertools.rst:76 ../../library/itertools.rst:77 +#: ../../library/itertools.rst:77 ../../library/itertools.rst:78 msgid "p, r" msgstr "p, r" -#: ../../library/itertools.rst:76 +#: ../../library/itertools.rst:77 msgid "r-length tuples, in sorted order, no repeated elements" msgstr "" -#: ../../library/itertools.rst:77 +#: ../../library/itertools.rst:78 msgid ":func:`combinations_with_replacement`" msgstr ":func:`combinations_with_replacement`" -#: ../../library/itertools.rst:77 +#: ../../library/itertools.rst:78 msgid "r-length tuples, in sorted order, with repeated elements" msgstr "" -#: ../../library/itertools.rst:81 +#: ../../library/itertools.rst:82 msgid "Examples" msgstr "" -#: ../../library/itertools.rst:83 +#: ../../library/itertools.rst:84 msgid "``product('ABCD', repeat=2)``" msgstr "``product('ABCD', repeat=2)``" -#: ../../library/itertools.rst:83 +#: ../../library/itertools.rst:84 msgid "``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``" msgstr "``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``" -#: ../../library/itertools.rst:84 +#: ../../library/itertools.rst:85 msgid "``permutations('ABCD', 2)``" msgstr "``permutations('ABCD', 2)``" -#: ../../library/itertools.rst:84 +#: ../../library/itertools.rst:85 msgid "``AB AC AD BA BC BD CA CB CD DA DB DC``" msgstr "``AB AC AD BA BC BD CA CB CD DA DB DC``" -#: ../../library/itertools.rst:85 +#: ../../library/itertools.rst:86 msgid "``combinations('ABCD', 2)``" msgstr "``combinations('ABCD', 2)``" -#: ../../library/itertools.rst:85 +#: ../../library/itertools.rst:86 msgid "``AB AC AD BC BD CD``" msgstr "``AB AC AD BC BD CD``" -#: ../../library/itertools.rst:86 +#: ../../library/itertools.rst:87 msgid "``combinations_with_replacement('ABCD', 2)``" msgstr "``combinations_with_replacement('ABCD', 2)``" -#: ../../library/itertools.rst:86 +#: ../../library/itertools.rst:87 msgid "``AA AB AC AD BB BC BD CC CD DD``" msgstr "``AA AB AC AD BB BC BD CC CD DD``" -#: ../../library/itertools.rst:93 +#: ../../library/itertools.rst:94 msgid "Itertool functions" msgstr "" -#: ../../library/itertools.rst:95 +#: ../../library/itertools.rst:96 msgid "" "The following module functions all construct and return iterators. Some " "provide streams of infinite length, so they should only be accessed by " "functions or loops that truncate the stream." msgstr "" -#: ../../library/itertools.rst:101 +#: ../../library/itertools.rst:102 msgid "" "Make an iterator that returns accumulated sums, or accumulated results of " "other binary functions (specified via the optional *func* argument)." msgstr "" -#: ../../library/itertools.rst:105 +#: ../../library/itertools.rst:106 msgid "" "If *func* is supplied, it should be a function of two arguments. Elements of " "the input *iterable* may be any type that can be accepted as arguments to " @@ -419,7 +438,7 @@ msgid "" "`~fractions.Fraction`.)" msgstr "" -#: ../../library/itertools.rst:112 +#: ../../library/itertools.rst:113 msgid "" "Usually, the number of elements output matches the input iterable. However, " "if the keyword argument *initial* is provided, the accumulation leads off " @@ -427,17 +446,17 @@ msgid "" "input iterable." msgstr "" -#: ../../library/itertools.rst:117 ../../library/itertools.rst:203 -#: ../../library/itertools.rst:252 ../../library/itertools.rst:452 -#: ../../library/itertools.rst:488 ../../library/itertools.rst:515 -#: ../../library/itertools.rst:595 +#: ../../library/itertools.rst:118 ../../library/itertools.rst:191 +#: ../../library/itertools.rst:242 ../../library/itertools.rst:291 +#: ../../library/itertools.rst:491 ../../library/itertools.rst:527 +#: ../../library/itertools.rst:554 ../../library/itertools.rst:634 msgid "Roughly equivalent to::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../library/itertools.rst:136 +#: ../../library/itertools.rst:137 msgid "" "There are a number of uses for the *func* argument. It can be set to :func:" "`min` for a running minimum, :func:`max` for a running maximum, or :func:" @@ -445,21 +464,35 @@ msgid "" "accumulating interest and applying payments:" msgstr "" -#: ../../library/itertools.rst:154 +#: ../../library/itertools.rst:155 msgid "" "See :func:`functools.reduce` for a similar function that returns only the " "final accumulated value." msgstr "" -#: ../../library/itertools.rst:159 +#: ../../library/itertools.rst:160 msgid "Added the optional *func* parameter." msgstr "新增選用的 *func* 參數。" -#: ../../library/itertools.rst:162 +#: ../../library/itertools.rst:163 msgid "Added the optional *initial* parameter." msgstr "新增選用的 *initial* 參數。" -#: ../../library/itertools.rst:167 +#: ../../library/itertools.rst:169 +msgid "" +"Batch data from the *iterable* into tuples of length *n*. The last batch may " +"be shorter than *n*." +msgstr "" + +#: ../../library/itertools.rst:172 +msgid "" +"Loops over the input iterable and accumulates data into tuples up to size " +"*n*. The input is consumed lazily, just enough to fill a batch. The result " +"is yielded as soon as the batch is full or when the input iterable is " +"exhausted:" +msgstr "" + +#: ../../library/itertools.rst:206 msgid "" "Make an iterator that returns elements from the first iterable until it is " "exhausted, then proceeds to the next iterable, until all of the iterables " @@ -467,69 +500,69 @@ msgid "" "sequence. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:181 +#: ../../library/itertools.rst:220 msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:193 +#: ../../library/itertools.rst:232 msgid "Return *r* length subsequences of elements from the input *iterable*." msgstr "" -#: ../../library/itertools.rst:195 ../../library/itertools.rst:244 +#: ../../library/itertools.rst:234 ../../library/itertools.rst:283 msgid "" "The combination tuples are emitted in lexicographic ordering according to " "the order of the input *iterable*. So, if the input *iterable* is sorted, " "the output tuples will be produced in sorted order." msgstr "" -#: ../../library/itertools.rst:199 +#: ../../library/itertools.rst:238 msgid "" "Elements are treated as unique based on their position, not on their value. " "So if the input elements are unique, there will be no repeated values in " "each combination." msgstr "" -#: ../../library/itertools.rst:225 +#: ../../library/itertools.rst:264 msgid "" "The code for :func:`combinations` can be also expressed as a subsequence of :" "func:`permutations` after filtering entries where the elements are not in " "sorted order (according to their position in the input pool)::" msgstr "" -#: ../../library/itertools.rst:236 +#: ../../library/itertools.rst:275 msgid "" "The number of items returned is ``n! / r! / (n-r)!`` when ``0 <= r <= n`` or " "zero when ``r > n``." msgstr "" -#: ../../library/itertools.rst:241 +#: ../../library/itertools.rst:280 msgid "" "Return *r* length subsequences of elements from the input *iterable* " "allowing individual elements to be repeated more than once." msgstr "" -#: ../../library/itertools.rst:248 +#: ../../library/itertools.rst:287 msgid "" "Elements are treated as unique based on their position, not on their value. " "So if the input elements are unique, the generated combinations will also be " "unique." msgstr "" -#: ../../library/itertools.rst:271 +#: ../../library/itertools.rst:310 msgid "" "The code for :func:`combinations_with_replacement` can be also expressed as " "a subsequence of :func:`product` after filtering entries where the elements " "are not in sorted order (according to their position in the input pool)::" msgstr "" -#: ../../library/itertools.rst:282 +#: ../../library/itertools.rst:321 msgid "" "The number of items returned is ``(n+r-1)! / r! / (n-1)!`` when ``n > 0``." msgstr "" -#: ../../library/itertools.rst:289 +#: ../../library/itertools.rst:328 msgid "" "Make an iterator that filters elements from *data* returning only those that " "have a corresponding element in *selectors* that evaluates to ``True``. " @@ -537,7 +570,7 @@ msgid "" "Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:303 +#: ../../library/itertools.rst:342 msgid "" "Make an iterator that returns evenly spaced values starting with number " "*start*. Often used as an argument to :func:`map` to generate consecutive " @@ -545,31 +578,31 @@ msgid "" "equivalent to::" msgstr "" -#: ../../library/itertools.rst:315 +#: ../../library/itertools.rst:354 msgid "" "When counting with floating point numbers, better accuracy can sometimes be " "achieved by substituting multiplicative code such as: ``(start + step * i " "for i in count())``." msgstr "" -#: ../../library/itertools.rst:319 +#: ../../library/itertools.rst:358 msgid "Added *step* argument and allowed non-integer arguments." msgstr "新增 *step* 引數並允許非整數引數。" -#: ../../library/itertools.rst:324 +#: ../../library/itertools.rst:363 msgid "" "Make an iterator returning elements from the iterable and saving a copy of " "each. When the iterable is exhausted, return elements from the saved copy. " "Repeats indefinitely. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:338 +#: ../../library/itertools.rst:377 msgid "" "Note, this member of the toolkit may require significant auxiliary storage " "(depending on the length of the iterable)." msgstr "" -#: ../../library/itertools.rst:344 +#: ../../library/itertools.rst:383 msgid "" "Make an iterator that drops elements from the iterable as long as the " "predicate is true; afterwards, returns every element. Note, the iterator " @@ -577,14 +610,14 @@ msgid "" "may have a lengthy start-up time. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:361 +#: ../../library/itertools.rst:400 msgid "" "Make an iterator that filters elements from iterable returning only those " "for which the predicate is false. If *predicate* is ``None``, return the " "items that are false. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:376 +#: ../../library/itertools.rst:415 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -593,7 +626,7 @@ msgid "" "sorted on the same key function." msgstr "" -#: ../../library/itertools.rst:382 +#: ../../library/itertools.rst:421 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -602,7 +635,7 @@ msgid "" "aggregates common elements regardless of their input order." msgstr "" -#: ../../library/itertools.rst:388 +#: ../../library/itertools.rst:427 msgid "" "The returned group is itself an iterator that shares the underlying iterable " "with :func:`groupby`. Because the source is shared, when the :func:" @@ -610,14 +643,14 @@ msgid "" "if that data is needed later, it should be stored as a list::" msgstr "" -#: ../../library/itertools.rst:400 +#: ../../library/itertools.rst:439 msgid ":func:`groupby` is roughly equivalent to::" msgstr "" ":func:`groupby` 大致等價於:\n" "\n" "::" -#: ../../library/itertools.rst:437 +#: ../../library/itertools.rst:476 msgid "" "Make an iterator that returns selected elements from the iterable. If " "*start* is non-zero, then elements from the iterable are skipped until start " @@ -627,13 +660,13 @@ msgid "" "all; otherwise, it stops at the specified position." msgstr "" -#: ../../library/itertools.rst:444 +#: ../../library/itertools.rst:483 msgid "" "If *start* is ``None``, then iteration starts at zero. If *step* is " "``None``, then the step defaults to one." msgstr "" -#: ../../library/itertools.rst:447 +#: ../../library/itertools.rst:486 msgid "" "Unlike regular slicing, :func:`islice` does not support negative values for " "*start*, *stop*, or *step*. Can be used to extract related fields from data " @@ -641,67 +674,67 @@ msgid "" "report may list a name field on every third line)." msgstr "" -#: ../../library/itertools.rst:482 +#: ../../library/itertools.rst:521 msgid "Return successive overlapping pairs taken from the input *iterable*." msgstr "" -#: ../../library/itertools.rst:484 +#: ../../library/itertools.rst:523 msgid "" "The number of 2-tuples in the output iterator will be one fewer than the " "number of inputs. It will be empty if the input iterable has fewer than two " "values." msgstr "" -#: ../../library/itertools.rst:501 +#: ../../library/itertools.rst:540 msgid "" "Return successive *r* length permutations of elements in the *iterable*." msgstr "" -#: ../../library/itertools.rst:503 +#: ../../library/itertools.rst:542 msgid "" "If *r* is not specified or is ``None``, then *r* defaults to the length of " "the *iterable* and all possible full-length permutations are generated." msgstr "" -#: ../../library/itertools.rst:507 +#: ../../library/itertools.rst:546 msgid "" "The permutation tuples are emitted in lexicographic order according to the " "order of the input *iterable*. So, if the input *iterable* is sorted, the " "output tuples will be produced in sorted order." msgstr "" -#: ../../library/itertools.rst:511 +#: ../../library/itertools.rst:550 msgid "" "Elements are treated as unique based on their position, not on their value. " "So if the input elements are unique, there will be no repeated values within " "a permutation." msgstr "" -#: ../../library/itertools.rst:542 +#: ../../library/itertools.rst:581 msgid "" "The code for :func:`permutations` can be also expressed as a subsequence of :" "func:`product`, filtered to exclude entries with repeated elements (those " "from the same position in the input pool)::" msgstr "" -#: ../../library/itertools.rst:554 +#: ../../library/itertools.rst:593 msgid "" "The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` or zero " "when ``r > n``." msgstr "" -#: ../../library/itertools.rst:559 +#: ../../library/itertools.rst:598 msgid "Cartesian product of input iterables." msgstr "" -#: ../../library/itertools.rst:561 +#: ../../library/itertools.rst:600 msgid "" "Roughly equivalent to nested for-loops in a generator expression. For " "example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in " "B)``." msgstr "" -#: ../../library/itertools.rst:564 +#: ../../library/itertools.rst:603 msgid "" "The nested loops cycle like an odometer with the rightmost element advancing " "on every iteration. This pattern creates a lexicographic ordering so that " @@ -709,39 +742,39 @@ msgid "" "sorted order." msgstr "" -#: ../../library/itertools.rst:569 +#: ../../library/itertools.rst:608 msgid "" "To compute the product of an iterable with itself, specify the number of " "repetitions with the optional *repeat* keyword argument. For example, " "``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``." msgstr "" -#: ../../library/itertools.rst:573 +#: ../../library/itertools.rst:612 msgid "" "This function is roughly equivalent to the following code, except that the " "actual implementation does not build up intermediate results in memory::" msgstr "" -#: ../../library/itertools.rst:586 +#: ../../library/itertools.rst:625 msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " "is only useful with finite inputs." msgstr "" -#: ../../library/itertools.rst:592 +#: ../../library/itertools.rst:631 msgid "" "Make an iterator that returns *object* over and over again. Runs " "indefinitely unless the *times* argument is specified." msgstr "" -#: ../../library/itertools.rst:606 +#: ../../library/itertools.rst:645 msgid "" "A common use for *repeat* is to supply a stream of constant values to *map* " "or *zip*:" msgstr "" -#: ../../library/itertools.rst:616 +#: ../../library/itertools.rst:655 msgid "" "Make an iterator that computes the function using arguments obtained from " "the iterable. Used instead of :func:`map` when argument parameters are " @@ -749,45 +782,45 @@ msgid "" "\"pre-zipped\")." msgstr "" -#: ../../library/itertools.rst:621 +#: ../../library/itertools.rst:660 msgid "" "The difference between :func:`map` and :func:`starmap` parallels the " "distinction between ``function(a,b)`` and ``function(*c)``. Roughly " "equivalent to::" msgstr "" -#: ../../library/itertools.rst:633 +#: ../../library/itertools.rst:672 msgid "" "Make an iterator that returns elements from the iterable as long as the " "predicate is true. Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:647 +#: ../../library/itertools.rst:686 msgid "Return *n* independent iterators from a single iterable." msgstr "" -#: ../../library/itertools.rst:649 +#: ../../library/itertools.rst:688 msgid "" "The following Python code helps explain what *tee* does (although the actual " "implementation is more complex and uses only a single underlying :abbr:`FIFO " "(first-in, first-out)` queue)::" msgstr "" -#: ../../library/itertools.rst:668 +#: ../../library/itertools.rst:707 msgid "" "Once a :func:`tee` has been created, the original *iterable* should not be " "used anywhere else; otherwise, the *iterable* could get advanced without the " "tee objects being informed." msgstr "" -#: ../../library/itertools.rst:672 +#: ../../library/itertools.rst:711 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " -"when using simultaneously iterators returned by the same :func:`tee` call, " +"when simultaneously using iterators returned by the same :func:`tee` call, " "even if the original *iterable* is threadsafe." msgstr "" -#: ../../library/itertools.rst:676 +#: ../../library/itertools.rst:715 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -795,7 +828,7 @@ msgid "" "func:`list` instead of :func:`tee`." msgstr "" -#: ../../library/itertools.rst:684 +#: ../../library/itertools.rst:723 msgid "" "Make an iterator that aggregates elements from each of the iterables. If the " "iterables are of uneven length, missing values are filled-in with " @@ -803,7 +836,7 @@ msgid "" "Roughly equivalent to::" msgstr "" -#: ../../library/itertools.rst:708 +#: ../../library/itertools.rst:747 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " @@ -811,17 +844,17 @@ msgid "" "specified, *fillvalue* defaults to ``None``." msgstr "" -#: ../../library/itertools.rst:717 +#: ../../library/itertools.rst:756 msgid "Itertools Recipes" msgstr "" -#: ../../library/itertools.rst:719 +#: ../../library/itertools.rst:758 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" -#: ../../library/itertools.rst:722 +#: ../../library/itertools.rst:761 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -833,22 +866,22 @@ msgid "" "``map()``, ``filter()``, ``reversed()``, and ``enumerate()``." msgstr "" -#: ../../library/itertools.rst:731 +#: ../../library/itertools.rst:770 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " -"as recipes. Currently, the ``iter_index()`` recipe is being tested to see " -"whether it proves its worth." +"as recipes. Currently, the ``sliding_window()`` and ``iter_index()`` " +"recipes are being tested to see whether they prove their worth." msgstr "" -#: ../../library/itertools.rst:736 +#: ../../library/itertools.rst:775 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the `more-itertools project `_ found on the Python Package Index::" msgstr "" -#: ../../library/itertools.rst:742 +#: ../../library/itertools.rst:781 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -858,3 +891,7 @@ msgid "" "preferring \"vectorized\" building blocks over the use of for-loops and :" "term:`generator`\\s which incur interpreter overhead." msgstr "" + +#: ../../library/itertools.rst:1025 +msgid "The following recipes have a more mathematical flavor:" +msgstr "" diff --git a/library/locale.po b/library/locale.po index 24959a9b68..7ebeda6b14 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -631,26 +631,11 @@ msgstr "" #: ../../library/locale.rst:419 msgid "" -"Please note that this function works like :meth:`format_string` but will " -"only work for exactly one ``%char`` specifier. For example, ``'%f'`` and " -"``'%.0f'`` are both valid specifiers, but ``'%f KiB'`` is not." -msgstr "" - -#: ../../library/locale.rst:423 -msgid "For whole format strings, use :func:`format_string`." -msgstr "" - -#: ../../library/locale.rst:425 -msgid "Use :meth:`format_string` instead." -msgstr "" - -#: ../../library/locale.rst:431 -msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:433 +#: ../../library/locale.rst:421 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -658,68 +643,68 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:440 +#: ../../library/locale.rst:428 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: ../../library/locale.rst:446 +#: ../../library/locale.rst:434 msgid "" "Formats a floating point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: ../../library/locale.rst:452 +#: ../../library/locale.rst:440 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:460 +#: ../../library/locale.rst:448 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:468 +#: ../../library/locale.rst:456 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: ../../library/locale.rst:474 +#: ../../library/locale.rst:462 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:481 +#: ../../library/locale.rst:469 msgid "" "Locale category for the character type functions. Depending on the settings " "of this category, the functions of module :mod:`string` dealing with case " "change their behaviour." msgstr "" -#: ../../library/locale.rst:488 +#: ../../library/locale.rst:476 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:494 +#: ../../library/locale.rst:482 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:500 +#: ../../library/locale.rst:488 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:506 +#: ../../library/locale.rst:494 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -727,21 +712,21 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:511 +#: ../../library/locale.rst:499 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:517 +#: ../../library/locale.rst:505 msgid "" -"Locale category for formatting numbers. The functions :func:`.format`, :" -"func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`locale` module are " -"affected by that category. All other numeric formatting operations are not " -"affected." +"Locale category for formatting numbers. The functions :func:" +"`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" +"`locale` module are affected by that category. All other numeric formatting " +"operations are not affected." msgstr "" -#: ../../library/locale.rst:525 +#: ../../library/locale.rst:513 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -751,24 +736,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:534 +#: ../../library/locale.rst:522 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:538 +#: ../../library/locale.rst:526 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:551 +#: ../../library/locale.rst:539 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:553 +#: ../../library/locale.rst:541 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -776,7 +761,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:546 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -786,7 +771,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:565 +#: ../../library/locale.rst:553 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -794,7 +779,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:570 +#: ../../library/locale.rst:558 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -805,14 +790,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:577 +#: ../../library/locale.rst:565 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" -"func:`.format`, :func:`.str`." +"func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:581 +#: ../../library/locale.rst:569 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -823,11 +808,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:592 +#: ../../library/locale.rst:580 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:594 +#: ../../library/locale.rst:582 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -835,7 +820,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:599 +#: ../../library/locale.rst:587 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -845,11 +830,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:610 +#: ../../library/locale.rst:598 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:618 +#: ../../library/locale.rst:606 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`!gettext`, :" @@ -860,7 +845,7 @@ msgid "" "for locating message catalogs." msgstr "" -#: ../../library/locale.rst:625 +#: ../../library/locale.rst:613 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " @@ -870,7 +855,7 @@ msgid "" "their message catalogs." msgstr "" -#: ../../library/locale.rst:19 ../../library/locale.rst:479 +#: ../../library/locale.rst:19 ../../library/locale.rst:467 msgid "module" msgstr "module(模組)" @@ -878,6 +863,6 @@ msgstr "module(模組)" msgid "_locale" msgstr "_locale" -#: ../../library/locale.rst:479 +#: ../../library/locale.rst:467 msgid "string" msgstr "string(字串)" diff --git a/library/logging.config.po b/library/logging.config.po index 974264b176..cf82178a69 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -367,7 +367,11 @@ msgstr "``style``" msgid "``validate`` (since version >=3.8)" msgstr "" -#: ../../library/logging.config.rst:265 +#: ../../library/logging.config.rst:264 +msgid "``defaults`` (since version >=3.12)" +msgstr "" + +#: ../../library/logging.config.rst:266 msgid "" "An optional ``class`` key indicates the name of the formatter's class (as a " "dotted module and class name). The instantiation arguments are as for :" @@ -378,60 +382,60 @@ msgid "" "configuration keys, you should use :ref:`logging-config-dict-userdef`." msgstr "" -#: ../../library/logging.config.rst:274 +#: ../../library/logging.config.rst:275 msgid "" "*filters* - the corresponding value will be a dict in which each key is a " "filter id and each value is a dict describing how to configure the " "corresponding Filter instance." msgstr "" -#: ../../library/logging.config.rst:278 +#: ../../library/logging.config.rst:279 msgid "" "The configuring dict is searched for the key ``name`` (defaulting to the " "empty string) and this is used to construct a :class:`logging.Filter` " "instance." msgstr "" -#: ../../library/logging.config.rst:282 +#: ../../library/logging.config.rst:283 msgid "" "*handlers* - the corresponding value will be a dict in which each key is a " "handler id and each value is a dict describing how to configure the " "corresponding Handler instance." msgstr "" -#: ../../library/logging.config.rst:286 ../../library/logging.config.rst:331 +#: ../../library/logging.config.rst:287 ../../library/logging.config.rst:332 msgid "The configuring dict is searched for the following keys:" msgstr "" -#: ../../library/logging.config.rst:288 +#: ../../library/logging.config.rst:289 msgid "" "``class`` (mandatory). This is the fully qualified name of the handler " "class." msgstr "" -#: ../../library/logging.config.rst:291 +#: ../../library/logging.config.rst:292 msgid "``level`` (optional). The level of the handler." msgstr "" -#: ../../library/logging.config.rst:293 +#: ../../library/logging.config.rst:294 msgid "``formatter`` (optional). The id of the formatter for this handler." msgstr "" -#: ../../library/logging.config.rst:296 +#: ../../library/logging.config.rst:297 msgid "``filters`` (optional). A list of ids of the filters for this handler." msgstr "" -#: ../../library/logging.config.rst:299 ../../library/logging.config.rst:340 +#: ../../library/logging.config.rst:300 ../../library/logging.config.rst:341 msgid "``filters`` can take filter instances in addition to ids." msgstr "" -#: ../../library/logging.config.rst:302 +#: ../../library/logging.config.rst:303 msgid "" "All *other* keys are passed through as keyword arguments to the handler's " "constructor. For example, given the snippet:" msgstr "" -#: ../../library/logging.config.rst:321 +#: ../../library/logging.config.rst:322 msgid "" "the handler with id ``console`` is instantiated as a :class:`logging." "StreamHandler`, using ``sys.stdout`` as the underlying stream. The handler " @@ -440,44 +444,44 @@ msgid "" "maxBytes=1024, backupCount=3``." msgstr "" -#: ../../library/logging.config.rst:327 +#: ../../library/logging.config.rst:328 msgid "" "*loggers* - the corresponding value will be a dict in which each key is a " "logger name and each value is a dict describing how to configure the " "corresponding Logger instance." msgstr "" -#: ../../library/logging.config.rst:333 +#: ../../library/logging.config.rst:334 msgid "``level`` (optional). The level of the logger." msgstr "" -#: ../../library/logging.config.rst:335 +#: ../../library/logging.config.rst:336 msgid "``propagate`` (optional). The propagation setting of the logger." msgstr "" -#: ../../library/logging.config.rst:337 +#: ../../library/logging.config.rst:338 msgid "``filters`` (optional). A list of ids of the filters for this logger." msgstr "" -#: ../../library/logging.config.rst:343 +#: ../../library/logging.config.rst:344 msgid "" "``handlers`` (optional). A list of ids of the handlers for this logger." msgstr "" -#: ../../library/logging.config.rst:346 +#: ../../library/logging.config.rst:347 msgid "" "The specified loggers will be configured according to the level, " "propagation, filters and handlers specified." msgstr "" -#: ../../library/logging.config.rst:349 +#: ../../library/logging.config.rst:350 msgid "" "*root* - this will be the configuration for the root logger. Processing of " "the configuration will be as for any logger, except that the ``propagate`` " "setting will not be applicable." msgstr "" -#: ../../library/logging.config.rst:353 +#: ../../library/logging.config.rst:354 msgid "" "*incremental* - whether the configuration is to be interpreted as " "incremental to the existing configuration. This value defaults to " @@ -486,13 +490,13 @@ msgid "" "`fileConfig` API." msgstr "" -#: ../../library/logging.config.rst:359 +#: ../../library/logging.config.rst:360 msgid "" "If the specified value is ``True``, the configuration is processed as " "described in the section on :ref:`logging-config-dict-incremental`." msgstr "" -#: ../../library/logging.config.rst:362 +#: ../../library/logging.config.rst:363 msgid "" "*disable_existing_loggers* - whether any existing non-root loggers are to be " "disabled. This setting mirrors the parameter of the same name in :func:" @@ -500,11 +504,11 @@ msgid "" "ignored if *incremental* is ``True``." msgstr "" -#: ../../library/logging.config.rst:370 +#: ../../library/logging.config.rst:371 msgid "Incremental Configuration" msgstr "" -#: ../../library/logging.config.rst:372 +#: ../../library/logging.config.rst:373 msgid "" "It is difficult to provide complete flexibility for incremental " "configuration. For example, because objects such as filters and formatters " @@ -512,7 +516,7 @@ msgid "" "to such anonymous objects when augmenting a configuration." msgstr "" -#: ../../library/logging.config.rst:378 +#: ../../library/logging.config.rst:379 msgid "" "Furthermore, there is not a compelling case for arbitrarily altering the " "object graph of loggers, handlers, filters, formatters at run-time, once a " @@ -523,7 +527,7 @@ msgid "" "worth the complexity it adds to the implementation." msgstr "" -#: ../../library/logging.config.rst:387 +#: ../../library/logging.config.rst:388 msgid "" "Thus, when the ``incremental`` key of a configuration dict is present and is " "``True``, the system will completely ignore any ``formatters`` and " @@ -532,7 +536,7 @@ msgid "" "``loggers`` and ``root`` entries." msgstr "" -#: ../../library/logging.config.rst:393 +#: ../../library/logging.config.rst:394 msgid "" "Using a value in the configuration dict lets configurations to be sent over " "the wire as pickled dicts to a socket listener. Thus, the logging verbosity " @@ -540,11 +544,11 @@ msgid "" "and restart the application." msgstr "" -#: ../../library/logging.config.rst:401 +#: ../../library/logging.config.rst:402 msgid "Object connections" msgstr "" -#: ../../library/logging.config.rst:403 +#: ../../library/logging.config.rst:404 msgid "" "The schema describes a set of logging objects - loggers, handlers, " "formatters, filters - which are connected to each other in an object graph. " @@ -560,17 +564,17 @@ msgid "" "source and the destination object with that id." msgstr "" -#: ../../library/logging.config.rst:417 +#: ../../library/logging.config.rst:418 msgid "So, for example, consider the following YAML snippet:" msgstr "" -#: ../../library/logging.config.rst:438 +#: ../../library/logging.config.rst:439 msgid "" "(Note: YAML used here because it's a little more readable than the " "equivalent Python source form for the dictionary.)" msgstr "" -#: ../../library/logging.config.rst:441 +#: ../../library/logging.config.rst:442 msgid "" "The ids for loggers are the logger names which would be used " "programmatically to obtain a reference to those loggers, e.g. ``foo.bar." @@ -581,7 +585,7 @@ msgid "" "configuration call is complete." msgstr "" -#: ../../library/logging.config.rst:449 +#: ../../library/logging.config.rst:450 msgid "" "The above snippet indicates that logger named ``foo.bar.baz`` should have " "two handlers attached to it, which are described by the handler ids ``h1`` " @@ -589,11 +593,11 @@ msgid "" "the formatter for ``h2`` is that described by id ``precise``." msgstr "" -#: ../../library/logging.config.rst:459 +#: ../../library/logging.config.rst:460 msgid "User-defined objects" msgstr "" -#: ../../library/logging.config.rst:461 +#: ../../library/logging.config.rst:462 msgid "" "The schema supports user-defined objects for handlers, filters and " "formatters. (Loggers do not need to have different types for different " @@ -601,7 +605,7 @@ msgid "" "defined logger classes.)" msgstr "" -#: ../../library/logging.config.rst:466 +#: ../../library/logging.config.rst:467 msgid "" "Objects to be configured are described by dictionaries which detail their " "configuration. In some places, the logging system will be able to infer " @@ -614,7 +618,7 @@ msgid "" "made available under the special key ``'()'``. Here's a concrete example:" msgstr "" -#: ../../library/logging.config.rst:492 +#: ../../library/logging.config.rst:493 msgid "" "The above YAML snippet defines three formatters. The first, with id " "``brief``, is a standard :class:`logging.Formatter` instance with the " @@ -625,14 +629,14 @@ msgid "" "configuration sub-dictionaries::" msgstr "" -#: ../../library/logging.config.rst:504 +#: ../../library/logging.config.rst:505 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/logging.config.rst:511 +#: ../../library/logging.config.rst:512 msgid "" "respectively, and as these dictionaries do not contain the special key " "``'()'``, the instantiation is inferred from the context: as a result, " @@ -641,7 +645,7 @@ msgid "" "is::" msgstr "" -#: ../../library/logging.config.rst:524 +#: ../../library/logging.config.rst:525 msgid "" "and this contains the special key ``'()'``, which means that user-defined " "instantiation is wanted. In this case, the specified factory callable will " @@ -653,7 +657,7 @@ msgid "" "assumed to be returned by the call::" msgstr "" -#: ../../library/logging.config.rst:536 +#: ../../library/logging.config.rst:537 msgid "" "The values for keys such as ``bar``, ``spam`` and ``answer`` in the above " "example should not be configuration dictionaries or references such as " @@ -661,7 +665,7 @@ msgid "" "configuration machinery, but passed to the callable as-is." msgstr "" -#: ../../library/logging.config.rst:541 +#: ../../library/logging.config.rst:542 msgid "" "The key ``'()'`` has been used as the special key because it is not a valid " "keyword parameter name, and so will not clash with the names of the keyword " @@ -669,13 +673,13 @@ msgid "" "corresponding value is a callable." msgstr "" -#: ../../library/logging.config.rst:546 +#: ../../library/logging.config.rst:547 msgid "" "The ``filters`` member of ``handlers`` and ``loggers`` can take filter " "instances in addition to ids." msgstr "" -#: ../../library/logging.config.rst:550 +#: ../../library/logging.config.rst:551 msgid "" "You can also specify a special key ``'.'`` whose value is a dictionary is a " "mapping of attribute names to values. If found, the specified attributes " @@ -683,13 +687,13 @@ msgid "" "following configuration::" msgstr "" -#: ../../library/logging.config.rst:566 +#: ../../library/logging.config.rst:567 msgid "" "the returned formatter will have attribute ``foo`` set to ``'bar'`` and " "attribute ``baz`` set to ``'bozz'``." msgstr "" -#: ../../library/logging.config.rst:569 +#: ../../library/logging.config.rst:570 msgid "" "The values for attributes such as ``foo`` and ``baz`` in the above example " "should not be configuration dictionaries or references such as ``cfg://foo`` " @@ -697,11 +701,11 @@ msgid "" "machinery, but set as attribute values as-is." msgstr "" -#: ../../library/logging.config.rst:578 +#: ../../library/logging.config.rst:579 msgid "Handler configuration order" msgstr "" -#: ../../library/logging.config.rst:580 +#: ../../library/logging.config.rst:581 msgid "" "Handlers are configured in alphabetical order of their keys, and a " "configured handler replaces the configuration dictionary in (a working copy " @@ -722,11 +726,11 @@ msgid "" "dictionary." msgstr "" -#: ../../library/logging.config.rst:601 +#: ../../library/logging.config.rst:602 msgid "Access to external objects" msgstr "" -#: ../../library/logging.config.rst:603 +#: ../../library/logging.config.rst:604 msgid "" "There are times where a configuration needs to refer to objects external to " "the configuration, for example ``sys.stderr``. If the configuration dict is " @@ -741,7 +745,7 @@ msgid "" "import mechanisms." msgstr "" -#: ../../library/logging.config.rst:616 +#: ../../library/logging.config.rst:617 msgid "" "The handling of such prefixes is done in a way analogous to protocol " "handling: there is a generic mechanism to look for prefixes which match the " @@ -751,11 +755,11 @@ msgid "" "prefix is not recognised, then the string value will be left as-is." msgstr "" -#: ../../library/logging.config.rst:628 +#: ../../library/logging.config.rst:629 msgid "Access to internal objects" msgstr "" -#: ../../library/logging.config.rst:630 +#: ../../library/logging.config.rst:631 msgid "" "As well as external objects, there is sometimes also a need to refer to " "objects in the configuration. This will be done implicitly by the " @@ -766,7 +770,7 @@ msgid "" "and resolve to the appropriate destination object." msgstr "" -#: ../../library/logging.config.rst:638 +#: ../../library/logging.config.rst:639 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -780,7 +784,7 @@ msgid "" "resolution system allows the user to specify:" msgstr "" -#: ../../library/logging.config.rst:660 +#: ../../library/logging.config.rst:661 msgid "" "The literal string ``'cfg://handlers.file'`` will be resolved in an " "analogous way to strings with the ``ext://`` prefix, but looking in the " @@ -789,7 +793,7 @@ msgid "" "format``. Thus, given the following snippet:" msgstr "" -#: ../../library/logging.config.rst:678 +#: ../../library/logging.config.rst:679 msgid "" "in the configuration, the string ``'cfg://handlers'`` would resolve to the " "dict with key ``handlers``, the string ``'cfg://handlers.email`` would " @@ -805,7 +809,7 @@ msgid "" "to the string value if needed." msgstr "" -#: ../../library/logging.config.rst:692 +#: ../../library/logging.config.rst:693 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -815,11 +819,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: ../../library/logging.config.rst:704 +#: ../../library/logging.config.rst:705 msgid "Import resolution and custom importers" msgstr "" -#: ../../library/logging.config.rst:706 +#: ../../library/logging.config.rst:707 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -831,18 +835,120 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: ../../library/logging.config.rst:721 +#: ../../library/logging.config.rst:722 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" #: ../../library/logging.config.rst:728 -msgid "Configuration file format" +msgid "Configuring QueueHandler and QueueListener" msgstr "" #: ../../library/logging.config.rst:730 msgid "" +"If you want to configure a :class:`~logging.handlers.QueueHandler`, noting " +"that this is normally used in conjunction with a :class:`~logging.handlers." +"QueueListener`, you can configure both together. After the configuration, " +"the ``QueueListener`` instance will be available as the :attr:`~logging." +"handlers.QueueHandler.listener` attribute of the created handler, and that " +"in turn will be available to you using :func:`~logging.getHandlerByName` and " +"passing the name you have used for the ``QueueHandler`` in your " +"configuration. The dictionary schema for configuring the pair is shown in " +"the example YAML snippet below." +msgstr "" + +#: ../../library/logging.config.rst:751 +msgid "The ``queue`` and ``listener`` keys are optional." +msgstr "" + +#: ../../library/logging.config.rst:753 +msgid "" +"If the ``queue`` key is present, the corresponding value can be one of the " +"following:" +msgstr "" + +#: ../../library/logging.config.rst:755 +msgid "" +"An actual instance of :class:`queue.Queue` or a subclass thereof. This is of " +"course only possible if you are constructing or modifying the configuration " +"dictionary in code." +msgstr "" + +#: ../../library/logging.config.rst:759 +msgid "" +"A string that resolves to a callable which, when called with no arguments, " +"returns the :class:`queue.Queue` instance to use. That callable could be a :" +"class:`queue.Queue` subclass or a function which returns a suitable queue " +"instance, such as ``my.module.queue_factory()``." +msgstr "" + +#: ../../library/logging.config.rst:764 +msgid "" +"A dict with a ``'()'`` key which is constructed in the usual way as " +"discussed in :ref:`logging-config-dict-userdef`. The result of this " +"construction should be a :class:`queue.Queue` instance." +msgstr "" + +#: ../../library/logging.config.rst:768 +msgid "" +"If the ``queue`` key is absent, a standard unbounded :class:`queue.Queue` " +"instance is created and used." +msgstr "" + +#: ../../library/logging.config.rst:771 +msgid "" +"If the ``listener`` key is present, the corresponding value can be one of " +"the following:" +msgstr "" + +#: ../../library/logging.config.rst:773 +msgid "" +"A subclass of :class:`logging.handlers.QueueListener`. This is of course " +"only possible if you are constructing or modifying the configuration " +"dictionary in code." +msgstr "" + +#: ../../library/logging.config.rst:777 +msgid "" +"A string which resolves to a class which is a subclass of ``QueueListener``, " +"such as ``'my.package.CustomListener'``." +msgstr "" + +#: ../../library/logging.config.rst:780 +msgid "" +"A dict with a ``'()'`` key which is constructed in the usual way as " +"discussed in :ref:`logging-config-dict-userdef`. The result of this " +"construction should be a callable with the same signature as the " +"``QueueListener`` initializer." +msgstr "" + +#: ../../library/logging.config.rst:784 +msgid "" +"If the ``listener`` key is absent, :class:`logging.handlers.QueueListener` " +"is used." +msgstr "" + +#: ../../library/logging.config.rst:786 +msgid "" +"The values under the ``handlers`` key are the names of other handlers in the " +"configuration (not shown in the above snippet) which will be passed to the " +"queue listener." +msgstr "" + +#: ../../library/logging.config.rst:790 +msgid "" +"Any custom queue handler and listener classes will need to be defined with " +"the same initialization signatures as :class:`~logging.handlers." +"QueueHandler` and :class:`~logging.handlers.QueueListener`." +msgstr "" + +#: ../../library/logging.config.rst:799 +msgid "Configuration file format" +msgstr "" + +#: ../../library/logging.config.rst:801 +msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " "``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name " @@ -858,7 +964,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:745 +#: ../../library/logging.config.rst:816 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -871,17 +977,17 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:755 +#: ../../library/logging.config.rst:826 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:768 +#: ../../library/logging.config.rst:839 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:777 +#: ../../library/logging.config.rst:848 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -889,7 +995,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:782 +#: ../../library/logging.config.rst:853 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -897,13 +1003,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:787 +#: ../../library/logging.config.rst:858 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:798 +#: ../../library/logging.config.rst:869 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -916,20 +1022,20 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:807 +#: ../../library/logging.config.rst:878 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:817 +#: ../../library/logging.config.rst:888 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:821 +#: ../../library/logging.config.rst:892 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -937,7 +1043,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:826 +#: ../../library/logging.config.rst:897 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -946,7 +1052,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:832 +#: ../../library/logging.config.rst:903 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -954,19 +1060,26 @@ msgid "" "``{}``." msgstr "" -#: ../../library/logging.config.rst:889 +#: ../../library/logging.config.rst:960 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:900 +#: ../../library/logging.config.rst:972 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: ../../library/logging.config.rst:906 +#: ../../library/logging.config.rst:976 +msgid "" +"The ``defaults`` entry, when :ref:`evaluated ` in the context of " +"the ``logging`` package's namespace, is a dictionary of default values for " +"custom formatting fields. If not provided, it defaults to ``None``." +msgstr "" + +#: ../../library/logging.config.rst:983 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -975,18 +1088,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:915 +#: ../../library/logging.config.rst:992 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:915 +#: ../../library/logging.config.rst:992 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:917 +#: ../../library/logging.config.rst:994 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:918 +#: ../../library/logging.config.rst:995 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 5855f98090..e783e1d915 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -537,8 +537,9 @@ msgstr "" #: ../../library/logging.handlers.rst:398 msgid "" "The system will save old log files by appending extensions to the filename. " -"The extensions are date-and-time based, using the strftime format ``%Y-%m-%d_" -"%H-%M-%S`` or a leading portion thereof, depending on the rollover interval." +"The extensions are date-and-time based, using the strftime format ``%Y-%m-" +"%d_%H-%M-%S`` or a leading portion thereof, depending on the rollover " +"interval." msgstr "" #: ../../library/logging.handlers.rst:403 @@ -1439,7 +1440,7 @@ msgid "" msgstr "" #: ../../library/logging.handlers.rst:1045 -#: ../../library/logging.handlers.rst:1128 +#: ../../library/logging.handlers.rst:1134 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." @@ -1501,11 +1502,18 @@ msgid "" "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1099 +#: ../../library/logging.handlers.rst:1096 +msgid "" +"When created via configuration using :func:`~logging.config.dictConfig`, " +"this attribute will contain a :class:`QueueListener` instance for use with " +"this handler. Otherwise, it will be ``None``." +msgstr "" + +#: ../../library/logging.handlers.rst:1105 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1103 +#: ../../library/logging.handlers.rst:1109 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1516,7 +1524,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1111 +#: ../../library/logging.handlers.rst:1117 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1526,7 +1534,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1120 +#: ../../library/logging.handlers.rst:1126 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1537,7 +1545,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1131 +#: ../../library/logging.handlers.rst:1137 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1545,82 +1553,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1136 +#: ../../library/logging.handlers.rst:1142 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1141 +#: ../../library/logging.handlers.rst:1147 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1143 +#: ../../library/logging.handlers.rst:1149 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1149 +#: ../../library/logging.handlers.rst:1155 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1151 +#: ../../library/logging.handlers.rst:1157 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1157 +#: ../../library/logging.handlers.rst:1163 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1159 +#: ../../library/logging.handlers.rst:1165 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1165 +#: ../../library/logging.handlers.rst:1171 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1167 +#: ../../library/logging.handlers.rst:1173 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1172 +#: ../../library/logging.handlers.rst:1178 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1174 +#: ../../library/logging.handlers.rst:1180 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1180 +#: ../../library/logging.handlers.rst:1186 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1191 +#: ../../library/logging.handlers.rst:1197 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1191 +#: ../../library/logging.handlers.rst:1197 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1193 +#: ../../library/logging.handlers.rst:1199 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1194 +#: ../../library/logging.handlers.rst:1200 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/logging.po b/library/logging.po index 9dd7c1b27f..e990978301 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -204,7 +204,7 @@ msgid "" "level." msgstr "" -#: ../../library/logging.rst:134 ../../library/logging.rst:447 +#: ../../library/logging.rst:134 ../../library/logging.rst:459 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" @@ -245,6 +245,16 @@ msgstr "" #: ../../library/logging.rst:175 msgid "" +"Returns a set of loggers which are immediate children of this logger. So for " +"example ``logging.getLogger().getChildren()`` might return a set containing " +"loggers named ``foo`` and ``bar``, but a logger named ``foo.bar`` wouldn't " +"be included in the set. Likewise, ``logging.getLogger('foo').getChildren()`` " +"might return a set including a logger named ``foo.bar``, but it wouldn't " +"include one named ``foo.bar.baz``." +msgstr "" + +#: ../../library/logging.rst:187 +msgid "" "Logs a message with level :const:`DEBUG` on this logger. The *msg* is the " "message format string, and the *args* are the arguments which are merged " "into *msg* using the string formatting operator. (Note that this means that " @@ -253,13 +263,13 @@ msgid "" "are supplied." msgstr "" -#: ../../library/logging.rst:181 +#: ../../library/logging.rst:193 msgid "" "There are four keyword arguments in *kwargs* which are inspected: " "*exc_info*, *stack_info*, *stacklevel* and *extra*." msgstr "" -#: ../../library/logging.rst:184 +#: ../../library/logging.rst:196 msgid "" "If *exc_info* does not evaluate as false, it causes exception information to " "be added to the logging message. If an exception tuple (in the format " @@ -268,7 +278,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:1067 +#: ../../library/logging.rst:201 ../../library/logging.rst:1088 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,20 +290,20 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1076 +#: ../../library/logging.rst:210 ../../library/logging.rst:1097 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1084 +#: ../../library/logging.rst:218 ../../library/logging.rst:1105 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." msgstr "" -#: ../../library/logging.rst:209 +#: ../../library/logging.rst:221 msgid "" "The third optional keyword argument is *stacklevel*, which defaults to " "``1``. If greater than 1, the corresponding number of stack frames are " @@ -305,7 +315,7 @@ msgid "" "module." msgstr "" -#: ../../library/logging.rst:217 +#: ../../library/logging.rst:229 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the :class:`LogRecord` " @@ -314,18 +324,18 @@ msgid "" "incorporated into logged messages. For example::" msgstr "" -#: ../../library/logging.rst:229 +#: ../../library/logging.rst:241 msgid "would print something like" msgstr "" -#: ../../library/logging.rst:235 +#: ../../library/logging.rst:247 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the section on :ref:`logrecord-attributes` " "for more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:239 +#: ../../library/logging.rst:251 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -336,7 +346,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1115 +#: ../../library/logging.rst:258 ../../library/logging.rst:1136 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -347,78 +357,78 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:253 +#: ../../library/logging.rst:265 msgid "" "If no handler is attached to this logger (or any of its ancestors, taking " "into account the relevant :attr:`Logger.propagate` attributes), the message " "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1126 +#: ../../library/logging.rst:269 ../../library/logging.rst:1147 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:260 +#: ../../library/logging.rst:272 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:263 +#: ../../library/logging.rst:275 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:269 +#: ../../library/logging.rst:281 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:275 +#: ../../library/logging.rst:287 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:278 +#: ../../library/logging.rst:290 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:284 +#: ../../library/logging.rst:296 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:290 +#: ../../library/logging.rst:302 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:296 +#: ../../library/logging.rst:308 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:302 +#: ../../library/logging.rst:314 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:309 +#: ../../library/logging.rst:321 msgid "Adds the specified filter *filter* to this logger." msgstr "" -#: ../../library/logging.rst:314 +#: ../../library/logging.rst:326 msgid "Removes the specified filter *filter* from this logger." msgstr "" -#: ../../library/logging.rst:319 +#: ../../library/logging.rst:331 msgid "" "Apply this logger's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -427,22 +437,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:328 +#: ../../library/logging.rst:340 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:333 +#: ../../library/logging.rst:345 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:338 +#: ../../library/logging.rst:350 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:342 +#: ../../library/logging.rst:354 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -452,7 +462,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:352 +#: ../../library/logging.rst:364 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -461,13 +471,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:360 +#: ../../library/logging.rst:372 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:365 +#: ../../library/logging.rst:377 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -477,15 +487,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:374 +#: ../../library/logging.rst:386 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:380 +#: ../../library/logging.rst:392 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:382 +#: ../../library/logging.rst:394 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -494,67 +504,67 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:401 msgid "Level" msgstr "" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:401 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:391 +#: ../../library/logging.rst:403 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../library/logging.rst:391 +#: ../../library/logging.rst:403 msgid "50" msgstr "50" -#: ../../library/logging.rst:393 +#: ../../library/logging.rst:405 msgid "``ERROR``" msgstr "``ERROR``" -#: ../../library/logging.rst:393 +#: ../../library/logging.rst:405 msgid "40" msgstr "40" -#: ../../library/logging.rst:395 +#: ../../library/logging.rst:407 msgid "``WARNING``" msgstr "``WARNING``" -#: ../../library/logging.rst:395 +#: ../../library/logging.rst:407 msgid "30" msgstr "30" -#: ../../library/logging.rst:397 +#: ../../library/logging.rst:409 msgid "``INFO``" msgstr "``INFO``" -#: ../../library/logging.rst:397 +#: ../../library/logging.rst:409 msgid "20" msgstr "20" -#: ../../library/logging.rst:399 +#: ../../library/logging.rst:411 msgid "``DEBUG``" msgstr "``DEBUG``" -#: ../../library/logging.rst:399 +#: ../../library/logging.rst:411 msgid "10" msgstr "10" -#: ../../library/logging.rst:401 +#: ../../library/logging.rst:413 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../library/logging.rst:401 +#: ../../library/logging.rst:413 msgid "0" msgstr "0" -#: ../../library/logging.rst:408 +#: ../../library/logging.rst:420 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:410 +#: ../../library/logging.rst:422 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -562,53 +572,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:419 +#: ../../library/logging.rst:431 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:426 +#: ../../library/logging.rst:438 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:432 +#: ../../library/logging.rst:444 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:437 +#: ../../library/logging.rst:449 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:442 +#: ../../library/logging.rst:454 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:449 +#: ../../library/logging.rst:461 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:457 +#: ../../library/logging.rst:469 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:462 +#: ../../library/logging.rst:474 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:467 +#: ../../library/logging.rst:479 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:472 +#: ../../library/logging.rst:484 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -617,13 +627,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:481 +#: ../../library/logging.rst:493 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:487 +#: ../../library/logging.rst:499 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -631,14 +641,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:495 +#: ../../library/logging.rst:507 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:502 +#: ../../library/logging.rst:514 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute " @@ -651,20 +661,20 @@ msgid "" "more useful during development)." msgstr "" -#: ../../library/logging.rst:515 +#: ../../library/logging.rst:527 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:521 +#: ../../library/logging.rst:533 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:525 +#: ../../library/logging.rst:537 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -673,13 +683,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:531 +#: ../../library/logging.rst:543 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:534 +#: ../../library/logging.rst:546 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -689,84 +699,80 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:541 +#: ../../library/logging.rst:553 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:546 +#: ../../library/logging.rst:558 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:550 +#: ../../library/logging.rst:564 msgid "" -":class:`Formatter` objects have the following attributes and methods. They " -"are responsible for converting a :class:`LogRecord` to (usually) a string " -"which can be interpreted by either a human or an external system. The base :" -"class:`Formatter` allows a formatting string to be specified. If none is " -"supplied, the default value of ``'%(message)s'`` is used, which just " -"includes the message in the logging call. To have additional items of " -"information in the formatted output (such as a timestamp), keep reading." +"Responsible for converting a :class:`LogRecord` to an output string to be " +"interpreted by a human or external system." msgstr "" -#: ../../library/logging.rst:558 +#: ../../library/logging.rst:0 +msgid "Parameters" +msgstr "" + +#: ../../library/logging.rst:567 msgid "" -"A Formatter can be initialized with a format string which makes use of " -"knowledge of the :class:`LogRecord` attributes - such as the default value " -"mentioned above making use of the fact that the user's message and arguments " -"are pre-formatted into a :class:`LogRecord`'s *message* attribute. This " -"format string contains standard Python %-style mapping keys. See section :" -"ref:`old-string-formatting` for more information on string formatting." +"A format string in the given *style* for the logged output as a whole. The " +"possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" +"`logrecord-attributes`. If not specified, ``'%(message)s'`` is used, which " +"is just the logged message." msgstr "" -#: ../../library/logging.rst:565 +#: ../../library/logging.rst:575 msgid "" -"The useful mapping keys in a :class:`LogRecord` are given in the section on :" -"ref:`logrecord-attributes`." +"A format string in the given *style* for the date/time portion of the logged " +"output. If not specified, the default described in :meth:`formatTime` is " +"used." msgstr "" -#: ../../library/logging.rst:571 +#: ../../library/logging.rst:580 msgid "" -"Returns a new instance of the :class:`Formatter` class. The instance is " -"initialized with a format string for the message as a whole, as well as a " -"format string for the date/time portion of a message. If no *fmt* is " -"specified, ``'%(message)s'`` is used. If no *datefmt* is specified, a " -"format is used which is described in the :meth:`formatTime` documentation." +"Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " +"string will be merged with its data: using one of :ref:`old-string-" +"formatting` (``%``), :meth:`str.format` (``{``) or :class:`string.Template` " +"(``$``). This only applies to *fmt* and *datefmt* (e.g. ``'%(message)s'`` " +"versus ``'{message}'``), not to the actual log messages passed to the " +"logging methods. However, there are :ref:`other ways ` to " +"use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:577 +#: ../../library/logging.rst:590 msgid "" -"The *style* parameter can be one of '%', '{' or '$' and determines how the " -"format string will be merged with its data: using one of %-formatting, :meth:" -"`str.format` or :class:`string.Template`. This only applies to the format " -"string *fmt* (e.g. ``'%(message)s'`` or ``{message}``), not to the actual " -"log messages passed to ``Logger.debug`` etc; see :ref:`formatting-styles` " -"for more information on using {- and $-formatting for log messages." +"If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " +"raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " +"%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:585 +#: ../../library/logging.rst:595 msgid "" -"The *defaults* parameter can be a dictionary with default values to use in " -"custom fields. For example: ``logging.Formatter('%(ip)s %(message)s', " -"defaults={\"ip\": None})``" +"A dictionary with default values to use in custom fields. For example, " +"``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:589 -msgid "The *style* parameter was added." +#: ../../library/logging.rst:600 +#, fuzzy +msgid "The *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:592 -msgid "" -"The *validate* parameter was added. Incorrect or mismatched style and fmt " -"will raise a ``ValueError``. For example: ``logging.Formatter('%(asctime)s - " -"%(message)s', style='{')``." -msgstr "" +#: ../../library/logging.rst:603 +#, fuzzy +msgid "The *validate* parameter." +msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:597 -msgid "The *defaults* parameter was added." +#: ../../library/logging.rst:606 +#, fuzzy +msgid "The *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:602 +#: ../../library/logging.rst:612 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -785,13 +791,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:618 +#: ../../library/logging.rst:628 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:624 +#: ../../library/logging.rst:634 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -804,7 +810,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:634 +#: ../../library/logging.rst:644 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -814,7 +820,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:642 +#: ../../library/logging.rst:652 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -829,11 +835,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:655 +#: ../../library/logging.rst:665 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:660 +#: ../../library/logging.rst:670 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -841,14 +847,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:667 +#: ../../library/logging.rst:677 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:673 +#: ../../library/logging.rst:683 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -857,7 +863,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:681 +#: ../../library/logging.rst:691 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -865,14 +871,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:688 +#: ../../library/logging.rst:698 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:695 +#: ../../library/logging.rst:705 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -880,11 +886,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:703 +#: ../../library/logging.rst:713 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:705 +#: ../../library/logging.rst:715 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -894,7 +900,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:715 +#: ../../library/logging.rst:725 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -902,13 +908,15 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:722 +#: ../../library/logging.rst:732 msgid "" -"Is the specified record to be logged? Returns zero for no, nonzero for yes. " -"If deemed appropriate, the record may be modified in-place by this method." +"Is the specified record to be logged? Returns false for no, true for yes. " +"Filters can either modify log records in-place or return a completely " +"different record instance which will replace the original log record in any " +"future processing of the event." msgstr "" -#: ../../library/logging.rst:726 +#: ../../library/logging.rst:737 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -918,13 +926,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:744 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:736 +#: ../../library/logging.rst:747 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -935,7 +943,15 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:746 +#: ../../library/logging.rst:757 +msgid "" +"You can now return a :class:`LogRecord` instance from filters to replace the " +"log record rather than modifying it in place. This allows filters attached " +"to a :class:`Handler` to modify the log record before it is emitted, without " +"having side effects on other handlers." +msgstr "" + +#: ../../library/logging.rst:763 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -947,11 +963,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:759 +#: ../../library/logging.rst:776 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:761 +#: ../../library/logging.rst:778 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -959,21 +975,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:769 +#: ../../library/logging.rst:786 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:771 +#: ../../library/logging.rst:788 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:0 -msgid "Parameters" -msgstr "" - -#: ../../library/logging.rst:775 +#: ../../library/logging.rst:792 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -981,7 +993,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:783 +#: ../../library/logging.rst:800 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -989,46 +1001,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:807 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:794 +#: ../../library/logging.rst:811 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:798 +#: ../../library/logging.rst:815 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:803 +#: ../../library/logging.rst:820 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:807 +#: ../../library/logging.rst:824 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:812 +#: ../../library/logging.rst:829 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:816 +#: ../../library/logging.rst:833 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:823 +#: ../../library/logging.rst:840 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1037,7 +1049,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:847 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1045,24 +1057,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:836 +#: ../../library/logging.rst:853 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:848 +#: ../../library/logging.rst:865 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:874 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:859 +#: ../../library/logging.rst:876 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1073,7 +1085,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:884 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1081,7 +1093,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:890 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1090,308 +1102,326 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:880 +#: ../../library/logging.rst:897 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:880 ../../library/logging.rst:1271 +#: ../../library/logging.rst:897 ../../library/logging.rst:1305 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:880 ../../library/logging.rst:1271 +#: ../../library/logging.rst:897 ../../library/logging.rst:1305 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:882 +#: ../../library/logging.rst:0 ../../library/logging.rst:899 msgid "args" msgstr "" -#: ../../library/logging.rst:882 ../../library/logging.rst:896 -#: ../../library/logging.rst:924 ../../library/logging.rst:942 +#: ../../library/logging.rst:899 ../../library/logging.rst:913 +#: ../../library/logging.rst:941 ../../library/logging.rst:959 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:882 +#: ../../library/logging.rst:899 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:904 msgid "asctime" msgstr "" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:904 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:904 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:893 +#: ../../library/logging.rst:910 msgid "created" msgstr "" -#: ../../library/logging.rst:893 +#: ../../library/logging.rst:910 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:893 +#: ../../library/logging.rst:910 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:896 +#: ../../library/logging.rst:0 ../../library/logging.rst:913 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:896 +#: ../../library/logging.rst:913 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:916 msgid "filename" msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:916 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:916 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:901 +#: ../../library/logging.rst:918 msgid "funcName" msgstr "" -#: ../../library/logging.rst:901 +#: ../../library/logging.rst:918 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:901 +#: ../../library/logging.rst:918 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:903 +#: ../../library/logging.rst:920 msgid "levelname" msgstr "" -#: ../../library/logging.rst:903 +#: ../../library/logging.rst:920 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:903 +#: ../../library/logging.rst:920 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:924 msgid "levelno" msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:924 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:924 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:912 +#: ../../library/logging.rst:929 msgid "lineno" msgstr "" -#: ../../library/logging.rst:912 +#: ../../library/logging.rst:929 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:912 +#: ../../library/logging.rst:929 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:915 +#: ../../library/logging.rst:932 msgid "message" msgstr "" -#: ../../library/logging.rst:915 +#: ../../library/logging.rst:932 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:915 +#: ../../library/logging.rst:932 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:936 msgid "module" msgstr "模組" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:936 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:936 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:938 msgid "msecs" msgstr "" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:938 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:938 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:924 +#: ../../library/logging.rst:0 ../../library/logging.rst:941 msgid "msg" msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:941 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:929 +#: ../../library/logging.rst:0 ../../library/logging.rst:946 msgid "name" msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:946 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:946 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:948 msgid "pathname" msgstr "" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:948 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:948 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:951 msgid "process" msgstr "" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:951 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:951 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:953 msgid "processName" msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:953 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:953 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:955 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:955 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:955 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:959 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:959 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:965 msgid "thread" msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:965 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:965 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:967 msgid "threadName" msgstr "" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:967 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:950 +#: ../../library/logging.rst:967 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:969 +msgid "taskName" +msgstr "" + +#: ../../library/logging.rst:969 +#, fuzzy +msgid "``%(taskName)s``" +msgstr "``%(threadName)s``" + +#: ../../library/logging.rst:969 +msgid ":class:`asyncio.Task` name (if available)." +msgstr "" + +#: ../../library/logging.rst:972 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:960 +#: ../../library/logging.rst:975 +#, fuzzy +msgid "*taskName* was added." +msgstr "新增 *processName*\\ 。" + +#: ../../library/logging.rst:981 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:962 +#: ../../library/logging.rst:983 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:968 +#: ../../library/logging.rst:989 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:973 +#: ../../library/logging.rst:994 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1400,7 +1430,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:979 +#: ../../library/logging.rst:1000 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1412,24 +1442,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:988 +#: ../../library/logging.rst:1009 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:993 +#: ../../library/logging.rst:1014 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:999 +#: ../../library/logging.rst:1020 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1001 +#: ../../library/logging.rst:1022 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1438,7 +1468,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1006 +#: ../../library/logging.rst:1027 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1446,17 +1476,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1013 +#: ../../library/logging.rst:1034 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1036 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1021 +#: ../../library/logging.rst:1042 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1465,14 +1495,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1026 +#: ../../library/logging.rst:1047 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1033 +#: ../../library/logging.rst:1054 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1481,24 +1511,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1065 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1067 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1072 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1056 +#: ../../library/logging.rst:1077 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1507,7 +1537,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1061 +#: ../../library/logging.rst:1082 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1517,7 +1547,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1087 +#: ../../library/logging.rst:1108 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1526,18 +1556,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1098 +#: ../../library/logging.rst:1119 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1104 +#: ../../library/logging.rst:1125 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1129 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1548,58 +1578,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1122 +#: ../../library/logging.rst:1143 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1131 +#: ../../library/logging.rst:1152 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1158 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1140 +#: ../../library/logging.rst:1161 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1147 +#: ../../library/logging.rst:1168 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1153 +#: ../../library/logging.rst:1174 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1159 +#: ../../library/logging.rst:1180 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1165 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1170 +#: ../../library/logging.rst:1191 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 " @@ -1613,7 +1643,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1181 +#: ../../library/logging.rst:1202 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 " @@ -1621,13 +1651,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1207 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1213 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1637,24 +1667,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1199 +#: ../../library/logging.rst:1220 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1225 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1233 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1214 +#: ../../library/logging.rst:1235 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1664,20 +1694,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1242 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:1225 +#: ../../library/logging.rst:1246 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1228 +#: ../../library/logging.rst:1249 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 " @@ -1686,7 +1716,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1234 +#: ../../library/logging.rst:1255 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. " @@ -1694,7 +1724,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1242 +#: ../../library/logging.rst:1263 +msgid "" +"Returns a handler with the specified *name*, or ``None`` if there is no " +"handler with that name." +msgstr "" + +#: ../../library/logging.rst:1270 +msgid "Returns an immutable set of all known handler names." +msgstr "" + +#: ../../library/logging.rst:1276 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1702,7 +1742,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1250 +#: ../../library/logging.rst:1284 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1711,13 +1751,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1256 +#: ../../library/logging.rst:1290 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:1259 +#: ../../library/logging.rst:1293 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 " @@ -1726,54 +1766,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1266 +#: ../../library/logging.rst:1300 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1307 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1307 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1311 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1277 +#: ../../library/logging.rst:1311 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1315 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1315 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1286 +#: ../../library/logging.rst:1320 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1286 +#: ../../library/logging.rst:1320 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1289 +#: ../../library/logging.rst:1323 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1289 +#: ../../library/logging.rst:1323 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1334 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1334 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:1306 +#: ../../library/logging.rst:1340 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1340 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 " @@ -1813,33 +1853,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1349 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1349 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:1321 +#: ../../library/logging.rst:1355 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1355 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:1326 +#: ../../library/logging.rst:1360 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1326 +#: ../../library/logging.rst:1360 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 " @@ -1848,39 +1888,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1337 +#: ../../library/logging.rst:1371 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1374 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:1346 +#: ../../library/logging.rst:1380 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1383 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1354 +#: ../../library/logging.rst:1388 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:1358 +#: ../../library/logging.rst:1392 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:1365 +#: ../../library/logging.rst:1399 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 " @@ -1892,32 +1932,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1410 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1412 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1414 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:1385 +#: ../../library/logging.rst:1419 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1387 +#: ../../library/logging.rst:1421 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1423 msgid "The logger name." msgstr "" @@ -1925,7 +1965,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1390 +#: ../../library/logging.rst:1424 msgid "The logging level (numeric)." msgstr "" @@ -1933,7 +1973,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1425 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1941,19 +1981,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1426 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1393 +#: ../../library/logging.rst:1427 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1428 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1429 msgid "An exception tuple, or ``None``." msgstr "" @@ -1961,7 +2001,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1396 +#: ../../library/logging.rst:1430 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1969,7 +2009,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1432 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1979,15 +2019,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1400 +#: ../../library/logging.rst:1434 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1404 +#: ../../library/logging.rst:1438 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1408 +#: ../../library/logging.rst:1442 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``, " @@ -1998,22 +2038,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1419 +#: ../../library/logging.rst:1453 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1421 +#: ../../library/logging.rst:1455 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1426 +#: ../../library/logging.rst:1460 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1429 +#: ../../library/logging.rst:1463 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2022,46 +2062,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1434 +#: ../../library/logging.rst:1468 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:1442 +#: ../../library/logging.rst:1476 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1476 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1479 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1479 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1449 +#: ../../library/logging.rst:1483 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1482 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1454 +#: ../../library/logging.rst:1488 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1486 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/math.po b/library/math.po index e78bfbcb4c..69a14116af 100644 --- a/library/math.po +++ b/library/math.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,7 +75,7 @@ msgid "" "coefficient of k-th term in polynomial expansion of ``(1 + x)ⁿ``." msgstr "" -#: ../../library/math.rst:51 ../../library/math.rst:260 +#: ../../library/math.rst:51 ../../library/math.rst:258 msgid "" "Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" "exc:`ValueError` if either of the arguments are negative." @@ -136,10 +136,10 @@ msgstr "" #: ../../library/math.rst:110 msgid "" "Return an accurate floating point sum of values in the iterable. Avoids " -"loss of precision by tracking multiple intermediate partial sums::" +"loss of precision by tracking multiple intermediate partial sums." msgstr "" -#: ../../library/math.rst:118 +#: ../../library/math.rst:113 msgid "" "The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " "typical case where the rounding mode is half-even. On some non-Windows " @@ -148,14 +148,14 @@ msgid "" "least significant bit." msgstr "" -#: ../../library/math.rst:124 +#: ../../library/math.rst:119 msgid "" "For further discussion and two alternative approaches, see the `ASPN " "cookbook recipes for accurate floating point summation `_\\." msgstr "" -#: ../../library/math.rst:131 +#: ../../library/math.rst:126 msgid "" "Return the greatest common divisor of the specified integer arguments. If " "any of the arguments is nonzero, then the returned value is the largest " @@ -164,25 +164,25 @@ msgid "" "``0``." msgstr "" -#: ../../library/math.rst:139 +#: ../../library/math.rst:134 msgid "" "Added support for an arbitrary number of arguments. Formerly, only two " "arguments were supported." msgstr "" -#: ../../library/math.rst:146 +#: ../../library/math.rst:141 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "" -#: ../../library/math.rst:149 +#: ../../library/math.rst:144 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." msgstr "" -#: ../../library/math.rst:152 +#: ../../library/math.rst:147 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -191,19 +191,19 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" -#: ../../library/math.rst:158 +#: ../../library/math.rst:153 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." msgstr "" -#: ../../library/math.rst:161 +#: ../../library/math.rst:156 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." msgstr "" -#: ../../library/math.rst:164 +#: ../../library/math.rst:159 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -211,35 +211,35 @@ msgid "" "considered close to themselves." msgstr "" -#: ../../library/math.rst:173 +#: ../../library/math.rst:168 msgid ":pep:`485` -- A function for testing approximate equality" msgstr "" -#: ../../library/math.rst:178 +#: ../../library/math.rst:173 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" msgstr "" -#: ../../library/math.rst:186 +#: ../../library/math.rst:181 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." msgstr "" -#: ../../library/math.rst:192 +#: ../../library/math.rst:187 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -#: ../../library/math.rst:197 +#: ../../library/math.rst:192 msgid "" "Return the integer square root of the nonnegative integer *n*. This is the " "floor of the exact square root of *n*, or equivalently the greatest integer " "*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." msgstr "" -#: ../../library/math.rst:201 +#: ../../library/math.rst:196 msgid "" "For some applications, it may be more convenient to have the least integer " "*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " @@ -247,7 +247,7 @@ msgid "" "``a = 1 + isqrt(n - 1)``." msgstr "" -#: ../../library/math.rst:211 +#: ../../library/math.rst:206 msgid "" "Return the least common multiple of the specified integer arguments. If all " "arguments are nonzero, then the returned value is the smallest positive " @@ -256,82 +256,86 @@ msgid "" "``1``." msgstr "" -#: ../../library/math.rst:222 +#: ../../library/math.rst:217 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." msgstr "" -#: ../../library/math.rst:228 +#: ../../library/math.rst:223 msgid "" "Return the fractional and integer parts of *x*. Both results carry the sign " "of *x* and are floats." msgstr "" -#: ../../library/math.rst:234 -msgid "Return the next floating-point value after *x* towards *y*." +#: ../../library/math.rst:229 +msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: ../../library/math.rst:236 -msgid "If *x* is equal to *y*, return *y*." +#: ../../library/math.rst:231 +msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: ../../library/math.rst:238 +#: ../../library/math.rst:233 msgid "Examples:" msgstr "範例:" -#: ../../library/math.rst:240 +#: ../../library/math.rst:235 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: ../../library/math.rst:241 +#: ../../library/math.rst:236 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: ../../library/math.rst:242 +#: ../../library/math.rst:237 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: ../../library/math.rst:243 +#: ../../library/math.rst:238 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: ../../library/math.rst:245 +#: ../../library/math.rst:240 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" -#: ../../library/math.rst:251 +#: ../../library/math.rst:242 +msgid "Added the *steps* argument." +msgstr "" + +#: ../../library/math.rst:249 msgid "" "Return the number of ways to choose *k* items from *n* items without " "repetition and with order." msgstr "" -#: ../../library/math.rst:254 +#: ../../library/math.rst:252 msgid "" "Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " "``k > n``." msgstr "" -#: ../../library/math.rst:257 +#: ../../library/math.rst:255 msgid "" "If *k* is not specified or is None, then *k* defaults to *n* and the " "function returns ``n!``." msgstr "" -#: ../../library/math.rst:268 +#: ../../library/math.rst:266 msgid "" "Calculate the product of all the elements in the input *iterable*. The " "default *start* value for the product is ``1``." msgstr "" -#: ../../library/math.rst:271 +#: ../../library/math.rst:269 msgid "" "When the iterable is empty, return the start value. This function is " "intended specifically for use with numeric values and may reject non-numeric " "types." msgstr "" -#: ../../library/math.rst:280 +#: ../../library/math.rst:278 msgid "" "Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " "*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " @@ -341,7 +345,7 @@ msgid "" "thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -#: ../../library/math.rst:287 +#: ../../library/math.rst:285 msgid "" "Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " "*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " @@ -349,13 +353,31 @@ msgid "" "remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -#: ../../library/math.rst:293 +#: ../../library/math.rst:291 msgid "" "On platforms using IEEE 754 binary floating-point, the result of this " "operation is always exactly representable: no rounding error is introduced." msgstr "" +#: ../../library/math.rst:299 +msgid "Return the sum of products of values from two iterables *p* and *q*." +msgstr "" + #: ../../library/math.rst:301 +msgid "Raises :exc:`ValueError` if the inputs do not have the same length." +msgstr "" + +#: ../../library/math.rst:303 ../../library/math.rst:498 +msgid "Roughly equivalent to::" +msgstr "" + +#: ../../library/math.rst:307 +msgid "" +"For float and mixed int/float inputs, the intermediate products and sums are " +"computed with extended precision." +msgstr "" + +#: ../../library/math.rst:315 msgid "" "Return *x* with the fractional part removed, leaving the integer part. This " "rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " @@ -364,54 +386,54 @@ msgid "" "class:`~numbers.Integral` value." msgstr "" -#: ../../library/math.rst:309 +#: ../../library/math.rst:323 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: ../../library/math.rst:311 +#: ../../library/math.rst:325 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: ../../library/math.rst:312 +#: ../../library/math.rst:326 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "" -#: ../../library/math.rst:313 +#: ../../library/math.rst:327 msgid "If *x* is a positive infinity, return *x*." msgstr "" -#: ../../library/math.rst:314 +#: ../../library/math.rst:328 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" "data:`sys.float_info.min `)." msgstr "" -#: ../../library/math.rst:317 +#: ../../library/math.rst:331 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: ../../library/math.rst:320 +#: ../../library/math.rst:334 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: ../../library/math.rst:324 +#: ../../library/math.rst:338 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: ../../library/math.rst:326 +#: ../../library/math.rst:340 msgid "" "See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." msgstr "" -#: ../../library/math.rst:332 +#: ../../library/math.rst:346 msgid "" "Note that :func:`frexp` and :func:`modf` have a different call/return " "pattern than their C equivalents: they take a single argument and return a " @@ -419,7 +441,7 @@ msgid "" "'output parameter' (there is no such thing in Python)." msgstr "" -#: ../../library/math.rst:337 +#: ../../library/math.rst:351 msgid "" "For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " "*all* floating-point numbers of sufficiently large magnitude are exact " @@ -428,69 +450,69 @@ msgid "" "``abs(x) >= 2**52`` necessarily has no fractional bits." msgstr "" -#: ../../library/math.rst:345 +#: ../../library/math.rst:359 msgid "Power and logarithmic functions" msgstr "" -#: ../../library/math.rst:349 +#: ../../library/math.rst:363 msgid "Return the cube root of *x*." msgstr "" -#: ../../library/math.rst:356 +#: ../../library/math.rst:370 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: ../../library/math.rst:363 +#: ../../library/math.rst:377 msgid "Return *2* raised to the power *x*." msgstr "" -#: ../../library/math.rst:370 +#: ../../library/math.rst:384 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " "can result in a `significant loss of precision `_\\; the :func:`expm1` function provides a way to " -"compute this quantity to full precision::" +"compute this quantity to full precision:" msgstr "" -#: ../../library/math.rst:387 +#: ../../library/math.rst:401 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: ../../library/math.rst:389 +#: ../../library/math.rst:403 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: ../../library/math.rst:395 +#: ../../library/math.rst:409 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: ../../library/math.rst:401 +#: ../../library/math.rst:415 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: ../../library/math.rst:408 +#: ../../library/math.rst:422 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: ../../library/math.rst:414 +#: ../../library/math.rst:428 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: ../../library/math.rst:420 +#: ../../library/math.rst:434 msgid "" "Return ``x`` raised to the power ``y``. Exceptional cases follow the IEEE " "754 standard as far as possible. In particular, ``pow(1.0, x)`` and " @@ -499,47 +521,47 @@ msgid "" "integer then ``pow(x, y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: ../../library/math.rst:427 +#: ../../library/math.rst:441 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: ../../library/math.rst:431 +#: ../../library/math.rst:445 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: ../../library/math.rst:439 +#: ../../library/math.rst:453 msgid "Return the square root of *x*." msgstr "" -#: ../../library/math.rst:443 +#: ../../library/math.rst:457 msgid "Trigonometric functions" msgstr "" -#: ../../library/math.rst:447 +#: ../../library/math.rst:461 msgid "" "Return the arc cosine of *x*, in radians. The result is between ``0`` and " "``pi``." msgstr "" -#: ../../library/math.rst:453 +#: ../../library/math.rst:467 msgid "" "Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " "``pi/2``." msgstr "" -#: ../../library/math.rst:459 +#: ../../library/math.rst:473 msgid "" "Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " "and ``pi/2``." msgstr "" -#: ../../library/math.rst:465 +#: ../../library/math.rst:479 msgid "" "Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " "``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " @@ -549,121 +571,117 @@ msgid "" "``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." msgstr "" -#: ../../library/math.rst:475 +#: ../../library/math.rst:489 msgid "Return the cosine of *x* radians." msgstr "" -#: ../../library/math.rst:480 +#: ../../library/math.rst:494 msgid "" "Return the Euclidean distance between two points *p* and *q*, each given as " "a sequence (or iterable) of coordinates. The two points must have the same " "dimension." msgstr "" -#: ../../library/math.rst:484 -msgid "Roughly equivalent to::" -msgstr "" - -#: ../../library/math.rst:493 +#: ../../library/math.rst:507 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: ../../library/math.rst:497 +#: ../../library/math.rst:511 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: ../../library/math.rst:501 +#: ../../library/math.rst:515 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: ../../library/math.rst:505 +#: ../../library/math.rst:519 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: ../../library/math.rst:513 +#: ../../library/math.rst:527 msgid "Return the sine of *x* radians." msgstr "" -#: ../../library/math.rst:518 +#: ../../library/math.rst:532 msgid "Return the tangent of *x* radians." msgstr "" -#: ../../library/math.rst:522 +#: ../../library/math.rst:536 msgid "Angular conversion" msgstr "" -#: ../../library/math.rst:526 +#: ../../library/math.rst:540 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: ../../library/math.rst:531 +#: ../../library/math.rst:545 msgid "Convert angle *x* from degrees to radians." msgstr "" -#: ../../library/math.rst:535 +#: ../../library/math.rst:549 msgid "Hyperbolic functions" msgstr "" -#: ../../library/math.rst:537 +#: ../../library/math.rst:551 msgid "" -"`Hyperbolic functions `_ " +"`Hyperbolic functions `_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: ../../library/math.rst:543 +#: ../../library/math.rst:557 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:548 +#: ../../library/math.rst:562 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:553 +#: ../../library/math.rst:567 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:558 +#: ../../library/math.rst:572 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:563 +#: ../../library/math.rst:577 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:568 +#: ../../library/math.rst:582 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:572 +#: ../../library/math.rst:586 msgid "Special functions" msgstr "" -#: ../../library/math.rst:576 +#: ../../library/math.rst:590 msgid "" "Return the `error function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:579 +#: ../../library/math.rst:593 msgid "" "The :func:`erf` function can be used to compute traditional statistical " "functions such as the `cumulative standard normal distribution `_::" msgstr "" -#: ../../library/math.rst:592 +#: ../../library/math.rst:606 msgid "" "Return the complementary error function at *x*. The `complementary error " "function `_ is defined as " @@ -672,31 +690,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: ../../library/math.rst:603 +#: ../../library/math.rst:617 msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:611 +#: ../../library/math.rst:625 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: ../../library/math.rst:618 +#: ../../library/math.rst:632 msgid "Constants" msgstr "常數" -#: ../../library/math.rst:622 +#: ../../library/math.rst:636 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: ../../library/math.rst:627 +#: ../../library/math.rst:641 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: ../../library/math.rst:632 +#: ../../library/math.rst:646 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -705,27 +723,27 @@ msgid "" "celebrating `Tau day `_ by eating twice as much pie!" msgstr "" -#: ../../library/math.rst:643 +#: ../../library/math.rst:657 msgid "" "A floating-point positive infinity. (For negative infinity, use ``-math." "inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: ../../library/math.rst:651 +#: ../../library/math.rst:665 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard `_, ``math.nan`` and ``float('nan')`` are not " "considered to equal to any other numeric value, including themselves. To " "check whether a number is a NaN, use the :func:`isnan` function to test for " -"NaNs instead of ``is`` or ``==``. Example::" +"NaNs instead of ``is`` or ``==``. Example:" msgstr "" -#: ../../library/math.rst:669 +#: ../../library/math.rst:683 msgid "It is now always available." msgstr "" -#: ../../library/math.rst:677 +#: ../../library/math.rst:691 msgid "" "The :mod:`math` module consists mostly of thin wrappers around the platform " "C math library functions. Behavior in exceptional cases follows Annex F of " @@ -740,17 +758,17 @@ msgid "" "``hypot(float('nan'), float('inf'))``." msgstr "" -#: ../../library/math.rst:689 +#: ../../library/math.rst:703 msgid "" "Note that Python makes no effort to distinguish signaling NaNs from quiet " "NaNs, and behavior for signaling NaNs remains unspecified. Typical behavior " "is to treat all NaNs as though they were quiet." msgstr "" -#: ../../library/math.rst:696 +#: ../../library/math.rst:710 msgid "Module :mod:`cmath`" msgstr ":mod:`cmath` 模組" -#: ../../library/math.rst:697 +#: ../../library/math.rst:711 msgid "Complex number versions of many of these functions." msgstr "" diff --git a/library/mmap.po b/library/mmap.po index 20b5cd1968..179cd060fe 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -124,7 +124,8 @@ msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." msgstr "" -"引發一個附帶引數 ``fileno``、``length``、``access``、``offset`` 的\\ :ref:`稽核事件 ` ``mmap.__new__``。" +"引發一個附帶引數 ``fileno``、``length``、``access``、``offset`` 的\\ :ref:`稽" +"核事件 ` ``mmap.__new__``。" #: ../../library/mmap.rst:77 msgid "" @@ -378,16 +379,25 @@ msgstr "" msgid "MAP_* Constants" msgstr "" -#: ../../library/mmap.rst:374 +#: ../../library/mmap.rst:376 msgid "" -"These are the various flags that can be passed to :meth:`mmap.mmap`. Note " -"that some options might not be present on some systems." +"These are the various flags that can be passed to :meth:`mmap.mmap`. :data:" +"`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is " +"only available at OpenBSD. Note that some options might not be present on " +"some systems." msgstr "" -#: ../../library/mmap.rst:376 -msgid "Added MAP_POPULATE constant." +#: ../../library/mmap.rst:380 +#, fuzzy +msgid "Added :data:`MAP_POPULATE` constant." msgstr "新增 MAP_POPULATE 常數。" -#: ../../library/mmap.rst:379 -msgid "Added MAP_STACK constant." +#: ../../library/mmap.rst:383 +#, fuzzy +msgid "Added :data:`MAP_STACK` constant." msgstr "新增 MAP_STACK 常數。" + +#: ../../library/mmap.rst:386 +msgid "" +"Added :data:`MAP_ALIGNED_SUPER` constant. Added :data:`MAP_CONCEAL` constant." +msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 7d9911eddf..fc7a36f63d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-23 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,7 +49,7 @@ msgid "" "the :term:`Global Interpreter Lock ` by using " "subprocesses instead of threads. Due to this, the :mod:`multiprocessing` " "module allows the programmer to fully leverage multiple processors on a " -"given machine. It runs on both Unix and Windows." +"given machine. It runs on both POSIX and Windows." msgstr "" #: ../../library/multiprocessing.rst:25 @@ -102,7 +102,7 @@ msgid "" "necessary, see :ref:`multiprocessing-programming`." msgstr "" -#: ../../library/multiprocessing.rst:103 +#: ../../library/multiprocessing.rst:105 msgid "Contexts and start methods" msgstr "" @@ -127,10 +127,11 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:118 -msgid "Available on Unix and Windows. The default on Windows and macOS." +msgid "" +"Available on POSIX and Windows platforms. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:127 +#: ../../library/multiprocessing.rst:132 msgid "*fork*" msgstr "" @@ -143,45 +144,54 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:127 -msgid "Available on Unix only. The default on Unix." +msgid "" +"Available on POSIX systems. Currently the default on POSIX except macOS." +msgstr "" + +#: ../../library/multiprocessing.rst:130 +msgid "" +"The default start method will change away from *fork* in Python 3.14. Code " +"that requires *fork* should explicitly specify that via :func:`get_context` " +"or :func:`set_start_method`." msgstr "" -#: ../../library/multiprocessing.rst:138 +#: ../../library/multiprocessing.rst:145 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:130 +#: ../../library/multiprocessing.rst:135 msgid "" "When the program starts and selects the *forkserver* start method, a server " -"process is started. From then on, whenever a new process is needed, the " +"process is spawned. From then on, whenever a new process is needed, the " "parent process connects to the server and requests that it fork a new " -"process. The fork server process is single threaded so it is safe for it to " -"use :func:`os.fork`. No unnecessary resources are inherited." +"process. The fork server process is single threaded unless system libraries " +"or preloaded imports spawn threads as a side-effect so it is generally safe " +"for it to use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:137 +#: ../../library/multiprocessing.rst:143 msgid "" -"Available on Unix platforms which support passing file descriptors over Unix " -"pipes." +"Available on POSIX platforms which support passing file descriptors over " +"Unix pipes such as Linux." msgstr "" -#: ../../library/multiprocessing.rst:142 ../../library/multiprocessing.rst:1070 +#: ../../library/multiprocessing.rst:149 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " -"subprocess. See :issue:`33725`." +"subprocess as macOS system libraries may start threads. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:146 +#: ../../library/multiprocessing.rst:153 msgid "" -"*spawn* added on all Unix platforms, and *forkserver* added for some Unix " +"*spawn* added on all POSIX platforms, and *forkserver* added for some POSIX " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:152 +#: ../../library/multiprocessing.rst:159 msgid "" -"On Unix using the *spawn* or *forkserver* start methods will also start a " +"On POSIX using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " "(such as named semaphores or :class:`~multiprocessing.shared_memory." "SharedMemory` objects) created by processes of the program. When all " @@ -194,25 +204,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:165 +#: ../../library/multiprocessing.rst:172 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:182 +#: ../../library/multiprocessing.rst:189 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:185 +#: ../../library/multiprocessing.rst:192 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:203 +#: ../../library/multiprocessing.rst:210 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -220,55 +230,55 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:208 +#: ../../library/multiprocessing.rst:215 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:214 +#: ../../library/multiprocessing.rst:221 msgid "" -"The ``'spawn'`` and ``'forkserver'`` start methods cannot currently be used " +"The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used " "with \"frozen\" executables (i.e., binaries produced by packages like " -"**PyInstaller** and **cx_Freeze**) on Unix. The ``'fork'`` start method does " -"work." +"**PyInstaller** and **cx_Freeze**) on POSIX systems. The ``'fork'`` start " +"method may work if code does not use threads." msgstr "" -#: ../../library/multiprocessing.rst:221 +#: ../../library/multiprocessing.rst:228 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:223 +#: ../../library/multiprocessing.rst:230 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:226 +#: ../../library/multiprocessing.rst:233 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:228 +#: ../../library/multiprocessing.rst:235 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:243 +#: ../../library/multiprocessing.rst:250 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:245 +#: ../../library/multiprocessing.rst:252 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:247 +#: ../../library/multiprocessing.rst:254 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:263 +#: ../../library/multiprocessing.rst:270 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -278,55 +288,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:273 +#: ../../library/multiprocessing.rst:280 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:275 +#: ../../library/multiprocessing.rst:282 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:294 +#: ../../library/multiprocessing.rst:301 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:299 +#: ../../library/multiprocessing.rst:306 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:301 +#: ../../library/multiprocessing.rst:308 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:305 +#: ../../library/multiprocessing.rst:312 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:308 +#: ../../library/multiprocessing.rst:315 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:310 +#: ../../library/multiprocessing.rst:317 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:331 ../../library/multiprocessing.rst:377 +#: ../../library/multiprocessing.rst:338 ../../library/multiprocessing.rst:384 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:336 +#: ../../library/multiprocessing.rst:343 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -334,25 +344,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:341 +#: ../../library/multiprocessing.rst:348 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:345 +#: ../../library/multiprocessing.rst:352 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:347 +#: ../../library/multiprocessing.rst:354 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:351 +#: ../../library/multiprocessing.rst:358 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -361,7 +371,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:382 +#: ../../library/multiprocessing.rst:389 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -369,31 +379,31 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:389 +#: ../../library/multiprocessing.rst:396 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:391 +#: ../../library/multiprocessing.rst:398 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:395 +#: ../../library/multiprocessing.rst:402 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/multiprocessing.rst:439 +#: ../../library/multiprocessing.rst:446 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:444 +#: ../../library/multiprocessing.rst:451 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -402,35 +412,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:467 +#: ../../library/multiprocessing.rst:474 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:473 +#: ../../library/multiprocessing.rst:480 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:475 +#: ../../library/multiprocessing.rst:482 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:487 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:485 +#: ../../library/multiprocessing.rst:492 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:489 +#: ../../library/multiprocessing.rst:496 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -444,29 +454,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:500 +#: ../../library/multiprocessing.rst:507 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:504 +#: ../../library/multiprocessing.rst:511 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:508 +#: ../../library/multiprocessing.rst:515 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:513 +#: ../../library/multiprocessing.rst:520 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:522 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -474,30 +484,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:527 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:523 +#: ../../library/multiprocessing.rst:530 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:535 +#: ../../library/multiprocessing.rst:542 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:537 +#: ../../library/multiprocessing.rst:544 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:549 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -507,23 +517,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:556 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:551 +#: ../../library/multiprocessing.rst:558 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:563 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:560 +#: ../../library/multiprocessing.rst:567 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -531,33 +541,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:574 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:569 +#: ../../library/multiprocessing.rst:576 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:581 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:577 +#: ../../library/multiprocessing.rst:584 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:579 +#: ../../library/multiprocessing.rst:586 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:582 +#: ../../library/multiprocessing.rst:589 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -566,92 +576,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:588 +#: ../../library/multiprocessing.rst:595 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:593 +#: ../../library/multiprocessing.rst:600 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:598 +#: ../../library/multiprocessing.rst:605 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:601 +#: ../../library/multiprocessing.rst:608 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:612 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:611 +#: ../../library/multiprocessing.rst:618 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:613 +#: ../../library/multiprocessing.rst:620 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:616 +#: ../../library/multiprocessing.rst:623 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:627 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:624 +#: ../../library/multiprocessing.rst:631 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:634 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:638 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " -"``WaitForMultipleObjects`` family of API calls. On Unix, this is a file " +"``WaitForMultipleObjects`` family of API calls. On POSIX, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:639 +#: ../../library/multiprocessing.rst:646 msgid "" -"Terminate the process. On Unix this is done using the ``SIGTERM`` signal; " +"Terminate the process. On POSIX this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:643 +#: ../../library/multiprocessing.rst:650 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:648 +#: ../../library/multiprocessing.rst:655 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -660,11 +670,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:656 -msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on Unix." +#: ../../library/multiprocessing.rst:663 +msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on POSIX." msgstr "" -#: ../../library/multiprocessing.rst:662 +#: ../../library/multiprocessing.rst:669 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -672,59 +682,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:670 +#: ../../library/multiprocessing.rst:677 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:674 +#: ../../library/multiprocessing.rst:681 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:694 +#: ../../library/multiprocessing.rst:702 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:698 +#: ../../library/multiprocessing.rst:706 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:701 +#: ../../library/multiprocessing.rst:709 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:714 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:710 +#: ../../library/multiprocessing.rst:718 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:721 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:715 +#: ../../library/multiprocessing.rst:723 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:719 +#: ../../library/multiprocessing.rst:727 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:722 +#: ../../library/multiprocessing.rst:730 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -734,7 +744,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:729 +#: ../../library/multiprocessing.rst:737 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -742,20 +752,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:734 +#: ../../library/multiprocessing.rst:742 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:739 +#: ../../library/multiprocessing.rst:747 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:746 +#: ../../library/multiprocessing.rst:754 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -764,14 +774,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:753 +#: ../../library/multiprocessing.rst:761 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:758 +#: ../../library/multiprocessing.rst:766 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -779,7 +789,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:765 +#: ../../library/multiprocessing.rst:773 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -787,7 +797,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:772 +#: ../../library/multiprocessing.rst:780 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1131 +#: ../../library/multiprocessing.rst:1155 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1158 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1139 +#: ../../library/multiprocessing.rst:1163 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1146 +#: ../../library/multiprocessing.rst:1170 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1150 +#: ../../library/multiprocessing.rst:1174 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1152 +#: ../../library/multiprocessing.rst:1176 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1156 +#: ../../library/multiprocessing.rst:1180 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1182 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1162 +#: ../../library/multiprocessing.rst:1186 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1167 +#: ../../library/multiprocessing.rst:1191 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1193 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1273,7 +1315,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1200 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1281,19 +1323,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1181 +#: ../../library/multiprocessing.rst:1205 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1185 +#: ../../library/multiprocessing.rst:1209 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1192 +#: ../../library/multiprocessing.rst:1216 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1301,45 +1343,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1198 +#: ../../library/multiprocessing.rst:1222 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1203 +#: ../../library/multiprocessing.rst:1227 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1207 +#: ../../library/multiprocessing.rst:1231 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1211 +#: ../../library/multiprocessing.rst:1235 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1240 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1241 +#: ../../library/multiprocessing.rst:1265 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1245 +#: ../../library/multiprocessing.rst:1269 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1347,73 +1389,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1252 +#: ../../library/multiprocessing.rst:1276 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1258 +#: ../../library/multiprocessing.rst:1282 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1262 +#: ../../library/multiprocessing.rst:1286 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1266 +#: ../../library/multiprocessing.rst:1290 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1271 +#: ../../library/multiprocessing.rst:1295 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1277 +#: ../../library/multiprocessing.rst:1301 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1280 -#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1304 +#: ../../library/multiprocessing.rst:1442 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1284 +#: ../../library/multiprocessing.rst:1308 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1289 +#: ../../library/multiprocessing.rst:1313 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1291 +#: ../../library/multiprocessing.rst:1315 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1294 -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1318 +#: ../../library/multiprocessing.rst:1867 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1299 +#: ../../library/multiprocessing.rst:1323 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1304 +#: ../../library/multiprocessing.rst:1328 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1424,25 +1466,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1312 +#: ../../library/multiprocessing.rst:1336 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1316 +#: ../../library/multiprocessing.rst:1340 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1321 -#: ../../library/multiprocessing.rst:1372 +#: ../../library/multiprocessing.rst:1345 +#: ../../library/multiprocessing.rst:1396 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1347 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1450,14 +1492,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1352 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1332 +#: ../../library/multiprocessing.rst:1356 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1471,19 +1513,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1371 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1350 +#: ../../library/multiprocessing.rst:1374 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1356 +#: ../../library/multiprocessing.rst:1380 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1492,20 +1534,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1362 +#: ../../library/multiprocessing.rst:1386 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1366 +#: ../../library/multiprocessing.rst:1390 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1398 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1518,7 +1560,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1384 +#: ../../library/multiprocessing.rst:1408 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1529,14 +1571,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1392 +#: ../../library/multiprocessing.rst:1416 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1399 +#: ../../library/multiprocessing.rst:1423 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1546,7 +1588,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1407 +#: ../../library/multiprocessing.rst:1431 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1555,17 +1597,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1440 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1447 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1428 +#: ../../library/multiprocessing.rst:1452 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1574,13 +1616,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1434 +#: ../../library/multiprocessing.rst:1458 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1439 +#: ../../library/multiprocessing.rst:1463 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1589,32 +1631,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1471 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1449 +#: ../../library/multiprocessing.rst:1473 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1454 +#: ../../library/multiprocessing.rst:1478 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1458 -#: ../../library/multiprocessing.rst:1545 +#: ../../library/multiprocessing.rst:1482 +#: ../../library/multiprocessing.rst:1569 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1462 +#: ../../library/multiprocessing.rst:1486 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1624,32 +1666,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1469 +#: ../../library/multiprocessing.rst:1493 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1475 +#: ../../library/multiprocessing.rst:1499 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1481 -#: ../../library/multiprocessing.rst:1571 -#: ../../library/multiprocessing.rst:1586 +#: ../../library/multiprocessing.rst:1505 +#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1610 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1485 +#: ../../library/multiprocessing.rst:1509 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1488 +#: ../../library/multiprocessing.rst:1512 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1659,7 +1701,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1495 +#: ../../library/multiprocessing.rst:1519 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1669,28 +1711,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1526 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1504 +#: ../../library/multiprocessing.rst:1528 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1509 +#: ../../library/multiprocessing.rst:1533 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1514 +#: ../../library/multiprocessing.rst:1538 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1520 +#: ../../library/multiprocessing.rst:1544 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1699,11 +1741,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1552 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1554 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1713,40 +1755,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1537 +#: ../../library/multiprocessing.rst:1561 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1543 +#: ../../library/multiprocessing.rst:1567 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1549 +#: ../../library/multiprocessing.rst:1573 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1553 +#: ../../library/multiprocessing.rst:1577 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1559 +#: ../../library/multiprocessing.rst:1583 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1563 -#: ../../library/multiprocessing.rst:1579 +#: ../../library/multiprocessing.rst:1587 +#: ../../library/multiprocessing.rst:1603 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1756,121 +1798,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1575 +#: ../../library/multiprocessing.rst:1599 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1590 +#: ../../library/multiprocessing.rst:1614 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1619 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1623 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1603 +#: ../../library/multiprocessing.rst:1627 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1606 +#: ../../library/multiprocessing.rst:1630 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1634 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1639 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1639 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1639 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1641 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1641 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1617 +#: ../../library/multiprocessing.rst:1641 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1642 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1618 +#: ../../library/multiprocessing.rst:1642 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1643 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1643 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1643 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1644 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1644 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1620 +#: ../../library/multiprocessing.rst:1644 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1624 +#: ../../library/multiprocessing.rst:1648 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1662 +#: ../../library/multiprocessing.rst:1686 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1675 +#: ../../library/multiprocessing.rst:1699 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1701 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1879,7 +1921,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1710 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1887,31 +1929,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1694 +#: ../../library/multiprocessing.rst:1718 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:1700 +#: ../../library/multiprocessing.rst:1724 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1726 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:1705 +#: ../../library/multiprocessing.rst:1729 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:1708 +#: ../../library/multiprocessing.rst:1732 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`` " @@ -1919,19 +1961,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1713 +#: ../../library/multiprocessing.rst:1737 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1740 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1719 +#: ../../library/multiprocessing.rst:1743 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1939,54 +1981,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1748 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1729 +#: ../../library/multiprocessing.rst:1753 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:1734 +#: ../../library/multiprocessing.rst:1758 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:1743 +#: ../../library/multiprocessing.rst:1767 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1747 +#: ../../library/multiprocessing.rst:1771 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1755 +#: ../../library/multiprocessing.rst:1779 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:1758 +#: ../../library/multiprocessing.rst:1782 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1762 +#: ../../library/multiprocessing.rst:1786 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1765 +#: ../../library/multiprocessing.rst:1789 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:1768 +#: ../../library/multiprocessing.rst:1792 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1994,14 +2036,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1774 +#: ../../library/multiprocessing.rst:1798 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:1778 +#: ../../library/multiprocessing.rst:1802 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2012,7 +2054,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1787 +#: ../../library/multiprocessing.rst:1811 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 " @@ -2022,22 +2064,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1818 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:1798 +#: ../../library/multiprocessing.rst:1822 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1826 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1804 +#: ../../library/multiprocessing.rst:1828 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2045,173 +2087,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1810 +#: ../../library/multiprocessing.rst:1834 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:1815 +#: ../../library/multiprocessing.rst:1839 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:1819 +#: ../../library/multiprocessing.rst:1843 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:1825 +#: ../../library/multiprocessing.rst:1849 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1832 +#: ../../library/multiprocessing.rst:1856 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1861 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1840 +#: ../../library/multiprocessing.rst:1864 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:1848 +#: ../../library/multiprocessing.rst:1872 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1876 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1880 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1860 +#: ../../library/multiprocessing.rst:1884 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1888 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1868 +#: ../../library/multiprocessing.rst:1892 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1873 +#: ../../library/multiprocessing.rst:1897 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1877 +#: ../../library/multiprocessing.rst:1901 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1908 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1889 +#: ../../library/multiprocessing.rst:1913 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1891 +#: ../../library/multiprocessing.rst:1915 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:1898 +#: ../../library/multiprocessing.rst:1922 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1900 +#: ../../library/multiprocessing.rst:1924 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:1903 +#: ../../library/multiprocessing.rst:1927 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:1919 +#: ../../library/multiprocessing.rst:1944 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1946 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:1946 +#: ../../library/multiprocessing.rst:1971 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1948 +#: ../../library/multiprocessing.rst:1973 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:1951 +#: ../../library/multiprocessing.rst:1976 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1988 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1998 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1984 +#: ../../library/multiprocessing.rst:2009 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2034 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2011 +#: ../../library/multiprocessing.rst:2036 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:2015 +#: ../../library/multiprocessing.rst:2040 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2219,14 +2261,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2033 +#: ../../library/multiprocessing.rst:2058 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:2037 +#: ../../library/multiprocessing.rst:2062 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:" @@ -2234,11 +2276,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2053 +#: ../../library/multiprocessing.rst:2078 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2091 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 " @@ -2249,53 +2291,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2085 +#: ../../library/multiprocessing.rst:2110 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:2091 +#: ../../library/multiprocessing.rst:2116 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2124 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2103 +#: ../../library/multiprocessing.rst:2128 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2107 +#: ../../library/multiprocessing.rst:2132 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2134 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2113 +#: ../../library/multiprocessing.rst:2138 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2142 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2119 +#: ../../library/multiprocessing.rst:2144 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:2123 +#: ../../library/multiprocessing.rst:2148 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 " @@ -2303,79 +2345,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2153 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2131 +#: ../../library/multiprocessing.rst:2156 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2147 +#: ../../library/multiprocessing.rst:2172 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2174 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2178 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2157 +#: ../../library/multiprocessing.rst:2182 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2186 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2163 +#: ../../library/multiprocessing.rst:2188 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:2166 +#: ../../library/multiprocessing.rst:2191 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2196 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2201 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:2181 +#: ../../library/multiprocessing.rst:2206 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:2185 +#: ../../library/multiprocessing.rst:2210 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:2188 -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2213 +#: ../../library/multiprocessing.rst:2774 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2191 +#: ../../library/multiprocessing.rst:2216 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 " @@ -2383,7 +2425,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2221 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2391,13 +2433,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2202 +#: ../../library/multiprocessing.rst:2227 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2231 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 " @@ -2405,22 +2447,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2211 +#: ../../library/multiprocessing.rst:2236 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:2215 +#: ../../library/multiprocessing.rst:2240 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2218 +#: ../../library/multiprocessing.rst:2243 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2223 +#: ../../library/multiprocessing.rst:2248 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 " @@ -2431,7 +2473,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2233 +#: ../../library/multiprocessing.rst:2258 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 " @@ -2439,14 +2481,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2265 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2243 -#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2268 +#: ../../library/multiprocessing.rst:2299 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, " @@ -2454,60 +2496,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2248 -#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2273 +#: ../../library/multiprocessing.rst:2304 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:2252 -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2277 +#: ../../library/multiprocessing.rst:2308 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2257 +#: ../../library/multiprocessing.rst:2282 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:2261 +#: ../../library/multiprocessing.rst:2286 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:2265 +#: ../../library/multiprocessing.rst:2290 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:2271 +#: ../../library/multiprocessing.rst:2296 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2288 +#: ../../library/multiprocessing.rst:2313 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2315 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:2295 +#: ../../library/multiprocessing.rst:2320 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: " @@ -2515,65 +2557,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2327 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:2308 +#: ../../library/multiprocessing.rst:2333 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:2312 +#: ../../library/multiprocessing.rst:2337 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2319 +#: ../../library/multiprocessing.rst:2344 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:2327 +#: ../../library/multiprocessing.rst:2352 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:2332 +#: ../../library/multiprocessing.rst:2357 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:2338 +#: ../../library/multiprocessing.rst:2363 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2341 +#: ../../library/multiprocessing.rst:2366 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:2349 +#: ../../library/multiprocessing.rst:2374 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2354 +#: ../../library/multiprocessing.rst:2379 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2581,41 +2623,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2386 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2365 +#: ../../library/multiprocessing.rst:2390 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2369 +#: ../../library/multiprocessing.rst:2394 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2372 +#: ../../library/multiprocessing.rst:2397 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2376 +#: ../../library/multiprocessing.rst:2401 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2403 +#: ../../library/multiprocessing.rst:2428 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2408 +#: ../../library/multiprocessing.rst:2433 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:2412 +#: ../../library/multiprocessing.rst:2437 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2624,46 +2666,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2446 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2424 +#: ../../library/multiprocessing.rst:2449 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:2430 +#: ../../library/multiprocessing.rst:2455 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:2433 +#: ../../library/multiprocessing.rst:2458 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2438 +#: ../../library/multiprocessing.rst:2463 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2441 +#: ../../library/multiprocessing.rst:2466 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:2445 -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2470 +#: ../../library/multiprocessing.rst:2505 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 " @@ -2672,26 +2714,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2453 +#: ../../library/multiprocessing.rst:2478 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2456 +#: ../../library/multiprocessing.rst:2481 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2461 +#: ../../library/multiprocessing.rst:2486 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:2465 +#: ../../library/multiprocessing.rst:2490 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 " @@ -2705,49 +2747,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2501 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:2488 +#: ../../library/multiprocessing.rst:2513 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:2495 +#: ../../library/multiprocessing.rst:2520 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:2499 +#: ../../library/multiprocessing.rst:2524 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2528 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2532 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2535 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:2517 +#: ../../library/multiprocessing.rst:2542 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 " @@ -2756,40 +2798,40 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2523 +#: ../../library/multiprocessing.rst:2548 msgid "" -"For both Unix and Windows, an object can appear in *object_list* if it is" +"For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2551 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2527 +#: ../../library/multiprocessing.rst:2552 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2553 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2531 +#: ../../library/multiprocessing.rst:2556 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:2534 +#: ../../library/multiprocessing.rst:2559 msgid "" -"**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." +"**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" "`select.select` is interrupted by a signal, it can raise :exc:`OSError` with " "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2540 +#: ../../library/multiprocessing.rst:2565 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 " @@ -2798,46 +2840,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2550 +#: ../../library/multiprocessing.rst:2575 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2577 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:2571 +#: ../../library/multiprocessing.rst:2596 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2588 +#: ../../library/multiprocessing.rst:2613 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2627 +#: ../../library/multiprocessing.rst:2652 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2629 +#: ../../library/multiprocessing.rst:2654 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:2632 +#: ../../library/multiprocessing.rst:2657 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2635 +#: ../../library/multiprocessing.rst:2660 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2846,17 +2888,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2640 +#: ../../library/multiprocessing.rst:2665 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:2647 +#: ../../library/multiprocessing.rst:2672 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2649 +#: ../../library/multiprocessing.rst:2674 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2864,7 +2906,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2655 +#: ../../library/multiprocessing.rst:2680 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 " @@ -2872,7 +2914,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2661 +#: ../../library/multiprocessing.rst:2686 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2883,17 +2925,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2694 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2673 +#: ../../library/multiprocessing.rst:2698 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2700 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2901,27 +2943,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2707 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2685 +#: ../../library/multiprocessing.rst:2710 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:2689 +#: ../../library/multiprocessing.rst:2714 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:2696 +#: ../../library/multiprocessing.rst:2721 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 " @@ -2930,25 +2972,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2702 +#: ../../library/multiprocessing.rst:2727 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2717 +#: ../../library/multiprocessing.rst:2742 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2721 +#: ../../library/multiprocessing.rst:2746 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2726 +#: ../../library/multiprocessing.rst:2751 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:2731 +#: ../../library/multiprocessing.rst:2756 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2956,7 +2998,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2764 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2966,18 +3008,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2771 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:2752 +#: ../../library/multiprocessing.rst:2777 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2781 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 :" @@ -2987,7 +3029,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2763 +#: ../../library/multiprocessing.rst:2788 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2996,84 +3038,84 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2773 +#: ../../library/multiprocessing.rst:2798 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2775 +#: ../../library/multiprocessing.rst:2800 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2805 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2782 +#: ../../library/multiprocessing.rst:2807 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2784 +#: ../../library/multiprocessing.rst:2809 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2811 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2789 +#: ../../library/multiprocessing.rst:2814 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:2793 +#: ../../library/multiprocessing.rst:2818 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2820 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2797 +#: ../../library/multiprocessing.rst:2822 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2824 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2802 +#: ../../library/multiprocessing.rst:2827 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2804 +#: ../../library/multiprocessing.rst:2829 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2806 +#: ../../library/multiprocessing.rst:2831 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 :" -"func:`~multiprocessing.active_children` is called) all completed processes " -"which have not yet been joined will be joined. Also calling a finished " -"process's :meth:`Process.is_alive ` will " -"join the process. Even so it is probably good practice to explicitly join " -"all the processes that you start." +"On POSIX 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 :func:`~multiprocessing.active_children` is called) all completed " +"processes which have not yet been joined will be joined. Also calling a " +"finished process's :meth:`Process.is_alive ` will join the process. Even so it is probably good practice to " +"explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2839 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2816 +#: ../../library/multiprocessing.rst:2841 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3083,11 +3125,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2849 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2826 +#: ../../library/multiprocessing.rst:2851 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3095,18 +3137,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2832 +#: ../../library/multiprocessing.rst:2857 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:2836 +#: ../../library/multiprocessing.rst:2861 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2838 +#: ../../library/multiprocessing.rst:2863 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 " @@ -3115,7 +3157,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2844 +#: ../../library/multiprocessing.rst:2869 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 " @@ -3124,29 +3166,29 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2850 +#: ../../library/multiprocessing.rst:2875 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2889 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2892 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2894 msgid "" -"On Unix using the *fork* start method, a child process can make use of a " +"On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " "However, it is better to pass the object as an argument to the constructor " "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2874 +#: ../../library/multiprocessing.rst:2899 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 " @@ -3155,29 +3197,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2881 +#: ../../library/multiprocessing.rst:2906 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2893 +#: ../../library/multiprocessing.rst:2918 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2905 +#: ../../library/multiprocessing.rst:2930 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2932 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2911 +#: ../../library/multiprocessing.rst:2936 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:2917 +#: ../../library/multiprocessing.rst:2942 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3187,33 +3229,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2949 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:2936 +#: ../../library/multiprocessing.rst:2961 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2964 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2941 +#: ../../library/multiprocessing.rst:2966 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2969 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2946 +#: ../../library/multiprocessing.rst:2971 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3221,11 +3263,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2951 +#: ../../library/multiprocessing.rst:2976 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2953 +#: ../../library/multiprocessing.rst:2978 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 " @@ -3233,66 +3275,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2958 +#: ../../library/multiprocessing.rst:2983 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2963 +#: ../../library/multiprocessing.rst:2988 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2965 +#: ../../library/multiprocessing.rst:2990 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:2969 +#: ../../library/multiprocessing.rst:2994 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:3006 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2995 +#: ../../library/multiprocessing.rst:3020 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2998 +#: ../../library/multiprocessing.rst:3023 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:3001 +#: ../../library/multiprocessing.rst:3026 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3008 +#: ../../library/multiprocessing.rst:3033 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3035 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3016 +#: ../../library/multiprocessing.rst:3041 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3022 +#: ../../library/multiprocessing.rst:3047 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/nntplib.po b/library/nntplib.po index b7b678c2b1..0e42f395d3 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "**原始碼:**\\ :source:`Lib/nntplib.py`" msgid "The :mod:`nntplib` module is deprecated (see :pep:`594` for details)." msgstr ":mod:`nntlib` 模組 (module) 即將被棄用(詳見 :pep:`594`\\ )。" -#: ../../library/nntplib.rst:19 +#: ../../library/nntplib.rst:36 msgid "" "This module defines the class :class:`NNTP` which implements the client side " "of the Network News Transfer Protocol. It can be used to implement a news " @@ -49,23 +49,23 @@ msgid "" "more information." msgstr "" -#: ../../library/nntplib.rst:26 +#: ../../library/nntplib.rst:43 msgid "" "Here are two small examples of how it can be used. To list some statistics " "about a newsgroup and print the subjects of the last 10 articles::" msgstr "" -#: ../../library/nntplib.rst:50 +#: ../../library/nntplib.rst:67 msgid "" "To post an article from a binary file (this assumes that the article has " "valid headers, and that you have right to post on the particular newsgroup)::" msgstr "" -#: ../../library/nntplib.rst:60 +#: ../../library/nntplib.rst:77 msgid "The module itself defines the following classes:" msgstr "" -#: ../../library/nntplib.rst:65 +#: ../../library/nntplib.rst:82 msgid "" "Return a new :class:`NNTP` object, representing a connection to the NNTP " "server running on host *host*, listening at port *port*. An optional " @@ -83,7 +83,7 @@ msgid "" "close the NNTP connection when done, e.g.:" msgstr "" -#: ../../library/nntplib.rst:99 ../../library/nntplib.rst:131 +#: ../../library/nntplib.rst:116 ../../library/nntplib.rst:148 msgid "" "Raises an :ref:`auditing event ` ``nntplib.connect`` with " "arguments ``self``, ``host``, ``port``." @@ -91,7 +91,7 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``nntplib.connect``。" -#: ../../library/nntplib.rst:101 ../../library/nntplib.rst:133 +#: ../../library/nntplib.rst:118 ../../library/nntplib.rst:150 msgid "" "Raises an :ref:`auditing event ` ``nntplib.putline`` with " "arguments ``self``, ``line``." @@ -99,28 +99,28 @@ msgstr "" "引發一個附帶引數 ``self``、``line`` 的\\ :ref:`稽核事件 ` " "``nntplib.putline``。" -#: ../../library/nntplib.rst:92 ../../library/nntplib.rst:124 +#: ../../library/nntplib.rst:109 ../../library/nntplib.rst:141 msgid "" "All commands will raise an :ref:`auditing event ` ``nntplib." "putline`` with arguments ``self`` and ``line``, where ``line`` is the bytes " "about to be sent to the remote host." msgstr "" -#: ../../library/nntplib.rst:96 +#: ../../library/nntplib.rst:113 msgid "*usenetrc* is now ``False`` by default." msgstr "" -#: ../../library/nntplib.rst:99 +#: ../../library/nntplib.rst:116 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/nntplib.rst:102 ../../library/nntplib.rst:135 +#: ../../library/nntplib.rst:119 ../../library/nntplib.rst:152 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket." msgstr "" -#: ../../library/nntplib.rst:108 +#: ../../library/nntplib.rst:125 msgid "" "Return a new :class:`NNTP_SSL` object, representing an encrypted connection " "to the NNTP server running on host *host*, listening at port *port*. :class:" @@ -131,85 +131,85 @@ msgid "" "`NNTP`." msgstr "" -#: ../../library/nntplib.rst:116 +#: ../../library/nntplib.rst:133 msgid "" "Note that SSL-on-563 is discouraged per :rfc:`4642`, in favor of STARTTLS as " "described below. However, some servers only support the former." msgstr "" -#: ../../library/nntplib.rst:130 +#: ../../library/nntplib.rst:147 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/nntplib.rst:141 +#: ../../library/nntplib.rst:158 msgid "" "Derived from the standard exception :exc:`Exception`, this is the base class " "for all exceptions raised by the :mod:`nntplib` module. Instances of this " "class have the following attribute:" msgstr "" -#: ../../library/nntplib.rst:147 +#: ../../library/nntplib.rst:164 msgid "The response of the server if available, as a :class:`str` object." msgstr "" -#: ../../library/nntplib.rst:152 +#: ../../library/nntplib.rst:169 msgid "Exception raised when an unexpected reply is received from the server." msgstr "" -#: ../../library/nntplib.rst:157 +#: ../../library/nntplib.rst:174 msgid "" "Exception raised when a response code in the range 400--499 is received." msgstr "" -#: ../../library/nntplib.rst:162 +#: ../../library/nntplib.rst:179 msgid "" "Exception raised when a response code in the range 500--599 is received." msgstr "" -#: ../../library/nntplib.rst:167 +#: ../../library/nntplib.rst:184 msgid "" "Exception raised when a reply is received from the server that does not " "begin with a digit in the range 1--5." msgstr "" -#: ../../library/nntplib.rst:173 +#: ../../library/nntplib.rst:190 msgid "Exception raised when there is some error in the response data." msgstr "" -#: ../../library/nntplib.rst:179 +#: ../../library/nntplib.rst:196 msgid "NNTP Objects" msgstr "NNTP 物件" -#: ../../library/nntplib.rst:181 +#: ../../library/nntplib.rst:198 msgid "" "When connected, :class:`NNTP` and :class:`NNTP_SSL` objects support the " "following methods and attributes." msgstr "" -#: ../../library/nntplib.rst:185 +#: ../../library/nntplib.rst:202 msgid "Attributes" msgstr "屬性" -#: ../../library/nntplib.rst:189 +#: ../../library/nntplib.rst:206 msgid "" "An integer representing the version of the NNTP protocol supported by the " "server. In practice, this should be ``2`` for servers advertising :rfc:" "`3977` compliance and ``1`` for others." msgstr "" -#: ../../library/nntplib.rst:197 +#: ../../library/nntplib.rst:214 msgid "" "A string describing the software name and version of the NNTP server, or :" "const:`None` if not advertised by the server." msgstr "" -#: ../../library/nntplib.rst:203 +#: ../../library/nntplib.rst:220 msgid "Methods" msgstr "" -#: ../../library/nntplib.rst:205 +#: ../../library/nntplib.rst:222 msgid "" "The *response* that is returned as the first item in the return tuple of " "almost all methods is the server's response: a string beginning with a three-" @@ -217,7 +217,7 @@ msgid "" "one of the above exceptions." msgstr "" -#: ../../library/nntplib.rst:210 +#: ../../library/nntplib.rst:227 msgid "" "Many of the following methods take an optional keyword-only argument *file*. " "When the *file* argument is supplied, it must be either a :term:`file " @@ -227,26 +227,26 @@ msgid "" "of lines, tuples or objects that the method normally returns will be empty." msgstr "" -#: ../../library/nntplib.rst:217 +#: ../../library/nntplib.rst:234 msgid "" "Many of the following methods have been reworked and fixed, which makes them " "incompatible with their 3.1 counterparts." msgstr "" -#: ../../library/nntplib.rst:224 +#: ../../library/nntplib.rst:241 msgid "" "Send a ``QUIT`` command and close the connection. Once this method has been " "called, no other methods of the NNTP object should be called." msgstr "" -#: ../../library/nntplib.rst:230 +#: ../../library/nntplib.rst:247 msgid "" "Return the welcome message sent by the server in reply to the initial " "connection. (This message sometimes contains disclaimers or help " "information that may be relevant to the user.)" msgstr "" -#: ../../library/nntplib.rst:237 +#: ../../library/nntplib.rst:254 msgid "" "Return the :rfc:`3977` capabilities advertised by the server, as a :class:" "`dict` instance mapping capability names to (possibly empty) lists of " @@ -254,14 +254,14 @@ msgid "" "command, an empty dictionary is returned instead." msgstr "" -#: ../../library/nntplib.rst:251 +#: ../../library/nntplib.rst:268 msgid "" "Send ``AUTHINFO`` commands with the user name and password. If *user* and " "*password* are ``None`` and *usenetrc* is true, credentials from ``~/." "netrc`` will be used if possible." msgstr "" -#: ../../library/nntplib.rst:255 +#: ../../library/nntplib.rst:272 msgid "" "Unless intentionally delayed, login is normally performed during the :class:" "`NNTP` object initialization and separately calling this function is " @@ -269,14 +269,14 @@ msgid "" "or *password* when creating the object, and must set *usenetrc* to False." msgstr "" -#: ../../library/nntplib.rst:266 +#: ../../library/nntplib.rst:283 msgid "" "Send a ``STARTTLS`` command. This will enable encryption on the NNTP " "connection. The *context* argument is optional and should be a :class:`ssl." "SSLContext` object. Please read :ref:`ssl-security` for best practices." msgstr "" -#: ../../library/nntplib.rst:271 +#: ../../library/nntplib.rst:288 msgid "" "Note that this may not be done after authentication information has been " "transmitted, and authentication occurs by default if possible during a :" @@ -284,13 +284,13 @@ msgid "" "on suppressing this behavior." msgstr "" -#: ../../library/nntplib.rst:278 +#: ../../library/nntplib.rst:295 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/nntplib.rst:285 +#: ../../library/nntplib.rst:302 msgid "" "Send a ``NEWGROUPS`` command. The *date* argument should be a :class:" "`datetime.date` or :class:`datetime.datetime` object. Return a pair " @@ -299,18 +299,18 @@ msgid "" "will be empty." msgstr "" -#: ../../library/nntplib.rst:301 +#: ../../library/nntplib.rst:318 msgid "" "Send a ``NEWNEWS`` command. Here, *group* is a group name or ``'*'``, and " "*date* has the same meaning as for :meth:`newgroups`. Return a pair " "``(response, articles)`` where *articles* is a list of message ids." msgstr "" -#: ../../library/nntplib.rst:305 +#: ../../library/nntplib.rst:322 msgid "This command is frequently disabled by NNTP server administrators." msgstr "" -#: ../../library/nntplib.rst:310 +#: ../../library/nntplib.rst:327 msgid "" "Send a ``LIST`` or ``LIST ACTIVE`` command. Return a pair ``(response, " "list)`` where *list* is a list of tuples representing all the groups " @@ -320,48 +320,48 @@ msgid "" "article numbers, and *flag* usually takes one of these values:" msgstr "" -#: ../../library/nntplib.rst:318 +#: ../../library/nntplib.rst:335 msgid "``y``: Local postings and articles from peers are allowed." msgstr "" -#: ../../library/nntplib.rst:319 +#: ../../library/nntplib.rst:336 msgid "``m``: The group is moderated and all postings must be approved." msgstr "" -#: ../../library/nntplib.rst:320 +#: ../../library/nntplib.rst:337 msgid "``n``: No local postings are allowed, only articles from peers." msgstr "" -#: ../../library/nntplib.rst:321 +#: ../../library/nntplib.rst:338 msgid "``j``: Articles from peers are filed in the junk group instead." msgstr "" -#: ../../library/nntplib.rst:322 +#: ../../library/nntplib.rst:339 msgid "``x``: No local postings, and articles from peers are ignored." msgstr "" -#: ../../library/nntplib.rst:323 +#: ../../library/nntplib.rst:340 msgid "``=foo.bar``: Articles are filed in the ``foo.bar`` group instead." msgstr "" -#: ../../library/nntplib.rst:325 +#: ../../library/nntplib.rst:342 msgid "" "If *flag* has another value, then the status of the newsgroup should be " "considered unknown." msgstr "" -#: ../../library/nntplib.rst:328 +#: ../../library/nntplib.rst:345 msgid "" "This command can return very large results, especially if *group_pattern* is " "not specified. It is best to cache the results offline unless you really " "need to refresh them." msgstr "" -#: ../../library/nntplib.rst:332 +#: ../../library/nntplib.rst:349 msgid "*group_pattern* was added." msgstr "新增 *group_pattern*\\ 。" -#: ../../library/nntplib.rst:338 +#: ../../library/nntplib.rst:355 msgid "" "Send a ``LIST NEWSGROUPS`` command, where *grouppattern* is a wildmat string " "as specified in :rfc:`3977` (it's essentially the same as DOS or UNIX shell " @@ -369,20 +369,20 @@ msgid "" "*descriptions* is a dictionary mapping group names to textual descriptions." msgstr "" -#: ../../library/nntplib.rst:352 +#: ../../library/nntplib.rst:369 msgid "" "Get a description for a single group *group*. If more than one group " "matches (if 'group' is a real wildmat string), return the first match. If " "no group matches, return an empty string." msgstr "" -#: ../../library/nntplib.rst:356 +#: ../../library/nntplib.rst:373 msgid "" "This elides the response code from the server. If the response code is " "needed, use :meth:`descriptions`." msgstr "" -#: ../../library/nntplib.rst:362 +#: ../../library/nntplib.rst:379 msgid "" "Send a ``GROUP`` command, where *name* is the group name. The group is " "selected as the current group, if it exists. Return a tuple ``(response, " @@ -391,7 +391,7 @@ msgid "" "*last* is the last article number in the group, and *name* is the group name." msgstr "" -#: ../../library/nntplib.rst:372 +#: ../../library/nntplib.rst:389 msgid "" "Send an ``OVER`` command, or an ``XOVER`` command on legacy servers. " "*message_spec* can be either a string representing a message id, or a " @@ -401,7 +401,7 @@ msgid "" "`None` to select the current article in the current group." msgstr "" -#: ../../library/nntplib.rst:379 +#: ../../library/nntplib.rst:396 msgid "" "Return a pair ``(response, overviews)``. *overviews* is a list of " "``(article_number, overview)`` tuples, one for each article selected by " @@ -412,40 +412,40 @@ msgid "" "following items are guaranteed to be present by the NNTP specification:" msgstr "" -#: ../../library/nntplib.rst:387 +#: ../../library/nntplib.rst:404 msgid "" "the ``subject``, ``from``, ``date``, ``message-id`` and ``references`` " "headers" msgstr "" -#: ../../library/nntplib.rst:389 +#: ../../library/nntplib.rst:406 msgid "" "the ``:bytes`` metadata: the number of bytes in the entire raw article " "(including headers and body)" msgstr "" -#: ../../library/nntplib.rst:391 +#: ../../library/nntplib.rst:408 msgid "the ``:lines`` metadata: the number of lines in the article body" msgstr "" -#: ../../library/nntplib.rst:393 +#: ../../library/nntplib.rst:410 msgid "" "The value of each item is either a string, or :const:`None` if not present." msgstr "" -#: ../../library/nntplib.rst:395 +#: ../../library/nntplib.rst:412 msgid "" "It is advisable to use the :func:`decode_header` function on header values " "when they may contain non-ASCII characters::" msgstr "" -#: ../../library/nntplib.rst:415 +#: ../../library/nntplib.rst:432 msgid "" "Send a ``HELP`` command. Return a pair ``(response, list)`` where *list* is " "a list of help strings." msgstr "" -#: ../../library/nntplib.rst:421 +#: ../../library/nntplib.rst:438 msgid "" "Send a ``STAT`` command, where *message_spec* is either a message id " "(enclosed in ``'<'`` and ``'>'``) or an article number in the current group. " @@ -454,15 +454,15 @@ msgid "" "where *number* is the article number and *id* is the message id." msgstr "" -#: ../../library/nntplib.rst:435 +#: ../../library/nntplib.rst:452 msgid "Send a ``NEXT`` command. Return as for :meth:`.stat`." msgstr "" -#: ../../library/nntplib.rst:440 +#: ../../library/nntplib.rst:457 msgid "Send a ``LAST`` command. Return as for :meth:`.stat`." msgstr "" -#: ../../library/nntplib.rst:445 +#: ../../library/nntplib.rst:462 msgid "" "Send an ``ARTICLE`` command, where *message_spec* has the same meaning as " "for :meth:`.stat`. Return a tuple ``(response, info)`` where *info* is a :" @@ -473,21 +473,21 @@ msgid "" "comprising the raw message including headers and body." msgstr "" -#: ../../library/nntplib.rst:470 +#: ../../library/nntplib.rst:487 msgid "" "Same as :meth:`article()`, but sends a ``HEAD`` command. The *lines* " "returned (or written to *file*) will only contain the message headers, not " "the body." msgstr "" -#: ../../library/nntplib.rst:477 +#: ../../library/nntplib.rst:494 msgid "" "Same as :meth:`article()`, but sends a ``BODY`` command. The *lines* " "returned (or written to *file*) will only contain the message body, not the " "headers." msgstr "" -#: ../../library/nntplib.rst:484 +#: ../../library/nntplib.rst:501 msgid "" "Post an article using the ``POST`` command. The *data* argument is either " "a :term:`file object` opened for binary reading, or any iterable of bytes " @@ -497,30 +497,30 @@ msgid "" "appends the termination line." msgstr "" -#: ../../library/nntplib.rst:491 +#: ../../library/nntplib.rst:508 msgid "" "If the method succeeds, the server's response is returned. If the server " "refuses posting, a :class:`NNTPReplyError` is raised." msgstr "" -#: ../../library/nntplib.rst:497 +#: ../../library/nntplib.rst:514 msgid "" "Send an ``IHAVE`` command. *message_id* is the id of the message to send to " "the server (enclosed in ``'<'`` and ``'>'``). The *data* parameter and the " "return value are the same as for :meth:`post()`." msgstr "" -#: ../../library/nntplib.rst:504 +#: ../../library/nntplib.rst:521 msgid "" "Return a pair ``(response, date)``. *date* is a :class:`~datetime.datetime` " "object containing the current date and time of the server." msgstr "" -#: ../../library/nntplib.rst:510 +#: ../../library/nntplib.rst:527 msgid "Send a ``SLAVE`` command. Return the server's *response*." msgstr "" -#: ../../library/nntplib.rst:515 +#: ../../library/nntplib.rst:532 msgid "" "Set the instance's debugging level. This controls the amount of debugging " "output printed. The default, ``0``, produces no debugging output. A value " @@ -530,13 +530,13 @@ msgid "" "the connection (including message text)." msgstr "" -#: ../../library/nntplib.rst:523 +#: ../../library/nntplib.rst:540 msgid "" "The following are optional NNTP extensions defined in :rfc:`2980`. Some of " "them have been superseded by newer commands in :rfc:`3977`." msgstr "" -#: ../../library/nntplib.rst:529 +#: ../../library/nntplib.rst:546 msgid "" "Send an ``XHDR`` command. The *hdr* argument is a header keyword, e.g. " "``'subject'``. The *str* argument should have the form ``'first-last'`` " @@ -551,7 +551,7 @@ msgid "" "*file* is supplied, then the returned *list* is an empty list." msgstr "" -#: ../../library/nntplib.rst:544 +#: ../../library/nntplib.rst:561 msgid "" "Send an ``XOVER`` command. *start* and *end* are article numbers delimiting " "the range of articles to select. The return value is the same of for :meth:" @@ -559,15 +559,15 @@ msgid "" "automatically use the newer ``OVER`` command if available." msgstr "" -#: ../../library/nntplib.rst:552 +#: ../../library/nntplib.rst:569 msgid "Utility functions" msgstr "" -#: ../../library/nntplib.rst:554 +#: ../../library/nntplib.rst:571 msgid "The module also defines the following utility function:" msgstr "" -#: ../../library/nntplib.rst:559 +#: ../../library/nntplib.rst:576 msgid "" "Decode a header value, un-escaping any escaped non-ASCII characters. " "*header_str* must be a :class:`str` object. The unescaped value is " diff --git a/library/optparse.po b/library/optparse.po index 380eb8bf7b..1a68598e2e 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:19+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2452,8 +2452,8 @@ msgstr "" #: ../../library/optparse.rst:2049 msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " -"ensure_value() first sets it to ``value``, and then returns 'value. This is " -"very handy for actions like ``\"extend\"``, ``\"append\"``, and " +"ensure_value() first sets it to ``value``, and then returns ``value``. This " +"is very handy for actions like ``\"extend\"``, ``\"append\"``, and " "``\"count\"``, all of which accumulate data in a variable and expect that " "variable to be of a certain type (a list for the first two, an integer for " "the latter). Using :meth:`ensure_value` means that scripts using your " diff --git a/library/os.path.po b/library/os.path.po index 52e6a1bf8c..29ef017d63 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,12 +116,12 @@ msgstr "" #: ../../library/os.path.rst:214 ../../library/os.path.rst:226 #: ../../library/os.path.rst:235 ../../library/os.path.rst:245 #: ../../library/os.path.rst:255 ../../library/os.path.rst:265 -#: ../../library/os.path.rst:275 ../../library/os.path.rst:294 -#: ../../library/os.path.rst:325 ../../library/os.path.rst:345 -#: ../../library/os.path.rst:368 ../../library/os.path.rst:390 -#: ../../library/os.path.rst:408 ../../library/os.path.rst:421 -#: ../../library/os.path.rst:437 ../../library/os.path.rst:453 -#: ../../library/os.path.rst:478 ../../library/os.path.rst:509 +#: ../../library/os.path.rst:284 ../../library/os.path.rst:303 +#: ../../library/os.path.rst:352 ../../library/os.path.rst:372 +#: ../../library/os.path.rst:395 ../../library/os.path.rst:417 +#: ../../library/os.path.rst:435 ../../library/os.path.rst:448 +#: ../../library/os.path.rst:464 ../../library/os.path.rst:480 +#: ../../library/os.path.rst:505 ../../library/os.path.rst:569 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" @@ -149,9 +149,9 @@ msgstr "" "和相對路徑、*paths* 位於不同的磁碟機或 *paths* 為空,則引發 :exc:" "`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" -#: ../../library/os.path.rst:88 ../../library/os.path.rst:388 -#: ../../library/os.path.rst:400 ../../library/os.path.rst:416 -#: ../../library/os.path.rst:432 +#: ../../library/os.path.rst:88 ../../library/os.path.rst:415 +#: ../../library/os.path.rst:427 ../../library/os.path.rst:443 +#: ../../library/os.path.rst:459 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -324,12 +324,19 @@ msgstr "" #: ../../library/os.path.rst:271 msgid "" +"Return ``True`` if *path* refers to an :func:`existing ` directory " +"entry that is a junction. Always return ``False`` if junctions are not " +"supported on the current platform." +msgstr "" + +#: ../../library/os.path.rst:280 +msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a symbolic link. Always ``False`` if symbolic links are not " "supported by the Python runtime." msgstr "" -#: ../../library/os.path.rst:281 +#: ../../library/os.path.rst:290 msgid "" "Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a " "file system where a different file system has been mounted. On POSIX, the " @@ -342,11 +349,33 @@ msgid "" "called to see if it is different from the input path." msgstr "" -#: ../../library/os.path.rst:291 +#: ../../library/os.path.rst:300 msgid "Support for detecting non-root mount points on Windows." msgstr "" -#: ../../library/os.path.rst:300 +#: ../../library/os.path.rst:309 +msgid "" +"Return ``True`` if pathname *path* is located on a Windows Dev Drive. A Dev " +"Drive is optimized for developer scenarios, and offers faster performance " +"for reading and writing files. It is recommended for use for source code, " +"temporary build directories, package caches, and other IO-intensive " +"operations." +msgstr "" + +#: ../../library/os.path.rst:315 +msgid "" +"May raise an error for an invalid path, for example, one without a " +"recognizable drive, but returns ``False`` on platforms that do not support " +"Dev Drives. See `the Windows documentation `_ for information on enabling and creating Dev Drives." +msgstr "" + +#: ../../library/os.path.rst:320 +#, fuzzy +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`適用 `:Unix、Windows。" + +#: ../../library/os.path.rst:327 msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " @@ -357,7 +386,7 @@ msgid "" "and joining continues from the absolute path segment." msgstr "" -#: ../../library/os.path.rst:308 +#: ../../library/os.path.rst:335 msgid "" "On Windows, the drive is not reset when a rooted path segment (e.g., " "``r'\\foo'``) is encountered. If a segment is on a different drive or is an " @@ -367,18 +396,18 @@ msgid "" "on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\\\foo`." msgstr "" -#: ../../library/os.path.rst:315 +#: ../../library/os.path.rst:342 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "" -#: ../../library/os.path.rst:321 +#: ../../library/os.path.rst:348 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " "On other operating systems, return the path unchanged." msgstr "" -#: ../../library/os.path.rst:331 +#: ../../library/os.path.rst:358 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -387,7 +416,7 @@ msgid "" "backward slashes. To normalize case, use :func:`normcase`." msgstr "" -#: ../../library/os.path.rst:338 +#: ../../library/os.path.rst:365 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " "Pathname Resolution `_.) For example::" +msgstr "" + +#: ../../library/os.path.rst:530 +msgid "" +"On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a " +"device name. The *root* may be empty, a forward slash, or a backward slash. " +"For example::" +msgstr "" + +#: ../../library/os.path.rst:544 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " "ext == path``, and the extension, *ext*, is empty or begins with a period " "and contains at most one period." msgstr "" -#: ../../library/os.path.rst:488 +#: ../../library/os.path.rst:548 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "" -#: ../../library/os.path.rst:493 +#: ../../library/os.path.rst:553 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" msgstr "" -#: ../../library/os.path.rst:501 +#: ../../library/os.path.rst:561 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "" -#: ../../library/os.path.rst:515 +#: ../../library/os.path.rst:575 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." diff --git a/library/os.po b/library/os.po index 75273bae39..4bf42a0cc5 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -288,39 +288,39 @@ msgstr "" #: ../../library/os.rst:181 ../../library/os.rst:358 ../../library/os.rst:367 #: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:434 #: ../../library/os.rst:442 ../../library/os.rst:480 ../../library/os.rst:491 -#: ../../library/os.rst:501 ../../library/os.rst:511 ../../library/os.rst:534 -#: ../../library/os.rst:568 ../../library/os.rst:575 ../../library/os.rst:582 -#: ../../library/os.rst:591 ../../library/os.rst:603 ../../library/os.rst:612 -#: ../../library/os.rst:629 ../../library/os.rst:638 ../../library/os.rst:645 -#: ../../library/os.rst:654 ../../library/os.rst:663 ../../library/os.rst:670 -#: ../../library/os.rst:677 ../../library/os.rst:686 ../../library/os.rst:1051 -#: ../../library/os.rst:1195 ../../library/os.rst:1221 -#: ../../library/os.rst:1458 ../../library/os.rst:1493 -#: ../../library/os.rst:1502 ../../library/os.rst:1866 -#: ../../library/os.rst:1955 ../../library/os.rst:1995 -#: ../../library/os.rst:2212 ../../library/os.rst:2234 -#: ../../library/os.rst:3762 ../../library/os.rst:3769 -#: ../../library/os.rst:3776 ../../library/os.rst:3783 -#: ../../library/os.rst:3790 ../../library/os.rst:3797 -#: ../../library/os.rst:3804 ../../library/os.rst:3812 -#: ../../library/os.rst:3820 ../../library/os.rst:3827 -#: ../../library/os.rst:3834 ../../library/os.rst:3843 -#: ../../library/os.rst:3851 ../../library/os.rst:3859 -#: ../../library/os.rst:3866 ../../library/os.rst:3873 -#: ../../library/os.rst:3894 ../../library/os.rst:3911 -#: ../../library/os.rst:3951 ../../library/os.rst:3958 -#: ../../library/os.rst:3979 ../../library/os.rst:4106 -#: ../../library/os.rst:4155 ../../library/os.rst:4392 -#: ../../library/os.rst:4426 ../../library/os.rst:4484 -#: ../../library/os.rst:4498 ../../library/os.rst:4515 -#: ../../library/os.rst:4530 ../../library/os.rst:4541 -#: ../../library/os.rst:4553 ../../library/os.rst:4566 -#: ../../library/os.rst:4575 ../../library/os.rst:4585 -#: ../../library/os.rst:4598 ../../library/os.rst:4649 -#: ../../library/os.rst:4660 ../../library/os.rst:4672 -#: ../../library/os.rst:4679 ../../library/os.rst:4688 -#: ../../library/os.rst:4697 ../../library/os.rst:4706 -#: ../../library/os.rst:4715 +#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:545 +#: ../../library/os.rst:579 ../../library/os.rst:586 ../../library/os.rst:593 +#: ../../library/os.rst:602 ../../library/os.rst:652 ../../library/os.rst:661 +#: ../../library/os.rst:678 ../../library/os.rst:687 ../../library/os.rst:694 +#: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 +#: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 +#: ../../library/os.rst:1305 ../../library/os.rst:1331 +#: ../../library/os.rst:1568 ../../library/os.rst:1607 +#: ../../library/os.rst:1616 ../../library/os.rst:1980 +#: ../../library/os.rst:2069 ../../library/os.rst:2109 +#: ../../library/os.rst:2389 ../../library/os.rst:2411 +#: ../../library/os.rst:3993 ../../library/os.rst:4000 +#: ../../library/os.rst:4007 ../../library/os.rst:4014 +#: ../../library/os.rst:4021 ../../library/os.rst:4028 +#: ../../library/os.rst:4035 ../../library/os.rst:4043 +#: ../../library/os.rst:4051 ../../library/os.rst:4058 +#: ../../library/os.rst:4065 ../../library/os.rst:4074 +#: ../../library/os.rst:4082 ../../library/os.rst:4090 +#: ../../library/os.rst:4097 ../../library/os.rst:4104 +#: ../../library/os.rst:4125 ../../library/os.rst:4142 +#: ../../library/os.rst:4182 ../../library/os.rst:4189 +#: ../../library/os.rst:4219 ../../library/os.rst:4346 +#: ../../library/os.rst:4395 ../../library/os.rst:4632 +#: ../../library/os.rst:4666 ../../library/os.rst:4724 +#: ../../library/os.rst:4738 ../../library/os.rst:4755 +#: ../../library/os.rst:4770 ../../library/os.rst:4781 +#: ../../library/os.rst:4793 ../../library/os.rst:4806 +#: ../../library/os.rst:4815 ../../library/os.rst:4825 +#: ../../library/os.rst:4838 ../../library/os.rst:4889 +#: ../../library/os.rst:4900 ../../library/os.rst:4912 +#: ../../library/os.rst:4919 ../../library/os.rst:4928 +#: ../../library/os.rst:4937 ../../library/os.rst:4946 +#: ../../library/os.rst:4955 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -475,12 +475,13 @@ msgid "" "like to use a different encoding." msgstr "" -#: ../../library/os.rst:322 ../../library/os.rst:980 ../../library/os.rst:991 -#: ../../library/os.rst:1207 ../../library/os.rst:1642 -#: ../../library/os.rst:2039 ../../library/os.rst:2312 -#: ../../library/os.rst:3102 ../../library/os.rst:3139 -#: ../../library/os.rst:3754 ../../library/os.rst:4243 -#: ../../library/os.rst:4254 ../../library/os.rst:4371 +#: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 +#: ../../library/os.rst:1110 ../../library/os.rst:1317 +#: ../../library/os.rst:1588 ../../library/os.rst:1756 +#: ../../library/os.rst:2153 ../../library/os.rst:2489 +#: ../../library/os.rst:3332 ../../library/os.rst:3369 +#: ../../library/os.rst:3985 ../../library/os.rst:4483 +#: ../../library/os.rst:4494 ../../library/os.rst:4611 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -499,22 +500,21 @@ msgid "" "``True``." msgstr "" -#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:522 -#: ../../library/os.rst:738 ../../library/os.rst:898 ../../library/os.rst:913 -#: ../../library/os.rst:924 ../../library/os.rst:947 ../../library/os.rst:968 -#: ../../library/os.rst:1004 ../../library/os.rst:1028 -#: ../../library/os.rst:1040 ../../library/os.rst:1246 -#: ../../library/os.rst:1261 ../../library/os.rst:1274 -#: ../../library/os.rst:1343 ../../library/os.rst:1478 -#: ../../library/os.rst:1553 ../../library/os.rst:1580 -#: ../../library/os.rst:1615 ../../library/os.rst:1938 -#: ../../library/os.rst:1969 ../../library/os.rst:2010 -#: ../../library/os.rst:2023 ../../library/os.rst:2278 -#: ../../library/os.rst:2290 ../../library/os.rst:2968 -#: ../../library/os.rst:3125 ../../library/os.rst:3358 -#: ../../library/os.rst:4861 ../../library/os.rst:4870 -#: ../../library/os.rst:4891 ../../library/os.rst:4901 -#: ../../library/os.rst:4910 +#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:533 +#: ../../library/os.rst:787 ../../library/os.rst:1004 ../../library/os.rst:1019 +#: ../../library/os.rst:1030 ../../library/os.rst:1053 +#: ../../library/os.rst:1074 ../../library/os.rst:1138 +#: ../../library/os.rst:1150 ../../library/os.rst:1356 +#: ../../library/os.rst:1371 ../../library/os.rst:1384 +#: ../../library/os.rst:1453 ../../library/os.rst:1667 +#: ../../library/os.rst:1694 ../../library/os.rst:1729 +#: ../../library/os.rst:2052 ../../library/os.rst:2083 +#: ../../library/os.rst:2124 ../../library/os.rst:2137 +#: ../../library/os.rst:2455 ../../library/os.rst:2467 +#: ../../library/os.rst:3198 ../../library/os.rst:3355 +#: ../../library/os.rst:3588 ../../library/os.rst:5101 +#: ../../library/os.rst:5110 ../../library/os.rst:5131 +#: ../../library/os.rst:5141 ../../library/os.rst:5150 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -540,8 +540,8 @@ msgstr "" msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:378 ../../library/os.rst:451 ../../library/os.rst:524 -#: ../../library/os.rst:709 +#: ../../library/os.rst:378 ../../library/os.rst:451 ../../library/os.rst:535 +#: ../../library/os.rst:758 msgid "" "The function is a stub on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -586,10 +586,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3719 -#: ../../library/os.rst:3935 ../../library/os.rst:4224 -#: ../../library/os.rst:4348 ../../library/os.rst:4464 -#: ../../library/os.rst:4633 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3950 +#: ../../library/os.rst:4166 ../../library/os.rst:4464 +#: ../../library/os.rst:4588 ../../library/os.rst:4704 +#: ../../library/os.rst:4873 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -630,42 +630,47 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:489 +#: ../../library/os.rst:489 ../../library/os.rst:501 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:498 +#: ../../library/os.rst:503 +#, fuzzy +msgid ":ref:`Availability `: macOS" +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/os.rst:509 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:508 +#: ../../library/os.rst:519 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:520 +#: ../../library/os.rst:531 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:530 +#: ../../library/os.rst:541 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:543 +#: ../../library/os.rst:554 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:547 +#: ../../library/os.rst:558 msgid "" "Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " @@ -675,13 +680,13 @@ msgid "" "in their implementations." msgstr "" -#: ../../library/os.rst:555 +#: ../../library/os.rst:566 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:558 +#: ../../library/os.rst:569 msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." @@ -689,23 +694,23 @@ msgstr "" "引發一個附帶引數 ``key``、``value`` 的\\ :ref:`稽核事件 ` ``os." "putenv``。" -#: ../../library/os.rst:560 +#: ../../library/os.rst:571 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:566 +#: ../../library/os.rst:577 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:573 +#: ../../library/os.rst:584 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:580 +#: ../../library/os.rst:591 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:587 +#: ../../library/os.rst:598 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 " @@ -713,7 +718,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:593 +#: ../../library/os.rst:604 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:" @@ -721,21 +726,69 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:600 +#: ../../library/os.rst:611 +msgid "" +"Reassociate the current thread with a Linux namespace. See the :manpage:" +"`setns(2)` and :manpage:`namespaces(7)` man pages for more details." +msgstr "" + +#: ../../library/os.rst:615 +msgid "" +"If *fd* refers to a :file:`/proc/{pid}/ns/` link, ``setns()`` reassociates " +"the calling thread with the namespace associated with that link, and " +"*nstype* may be set to one of the :ref:`CLONE_NEW* constants ` to impose constraints on the operation (``0`` means no " +"constraints)." +msgstr "" + +#: ../../library/os.rst:622 +msgid "" +"Since Linux 5.8, *fd* may refer to a PID file descriptor obtained from :func:" +"`~os.pidfd_open`. In this case, ``setns()`` reassociates the calling thread " +"into one or more of the same namespaces as the thread referred to by *fd*. " +"This is subject to any constraints imposed by *nstype*, which is a bit mask " +"combining one or more of the :ref:`CLONE_NEW* constants `, e.g. ``setns(fd, os.CLONE_NEWUTS | os.CLONE_NEWPID)``. The caller's " +"memberships in unspecified namespaces are left unchanged." +msgstr "" + +#: ../../library/os.rst:631 +msgid "" +"*fd* can be any object with a :meth:`~io.IOBase.fileno` method, or a raw " +"file descriptor." +msgstr "" + +#: ../../library/os.rst:633 +msgid "" +"This example reassociates the thread with the ``init`` process's network " +"namespace::" +msgstr "" + +#: ../../library/os.rst:639 +#, fuzzy +msgid ":ref:`Availability `: Linux >= 3.0 with glibc >= 2.14." +msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" + +#: ../../library/os.rst:645 +#, fuzzy +msgid "The :func:`~os.unshare` function." +msgstr ":func:`fstat` 和 :func:`lstat` 函式。" + +#: ../../library/os.rst:649 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:608 +#: ../../library/os.rst:657 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:619 +#: ../../library/os.rst:668 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -748,109 +801,109 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:636 +#: ../../library/os.rst:685 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:643 +#: ../../library/os.rst:692 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:652 +#: ../../library/os.rst:701 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:661 +#: ../../library/os.rst:710 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:668 +#: ../../library/os.rst:717 msgid "" "Call the system call :c:func:`getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:675 +#: ../../library/os.rst:724 msgid "" "Call the system call :c:func:`setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:684 +#: ../../library/os.rst:733 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:692 +#: ../../library/os.rst:741 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:699 +#: ../../library/os.rst:748 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:707 +#: ../../library/os.rst:756 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:719 +#: ../../library/os.rst:768 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:722 +#: ../../library/os.rst:771 msgid ":attr:`sysname` - operating system name" msgstr ":attr:`sysname` - 作業系統名稱" -#: ../../library/os.rst:723 +#: ../../library/os.rst:772 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:724 +#: ../../library/os.rst:773 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:725 +#: ../../library/os.rst:774 msgid ":attr:`version` - operating system version" msgstr ":attr:`version` - 作業系統版本" -#: ../../library/os.rst:726 +#: ../../library/os.rst:775 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:728 +#: ../../library/os.rst:777 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:733 +#: ../../library/os.rst:782 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:740 ../../library/os.rst:4373 +#: ../../library/os.rst:789 ../../library/os.rst:4613 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:749 +#: ../../library/os.rst:798 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:753 +#: ../../library/os.rst:802 msgid "" "Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -858,28 +911,56 @@ msgid "" "items of :data:`os.environ`." msgstr "" -#: ../../library/os.rst:758 +#: ../../library/os.rst:807 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." msgstr "" "引發一個附帶引數 ``key`` 的\\ :ref:`稽核事件 ` ``os.unsetenv``。" -#: ../../library/os.rst:760 +#: ../../library/os.rst:809 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:767 +#: ../../library/os.rst:815 +msgid "" +"Disassociate parts of the process execution context, and move them into a " +"newly created namespace. See the :manpage:`unshare(2)` man page for more " +"details. The *flags* argument is a bit mask, combining zero or more of the :" +"ref:`CLONE_* constants `, that specifies which parts " +"of the execution context should be unshared from their existing associations " +"and moved to a new namespace. If the *flags* argument is ``0``, no changes " +"are made to the calling process's execution context." +msgstr "" + +#: ../../library/os.rst:826 +#, fuzzy +msgid ":ref:`Availability `: Linux >= 2.6.16." +msgstr ":ref:`適用 `:Linux 4.16 以上。" + +#: ../../library/os.rst:832 +#, fuzzy +msgid "The :func:`~os.setns` function." +msgstr ":func:`fstat` 和 :func:`lstat` 函式。" + +#: ../../library/os.rst:836 +msgid "" +"Flags to the :func:`unshare` function, if the implementation supports them. " +"See :manpage:`unshare(2)` in the Linux manual for their exact effect and " +"availability." +msgstr "" + +#: ../../library/os.rst:859 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:769 +#: ../../library/os.rst:861 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:775 +#: ../../library/os.rst:867 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 " @@ -887,16 +968,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:784 +#: ../../library/os.rst:876 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:786 +#: ../../library/os.rst:878 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:788 +#: ../../library/os.rst:880 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 " @@ -906,7 +987,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:795 +#: ../../library/os.rst:887 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 " @@ -914,11 +995,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:803 +#: ../../library/os.rst:895 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:807 +#: ../../library/os.rst:899 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 " @@ -926,77 +1007,98 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:815 +#: ../../library/os.rst:907 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:827 +#: ../../library/os.rst:919 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " "If *offset_src* is None, then *src* is read from the current position; " -"respectively for *offset_dst*. The files pointed by *src* and *dst* must " +"respectively for *offset_dst*." +msgstr "" + +#: ../../library/os.rst:924 +msgid "" +"In Linux kernel older than 5.3, the files pointed by *src* and *dst* must " "reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" "attr:`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:834 ../../library/os.rst:1518 +#: ../../library/os.rst:928 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 " -"filesystems could implement extra optimizations. The copy is done as if both " -"files are opened as binary." +"filesystems could implement extra optimizations, such as the use of reflinks " +"(i.e., two or more inodes that share pointers to the same copy-on-write disk " +"blocks; supported file systems include btrfs and XFS) and server-side copy " +"(in the case of NFS)." msgstr "" -#: ../../library/os.rst:839 +#: ../../library/os.rst:935 +msgid "" +"The function copies bytes between two file descriptors. Text options, like " +"the encoding and the line ending, are ignored." +msgstr "" + +#: ../../library/os.rst:938 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:842 +#: ../../library/os.rst:943 +msgid "" +"On Linux, :func:`os.copy_file_range` should not be used for copying a range " +"of a pseudo file from a special filesystem like procfs and sysfs. It will " +"always copy no bytes and return 0 as if the file was empty because of a " +"known Linux kernel issue." +msgstr "" + +#: ../../library/os.rst:948 msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:849 +#: ../../library/os.rst:955 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:852 +#: ../../library/os.rst:958 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:855 +#: ../../library/os.rst:961 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:861 +#: ../../library/os.rst:967 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: ../../library/os.rst:864 +#: ../../library/os.rst:970 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:868 ../../library/os.rst:881 +#: ../../library/os.rst:974 ../../library/os.rst:987 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/os.rst:870 ../../library/os.rst:1094 +#: ../../library/os.rst:976 ../../library/os.rst:1204 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:876 +#: ../../library/os.rst:982 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -1004,22 +1106,23 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:883 +#: ../../library/os.rst:989 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:886 +#: ../../library/os.rst:992 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:892 +#: ../../library/os.rst:998 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:896 ../../library/os.rst:1914 ../../library/os.rst:2008 +#: ../../library/os.rst:1002 ../../library/os.rst:2028 +#: ../../library/os.rst:2122 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1027,22 +1130,24 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.chmod``。" -#: ../../library/os.rst:900 ../../library/os.rst:915 ../../library/os.rst:1006 -#: ../../library/os.rst:1480 ../../library/os.rst:1911 -#: ../../library/os.rst:1940 ../../library/os.rst:3104 +#: ../../library/os.rst:1006 ../../library/os.rst:1021 +#: ../../library/os.rst:1112 ../../library/os.rst:1590 +#: ../../library/os.rst:2025 ../../library/os.rst:2054 +#: ../../library/os.rst:3334 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." msgstr "" -#: ../../library/os.rst:906 +#: ../../library/os.rst:1012 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:911 ../../library/os.rst:1936 ../../library/os.rst:2021 +#: ../../library/os.rst:1017 ../../library/os.rst:2050 +#: ../../library/os.rst:2135 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1050,17 +1155,17 @@ msgstr "" "引發一個附帶引數 ``path``、``uid``、``gid``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.chown``。" -#: ../../library/os.rst:921 +#: ../../library/os.rst:1027 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:927 +#: ../../library/os.rst:1033 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:932 +#: ../../library/os.rst:1038 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1071,7 +1176,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:940 ../../library/os.rst:2270 +#: ../../library/os.rst:1046 ../../library/os.rst:2447 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 " @@ -1079,53 +1184,53 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:945 +#: ../../library/os.rst:1051 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:952 +#: ../../library/os.rst:1058 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:955 +#: ../../library/os.rst:1061 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:959 ../../library/os.rst:2105 +#: ../../library/os.rst:1065 ../../library/os.rst:2282 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:964 +#: ../../library/os.rst:1070 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:973 +#: ../../library/os.rst:1079 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:976 +#: ../../library/os.rst:1082 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:985 +#: ../../library/os.rst:1091 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:989 +#: ../../library/os.rst:1095 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." @@ -1133,28 +1238,37 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:993 ../../library/os.rst:3143 +#: ../../library/os.rst:1099 ../../library/os.rst:3373 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" -#: ../../library/os.rst:999 +#: ../../library/os.rst:1105 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:1002 +#: ../../library/os.rst:1108 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1014 +#: ../../library/os.rst:1115 ../../library/os.rst:1593 +msgid "On Windows, this function is limited to pipes." +msgstr "" + +#: ../../library/os.rst:1119 ../../library/os.rst:1597 +#, fuzzy +msgid "Added support for pipes on Windows." +msgstr "新增對 Windows 的支援。" + +#: ../../library/os.rst:1124 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:1020 +#: ../../library/os.rst:1130 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:" @@ -1162,24 +1276,24 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: ../../library/os.rst:1026 +#: ../../library/os.rst:1136 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." msgstr "" -#: ../../library/os.rst:1038 +#: ../../library/os.rst:1148 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:1047 +#: ../../library/os.rst:1157 msgid "" "Prepare the tty of which fd is a file descriptor for a new login session. " "Make the calling process a session leader; make the tty the controlling tty, " "the stdin, the stdout, and the stderr of the calling process; close fd." msgstr "" -#: ../../library/os.rst:1058 +#: ../../library/os.rst:1168 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 " @@ -1189,19 +1303,19 @@ msgid "" "beginning." msgstr "" -#: ../../library/os.rst:1069 +#: ../../library/os.rst:1179 msgid "" "Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " "respectively." msgstr "" -#: ../../library/os.rst:1072 +#: ../../library/os.rst:1182 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1079 +#: ../../library/os.rst:1189 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 " @@ -1209,7 +1323,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1084 +#: ../../library/os.rst:1194 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`) " @@ -1217,13 +1331,13 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1089 +#: ../../library/os.rst:1199 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1092 +#: ../../library/os.rst:1202 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1231,7 +1345,7 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/os.rst:1099 +#: ../../library/os.rst:1209 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 :" @@ -1239,39 +1353,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1104 ../../library/os.rst:2146 -#: ../../library/os.rst:2214 ../../library/os.rst:2236 -#: ../../library/os.rst:2317 ../../library/os.rst:2348 +#: ../../library/os.rst:1214 ../../library/os.rst:2323 +#: ../../library/os.rst:2391 ../../library/os.rst:2413 +#: ../../library/os.rst:2494 ../../library/os.rst:2525 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1107 ../../library/os.rst:1426 -#: ../../library/os.rst:1597 ../../library/os.rst:4466 +#: ../../library/os.rst:1217 ../../library/os.rst:1536 +#: ../../library/os.rst:1711 ../../library/os.rst:4706 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:1112 ../../library/os.rst:1808 -#: ../../library/os.rst:1840 ../../library/os.rst:1871 -#: ../../library/os.rst:1920 ../../library/os.rst:1957 -#: ../../library/os.rst:1997 ../../library/os.rst:2012 -#: ../../library/os.rst:2025 ../../library/os.rst:2084 -#: ../../library/os.rst:2113 ../../library/os.rst:2149 -#: ../../library/os.rst:2190 ../../library/os.rst:2217 -#: ../../library/os.rst:2239 ../../library/os.rst:2280 -#: ../../library/os.rst:2351 ../../library/os.rst:2370 -#: ../../library/os.rst:2458 ../../library/os.rst:2731 -#: ../../library/os.rst:2982 ../../library/os.rst:3146 -#: ../../library/os.rst:3162 ../../library/os.rst:3202 -#: ../../library/os.rst:3301 ../../library/os.rst:3362 -#: ../../library/os.rst:3546 ../../library/os.rst:3725 -#: ../../library/os.rst:4231 +#: ../../library/os.rst:1222 ../../library/os.rst:1922 +#: ../../library/os.rst:1954 ../../library/os.rst:1985 +#: ../../library/os.rst:2034 ../../library/os.rst:2071 +#: ../../library/os.rst:2111 ../../library/os.rst:2126 +#: ../../library/os.rst:2139 ../../library/os.rst:2198 +#: ../../library/os.rst:2290 ../../library/os.rst:2326 +#: ../../library/os.rst:2367 ../../library/os.rst:2394 +#: ../../library/os.rst:2416 ../../library/os.rst:2457 +#: ../../library/os.rst:2528 ../../library/os.rst:2547 +#: ../../library/os.rst:2635 ../../library/os.rst:2925 +#: ../../library/os.rst:3212 ../../library/os.rst:3376 +#: ../../library/os.rst:3392 ../../library/os.rst:3432 +#: ../../library/os.rst:3531 ../../library/os.rst:3592 +#: ../../library/os.rst:3776 ../../library/os.rst:3956 +#: ../../library/os.rst:4471 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1115 +#: ../../library/os.rst:1225 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 ``|" @@ -1281,45 +1395,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1130 +#: ../../library/os.rst:1240 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1141 +#: ../../library/os.rst:1251 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1143 +#: ../../library/os.rst:1253 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1154 +#: ../../library/os.rst:1264 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1161 +#: ../../library/os.rst:1271 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1163 +#: ../../library/os.rst:1273 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1177 +#: ../../library/os.rst:1287 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1180 +#: ../../library/os.rst:1290 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:1190 +#: ../../library/os.rst:1300 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 " @@ -1327,18 +1441,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1197 ../../library/os.rst:1209 +#: ../../library/os.rst:1307 ../../library/os.rst:1319 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1203 +#: ../../library/os.rst:1313 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:1215 +#: ../../library/os.rst:1325 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:" @@ -1346,17 +1460,17 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1228 +#: ../../library/os.rst:1338 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:1231 +#: ../../library/os.rst:1341 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" -#: ../../library/os.rst:1238 +#: ../../library/os.rst:1348 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 " @@ -1367,25 +1481,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1258 +#: ../../library/os.rst:1368 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:1268 +#: ../../library/os.rst:1378 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1271 ../../library/os.rst:1415 +#: ../../library/os.rst:1381 ../../library/os.rst:1525 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:1281 +#: ../../library/os.rst:1391 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1393,38 +1507,38 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1286 ../../library/os.rst:1356 +#: ../../library/os.rst:1396 ../../library/os.rst:1466 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1289 +#: ../../library/os.rst:1399 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1290 +#: ../../library/os.rst:1400 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1292 ../../library/os.rst:1547 +#: ../../library/os.rst:1402 ../../library/os.rst:1661 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:1295 ../../library/os.rst:1365 -#: ../../library/os.rst:1550 ../../library/os.rst:1612 +#: ../../library/os.rst:1405 ../../library/os.rst:1475 +#: ../../library/os.rst:1664 ../../library/os.rst:1726 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:1298 +#: ../../library/os.rst:1408 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1300 ../../library/os.rst:1370 +#: ../../library/os.rst:1410 ../../library/os.rst:1480 msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " ">= 2.7, AIX >= 7.1." @@ -1432,55 +1546,55 @@ msgstr "" ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " "以上、AIX 7.1 以上。" -#: ../../library/os.rst:1302 ../../library/os.rst:1372 +#: ../../library/os.rst:1412 ../../library/os.rst:1482 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1309 +#: ../../library/os.rst:1419 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:1313 +#: ../../library/os.rst:1423 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:1317 +#: ../../library/os.rst:1427 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1324 +#: ../../library/os.rst:1434 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:1328 +#: ../../library/os.rst:1438 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1331 +#: ../../library/os.rst:1441 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1338 +#: ../../library/os.rst:1448 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1341 ../../library/os.rst:1587 +#: ../../library/os.rst:1451 ../../library/os.rst:1701 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1350 +#: ../../library/os.rst:1460 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:" @@ -1489,43 +1603,43 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1359 +#: ../../library/os.rst:1469 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1360 +#: ../../library/os.rst:1470 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1361 +#: ../../library/os.rst:1471 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1363 +#: ../../library/os.rst:1473 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1368 +#: ../../library/os.rst:1478 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1379 +#: ../../library/os.rst:1489 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:1382 ../../library/os.rst:1392 +#: ../../library/os.rst:1492 ../../library/os.rst:1502 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1389 +#: ../../library/os.rst:1499 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:1399 +#: ../../library/os.rst:1509 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 " @@ -1535,15 +1649,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1406 +#: ../../library/os.rst:1516 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1413 +#: ../../library/os.rst:1523 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1420 +#: ../../library/os.rst:1530 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 " @@ -1552,26 +1666,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1435 +#: ../../library/os.rst:1545 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:1439 +#: ../../library/os.rst:1549 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1442 +#: ../../library/os.rst:1552 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:1445 +#: ../../library/os.rst:1555 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 " @@ -1579,59 +1693,59 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1449 +#: ../../library/os.rst:1559 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:1452 +#: ../../library/os.rst:1562 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:1455 +#: ../../library/os.rst:1565 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1462 +#: ../../library/os.rst:1572 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1467 +#: ../../library/os.rst:1577 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1473 +#: ../../library/os.rst:1583 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:1476 +#: ../../library/os.rst:1586 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1490 +#: ../../library/os.rst:1604 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1499 +#: ../../library/os.rst:1613 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1509 +#: ../../library/os.rst:1623 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1643,7 +1757,15 @@ msgid "" "`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1523 +#: ../../library/os.rst:1632 +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 " +"filesystems could implement extra optimizations. The copy is done as if both " +"files are opened as binary." +msgstr "" + +#: ../../library/os.rst:1637 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, " @@ -1652,11 +1774,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1529 +#: ../../library/os.rst:1643 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1542 +#: ../../library/os.rst:1656 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1664,34 +1786,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1560 +#: ../../library/os.rst:1674 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:1563 ../../library/os.rst:1571 +#: ../../library/os.rst:1677 ../../library/os.rst:1685 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1568 +#: ../../library/os.rst:1682 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:1576 +#: ../../library/os.rst:1690 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:1585 +#: ../../library/os.rst:1699 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1591 +#: ../../library/os.rst:1705 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 " @@ -1700,7 +1822,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1605 +#: ../../library/os.rst:1719 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1708,70 +1830,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1610 +#: ../../library/os.rst:1724 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1623 +#: ../../library/os.rst:1737 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1629 +#: ../../library/os.rst:1743 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1632 +#: ../../library/os.rst:1746 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1635 +#: ../../library/os.rst:1749 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1638 +#: ../../library/os.rst:1752 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:1646 +#: ../../library/os.rst:1760 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1650 +#: ../../library/os.rst:1764 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1654 +#: ../../library/os.rst:1768 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1660 +#: ../../library/os.rst:1774 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1664 +#: ../../library/os.rst:1778 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:1668 +#: ../../library/os.rst:1782 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:1671 +#: ../../library/os.rst:1785 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, " @@ -1782,46 +1904,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1679 +#: ../../library/os.rst:1793 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1684 +#: ../../library/os.rst:1798 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1688 +#: ../../library/os.rst:1802 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1692 +#: ../../library/os.rst:1806 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1694 ../../library/os.rst:1700 -#: ../../library/os.rst:3651 ../../library/os.rst:4266 -#: ../../library/os.rst:4311 +#: ../../library/os.rst:1808 ../../library/os.rst:1814 +#: ../../library/os.rst:3881 ../../library/os.rst:4506 +#: ../../library/os.rst:4551 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1698 +#: ../../library/os.rst:1812 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1706 +#: ../../library/os.rst:1820 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1708 +#: ../../library/os.rst:1822 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1713 +#: ../../library/os.rst:1827 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. " @@ -1832,7 +1954,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1721 +#: ../../library/os.rst:1835 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 " @@ -1840,13 +1962,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1726 +#: ../../library/os.rst:1840 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:1731 +#: ../../library/os.rst:1845 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 " @@ -1857,14 +1979,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1738 +#: ../../library/os.rst:1852 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:1744 +#: ../../library/os.rst:1858 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 " @@ -1873,14 +1995,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1750 +#: ../../library/os.rst:1864 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:1758 +#: ../../library/os.rst:1872 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 " @@ -1892,13 +2014,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1767 +#: ../../library/os.rst:1881 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1770 +#: ../../library/os.rst:1884 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1907,7 +2029,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1778 +#: ../../library/os.rst:1892 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 " @@ -1916,117 +2038,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1789 +#: ../../library/os.rst:1903 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1801 +#: ../../library/os.rst:1915 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:1805 +#: ../../library/os.rst:1919 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1817 +#: ../../library/os.rst:1931 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:1826 +#: ../../library/os.rst:1940 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1828 +#: ../../library/os.rst:1942 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:1831 +#: ../../library/os.rst:1945 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1834 ../../library/os.rst:1967 +#: ../../library/os.rst:1948 ../../library/os.rst:2081 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1836 +#: ../../library/os.rst:1950 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1960 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:1849 +#: ../../library/os.rst:1963 msgid ":data:`stat.UF_NODUMP`" msgstr ":data:`stat.UF_NODUMP`" -#: ../../library/os.rst:1850 +#: ../../library/os.rst:1964 msgid ":data:`stat.UF_IMMUTABLE`" msgstr ":data:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1851 +#: ../../library/os.rst:1965 msgid ":data:`stat.UF_APPEND`" msgstr ":data:`stat.UF_APPEND`" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1966 msgid ":data:`stat.UF_OPAQUE`" msgstr ":data:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1853 +#: ../../library/os.rst:1967 msgid ":data:`stat.UF_NOUNLINK`" msgstr ":data:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1854 +#: ../../library/os.rst:1968 msgid ":data:`stat.UF_COMPRESSED`" msgstr ":data:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1855 +#: ../../library/os.rst:1969 msgid ":data:`stat.UF_HIDDEN`" msgstr ":data:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1856 +#: ../../library/os.rst:1970 msgid ":data:`stat.SF_ARCHIVED`" msgstr ":data:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1857 +#: ../../library/os.rst:1971 msgid ":data:`stat.SF_IMMUTABLE`" msgstr ":data:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1858 +#: ../../library/os.rst:1972 msgid ":data:`stat.SF_APPEND`" msgstr ":data:`stat.SF_APPEND`" -#: ../../library/os.rst:1859 +#: ../../library/os.rst:1973 msgid ":data:`stat.SF_NOUNLINK`" msgstr ":data:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1860 +#: ../../library/os.rst:1974 msgid ":data:`stat.SF_SNAPSHOT`" msgstr ":data:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1862 +#: ../../library/os.rst:1976 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1864 ../../library/os.rst:1993 +#: ../../library/os.rst:1978 ../../library/os.rst:2107 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2034,164 +2156,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:1868 +#: ../../library/os.rst:1982 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1877 +#: ../../library/os.rst:1991 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:1881 +#: ../../library/os.rst:1995 msgid ":data:`stat.S_ISUID`" msgstr ":data:`stat.S_ISUID`" -#: ../../library/os.rst:1882 +#: ../../library/os.rst:1996 msgid ":data:`stat.S_ISGID`" msgstr ":data:`stat.S_ISGID`" -#: ../../library/os.rst:1883 +#: ../../library/os.rst:1997 msgid ":data:`stat.S_ENFMT`" msgstr ":data:`stat.S_ENFMT`" -#: ../../library/os.rst:1884 +#: ../../library/os.rst:1998 msgid ":data:`stat.S_ISVTX`" msgstr ":data:`stat.S_ISVTX`" -#: ../../library/os.rst:1885 +#: ../../library/os.rst:1999 msgid ":data:`stat.S_IREAD`" msgstr ":data:`stat.S_IREAD`" -#: ../../library/os.rst:1886 +#: ../../library/os.rst:2000 msgid ":data:`stat.S_IWRITE`" msgstr ":data:`stat.S_IWRITE`" -#: ../../library/os.rst:1887 +#: ../../library/os.rst:2001 msgid ":data:`stat.S_IEXEC`" msgstr ":data:`stat.S_IEXEC`" -#: ../../library/os.rst:1888 +#: ../../library/os.rst:2002 msgid ":data:`stat.S_IRWXU`" msgstr ":data:`stat.S_IRWXU`" -#: ../../library/os.rst:1889 +#: ../../library/os.rst:2003 msgid ":data:`stat.S_IRUSR`" msgstr ":data:`stat.S_IRUSR`" -#: ../../library/os.rst:1890 +#: ../../library/os.rst:2004 msgid ":data:`stat.S_IWUSR`" msgstr ":data:`stat.S_IWUSR`" -#: ../../library/os.rst:1891 +#: ../../library/os.rst:2005 msgid ":data:`stat.S_IXUSR`" msgstr ":data:`stat.S_IXUSR`" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:2006 msgid ":data:`stat.S_IRWXG`" msgstr ":data:`stat.S_IRWXG`" -#: ../../library/os.rst:1893 +#: ../../library/os.rst:2007 msgid ":data:`stat.S_IRGRP`" msgstr ":data:`stat.S_IRGRP`" -#: ../../library/os.rst:1894 +#: ../../library/os.rst:2008 msgid ":data:`stat.S_IWGRP`" msgstr ":data:`stat.S_IWGRP`" -#: ../../library/os.rst:1895 +#: ../../library/os.rst:2009 msgid ":data:`stat.S_IXGRP`" msgstr ":data:`stat.S_IXGRP`" -#: ../../library/os.rst:1896 +#: ../../library/os.rst:2010 msgid ":data:`stat.S_IRWXO`" msgstr ":data:`stat.S_IRWXO`" -#: ../../library/os.rst:1897 +#: ../../library/os.rst:2011 msgid ":data:`stat.S_IROTH`" msgstr ":data:`stat.S_IROTH`" -#: ../../library/os.rst:1898 +#: ../../library/os.rst:2012 msgid ":data:`stat.S_IWOTH`" msgstr ":data:`stat.S_IWOTH`" -#: ../../library/os.rst:1899 +#: ../../library/os.rst:2013 msgid ":data:`stat.S_IXOTH`" msgstr ":data:`stat.S_IXOTH`" -#: ../../library/os.rst:1901 ../../library/os.rst:1929 -#: ../../library/os.rst:3192 +#: ../../library/os.rst:2015 ../../library/os.rst:2043 +#: ../../library/os.rst:3422 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:1907 +#: ../../library/os.rst:2021 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:1916 ../../library/os.rst:1943 +#: ../../library/os.rst:2030 ../../library/os.rst:2057 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1926 +#: ../../library/os.rst:2040 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:1933 +#: ../../library/os.rst:2047 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:1947 +#: ../../library/os.rst:2061 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1953 +#: ../../library/os.rst:2067 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:1963 +#: ../../library/os.rst:2077 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:1974 +#: ../../library/os.rst:2088 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:1979 +#: ../../library/os.rst:2093 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:1981 +#: ../../library/os.rst:2095 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:1989 +#: ../../library/os.rst:2103 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:2003 +#: ../../library/os.rst:2117 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` " @@ -2199,25 +2321,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2017 +#: ../../library/os.rst:2131 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:2031 +#: ../../library/os.rst:2145 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2033 +#: ../../library/os.rst:2147 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:2037 +#: ../../library/os.rst:2151 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2225,20 +2347,20 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2041 +#: ../../library/os.rst:2155 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2158 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:2047 ../../library/os.rst:2402 -#: ../../library/os.rst:2439 ../../library/os.rst:3114 +#: ../../library/os.rst:2161 ../../library/os.rst:2579 +#: ../../library/os.rst:2616 ../../library/os.rst:3344 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2053 +#: ../../library/os.rst:2167 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 " @@ -2247,7 +2369,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2059 +#: ../../library/os.rst:2173 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2255,74 +2377,160 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2064 ../../library/os.rst:2487 +#: ../../library/os.rst:2178 ../../library/os.rst:2664 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2067 +#: ../../library/os.rst:2181 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2070 +#: ../../library/os.rst:2184 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2074 +#: ../../library/os.rst:2188 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:2078 +#: ../../library/os.rst:2192 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2081 ../../library/os.rst:2973 +#: ../../library/os.rst:2195 ../../library/os.rst:3203 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2090 +#: ../../library/os.rst:2204 +msgid "Return a list containing the names of drives on a Windows system." +msgstr "" + +#: ../../library/os.rst:2206 +msgid "" +"A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " +"associated with a volume, and some may be inaccessible for a variety of " +"reasons, including permissions, network connectivity or missing media. This " +"function does not test for access." +msgstr "" + +#: ../../library/os.rst:2211 +msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." +msgstr "" + +#: ../../library/os.rst:2214 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``os.listdrives`` with no " +"arguments." +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" + +#: ../../library/os.rst:2216 ../../library/os.rst:2240 +#: ../../library/os.rst:2260 +#, fuzzy +msgid ":ref:`Availability `: Windows" +msgstr ":ref:`適用 `:Windows。" + +#: ../../library/os.rst:2223 +msgid "" +"Return a list containing the mount points for a volume on a Windows system." +msgstr "" + +#: ../../library/os.rst:2226 +msgid "" +"*volume* must be represented as a GUID path, like those returned by :func:" +"`os.listvolumes`. Volumes may be mounted in multiple locations or not at " +"all. In the latter case, the list will be empty. Mount points that are not " +"associated with a volume will not be returned by this function." +msgstr "" + +#: ../../library/os.rst:2232 +msgid "" +"The mount points return by this function will be absolute paths, and may be " +"longer than the drive name." +msgstr "" + +#: ../../library/os.rst:2235 +msgid "" +"Raises :exc:`OSError` if the volume is not recognized or if an error occurs " +"collecting the paths." +msgstr "" + +#: ../../library/os.rst:2238 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``os.listmounts`` with argument " +"``volume``." +msgstr "" +"引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" + +#: ../../library/os.rst:2247 +msgid "Return a list containing the volumes in the system." +msgstr "" + +#: ../../library/os.rst:2249 +msgid "" +"Volumes are typically represented as a GUID path that looks like ``\\\\?" +"\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " +"accessed through a GUID path, permissions allowing. However, users are " +"generally not familiar with them, and so the recommended use of this " +"function is to retrieve mount points using :func:`os.listmounts`." +msgstr "" + +#: ../../library/os.rst:2256 +msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." +msgstr "" + +#: ../../library/os.rst:2258 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``os.listvolumes`` with no " +"arguments." +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" + +#: ../../library/os.rst:2267 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:2094 +#: ../../library/os.rst:2271 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2097 +#: ../../library/os.rst:2274 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2100 ../../library/os.rst:2138 -#: ../../library/os.rst:2203 ../../library/os.rst:2231 -#: ../../library/os.rst:2305 +#: ../../library/os.rst:2277 ../../library/os.rst:2315 +#: ../../library/os.rst:2380 ../../library/os.rst:2408 +#: ../../library/os.rst:2482 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2107 ../../library/os.rst:2314 -#: ../../library/os.rst:3107 +#: ../../library/os.rst:2284 ../../library/os.rst:2491 +#: ../../library/os.rst:3337 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2110 +#: ../../library/os.rst:2287 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2116 +#: ../../library/os.rst:2293 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2330,18 +2538,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2125 +#: ../../library/os.rst:2302 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2127 +#: ../../library/os.rst:2304 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:2132 +#: ../../library/os.rst:2309 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 " @@ -2350,13 +2558,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2141 +#: ../../library/os.rst:2318 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2144 ../../library/os.rst:2178 +#: ../../library/os.rst:2321 ../../library/os.rst:2355 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2364,13 +2572,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2159 +#: ../../library/os.rst:2336 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2162 +#: ../../library/os.rst:2339 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2379,27 +2587,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2168 +#: ../../library/os.rst:2345 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2173 +#: ../../library/os.rst:2350 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2176 +#: ../../library/os.rst:2353 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2180 +#: ../../library/os.rst:2357 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2185 +#: ../../library/os.rst:2362 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 " @@ -2407,19 +2615,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2193 +#: ../../library/os.rst:2370 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2200 +#: ../../library/os.rst:2377 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:2206 +#: ../../library/os.rst:2383 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 " @@ -2429,7 +2637,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2223 +#: ../../library/os.rst:2400 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 " @@ -2440,23 +2648,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2245 +#: ../../library/os.rst:2422 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:2251 +#: ../../library/os.rst:2428 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:2257 +#: ../../library/os.rst:2434 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2262 +#: ../../library/os.rst:2439 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2467,20 +2675,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2275 ../../library/os.rst:2966 -#: ../../library/os.rst:3135 +#: ../../library/os.rst:2452 ../../library/os.rst:3196 +#: ../../library/os.rst:3365 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2286 +#: ../../library/os.rst:2463 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:2295 +#: ../../library/os.rst:2472 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 " @@ -2488,7 +2696,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2477 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 " @@ -2496,42 +2704,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2308 +#: ../../library/os.rst:2485 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:2320 +#: ../../library/os.rst:2497 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2323 +#: ../../library/os.rst:2500 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2326 +#: ../../library/os.rst:2503 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:2333 +#: ../../library/os.rst:2510 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2337 ../../library/os.rst:2450 -#: ../../library/os.rst:3086 +#: ../../library/os.rst:2514 ../../library/os.rst:2627 +#: ../../library/os.rst:3316 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2340 +#: ../../library/os.rst:2517 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 " @@ -2539,12 +2747,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2344 +#: ../../library/os.rst:2521 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2346 ../../library/os.rst:2368 -#: ../../library/os.rst:3157 +#: ../../library/os.rst:2523 ../../library/os.rst:2545 +#: ../../library/os.rst:3387 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2552,7 +2760,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2359 +#: ../../library/os.rst:2536 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2564,20 +2772,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2553 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:2379 +#: ../../library/os.rst:2556 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2383 +#: ../../library/os.rst:2560 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 " @@ -2589,20 +2797,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2392 ../../library/os.rst:2432 +#: ../../library/os.rst:2569 ../../library/os.rst:2609 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:2395 +#: ../../library/os.rst:2572 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2397 ../../library/os.rst:2418 -#: ../../library/os.rst:2435 +#: ../../library/os.rst:2574 ../../library/os.rst:2595 +#: ../../library/os.rst:2612 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2610,11 +2818,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2399 +#: ../../library/os.rst:2576 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2408 +#: ../../library/os.rst:2585 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2623,17 +2831,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2415 +#: ../../library/os.rst:2592 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:2420 +#: ../../library/os.rst:2597 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2426 +#: ../../library/os.rst:2603 msgid "" "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 " @@ -2642,7 +2850,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2445 +#: ../../library/os.rst:2622 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2650,7 +2858,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2453 +#: ../../library/os.rst:2630 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2658,11 +2866,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2455 ../../library/os.rst:3159 +#: ../../library/os.rst:2632 ../../library/os.rst:3389 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2464 +#: ../../library/os.rst:2641 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2672,7 +2880,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2471 +#: ../../library/os.rst:2648 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2684,7 +2892,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2481 +#: ../../library/os.rst:2658 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 " @@ -2693,31 +2901,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2490 +#: ../../library/os.rst:2667 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2492 +#: ../../library/os.rst:2669 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2497 +#: ../../library/os.rst:2674 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2499 +#: ../../library/os.rst:2676 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:2506 +#: ../../library/os.rst:2683 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 " @@ -2725,7 +2933,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2518 +#: ../../library/os.rst:2695 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2736,7 +2944,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2530 +#: ../../library/os.rst:2707 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2744,28 +2952,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2536 +#: ../../library/os.rst:2713 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2538 +#: ../../library/os.rst:2715 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2544 +#: ../../library/os.rst:2721 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2547 +#: ../../library/os.rst:2724 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:2551 +#: ../../library/os.rst:2728 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 " @@ -2773,7 +2981,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2733 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 " @@ -2781,29 +2989,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2738 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2564 +#: ../../library/os.rst:2741 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2568 +#: ../../library/os.rst:2745 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2571 +#: ../../library/os.rst:2748 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:2577 +#: ../../library/os.rst:2754 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 " @@ -2813,51 +3021,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2584 +#: ../../library/os.rst:2761 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:2590 +#: ../../library/os.rst:2767 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2592 +#: ../../library/os.rst:2769 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:2596 +#: ../../library/os.rst:2773 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2601 +#: ../../library/os.rst:2778 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:2605 +#: ../../library/os.rst:2782 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:2609 +#: ../../library/os.rst:2786 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:2613 +#: ../../library/os.rst:2790 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 " @@ -2867,46 +3075,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2620 ../../library/os.rst:2650 +#: ../../library/os.rst:2797 ../../library/os.rst:2827 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2802 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:2629 +#: ../../library/os.rst:2806 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:2633 +#: ../../library/os.rst:2810 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:2638 +#: ../../library/os.rst:2815 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:2642 +#: ../../library/os.rst:2819 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:2645 +#: ../../library/os.rst:2822 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 " @@ -2914,49 +3122,70 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2655 +#: ../../library/os.rst:2832 +msgid "" +"Return ``True`` if this entry is a junction (even if broken); return " +"``False`` if the entry points to a regular directory, any kind of file, a " +"symlink, or if it doesn't exist anymore." +msgstr "" + +#: ../../library/os.rst:2836 +msgid "" +"The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." +"isjunction` to fetch up-to-date information." +msgstr "" + +#: ../../library/os.rst:2843 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:2659 +#: ../../library/os.rst:2847 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:2664 +#: ../../library/os.rst:2852 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:2668 +#: ../../library/os.rst:2856 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:2672 +#: ../../library/os.rst:2860 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " "``name`` attribute has the same meaning, as do the ``is_dir()``, " -"``is_file()``, ``is_symlink()`` and ``stat()`` methods." +"``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2680 +#: ../../library/os.rst:2868 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2687 +#: ../../library/os.rst:2872 +msgid "" +"The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " +"file creation time is properly available as ``st_birthtime``, and in the " +"future ``st_ctime`` may be changed to return zero or the metadata change " +"time, if available." +msgstr "" + +#: ../../library/os.rst:2881 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 " @@ -2965,21 +3194,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2693 +#: ../../library/os.rst:2887 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2696 ../../library/os.rst:3525 -#: ../../library/os.rst:3541 ../../library/os.rst:3557 -#: ../../library/os.rst:3577 +#: ../../library/os.rst:2890 ../../library/os.rst:3755 +#: ../../library/os.rst:3771 ../../library/os.rst:3787 +#: ../../library/os.rst:3807 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2699 +#: ../../library/os.rst:2893 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2993,24 +3222,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2712 ../../library/os.rst:3445 +#: ../../library/os.rst:2906 ../../library/os.rst:3675 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2725 +#: ../../library/os.rst:2919 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2727 +#: ../../library/os.rst:2921 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2734 +#: ../../library/os.rst:2928 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3020,191 +3249,212 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2745 +#: ../../library/os.rst:2939 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:2749 +#: ../../library/os.rst:2943 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2753 +#: ../../library/os.rst:2947 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2757 +#: ../../library/os.rst:2951 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2760 +#: ../../library/os.rst:2954 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2955 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2767 +#: ../../library/os.rst:2961 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2771 +#: ../../library/os.rst:2965 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2775 +#: ../../library/os.rst:2969 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2779 +#: ../../library/os.rst:2973 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2783 +#: ../../library/os.rst:2977 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:2787 +#: ../../library/os.rst:2981 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2791 +#: ../../library/os.rst:2985 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2795 +#: ../../library/os.rst:2989 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2799 ../../library/os.rst:2815 -msgid "Platform dependent:" -msgstr "" - -#: ../../library/os.rst:2801 ../../library/os.rst:2817 -msgid "the time of most recent metadata change on Unix," +#: ../../library/os.rst:2993 +msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:2802 -msgid "the time of creation on Windows, expressed in seconds." +#: ../../library/os.rst:2995 +msgid "" +"``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " +"creation time. In the future, ``st_ctime`` will contain the time of the most " +"recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:2806 +#: ../../library/os.rst:3002 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2810 +#: ../../library/os.rst:3006 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:3011 +msgid "" +"Time of most recent metadata change expressed in nanoseconds as an integer." +msgstr "" + +#: ../../library/os.rst:3014 +msgid "" +"``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " +"file creation time. In the future, ``st_ctime`` will contain the time of the " +"most recent metadata change, as for other platforms." +msgstr "" + +#: ../../library/os.rst:3021 +msgid "" +"Time of file creation expressed in seconds. This attribute is not always " +"available, and may raise :exc:`AttributeError`." +msgstr "" + +#: ../../library/os.rst:3024 +msgid "``st_birthtime`` is now available on Windows." +msgstr "" + +#: ../../library/os.rst:3029 msgid "" -"the time of creation on Windows, expressed in nanoseconds as an integer." +"Time of file creation expressed in nanoseconds as an integer. This attribute " +"is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:2823 +#: ../../library/os.rst:3037 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 " -"system. For example, on Windows systems using the FAT or FAT32 file " -"systems, :attr:`st_mtime` has 2-second resolution, and :attr:`st_atime` has " -"only 1-day resolution. See your operating system documentation for details." +"The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" +"attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " +"system and the file system. For example, on Windows systems using the FAT32 " +"file systems, :attr:`st_mtime` has 2-second resolution, and :attr:`st_atime` " +"has only 1-day resolution. See your operating system documentation for " +"details." msgstr "" -#: ../../library/os.rst:2830 +#: ../../library/os.rst:3044 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 " -"provide nanosecond precision. On systems that do provide nanosecond " -"precision, the floating-point object used to store :attr:`st_atime`, :attr:" -"`st_mtime`, and :attr:`st_ctime` cannot preserve all of it, and as such will " -"be slightly inexact. If you need the exact timestamps you should always use :" -"attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." +"Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" +"`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " +"nanoseconds, many systems do not provide nanosecond precision. On systems " +"that do provide nanosecond precision, the floating-point object used to " +"store :attr:`st_atime`, :attr:`st_mtime`, :attr:`st_ctime` and :attr:" +"`st_birthtime` cannot preserve all of it, and as such will be slightly " +"inexact. If you need the exact timestamps you should always use :attr:" +"`st_atime_ns`, :attr:`st_mtime_ns`, :attr:`st_ctime_ns` and :attr:" +"`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:2839 +#: ../../library/os.rst:3054 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2844 +#: ../../library/os.rst:3059 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:2849 +#: ../../library/os.rst:3064 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:2854 +#: ../../library/os.rst:3069 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2858 +#: ../../library/os.rst:3073 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2860 +#: ../../library/os.rst:3075 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:2865 +#: ../../library/os.rst:3080 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2869 -msgid "Time of file creation." -msgstr "" - -#: ../../library/os.rst:2871 +#: ../../library/os.rst:3082 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2876 +#: ../../library/os.rst:3087 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2879 +#: ../../library/os.rst:3090 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2883 +#: ../../library/os.rst:3094 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:3098 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2891 +#: ../../library/os.rst:3102 msgid "File type." msgstr "" -#: ../../library/os.rst:2893 +#: ../../library/os.rst:3104 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2897 +#: ../../library/os.rst:3108 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -3212,21 +3462,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2904 +#: ../../library/os.rst:3115 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:2908 +#: ../../library/os.rst:3119 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:2912 +#: ../../library/os.rst:3123 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 " @@ -3238,35 +3488,59 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:3132 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2925 +#: ../../library/os.rst:3136 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2928 +#: ../../library/os.rst:3139 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2932 +#: ../../library/os.rst:3143 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2935 +#: ../../library/os.rst:3146 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2938 +#: ../../library/os.rst:3149 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:2945 +#: ../../library/os.rst:3154 +msgid "" +"On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " +"last metadata change time, for consistency with other platforms, but for now " +"still contains creation time. Use :attr:`st_birthtime` for the creation time." +msgstr "" + +#: ../../library/os.rst:3160 +msgid "" +"On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " +"system. Previously it would not be above 64 bits, and larger file " +"identifiers would be arbitrarily packed." +msgstr "" + +#: ../../library/os.rst:3165 +msgid "" +"On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " +"contain the same as :attr:`st_dev`, which was incorrect." +msgstr "" + +#: ../../library/os.rst:3169 +msgid "Added the :attr:`st_birthtime` member on Windows." +msgstr "" + +#: ../../library/os.rst:3175 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 " @@ -3276,7 +3550,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2952 +#: ../../library/os.rst:3182 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-" @@ -3284,7 +3558,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2957 +#: ../../library/os.rst:3187 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3297,11 +3571,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2970 +#: ../../library/os.rst:3200 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:2976 +#: ../../library/os.rst:3206 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3309,11 +3583,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2985 +#: ../../library/os.rst:3215 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:3221 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3325,7 +3599,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3001 +#: ../../library/os.rst:3231 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 " @@ -3333,13 +3607,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3008 +#: ../../library/os.rst:3238 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3016 +#: ../../library/os.rst:3246 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3348,19 +3622,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3022 +#: ../../library/os.rst:3252 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3027 +#: ../../library/os.rst:3257 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3035 +#: ../../library/os.rst:3265 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 " @@ -3369,7 +3643,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3042 +#: ../../library/os.rst:3272 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3378,7 +3652,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3055 +#: ../../library/os.rst:3285 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3391,7 +3665,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3065 +#: ../../library/os.rst:3295 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3400,11 +3674,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3078 +#: ../../library/os.rst:3308 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3080 +#: ../../library/os.rst:3310 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 " @@ -3414,7 +3688,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3091 +#: ../../library/os.rst:3321 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3422,12 +3696,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3097 +#: ../../library/os.rst:3327 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3100 +#: ../../library/os.rst:3330 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3435,27 +3709,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3110 +#: ../../library/os.rst:3340 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3117 +#: ../../library/os.rst:3347 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3123 +#: ../../library/os.rst:3353 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3132 +#: ../../library/os.rst:3362 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3137 +#: ../../library/os.rst:3367 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3463,46 +3737,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3152 +#: ../../library/os.rst:3382 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:3168 +#: ../../library/os.rst:3398 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3170 +#: ../../library/os.rst:3400 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:3173 +#: ../../library/os.rst:3403 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:3176 +#: ../../library/os.rst:3406 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:3179 +#: ../../library/os.rst:3409 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:3183 +#: ../../library/os.rst:3413 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3185 +#: ../../library/os.rst:3415 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 " @@ -3512,7 +3786,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3196 +#: ../../library/os.rst:3426 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3520,13 +3794,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3198 +#: ../../library/os.rst:3428 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3212 +#: ../../library/os.rst:3442 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* " @@ -3534,7 +3808,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3217 +#: ../../library/os.rst:3447 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3548,7 +3822,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3228 +#: ../../library/os.rst:3458 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 " @@ -3559,7 +3833,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3236 +#: ../../library/os.rst:3466 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3572,7 +3846,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3245 +#: ../../library/os.rst:3475 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 " @@ -3582,42 +3856,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3251 +#: ../../library/os.rst:3481 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:3257 +#: ../../library/os.rst:3487 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:3263 +#: ../../library/os.rst:3493 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:3267 ../../library/os.rst:3328 +#: ../../library/os.rst:3497 ../../library/os.rst:3558 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:3280 +#: ../../library/os.rst:3510 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:3295 +#: ../../library/os.rst:3525 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3625,25 +3899,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3297 +#: ../../library/os.rst:3527 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:3311 +#: ../../library/os.rst:3541 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:3314 +#: ../../library/os.rst:3544 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:3317 +#: ../../library/os.rst:3547 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3651,20 +3925,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3324 +#: ../../library/os.rst:3554 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:3341 +#: ../../library/os.rst:3571 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:3356 +#: ../../library/os.rst:3586 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -3672,11 +3946,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3365 +#: ../../library/os.rst:3595 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3371 +#: ../../library/os.rst:3601 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 " @@ -3684,7 +3958,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3376 +#: ../../library/os.rst:3606 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/" @@ -3694,23 +3968,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3383 +#: ../../library/os.rst:3613 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3406 +#: ../../library/os.rst:3636 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3408 +#: ../../library/os.rst:3638 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3410 +#: ../../library/os.rst:3640 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3417 +#: ../../library/os.rst:3647 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." @@ -3719,7 +3993,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3423 +#: ../../library/os.rst:3653 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 " @@ -3727,87 +4001,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3428 +#: ../../library/os.rst:3658 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3431 +#: ../../library/os.rst:3661 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:3434 +#: ../../library/os.rst:3664 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:3438 +#: ../../library/os.rst:3668 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3441 +#: ../../library/os.rst:3671 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:3462 +#: ../../library/os.rst:3692 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3698 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:3471 ../../library/os.rst:3480 -#: ../../library/os.rst:3488 ../../library/os.rst:3497 +#: ../../library/os.rst:3701 ../../library/os.rst:3710 +#: ../../library/os.rst:3718 ../../library/os.rst:3727 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3477 +#: ../../library/os.rst:3707 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:3486 +#: ../../library/os.rst:3716 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3494 +#: ../../library/os.rst:3724 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3503 +#: ../../library/os.rst:3733 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:3506 +#: ../../library/os.rst:3736 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3512 +#: ../../library/os.rst:3742 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3516 +#: ../../library/os.rst:3746 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3520 +#: ../../library/os.rst:3750 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3815,7 +4089,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3528 +#: ../../library/os.rst:3758 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -3823,12 +4097,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3530 ../../library/os.rst:3562 -#: ../../library/os.rst:3587 +#: ../../library/os.rst:3760 ../../library/os.rst:3792 +#: ../../library/os.rst:3817 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3536 +#: ../../library/os.rst:3766 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3836,14 +4110,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3544 +#: ../../library/os.rst:3774 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3552 +#: ../../library/os.rst:3782 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3851,7 +4125,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3560 +#: ../../library/os.rst:3790 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -3859,7 +4133,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3568 +#: ../../library/os.rst:3798 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3871,13 +4145,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3582 +#: ../../library/os.rst:3812 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:3585 +#: ../../library/os.rst:3815 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -3885,33 +4159,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3593 +#: ../../library/os.rst:3823 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3599 +#: ../../library/os.rst:3829 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:3605 +#: ../../library/os.rst:3835 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:3612 +#: ../../library/os.rst:3842 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3614 +#: ../../library/os.rst:3844 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3616 +#: ../../library/os.rst:3846 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 " @@ -3922,7 +4196,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3627 +#: ../../library/os.rst:3857 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 " @@ -3931,31 +4205,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3636 +#: ../../library/os.rst:3866 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3638 +#: ../../library/os.rst:3868 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:3642 +#: ../../library/os.rst:3872 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3645 +#: ../../library/os.rst:3875 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3649 +#: ../../library/os.rst:3879 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -3963,7 +4237,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3883 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3971,14 +4245,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3660 +#: ../../library/os.rst:3890 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:3675 +#: ../../library/os.rst:3905 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 " @@ -3986,7 +4260,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3680 +#: ../../library/os.rst:3910 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 " @@ -3994,7 +4268,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3686 +#: ../../library/os.rst:3916 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4007,7 +4281,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3925 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4017,10 +4291,11 @@ msgid "" "of the :envvar:`PATH` variable. The other variants, :func:`execl`, :func:" "`execle`, :func:`execv`, and :func:`execve`, will not use the :envvar:`PATH` " "variable to locate the executable; *path* must contain an appropriate " -"absolute or relative path." +"absolute or relative path. Relative paths must include at least one slash, " +"even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3705 +#: ../../library/os.rst:3936 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 " @@ -4030,7 +4305,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3712 +#: ../../library/os.rst:3943 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 " @@ -4039,7 +4314,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3717 +#: ../../library/os.rst:3948 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4047,25 +4322,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3721 +#: ../../library/os.rst:3952 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3730 +#: ../../library/os.rst:3961 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3735 +#: ../../library/os.rst:3966 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3738 +#: ../../library/os.rst:3969 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 " @@ -4073,125 +4348,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3744 +#: ../../library/os.rst:3975 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:3751 +#: ../../library/os.rst:3982 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:3759 +#: ../../library/os.rst:3990 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3767 +#: ../../library/os.rst:3998 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3774 +#: ../../library/os.rst:4005 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3781 +#: ../../library/os.rst:4012 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:4019 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3795 +#: ../../library/os.rst:4026 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3802 +#: ../../library/os.rst:4033 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3809 +#: ../../library/os.rst:4040 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:3817 +#: ../../library/os.rst:4048 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:3825 +#: ../../library/os.rst:4056 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3832 +#: ../../library/os.rst:4063 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3839 +#: ../../library/os.rst:4070 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:3848 +#: ../../library/os.rst:4079 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3856 +#: ../../library/os.rst:4087 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:3864 +#: ../../library/os.rst:4095 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3871 +#: ../../library/os.rst:4102 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3878 +#: ../../library/os.rst:4109 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:3881 +#: ../../library/os.rst:4112 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:3884 +#: ../../library/os.rst:4115 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:4117 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3892 +#: ../../library/os.rst:4123 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:4130 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, " @@ -4200,24 +4475,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3905 +#: ../../library/os.rst:4136 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:3907 +#: ../../library/os.rst:4138 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3920 +#: ../../library/os.rst:4151 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:3923 +#: ../../library/os.rst:4154 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 " @@ -4227,11 +4502,11 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3931 +#: ../../library/os.rst:4162 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:3933 +#: ../../library/os.rst:4164 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4239,15 +4514,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:3937 +#: ../../library/os.rst:4168 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:4178 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:3949 +#: ../../library/os.rst:4180 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4255,34 +4530,46 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:3956 +#: ../../library/os.rst:4187 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:4194 msgid "" -"Return a file descriptor referring to the process *pid*. This descriptor " -"can be used to perform process management without races and signals. The " -"*flags* argument is provided for future extensions; no flag values are " -"currently defined." +"Return a file descriptor referring to the process *pid* with *flags* set. " +"This descriptor can be used to perform process management without races and " +"signals." msgstr "" -#: ../../library/os.rst:3968 +#: ../../library/os.rst:4198 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3970 +#: ../../library/os.rst:4200 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:3976 +#: ../../library/os.rst:4205 +msgid "" +"This flag indicates that the file descriptor will be non-blocking. If the " +"process referred to by the file descriptor has not yet terminated, then an " +"attempt to wait on the file descriptor using :manpage:`waitid(2)` will " +"immediately return the error :data:`~errno.EAGAIN` rather than blocking." +msgstr "" + +#: ../../library/os.rst:4210 +#, fuzzy +msgid ":ref:`Availability `: Linux >= 5.10" +msgstr ":ref:`適用 `:Linux 5.3 以上" + +#: ../../library/os.rst:4216 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3984 +#: ../../library/os.rst:4224 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 " @@ -4292,7 +4579,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:3992 +#: ../../library/os.rst:4232 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4304,60 +4591,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:4242 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:4007 +#: ../../library/os.rst:4247 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:4011 +#: ../../library/os.rst:4251 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4014 +#: ../../library/os.rst:4254 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4257 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4266 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4028 +#: ../../library/os.rst:4268 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4030 +#: ../../library/os.rst:4270 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4033 +#: ../../library/os.rst:4273 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:4037 +#: ../../library/os.rst:4277 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 " @@ -4366,31 +4653,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4045 +#: ../../library/os.rst:4285 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4047 +#: ../../library/os.rst:4287 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4051 +#: ../../library/os.rst:4291 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4053 +#: ../../library/os.rst:4293 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4057 +#: ../../library/os.rst:4297 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4059 +#: ../../library/os.rst:4299 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4301 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4399,7 +4686,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4067 +#: ../../library/os.rst:4307 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 " @@ -4408,7 +4695,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4073 +#: ../../library/os.rst:4313 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 " @@ -4419,7 +4706,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4081 +#: ../../library/os.rst:4321 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:" @@ -4427,7 +4714,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:4086 +#: ../../library/os.rst:4326 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 " @@ -4435,14 +4722,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4091 +#: ../../library/os.rst:4331 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:4095 +#: ../../library/os.rst:4335 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4452,7 +4739,7 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4102 ../../library/os.rst:4118 +#: ../../library/os.rst:4342 ../../library/os.rst:4358 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4460,76 +4747,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4352 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4114 +#: ../../library/os.rst:4354 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:4122 +#: ../../library/os.rst:4362 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4124 +#: ../../library/os.rst:4364 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4370 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:4135 +#: ../../library/os.rst:4375 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4136 +#: ../../library/os.rst:4376 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4378 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4140 +#: ../../library/os.rst:4380 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:4144 +#: ../../library/os.rst:4384 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:4149 +#: ../../library/os.rst:4389 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:4153 +#: ../../library/os.rst:4393 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4169 +#: ../../library/os.rst:4409 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4171 +#: ../../library/os.rst:4411 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4537,7 +4824,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4176 +#: ../../library/os.rst:4416 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 " @@ -4546,13 +4833,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4182 +#: ../../library/os.rst:4422 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:4185 +#: ../../library/os.rst:4425 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4564,7 +4851,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4434 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4577,7 +4864,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4444 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 " @@ -4589,13 +4876,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4213 +#: ../../library/os.rst:4453 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4222 +#: ../../library/os.rst:4462 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4603,7 +4890,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4226 +#: ../../library/os.rst:4466 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4611,7 +4898,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4238 +#: ../../library/os.rst:4478 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4619,7 +4906,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4488 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4628,7 +4915,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4260 +#: ../../library/os.rst:4500 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4638,49 +4925,48 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4271 +#: ../../library/os.rst:4511 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4513 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 " -"argument to the :program:`start` command from the interactive command shell: " -"the file is opened with whatever application (if any) its extension is " -"associated." +"When *operation* is not specified, this acts like double-clicking the file " +"in Windows Explorer, or giving the file name as an argument to the :program:" +"`start` command from the interactive command shell: the file is opened with " +"whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4278 +#: ../../library/os.rst:4518 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 " -"Microsoft are ``'print'`` and ``'edit'`` (to be used on files) as well as " -"``'explore'`` and ``'find'`` (to be used on directories)." +"Microsoft are ``'open'``, ``'print'`` and ``'edit'`` (to be used on files) " +"as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4283 +#: ../../library/os.rst:4523 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:4287 +#: ../../library/os.rst:4527 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:4291 +#: ../../library/os.rst:4531 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:4295 +#: ../../library/os.rst:4535 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 " @@ -4691,14 +4977,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4303 +#: ../../library/os.rst:4543 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:4307 +#: ../../library/os.rst:4547 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -4706,7 +4992,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4309 +#: ../../library/os.rst:4549 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -4714,13 +5000,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4553 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4320 +#: ../../library/os.rst:4560 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 " @@ -4731,13 +5017,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4568 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:4331 +#: ../../library/os.rst:4571 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 :" @@ -4746,7 +5032,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4337 +#: ../../library/os.rst:4577 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4754,54 +5040,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4582 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:4346 +#: ../../library/os.rst:4586 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4593 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4596 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4597 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4358 +#: ../../library/os.rst:4598 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4359 +#: ../../library/os.rst:4599 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4360 +#: ../../library/os.rst:4600 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4362 +#: ../../library/os.rst:4602 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:4366 +#: ../../library/os.rst:4606 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -4811,7 +5097,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4380 +#: ../../library/os.rst:4620 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -4820,83 +5106,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4386 +#: ../../library/os.rst:4626 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4389 ../../library/os.rst:4461 +#: ../../library/os.rst:4629 ../../library/os.rst:4701 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4396 +#: ../../library/os.rst:4636 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4403 +#: ../../library/os.rst:4643 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4405 +#: ../../library/os.rst:4645 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4408 +#: ../../library/os.rst:4648 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4652 msgid "" "The return value is an object representing the data contained in the :c:type:" "`!siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4415 +#: ../../library/os.rst:4655 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4656 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4417 +#: ../../library/os.rst:4657 msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4658 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4419 +#: ../../library/os.rst:4659 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4421 +#: ../../library/os.rst:4661 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4433 +#: ../../library/os.rst:4673 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4675 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 " @@ -4905,7 +5191,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4440 +#: ../../library/os.rst:4680 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 " @@ -4915,7 +5201,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4447 +#: ../../library/os.rst:4687 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -4924,7 +5210,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4693 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 " @@ -4936,7 +5222,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4474 +#: ../../library/os.rst:4714 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 " @@ -4945,13 +5231,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4481 ../../library/os.rst:4495 +#: ../../library/os.rst:4721 ../../library/os.rst:4735 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4489 +#: ../../library/os.rst:4729 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4960,118 +5246,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4506 +#: ../../library/os.rst:4746 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4749 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4510 +#: ../../library/os.rst:4750 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4511 +#: ../../library/os.rst:4751 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4512 +#: ../../library/os.rst:4752 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4517 +#: ../../library/os.rst:4757 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4520 +#: ../../library/os.rst:4760 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4526 +#: ../../library/os.rst:4766 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4535 +#: ../../library/os.rst:4775 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4538 +#: ../../library/os.rst:4778 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4548 +#: ../../library/os.rst:4788 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4551 ../../library/os.rst:4583 +#: ../../library/os.rst:4791 ../../library/os.rst:4823 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4800 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4564 +#: ../../library/os.rst:4804 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4571 +#: ../../library/os.rst:4811 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4580 +#: ../../library/os.rst:4820 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4595 +#: ../../library/os.rst:4835 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4842 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4608 +#: ../../library/os.rst:4848 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4850 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4612 +#: ../../library/os.rst:4852 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:4615 +#: ../../library/os.rst:4855 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 " @@ -5079,15 +5365,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4619 +#: ../../library/os.rst:4859 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4621 +#: ../../library/os.rst:4861 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4623 +#: ../../library/os.rst:4863 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 " @@ -5095,217 +5381,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4630 +#: ../../library/os.rst:4870 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4878 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:4644 +#: ../../library/os.rst:4884 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4647 ../../library/os.rst:4713 +#: ../../library/os.rst:4887 ../../library/os.rst:4953 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4894 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:4658 +#: ../../library/os.rst:4898 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4665 +#: ../../library/os.rst:4905 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4908 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:4676 +#: ../../library/os.rst:4916 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4684 +#: ../../library/os.rst:4924 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:4693 +#: ../../library/os.rst:4933 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4695 +#: ../../library/os.rst:4935 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4702 +#: ../../library/os.rst:4942 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4944 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4711 +#: ../../library/os.rst:4951 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4719 +#: ../../library/os.rst:4959 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4721 +#: ../../library/os.rst:4961 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:4727 +#: ../../library/os.rst:4967 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4732 +#: ../../library/os.rst:4972 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4976 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4981 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4745 +#: ../../library/os.rst:4985 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4749 +#: ../../library/os.rst:4989 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4753 +#: ../../library/os.rst:4993 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4997 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:4764 +#: ../../library/os.rst:5004 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:4768 +#: ../../library/os.rst:5008 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:5012 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4777 +#: ../../library/os.rst:5017 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4783 +#: ../../library/os.rst:5023 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4789 +#: ../../library/os.rst:5029 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:4796 +#: ../../library/os.rst:5036 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:4803 +#: ../../library/os.rst:5043 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:4809 +#: ../../library/os.rst:5049 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:4815 +#: ../../library/os.rst:5055 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:4821 +#: ../../library/os.rst:5061 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4826 +#: ../../library/os.rst:5066 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:4833 +#: ../../library/os.rst:5073 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4840 +#: ../../library/os.rst:5080 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4845 +#: ../../library/os.rst:5085 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 " @@ -5316,13 +5602,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:5093 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4856 +#: ../../library/os.rst:5096 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 " @@ -5330,33 +5616,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4866 +#: ../../library/os.rst:5106 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:4875 +#: ../../library/os.rst:5115 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:5117 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:4887 +#: ../../library/os.rst:5127 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:4896 +#: ../../library/os.rst:5136 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5365,44 +5651,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4906 +#: ../../library/os.rst:5146 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:4912 +#: ../../library/os.rst:5152 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:4915 +#: ../../library/os.rst:5155 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4918 +#: ../../library/os.rst:5158 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4924 +#: ../../library/os.rst:5164 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:4932 +#: ../../library/os.rst:5172 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:4941 +#: ../../library/os.rst:5181 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5411,7 +5697,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:5191 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5419,27 +5705,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4960 +#: ../../library/os.rst:5200 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:4968 +#: ../../library/os.rst:5208 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:4975 +#: ../../library/os.rst:5215 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:4982 +#: ../../library/os.rst:5222 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 " @@ -5448,36 +5734,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4991 +#: ../../library/os.rst:5231 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:5002 +#: ../../library/os.rst:5242 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:5010 +#: ../../library/os.rst:5250 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5015 +#: ../../library/os.rst:5255 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5018 +#: ../../library/os.rst:5258 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5021 +#: ../../library/os.rst:5261 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5485,36 +5771,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5026 +#: ../../library/os.rst:5266 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:5030 +#: ../../library/os.rst:5270 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5033 +#: ../../library/os.rst:5273 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5039 +#: ../../library/os.rst:5279 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5041 +#: ../../library/os.rst:5281 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:5045 +#: ../../library/os.rst:5285 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5524,69 +5810,69 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5052 +#: ../../library/os.rst:5292 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:5056 +#: ../../library/os.rst:5296 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5059 +#: ../../library/os.rst:5299 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:5063 +#: ../../library/os.rst:5303 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5067 +#: ../../library/os.rst:5307 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:5071 +#: ../../library/os.rst:5311 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:5077 +#: ../../library/os.rst:5317 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5083 +#: ../../library/os.rst:5323 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:5087 +#: ../../library/os.rst:5327 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:5094 +#: ../../library/os.rst:5334 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." msgstr "" -#: ../../library/os.rst:363 ../../library/os.rst:518 ../../library/os.rst:682 +#: ../../library/os.rst:363 ../../library/os.rst:529 ../../library/os.rst:731 msgid "user" msgstr "user(使用者)" @@ -5595,8 +5881,8 @@ msgid "effective id" msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 -#: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:617 -#: ../../library/os.rst:3916 ../../library/os.rst:3943 +#: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 +#: ../../library/os.rst:4147 ../../library/os.rst:4174 msgid "process" msgstr "process" @@ -5604,7 +5890,7 @@ msgstr "process" msgid "group" msgstr "group(群組)" -#: ../../library/os.rst:447 ../../library/os.rst:518 +#: ../../library/os.rst:447 ../../library/os.rst:529 msgid "id" msgstr "id" @@ -5612,118 +5898,118 @@ msgstr "id" msgid "id of parent" msgstr "" -#: ../../library/os.rst:470 ../../library/os.rst:617 +#: ../../library/os.rst:470 ../../library/os.rst:666 msgid "scheduling priority" msgstr "scheduling priority(排程優先權)" -#: ../../library/os.rst:541 ../../library/os.rst:747 +#: ../../library/os.rst:552 ../../library/os.rst:796 msgid "environment variables" msgstr "environment variables(環境變數)" -#: ../../library/os.rst:541 +#: ../../library/os.rst:552 msgid "setting" msgstr "setting(設定)" -#: ../../library/os.rst:682 +#: ../../library/os.rst:731 msgid "id, setting" msgstr "id, setting(設定)" -#: ../../library/os.rst:715 +#: ../../library/os.rst:764 msgid "gethostname() (in module socket)" msgstr "gethostname()(於 socket 模組)" -#: ../../library/os.rst:715 +#: ../../library/os.rst:764 msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:747 ../../library/os.rst:2357 +#: ../../library/os.rst:796 ../../library/os.rst:2534 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1188 ../../library/os.rst:2710 +#: ../../library/os.rst:1298 ../../library/os.rst:2904 msgid "module" msgstr "module(模組)" -#: ../../library/os.rst:1188 +#: ../../library/os.rst:1298 msgid "pty" msgstr "pty" -#: ../../library/os.rst:1824 ../../library/os.rst:2155 -#: ../../library/os.rst:2357 ../../library/os.rst:3208 -#: ../../library/os.rst:3307 +#: ../../library/os.rst:1938 ../../library/os.rst:2332 +#: ../../library/os.rst:2534 ../../library/os.rst:3438 +#: ../../library/os.rst:3537 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1824 +#: ../../library/os.rst:1938 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2155 +#: ../../library/os.rst:2332 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2155 +#: ../../library/os.rst:2332 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2155 +#: ../../library/os.rst:2332 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2710 +#: ../../library/os.rst:2904 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3208 ../../library/os.rst:3307 +#: ../../library/os.rst:3438 ../../library/os.rst:3537 msgid "walking" msgstr "" -#: ../../library/os.rst:3208 ../../library/os.rst:3307 +#: ../../library/os.rst:3438 ../../library/os.rst:3537 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:3916 ../../library/os.rst:3943 +#: ../../library/os.rst:4147 ../../library/os.rst:4174 msgid "killing" msgstr "" -#: ../../library/os.rst:3916 ../../library/os.rst:3943 +#: ../../library/os.rst:4147 ../../library/os.rst:4174 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:4921 ../../library/os.rst:4957 +#: ../../library/os.rst:5161 ../../library/os.rst:5197 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:4921 ../../library/os.rst:4929 -#: ../../library/os.rst:4937 ../../library/os.rst:4948 -#: ../../library/os.rst:4957 +#: ../../library/os.rst:5161 ../../library/os.rst:5169 +#: ../../library/os.rst:5177 ../../library/os.rst:5188 +#: ../../library/os.rst:5197 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:4929 +#: ../../library/os.rst:5169 msgid ".." msgstr ".." -#: ../../library/os.rst:4937 ../../library/os.rst:4948 +#: ../../library/os.rst:5177 ../../library/os.rst:5188 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:4938 +#: ../../library/os.rst:5178 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:4938 +#: ../../library/os.rst:5178 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:4964 +#: ../../library/os.rst:5204 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:4964 +#: ../../library/os.rst:5204 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:4964 +#: ../../library/os.rst:5204 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pathlib.po b/library/pathlib.po index f2626c8473..42da18f10d 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-11 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-11 01:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -110,8 +110,8 @@ msgid "" "access a filesystem. There are three ways to access these classes, which we " "also call *flavours*:" msgstr "" -"純路徑物件提供處理路徑的操作,實際上不會存取檔案系統。有三種方法可以存取" -"這些類別 (class),我們也稱之為\\ *類型*:" +"純路徑物件提供處理路徑的操作,實際上不會存取檔案系統。有三種方法可以存取這些" +"類別 (class),我們也稱之為\\ *類型*:" #: ../../library/pathlib.rst:102 msgid "" @@ -124,25 +124,27 @@ msgstr "" "::" #: ../../library/pathlib.rst:108 +#, fuzzy msgid "" "Each element of *pathsegments* can be either a string representing a path " -"segment, an object implementing the :class:`os.PathLike` interface which " -"returns a string, or another path object::" +"segment, or an object implementing the :class:`os.PathLike` interface where " +"the :meth:`~os.PathLike.__fspath__` method returns a string, such as another " +"path object::" msgstr "" -"*pathsegments* 中的每個元素可以是以下三種的其中一種:一個表示路徑片段的字串、實" -"作了 :class:`os.PathLike` 介面 (interface) 並回傳字串的物件,或者另一個路徑物" -"件:\n" +"*pathsegments* 中的每個元素可以是以下三種的其中一種:一個表示路徑片段的字串、" +"實作了 :class:`os.PathLike` 介面 (interface) 並回傳字串的物件,或者另一個路徑" +"物件:\n" "\n" "::" -#: ../../library/pathlib.rst:117 +#: ../../library/pathlib.rst:118 msgid "When *pathsegments* is empty, the current directory is assumed::" msgstr "" "當 *pathsegments* 是空的時候,預設使用目前的目錄:\n" "\n" "::" -#: ../../library/pathlib.rst:122 +#: ../../library/pathlib.rst:123 msgid "" "If a segment is an absolute path, all previous segments are ignored (like :" "func:`os.path.join`)::" @@ -152,17 +154,17 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:130 +#: ../../library/pathlib.rst:131 msgid "" "On Windows, the drive is not reset when a rooted relative path segment (e." "g., ``r'\\foo'``) is encountered::" msgstr "" -"在 Windows 系統上,當遇到具有根目錄的相對路徑片段(例如 ``r'\\foo'``)時,磁碟" -"機 (drive) 部分不會被重置:\n" +"在 Windows 系統上,當遇到具有根目錄的相對路徑片段(例如 ``r'\\foo'``)時,磁" +"碟機 (drive) 部分不會被重置:\n" "\n" "::" -#: ../../library/pathlib.rst:136 +#: ../../library/pathlib.rst:137 msgid "" "Spurious slashes and single dots are collapsed, but double dots (``'..'``) " "and leading double slashes (``'//'``) are not, since this would change the " @@ -174,16 +176,16 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:149 +#: ../../library/pathlib.rst:150 msgid "" "(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to " "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -"(一個使得 ``PurePosixPath('foo/../bar')`` 等同於 ``PurePosixPath('bar')`` " -"的單純方法,但如果 ``foo`` 是一個目錄的符號連結,這是錯誤的。)" +"(一個使得 ``PurePosixPath('foo/../bar')`` 等同於 ``PurePosixPath('bar')`` 的" +"單純方法,但如果 ``foo`` 是一個目錄的符號連結,這是錯誤的。)" -#: ../../library/pathlib.rst:153 +#: ../../library/pathlib.rst:154 msgid "" "Pure path objects implement the :class:`os.PathLike` interface, allowing " "them to be used anywhere the interface is accepted." @@ -191,66 +193,66 @@ msgstr "" "純路徑物件實作了 :class:`os.PathLike` 介面,使得它們可以在任何接受該介面的地" "方使用。" -#: ../../library/pathlib.rst:156 +#: ../../library/pathlib.rst:157 msgid "Added support for the :class:`os.PathLike` interface." msgstr "新增了對於 :class:`os.PathLike` 介面的支援。" -#: ../../library/pathlib.rst:161 +#: ../../library/pathlib.rst:162 msgid "" "A subclass of :class:`PurePath`, this path flavour represents non-Windows " "filesystem paths::" msgstr "" -":class:`PurePath` 的一個子類別 (subclass),該路徑類型表示非 Windows 檔案系統的" -"路徑:\n" +":class:`PurePath` 的一個子類別 (subclass),該路徑類型表示非 Windows 檔案系統" +"的路徑:\n" "\n" "::" -#: ../../library/pathlib.rst:167 ../../library/pathlib.rst:179 -#: ../../library/pathlib.rst:672 ../../library/pathlib.rst:682 -#: ../../library/pathlib.rst:692 +#: ../../library/pathlib.rst:168 ../../library/pathlib.rst:180 +#: ../../library/pathlib.rst:739 ../../library/pathlib.rst:749 +#: ../../library/pathlib.rst:759 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "*pathsegments* 的指定方式與 :class:`PurePath` 類似。" -#: ../../library/pathlib.rst:171 +#: ../../library/pathlib.rst:172 msgid "" "A subclass of :class:`PurePath`, this path flavour represents Windows " "filesystem paths, including `UNC paths`_::" msgstr "" -":class:`PurePath` 的一個子類別,該路徑類型表示 Windows 檔案系統的路徑,包括 " -" `UNC paths`_:\n" +":class:`PurePath` 的一個子類別,該路徑類型表示 Windows 檔案系統的路徑,包括 " +"`UNC paths`_:\n" "\n" "::" -#: ../../library/pathlib.rst:183 +#: ../../library/pathlib.rst:184 msgid "" "Regardless of the system you're running on, you can instantiate all of these " "classes, since they don't provide any operation that does system calls." msgstr "" -"不論你使用的是什麼系統,你都可以實例化這些類別,因為它們不提供任何涉" -"及系統呼叫 (system calls) 的操作。" +"不論你使用的是什麼系統,你都可以實例化這些類別,因為它們不提供任何涉及系統呼" +"叫 (system calls) 的操作。" -#: ../../library/pathlib.rst:188 +#: ../../library/pathlib.rst:189 msgid "General properties" msgstr "通用特性" -#: ../../library/pathlib.rst:190 +#: ../../library/pathlib.rst:191 msgid "" "Paths are immutable and :term:`hashable`. Paths of a same flavour are " "comparable and orderable. These properties respect the flavour's case-" "folding semantics::" msgstr "" -"路徑物件是不可變 (immutable) 且 :term:`hashable` (可雜湊)的。相同類型的路" -"徑物件可以被比較和排序。這些特性遵守該類型的大小寫規則:" +"路徑物件是不可變 (immutable) 且 :term:`hashable` (可雜湊)的。相同類型的路徑" +"物件可以被比較和排序。這些特性遵守該類型的大小寫規則:" -#: ../../library/pathlib.rst:203 +#: ../../library/pathlib.rst:204 msgid "Paths of a different flavour compare unequal and cannot be ordered::" msgstr "不同類型的路徑物件在比較時視為不相等且無法被排序:" -#: ../../library/pathlib.rst:214 +#: ../../library/pathlib.rst:215 msgid "Operators" msgstr "運算子" -#: ../../library/pathlib.rst:216 +#: ../../library/pathlib.rst:217 msgid "" "The slash operator helps create child paths, like :func:`os.path.join`. If " "the argument is an absolute path, the previous path is ignored. On Windows, " @@ -261,291 +263,344 @@ msgstr "" "一樣。如果引數是絕對路徑,則忽略前一個路徑。在 Windows 系統上,當引數是以根目" "錄為基礎的相對路徑(例如,``r’\\foo’``),磁碟路徑不會被重置:" -#: ../../library/pathlib.rst:234 +#: ../../library/pathlib.rst:235 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "路徑物件可以被用在任何可以使用 :class:`os.PathLike` 的地方:" -#: ../../library/pathlib.rst:242 +#: ../../library/pathlib.rst:243 msgid "" "The string representation of a path is the raw filesystem path itself (in " "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -#: ../../library/pathlib.rst:253 +#: ../../library/pathlib.rst:254 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -#: ../../library/pathlib.rst:260 +#: ../../library/pathlib.rst:261 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -#: ../../library/pathlib.rst:265 +#: ../../library/pathlib.rst:266 msgid "Accessing individual parts" msgstr "" -#: ../../library/pathlib.rst:267 +#: ../../library/pathlib.rst:268 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -#: ../../library/pathlib.rst:272 +#: ../../library/pathlib.rst:273 msgid "A tuple giving access to the path's various components::" msgstr "" -#: ../../library/pathlib.rst:282 +#: ../../library/pathlib.rst:283 msgid "(note how the drive and local root are regrouped in a single part)" msgstr "" -#: ../../library/pathlib.rst:286 +#: ../../library/pathlib.rst:287 msgid "Methods and properties" msgstr "" -#: ../../library/pathlib.rst:292 +#: ../../library/pathlib.rst:293 msgid "Pure paths provide the following methods and properties:" msgstr "" -#: ../../library/pathlib.rst:296 +#: ../../library/pathlib.rst:297 msgid "A string representing the drive letter or name, if any::" msgstr "" -#: ../../library/pathlib.rst:305 +#: ../../library/pathlib.rst:306 msgid "UNC shares are also considered drives::" msgstr "" -#: ../../library/pathlib.rst:312 +#: ../../library/pathlib.rst:313 msgid "A string representing the (local or global) root, if any::" msgstr "" -#: ../../library/pathlib.rst:321 +#: ../../library/pathlib.rst:322 msgid "UNC shares always have a root::" msgstr "" -#: ../../library/pathlib.rst:326 +#: ../../library/pathlib.rst:327 msgid "" "If the path starts with more than two successive slashes, :class:`~pathlib." "PurePosixPath` collapses them::" msgstr "" -#: ../../library/pathlib.rst:338 +#: ../../library/pathlib.rst:339 msgid "" "This behavior conforms to *The Open Group Base Specifications Issue 6*, " "paragraph `4.11 Pathname Resolution `_:" msgstr "" -#: ../../library/pathlib.rst:342 +#: ../../library/pathlib.rst:343 msgid "" "*\"A pathname that begins with two successive slashes may be interpreted in " "an implementation-defined manner, although more than two leading slashes " "shall be treated as a single slash.\"*" msgstr "" -#: ../../library/pathlib.rst:348 +#: ../../library/pathlib.rst:349 msgid "The concatenation of the drive and root::" msgstr "" -#: ../../library/pathlib.rst:362 +#: ../../library/pathlib.rst:363 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" msgstr "" -#: ../../library/pathlib.rst:373 +#: ../../library/pathlib.rst:374 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." msgstr "" -#: ../../library/pathlib.rst:378 +#: ../../library/pathlib.rst:379 msgid "The logical parent of the path::" msgstr "" -#: ../../library/pathlib.rst:384 +#: ../../library/pathlib.rst:385 msgid "You cannot go past an anchor, or empty path::" msgstr "" -#: ../../library/pathlib.rst:394 +#: ../../library/pathlib.rst:395 msgid "This is a purely lexical operation, hence the following behaviour::" msgstr "" -#: ../../library/pathlib.rst:400 +#: ../../library/pathlib.rst:401 msgid "" "If you want to walk an arbitrary filesystem path upwards, it is recommended " "to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate " "``\"..\"`` components." msgstr "" -#: ../../library/pathlib.rst:407 +#: ../../library/pathlib.rst:408 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -#: ../../library/pathlib.rst:413 +#: ../../library/pathlib.rst:414 msgid "UNC drive names are not considered::" msgstr "" -#: ../../library/pathlib.rst:423 +#: ../../library/pathlib.rst:424 msgid "The file extension of the final component, if any::" msgstr "" -#: ../../library/pathlib.rst:435 +#: ../../library/pathlib.rst:436 msgid "A list of the path's file extensions::" msgstr "" -#: ../../library/pathlib.rst:447 +#: ../../library/pathlib.rst:448 msgid "The final path component, without its suffix::" msgstr "" -#: ../../library/pathlib.rst:459 +#: ../../library/pathlib.rst:460 msgid "" "Return a string representation of the path with forward slashes (``/``)::" msgstr "" -#: ../../library/pathlib.rst:470 +#: ../../library/pathlib.rst:471 msgid "" "Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the " "path isn't absolute." msgstr "" -#: ../../library/pathlib.rst:483 +#: ../../library/pathlib.rst:484 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -#: ../../library/pathlib.rst:503 +#: ../../library/pathlib.rst:504 msgid "Return whether or not this path is relative to the *other* path." msgstr "" #: ../../library/pathlib.rst:516 msgid "" +"Passing additional arguments is deprecated; if supplied, they are joined " +"with *other*." +msgstr "" + +#: ../../library/pathlib.rst:521 +msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -#: ../../library/pathlib.rst:525 +#: ../../library/pathlib.rst:530 msgid "" "File system calls on reserved paths can fail mysteriously or have unintended " "effects." msgstr "" -#: ../../library/pathlib.rst:531 +#: ../../library/pathlib.rst:536 msgid "" "Calling this method is equivalent to combining the path with each of the " -"*other* arguments in turn::" +"given *pathsegments* in turn::" msgstr "" -#: ../../library/pathlib.rst:546 +#: ../../library/pathlib.rst:551 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:549 +#: ../../library/pathlib.rst:554 msgid "" "If *pattern* is relative, the path can be either relative or absolute, and " "matching is done from the right::" msgstr "" -#: ../../library/pathlib.rst:559 +#: ../../library/pathlib.rst:564 msgid "" "If *pattern* is absolute, the path must be absolute, and the whole path must " "match::" msgstr "" -#: ../../library/pathlib.rst:567 +#: ../../library/pathlib.rst:572 +msgid "" +"The *pattern* may be another path object; this speeds up matching the same " +"pattern against multiple files::" +msgstr "" + +#: ../../library/pathlib.rst:579 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: ../../library/pathlib.rst:577 +#: ../../library/pathlib.rst:586 +msgid "" +"Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." +msgstr "" + +#: ../../library/pathlib.rst:588 ../../library/pathlib.rst:931 +#: ../../library/pathlib.rst:1344 +#, fuzzy +msgid "The *case_sensitive* parameter was added." +msgstr "新增 *newline* 參數。" + +#: ../../library/pathlib.rst:594 msgid "" "Compute a version of this path relative to the path represented by *other*. " -"If it's impossible, ValueError is raised::" +"If it's impossible, :exc:`ValueError` is raised::" +msgstr "" + +#: ../../library/pathlib.rst:609 +msgid "" +"When *walk_up* is False (the default), the path must start with *other*. " +"When the argument is True, ``..`` entries may be added to form the relative " +"path. In all other cases, such as the paths referencing different drives, :" +"exc:`ValueError` is raised.::" +msgstr "" + +#: ../../library/pathlib.rst:624 +msgid "" +"This function is part of :class:`PurePath` and works with strings. It does " +"not check or access the underlying file structure. This can impact the " +"*walk_up* option as it assumes that no symlinks are present in the path; " +"call :meth:`~Path.resolve` first if necessary to resolve symlinks." +msgstr "" + +#: ../../library/pathlib.rst:630 +msgid "" +"The *walk_up* parameter was added (old behavior is the same as " +"``walk_up=False``)." msgstr "" -#: ../../library/pathlib.rst:592 +#: ../../library/pathlib.rst:635 msgid "" -"NOTE: This function is part of :class:`PurePath` and works with strings. It " -"does not check or access the underlying file structure." +"Passing additional positional arguments is deprecated; if supplied, they are " +"joined with *other*." msgstr "" -#: ../../library/pathlib.rst:597 +#: ../../library/pathlib.rst:640 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:614 +#: ../../library/pathlib.rst:657 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:638 +#: ../../library/pathlib.rst:681 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: ../../library/pathlib.rst:657 +#: ../../library/pathlib.rst:698 +msgid "" +"Create a new path object of the same type by combining the given " +"*pathsegments*. This method is called whenever a derivative path is created, " +"such as from :attr:`parent` and :meth:`relative_to`. Subclasses may override " +"this method to pass information to derivative paths, for example::" +msgstr "" + +#: ../../library/pathlib.rst:724 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:659 +#: ../../library/pathlib.rst:726 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:665 +#: ../../library/pathlib.rst:732 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:676 +#: ../../library/pathlib.rst:743 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:686 +#: ../../library/pathlib.rst:753 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:694 +#: ../../library/pathlib.rst:761 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:714 +#: ../../library/pathlib.rst:781 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:716 +#: ../../library/pathlib.rst:783 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:722 +#: ../../library/pathlib.rst:789 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -555,84 +610,93 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:732 +#: ../../library/pathlib.rst:799 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:741 +#: ../../library/pathlib.rst:808 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:755 +#: ../../library/pathlib.rst:822 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:758 +#: ../../library/pathlib.rst:825 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:769 ../../library/pathlib.rst:789 +#: ../../library/pathlib.rst:836 ../../library/pathlib.rst:856 +#: ../../library/pathlib.rst:877 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:774 +#: ../../library/pathlib.rst:841 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:776 +#: ../../library/pathlib.rst:843 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:794 -msgid "Whether the path points to an existing file or directory::" +#: ../../library/pathlib.rst:861 +msgid "Return ``True`` if the path points to an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:806 +#: ../../library/pathlib.rst:863 msgid "" -"If the path points to a symlink, :meth:`exists` returns whether the symlink " -"*points to* an existing file or directory." +"This method normally follows symlinks; to check if a symlink exists, add the " +"argument ``follow_symlinks=False``." msgstr "" -#: ../../library/pathlib.rst:812 +#: ../../library/pathlib.rst:882 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:827 +#: ../../library/pathlib.rst:897 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:835 +#: ../../library/pathlib.rst:905 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:847 +#: ../../library/pathlib.rst:916 ../../library/pathlib.rst:1333 +msgid "" +"By default, or when the *case_sensitive* keyword-only argument is set to " +"``None``, this method matches paths using platform-specific casing rules: " +"typically, case-sensitive on POSIX, and case-insensitive on Windows. Set " +"*case_sensitive* to ``True`` or ``False`` to override this behaviour." +msgstr "" + +#: ../../library/pathlib.rst:922 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:850 +#: ../../library/pathlib.rst:925 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -640,91 +704,103 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.glob``。" -#: ../../library/pathlib.rst:852 ../../library/pathlib.rst:1147 +#: ../../library/pathlib.rst:927 ../../library/pathlib.rst:1340 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." msgstr "" -#: ../../library/pathlib.rst:858 +#: ../../library/pathlib.rst:937 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:864 +#: ../../library/pathlib.rst:943 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:867 ../../library/pathlib.rst:876 -#: ../../library/pathlib.rst:905 ../../library/pathlib.rst:914 -#: ../../library/pathlib.rst:923 ../../library/pathlib.rst:932 +#: ../../library/pathlib.rst:946 ../../library/pathlib.rst:955 +#: ../../library/pathlib.rst:997 ../../library/pathlib.rst:1006 +#: ../../library/pathlib.rst:1015 ../../library/pathlib.rst:1024 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:873 +#: ../../library/pathlib.rst:952 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:882 +#: ../../library/pathlib.rst:961 +msgid "" +"Return ``True`` if the path points to a junction, and ``False`` for any " +"other type of file. Currently only Windows supports junctions." +msgstr "" + +#: ../../library/pathlib.rst:969 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " "function checks whether *path*'s parent, :file:`path/..`, is on a different " "device than *path*, or whether :file:`path/..` and *path* point to the same " "i-node on the same device --- this should detect mount points for all Unix " -"and POSIX variants. Not implemented on Windows." +"and POSIX variants. On Windows, a mount point is considered to be a drive " +"letter root (e.g. ``c:\\``), a UNC share (e.g. ``\\\\server\\share``), or a " +"mounted filesystem directory." msgstr "" -#: ../../library/pathlib.rst:894 +#: ../../library/pathlib.rst:980 +msgid "Windows support was added." +msgstr "" + +#: ../../library/pathlib.rst:986 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:896 +#: ../../library/pathlib.rst:988 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:902 +#: ../../library/pathlib.rst:994 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:911 +#: ../../library/pathlib.rst:1003 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:920 +#: ../../library/pathlib.rst:1012 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:929 +#: ../../library/pathlib.rst:1021 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:938 +#: ../../library/pathlib.rst:1030 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:952 +#: ../../library/pathlib.rst:1044 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -732,62 +808,162 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:959 +#: ../../library/pathlib.rst:1051 +msgid "" +"Generate the file names in a directory tree by walking the tree either top-" +"down or bottom-up." +msgstr "" + +#: ../../library/pathlib.rst:1054 +msgid "" +"For each directory in the directory tree rooted at *self* (including *self* " +"but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " +"dirnames, filenames)``." +msgstr "" + +#: ../../library/pathlib.rst:1058 +msgid "" +"*dirpath* is a :class:`Path` to the directory currently being walked, " +"*dirnames* is a list of strings for the names of subdirectories in *dirpath* " +"(excluding ``'.'`` and ``'..'``), and *filenames* is a list of strings for " +"the names of the non-directory files in *dirpath*. To get a full path (which " +"begins with *self*) to a file or directory in *dirpath*, do ``dirpath / " +"name``. Whether or not the lists are sorted is file system-dependent." +msgstr "" + +#: ../../library/pathlib.rst:1066 +msgid "" +"If the optional argument *top_down* is true (which is the default), the " +"triple for a directory is generated before the triples for any of its " +"subdirectories (directories are walked top-down). If *top_down* is false, " +"the triple for a directory is generated after the triples for all of its " +"subdirectories (directories are walked bottom-up). No matter the value of " +"*top_down*, the list of subdirectories is retrieved before the triples for " +"the directory and its subdirectories are walked." +msgstr "" + +#: ../../library/pathlib.rst:1074 +msgid "" +"When *top_down* is true, the caller can modify the *dirnames* list in-place " +"(for example, using :keyword:`del` or slice assignment), and :meth:`Path." +"walk` will only recurse into the subdirectories whose names remain in " +"*dirnames*. This can be used to prune the search, or to impose a specific " +"order of visiting, or even to inform :meth:`Path.walk` about directories the " +"caller creates or renames before it resumes :meth:`Path.walk` again. " +"Modifying *dirnames* when *top_down* is false has no effect on the behavior " +"of :meth:`Path.walk()` since the directories in *dirnames* have already been " +"generated by the time *dirnames* is yielded to the caller." +msgstr "" + +#: ../../library/pathlib.rst:1084 +msgid "" +"By default, errors from :func:`os.scandir` are ignored. If the optional " +"argument *on_error* is specified, it should be a callable; it will be called " +"with one argument, an :exc:`OSError` instance. The callable can handle the " +"error to continue the walk or re-raise it to stop the walk. Note that the " +"filename is available as the ``filename`` attribute of the exception object." +msgstr "" + +#: ../../library/pathlib.rst:1090 +msgid "" +"By default, :meth:`Path.walk` does not follow symbolic links, and instead " +"adds them to the *filenames* list. Set *follow_symlinks* to true to resolve " +"symlinks and place them in *dirnames* and *filenames* as appropriate for " +"their targets, and consequently visit directories pointed to by symlinks " +"(where supported)." +msgstr "" + +#: ../../library/pathlib.rst:1097 +msgid "" +"Be aware that setting *follow_symlinks* to true can lead to infinite " +"recursion if a link points to a parent directory of itself. :meth:`Path." +"walk` does not keep track of the directories it has already visited." +msgstr "" + +#: ../../library/pathlib.rst:1102 +msgid "" +":meth:`Path.walk` assumes the directories it walks are not modified during " +"execution. For example, if a directory from *dirnames* has been replaced " +"with a symlink and *follow_symlinks* is false, :meth:`Path.walk` will still " +"try to descend into it. To prevent such behavior, remove directories from " +"*dirnames* as appropriate." +msgstr "" + +#: ../../library/pathlib.rst:1110 +msgid "" +"Unlike :func:`os.walk`, :meth:`Path.walk` lists symlinks to directories in " +"*filenames* if *follow_symlinks* is false." +msgstr "" + +#: ../../library/pathlib.rst:1113 +msgid "" +"This example displays the number of bytes used by all files in each " +"directory, while ignoring ``__pycache__`` directories::" +msgstr "" + +#: ../../library/pathlib.rst:1129 +msgid "" +"This next example is a simple implementation of :func:`shutil.rmtree`. " +"Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow " +"deleting a directory before it is empty::" +msgstr "" + +#: ../../library/pathlib.rst:1146 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:965 +#: ../../library/pathlib.rst:1152 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:971 +#: ../../library/pathlib.rst:1158 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:976 +#: ../../library/pathlib.rst:1163 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:980 +#: ../../library/pathlib.rst:1167 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:983 +#: ../../library/pathlib.rst:1170 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:986 +#: ../../library/pathlib.rst:1173 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:990 +#: ../../library/pathlib.rst:1177 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:996 +#: ../../library/pathlib.rst:1183 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:1008 +#: ../../library/pathlib.rst:1195 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." @@ -795,27 +971,27 @@ msgstr "" "回傳擁有該檔案的用戶的名稱。如果在系統資料庫中找不到該檔案的 uid ,則會引發 :" "exc:`KeyError`。" -#: ../../library/pathlib.rst:1014 +#: ../../library/pathlib.rst:1201 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" "將指向檔案的二進制內容以一個位元組 (bytes) 物件回傳:\n" "\n" "::" -#: ../../library/pathlib.rst:1027 +#: ../../library/pathlib.rst:1214 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" "將指向檔案的解碼內容以字串形式回傳:\n" "\n" "::" -#: ../../library/pathlib.rst:1035 +#: ../../library/pathlib.rst:1222 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "該檔案被打開並且隨後關閉。選填參數的含義與 :func:`open` 函數中的相同。" -#: ../../library/pathlib.rst:1043 +#: ../../library/pathlib.rst:1230 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" @@ -824,7 +1000,7 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:1056 +#: ../../library/pathlib.rst:1243 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, " @@ -839,7 +1015,7 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:1071 ../../library/pathlib.rst:1087 +#: ../../library/pathlib.rst:1258 ../../library/pathlib.rst:1274 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 " @@ -848,17 +1024,17 @@ msgstr "" "目標路徑可以是絕對路徑或相對路徑。相對路徑會相對於當前的工作目錄進行解釋," "*not* 相對於路徑物件所在的目錄。" -#: ../../library/pathlib.rst:1075 +#: ../../library/pathlib.rst:1262 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "此功能是使用 :func:`os.rename` 實現的,並提供相同的保證。" -#: ../../library/pathlib.rst:1077 ../../library/pathlib.rst:1091 +#: ../../library/pathlib.rst:1264 ../../library/pathlib.rst:1278 msgid "Added return value, return the new Path instance." msgstr "新增了回傳值,回傳新的路徑 (Path) 物件。" -#: ../../library/pathlib.rst:1083 +#: ../../library/pathlib.rst:1270 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 " @@ -867,7 +1043,7 @@ msgstr "" "將此檔案或目錄重新命名為給定的 *target* ,並回傳一個指向 *target* 的新路徑物" "件。如果 *target* 指向一個現有的檔案或空目錄,它將被無條件地取代。" -#: ../../library/pathlib.rst:1097 +#: ../../library/pathlib.rst:1284 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" @@ -876,7 +1052,7 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:1109 +#: ../../library/pathlib.rst:1296 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" @@ -885,7 +1061,7 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:1118 +#: ../../library/pathlib.rst:1305 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" @@ -894,7 +1070,7 @@ msgstr "" "\n" "::" -#: ../../library/pathlib.rst:1124 +#: ../../library/pathlib.rst:1311 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 " @@ -907,21 +1083,24 @@ msgstr "" "中,而不檢查其是否存在。 如果在解析過程中遇到無窮迴圈,則引發 :exc:" "`RuntimeError`。" -#: ../../library/pathlib.rst:1130 -msgid "The *strict* argument (pre-3.6 behavior is strict)." +#: ../../library/pathlib.rst:1317 +#, fuzzy +msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." msgstr "*strict* 引數(在 3.6 版本之前的行為是嚴格的)。" -#: ../../library/pathlib.rst:1135 +#: ../../library/pathlib.rst:1322 +#, fuzzy msgid "" -"This is like calling :func:`Path.glob` with \"``**/``\" added in front of " -"the given relative *pattern*::" +"Glob the given relative *pattern* recursively. This is like calling :func:" +"`Path.glob` with \"``**/``\" added in front of the *pattern*, where " +"*patterns* are the same as for :mod:`fnmatch`::" msgstr "" "這相當於在給定的相對 *pattern* 前面加上 \"``**/``\" 並呼叫 :func:`Path.glob` " ":\n" "\n" "::" -#: ../../library/pathlib.rst:1145 +#: ../../library/pathlib.rst:1338 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." @@ -929,11 +1108,11 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.rglob``。" -#: ../../library/pathlib.rst:1153 +#: ../../library/pathlib.rst:1350 msgid "Remove this directory. The directory must be empty." msgstr "移除此目錄。該目錄必須為空。" -#: ../../library/pathlib.rst:1158 +#: ../../library/pathlib.rst:1355 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:" @@ -943,53 +1122,34 @@ msgstr "" "物件或字串。其語義類似於 :func:`os.path.samefile` 和 :func:`os.path." "samestat`。" -#: ../../library/pathlib.rst:1162 +#: ../../library/pathlib.rst:1359 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1179 +#: ../../library/pathlib.rst:1376 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:1195 +#: ../../library/pathlib.rst:1392 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1200 +#: ../../library/pathlib.rst:1397 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1203 +#: ../../library/pathlib.rst:1400 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1210 -msgid "Make *target* a hard link to this path." -msgstr "" - -#: ../../library/pathlib.rst:1214 -msgid "" -"This function does not make this path a hard link to *target*, despite the " -"implication of the function and argument names. The argument order (target, " -"link) is the reverse of :func:`Path.symlink_to` and :func:`Path." -"hardlink_to`, but matches that of :func:`os.link`." -msgstr "" - -#: ../../library/pathlib.rst:1223 -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:1230 +#: ../../library/pathlib.rst:1408 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. " @@ -998,65 +1158,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1239 +#: ../../library/pathlib.rst:1417 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1242 +#: ../../library/pathlib.rst:1420 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1245 +#: ../../library/pathlib.rst:1423 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1248 +#: ../../library/pathlib.rst:1426 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1254 +#: ../../library/pathlib.rst:1432 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1263 +#: ../../library/pathlib.rst:1441 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1270 +#: ../../library/pathlib.rst:1448 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1279 +#: ../../library/pathlib.rst:1457 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:1284 +#: ../../library/pathlib.rst:1462 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1288 +#: ../../library/pathlib.rst:1466 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1290 +#: ../../library/pathlib.rst:1468 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1295 +#: ../../library/pathlib.rst:1473 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -1064,237 +1224,247 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1479 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1301 +#: ../../library/pathlib.rst:1479 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1481 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1303 +#: ../../library/pathlib.rst:1481 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1482 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1304 +#: ../../library/pathlib.rst:1482 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1483 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1483 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1306 +#: ../../library/pathlib.rst:1484 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1306 ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1484 ../../library/pathlib.rst:1485 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1307 +#: ../../library/pathlib.rst:1485 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1486 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1486 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1487 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1309 +#: ../../library/pathlib.rst:1487 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1488 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1310 +#: ../../library/pathlib.rst:1488 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1489 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1489 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1490 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1312 +#: ../../library/pathlib.rst:1490 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1491 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1313 +#: ../../library/pathlib.rst:1491 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1492 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1492 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1494 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1316 +#: ../../library/pathlib.rst:1494 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1495 +#, fuzzy +msgid ":func:`os.walk`" +msgstr ":func:`os.link`" + +#: ../../library/pathlib.rst:1495 +#, fuzzy +msgid ":meth:`Path.walk`" +msgstr ":meth:`Path.readlink`" + +#: ../../library/pathlib.rst:1496 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1496 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1497 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1318 +#: ../../library/pathlib.rst:1497 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1498 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1319 +#: ../../library/pathlib.rst:1498 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1499 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1499 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1500 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1321 +#: ../../library/pathlib.rst:1500 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1501 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1501 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1323 +#: ../../library/pathlib.rst:1502 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1323 +#: ../../library/pathlib.rst:1502 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1324 +#: ../../library/pathlib.rst:1503 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1324 +#: ../../library/pathlib.rst:1503 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1506 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1327 +#: ../../library/pathlib.rst:1506 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1507 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1328 +#: ../../library/pathlib.rst:1507 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1508 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1329 +#: ../../library/pathlib.rst:1508 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1330 +#: ../../library/pathlib.rst:1509 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1330 +#: ../../library/pathlib.rst:1509 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1331 +#: ../../library/pathlib.rst:1510 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1331 +#: ../../library/pathlib.rst:1510 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1332 +#: ../../library/pathlib.rst:1511 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1332 +#: ../../library/pathlib.rst:1511 msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1337 +#: ../../library/pathlib.rst:1516 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1338 +#: ../../library/pathlib.rst:1517 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1339 +#: ../../library/pathlib.rst:1518 msgid "" ":meth:`PurePath.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 2f5c2b8916..f671c5733c 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -308,7 +308,33 @@ msgid "" "\"\";\"``." msgstr "" -#: ../../library/pdb.rst:270 +#: ../../library/pdb.rst:266 +msgid "" +"To set a temporary global variable, use a *convenience variable*. A " +"*convenience variable* is a variable whose name starts with ``$``. For " +"example, ``$foo = 1`` sets a global variable ``$foo`` which you can use in " +"the debugger session. The *convenience variables* are cleared when the " +"program resumes execution so it's less likely to interfere with your program " +"compared to using normal variables like ``foo = 1``." +msgstr "" + +#: ../../library/pdb.rst:273 +msgid "There are three preset *convenience variables*:" +msgstr "" + +#: ../../library/pdb.rst:275 +msgid "``$_frame``: the current frame you are debugging" +msgstr "" + +#: ../../library/pdb.rst:276 +msgid "``$_retval``: the return value if the frame is returning" +msgstr "" + +#: ../../library/pdb.rst:277 +msgid "``$_exception``: the exception if the frame is raising an exception" +msgstr "" + +#: ../../library/pdb.rst:285 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -317,20 +343,20 @@ msgid "" "and aliases defined there can be overridden by the local file." msgstr "" -#: ../../library/pdb.rst:276 +#: ../../library/pdb.rst:291 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: ../../library/pdb.rst:280 +#: ../../library/pdb.rst:295 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:288 +#: ../../library/pdb.rst:303 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -339,26 +365,26 @@ msgid "" "the ``!`` command." msgstr "" -#: ../../library/pdb.rst:296 +#: ../../library/pdb.rst:311 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:301 +#: ../../library/pdb.rst:316 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: ../../library/pdb.rst:306 +#: ../../library/pdb.rst:321 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: ../../library/pdb.rst:311 +#: ../../library/pdb.rst:326 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 " @@ -369,33 +395,33 @@ msgid "" "refer." msgstr "" -#: ../../library/pdb.rst:318 +#: ../../library/pdb.rst:333 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:321 +#: ../../library/pdb.rst:336 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:327 +#: ../../library/pdb.rst:342 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:332 +#: ../../library/pdb.rst:347 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:338 +#: ../../library/pdb.rst:353 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -403,11 +429,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: ../../library/pdb.rst:345 +#: ../../library/pdb.rst:360 msgid "Enable the breakpoints specified." msgstr "" -#: ../../library/pdb.rst:349 +#: ../../library/pdb.rst:364 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 " @@ -416,39 +442,39 @@ msgid "" "associated condition evaluates to true." msgstr "" -#: ../../library/pdb.rst:357 +#: ../../library/pdb.rst:372 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:363 +#: ../../library/pdb.rst:378 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:372 +#: ../../library/pdb.rst:387 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:375 +#: ../../library/pdb.rst:390 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: ../../library/pdb.rst:377 +#: ../../library/pdb.rst:392 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:381 +#: ../../library/pdb.rst:396 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -459,7 +485,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: ../../library/pdb.rst:390 +#: ../../library/pdb.rst:405 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 " @@ -468,13 +494,13 @@ msgid "" "was reached." msgstr "" -#: ../../library/pdb.rst:397 +#: ../../library/pdb.rst:412 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:402 +#: ../../library/pdb.rst:417 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 " @@ -483,46 +509,46 @@ msgid "" "line in the current function.)" msgstr "" -#: ../../library/pdb.rst:410 +#: ../../library/pdb.rst:425 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: ../../library/pdb.rst:413 +#: ../../library/pdb.rst:428 msgid "" "With *lineno*, continue execution until a line with a number greater or " "equal to *lineno* is reached. In both cases, also stop when the current " "frame returns." msgstr "" -#: ../../library/pdb.rst:417 +#: ../../library/pdb.rst:432 msgid "Allow giving an explicit line number." msgstr "" -#: ../../library/pdb.rst:422 +#: ../../library/pdb.rst:437 msgid "Continue execution until the current function returns." msgstr "" -#: ../../library/pdb.rst:426 +#: ../../library/pdb.rst:441 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: ../../library/pdb.rst:430 +#: ../../library/pdb.rst:445 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:434 +#: ../../library/pdb.rst:449 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:440 +#: ../../library/pdb.rst:455 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -531,7 +557,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: ../../library/pdb.rst:446 +#: ../../library/pdb.rst:461 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -539,90 +565,90 @@ msgid "" "line." msgstr "" -#: ../../library/pdb.rst:451 +#: ../../library/pdb.rst:466 msgid "The ``>>`` marker." msgstr "" -#: ../../library/pdb.rst:456 +#: ../../library/pdb.rst:471 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: ../../library/pdb.rst:463 +#: ../../library/pdb.rst:478 msgid "Print the arguments of the current function and their current values." msgstr "" -#: ../../library/pdb.rst:467 +#: ../../library/pdb.rst:482 msgid "Evaluate *expression* in the current context and print its value." msgstr "" -#: ../../library/pdb.rst:471 +#: ../../library/pdb.rst:486 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: ../../library/pdb.rst:477 +#: ../../library/pdb.rst:492 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: ../../library/pdb.rst:482 +#: ../../library/pdb.rst:497 msgid "Print the type of *expression*." msgstr "" -#: ../../library/pdb.rst:486 +#: ../../library/pdb.rst:501 msgid "Try to get source code of *expression* and display it." msgstr "" -#: ../../library/pdb.rst:492 +#: ../../library/pdb.rst:507 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -#: ../../library/pdb.rst:495 +#: ../../library/pdb.rst:510 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:499 +#: ../../library/pdb.rst:514 msgid "" "Display evaluates *expression* and compares to the result of the previous " "evaluation of *expression*, so when the result is mutable, display may not " "be able to pick up the changes." msgstr "" -#: ../../library/pdb.rst:503 +#: ../../library/pdb.rst:518 msgid "Example::" msgstr "" -#: ../../library/pdb.rst:511 +#: ../../library/pdb.rst:526 msgid "" "Display won't realize ``lst`` has been changed because the result of " "evaluation is modified in place by ``lst.append(1)`` before being compared::" msgstr "" -#: ../../library/pdb.rst:526 +#: ../../library/pdb.rst:541 msgid "You can do some tricks with copy mechanism to make it work::" msgstr "" -#: ../../library/pdb.rst:545 +#: ../../library/pdb.rst:560 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." msgstr "" -#: ../../library/pdb.rst:552 +#: ../../library/pdb.rst:567 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:562 +#: ../../library/pdb.rst:577 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " @@ -631,7 +657,7 @@ msgid "" "arguments are given, all aliases are listed." msgstr "" -#: ../../library/pdb.rst:568 +#: ../../library/pdb.rst:583 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 " @@ -640,26 +666,30 @@ msgid "" "other words in the line are left alone." msgstr "" -#: ../../library/pdb.rst:574 +#: ../../library/pdb.rst:589 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: ../../library/pdb.rst:584 +#: ../../library/pdb.rst:599 msgid "Delete the specified alias *name*." msgstr "" -#: ../../library/pdb.rst:588 +#: ../../library/pdb.rst:603 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 " -"statement resembles a debugger command. To set a global variable, you can " -"prefix the assignment command with a :keyword:`global` statement on the same " -"line, e.g.::" +"statement resembles a debugger command, e.g.:" +msgstr "" + +#: ../../library/pdb.rst:612 +msgid "" +"To set a global variable, you can prefix the assignment command with a :" +"keyword:`global` statement on the same line, e.g.:" msgstr "" -#: ../../library/pdb.rst:600 +#: ../../library/pdb.rst:623 msgid "" "Restart the debugged Python program. If *args* is supplied, it is split " "with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -667,25 +697,25 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: ../../library/pdb.rst:607 +#: ../../library/pdb.rst:630 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: ../../library/pdb.rst:611 +#: ../../library/pdb.rst:634 msgid "" "Enter a recursive debugger that steps through *code* (which is an arbitrary " "expression or statement to be executed in the current environment)." msgstr "" -#: ../../library/pdb.rst:617 +#: ../../library/pdb.rst:640 msgid "Print the return value for the last return of the current function." msgstr "" -#: ../../library/pdb.rst:620 +#: ../../library/pdb.rst:643 msgid "Footnotes" msgstr "註解" -#: ../../library/pdb.rst:621 +#: ../../library/pdb.rst:644 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." @@ -711,18 +741,18 @@ msgstr "bdb" msgid "cmd" msgstr "cmd" -#: ../../library/pdb.rst:266 +#: ../../library/pdb.rst:281 msgid ".pdbrc" msgstr ".pdbrc" -#: ../../library/pdb.rst:266 +#: ../../library/pdb.rst:281 msgid "file" msgstr "file(檔案)" -#: ../../library/pdb.rst:266 +#: ../../library/pdb.rst:281 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/pdb.rst:266 +#: ../../library/pdb.rst:281 msgid "configuration" msgstr "configuration(設定)" diff --git a/library/pkgutil.po b/library/pkgutil.po index 5994f9d12d..daf96b4ee6 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,40 +77,11 @@ msgid "" "isdir` behavior)." msgstr "" -#: ../../library/pkgutil.rst:54 -msgid ":pep:`302` Finder that wraps Python's \"classic\" import algorithm." -msgstr "" - -#: ../../library/pkgutil.rst:56 -msgid "" -"If *dirname* is a string, a :pep:`302` finder is created that searches that " -"directory. If *dirname* is ``None``, a :pep:`302` finder is created that " -"searches the current :data:`sys.path`, plus any modules that are frozen or " -"built-in." -msgstr "" - -#: ../../library/pkgutil.rst:61 -msgid "" -"Note that :class:`ImpImporter` does not currently support being used by " -"placement on :data:`sys.meta_path`." -msgstr "" - -#: ../../library/pkgutil.rst:64 ../../library/pkgutil.rst:73 -msgid "" -"This emulation is no longer needed, as the standard import mechanism is now " -"fully :pep:`302` compliant and available in :mod:`importlib`." -msgstr "" - -#: ../../library/pkgutil.rst:71 -msgid "" -":term:`Loader ` that wraps Python's \"classic\" import algorithm." -msgstr "" - -#: ../../library/pkgutil.rst:80 +#: ../../library/pkgutil.rst:53 msgid "Retrieve a module :term:`loader` for the given *fullname*." msgstr "" -#: ../../library/pkgutil.rst:82 +#: ../../library/pkgutil.rst:55 msgid "" "This is a backwards compatibility wrapper around :func:`importlib.util." "find_spec` that converts most failures to :exc:`ImportError` and only " @@ -118,39 +89,43 @@ msgid "" "ModuleSpec`." msgstr "" -#: ../../library/pkgutil.rst:87 ../../library/pkgutil.rst:104 -#: ../../library/pkgutil.rst:119 ../../library/pkgutil.rst:140 -#: ../../library/pkgutil.rst:161 ../../library/pkgutil.rst:200 +#: ../../library/pkgutil.rst:60 ../../library/pkgutil.rst:81 +#: ../../library/pkgutil.rst:96 ../../library/pkgutil.rst:120 +#: ../../library/pkgutil.rst:141 ../../library/pkgutil.rst:180 msgid "" "Updated to be based directly on :mod:`importlib` rather than relying on the " "package internal :pep:`302` import emulation." msgstr "" -#: ../../library/pkgutil.rst:91 ../../library/pkgutil.rst:123 +#: ../../library/pkgutil.rst:64 ../../library/pkgutil.rst:100 msgid "Updated to be based on :pep:`451`" msgstr "基於 :pep:`451` 來更新" -#: ../../library/pkgutil.rst:96 +#: ../../library/pkgutil.rst:68 ../../library/pkgutil.rst:104 +msgid "Use :func:`importlib.util.find_spec` instead." +msgstr "" + +#: ../../library/pkgutil.rst:73 msgid "Retrieve a :term:`finder` for the given *path_item*." msgstr "" -#: ../../library/pkgutil.rst:98 +#: ../../library/pkgutil.rst:75 msgid "" "The returned finder is cached in :data:`sys.path_importer_cache` if it was " "newly created by a path hook." msgstr "" -#: ../../library/pkgutil.rst:101 +#: ../../library/pkgutil.rst:78 msgid "" "The cache (or part of it) can be cleared manually if a rescan of :data:`sys." "path_hooks` is necessary." msgstr "" -#: ../../library/pkgutil.rst:111 +#: ../../library/pkgutil.rst:88 msgid "Get a :term:`loader` object for *module_or_name*." msgstr "" -#: ../../library/pkgutil.rst:113 +#: ../../library/pkgutil.rst:90 msgid "" "If the module or package is accessible via the normal import mechanism, a " "wrapper around the relevant part of that machinery is returned. Returns " @@ -159,44 +134,44 @@ msgid "" "to establish the package ``__path__``." msgstr "" -#: ../../library/pkgutil.rst:129 +#: ../../library/pkgutil.rst:109 msgid "Yield :term:`finder` objects for the given module name." msgstr "" -#: ../../library/pkgutil.rst:131 +#: ../../library/pkgutil.rst:111 msgid "" "If fullname contains a ``'.'``, the finders will be for the package " "containing fullname, otherwise they will be all registered top level finders " "(i.e. those on both :data:`sys.meta_path` and :data:`sys.path_hooks`)." msgstr "" -#: ../../library/pkgutil.rst:135 +#: ../../library/pkgutil.rst:115 msgid "" "If the named module is in a package, that package is imported as a side " "effect of invoking this function." msgstr "" -#: ../../library/pkgutil.rst:138 +#: ../../library/pkgutil.rst:118 msgid "If no module name is specified, all top level finders are produced." msgstr "" -#: ../../library/pkgutil.rst:147 +#: ../../library/pkgutil.rst:127 msgid "" "Yields :class:`ModuleInfo` for all submodules on *path*, or, if *path* is " "``None``, all top-level modules on :data:`sys.path`." msgstr "" -#: ../../library/pkgutil.rst:150 ../../library/pkgutil.rst:171 +#: ../../library/pkgutil.rst:130 ../../library/pkgutil.rst:151 msgid "" "*path* should be either ``None`` or a list of paths to look for modules in." msgstr "" -#: ../../library/pkgutil.rst:152 ../../library/pkgutil.rst:173 +#: ../../library/pkgutil.rst:132 ../../library/pkgutil.rst:153 msgid "" "*prefix* is a string to output on the front of every module name on output." msgstr "" -#: ../../library/pkgutil.rst:156 ../../library/pkgutil.rst:195 +#: ../../library/pkgutil.rst:136 ../../library/pkgutil.rst:175 msgid "" "Only works for a :term:`finder` which defines an ``iter_modules()`` method. " "This interface is non-standard, so the module also provides implementations " @@ -204,20 +179,20 @@ msgid "" "zipimporter`." msgstr "" -#: ../../library/pkgutil.rst:168 +#: ../../library/pkgutil.rst:148 msgid "" "Yields :class:`ModuleInfo` for all modules recursively on *path*, or, if " "*path* is ``None``, all accessible modules." msgstr "" -#: ../../library/pkgutil.rst:175 +#: ../../library/pkgutil.rst:155 msgid "" "Note that this function must import all *packages* (*not* all modules!) on " "the given *path*, in order to access the ``__path__`` attribute to find " "submodules." msgstr "" -#: ../../library/pkgutil.rst:179 +#: ../../library/pkgutil.rst:159 msgid "" "*onerror* is a function which gets called with one argument (the name of the " "package which was being imported) if any exception occurs while trying to " @@ -226,18 +201,18 @@ msgid "" "propagated, terminating the search." msgstr "" -#: ../../library/pkgutil.rst:185 +#: ../../library/pkgutil.rst:165 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/pkgutil.rst:207 +#: ../../library/pkgutil.rst:187 msgid "Get a resource from a package." msgstr "" -#: ../../library/pkgutil.rst:209 +#: ../../library/pkgutil.rst:189 msgid "" "This is a wrapper for the :term:`loader` :meth:`get_data ` API. The *package* argument should be the name of " @@ -247,19 +222,19 @@ msgid "" "rooted name (starting with a ``/``)." msgstr "" -#: ../../library/pkgutil.rst:216 +#: ../../library/pkgutil.rst:196 msgid "" "The function returns a binary string that is the contents of the specified " "resource." msgstr "" -#: ../../library/pkgutil.rst:219 +#: ../../library/pkgutil.rst:199 msgid "" "For packages located in the filesystem, which have already been imported, " "this is the rough equivalent of::" msgstr "" -#: ../../library/pkgutil.rst:225 +#: ../../library/pkgutil.rst:205 msgid "" "If the package cannot be located or loaded, or it uses a :term:`loader` " "which does not support :meth:`get_data `." msgstr "" -#: ../../library/pkgutil.rst:234 +#: ../../library/pkgutil.rst:214 msgid "Resolve a name to an object." msgstr "" -#: ../../library/pkgutil.rst:236 +#: ../../library/pkgutil.rst:216 msgid "" "This functionality is used in numerous places in the standard library (see :" "issue:`12915`) - and equivalent functionality is also in widely used third-" "party packages such as setuptools, Django and Pyramid." msgstr "" -#: ../../library/pkgutil.rst:240 +#: ../../library/pkgutil.rst:220 msgid "" "It is expected that *name* will be a string in one of the following formats, " "where W is shorthand for a valid Python identifier and dot stands for a " "literal period in these pseudo-regexes:" msgstr "" -#: ../../library/pkgutil.rst:244 +#: ../../library/pkgutil.rst:224 msgid "``W(.W)*``" msgstr "``W(.W)*``" -#: ../../library/pkgutil.rst:245 +#: ../../library/pkgutil.rst:225 msgid "``W(.W)*:(W(.W)*)?``" msgstr "``W(.W)*:(W(.W)*)?``" -#: ../../library/pkgutil.rst:247 +#: ../../library/pkgutil.rst:227 msgid "" "The first form is intended for backward compatibility only. It assumes that " "some part of the dotted name is a package, and the rest is an object " @@ -304,7 +279,7 @@ msgid "" "form." msgstr "" -#: ../../library/pkgutil.rst:254 +#: ../../library/pkgutil.rst:234 msgid "" "In the second form, the caller makes the division point clear through the " "provision of a single colon: the dotted name to the left of the colon is a " @@ -313,21 +288,21 @@ msgid "" "ends with the colon, then a module object is returned." msgstr "" -#: ../../library/pkgutil.rst:260 +#: ../../library/pkgutil.rst:240 msgid "" "The function will return an object (which might be a module), or raise one " "of the following exceptions:" msgstr "" -#: ../../library/pkgutil.rst:263 +#: ../../library/pkgutil.rst:243 msgid ":exc:`ValueError` -- if *name* isn't in a recognised format." msgstr "" -#: ../../library/pkgutil.rst:265 +#: ../../library/pkgutil.rst:245 msgid ":exc:`ImportError` -- if an import failed when it shouldn't have." msgstr "" -#: ../../library/pkgutil.rst:267 +#: ../../library/pkgutil.rst:247 msgid "" ":exc:`AttributeError` -- If a failure occurred when traversing the object " "hierarchy within the imported package to get to the desired object." diff --git a/library/platform.po b/library/platform.po index 0d043e0ab4..e451341669 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-10 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,8 +62,8 @@ msgid "" "supported pointer size." msgstr "" "無法確定的值將回傳參數所給定之預先設置值。如果給定的位元為 ``''``\\ ,則會使" -"用 ``sizeof(pointer)``\\ (或者當 Python 版本 < 1.5.2 時為 ``sizeof(long)``" -"\\ )作為所支援指標大小的指示器 (indicator)。" +"用 ``sizeof(pointer)``\\ (或者當 Python 版本 < 1.5.2 時為 " +"``sizeof(long)``\\ )作為所支援指標大小的指示器 (indicator)。" #: ../../library/platform.rst:38 msgid "" @@ -226,8 +226,8 @@ msgid "" "Returns the system/OS name, such as ``'Linux'``, ``'Darwin'``, ``'Java'``, " "``'Windows'``. An empty string is returned if the value cannot be determined." msgstr "" -"回傳系統/OS 的名稱,例如 ``'Linux'``\\ 、\\ ``'Darwin'``\\ 、\\ ``'Java'``" -"\\ 、\\ ``'Windows'``\\ 。如果該值無法確定則回傳一個空字串。" +"回傳系統/OS 的名稱,例如 ``'Linux'``\\ 、\\ ``'Darwin'``\\ 、\\ " +"``'Java'``\\ 、\\ ``'Windows'``\\ 。如果該值無法確定則回傳一個空字串。" #: ../../library/platform.rst:154 msgid "" @@ -235,8 +235,8 @@ msgid "" "used for some systems. It also does some reordering of the information in " "some cases where it would otherwise cause confusion." msgstr "" -"回傳做為某些系統所使用的常見行銷名稱之別名的 ``(system, release, version)``" -"\\ 。它還會在可能導致混淆的情況下對資訊進行一些重新排序。" +"回傳做為某些系統所使用的常見行銷名稱之別名的 ``(system, release, " +"version)``\\ 。它還會在可能導致混淆的情況下對資訊進行一些重新排序。" #: ../../library/platform.rst:161 msgid "" @@ -258,33 +258,36 @@ msgstr "" "`processor`\\ 。" #: ../../library/platform.rst:171 +msgid ":attr:`processor` is resolved late, on demand." +msgstr "" + +#: ../../library/platform.rst:173 msgid "" -"Note that this adds a sixth attribute (:attr:`processor`) not present in " -"the :func:`os.uname` result. Also, the attribute names are different for " -"the first two attributes; :func:`os.uname` names them :attr:`sysname` and :" -"attr:`nodename`." +"Note: the first two attribute names differ from the names presented by :func:" +"`os.uname`, where they are named :attr:`sysname` and :attr:`nodename`." msgstr "" -"請注意此函式新增的第六個屬性 (:attr:`processor`) 並不存在於 :func:`os.uname` " -"的結果中。並且前兩個屬性的屬性名稱也不一致;\\ :func:`os.uname` 是將它們稱" -"為 :attr:`sysname` 和 :attr:`nodename`\\ 。" -#: ../../library/platform.rst:176 +#: ../../library/platform.rst:177 msgid "Entries which cannot be determined are set to ``''``." msgstr "無法確定的條目會被設為 ``''``\\ 。" -#: ../../library/platform.rst:178 +#: ../../library/platform.rst:179 msgid "Result changed from a tuple to a :func:`~collections.namedtuple`." msgstr "將結果從 tuple 改為 :func:`~collections.namedtuple`\\ 。" -#: ../../library/platform.rst:183 +#: ../../library/platform.rst:182 +msgid ":attr:`processor` is resolved late instead of immediately." +msgstr "" + +#: ../../library/platform.rst:187 msgid "Java Platform" msgstr "Java 平台" -#: ../../library/platform.rst:188 +#: ../../library/platform.rst:192 msgid "Version interface for Jython." msgstr "Jython 的版本介面。" -#: ../../library/platform.rst:190 +#: ../../library/platform.rst:194 msgid "" "Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a " "tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple " @@ -296,11 +299,11 @@ msgstr "" "os_version, os_arch)``\\ 。無法確定的值將被設為由參數所給定的預設值(預設均" "為 ``''``\\ )。" -#: ../../library/platform.rst:197 +#: ../../library/platform.rst:201 msgid "Windows Platform" msgstr "Windows 平台" -#: ../../library/platform.rst:202 +#: ../../library/platform.rst:206 msgid "" "Get additional version information from the Windows Registry and return a " "tuple ``(release, version, csd, ptype)`` referring to OS release, version " @@ -312,7 +315,7 @@ msgstr "" "``(release, version, csd, ptype)``\\ ,它代表 OS 發行版、版本號、CSD 級別 " "(service pack) 和 OS 類型(多個/單個處理器)。" -#: ../../library/platform.rst:208 +#: ../../library/platform.rst:212 msgid "" "As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT " "machines and ``'Multiprocessor Free'`` on multi processor machines. The " @@ -325,49 +328,50 @@ msgstr "" "版本沒有除錯程式。它也可能以 *'Checked'* 表示,代表該 OS 版本使用了除錯程式," "即檢查引數、範圍等的程式。" -#: ../../library/platform.rst:216 +#: ../../library/platform.rst:220 msgid "" "Returns a string representing the current Windows edition, or ``None`` if " "the value cannot be determined. Possible values include but are not limited " "to ``'Enterprise'``, ``'IoTUAP'``, ``'ServerStandard'``, and " "``'nanoserver'``." msgstr "" -"回傳一個代表當前 Windows 版本的字串。可能的值包括但不限於 ``'Enterprise'``" -"\\ 、\\ ``'IoTUAP'``\\ 、\\ ``'ServerStandard'`` 和 ``'nanoserver'``\\ 。" +"回傳一個代表當前 Windows 版本的字串。可能的值包括但不限於 " +"``'Enterprise'``\\ 、\\ ``'IoTUAP'``\\ 、\\ ``'ServerStandard'`` 和 " +"``'nanoserver'``\\ 。" -#: ../../library/platform.rst:224 +#: ../../library/platform.rst:228 msgid "" "Return ``True`` if the Windows edition returned by :func:`win32_edition` is " "recognized as an IoT edition." msgstr "" -"如果 :func:`win32_edition` 回傳的 Windows 版本被識別為 IoT 版則回傳 ``True``" -"\\ 。" +"如果 :func:`win32_edition` 回傳的 Windows 版本被識別為 IoT 版則回傳 " +"``True``\\ 。" -#: ../../library/platform.rst:231 +#: ../../library/platform.rst:235 msgid "macOS Platform" msgstr "macOS 平台" -#: ../../library/platform.rst:236 +#: ../../library/platform.rst:240 msgid "" "Get macOS version information and return it as tuple ``(release, " "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " "dev_stage, non_release_version)``." msgstr "" -"獲取 Mac OS 版本資訊並將其回傳為 tuple ``(release, versioninfo, machine)``" -"\\ ,其中 *versioninfo* 是一個 tuple ``(version, dev_stage, " +"獲取 Mac OS 版本資訊並將其回傳為 tuple ``(release, versioninfo, " +"machine)``\\ ,其中 *versioninfo* 是一個 tuple ``(version, dev_stage, " "non_release_version)``\\ 。" -#: ../../library/platform.rst:240 +#: ../../library/platform.rst:244 msgid "" "Entries which cannot be determined are set to ``''``. All tuple entries are " "strings." msgstr "無法確定的條目會被設為 ``''``\\ 。所有 tuple 條目均為字串。" -#: ../../library/platform.rst:245 +#: ../../library/platform.rst:249 msgid "Unix Platforms" msgstr "Unix 平台" -#: ../../library/platform.rst:249 +#: ../../library/platform.rst:253 msgid "" "Tries to determine the libc version against which the file executable " "(defaults to the Python interpreter) is linked. Returns a tuple of strings " @@ -377,7 +381,7 @@ msgstr "" "嘗試確認可執行檔案(預設為 Python 直譯器)所連結到的 libc 版本。回傳一個字串 " "tuple ``(lib, version)``\\ ,當查詢失敗時其預設值將被設為給定的參數值。" -#: ../../library/platform.rst:253 +#: ../../library/platform.rst:257 msgid "" "Note that this function has intimate knowledge of how different libc " "versions add symbols to the executable is probably only usable for " @@ -386,15 +390,15 @@ msgstr "" "請注意,此函式對於不同 libc 版本如何為可執行檔案新增符號的方式有深層的關聯," "可能僅適用於以 :program:`gcc` 編譯出來的可執行檔案。" -#: ../../library/platform.rst:257 +#: ../../library/platform.rst:261 msgid "The file is read and scanned in chunks of *chunksize* bytes." msgstr "檔案會以 *chunksize* 位元組大小的分塊 (chunk) 來讀取和掃描。" -#: ../../library/platform.rst:261 +#: ../../library/platform.rst:265 msgid "Linux Platforms" msgstr "Linux 平台" -#: ../../library/platform.rst:265 +#: ../../library/platform.rst:269 msgid "" "Get operating system identification from ``os-release`` file and return it " "as a dict. The ``os-release`` file is a `freedesktop.org standard `_\\ 、並在大多數 Linux 發行版上可用。一個重要的" "例外是 Android 和基於 Android 的發行版。" -#: ../../library/platform.rst:271 +#: ../../library/platform.rst:275 msgid "" "Raises :exc:`OSError` or subclass when neither ``/etc/os-release`` nor ``/" "usr/lib/os-release`` can be read." @@ -415,7 +419,7 @@ msgstr "" "當 ``/etc/os-release`` 與 ``/usr/lib/os-release`` 均無法被讀取時將引發 :exc:" "`OSError` 或其子類別。" -#: ../../library/platform.rst:274 +#: ../../library/platform.rst:278 msgid "" "On success, the function returns a dictionary where keys and values are " "strings. Values have their special characters like ``\"`` and ``$`` " @@ -423,12 +427,12 @@ msgid "" "defined according to the standard. All other fields are optional. Vendors " "may include additional fields." msgstr "" -"成功時,該函式將回傳一個字典,其中鍵和值均為字串。值當中的特殊字元例如 ``" -"\"`` 和 ``$`` 會被移除引號 (unquoted)。欄位 ``NAME``\\ 、\\ ``ID`` 和 " +"成功時,該函式將回傳一個字典,其中鍵和值均為字串。值當中的特殊字元例如 " +"``\"`` 和 ``$`` 會被移除引號 (unquoted)。欄位 ``NAME``\\ 、\\ ``ID`` 和 " "``PRETTY_NAME`` 總會按照標準來定義。所有其他欄位都是可選的。根據不同廠商可能" "會包括額外的欄位。" -#: ../../library/platform.rst:280 +#: ../../library/platform.rst:284 msgid "" "Note that fields like ``NAME``, ``VERSION``, and ``VARIANT`` are strings " "suitable for presentation to users. Programs should use fields like ``ID``, " @@ -439,9 +443,19 @@ msgstr "" "的字串。程式應當使用 ``ID``\\ 、\\ ``ID_LIKE``\\ 、\\ ``VERSION_ID`` 或 " "``VARIANT_ID`` 等欄位來標識 Linux 發行版。" -#: ../../library/platform.rst:285 +#: ../../library/platform.rst:289 msgid "Example::" msgstr "" "範例:\n" "\n" "::" + +#~ msgid "" +#~ "Note that this adds a sixth attribute (:attr:`processor`) not present in " +#~ "the :func:`os.uname` result. Also, the attribute names are different for " +#~ "the first two attributes; :func:`os.uname` names them :attr:`sysname` " +#~ "and :attr:`nodename`." +#~ msgstr "" +#~ "請注意此函式新增的第六個屬性 (:attr:`processor`) 並不存在於 :func:`os." +#~ "uname` 的結果中。並且前兩個屬性的屬性名稱也不一致;\\ :func:`os.uname` 是" +#~ "將它們稱為 :attr:`sysname` 和 :attr:`nodename`\\ 。" diff --git a/library/poplib.po b/library/poplib.po index 351d58855f..1059435461 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,7 +75,7 @@ msgid "" "timeout setting will be used)." msgstr "" -#: ../../library/poplib.rst:55 ../../library/poplib.rst:81 +#: ../../library/poplib.rst:55 ../../library/poplib.rst:77 msgid "" "Raises an :ref:`auditing event ` ``poplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -83,7 +83,7 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``poplib.connect``。" -#: ../../library/poplib.rst:57 ../../library/poplib.rst:83 +#: ../../library/poplib.rst:57 ../../library/poplib.rst:79 msgid "" "Raises an :ref:`auditing event ` ``poplib.putline`` with arguments " "``self``, ``line``." @@ -91,7 +91,7 @@ msgstr "" "引發一個附帶引數 ``self``、``line`` 的\\ :ref:`稽核事件 ` ``poplib." "putline``。" -#: ../../library/poplib.rst:48 ../../library/poplib.rst:74 +#: ../../library/poplib.rst:48 ../../library/poplib.rst:70 msgid "" "All commands will raise an :ref:`auditing event ` ``poplib." "putline`` with arguments ``self`` and ``line``, where ``line`` is the bytes " @@ -100,7 +100,7 @@ msgstr "" "引發一個附帶引數 ``self``、``line`` 的\\ :ref:`稽核事件 ` ``poplib." "putline``。其中 ``line`` 為即將傳送給遠端的位元組。" -#: ../../library/poplib.rst:52 ../../library/poplib.rst:93 +#: ../../library/poplib.rst:52 ../../library/poplib.rst:82 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket." @@ -117,50 +117,40 @@ msgid "" "for best practices." msgstr "" -#: ../../library/poplib.rst:66 -msgid "" -"*keyfile* and *certfile* are a legacy alternative to *context* - they can " -"point to PEM-formatted private key and certificate chain files, " -"respectively, for the SSL connection." -msgstr "" - -#: ../../library/poplib.rst:78 +#: ../../library/poplib.rst:74 msgid "*context* parameter added." msgstr "" -#: ../../library/poplib.rst:81 +#: ../../library/poplib.rst:77 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/poplib.rst:88 -msgid "" -"*keyfile* and *certfile* are deprecated in favor of *context*. Please use :" -"meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +#: ../../library/poplib.rst:86 +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "" -#: ../../library/poplib.rst:97 +#: ../../library/poplib.rst:89 msgid "One exception is defined as an attribute of the :mod:`poplib` module:" msgstr "" -#: ../../library/poplib.rst:102 +#: ../../library/poplib.rst:94 msgid "" "Exception raised on any errors from this module (errors from :mod:`socket` " "module are not caught). The reason for the exception is passed to the " "constructor as a string." msgstr "" -#: ../../library/poplib.rst:110 +#: ../../library/poplib.rst:102 msgid "Module :mod:`imaplib`" msgstr ":mod:`imaplib` 模組" -#: ../../library/poplib.rst:110 +#: ../../library/poplib.rst:102 msgid "The standard Python IMAP module." msgstr "" -#: ../../library/poplib.rst:114 +#: ../../library/poplib.rst:106 msgid "" "`Frequently Asked Questions About Fetchmail `_" @@ -168,28 +158,28 @@ msgstr "" "`關於 Fetchmail 的常見問題 `_" -#: ../../library/poplib.rst:113 +#: ../../library/poplib.rst:105 msgid "" "The FAQ for the :program:`fetchmail` POP/IMAP client collects information on " "POP3 server variations and RFC noncompliance that may be useful if you need " "to write an application based on the POP protocol." msgstr "" -#: ../../library/poplib.rst:121 +#: ../../library/poplib.rst:113 msgid "POP3 Objects" msgstr "POP3 物件" -#: ../../library/poplib.rst:123 +#: ../../library/poplib.rst:115 msgid "" "All POP3 commands are represented by methods of the same name, in lowercase; " "most return the response text sent by the server." msgstr "" -#: ../../library/poplib.rst:126 +#: ../../library/poplib.rst:118 msgid "A :class:`POP3` instance has the following methods:" msgstr "" -#: ../../library/poplib.rst:131 +#: ../../library/poplib.rst:123 msgid "" "Set the instance's debugging level. This controls the amount of debugging " "output printed. The default, ``0``, produces no debugging output. A value " @@ -199,81 +189,81 @@ msgid "" "connection." msgstr "" -#: ../../library/poplib.rst:140 +#: ../../library/poplib.rst:132 msgid "Returns the greeting string sent by the POP3 server." msgstr "" -#: ../../library/poplib.rst:145 +#: ../../library/poplib.rst:137 msgid "" "Query the server's capabilities as specified in :rfc:`2449`. Returns a " "dictionary in the form ``{'name': ['param'...]}``." msgstr "" -#: ../../library/poplib.rst:153 +#: ../../library/poplib.rst:145 msgid "" "Send user command, response should indicate that a password is required." msgstr "" -#: ../../library/poplib.rst:158 +#: ../../library/poplib.rst:150 msgid "" "Send password, response includes message count and mailbox size. Note: the " "mailbox on the server is locked until :meth:`~poplib.quit` is called." msgstr "" -#: ../../library/poplib.rst:164 +#: ../../library/poplib.rst:156 msgid "Use the more secure APOP authentication to log into the POP3 server." msgstr "" -#: ../../library/poplib.rst:169 +#: ../../library/poplib.rst:161 msgid "" "Use RPOP authentication (similar to UNIX r-commands) to log into POP3 server." msgstr "" -#: ../../library/poplib.rst:174 +#: ../../library/poplib.rst:166 msgid "" "Get mailbox status. The result is a tuple of 2 integers: ``(message count, " "mailbox size)``." msgstr "" -#: ../../library/poplib.rst:180 +#: ../../library/poplib.rst:172 msgid "" "Request message list, result is in the form ``(response, ['mesg_num " "octets', ...], octets)``. If *which* is set, it is the message to list." msgstr "" -#: ../../library/poplib.rst:186 +#: ../../library/poplib.rst:178 msgid "" "Retrieve whole message number *which*, and set its seen flag. Result is in " "form ``(response, ['line', ...], octets)``." msgstr "" -#: ../../library/poplib.rst:192 +#: ../../library/poplib.rst:184 msgid "" "Flag message number *which* for deletion. On most servers deletions are not " "actually performed until QUIT (the major exception is Eudora QPOP, which " "deliberately violates the RFCs by doing pending deletes on any disconnect)." msgstr "" -#: ../../library/poplib.rst:199 +#: ../../library/poplib.rst:191 msgid "Remove any deletion marks for the mailbox." msgstr "" -#: ../../library/poplib.rst:204 +#: ../../library/poplib.rst:196 msgid "Do nothing. Might be used as a keep-alive." msgstr "" -#: ../../library/poplib.rst:209 +#: ../../library/poplib.rst:201 msgid "Signoff: commit changes, unlock mailbox, drop connection." msgstr "" -#: ../../library/poplib.rst:214 +#: ../../library/poplib.rst:206 msgid "" "Retrieves the message header plus *howmuch* lines of the message after the " "header of message number *which*. Result is in form ``(response, " "['line', ...], octets)``." msgstr "" -#: ../../library/poplib.rst:218 +#: ../../library/poplib.rst:210 msgid "" "The POP3 TOP command this method uses, unlike the RETR command, doesn't set " "the message's seen flag; unfortunately, TOP is poorly specified in the RFCs " @@ -281,26 +271,26 @@ msgid "" "against the POP3 servers you will use before trusting it." msgstr "" -#: ../../library/poplib.rst:226 +#: ../../library/poplib.rst:218 msgid "" "Return message digest (unique id) list. If *which* is specified, result " "contains the unique id for that message in the form ``'response mesgnum " "uid``, otherwise result is list ``(response, ['mesgnum uid', ...], octets)``." msgstr "" -#: ../../library/poplib.rst:233 +#: ../../library/poplib.rst:225 msgid "" "Try to switch to UTF-8 mode. Returns the server response if successful, " "raises :class:`error_proto` if not. Specified in :RFC:`6856`." msgstr "" -#: ../../library/poplib.rst:241 +#: ../../library/poplib.rst:233 msgid "" "Start a TLS session on the active connection as specified in :rfc:`2595`. " "This is only allowed before user authentication" msgstr "" -#: ../../library/poplib.rst:244 +#: ../../library/poplib.rst:236 msgid "" "*context* parameter is a :class:`ssl.SSLContext` object which allows " "bundling SSL configuration options, certificates and private keys into a " @@ -308,29 +298,29 @@ msgid "" "for best practices." msgstr "" -#: ../../library/poplib.rst:249 +#: ../../library/poplib.rst:241 msgid "" "This method supports hostname checking via :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/poplib.rst:256 +#: ../../library/poplib.rst:248 msgid "" "Instances of :class:`POP3_SSL` have no additional methods. The interface of " "this subclass is identical to its parent." msgstr "" -#: ../../library/poplib.rst:263 +#: ../../library/poplib.rst:255 msgid "POP3 Example" msgstr "POP3 範例" -#: ../../library/poplib.rst:265 +#: ../../library/poplib.rst:257 msgid "" "Here is a minimal example (without error checking) that opens a mailbox and " "retrieves and prints all messages::" msgstr "" -#: ../../library/poplib.rst:278 +#: ../../library/poplib.rst:270 msgid "" "At the end of the module, there is a test section that contains a more " "extensive example of usage." diff --git a/library/pprint.po b/library/pprint.po index 1dac2a136a..48282c8e41 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -180,42 +180,47 @@ msgid "" msgstr "" #: ../../library/pprint.rst:174 -msgid "Determine if *object* requires a recursive representation." +msgid "" +"Determine if *object* requires a recursive representation. This function is " +"subject to the same limitations as noted in :func:`saferepr` below and may " +"raise an :exc:`RecursionError` if it fails to detect a recursive object." msgstr "" -#: ../../library/pprint.rst:177 +#: ../../library/pprint.rst:179 msgid "One more support function is also defined:" msgstr "" -#: ../../library/pprint.rst:181 +#: ../../library/pprint.rst:183 msgid "" -"Return a string representation of *object*, protected against recursive data " -"structures. If the representation of *object* exposes a recursive entry, " -"the recursive reference will be represented as ````. The representation is not otherwise formatted." msgstr "" -#: ../../library/pprint.rst:193 +#: ../../library/pprint.rst:197 msgid "PrettyPrinter Objects" msgstr "PrettyPrinter 物件" -#: ../../library/pprint.rst:195 +#: ../../library/pprint.rst:199 msgid ":class:`PrettyPrinter` instances have the following methods:" msgstr "" -#: ../../library/pprint.rst:200 +#: ../../library/pprint.rst:204 msgid "" "Return the formatted representation of *object*. This takes into account " "the options passed to the :class:`PrettyPrinter` constructor." msgstr "" -#: ../../library/pprint.rst:206 +#: ../../library/pprint.rst:210 msgid "" "Print the formatted representation of *object* on the configured stream, " "followed by a newline." msgstr "" -#: ../../library/pprint.rst:209 +#: ../../library/pprint.rst:213 msgid "" "The following methods provide the implementations for the corresponding " "functions of the same names. Using these methods on an instance is slightly " @@ -223,7 +228,7 @@ msgid "" "created." msgstr "" -#: ../../library/pprint.rst:219 +#: ../../library/pprint.rst:223 msgid "" "Determine if the formatted representation of the object is \"readable,\" or " "can be used to reconstruct the value using :func:`eval`. Note that this " @@ -232,18 +237,18 @@ msgid "" "returns ``False``." msgstr "" -#: ../../library/pprint.rst:228 +#: ../../library/pprint.rst:232 msgid "Determine if the object requires a recursive representation." msgstr "" -#: ../../library/pprint.rst:230 +#: ../../library/pprint.rst:234 msgid "" "This method is provided as a hook to allow subclasses to modify the way " "objects are converted to strings. The default implementation uses the " "internals of the :func:`saferepr` implementation." msgstr "" -#: ../../library/pprint.rst:237 +#: ../../library/pprint.rst:241 msgid "" "Returns three values: the formatted version of *object* as a string, a flag " "indicating whether the result is readable, and a flag indicating whether " @@ -261,28 +266,28 @@ msgid "" "of the current call." msgstr "" -#: ../../library/pprint.rst:255 +#: ../../library/pprint.rst:259 msgid "Example" msgstr "範例" -#: ../../library/pprint.rst:257 +#: ../../library/pprint.rst:261 msgid "" "To demonstrate several uses of the :func:`pprint` function and its " "parameters, let's fetch information about a project from `PyPI `_::" msgstr "" -#: ../../library/pprint.rst:266 +#: ../../library/pprint.rst:270 msgid "In its basic form, :func:`pprint` shows the whole object::" msgstr "" -#: ../../library/pprint.rst:322 +#: ../../library/pprint.rst:326 msgid "" "The result can be limited to a certain *depth* (ellipsis is used for deeper " "contents)::" msgstr "" -#: ../../library/pprint.rst:368 +#: ../../library/pprint.rst:372 msgid "" "Additionally, maximum character *width* can be suggested. If a long object " "cannot be split, the specified width will be exceeded::" @@ -296,10 +301,10 @@ msgstr "..." msgid "placeholder" msgstr "placeholder(佔位符號)" -#: ../../library/pprint.rst:162 ../../library/pprint.rst:217 +#: ../../library/pprint.rst:162 ../../library/pprint.rst:221 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/pprint.rst:162 ../../library/pprint.rst:217 +#: ../../library/pprint.rst:162 ../../library/pprint.rst:221 msgid "eval" msgstr "eval" diff --git a/library/random.po b/library/random.po index 73461c05f2..0548a889f0 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-15 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -226,25 +226,28 @@ msgid "Functions for integers" msgstr "回傳整數的函式" #: ../../library/random.rst:126 -msgid "" -"Return a randomly selected element from ``range(start, stop, step)``. This " -"is equivalent to ``choice(range(start, stop, step))``, but doesn't actually " -"build a range object." +msgid "Return a randomly selected element from ``range(start, stop, step)``." msgstr "" -"從 ``range(start, stop, step)`` 中回傳一個隨機選擇的元素。這等效於 " -"``choice(range(start, stop, step))``,但實際上並沒有構建範圍物件。" -#: ../../library/random.rst:130 +#: ../../library/random.rst:128 msgid "" -"The positional argument pattern matches that of :func:`range`. Keyword " -"arguments should not be used because the function may use them in unexpected " -"ways." +"This is roughly equivalent to ``choice(range(start, stop, step))`` but " +"supports arbitrarily large ranges and is optimized for common cases." +msgstr "" + +#: ../../library/random.rst:131 +msgid "The positional argument pattern matches the :func:`range` function." msgstr "" -"位置引數模式與 :func:`range` 的位置引數模式匹配。不應使用關鍵字引數,因為函式" -"可能會以不預期的方式使用它們。" #: ../../library/random.rst:133 msgid "" +"Keyword arguments should not be used because they can be interpreted in " +"unexpected ways. For example ``randrange(start=100)`` is interpreted as " +"``randrange(0, 100, 1)``." +msgstr "" + +#: ../../library/random.rst:137 +msgid "" ":meth:`randrange` is more sophisticated about producing equally distributed " "values. Formerly it used a style like ``int(random()*n)`` which could " "produce slightly uneven distributions." @@ -252,35 +255,28 @@ msgstr "" ":meth:`randrange` 在產生均勻分佈的值方面更為複雜。以前,它使用像 " "``int(random()*n)`` 這樣的樣式,這可能會產生稍微不均勻的分佈。" -#: ../../library/random.rst:138 +#: ../../library/random.rst:142 +#, fuzzy msgid "" -"The automatic conversion of non-integer types to equivalent integers is " -"deprecated. Currently ``randrange(10.0)`` is losslessly converted to " -"``randrange(10)``. In the future, this will raise a :exc:`TypeError`." +"Automatic conversion of non-integer types is no longer supported. Calls such " +"as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` now raise a :exc:" +"`TypeError`." msgstr "" "非整數類型到等效整數的自動轉換已被棄用。目前 ``randrange(10.0)`` 被無損轉換" "為 ``randrange(10)``。將來,這將會引發 :exc:`TypeError`。" -#: ../../library/random.rst:143 -msgid "" -"The exception raised for non-integral values such as ``randrange(10.5)`` or " -"``randrange('10')`` will be changed from :exc:`ValueError` to :exc:" -"`TypeError`." -msgstr "" -"對於非整數值,例如 ``randrange(10.5)`` 或 ``randrange('10')``,引發的例外將" -"從 :exc:`ValueError` 改為 :exc:`TypeError`。" - -#: ../../library/random.rst:150 +#: ../../library/random.rst:149 msgid "" "Return a random integer *N* such that ``a <= N <= b``. Alias for " "``randrange(a, b+1)``." msgstr "" "回傳一個隨機整數 *N*,使得 ``a <= N <= b``。為 ``randrange(a, b+1)`` 的別名。" -#: ../../library/random.rst:155 +#: ../../library/random.rst:154 +#, fuzzy msgid "" "Returns a non-negative Python integer with *k* random bits. This method is " -"supplied with the MersenneTwister generator and some other generators may " +"supplied with the Mersenne Twister generator and some other generators may " "also provide it as an optional part of the API. When available, :meth:" "`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." msgstr "" @@ -288,15 +284,15 @@ msgstr "" "生器一起提供,一些其他的產生器也可能將其作為 API 的可選部分。如果可用,\\ :" "meth:`getrandbits` 使 :meth:`randrange` 能夠處理任意大的範圍。" -#: ../../library/random.rst:161 +#: ../../library/random.rst:160 msgid "This method now accepts zero for *k*." msgstr "此方法現在接受 *k* 為零。" -#: ../../library/random.rst:166 +#: ../../library/random.rst:165 msgid "Functions for sequences" msgstr "回傳序列的函式" -#: ../../library/random.rst:170 +#: ../../library/random.rst:169 msgid "" "Return a random element from the non-empty sequence *seq*. If *seq* is " "empty, raises :exc:`IndexError`." @@ -304,7 +300,7 @@ msgstr "" "從非空序列 *seq* 回傳一個隨機元素。如果 *seq* 為空,則引發 :exc:" "`IndexError`。" -#: ../../library/random.rst:175 +#: ../../library/random.rst:174 msgid "" "Return a *k* sized list of elements chosen from the *population* with " "replacement. If the *population* is empty, raises :exc:`IndexError`." @@ -312,7 +308,7 @@ msgstr "" "回傳從 *population* 中重置取樣出的一個大小為 *k* 的元素 list。如果 " "*population* 為空,則引發 :exc:`IndexError`。" -#: ../../library/random.rst:178 +#: ../../library/random.rst:177 msgid "" "If a *weights* sequence is specified, selections are made according to the " "relative weights. Alternatively, if a *cum_weights* sequence is given, the " @@ -328,7 +324,7 @@ msgstr "" "15, 45, 50]``。在內部,相對權重在進行選擇之前會轉換為累積權重,因此提供累積權" "重可以節省工作。" -#: ../../library/random.rst:187 +#: ../../library/random.rst:186 msgid "" "If neither *weights* nor *cum_weights* are specified, selections are made " "with equal probability. If a weights sequence is supplied, it must be the " @@ -339,7 +335,7 @@ msgstr "" "供了加權序列,則該序列的長度必須與 *population* 序列的長度相同。它是一個 :" "exc:`TypeError` 來指定 *weights* 和 *cum_weights*。" -#: ../../library/random.rst:192 +#: ../../library/random.rst:191 msgid "" "The *weights* or *cum_weights* can use any numeric type that interoperates " "with the :class:`float` values returned by :func:`random` (that includes " @@ -352,7 +348,7 @@ msgstr "" "數值類型。權重假定為非負數和有限的。如果所有權重均為零,則引發 :exc:" "`ValueError`。" -#: ../../library/random.rst:198 +#: ../../library/random.rst:197 msgid "" "For a given seed, the :func:`choices` function with equal weighting " "typically produces a different sequence than repeated calls to :func:" @@ -366,15 +362,15 @@ msgstr "" "和速度。:func:`choice` 使用的演算法預設為整數運算和重複選擇,以避免捨入誤差產" "生的小偏差。" -#: ../../library/random.rst:207 +#: ../../library/random.rst:206 msgid "Raises a :exc:`ValueError` if all weights are zero." msgstr "如果所有權重均為零,則引發 :exc:`ValueError`。" -#: ../../library/random.rst:213 +#: ../../library/random.rst:212 msgid "Shuffle the sequence *x* in place." msgstr "將序列 *x* 原地 (in place) 隨機打亂位置。" -#: ../../library/random.rst:215 +#: ../../library/random.rst:214 msgid "" "To shuffle an immutable sequence and return a new shuffled list, use " "``sample(x, k=len(x))`` instead." @@ -382,7 +378,7 @@ msgstr "" "要打亂一個不可變的序列並回傳一個新的被打亂的 list(串列),請使用 " "``sample(x, k=len(x))``。" -#: ../../library/random.rst:218 +#: ../../library/random.rst:217 msgid "" "Note that even for small ``len(x)``, the total number of permutations of *x* " "can quickly grow larger than the period of most random number generators. " @@ -394,11 +390,11 @@ msgstr "" "數產生器的週期。這意味著長序列的大多數置換永遠無法產生。例如,長度為 2080 的" "序列是 Mersenne Twister 隨機數產生器週期內可以容納的最大序列。" -#: ../../library/random.rst:225 +#: ../../library/random.rst:224 msgid "The optional parameter *random*." msgstr "選擇性參數 *random*。" -#: ../../library/random.rst:230 +#: ../../library/random.rst:229 msgid "" "Return a *k* length list of unique elements chosen from the population " "sequence. Used for random sampling without replacement." @@ -406,7 +402,7 @@ msgstr "" "回傳從母體序列中選擇出的一個包含獨特元素、長度為 *k* 的 list。用於不重置的隨" "機取樣。" -#: ../../library/random.rst:233 +#: ../../library/random.rst:232 msgid "" "Returns a new list containing elements from the population while leaving the " "original population unchanged. The resulting list is in selection order so " @@ -418,7 +414,7 @@ msgstr "" "此所有子切片也會是有效的隨機樣本。這允許抽獎獲獎者(樣本)分為大獎和第二名獲" "獎者(子切片)。" -#: ../../library/random.rst:239 +#: ../../library/random.rst:238 msgid "" "Members of the population need not be :term:`hashable` or unique. If the " "population contains repeats, then each occurrence is a possible selection in " @@ -427,7 +423,7 @@ msgstr "" "母體成員不必是 :term:`hashable` 或唯一的。如果母體包含重複項,則每次出現都是" "樣本中可能出現的一個選擇。" -#: ../../library/random.rst:242 +#: ../../library/random.rst:241 msgid "" "Repeated elements can be specified one at a time or with the optional " "keyword-only *counts* parameter. For example, ``sample(['red', 'blue'], " @@ -438,7 +434,7 @@ msgstr "" "素。例如 ``sample(['red', 'blue'], counts=[4, 2], k=5)`` 等同於 " "``sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5)``。" -#: ../../library/random.rst:247 +#: ../../library/random.rst:246 msgid "" "To choose a sample from a range of integers, use a :func:`range` object as " "an argument. This is especially fast and space efficient for sampling from " @@ -447,28 +443,55 @@ msgstr "" "若要從整數範圍中選擇範例,請使用 :func:`range` 物件作為引數。這對於從大型母體" "中取樣特別快速且節省空間:\\ ``sample(range(10000000), k=60)``。" -#: ../../library/random.rst:251 +#: ../../library/random.rst:250 msgid "" "If the sample size is larger than the population size, a :exc:`ValueError` " "is raised." msgstr "如果樣本大小大於母體大小,:exc:`ValueError` 會被引發。" -#: ../../library/random.rst:254 +#: ../../library/random.rst:253 msgid "Added the *counts* parameter." msgstr "新增 *counts* 參數。" -#: ../../library/random.rst:259 +#: ../../library/random.rst:258 msgid "" "The *population* must be a sequence. Automatic conversion of sets to lists " "is no longer supported." msgstr "" -#: ../../library/random.rst:266 -msgid "Real-valued distributions" +#: ../../library/random.rst:262 +#, fuzzy +msgid "Discrete distributions" msgstr "實數分布" +#: ../../library/random.rst:264 +msgid "The following function generates a discrete distribution." +msgstr "" + #: ../../library/random.rst:268 msgid "" +"`Binomial distribution `_. Return the number of successes for *n* independent trials with the " +"probability of success in each trial being *p*:" +msgstr "" + +#: ../../library/random.rst:273 +msgid "Mathematically equivalent to::" +msgstr "" + +#: ../../library/random.rst:277 +msgid "" +"The number of trials *n* should be a non-negative integer. The probability " +"of success *p* should be between ``0.0 <= p <= 1.0``. The result is an " +"integer in the range ``0 <= X <= n``." +msgstr "" + +#: ../../library/random.rst:287 +msgid "Real-valued distributions" +msgstr "實數分布" + +#: ../../library/random.rst:289 +msgid "" "The following functions generate specific real-valued distributions. " "Function parameters are named after the corresponding variables in the " "distribution's equation, as used in common mathematical practice; most of " @@ -477,12 +500,12 @@ msgstr "" "以下函式產生特定的實數分佈。函式參數以分佈方程中的對應變數命名,如常見的數學" "實踐所示;這些方程式中的大多數都可以在任意統計文本中找到。" -#: ../../library/random.rst:276 +#: ../../library/random.rst:297 msgid "" "Return the next random floating point number in the range ``0.0 <= X < 1.0``" msgstr "回傳範圍 ``0.0 <= X < 1.0`` 中的下一個隨機浮點數" -#: ../../library/random.rst:281 +#: ../../library/random.rst:302 msgid "" "Return a random floating point number *N* such that ``a <= N <= b`` for ``a " "<= b`` and ``b <= N <= a`` for ``b < a``." @@ -490,7 +513,7 @@ msgstr "" "回傳一個隨機浮點數 *N*,當 ``a <= b`` 時確保 N 為 ``a <= N <= b`` 、``b < " "a`` 時確保 N 為 ``b <= N <= a``。" -#: ../../library/random.rst:284 +#: ../../library/random.rst:305 msgid "" "The end-point value ``b`` may or may not be included in the range depending " "on floating-point rounding in the equation ``a + (b-a) * random()``." @@ -498,7 +521,7 @@ msgstr "" "終點值 ``b`` 可能包含在範圍內,也可能不包含在範圍內,取決於方程式 ``a + (b-" "a) * random()`` 中的浮點捨入。" -#: ../../library/random.rst:290 +#: ../../library/random.rst:311 msgid "" "Return a random floating point number *N* such that ``low <= N <= high`` and " "with the specified *mode* between those bounds. The *low* and *high* bounds " @@ -509,7 +532,7 @@ msgstr "" "的 *mode*。*low* 和 *high* 邊界預設為零和一。*mode* 引數預設為邊界之間的中" "點,從而給出對稱分佈。" -#: ../../library/random.rst:298 +#: ../../library/random.rst:319 msgid "" "Beta distribution. Conditions on the parameters are ``alpha > 0`` and " "``beta > 0``. Returned values range between 0 and 1." @@ -517,7 +540,7 @@ msgstr "" "Beta(貝它)分布。參數的條件為 ``alpha > 0`` 和 ``beta > 0``。回傳值的範圍介" "於 0 和 1 之間。" -#: ../../library/random.rst:304 +#: ../../library/random.rst:325 msgid "" "Exponential distribution. *lambd* is 1.0 divided by the desired mean. It " "should be nonzero. (The parameter would be called \"lambda\", but that is a " @@ -529,23 +552,28 @@ msgstr "" "\"lambda\",但這是 Python 中的保留字)如果 *lambd* 為正,則回傳值的範圍從 0 " "到正無窮大;如果 *lambd* 為負,則回傳值的範圍從負無窮大到 0。" -#: ../../library/random.rst:313 +#: ../../library/random.rst:331 +msgid "Added the default value for ``lambd``." +msgstr "" + +#: ../../library/random.rst:337 msgid "" "Gamma distribution. (*Not* the gamma function!) The shape and scale " "parameters, *alpha* and *beta*, must have positive values. (Calling " "conventions vary and some sources define 'beta' as the inverse of the scale)." msgstr "" -"Gamma(伽瑪)分佈。(*不是* Gamma 函式!)。形狀 (shape) 和比例 (scale) 參數 *alpha* " -"和 *beta* 必須具有正值。(根據呼叫習慣不同,部分來源會將 'beta' 定義為比例的倒數)。" +"Gamma(伽瑪)分佈。(*不是* Gamma 函式!)。形狀 (shape) 和比例 (scale) 參數 " +"*alpha* 和 *beta* 必須具有正值。(根據呼叫習慣不同,部分來源會將 'beta' 定義" +"為比例的倒數)。" -#: ../../library/random.rst:318 +#: ../../library/random.rst:342 msgid "The probability distribution function is::" msgstr "" "Probability distribution function(機率密度函式)是:\n" "\n" "::" -#: ../../library/random.rst:327 +#: ../../library/random.rst:351 msgid "" "Normal distribution, also called the Gaussian distribution. *mu* is the " "mean, and *sigma* is the standard deviation. This is slightly faster than " @@ -554,7 +582,7 @@ msgstr "" "常態分佈,也稱為高斯分佈。*mu* 是平均數,*sigma* 是標準差。這比下面定義的 :" "func:`normalvariate` 函式快一點。" -#: ../../library/random.rst:332 +#: ../../library/random.rst:356 msgid "" "Multithreading note: When two threads call this function simultaneously, it " "is possible that they will receive the same return value. This can be " @@ -566,11 +594,11 @@ msgstr "" "可以透過三種方式避免。1)讓每個執行緒使用隨機數產生器的不同實例。2)在所有呼" "叫周圍加鎖。3)使用較慢但執行緒安全的 :func:`normalvariate` 函式代替。" -#: ../../library/random.rst:339 ../../library/random.rst:355 +#: ../../library/random.rst:363 ../../library/random.rst:379 msgid "*mu* and *sigma* now have default arguments." msgstr "" -#: ../../library/random.rst:345 +#: ../../library/random.rst:369 msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " @@ -580,13 +608,13 @@ msgstr "" "對數常態分佈。如果你取此分佈的自然對數,你將獲得一個具有平均數 *mu* 和標準差 " "*sigma* 的常態分佈。*mu* 可以為任何值,並且 *sigma* 必須大於零。" -#: ../../library/random.rst:353 +#: ../../library/random.rst:377 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "常態分佈。*mu* 是平均數,*sigma* 是標準差。" -#: ../../library/random.rst:361 +#: ../../library/random.rst:385 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -597,37 +625,38 @@ msgstr "" "大於或等於零。如果 *kappa* 等於零,則此分佈在 0 到 2\\*\\ *pi* 的範圍內將減小" "為均勻的隨機角度。" -#: ../../library/random.rst:369 +#: ../../library/random.rst:393 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "Pareto distribution(柏拉圖分佈)。*alpha* 是形狀參數。" -#: ../../library/random.rst:374 +#: ../../library/random.rst:398 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" "Weibull distribution(韋伯分佈)。*alpha* 是比例參數,*beta* 是形狀參數。" -#: ../../library/random.rst:379 +#: ../../library/random.rst:403 msgid "Alternative Generator" msgstr "替代產生器" -#: ../../library/random.rst:383 +#: ../../library/random.rst:407 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" -#: ../../library/random.rst:386 +#: ../../library/random.rst:413 +#, fuzzy msgid "" -"In the future, the *seed* must be one of the following types: :class:" -"`NoneType`, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" -"class:`bytearray`." +"Formerly the *seed* could be any hashable object. Now it is limited to: :" +"class:`NoneType`, :class:`int`, :class:`float`, :class:`str`, :class:" +"`bytes`, or :class:`bytearray`." msgstr "" "將來,*seed* 必須是以下類型之一:\\ :class:`NoneType`、\\ :class:`int`、\\ :" "class:`float`、\\ :class:`str`、\\ :class:`bytes`、\\ :class:`bytearray`。" -#: ../../library/random.rst:393 +#: ../../library/random.rst:417 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -641,21 +670,22 @@ msgstr "" "有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :" "exc:`NotImplementedError`。" -#: ../../library/random.rst:402 +#: ../../library/random.rst:426 msgid "Notes on Reproducibility" msgstr "關於 Reproducibility(復現性)的注意事項" -#: ../../library/random.rst:404 +#: ../../library/random.rst:428 +#, fuzzy msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " -"pseudo-random number generator. By re-using a seed value, the same sequence " +"pseudo-random number generator. By reusing a seed value, the same sequence " "should be reproducible from run to run as long as multiple threads are not " "running." msgstr "" "有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使" "用種子值,同一序列就應該可以被復現。" -#: ../../library/random.rst:408 +#: ../../library/random.rst:432 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" @@ -663,13 +693,13 @@ msgstr "" "大多數隨機 module 的演算法和 seed 設定函式在 Python 版本中可能會發生變化,但" "可以保證兩個方面不會改變:" -#: ../../library/random.rst:411 +#: ../../library/random.rst:435 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "如果增加了新的 seed 設定函式,則將提供向後相容的播種器 (seeder)。" -#: ../../library/random.rst:414 +#: ../../library/random.rst:438 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." @@ -677,25 +707,25 @@ msgstr "" "當相容的播種器被賦予相同的種子時,產生器的 :meth:`~Random.random` 方法將持續" "產生相同的序列。" -#: ../../library/random.rst:420 +#: ../../library/random.rst:444 msgid "Examples" msgstr "範例" -#: ../../library/random.rst:422 +#: ../../library/random.rst:446 msgid "Basic examples::" msgstr "" "基礎範例:\n" "\n" "::" -#: ../../library/random.rst:450 +#: ../../library/random.rst:474 msgid "Simulations::" msgstr "" "模擬:\n" "\n" "::" -#: ../../library/random.rst:478 +#: ../../library/random.rst:499 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " @@ -707,7 +737,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:491 +#: ../../library/random.rst:512 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -721,7 +751,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:518 +#: ../../library/random.rst:539 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "" @@ -729,7 +759,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:547 +#: ../../library/random.rst:568 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ 製作的教" "學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。" -#: ../../library/random.rst:553 +#: ../../library/random.rst:574 msgid "" "`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter " @@ -766,17 +796,17 @@ msgstr "" "html>`_ 的教學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數" "據分析。" -#: ../../library/random.rst:568 +#: ../../library/random.rst:589 msgid "Recipes" msgstr "使用方案" -#: ../../library/random.rst:570 +#: ../../library/random.rst:591 msgid "" "These recipes show how to efficiently make random selections from the " "combinatoric iterators in the :mod:`itertools` module:" msgstr "" -#: ../../library/random.rst:602 +#: ../../library/random.rst:623 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -788,7 +818,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:608 +#: ../../library/random.rst:629 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -800,7 +830,7 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:630 +#: ../../library/random.rst:651 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" @@ -810,7 +840,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:639 +#: ../../library/random.rst:660 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -823,7 +853,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:648 +#: ../../library/random.rst:669 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " @@ -833,3 +863,27 @@ msgstr "" "`產生偽隨機浮點值 `_ Allen B. Downey 的一篇論文描述了產生比通常由 :func:`.random` 產生的 " "float 更 fine-grained(細粒的)的方法。" + +#~ msgid "" +#~ "Return a randomly selected element from ``range(start, stop, step)``. " +#~ "This is equivalent to ``choice(range(start, stop, step))``, but doesn't " +#~ "actually build a range object." +#~ msgstr "" +#~ "從 ``range(start, stop, step)`` 中回傳一個隨機選擇的元素。這等效於 " +#~ "``choice(range(start, stop, step))``,但實際上並沒有構建範圍物件。" + +#~ msgid "" +#~ "The positional argument pattern matches that of :func:`range`. Keyword " +#~ "arguments should not be used because the function may use them in " +#~ "unexpected ways." +#~ msgstr "" +#~ "位置引數模式與 :func:`range` 的位置引數模式匹配。不應使用關鍵字引數,因為" +#~ "函式可能會以不預期的方式使用它們。" + +#~ msgid "" +#~ "The exception raised for non-integral values such as ``randrange(10.5)`` " +#~ "or ``randrange('10')`` will be changed from :exc:`ValueError` to :exc:" +#~ "`TypeError`." +#~ msgstr "" +#~ "對於非整數值,例如 ``randrange(10.5)`` 或 ``randrange('10')``,引發的例外" +#~ "將從 :exc:`ValueError` 改為 :exc:`TypeError`。" diff --git a/library/re.po b/library/re.po index 79cffdc958..7ca0bb7b97 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-05 00:20+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-05-20 13:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,8 +53,8 @@ msgid "" "string, because the regular expression must be ``\\\\``, and each backslash " "must be expressed as ``\\\\`` inside a regular Python string literal. Also, " "please note that any invalid escape sequences in Python's usage of the " -"backslash in string literals now generate a :exc:`DeprecationWarning` and in " -"the future this will become a :exc:`SyntaxError`. This behaviour will happen " +"backslash in string literals now generate a :exc:`SyntaxWarning` and in the " +"future this will become a :exc:`SyntaxError`. This behaviour will happen " "even if it is a valid escape sequence for a regular expression." msgstr "" @@ -147,7 +147,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1530 +#: ../../library/re.rst:104 ../../library/re.rst:1532 msgid "``.``" msgstr "``.``" @@ -532,7 +532,7 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:423 +#: ../../library/re.rst:424 msgid "``(?P...)``" msgstr "``(?P...)``" @@ -540,113 +540,114 @@ msgstr "``(?P...)``" msgid "" "Similar to regular parentheses, but the substring matched by the group is " "accessible via the symbolic group name *name*. Group names must be valid " -"Python identifiers, and each group name must be defined only once within a " -"regular expression. A symbolic group is also a numbered group, just as if " +"Python identifiers, and in :class:`bytes` patterns they can only contain " +"bytes in the ASCII range. Each group name must be defined only once within " +"a regular expression. A symbolic group is also a numbered group, just as if " "the group were not named." msgstr "" -#: ../../library/re.rst:403 +#: ../../library/re.rst:404 msgid "" "Named groups can be referenced in three contexts. If the pattern is ``(?" "P['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either " "single or double quotes):" msgstr "" -#: ../../library/re.rst:408 +#: ../../library/re.rst:409 msgid "Context of reference to group \"quote\"" msgstr "" -#: ../../library/re.rst:408 +#: ../../library/re.rst:409 msgid "Ways to reference it" msgstr "" -#: ../../library/re.rst:410 +#: ../../library/re.rst:411 msgid "in the same pattern itself" msgstr "" -#: ../../library/re.rst:410 +#: ../../library/re.rst:411 msgid "``(?P=quote)`` (as shown)" msgstr "" -#: ../../library/re.rst:411 ../../library/re.rst:418 +#: ../../library/re.rst:412 ../../library/re.rst:419 msgid "``\\1``" msgstr "``\\1``" -#: ../../library/re.rst:413 +#: ../../library/re.rst:414 msgid "when processing match object *m*" msgstr "" -#: ../../library/re.rst:413 +#: ../../library/re.rst:414 msgid "``m.group('quote')``" msgstr "``m.group('quote')``" -#: ../../library/re.rst:414 +#: ../../library/re.rst:415 msgid "``m.end('quote')`` (etc.)" msgstr "" -#: ../../library/re.rst:416 +#: ../../library/re.rst:417 msgid "in a string passed to the *repl* argument of ``re.sub()``" msgstr "" -#: ../../library/re.rst:416 +#: ../../library/re.rst:417 msgid "``\\g``" msgstr "``\\g``" -#: ../../library/re.rst:417 +#: ../../library/re.rst:418 msgid "``\\g<1>``" msgstr "``\\g<1>``" -#: ../../library/re.rst:421 +#: ../../library/re.rst:422 msgid "" -"Group *name* containing characters outside the ASCII range (``b'\\x00'``-" -"``b'\\x7f'``) in :class:`bytes` patterns." +"In :class:`bytes` patterns, group *name* can only contain bytes in the ASCII " +"range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:429 +#: ../../library/re.rst:430 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:428 +#: ../../library/re.rst:429 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:434 +#: ../../library/re.rst:435 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:434 +#: ../../library/re.rst:435 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:441 +#: ../../library/re.rst:442 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:439 +#: ../../library/re.rst:440 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:448 +#: ../../library/re.rst:449 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:446 +#: ../../library/re.rst:447 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:475 +#: ../../library/re.rst:476 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:453 +#: ../../library/re.rst:454 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -660,19 +661,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:468 +#: ../../library/re.rst:469 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:474 +#: ../../library/re.rst:475 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:484 +#: ../../library/re.rst:485 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:497 ../../library/re.rst:1020 +#: ../../library/re.rst:498 msgid "" -"Group *id* containing anything except ASCII digits. Group *name* containing " -"characters outside the ASCII range (``b'\\x00'``-``b'\\x7f'``) in :class:" -"`bytes` replacement strings." +"Group *id* can only contain ASCII digits. In :class:`bytes` patterns, group " +"*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:503 +#: ../../library/re.rst:504 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -710,11 +710,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:518 +#: ../../library/re.rst:519 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:511 +#: ../../library/re.rst:512 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -726,19 +726,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:523 +#: ../../library/re.rst:524 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:523 +#: ../../library/re.rst:524 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:539 +#: ../../library/re.rst:540 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:528 +#: ../../library/re.rst:529 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -748,7 +748,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:535 +#: ../../library/re.rst:536 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -757,11 +757,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:550 +#: ../../library/re.rst:551 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:544 +#: ../../library/re.rst:545 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -772,15 +772,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:562 +#: ../../library/re.rst:563 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:559 ../../library/re.rst:579 ../../library/re.rst:598 +#: ../../library/re.rst:560 ../../library/re.rst:580 ../../library/re.rst:599 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:556 +#: ../../library/re.rst:557 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -788,30 +788,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:562 ../../library/re.rst:583 ../../library/re.rst:604 +#: ../../library/re.rst:563 ../../library/re.rst:584 ../../library/re.rst:605 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:562 +#: ../../library/re.rst:563 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:569 +#: ../../library/re.rst:570 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:567 +#: ../../library/re.rst:568 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:583 +#: ../../library/re.rst:584 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:575 +#: ../../library/re.rst:576 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -819,35 +819,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:582 +#: ../../library/re.rst:583 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:590 +#: ../../library/re.rst:591 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:588 +#: ../../library/re.rst:589 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:604 +#: ../../library/re.rst:605 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:596 +#: ../../library/re.rst:597 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:601 +#: ../../library/re.rst:602 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -855,11 +855,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:613 +#: ../../library/re.rst:614 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:609 +#: ../../library/re.rst:610 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -867,34 +867,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:618 +#: ../../library/re.rst:619 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:618 +#: ../../library/re.rst:619 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:634 +#: ../../library/re.rst:635 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:641 +#: ../../library/re.rst:642 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:645 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:648 +#: ../../library/re.rst:649 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -902,26 +902,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:653 +#: ../../library/re.rst:654 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:656 +#: ../../library/re.rst:657 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:659 +#: ../../library/re.rst:660 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:667 +#: ../../library/re.rst:668 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:669 +#: ../../library/re.rst:670 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -929,26 +929,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:676 +#: ../../library/re.rst:677 msgid "Flags" msgstr "" -#: ../../library/re.rst:678 +#: ../../library/re.rst:679 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:685 +#: ../../library/re.rst:686 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:687 +#: ../../library/re.rst:688 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:692 +#: ../../library/re.rst:693 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -956,7 +956,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:697 +#: ../../library/re.rst:698 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -964,13 +964,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:706 +#: ../../library/re.rst:707 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:713 +#: ../../library/re.rst:714 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -980,7 +980,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:720 +#: ../../library/re.rst:721 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -991,7 +991,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:731 +#: ../../library/re.rst:732 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -1002,20 +1002,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:740 +#: ../../library/re.rst:741 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:744 +#: ../../library/re.rst:745 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:753 +#: ../../library/re.rst:754 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1026,7 +1026,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:763 +#: ../../library/re.rst:764 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1034,14 +1034,14 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:776 +#: ../../library/re.rst:777 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:786 +#: ../../library/re.rst:787 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1054,53 +1054,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:796 +#: ../../library/re.rst:797 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:804 +#: ../../library/re.rst:805 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:808 +#: ../../library/re.rst:809 msgid "Functions" msgstr "" -#: ../../library/re.rst:812 +#: ../../library/re.rst:813 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:817 +#: ../../library/re.rst:818 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:821 +#: ../../library/re.rst:822 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:826 +#: ../../library/re.rst:827 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:830 +#: ../../library/re.rst:831 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:836 +#: ../../library/re.rst:837 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1108,7 +1108,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:844 +#: ../../library/re.rst:845 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1117,7 +1117,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:853 +#: ../../library/re.rst:854 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1145,7 +1145,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:877 +#: ../../library/re.rst:878 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1154,42 +1154,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:892 +#: ../../library/re.rst:893 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:899 +#: ../../library/re.rst:900 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:902 +#: ../../library/re.rst:903 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:912 ../../library/re.rst:1002 ../../library/re.rst:1031 +#: ../../library/re.rst:913 ../../library/re.rst:1004 ../../library/re.rst:1033 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:915 +#: ../../library/re.rst:916 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:921 +#: ../../library/re.rst:922 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:925 +#: ../../library/re.rst:926 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1199,11 +1199,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:937 ../../library/re.rst:948 +#: ../../library/re.rst:938 ../../library/re.rst:949 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:943 +#: ../../library/re.rst:944 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1211,7 +1211,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:954 +#: ../../library/re.rst:955 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1225,18 +1225,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:970 +#: ../../library/re.rst:971 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:982 +#: ../../library/re.rst:984 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:986 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1245,7 +1245,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:992 +#: ../../library/re.rst:994 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1258,53 +1258,60 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1005 ../../library/re.rst:1034 -#: ../../library/re.rst:1268 +#: ../../library/re.rst:1007 ../../library/re.rst:1036 +#: ../../library/re.rst:1270 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1008 +#: ../../library/re.rst:1010 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1014 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1016 +#: ../../library/re.rst:1018 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1028 +#: ../../library/re.rst:1022 +msgid "" +"Group *id* can only contain ASCII digits. In :class:`bytes` replacement " +"strings, group *name* can only contain bytes in the ASCII range " +"(``b'\\x00'``-``b'\\x7f'``)." +msgstr "" + +#: ../../library/re.rst:1030 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1040 +#: ../../library/re.rst:1042 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1055 +#: ../../library/re.rst:1057 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1063 +#: ../../library/re.rst:1065 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1066 +#: ../../library/re.rst:1068 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1312,15 +1319,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1075 +#: ../../library/re.rst:1077 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1079 +#: ../../library/re.rst:1081 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1083 +#: ../../library/re.rst:1085 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1329,41 +1336,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1091 +#: ../../library/re.rst:1093 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1097 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1099 +#: ../../library/re.rst:1101 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1103 +#: ../../library/re.rst:1105 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1107 +#: ../../library/re.rst:1109 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1109 +#: ../../library/re.rst:1111 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1115 +#: ../../library/re.rst:1117 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1117 +#: ../../library/re.rst:1119 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1122 +#: ../../library/re.rst:1124 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1372,7 +1379,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1128 +#: ../../library/re.rst:1130 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1381,7 +1388,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1134 +#: ../../library/re.rst:1136 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1391,7 +1398,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1149 +#: ../../library/re.rst:1151 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1399,19 +1406,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1154 ../../library/re.rst:1172 +#: ../../library/re.rst:1156 ../../library/re.rst:1174 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1162 +#: ../../library/re.rst:1164 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1168 +#: ../../library/re.rst:1170 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1419,76 +1426,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1186 +#: ../../library/re.rst:1188 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1191 +#: ../../library/re.rst:1193 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1198 +#: ../../library/re.rst:1200 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1207 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1210 +#: ../../library/re.rst:1212 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1215 +#: ../../library/re.rst:1217 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1224 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1227 +#: ../../library/re.rst:1229 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1234 +#: ../../library/re.rst:1236 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1239 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1245 +#: ../../library/re.rst:1247 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1247 +#: ../../library/re.rst:1249 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1256 +#: ../../library/re.rst:1258 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1261 +#: ../../library/re.rst:1263 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1497,7 +1504,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1273 +#: ../../library/re.rst:1275 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1512,7 +1519,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1297 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1520,57 +1527,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1300 +#: ../../library/re.rst:1302 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1308 +#: ../../library/re.rst:1310 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1315 +#: ../../library/re.rst:1317 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1324 +#: ../../library/re.rst:1326 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1335 +#: ../../library/re.rst:1337 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1348 +#: ../../library/re.rst:1350 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1352 ../../library/re.rst:1577 +#: ../../library/re.rst:1354 ../../library/re.rst:1579 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1358 +#: ../../library/re.rst:1360 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1371 +#: ../../library/re.rst:1373 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1383 +#: ../../library/re.rst:1385 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1579,7 +1586,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1391 +#: ../../library/re.rst:1393 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1587,32 +1594,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1396 +#: ../../library/re.rst:1398 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1408 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1413 +#: ../../library/re.rst:1415 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1420 +#: ../../library/re.rst:1422 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1429 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1621,43 +1628,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1436 +#: ../../library/re.rst:1438 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1444 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1448 +#: ../../library/re.rst:1450 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1451 +#: ../../library/re.rst:1453 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1459 +#: ../../library/re.rst:1461 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1463 +#: ../../library/re.rst:1465 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1465 +#: ../../library/re.rst:1467 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1473 +#: ../../library/re.rst:1475 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1665,28 +1672,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1478 +#: ../../library/re.rst:1480 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1488 +#: ../../library/re.rst:1490 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1498 +#: ../../library/re.rst:1500 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1517 +#: ../../library/re.rst:1519 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1521 +#: ../../library/re.rst:1523 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1695,124 +1702,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1530 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1528 +#: ../../library/re.rst:1530 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1532 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1534 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1534 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1536 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1536 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1538 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1538 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1540 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1540 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1542 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1542 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1544 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1544 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1546 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1546 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1548 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1548 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1551 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1555 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1559 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1565 +#: ../../library/re.rst:1567 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1571 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1571 +#: ../../library/re.rst:1573 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1572 +#: ../../library/re.rst:1574 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1574 +#: ../../library/re.rst:1576 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1586 +#: ../../library/re.rst:1588 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1596 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1820,11 +1827,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1604 +#: ../../library/re.rst:1606 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1606 +#: ../../library/re.rst:1608 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1832,37 +1839,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1611 +#: ../../library/re.rst:1613 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1624 +#: ../../library/re.rst:1626 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1637 +#: ../../library/re.rst:1639 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1650 +#: ../../library/re.rst:1652 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1665 +#: ../../library/re.rst:1667 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1667 +#: ../../library/re.rst:1669 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1870,11 +1877,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1684 +#: ../../library/re.rst:1687 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1686 +#: ../../library/re.rst:1689 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1882,11 +1889,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1697 +#: ../../library/re.rst:1700 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1699 +#: ../../library/re.rst:1702 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1895,11 +1902,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1713 +#: ../../library/re.rst:1716 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1715 +#: ../../library/re.rst:1718 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1907,7 +1914,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1725 +#: ../../library/re.rst:1728 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1915,29 +1922,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1737 +#: ../../library/re.rst:1740 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1739 +#: ../../library/re.rst:1742 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1743 +#: ../../library/re.rst:1746 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1799 +#: ../../library/re.rst:1802 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1822 +#: ../../library/re.rst:1825 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -1955,14 +1962,14 @@ msgstr ". (點)" #: ../../library/re.rst:220 ../../library/re.rst:235 ../../library/re.rst:244 #: ../../library/re.rst:257 ../../library/re.rst:263 ../../library/re.rst:296 #: ../../library/re.rst:309 ../../library/re.rst:319 ../../library/re.rst:345 -#: ../../library/re.rst:394 ../../library/re.rst:425 ../../library/re.rst:431 -#: ../../library/re.rst:436 ../../library/re.rst:443 ../../library/re.rst:450 -#: ../../library/re.rst:477 ../../library/re.rst:487 ../../library/re.rst:508 -#: ../../library/re.rst:520 ../../library/re.rst:525 ../../library/re.rst:541 -#: ../../library/re.rst:552 ../../library/re.rst:564 ../../library/re.rst:571 -#: ../../library/re.rst:585 ../../library/re.rst:592 ../../library/re.rst:606 -#: ../../library/re.rst:615 ../../library/re.rst:620 ../../library/re.rst:784 -#: ../../library/re.rst:990 +#: ../../library/re.rst:394 ../../library/re.rst:426 ../../library/re.rst:432 +#: ../../library/re.rst:437 ../../library/re.rst:444 ../../library/re.rst:451 +#: ../../library/re.rst:478 ../../library/re.rst:488 ../../library/re.rst:509 +#: ../../library/re.rst:521 ../../library/re.rst:526 ../../library/re.rst:542 +#: ../../library/re.rst:553 ../../library/re.rst:565 ../../library/re.rst:572 +#: ../../library/re.rst:586 ../../library/re.rst:593 ../../library/re.rst:607 +#: ../../library/re.rst:616 ../../library/re.rst:621 ../../library/re.rst:785 +#: ../../library/re.rst:992 msgid "in regular expressions" msgstr "於正規表示式中" @@ -2014,7 +2021,7 @@ msgstr "?+" msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:508 +#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:509 msgid "\\ (backslash)" msgstr "\\ (反斜線)" @@ -2046,126 +2053,126 @@ msgstr "(?:" msgid "(?P<" msgstr "(?P<" -#: ../../library/re.rst:425 +#: ../../library/re.rst:426 msgid "(?P=" msgstr "(?P=" -#: ../../library/re.rst:431 +#: ../../library/re.rst:432 msgid "(?#" msgstr "(?#" -#: ../../library/re.rst:436 +#: ../../library/re.rst:437 msgid "(?=" msgstr "(?=" -#: ../../library/re.rst:443 +#: ../../library/re.rst:444 msgid "(?!" msgstr "(?!" -#: ../../library/re.rst:450 +#: ../../library/re.rst:451 msgid "(?<=" msgstr "(?<=" -#: ../../library/re.rst:477 +#: ../../library/re.rst:478 msgid "(?\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgstr "" msgid "This module provides a class, an instance, and a function:" msgstr "" -#: ../../library/reprlib.rst:22 +#: ../../library/reprlib.rst:24 msgid "" "Class which provides formatting services useful in implementing functions " "similar to the built-in :func:`repr`; size limits for different object " @@ -45,70 +45,91 @@ msgid "" "excessively long." msgstr "" -#: ../../library/reprlib.rst:29 +#: ../../library/reprlib.rst:28 +msgid "" +"The keyword arguments of the constructor can be used as a shortcut to set " +"the attributes of the :class:`Repr` instance. Which means that the following " +"initialization::" +msgstr "" + +#: ../../library/reprlib.rst:34 +msgid "Is equivalent to::" +msgstr "" + +#: ../../library/reprlib.rst:39 +msgid "" +"See section `Repr Objects`_ for more information about :class:`Repr` " +"attributes." +msgstr "" + +#: ../../library/reprlib.rst:42 +msgid "Allow attributes to be set via keyword arguments." +msgstr "" + +#: ../../library/reprlib.rst:48 msgid "" "This is an instance of :class:`Repr` which is used to provide the :func:`." "repr` function described below. Changing the attributes of this object will " "affect the size limits used by :func:`.repr` and the Python debugger." msgstr "" -#: ../../library/reprlib.rst:37 +#: ../../library/reprlib.rst:56 msgid "" "This is the :meth:`~Repr.repr` method of ``aRepr``. It returns a string " "similar to that returned by the built-in function of the same name, but with " "limits on most sizes." msgstr "" -#: ../../library/reprlib.rst:41 +#: ../../library/reprlib.rst:60 msgid "" "In addition to size-limiting tools, the module also provides a decorator for " "detecting recursive calls to :meth:`__repr__` and substituting a placeholder " "string instead." msgstr "" -#: ../../library/reprlib.rst:50 +#: ../../library/reprlib.rst:69 msgid "" "Decorator for :meth:`__repr__` methods to detect recursive calls within the " "same thread. If a recursive call is made, the *fillvalue* is returned, " "otherwise, the usual :meth:`__repr__` call is made. For example:" msgstr "" -#: ../../library/reprlib.rst:72 +#: ../../library/reprlib.rst:91 msgid "Repr Objects" msgstr "Repr 物件" -#: ../../library/reprlib.rst:74 +#: ../../library/reprlib.rst:93 msgid "" ":class:`Repr` instances provide several attributes which can be used to " "provide size limits for the representations of different object types, and " "methods which format specific object types." msgstr "" -#: ../../library/reprlib.rst:81 +#: ../../library/reprlib.rst:100 msgid "" "This string is displayed for recursive references. It defaults to ``...``." msgstr "" -#: ../../library/reprlib.rst:89 +#: ../../library/reprlib.rst:108 msgid "" "Depth limit on the creation of recursive representations. The default is " "``6``." msgstr "" -#: ../../library/reprlib.rst:100 +#: ../../library/reprlib.rst:119 msgid "" "Limits on the number of entries represented for the named object type. The " "default is ``4`` for :attr:`maxdict`, ``5`` for :attr:`maxarray`, and ``6`` " "for the others." msgstr "" -#: ../../library/reprlib.rst:107 +#: ../../library/reprlib.rst:126 msgid "" "Maximum number of characters in the representation for an integer. Digits " "are dropped from the middle. The default is ``40``." msgstr "" -#: ../../library/reprlib.rst:113 +#: ../../library/reprlib.rst:132 msgid "" "Limit on the number of characters in the representation of the string. Note " "that the \"normal\" representation of the string is used as the character " @@ -116,20 +137,39 @@ msgid "" "mangled when the representation is shortened. The default is ``30``." msgstr "" -#: ../../library/reprlib.rst:121 +#: ../../library/reprlib.rst:140 msgid "" "This limit is used to control the size of object types for which no specific " "formatting method is available on the :class:`Repr` object. It is applied in " "a similar manner as :attr:`maxstring`. The default is ``20``." msgstr "" -#: ../../library/reprlib.rst:128 +#: ../../library/reprlib.rst:147 +msgid "" +"If this attribute is set to ``None`` (the default), the output is formatted " +"with no line breaks or indentation, like the standard :func:`repr`. For " +"example:" +msgstr "" + +#: ../../library/reprlib.rst:160 +msgid "" +"If :attr:`~Repr.indent` is set to a string, each recursion level is placed " +"on its own line, indented by that string:" +msgstr "" + +#: ../../library/reprlib.rst:181 +msgid "" +"Setting :attr:`~Repr.indent` to a positive integer value behaves as if it " +"was set to a string with that number of spaces:" +msgstr "" + +#: ../../library/reprlib.rst:207 msgid "" "The equivalent to the built-in :func:`repr` that uses the formatting imposed " "by the instance." msgstr "" -#: ../../library/reprlib.rst:134 +#: ../../library/reprlib.rst:213 msgid "" "Recursive implementation used by :meth:`.repr`. This uses the type of *obj* " "to determine which formatting method to call, passing it *obj* and *level*. " @@ -138,7 +178,7 @@ msgid "" "call." msgstr "" -#: ../../library/reprlib.rst:143 +#: ../../library/reprlib.rst:222 msgid "" "Formatting methods for specific types are implemented as methods with a name " "based on the type name. In the method name, **TYPE** is replaced by ``'_'." @@ -147,11 +187,11 @@ msgid "" "should call ``self.repr1(subobj, level - 1)``." msgstr "" -#: ../../library/reprlib.rst:153 +#: ../../library/reprlib.rst:232 msgid "Subclassing Repr Objects" msgstr "" -#: ../../library/reprlib.rst:155 +#: ../../library/reprlib.rst:234 msgid "" "The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of :" "class:`Repr` to add support for additional built-in object types or to " @@ -159,10 +199,10 @@ msgid "" "special support for file objects could be added::" msgstr "" -#: ../../library/reprlib.rst:46 +#: ../../library/reprlib.rst:65 msgid "..." msgstr "..." -#: ../../library/reprlib.rst:46 +#: ../../library/reprlib.rst:65 msgid "placeholder" msgstr "placeholder(佔位符號)" diff --git a/library/runpy.po b/library/runpy.po index 928df352e6..c88a46c82e 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgid "" "overridden by :func:`run_module`." msgstr "" -#: ../../library/runpy.rst:52 ../../library/runpy.rst:121 +#: ../../library/runpy.rst:52 ../../library/runpy.rst:126 msgid "" "The special global variables ``__name__``, ``__spec__``, ``__file__``, " "``__cached__``, ``__loader__`` and ``__package__`` are set in the globals " @@ -147,7 +147,13 @@ msgid "" "name``." msgstr "" -#: ../../library/runpy.rst:101 +#: ../../library/runpy.rst:96 +msgid "" +"The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +msgstr "" + +#: ../../library/runpy.rst:106 msgid "" "Execute the code at the named filesystem location and return the resulting " "module globals dictionary. As with a script name supplied to the CPython " @@ -156,7 +162,7 @@ msgid "" "module (e.g. a zipfile containing a top-level ``__main__.py`` file)." msgstr "" -#: ../../library/runpy.rst:107 +#: ../../library/runpy.rst:112 msgid "" "For a simple script, the specified code is simply executed in a fresh module " "namespace. For a valid sys.path entry (typically a zipfile or directory), " @@ -167,7 +173,7 @@ msgid "" "module at the specified location." msgstr "" -#: ../../library/runpy.rst:115 +#: ../../library/runpy.rst:120 msgid "" "The optional dictionary argument *init_globals* may be used to pre-populate " "the module's globals dictionary before the code is executed. The supplied " @@ -176,13 +182,13 @@ msgid "" "overridden by :func:`run_path`." msgstr "" -#: ../../library/runpy.rst:127 +#: ../../library/runpy.rst:132 msgid "" "``__name__`` is set to *run_name* if this optional argument is not :const:" "`None` and to ``''`` otherwise." msgstr "" -#: ../../library/runpy.rst:130 +#: ../../library/runpy.rst:135 msgid "" "If the supplied path directly references a script file (whether as source or " "as precompiled byte code), then ``__file__`` will be set to the supplied " @@ -190,7 +196,7 @@ msgid "" "will all be set to :const:`None`." msgstr "" -#: ../../library/runpy.rst:135 +#: ../../library/runpy.rst:140 msgid "" "If the supplied path is a reference to a valid sys.path entry, then " "``__spec__`` will be set appropriately for the imported ``__main__`` module " @@ -199,7 +205,7 @@ msgid "" "normal ` based on the module spec." msgstr "" -#: ../../library/runpy.rst:141 +#: ../../library/runpy.rst:146 msgid "" "A number of alterations are also made to the :mod:`sys` module. Firstly, " "``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated " @@ -209,7 +215,7 @@ msgid "" "returns." msgstr "" -#: ../../library/runpy.rst:148 +#: ../../library/runpy.rst:153 msgid "" "Note that, unlike :func:`run_module`, the alterations made to :mod:`sys` are " "not optional in this function as these adjustments are essential to allowing " @@ -218,13 +224,13 @@ msgid "" "with the import lock or delegated to a separate process." msgstr "" -#: ../../library/runpy.rst:155 +#: ../../library/runpy.rst:160 msgid "" ":ref:`using-on-interface-options` for equivalent functionality on the " "command line (``python path/to/script``)." msgstr "" -#: ../../library/runpy.rst:160 +#: ../../library/runpy.rst:165 msgid "" "Updated to take advantage of the module spec feature added by :pep:`451`. " "This allows ``__cached__`` to be set correctly in the case where " @@ -232,38 +238,44 @@ msgid "" "executed directly." msgstr "" -#: ../../library/runpy.rst:169 +#: ../../library/runpy.rst:171 +msgid "" +"The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " +"deprecated." +msgstr "" + +#: ../../library/runpy.rst:178 msgid ":pep:`338` -- Executing modules as scripts" msgstr "" -#: ../../library/runpy.rst:169 ../../library/runpy.rst:172 +#: ../../library/runpy.rst:178 ../../library/runpy.rst:181 msgid "PEP written and implemented by Nick Coghlan." msgstr "" -#: ../../library/runpy.rst:172 +#: ../../library/runpy.rst:181 msgid ":pep:`366` -- Main module explicit relative imports" msgstr "" -#: ../../library/runpy.rst:175 +#: ../../library/runpy.rst:184 msgid ":pep:`451` -- A ModuleSpec Type for the Import System" msgstr "" -#: ../../library/runpy.rst:175 +#: ../../library/runpy.rst:184 msgid "PEP written and implemented by Eric Snow" msgstr "" -#: ../../library/runpy.rst:177 +#: ../../library/runpy.rst:186 msgid ":ref:`using-on-general` - CPython command line details" msgstr "" -#: ../../library/runpy.rst:179 +#: ../../library/runpy.rst:188 msgid "The :func:`importlib.import_module` function" msgstr "" -#: ../../library/runpy.rst:32 ../../library/runpy.rst:98 +#: ../../library/runpy.rst:32 ../../library/runpy.rst:103 msgid "module" msgstr "module(模組)" -#: ../../library/runpy.rst:32 ../../library/runpy.rst:98 +#: ../../library/runpy.rst:32 ../../library/runpy.rst:103 msgid "__main__" msgstr "__main__" diff --git a/library/shlex.po b/library/shlex.po index 516b2dc361..3ada498053 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,42 +48,36 @@ msgid "" "false." msgstr "" -#: ../../library/shlex.rst:35 +#: ../../library/shlex.rst:33 msgid "" -"Since the :func:`split` function instantiates a :class:`~shlex.shlex` " -"instance, passing ``None`` for *s* will read the string to split from " -"standard input." +"Passing ``None`` for *s* argument now raises an exception, rather than " +"reading :data:`sys.stdin`." msgstr "" #: ../../library/shlex.rst:39 msgid "" -"Passing ``None`` for *s* will raise an exception in future Python versions." -msgstr "" - -#: ../../library/shlex.rst:45 -msgid "" "Concatenate the tokens of the list *split_command* and return a string. This " "function is the inverse of :func:`split`." msgstr "" -#: ../../library/shlex.rst:52 +#: ../../library/shlex.rst:46 msgid "" "The returned value is shell-escaped to protect against injection " "vulnerabilities (see :func:`quote`)." msgstr "" -#: ../../library/shlex.rst:60 +#: ../../library/shlex.rst:54 msgid "" "Return a shell-escaped version of the string *s*. The returned value is a " "string that can safely be used as one token in a shell command line, for " "cases where you cannot use a list." msgstr "" -#: ../../library/shlex.rst:68 +#: ../../library/shlex.rst:62 msgid "The ``shlex`` module is **only designed for Unix shells**." msgstr "" -#: ../../library/shlex.rst:70 +#: ../../library/shlex.rst:64 msgid "" "The :func:`quote` function is not guaranteed to be correct on non-POSIX " "compliant shells or shells from other operating systems such as Windows. " @@ -91,29 +85,29 @@ msgid "" "possibility of a command injection vulnerability." msgstr "" -#: ../../library/shlex.rst:75 +#: ../../library/shlex.rst:69 msgid "" "Consider using functions that pass command arguments with lists such as :" "func:`subprocess.run` with ``shell=False``." msgstr "" -#: ../../library/shlex.rst:78 +#: ../../library/shlex.rst:72 msgid "This idiom would be unsafe:" msgstr "" -#: ../../library/shlex.rst:85 +#: ../../library/shlex.rst:79 msgid ":func:`quote` lets you plug the security hole:" msgstr "" -#: ../../library/shlex.rst:95 +#: ../../library/shlex.rst:89 msgid "The quoting is compatible with UNIX shells and with :func:`split`:" msgstr "" -#: ../../library/shlex.rst:107 +#: ../../library/shlex.rst:101 msgid "The :mod:`shlex` module defines the following class:" msgstr "" -#: ../../library/shlex.rst:112 +#: ../../library/shlex.rst:106 msgid "" "A :class:`~shlex.shlex` instance or subclass instance is a lexical analyzer " "object. The initialization argument, if present, specifies where to read " @@ -140,28 +134,28 @@ msgid "" "creation and can't be modified later." msgstr "" -#: ../../library/shlex.rst:137 +#: ../../library/shlex.rst:131 msgid "The *punctuation_chars* parameter was added." msgstr "新增 *punctuation_chars* 參數。" -#: ../../library/shlex.rst:142 +#: ../../library/shlex.rst:136 msgid "Module :mod:`configparser`" msgstr ":mod:`configparser` 模組" -#: ../../library/shlex.rst:143 +#: ../../library/shlex.rst:137 msgid "" "Parser for configuration files similar to the Windows :file:`.ini` files." msgstr "" -#: ../../library/shlex.rst:149 +#: ../../library/shlex.rst:143 msgid "shlex Objects" msgstr "shlex 物件" -#: ../../library/shlex.rst:151 +#: ../../library/shlex.rst:145 msgid "A :class:`~shlex.shlex` instance has the following methods:" msgstr "" -#: ../../library/shlex.rst:156 +#: ../../library/shlex.rst:150 msgid "" "Return a token. If tokens have been stacked using :meth:`push_token`, pop a " "token off the stack. Otherwise, read one from the input stream. If reading " @@ -169,25 +163,25 @@ msgid "" "string (``''``) in non-POSIX mode, and ``None`` in POSIX mode)." msgstr "" -#: ../../library/shlex.rst:164 +#: ../../library/shlex.rst:158 msgid "Push the argument onto the token stack." msgstr "" -#: ../../library/shlex.rst:169 +#: ../../library/shlex.rst:163 msgid "" "Read a raw token. Ignore the pushback stack, and do not interpret source " "requests. (This is not ordinarily a useful entry point, and is documented " "here only for the sake of completeness.)" msgstr "" -#: ../../library/shlex.rst:176 +#: ../../library/shlex.rst:170 msgid "" "When :class:`~shlex.shlex` detects a source request (see :attr:`source` " "below) this method is given the following token as argument, and expected to " "return a tuple consisting of a filename and an open file-like object." msgstr "" -#: ../../library/shlex.rst:180 +#: ../../library/shlex.rst:174 msgid "" "Normally, this method first strips any quotes off the argument. If the " "result is an absolute pathname, or there was no previous source request in " @@ -198,7 +192,7 @@ msgid "" "preprocessor handles ``#include \"file.h\"``)." msgstr "" -#: ../../library/shlex.rst:188 +#: ../../library/shlex.rst:182 msgid "" "The result of the manipulations is treated as a filename, and returned as " "the first component of the tuple, with :func:`open` called on it to yield " @@ -206,7 +200,7 @@ msgid "" "in instance initialization!)" msgstr "" -#: ../../library/shlex.rst:193 +#: ../../library/shlex.rst:187 msgid "" "This hook is exposed so that you can use it to implement directory search " "paths, addition of file extensions, and other namespace hacks. There is no " @@ -214,55 +208,55 @@ msgid "" "IOBase.close` method of the sourced input stream when it returns EOF." msgstr "" -#: ../../library/shlex.rst:199 +#: ../../library/shlex.rst:193 msgid "" "For more explicit control of source stacking, use the :meth:`push_source` " "and :meth:`pop_source` methods." msgstr "" -#: ../../library/shlex.rst:205 +#: ../../library/shlex.rst:199 msgid "" "Push an input source stream onto the input stack. If the filename argument " "is specified it will later be available for use in error messages. This is " "the same method used internally by the :meth:`sourcehook` method." msgstr "" -#: ../../library/shlex.rst:212 +#: ../../library/shlex.rst:206 msgid "" "Pop the last-pushed input source from the input stack. This is the same " "method used internally when the lexer reaches EOF on a stacked input stream." msgstr "" -#: ../../library/shlex.rst:218 +#: ../../library/shlex.rst:212 msgid "" "This method generates an error message leader in the format of a Unix C " -"compiler error label; the format is ``'\"%s\", line %d: '``, where the ``" -"%s`` is replaced with the name of the current source file and the ``%d`` " +"compiler error label; the format is ``'\"%s\", line %d: '``, where the " +"``%s`` is replaced with the name of the current source file and the ``%d`` " "with the current input line number (the optional arguments can be used to " "override these)." msgstr "" -#: ../../library/shlex.rst:223 +#: ../../library/shlex.rst:217 msgid "" "This convenience is provided to encourage :mod:`shlex` users to generate " "error messages in the standard, parseable format understood by Emacs and " "other Unix tools." msgstr "" -#: ../../library/shlex.rst:227 +#: ../../library/shlex.rst:221 msgid "" "Instances of :class:`~shlex.shlex` subclasses have some public instance " "variables which either control lexical analysis or can be used for debugging:" msgstr "" -#: ../../library/shlex.rst:233 +#: ../../library/shlex.rst:227 msgid "" "The string of characters that are recognized as comment beginners. All " "characters from the comment beginner to end of line are ignored. Includes " "just ``'#'`` by default." msgstr "" -#: ../../library/shlex.rst:240 +#: ../../library/shlex.rst:234 msgid "" "The string of characters that will accumulate into multi-character tokens. " "By default, includes all ASCII alphanumerics and underscore. In POSIX mode, " @@ -275,20 +269,20 @@ msgid "" "effect." msgstr "" -#: ../../library/shlex.rst:253 +#: ../../library/shlex.rst:247 msgid "" "Characters that will be considered whitespace and skipped. Whitespace " "bounds tokens. By default, includes space, tab, linefeed and carriage-" "return." msgstr "" -#: ../../library/shlex.rst:259 +#: ../../library/shlex.rst:253 msgid "" "Characters that will be considered as escape. This will be only used in " "POSIX mode, and includes just ``'\\'`` by default." msgstr "" -#: ../../library/shlex.rst:265 +#: ../../library/shlex.rst:259 msgid "" "Characters that will be considered string quotes. The token accumulates " "until the same quote is encountered again (thus, different quote types " @@ -296,14 +290,14 @@ msgid "" "double quotes." msgstr "" -#: ../../library/shlex.rst:272 +#: ../../library/shlex.rst:266 msgid "" "Characters in :attr:`quotes` that will interpret escape characters defined " "in :attr:`escape`. This is only used in POSIX mode, and includes just " "``'\"'`` by default." msgstr "" -#: ../../library/shlex.rst:279 +#: ../../library/shlex.rst:273 msgid "" "If ``True``, tokens will only be split in whitespaces. This is useful, for " "example, for parsing command lines with :class:`~shlex.shlex`, getting " @@ -312,26 +306,26 @@ msgid "" "those characters." msgstr "" -#: ../../library/shlex.rst:285 +#: ../../library/shlex.rst:279 msgid "" "The :attr:`punctuation_chars` attribute was made compatible with the :attr:" "`whitespace_split` attribute." msgstr "" -#: ../../library/shlex.rst:292 +#: ../../library/shlex.rst:286 msgid "" "The name of the current input file, as initially set at class instantiation " "time or stacked by later source requests. It may be useful to examine this " "when constructing error messages." msgstr "" -#: ../../library/shlex.rst:299 +#: ../../library/shlex.rst:293 msgid "" "The input stream from which this :class:`~shlex.shlex` instance is reading " "characters." msgstr "" -#: ../../library/shlex.rst:305 +#: ../../library/shlex.rst:299 msgid "" "This attribute is ``None`` by default. If you assign a string to it, that " "string will be recognized as a lexical-level inclusion request similar to " @@ -343,29 +337,29 @@ msgid "" "deep." msgstr "" -#: ../../library/shlex.rst:316 +#: ../../library/shlex.rst:310 msgid "" "If this attribute is numeric and ``1`` or more, a :class:`~shlex.shlex` " "instance will print verbose progress output on its behavior. If you need to " "use this, you can read the module source code to learn the details." msgstr "" -#: ../../library/shlex.rst:323 +#: ../../library/shlex.rst:317 msgid "Source line number (count of newlines seen so far plus one)." msgstr "" -#: ../../library/shlex.rst:328 +#: ../../library/shlex.rst:322 msgid "" "The token buffer. It may be useful to examine this when catching exceptions." msgstr "" -#: ../../library/shlex.rst:333 +#: ../../library/shlex.rst:327 msgid "" "Token used to determine end of file. This will be set to the empty string " "(``''``), in non-POSIX mode, and to ``None`` in POSIX mode." msgstr "" -#: ../../library/shlex.rst:339 +#: ../../library/shlex.rst:333 msgid "" "A read-only property. Characters that will be considered punctuation. Runs " "of punctuation characters will be returned as a single token. However, note " @@ -374,39 +368,39 @@ msgid "" "by shells." msgstr "" -#: ../../library/shlex.rst:350 +#: ../../library/shlex.rst:344 msgid "Parsing Rules" msgstr "" -#: ../../library/shlex.rst:352 +#: ../../library/shlex.rst:346 msgid "" "When operating in non-POSIX mode, :class:`~shlex.shlex` will try to obey to " "the following rules." msgstr "" -#: ../../library/shlex.rst:355 +#: ../../library/shlex.rst:349 msgid "" "Quote characters are not recognized within words (``Do\"Not\"Separate`` is " "parsed as the single word ``Do\"Not\"Separate``);" msgstr "" -#: ../../library/shlex.rst:358 +#: ../../library/shlex.rst:352 msgid "Escape characters are not recognized;" msgstr "" -#: ../../library/shlex.rst:360 +#: ../../library/shlex.rst:354 msgid "" "Enclosing characters in quotes preserve the literal value of all characters " "within the quotes;" msgstr "" -#: ../../library/shlex.rst:363 +#: ../../library/shlex.rst:357 msgid "" "Closing quotes separate words (``\"Do\"Separate`` is parsed as ``\"Do\"`` " "and ``Separate``);" msgstr "" -#: ../../library/shlex.rst:366 +#: ../../library/shlex.rst:360 msgid "" "If :attr:`~shlex.whitespace_split` is ``False``, any character not declared " "to be a word character, whitespace, or a quote will be returned as a single-" @@ -414,40 +408,40 @@ msgid "" "words in whitespaces;" msgstr "" -#: ../../library/shlex.rst:371 +#: ../../library/shlex.rst:365 msgid "EOF is signaled with an empty string (``''``);" msgstr "" -#: ../../library/shlex.rst:373 +#: ../../library/shlex.rst:367 msgid "It's not possible to parse empty strings, even if quoted." msgstr "" -#: ../../library/shlex.rst:375 +#: ../../library/shlex.rst:369 msgid "" "When operating in POSIX mode, :class:`~shlex.shlex` will try to obey to the " "following parsing rules." msgstr "" -#: ../../library/shlex.rst:378 +#: ../../library/shlex.rst:372 msgid "" -"Quotes are stripped out, and do not separate words (``\"Do\"Not\"Separate" -"\"`` is parsed as the single word ``DoNotSeparate``);" +"Quotes are stripped out, and do not separate words " +"(``\"Do\"Not\"Separate\"`` is parsed as the single word ``DoNotSeparate``);" msgstr "" -#: ../../library/shlex.rst:381 +#: ../../library/shlex.rst:375 msgid "" "Non-quoted escape characters (e.g. ``'\\'``) preserve the literal value of " "the next character that follows;" msgstr "" -#: ../../library/shlex.rst:384 +#: ../../library/shlex.rst:378 msgid "" "Enclosing characters in quotes which are not part of :attr:`~shlex." "escapedquotes` (e.g. ``\"'\"``) preserve the literal value of all characters " "within the quotes;" msgstr "" -#: ../../library/shlex.rst:388 +#: ../../library/shlex.rst:382 msgid "" "Enclosing characters in quotes which are part of :attr:`~shlex." "escapedquotes` (e.g. ``'\"'``) preserves the literal value of all characters " @@ -457,19 +451,19 @@ msgid "" "escape character will be considered a normal character." msgstr "" -#: ../../library/shlex.rst:396 +#: ../../library/shlex.rst:390 msgid "EOF is signaled with a :const:`None` value;" msgstr "" -#: ../../library/shlex.rst:398 +#: ../../library/shlex.rst:392 msgid "Quoted empty strings (``''``) are allowed." msgstr "" -#: ../../library/shlex.rst:403 +#: ../../library/shlex.rst:397 msgid "Improved Compatibility with Shells" msgstr "" -#: ../../library/shlex.rst:407 +#: ../../library/shlex.rst:401 msgid "" "The :class:`shlex` class provides compatibility with the parsing performed " "by common Unix shells like ``bash``, ``dash``, and ``sh``. To take " @@ -484,20 +478,20 @@ msgid "" "following snippet:" msgstr "" -#: ../../library/shlex.rst:433 +#: ../../library/shlex.rst:427 msgid "" "Of course, tokens will be returned which are not valid for shells, and " "you'll need to implement your own error checks on the returned tokens." msgstr "" -#: ../../library/shlex.rst:436 +#: ../../library/shlex.rst:430 msgid "" "Instead of passing ``True`` as the value for the punctuation_chars " "parameter, you can pass a string with specific characters, which will be " "used to determine which characters constitute punctuation. For example::" msgstr "" -#: ../../library/shlex.rst:445 +#: ../../library/shlex.rst:439 msgid "" "When ``punctuation_chars`` is specified, the :attr:`~shlex.wordchars` " "attribute is augmented with the characters ``~-./*?=``. That is because " @@ -505,7 +499,7 @@ msgid "" "line arguments (e.g. ``--color=auto``). Hence::" msgstr "" -#: ../../library/shlex.rst:456 +#: ../../library/shlex.rst:450 msgid "" "However, to match the shell as closely as possible, it is recommended to " "always use ``posix`` and :attr:`~shlex.whitespace_split` when using :attr:" @@ -513,7 +507,7 @@ msgid "" "entirely." msgstr "" -#: ../../library/shlex.rst:461 +#: ../../library/shlex.rst:455 msgid "" "For best effect, ``punctuation_chars`` should be set in conjunction with " "``posix=True``. (Note that ``posix=False`` is the default for :class:`~shlex." diff --git a/library/shutil.po b/library/shutil.po index a4473e1e3a..d1753885a3 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,7 +115,7 @@ msgstr "" #: ../../library/shutil.rst:81 ../../library/shutil.rst:185 #: ../../library/shutil.rst:217 ../../library/shutil.rst:287 -#: ../../library/shutil.rst:381 +#: ../../library/shutil.rst:387 msgid "" "Platform-specific fast-copy syscalls may be used internally in order to copy " "the file more efficiently. See :ref:`shutil-platform-dependent-efficient-" @@ -378,8 +378,8 @@ 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 " "from failed removals will be ignored; if false or omitted, such errors are " -"handled by calling a handler specified by *onerror* or, if that is omitted, " -"they raise an exception." +"handled by calling a handler specified by *onexc* or *onerror* or, if both " +"are omitted, exceptions are propagated to the caller." msgstr "" #: ../../library/shutil.rst:305 @@ -401,8 +401,8 @@ msgstr "" #: ../../library/shutil.rst:318 msgid "" -"If *onerror* is provided, it must be a callable that accepts three " -"parameters: *function*, *path*, and *excinfo*." +"If *onexc* is provided, it must be a callable that accepts three parameters: " +"*function*, *path*, and *excinfo*." msgstr "" #: ../../library/shutil.rst:321 @@ -410,55 +410,65 @@ msgid "" "The first parameter, *function*, is the function which raised the exception; " "it depends on the platform and implementation. The second parameter, " "*path*, will be the path name passed to *function*. The third parameter, " -"*excinfo*, will be the exception information returned by :func:`sys." -"exc_info`. Exceptions raised by *onerror* will not be caught." +"*excinfo*, is the exception that was raised. Exceptions raised by *onexc* " +"will not be caught." msgstr "" #: ../../library/shutil.rst:327 msgid "" +"The deprecated *onerror* is similar to *onexc*, except that the third " +"parameter it receives is the tuple returned from :func:`sys.exc_info`." +msgstr "" + +#: ../../library/shutil.rst:330 +msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " "``path``, ``dir_fd``." msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` " "``shutil.rmtree``。" -#: ../../library/shutil.rst:329 +#: ../../library/shutil.rst:332 msgid "" "Added a symlink attack resistant version that is used automatically if " "platform supports fd-based functions." msgstr "" -#: ../../library/shutil.rst:333 +#: ../../library/shutil.rst:336 msgid "" "On Windows, will no longer delete the contents of a directory junction " "before removing the junction." msgstr "" -#: ../../library/shutil.rst:337 +#: ../../library/shutil.rst:340 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/shutil.rst:342 +#: ../../library/shutil.rst:343 +msgid "Added the *onexc* parameter, deprecated *onerror*." +msgstr "" + +#: ../../library/shutil.rst:348 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:351 +#: ../../library/shutil.rst:357 msgid "" "Recursively move a file or directory (*src*) to another location (*dst*) and " "return the destination." msgstr "" -#: ../../library/shutil.rst:354 +#: ../../library/shutil.rst:360 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:358 +#: ../../library/shutil.rst:364 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 " @@ -466,7 +476,7 @@ msgid "" "will be created in or as *dst* and *src* will be removed." msgstr "" -#: ../../library/shutil.rst:363 +#: ../../library/shutil.rst:369 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." @@ -477,7 +487,7 @@ msgid "" "the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:371 +#: ../../library/shutil.rst:377 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." @@ -485,50 +495,50 @@ msgstr "" "引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." "move``。" -#: ../../library/shutil.rst:373 +#: ../../library/shutil.rst:379 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:378 +#: ../../library/shutil.rst:384 msgid "Added the *copy_function* keyword argument." msgstr "新增 *copy_function* 關鍵字引數。" -#: ../../library/shutil.rst:386 +#: ../../library/shutil.rst:392 msgid "Accepts a :term:`path-like object` for both *src* and *dst*." msgstr "" -#: ../../library/shutil.rst:391 +#: ../../library/shutil.rst:397 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:398 +#: ../../library/shutil.rst:404 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:401 +#: ../../library/shutil.rst:407 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/shutil.rst:405 +#: ../../library/shutil.rst:411 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: ../../library/shutil.rst:407 +#: ../../library/shutil.rst:413 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:410 +#: ../../library/shutil.rst:416 msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:412 +#: ../../library/shutil.rst:418 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -536,57 +546,82 @@ msgstr "" "引發一個附帶引數 ``path``、``user``、``group`` 的\\ :ref:`稽核事件 " "` ``shutil.chown``。" -#: ../../library/shutil.rst:414 +#: ../../library/shutil.rst:420 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/shutil.rst:421 +#: ../../library/shutil.rst:427 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:424 +#: ../../library/shutil.rst:430 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and executable." msgstr "" -#: ../../library/shutil.rst:427 +#: ../../library/shutil.rst:433 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:430 +#: ../../library/shutil.rst:436 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 " -"command shell uses when finding executables. Additionally, when finding the " -"*cmd* in the *path*, the ``PATHEXT`` environment variable is checked. For " -"example, if you call ``shutil.which(\"python\")``, :func:`which` will search " -"``PATHEXT`` to know that it should look for ``python.exe`` within the *path* " -"directories. For example, on Windows::" +"On Windows, the current directory is prepended to the *path* if *mode* does " +"not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " +"Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to " +"determine if the current directory should be prepended to *path*. To avoid " +"consulting the current working directory for executables: set the " +"environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" #: ../../library/shutil.rst:443 msgid "" +"Also on Windows, the ``PATHEXT`` variable is used to resolve commands that " +"may not already include an extension. For example, if you call ``shutil." +"which(\"python\")``, :func:`which` will search ``PATHEXT`` to know that it " +"should look for ``python.exe`` within the *path* directories. For example, " +"on Windows::" +msgstr "" + +#: ../../library/shutil.rst:452 +msgid "" +"This is also applied when *cmd* is a path that contains a directory " +"component::" +msgstr "" + +#: ../../library/shutil.rst:460 +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:449 +#: ../../library/shutil.rst:464 +msgid "" +"On Windows, the current directory is no longer prepended to the search path " +"if *mode* includes ``os.X_OK`` and WinAPI " +"``NeedCurrentDirectoryForExePathW(cmd)`` is false, else the current " +"directory is prepended even if it is already in the search path; ``PATHEXT`` " +"is used now even when *cmd* includes a directory component or ends with an " +"extension that is in ``PATHEXT``; and filenames that have no extension can " +"now be found." +msgstr "" + +#: ../../library/shutil.rst:475 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:456 +#: ../../library/shutil.rst:482 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:458 +#: ../../library/shutil.rst:484 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -596,77 +631,77 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:466 +#: ../../library/shutil.rst:492 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:468 +#: ../../library/shutil.rst:494 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:470 +#: ../../library/shutil.rst:496 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:474 +#: ../../library/shutil.rst:500 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:483 +#: ../../library/shutil.rst:509 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:485 +#: ../../library/shutil.rst:511 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:491 +#: ../../library/shutil.rst:517 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:494 +#: ../../library/shutil.rst:520 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:509 +#: ../../library/shutil.rst:535 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:511 +#: ../../library/shutil.rst:537 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 " -"clear the readonly bit and reattempt the remove. Any subsequent failure will " +"the files have their read-only bit set. It uses the onexc callback to clear " +"the readonly bit and reattempt the remove. Any subsequent failure will " "propagate. ::" msgstr "" -#: ../../library/shutil.rst:529 +#: ../../library/shutil.rst:555 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:533 +#: ../../library/shutil.rst:559 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:563 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:542 +#: ../../library/shutil.rst:568 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:544 +#: ../../library/shutil.rst:570 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 " @@ -675,14 +710,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:550 +#: ../../library/shutil.rst:576 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:554 +#: ../../library/shutil.rst:580 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. " @@ -690,33 +725,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:560 +#: ../../library/shutil.rst:586 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:562 +#: ../../library/shutil.rst:588 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:565 +#: ../../library/shutil.rst:591 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:568 +#: ../../library/shutil.rst:594 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:571 +#: ../../library/shutil.rst:597 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:573 +#: ../../library/shutil.rst:599 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -724,67 +759,68 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:577 +#: ../../library/shutil.rst:603 msgid "" "This function is not thread-safe when custom archivers registered with :func:" -"`register_archive_format` are used. In this case it temporarily changes the " -"current working directory of the process to perform archiving." +"`register_archive_format` do not support the *root_dir* argument. In this " +"case it temporarily changes the current working directory of the process to " +"*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:609 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:586 +#: ../../library/shutil.rst:613 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:592 +#: ../../library/shutil.rst:619 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:595 ../../library/shutil.rst:698 +#: ../../library/shutil.rst:622 ../../library/shutil.rst:733 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:624 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:598 +#: ../../library/shutil.rst:625 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:599 ../../library/shutil.rst:703 +#: ../../library/shutil.rst:626 ../../library/shutil.rst:738 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:600 ../../library/shutil.rst:704 +#: ../../library/shutil.rst:627 ../../library/shutil.rst:739 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:601 ../../library/shutil.rst:705 +#: ../../library/shutil.rst:628 ../../library/shutil.rst:740 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:630 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:609 +#: ../../library/shutil.rst:636 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:611 +#: ../../library/shutil.rst:638 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 " @@ -793,33 +829,47 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:617 +#: ../../library/shutil.rst:644 +msgid "" +"If *function* has the custom attribute ``function.supports_root_dir`` set to " +"``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " +"the current working directory of the process is temporarily changed to " +"*root_dir* before calling *function*. In this case :func:`make_archive` is " +"not thread-safe." +msgstr "" + +#: ../../library/shutil.rst:650 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:620 +#: ../../library/shutil.rst:653 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:656 +#, fuzzy +msgid "Added support for functions supporting the *root_dir* argument." +msgstr "新增 *xztar* 格式的支援。" + +#: ../../library/shutil.rst:662 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:667 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:633 +#: ../../library/shutil.rst:669 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:636 +#: ../../library/shutil.rst:672 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -828,17 +878,17 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:643 +#: ../../library/shutil.rst:679 msgid "" -"The keyword-only *filter* argument, which was added in Python 3.11.4, is " -"passed to the underlying unpacking function. For zip files, *filter* is not " -"accepted. For tar files, it is recommended to set it to ``'data'``, unless " -"using features specific to tar and UNIX-like filesystems. (See :ref:`tarfile-" -"extraction-filter` for details.) The ``'data'`` filter will become the " -"default for tar files in Python 3.14." +"The keyword-only *filter* argument is passed to the underlying unpacking " +"function. For zip files, *filter* is not accepted. For tar files, it is " +"recommended to set it to ``'data'``, unless using features specific to tar " +"and UNIX-like filesystems. (See :ref:`tarfile-extraction-filter` for " +"details.) The ``'data'`` filter will become the default for tar files in " +"Python 3.14." msgstr "" -#: ../../library/shutil.rst:652 +#: ../../library/shutil.rst:687 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -846,7 +896,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:691 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -854,138 +904,138 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:661 +#: ../../library/shutil.rst:696 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:664 +#: ../../library/shutil.rst:699 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:669 +#: ../../library/shutil.rst:704 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:673 +#: ../../library/shutil.rst:708 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:676 +#: ../../library/shutil.rst:711 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:677 +#: ../../library/shutil.rst:712 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:678 +#: ../../library/shutil.rst:713 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:680 +#: ../../library/shutil.rst:715 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:683 +#: ../../library/shutil.rst:718 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:689 +#: ../../library/shutil.rst:724 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:694 +#: ../../library/shutil.rst:729 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:700 +#: ../../library/shutil.rst:735 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:737 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:707 +#: ../../library/shutil.rst:742 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:714 +#: ../../library/shutil.rst:749 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:716 +#: ../../library/shutil.rst:751 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:726 +#: ../../library/shutil.rst:761 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:744 +#: ../../library/shutil.rst:779 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:746 +#: ../../library/shutil.rst:781 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:760 +#: ../../library/shutil.rst:795 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:774 +#: ../../library/shutil.rst:809 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:784 +#: ../../library/shutil.rst:819 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:788 +#: ../../library/shutil.rst:823 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:825 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:794 +#: ../../library/shutil.rst:829 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:798 +#: ../../library/shutil.rst:833 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 " @@ -994,17 +1044,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:804 +#: ../../library/shutil.rst:839 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:806 +#: ../../library/shutil.rst:841 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:811 +#: ../../library/shutil.rst:846 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/smtplib.po b/library/smtplib.po index 11a2a1c00d..f9325a440f 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,21 +99,22 @@ msgstr "" msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/smtplib.rst:68 ../../library/smtplib.rst:100 -msgid "source_address argument was added." +#: ../../library/smtplib.rst:68 +#, fuzzy +msgid "*source_address* argument was added." msgstr "新增 source_address 引數。" #: ../../library/smtplib.rst:71 msgid "The SMTPUTF8 extension (:rfc:`6531`) is now supported." msgstr "" -#: ../../library/smtplib.rst:74 ../../library/smtplib.rst:115 +#: ../../library/smtplib.rst:74 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" -"`ValueError` to prevent the creation of a non-blocking socket" +"`ValueError` to prevent the creation of a non-blocking socket." msgstr "" -#: ../../library/smtplib.rst:82 +#: ../../library/smtplib.rst:81 msgid "" "An :class:`SMTP_SSL` instance behaves exactly the same as instances of :" "class:`SMTP`. :class:`SMTP_SSL` should be used for situations where SSL is " @@ -127,73 +128,74 @@ msgid "" "practices." msgstr "" -#: ../../library/smtplib.rst:93 -msgid "" -"*keyfile* and *certfile* are a legacy alternative to *context*, and can " -"point to a PEM formatted private key and certificate chain file for the SSL " -"connection." -msgstr "" - -#: ../../library/smtplib.rst:97 ../../library/smtplib.rst:428 +#: ../../library/smtplib.rst:92 ../../library/smtplib.rst:415 msgid "*context* was added." msgstr "新增 *context*\\ 。" -#: ../../library/smtplib.rst:103 +#: ../../library/smtplib.rst:95 +#, fuzzy +msgid "The *source_address* argument was added." +msgstr "新增 source_address 引數。" + +#: ../../library/smtplib.rst:98 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" -#: ../../library/smtplib.rst:110 ../../library/smtplib.rst:414 +#: ../../library/smtplib.rst:103 msgid "" -"*keyfile* and *certfile* are deprecated in favor of *context*. Please use :" -"meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +"If the *timeout* parameter is set to be zero, it will raise a :class:" +"`ValueError` to prevent the creation of a non-blocking socket" +msgstr "" + +#: ../../library/smtplib.rst:107 ../../library/smtplib.rst:403 +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." msgstr "" -#: ../../library/smtplib.rst:122 +#: ../../library/smtplib.rst:113 msgid "" "The LMTP protocol, which is very similar to ESMTP, is heavily based on the " "standard SMTP client. It's common to use Unix sockets for LMTP, so our :meth:" "`connect` method must support that as well as a regular host:port server. " -"The optional arguments local_hostname and source_address have the same " +"The optional arguments *local_hostname* and *source_address* have the same " "meaning as they do in the :class:`SMTP` class. To specify a Unix socket, you " "must use an absolute path for *host*, starting with a '/'." msgstr "" -#: ../../library/smtplib.rst:129 +#: ../../library/smtplib.rst:120 msgid "" "Authentication is supported, using the regular SMTP mechanism. When using a " "Unix socket, LMTP generally don't support or require any authentication, but " "your mileage might vary." msgstr "" -#: ../../library/smtplib.rst:133 +#: ../../library/smtplib.rst:124 msgid "The optional *timeout* parameter was added." msgstr "新增 *timeout* 選用參數。" -#: ../../library/smtplib.rst:137 +#: ../../library/smtplib.rst:128 msgid "A nice selection of exceptions is defined as well:" msgstr "" -#: ../../library/smtplib.rst:142 +#: ../../library/smtplib.rst:133 msgid "" "Subclass of :exc:`OSError` that is the base exception class for all the " "other exceptions provided by this module." msgstr "" -#: ../../library/smtplib.rst:145 +#: ../../library/smtplib.rst:136 msgid "SMTPException became subclass of :exc:`OSError`" msgstr "" -#: ../../library/smtplib.rst:151 +#: ../../library/smtplib.rst:142 msgid "" "This exception is raised when the server unexpectedly disconnects, or when " "an attempt is made to use the :class:`SMTP` instance before connecting it to " "a server." msgstr "" -#: ../../library/smtplib.rst:158 +#: ../../library/smtplib.rst:149 msgid "" "Base class for all exceptions that include an SMTP error code. These " "exceptions are generated in some instances when the SMTP server returns an " @@ -201,72 +203,72 @@ msgid "" "the error, and the :attr:`smtp_error` attribute is set to the error message." msgstr "" -#: ../../library/smtplib.rst:166 +#: ../../library/smtplib.rst:157 msgid "" "Sender address refused. In addition to the attributes set by on all :exc:" "`SMTPResponseException` exceptions, this sets 'sender' to the string that " "the SMTP server refused." msgstr "" -#: ../../library/smtplib.rst:173 +#: ../../library/smtplib.rst:164 msgid "" "All recipient addresses refused. The errors for each recipient are " "accessible through the attribute :attr:`recipients`, which is a dictionary " "of exactly the same sort as :meth:`SMTP.sendmail` returns." msgstr "" -#: ../../library/smtplib.rst:180 +#: ../../library/smtplib.rst:171 msgid "The SMTP server refused to accept the message data." msgstr "" -#: ../../library/smtplib.rst:185 +#: ../../library/smtplib.rst:176 msgid "Error occurred during establishment of a connection with the server." msgstr "" -#: ../../library/smtplib.rst:190 +#: ../../library/smtplib.rst:181 msgid "The server refused our ``HELO`` message." msgstr "" -#: ../../library/smtplib.rst:195 +#: ../../library/smtplib.rst:186 msgid "The command or option attempted is not supported by the server." msgstr "" -#: ../../library/smtplib.rst:202 +#: ../../library/smtplib.rst:193 msgid "" "SMTP authentication went wrong. Most probably the server didn't accept the " "username/password combination provided." msgstr "" -#: ../../library/smtplib.rst:210 +#: ../../library/smtplib.rst:201 msgid ":rfc:`821` - Simple Mail Transfer Protocol" msgstr "" -#: ../../library/smtplib.rst:209 +#: ../../library/smtplib.rst:200 msgid "" "Protocol definition for SMTP. This document covers the model, operating " "procedure, and protocol details for SMTP." msgstr "" -#: ../../library/smtplib.rst:214 +#: ../../library/smtplib.rst:205 msgid ":rfc:`1869` - SMTP Service Extensions" msgstr "" -#: ../../library/smtplib.rst:213 +#: ../../library/smtplib.rst:204 msgid "" "Definition of the ESMTP extensions for SMTP. This describes a framework for " "extending SMTP with new commands, supporting dynamic discovery of the " "commands provided by the server, and defines a few additional commands." msgstr "" -#: ../../library/smtplib.rst:221 +#: ../../library/smtplib.rst:212 msgid "SMTP Objects" msgstr "SMTP 物件" -#: ../../library/smtplib.rst:223 +#: ../../library/smtplib.rst:214 msgid "An :class:`SMTP` instance has the following methods:" msgstr "" -#: ../../library/smtplib.rst:228 +#: ../../library/smtplib.rst:219 msgid "" "Set the debug output level. A value of 1 or ``True`` for *level* results in " "debug messages for connection and for all messages sent to and received from " @@ -274,36 +276,36 @@ msgid "" "timestamped." msgstr "" -#: ../../library/smtplib.rst:233 +#: ../../library/smtplib.rst:224 msgid "Added debuglevel 2." msgstr "" -#: ../../library/smtplib.rst:238 +#: ../../library/smtplib.rst:229 msgid "" "Send a command *cmd* to the server. The optional argument *args* is simply " "concatenated to the command, separated by a space." msgstr "" -#: ../../library/smtplib.rst:241 +#: ../../library/smtplib.rst:232 msgid "" "This returns a 2-tuple composed of a numeric response code and the actual " "response line (multiline responses are joined into one long line.)" msgstr "" -#: ../../library/smtplib.rst:244 +#: ../../library/smtplib.rst:235 msgid "" "In normal operation it should not be necessary to call this method " "explicitly. It is used to implement other methods and may be useful for " "testing private extensions." msgstr "" -#: ../../library/smtplib.rst:248 +#: ../../library/smtplib.rst:239 msgid "" "If the connection to the server is lost while waiting for the reply, :exc:" "`SMTPServerDisconnected` will be raised." msgstr "" -#: ../../library/smtplib.rst:254 +#: ../../library/smtplib.rst:245 msgid "" "Connect to a host on a given port. The defaults are to connect to the local " "host at the standard SMTP port (25). If the hostname ends with a colon " @@ -314,13 +316,13 @@ msgid "" "connection response." msgstr "" -#: ../../library/smtplib.rst:273 +#: ../../library/smtplib.rst:264 msgid "" "Raises an :ref:`auditing event ` ``smtplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" -#: ../../library/smtplib.rst:267 +#: ../../library/smtplib.rst:258 msgid "" "Identify yourself to the SMTP server using ``HELO``. The hostname argument " "defaults to the fully qualified domain name of the local host. The message " @@ -328,14 +330,14 @@ msgid "" "object." msgstr "" -#: ../../library/smtplib.rst:272 +#: ../../library/smtplib.rst:263 msgid "" "In normal operation it should not be necessary to call this method " "explicitly. It will be implicitly called by the :meth:`sendmail` when " "necessary." msgstr "" -#: ../../library/smtplib.rst:278 +#: ../../library/smtplib.rst:269 msgid "" "Identify yourself to an ESMTP server using ``EHLO``. The hostname argument " "defaults to the fully qualified domain name of the local host. Examine the " @@ -347,37 +349,37 @@ msgid "" "service extensions this server supports, and their parameters (if any)." msgstr "" -#: ../../library/smtplib.rst:288 +#: ../../library/smtplib.rst:279 msgid "" "Unless you wish to use :meth:`has_extn` before sending mail, it should not " "be necessary to call this method explicitly. It will be implicitly called " "by :meth:`sendmail` when necessary." msgstr "" -#: ../../library/smtplib.rst:294 +#: ../../library/smtplib.rst:285 msgid "" "This method calls :meth:`ehlo` and/or :meth:`helo` if there has been no " "previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO`` " "first." msgstr "" -#: ../../library/smtplib.rst:298 ../../library/smtplib.rst:328 -#: ../../library/smtplib.rst:420 ../../library/smtplib.rst:489 +#: ../../library/smtplib.rst:289 ../../library/smtplib.rst:319 +#: ../../library/smtplib.rst:407 ../../library/smtplib.rst:476 msgid ":exc:`SMTPHeloError`" msgstr ":exc:`SMTPHeloError`" -#: ../../library/smtplib.rst:299 ../../library/smtplib.rst:328 -#: ../../library/smtplib.rst:420 ../../library/smtplib.rst:489 +#: ../../library/smtplib.rst:290 ../../library/smtplib.rst:319 +#: ../../library/smtplib.rst:407 ../../library/smtplib.rst:476 msgid "The server didn't reply properly to the ``HELO`` greeting." msgstr "" -#: ../../library/smtplib.rst:303 +#: ../../library/smtplib.rst:294 msgid "" "Return :const:`True` if *name* is in the set of SMTP service extensions " "returned by the server, :const:`False` otherwise. Case is ignored." msgstr "" -#: ../../library/smtplib.rst:309 +#: ../../library/smtplib.rst:300 msgid "" "Check the validity of an address on this server using SMTP ``VRFY``. Returns " "a tuple consisting of code 250 and a full :rfc:`822` address (including " @@ -385,11 +387,11 @@ msgid "" "code of 400 or greater and an error string." msgstr "" -#: ../../library/smtplib.rst:316 +#: ../../library/smtplib.rst:307 msgid "Many sites disable SMTP ``VRFY`` in order to foil spammers." msgstr "" -#: ../../library/smtplib.rst:321 +#: ../../library/smtplib.rst:312 msgid "" "Log in on an SMTP server that requires authentication. The arguments are the " "username and the password to authenticate with. If there has been no " @@ -398,32 +400,32 @@ msgid "" "successful, or may raise the following exceptions:" msgstr "" -#: ../../library/smtplib.rst:331 +#: ../../library/smtplib.rst:322 msgid ":exc:`SMTPAuthenticationError`" msgstr ":exc:`SMTPAuthenticationError`" -#: ../../library/smtplib.rst:331 +#: ../../library/smtplib.rst:322 msgid "The server didn't accept the username/password combination." msgstr "" -#: ../../library/smtplib.rst:334 ../../library/smtplib.rst:423 -#: ../../library/smtplib.rst:500 +#: ../../library/smtplib.rst:325 ../../library/smtplib.rst:410 +#: ../../library/smtplib.rst:487 msgid ":exc:`SMTPNotSupportedError`" msgstr ":exc:`SMTPNotSupportedError`" -#: ../../library/smtplib.rst:334 +#: ../../library/smtplib.rst:325 msgid "The ``AUTH`` command is not supported by the server." msgstr "" -#: ../../library/smtplib.rst:337 +#: ../../library/smtplib.rst:328 msgid ":exc:`SMTPException`" msgstr ":exc:`SMTPException`" -#: ../../library/smtplib.rst:337 +#: ../../library/smtplib.rst:328 msgid "No suitable authentication method was found." msgstr "" -#: ../../library/smtplib.rst:339 +#: ../../library/smtplib.rst:330 msgid "" "Each of the authentication methods supported by :mod:`smtplib` are tried in " "turn if they are advertised as supported by the server. See :meth:`auth` " @@ -431,7 +433,7 @@ msgid "" "passed through to :meth:`auth`." msgstr "" -#: ../../library/smtplib.rst:344 +#: ../../library/smtplib.rst:335 msgid "" "Optional keyword argument *initial_response_ok* specifies whether, for " "authentication methods that support it, an \"initial response\" as specified " @@ -439,35 +441,31 @@ msgid "" "requiring a challenge/response." msgstr "" -#: ../../library/smtplib.rst:349 +#: ../../library/smtplib.rst:340 msgid "" ":exc:`SMTPNotSupportedError` may be raised, and the *initial_response_ok* " "parameter was added." msgstr "" -#: ../../library/smtplib.rst:356 +#: ../../library/smtplib.rst:347 msgid "" "Issue an ``SMTP`` ``AUTH`` command for the specified authentication " "*mechanism*, and handle the challenge response via *authobject*." msgstr "" -#: ../../library/smtplib.rst:359 +#: ../../library/smtplib.rst:350 msgid "" "*mechanism* specifies which authentication mechanism is to be used as " "argument to the ``AUTH`` command; the valid values are those listed in the " "``auth`` element of :attr:`esmtp_features`." msgstr "" -#: ../../library/smtplib.rst:363 +#: ../../library/smtplib.rst:354 msgid "" -"*authobject* must be a callable object taking an optional single argument:" -msgstr "" - -#: ../../library/smtplib.rst:365 -msgid "data = authobject(challenge=None)" +"*authobject* must be a callable object taking an optional single argument::" msgstr "" -#: ../../library/smtplib.rst:367 +#: ../../library/smtplib.rst:358 msgid "" "If optional keyword argument *initial_response_ok* is true, ``authobject()`` " "will be called first with no argument. It can return the :rfc:`4954` " @@ -478,7 +476,7 @@ msgid "" "false, then ``authobject()`` will not be called first with ``None``." msgstr "" -#: ../../library/smtplib.rst:375 +#: ../../library/smtplib.rst:366 msgid "" "If the initial response check returns ``None``, or if *initial_response_ok* " "is false, ``authobject()`` will be called to process the server's challenge " @@ -487,7 +485,7 @@ msgid "" "the server." msgstr "" -#: ../../library/smtplib.rst:381 +#: ../../library/smtplib.rst:372 msgid "" "The ``SMTP`` class provides ``authobjects`` for the ``CRAM-MD5``, ``PLAIN``, " "and ``LOGIN`` mechanisms; they are named ``SMTP.auth_cram_md5``, ``SMTP." @@ -496,7 +494,7 @@ msgid "" "appropriate values." msgstr "" -#: ../../library/smtplib.rst:387 +#: ../../library/smtplib.rst:378 msgid "" "User code does not normally need to call ``auth`` directly, but can instead " "call the :meth:`login` method, which will try each of the above mechanisms " @@ -505,57 +503,57 @@ msgid "" "by :mod:`smtplib`." msgstr "" -#: ../../library/smtplib.rst:398 +#: ../../library/smtplib.rst:389 msgid "" "Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP " "commands that follow will be encrypted. You should then call :meth:`ehlo` " "again." msgstr "" -#: ../../library/smtplib.rst:402 +#: ../../library/smtplib.rst:393 msgid "" "If *keyfile* and *certfile* are provided, they are used to create an :class:" "`ssl.SSLContext`." msgstr "" -#: ../../library/smtplib.rst:405 +#: ../../library/smtplib.rst:396 msgid "" "Optional *context* parameter is an :class:`ssl.SSLContext` object; This is " "an alternative to using a keyfile and a certfile and if specified both " "*keyfile* and *certfile* should be ``None``." msgstr "" -#: ../../library/smtplib.rst:409 +#: ../../library/smtplib.rst:400 msgid "" "If there has been no previous ``EHLO`` or ``HELO`` command this session, " "this method tries ESMTP ``EHLO`` first." msgstr "" -#: ../../library/smtplib.rst:423 +#: ../../library/smtplib.rst:410 msgid "The server does not support the STARTTLS extension." msgstr "" -#: ../../library/smtplib.rst:426 +#: ../../library/smtplib.rst:413 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../library/smtplib.rst:426 +#: ../../library/smtplib.rst:413 msgid "SSL/TLS support is not available to your Python interpreter." msgstr "" -#: ../../library/smtplib.rst:431 +#: ../../library/smtplib.rst:418 msgid "" "The method now supports hostname check with :attr:`SSLContext." "check_hostname` and *Server Name Indicator* (see :data:`~ssl.HAS_SNI`)." msgstr "" -#: ../../library/smtplib.rst:436 +#: ../../library/smtplib.rst:423 msgid "" "The error raised for lack of STARTTLS support is now the :exc:" "`SMTPNotSupportedError` subclass instead of the base :exc:`SMTPException`." msgstr "" -#: ../../library/smtplib.rst:444 +#: ../../library/smtplib.rst:431 msgid "" "Send mail. The required arguments are an :rfc:`822` from-address string, a " "list of :rfc:`822` to-address strings (a bare string will be treated as a " @@ -568,14 +566,14 @@ msgid "" "the message.)" msgstr "" -#: ../../library/smtplib.rst:455 +#: ../../library/smtplib.rst:442 msgid "" "The *from_addr* and *to_addrs* parameters are used to construct the message " "envelope used by the transport agents. ``sendmail`` does not modify the " "message headers in any way." msgstr "" -#: ../../library/smtplib.rst:459 +#: ../../library/smtplib.rst:446 msgid "" "*msg* may be a string containing characters in the ASCII range, or a byte " "string. A string is encoded to bytes using the ascii codec, and lone " @@ -583,7 +581,7 @@ msgid "" "byte string is not modified." msgstr "" -#: ../../library/smtplib.rst:464 +#: ../../library/smtplib.rst:451 msgid "" "If there has been no previous ``EHLO`` or ``HELO`` command this session, " "this method tries ESMTP ``EHLO`` first. If the server does ESMTP, message " @@ -592,7 +590,7 @@ msgid "" "will be tried and ESMTP options suppressed." msgstr "" -#: ../../library/smtplib.rst:470 +#: ../../library/smtplib.rst:457 msgid "" "This method will return normally if the mail is accepted for at least one " "recipient. Otherwise it will raise an exception. That is, if this method " @@ -602,21 +600,21 @@ msgid "" "SMTP error code and the accompanying error message sent by the server." msgstr "" -#: ../../library/smtplib.rst:477 +#: ../../library/smtplib.rst:464 msgid "" "If ``SMTPUTF8`` is included in *mail_options*, and the server supports it, " "*from_addr* and *to_addrs* may contain non-ASCII characters." msgstr "" -#: ../../library/smtplib.rst:480 +#: ../../library/smtplib.rst:467 msgid "This method may raise the following exceptions:" msgstr "" -#: ../../library/smtplib.rst:486 +#: ../../library/smtplib.rst:473 msgid ":exc:`SMTPRecipientsRefused`" msgstr ":exc:`SMTPRecipientsRefused`" -#: ../../library/smtplib.rst:483 +#: ../../library/smtplib.rst:470 msgid "" "All recipients were refused. Nobody got the mail. The :attr:`recipients` " "attribute of the exception object is a dictionary with information about the " @@ -624,47 +622,47 @@ msgid "" "accepted)." msgstr "" -#: ../../library/smtplib.rst:492 +#: ../../library/smtplib.rst:479 msgid ":exc:`SMTPSenderRefused`" msgstr ":exc:`SMTPSenderRefused`" -#: ../../library/smtplib.rst:492 +#: ../../library/smtplib.rst:479 msgid "The server didn't accept the *from_addr*." msgstr "" -#: ../../library/smtplib.rst:496 +#: ../../library/smtplib.rst:483 msgid ":exc:`SMTPDataError`" msgstr ":exc:`SMTPDataError`" -#: ../../library/smtplib.rst:495 +#: ../../library/smtplib.rst:482 msgid "" "The server replied with an unexpected error code (other than a refusal of a " "recipient)." msgstr "" -#: ../../library/smtplib.rst:499 +#: ../../library/smtplib.rst:486 msgid "" "``SMTPUTF8`` was given in the *mail_options* but is not supported by the " "server." msgstr "" -#: ../../library/smtplib.rst:502 +#: ../../library/smtplib.rst:489 msgid "" "Unless otherwise noted, the connection will be open even after an exception " "is raised." msgstr "" -#: ../../library/smtplib.rst:505 +#: ../../library/smtplib.rst:492 msgid "*msg* may be a byte string." msgstr "" -#: ../../library/smtplib.rst:508 +#: ../../library/smtplib.rst:495 msgid "" "``SMTPUTF8`` support added, and :exc:`SMTPNotSupportedError` may be raised " "if ``SMTPUTF8`` is specified but the server does not support it." msgstr "" -#: ../../library/smtplib.rst:516 +#: ../../library/smtplib.rst:503 msgid "" "This is a convenience method for calling :meth:`sendmail` with the message " "represented by an :class:`email.message.Message` object. The arguments have " @@ -672,7 +670,7 @@ msgid "" "object." msgstr "" -#: ../../library/smtplib.rst:521 +#: ../../library/smtplib.rst:508 msgid "" "If *from_addr* is ``None`` or *to_addrs* is ``None``, ``send_message`` fills " "those arguments with addresses extracted from the headers of *msg* as " @@ -687,7 +685,7 @@ msgid "" "most recent set of :mailheader:`Resent-` headers." msgstr "" -#: ../../library/smtplib.rst:533 +#: ../../library/smtplib.rst:520 msgid "" "``send_message`` serializes *msg* using :class:`~email.generator." "BytesGenerator` with ``\\r\\n`` as the *linesep*, and calls :meth:`sendmail` " @@ -702,17 +700,17 @@ msgid "" "to *mail_options*." msgstr "" -#: ../../library/smtplib.rst:547 +#: ../../library/smtplib.rst:534 msgid "Support for internationalized addresses (``SMTPUTF8``)." msgstr "" -#: ../../library/smtplib.rst:553 +#: ../../library/smtplib.rst:540 msgid "" "Terminate the SMTP session and close the connection. Return the result of " "the SMTP ``QUIT`` command." msgstr "" -#: ../../library/smtplib.rst:557 +#: ../../library/smtplib.rst:544 msgid "" "Low-level methods corresponding to the standard SMTP/ESMTP commands " "``HELP``, ``RSET``, ``NOOP``, ``MAIL``, ``RCPT``, and ``DATA`` are also " @@ -720,11 +718,11 @@ msgid "" "documented here. For details, consult the module code." msgstr "" -#: ../../library/smtplib.rst:566 +#: ../../library/smtplib.rst:553 msgid "SMTP Example" msgstr "SMTP 範例" -#: ../../library/smtplib.rst:568 +#: ../../library/smtplib.rst:555 msgid "" "This example prompts the user for addresses needed in the message envelope " "('To' and 'From' addresses), and the message to be delivered. Note that the " @@ -734,7 +732,7 @@ msgid "" "headers explicitly. ::" msgstr "" -#: ../../library/smtplib.rst:604 +#: ../../library/smtplib.rst:591 msgid "" "In general, you will want to use the :mod:`email` package's features to " "construct an email message, which you can then send via :meth:`~smtplib.SMTP." diff --git a/library/socket.po b/library/socket.po index 365272aa25..cdd5b762ce 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-05 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -111,8 +111,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1043 -#: ../../library/socket.rst:1085 ../../library/socket.rst:1844 +#: ../../library/socket.rst:66 ../../library/socket.rst:1142 +#: ../../library/socket.rst:1184 ../../library/socket.rst:1943 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -286,8 +286,8 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:519 -#: ../../library/socket.rst:1766 +#: ../../library/socket.rst:171 ../../library/socket.rst:583 +#: ../../library/socket.rst:1865 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -302,7 +302,7 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:592 +#: ../../library/socket.rst:181 ../../library/socket.rst:656 msgid ":ref:`Availability `: Linux >= 3.9" msgstr ":ref:`適用 `:Linux 3.9 以上。" @@ -323,54 +323,56 @@ msgstr "" #: ../../library/socket.rst:192 msgid "" -"*proto* - An in network-byte-order integer specifying the Ethernet protocol " -"number." +"*proto* - The Ethernet protocol number. May be :data:`ETH_P_ALL` to capture " +"all protocols, one of the :ref:`ETHERTYPE_* constants ` or any other Ethernet protocol number. Value must be in network-byte-" +"order." msgstr "" -#: ../../library/socket.rst:194 +#: ../../library/socket.rst:197 msgid "*pkttype* - Optional integer specifying the packet type:" msgstr "" -#: ../../library/socket.rst:196 +#: ../../library/socket.rst:199 msgid "``PACKET_HOST`` (the default) - Packet addressed to the local host." msgstr "" -#: ../../library/socket.rst:197 +#: ../../library/socket.rst:200 msgid "``PACKET_BROADCAST`` - Physical-layer broadcast packet." msgstr "" -#: ../../library/socket.rst:198 +#: ../../library/socket.rst:201 msgid "" "``PACKET_MULTICAST`` - Packet sent to a physical-layer multicast address." msgstr "" -#: ../../library/socket.rst:199 +#: ../../library/socket.rst:202 msgid "" "``PACKET_OTHERHOST`` - Packet to some other host that has been caught by a " "device driver in promiscuous mode." msgstr "" -#: ../../library/socket.rst:201 +#: ../../library/socket.rst:204 msgid "" "``PACKET_OUTGOING`` - Packet originating from the local host that is looped " "back to a packet socket." msgstr "" -#: ../../library/socket.rst:203 +#: ../../library/socket.rst:206 msgid "*hatype* - Optional integer specifying the ARP hardware address type." msgstr "" -#: ../../library/socket.rst:204 +#: ../../library/socket.rst:207 msgid "" "*addr* - Optional bytes-like object specifying the hardware physical " "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:207 ../../library/socket.rst:480 +#: ../../library/socket.rst:210 ../../library/socket.rst:531 msgid ":ref:`Availability `: Linux >= 2.2." msgstr ":ref:`適用 `:Linux >= 2.2。" -#: ../../library/socket.rst:209 +#: ../../library/socket.rst:212 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " "with services running on co-processors in Qualcomm platforms. The address " @@ -378,11 +380,11 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:214 ../../library/socket.rst:568 +#: ../../library/socket.rst:217 ../../library/socket.rst:632 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux >= 4.7。" -#: ../../library/socket.rst:218 +#: ../../library/socket.rst:221 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " "what portion of a packet is covered with the checksum. It adds two socket " @@ -393,18 +395,68 @@ msgid "" "of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." msgstr "" -#: ../../library/socket.rst:227 +#: ../../library/socket.rst:230 msgid "" "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:231 +#: ../../library/socket.rst:234 msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" msgstr ":ref:`適用 `:Linux 2.6.20 以上、FreeBSD 10.1 以上。" -#: ../../library/socket.rst:235 +#: ../../library/socket.rst:238 +msgid "" +":const:`AF_HYPERV` is a Windows-only socket based interface for " +"communicating with Hyper-V hosts and guests. The address family is " +"represented as a ``(vm_id, service_id)`` tuple where the ``vm_id`` and " +"``service_id`` are UUID strings." +msgstr "" + +#: ../../library/socket.rst:243 +msgid "" +"The ``vm_id`` is the virtual machine identifier or a set of known VMID " +"values if the target is not a specific virtual machine. Known VMID constants " +"defined on ``socket`` are:" +msgstr "" + +#: ../../library/socket.rst:247 +msgid "``HV_GUID_ZERO``" +msgstr "" + +#: ../../library/socket.rst:248 +msgid "``HV_GUID_BROADCAST``" +msgstr "" + +#: ../../library/socket.rst:249 +msgid "" +"``HV_GUID_WILDCARD`` - Used to bind on itself and accept connections from " +"all partitions." +msgstr "" + +#: ../../library/socket.rst:251 +msgid "" +"``HV_GUID_CHILDREN`` - Used to bind on itself and accept connection from " +"child partitions." +msgstr "" + +#: ../../library/socket.rst:253 +msgid "``HV_GUID_LOOPBACK`` - Used as a target to itself." +msgstr "" + +#: ../../library/socket.rst:254 +msgid "" +"``HV_GUID_PARENT`` - When used as a bind accepts connection from the parent " +"partition. When used as an address target it will connect to the parent " +"partition." +msgstr "" + +#: ../../library/socket.rst:257 +msgid "The ``service_id`` is the service identifier of the registered service." +msgstr "" + +#: ../../library/socket.rst:261 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " "program may show a nondeterministic behavior, as Python uses the first " @@ -414,41 +466,41 @@ msgid "" "deterministic behavior use a numeric address in *host* portion." msgstr "" -#: ../../library/socket.rst:242 +#: ../../library/socket.rst:268 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " "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:247 +#: ../../library/socket.rst:273 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " "generalization of this based on timeouts is supported through :meth:`~socket." "settimeout`." msgstr "" -#: ../../library/socket.rst:253 +#: ../../library/socket.rst:279 msgid "Module contents" msgstr "模組內容" -#: ../../library/socket.rst:255 +#: ../../library/socket.rst:281 msgid "The module :mod:`socket` exports the following elements." msgstr "" -#: ../../library/socket.rst:259 +#: ../../library/socket.rst:285 msgid "Exceptions" msgstr "例外" -#: ../../library/socket.rst:263 +#: ../../library/socket.rst:289 msgid "A deprecated alias of :exc:`OSError`." msgstr "一個已棄用的 :exc:`OSError` 的別名。" -#: ../../library/socket.rst:265 +#: ../../library/socket.rst:291 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:271 +#: ../../library/socket.rst:297 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" @@ -458,12 +510,12 @@ msgid "" "description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" -#: ../../library/socket.rst:279 ../../library/socket.rst:292 -#: ../../library/socket.rst:305 +#: ../../library/socket.rst:305 ../../library/socket.rst:318 +#: ../../library/socket.rst:331 msgid "This class was made a subclass of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:284 +#: ../../library/socket.rst:310 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " @@ -473,11 +525,11 @@ msgid "" "match one of the :const:`EAI_\\*` constants defined in this module." msgstr "" -#: ../../library/socket.rst:297 +#: ../../library/socket.rst:323 msgid "A deprecated alias of :exc:`TimeoutError`." msgstr "" -#: ../../library/socket.rst:299 +#: ../../library/socket.rst:325 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " "on a socket which has had timeouts enabled via a prior call to :meth:" @@ -486,21 +538,21 @@ msgid "" "currently always \"timed out\"." msgstr "" -#: ../../library/socket.rst:308 +#: ../../library/socket.rst:334 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "" -#: ../../library/socket.rst:313 +#: ../../library/socket.rst:339 msgid "Constants" msgstr "常數" -#: ../../library/socket.rst:315 +#: ../../library/socket.rst:341 msgid "" "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" "`SocketKind` :class:`.IntEnum` collections." msgstr "" -#: ../../library/socket.rst:324 +#: ../../library/socket.rst:350 msgid "" "These constants represent the address (and protocol) families, used for the " "first argument to :func:`.socket`. If the :const:`AF_UNIX` constant is not " @@ -508,7 +560,7 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:336 +#: ../../library/socket.rst:362 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -516,24 +568,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:344 +#: ../../library/socket.rst:370 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:350 +#: ../../library/socket.rst:376 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:353 +#: ../../library/socket.rst:379 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" -#: ../../library/socket.rst:372 +#: ../../library/socket.rst:398 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -543,175 +595,218 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:379 +#: ../../library/socket.rst:405 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:383 +#: ../../library/socket.rst:409 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:387 +#: ../../library/socket.rst:413 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "新增 ``TCP_NOTSENT_LOWAT``。" -#: ../../library/socket.rst:390 +#: ../../library/socket.rst:416 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:393 +#: ../../library/socket.rst:419 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: ../../library/socket.rst:398 +#: ../../library/socket.rst:424 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: ../../library/socket.rst:407 ../../library/socket.rst:477 -#: ../../library/socket.rst:488 +#: ../../library/socket.rst:428 +msgid "" +"Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " +"respectively those constants can be used in the same way that ``SO_MARK`` is " +"used on Linux. Also added missing TCP socket options from Linux: " +"``TCP_MD5SIG``, ``TCP_THIN_LINEAR_TIMEOUTS``, ``TCP_THIN_DUPACK``, " +"``TCP_REPAIR``, ``TCP_REPAIR_QUEUE``, ``TCP_QUEUE_SEQ``, " +"``TCP_REPAIR_OPTIONS``, ``TCP_TIMESTAMP``, ``TCP_CC_INFO``, " +"``TCP_SAVE_SYN``, ``TCP_SAVED_SYN``, ``TCP_REPAIR_WINDOW``, " +"``TCP_FASTOPEN_CONNECT``, ``TCP_ULP``, ``TCP_MD5SIG_EXT``, " +"``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``, ``TCP_ZEROCOPY_RECEIVE``, " +"``TCP_INQ``, ``TCP_TX_DELAY``. Added ``IP_PKTINFO``, ``IP_UNBLOCK_SOURCE``, " +"``IP_BLOCK_SOURCE``, ``IP_ADD_SOURCE_MEMBERSHIP``, " +"``IP_DROP_SOURCE_MEMBERSHIP``." +msgstr "" + +#: ../../library/socket.rst:447 ../../library/socket.rst:528 +#: ../../library/socket.rst:552 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:410 +#: ../../library/socket.rst:450 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" -#: ../../library/socket.rst:414 +#: ../../library/socket.rst:454 msgid "NetBSD support was added." msgstr "" -#: ../../library/socket.rst:420 +#: ../../library/socket.rst:460 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:424 ../../library/socket.rst:459 +#: ../../library/socket.rst:464 ../../library/socket.rst:499 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" -#: ../../library/socket.rst:427 +#: ../../library/socket.rst:467 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:433 +#: ../../library/socket.rst:473 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:437 ../../library/socket.rst:448 +#: ../../library/socket.rst:477 ../../library/socket.rst:488 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:439 +#: ../../library/socket.rst:479 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" -#: ../../library/socket.rst:445 +#: ../../library/socket.rst:485 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:450 +#: ../../library/socket.rst:490 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" -#: ../../library/socket.rst:456 +#: ../../library/socket.rst:496 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:465 +#: ../../library/socket.rst:505 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:468 +#: ../../library/socket.rst:508 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:491 +#: ../../library/socket.rst:516 +msgid "" +"These two constants, documented in the FreeBSD divert(4) manual page, are " +"also defined in the socket module." +msgstr "" + +#: ../../library/socket.rst:519 +#, fuzzy +msgid ":ref:`Availability `: FreeBSD >= 14.0." +msgstr ":ref:`適用 `:FreeBSD。" + +#: ../../library/socket.rst:536 +msgid "" +":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " +"*proto* for the :const:`AF_PACKET` family in order to capture every packet, " +"regardless of protocol." +msgstr "" + +#: ../../library/socket.rst:540 +msgid "For more information, see the :manpage:`packet(7)` manpage." +msgstr "" + +#: ../../library/socket.rst:542 +#, fuzzy +msgid ":ref:`Availability `: Linux." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/socket.rst:555 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" -#: ../../library/socket.rst:501 +#: ../../library/socket.rst:565 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:504 ../../library/socket.rst:1458 +#: ../../library/socket.rst:568 ../../library/socket.rst:1557 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" -#: ../../library/socket.rst:510 +#: ../../library/socket.rst:574 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:517 +#: ../../library/socket.rst:581 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:529 +#: ../../library/socket.rst:593 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:531 +#: ../../library/socket.rst:595 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:537 +#: ../../library/socket.rst:601 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" -#: ../../library/socket.rst:543 +#: ../../library/socket.rst:607 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:549 +#: ../../library/socket.rst:613 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:558 +#: ../../library/socket.rst:622 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:565 +#: ../../library/socket.rst:629 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:638 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -720,30 +815,50 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:583 +#: ../../library/socket.rst:647 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/socket.rst:587 +#: ../../library/socket.rst:651 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:595 +#: ../../library/socket.rst:671 +msgid "Constants for Windows Hyper-V sockets for host/guest communications." +msgstr "" + +#: ../../library/socket.rst:673 ../../library/socket.rst:880 +#: ../../library/socket.rst:1971 +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`適用 `:Windows。" + +#: ../../library/socket.rst:684 +msgid "" +"`IEEE 802.3 protocol number `_. constants." +msgstr "" + +#: ../../library/socket.rst:688 +#, fuzzy +msgid ":ref:`Availability `: Linux, FreeBSD, macOS." +msgstr ":ref:`適用 `:BSD、macOS。" + +#: ../../library/socket.rst:694 msgid "Functions" msgstr "函式" -#: ../../library/socket.rst:598 +#: ../../library/socket.rst:697 msgid "Creating sockets" msgstr "建立 sockets" -#: ../../library/socket.rst:600 +#: ../../library/socket.rst:699 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:605 +#: ../../library/socket.rst:704 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -756,7 +871,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:615 +#: ../../library/socket.rst:714 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -767,12 +882,12 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:624 ../../library/socket.rst:770 -#: ../../library/socket.rst:1277 ../../library/socket.rst:1371 +#: ../../library/socket.rst:723 ../../library/socket.rst:869 +#: ../../library/socket.rst:1376 ../../library/socket.rst:1470 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:637 +#: ../../library/socket.rst:736 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -780,44 +895,44 @@ msgstr "" "引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" "事件 ` ``socket.__new__``。" -#: ../../library/socket.rst:628 +#: ../../library/socket.rst:727 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:632 +#: ../../library/socket.rst:731 msgid "The CAN_BCM protocol was added." msgstr "新增 CAN_BCM 協定。" -#: ../../library/socket.rst:635 ../../library/socket.rst:772 +#: ../../library/socket.rst:734 ../../library/socket.rst:871 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:737 msgid "The CAN_ISOTP protocol was added." msgstr "新增 CAN_ISOTP 協定。" -#: ../../library/socket.rst:641 +#: ../../library/socket.rst:740 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: ../../library/socket.rst:653 +#: ../../library/socket.rst:752 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:657 +#: ../../library/socket.rst:756 msgid "The CAN_J1939 protocol was added." msgstr "新增 CAN_J1939 協定。" -#: ../../library/socket.rst:660 +#: ../../library/socket.rst:759 msgid "The IPPROTO_MPTCP protocol was added." msgstr "新增 IPPROTO_MPTCP 協定。" -#: ../../library/socket.rst:665 +#: ../../library/socket.rst:764 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -826,25 +941,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:670 +#: ../../library/socket.rst:769 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:672 +#: ../../library/socket.rst:771 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:676 +#: ../../library/socket.rst:775 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:679 +#: ../../library/socket.rst:778 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:685 +#: ../../library/socket.rst:784 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -855,21 +970,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:693 +#: ../../library/socket.rst:792 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:698 +#: ../../library/socket.rst:797 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:702 +#: ../../library/socket.rst:801 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -877,21 +992,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:707 +#: ../../library/socket.rst:806 msgid "*source_address* was added." msgstr "新增 *source_address*\\ 。" -#: ../../library/socket.rst:710 +#: ../../library/socket.rst:809 msgid "*all_errors* was added." msgstr "新增 *all_errors*\\ 。" -#: ../../library/socket.rst:716 +#: ../../library/socket.rst:815 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" -"tuple ``(host, port)``) and return the socket object." +"tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:719 +#: ../../library/socket.rst:818 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -899,7 +1014,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:724 +#: ../../library/socket.rst:823 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -912,20 +1027,20 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:746 +#: ../../library/socket.rst:845 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:754 +#: ../../library/socket.rst:853 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:761 +#: ../../library/socket.rst:860 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`fileno` method) and build a socket object from the result. " @@ -938,38 +1053,34 @@ msgid "" "socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:778 +#: ../../library/socket.rst:877 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:781 ../../library/socket.rst:1872 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - -#: ../../library/socket.rst:788 +#: ../../library/socket.rst:887 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:793 +#: ../../library/socket.rst:892 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:795 +#: ../../library/socket.rst:894 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:800 +#: ../../library/socket.rst:899 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:808 +#: ../../library/socket.rst:907 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -979,7 +1090,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:815 +#: ../../library/socket.rst:914 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -990,15 +1101,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:823 +#: ../../library/socket.rst:922 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:825 +#: ../../library/socket.rst:924 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:827 +#: ../../library/socket.rst:926 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -1010,7 +1121,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:848 +#: ../../library/socket.rst:947 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1018,24 +1129,24 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:839 +#: ../../library/socket.rst:938 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:849 +#: ../../library/socket.rst:948 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:852 +#: ../../library/socket.rst:951 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:858 +#: ../../library/socket.rst:957 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1046,7 +1157,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:869 +#: ../../library/socket.rst:968 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1056,7 +1167,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:886 ../../library/socket.rst:902 +#: ../../library/socket.rst:985 ../../library/socket.rst:1001 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1064,18 +1175,18 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:877 ../../library/socket.rst:893 -#: ../../library/socket.rst:906 ../../library/socket.rst:921 -#: ../../library/socket.rst:938 ../../library/socket.rst:949 -#: ../../library/socket.rst:960 ../../library/socket.rst:971 -#: ../../library/socket.rst:1295 ../../library/socket.rst:1342 -#: ../../library/socket.rst:1356 ../../library/socket.rst:1376 -#: ../../library/socket.rst:1423 ../../library/socket.rst:1468 -#: ../../library/socket.rst:1850 ../../library/socket.rst:1860 +#: ../../library/socket.rst:976 ../../library/socket.rst:992 +#: ../../library/socket.rst:1005 ../../library/socket.rst:1020 +#: ../../library/socket.rst:1037 ../../library/socket.rst:1048 +#: ../../library/socket.rst:1059 ../../library/socket.rst:1070 +#: ../../library/socket.rst:1394 ../../library/socket.rst:1441 +#: ../../library/socket.rst:1455 ../../library/socket.rst:1475 +#: ../../library/socket.rst:1522 ../../library/socket.rst:1567 +#: ../../library/socket.rst:1949 ../../library/socket.rst:1959 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/socket.rst:882 +#: ../../library/socket.rst:981 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a " "triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1087,26 +1198,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:898 +#: ../../library/socket.rst:997 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:912 +#: ../../library/socket.rst:1011 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:903 +#: ../../library/socket.rst:1002 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:911 +#: ../../library/socket.rst:1010 msgid "" "Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1117,7 +1228,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:930 +#: ../../library/socket.rst:1029 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1125,7 +1236,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:926 +#: ../../library/socket.rst:1025 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1133,18 +1244,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:931 +#: ../../library/socket.rst:1030 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:934 +#: ../../library/socket.rst:1033 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:947 +#: ../../library/socket.rst:1046 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1152,7 +1263,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:943 +#: ../../library/socket.rst:1042 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1161,14 +1272,14 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:1053 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:969 +#: ../../library/socket.rst:1068 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1176,14 +1287,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:965 +#: ../../library/socket.rst:1064 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:980 +#: ../../library/socket.rst:1079 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1191,40 +1302,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:976 +#: ../../library/socket.rst:1075 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:983 +#: ../../library/socket.rst:1082 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:987 ../../library/socket.rst:1005 +#: ../../library/socket.rst:1086 ../../library/socket.rst:1104 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:994 +#: ../../library/socket.rst:1093 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1001 +#: ../../library/socket.rst:1100 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1012 +#: ../../library/socket.rst:1111 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1233,26 +1344,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1018 +#: ../../library/socket.rst:1117 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1021 +#: ../../library/socket.rst:1120 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1025 +#: ../../library/socket.rst:1124 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1031 +#: ../../library/socket.rst:1130 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1262,7 +1373,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1038 +#: ../../library/socket.rst:1137 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1270,7 +1381,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1049 +#: ../../library/socket.rst:1148 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1278,7 +1389,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1054 +#: ../../library/socket.rst:1153 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1287,15 +1398,15 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1060 ../../library/socket.rst:1080 +#: ../../library/socket.rst:1159 ../../library/socket.rst:1179 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/socket.rst:1062 ../../library/socket.rst:1082 +#: ../../library/socket.rst:1161 ../../library/socket.rst:1181 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1068 +#: ../../library/socket.rst:1167 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1304,7 +1415,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1174 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1312,7 +1423,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1097 +#: ../../library/socket.rst:1196 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1323,16 +1434,16 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1106 ../../library/socket.rst:1129 +#: ../../library/socket.rst:1205 ../../library/socket.rst:1228 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1108 ../../library/socket.rst:1598 -#: ../../library/socket.rst:1642 ../../library/socket.rst:1750 +#: ../../library/socket.rst:1207 ../../library/socket.rst:1697 +#: ../../library/socket.rst:1741 ../../library/socket.rst:1849 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1115 +#: ../../library/socket.rst:1214 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1342,7 +1453,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1123 +#: ../../library/socket.rst:1222 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1350,31 +1461,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1131 +#: ../../library/socket.rst:1230 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1138 +#: ../../library/socket.rst:1237 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1145 +#: ../../library/socket.rst:1244 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1153 +#: ../../library/socket.rst:1252 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1167 +#: ../../library/socket.rst:1266 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1382,114 +1493,114 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1158 ../../library/socket.rst:1596 -#: ../../library/socket.rst:1640 +#: ../../library/socket.rst:1257 ../../library/socket.rst:1695 +#: ../../library/socket.rst:1739 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/socket.rst:1165 +#: ../../library/socket.rst:1264 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1169 ../../library/socket.rst:1196 -#: ../../library/socket.rst:1213 ../../library/socket.rst:1230 -#: ../../library/socket.rst:1244 +#: ../../library/socket.rst:1268 ../../library/socket.rst:1295 +#: ../../library/socket.rst:1312 ../../library/socket.rst:1329 +#: ../../library/socket.rst:1343 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1173 ../../library/socket.rst:1200 -#: ../../library/socket.rst:1217 +#: ../../library/socket.rst:1272 ../../library/socket.rst:1299 +#: ../../library/socket.rst:1316 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1178 +#: ../../library/socket.rst:1277 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1181 +#: ../../library/socket.rst:1280 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1182 +#: ../../library/socket.rst:1281 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1183 +#: ../../library/socket.rst:1282 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1184 +#: ../../library/socket.rst:1283 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1186 +#: ../../library/socket.rst:1285 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1192 +#: ../../library/socket.rst:1291 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1204 ../../library/socket.rst:1221 +#: ../../library/socket.rst:1303 ../../library/socket.rst:1320 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1209 +#: ../../library/socket.rst:1308 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1226 +#: ../../library/socket.rst:1325 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1232 ../../library/socket.rst:1246 +#: ../../library/socket.rst:1331 ../../library/socket.rst:1345 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1240 +#: ../../library/socket.rst:1339 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1253 +#: ../../library/socket.rst:1352 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1259 +#: ../../library/socket.rst:1358 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1261 +#: ../../library/socket.rst:1360 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1265 +#: ../../library/socket.rst:1364 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1272 +#: ../../library/socket.rst:1371 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1498,27 +1609,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1279 ../../library/socket.rst:1373 +#: ../../library/socket.rst:1378 ../../library/socket.rst:1472 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1282 ../../library/socket.rst:1511 -#: ../../library/socket.rst:1525 ../../library/socket.rst:1602 -#: ../../library/socket.rst:1675 ../../library/socket.rst:1694 -#: ../../library/socket.rst:1711 ../../library/socket.rst:1756 +#: ../../library/socket.rst:1381 ../../library/socket.rst:1610 +#: ../../library/socket.rst:1624 ../../library/socket.rst:1701 +#: ../../library/socket.rst:1774 ../../library/socket.rst:1793 +#: ../../library/socket.rst:1810 ../../library/socket.rst:1855 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1290 +#: ../../library/socket.rst:1389 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1304 +#: ../../library/socket.rst:1403 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1526,7 +1637,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1300 +#: ../../library/socket.rst:1399 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1535,20 +1646,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1306 +#: ../../library/socket.rst:1405 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1310 +#: ../../library/socket.rst:1409 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1316 +#: ../../library/socket.rst:1415 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1556,13 +1667,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1324 +#: ../../library/socket.rst:1423 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1327 +#: ../../library/socket.rst:1426 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1572,7 +1683,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1345 ../../library/socket.rst:1365 +#: ../../library/socket.rst:1444 ../../library/socket.rst:1464 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1580,7 +1691,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1336 +#: ../../library/socket.rst:1435 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1588,7 +1699,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1347 +#: ../../library/socket.rst:1446 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1598,38 +1709,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1360 +#: ../../library/socket.rst:1459 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1369 +#: ../../library/socket.rst:1468 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1381 +#: ../../library/socket.rst:1480 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1384 +#: ../../library/socket.rst:1483 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1390 +#: ../../library/socket.rst:1489 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1399 +#: ../../library/socket.rst:1498 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1637,14 +1748,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1506 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1414 +#: ../../library/socket.rst:1513 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1656,16 +1767,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1428 +#: ../../library/socket.rst:1527 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1431 +#: ../../library/socket.rst:1530 msgid "This is equivalent to checking ``socket.gettimeout() != 0``." msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" -#: ../../library/socket.rst:1438 +#: ../../library/socket.rst:1537 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1676,30 +1787,30 @@ msgstr "" msgid "platform" msgstr "平台" -#: ../../library/socket.rst:1445 +#: ../../library/socket.rst:1544 msgid "Windows" msgstr "Windows" -#: ../../library/socket.rst:1447 +#: ../../library/socket.rst:1546 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1452 +#: ../../library/socket.rst:1551 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1455 +#: ../../library/socket.rst:1554 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1463 +#: ../../library/socket.rst:1562 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1707,11 +1818,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1470 +#: ../../library/socket.rst:1569 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1479 +#: ../../library/socket.rst:1578 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1720,28 +1831,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1484 +#: ../../library/socket.rst:1583 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1488 +#: ../../library/socket.rst:1587 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1494 +#: ../../library/socket.rst:1593 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1501 +#: ../../library/socket.rst:1600 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1750,13 +1861,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1508 +#: ../../library/socket.rst:1607 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1519 +#: ../../library/socket.rst:1618 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1766,14 +1877,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1530 +#: ../../library/socket.rst:1629 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1537 +#: ../../library/socket.rst:1636 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1784,7 +1895,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1547 +#: ../../library/socket.rst:1646 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1799,7 +1910,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1561 +#: ../../library/socket.rst:1660 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1812,7 +1923,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1572 +#: ../../library/socket.rst:1671 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1821,7 +1932,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1579 +#: ../../library/socket.rst:1678 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1830,7 +1941,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1610 +#: ../../library/socket.rst:1709 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1843,7 +1954,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1621 +#: ../../library/socket.rst:1720 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1851,14 +1962,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1626 +#: ../../library/socket.rst:1725 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1649 +#: ../../library/socket.rst:1748 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1868,7 +1979,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1659 +#: ../../library/socket.rst:1758 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1877,7 +1988,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1668 +#: ../../library/socket.rst:1767 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1887,7 +1998,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1683 +#: ../../library/socket.rst:1782 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1897,13 +2008,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1690 +#: ../../library/socket.rst:1789 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1703 +#: ../../library/socket.rst:1802 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -1912,7 +2023,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1819 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -1920,7 +2031,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1719 +#: ../../library/socket.rst:1818 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -1940,18 +2051,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1739 +#: ../../library/socket.rst:1838 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1748 +#: ../../library/socket.rst:1847 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1763 +#: ../../library/socket.rst:1862 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -1959,14 +2070,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1763 +#: ../../library/socket.rst:1862 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1772 +#: ../../library/socket.rst:1871 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -1980,38 +2091,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1788 +#: ../../library/socket.rst:1887 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1796 +#: ../../library/socket.rst:1895 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1799 +#: ../../library/socket.rst:1898 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1801 +#: ../../library/socket.rst:1900 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1803 +#: ../../library/socket.rst:1902 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1805 +#: ../../library/socket.rst:1904 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1812 +#: ../../library/socket.rst:1911 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -2021,19 +2132,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1918 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1821 +#: ../../library/socket.rst:1920 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1834 +#: ../../library/socket.rst:1933 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -2046,11 +2157,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1946 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1855 +#: ../../library/socket.rst:1954 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2058,7 +2169,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1865 +#: ../../library/socket.rst:1964 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2069,48 +2180,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1877 +#: ../../library/socket.rst:1976 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1880 +#: ../../library/socket.rst:1979 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1886 +#: ../../library/socket.rst:1985 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1891 +#: ../../library/socket.rst:1990 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1896 +#: ../../library/socket.rst:1995 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:1903 +#: ../../library/socket.rst:2002 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:1905 +#: ../../library/socket.rst:2004 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:1909 +#: ../../library/socket.rst:2008 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:1912 +#: ../../library/socket.rst:2011 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2118,14 +2229,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:1917 +#: ../../library/socket.rst:2016 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:1922 +#: ../../library/socket.rst:2021 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2134,11 +2245,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:1929 +#: ../../library/socket.rst:2028 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:2030 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2148,24 +2259,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:1939 +#: ../../library/socket.rst:2038 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:1941 +#: ../../library/socket.rst:2040 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:1945 +#: ../../library/socket.rst:2044 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:1948 +#: ../../library/socket.rst:2047 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2173,11 +2284,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:1957 +#: ../../library/socket.rst:2056 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:1959 +#: ../../library/socket.rst:2058 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2190,14 +2301,14 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:1969 +#: ../../library/socket.rst:2068 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2000 +#: ../../library/socket.rst:2099 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2207,73 +2318,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2072 +#: ../../library/socket.rst:2171 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2097 +#: ../../library/socket.rst:2196 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2103 +#: ../../library/socket.rst:2202 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2107 +#: ../../library/socket.rst:2206 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2147 +#: ../../library/socket.rst:2246 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2152 +#: ../../library/socket.rst:2251 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2155 +#: ../../library/socket.rst:2254 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :data:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2162 +#: ../../library/socket.rst:2261 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2168 +#: ../../library/socket.rst:2267 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2170 +#: ../../library/socket.rst:2269 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2172 +#: ../../library/socket.rst:2271 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2175 +#: ../../library/socket.rst:2274 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2292,18 +2403,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1477 +#: ../../library/socket.rst:1576 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1477 +#: ../../library/socket.rst:1576 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1832 +#: ../../library/socket.rst:1931 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1832 +#: ../../library/socket.rst:1931 msgid "struct" msgstr "struct" diff --git a/library/socketserver.po b/library/socketserver.po index 27a6fe6247..b831e1929f 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -174,11 +174,17 @@ msgid "" "block_on_close` class attribute to opt-in for the pre-3.7 behaviour." msgstr "" -#: ../../library/socketserver.rst:144 +#: ../../library/socketserver.rst:148 msgid "These classes are pre-defined using the mix-in classes." msgstr "" -#: ../../library/socketserver.rst:147 +#: ../../library/socketserver.rst:150 +msgid "" +"The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes " +"were added." +msgstr "" + +#: ../../library/socketserver.rst:154 msgid "" "To implement a service, you must derive a class from :class:" "`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " @@ -189,7 +195,7 @@ msgid "" "`DatagramRequestHandler`." msgstr "" -#: ../../library/socketserver.rst:155 +#: ../../library/socketserver.rst:162 msgid "" "Of course, you still have to use your head! For instance, it makes no sense " "to use a forking server if the service contains state in memory that can be " @@ -199,7 +205,7 @@ msgid "" "probably have to use locks to protect the integrity of the shared data." msgstr "" -#: ../../library/socketserver.rst:162 +#: ../../library/socketserver.rst:169 msgid "" "On the other hand, if you are building an HTTP server where all data is " "stored externally (for instance, in the file system), a synchronous class " @@ -209,7 +215,7 @@ msgid "" "appropriate." msgstr "" -#: ../../library/socketserver.rst:168 +#: ../../library/socketserver.rst:175 msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " @@ -218,7 +224,7 @@ msgid "" "`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:173 +#: ../../library/socketserver.rst:180 msgid "" "Another approach to handling multiple simultaneous requests in an " "environment that supports neither threads nor :func:`~os.fork` (or where " @@ -227,15 +233,14 @@ msgid "" "decide which request to work on next (or whether to handle a new incoming " "request). This is particularly important for stream services where each " "client can potentially be connected for a long time (if threads or " -"subprocesses cannot be used). See :mod:`asyncore` for another way to manage " -"this." +"subprocesses cannot be used)." msgstr "" -#: ../../library/socketserver.rst:187 +#: ../../library/socketserver.rst:193 msgid "Server Objects" msgstr "" -#: ../../library/socketserver.rst:191 +#: ../../library/socketserver.rst:197 msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " @@ -243,14 +248,14 @@ msgid "" "`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" -#: ../../library/socketserver.rst:199 +#: ../../library/socketserver.rst:205 msgid "" "Return an integer file descriptor for the socket on which the server is " "listening. This function is most commonly passed to :mod:`selectors`, to " "allow monitoring multiple servers in the same process." msgstr "" -#: ../../library/socketserver.rst:206 +#: ../../library/socketserver.rst:212 msgid "" "Process a single request. This function calls the following methods in " "order: :meth:`get_request`, :meth:`verify_request`, and :meth:" @@ -261,7 +266,7 @@ msgid "" "`handle_request` will return." msgstr "" -#: ../../library/socketserver.rst:218 +#: ../../library/socketserver.rst:224 msgid "" "Handle requests until an explicit :meth:`shutdown` request. Poll for " "shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " @@ -271,41 +276,41 @@ msgid "" "clean up zombie child processes." msgstr "" -#: ../../library/socketserver.rst:226 +#: ../../library/socketserver.rst:232 msgid "Added ``service_actions`` call to the ``serve_forever`` method." msgstr "" -#: ../../library/socketserver.rst:232 +#: ../../library/socketserver.rst:238 msgid "" "This is called in the :meth:`serve_forever` loop. This method can be " "overridden by subclasses or mixin classes to perform actions specific to a " "given service, such as cleanup actions." msgstr "" -#: ../../library/socketserver.rst:240 +#: ../../library/socketserver.rst:246 msgid "" "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" "`shutdown` must be called while :meth:`serve_forever` is running in a " "different thread otherwise it will deadlock." msgstr "" -#: ../../library/socketserver.rst:247 +#: ../../library/socketserver.rst:253 msgid "Clean up the server. May be overridden." msgstr "" -#: ../../library/socketserver.rst:252 +#: ../../library/socketserver.rst:258 msgid "" "The family of protocols to which the server's socket belongs. Common " "examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." msgstr "" -#: ../../library/socketserver.rst:258 +#: ../../library/socketserver.rst:264 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:264 +#: ../../library/socketserver.rst:270 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -314,22 +319,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:273 +#: ../../library/socketserver.rst:279 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:276 +#: ../../library/socketserver.rst:282 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:282 +#: ../../library/socketserver.rst:288 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:288 +#: ../../library/socketserver.rst:294 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -338,40 +343,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:297 +#: ../../library/socketserver.rst:303 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:303 +#: ../../library/socketserver.rst:309 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:308 +#: ../../library/socketserver.rst:314 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:317 +#: ../../library/socketserver.rst:323 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:323 +#: ../../library/socketserver.rst:329 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:330 +#: ../../library/socketserver.rst:336 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -379,11 +384,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:335 +#: ../../library/socketserver.rst:341 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:342 +#: ../../library/socketserver.rst:348 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -392,7 +397,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:351 +#: ../../library/socketserver.rst:357 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -400,20 +405,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:363 +#: ../../library/socketserver.rst:369 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:370 +#: ../../library/socketserver.rst:376 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:376 +#: ../../library/socketserver.rst:382 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -421,17 +426,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:382 +#: ../../library/socketserver.rst:388 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:388 +#: ../../library/socketserver.rst:394 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:392 +#: ../../library/socketserver.rst:398 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -439,13 +444,13 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:401 +#: ../../library/socketserver.rst:407 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:407 +#: ../../library/socketserver.rst:413 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " @@ -454,21 +459,21 @@ msgid "" "attr:`self.server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:413 +#: ../../library/socketserver.rst:419 msgid "" "The type of :attr:`self.request` is different for datagram or stream " "services. For stream services, :attr:`self.request` is a socket object; for " "datagram services, :attr:`self.request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:420 +#: ../../library/socketserver.rst:426 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:428 +#: ../../library/socketserver.rst:434 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " @@ -480,32 +485,32 @@ msgid "" "BufferedIOBase` writable interface." msgstr "" -#: ../../library/socketserver.rst:437 +#: ../../library/socketserver.rst:443 msgid "" ":attr:`StreamRequestHandler.wfile` also supports the :class:`io." "BufferedIOBase` writable interface." msgstr "" -#: ../../library/socketserver.rst:443 +#: ../../library/socketserver.rst:449 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:446 +#: ../../library/socketserver.rst:452 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:448 ../../library/socketserver.rst:547 +#: ../../library/socketserver.rst:454 ../../library/socketserver.rst:553 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:478 +#: ../../library/socketserver.rst:484 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:493 +#: ../../library/socketserver.rst:499 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -513,47 +518,47 @@ msgid "" "has been sent from the client in one ``sendall()`` call." msgstr "" -#: ../../library/socketserver.rst:499 ../../library/socketserver.rst:571 +#: ../../library/socketserver.rst:505 ../../library/socketserver.rst:577 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:520 ../../library/socketserver.rst:646 +#: ../../library/socketserver.rst:526 ../../library/socketserver.rst:652 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:522 +#: ../../library/socketserver.rst:528 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:532 +#: ../../library/socketserver.rst:538 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:545 +#: ../../library/socketserver.rst:551 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:590 +#: ../../library/socketserver.rst:596 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:594 +#: ../../library/socketserver.rst:600 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:596 +#: ../../library/socketserver.rst:602 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:599 +#: ../../library/socketserver.rst:605 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:657 +#: ../../library/socketserver.rst:663 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/sqlite3.po b/library/sqlite3.po index 507125b3ae..ae3be07066 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-12 00:20+0000\n" +"POT-Creation-Date: 2023-07-19 00:54+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -236,7 +236,7 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:558 +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:625 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" @@ -257,7 +257,7 @@ msgstr "" msgid "Module functions" msgstr "" -#: ../../library/sqlite3.rst:264 +#: ../../library/sqlite3.rst:265 msgid "Open a connection to an SQLite database." msgstr "" @@ -265,14 +265,14 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/sqlite3.rst:266 +#: ../../library/sqlite3.rst:267 msgid "" "The path to the database file to be opened. You can pass ``\":memory:\"`` to " "create an `SQLite database existing only in memory `_, and open a connection to it." msgstr "" -#: ../../library/sqlite3.rst:273 +#: ../../library/sqlite3.rst:274 msgid "" "How many seconds the connection should wait before raising an :exc:" "`OperationalError` when a table is locked. If another connection opens a " @@ -280,7 +280,7 @@ msgid "" "transaction is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:280 +#: ../../library/sqlite3.rst:281 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -293,16 +293,17 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:294 +#: ../../library/sqlite3.rst:295 msgid "" -"The :attr:`~Connection.isolation_level` of the connection, controlling " -"whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " -"(default), ``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable " -"opening transactions implicitly. See :ref:`sqlite3-controlling-transactions` " -"for more." +"Control legacy transaction handling behaviour. See :attr:`Connection." +"isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " +"more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or " +"``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. " +"Has no effect unless :attr:`Connection.autocommit` is set to :data:`~sqlite3." +"LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" -#: ../../library/sqlite3.rst:302 +#: ../../library/sqlite3.rst:305 msgid "" "If ``True`` (default), :exc:`ProgrammingError` will be raised if the " "database connection is used by a thread other than the one that created it. " @@ -311,19 +312,19 @@ msgid "" "See :attr:`threadsafety` for more information." msgstr "" -#: ../../library/sqlite3.rst:311 +#: ../../library/sqlite3.rst:314 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:315 +#: ../../library/sqlite3.rst:318 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:320 +#: ../../library/sqlite3.rst:323 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -332,11 +333,20 @@ msgid "" "various :ref:`sqlite3-uri-tricks`." msgstr "" +#: ../../library/sqlite3.rst:332 +msgid "" +"Control :pep:`249` transaction handling behaviour. See :attr:`Connection." +"autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " +"information. *autocommit* currently defaults to :data:`~sqlite3." +"LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a " +"future Python release." +msgstr "" + #: ../../library/sqlite3.rst:0 msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:331 +#: ../../library/sqlite3.rst:343 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." @@ -344,7 +354,7 @@ msgstr "" "引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." "connect``。" -#: ../../library/sqlite3.rst:332 +#: ../../library/sqlite3.rst:344 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." @@ -352,20 +362,25 @@ msgstr "" "引發一個附帶引數 ``connection_handle`` 的\\ :ref:`稽核事件 ` " "``sqlite3.connect/handle``。" -#: ../../library/sqlite3.rst:334 +#: ../../library/sqlite3.rst:346 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:337 +#: ../../library/sqlite3.rst:349 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:340 +#: ../../library/sqlite3.rst:352 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "``sqlite3.connect/handle`` 稽核事件。" -#: ../../library/sqlite3.rst:345 +#: ../../library/sqlite3.rst:355 +#, fuzzy +msgid "The *autocommit* parameter." +msgstr "*uri* 參數。" + +#: ../../library/sqlite3.rst:360 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -373,18 +388,24 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:351 +#: ../../library/sqlite3.rst:366 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:360 +#: ../../library/sqlite3.rst:375 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:366 +#: ../../library/sqlite3.rst:379 +msgid "" +"See :func:`!runsource` in :source:`Lib/sqlite3/__main__.py` for real-world " +"use." +msgstr "" + +#: ../../library/sqlite3.rst:384 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -393,13 +414,13 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:373 +#: ../../library/sqlite3.rst:391 msgid "" "Register an :func:`unraisable hook handler ` for an " "improved debug experience:" msgstr "" -#: ../../library/sqlite3.rst:398 +#: ../../library/sqlite3.rst:417 msgid "" "Register an *adapter* :term:`callable` to adapt the Python type *type* into " "an SQLite type. The adapter is called with a Python object of type *type* as " @@ -407,7 +428,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:406 +#: ../../library/sqlite3.rst:425 msgid "" "Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -417,17 +438,24 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:414 +#: ../../library/sqlite3.rst:433 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:421 +#: ../../library/sqlite3.rst:440 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:425 +#: ../../library/sqlite3.rst:444 +msgid "" +"Set :attr:`~Connection.autocommit` to this constant to select old style (pre-" +"Python 3.12) transaction control behaviour. See :ref:`sqlite3-transaction-" +"control-isolation-level` for more information." +msgstr "" + +#: ../../library/sqlite3.rst:450 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -435,13 +463,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:435 +#: ../../library/sqlite3.rst:460 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:440 +#: ../../library/sqlite3.rst:465 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -450,61 +478,61 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:456 +#: ../../library/sqlite3.rst:481 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:463 +#: ../../library/sqlite3.rst:488 msgid "" "Flags that should be returned by the *authorizer_callback* :term:`callable` " "passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:466 +#: ../../library/sqlite3.rst:491 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:467 +#: ../../library/sqlite3.rst:492 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:468 +#: ../../library/sqlite3.rst:493 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:472 +#: ../../library/sqlite3.rst:497 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:477 +#: ../../library/sqlite3.rst:502 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:483 +#: ../../library/sqlite3.rst:508 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: ../../library/sqlite3.rst:487 +#: ../../library/sqlite3.rst:512 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:491 +#: ../../library/sqlite3.rst:516 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:496 +#: ../../library/sqlite3.rst:521 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -512,154 +540,181 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:501 +#: ../../library/sqlite3.rst:526 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:503 +#: ../../library/sqlite3.rst:528 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:506 +#: ../../library/sqlite3.rst:531 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:509 +#: ../../library/sqlite3.rst:534 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:538 msgid "SQLite threading mode" msgstr "" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:538 msgid "`threadsafety`_" msgstr "`threadsafety`_" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:538 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:513 +#: ../../library/sqlite3.rst:538 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:516 +#: ../../library/sqlite3.rst:541 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:516 +#: ../../library/sqlite3.rst:541 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:516 +#: ../../library/sqlite3.rst:541 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:519 +#: ../../library/sqlite3.rst:544 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:519 ../../library/sqlite3.rst:522 +#: ../../library/sqlite3.rst:544 ../../library/sqlite3.rst:547 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:519 +#: ../../library/sqlite3.rst:544 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:519 +#: ../../library/sqlite3.rst:544 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:522 +#: ../../library/sqlite3.rst:547 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:522 +#: ../../library/sqlite3.rst:547 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:522 +#: ../../library/sqlite3.rst:547 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:529 +#: ../../library/sqlite3.rst:554 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:534 +#: ../../library/sqlite3.rst:559 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:539 +#: ../../library/sqlite3.rst:565 ../../library/sqlite3.rst:575 +msgid "" +"This constant used to reflect the version number of the ``pysqlite`` " +"package, a third-party library which used to upstream changes to :mod:`!" +"sqlite3`. Today, it carries no meaning or practical value." +msgstr "" + +#: ../../library/sqlite3.rst:569 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:546 +#: ../../library/sqlite3.rst:596 +msgid "" +"These constants are used for the :meth:`Connection.setconfig` and :meth:" +"`~Connection.getconfig` methods." +msgstr "" + +#: ../../library/sqlite3.rst:599 +msgid "" +"The availability of these constants varies depending on the version of " +"SQLite Python was compiled with." +msgstr "" + +#: ../../library/sqlite3.rst:606 +msgid "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" +msgstr "" + +#: ../../library/sqlite3.rst:607 +msgid "SQLite docs: Database Connection Configuration Options" +msgstr "" + +#: ../../library/sqlite3.rst:613 msgid "Connection objects" msgstr "" -#: ../../library/sqlite3.rst:550 +#: ../../library/sqlite3.rst:617 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " "is created using :func:`sqlite3.connect`. Their main purpose is creating :" "class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" -#: ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:624 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:560 +#: ../../library/sqlite3.rst:627 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:564 +#: ../../library/sqlite3.rst:631 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a :term:" "`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:571 +#: ../../library/sqlite3.rst:638 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:574 +#: ../../library/sqlite3.rst:641 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:577 +#: ../../library/sqlite3.rst:644 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:580 +#: ../../library/sqlite3.rst:647 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:583 +#: ../../library/sqlite3.rst:650 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:588 +#: ../../library/sqlite3.rst:655 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -668,111 +723,117 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:592 +#: ../../library/sqlite3.rst:659 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:599 +#: ../../library/sqlite3.rst:666 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:606 +#: ../../library/sqlite3.rst:673 msgid "" -"Commit any pending transaction to the database. If there is no open " -"transaction, this method is a no-op." +"Commit any pending transaction to the database. If :attr:`autocommit` is " +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was committed by this method." msgstr "" -#: ../../library/sqlite3.rst:611 +#: ../../library/sqlite3.rst:681 msgid "" -"Roll back to the start of any pending transaction. If there is no open " -"transaction, this method is a no-op." +"Roll back to the start of any pending transaction. If :attr:`autocommit` is " +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was rolled back by this method." msgstr "" -#: ../../library/sqlite3.rst:616 +#: ../../library/sqlite3.rst:689 msgid "" -"Close the database connection. Any pending transaction is not committed " -"implicitly; make sure to :meth:`commit` before closing to avoid losing " -"pending changes." +"Close the database connection. If :attr:`autocommit` is ``False``, any " +"pending transaction is implicitly rolled back. If :attr:`!autocommit` is " +"``True`` or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction " +"control is executed. Make sure to :meth:`commit` before closing to avoid " +"losing pending changes." msgstr "" -#: ../../library/sqlite3.rst:623 +#: ../../library/sqlite3.rst:699 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:629 +#: ../../library/sqlite3.rst:705 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:635 +#: ../../library/sqlite3.rst:711 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:641 +#: ../../library/sqlite3.rst:717 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:643 +#: ../../library/sqlite3.rst:719 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:646 +#: ../../library/sqlite3.rst:722 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:650 +#: ../../library/sqlite3.rst:726 msgid "" "A :term:`callable` that is called when the SQL function is invoked. The " "callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:657 +#: ../../library/sqlite3.rst:733 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:662 +#: ../../library/sqlite3.rst:738 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:665 +#: ../../library/sqlite3.rst:741 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:668 ../../library/sqlite3.rst:706 -#: ../../library/sqlite3.rst:769 ../../library/sqlite3.rst:1021 -#: ../../library/sqlite3.rst:1258 ../../library/sqlite3.rst:1385 -#: ../../library/sqlite3.rst:1413 +#: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:782 +#: ../../library/sqlite3.rst:845 ../../library/sqlite3.rst:1115 +#: ../../library/sqlite3.rst:1415 ../../library/sqlite3.rst:1552 +#: ../../library/sqlite3.rst:1591 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:684 +#: ../../library/sqlite3.rst:760 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:686 +#: ../../library/sqlite3.rst:762 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:689 +#: ../../library/sqlite3.rst:765 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:693 +#: ../../library/sqlite3.rst:769 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -781,45 +842,45 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:694 +#: ../../library/sqlite3.rst:770 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:696 +#: ../../library/sqlite3.rst:772 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:697 ../../library/sqlite3.rst:753 +#: ../../library/sqlite3.rst:773 ../../library/sqlite3.rst:829 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:700 +#: ../../library/sqlite3.rst:776 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:703 +#: ../../library/sqlite3.rst:779 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:738 +#: ../../library/sqlite3.rst:814 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:740 +#: ../../library/sqlite3.rst:816 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:743 +#: ../../library/sqlite3.rst:819 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:823 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -831,79 +892,79 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:748 +#: ../../library/sqlite3.rst:824 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:750 +#: ../../library/sqlite3.rst:826 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:827 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:828 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:756 +#: ../../library/sqlite3.rst:832 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:759 +#: ../../library/sqlite3.rst:835 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:761 +#: ../../library/sqlite3.rst:837 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:900 msgid "" "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:828 +#: ../../library/sqlite3.rst:904 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:905 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:830 +#: ../../library/sqlite3.rst:906 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:908 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:860 +#: ../../library/sqlite3.rst:936 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:862 +#: ../../library/sqlite3.rst:938 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:869 +#: ../../library/sqlite3.rst:945 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an :exc:" "`OperationalError`." msgstr "" -#: ../../library/sqlite3.rst:876 +#: ../../library/sqlite3.rst:952 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " @@ -912,7 +973,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:883 +#: ../../library/sqlite3.rst:959 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 ``None`` " @@ -922,7 +983,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:890 +#: ../../library/sqlite3.rst:966 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 " @@ -930,15 +991,15 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:894 +#: ../../library/sqlite3.rst:970 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:896 +#: ../../library/sqlite3.rst:972 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:902 +#: ../../library/sqlite3.rst:978 msgid "" "Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -946,26 +1007,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:907 +#: ../../library/sqlite3.rst:983 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:910 +#: ../../library/sqlite3.rst:986 msgid "" "Returning a non-zero value from the handler function will terminate the " -"currently executing query and cause it to raise an :exc:`OperationalError` " +"currently executing query and cause it to raise a :exc:`DatabaseError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:917 +#: ../../library/sqlite3.rst:993 msgid "" "Register :term:`callable` *trace_callback* to be invoked for each SQL " "statement that is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:920 +#: ../../library/sqlite3.rst:996 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 " @@ -975,18 +1036,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:928 +#: ../../library/sqlite3.rst:1004 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:931 +#: ../../library/sqlite3.rst:1007 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:941 +#: ../../library/sqlite3.rst:1017 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -995,7 +1056,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:950 +#: ../../library/sqlite3.rst:1026 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1004,7 +1065,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:957 +#: ../../library/sqlite3.rst:1033 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1012,18 +1073,28 @@ msgstr "" "引發一個附帶引數 ``connection``、``enabled`` 的\\ :ref:`稽核事件 ` " "``sqlite3.enable_load_extension``。" -#: ../../library/sqlite3.rst:961 +#: ../../library/sqlite3.rst:1037 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "加入 ``sqlite3.enable_load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1004 +#: ../../library/sqlite3.rst:1080 +msgid "" +"Load an SQLite extension from a shared library. Enable extension loading " +"with :meth:`enable_load_extension` before calling this method." +msgstr "" + +#: ../../library/sqlite3.rst:1084 +msgid "The path to the SQLite extension." +msgstr "" + +#: ../../library/sqlite3.rst:1088 msgid "" -"Load an SQLite extension from a shared library located at *path*. Enable " -"extension loading with :meth:`enable_load_extension` before calling this " -"method." +"Entry point name. If ``None`` (the default), SQLite will come up with an " +"entry point name of its own; see the SQLite docs `Loading an Extension`_ for " +"details." msgstr "" -#: ../../library/sqlite3.rst:1008 +#: ../../library/sqlite3.rst:1097 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." @@ -1031,38 +1102,43 @@ msgstr "" "引發一個附帶引數 ``connection``、``path`` 的\\ :ref:`稽核事件 ` " "``sqlite3.load_extension``。" -#: ../../library/sqlite3.rst:1012 +#: ../../library/sqlite3.rst:1101 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1017 +#: ../../library/sqlite3.rst:1104 +#, fuzzy +msgid "The *entrypoint* parameter." +msgstr "*uri* 參數。" + +#: ../../library/sqlite3.rst:1111 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1035 +#: ../../library/sqlite3.rst:1129 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1037 +#: ../../library/sqlite3.rst:1131 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1040 +#: ../../library/sqlite3.rst:1134 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1043 +#: ../../library/sqlite3.rst:1137 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1049 +#: ../../library/sqlite3.rst:1143 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1070,46 +1146,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1058 +#: ../../library/sqlite3.rst:1152 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1065 +#: ../../library/sqlite3.rst:1159 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1069 +#: ../../library/sqlite3.rst:1163 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1088 +#: ../../library/sqlite3.rst:1182 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1100 +#: ../../library/sqlite3.rst:1194 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1102 +#: ../../library/sqlite3.rst:1196 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1107 ../../library/sqlite3.rst:1144 +#: ../../library/sqlite3.rst:1201 ../../library/sqlite3.rst:1238 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1110 +#: ../../library/sqlite3.rst:1204 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1130 +#: ../../library/sqlite3.rst:1224 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1117,22 +1193,40 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1229 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1138 +#: ../../library/sqlite3.rst:1232 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1147 +#: ../../library/sqlite3.rst:1241 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1164 +#: ../../library/sqlite3.rst:1258 +msgid "Query a boolean connection configuration option." +msgstr "" + +#: ../../library/sqlite3.rst:1260 ../../library/sqlite3.rst:1271 +msgid "A :ref:`SQLITE_DBCONFIG code `." +msgstr "" + +#: ../../library/sqlite3.rst:1269 +msgid "Set a boolean connection configuration option." +msgstr "" + +#: ../../library/sqlite3.rst:1274 +msgid "" +"``True`` if the configuration option should be enabled (default); ``False`` " +"if it should be disabled." +msgstr "" + +#: ../../library/sqlite3.rst:1282 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1141,17 +1235,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1170 +#: ../../library/sqlite3.rst:1288 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1178 +#: ../../library/sqlite3.rst:1296 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1186 +#: ../../library/sqlite3.rst:1304 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1159,63 +1253,120 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1192 +#: ../../library/sqlite3.rst:1310 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1195 +#: ../../library/sqlite3.rst:1313 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1199 +#: ../../library/sqlite3.rst:1317 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1203 +#: ../../library/sqlite3.rst:1321 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1206 +#: ../../library/sqlite3.rst:1324 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1211 +#: ../../library/sqlite3.rst:1329 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1218 +#: ../../library/sqlite3.rst:1336 +msgid "" +"This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" +"autocommit` has three allowed values:" +msgstr "" + +#: ../../library/sqlite3.rst:1339 +msgid "" +"``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" +"mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" +"meth:`rollback` to close transactions." +msgstr "" + +#: ../../library/sqlite3.rst:1343 +msgid "This is the recommended value of :attr:`!autocommit`." +msgstr "" + +#: ../../library/sqlite3.rst:1345 +msgid "" +"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" +"`rollback` have no effect in this mode." +msgstr "" + +#: ../../library/sqlite3.rst:1348 +msgid "" +":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" +"compliant) transaction control. See :attr:`isolation_level` for more details." +msgstr "" + +#: ../../library/sqlite3.rst:1352 +msgid "This is currently the default value of :attr:`!autocommit`." +msgstr "" + +#: ../../library/sqlite3.rst:1354 +msgid "" +"Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " +"changing it to ``True`` will commit any pending transaction." +msgstr "" + +#: ../../library/sqlite3.rst:1357 +msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." +msgstr "" + +#: ../../library/sqlite3.rst:1361 +msgid "" +"The :attr:`isolation_level` attribute has no effect unless :attr:" +"`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." +msgstr "" + +#: ../../library/sqlite3.rst:1368 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1221 +#: ../../library/sqlite3.rst:1371 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1228 +#: ../../library/sqlite3.rst:1378 msgid "" -"This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " +"Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " "transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, " "``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying " -"`SQLite transaction behaviour`_, implicit :ref:`transaction management " -"` is performed." +"`SQLite transaction behaviour`_, :ref:`implicit transaction management " +"` is performed." msgstr "" -#: ../../library/sqlite3.rst:1236 +#: ../../library/sqlite3.rst:1386 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1241 +#: ../../library/sqlite3.rst:1391 +msgid "" +"Using :attr:`autocommit` to control transaction handling is recommended over " +"using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " +"unless :attr:`autocommit` is set to :data:`LEGACY_TRANSACTION_CONTROL` (the " +"default)." +msgstr "" + +#: ../../library/sqlite3.rst:1398 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1224,12 +1375,12 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1248 ../../library/sqlite3.rst:1540 -#: ../../library/sqlite3.rst:1563 +#: ../../library/sqlite3.rst:1405 ../../library/sqlite3.rst:1718 +#: ../../library/sqlite3.rst:1741 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1252 +#: ../../library/sqlite3.rst:1409 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " @@ -1237,17 +1388,17 @@ msgid "" "If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1292 +#: ../../library/sqlite3.rst:1449 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1299 +#: ../../library/sqlite3.rst:1456 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1301 +#: ../../library/sqlite3.rst:1458 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1255,108 +1406,125 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1308 +#: ../../library/sqlite3.rst:1465 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1333 +#: ../../library/sqlite3.rst:1490 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1340 +#: ../../library/sqlite3.rst:1497 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1344 +#: ../../library/sqlite3.rst:1501 msgid "A single SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1347 +#: ../../library/sqlite3.rst:1504 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1511 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1514 +msgid "" +"If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" +"attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " +"``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open " +"transaction, a transaction is implicitly opened before executing *sql*." +msgstr "" + +#: ../../library/sqlite3.rst:1523 msgid "" -"If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " -"``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " -"no open transaction, a transaction is implicitly opened before executing " -"*sql*." +":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" +"`dict`. Starting with Python 3.14, :exc:`ProgrammingError` will be raised " +"instead." msgstr "" -#: ../../library/sqlite3.rst:1362 +#: ../../library/sqlite3.rst:1529 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1366 +#: ../../library/sqlite3.rst:1533 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1370 +#: ../../library/sqlite3.rst:1537 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1372 +#: ../../library/sqlite3.rst:1539 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1375 +#: ../../library/sqlite3.rst:1542 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1381 +#: ../../library/sqlite3.rst:1548 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statment." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1565 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1405 +#: ../../library/sqlite3.rst:1572 msgid "" -"Execute the SQL statements in *sql_script*. If there is a pending " +":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " +"of :class:`dict`\\s. Starting with Python 3.14, :exc:`ProgrammingError` will " +"be raised instead." +msgstr "" + +#: ../../library/sqlite3.rst:1581 +msgid "" +"Execute the SQL statements in *sql_script*. If the :attr:`~Connection." +"autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " "implicit transaction control is performed; any transaction control must be " "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1411 +#: ../../library/sqlite3.rst:1589 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1429 +#: ../../library/sqlite3.rst:1607 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1437 +#: ../../library/sqlite3.rst:1615 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1440 +#: ../../library/sqlite3.rst:1618 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1364,7 +1532,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1446 +#: ../../library/sqlite3.rst:1624 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1372,36 +1540,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1453 +#: ../../library/sqlite3.rst:1631 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1460 +#: ../../library/sqlite3.rst:1638 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1462 +#: ../../library/sqlite3.rst:1640 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:1467 ../../library/sqlite3.rst:1471 +#: ../../library/sqlite3.rst:1645 ../../library/sqlite3.rst:1649 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1475 +#: ../../library/sqlite3.rst:1653 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:1480 +#: ../../library/sqlite3.rst:1658 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1409,18 +1577,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1494 +#: ../../library/sqlite3.rst:1672 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1498 +#: ../../library/sqlite3.rst:1676 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1502 +#: ../../library/sqlite3.rst:1680 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1430,15 +1598,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1510 +#: ../../library/sqlite3.rst:1688 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1512 +#: ../../library/sqlite3.rst:1690 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1517 +#: ../../library/sqlite3.rst:1695 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1448,7 +1616,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1528 +#: ../../library/sqlite3.rst:1706 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1457,18 +1625,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1535 +#: ../../library/sqlite3.rst:1713 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1551 +#: ../../library/sqlite3.rst:1729 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1555 +#: ../../library/sqlite3.rst:1733 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1476,28 +1644,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1560 +#: ../../library/sqlite3.rst:1738 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1567 +#: ../../library/sqlite3.rst:1745 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1571 +#: ../../library/sqlite3.rst:1749 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1578 +#: ../../library/sqlite3.rst:1756 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1584 +#: ../../library/sqlite3.rst:1762 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1505,24 +1673,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1589 +#: ../../library/sqlite3.rst:1767 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1619 +#: ../../library/sqlite3.rst:1797 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1621 +#: ../../library/sqlite3.rst:1799 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1627 +#: ../../library/sqlite3.rst:1805 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1530,18 +1698,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1635 +#: ../../library/sqlite3.rst:1813 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1641 +#: ../../library/sqlite3.rst:1819 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1645 +#: ../../library/sqlite3.rst:1823 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1549,26 +1717,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1653 +#: ../../library/sqlite3.rst:1831 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1657 +#: ../../library/sqlite3.rst:1835 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1665 +#: ../../library/sqlite3.rst:1843 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1667 +#: ../../library/sqlite3.rst:1845 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1671 +#: ../../library/sqlite3.rst:1849 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1576,39 +1744,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1678 +#: ../../library/sqlite3.rst:1856 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1682 +#: ../../library/sqlite3.rst:1860 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1687 +#: ../../library/sqlite3.rst:1865 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1694 +#: ../../library/sqlite3.rst:1872 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1701 +#: ../../library/sqlite3.rst:1879 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1708 +#: ../../library/sqlite3.rst:1886 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1616,14 +1784,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1715 +#: ../../library/sqlite3.rst:1893 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1721 +#: ../../library/sqlite3.rst:1899 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1631,20 +1799,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1907 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:1734 +#: ../../library/sqlite3.rst:1912 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1919 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1652,7 +1820,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1748 +#: ../../library/sqlite3.rst:1926 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1661,78 +1829,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1758 +#: ../../library/sqlite3.rst:1936 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1760 +#: ../../library/sqlite3.rst:1938 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1763 +#: ../../library/sqlite3.rst:1941 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 +#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1774 +#: ../../library/sqlite3.rst:1952 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1791 +#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 +#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 +#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1780 +#: ../../library/sqlite3.rst:1958 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1791 +#: ../../library/sqlite3.rst:1969 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1975 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1741,42 +1909,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1807 -msgid "Default adapters and converters" +#: ../../library/sqlite3.rst:1985 +msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1809 +#: ../../library/sqlite3.rst:1989 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." +"The default adapters and converters are deprecated as of Python 3.12. " +"Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " +"your needs." msgstr "" -#: ../../library/sqlite3.rst:1812 +#: ../../library/sqlite3.rst:1993 +msgid "The deprecated default adapters and converters consist of:" +msgstr "" + +#: ../../library/sqlite3.rst:1995 msgid "" -"The default converters are registered under the name \"date\" for :class:" -"`datetime.date` and under the name \"timestamp\" for :class:`datetime." -"datetime`." +"An adapter for :class:`datetime.date` objects to :class:`strings ` in " +"`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1816 +#: ../../library/sqlite3.rst:1997 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." +"An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " +"format." msgstr "" -#: ../../library/sqlite3.rst:1820 -msgid "The following example demonstrates this." +#: ../../library/sqlite3.rst:1999 +msgid "" +"A converter for :ref:`declared ` \"date\" types to :" +"class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:1824 +#: ../../library/sqlite3.rst:2001 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." +"A converter for declared \"timestamp\" types to :class:`datetime.datetime` " +"objects. Fractional parts will be truncated to 6 digits (microsecond " +"precision)." msgstr "" -#: ../../library/sqlite3.rst:1830 +#: ../../library/sqlite3.rst:2007 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1784,15 +1957,38 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1839 +#: ../../library/sqlite3.rst:2020 +msgid "Command-line interface" +msgstr "" + +#: ../../library/sqlite3.rst:2022 +msgid "" +"The :mod:`!sqlite3` module can be invoked as a script, using the " +"interpreter's :option:`-m` switch, in order to provide a simple SQLite " +"shell. The argument signature is as follows::" +msgstr "" + +#: ../../library/sqlite3.rst:2029 +msgid "Type ``.quit`` or CTRL-D to exit the shell." +msgstr "" + +#: ../../library/sqlite3.rst:2035 +msgid "Print CLI help." +msgstr "" + +#: ../../library/sqlite3.rst:2039 +msgid "Print underlying SQLite library version." +msgstr "" + +#: ../../library/sqlite3.rst:2047 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1844 +#: ../../library/sqlite3.rst:2052 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1846 +#: ../../library/sqlite3.rst:2054 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1800,7 +1996,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1859 +#: ../../library/sqlite3.rst:2067 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1808,35 +2004,35 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1864 +#: ../../library/sqlite3.rst:2072 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " "*parameters* must be a :term:`sequence` whose length must match the number " "of placeholders, or a :exc:`ProgrammingError` is raised. For the named " -"style, *parameters* should be an instance of a :class:`dict` (or a " -"subclass), which must contain keys for all named parameters; any extra items " -"are ignored. Here's an example of both styles:" +"style, *parameters* must be an instance of a :class:`dict` (or a subclass), " +"which must contain keys for all named parameters; any extra items are " +"ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1901 +#: ../../library/sqlite3.rst:2109 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1908 +#: ../../library/sqlite3.rst:2116 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1910 +#: ../../library/sqlite3.rst:2118 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1914 +#: ../../library/sqlite3.rst:2122 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1846,11 +2042,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:2134 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1928 +#: ../../library/sqlite3.rst:2136 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1860,84 +2056,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1959 +#: ../../library/sqlite3.rst:2167 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:2169 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1991 +#: ../../library/sqlite3.rst:2199 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:2201 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1998 +#: ../../library/sqlite3.rst:2206 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:2001 +#: ../../library/sqlite3.rst:2209 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:2006 +#: ../../library/sqlite3.rst:2214 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2015 +#: ../../library/sqlite3.rst:2223 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2019 +#: ../../library/sqlite3.rst:2227 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:2228 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2021 +#: ../../library/sqlite3.rst:2229 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2025 +#: ../../library/sqlite3.rst:2233 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2076 +#: ../../library/sqlite3.rst:2284 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2078 +#: ../../library/sqlite3.rst:2286 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2140 +#: ../../library/sqlite3.rst:2348 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2142 +#: ../../library/sqlite3.rst:2350 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1949,72 +2145,75 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2183 +#: ../../library/sqlite3.rst:2391 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2185 +#: ../../library/sqlite3.rst:2393 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " "of the context manager. If the body of the :keyword:`with` statement " "finishes without exceptions, the transaction is committed. If this commit " "fails, or if the body of the ``with`` statement raises an uncaught " -"exception, the transaction is rolled back." +"exception, the transaction is rolled back. If :attr:`~Connection.autocommit` " +"is ``False``, a new transaction is implicitly opened after committing or " +"rolling back." msgstr "" -#: ../../library/sqlite3.rst:2194 +#: ../../library/sqlite3.rst:2404 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " -"statement, the context manager is a no-op." +"statement, or if :attr:`~Connection.autocommit` is ``True``, the context " +"manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2410 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2232 +#: ../../library/sqlite3.rst:2443 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2234 +#: ../../library/sqlite3.rst:2445 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2236 +#: ../../library/sqlite3.rst:2447 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2245 +#: ../../library/sqlite3.rst:2456 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2255 +#: ../../library/sqlite3.rst:2466 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2269 +#: ../../library/sqlite3.rst:2480 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2278 +#: ../../library/sqlite3.rst:2489 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2280 +#: ../../library/sqlite3.rst:2491 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2285 +#: ../../library/sqlite3.rst:2496 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2022,7 +2221,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2290 +#: ../../library/sqlite3.rst:2501 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2030,11 +2229,11 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2300 +#: ../../library/sqlite3.rst:2511 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2317 +#: ../../library/sqlite3.rst:2528 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -2042,47 +2241,124 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2322 +#: ../../library/sqlite3.rst:2533 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2331 +#: ../../library/sqlite3.rst:2542 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2341 +#: ../../library/sqlite3.rst:2552 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2352 +#: ../../library/sqlite3.rst:2563 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2367 +#: ../../library/sqlite3.rst:2578 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2375 +#: ../../library/sqlite3.rst:2586 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2380 +#: ../../library/sqlite3.rst:2592 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2382 +#: ../../library/sqlite3.rst:2594 msgid "" -"The :mod:`!sqlite3` module does not adhere to the transaction handling " -"recommended by :pep:`249`." +":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " +"database transactions are opened and closed. :ref:`sqlite3-transaction-" +"control-autocommit` is recommended, while :ref:`sqlite3-transaction-control-" +"isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2385 +#: ../../library/sqlite3.rst:2603 +msgid "Transaction control via the ``autocommit`` attribute" +msgstr "" + +#: ../../library/sqlite3.rst:2605 +msgid "" +"The recommended way of controlling transaction behaviour is through the :" +"attr:`Connection.autocommit` attribute, which should preferably be set using " +"the *autocommit* parameter of :func:`connect`." +msgstr "" + +#: ../../library/sqlite3.rst:2610 +msgid "" +"It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" +"compliant transaction control. This means:" +msgstr "" + +#: ../../library/sqlite3.rst:2614 +msgid "" +":mod:`!sqlite3` ensures that a transaction is always open, so :func:" +"`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " +"implicitly open a new transaction (immediately after closing the pending " +"one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements " +"when opening transactions." +msgstr "" + +#: ../../library/sqlite3.rst:2619 +msgid "Transactions should be committed explicitly using :meth:`!commit`." +msgstr "" + +#: ../../library/sqlite3.rst:2620 +msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." +msgstr "" + +#: ../../library/sqlite3.rst:2621 +msgid "" +"An implicit rollback is performed if the database is :meth:`~Connection." +"close`-ed with pending changes." +msgstr "" + +#: ../../library/sqlite3.rst:2624 +msgid "" +"Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " +"mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " +"effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-" +"compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection." +"in_transaction` to query the low-level SQLite autocommit mode." +msgstr "" + +#: ../../library/sqlite3.rst:2632 +msgid "" +"Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " +"control behaviour to the :attr:`Connection.isolation_level` attribute. See :" +"ref:`sqlite3-transaction-control-isolation-level` for more information." +msgstr "" + +#: ../../library/sqlite3.rst:2641 +msgid "Transaction control via the ``isolation_level`` attribute" +msgstr "" + +#: ../../library/sqlite3.rst:2645 +msgid "" +"The recommended way of controlling transactions is via the :attr:" +"`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" +"autocommit`." +msgstr "" + +#: ../../library/sqlite3.rst:2649 +msgid "" +"If :attr:`Connection.autocommit` is set to :data:" +"`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " +"controlled using the :attr:`Connection.isolation_level` attribute. " +"Otherwise, :attr:`!isolation_level` has no effect." +msgstr "" + +#: ../../library/sqlite3.rst:2655 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2096,7 +2372,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2398 +#: ../../library/sqlite3.rst:2668 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2106,27 +2382,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2406 +#: ../../library/sqlite3.rst:2676 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2410 +#: ../../library/sqlite3.rst:2680 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:2684 +msgid "" +"The recommended way of controlling transactions is now via the :attr:" +"`~Connection.autocommit` attribute." +msgstr "" + +#: ../../library/sqlite3.rst:1492 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1335 ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1492 ../../library/sqlite3.rst:1493 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1493 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/ssl.po b/library/ssl.po index 9d5fb2306a..ee63453ce8 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,37 +117,34 @@ msgstr "" #: ../../library/ssl.rst:77 msgid "" -"Since Python 3.2 and 2.7.9, it is recommended to use the :meth:`SSLContext." -"wrap_socket` of an :class:`SSLContext` instance to wrap sockets as :class:" -"`SSLSocket` objects. The helper functions :func:`create_default_context` " -"returns a new context with secure default settings. The old :func:" -"`wrap_socket` function is deprecated since it is both inefficient and has no " -"support for server name indication (SNI) and hostname matching." +"Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." +"wrap_socket` method. The helper function :func:`create_default_context` " +"returns a new context with secure default settings." msgstr "" -#: ../../library/ssl.rst:85 +#: ../../library/ssl.rst:82 msgid "Client socket example with default context and IPv4/IPv6 dual stack::" msgstr "" -#: ../../library/ssl.rst:98 +#: ../../library/ssl.rst:95 msgid "Client socket example with custom context and IPv4::" msgstr "" -#: ../../library/ssl.rst:110 +#: ../../library/ssl.rst:107 msgid "Server socket example listening on localhost IPv4::" msgstr "" -#: ../../library/ssl.rst:124 +#: ../../library/ssl.rst:121 msgid "Context creation" msgstr "" -#: ../../library/ssl.rst:126 +#: ../../library/ssl.rst:123 msgid "" "A convenience function helps create :class:`SSLContext` objects for common " "purposes." msgstr "" -#: ../../library/ssl.rst:131 +#: ../../library/ssl.rst:128 msgid "" "Return a new :class:`SSLContext` object with default settings for the given " "*purpose*. The settings are chosen by the :mod:`ssl` module, and usually " @@ -155,7 +152,7 @@ msgid "" "constructor directly." msgstr "" -#: ../../library/ssl.rst:136 +#: ../../library/ssl.rst:133 msgid "" "*cafile*, *capath*, *cadata* represent optional CA certificates to trust for " "certificate verification, as in :meth:`SSLContext.load_verify_locations`. " @@ -163,7 +160,7 @@ msgid "" "system's default CA certificates instead." msgstr "" -#: ../../library/ssl.rst:142 +#: ../../library/ssl.rst:139 msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " @@ -175,27 +172,27 @@ msgid "" "certificates." msgstr "" -#: ../../library/ssl.rst:151 +#: ../../library/ssl.rst:148 msgid "" "When :attr:`~SSLContext.keylog_filename` is supported and the environment " "variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " "enables key logging." msgstr "" -#: ../../library/ssl.rst:156 +#: ../../library/ssl.rst:153 msgid "" "The protocol, options, cipher and other settings may change to more " "restrictive values anytime without prior deprecation. The values represent " "a fair balance between compatibility and security." msgstr "" -#: ../../library/ssl.rst:160 +#: ../../library/ssl.rst:157 msgid "" "If your application needs specific settings, you should create a :class:" "`SSLContext` and apply the settings yourself." msgstr "" -#: ../../library/ssl.rst:164 +#: ../../library/ssl.rst:161 msgid "" "If you find that when certain older clients or servers attempt to connect " "with a :class:`SSLContext` created by this function that they get an error " @@ -206,33 +203,33 @@ msgid "" "still allow SSL 3.0 connections you can re-enable them using::" msgstr "" -#: ../../library/ssl.rst:180 +#: ../../library/ssl.rst:177 msgid "RC4 was dropped from the default cipher string." msgstr "" -#: ../../library/ssl.rst:184 +#: ../../library/ssl.rst:181 msgid "ChaCha20/Poly1305 was added to the default cipher string." msgstr "" -#: ../../library/ssl.rst:186 +#: ../../library/ssl.rst:183 msgid "3DES was dropped from the default cipher string." msgstr "" -#: ../../library/ssl.rst:190 +#: ../../library/ssl.rst:187 msgid "Support for key logging to :envvar:`SSLKEYLOGFILE` was added." msgstr "" -#: ../../library/ssl.rst:194 +#: ../../library/ssl.rst:191 msgid "" "The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." msgstr "" -#: ../../library/ssl.rst:200 +#: ../../library/ssl.rst:197 msgid "Exceptions" msgstr "例外" -#: ../../library/ssl.rst:204 +#: ../../library/ssl.rst:201 msgid "" "Raised to signal an error from the underlying SSL implementation (currently " "provided by the OpenSSL library). This signifies some problem in the higher-" @@ -242,85 +239,85 @@ msgid "" "OpenSSL library." msgstr "" -#: ../../library/ssl.rst:211 +#: ../../library/ssl.rst:208 msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." msgstr "" -#: ../../library/ssl.rst:216 +#: ../../library/ssl.rst:213 msgid "" "A string mnemonic designating the OpenSSL submodule in which the error " "occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible " "values depends on the OpenSSL version." msgstr "" -#: ../../library/ssl.rst:224 +#: ../../library/ssl.rst:221 msgid "" "A string mnemonic designating the reason this error occurred, for example " "``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the " "OpenSSL version." msgstr "" -#: ../../library/ssl.rst:232 +#: ../../library/ssl.rst:229 msgid "" "A subclass of :exc:`SSLError` raised when trying to read or write and the " "SSL connection has been closed cleanly. Note that this doesn't mean that " "the underlying transport (read TCP) has been closed." msgstr "" -#: ../../library/ssl.rst:240 +#: ../../library/ssl.rst:237 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " "received on the underlying TCP transport before the request can be fulfilled." msgstr "" -#: ../../library/ssl.rst:249 +#: ../../library/ssl.rst:246 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " "sent on the underlying TCP transport before the request can be fulfilled." msgstr "" -#: ../../library/ssl.rst:258 +#: ../../library/ssl.rst:255 msgid "" "A subclass of :exc:`SSLError` raised when a system error was encountered " "while trying to fulfill an operation on a SSL socket. Unfortunately, there " "is no easy way to inspect the original errno number." msgstr "" -#: ../../library/ssl.rst:266 +#: ../../library/ssl.rst:263 msgid "" "A subclass of :exc:`SSLError` raised when the SSL connection has been " "terminated abruptly. Generally, you shouldn't try to reuse the underlying " "transport when this error is encountered." msgstr "" -#: ../../library/ssl.rst:274 +#: ../../library/ssl.rst:271 msgid "" "A subclass of :exc:`SSLError` raised when certificate validation has failed." msgstr "" -#: ../../library/ssl.rst:281 +#: ../../library/ssl.rst:278 msgid "A numeric error number that denotes the verification error." msgstr "" -#: ../../library/ssl.rst:285 +#: ../../library/ssl.rst:282 msgid "A human readable string of the verification error." msgstr "" -#: ../../library/ssl.rst:289 +#: ../../library/ssl.rst:286 msgid "An alias for :exc:`SSLCertVerificationError`." msgstr "" -#: ../../library/ssl.rst:291 +#: ../../library/ssl.rst:288 msgid "The exception is now an alias for :exc:`SSLCertVerificationError`." msgstr "" -#: ../../library/ssl.rst:296 +#: ../../library/ssl.rst:293 msgid "Random generation" msgstr "" -#: ../../library/ssl.rst:300 +#: ../../library/ssl.rst:297 msgid "" "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" "`SSLError` if the PRNG has not been seeded with enough data or if the " @@ -329,11 +326,11 @@ msgid "" "to seed the PRNG." msgstr "" -#: ../../library/ssl.rst:306 ../../library/ssl.rst:327 +#: ../../library/ssl.rst:303 msgid "For almost all applications :func:`os.urandom` is preferable." msgstr "" -#: ../../library/ssl.rst:308 +#: ../../library/ssl.rst:305 msgid "" "Read the Wikipedia article, `Cryptographically secure pseudorandom number " "generator (CSPRNG) `: Windows." msgstr ":ref:`適用 `:只有 Windows。" -#: ../../library/ssl.rst:505 +#: ../../library/ssl.rst:438 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " "``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." msgstr "" -#: ../../library/ssl.rst:509 +#: ../../library/ssl.rst:442 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" "`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data." msgstr "" -#: ../../library/ssl.rst:523 -msgid "" -"Takes an instance ``sock`` of :class:`socket.socket`, and returns an " -"instance of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, " -"which wraps the underlying socket in an SSL context. ``sock`` must be a :" -"data:`~socket.SOCK_STREAM` socket; other socket types are unsupported." -msgstr "" - -#: ../../library/ssl.rst:528 -msgid "" -"Internally, function creates a :class:`SSLContext` with protocol " -"*ssl_version* and :attr:`SSLContext.options` set to *cert_reqs*. If " -"parameters *keyfile*, *certfile*, *ca_certs* or *ciphers* are set, then the " -"values are passed to :meth:`SSLContext.load_cert_chain`, :meth:`SSLContext." -"load_verify_locations`, and :meth:`SSLContext.set_ciphers`." -msgstr "" - -#: ../../library/ssl.rst:535 -msgid "" -"The arguments *server_side*, *do_handshake_on_connect*, and " -"*suppress_ragged_eofs* have the same meaning as :meth:`SSLContext." -"wrap_socket`." -msgstr "" - -#: ../../library/ssl.rst:541 -msgid "" -"Since Python 3.2 and 2.7.9, it is recommended to use the :meth:`SSLContext." -"wrap_socket` instead of :func:`wrap_socket`. The top-level function is " -"limited and creates an insecure client socket without server name indication " -"or hostname matching." -msgstr "" - -#: ../../library/ssl.rst:547 +#: ../../library/ssl.rst:453 msgid "Constants" msgstr "常數" -#: ../../library/ssl.rst:549 +#: ../../library/ssl.rst:455 msgid "" "All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` " "collections." msgstr "" -#: ../../library/ssl.rst:555 +#: ../../library/ssl.rst:461 msgid "" -"Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs`` " -"parameter to :func:`wrap_socket`. Except for :const:`PROTOCOL_TLS_CLIENT`, " -"it is the default mode. With client-side sockets, just about any cert is " -"accepted. Validation errors, such as untrusted or expired cert, are ignored " -"and do not abort the TLS/SSL handshake." +"Possible value for :attr:`SSLContext.verify_mode`. Except for :const:" +"`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, " +"just about any cert is accepted. Validation errors, such as untrusted or " +"expired cert, are ignored and do not abort the TLS/SSL handshake." msgstr "" -#: ../../library/ssl.rst:561 +#: ../../library/ssl.rst:467 msgid "" "In server mode, no certificate is requested from the client, so the client " "does not send any for client cert authentication." msgstr "" -#: ../../library/ssl.rst:564 ../../library/ssl.rst:2340 +#: ../../library/ssl.rst:470 ../../library/ssl.rst:2245 msgid "See the discussion of :ref:`ssl-security` below." msgstr "參閱下方 :ref:`ssl-security` 的討論。" -#: ../../library/ssl.rst:568 +#: ../../library/ssl.rst:474 msgid "" -"Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs`` " -"parameter to :func:`wrap_socket`. In client mode, :const:`CERT_OPTIONAL` " -"has the same meaning as :const:`CERT_REQUIRED`. It is recommended to use :" -"const:`CERT_REQUIRED` for client-side sockets instead." +"Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:" +"`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is " +"recommended to use :const:`CERT_REQUIRED` for client-side sockets instead." msgstr "" -#: ../../library/ssl.rst:573 +#: ../../library/ssl.rst:479 msgid "" "In server mode, a client certificate request is sent to the client. The " "client may either ignore the request or send a certificate in order perform " @@ -649,45 +548,43 @@ msgid "" "TLS handshake." msgstr "" -#: ../../library/ssl.rst:579 ../../library/ssl.rst:599 +#: ../../library/ssl.rst:485 ../../library/ssl.rst:504 msgid "" -"Use of this setting requires a valid set of CA certificates to be passed, " -"either to :meth:`SSLContext.load_verify_locations` or as a value of the " -"``ca_certs`` parameter to :func:`wrap_socket`." +"Use of this setting requires a valid set of CA certificates to be passed to :" +"meth:`SSLContext.load_verify_locations`." msgstr "" -#: ../../library/ssl.rst:585 +#: ../../library/ssl.rst:490 msgid "" -"Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs`` " -"parameter to :func:`wrap_socket`. In this mode, certificates are required " -"from the other side of the socket connection; an :class:`SSLError` will be " -"raised if no certificate is provided, or if its validation fails. This mode " -"is **not** sufficient to verify a certificate in client mode as it does not " -"match hostnames. :attr:`~SSLContext.check_hostname` must be enabled as well " -"to verify the authenticity of a cert. :const:`PROTOCOL_TLS_CLIENT` uses :" -"const:`CERT_REQUIRED` and enables :attr:`~SSLContext.check_hostname` by " -"default." +"Possible value for :attr:`SSLContext.verify_mode`. In this mode, " +"certificates are required from the other side of the socket connection; an :" +"class:`SSLError` will be raised if no certificate is provided, or if its " +"validation fails. This mode is **not** sufficient to verify a certificate in " +"client mode as it does not match hostnames. :attr:`~SSLContext." +"check_hostname` must be enabled as well to verify the authenticity of a " +"cert. :const:`PROTOCOL_TLS_CLIENT` uses :const:`CERT_REQUIRED` and enables :" +"attr:`~SSLContext.check_hostname` by default." msgstr "" -#: ../../library/ssl.rst:595 +#: ../../library/ssl.rst:500 msgid "" "With server socket, this mode provides mandatory TLS client cert " "authentication. A client certificate request is sent to the client and the " "client must provide a valid and trusted certificate." msgstr "" -#: ../../library/ssl.rst:605 +#: ../../library/ssl.rst:509 msgid ":class:`enum.IntEnum` collection of CERT_* constants." msgstr "" -#: ../../library/ssl.rst:611 +#: ../../library/ssl.rst:515 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, " "certificate revocation lists (CRLs) are not checked. By default OpenSSL does " "neither require nor verify CRLs." msgstr "" -#: ../../library/ssl.rst:619 +#: ../../library/ssl.rst:523 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " @@ -696,32 +593,32 @@ msgid "" "load_verify_locations`, validation will fail." msgstr "" -#: ../../library/ssl.rst:629 +#: ../../library/ssl.rst:533 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of " "all certificates in the peer cert chain are checked." msgstr "" -#: ../../library/ssl.rst:636 +#: ../../library/ssl.rst:540 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to disable workarounds " "for broken X.509 certificates." msgstr "" -#: ../../library/ssl.rst:643 +#: ../../library/ssl.rst:547 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to enables proxy " "certificate verification." msgstr "" -#: ../../library/ssl.rst:650 +#: ../../library/ssl.rst:554 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "prefer trusted certificates when building the trust chain to validate a " "certificate. This flag is enabled by default." msgstr "" -#: ../../library/ssl.rst:658 +#: ../../library/ssl.rst:562 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "accept intermediate CAs in the trust store to be treated as trust-anchors, " @@ -730,25 +627,25 @@ msgid "" "to trust its ancestor root CA." msgstr "" -#: ../../library/ssl.rst:669 +#: ../../library/ssl.rst:573 msgid ":class:`enum.IntFlag` collection of VERIFY_* constants." msgstr "" -#: ../../library/ssl.rst:675 +#: ../../library/ssl.rst:579 msgid "" "Selects the highest protocol version that both the client and server " "support. Despite the name, this option can select both \"SSL\" and \"TLS\" " "protocols." msgstr "" -#: ../../library/ssl.rst:682 +#: ../../library/ssl.rst:586 msgid "" "TLS clients and servers require different default settings for secure " "communication. The generic TLS protocol constant is deprecated in favor of :" "data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:688 +#: ../../library/ssl.rst:592 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context client-side connections. The protocol " @@ -756,53 +653,35 @@ msgid "" "default." msgstr "" -#: ../../library/ssl.rst:697 +#: ../../library/ssl.rst:601 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context server-side connections." msgstr "" -#: ../../library/ssl.rst:704 +#: ../../library/ssl.rst:608 msgid "Alias for :data:`PROTOCOL_TLS`." msgstr "" -#: ../../library/ssl.rst:708 +#: ../../library/ssl.rst:612 msgid "Use :data:`PROTOCOL_TLS` instead." msgstr "" -#: ../../library/ssl.rst:712 -msgid "Selects SSL version 2 as the channel encryption protocol." -msgstr "" - -#: ../../library/ssl.rst:714 -msgid "" -"This protocol is not available if OpenSSL is compiled with the ``no-ssl2`` " -"option." -msgstr "" - -#: ../../library/ssl.rst:719 -msgid "SSL version 2 is insecure. Its use is highly discouraged." -msgstr "" - -#: ../../library/ssl.rst:723 -msgid "OpenSSL has removed support for SSLv2." -msgstr "" - -#: ../../library/ssl.rst:727 +#: ../../library/ssl.rst:616 msgid "Selects SSL version 3 as the channel encryption protocol." msgstr "" -#: ../../library/ssl.rst:729 +#: ../../library/ssl.rst:618 msgid "" "This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " "option." msgstr "" -#: ../../library/ssl.rst:734 +#: ../../library/ssl.rst:623 msgid "SSL version 3 is insecure. Its use is highly discouraged." msgstr "" -#: ../../library/ssl.rst:738 +#: ../../library/ssl.rst:627 msgid "" "OpenSSL has deprecated all version specific protocols. Use the default " "protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :" @@ -810,88 +689,88 @@ msgid "" "instead." msgstr "" -#: ../../library/ssl.rst:746 +#: ../../library/ssl.rst:635 msgid "Selects TLS version 1.0 as the channel encryption protocol." msgstr "" -#: ../../library/ssl.rst:750 ../../library/ssl.rst:761 -#: ../../library/ssl.rst:772 +#: ../../library/ssl.rst:639 ../../library/ssl.rst:650 +#: ../../library/ssl.rst:661 msgid "OpenSSL has deprecated all version specific protocols." msgstr "" -#: ../../library/ssl.rst:754 +#: ../../library/ssl.rst:643 msgid "" "Selects TLS version 1.1 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." msgstr "" -#: ../../library/ssl.rst:765 +#: ../../library/ssl.rst:654 msgid "" "Selects TLS version 1.2 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." msgstr "" -#: ../../library/ssl.rst:776 +#: ../../library/ssl.rst:665 msgid "" "Enables workarounds for various bugs present in other SSL implementations. " "This option is set by default. It does not necessarily set the same flags " "as OpenSSL's ``SSL_OP_ALL`` constant." msgstr "" -#: ../../library/ssl.rst:784 +#: ../../library/ssl.rst:673 msgid "" "Prevents an SSLv2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv2 as " "the protocol version." msgstr "" -#: ../../library/ssl.rst:792 +#: ../../library/ssl.rst:681 msgid "SSLv2 is deprecated" msgstr "" -#: ../../library/ssl.rst:796 +#: ../../library/ssl.rst:685 msgid "" "Prevents an SSLv3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv3 as " "the protocol version." msgstr "" -#: ../../library/ssl.rst:804 +#: ../../library/ssl.rst:693 msgid "SSLv3 is deprecated" msgstr "" -#: ../../library/ssl.rst:808 +#: ../../library/ssl.rst:697 msgid "" "Prevents a TLSv1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as " "the protocol version." msgstr "" -#: ../../library/ssl.rst:814 +#: ../../library/ssl.rst:703 msgid "" "The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext." "minimum_version` and :attr:`SSLContext.maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:821 +#: ../../library/ssl.rst:710 msgid "" "Prevents a TLSv1.1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as " "the protocol version. Available only with openssl version 1.0.1+." msgstr "" -#: ../../library/ssl.rst:827 ../../library/ssl.rst:838 +#: ../../library/ssl.rst:716 ../../library/ssl.rst:727 msgid "The option is deprecated since OpenSSL 1.1.0." msgstr "" -#: ../../library/ssl.rst:832 +#: ../../library/ssl.rst:721 msgid "" "Prevents a TLSv1.2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as " "the protocol version. Available only with openssl version 1.0.1+." msgstr "" -#: ../../library/ssl.rst:843 +#: ../../library/ssl.rst:732 msgid "" "Prevents a TLSv1.3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as " @@ -900,100 +779,122 @@ msgid "" "defaults to *0*." msgstr "" -#: ../../library/ssl.rst:851 +#: ../../library/ssl.rst:740 msgid "" "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15, 3.6.3 " "and 3.7.0 for backwards compatibility with OpenSSL 1.0.2." msgstr "" -#: ../../library/ssl.rst:857 +#: ../../library/ssl.rst:746 msgid "" "Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest " "messages, and ignore renegotiation requests via ClientHello." msgstr "" -#: ../../library/ssl.rst:860 +#: ../../library/ssl.rst:749 msgid "This option is only available with OpenSSL 1.1.0h and later." msgstr "" -#: ../../library/ssl.rst:866 +#: ../../library/ssl.rst:755 msgid "" "Use the server's cipher ordering preference, rather than the client's. This " "option has no effect on client sockets and SSLv2 server sockets." msgstr "" -#: ../../library/ssl.rst:873 +#: ../../library/ssl.rst:762 msgid "" "Prevents re-use of the same DH key for distinct SSL sessions. This improves " "forward secrecy but requires more computational resources. This option only " "applies to server sockets." msgstr "" -#: ../../library/ssl.rst:881 +#: ../../library/ssl.rst:770 msgid "" "Prevents re-use of the same ECDH key for distinct SSL sessions. This " "improves forward secrecy but requires more computational resources. This " "option only applies to server sockets." msgstr "" -#: ../../library/ssl.rst:889 +#: ../../library/ssl.rst:778 msgid "" "Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a " "TLS 1.3 connection look more like a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:892 +#: ../../library/ssl.rst:781 msgid "This option is only available with OpenSSL 1.1.1 and later." msgstr "" -#: ../../library/ssl.rst:898 +#: ../../library/ssl.rst:787 msgid "" "Disable compression on the SSL channel. This is useful if the application " "protocol supports its own compression scheme." msgstr "" -#: ../../library/ssl.rst:905 +#: ../../library/ssl.rst:794 msgid ":class:`enum.IntFlag` collection of OP_* constants." msgstr "" -#: ../../library/ssl.rst:909 +#: ../../library/ssl.rst:798 msgid "Prevent client side from requesting a session ticket." msgstr "" -#: ../../library/ssl.rst:915 +#: ../../library/ssl.rst:804 msgid "Ignore unexpected shutdown of TLS connections." msgstr "" -#: ../../library/ssl.rst:917 +#: ../../library/ssl.rst:806 ../../library/ssl.rst:822 msgid "This option is only available with OpenSSL 3.0.0 and later." msgstr "" -#: ../../library/ssl.rst:923 +#: ../../library/ssl.rst:812 +msgid "" +"Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must " +"have been compiled with support for it, and the negotiated cipher suites and " +"extensions must be supported by it (a list of supported ones may vary by " +"platform and kernel version)." +msgstr "" + +#: ../../library/ssl.rst:817 +msgid "" +"Note that with enabled kernel TLS some cryptographic operations are " +"performed by the kernel directly and not via any available OpenSSL " +"Providers. This might be undesirable if, for example, the application " +"requires all cryptographic operations to be performed by the FIPS provider." +msgstr "" + +#: ../../library/ssl.rst:828 +msgid "" +"Allow legacy insecure renegotiation between OpenSSL and unpatched servers " +"only." +msgstr "" + +#: ../../library/ssl.rst:835 msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." msgstr "" -#: ../../library/ssl.rst:930 +#: ../../library/ssl.rst:842 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." msgstr "" -#: ../../library/ssl.rst:938 +#: ../../library/ssl.rst:850 msgid "" "Whether the OpenSSL library has built-in support for the Elliptic Curve-" "based Diffie-Hellman key exchange. This should be true unless the feature " "was explicitly disabled by the distributor." msgstr "" -#: ../../library/ssl.rst:946 +#: ../../library/ssl.rst:858 msgid "" "Whether the OpenSSL library has built-in support for the *Server Name " "Indication* extension (as defined in :rfc:`6066`)." msgstr "" -#: ../../library/ssl.rst:953 +#: ../../library/ssl.rst:865 msgid "" "Whether the OpenSSL library has built-in support for the *Next Protocol " "Negotiation* as described in the `Application Layer Protocol Negotiation " @@ -1002,57 +903,57 @@ msgid "" "advertise which protocols you want to support." msgstr "" -#: ../../library/ssl.rst:963 +#: ../../library/ssl.rst:875 msgid "" "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "" -#: ../../library/ssl.rst:969 +#: ../../library/ssl.rst:881 msgid "" "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." msgstr "" -#: ../../library/ssl.rst:975 +#: ../../library/ssl.rst:887 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "" -#: ../../library/ssl.rst:981 +#: ../../library/ssl.rst:893 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "" -#: ../../library/ssl.rst:987 +#: ../../library/ssl.rst:899 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." msgstr "" -#: ../../library/ssl.rst:993 +#: ../../library/ssl.rst:905 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." msgstr "" -#: ../../library/ssl.rst:999 +#: ../../library/ssl.rst:911 msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." msgstr "" -#: ../../library/ssl.rst:1006 +#: ../../library/ssl.rst:918 msgid "The version string of the OpenSSL library loaded by the interpreter::" msgstr "" -#: ../../library/ssl.rst:1015 +#: ../../library/ssl.rst:927 msgid "" "A tuple of five integers representing version information about the OpenSSL " "library::" msgstr "" -#: ../../library/ssl.rst:1025 +#: ../../library/ssl.rst:937 msgid "The raw version number of the OpenSSL library, as a single integer::" msgstr "" -#: ../../library/ssl.rst:1038 +#: ../../library/ssl.rst:950 msgid "" "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry " "`." msgstr "" -#: ../../library/ssl.rst:1137 +#: ../../library/ssl.rst:1049 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method." msgstr "" -#: ../../library/ssl.rst:1140 +#: ../../library/ssl.rst:1052 msgid "The :meth:`sendfile` method was added." msgstr "" -#: ../../library/ssl.rst:1143 +#: ../../library/ssl.rst:1055 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " "received or sent. The socket timeout is now the maximum total duration of " "the shutdown." msgstr "" -#: ../../library/ssl.rst:1148 +#: ../../library/ssl.rst:1060 msgid "" "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" "`SSLContext.wrap_socket` to wrap a socket." msgstr "" -#: ../../library/ssl.rst:1152 +#: ../../library/ssl.rst:1064 msgid "" ":class:`SSLSocket` instances must to created with :meth:`~SSLContext." "wrap_socket`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:1158 +#: ../../library/ssl.rst:1070 msgid "" "Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The " "functions support reading and writing of data larger than 2 GB. Writing zero-" "length data no longer fails with a protocol violation error." msgstr "" -#: ../../library/ssl.rst:1163 +#: ../../library/ssl.rst:1075 msgid "SSL sockets also have the following additional methods and attributes:" msgstr "" -#: ../../library/ssl.rst:1167 +#: ../../library/ssl.rst:1079 msgid "" "Read up to *len* bytes of data from the SSL socket and return the result as " "a ``bytes`` instance. If *buffer* is specified, then read into the buffer " "instead, and return the number of bytes read." msgstr "" -#: ../../library/ssl.rst:1171 +#: ../../library/ssl.rst:1083 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." msgstr "" -#: ../../library/ssl.rst:1174 +#: ../../library/ssl.rst:1086 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`read` can also " "cause write operations." msgstr "" -#: ../../library/ssl.rst:1177 +#: ../../library/ssl.rst:1089 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to read up to *len* " "bytes." msgstr "" -#: ../../library/ssl.rst:1182 +#: ../../library/ssl.rst:1094 msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "" -#: ../../library/ssl.rst:1187 +#: ../../library/ssl.rst:1099 msgid "" "Write *buf* to the SSL socket and return the number of bytes written. The " "*buf* argument must be an object supporting the buffer interface." msgstr "" -#: ../../library/ssl.rst:1190 +#: ../../library/ssl.rst:1102 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." msgstr "" -#: ../../library/ssl.rst:1193 +#: ../../library/ssl.rst:1105 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`write` can " "also cause read operations." msgstr "" -#: ../../library/ssl.rst:1196 +#: ../../library/ssl.rst:1108 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to write *buf*." msgstr "" -#: ../../library/ssl.rst:1200 +#: ../../library/ssl.rst:1112 msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "" -#: ../../library/ssl.rst:1205 +#: ../../library/ssl.rst:1117 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1311,30 +1212,30 @@ msgid "" "unwrap` was not called." msgstr "" -#: ../../library/ssl.rst:1211 +#: ../../library/ssl.rst:1123 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." msgstr "" -#: ../../library/ssl.rst:1217 +#: ../../library/ssl.rst:1129 msgid "Perform the SSL setup handshake." msgstr "" -#: ../../library/ssl.rst:1219 +#: ../../library/ssl.rst:1131 msgid "" "The handshake method also performs :func:`match_hostname` when the :attr:" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." "context` is true." msgstr "" -#: ../../library/ssl.rst:1224 +#: ../../library/ssl.rst:1136 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration of the handshake." msgstr "" -#: ../../library/ssl.rst:1228 +#: ../../library/ssl.rst:1140 msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" "func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " @@ -1342,14 +1243,14 @@ msgid "" "sent to the peer." msgstr "" -#: ../../library/ssl.rst:1236 +#: ../../library/ssl.rst:1148 msgid "" "If there is no certificate for the peer on the other end of the connection, " "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" "`ValueError`." msgstr "" -#: ../../library/ssl.rst:1240 +#: ../../library/ssl.rst:1152 msgid "" "If the ``binary_form`` parameter is :const:`False`, and a certificate was " "received from the peer, this method returns a :class:`dict` instance. If " @@ -1361,7 +1262,7 @@ msgid "" "also be a ``subjectAltName`` key in the dictionary." msgstr "" -#: ../../library/ssl.rst:1249 +#: ../../library/ssl.rst:1161 msgid "" "The ``subject`` and ``issuer`` fields are tuples containing the sequence of " "relative distinguished names (RDNs) given in the certificate's data " @@ -1369,13 +1270,7 @@ msgid "" "value pairs. Here is a real-world example::" msgstr "" -#: ../../library/ssl.rst:1275 -msgid "" -"To validate a certificate for a particular service, you can use the :func:" -"`match_hostname` function." -msgstr "" - -#: ../../library/ssl.rst:1278 +#: ../../library/ssl.rst:1185 msgid "" "If the ``binary_form`` parameter is :const:`True`, and a certificate was " "provided, this method returns the DER-encoded form of the entire certificate " @@ -1384,13 +1279,13 @@ msgid "" "socket's role:" msgstr "" -#: ../../library/ssl.rst:1284 +#: ../../library/ssl.rst:1191 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" msgstr "" -#: ../../library/ssl.rst:1287 +#: ../../library/ssl.rst:1194 msgid "" "for a server SSL socket, the client will only provide a certificate when " "requested by the server; therefore :meth:`getpeercert` will return :const:" @@ -1398,24 +1293,29 @@ msgid "" "or :const:`CERT_REQUIRED`)." msgstr "" -#: ../../library/ssl.rst:1292 +#: ../../library/ssl.rst:1199 +#, fuzzy +msgid "See also :attr:`SSLContext.check_hostname`." +msgstr ":attr:`~SSLSocket.server_hostname`" + +#: ../../library/ssl.rst:1201 msgid "" "The returned dictionary includes additional items such as ``issuer`` and " "``notBefore``." msgstr "" -#: ../../library/ssl.rst:1296 +#: ../../library/ssl.rst:1205 msgid "" ":exc:`ValueError` is raised when the handshake isn't done. The returned " "dictionary includes additional X509v3 extension items such as " "``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" -#: ../../library/ssl.rst:1301 +#: ../../library/ssl.rst:1210 msgid "IPv6 address strings no longer have a trailing new line." msgstr "" -#: ../../library/ssl.rst:1306 +#: ../../library/ssl.rst:1215 msgid "" "Returns a three-value tuple containing the name of the cipher being used, " "the version of the SSL protocol that defines its use, and the number of " @@ -1423,7 +1323,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ssl.rst:1312 +#: ../../library/ssl.rst:1221 msgid "" "Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " @@ -1433,25 +1333,25 @@ msgid "" "socket." msgstr "" -#: ../../library/ssl.rst:1323 +#: ../../library/ssl.rst:1232 msgid "" "Return the compression algorithm being used as a string, or ``None`` if the " "connection isn't compressed." msgstr "" -#: ../../library/ssl.rst:1326 +#: ../../library/ssl.rst:1235 msgid "" "If the higher-level protocol supports its own compression mechanism, you can " "use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" -#: ../../library/ssl.rst:1333 +#: ../../library/ssl.rst:1242 msgid "" "Get channel binding data for current connection, as a bytes object. Returns " "``None`` if not connected or the handshake has not been completed." msgstr "" -#: ../../library/ssl.rst:1336 +#: ../../library/ssl.rst:1245 msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " @@ -1460,7 +1360,7 @@ msgid "" "channel binding type is requested." msgstr "" -#: ../../library/ssl.rst:1346 +#: ../../library/ssl.rst:1255 msgid "" "Return the protocol that was selected during the TLS handshake. If :meth:" "`SSLContext.set_alpn_protocols` was not called, if the other party does not " @@ -1468,7 +1368,7 @@ msgid "" "protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" -#: ../../library/ssl.rst:1356 +#: ../../library/ssl.rst:1265 msgid "" "Return the higher-level protocol that was selected during the TLS/SSL " "handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the " @@ -1476,11 +1376,11 @@ msgid "" "this will return ``None``." msgstr "" -#: ../../library/ssl.rst:1365 ../../library/ssl.rst:1725 +#: ../../library/ssl.rst:1274 ../../library/ssl.rst:1630 msgid "NPN has been superseded by ALPN" msgstr "" -#: ../../library/ssl.rst:1369 +#: ../../library/ssl.rst:1278 msgid "" "Performs the SSL shutdown handshake, which removes the TLS layer from the " "underlying socket, and returns the underlying socket object. This can be " @@ -1489,7 +1389,7 @@ msgid "" "other side of the connection, rather than the original socket." msgstr "" -#: ../../library/ssl.rst:1377 +#: ../../library/ssl.rst:1286 msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " @@ -1497,26 +1397,26 @@ msgid "" "`SSLContext.post_handshake_auth`." msgstr "" -#: ../../library/ssl.rst:1382 +#: ../../library/ssl.rst:1291 msgid "" "The method does not perform a cert exchange immediately. The server-side " "sends a CertificateRequest during the next write event and expects the " "client to respond with a certificate on the next read event." msgstr "" -#: ../../library/ssl.rst:1386 +#: ../../library/ssl.rst:1295 msgid "" "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" "`SSLError` is raised." msgstr "" -#: ../../library/ssl.rst:1390 +#: ../../library/ssl.rst:1299 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the method raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/ssl.rst:1397 +#: ../../library/ssl.rst:1306 msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` if no secure connection is established. As of this " @@ -1525,33 +1425,29 @@ msgid "" "may define more return values." msgstr "" -#: ../../library/ssl.rst:1407 +#: ../../library/ssl.rst:1316 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -#: ../../library/ssl.rst:1412 -msgid "" -"The :class:`SSLContext` object this SSL socket is tied to. If the SSL " -"socket was created using the deprecated :func:`wrap_socket` function (rather " -"than :meth:`SSLContext.wrap_socket`), this is a custom context object " -"created for this SSL socket." +#: ../../library/ssl.rst:1321 +msgid "The :class:`SSLContext` object this SSL socket is tied to." msgstr "" -#: ../../library/ssl.rst:1421 +#: ../../library/ssl.rst:1327 msgid "" "A boolean which is ``True`` for server-side sockets and ``False`` for client-" "side sockets." msgstr "" -#: ../../library/ssl.rst:1428 +#: ../../library/ssl.rst:1334 msgid "" "Hostname of the server: :class:`str` type, or ``None`` for server-side " "socket or if the hostname was not specified in the constructor." msgstr "" -#: ../../library/ssl.rst:1433 +#: ../../library/ssl.rst:1339 msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " @@ -1559,7 +1455,7 @@ msgid "" "org\"``)." msgstr "" -#: ../../library/ssl.rst:1441 +#: ../../library/ssl.rst:1347 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " @@ -1567,11 +1463,11 @@ msgid "" "`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" -#: ../../library/ssl.rst:1454 +#: ../../library/ssl.rst:1360 msgid "SSL Contexts" msgstr "" -#: ../../library/ssl.rst:1458 +#: ../../library/ssl.rst:1364 msgid "" "An SSL context holds various data longer-lived than single SSL connections, " "such as SSL configuration options, certificate(s) and private key(s). It " @@ -1579,7 +1475,7 @@ msgid "" "speed up repeated connections from the same clients." msgstr "" -#: ../../library/ssl.rst:1465 +#: ../../library/ssl.rst:1371 msgid "" "Create a new SSL context. You may pass *protocol* which must be one of the " "``PROTOCOL_*`` constants defined in this module. The parameter specifies " @@ -1590,127 +1486,126 @@ msgid "" "provides the most compatibility with other versions." msgstr "" -#: ../../library/ssl.rst:1474 +#: ../../library/ssl.rst:1380 msgid "" "Here's a table showing which versions in a client (down the side) can " "connect to which versions in a server (along the top):" msgstr "" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "*client* / **server**" msgstr "" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**SSLv2**" msgstr "**SSLv2**" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**SSLv3**" msgstr "**SSLv3**" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**TLS** [3]_" msgstr "**TLS** [3]_" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**TLSv1**" msgstr "**TLSv1**" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**TLSv1.1**" msgstr "**TLSv1.1**" -#: ../../library/ssl.rst:1480 +#: ../../library/ssl.rst:1386 msgid "**TLSv1.2**" msgstr "**TLSv1.2**" -#: ../../library/ssl.rst:1482 +#: ../../library/ssl.rst:1388 msgid "*SSLv2*" msgstr "*SSLv2*" -#: ../../library/ssl.rst:1482 ../../library/ssl.rst:1483 -#: ../../library/ssl.rst:1484 ../../library/ssl.rst:1485 -#: ../../library/ssl.rst:1486 ../../library/ssl.rst:1487 +#: ../../library/ssl.rst:1388 ../../library/ssl.rst:1389 +#: ../../library/ssl.rst:1390 ../../library/ssl.rst:1391 +#: ../../library/ssl.rst:1392 ../../library/ssl.rst:1393 msgid "yes" msgstr "" -#: ../../library/ssl.rst:1482 ../../library/ssl.rst:1483 -#: ../../library/ssl.rst:1485 ../../library/ssl.rst:1486 -#: ../../library/ssl.rst:1487 +#: ../../library/ssl.rst:1388 ../../library/ssl.rst:1389 +#: ../../library/ssl.rst:1391 ../../library/ssl.rst:1392 +#: ../../library/ssl.rst:1393 msgid "no" msgstr "" -#: ../../library/ssl.rst:1482 ../../library/ssl.rst:1484 +#: ../../library/ssl.rst:1388 ../../library/ssl.rst:1390 msgid "no [1]_" msgstr "" -#: ../../library/ssl.rst:1483 +#: ../../library/ssl.rst:1389 msgid "*SSLv3*" msgstr "*SSLv3*" -#: ../../library/ssl.rst:1483 ../../library/ssl.rst:1484 +#: ../../library/ssl.rst:1389 ../../library/ssl.rst:1390 msgid "no [2]_" msgstr "" -#: ../../library/ssl.rst:1484 +#: ../../library/ssl.rst:1390 msgid "*TLS* (*SSLv23*) [3]_" msgstr "*TLS* (*SSLv23*) [3]_" -#: ../../library/ssl.rst:1485 +#: ../../library/ssl.rst:1391 msgid "*TLSv1*" msgstr "*TLSv1*" -#: ../../library/ssl.rst:1486 +#: ../../library/ssl.rst:1392 msgid "*TLSv1.1*" msgstr "*TLSv1.1*" -#: ../../library/ssl.rst:1487 +#: ../../library/ssl.rst:1393 msgid "*TLSv1.2*" msgstr "*TLSv1.2*" -#: ../../library/ssl.rst:1490 +#: ../../library/ssl.rst:1396 msgid "Footnotes" msgstr "註解" -#: ../../library/ssl.rst:1491 +#: ../../library/ssl.rst:1397 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr "" -#: ../../library/ssl.rst:1492 +#: ../../library/ssl.rst:1398 msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr "" -#: ../../library/ssl.rst:1493 +#: ../../library/ssl.rst:1399 msgid "" "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " "1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" -#: ../../library/ssl.rst:1498 +#: ../../library/ssl.rst:1404 msgid "" ":func:`create_default_context` lets the :mod:`ssl` module choose security " "settings for a given purpose." msgstr "" -#: ../../library/ssl.rst:1503 +#: ../../library/ssl.rst:1409 msgid "" "The context is created with secure default values. The options :data:" "`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" -"`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2` (except " -"for :data:`PROTOCOL_SSLv2`), and :data:`OP_NO_SSLv3` (except for :data:" -"`PROTOCOL_SSLv3`) are set by default. The initial cipher suite list contains " -"only ``HIGH`` ciphers, no ``NULL`` ciphers and no ``MD5`` ciphers (except " -"for :data:`PROTOCOL_SSLv2`)." +"`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2`, and :" +"data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are set by default. " +"The initial cipher suite list contains only ``HIGH`` ciphers, no ``NULL`` " +"ciphers and no ``MD5`` ciphers." msgstr "" -#: ../../library/ssl.rst:1514 +#: ../../library/ssl.rst:1419 msgid "" ":class:`SSLContext` without protocol argument is deprecated. The context " "class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" -#: ../../library/ssl.rst:1520 +#: ../../library/ssl.rst:1425 msgid "" "The default cipher suites now include only secure AES and ChaCha20 ciphers " "with forward secrecy and security level 2. RSA and DH keys with less than " @@ -1719,22 +1614,22 @@ msgid "" "use TLS 1.2 as minimum TLS version." msgstr "" -#: ../../library/ssl.rst:1527 +#: ../../library/ssl.rst:1432 msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr "" -#: ../../library/ssl.rst:1531 +#: ../../library/ssl.rst:1436 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -#: ../../library/ssl.rst:1535 +#: ../../library/ssl.rst:1440 msgid "Example for a context with one CA cert and one other cert::" msgstr "" -#: ../../library/ssl.rst:1545 +#: ../../library/ssl.rst:1450 msgid "" "Load a private key and the corresponding certificate. The *certfile* string " "must be the path to a single file in PEM format containing the certificate " @@ -1745,7 +1640,7 @@ msgid "" "more information on how the certificate is stored in the *certfile*." msgstr "" -#: ../../library/ssl.rst:1554 +#: ../../library/ssl.rst:1459 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -1757,24 +1652,24 @@ msgid "" "encrypted and no password is needed." msgstr "" -#: ../../library/ssl.rst:1563 +#: ../../library/ssl.rst:1468 msgid "" "If the *password* argument is not specified and a password is required, " "OpenSSL's built-in password prompting mechanism will be used to " "interactively prompt the user for a password." msgstr "" -#: ../../library/ssl.rst:1567 +#: ../../library/ssl.rst:1472 msgid "" "An :class:`SSLError` is raised if the private key doesn't match with the " "certificate." msgstr "" -#: ../../library/ssl.rst:1570 +#: ../../library/ssl.rst:1475 msgid "New optional argument *password*." msgstr "" -#: ../../library/ssl.rst:1575 +#: ../../library/ssl.rst:1480 msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " @@ -1783,7 +1678,7 @@ msgid "" "from other locations, too." msgstr "" -#: ../../library/ssl.rst:1581 +#: ../../library/ssl.rst:1486 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " "default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are " @@ -1792,28 +1687,28 @@ msgid "" "certificate verification on the server side." msgstr "" -#: ../../library/ssl.rst:1591 +#: ../../library/ssl.rst:1496 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " "other peers' certificates when :data:`verify_mode` is other than :data:" "`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" -#: ../../library/ssl.rst:1595 +#: ../../library/ssl.rst:1500 msgid "" "This method can also load certification revocation lists (CRLs) in PEM or " "DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " "must be configured properly." msgstr "" -#: ../../library/ssl.rst:1599 +#: ../../library/ssl.rst:1504 msgid "" "The *cafile* string, if present, is the path to a file of concatenated CA " "certificates in PEM format. See the discussion of :ref:`ssl-certificates` " "for more information about how to arrange the certificates in this file." msgstr "" -#: ../../library/ssl.rst:1604 +#: ../../library/ssl.rst:1509 msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " @@ -1821,7 +1716,7 @@ msgid "" "html>`_." msgstr "" -#: ../../library/ssl.rst:1609 +#: ../../library/ssl.rst:1514 msgid "" "The *cadata* object, if present, is either an ASCII string of one or more " "PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " @@ -1829,11 +1724,11 @@ msgid "" "are ignored but at least one certificate must be present." msgstr "" -#: ../../library/ssl.rst:1614 +#: ../../library/ssl.rst:1519 msgid "New optional argument *cadata*" msgstr "" -#: ../../library/ssl.rst:1619 +#: ../../library/ssl.rst:1524 msgid "" "Get a list of loaded \"certification authority\" (CA) certificates. If the " "``binary_form`` parameter is :const:`False` each list entry is a dict like " @@ -1843,19 +1738,19 @@ msgid "" "a SSL connection." msgstr "" -#: ../../library/ssl.rst:1627 +#: ../../library/ssl.rst:1532 msgid "" "Certificates in a capath directory aren't loaded unless they have been used " "at least once." msgstr "" -#: ../../library/ssl.rst:1634 +#: ../../library/ssl.rst:1539 msgid "" "Get a list of enabled ciphers. The list is in order of cipher priority. See :" "meth:`SSLContext.set_ciphers`." msgstr "" -#: ../../library/ssl.rst:1671 +#: ../../library/ssl.rst:1576 msgid "" "Load a set of default \"certification authority\" (CA) certificates from a " "filesystem path defined when building the OpenSSL library. Unfortunately, " @@ -1865,7 +1760,7 @@ msgid "" "configured properly." msgstr "" -#: ../../library/ssl.rst:1680 +#: ../../library/ssl.rst:1585 msgid "" "Set the available ciphers for sockets created with this context. It should " "be a string in the `OpenSSL cipher list format `_" msgstr "" -#: ../../library/ssl.rst:1818 +#: ../../library/ssl.rst:1723 msgid "Vincent Bernat." msgstr "" -#: ../../library/ssl.rst:1824 +#: ../../library/ssl.rst:1729 msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " @@ -2054,13 +1949,13 @@ msgid "" "a :data:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" -#: ../../library/ssl.rst:1830 +#: ../../library/ssl.rst:1735 msgid "" "The parameter ``server_side`` is a boolean which identifies whether server-" "side or client-side behavior is desired from this socket." msgstr "" -#: ../../library/ssl.rst:1833 +#: ../../library/ssl.rst:1738 msgid "" "For client-side sockets, the context construction is lazy; if the underlying " "socket isn't connected yet, the context construction will be performed " @@ -2071,7 +1966,7 @@ msgid "" "exc:`SSLError`." msgstr "" -#: ../../library/ssl.rst:1841 +#: ../../library/ssl.rst:1746 msgid "" "On client connections, the optional parameter *server_hostname* specifies " "the hostname of the service which we are connecting to. This allows a " @@ -2080,7 +1975,7 @@ msgid "" "*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." msgstr "" -#: ../../library/ssl.rst:1847 +#: ../../library/ssl.rst:1752 msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " @@ -2090,7 +1985,7 @@ msgid "" "socket I/O involved in the handshake." msgstr "" -#: ../../library/ssl.rst:1854 +#: ../../library/ssl.rst:1759 msgid "" "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." "recv` method should signal unexpected EOF from the other end of the " @@ -2100,34 +1995,34 @@ msgid "" "exceptions back to the caller." msgstr "" -#: ../../library/ssl.rst:1861 +#: ../../library/ssl.rst:1766 msgid "*session*, see :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:1863 +#: ../../library/ssl.rst:1768 msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: ../../library/ssl.rst:1867 ../../library/ssl.rst:1893 +#: ../../library/ssl.rst:1772 ../../library/ssl.rst:1798 msgid "*session* argument was added." msgstr "新增 *session* 引數。" -#: ../../library/ssl.rst:1870 +#: ../../library/ssl.rst:1775 msgid "" "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1876 +#: ../../library/ssl.rst:1781 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1885 +#: ../../library/ssl.rst:1790 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2135,26 +2030,26 @@ msgid "" "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1890 +#: ../../library/ssl.rst:1795 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1896 +#: ../../library/ssl.rst:1801 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1902 +#: ../../library/ssl.rst:1807 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1910 +#: ../../library/ssl.rst:1815 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2163,7 +2058,7 @@ msgid "" "misses in the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1921 +#: ../../library/ssl.rst:1826 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " "The context's :attr:`~SSLContext.verify_mode` must be set to :data:" @@ -2176,7 +2071,7 @@ msgid "" "With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: ../../library/ssl.rst:1949 +#: ../../library/ssl.rst:1854 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2184,7 +2079,7 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1956 +#: ../../library/ssl.rst:1861 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2193,7 +2088,7 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1966 +#: ../../library/ssl.rst:1871 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2201,7 +2096,7 @@ msgid "" "`PROTOCOL_TLS_CLIENT`, and :attr:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1971 +#: ../../library/ssl.rst:1876 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2211,38 +2106,38 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1984 +#: ../../library/ssl.rst:1889 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1991 +#: ../../library/ssl.rst:1896 msgid "" "Control the number of TLS 1.3 session tickets of a :attr:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: ../../library/ssl.rst:1999 +#: ../../library/ssl.rst:1904 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:2003 +#: ../../library/ssl.rst:1908 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr "" -#: ../../library/ssl.rst:2011 +#: ../../library/ssl.rst:1916 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " "Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." "maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:2017 +#: ../../library/ssl.rst:1922 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2250,13 +2145,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:2022 +#: ../../library/ssl.rst:1927 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:2025 +#: ../../library/ssl.rst:1930 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2264,59 +2159,59 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:2035 +#: ../../library/ssl.rst:1940 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:2040 +#: ../../library/ssl.rst:1945 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:2048 +#: ../../library/ssl.rst:1953 msgid "" "The flag had no effect with OpenSSL before version 1.1.1k. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: ../../library/ssl.rst:2053 +#: ../../library/ssl.rst:1958 msgid "" "An integer representing the `security level `_ for the context. This " "attribute is read-only." msgstr "" -#: ../../library/ssl.rst:2061 +#: ../../library/ssl.rst:1966 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " "neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: ../../library/ssl.rst:2067 +#: ../../library/ssl.rst:1972 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr "" -#: ../../library/ssl.rst:2075 +#: ../../library/ssl.rst:1980 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:2079 +#: ../../library/ssl.rst:1984 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr "" -#: ../../library/ssl.rst:2092 +#: ../../library/ssl.rst:1997 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:2094 +#: ../../library/ssl.rst:1999 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2327,7 +2222,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2102 +#: ../../library/ssl.rst:2007 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2341,7 +2236,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2112 +#: ../../library/ssl.rst:2017 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2354,18 +2249,18 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2122 +#: ../../library/ssl.rst:2027 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2131 +#: ../../library/ssl.rst:2036 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2133 +#: ../../library/ssl.rst:2038 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -2381,11 +2276,11 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2157 +#: ../../library/ssl.rst:2062 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2159 +#: ../../library/ssl.rst:2064 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -2397,24 +2292,23 @@ msgid "" "create_default_context`." msgstr "" -#: ../../library/ssl.rst:2168 +#: ../../library/ssl.rst:2073 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2170 +#: ../../library/ssl.rst:2075 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " -"and :func:`wrap_socket` needs to be passed. If the private key is stored " -"with the certificate, it should come before the first certificate in the " -"certificate chain::" +"needs to be passed. If the private key is stored with the certificate, it " +"should come before the first certificate in the certificate chain::" msgstr "" -#: ../../library/ssl.rst:2184 +#: ../../library/ssl.rst:2089 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2186 +#: ../../library/ssl.rst:2091 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -2424,51 +2318,51 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2215 +#: ../../library/ssl.rst:2120 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2221 +#: ../../library/ssl.rst:2126 msgid "Examples" msgstr "範例" -#: ../../library/ssl.rst:2224 +#: ../../library/ssl.rst:2129 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2226 +#: ../../library/ssl.rst:2131 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2237 +#: ../../library/ssl.rst:2142 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2239 +#: ../../library/ssl.rst:2144 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2244 +#: ../../library/ssl.rst:2149 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2251 +#: ../../library/ssl.rst:2156 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2255 +#: ../../library/ssl.rst:2160 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -2476,7 +2370,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2260 +#: ../../library/ssl.rst:2165 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -2485,27 +2379,27 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2270 +#: ../../library/ssl.rst:2175 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2274 +#: ../../library/ssl.rst:2179 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2317 +#: ../../library/ssl.rst:2222 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2344 +#: ../../library/ssl.rst:2249 msgid "Server-side operation" msgstr "" -#: ../../library/ssl.rst:2346 +#: ../../library/ssl.rst:2251 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -2514,20 +2408,20 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2361 +#: ../../library/ssl.rst:2266 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2374 +#: ../../library/ssl.rst:2279 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2388 +#: ../../library/ssl.rst:2293 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -2535,18 +2429,18 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2396 +#: ../../library/ssl.rst:2301 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2398 +#: ../../library/ssl.rst:2303 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2402 +#: ../../library/ssl.rst:2307 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -2558,13 +2452,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2414 +#: ../../library/ssl.rst:2319 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2418 +#: ../../library/ssl.rst:2323 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -2574,7 +2468,7 @@ msgid "" "`~select.select`." msgstr "" -#: ../../library/ssl.rst:2425 +#: ../../library/ssl.rst:2330 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -2583,13 +2477,13 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2431 +#: ../../library/ssl.rst:2336 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2434 +#: ../../library/ssl.rst:2339 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -2597,7 +2491,7 @@ msgid "" "readiness::" msgstr "" -#: ../../library/ssl.rst:2450 +#: ../../library/ssl.rst:2355 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level API. It polls for events using " @@ -2606,26 +2500,26 @@ msgid "" "handshake asynchronously as well." msgstr "" -#: ../../library/ssl.rst:2459 +#: ../../library/ssl.rst:2364 msgid "Memory BIO Support" msgstr "" -#: ../../library/ssl.rst:2463 +#: ../../library/ssl.rst:2368 msgid "" "Ever since the SSL module was introduced in Python 2.6, the :class:" "`SSLSocket` class has provided two related but distinct areas of " "functionality:" msgstr "" -#: ../../library/ssl.rst:2466 +#: ../../library/ssl.rst:2371 msgid "SSL protocol handling" msgstr "" -#: ../../library/ssl.rst:2467 +#: ../../library/ssl.rst:2372 msgid "Network IO" msgstr "" -#: ../../library/ssl.rst:2469 +#: ../../library/ssl.rst:2374 msgid "" "The network IO API is identical to that provided by :class:`socket.socket`, " "from which :class:`SSLSocket` also inherits. This allows an SSL socket to be " @@ -2633,7 +2527,7 @@ msgid "" "add SSL support to an existing application." msgstr "" -#: ../../library/ssl.rst:2474 +#: ../../library/ssl.rst:2379 msgid "" "Combining SSL protocol handling and network IO usually works well, but there " "are some cases where it doesn't. An example is async IO frameworks that want " @@ -2645,7 +2539,7 @@ msgid "" "`SSLObject` is provided." msgstr "" -#: ../../library/ssl.rst:2485 +#: ../../library/ssl.rst:2390 msgid "" "A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol " "instance that does not contain any network IO methods. This class is " @@ -2653,7 +2547,7 @@ msgid "" "for SSL through memory buffers." msgstr "" -#: ../../library/ssl.rst:2490 +#: ../../library/ssl.rst:2395 msgid "" "This class implements an interface on top of a low-level SSL object as " "implemented by OpenSSL. This object captures the state of an SSL connection " @@ -2661,7 +2555,7 @@ msgid "" "separate \"BIO\" objects which are OpenSSL's IO abstraction layer." msgstr "" -#: ../../library/ssl.rst:2495 +#: ../../library/ssl.rst:2400 msgid "" "This class has no public constructor. An :class:`SSLObject` instance must " "be created using the :meth:`~SSLContext.wrap_bio` method. This method will " @@ -2670,214 +2564,214 @@ msgid "" "instance, while the *outgoing* BIO is used to pass data the other way around." msgstr "" -#: ../../library/ssl.rst:2502 +#: ../../library/ssl.rst:2407 msgid "The following methods are available:" msgstr "" -#: ../../library/ssl.rst:2504 +#: ../../library/ssl.rst:2409 msgid ":attr:`~SSLSocket.context`" msgstr ":attr:`~SSLSocket.context`" -#: ../../library/ssl.rst:2505 +#: ../../library/ssl.rst:2410 msgid ":attr:`~SSLSocket.server_side`" msgstr ":attr:`~SSLSocket.server_side`" -#: ../../library/ssl.rst:2506 +#: ../../library/ssl.rst:2411 msgid ":attr:`~SSLSocket.server_hostname`" msgstr ":attr:`~SSLSocket.server_hostname`" -#: ../../library/ssl.rst:2507 +#: ../../library/ssl.rst:2412 msgid ":attr:`~SSLSocket.session`" msgstr ":attr:`~SSLSocket.session`" -#: ../../library/ssl.rst:2508 +#: ../../library/ssl.rst:2413 msgid ":attr:`~SSLSocket.session_reused`" msgstr ":attr:`~SSLSocket.session_reused`" -#: ../../library/ssl.rst:2509 +#: ../../library/ssl.rst:2414 msgid ":meth:`~SSLSocket.read`" msgstr ":meth:`~SSLSocket.read`" -#: ../../library/ssl.rst:2510 +#: ../../library/ssl.rst:2415 msgid ":meth:`~SSLSocket.write`" msgstr ":meth:`~SSLSocket.write`" -#: ../../library/ssl.rst:2511 +#: ../../library/ssl.rst:2416 msgid ":meth:`~SSLSocket.getpeercert`" msgstr ":meth:`~SSLSocket.getpeercert`" -#: ../../library/ssl.rst:2512 +#: ../../library/ssl.rst:2417 msgid ":meth:`~SSLSocket.selected_alpn_protocol`" msgstr ":meth:`~SSLSocket.selected_alpn_protocol`" -#: ../../library/ssl.rst:2513 +#: ../../library/ssl.rst:2418 msgid ":meth:`~SSLSocket.selected_npn_protocol`" msgstr ":meth:`~SSLSocket.selected_npn_protocol`" -#: ../../library/ssl.rst:2514 +#: ../../library/ssl.rst:2419 msgid ":meth:`~SSLSocket.cipher`" msgstr ":meth:`~SSLSocket.cipher`" -#: ../../library/ssl.rst:2515 +#: ../../library/ssl.rst:2420 msgid ":meth:`~SSLSocket.shared_ciphers`" msgstr ":meth:`~SSLSocket.shared_ciphers`" -#: ../../library/ssl.rst:2516 +#: ../../library/ssl.rst:2421 msgid ":meth:`~SSLSocket.compression`" msgstr ":meth:`~SSLSocket.compression`" -#: ../../library/ssl.rst:2517 +#: ../../library/ssl.rst:2422 msgid ":meth:`~SSLSocket.pending`" msgstr ":meth:`~SSLSocket.pending`" -#: ../../library/ssl.rst:2518 +#: ../../library/ssl.rst:2423 msgid ":meth:`~SSLSocket.do_handshake`" msgstr ":meth:`~SSLSocket.do_handshake`" -#: ../../library/ssl.rst:2519 +#: ../../library/ssl.rst:2424 msgid ":meth:`~SSLSocket.verify_client_post_handshake`" msgstr ":meth:`~SSLSocket.verify_client_post_handshake`" -#: ../../library/ssl.rst:2520 +#: ../../library/ssl.rst:2425 msgid ":meth:`~SSLSocket.unwrap`" msgstr ":meth:`~SSLSocket.unwrap`" -#: ../../library/ssl.rst:2521 +#: ../../library/ssl.rst:2426 msgid ":meth:`~SSLSocket.get_channel_binding`" msgstr ":meth:`~SSLSocket.get_channel_binding`" -#: ../../library/ssl.rst:2522 +#: ../../library/ssl.rst:2427 msgid ":meth:`~SSLSocket.version`" msgstr ":meth:`~SSLSocket.version`" -#: ../../library/ssl.rst:2524 +#: ../../library/ssl.rst:2429 msgid "" "When compared to :class:`SSLSocket`, this object lacks the following " "features:" msgstr "" -#: ../../library/ssl.rst:2527 +#: ../../library/ssl.rst:2432 msgid "" "Any form of network IO; ``recv()`` and ``send()`` read and write only to the " "underlying :class:`MemoryBIO` buffers." msgstr "" -#: ../../library/ssl.rst:2530 +#: ../../library/ssl.rst:2435 msgid "" "There is no *do_handshake_on_connect* machinery. You must always manually " "call :meth:`~SSLSocket.do_handshake` to start the handshake." msgstr "" -#: ../../library/ssl.rst:2533 +#: ../../library/ssl.rst:2438 msgid "" "There is no handling of *suppress_ragged_eofs*. All end-of-file conditions " "that are in violation of the protocol are reported via the :exc:" "`SSLEOFError` exception." msgstr "" -#: ../../library/ssl.rst:2537 +#: ../../library/ssl.rst:2442 msgid "" "The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike " "for an SSL socket where it returns the underlying socket." msgstr "" -#: ../../library/ssl.rst:2540 +#: ../../library/ssl.rst:2445 msgid "" "The *server_name_callback* callback passed to :meth:`SSLContext." "set_servername_callback` will get an :class:`SSLObject` instance instead of " "a :class:`SSLSocket` instance as its first parameter." msgstr "" -#: ../../library/ssl.rst:2544 +#: ../../library/ssl.rst:2449 msgid "Some notes related to the use of :class:`SSLObject`:" msgstr "" -#: ../../library/ssl.rst:2546 +#: ../../library/ssl.rst:2451 msgid "" "All IO on an :class:`SSLObject` is :ref:`non-blocking `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2551 +#: ../../library/ssl.rst:2456 msgid "" "There is no module-level ``wrap_bio()`` call like there is for :meth:" "`~SSLContext.wrap_socket`. An :class:`SSLObject` is always created via an :" "class:`SSLContext`." msgstr "" -#: ../../library/ssl.rst:2555 +#: ../../library/ssl.rst:2460 msgid "" ":class:`SSLObject` instances must to created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2561 +#: ../../library/ssl.rst:2466 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2567 +#: ../../library/ssl.rst:2472 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2572 +#: ../../library/ssl.rst:2477 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2576 +#: ../../library/ssl.rst:2481 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2581 +#: ../../library/ssl.rst:2486 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2586 +#: ../../library/ssl.rst:2491 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2589 +#: ../../library/ssl.rst:2494 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2594 +#: ../../library/ssl.rst:2499 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2600 +#: ../../library/ssl.rst:2505 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2606 +#: ../../library/ssl.rst:2511 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2618 +#: ../../library/ssl.rst:2523 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2621 +#: ../../library/ssl.rst:2526 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2623 +#: ../../library/ssl.rst:2528 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -2887,19 +2781,19 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2630 +#: ../../library/ssl.rst:2535 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2639 +#: ../../library/ssl.rst:2544 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2642 +#: ../../library/ssl.rst:2547 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -2907,15 +2801,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2648 +#: ../../library/ssl.rst:2553 msgid "Manual settings" msgstr "" -#: ../../library/ssl.rst:2651 +#: ../../library/ssl.rst:2556 msgid "Verifying certificates" msgstr "" -#: ../../library/ssl.rst:2653 +#: ../../library/ssl.rst:2558 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -2925,18 +2819,18 @@ msgid "" "`CERT_REQUIRED`. However, it is in itself not sufficient; you also have to " "check that the server certificate, which can be obtained by calling :meth:" "`SSLSocket.getpeercert`, matches the desired service. For many protocols " -"and applications, the service can be identified by the hostname; in this " -"case, the :func:`match_hostname` function can be used. This common check is " -"automatically performed when :attr:`SSLContext.check_hostname` is enabled." +"and applications, the service can be identified by the hostname. This common " +"check is automatically performed when :attr:`SSLContext.check_hostname` is " +"enabled." msgstr "" -#: ../../library/ssl.rst:2666 +#: ../../library/ssl.rst:2570 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`match_hostname`." msgstr "" -#: ../../library/ssl.rst:2670 +#: ../../library/ssl.rst:2574 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -2944,11 +2838,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2676 +#: ../../library/ssl.rst:2580 msgid "Protocol versions" msgstr "" -#: ../../library/ssl.rst:2678 +#: ../../library/ssl.rst:2582 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -2957,7 +2851,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2691 +#: ../../library/ssl.rst:2595 msgid "" "The SSL context created above will only allow TLSv1.2 and later (if " "supported by your system) connections to a server. :const:" @@ -2965,11 +2859,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2698 +#: ../../library/ssl.rst:2602 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2700 +#: ../../library/ssl.rst:2604 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -2982,32 +2876,32 @@ msgid "" "ciphers`` command on your system." msgstr "" -#: ../../library/ssl.rst:2711 +#: ../../library/ssl.rst:2615 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2713 +#: ../../library/ssl.rst:2617 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " "aware that OpenSSL's internal random number generator does not properly " "handle forked processes. Applications must change the PRNG state of the " "parent process if they use any SSL feature with :func:`os.fork`. Any " -"successful call of :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or :func:" -"`~ssl.RAND_pseudo_bytes` is sufficient." +"successful call of :func:`~ssl.RAND_add` or :func:`~ssl.RAND_bytes` is " +"sufficient." msgstr "" -#: ../../library/ssl.rst:2725 +#: ../../library/ssl.rst:2629 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2729 +#: ../../library/ssl.rst:2633 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2732 +#: ../../library/ssl.rst:2636 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3015,14 +2909,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2736 +#: ../../library/ssl.rst:2640 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2739 +#: ../../library/ssl.rst:2643 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3030,103 +2924,103 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2743 +#: ../../library/ssl.rst:2647 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2750 +#: ../../library/ssl.rst:2654 msgid "Class :class:`socket.socket`" msgstr "" -#: ../../library/ssl.rst:2750 +#: ../../library/ssl.rst:2654 msgid "Documentation of underlying :mod:`socket` class" msgstr "" -#: ../../library/ssl.rst:2753 +#: ../../library/ssl.rst:2657 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" msgstr "" -#: ../../library/ssl.rst:2753 +#: ../../library/ssl.rst:2657 msgid "Intro from the Apache HTTP Server documentation" msgstr "" -#: ../../library/ssl.rst:2756 +#: ../../library/ssl.rst:2660 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" msgstr "" -#: ../../library/ssl.rst:2756 +#: ../../library/ssl.rst:2660 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2759 +#: ../../library/ssl.rst:2663 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr "" -#: ../../library/ssl.rst:2759 +#: ../../library/ssl.rst:2663 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2762 +#: ../../library/ssl.rst:2666 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" msgstr "" -#: ../../library/ssl.rst:2762 +#: ../../library/ssl.rst:2666 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2765 +#: ../../library/ssl.rst:2669 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" msgstr "" -#: ../../library/ssl.rst:2765 +#: ../../library/ssl.rst:2669 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2768 +#: ../../library/ssl.rst:2672 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr "" -#: ../../library/ssl.rst:2768 +#: ../../library/ssl.rst:2672 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2771 +#: ../../library/ssl.rst:2675 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" msgstr "" -#: ../../library/ssl.rst:2771 +#: ../../library/ssl.rst:2675 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2774 +#: ../../library/ssl.rst:2678 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" msgstr "" -#: ../../library/ssl.rst:2774 +#: ../../library/ssl.rst:2678 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2776 +#: ../../library/ssl.rst:2680 msgid "" "`Mozilla's Server Side TLS recommendations `_" msgstr "" -#: ../../library/ssl.rst:2777 +#: ../../library/ssl.rst:2681 msgid "Mozilla" msgstr "Mozilla" @@ -3154,10 +3048,10 @@ msgstr "Transport Layer Security(傳輸層安全)" msgid "Secure Sockets Layer" msgstr "Secure Sockets Layer(安全 socket 層)" -#: ../../library/ssl.rst:2085 +#: ../../library/ssl.rst:1990 msgid "certificates" msgstr "certificates(憑證)" -#: ../../library/ssl.rst:2087 +#: ../../library/ssl.rst:1992 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" diff --git a/library/statistics.po b/library/statistics.po index 375ba27f0f..fb538a9623 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -242,7 +242,8 @@ msgid ":func:`correlation`" msgstr ":func:`correlation`" #: ../../library/statistics.rst:107 -msgid "Pearson's correlation coefficient for two variables." +#, fuzzy +msgid "Pearson and Spearman's correlation coefficients." msgstr "兩個變數之間的 Pearson 相關係數 (correlation coefficient)。" #: ../../library/statistics.rst:108 @@ -690,7 +691,7 @@ msgid "Raises :exc:`StatisticsError` if *data* is empty." msgstr "若 *data* 為空,則引發 :exc:`StatisticsError`。" #: ../../library/statistics.rst:461 ../../library/statistics.rst:531 -#: ../../library/statistics.rst:635 ../../library/statistics.rst:663 +#: ../../library/statistics.rst:635 msgid "Examples:" msgstr "範例:" @@ -902,20 +903,35 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),否則會引發 :exc:`StatisticsError`。" #: ../../library/statistics.rst:653 +#, fuzzy msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " "coefficient *r* takes values between -1 and +1. It measures the strength and " -"direction of the linear relationship, where +1 means very strong, positive " -"linear relationship, -1 very strong, negative linear relationship, and 0 no " -"linear relationship." +"direction of a linear relationship." msgstr "" "回傳兩輸入的 `Pearson 相關係數 (Pearson’s correlation coefficient) `_。Pearson 相關係數 " "*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向,其中 +1 表示強烈正線" "性相關,-1 表示強烈負線性相關,而 0 表示無線性關係。" -#: ../../library/statistics.rst:660 +#: ../../library/statistics.rst:659 +msgid "" +"If *method* is \"ranked\", computes `Spearman's rank correlation coefficient " +"`_ " +"for two inputs. The data is replaced by ranks. Ties are averaged so that " +"equal values receive the same rank. The resulting coefficient measures the " +"strength of a monotonic relationship." +msgstr "" + +#: ../../library/statistics.rst:665 +msgid "" +"Spearman's correlation coefficient is appropriate for ordinal data or for " +"continuous data that doesn't meet the linear proportion requirement for " +"Pearson's correlation coefficient." +msgstr "" + +#: ../../library/statistics.rst:669 msgid "" "Both inputs must be of the same length (no less than two), and need not to " "be constant, otherwise :exc:`StatisticsError` is raised." @@ -923,7 +939,17 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且不須為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:678 +#: ../../library/statistics.rst:672 +msgid "" +"Example with `Kepler's laws of planetary motion `_:" +msgstr "" + +#: ../../library/statistics.rst:699 +msgid "Added support for Spearman's rank correlation coefficient." +msgstr "" + +#: ../../library/statistics.rst:704 msgid "" "Return the slope and intercept of `simple linear regression `_ parameters estimated using " @@ -937,11 +963,11 @@ msgstr "" "迴歸描述自變數 (independent variable) *x* 與應變數 (dependent variable) *y* " "之間的關係,用以下的線性函式表示:" -#: ../../library/statistics.rst:684 +#: ../../library/statistics.rst:710 msgid "*y = slope \\* x + intercept + noise*" msgstr "*y = slope \\* x + intercept + noise*" -#: ../../library/statistics.rst:686 +#: ../../library/statistics.rst:712 msgid "" "where ``slope`` and ``intercept`` are the regression parameters that are " "estimated, and ``noise`` represents the variability of the data that was not " @@ -951,7 +977,7 @@ msgstr "" "其中 ``slope`` 和 ``intercept`` 是被估計的迴歸參數,而 ``noise`` 表示由線性迴" "歸未解釋的資料變異性(它等於應變數的預測值與實際值之差)。" -#: ../../library/statistics.rst:692 +#: ../../library/statistics.rst:718 msgid "" "Both inputs must be of the same length (no less than two), and the " "independent variable *x* cannot be constant; otherwise a :exc:" @@ -960,7 +986,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且自變數 *x* 不得為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:696 +#: ../../library/statistics.rst:722 msgid "" "For example, we can use the `release dates of the Monty Python films " "`_ to predict the " @@ -971,7 +997,7 @@ msgstr "" "wikipedia.org/wiki/Monty_Python#Films>`_\\ 來預測至 2019 年為止,假設他們保持" "固定的製作速度,應該會產生的 Monty Python 電影的累計數量。" -#: ../../library/statistics.rst:710 +#: ../../library/statistics.rst:736 msgid "" "If *proportional* is true, the independent variable *x* and the dependent " "variable *y* are assumed to be directly proportional. The data is fit to a " @@ -982,31 +1008,31 @@ msgstr "" "資料座落在通過原點的一直線上。由於 *intercept* 始終為 0.0,因此線性函式可簡化" "如下:" -#: ../../library/statistics.rst:716 +#: ../../library/statistics.rst:742 msgid "*y = slope \\* x + noise*" msgstr "*y = slope \\* x + noise*" -#: ../../library/statistics.rst:720 +#: ../../library/statistics.rst:746 msgid "Added support for *proportional*." msgstr "新增 *proportional* 的支援。" -#: ../../library/statistics.rst:724 +#: ../../library/statistics.rst:750 msgid "Exceptions" msgstr "例外" -#: ../../library/statistics.rst:726 +#: ../../library/statistics.rst:752 msgid "A single exception is defined:" msgstr "定義了一個單一的例外:" -#: ../../library/statistics.rst:730 +#: ../../library/statistics.rst:756 msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." msgstr ":exc:`ValueError` 的子類別,用於和統計相關的例外。" -#: ../../library/statistics.rst:734 +#: ../../library/statistics.rst:760 msgid ":class:`NormalDist` objects" msgstr ":class:`NormalDist` 物件" -#: ../../library/statistics.rst:736 +#: ../../library/statistics.rst:762 msgid "" ":class:`NormalDist` is a tool for creating and manipulating normal " "distributions of a `random variable `_ 的常態分布的工" "具。它是一個將量測資料的平均數與標準差視為單一實體的類別。" -#: ../../library/statistics.rst:742 +#: ../../library/statistics.rst:768 msgid "" "Normal distributions arise from the `Central Limit Theorem `_ and have a wide range of " @@ -1026,7 +1052,7 @@ msgstr "" "常態分布源自於\\ `中央極限定理 (Central Limit Theorem) `_,在統計學中有著廣泛的應用。" -#: ../../library/statistics.rst:748 +#: ../../library/statistics.rst:774 msgid "" "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean " "`_ and *sigma* represents the " @@ -1036,11 +1062,11 @@ msgstr "" "en.wikipedia.org/wiki/Arithmetic_mean>`_\\ 而 *sigma* 代表\\ `標準差 " "`_。" -#: ../../library/statistics.rst:753 +#: ../../library/statistics.rst:779 msgid "If *sigma* is negative, raises :exc:`StatisticsError`." msgstr "若 *sigma* 為負值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:757 +#: ../../library/statistics.rst:783 msgid "" "A read-only property for the `arithmetic mean `_ of a normal distribution." @@ -1048,14 +1074,14 @@ msgstr "" "常態分布中的\\ `算數平均數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:763 +#: ../../library/statistics.rst:789 msgid "" "A read-only property for the `median `_ of a normal distribution." msgstr "" "常態分布中的\\ `中位數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:769 +#: ../../library/statistics.rst:795 msgid "" "A read-only property for the `mode `_ of a normal distribution." @@ -1063,7 +1089,7 @@ msgstr "" "常態分布中的\\ `眾數 `_\\ 唯" "讀屬性。" -#: ../../library/statistics.rst:775 +#: ../../library/statistics.rst:801 msgid "" "A read-only property for the `standard deviation `_ of a normal distribution." @@ -1071,7 +1097,7 @@ msgstr "" "常態分布中的\\ `標準差 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:781 +#: ../../library/statistics.rst:807 msgid "" "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard " @@ -1080,7 +1106,7 @@ msgstr "" "常態分布中的\\ `變異數 `_\\ 唯讀屬" "性。" -#: ../../library/statistics.rst:787 +#: ../../library/statistics.rst:813 msgid "" "Makes a normal distribution instance with *mu* and *sigma* parameters " "estimated from the *data* using :func:`fmean` and :func:`stdev`." @@ -1088,7 +1114,7 @@ msgstr "" "利用 :func:`fmean` 與 :func:`stdev` 函式,估計 *data* 的 *mu* 與 *sigma* 參" "數,建立一個常態分布的實例。" -#: ../../library/statistics.rst:790 +#: ../../library/statistics.rst:816 msgid "" "The *data* can be any :term:`iterable` and should consist of values that can " "be converted to type :class:`float`. If *data* does not contain at least " @@ -1100,7 +1126,7 @@ msgstr "" "若 *data* 沒有包含至少兩個以上的元素在內,則引發 :exc:`StatisticsError`,因為" "至少需要一個點來估計中央值且至少需要兩個點來估計分散情形。" -#: ../../library/statistics.rst:798 +#: ../../library/statistics.rst:824 msgid "" "Generates *n* random samples for a given mean and standard deviation. " "Returns a :class:`list` of :class:`float` values." @@ -1108,7 +1134,7 @@ msgstr "" "給定平均值與標準差,產生 *n* 個隨機樣本。回傳一個由 :class:`float` 組成的 :" "class:`list`。" -#: ../../library/statistics.rst:801 +#: ../../library/statistics.rst:827 msgid "" "If *seed* is given, creates a new instance of the underlying random number " "generator. This is useful for creating reproducible results, even in a " @@ -1117,7 +1143,7 @@ msgstr "" "若有給定 *seed*,則會建立一個以此為基礎的亂數產生器實例。這對於建立可重現的結" "果很有幫助,即使在多執行緒情境下也是如此。" -#: ../../library/statistics.rst:807 +#: ../../library/statistics.rst:833 msgid "" "Using a `probability density function (pdf) `_, compute the relative likelihood that a " @@ -1129,7 +1155,7 @@ msgstr "" "值 *x* 的相對概度 (relative likelihood)。數學上,它是比率 ``P(x <= X < " "x+dx) / dx`` 在 *dx* 趨近於零時的極限值。" -#: ../../library/statistics.rst:813 +#: ../../library/statistics.rst:839 msgid "" "The relative likelihood is computed as the probability of a sample occurring " "in a narrow range divided by the width of the range (hence the word " @@ -1139,7 +1165,7 @@ msgstr "" "相對概度是樣本出現在狹窄範圍的機率,除以該範圍的寬度(故稱為「密度」)計算而" "得。由於概度是相對於其它點,故其值可大於 ``1.0``。" -#: ../../library/statistics.rst:820 +#: ../../library/statistics.rst:846 msgid "" "Using a `cumulative distribution function (cdf) `_, compute the probability that a " @@ -1150,7 +1176,7 @@ msgstr "" "wikipedia.org/wiki/Cumulative_distribution_function>`_ 計算隨機變數 *X* 小於" "或等於 *x* 的機率。數學上,它記為 ``P(X <= x)``。" -#: ../../library/statistics.rst:827 +#: ../../library/statistics.rst:853 msgid "" "Compute the inverse cumulative distribution function, also known as the " "`quantile function `_ or " @@ -1164,7 +1190,7 @@ msgstr "" "org/web/20190203145224/https://www.statisticshowto.datasciencecentral.com/" "inverse-distribution-function/>`_ 函式。數學上記為 ``x : P(X <= x) = p``。" -#: ../../library/statistics.rst:833 +#: ../../library/statistics.rst:859 msgid "" "Finds the value *x* of the random variable *X* such that the probability of " "the variable being less than or equal to that value equals the given " @@ -1172,7 +1198,7 @@ msgid "" msgstr "" "找出一個值 *x*,使得隨機變數 *X* 小於或等於該值的機率等於給定的機率 *p*。" -#: ../../library/statistics.rst:839 +#: ../../library/statistics.rst:865 msgid "" "Measures the agreement between two normal probability distributions. Returns " "a value between 0.0 and 1.0 giving `the overlapping area for the two " @@ -1181,7 +1207,7 @@ msgstr "" "衡量兩常態分布之間的一致性。回傳一個介於 0.0 與 1.0 之間的值,表示\\ `兩機率" "密度函式的重疊區域 `_。" -#: ../../library/statistics.rst:846 +#: ../../library/statistics.rst:872 msgid "" "Divide the normal distribution into *n* continuous intervals with equal " "probability. Returns a list of (n - 1) cut points separating the intervals." @@ -1189,7 +1215,7 @@ msgstr "" "將常態分布分割成 *n* 個具有相等機率的連續區間。回傳一個 list,包含 (n-1) 個切" "割區間的分隔點。" -#: ../../library/statistics.rst:850 +#: ../../library/statistics.rst:876 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate the " @@ -1199,7 +1225,7 @@ msgstr "" "*n* 設定為 100 表示百分位數,這會產生 99 個分隔點,將常態分布切割成大小相等的" "群組。" -#: ../../library/statistics.rst:856 +#: ../../library/statistics.rst:882 msgid "" "Compute the `Standard Score `_ describing *x* in terms of the number of standard " @@ -1210,7 +1236,7 @@ msgstr "" "probability-and-statistics/z-score/>`_,用以描述在常態分布中,*x* 高出或低於" "平均數幾個標準差:``(x - mean) / stdev``。" -#: ../../library/statistics.rst:864 +#: ../../library/statistics.rst:890 msgid "" "Instances of :class:`NormalDist` support addition, subtraction, " "multiplication and division by a constant. These operations are used for " @@ -1219,14 +1245,14 @@ msgstr "" ":class:`NormalDist` 的實例支援對常數的加法、減法、乘法與除法。這些操作用於平" "移與縮放。例如:" -#: ../../library/statistics.rst:874 +#: ../../library/statistics.rst:900 msgid "" "Dividing a constant by an instance of :class:`NormalDist` is not supported " "because the result wouldn't be normally distributed." msgstr "" "不支援將常數除以 :class:`NormalDist` 的實例,因為結果將不符合常態分布。" -#: ../../library/statistics.rst:877 +#: ../../library/statistics.rst:903 msgid "" "Since normal distributions arise from additive effects of independent " "variables, it is possible to `add and subtract two independent normally " @@ -1239,15 +1265,15 @@ msgstr "" "Sum_of_normally_distributed_random_variables>`_,並且表示為 :class:" "`NormalDist` 的實例。例如:" -#: ../../library/statistics.rst:897 +#: ../../library/statistics.rst:923 msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:899 +#: ../../library/statistics.rst:925 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:901 +#: ../../library/statistics.rst:927 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1259,7 +1285,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:914 +#: ../../library/statistics.rst:940 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1267,7 +1293,7 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:924 +#: ../../library/statistics.rst:950 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1277,7 +1303,7 @@ msgstr "" "樣本以進行 `Monte Carlo 模擬 `_:" -#: ../../library/statistics.rst:940 +#: ../../library/statistics.rst:966 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1287,7 +1313,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:945 +#: ../../library/statistics.rst:971 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1300,11 +1326,11 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:976 +#: ../../library/statistics.rst:1003 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:978 +#: ../../library/statistics.rst:1005 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1315,7 +1341,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:983 +#: ../../library/statistics.rst:1010 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1324,13 +1350,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:996 +#: ../../library/statistics.rst:1023 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1005 +#: ../../library/statistics.rst:1032 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1341,7 +1367,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1020 +#: ../../library/statistics.rst:1047 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,21 +122,21 @@ msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 #: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 -#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 -#: ../../library/stdtypes.rst:1127 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 +#: ../../library/stdtypes.rst:1166 msgid "Operation" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 -#: ../../library/stdtypes.rst:922 ../../library/stdtypes.rst:1127 +#: ../../library/stdtypes.rst:961 ../../library/stdtypes.rst:1166 msgid "Result" msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 -#: ../../library/stdtypes.rst:1127 ../../library/stdtypes.rst:2372 -#: ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 +#: ../../library/stdtypes.rst:1166 ../../library/stdtypes.rst:2416 +#: ../../library/stdtypes.rst:3634 msgid "Notes" msgstr "註解" @@ -149,9 +149,9 @@ msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 -#: ../../library/stdtypes.rst:924 ../../library/stdtypes.rst:927 -#: ../../library/stdtypes.rst:1138 ../../library/stdtypes.rst:2378 -#: ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:963 ../../library/stdtypes.rst:966 +#: ../../library/stdtypes.rst:1177 ../../library/stdtypes.rst:2422 +#: ../../library/stdtypes.rst:3640 msgid "\\(1)" msgstr "\\(1)" @@ -164,9 +164,9 @@ msgid "if *x* is false, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1166 -#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:2384 -#: ../../library/stdtypes.rst:3600 ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1205 +#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:2428 +#: ../../library/stdtypes.rst:3644 ../../library/stdtypes.rst:3646 msgid "\\(2)" msgstr "\\(2)" @@ -178,19 +178,19 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:936 -#: ../../library/stdtypes.rst:1169 ../../library/stdtypes.rst:2386 -#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:2390 -#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3604 -#: ../../library/stdtypes.rst:3606 ../../library/stdtypes.rst:3608 -#: ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:975 +#: ../../library/stdtypes.rst:1208 ../../library/stdtypes.rst:2430 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:2434 +#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:3650 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:3654 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:973 -#: ../../library/stdtypes.rst:1177 ../../library/stdtypes.rst:2418 -#: ../../library/stdtypes.rst:3640 +#: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:1012 +#: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:2462 +#: ../../library/stdtypes.rst:3684 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2349 -#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3567 -#: ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2393 +#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:3634 msgid "Meaning" msgstr "" @@ -513,8 +513,8 @@ msgid "" "zero." msgstr "" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1159 -#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1198 +#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3671 msgid "\\(6)" msgstr "\\(6)" @@ -551,10 +551,10 @@ msgid "*x* to the power *y*" msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 -#: ../../library/stdtypes.rst:1148 ../../library/stdtypes.rst:1151 -#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:2408 -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3623 -#: ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:1187 ../../library/stdtypes.rst:1190 +#: ../../library/stdtypes.rst:2449 ../../library/stdtypes.rst:2452 +#: ../../library/stdtypes.rst:2455 ../../library/stdtypes.rst:3667 +#: ../../library/stdtypes.rst:3674 msgid "\\(5)" msgstr "\\(5)" @@ -607,8 +607,9 @@ msgstr "" #: ../../library/stdtypes.rst:355 msgid "" -"See https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedNumericType." -"txt for a complete list of code points with the ``Nd`` property." +"See `the Unicode Standard `_ for a complete list of code points with the ``Nd`` " +"property." msgstr "" #: ../../library/stdtypes.rst:359 @@ -689,9 +690,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "" #: ../../library/stdtypes.rst:415 ../../library/stdtypes.rst:418 -#: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1172 -#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:2398 -#: ../../library/stdtypes.rst:3612 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1211 +#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:2442 +#: ../../library/stdtypes.rst:3656 ../../library/stdtypes.rst:3660 msgid "\\(4)" msgstr "\\(4)" @@ -880,36 +881,41 @@ msgstr "" #: ../../library/stdtypes.rst:606 msgid "" -"Return a pair of integers whose ratio is exactly equal to the original " -"integer and with a positive denominator. The integer ratio of integers " -"(whole numbers) is always the integer as the numerator and ``1`` as the " -"denominator." +"Return a pair of integers whose ratio is equal to the original integer and " +"has a positive denominator. The integer ratio of integers (whole numbers) " +"is always the integer as the numerator and ``1`` as the denominator." msgstr "" -#: ../../library/stdtypes.rst:614 +#: ../../library/stdtypes.rst:615 +msgid "" +"Returns ``True``. Exists for duck type compatibility with :meth:`float." +"is_integer`." +msgstr "" + +#: ../../library/stdtypes.rst:620 msgid "Additional Methods on Float" msgstr "" -#: ../../library/stdtypes.rst:616 +#: ../../library/stdtypes.rst:622 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -#: ../../library/stdtypes.rst:621 +#: ../../library/stdtypes.rst:627 msgid "" -"Return a pair of integers whose ratio is exactly equal to the original float " -"and with a positive denominator. Raises :exc:`OverflowError` on infinities " -"and a :exc:`ValueError` on NaNs." +"Return a pair of integers whose ratio is exactly equal to the original " +"float. The ratio is in lowest terms and has a positive denominator. Raises :" +"exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." msgstr "" -#: ../../library/stdtypes.rst:628 +#: ../../library/stdtypes.rst:634 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" -#: ../../library/stdtypes.rst:636 +#: ../../library/stdtypes.rst:642 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -919,30 +925,30 @@ msgid "" "numerical work." msgstr "" -#: ../../library/stdtypes.rst:647 +#: ../../library/stdtypes.rst:653 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " "leading ``0x`` and a trailing ``p`` and exponent." msgstr "" -#: ../../library/stdtypes.rst:655 +#: ../../library/stdtypes.rst:661 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." msgstr "" -#: ../../library/stdtypes.rst:660 +#: ../../library/stdtypes.rst:666 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" -#: ../../library/stdtypes.rst:663 +#: ../../library/stdtypes.rst:669 msgid "A hexadecimal string takes the form::" msgstr "" -#: ../../library/stdtypes.rst:667 +#: ../../library/stdtypes.rst:673 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -956,7 +962,7 @@ msgid "" "by :meth:`float.fromhex`." msgstr "" -#: ../../library/stdtypes.rst:680 +#: ../../library/stdtypes.rst:686 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " @@ -964,17 +970,17 @@ msgid "" "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" -#: ../../library/stdtypes.rst:690 +#: ../../library/stdtypes.rst:696 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" -#: ../../library/stdtypes.rst:700 +#: ../../library/stdtypes.rst:706 msgid "Hashing of numeric types" msgstr "" -#: ../../library/stdtypes.rst:702 +#: ../../library/stdtypes.rst:708 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " "that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." @@ -990,24 +996,24 @@ msgid "" "of :data:`sys.hash_info`." msgstr "" -#: ../../library/stdtypes.rst:717 +#: ../../library/stdtypes.rst:723 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" -#: ../../library/stdtypes.rst:720 +#: ../../library/stdtypes.rst:726 msgid "Here are the rules in detail:" msgstr "" -#: ../../library/stdtypes.rst:722 +#: ../../library/stdtypes.rst:728 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " "P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" -#: ../../library/stdtypes.rst:726 +#: ../../library/stdtypes.rst:732 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " @@ -1015,20 +1021,20 @@ msgid "" "value ``sys.hash_info.inf``." msgstr "" -#: ../../library/stdtypes.rst:731 +#: ../../library/stdtypes.rst:737 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:735 +#: ../../library/stdtypes.rst:741 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " "(respectively)." msgstr "" -#: ../../library/stdtypes.rst:739 +#: ../../library/stdtypes.rst:745 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " "imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." @@ -1037,32 +1043,71 @@ msgid "" "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:747 +#: ../../library/stdtypes.rst:753 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -#: ../../library/stdtypes.rst:802 -msgid "Iterator Types" +#: ../../library/stdtypes.rst:808 +msgid "Boolean Type - :class:`bool`" msgstr "" #: ../../library/stdtypes.rst:810 msgid "" +"Booleans represent truth values. The :class:`bool` type has exactly two " +"constant instances: ``True`` and ``False``." +msgstr "" + +#: ../../library/stdtypes.rst:818 +msgid "" +"The built-in function :func:`bool` converts any value to a boolean, if the " +"value can be interpreted as a truth value (see section :ref:`truth` above)." +msgstr "" + +#: ../../library/stdtypes.rst:821 +msgid "" +"For logical operations, use the :ref:`boolean operators ` ``and``, " +"``or`` and ``not``. When applying the bitwise operators ``&``, ``|``, ``^`` " +"to two booleans, they return a bool equivalent to the logical operations " +"\"and\", \"or\", \"xor\". However, the logical operators ``and``, ``or`` and " +"``!=`` should be preferred over ``&``, ``|`` and ``^``." +msgstr "" + +#: ../../library/stdtypes.rst:830 +msgid "" +"The use of the bitwise inversion operator ``~`` is deprecated and will raise " +"an error in Python 3.14." +msgstr "" + +#: ../../library/stdtypes.rst:833 +msgid "" +":class:`bool` is a subclass of :class:`int` (see :ref:`typesnumeric`). In " +"many numeric contexts, ``False`` and ``True`` behave like the integers 0 and " +"1, respectively. However, relying on this is discouraged; explicitly convert " +"using :func:`int` instead." +msgstr "" + +#: ../../library/stdtypes.rst:841 +msgid "Iterator Types" +msgstr "" + +#: ../../library/stdtypes.rst:849 +msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " "support iteration. Sequences, described below in more detail, always " "support the iteration methods." msgstr "" -#: ../../library/stdtypes.rst:815 +#: ../../library/stdtypes.rst:854 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" -#: ../../library/stdtypes.rst:822 +#: ../../library/stdtypes.rst:861 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1074,13 +1119,13 @@ msgid "" "in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:831 +#: ../../library/stdtypes.rst:870 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" -#: ../../library/stdtypes.rst:837 +#: ../../library/stdtypes.rst:876 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " "containers and iterators to be used with the :keyword:`for` and :keyword:" @@ -1088,7 +1133,7 @@ msgid "" "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:846 +#: ../../library/stdtypes.rst:885 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1096,7 +1141,7 @@ msgid "" "Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:851 +#: ../../library/stdtypes.rst:890 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1104,18 +1149,18 @@ msgid "" "the iterator protocol." msgstr "" -#: ../../library/stdtypes.rst:856 +#: ../../library/stdtypes.rst:895 msgid "" "Once an iterator's :meth:`~iterator.__next__` method raises :exc:" "`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" -#: ../../library/stdtypes.rst:864 +#: ../../library/stdtypes.rst:903 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:866 +#: ../../library/stdtypes.rst:905 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`__iter__` method is " @@ -1125,11 +1170,11 @@ msgid "" "found in :ref:`the documentation for the yield expression `." msgstr "" -#: ../../library/stdtypes.rst:878 +#: ../../library/stdtypes.rst:917 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:880 +#: ../../library/stdtypes.rst:919 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1137,11 +1182,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:889 +#: ../../library/stdtypes.rst:928 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:893 +#: ../../library/stdtypes.rst:932 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1149,7 +1194,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:898 +#: ../../library/stdtypes.rst:937 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1157,7 +1202,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:903 +#: ../../library/stdtypes.rst:942 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1165,125 +1210,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:924 +#: ../../library/stdtypes.rst:963 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:924 +#: ../../library/stdtypes.rst:963 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:927 +#: ../../library/stdtypes.rst:966 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:927 +#: ../../library/stdtypes.rst:966 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:930 +#: ../../library/stdtypes.rst:969 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:930 +#: ../../library/stdtypes.rst:969 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:930 +#: ../../library/stdtypes.rst:969 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:933 +#: ../../library/stdtypes.rst:972 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:933 +#: ../../library/stdtypes.rst:972 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:933 +#: ../../library/stdtypes.rst:972 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:936 +#: ../../library/stdtypes.rst:975 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:936 +#: ../../library/stdtypes.rst:975 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:938 +#: ../../library/stdtypes.rst:977 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:938 +#: ../../library/stdtypes.rst:977 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:938 +#: ../../library/stdtypes.rst:977 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:940 +#: ../../library/stdtypes.rst:979 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:940 +#: ../../library/stdtypes.rst:979 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:940 +#: ../../library/stdtypes.rst:979 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:943 +#: ../../library/stdtypes.rst:982 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:943 +#: ../../library/stdtypes.rst:982 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:945 +#: ../../library/stdtypes.rst:984 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:945 +#: ../../library/stdtypes.rst:984 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:947 +#: ../../library/stdtypes.rst:986 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:947 +#: ../../library/stdtypes.rst:986 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:949 +#: ../../library/stdtypes.rst:988 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:949 +#: ../../library/stdtypes.rst:988 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:949 ../../library/stdtypes.rst:3598 +#: ../../library/stdtypes.rst:988 ../../library/stdtypes.rst:3642 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:953 +#: ../../library/stdtypes.rst:992 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:953 +#: ../../library/stdtypes.rst:992 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:957 +#: ../../library/stdtypes.rst:996 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1292,7 +1337,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:967 +#: ../../library/stdtypes.rst:1006 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " @@ -1301,7 +1346,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:976 +#: ../../library/stdtypes.rst:1015 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1309,7 +1354,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:985 +#: ../../library/stdtypes.rst:1024 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1317,7 +1362,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:997 +#: ../../library/stdtypes.rst:1036 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1325,20 +1370,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1009 +#: ../../library/stdtypes.rst:1048 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1013 +#: ../../library/stdtypes.rst:1052 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " "still ``0``." msgstr "" -#: ../../library/stdtypes.rst:1018 +#: ../../library/stdtypes.rst:1057 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``. If *i* or *j* is greater than " @@ -1347,7 +1392,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1025 +#: ../../library/stdtypes.rst:1064 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1360,7 +1405,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1036 +#: ../../library/stdtypes.rst:1075 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1368,14 +1413,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1041 +#: ../../library/stdtypes.rst:1080 msgid "" "if concatenating :class:`str` objects, you can build a list and use :meth:" "`str.join` at the end or else write to an :class:`io.StringIO` instance and " "retrieve its value when complete" msgstr "" -#: ../../library/stdtypes.rst:1045 +#: ../../library/stdtypes.rst:1084 msgid "" "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." "join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" @@ -1383,22 +1428,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1050 +#: ../../library/stdtypes.rst:1089 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1052 +#: ../../library/stdtypes.rst:1091 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1056 +#: ../../library/stdtypes.rst:1095 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -#: ../../library/stdtypes.rst:1061 +#: ../../library/stdtypes.rst:1100 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1408,42 +1453,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1072 +#: ../../library/stdtypes.rst:1111 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1079 +#: ../../library/stdtypes.rst:1118 msgid "" "The only operation that immutable sequence types generally implement that is " "not also implemented by mutable sequence types is support for the :func:" "`hash` built-in." msgstr "" -#: ../../library/stdtypes.rst:1083 +#: ../../library/stdtypes.rst:1122 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " "to be used as :class:`dict` keys and stored in :class:`set` and :class:" "`frozenset` instances." msgstr "" -#: ../../library/stdtypes.rst:1087 +#: ../../library/stdtypes.rst:1126 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1094 +#: ../../library/stdtypes.rst:1133 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1101 +#: ../../library/stdtypes.rst:1140 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -#: ../../library/stdtypes.rst:1105 +#: ../../library/stdtypes.rst:1144 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1451,145 +1496,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1129 +#: ../../library/stdtypes.rst:1168 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1129 +#: ../../library/stdtypes.rst:1168 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1132 +#: ../../library/stdtypes.rst:1171 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1132 +#: ../../library/stdtypes.rst:1171 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1136 +#: ../../library/stdtypes.rst:1175 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1136 +#: ../../library/stdtypes.rst:1175 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1138 +#: ../../library/stdtypes.rst:1177 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1138 +#: ../../library/stdtypes.rst:1177 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1141 +#: ../../library/stdtypes.rst:1180 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1141 +#: ../../library/stdtypes.rst:1180 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1144 +#: ../../library/stdtypes.rst:1183 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1144 +#: ../../library/stdtypes.rst:1183 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1148 +#: ../../library/stdtypes.rst:1187 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1148 +#: ../../library/stdtypes.rst:1187 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1151 +#: ../../library/stdtypes.rst:1190 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1151 +#: ../../library/stdtypes.rst:1190 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1154 +#: ../../library/stdtypes.rst:1193 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1154 +#: ../../library/stdtypes.rst:1193 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1159 +#: ../../library/stdtypes.rst:1198 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1159 +#: ../../library/stdtypes.rst:1198 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1162 +#: ../../library/stdtypes.rst:1201 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1162 +#: ../../library/stdtypes.rst:1201 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:1205 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:1205 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1169 +#: ../../library/stdtypes.rst:1208 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1169 +#: ../../library/stdtypes.rst:1208 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1172 +#: ../../library/stdtypes.rst:1211 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1172 +#: ../../library/stdtypes.rst:1211 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1180 +#: ../../library/stdtypes.rst:1219 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1183 +#: ../../library/stdtypes.rst:1222 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1187 +#: ../../library/stdtypes.rst:1226 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1190 +#: ../../library/stdtypes.rst:1229 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1195 +#: ../../library/stdtypes.rst:1234 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1598,11 +1643,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1201 +#: ../../library/stdtypes.rst:1240 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1205 +#: ../../library/stdtypes.rst:1244 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -1610,39 +1655,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1214 +#: ../../library/stdtypes.rst:1253 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1218 +#: ../../library/stdtypes.rst:1257 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1224 +#: ../../library/stdtypes.rst:1263 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1226 +#: ../../library/stdtypes.rst:1265 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1227 +#: ../../library/stdtypes.rst:1266 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1228 +#: ../../library/stdtypes.rst:1267 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1229 +#: ../../library/stdtypes.rst:1268 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1231 +#: ../../library/stdtypes.rst:1270 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -1653,20 +1698,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1240 +#: ../../library/stdtypes.rst:1279 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1243 +#: ../../library/stdtypes.rst:1282 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1249 +#: ../../library/stdtypes.rst:1288 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1674,13 +1719,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1254 +#: ../../library/stdtypes.rst:1293 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1257 +#: ../../library/stdtypes.rst:1296 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -1689,19 +1734,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1264 +#: ../../library/stdtypes.rst:1303 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1267 +#: ../../library/stdtypes.rst:1306 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1270 +#: ../../library/stdtypes.rst:1309 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -1709,7 +1754,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1275 +#: ../../library/stdtypes.rst:1314 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -1717,12 +1762,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1280 +#: ../../library/stdtypes.rst:1319 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1284 +#: ../../library/stdtypes.rst:1323 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -1730,11 +1775,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1293 +#: ../../library/stdtypes.rst:1332 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1297 +#: ../../library/stdtypes.rst:1336 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1743,27 +1788,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1305 +#: ../../library/stdtypes.rst:1344 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1307 +#: ../../library/stdtypes.rst:1346 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1308 +#: ../../library/stdtypes.rst:1347 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1348 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1310 +#: ../../library/stdtypes.rst:1349 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1312 +#: ../../library/stdtypes.rst:1351 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -1774,7 +1819,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1320 +#: ../../library/stdtypes.rst:1359 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -1783,30 +1828,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1326 +#: ../../library/stdtypes.rst:1365 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1329 +#: ../../library/stdtypes.rst:1368 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1337 +#: ../../library/stdtypes.rst:1376 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1341 +#: ../../library/stdtypes.rst:1380 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1348 +#: ../../library/stdtypes.rst:1387 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1815,38 +1860,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1354 +#: ../../library/stdtypes.rst:1393 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1358 +#: ../../library/stdtypes.rst:1397 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1362 +#: ../../library/stdtypes.rst:1401 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1367 +#: ../../library/stdtypes.rst:1406 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1371 +#: ../../library/stdtypes.rst:1410 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1388 +#: ../../library/stdtypes.rst:1427 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1854,23 +1899,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1395 +#: ../../library/stdtypes.rst:1434 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1400 +#: ../../library/stdtypes.rst:1439 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1404 +#: ../../library/stdtypes.rst:1443 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1407 +#: ../../library/stdtypes.rst:1446 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -1879,14 +1924,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1413 +#: ../../library/stdtypes.rst:1452 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1433 +#: ../../library/stdtypes.rst:1472 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1896,121 +1941,121 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1440 +#: ../../library/stdtypes.rst:1479 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1446 +#: ../../library/stdtypes.rst:1485 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1451 +#: ../../library/stdtypes.rst:1490 msgid "" "The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1457 +#: ../../library/stdtypes.rst:1496 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1469 +#: ../../library/stdtypes.rst:1508 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1471 +#: ../../library/stdtypes.rst:1510 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1476 +#: ../../library/stdtypes.rst:1515 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1477 +#: ../../library/stdtypes.rst:1516 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1478 +#: ../../library/stdtypes.rst:1517 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1480 +#: ../../library/stdtypes.rst:1519 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1483 +#: ../../library/stdtypes.rst:1522 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1487 +#: ../../library/stdtypes.rst:1526 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported escape sequences, and the ``r`` (\"raw\") prefix that " "disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1491 +#: ../../library/stdtypes.rst:1530 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1494 +#: ../../library/stdtypes.rst:1533 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1500 +#: ../../library/stdtypes.rst:1539 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1504 +#: ../../library/stdtypes.rst:1543 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1516 +#: ../../library/stdtypes.rst:1555 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1520 +#: ../../library/stdtypes.rst:1559 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " "or nicely printable string representation of *object*. For string objects, " "this is the string itself. If *object* does not have a :meth:`~object." -"__str__` method, then :func:`str` falls back to returning :meth:" +"__str__` method, then :func:`str` falls back to returning :func:" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1532 +#: ../../library/stdtypes.rst:1571 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2022,7 +2067,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1541 +#: ../../library/stdtypes.rst:1580 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2030,7 +2075,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1549 +#: ../../library/stdtypes.rst:1588 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2038,17 +2083,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1561 +#: ../../library/stdtypes.rst:1600 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1566 +#: ../../library/stdtypes.rst:1605 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1569 +#: ../../library/stdtypes.rst:1608 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2058,33 +2103,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1576 +#: ../../library/stdtypes.rst:1615 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1582 +#: ../../library/stdtypes.rst:1621 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1585 +#: ../../library/stdtypes.rst:1624 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1592 +#: ../../library/stdtypes.rst:1631 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1595 +#: ../../library/stdtypes.rst:1634 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2093,43 +2138,44 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1601 +#: ../../library/stdtypes.rst:1640 msgid "" -"The casefolding algorithm is described in section 3.13 of the Unicode " -"Standard." +"The casefolding algorithm is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:1609 +#: ../../library/stdtypes.rst:1649 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1617 +#: ../../library/stdtypes.rst:1657 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1621 +#: ../../library/stdtypes.rst:1661 msgid "" "If *sub* is empty, returns the number of empty strings between characters " "which is the length of the string plus one." msgstr "" -#: ../../library/stdtypes.rst:1627 +#: ../../library/stdtypes.rst:1667 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1629 ../../library/stdtypes.rst:2764 +#: ../../library/stdtypes.rst:1669 ../../library/stdtypes.rst:2808 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1632 +#: ../../library/stdtypes.rst:1672 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2138,24 +2184,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1639 +#: ../../library/stdtypes.rst:1679 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:1644 ../../library/stdtypes.rst:2783 +#: ../../library/stdtypes.rst:1684 ../../library/stdtypes.rst:2827 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1647 ../../library/stdtypes.rst:2786 +#: ../../library/stdtypes.rst:1687 ../../library/stdtypes.rst:2830 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1654 +#: ../../library/stdtypes.rst:1694 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2163,7 +2209,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1662 +#: ../../library/stdtypes.rst:1702 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2179,21 +2225,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1683 +#: ../../library/stdtypes.rst:1723 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1689 +#: ../../library/stdtypes.rst:1729 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1699 +#: ../../library/stdtypes.rst:1739 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2203,13 +2249,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1709 +#: ../../library/stdtypes.rst:1749 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1713 +#: ../../library/stdtypes.rst:1753 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2220,26 +2266,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1722 +#: ../../library/stdtypes.rst:1762 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1730 +#: ../../library/stdtypes.rst:1770 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1746 +#: ../../library/stdtypes.rst:1786 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1752 +#: ../../library/stdtypes.rst:1792 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2247,24 +2293,26 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1760 +#: ../../library/stdtypes.rst:1800 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " "those characters defined in the Unicode character database as \"Letter\", i." "e., those with general category property being one of \"Lm\", \"Lt\", " -"\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the " -"\"Alphabetic\" property defined in the Unicode Standard." +"\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic " +"property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' " +"of the Unicode Standard `_." msgstr "" -#: ../../library/stdtypes.rst:1769 +#: ../../library/stdtypes.rst:1811 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1778 +#: ../../library/stdtypes.rst:1820 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2273,7 +2321,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1788 +#: ../../library/stdtypes.rst:1830 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2283,32 +2331,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1798 +#: ../../library/stdtypes.rst:1840 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1801 +#: ../../library/stdtypes.rst:1843 msgid "" -"Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " -"identifier, such as :keyword:`def` and :keyword:`class`." +":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " +"reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1804 +#: ../../library/stdtypes.rst:1846 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1817 +#: ../../library/stdtypes.rst:1859 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1823 +#: ../../library/stdtypes.rst:1865 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2318,7 +2366,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1833 +#: ../../library/stdtypes.rst:1875 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2329,20 +2377,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1844 +#: ../../library/stdtypes.rst:1886 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1847 +#: ../../library/stdtypes.rst:1889 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:1855 +#: ../../library/stdtypes.rst:1897 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -2350,13 +2398,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1862 +#: ../../library/stdtypes.rst:1904 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1880 +#: ../../library/stdtypes.rst:1922 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -2364,26 +2412,27 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1888 +#: ../../library/stdtypes.rst:1930 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1895 +#: ../../library/stdtypes.rst:1937 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1898 +#: ../../library/stdtypes.rst:1940 msgid "" -"The lowercasing algorithm used is described in section 3.13 of the Unicode " -"Standard." +"The lowercasing algorithm used is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:1904 +#: ../../library/stdtypes.rst:1947 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2392,19 +2441,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1914 +#: ../../library/stdtypes.rst:1957 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1925 +#: ../../library/stdtypes.rst:1968 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1927 +#: ../../library/stdtypes.rst:1970 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -2412,7 +2461,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1932 +#: ../../library/stdtypes.rst:1975 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in x will be mapped to the character at " @@ -2420,7 +2469,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1940 +#: ../../library/stdtypes.rst:1983 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2428,47 +2477,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1948 +#: ../../library/stdtypes.rst:1991 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" -#: ../../library/stdtypes.rst:1962 +#: ../../library/stdtypes.rst:2005 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string::" msgstr "" -#: ../../library/stdtypes.rst:1976 +#: ../../library/stdtypes.rst:2019 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If the optional argument *count* is given, only the first *count* " "occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:1983 +#: ../../library/stdtypes.rst:2026 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:1990 +#: ../../library/stdtypes.rst:2033 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1996 +#: ../../library/stdtypes.rst:2039 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2003 +#: ../../library/stdtypes.rst:2046 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2476,7 +2525,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2011 +#: ../../library/stdtypes.rst:2054 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -2485,7 +2534,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2020 +#: ../../library/stdtypes.rst:2063 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2494,13 +2543,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2030 +#: ../../library/stdtypes.rst:2073 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2040 +#: ../../library/stdtypes.rst:2083 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -2509,7 +2558,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2046 +#: ../../library/stdtypes.rst:2089 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2518,23 +2567,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2052 ../../library/stdtypes.rst:2068 -#: ../../library/stdtypes.rst:2120 ../../library/stdtypes.rst:2188 -#: ../../library/stdtypes.rst:2255 ../../library/stdtypes.rst:3102 -#: ../../library/stdtypes.rst:3118 ../../library/stdtypes.rst:3209 -#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:3250 -#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3292 -#: ../../library/stdtypes.rst:3306 ../../library/stdtypes.rst:3324 -#: ../../library/stdtypes.rst:3351 ../../library/stdtypes.rst:3374 -#: ../../library/stdtypes.rst:3401 ../../library/stdtypes.rst:3443 -#: ../../library/stdtypes.rst:3467 +#: ../../library/stdtypes.rst:2095 ../../library/stdtypes.rst:2111 +#: ../../library/stdtypes.rst:2163 ../../library/stdtypes.rst:2231 +#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3146 +#: ../../library/stdtypes.rst:3162 ../../library/stdtypes.rst:3253 +#: ../../library/stdtypes.rst:3269 ../../library/stdtypes.rst:3294 +#: ../../library/stdtypes.rst:3308 ../../library/stdtypes.rst:3336 +#: ../../library/stdtypes.rst:3350 ../../library/stdtypes.rst:3368 +#: ../../library/stdtypes.rst:3395 ../../library/stdtypes.rst:3418 +#: ../../library/stdtypes.rst:3445 ../../library/stdtypes.rst:3487 +#: ../../library/stdtypes.rst:3511 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2061 +#: ../../library/stdtypes.rst:2104 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -2544,131 +2593,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2083 +#: ../../library/stdtypes.rst:2126 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2087 +#: ../../library/stdtypes.rst:2130 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2091 +#: ../../library/stdtypes.rst:2134 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2091 +#: ../../library/stdtypes.rst:2134 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2093 +#: ../../library/stdtypes.rst:2136 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2093 +#: ../../library/stdtypes.rst:2136 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2095 +#: ../../library/stdtypes.rst:2138 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2095 +#: ../../library/stdtypes.rst:2138 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2097 +#: ../../library/stdtypes.rst:2140 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2097 +#: ../../library/stdtypes.rst:2140 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2099 +#: ../../library/stdtypes.rst:2142 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2099 +#: ../../library/stdtypes.rst:2142 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2101 +#: ../../library/stdtypes.rst:2144 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2101 +#: ../../library/stdtypes.rst:2144 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2103 +#: ../../library/stdtypes.rst:2146 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2103 +#: ../../library/stdtypes.rst:2146 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2105 +#: ../../library/stdtypes.rst:2148 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2105 +#: ../../library/stdtypes.rst:2148 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2107 +#: ../../library/stdtypes.rst:2150 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2107 +#: ../../library/stdtypes.rst:2150 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2109 +#: ../../library/stdtypes.rst:2152 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2109 +#: ../../library/stdtypes.rst:2152 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2111 +#: ../../library/stdtypes.rst:2154 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2111 +#: ../../library/stdtypes.rst:2154 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2113 +#: ../../library/stdtypes.rst:2156 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2113 +#: ../../library/stdtypes.rst:2156 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2118 +#: ../../library/stdtypes.rst:2161 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2127 +#: ../../library/stdtypes.rst:2170 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2136 +#: ../../library/stdtypes.rst:2179 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2146 +#: ../../library/stdtypes.rst:2189 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2676,7 +2725,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2154 +#: ../../library/stdtypes.rst:2197 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -2685,7 +2734,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2165 +#: ../../library/stdtypes.rst:2208 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2693,20 +2742,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2178 +#: ../../library/stdtypes.rst:2221 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2185 +#: ../../library/stdtypes.rst:2228 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2193 ../../library/stdtypes.rst:3411 +#: ../../library/stdtypes.rst:2236 ../../library/stdtypes.rst:3455 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 " @@ -2714,19 +2763,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2201 +#: ../../library/stdtypes.rst:2244 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2204 +#: ../../library/stdtypes.rst:2247 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2219 +#: ../../library/stdtypes.rst:2262 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -2738,19 +2787,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2228 +#: ../../library/stdtypes.rst:2271 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2231 +#: ../../library/stdtypes.rst:2274 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2237 +#: ../../library/stdtypes.rst:2280 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -2759,13 +2808,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2243 +#: ../../library/stdtypes.rst:2286 msgid "" -"The uppercasing algorithm used is described in section 3.13 of the Unicode " -"Standard." +"The uppercasing algorithm used is `described in section 3.13 'Default Case " +"Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2249 +#: ../../library/stdtypes.rst:2293 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -2773,11 +2823,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2267 +#: ../../library/stdtypes.rst:2311 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2280 +#: ../../library/stdtypes.rst:2324 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 " @@ -2788,7 +2838,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2288 +#: ../../library/stdtypes.rst:2332 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2798,7 +2848,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2294 +#: ../../library/stdtypes.rst:2338 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 " @@ -2806,36 +2856,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3522 +#: ../../library/stdtypes.rst:2348 ../../library/stdtypes.rst:3566 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3525 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3527 +#: ../../library/stdtypes.rst:2353 ../../library/stdtypes.rst:3571 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3530 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3533 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 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:2319 ../../library/stdtypes.rst:3537 +#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2843,15 +2893,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2324 ../../library/stdtypes.rst:3542 +#: ../../library/stdtypes.rst:2368 ../../library/stdtypes.rst:3586 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2326 ../../library/stdtypes.rst:3544 +#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2328 +#: ../../library/stdtypes.rst:2372 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -2859,279 +2909,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3555 +#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2340 ../../library/stdtypes.rst:3558 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 +#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3618 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:2400 ../../library/stdtypes.rst:3618 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 +#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 +#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3624 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2366 ../../library/stdtypes.rst:3584 +#: ../../library/stdtypes.rst:2410 ../../library/stdtypes.rst:3628 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:2369 ../../library/stdtypes.rst:3587 +#: ../../library/stdtypes.rst:2413 ../../library/stdtypes.rst:3631 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3590 +#: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3634 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3592 +#: ../../library/stdtypes.rst:2418 ../../library/stdtypes.rst:3636 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:2376 -#: ../../library/stdtypes.rst:3592 ../../library/stdtypes.rst:3594 +#: ../../library/stdtypes.rst:2418 ../../library/stdtypes.rst:2420 +#: ../../library/stdtypes.rst:3636 ../../library/stdtypes.rst:3638 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3594 +#: ../../library/stdtypes.rst:2420 ../../library/stdtypes.rst:3638 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3640 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3640 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 +#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3642 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 +#: ../../library/stdtypes.rst:2424 ../../library/stdtypes.rst:3642 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 +#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3644 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 +#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3644 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3646 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 +#: ../../library/stdtypes.rst:2428 ../../library/stdtypes.rst:3646 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3648 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3648 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3650 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3650 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3608 +#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:3652 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:2392 -#: ../../library/stdtypes.rst:3608 ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:2434 ../../library/stdtypes.rst:2436 +#: ../../library/stdtypes.rst:3652 ../../library/stdtypes.rst:3654 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3610 +#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3654 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 +#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3656 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 +#: ../../library/stdtypes.rst:2438 ../../library/stdtypes.rst:3656 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:2398 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3660 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 +#: ../../library/stdtypes.rst:2442 ../../library/stdtypes.rst:3660 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:2402 ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3664 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2402 +#: ../../library/stdtypes.rst:2446 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:2449 ../../library/stdtypes.rst:3677 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2405 +#: ../../library/stdtypes.rst:2449 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2408 ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:2452 ../../library/stdtypes.rst:3671 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:2452 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:2455 ../../library/stdtypes.rst:3674 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2411 +#: ../../library/stdtypes.rst:2455 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3680 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 +#: ../../library/stdtypes.rst:2458 ../../library/stdtypes.rst:3680 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:3643 +#: ../../library/stdtypes.rst:2465 ../../library/stdtypes.rst:3687 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3647 +#: ../../library/stdtypes.rst:2469 ../../library/stdtypes.rst:3691 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:2429 ../../library/stdtypes.rst:3651 +#: ../../library/stdtypes.rst:2473 ../../library/stdtypes.rst:3695 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3654 +#: ../../library/stdtypes.rst:2476 ../../library/stdtypes.rst:3698 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3658 +#: ../../library/stdtypes.rst:2480 ../../library/stdtypes.rst:3702 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:2439 ../../library/stdtypes.rst:3661 +#: ../../library/stdtypes.rst:2483 ../../library/stdtypes.rst:3705 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2443 ../../library/stdtypes.rst:3665 +#: ../../library/stdtypes.rst:2487 ../../library/stdtypes.rst:3709 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3674 +#: ../../library/stdtypes.rst:2490 ../../library/stdtypes.rst:3718 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2448 +#: ../../library/stdtypes.rst:2492 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2453 +#: ../../library/stdtypes.rst:2497 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2464 +#: ../../library/stdtypes.rst:2508 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2472 +#: ../../library/stdtypes.rst:2516 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -3139,17 +3189,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2477 +#: ../../library/stdtypes.rst:2521 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2483 +#: ../../library/stdtypes.rst:2527 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2487 +#: ../../library/stdtypes.rst:2531 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3157,40 +3207,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2494 +#: ../../library/stdtypes.rst:2538 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2497 +#: ../../library/stdtypes.rst:2541 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2542 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2499 +#: ../../library/stdtypes.rst:2543 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2501 +#: ../../library/stdtypes.rst:2545 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2505 +#: ../../library/stdtypes.rst:2549 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2509 +#: ../../library/stdtypes.rst:2553 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3203,29 +3253,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2519 +#: ../../library/stdtypes.rst:2563 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2522 +#: ../../library/stdtypes.rst:2566 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2567 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2568 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2526 +#: ../../library/stdtypes.rst:2570 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2528 +#: ../../library/stdtypes.rst:2572 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3233,32 +3283,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2534 +#: ../../library/stdtypes.rst:2578 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2541 +#: ../../library/stdtypes.rst:2585 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2545 +#: ../../library/stdtypes.rst:2589 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2550 ../../library/stdtypes.rst:2635 +#: ../../library/stdtypes.rst:2594 ../../library/stdtypes.rst:2679 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2556 +#: ../../library/stdtypes.rst:2600 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -3267,13 +3317,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2573 +#: ../../library/stdtypes.rst:2617 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2577 +#: ../../library/stdtypes.rst:2621 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3281,58 +3331,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2582 +#: ../../library/stdtypes.rst:2626 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2590 +#: ../../library/stdtypes.rst:2634 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2594 +#: ../../library/stdtypes.rst:2638 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2599 +#: ../../library/stdtypes.rst:2643 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2602 +#: ../../library/stdtypes.rst:2646 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2647 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2604 +#: ../../library/stdtypes.rst:2648 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2649 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2607 +#: ../../library/stdtypes.rst:2651 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:2611 +#: ../../library/stdtypes.rst:2655 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2613 +#: ../../library/stdtypes.rst:2657 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3340,33 +3390,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2619 +#: ../../library/stdtypes.rst:2663 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:2626 +#: ../../library/stdtypes.rst:2670 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2630 +#: ../../library/stdtypes.rst:2674 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2643 +#: ../../library/stdtypes.rst:2687 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:2648 +#: ../../library/stdtypes.rst:2692 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 " @@ -3374,7 +3424,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2653 +#: ../../library/stdtypes.rst:2697 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3382,11 +3432,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2662 +#: ../../library/stdtypes.rst:2706 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2667 +#: ../../library/stdtypes.rst:2711 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3395,107 +3445,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2675 +#: ../../library/stdtypes.rst:2719 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:2682 +#: ../../library/stdtypes.rst:2726 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2687 +#: ../../library/stdtypes.rst:2731 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:2692 +#: ../../library/stdtypes.rst:2736 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:2695 +#: ../../library/stdtypes.rst:2739 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2701 +#: ../../library/stdtypes.rst:2745 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:2705 ../../library/stdtypes.rst:2810 -#: ../../library/stdtypes.rst:2832 ../../library/stdtypes.rst:2898 -#: ../../library/stdtypes.rst:2911 +#: ../../library/stdtypes.rst:2749 ../../library/stdtypes.rst:2854 +#: ../../library/stdtypes.rst:2876 ../../library/stdtypes.rst:2942 +#: ../../library/stdtypes.rst:2955 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:2708 +#: ../../library/stdtypes.rst:2752 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:2711 ../../library/stdtypes.rst:2822 -#: ../../library/stdtypes.rst:2835 ../../library/stdtypes.rst:2901 -#: ../../library/stdtypes.rst:2914 +#: ../../library/stdtypes.rst:2755 ../../library/stdtypes.rst:2866 +#: ../../library/stdtypes.rst:2879 ../../library/stdtypes.rst:2945 +#: ../../library/stdtypes.rst:2958 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2718 +#: ../../library/stdtypes.rst:2762 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:2727 +#: ../../library/stdtypes.rst:2771 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2731 ../../library/stdtypes.rst:2753 -#: ../../library/stdtypes.rst:2886 ../../library/stdtypes.rst:2979 -#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:3024 -#: ../../library/stdtypes.rst:3038 ../../library/stdtypes.rst:3080 -#: ../../library/stdtypes.rst:3150 ../../library/stdtypes.rst:3168 -#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:3335 -#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3433 -#: ../../library/stdtypes.rst:3454 ../../library/stdtypes.rst:3476 -#: ../../library/stdtypes.rst:3678 +#: ../../library/stdtypes.rst:2775 ../../library/stdtypes.rst:2797 +#: ../../library/stdtypes.rst:2930 ../../library/stdtypes.rst:3023 +#: ../../library/stdtypes.rst:3037 ../../library/stdtypes.rst:3068 +#: ../../library/stdtypes.rst:3082 ../../library/stdtypes.rst:3124 +#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:3212 +#: ../../library/stdtypes.rst:3240 ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3434 ../../library/stdtypes.rst:3477 +#: ../../library/stdtypes.rst:3498 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:3722 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:2740 +#: ../../library/stdtypes.rst:2784 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:2749 +#: ../../library/stdtypes.rst:2793 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2762 +#: ../../library/stdtypes.rst:2806 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2767 +#: ../../library/stdtypes.rst:2811 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3503,21 +3553,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2773 +#: ../../library/stdtypes.rst:2817 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:2779 +#: ../../library/stdtypes.rst:2823 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:2794 +#: ../../library/stdtypes.rst:2838 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3525,11 +3575,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2799 +#: ../../library/stdtypes.rst:2843 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2805 +#: ../../library/stdtypes.rst:2849 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 " @@ -3537,20 +3587,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2815 +#: ../../library/stdtypes.rst:2859 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:2829 +#: ../../library/stdtypes.rst:2873 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2842 +#: ../../library/stdtypes.rst:2886 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 " @@ -3560,7 +3610,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2897 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 " @@ -3568,7 +3618,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2864 +#: ../../library/stdtypes.rst:2908 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 " @@ -3577,24 +3627,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2871 ../../library/stdtypes.rst:2928 +#: ../../library/stdtypes.rst:2915 ../../library/stdtypes.rst:2972 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2877 +#: ../../library/stdtypes.rst:2921 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:2881 +#: ../../library/stdtypes.rst:2925 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2937 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3602,13 +3652,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2908 +#: ../../library/stdtypes.rst:2952 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2921 +#: ../../library/stdtypes.rst:2965 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 " @@ -3617,7 +3667,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2934 +#: ../../library/stdtypes.rst:2978 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3625,11 +3675,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2939 +#: ../../library/stdtypes.rst:2983 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2945 +#: ../../library/stdtypes.rst:2989 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 " @@ -3637,22 +3687,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2994 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2953 +#: ../../library/stdtypes.rst:2997 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2959 +#: ../../library/stdtypes.rst:3003 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2963 +#: ../../library/stdtypes.rst:3007 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 " @@ -3661,7 +3711,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2972 +#: ../../library/stdtypes.rst:3016 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). " @@ -3669,7 +3719,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2986 +#: ../../library/stdtypes.rst:3030 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). " @@ -3677,7 +3727,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3000 +#: ../../library/stdtypes.rst:3044 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 " @@ -3687,14 +3737,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3012 +#: ../../library/stdtypes.rst:3056 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:3031 +#: ../../library/stdtypes.rst:3075 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). " @@ -3702,7 +3752,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3045 +#: ../../library/stdtypes.rst:3089 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 " @@ -3712,7 +3762,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3056 +#: ../../library/stdtypes.rst:3100 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 " @@ -3722,14 +3772,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3068 +#: ../../library/stdtypes.rst:3112 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:3087 +#: ../../library/stdtypes.rst:3131 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 " @@ -3738,7 +3788,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3093 +#: ../../library/stdtypes.rst:3137 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',')`` " @@ -3749,7 +3799,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3111 +#: ../../library/stdtypes.rst:3155 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 " @@ -3759,7 +3809,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3132 +#: ../../library/stdtypes.rst:3176 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 " @@ -3769,13 +3819,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3145 +#: ../../library/stdtypes.rst:3189 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3154 +#: ../../library/stdtypes.rst:3198 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 " @@ -3783,14 +3833,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3162 +#: ../../library/stdtypes.rst:3206 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:3175 +#: ../../library/stdtypes.rst:3219 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 " @@ -3806,7 +3856,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3203 +#: ../../library/stdtypes.rst:3247 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3815,7 +3865,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3220 +#: ../../library/stdtypes.rst:3264 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3823,35 +3873,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3236 +#: ../../library/stdtypes.rst:3280 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:3246 +#: ../../library/stdtypes.rst:3290 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:3261 +#: ../../library/stdtypes.rst:3305 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:3271 ../../library/stdtypes.rst:3313 -#: ../../library/stdtypes.rst:3329 ../../library/stdtypes.rst:3379 -#: ../../library/stdtypes.rst:3448 +#: ../../library/stdtypes.rst:3315 ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:3373 ../../library/stdtypes.rst:3423 +#: ../../library/stdtypes.rst:3492 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:3279 +#: ../../library/stdtypes.rst:3323 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3859,27 +3909,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3332 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:3303 +#: ../../library/stdtypes.rst:3347 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:3321 +#: ../../library/stdtypes.rst:3365 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3346 +#: ../../library/stdtypes.rst:3390 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 " @@ -3887,20 +3937,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3358 +#: ../../library/stdtypes.rst:3402 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:3371 +#: ../../library/stdtypes.rst:3415 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:3383 +#: ../../library/stdtypes.rst:3427 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3908,14 +3958,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3397 +#: ../../library/stdtypes.rst:3441 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:3406 +#: ../../library/stdtypes.rst:3450 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3923,18 +3973,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3419 +#: ../../library/stdtypes.rst:3463 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3440 +#: ../../library/stdtypes.rst:3484 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3461 +#: ../../library/stdtypes.rst:3505 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 " @@ -3943,11 +3993,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3483 +#: ../../library/stdtypes.rst:3527 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3500 +#: ../../library/stdtypes.rst:3544 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 " @@ -3955,7 +4005,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3505 +#: ../../library/stdtypes.rst:3549 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3965,7 +4015,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3512 +#: ../../library/stdtypes.rst:3556 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 " @@ -3973,7 +4023,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3546 +#: ../../library/stdtypes.rst:3590 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 " @@ -3981,73 +4031,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:3664 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:3667 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:3667 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3627 +#: ../../library/stdtypes.rst:3671 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3630 +#: ../../library/stdtypes.rst:3674 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:3677 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3633 +#: ../../library/stdtypes.rst:3677 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3668 +#: ../../library/stdtypes.rst:3712 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3715 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3683 +#: ../../library/stdtypes.rst:3727 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3690 +#: ../../library/stdtypes.rst:3734 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3692 +#: ../../library/stdtypes.rst:3736 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:3698 +#: ../../library/stdtypes.rst:3742 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:3702 +#: ../../library/stdtypes.rst:3746 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 " @@ -4055,23 +4105,32 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3707 +#: ../../library/stdtypes.rst:3751 +msgid "" +"``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " +"is the nested list representation of the view. If ``view.ndim = 1``, this is " +"equal to the number of elements in the view." +msgstr "" + +#: ../../library/stdtypes.rst:3755 +msgid "" +"If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " +"returning 1." +msgstr "" + +#: ../../library/stdtypes.rst:3758 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 " -"equal to the number of elements in the view. For higher dimensions, the " -"length is equal to the length of the nested list representation of the view. " "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3714 +#: ../../library/stdtypes.rst:3761 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3727 +#: ../../library/stdtypes.rst:3774 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 " @@ -4082,82 +4141,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3736 +#: ../../library/stdtypes.rst:3783 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3748 +#: ../../library/stdtypes.rst:3795 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3769 +#: ../../library/stdtypes.rst:3816 msgid "" "One-dimensional memoryviews of :term:`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:3781 +#: ../../library/stdtypes.rst:3828 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:3785 +#: ../../library/stdtypes.rst:3832 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3789 +#: ../../library/stdtypes.rst:3836 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3792 +#: ../../library/stdtypes.rst:3839 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3796 +#: ../../library/stdtypes.rst:3843 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:3800 +#: ../../library/stdtypes.rst:3847 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:3819 +#: ../../library/stdtypes.rst:3866 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:3835 +#: ../../library/stdtypes.rst:3882 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3838 +#: ../../library/stdtypes.rst:3885 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3844 +#: ../../library/stdtypes.rst:3891 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:3853 +#: ../../library/stdtypes.rst:3900 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4165,7 +4224,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3858 +#: ../../library/stdtypes.rst:3905 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' " @@ -4174,36 +4233,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3867 +#: ../../library/stdtypes.rst:3914 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3876 +#: ../../library/stdtypes.rst:3923 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:3883 +#: ../../library/stdtypes.rst:3930 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3893 +#: ../../library/stdtypes.rst:3940 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:3900 +#: ../../library/stdtypes.rst:3947 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3919 +#: ../../library/stdtypes.rst:3966 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 :" @@ -4212,20 +4271,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3925 +#: ../../library/stdtypes.rst:3972 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:3936 +#: ../../library/stdtypes.rst:3983 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3952 +#: ../../library/stdtypes.rst:3999 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 " @@ -4234,7 +4293,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3958 +#: ../../library/stdtypes.rst:4005 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 " @@ -4242,50 +4301,50 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:3964 +#: ../../library/stdtypes.rst:3963 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3987 +#: ../../library/stdtypes.rst:3986 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4000 +#: ../../library/stdtypes.rst:3999 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4025 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4040 +#: ../../library/stdtypes.rst:4039 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4042 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4047 +#: ../../library/stdtypes.rst:4046 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4058 +#: ../../library/stdtypes.rst:4057 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:4077 +#: ../../library/stdtypes.rst:4076 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4094 +#: ../../library/stdtypes.rst:4093 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:4097 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 " @@ -4293,59 +4352,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4103 +#: ../../library/stdtypes.rst:4102 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:4109 +#: ../../library/stdtypes.rst:4108 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:4121 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4127 +#: ../../library/stdtypes.rst:4126 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:4130 ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:4129 ../../library/stdtypes.rst:4137 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4135 +#: ../../library/stdtypes.rst:4134 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:4143 +#: ../../library/stdtypes.rst:4142 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4146 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4152 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4158 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4166 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4171 +#: ../../library/stdtypes.rst:4170 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4355,7 +4414,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4178 +#: ../../library/stdtypes.rst:4177 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 " @@ -4363,7 +4422,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4183 +#: ../../library/stdtypes.rst:4182 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4375,18 +4434,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4190 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:4195 +#: ../../library/stdtypes.rst:4194 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4199 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 " @@ -4394,92 +4453,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4205 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4207 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4209 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4212 +#: ../../library/stdtypes.rst:4211 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:4216 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:4220 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4224 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:4228 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:4235 +#: ../../library/stdtypes.rst:4234 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:4238 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4244 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4249 +#: ../../library/stdtypes.rst:4248 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4254 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4259 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:4264 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4269 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4273 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4276 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4489,7 +4548,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4284 +#: ../../library/stdtypes.rst:4283 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 " @@ -4499,14 +4558,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4291 +#: ../../library/stdtypes.rst:4290 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:4295 +#: ../../library/stdtypes.rst:4294 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 " @@ -4514,71 +4573,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4300 +#: ../../library/stdtypes.rst:4299 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:4303 +#: ../../library/stdtypes.rst:4302 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:4304 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:4309 +#: ../../library/stdtypes.rst:4308 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4314 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4320 +#: ../../library/stdtypes.rst:4319 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4325 +#: ../../library/stdtypes.rst:4324 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4330 +#: ../../library/stdtypes.rst:4329 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4334 +#: ../../library/stdtypes.rst:4333 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4337 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:4342 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:4346 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4352 +#: ../../library/stdtypes.rst:4351 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4354 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4586,18 +4645,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:4359 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:4368 +#: ../../library/stdtypes.rst:4367 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4378 +#: ../../library/stdtypes.rst:4377 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4606,7 +4665,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4383 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4615,33 +4674,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:4394 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4397 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4399 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:4402 +#: ../../library/stdtypes.rst:4401 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4402 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4406 +#: ../../library/stdtypes.rst:4405 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 " @@ -4653,7 +4712,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:4415 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 " @@ -4661,39 +4720,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:4420 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4432 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:4437 +#: ../../library/stdtypes.rst:4436 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:4441 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4445 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:4449 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4455 +#: ../../library/stdtypes.rst:4454 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 " @@ -4704,51 +4763,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:4472 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:4479 +#: ../../library/stdtypes.rst:4478 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4483 +#: ../../library/stdtypes.rst:4482 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4487 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4491 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4496 +#: ../../library/stdtypes.rst:4495 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4500 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:4504 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4508 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4510 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 " @@ -4757,70 +4816,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4518 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:4525 +#: ../../library/stdtypes.rst:4524 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4530 +#: ../../library/stdtypes.rst:4529 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4535 +#: ../../library/stdtypes.rst:4534 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:4541 +#: ../../library/stdtypes.rst:4540 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:4544 +#: ../../library/stdtypes.rst:4543 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:4548 +#: ../../library/stdtypes.rst:4547 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4554 +#: ../../library/stdtypes.rst:4553 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4561 +#: ../../library/stdtypes.rst:4560 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:4567 +#: ../../library/stdtypes.rst:4566 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4570 +#: ../../library/stdtypes.rst:4569 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 " @@ -4828,71 +4887,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4576 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4580 +#: ../../library/stdtypes.rst:4579 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:4590 +#: ../../library/stdtypes.rst:4589 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:4598 +#: ../../library/stdtypes.rst:4597 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:4604 +#: ../../library/stdtypes.rst:4603 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:4608 +#: ../../library/stdtypes.rst:4607 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:4626 +#: ../../library/stdtypes.rst:4625 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4630 +#: ../../library/stdtypes.rst:4629 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4642 +#: ../../library/stdtypes.rst:4641 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4646 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4654 +#: ../../library/stdtypes.rst:4653 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4655 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 " @@ -4900,23 +4959,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4660 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4666 +#: ../../library/stdtypes.rst:4665 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4669 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4673 +#: ../../library/stdtypes.rst:4672 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4924,39 +4983,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4678 +#: ../../library/stdtypes.rst:4677 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:4681 +#: ../../library/stdtypes.rst:4680 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4686 +#: ../../library/stdtypes.rst:4685 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:4691 +#: ../../library/stdtypes.rst:4690 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:4694 +#: ../../library/stdtypes.rst:4693 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4698 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4704 +#: ../../library/stdtypes.rst:4703 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4964,18 +5023,20 @@ msgid "" "are not treated as set-like since the entries are generally not unique.) " "For set-like views, all of the operations defined for the abstract base " "class :class:`collections.abc.Set` are available (for example, ``==``, " -"``<``, or ``^``)." +"``<``, or ``^``). While using set operators, set-like views accept any " +"iterable as the other operand, unlike sets which only accept sets as the " +"input." msgstr "" -#: ../../library/stdtypes.rst:4711 +#: ../../library/stdtypes.rst:4710 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4754 +#: ../../library/stdtypes.rst:4751 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4761 +#: ../../library/stdtypes.rst:4758 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 " @@ -4983,7 +5044,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4769 +#: ../../library/stdtypes.rst:4766 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 " @@ -4991,14 +5052,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4774 +#: ../../library/stdtypes.rst:4771 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:4778 +#: ../../library/stdtypes.rst:4775 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 " @@ -5008,7 +5069,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4788 +#: ../../library/stdtypes.rst:4785 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5017,7 +5078,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4793 +#: ../../library/stdtypes.rst:4790 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5028,7 +5089,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4797 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5037,7 +5098,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4806 +#: ../../library/stdtypes.rst:4803 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5046,7 +5107,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4812 +#: ../../library/stdtypes.rst:4809 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5056,7 +5117,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4819 +#: ../../library/stdtypes.rst:4816 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 " @@ -5065,23 +5126,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4827 +#: ../../library/stdtypes.rst:4824 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4832 +#: ../../library/stdtypes.rst:4829 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4839 +#: ../../library/stdtypes.rst:4836 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4845 +#: ../../library/stdtypes.rst:4842 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5091,19 +5152,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4855 +#: ../../library/stdtypes.rst:4852 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:4858 +#: ../../library/stdtypes.rst:4855 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4861 +#: ../../library/stdtypes.rst:4858 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 " @@ -5112,7 +5173,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4867 +#: ../../library/stdtypes.rst:4864 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 " @@ -5121,7 +5182,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4873 +#: ../../library/stdtypes.rst:4870 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 " @@ -5129,7 +5190,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4879 +#: ../../library/stdtypes.rst:4876 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." @@ -5138,21 +5199,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4885 +#: ../../library/stdtypes.rst:4882 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:4891 +#: ../../library/stdtypes.rst:4888 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:4899 +#: ../../library/stdtypes.rst:4896 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 " @@ -5160,13 +5221,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4907 +#: ../../library/stdtypes.rst:4904 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4915 +#: ../../library/stdtypes.rst:4912 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5175,331 +5236,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4925 +#: ../../library/stdtypes.rst:4922 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4936 +#: ../../library/stdtypes.rst:4933 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4944 +#: ../../library/stdtypes.rst:4941 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4952 +#: ../../library/stdtypes.rst:4949 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:4963 +#: ../../library/stdtypes.rst:4960 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4962 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4965 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4966 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4967 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4968 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4969 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4970 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4971 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:4999 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5000 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5001 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5002 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5003 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5004 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5005 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5006 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5007 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5009 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5010 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5011 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5012 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5013 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5014 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5015 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5016 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5020 +#: ../../library/stdtypes.rst:5017 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5021 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5026 +#: ../../library/stdtypes.rst:5023 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5025 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5032 +#: ../../library/stdtypes.rst:5029 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5040 +#: ../../library/stdtypes.rst:5037 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:5050 +#: ../../library/stdtypes.rst:5047 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5058 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:5068 +#: ../../library/stdtypes.rst:5065 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5074 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5074 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5079 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5077 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:5085 +#: ../../library/stdtypes.rst:5082 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:5082 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5091 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5100 +#: ../../library/stdtypes.rst:5097 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5508,7 +5569,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5107 +#: ../../library/stdtypes.rst:5104 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 " @@ -5516,7 +5577,7 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5114 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -5525,76 +5586,76 @@ msgid "" "a string, e.g. ``\"int | Foo\"``." msgstr "" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5122 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5127 +#: ../../library/stdtypes.rst:5124 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5131 +#: ../../library/stdtypes.rst:5128 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5135 +#: ../../library/stdtypes.rst:5132 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5139 +#: ../../library/stdtypes.rst:5136 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5143 +#: ../../library/stdtypes.rst:5140 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5150 +#: ../../library/stdtypes.rst:5147 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5156 +#: ../../library/stdtypes.rst:5153 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5161 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:5179 +#: ../../library/stdtypes.rst:5174 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:5197 +#: ../../library/stdtypes.rst:5192 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5200 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5207 +#: ../../library/stdtypes.rst:5202 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5214 +#: ../../library/stdtypes.rst:5209 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5216 +#: ../../library/stdtypes.rst:5211 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 " @@ -5605,7 +5666,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5223 +#: ../../library/stdtypes.rst:5218 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5616,32 +5677,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5231 +#: ../../library/stdtypes.rst:5226 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5234 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5241 +#: ../../library/stdtypes.rst:5236 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5242 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5249 +#: ../../library/stdtypes.rst:5244 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:5252 +#: ../../library/stdtypes.rst:5247 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5649,15 +5710,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5256 +#: ../../library/stdtypes.rst:5251 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5262 +#: ../../library/stdtypes.rst:5257 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5261 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 " @@ -5665,7 +5726,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5271 +#: ../../library/stdtypes.rst:5266 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:" @@ -5677,7 +5738,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5280 +#: ../../library/stdtypes.rst:5275 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5687,15 +5748,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5300 ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5295 ../../library/stdtypes.rst:5326 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5308 +#: ../../library/stdtypes.rst:5303 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5314 +#: ../../library/stdtypes.rst:5309 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5705,7 +5766,7 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5321 +#: ../../library/stdtypes.rst:5316 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." @@ -5713,17 +5774,17 @@ msgstr "" "存取 ``__code__`` 會引發一個附帶引數 ``obj`` 與 ``\"__code__\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5328 +#: ../../library/stdtypes.rst:5323 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:5337 +#: ../../library/stdtypes.rst:5332 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5338 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 " @@ -5731,30 +5792,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5348 +#: ../../library/stdtypes.rst:5343 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5354 +#: ../../library/stdtypes.rst:5349 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5351 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:5360 +#: ../../library/stdtypes.rst:5355 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5367 +#: ../../library/stdtypes.rst:5362 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5364 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5762,15 +5823,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5374 +#: ../../library/stdtypes.rst:5369 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5375 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5377 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 " @@ -5778,15 +5839,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5387 +#: ../../library/stdtypes.rst:5382 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5393 +#: ../../library/stdtypes.rst:5388 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5395 +#: ../../library/stdtypes.rst:5390 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5797,81 +5858,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5408 +#: ../../library/stdtypes.rst:5403 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5414 +#: ../../library/stdtypes.rst:5409 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5416 +#: ../../library/stdtypes.rst:5411 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5423 +#: ../../library/stdtypes.rst:5418 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5425 +#: ../../library/stdtypes.rst:5420 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:5432 +#: ../../library/stdtypes.rst:5427 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5438 +#: ../../library/stdtypes.rst:5433 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5438 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5443 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5449 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5462 +#: ../../library/stdtypes.rst:5457 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5468 +#: ../../library/stdtypes.rst:5463 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:5475 +#: ../../library/stdtypes.rst:5470 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:5486 +#: ../../library/stdtypes.rst:5481 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5483 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5879,7 +5940,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5493 +#: ../../library/stdtypes.rst:5488 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5889,25 +5950,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5500 +#: ../../library/stdtypes.rst:5495 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5503 +#: ../../library/stdtypes.rst:5498 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5507 +#: ../../library/stdtypes.rst:5502 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5524 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5915,94 +5976,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5534 +#: ../../library/stdtypes.rst:5529 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5544 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5546 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5549 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5550 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5551 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5552 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5553 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5556 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5558 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5559 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5565 +#: ../../library/stdtypes.rst:5560 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5561 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5562 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5563 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5566 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5573 +#: ../../library/stdtypes.rst:5568 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5571 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5579 +#: ../../library/stdtypes.rst:5574 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5576 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -6011,38 +6072,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5587 +#: ../../library/stdtypes.rst:5582 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5590 +#: ../../library/stdtypes.rst:5585 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5589 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5596 +#: ../../library/stdtypes.rst:5591 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5598 +#: ../../library/stdtypes.rst:5593 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5605 +#: ../../library/stdtypes.rst:5600 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6054,7 +6115,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5614 +#: ../../library/stdtypes.rst:5609 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6062,57 +6123,57 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5620 +#: ../../library/stdtypes.rst:5615 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5617 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " "limit, set it from your main entry point using Python version agnostic code " -"as these APIs were added in security patch releases in versions before 3.11." +"as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5627 +#: ../../library/stdtypes.rst:5622 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5634 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5638 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5644 +#: ../../library/stdtypes.rst:5639 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5647 +#: ../../library/stdtypes.rst:5642 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5645 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5647 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:5655 +#: ../../library/stdtypes.rst:5650 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -6125,13 +6186,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:315 #: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 #: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 -#: ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5334 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4369 msgid "statement" msgstr "statement(陳述式)" @@ -6152,7 +6213,7 @@ msgid "value" msgstr "value" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5398 msgid "Boolean" msgstr "Boolean(布林)" @@ -6180,7 +6241,7 @@ msgstr "False(內建物件)" #: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:97 #: ../../library/stdtypes.rst:122 ../../library/stdtypes.rst:194 #: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:390 -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "operator" msgstr "operator(運算子)" @@ -6192,11 +6253,11 @@ msgstr "or" msgid "and" msgstr "and" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 msgid "False" msgstr "False" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 msgid "True" msgstr "True" @@ -6254,10 +6315,10 @@ msgstr "is not" #: ../../library/stdtypes.rst:1295 ../../library/stdtypes.rst:1339 #: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1497 #: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 -#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4169 -#: ../../library/stdtypes.rst:4370 ../../library/stdtypes.rst:4841 -#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5264 -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 +#: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5298 msgid "object" msgstr "object(物件)" @@ -6299,11 +6360,11 @@ msgstr "__gt__()(實例方法)" msgid "__ge__() (instance method)" msgstr "__ge__()(實例方法)" -#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:946 msgid "in" msgstr "in" -#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:194 ../../library/stdtypes.rst:946 msgid "not in" msgstr "not in" @@ -6349,9 +6410,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4370 -#: ../../library/stdtypes.rst:5310 ../../library/stdtypes.rst:5324 -#: ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5305 ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5334 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -6367,8 +6428,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2342 -#: ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:3604 msgid "+ (plus)" msgstr "+ (加號)" @@ -6380,13 +6441,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2342 -#: ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:3604 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2299 -#: ../../library/stdtypes.rst:3517 +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2343 +#: ../../library/stdtypes.rst:3561 msgid "* (asterisk)" msgstr "* (星號)" @@ -6398,8 +6459,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2269 -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:2313 +#: ../../library/stdtypes.rst:3529 msgid "% (percent)" msgstr "% (百分號)" @@ -6409,7 +6470,7 @@ msgstr "**" #: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:390 #: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4369 msgid "operations on" msgstr "operations on(操作於)" @@ -6418,7 +6479,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5334 msgid "module" msgstr "模組" @@ -6478,389 +6539,393 @@ msgstr ">>" msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../library/stdtypes.rst:804 +#: ../../library/stdtypes.rst:813 +msgid "values" +msgstr "values" + +#: ../../library/stdtypes.rst:843 msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4756 +#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4753 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/stdtypes.rst:804 +#: ../../library/stdtypes.rst:843 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:891 -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1074 -#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:843 ../../library/stdtypes.rst:930 +#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1113 +#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:1150 msgid "sequence" msgstr "sequence(序列)" -#: ../../library/stdtypes.rst:804 +#: ../../library/stdtypes.rst:843 msgid "iteration" msgstr "iteration(疊代)" -#: ../../library/stdtypes.rst:804 +#: ../../library/stdtypes.rst:843 msgid "container" msgstr "container(容器)" -#: ../../library/stdtypes.rst:804 +#: ../../library/stdtypes.rst:843 msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4369 msgid "len" msgstr "len" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "min" msgstr "min" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "max" msgstr "max" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "concatenation" msgstr "concatenation(串接)" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "operation" msgstr "operation(操作)" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "repetition" msgstr "repetition(重複)" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1150 msgid "subscript" msgstr "subscript(下標)" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:946 ../../library/stdtypes.rst:1150 msgid "slice" msgstr "slice(切片)" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "count() (sequence method)" msgstr "count()(序列方法)" -#: ../../library/stdtypes.rst:907 +#: ../../library/stdtypes.rst:946 msgid "index() (sequence method)" msgstr "index()(序列方法)" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:1002 msgid "loop" msgstr "loop(迴圈)" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:1002 msgid "over mutable sequence" msgstr "over mutable sequence(於可變序列)" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:1002 msgid "mutable sequence" msgstr "mutable sequence(可變序列)" -#: ../../library/stdtypes.rst:963 +#: ../../library/stdtypes.rst:1002 msgid "loop over" msgstr "loop over(迴圈)" -#: ../../library/stdtypes.rst:1074 +#: ../../library/stdtypes.rst:1113 msgid "immutable" msgstr "immutable(不可變)" -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1295 +#: ../../library/stdtypes.rst:1113 ../../library/stdtypes.rst:1334 msgid "tuple" msgstr "tuple(元組)" -#: ../../library/stdtypes.rst:1074 +#: ../../library/stdtypes.rst:1113 msgid "hash" msgstr "hash(雜湊)" -#: ../../library/stdtypes.rst:1096 +#: ../../library/stdtypes.rst:1135 msgid "mutable" msgstr "mutable(可變)" -#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:1216 +#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:1150 +#: ../../library/stdtypes.rst:1255 msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1096 ../../library/stdtypes.rst:2466 -#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:2664 -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:1135 ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2636 ../../library/stdtypes.rst:2708 +#: ../../library/stdtypes.rst:3529 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 -#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5334 msgid "type" msgstr "type(型別)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 msgid "del" msgstr "del" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "append() (sequence method)" msgstr "append()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "clear() (sequence method)" msgstr "clear()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "copy() (sequence method)" msgstr "copy()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "extend() (sequence method)" msgstr "extend()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "insert() (sequence method)" msgstr "insert()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "pop() (sequence method)" msgstr "pop()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "remove() (sequence method)" msgstr "remove()(序列方法)" -#: ../../library/stdtypes.rst:1111 +#: ../../library/stdtypes.rst:1150 msgid "reverse() (sequence method)" msgstr "reverse()(序列方法)" -#: ../../library/stdtypes.rst:1339 +#: ../../library/stdtypes.rst:1378 msgid "range" msgstr "range" -#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1510 -#: ../../library/stdtypes.rst:1555 ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:1500 ../../library/stdtypes.rst:1549 +#: ../../library/stdtypes.rst:1594 ../../library/stdtypes.rst:2313 msgid "string" msgstr "string(字串)" -#: ../../library/stdtypes.rst:1461 +#: ../../library/stdtypes.rst:1500 msgid "text sequence type" msgstr "text sequence type(文字序列型別)" -#: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1510 -#: ../../library/stdtypes.rst:1528 +#: ../../library/stdtypes.rst:1500 ../../library/stdtypes.rst:1549 +#: ../../library/stdtypes.rst:1567 msgid "str (built-in class)" msgstr "str(內建類別)" -#: ../../library/stdtypes.rst:1461 +#: ../../library/stdtypes.rst:1500 msgid "(see also string)" msgstr "(亦請見 string)" -#: ../../library/stdtypes.rst:1497 +#: ../../library/stdtypes.rst:1536 msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1528 ../../library/stdtypes.rst:2458 +#: ../../library/stdtypes.rst:1567 ../../library/stdtypes.rst:2502 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1528 ../../library/stdtypes.rst:2466 -#: ../../library/stdtypes.rst:2485 ../../library/stdtypes.rst:2664 -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:1567 ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2529 ../../library/stdtypes.rst:2708 +#: ../../library/stdtypes.rst:3529 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1555 ../../library/stdtypes.rst:2664 +#: ../../library/stdtypes.rst:1594 ../../library/stdtypes.rst:2708 msgid "methods" msgstr "methods(方法)" -#: ../../library/stdtypes.rst:1563 +#: ../../library/stdtypes.rst:1602 msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2078 ../../library/stdtypes.rst:3339 +#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:3383 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2078 +#: ../../library/stdtypes.rst:2121 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:2313 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:2313 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:2313 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:2269 +#: ../../library/stdtypes.rst:2313 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3529 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:2269 ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3529 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3517 +#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3561 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:2342 -#: ../../library/stdtypes.rst:3517 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:3561 ../../library/stdtypes.rst:3604 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:2299 ../../library/stdtypes.rst:3517 +#: ../../library/stdtypes.rst:2343 ../../library/stdtypes.rst:3561 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:2342 ../../library/stdtypes.rst:3560 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:2458 +#: ../../library/stdtypes.rst:2502 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:2466 +#: ../../library/stdtypes.rst:2510 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:2466 +#: ../../library/stdtypes.rst:2510 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:3339 +#: ../../library/stdtypes.rst:3383 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:3339 +#: ../../library/stdtypes.rst:3383 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:3529 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:3529 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:3529 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:3485 +#: ../../library/stdtypes.rst:3529 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4168 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4369 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:4369 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:4453 +#: ../../library/stdtypes.rst:4452 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4756 +#: ../../library/stdtypes.rst:4753 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4756 +#: ../../library/stdtypes.rst:4753 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4756 +#: ../../library/stdtypes.rst:4753 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4826 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4826 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4838 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4838 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4838 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5093 msgid "Union" msgstr "Union(聯集)" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5093 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5264 +#: ../../library/stdtypes.rst:5259 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5298 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5298 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5310 +#: ../../library/stdtypes.rst:5305 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5310 +#: ../../library/stdtypes.rst:5305 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5319 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5319 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5358 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5363 +#: ../../library/stdtypes.rst:5358 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5398 msgid "values" msgstr "values" diff --git a/library/string.po b/library/string.po index d027e7d13e..183c30e0d9 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-08 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -282,7 +282,7 @@ msgid "" "*arg_name* can be followed by any number of index or attribute expressions. " "An expression of the form ``'.name'`` selects the named attribute using :" "func:`getattr`, while an expression of the form ``'[index]'`` does an index " -"lookup using :func:`__getitem__`." +"lookup using :meth:`~object.__getitem__`." msgstr "" #: ../../library/string.rst:242 @@ -303,11 +303,11 @@ msgstr "" #: ../../library/string.rst:258 msgid "" "The *conversion* field causes a type coercion before formatting. Normally, " -"the job of formatting a value is done by the :meth:`__format__` method of " -"the value itself. However, in some cases it is desirable to force a type to " -"be formatted as a string, overriding its own definition of formatting. By " -"converting the value to a string before calling :meth:`__format__`, the " -"normal formatting logic is bypassed." +"the job of formatting a value is done by the :meth:`~object.__format__` " +"method of the value itself. However, in some cases it is desirable to force " +"a type to be formatted as a string, overriding its own definition of " +"formatting. By converting the value to a string before calling :meth:" +"`~object.__format__`, the normal formatting logic is bypassed." msgstr "" #: ../../library/string.rst:265 diff --git a/library/struct.po b/library/struct.po index 5686458d29..a620b168a3 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 15:31+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -805,7 +805,7 @@ msgid "" "and data sizes. Internal pad bytes are normally inserted automatically. It " "is possible that a zero-repeat format code will be needed at the end of a " "format string to round up to the correct byte boundary for proper alignment " -"of consective chunks of data." +"of consecutive chunks of data." msgstr "" #: ../../library/struct.rst:467 @@ -875,10 +875,9 @@ msgstr "" #: ../../library/struct.rst:550 msgid "" -"The compiled versions of the most recent format strings passed to :class:" -"`Struct` and the module-level functions are cached, so programs that use " -"only a few format strings needn't worry about reusing a single :class:" -"`Struct` instance." +"The compiled versions of the most recent format strings passed to the module-" +"level functions are cached, so programs that use only a few format strings " +"needn't worry about reusing a single :class:`Struct` instance." msgstr "" #: ../../library/struct.rst:555 diff --git a/library/subprocess.po b/library/subprocess.po index 22a8e26bf9..a332b25463 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,13 +93,15 @@ msgstr "" #: ../../library/subprocess.rst:60 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:" -"`TimeoutExpired` exception will be re-raised after the child process has " -"terminated." +"A *timeout* may be specified in seconds, it is internally passed on to :meth:" +"`Popen.communicate`. If the timeout expires, the child process will be " +"killed and waited for. The :exc:`TimeoutExpired` exception will be re-raised " +"after the child process has terminated. The initial process creation itself " +"cannot be interrupted on many platform APIs so you are not guaranteed to see " +"a timeout exception until at least after however long process creation takes." msgstr "" -#: ../../library/subprocess.rst:65 +#: ../../library/subprocess.rst:68 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 " @@ -108,7 +110,7 @@ msgid "" "and the *stdin* argument may not be used as well." msgstr "" -#: ../../library/subprocess.rst:71 +#: ../../library/subprocess.rst:74 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 " @@ -116,7 +118,7 @@ msgid "" "captured." msgstr "" -#: ../../library/subprocess.rst:76 +#: ../../library/subprocess.rst:79 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 " @@ -125,7 +127,7 @@ msgid "" "backwards compatibility. By default, file objects are opened in binary mode." msgstr "" -#: ../../library/subprocess.rst:82 +#: ../../library/subprocess.rst:85 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 " @@ -135,26 +137,26 @@ msgid "" "`os.environb`." msgstr "" -#: ../../library/subprocess.rst:89 +#: ../../library/subprocess.rst:92 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/subprocess.rst:107 +#: ../../library/subprocess.rst:110 msgid "Added *encoding* and *errors* parameters" msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:111 +#: ../../library/subprocess.rst:114 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:501 -#: ../../library/subprocess.rst:1184 ../../library/subprocess.rst:1224 -#: ../../library/subprocess.rst:1287 +#: ../../library/subprocess.rst:119 ../../library/subprocess.rst:503 +#: ../../library/subprocess.rst:1185 ../../library/subprocess.rst:1225 +#: ../../library/subprocess.rst:1288 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -162,92 +164,92 @@ msgid "" "exe`` into a current directory no longer works." msgstr "" -#: ../../library/subprocess.rst:124 +#: ../../library/subprocess.rst:127 msgid "" "The return value from :func:`run`, representing a process that has finished." msgstr "" -#: ../../library/subprocess.rst:128 +#: ../../library/subprocess.rst:131 msgid "" "The arguments used to launch the process. This may be a list or a string." msgstr "" -#: ../../library/subprocess.rst:132 +#: ../../library/subprocess.rst:135 msgid "" "Exit status of the child process. Typically, an exit status of 0 indicates " "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:135 ../../library/subprocess.rst:931 +#: ../../library/subprocess.rst:138 ../../library/subprocess.rst:932 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/subprocess.rst:140 +#: ../../library/subprocess.rst:143 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:144 +#: ../../library/subprocess.rst:147 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:150 +#: ../../library/subprocess.rst:153 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:156 +#: ../../library/subprocess.rst:159 msgid "If :attr:`returncode` is non-zero, raise a :exc:`CalledProcessError`." msgstr "" -#: ../../library/subprocess.rst:162 +#: ../../library/subprocess.rst:165 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:171 +#: ../../library/subprocess.rst:174 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:178 +#: ../../library/subprocess.rst:181 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:185 +#: ../../library/subprocess.rst:188 msgid "Base class for all other exceptions from this module." msgstr "" -#: ../../library/subprocess.rst:192 +#: ../../library/subprocess.rst:195 msgid "" "Subclass of :exc:`SubprocessError`, raised when a timeout expires while " "waiting for a child process." msgstr "" -#: ../../library/subprocess.rst:197 ../../library/subprocess.rst:241 +#: ../../library/subprocess.rst:200 ../../library/subprocess.rst:244 msgid "Command that was used to spawn the child process." msgstr "" -#: ../../library/subprocess.rst:201 +#: ../../library/subprocess.rst:204 msgid "Timeout in seconds." msgstr "" -#: ../../library/subprocess.rst:205 +#: ../../library/subprocess.rst:208 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``. This is always :class:`bytes` when " @@ -255,11 +257,11 @@ msgid "" "remain ``None`` instead of ``b''`` when no output was observed." msgstr "" -#: ../../library/subprocess.rst:213 ../../library/subprocess.rst:250 +#: ../../library/subprocess.rst:216 ../../library/subprocess.rst:253 msgid "Alias for output, for symmetry with :attr:`stderr`." msgstr "" -#: ../../library/subprocess.rst:217 +#: ../../library/subprocess.rst:220 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " "Otherwise, ``None``. This is always :class:`bytes` when stderr output was " @@ -267,40 +269,40 @@ msgid "" "instead of ``b''`` when no stderr output was observed." msgstr "" -#: ../../library/subprocess.rst:224 ../../library/subprocess.rst:257 +#: ../../library/subprocess.rst:227 ../../library/subprocess.rst:260 msgid "*stdout* and *stderr* attributes added" msgstr "" -#: ../../library/subprocess.rst:229 +#: ../../library/subprocess.rst:232 msgid "" "Subclass of :exc:`SubprocessError`, raised when a process run by :func:" "`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) " "returns a non-zero exit status." msgstr "" -#: ../../library/subprocess.rst:236 +#: ../../library/subprocess.rst:239 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:245 +#: ../../library/subprocess.rst:248 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" "`check_output`. Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:254 +#: ../../library/subprocess.rst:257 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " "Otherwise, ``None``." msgstr "" -#: ../../library/subprocess.rst:264 +#: ../../library/subprocess.rst:267 msgid "Frequently Used Arguments" msgstr "" -#: ../../library/subprocess.rst:266 +#: ../../library/subprocess.rst:269 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 " @@ -308,7 +310,7 @@ msgid "" "default values. The arguments that are most commonly needed are:" msgstr "" -#: ../../library/subprocess.rst:271 +#: ../../library/subprocess.rst:274 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, " @@ -318,22 +320,21 @@ msgid "" "simply name the program to be executed without specifying any arguments." msgstr "" -#: ../../library/subprocess.rst:279 +#: ../../library/subprocess.rst:282 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " -"values are :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a " -"positive integer), an existing file object with a valid file descriptor, and " -"``None``. :data:`PIPE` indicates that a new pipe to the child should be " -"created. :data:`DEVNULL` indicates that the special file :data:`os.devnull` " -"will be used. With the default settings of ``None``, no redirection will " -"occur; the child's file handles will be inherited from the parent. " -"Additionally, *stderr* can be :data:`STDOUT`, which indicates that the " -"stderr data from the child process should be captured into the same file " -"handle as for *stdout*." +"values are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file " +"descriptor (a positive integer), and an existing :term:`file object` with a " +"valid file descriptor. With the default settings of ``None``, no " +"redirection will occur. :data:`PIPE` indicates that a new pipe to the child " +"should be created. :data:`DEVNULL` indicates that the special file :data:" +"`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, " +"which indicates that the stderr data from the child process should be " +"captured into the same file handle as for *stdout*." msgstr "" -#: ../../library/subprocess.rst:294 +#: ../../library/subprocess.rst:296 msgid "" "If *encoding* or *errors* are specified, or *text* (also known as " "*universal_newlines*) is true, the file objects *stdin*, *stdout* and " @@ -341,7 +342,7 @@ msgid "" "specified in the call or the defaults for :class:`io.TextIOWrapper`." msgstr "" -#: ../../library/subprocess.rst:300 +#: ../../library/subprocess.rst:302 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*, " @@ -350,28 +351,28 @@ msgid "" "when the *newline* argument to its constructor is ``None``." msgstr "" -#: ../../library/subprocess.rst:306 +#: ../../library/subprocess.rst:308 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:309 +#: ../../library/subprocess.rst:311 msgid "Added *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:312 +#: ../../library/subprocess.rst:314 msgid "Added the *text* parameter as an alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:317 +#: ../../library/subprocess.rst:319 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:321 +#: ../../library/subprocess.rst:323 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 " @@ -384,7 +385,7 @@ msgid "" "expanduser`, and :mod:`shutil`)." msgstr "" -#: ../../library/subprocess.rst:331 +#: ../../library/subprocess.rst:333 msgid "" "When *universal_newlines* is ``True``, the class uses the encoding :func:" "`locale.getpreferredencoding(False) ` instead " @@ -392,22 +393,22 @@ msgid "" "class for more information on this change." msgstr "" -#: ../../library/subprocess.rst:339 ../../library/subprocess.rst:460 +#: ../../library/subprocess.rst:341 ../../library/subprocess.rst:462 msgid "" "Read the `Security Considerations`_ section before using ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:341 +#: ../../library/subprocess.rst:343 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:346 +#: ../../library/subprocess.rst:348 msgid "Popen Constructor" msgstr "" -#: ../../library/subprocess.rst:348 +#: ../../library/subprocess.rst:350 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 " @@ -415,7 +416,7 @@ msgid "" "functions." msgstr "" -#: ../../library/subprocess.rst:363 +#: ../../library/subprocess.rst:365 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 " @@ -423,7 +424,7 @@ msgid "" "class:`Popen` are as follows." msgstr "" -#: ../../library/subprocess.rst:368 +#: ../../library/subprocess.rst:370 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 " @@ -434,7 +435,7 @@ msgid "" "sequence." msgstr "" -#: ../../library/subprocess.rst:378 +#: ../../library/subprocess.rst:380 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`. " @@ -443,7 +444,7 @@ msgid "" "format to launch an installed module." msgstr "" -#: ../../library/subprocess.rst:384 +#: ../../library/subprocess.rst:386 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 " @@ -457,27 +458,27 @@ msgid "" "variations." msgstr "" -#: ../../library/subprocess.rst:395 +#: ../../library/subprocess.rst:397 msgid "" "An example of passing some arguments to an external program as a sequence " "is::" msgstr "" -#: ../../library/subprocess.rst:400 +#: ../../library/subprocess.rst:402 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:406 +#: ../../library/subprocess.rst:408 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:418 +#: ../../library/subprocess.rst:420 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 " @@ -486,33 +487,33 @@ msgid "" "shown above) are single list elements." msgstr "" -#: ../../library/subprocess.rst:424 +#: ../../library/subprocess.rst:426 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:428 +#: ../../library/subprocess.rst:430 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:432 +#: ../../library/subprocess.rst:434 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:437 +#: ../../library/subprocess.rst:439 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:441 +#: ../../library/subprocess.rst:443 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 " @@ -524,7 +525,7 @@ msgid "" "class:`Popen` does the equivalent of::" msgstr "" -#: ../../library/subprocess.rst:452 +#: ../../library/subprocess.rst:454 msgid "" "On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable " "specifies the default shell. The only time you need to specify " @@ -533,35 +534,35 @@ msgid "" "``shell=True`` to run a batch file or console-based executable." msgstr "" -#: ../../library/subprocess.rst:462 +#: ../../library/subprocess.rst:464 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:466 +#: ../../library/subprocess.rst:468 msgid "" ":const:`0` means unbuffered (read and write are one system call and can " "return short)" msgstr "" -#: ../../library/subprocess.rst:468 +#: ../../library/subprocess.rst:470 msgid "" ":const:`1` means line buffered (only usable if ``text=True`` or " "``universal_newlines=True``)" msgstr "" -#: ../../library/subprocess.rst:470 +#: ../../library/subprocess.rst:472 msgid "any other positive value means use a buffer of approximately that size" msgstr "" -#: ../../library/subprocess.rst:472 +#: ../../library/subprocess.rst:474 msgid "" "negative bufsize (the default) means the system default of io." "DEFAULT_BUFFER_SIZE will be used." msgstr "" -#: ../../library/subprocess.rst:475 +#: ../../library/subprocess.rst:477 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 " @@ -570,7 +571,7 @@ msgid "" "of Python 2 as most code expected." msgstr "" -#: ../../library/subprocess.rst:482 +#: ../../library/subprocess.rst:484 msgid "" "The *executable* argument specifies a replacement program to execute. It " "is very seldom needed. When ``shell=False``, *executable* replaces the " @@ -583,44 +584,43 @@ msgid "" "default :file:`/bin/sh`." msgstr "" -#: ../../library/subprocess.rst:492 +#: ../../library/subprocess.rst:494 msgid "*executable* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:495 +#: ../../library/subprocess.rst:497 msgid "" "*executable* parameter accepts a bytes and :term:`path-like object` on " "Windows." msgstr "" -#: ../../library/subprocess.rst:507 +#: ../../library/subprocess.rst:509 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " -"values are :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a " -"positive integer), an existing :term:`file object` with a valid file " -"descriptor, and ``None``. :data:`PIPE` indicates that a new pipe to the " -"child should be created. :data:`DEVNULL` indicates that the special file :" -"data:`os.devnull` will be used. With the default settings of ``None``, no " -"redirection will occur; the child's file handles will be inherited from the " -"parent. Additionally, *stderr* can be :data:`STDOUT`, which indicates that " -"the stderr data from the applications should be captured into the same file " -"handle as for stdout." +"values are ``None``, :data:`PIPE`, :data:`DEVNULL`, an existing file " +"descriptor (a positive integer), and an existing :term:`file object` with a " +"valid file descriptor. With the default settings of ``None``, no " +"redirection will occur. :data:`PIPE` indicates that a new pipe to the child " +"should be created. :data:`DEVNULL` indicates that the special file :data:" +"`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, " +"which indicates that the stderr data from the applications should be " +"captured into the same file handle as for *stdout*." msgstr "" -#: ../../library/subprocess.rst:519 +#: ../../library/subprocess.rst:520 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:525 +#: ../../library/subprocess.rst:526 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." msgstr "" -#: ../../library/subprocess.rst:531 +#: ../../library/subprocess.rst:532 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* and " @@ -628,7 +628,7 @@ msgid "" "to call :func:`os.setsid` or :func:`os.setpgid` in the child." msgstr "" -#: ../../library/subprocess.rst:538 +#: ../../library/subprocess.rst:539 msgid "" "The *preexec_fn* parameter is no longer supported in subinterpreters. The " "use of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new " @@ -636,7 +636,7 @@ msgid "" "and other embedded environments." msgstr "" -#: ../../library/subprocess.rst:543 +#: ../../library/subprocess.rst:544 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. " @@ -644,38 +644,38 @@ msgid "" "flag as described in :ref:`fd_inheritance`." msgstr "" -#: ../../library/subprocess.rst:548 +#: ../../library/subprocess.rst:549 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:552 +#: ../../library/subprocess.rst:553 msgid "" "The default for *close_fds* was changed from :const:`False` to what is " "described above." msgstr "" -#: ../../library/subprocess.rst:556 +#: ../../library/subprocess.rst:557 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:561 +#: ../../library/subprocess.rst:562 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:565 +#: ../../library/subprocess.rst:566 msgid "The *pass_fds* parameter was added." msgstr "新增 *pass_fds* 參數。" -#: ../../library/subprocess.rst:568 +#: ../../library/subprocess.rst:569 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:" @@ -684,57 +684,57 @@ msgid "" "executable path is a relative path." msgstr "" -#: ../../library/subprocess.rst:574 +#: ../../library/subprocess.rst:575 msgid "*cwd* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:577 +#: ../../library/subprocess.rst:578 msgid "*cwd* parameter accepts a :term:`path-like object` on Windows." msgstr "" -#: ../../library/subprocess.rst:580 +#: ../../library/subprocess.rst:581 msgid "*cwd* parameter accepts a bytes object on Windows." msgstr "" -#: ../../library/subprocess.rst:583 +#: ../../library/subprocess.rst:584 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:588 +#: ../../library/subprocess.rst:589 msgid "*restore_signals* was added." msgstr "新增 *restore_signals*\\ 。" -#: ../../library/subprocess.rst:591 +#: ../../library/subprocess.rst:592 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." msgstr "" -#: ../../library/subprocess.rst:594 ../../library/subprocess.rst:601 -#: ../../library/subprocess.rst:611 ../../library/subprocess.rst:620 -#: ../../library/subprocess.rst:629 ../../library/subprocess.rst:635 +#: ../../library/subprocess.rst:595 ../../library/subprocess.rst:602 +#: ../../library/subprocess.rst:612 ../../library/subprocess.rst:621 +#: ../../library/subprocess.rst:630 ../../library/subprocess.rst:636 msgid ":ref:`Availability `: POSIX" msgstr ":ref:`適用 `:POSIX" -#: ../../library/subprocess.rst:595 +#: ../../library/subprocess.rst:596 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*\\ 。" -#: ../../library/subprocess.rst:598 +#: ../../library/subprocess.rst:599 msgid "" "If *process_group* is a non-negative integer, the ``setpgid(0, value)`` " "system call will be made in the child process prior to the execution of the " "subprocess." msgstr "" -#: ../../library/subprocess.rst:602 +#: ../../library/subprocess.rst:603 msgid "*process_group* was added." msgstr "新增 *process_group*\\ 。" -#: ../../library/subprocess.rst:605 +#: ../../library/subprocess.rst:606 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 " @@ -743,7 +743,7 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:614 +#: ../../library/subprocess.rst:615 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 " @@ -752,7 +752,7 @@ msgid "" "verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:623 +#: ../../library/subprocess.rst:624 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 " @@ -761,13 +761,13 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:632 +#: ../../library/subprocess.rst:633 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:638 +#: ../../library/subprocess.rst:639 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 " @@ -776,14 +776,14 @@ msgid "" "data:`os.environ` or :data:`os.environb`." msgstr "" -#: ../../library/subprocess.rst:646 +#: ../../library/subprocess.rst:647 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:652 +#: ../../library/subprocess.rst:653 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 " @@ -793,70 +793,70 @@ msgid "" "in binary mode." msgstr "" -#: ../../library/subprocess.rst:658 +#: ../../library/subprocess.rst:659 msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:661 ../../library/subprocess.rst:1282 +#: ../../library/subprocess.rst:662 ../../library/subprocess.rst:1283 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:664 +#: ../../library/subprocess.rst:665 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:668 +#: ../../library/subprocess.rst:669 msgid ":data:`CREATE_NEW_CONSOLE`" msgstr ":data:`CREATE_NEW_CONSOLE`" -#: ../../library/subprocess.rst:669 +#: ../../library/subprocess.rst:670 msgid ":data:`CREATE_NEW_PROCESS_GROUP`" msgstr ":data:`CREATE_NEW_PROCESS_GROUP`" -#: ../../library/subprocess.rst:670 +#: ../../library/subprocess.rst:671 msgid ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" msgstr ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:671 +#: ../../library/subprocess.rst:672 msgid ":data:`BELOW_NORMAL_PRIORITY_CLASS`" msgstr ":data:`BELOW_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:672 +#: ../../library/subprocess.rst:673 msgid ":data:`HIGH_PRIORITY_CLASS`" msgstr ":data:`HIGH_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:673 +#: ../../library/subprocess.rst:674 msgid ":data:`IDLE_PRIORITY_CLASS`" msgstr ":data:`IDLE_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:674 +#: ../../library/subprocess.rst:675 msgid ":data:`NORMAL_PRIORITY_CLASS`" msgstr ":data:`NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:675 +#: ../../library/subprocess.rst:676 msgid ":data:`REALTIME_PRIORITY_CLASS`" msgstr ":data:`REALTIME_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:676 +#: ../../library/subprocess.rst:677 msgid ":data:`CREATE_NO_WINDOW`" msgstr ":data:`CREATE_NO_WINDOW`" -#: ../../library/subprocess.rst:677 +#: ../../library/subprocess.rst:678 msgid ":data:`DETACHED_PROCESS`" msgstr ":data:`DETACHED_PROCESS`" -#: ../../library/subprocess.rst:678 +#: ../../library/subprocess.rst:679 msgid ":data:`CREATE_DEFAULT_ERROR_MODE`" msgstr ":data:`CREATE_DEFAULT_ERROR_MODE`" -#: ../../library/subprocess.rst:679 +#: ../../library/subprocess.rst:680 msgid ":data:`CREATE_BREAKAWAY_FROM_JOB`" msgstr ":data:`CREATE_BREAKAWAY_FROM_JOB`" -#: ../../library/subprocess.rst:681 +#: ../../library/subprocess.rst:682 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 " @@ -864,18 +864,18 @@ msgid "" "platforms will ignore this parameter." msgstr "" -#: ../../library/subprocess.rst:686 +#: ../../library/subprocess.rst:687 msgid "The ``pipesize`` parameter was added." msgstr "新增 ``pipesize`` 參數。" -#: ../../library/subprocess.rst:689 +#: ../../library/subprocess.rst:690 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:707 +#: ../../library/subprocess.rst:708 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." @@ -883,7 +883,7 @@ msgstr "" "引發一個附帶引數 ``executable``、``args``、``cwd``、``env`` 的\\ :ref:`稽核事" "件 ` ``subprocess.Popen``。" -#: ../../library/subprocess.rst:698 +#: ../../library/subprocess.rst:699 msgid "" "Popen and the other functions in this module that use it raise an :ref:" "`auditing event ` ``subprocess.Popen`` with arguments " @@ -891,17 +891,17 @@ msgid "" "be a single string or a list of strings, depending on platform." msgstr "" -#: ../../library/subprocess.rst:703 +#: ../../library/subprocess.rst:704 msgid "Added context manager support." msgstr "" -#: ../../library/subprocess.rst:706 +#: ../../library/subprocess.rst:707 msgid "" "Popen destructor now emits a :exc:`ResourceWarning` warning if the child " "process is still running." msgstr "" -#: ../../library/subprocess.rst:710 +#: ../../library/subprocess.rst:711 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 " @@ -910,17 +910,17 @@ msgid "" "returncode`." msgstr "" -#: ../../library/subprocess.rst:719 +#: ../../library/subprocess.rst:720 msgid "Exceptions" msgstr "例外" -#: ../../library/subprocess.rst:721 +#: ../../library/subprocess.rst:722 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:724 +#: ../../library/subprocess.rst:725 msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " @@ -931,39 +931,39 @@ msgid "" "subprocess." msgstr "" -#: ../../library/subprocess.rst:731 +#: ../../library/subprocess.rst:732 msgid "" "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " "arguments." msgstr "" -#: ../../library/subprocess.rst:734 +#: ../../library/subprocess.rst:735 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:738 +#: ../../library/subprocess.rst:739 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." +"func:`run` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` if " +"the timeout expires before the process exits." msgstr "" -#: ../../library/subprocess.rst:742 +#: ../../library/subprocess.rst:743 msgid "" "Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" -#: ../../library/subprocess.rst:744 +#: ../../library/subprocess.rst:745 msgid "The :exc:`SubprocessError` base class was added." msgstr "" -#: ../../library/subprocess.rst:750 +#: ../../library/subprocess.rst:751 msgid "Security Considerations" msgstr "" -#: ../../library/subprocess.rst:752 +#: ../../library/subprocess.rst:753 msgid "" "Unlike some other popen functions, this implementation will never implicitly " "call a system shell. This means that all characters, including shell " @@ -976,34 +976,34 @@ msgid "" "escaping." msgstr "" -#: ../../library/subprocess.rst:764 +#: ../../library/subprocess.rst:765 msgid "Popen Objects" msgstr "" -#: ../../library/subprocess.rst:766 +#: ../../library/subprocess.rst:767 msgid "Instances of the :class:`Popen` class have the following methods:" msgstr "" -#: ../../library/subprocess.rst:771 +#: ../../library/subprocess.rst:772 msgid "" "Check if child process has terminated. Set and return :attr:`~Popen." "returncode` attribute. Otherwise, returns ``None``." msgstr "" -#: ../../library/subprocess.rst:777 +#: ../../library/subprocess.rst:778 msgid "" "Wait for child process to terminate. Set and return :attr:`~Popen." "returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:780 +#: ../../library/subprocess.rst:781 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:786 +#: ../../library/subprocess.rst:787 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 " @@ -1011,20 +1011,20 @@ msgid "" "when using pipes to avoid that." msgstr "" -#: ../../library/subprocess.rst:793 +#: ../../library/subprocess.rst:794 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:797 ../../library/subprocess.rst:838 -#: ../../library/subprocess.rst:1179 ../../library/subprocess.rst:1219 -#: ../../library/subprocess.rst:1273 +#: ../../library/subprocess.rst:798 ../../library/subprocess.rst:839 +#: ../../library/subprocess.rst:1180 ../../library/subprocess.rst:1220 +#: ../../library/subprocess.rst:1274 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" -#: ../../library/subprocess.rst:802 +#: ../../library/subprocess.rst:803 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 " @@ -1034,13 +1034,13 @@ msgid "" "must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:809 +#: ../../library/subprocess.rst:810 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:813 +#: ../../library/subprocess.rst:814 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 " @@ -1048,67 +1048,67 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:818 +#: ../../library/subprocess.rst:819 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:822 +#: ../../library/subprocess.rst:823 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:835 +#: ../../library/subprocess.rst:836 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:844 +#: ../../library/subprocess.rst:845 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:846 +#: ../../library/subprocess.rst:847 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:850 +#: ../../library/subprocess.rst:851 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:857 +#: ../../library/subprocess.rst:858 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:864 +#: ../../library/subprocess.rst:865 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:868 +#: ../../library/subprocess.rst:869 msgid "" "The following attributes are also set by the class for you to access. " "Reassigning them to new values is unsupported:" msgstr "" -#: ../../library/subprocess.rst:873 +#: ../../library/subprocess.rst:874 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:880 +#: ../../library/subprocess.rst:881 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* " @@ -1117,7 +1117,7 @@ msgid "" "*stdin* argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:889 +#: ../../library/subprocess.rst:890 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 " @@ -1127,7 +1127,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:899 +#: ../../library/subprocess.rst:900 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 " @@ -1137,7 +1137,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:908 +#: ../../library/subprocess.rst:909 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1186,38 +1186,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:949 +#: ../../library/subprocess.rst:950 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:954 +#: ../../library/subprocess.rst:955 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:962 +#: ../../library/subprocess.rst:963 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:969 +#: ../../library/subprocess.rst:970 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:976 +#: ../../library/subprocess.rst:977 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:982 +#: ../../library/subprocess.rst:983 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1226,34 +1226,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:989 +#: ../../library/subprocess.rst:990 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:994 +#: ../../library/subprocess.rst:995 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:998 +#: ../../library/subprocess.rst:999 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:1016 +#: ../../library/subprocess.rst:1017 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:1001 +#: ../../library/subprocess.rst:1002 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:1004 +#: ../../library/subprocess.rst:1005 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1261,7 +1261,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:1011 +#: ../../library/subprocess.rst:1012 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1270,97 +1270,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1021 +#: ../../library/subprocess.rst:1022 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1023 +#: ../../library/subprocess.rst:1024 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1027 +#: ../../library/subprocess.rst:1028 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1032 +#: ../../library/subprocess.rst:1033 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1037 +#: ../../library/subprocess.rst:1038 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1042 +#: ../../library/subprocess.rst:1043 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1046 +#: ../../library/subprocess.rst:1047 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1052 +#: ../../library/subprocess.rst:1053 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1057 +#: ../../library/subprocess.rst:1058 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1062 +#: ../../library/subprocess.rst:1063 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:1066 +#: ../../library/subprocess.rst:1067 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1070 +#: ../../library/subprocess.rst:1071 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1077 +#: ../../library/subprocess.rst:1078 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1084 +#: ../../library/subprocess.rst:1085 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1091 +#: ../../library/subprocess.rst:1092 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1098 +#: ../../library/subprocess.rst:1099 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1105 +#: ../../library/subprocess.rst:1106 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1370,20 +1370,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1116 +#: ../../library/subprocess.rst:1117 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1123 +#: ../../library/subprocess.rst:1124 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:1131 +#: ../../library/subprocess.rst:1132 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 " @@ -1391,39 +1391,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1141 +#: ../../library/subprocess.rst:1142 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1149 +#: ../../library/subprocess.rst:1150 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1151 +#: ../../library/subprocess.rst:1152 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:1158 +#: ../../library/subprocess.rst:1159 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1161 ../../library/subprocess.rst:1201 +#: ../../library/subprocess.rst:1162 ../../library/subprocess.rst:1202 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1165 ../../library/subprocess.rst:1205 +#: ../../library/subprocess.rst:1166 ../../library/subprocess.rst:1206 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1167 ../../library/subprocess.rst:1207 +#: ../../library/subprocess.rst:1168 ../../library/subprocess.rst:1208 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 " @@ -1431,14 +1431,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1174 ../../library/subprocess.rst:1214 +#: ../../library/subprocess.rst:1175 ../../library/subprocess.rst:1215 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:1194 +#: ../../library/subprocess.rst:1195 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1447,11 +1447,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1236 +#: ../../library/subprocess.rst:1237 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1238 +#: ../../library/subprocess.rst:1239 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:" @@ -1459,11 +1459,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1243 +#: ../../library/subprocess.rst:1244 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1247 +#: ../../library/subprocess.rst:1248 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 " @@ -1473,52 +1473,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1254 +#: ../../library/subprocess.rst:1255 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:1258 +#: ../../library/subprocess.rst:1259 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:1262 +#: ../../library/subprocess.rst:1263 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1276 +#: ../../library/subprocess.rst:1277 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1279 +#: ../../library/subprocess.rst:1280 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1297 +#: ../../library/subprocess.rst:1298 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1299 +#: ../../library/subprocess.rst:1300 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1303 +#: ../../library/subprocess.rst:1304 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:1307 +#: ../../library/subprocess.rst:1308 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1526,143 +1526,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1312 +#: ../../library/subprocess.rst:1313 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1317 +#: ../../library/subprocess.rst:1318 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1323 ../../library/subprocess.rst:1334 -#: ../../library/subprocess.rst:1351 +#: ../../library/subprocess.rst:1324 ../../library/subprocess.rst:1335 +#: ../../library/subprocess.rst:1352 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1328 +#: ../../library/subprocess.rst:1329 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1341 +#: ../../library/subprocess.rst:1342 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:1344 +#: ../../library/subprocess.rst:1345 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1357 +#: ../../library/subprocess.rst:1358 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1365 +#: ../../library/subprocess.rst:1366 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1367 +#: ../../library/subprocess.rst:1368 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1368 +#: ../../library/subprocess.rst:1369 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1371 +#: ../../library/subprocess.rst:1372 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:1375 +#: ../../library/subprocess.rst:1376 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1388 +#: ../../library/subprocess.rst:1389 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1390 +#: ../../library/subprocess.rst:1391 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1396 +#: ../../library/subprocess.rst:1397 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1402 +#: ../../library/subprocess.rst:1403 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1408 +#: ../../library/subprocess.rst:1409 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1417 +#: ../../library/subprocess.rst:1418 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1447 +#: ../../library/subprocess.rst:1448 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1463 +#: ../../library/subprocess.rst:1464 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1467 +#: ../../library/subprocess.rst:1468 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:1486 +#: ../../library/subprocess.rst:1487 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1489 +#: ../../library/subprocess.rst:1490 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1491 +#: ../../library/subprocess.rst:1492 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1493 +#: ../../library/subprocess.rst:1494 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1495 +#: ../../library/subprocess.rst:1496 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:1501 +#: ../../library/subprocess.rst:1502 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1503 +#: ../../library/subprocess.rst:1504 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1670,11 +1670,11 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1510 +#: ../../library/subprocess.rst:1511 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1512 +#: ../../library/subprocess.rst:1513 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " @@ -1682,85 +1682,85 @@ msgid "" "details." msgstr "" -#: ../../library/subprocess.rst:1517 +#: ../../library/subprocess.rst:1518 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:1530 ../../library/subprocess.rst:1552 +#: ../../library/subprocess.rst:1531 ../../library/subprocess.rst:1553 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix 和 Windows。" -#: ../../library/subprocess.rst:1532 +#: ../../library/subprocess.rst:1533 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1535 +#: ../../library/subprocess.rst:1536 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:1539 ../../library/subprocess.rst:1557 +#: ../../library/subprocess.rst:1540 ../../library/subprocess.rst:1558 msgid "Added *encoding* and *errors* arguments." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/subprocess.rst:1544 +#: ../../library/subprocess.rst:1545 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1546 +#: ../../library/subprocess.rst:1547 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:1554 +#: ../../library/subprocess.rst:1555 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1562 +#: ../../library/subprocess.rst:1563 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1567 +#: ../../library/subprocess.rst:1568 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1569 +#: ../../library/subprocess.rst:1570 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:1573 +#: ../../library/subprocess.rst:1574 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1576 +#: ../../library/subprocess.rst:1577 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:1581 +#: ../../library/subprocess.rst:1582 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1584 +#: ../../library/subprocess.rst:1585 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1587 +#: ../../library/subprocess.rst:1588 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1768,33 +1768,33 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1596 +#: ../../library/subprocess.rst:1597 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1597 +#: ../../library/subprocess.rst:1598 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1604 +#: ../../library/subprocess.rst:1605 msgid "Disabling use of ``vfork()`` or ``posix_spawn()``" msgstr "" -#: ../../library/subprocess.rst:1606 +#: ../../library/subprocess.rst:1607 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" -#: ../../library/subprocess.rst:1610 +#: ../../library/subprocess.rst:1611 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " "prevent ``vfork()`` from being used by Python, you can set the :attr:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" -#: ../../library/subprocess.rst:1618 +#: ../../library/subprocess.rst:1619 msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" @@ -1802,7 +1802,7 @@ msgid "" "that." msgstr "" -#: ../../library/subprocess.rst:1627 +#: ../../library/subprocess.rst:1628 msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " @@ -1810,25 +1810,25 @@ msgid "" "the corresponding function will be used, only that it may be." msgstr "" -#: ../../library/subprocess.rst:1632 +#: ../../library/subprocess.rst:1633 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " "your code." msgstr "" -#: ../../library/subprocess.rst:1636 +#: ../../library/subprocess.rst:1637 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" -#: ../../library/subprocess.rst:1637 +#: ../../library/subprocess.rst:1638 msgid "``_USE_VFORK``" msgstr "``_USE_VFORK``" -#: ../../library/subprocess.rst:291 +#: ../../library/subprocess.rst:293 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/subprocess.rst:291 +#: ../../library/subprocess.rst:293 msgid "subprocess module" msgstr "subprocess 模組" diff --git a/library/sys.po b/library/sys.po index c621f5a3eb..15b42fde6f 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -295,14 +295,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "_current_exceptions``。" -#: ../../library/sys.rst:225 +#: ../../library/sys.rst:223 +msgid "" +"Each value in the dictionary is now a single exception instance, rather than " +"a 3-tuple as returned from ``sys.exc_info()``." +msgstr "" + +#: ../../library/sys.rst:229 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:229 +#: ../../library/sys.rst:233 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -312,7 +318,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:236 +#: ../../library/sys.rst:240 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -326,48 +332,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:248 +#: ../../library/sys.rst:252 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:252 +#: ../../library/sys.rst:256 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:259 +#: ../../library/sys.rst:263 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:262 +#: ../../library/sys.rst:266 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:270 +#: ../../library/sys.rst:274 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:276 +#: ../../library/sys.rst:280 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:278 ../../library/sys.rst:879 -#: ../../library/sys.rst:1585 ../../library/sys.rst:1818 +#: ../../library/sys.rst:282 ../../library/sys.rst:906 +#: ../../library/sys.rst:1643 ../../library/sys.rst:1876 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:283 +#: ../../library/sys.rst:287 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -376,7 +382,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:289 +#: ../../library/sys.rst:293 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -384,15 +390,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:293 +#: ../../library/sys.rst:297 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:313 +#: ../../library/sys.rst:317 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:319 +#: ../../library/sys.rst:323 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -401,38 +407,38 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:328 +#: ../../library/sys.rst:332 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:335 ../../library/sys.rst:1026 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:339 ../../library/sys.rst:1053 +#: ../../library/sys.rst:1759 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:335 ../../library/sys.rst:1026 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:339 ../../library/sys.rst:1053 +#: ../../library/sys.rst:1759 msgid "Explanation" msgstr "解釋" -#: ../../library/sys.rst:337 +#: ../../library/sys.rst:341 msgid ":const:`emscripten_version`" msgstr ":const:`emscripten_version`" -#: ../../library/sys.rst:337 +#: ../../library/sys.rst:341 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:340 +#: ../../library/sys.rst:344 msgid ":const:`runtime`" msgstr ":const:`runtime`" -#: ../../library/sys.rst:340 +#: ../../library/sys.rst:344 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -440,27 +446,27 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:343 +#: ../../library/sys.rst:347 msgid ":const:`pthreads`" msgstr ":const:`pthreads`" -#: ../../library/sys.rst:343 +#: ../../library/sys.rst:347 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:350 msgid ":const:`shared_memory`" msgstr ":const:`shared_memory`" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:350 +#: ../../library/sys.rst:354 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:357 +#: ../../library/sys.rst:361 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -471,12 +477,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:365 +#: ../../library/sys.rst:369 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:367 +#: ../../library/sys.rst:371 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -484,12 +490,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:377 +#: ../../library/sys.rst:381 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:379 +#: ../../library/sys.rst:383 msgid "" "When an exception is raised and uncaught, the interpreter calls ``sys." "excepthook`` with three arguments, the exception class, exception instance, " @@ -500,7 +506,7 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:386 +#: ../../library/sys.rst:390 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -508,7 +514,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:392 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -518,14 +524,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:397 +#: ../../library/sys.rst:401 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:407 +#: ../../library/sys.rst:411 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -534,15 +540,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:413 +#: ../../library/sys.rst:417 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:416 +#: ../../library/sys.rst:420 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:422 +#: ../../library/sys.rst:426 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -550,11 +556,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:427 +#: ../../library/sys.rst:431 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:434 +#: ../../library/sys.rst:438 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -565,13 +571,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:448 +#: ../../library/sys.rst:452 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -579,7 +585,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:456 +#: ../../library/sys.rst:460 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -591,7 +597,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:467 +#: ../../library/sys.rst:471 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -599,7 +605,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:475 +#: ../../library/sys.rst:479 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -607,13 +613,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:483 +#: ../../library/sys.rst:487 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:485 +#: ../../library/sys.rst:489 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -629,7 +635,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:498 +#: ../../library/sys.rst:502 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -638,194 +644,194 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:503 +#: ../../library/sys.rst:507 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:511 +#: ../../library/sys.rst:515 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:515 ../../library/sys.rst:572 -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:519 ../../library/sys.rst:576 +#: ../../library/sys.rst:952 msgid "attribute" msgstr "屬性" -#: ../../library/sys.rst:515 +#: ../../library/sys.rst:519 msgid "flag" msgstr "旗標" -#: ../../library/sys.rst:517 +#: ../../library/sys.rst:521 msgid ":const:`debug`" msgstr ":const:`debug`" -#: ../../library/sys.rst:517 +#: ../../library/sys.rst:521 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:518 +#: ../../library/sys.rst:522 msgid ":const:`inspect`" msgstr ":const:`inspect`" -#: ../../library/sys.rst:518 ../../library/sys.rst:519 +#: ../../library/sys.rst:522 ../../library/sys.rst:523 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:523 msgid ":const:`interactive`" msgstr ":const:`interactive`" -#: ../../library/sys.rst:520 +#: ../../library/sys.rst:524 msgid ":const:`isolated`" msgstr ":const:`isolated`" -#: ../../library/sys.rst:520 +#: ../../library/sys.rst:524 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:521 +#: ../../library/sys.rst:525 msgid ":const:`optimize`" msgstr ":const:`optimize`" -#: ../../library/sys.rst:521 +#: ../../library/sys.rst:525 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:522 +#: ../../library/sys.rst:526 msgid ":const:`dont_write_bytecode`" msgstr ":const:`dont_write_bytecode`" -#: ../../library/sys.rst:522 +#: ../../library/sys.rst:526 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:523 +#: ../../library/sys.rst:527 msgid ":const:`no_user_site`" msgstr ":const:`no_user_site`" -#: ../../library/sys.rst:523 +#: ../../library/sys.rst:527 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:528 msgid ":const:`no_site`" msgstr ":const:`no_site`" -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:528 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:529 msgid ":const:`ignore_environment`" msgstr ":const:`ignore_environment`" -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:529 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:526 +#: ../../library/sys.rst:530 msgid ":const:`verbose`" msgstr ":const:`verbose`" -#: ../../library/sys.rst:526 +#: ../../library/sys.rst:530 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:527 +#: ../../library/sys.rst:531 msgid ":const:`bytes_warning`" msgstr ":const:`bytes_warning`" -#: ../../library/sys.rst:527 +#: ../../library/sys.rst:531 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:532 msgid ":const:`quiet`" msgstr ":const:`quiet`" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:532 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:529 +#: ../../library/sys.rst:533 msgid ":const:`hash_randomization`" msgstr ":const:`hash_randomization`" -#: ../../library/sys.rst:529 +#: ../../library/sys.rst:533 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:530 +#: ../../library/sys.rst:534 msgid ":const:`dev_mode`" msgstr ":const:`dev_mode`" -#: ../../library/sys.rst:530 +#: ../../library/sys.rst:534 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:535 msgid ":const:`utf8_mode`" msgstr ":const:`utf8_mode`" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:535 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:532 +#: ../../library/sys.rst:536 msgid ":const:`safe_path`" msgstr ":const:`safe_path`" -#: ../../library/sys.rst:532 +#: ../../library/sys.rst:536 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:537 msgid ":const:`int_max_str_digits`" msgstr ":const:`int_max_str_digits`" -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:537 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:536 +#: ../../library/sys.rst:540 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:539 +#: ../../library/sys.rst:543 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:542 +#: ../../library/sys.rst:546 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:545 +#: ../../library/sys.rst:549 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:548 +#: ../../library/sys.rst:552 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:557 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:556 +#: ../../library/sys.rst:560 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:562 +#: ../../library/sys.rst:566 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -835,163 +841,163 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:572 +#: ../../library/sys.rst:576 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:572 ../../library/sys.rst:925 +#: ../../library/sys.rst:576 ../../library/sys.rst:952 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 msgid "``epsilon``" msgstr "``epsilon``" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 msgid "``DBL_EPSILON``" msgstr "``DBL_EPSILON``" -#: ../../library/sys.rst:574 +#: ../../library/sys.rst:578 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float" msgstr "" -#: ../../library/sys.rst:577 +#: ../../library/sys.rst:581 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "``dig``" msgstr "``dig``" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "``DBL_DIG``" msgstr "``DBL_DIG``" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "" "maximum number of decimal digits that can be faithfully represented in a " "float; see below" msgstr "" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "``mant_dig``" msgstr "``mant_dig``" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "``DBL_MANT_DIG``" msgstr "``DBL_MANT_DIG``" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "" "float precision: the number of base-``radix`` digits in the significand of a " "float" msgstr "" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "``max``" msgstr "``max``" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "``DBL_MAX``" msgstr "``DBL_MAX``" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "maximum representable positive finite float" msgstr "" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 msgid "``max_exp``" msgstr "``max_exp``" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 msgid "``DBL_MAX_EXP``" msgstr "``DBL_MAX_EXP``" -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:591 msgid "" "maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float" msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "``max_10_exp``" msgstr "``max_10_exp``" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "``DBL_MAX_10_EXP``" msgstr "``DBL_MAX_10_EXP``" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "" "maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats" msgstr "" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "``min``" msgstr "``min``" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "``DBL_MIN``" msgstr "``DBL_MIN``" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "minimum representable positive *normalized* float" msgstr "" -#: ../../library/sys.rst:595 +#: ../../library/sys.rst:599 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 msgid "``min_exp``" msgstr "``min_exp``" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 msgid "``DBL_MIN_EXP``" msgstr "``DBL_MIN_EXP``" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "``min_10_exp``" msgstr "``min_10_exp``" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "``DBL_MIN_10_EXP``" msgstr "``DBL_MIN_10_EXP``" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 msgid "``radix``" msgstr "``radix``" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 msgid "``FLT_RADIX``" msgstr "``FLT_RADIX``" -#: ../../library/sys.rst:605 +#: ../../library/sys.rst:609 msgid "radix of exponent representation" msgstr "" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 msgid "``rounds``" msgstr "``rounds``" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 msgid "``FLT_ROUNDS``" msgstr "``FLT_ROUNDS``" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:611 msgid "" "integer representing the rounding mode for floating-point arithmetic. This " "reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " @@ -999,13 +1005,13 @@ msgid "" "toward positive infinity, ``3`` toward negative infinity" msgstr "" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:621 msgid "" "All other values for ``FLT_ROUNDS`` characterize implementation-defined " "rounding behavior." msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -1013,13 +1019,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:638 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:647 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1029,7 +1035,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:660 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1039,38 +1045,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:663 +#: ../../library/sys.rst:667 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:671 +#: ../../library/sys.rst:675 +msgid "Return the number of unicode objects that have been interned." +msgstr "" + +#: ../../library/sys.rst:682 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:684 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:691 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:686 +#: ../../library/sys.rst:697 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:691 ../../library/sys.rst:1347 +#: ../../library/sys.rst:702 ../../library/sys.rst:1373 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:696 +#: ../../library/sys.rst:707 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:729 +#: ../../library/sys.rst:740 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1125,20 +1135,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:747 +#: ../../library/sys.rst:758 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:765 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:761 +#: ../../library/sys.rst:772 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1146,46 +1156,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:780 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:774 +#: ../../library/sys.rst:785 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:777 +#: ../../library/sys.rst:788 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:780 +#: ../../library/sys.rst:791 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:795 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:790 +#: ../../library/sys.rst:801 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:798 +#: ../../library/sys.rst:809 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1194,7 +1204,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:803 +#: ../../library/sys.rst:814 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1202,21 +1212,39 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:807 +#: ../../library/sys.rst:818 ../../library/sys.rst:834 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:817 +#: ../../library/sys.rst:824 +msgid "" +"Return the name of a module from the call stack. If optional integer " +"*depth* is given, return the module that many calls below the top of the " +"stack. If that is deeper than the call stack, or if the module is " +"unidentifiable, ``None`` is returned. The default for *depth* is zero, " +"returning the module at the top of the call stack." +msgstr "" + +#: ../../library/sys.rst:830 +#, fuzzy +msgid "" +"Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " +"argument ``depth``." +msgstr "" +"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." +"_getframe``。" + +#: ../../library/sys.rst:844 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:853 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:830 +#: ../../library/sys.rst:857 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1224,7 +1252,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:865 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1236,54 +1264,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:849 +#: ../../library/sys.rst:876 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:851 +#: ../../library/sys.rst:878 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:881 msgid "Constant" msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:881 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:856 +#: ../../library/sys.rst:883 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:856 +#: ../../library/sys.rst:883 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:885 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:885 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:888 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:888 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:865 +#: ../../library/sys.rst:892 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:896 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1291,24 +1319,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:902 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:881 +#: ../../library/sys.rst:908 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:912 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:891 +#: ../../library/sys.rst:918 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1318,103 +1346,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:898 +#: ../../library/sys.rst:925 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:902 ../../library/sys.rst:1549 +#: ../../library/sys.rst:929 ../../library/sys.rst:1575 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:908 +#: ../../library/sys.rst:935 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:914 ../../library/sys.rst:1570 +#: ../../library/sys.rst:941 ../../library/sys.rst:1596 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:920 +#: ../../library/sys.rst:947 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:954 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:954 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:956 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:956 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:958 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:958 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:933 +#: ../../library/sys.rst:960 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:933 +#: ../../library/sys.rst:960 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:962 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:962 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:965 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:965 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:941 +#: ../../library/sys.rst:968 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:941 +#: ../../library/sys.rst:968 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:970 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:970 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:976 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:955 +#: ../../library/sys.rst:982 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1422,7 +1450,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:993 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1430,25 +1458,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:971 +#: ../../library/sys.rst:998 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:976 +#: ../../library/sys.rst:1003 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:980 +#: ../../library/sys.rst:1007 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:984 +#: ../../library/sys.rst:1011 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1460,13 +1488,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:994 +#: ../../library/sys.rst:1021 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1024 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1475,7 +1503,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1004 +#: ../../library/sys.rst:1031 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1485,61 +1513,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1015 +#: ../../library/sys.rst:1042 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1047 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1055 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1055 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1059 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1059 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1062 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1062 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1066 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1066 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1074 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1053 +#: ../../library/sys.rst:1080 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1086 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1556,13 +1584,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1061 +#: ../../library/sys.rst:1088 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1097 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1574,56 +1602,57 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1105 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1084 +#: ../../library/sys.rst:1111 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1094 +#: ../../library/sys.rst:1118 msgid "" -"These three variables are not always defined; they are set when an exception " -"is not handled and the interpreter prints an error message and a stack " -"traceback. Their intended use is to allow an interactive user to import a " -"debugger module and engage in post-mortem debugging without having to re-" -"execute the command that caused the error. (Typical use is ``import pdb; " -"pdb.pm()`` to enter the post-mortem debugger; see :mod:`pdb` module for more " -"information.)" +"This variable is not always defined; it is set to the exception instance " +"when an exception is not handled and the interpreter prints an error message " +"and a stack traceback. Its intended use is to allow an interactive user to " +"import a debugger module and engage in post-mortem debugging without having " +"to re-execute the command that caused the error. (Typical use is ``import " +"pdb; pdb.pm()`` to enter the post-mortem debugger; see :mod:`pdb` module for " +"more information.)" msgstr "" -#: ../../library/sys.rst:1102 +#: ../../library/sys.rst:1132 msgid "" -"The meaning of the variables is the same as that of the return values from :" -"func:`exc_info` above." +"These three variables are deprecated; use :data:`sys.last_exc` instead. They " +"hold the legacy representation of ``sys.last_exc``, as returned from :func:" +"`exc_info` above." msgstr "" -#: ../../library/sys.rst:1108 +#: ../../library/sys.rst:1138 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1145 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1118 +#: ../../library/sys.rst:1148 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1126 +#: ../../library/sys.rst:1156 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1636,36 +1665,35 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1169 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1169 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1143 +#: ../../library/sys.rst:1173 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1142 +#: ../../library/sys.rst:1172 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1178 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" -"`451`. Earlier versions of Python looked for a method called :meth:" -"`~importlib.abc.MetaPathFinder.find_module`. This is still called as a " -"fallback if a :data:`meta_path` entry doesn't have a :meth:`~importlib.abc." -"MetaPathFinder.find_spec` method." +"`451`. Earlier versions of Python looked for a method called :meth:`!" +"find_module`. This is still called as a fallback if a :data:`meta_path` " +"entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1156 +#: ../../library/sys.rst:1186 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1677,78 +1705,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1168 +#: ../../library/sys.rst:1198 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1171 +#: ../../library/sys.rst:1201 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1180 +#: ../../library/sys.rst:1210 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1184 +#: ../../library/sys.rst:1214 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1188 +#: ../../library/sys.rst:1218 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1220 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1222 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1195 +#: ../../library/sys.rst:1225 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1228 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1204 +#: ../../library/sys.rst:1234 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1209 +#: ../../library/sys.rst:1239 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1213 ../../library/sys.rst:1224 +#: ../../library/sys.rst:1243 ../../library/sys.rst:1254 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1248 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1756,19 +1784,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1226 -msgid "" -"``None`` is stored instead of :class:`imp.NullImporter` when no finder is " -"found." -msgstr "" - -#: ../../library/sys.rst:1233 +#: ../../library/sys.rst:1259 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1236 +#: ../../library/sys.rst:1262 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1777,75 +1799,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1275 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1278 msgid "System" msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1278 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1280 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1280 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1255 +#: ../../library/sys.rst:1281 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1255 +#: ../../library/sys.rst:1281 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1282 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1282 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1283 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1283 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1258 +#: ../../library/sys.rst:1284 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1258 +#: ../../library/sys.rst:1284 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1285 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1285 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1286 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1286 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1289 msgid "" "On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1853,7 +1875,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1269 +#: ../../library/sys.rst:1295 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1861,57 +1883,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1277 +#: ../../library/sys.rst:1303 msgid "" ":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1306 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1312 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1315 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1319 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1295 +#: ../../library/sys.rst:1321 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1324 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1300 +#: ../../library/sys.rst:1326 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1334 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1920,14 +1942,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1340 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1355 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1937,7 +1959,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1339 +#: ../../library/sys.rst:1365 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1948,14 +1970,14 @@ msgid "" "data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1351 +#: ../../library/sys.rst:1377 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1389 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1970,7 +1992,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1374 +#: ../../library/sys.rst:1400 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1978,71 +2000,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1379 +#: ../../library/sys.rst:1405 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1381 ../../library/sys.rst:1462 +#: ../../library/sys.rst:1407 ../../library/sys.rst:1488 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1385 ../../library/sys.rst:1467 +#: ../../library/sys.rst:1411 ../../library/sys.rst:1493 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1410 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1390 ../../library/sys.rst:1482 +#: ../../library/sys.rst:1416 ../../library/sys.rst:1508 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1414 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1420 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1419 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1423 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1423 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1425 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1426 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1404 +#: ../../library/sys.rst:1430 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1434 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2050,19 +2072,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1413 +#: ../../library/sys.rst:1439 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1416 +#: ../../library/sys.rst:1442 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1449 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2073,7 +2095,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1440 +#: ../../library/sys.rst:1466 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2082,7 +2104,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1445 +#: ../../library/sys.rst:1471 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2090,7 +2112,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1476 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2098,31 +2120,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1481 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1485 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1491 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1502 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1496 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2132,7 +2154,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1505 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2140,22 +2162,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1487 +#: ../../library/sys.rst:1513 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1511 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1495 +#: ../../library/sys.rst:1521 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1490 +#: ../../library/sys.rst:1516 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2164,13 +2186,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1523 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1526 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2184,17 +2206,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1511 +#: ../../library/sys.rst:1537 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1539 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1543 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2202,13 +2224,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1524 +#: ../../library/sys.rst:1550 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1529 +#: ../../library/sys.rst:1555 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2217,7 +2239,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1535 +#: ../../library/sys.rst:1561 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2225,7 +2247,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1537 +#: ../../library/sys.rst:1563 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2233,20 +2255,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1565 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1568 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1554 +#: ../../library/sys.rst:1580 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2255,74 +2277,106 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1587 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1591 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1575 +#: ../../library/sys.rst:1601 +msgid "" +"Activate the stack profiler trampoline *backend*. The only supported backend " +"is ``\"perf\"``." +msgstr "" + +#: ../../library/sys.rst:1604 ../../library/sys.rst:1619 +#: ../../library/sys.rst:1627 +#, fuzzy +msgid ":ref:`Availability `: Linux." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/sys.rst:1610 +msgid ":ref:`perf_profiling`" +msgstr "" + +#: ../../library/sys.rst:1611 +msgid "https://perf.wiki.kernel.org" +msgstr "" + +#: ../../library/sys.rst:1615 +msgid "Deactivate the current stack profiler trampoline backend." +msgstr "" + +#: ../../library/sys.rst:1617 +msgid "If no stack profiler is activated, this function has no effect." +msgstr "" + +#: ../../library/sys.rst:1625 +msgid "Return ``True`` if a stack profiler trampoline is active." +msgstr "" + +#: ../../library/sys.rst:1633 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1637 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1582 +#: ../../library/sys.rst:1640 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1645 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1594 +#: ../../library/sys.rst:1652 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1655 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1657 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1659 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1603 +#: ../../library/sys.rst:1661 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1607 +#: ../../library/sys.rst:1665 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1610 +#: ../../library/sys.rst:1668 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2333,14 +2387,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1619 +#: ../../library/sys.rst:1677 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1682 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2349,7 +2403,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1689 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2358,19 +2412,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1695 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1643 +#: ../../library/sys.rst:1701 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1647 +#: ../../library/sys.rst:1705 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2378,7 +2432,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1657 +#: ../../library/sys.rst:1715 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2386,7 +2440,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1662 +#: ../../library/sys.rst:1720 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2394,7 +2448,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1726 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2402,12 +2456,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1676 +#: ../../library/sys.rst:1734 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1678 +#: ../../library/sys.rst:1736 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2415,7 +2469,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1683 +#: ../../library/sys.rst:1741 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2423,72 +2477,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1746 msgid "See also the :attr:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1753 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1761 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1761 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1763 msgid "``'nt'``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1706 +#: ../../library/sys.rst:1764 msgid "``'pthread'``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1765 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1709 +#: ../../library/sys.rst:1767 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1769 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1769 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1713 +#: ../../library/sys.rst:1771 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1772 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1716 +#: ../../library/sys.rst:1774 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1776 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1776 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1785 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2497,72 +2551,72 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1793 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1795 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1799 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1801 msgid "*exc_type*: Exception type." msgstr "*exc_type*: 例外型別。" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1802 msgid "*exc_value*: Exception value, can be ``None``." msgstr "*exc_value*: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1803 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "*exc_traceback*: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1746 +#: ../../library/sys.rst:1804 msgid "*err_msg*: Error message, can be ``None``." msgstr "*err_msg*: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1747 +#: ../../library/sys.rst:1805 msgid "*object*: Object causing the exception, can be ``None``." msgstr "*object*: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1807 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1753 +#: ../../library/sys.rst:1811 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1814 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1818 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1764 +#: ../../library/sys.rst:1822 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "關於處理未捕捉得例外,另請參閱 :func:`excepthook`。" -#: ../../library/sys.rst:1766 +#: ../../library/sys.rst:1824 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2571,7 +2625,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1826 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2579,7 +2633,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1835 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2588,13 +2642,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1844 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1792 +#: ../../library/sys.rst:1850 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2605,18 +2659,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1858 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1805 +#: ../../library/sys.rst:1863 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1812 +#: ../../library/sys.rst:1870 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2625,25 +2679,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1823 +#: ../../library/sys.rst:1881 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1897 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1847 +#: ../../library/sys.rst:1905 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1906 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2656,58 +2710,58 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:443 +#: ../../library/sys.rst:447 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:443 +#: ../../library/sys.rst:447 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +#: ../../library/sys.rst:840 ../../library/sys.rst:1385 msgid "profile function" msgstr "" -#: ../../library/sys.rst:813 ../../library/sys.rst:1359 +#: ../../library/sys.rst:840 ../../library/sys.rst:1385 msgid "profiler" msgstr "" -#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +#: ../../library/sys.rst:849 ../../library/sys.rst:1462 msgid "trace function" msgstr "" -#: ../../library/sys.rst:822 ../../library/sys.rst:1436 +#: ../../library/sys.rst:849 ../../library/sys.rst:1462 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1208 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1208 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1208 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1349 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1349 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1349 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1349 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1349 msgid "..." msgstr "..." diff --git a/library/sysconfig.po b/library/sysconfig.po index e624846ca4..5fbd96a8b2 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,7 +42,7 @@ msgstr "" msgid "" "A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` " "header file that are necessary to build both the Python binary itself and " -"third-party C extensions compiled using :mod:`distutils`." +"third-party C extensions compiled using ``setuptools``." msgstr "" #: ../../library/sysconfig.rst:30 diff --git a/library/syslog.po b/library/syslog.po index 99ca71e236..8c1e4a56f5 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,7 +72,8 @@ msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." msgstr "" -"引發一個附帶引數 ``priority``、``message`` 的\\ :ref:`稽核事件 ` ``syslog.syslog``。" +"引發一個附帶引數 ``priority``、``message`` 的\\ :ref:`稽核事件 ` " +"``syslog.syslog``。" #: ../../library/syslog.rst:38 msgid "" @@ -81,14 +82,23 @@ msgid "" "syslog implementation to call ``openlog()``." msgstr "" -#: ../../library/syslog.rst:46 +#: ../../library/syslog.rst:43 +msgid "" +"This function is restricted in subinterpreters. (Only code that runs in " +"multiple interpreters is affected and the restriction is not relevant for " +"most users.) :func:`openlog` must be called in the main interpreter before :" +"func:`syslog` may be used in a subinterpreter. Otherwise it will raise :exc:" +"`RuntimeError`." +msgstr "" + +#: ../../library/syslog.rst:53 msgid "" "Logging options of subsequent :func:`syslog` calls can be set by calling :" "func:`openlog`. :func:`syslog` will call :func:`openlog` with no arguments " "if the log is not currently open." msgstr "" -#: ../../library/syslog.rst:50 +#: ../../library/syslog.rst:57 msgid "" "The optional *ident* keyword argument is a string which is prepended to " "every message, and defaults to ``sys.argv[0]`` with leading path components " @@ -98,25 +108,34 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:68 +#: ../../library/syslog.rst:75 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." msgstr "" -"引發一個附帶引數 ``ident``、``logoption``、``facility`` 的\\ :ref:`稽核事件 ` ``syslog.openlog``。" +"引發一個附帶引數 ``ident``、``logoption``、``facility`` 的\\ :ref:`稽核事件 " +"` ``syslog.openlog``。" -#: ../../library/syslog.rst:59 +#: ../../library/syslog.rst:66 msgid "" "In previous versions, keyword arguments were not allowed, and *ident* was " "required." msgstr "" -#: ../../library/syslog.rst:66 +#: ../../library/syslog.rst:70 ../../library/syslog.rst:89 +msgid "" +"This function is restricted in subinterpreters. (Only code that runs in " +"multiple interpreters is affected and the restriction is not relevant for " +"most users.) This may only be called in the main interpreter. It will raise :" +"exc:`RuntimeError` if called in a subinterpreter." +msgstr "" + +#: ../../library/syslog.rst:80 msgid "" "Reset the syslog module values and call the system library ``closelog()``." msgstr "" -#: ../../library/syslog.rst:68 +#: ../../library/syslog.rst:82 msgid "" "This causes the module to behave as it does when initially imported. For " "example, :func:`openlog` will be called on the first :func:`syslog` call " @@ -124,14 +143,14 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:84 +#: ../../library/syslog.rst:98 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``syslog.closelog``。" -#: ../../library/syslog.rst:78 +#: ../../library/syslog.rst:99 msgid "" "Set the priority mask to *maskpri* and return the previous mask value. " "Calls to :func:`syslog` with a priority level not set in *maskpri* are " @@ -141,33 +160,34 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:96 +#: ../../library/syslog.rst:117 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." msgstr "" -"引發一個附帶引數 ``maskpri`` 的\\ :ref:`稽核事件 ` ``syslog.setlogmask``。" +"引發一個附帶引數 ``maskpri`` 的\\ :ref:`稽核事件 ` ``syslog." +"setlogmask``。" -#: ../../library/syslog.rst:87 +#: ../../library/syslog.rst:108 msgid "The module defines the following constants:" msgstr "" -#: ../../library/syslog.rst:92 +#: ../../library/syslog.rst:113 msgid "Priority levels (high to low):" msgstr "" -#: ../../library/syslog.rst:90 +#: ../../library/syslog.rst:111 msgid "" ":const:`LOG_EMERG`, :const:`LOG_ALERT`, :const:`LOG_CRIT`, :const:" "`LOG_ERR`, :const:`LOG_WARNING`, :const:`LOG_NOTICE`, :const:`LOG_INFO`, :" "const:`LOG_DEBUG`." msgstr "" -#: ../../library/syslog.rst:99 +#: ../../library/syslog.rst:120 msgid "Facilities:" msgstr "" -#: ../../library/syslog.rst:95 +#: ../../library/syslog.rst:116 msgid "" ":const:`LOG_KERN`, :const:`LOG_USER`, :const:`LOG_MAIL`, :const:" "`LOG_DAEMON`, :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:" @@ -175,33 +195,33 @@ msgid "" "const:`LOG_LOCAL7`, and, if defined in ````, :const:`LOG_AUTHPRIV`." msgstr "" -#: ../../library/syslog.rst:105 +#: ../../library/syslog.rst:126 msgid "Log options:" msgstr "" -#: ../../library/syslog.rst:102 +#: ../../library/syslog.rst:123 msgid "" ":const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined in " "````, :const:`LOG_ODELAY`, :const:`LOG_NOWAIT`, and :const:" "`LOG_PERROR`." msgstr "" -#: ../../library/syslog.rst:108 +#: ../../library/syslog.rst:129 msgid "Examples" msgstr "範例" -#: ../../library/syslog.rst:111 +#: ../../library/syslog.rst:132 msgid "Simple example" msgstr "簡單範例" -#: ../../library/syslog.rst:113 +#: ../../library/syslog.rst:134 msgid "A simple set of examples::" msgstr "" "一組簡單範例:\n" "\n" "::" -#: ../../library/syslog.rst:121 +#: ../../library/syslog.rst:142 msgid "" "An example of setting some log options, these would include the process ID " "in logged messages, and write the messages to the destination facility used " diff --git a/library/tarfile.po b/library/tarfile.po index 5adf528288..0324ebeb22 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-29 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,150 +70,159 @@ msgstr "" msgid "Added support for :mod:`lzma` compression." msgstr "" -#: ../../library/tarfile.rst:42 +#: ../../library/tarfile.rst:39 +msgid "" +"Archives are extracted using a :ref:`filter `, " +"which makes it possible to either limit surprising/dangerous features, or to " +"acknowledge that they are expected and the archive is fully trusted. By " +"default, archives are fully trusted, but this default is deprecated and " +"slated to change in Python 3.14." +msgstr "" + +#: ../../library/tarfile.rst:49 msgid "" "Return a :class:`TarFile` object for the pathname *name*. For detailed " "information on :class:`TarFile` objects and the keyword arguments that are " "allowed, see :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:46 +#: ../../library/tarfile.rst:53 msgid "" "*mode* has to be a string of the form ``'filemode[:compression]'``, it " "defaults to ``'r'``. Here is a full list of mode combinations:" msgstr "" -#: ../../library/tarfile.rst:50 +#: ../../library/tarfile.rst:57 msgid "mode" msgstr "" -#: ../../library/tarfile.rst:50 +#: ../../library/tarfile.rst:57 msgid "action" msgstr "" -#: ../../library/tarfile.rst:52 +#: ../../library/tarfile.rst:59 msgid "``'r' or 'r:*'``" msgstr "``'r' 或 'r:*'``" -#: ../../library/tarfile.rst:52 +#: ../../library/tarfile.rst:59 msgid "Open for reading with transparent compression (recommended)." msgstr "" -#: ../../library/tarfile.rst:55 +#: ../../library/tarfile.rst:62 msgid "``'r:'``" msgstr "``'r:'``" -#: ../../library/tarfile.rst:55 +#: ../../library/tarfile.rst:62 msgid "Open for reading exclusively without compression." msgstr "" -#: ../../library/tarfile.rst:58 +#: ../../library/tarfile.rst:65 msgid "``'r:gz'``" msgstr "``'r:gz'``" -#: ../../library/tarfile.rst:58 +#: ../../library/tarfile.rst:65 msgid "Open for reading with gzip compression." msgstr "" -#: ../../library/tarfile.rst:60 +#: ../../library/tarfile.rst:67 msgid "``'r:bz2'``" msgstr "``'r:bz2'``" -#: ../../library/tarfile.rst:60 +#: ../../library/tarfile.rst:67 msgid "Open for reading with bzip2 compression." msgstr "" -#: ../../library/tarfile.rst:62 +#: ../../library/tarfile.rst:69 msgid "``'r:xz'``" msgstr "``'r:xz'``" -#: ../../library/tarfile.rst:62 +#: ../../library/tarfile.rst:69 msgid "Open for reading with lzma compression." msgstr "" -#: ../../library/tarfile.rst:64 +#: ../../library/tarfile.rst:71 msgid "``'x'`` or ``'x:'``" msgstr "``'x'`` 或 ``'x:'``" -#: ../../library/tarfile.rst:64 +#: ../../library/tarfile.rst:71 msgid "" "Create a tarfile exclusively without compression. Raise a :exc:" "`FileExistsError` exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:69 +#: ../../library/tarfile.rst:76 msgid "``'x:gz'``" msgstr "``'x:gz'``" -#: ../../library/tarfile.rst:69 +#: ../../library/tarfile.rst:76 msgid "" "Create a tarfile with gzip compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:73 +#: ../../library/tarfile.rst:80 msgid "``'x:bz2'``" msgstr "``'x:bz2'``" -#: ../../library/tarfile.rst:73 +#: ../../library/tarfile.rst:80 msgid "" "Create a tarfile with bzip2 compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:77 +#: ../../library/tarfile.rst:84 msgid "``'x:xz'``" msgstr "``'x:xz'``" -#: ../../library/tarfile.rst:77 +#: ../../library/tarfile.rst:84 msgid "" "Create a tarfile with lzma compression. Raise a :exc:`FileExistsError` " "exception if it already exists." msgstr "" -#: ../../library/tarfile.rst:81 +#: ../../library/tarfile.rst:88 msgid "``'a' or 'a:'``" msgstr "``'a' 或 'a:'``" -#: ../../library/tarfile.rst:81 +#: ../../library/tarfile.rst:88 msgid "" "Open for appending with no compression. The file is created if it does not " "exist." msgstr "" -#: ../../library/tarfile.rst:84 +#: ../../library/tarfile.rst:91 msgid "``'w' or 'w:'``" msgstr "``'w' 或 'w:'``" -#: ../../library/tarfile.rst:84 +#: ../../library/tarfile.rst:91 msgid "Open for uncompressed writing." msgstr "" -#: ../../library/tarfile.rst:86 +#: ../../library/tarfile.rst:93 msgid "``'w:gz'``" msgstr "``'w:gz'``" -#: ../../library/tarfile.rst:86 +#: ../../library/tarfile.rst:93 msgid "Open for gzip compressed writing." msgstr "" -#: ../../library/tarfile.rst:88 +#: ../../library/tarfile.rst:95 msgid "``'w:bz2'``" msgstr "``'w:bz2'``" -#: ../../library/tarfile.rst:88 +#: ../../library/tarfile.rst:95 msgid "Open for bzip2 compressed writing." msgstr "" -#: ../../library/tarfile.rst:90 +#: ../../library/tarfile.rst:97 msgid "``'w:xz'``" msgstr "``'w:xz'``" -#: ../../library/tarfile.rst:90 +#: ../../library/tarfile.rst:97 msgid "Open for lzma compressed writing." msgstr "" -#: ../../library/tarfile.rst:93 +#: ../../library/tarfile.rst:100 msgid "" "Note that ``'a:gz'``, ``'a:bz2'`` or ``'a:xz'`` is not possible. If *mode* " "is not suitable to open a certain (compressed) file for reading, :exc:" @@ -221,26 +230,26 @@ msgid "" "method is not supported, :exc:`CompressionError` is raised." msgstr "" -#: ../../library/tarfile.rst:98 +#: ../../library/tarfile.rst:105 msgid "" "If *fileobj* is specified, it is used as an alternative to a :term:`file " "object` opened in binary mode for *name*. It is supposed to be at position 0." msgstr "" -#: ../../library/tarfile.rst:101 +#: ../../library/tarfile.rst:108 msgid "" -"For modes ``'w:gz'``, ``'r:gz'``, ``'w:bz2'``, ``'r:bz2'``, ``'x:gz'``, ``'x:" +"For modes ``'w:gz'``, ``'x:gz'``, ``'w|gz'``, ``'w:bz2'``, ``'x:bz2'``, ``'w|" "bz2'``, :func:`tarfile.open` accepts the keyword argument *compresslevel* " "(default ``9``) to specify the compression level of the file." msgstr "" -#: ../../library/tarfile.rst:105 +#: ../../library/tarfile.rst:112 msgid "" "For modes ``'w:xz'`` and ``'x:xz'``, :func:`tarfile.open` accepts the " "keyword argument *preset* to specify the compression level of the file." msgstr "" -#: ../../library/tarfile.rst:108 +#: ../../library/tarfile.rst:115 msgid "" "For special purposes, there is a second format for *mode*: ``'filemode|" "[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` " @@ -254,255 +263,259 @@ msgid "" "possible modes:" msgstr "" -#: ../../library/tarfile.rst:120 +#: ../../library/tarfile.rst:127 msgid "Mode" msgstr "" -#: ../../library/tarfile.rst:120 +#: ../../library/tarfile.rst:127 msgid "Action" msgstr "" -#: ../../library/tarfile.rst:122 +#: ../../library/tarfile.rst:129 msgid "``'r|*'``" msgstr "``'r|*'``" -#: ../../library/tarfile.rst:122 +#: ../../library/tarfile.rst:129 msgid "Open a *stream* of tar blocks for reading with transparent compression." msgstr "" -#: ../../library/tarfile.rst:125 +#: ../../library/tarfile.rst:132 msgid "``'r|'``" msgstr "``'r|'``" -#: ../../library/tarfile.rst:125 +#: ../../library/tarfile.rst:132 msgid "Open a *stream* of uncompressed tar blocks for reading." msgstr "" -#: ../../library/tarfile.rst:128 +#: ../../library/tarfile.rst:135 msgid "``'r|gz'``" msgstr "``'r|gz'``" -#: ../../library/tarfile.rst:128 +#: ../../library/tarfile.rst:135 msgid "Open a gzip compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:131 +#: ../../library/tarfile.rst:138 msgid "``'r|bz2'``" msgstr "``'r|bz2'``" -#: ../../library/tarfile.rst:131 +#: ../../library/tarfile.rst:138 msgid "Open a bzip2 compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:134 +#: ../../library/tarfile.rst:141 msgid "``'r|xz'``" msgstr "``'r|xz'``" -#: ../../library/tarfile.rst:134 +#: ../../library/tarfile.rst:141 msgid "Open an lzma compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:137 +#: ../../library/tarfile.rst:144 msgid "``'w|'``" msgstr "``'w|'``" -#: ../../library/tarfile.rst:137 +#: ../../library/tarfile.rst:144 msgid "Open an uncompressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:139 +#: ../../library/tarfile.rst:146 msgid "``'w|gz'``" msgstr "``'w|gz'``" -#: ../../library/tarfile.rst:139 +#: ../../library/tarfile.rst:146 msgid "Open a gzip compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:142 +#: ../../library/tarfile.rst:149 msgid "``'w|bz2'``" msgstr "``'w|bz2'``" -#: ../../library/tarfile.rst:142 +#: ../../library/tarfile.rst:149 msgid "Open a bzip2 compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:145 +#: ../../library/tarfile.rst:152 msgid "``'w|xz'``" msgstr "``'w|xz'``" -#: ../../library/tarfile.rst:145 +#: ../../library/tarfile.rst:152 msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:149 ../../library/tarfile.rst:365 +#: ../../library/tarfile.rst:156 ../../library/tarfile.rst:375 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/tarfile.rst:152 ../../library/tarfile.rst:368 -#: ../../library/tarfile.rst:605 +#: ../../library/tarfile.rst:159 ../../library/tarfile.rst:378 +#: ../../library/tarfile.rst:613 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:159 +#: ../../library/tarfile.rst:162 +msgid "The *compresslevel* keyword argument also works for streams." +msgstr "" + +#: ../../library/tarfile.rst:169 msgid "" "Class for reading and writing tar archives. Do not use this class directly: " "use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:165 +#: ../../library/tarfile.rst:175 msgid "" "Return :const:`True` if *name* is a tar archive file, that the :mod:" "`tarfile` module can read. *name* may be a :class:`str`, file, or file-like " "object." msgstr "" -#: ../../library/tarfile.rst:168 +#: ../../library/tarfile.rst:178 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/tarfile.rst:172 +#: ../../library/tarfile.rst:182 msgid "The :mod:`tarfile` module defines the following exceptions:" msgstr "" -#: ../../library/tarfile.rst:177 +#: ../../library/tarfile.rst:187 msgid "Base class for all :mod:`tarfile` exceptions." msgstr "" -#: ../../library/tarfile.rst:182 +#: ../../library/tarfile.rst:192 msgid "" "Is raised when a tar archive is opened, that either cannot be handled by " "the :mod:`tarfile` module or is somehow invalid." msgstr "" -#: ../../library/tarfile.rst:188 +#: ../../library/tarfile.rst:198 msgid "" "Is raised when a compression method is not supported or when the data cannot " "be decoded properly." msgstr "" -#: ../../library/tarfile.rst:194 +#: ../../library/tarfile.rst:204 msgid "" "Is raised for the limitations that are typical for stream-like :class:" "`TarFile` objects." msgstr "" -#: ../../library/tarfile.rst:200 +#: ../../library/tarfile.rst:210 msgid "" "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " "only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" -#: ../../library/tarfile.rst:206 +#: ../../library/tarfile.rst:216 msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" -#: ../../library/tarfile.rst:211 +#: ../../library/tarfile.rst:221 msgid "" "Base class for members :ref:`refused ` by filters." msgstr "" -#: ../../library/tarfile.rst:216 +#: ../../library/tarfile.rst:226 msgid "" "Information about the member that the filter refused to extract, as :ref:" "`TarInfo `." msgstr "" -#: ../../library/tarfile.rst:221 +#: ../../library/tarfile.rst:231 msgid "Raised to refuse extracting a member with an absolute path." msgstr "" -#: ../../library/tarfile.rst:225 +#: ../../library/tarfile.rst:235 msgid "Raised to refuse extracting a member outside the destination directory." msgstr "" -#: ../../library/tarfile.rst:229 +#: ../../library/tarfile.rst:239 msgid "Raised to refuse extracting a special file (e.g. a device or pipe)." msgstr "" -#: ../../library/tarfile.rst:233 +#: ../../library/tarfile.rst:243 msgid "Raised to refuse extracting a symbolic link with an absolute path." msgstr "" -#: ../../library/tarfile.rst:237 +#: ../../library/tarfile.rst:247 msgid "" "Raised to refuse extracting a symbolic link pointing outside the destination " "directory." msgstr "" -#: ../../library/tarfile.rst:241 +#: ../../library/tarfile.rst:251 msgid "The following constants are available at the module level:" msgstr "" -#: ../../library/tarfile.rst:245 +#: ../../library/tarfile.rst:255 msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -#: ../../library/tarfile.rst:249 +#: ../../library/tarfile.rst:259 msgid "" "Each of the following constants defines a tar archive format that the :mod:" "`tarfile` module is able to create. See section :ref:`tar-formats` for " "details." msgstr "" -#: ../../library/tarfile.rst:256 +#: ../../library/tarfile.rst:266 msgid "POSIX.1-1988 (ustar) format." msgstr "" -#: ../../library/tarfile.rst:261 +#: ../../library/tarfile.rst:271 msgid "GNU tar format." msgstr "" -#: ../../library/tarfile.rst:266 +#: ../../library/tarfile.rst:276 msgid "POSIX.1-2001 (pax) format." msgstr "" -#: ../../library/tarfile.rst:271 +#: ../../library/tarfile.rst:281 msgid "" "The default format for creating archives. This is currently :const:" "`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:273 +#: ../../library/tarfile.rst:283 msgid "" "The default format for new archives was changed to :const:`PAX_FORMAT` from :" "const:`GNU_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:281 +#: ../../library/tarfile.rst:291 msgid "Module :mod:`zipfile`" msgstr ":mod:`zipfile` 模組" -#: ../../library/tarfile.rst:281 +#: ../../library/tarfile.rst:291 msgid "Documentation of the :mod:`zipfile` standard module." msgstr "" -#: ../../library/tarfile.rst:285 +#: ../../library/tarfile.rst:295 msgid ":ref:`archiving-operations`" msgstr ":ref:`archiving-operations`" -#: ../../library/tarfile.rst:284 +#: ../../library/tarfile.rst:294 msgid "" "Documentation of the higher-level archiving facilities provided by the " "standard :mod:`shutil` module." msgstr "" -#: ../../library/tarfile.rst:287 +#: ../../library/tarfile.rst:297 msgid "" "`GNU tar manual, Basic Tar Format `_" msgstr "" -#: ../../library/tarfile.rst:288 +#: ../../library/tarfile.rst:298 msgid "Documentation for tar archive files, including GNU tar extensions." msgstr "" -#: ../../library/tarfile.rst:294 +#: ../../library/tarfile.rst:304 msgid "TarFile Objects" msgstr "TarFile 物件" -#: ../../library/tarfile.rst:296 +#: ../../library/tarfile.rst:306 msgid "" "The :class:`TarFile` object provides an interface to a tar archive. A tar " "archive is a sequence of blocks. An archive member (a stored file) is made " @@ -511,7 +524,7 @@ msgid "" "class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -#: ../../library/tarfile.rst:302 +#: ../../library/tarfile.rst:312 msgid "" "A :class:`TarFile` object can be used as a context manager in a :keyword:" "`with` statement. It will automatically be closed when the block is " @@ -520,24 +533,24 @@ msgid "" "be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -#: ../../library/tarfile.rst:308 +#: ../../library/tarfile.rst:318 msgid "Added support for the context management protocol." msgstr "" -#: ../../library/tarfile.rst:313 +#: ../../library/tarfile.rst:323 msgid "" "All following arguments are optional and can be accessed as instance " "attributes as well." msgstr "" -#: ../../library/tarfile.rst:316 +#: ../../library/tarfile.rst:326 msgid "" "*name* is the pathname of the archive. *name* may be a :term:`path-like " "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`name` attribute is used if it exists." msgstr "" -#: ../../library/tarfile.rst:320 +#: ../../library/tarfile.rst:330 msgid "" "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append " "data to an existing file, ``'w'`` to create a new file overwriting an " @@ -545,18 +558,18 @@ msgid "" "exist." msgstr "" -#: ../../library/tarfile.rst:324 +#: ../../library/tarfile.rst:334 msgid "" "If *fileobj* is given, it is used for reading or writing data. If it can be " "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -#: ../../library/tarfile.rst:330 +#: ../../library/tarfile.rst:340 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." msgstr "" -#: ../../library/tarfile.rst:332 +#: ../../library/tarfile.rst:342 msgid "" "*format* controls the archive format for writing. It must be one of the " "constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " @@ -564,20 +577,20 @@ msgid "" "detected, even if different formats are present in a single archive." msgstr "" -#: ../../library/tarfile.rst:337 +#: ../../library/tarfile.rst:347 msgid "" "The *tarinfo* argument can be used to replace the default :class:`TarInfo` " "class with a different one." msgstr "" -#: ../../library/tarfile.rst:340 +#: ../../library/tarfile.rst:350 msgid "" "If *dereference* is :const:`False`, add symbolic and hard links to the " "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -#: ../../library/tarfile.rst:344 +#: ../../library/tarfile.rst:354 msgid "" "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " "archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " @@ -585,19 +598,19 @@ msgid "" "concatenated or damaged archives." msgstr "" -#: ../../library/tarfile.rst:348 +#: ../../library/tarfile.rst:358 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." msgstr "" -#: ../../library/tarfile.rst:351 +#: ../../library/tarfile.rst:361 msgid "" "*errorlevel* controls how extraction errors are handled, see :attr:`the " "corresponding attribute <~TarFile.errorlevel>`." msgstr "" -#: ../../library/tarfile.rst:354 +#: ../../library/tarfile.rst:364 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " @@ -605,47 +618,47 @@ msgid "" "ref:`tar-unicode` for in-depth information." msgstr "" -#: ../../library/tarfile.rst:359 +#: ../../library/tarfile.rst:369 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:362 ../../library/tarfile.rst:678 +#: ../../library/tarfile.rst:372 ../../library/tarfile.rst:681 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" -#: ../../library/tarfile.rst:374 +#: ../../library/tarfile.rst:384 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: ../../library/tarfile.rst:380 +#: ../../library/tarfile.rst:390 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:385 +#: ../../library/tarfile.rst:395 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: ../../library/tarfile.rst:391 +#: ../../library/tarfile.rst:401 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: ../../library/tarfile.rst:397 +#: ../../library/tarfile.rst:407 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:403 +#: ../../library/tarfile.rst:413 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -653,18 +666,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:408 +#: ../../library/tarfile.rst:418 msgid "Added the *members* parameter." msgstr "新增 *members* 參數。" -#: ../../library/tarfile.rst:414 +#: ../../library/tarfile.rst:424 msgid "" "Return the next member of the archive as a :class:`TarInfo` object, when :" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -#: ../../library/tarfile.rst:421 +#: ../../library/tarfile.rst:431 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -676,22 +689,22 @@ msgid "" "fail." msgstr "" -#: ../../library/tarfile.rst:429 +#: ../../library/tarfile.rst:439 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: ../../library/tarfile.rst:433 +#: ../../library/tarfile.rst:443 msgid "" -"The *filter* argument, which was added in Python 3.11.4, specifies how " -"``members`` are modified or rejected before extraction. See :ref:`tarfile-" -"extraction-filter` for details. It is recommended to set this explicitly " -"depending on which *tar* features you need to support." +"The *filter* argument specifies how ``members`` are modified or rejected " +"before extraction. See :ref:`tarfile-extraction-filter` for details. It is " +"recommended to set this explicitly depending on which *tar* features you " +"need to support." msgstr "" -#: ../../library/tarfile.rst:441 +#: ../../library/tarfile.rst:451 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -699,26 +712,26 @@ msgid "" "\"``." msgstr "" -#: ../../library/tarfile.rst:446 ../../library/tarfile.rst:479 +#: ../../library/tarfile.rst:456 ../../library/tarfile.rst:489 msgid "" "Set ``filter='data'`` to prevent the most dangerous security issues, and " "read the :ref:`tarfile-extraction-filter` section for details." msgstr "" -#: ../../library/tarfile.rst:449 ../../library/tarfile.rst:485 +#: ../../library/tarfile.rst:459 ../../library/tarfile.rst:495 msgid "Added the *numeric_owner* parameter." msgstr "新增 *numeric_owner* 參數。" -#: ../../library/tarfile.rst:452 ../../library/tarfile.rst:488 +#: ../../library/tarfile.rst:462 ../../library/tarfile.rst:498 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:455 ../../library/tarfile.rst:491 -#: ../../library/tarfile.rst:571 +#: ../../library/tarfile.rst:465 ../../library/tarfile.rst:501 +#: ../../library/tarfile.rst:579 msgid "Added the *filter* parameter." msgstr "新增 *filter* 參數。" -#: ../../library/tarfile.rst:461 +#: ../../library/tarfile.rst:471 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -727,27 +740,27 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: ../../library/tarfile.rst:467 +#: ../../library/tarfile.rst:477 msgid "" "The *numeric_owner* and *filter* arguments are the same as for :meth:" "`extractall`." msgstr "" -#: ../../library/tarfile.rst:472 +#: ../../library/tarfile.rst:482 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: ../../library/tarfile.rst:477 +#: ../../library/tarfile.rst:487 msgid "See the warning for :meth:`extractall`." msgstr "參閱 :meth:`extractall` 的警告。" -#: ../../library/tarfile.rst:482 +#: ../../library/tarfile.rst:492 msgid "Added the *set_attrs* parameter." msgstr "增加 *set_attrs* 參數。" -#: ../../library/tarfile.rst:497 +#: ../../library/tarfile.rst:507 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " @@ -756,11 +769,11 @@ msgid "" "the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:503 +#: ../../library/tarfile.rst:513 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: ../../library/tarfile.rst:509 +#: ../../library/tarfile.rst:519 msgid "" "If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile." "extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error " @@ -770,59 +783,53 @@ msgid "" "exc:`TarError` exceptions as well." msgstr "" -#: ../../library/tarfile.rst:517 +#: ../../library/tarfile.rst:527 msgid "" "Some exceptions, e.g. ones caused by wrong argument types or data " "corruption, are always raised." msgstr "" -#: ../../library/tarfile.rst:520 +#: ../../library/tarfile.rst:530 msgid "" "Custom :ref:`extraction filters ` should raise :" "exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " "ones." msgstr "" -#: ../../library/tarfile.rst:524 +#: ../../library/tarfile.rst:534 msgid "" "Note that when an exception is raised, the archive may be partially " "extracted. It is the user’s responsibility to clean up." msgstr "" -#: ../../library/tarfile.rst:531 +#: ../../library/tarfile.rst:541 msgid "" "The :ref:`extraction filter ` used as a default " "for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`." msgstr "" -#: ../../library/tarfile.rst:535 +#: ../../library/tarfile.rst:545 msgid "" "The attribute may be ``None`` or a callable. String names are not allowed " "for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." msgstr "" -#: ../../library/tarfile.rst:539 +#: ../../library/tarfile.rst:549 msgid "" "If ``extraction_filter`` is ``None`` (the default), calling an extraction " -"method without a *filter* argument will use the :func:`fully_trusted " -"` filter for compatibility with previous Python " -"versions." +"method without a *filter* argument will raise a ``DeprecationWarning``, and " +"fall back to the :func:`fully_trusted ` filter, whose " +"dangerous behavior matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:544 -msgid "" -"In Python 3.12+, leaving ``extraction_filter=None`` will emit a " -"``DeprecationWarning``." -msgstr "" - -#: ../../library/tarfile.rst:547 +#: ../../library/tarfile.rst:555 msgid "" "In Python 3.14+, leaving ``extraction_filter=None`` will cause extraction " "methods to use the :func:`data ` filter by default." msgstr "" -#: ../../library/tarfile.rst:550 +#: ../../library/tarfile.rst:558 msgid "" "The attribute may be set on instances or overridden in subclasses. It also " "is possible to set it on the ``TarFile`` class itself to set a global " @@ -833,7 +840,7 @@ msgid "" "argument." msgstr "" -#: ../../library/tarfile.rst:560 +#: ../../library/tarfile.rst:568 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " @@ -846,11 +853,11 @@ msgid "" "ref:`tar-examples` for an example." msgstr "" -#: ../../library/tarfile.rst:574 +#: ../../library/tarfile.rst:582 msgid "Recursion adds entries in sorted order." msgstr "" -#: ../../library/tarfile.rst:580 +#: ../../library/tarfile.rst:588 msgid "" "Add the :class:`TarInfo` object *tarinfo* to the archive. If *fileobj* is " "given, it should be a :term:`binary file`, and ``tarinfo.size`` bytes are " @@ -858,7 +865,7 @@ msgid "" "objects directly, or by using :meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:588 +#: ../../library/tarfile.rst:596 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -869,7 +876,7 @@ msgid "" "The name should be a text string." msgstr "" -#: ../../library/tarfile.rst:597 +#: ../../library/tarfile.rst:605 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " @@ -879,21 +886,21 @@ msgid "" "case *arcname* could be a dummy string." msgstr "" -#: ../../library/tarfile.rst:611 +#: ../../library/tarfile.rst:619 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: ../../library/tarfile.rst:617 +#: ../../library/tarfile.rst:625 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: ../../library/tarfile.rst:624 +#: ../../library/tarfile.rst:632 msgid "TarInfo Objects" msgstr "TarInfo 物件" -#: ../../library/tarfile.rst:626 +#: ../../library/tarfile.rst:634 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -901,14 +908,14 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: ../../library/tarfile.rst:631 +#: ../../library/tarfile.rst:639 msgid "" ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" "`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." "gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:635 +#: ../../library/tarfile.rst:643 msgid "" "Modifying the objects returned by :meth:`~!TarFile.getmember` or :meth:`~!" "TarFile.getmembers` will affect all subsequent operations on the archive. " @@ -917,86 +924,82 @@ msgid "" "step." msgstr "" -#: ../../library/tarfile.rst:641 +#: ../../library/tarfile.rst:649 msgid "" "Several attributes can be set to ``None`` to indicate that a piece of " "metadata is unused or unknown. Different :class:`TarInfo` methods handle " "``None`` differently:" msgstr "" -#: ../../library/tarfile.rst:645 +#: ../../library/tarfile.rst:653 msgid "" "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " "ignore the corresponding metadata, leaving it set to a default." msgstr "" -#: ../../library/tarfile.rst:647 +#: ../../library/tarfile.rst:655 msgid ":meth:`~TarFile.addfile` will fail." msgstr "" -#: ../../library/tarfile.rst:648 +#: ../../library/tarfile.rst:656 msgid ":meth:`~TarFile.list` will print a placeholder string." msgstr "" -#: ../../library/tarfile.rst:651 -msgid "Added :meth:`~TarInfo.replace` and handling of ``None``." -msgstr "" - -#: ../../library/tarfile.rst:657 +#: ../../library/tarfile.rst:660 msgid "Create a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:662 +#: ../../library/tarfile.rst:665 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: ../../library/tarfile.rst:664 +#: ../../library/tarfile.rst:667 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: ../../library/tarfile.rst:669 +#: ../../library/tarfile.rst:672 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:675 +#: ../../library/tarfile.rst:678 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:682 +#: ../../library/tarfile.rst:685 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "" -#: ../../library/tarfile.rst:688 +#: ../../library/tarfile.rst:691 msgid "Name of the archive member." msgstr "" -#: ../../library/tarfile.rst:694 +#: ../../library/tarfile.rst:697 msgid "Size in bytes." msgstr "" -#: ../../library/tarfile.rst:700 +#: ../../library/tarfile.rst:703 msgid "" "Time of last modification in seconds since the :ref:`epoch `, as in :" "attr:`os.stat_result.st_mtime`." msgstr "" -#: ../../library/tarfile.rst:705 ../../library/tarfile.rst:716 -#: ../../library/tarfile.rst:743 ../../library/tarfile.rst:754 -#: ../../library/tarfile.rst:765 ../../library/tarfile.rst:776 +#: ../../library/tarfile.rst:708 ../../library/tarfile.rst:719 +#: ../../library/tarfile.rst:746 ../../library/tarfile.rst:757 +#: ../../library/tarfile.rst:768 ../../library/tarfile.rst:779 msgid "" "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`, causing extraction to skip applying this attribute." msgstr "" -#: ../../library/tarfile.rst:712 +#: ../../library/tarfile.rst:715 msgid "Permission bits, as for :func:`os.chmod`." msgstr "" -#: ../../library/tarfile.rst:722 +#: ../../library/tarfile.rst:725 msgid "" "File type. *type* is usually one of these constants: :const:`REGTYPE`, :" "const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" @@ -1005,93 +1008,93 @@ msgid "" "more conveniently, use the ``is*()`` methods below." msgstr "" -#: ../../library/tarfile.rst:732 +#: ../../library/tarfile.rst:735 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:739 +#: ../../library/tarfile.rst:742 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:750 +#: ../../library/tarfile.rst:753 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:761 +#: ../../library/tarfile.rst:764 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:772 +#: ../../library/tarfile.rst:775 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:783 +#: ../../library/tarfile.rst:786 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:791 +#: ../../library/tarfile.rst:794 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:797 +#: ../../library/tarfile.rst:800 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:801 +#: ../../library/tarfile.rst:804 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:806 +#: ../../library/tarfile.rst:809 msgid "Return :const:`True` if the :class:`Tarinfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:811 +#: ../../library/tarfile.rst:814 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:816 +#: ../../library/tarfile.rst:819 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:821 +#: ../../library/tarfile.rst:824 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:826 +#: ../../library/tarfile.rst:829 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:831 +#: ../../library/tarfile.rst:834 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:836 +#: ../../library/tarfile.rst:839 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:841 +#: ../../library/tarfile.rst:844 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:846 +#: ../../library/tarfile.rst:849 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:852 +#: ../../library/tarfile.rst:855 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:856 +#: ../../library/tarfile.rst:859 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1101,69 +1104,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:864 +#: ../../library/tarfile.rst:867 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:870 +#: ../../library/tarfile.rst:873 msgid ":pep:`706`" msgstr "" -#: ../../library/tarfile.rst:871 +#: ../../library/tarfile.rst:874 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:873 +#: ../../library/tarfile.rst:876 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:879 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:881 +#: ../../library/tarfile.rst:884 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:885 +#: ../../library/tarfile.rst:888 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:889 +#: ../../library/tarfile.rst:892 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:891 -msgid "" -"If that is also ``None`` (the default), the ``'fully_trusted'`` filter will " -"be used (for compatibility with earlier versions of Python)." -msgstr "" - #: ../../library/tarfile.rst:894 -msgid "In Python 3.12, the default will emit a ``DeprecationWarning``." +msgid "" +"If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " +"fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " +"matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:896 +#: ../../library/tarfile.rst:898 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:899 +#: ../../library/tarfile.rst:901 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1171,23 +1171,23 @@ msgid "" "members)::" msgstr "" -#: ../../library/tarfile.rst:906 +#: ../../library/tarfile.rst:908 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:910 +#: ../../library/tarfile.rst:912 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:912 +#: ../../library/tarfile.rst:914 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:913 +#: ../../library/tarfile.rst:915 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1195,118 +1195,118 @@ msgid "" "attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:919 +#: ../../library/tarfile.rst:921 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:921 +#: ../../library/tarfile.rst:923 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:926 +#: ../../library/tarfile.rst:928 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:928 +#: ../../library/tarfile.rst:930 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:932 +#: ../../library/tarfile.rst:934 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:934 +#: ../../library/tarfile.rst:936 msgid "Strip leading slashes (``/`` and :attr:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:935 +#: ../../library/tarfile.rst:937 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:939 +#: ../../library/tarfile.rst:941 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:942 +#: ../../library/tarfile.rst:944 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "attr:`~stat.S_IWGRP`|:attr:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:945 ../../library/tarfile.rst:978 +#: ../../library/tarfile.rst:947 ../../library/tarfile.rst:980 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:949 +#: ../../library/tarfile.rst:951 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:952 +#: ../../library/tarfile.rst:954 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:955 +#: ../../library/tarfile.rst:957 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:958 +#: ../../library/tarfile.rst:960 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:961 +#: ../../library/tarfile.rst:963 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:965 +#: ../../library/tarfile.rst:967 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:967 +#: ../../library/tarfile.rst:969 msgid "" "Set the owner read and write permissions (:attr:`~stat.S_IRUSR`|:attr:`~stat." "S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:969 +#: ../../library/tarfile.rst:971 msgid "" "Remove the group & other executable permission (:attr:`~stat.S_IXGRP`|:attr:" "`~stat.S_IXOTH`) if the owner doesn’t have it (:attr:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:973 +#: ../../library/tarfile.rst:975 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:975 +#: ../../library/tarfile.rst:977 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:984 +#: ../../library/tarfile.rst:986 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:988 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1315,11 +1315,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:994 +#: ../../library/tarfile.rst:996 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:996 +#: ../../library/tarfile.rst:998 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1327,182 +1327,182 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1001 +#: ../../library/tarfile.rst:1003 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1003 +#: ../../library/tarfile.rst:1005 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: ../../library/tarfile.rst:1006 +#: ../../library/tarfile.rst:1008 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1008 +#: ../../library/tarfile.rst:1010 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: ../../library/tarfile.rst:1011 +#: ../../library/tarfile.rst:1013 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1013 +#: ../../library/tarfile.rst:1015 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1015 +#: ../../library/tarfile.rst:1017 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1017 +#: ../../library/tarfile.rst:1019 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1019 +#: ../../library/tarfile.rst:1021 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1023 +#: ../../library/tarfile.rst:1025 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1029 +#: ../../library/tarfile.rst:1031 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1031 +#: ../../library/tarfile.rst:1033 msgid "" -"Extraction filters were added to Python 3.12, and are backported to older " +"Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " "e.g. ``hasattr(tarfile, 'data_filter')`` rather than checking the Python " "version." msgstr "" -#: ../../library/tarfile.rst:1036 +#: ../../library/tarfile.rst:1038 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1040 +#: ../../library/tarfile.rst:1042 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1045 +#: ../../library/tarfile.rst:1047 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1052 +#: ../../library/tarfile.rst:1054 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1056 +#: ../../library/tarfile.rst:1058 msgid "or::" msgstr "" -#: ../../library/tarfile.rst:1061 +#: ../../library/tarfile.rst:1063 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1072 +#: ../../library/tarfile.rst:1074 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1074 +#: ../../library/tarfile.rst:1076 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1081 +#: ../../library/tarfile.rst:1083 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1103 +#: ../../library/tarfile.rst:1105 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:1107 +#: ../../library/tarfile.rst:1109 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1110 +#: ../../library/tarfile.rst:1112 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1117 +#: ../../library/tarfile.rst:1119 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1123 +#: ../../library/tarfile.rst:1125 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1130 +#: ../../library/tarfile.rst:1132 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1137 +#: ../../library/tarfile.rst:1139 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1145 +#: ../../library/tarfile.rst:1147 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:1150 +#: ../../library/tarfile.rst:1152 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1155 +#: ../../library/tarfile.rst:1157 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1160 +#: ../../library/tarfile.rst:1162 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1165 +#: ../../library/tarfile.rst:1167 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1169 +#: ../../library/tarfile.rst:1171 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1173 +#: ../../library/tarfile.rst:1175 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " diff --git a/library/tempfile.po b/library/tempfile.po index 7d01439f63..9c597c23a3 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,8 +134,8 @@ msgid "" msgstr "" "在不是 Posix 或 Cygwin 的平臺上,TemporaryFile 是 NamedTemporaryFile 的別名。" -#: ../../library/tempfile.rst:68 ../../library/tempfile.rst:96 -#: ../../library/tempfile.rst:205 +#: ../../library/tempfile.rst:68 ../../library/tempfile.rst:137 +#: ../../library/tempfile.rst:258 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." @@ -147,39 +147,118 @@ msgstr "" msgid "The :py:data:`os.O_TMPFILE` flag is now used if available." msgstr "如果可用,自此開始使用 :py:data:`os.O_TMPFILE` 旗標。" -#: ../../library/tempfile.rst:74 ../../library/tempfile.rst:98 -#: ../../library/tempfile.rst:123 +#: ../../library/tempfile.rst:74 ../../library/tempfile.rst:139 +#: ../../library/tempfile.rst:167 msgid "Added *errors* parameter." msgstr "新增 *errors* 參數。" #: ../../library/tempfile.rst:80 msgid "" -"This function operates exactly as :func:`TemporaryFile` does, except that " -"the file is guaranteed to have a visible name in the file system (on Unix, " -"the directory entry is not unlinked). That name can be retrieved from the :" -"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). 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." +"This function operates exactly as :func:`TemporaryFile` does, except the " +"following differences:" +msgstr "" + +#: ../../library/tempfile.rst:83 +msgid "" +"This function returns a file that is guaranteed to have a visible name in " +"the file system." +msgstr "" + +#: ../../library/tempfile.rst:85 +msgid "" +"To manage the named file, it extends the parameters of :func:`TemporaryFile` " +"with *delete* and *delete_on_close* parameters that determine whether and " +"how the named file should be automatically deleted." +msgstr "" + +#: ../../library/tempfile.rst:89 +msgid "" +"The returned object is always a :term:`file-like object` whose :attr:`!file` " +"attribute is the underlying true file object. This :term:`file-like object` " +"can be used in a :keyword:`with` statement, just like a normal file. The " +"name of the temporary file can be retrieved from the :attr:`name` attribute " +"of the returned file-like object. On Unix, unlike with the :func:" +"`TemporaryFile`, the directory entry does not get unlinked immediately after " +"the file creation." +msgstr "" + +#: ../../library/tempfile.rst:97 +msgid "" +"If *delete* is true (the default) and *delete_on_close* is true (the " +"default), the file is deleted as soon as it is closed. If *delete* is true " +"and *delete_on_close* is false, the file is deleted on context manager exit " +"only, or else when the :term:`file-like object` is finalized. Deletion is " +"not always guaranteed in this case (see :meth:`object.__del__`). If *delete* " +"is false, the value of *delete_on_close* is ignored." +msgstr "" + +#: ../../library/tempfile.rst:104 +msgid "" +"Therefore to use the name of the temporary file to reopen the file after " +"closing it, either make sure not to delete the file upon closure (set the " +"*delete* parameter to be false) or, in case the temporary file is created in " +"a :keyword:`with` statement, set the *delete_on_close* parameter to be " +"false. The latter approach is recommended as it provides assistance in " +"automatic cleaning of the temporary file upon the context manager exit." msgstr "" -"此函式執行的操作與 :func:`TemporaryFile` 幾乎相同,不同之處為確保該臨時檔案在" -"檔案系統中具有可見的名稱(在 Unix 上目錄條目不會被 unlink)。檔名可以由回傳 " -"file-like object 的 :attr:`name` 屬性取得。在臨時檔案仍開啟時,是否允許用檔名" -"第二次開啟檔案,在各個平臺上是不同的(在 Unix 上可以;在 Windows NT 版本以上" -"不行)。如果 *delete* 為 true(預設值),則檔案會在關閉後立即被刪除。該函式回" -"傳的物件始終是 file-like object,它的 :attr:`!file` 屬性是底層的真實檔案物" -"件。file-like object 可以像普通檔案一樣在 :keyword:`with` 陳述句中使用。" -#: ../../library/tempfile.rst:93 +#: ../../library/tempfile.rst:111 +msgid "" +"Opening the temporary file again by its name while it is still open works as " +"follows:" +msgstr "" + +#: ../../library/tempfile.rst:114 +msgid "On POSIX the file can always be opened again." +msgstr "" + +#: ../../library/tempfile.rst:115 +msgid "" +"On Windows, make sure that at least one of the following conditions are " +"fulfilled:" +msgstr "" + +#: ../../library/tempfile.rst:118 +msgid "*delete* is false" +msgstr "" + +#: ../../library/tempfile.rst:119 +msgid "" +"additional open shares delete access (e.g. by calling :func:`os.open` with " +"the flag ``O_TEMPORARY``)" +msgstr "" + +#: ../../library/tempfile.rst:121 +msgid "" +"*delete* is true but *delete_on_close* is false. Note, that in this case the " +"additional opens that do not share delete access (e.g. created via builtin :" +"func:`open`) must be closed before exiting the context manager, else the :" +"func:`os.unlink` call on context manager exit will fail with a :exc:" +"`PermissionError`." +msgstr "" + +#: ../../library/tempfile.rst:127 +msgid "" +"On Windows, if *delete_on_close* is false, and the file is created in a " +"directory for which the user lacks delete access, then the :func:`os.unlink` " +"call on exit of the context manager will fail with a :exc:`PermissionError`. " +"This cannot happen when *delete_on_close* is true because delete access is " +"requested by the open, which fails immediately if the requested access is " +"not granted." +msgstr "" + +#: ../../library/tempfile.rst:134 msgid "" "On POSIX (only), a process that is terminated abruptly with SIGKILL cannot " "automatically delete any NamedTemporaryFiles it created." msgstr "" -#: ../../library/tempfile.rst:104 +#: ../../library/tempfile.rst:142 +#, fuzzy +msgid "Added *delete_on_close* parameter." +msgstr "新增 *errors* 參數。" + +#: ../../library/tempfile.rst:148 msgid "" "This class operates exactly as :func:`TemporaryFile` does, except that data " "is spooled in memory until the file size exceeds *max_size*, or until the " @@ -190,7 +269,7 @@ msgstr "" "在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`fileno` 方法被呼叫為" "止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` 相同。" -#: ../../library/tempfile.rst:110 +#: ../../library/tempfile.rst:154 msgid "" "The resulting file has one additional method, :func:`rollover`, which causes " "the file to roll over to an on-disk file regardless of its size." @@ -198,7 +277,7 @@ msgstr "" "生成的檔案物件有一個額外的方法 :func:`rollover`,忽略檔案大小並立即將其寫入磁" "碟。" -#: ../../library/tempfile.rst:113 +#: ../../library/tempfile.rst:157 msgid "" "The returned object is a file-like object whose :attr:`_file` attribute is " "either an :class:`io.BytesIO` or :class:`io.TextIOWrapper` object (depending " @@ -211,18 +290,18 @@ msgstr "" "真實的檔案物件(取決於是否已呼叫 :func:`rollover`)。file-like object 可以像" "普通檔案一樣在 :keyword:`with` 陳述式中使用。" -#: ../../library/tempfile.rst:120 +#: ../../library/tempfile.rst:164 msgid "the truncate method now accepts a ``size`` argument." msgstr "現在,檔案的截斷方法 (truncate method) 可接受一個 ``size`` 引數。" -#: ../../library/tempfile.rst:126 +#: ../../library/tempfile.rst:170 msgid "" "Fully implements the :class:`io.BufferedIOBase` and :class:`io.TextIOBase` " "abstract base classes (depending on whether binary or text *mode* was " "specified)." msgstr "" -#: ../../library/tempfile.rst:134 +#: ../../library/tempfile.rst:178 msgid "" "This class securely creates a temporary directory using the same rules as :" "func:`mkdtemp`. The resulting object can be used as a context manager (see :" @@ -234,7 +313,7 @@ msgstr "" "情境管理器使用(參見\\ :ref:`tempfile-examples`)。在完成情境或銷毀臨時目錄物" "件時,新建立的臨時目錄及其所有內容會從檔案系統中被移除。" -#: ../../library/tempfile.rst:140 +#: ../../library/tempfile.rst:184 msgid "" "The directory name can be retrieved from the :attr:`name` attribute of the " "returned object. When the returned object is used as a context manager, " @@ -245,7 +324,7 @@ msgstr "" "管理器時,這個 :attr:`name` 會作為 :keyword:`with` 陳述句中 :keyword:`!as` 子" "句的目標(如果有 as 的話)。" -#: ../../library/tempfile.rst:145 +#: ../../library/tempfile.rst:189 msgid "" "The directory can be explicitly cleaned up by calling the :func:`cleanup` " "method. If *ignore_cleanup_errors* is true, any unhandled exceptions during " @@ -263,7 +342,16 @@ msgstr "" "被引發(:func:`cleanup` 呼叫、退出情境管理器、物件被作為垃圾回收或直譯器關閉" "等)。" -#: ../../library/tempfile.rst:154 ../../library/tempfile.rst:234 +#: ../../library/tempfile.rst:198 +msgid "" +"The *delete* parameter can be used to disable cleanup of the directory tree " +"upon exiting the context. While it may seem unusual for a context manager " +"to disable the action taken when exiting the context, it can be useful " +"during debugging or when you need your cleanup behavior to be conditional " +"based on other logic." +msgstr "" + +#: ../../library/tempfile.rst:204 ../../library/tempfile.rst:284 msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." @@ -271,11 +359,16 @@ msgstr "" "引發一個附帶引數 ``fullpath`` 的 ``tempfile.mkdtemp`` :ref:`稽核事件 " "`。" -#: ../../library/tempfile.rst:158 +#: ../../library/tempfile.rst:208 msgid "Added *ignore_cleanup_errors* parameter." msgstr "新增 *ignore_cleanup_errors* 參數。" -#: ../../library/tempfile.rst:164 +#: ../../library/tempfile.rst:211 +#, fuzzy +msgid "Added the *delete* parameter." +msgstr "新增 *errors* 參數。" + +#: ../../library/tempfile.rst:217 msgid "" "Creates a temporary file in the most secure manner possible. There are no " "race conditions in the file's creation, assuming that the platform properly " @@ -290,7 +383,7 @@ msgstr "" "況。該檔案只能由建立者讀寫,如果所在平臺用 permission bit(許可權位元)來表示" "檔案是否可執行,則沒有人有執行權。檔案描述器不會被子行程繼承。" -#: ../../library/tempfile.rst:172 +#: ../../library/tempfile.rst:225 msgid "" "Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for " "deleting the temporary file when done with it." @@ -298,7 +391,7 @@ msgstr "" "與 :func:`TemporaryFile` 不同,:func:`mkstemp` 使用者用完臨時檔案後需要自行將" "其刪除。" -#: ../../library/tempfile.rst:175 +#: ../../library/tempfile.rst:228 msgid "" "If *suffix* is not ``None``, the file name will end with that suffix, " "otherwise there will be no suffix. :func:`mkstemp` does not put a dot " @@ -309,7 +402,7 @@ msgstr "" "func:`mkstemp` 不會在檔名和後綴之間加點 (dot),如果需要加一個點號,請將其放" "在 *suffix* 的開頭。" -#: ../../library/tempfile.rst:180 +#: ../../library/tempfile.rst:233 msgid "" "If *prefix* is not ``None``, the file name will begin with that prefix; " "otherwise, a default prefix is used. The default is the return value of :" @@ -319,7 +412,7 @@ msgstr "" "綴。預設前綴是 :func:`gettempprefix` 或 :func:`gettempprefixb` 函式的回傳值" "(自動呼叫合適的函式)。" -#: ../../library/tempfile.rst:184 +#: ../../library/tempfile.rst:237 msgid "" "If *dir* is not ``None``, the file will be created in that directory; " "otherwise, a default directory is used. The default directory is chosen " @@ -335,7 +428,7 @@ msgstr "" "檔案路徑是使用者友善的,比如透過 ``os.popen()`` 將路徑傳遞給外部命令時仍需要" "加引號 (quoting)。" -#: ../../library/tempfile.rst:192 +#: ../../library/tempfile.rst:245 msgid "" "If any of *suffix*, *prefix*, and *dir* are not ``None``, they must be the " "same type. If they are bytes, the returned name will be bytes instead of " @@ -346,7 +439,7 @@ msgstr "" "型別相同。如果它們是位元組串,則回傳名稱的型別就是位元組串而非字串。如果不想" "遵循預設行為但又想要回傳值是位元組串型別,請傳入 ``suffix=b''``。" -#: ../../library/tempfile.rst:198 +#: ../../library/tempfile.rst:251 msgid "" "If *text* is specified and true, the file is opened in text mode. Otherwise, " "(the default) the file is opened in binary mode." @@ -354,7 +447,7 @@ msgstr "" "如果指定了 *text* 且為真值,檔案會以文字模式開啟。否則,檔案(預設)以二進位" "制模式開啟。" -#: ../../library/tempfile.rst:201 +#: ../../library/tempfile.rst:254 msgid "" ":func:`mkstemp` returns a tuple containing an OS-level handle to an open " "file (as would be returned by :func:`os.open`) and the absolute pathname of " @@ -364,7 +457,7 @@ msgstr "" "level) 控制代碼,指向一個開啟的檔案(如同 :func:`os.open` 的回傳值),第二元" "素是該檔案的絕對路徑。" -#: ../../library/tempfile.rst:207 ../../library/tempfile.rst:236 +#: ../../library/tempfile.rst:260 ../../library/tempfile.rst:286 msgid "" "*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to " "obtain a bytes return value. Prior to this, only str was allowed. *suffix* " @@ -375,11 +468,11 @@ msgstr "" "串型別的回傳值。在之前只允許使用字串。*suffix* 和 *prefix* 現在可以接受 " "``None``,並且預設為 ``None`` 以使用合適的預設值。" -#: ../../library/tempfile.rst:213 ../../library/tempfile.rst:242 +#: ../../library/tempfile.rst:266 ../../library/tempfile.rst:292 msgid "The *dir* parameter now accepts a :term:`path-like object`." msgstr "*dir* 參數現在可接受一個類路徑物件 (:term:`path-like object`)。" -#: ../../library/tempfile.rst:219 +#: ../../library/tempfile.rst:272 msgid "" "Creates a temporary directory in the most secure manner possible. There are " "no race conditions in the directory's creation. The directory is readable, " @@ -388,58 +481,60 @@ msgstr "" "盡可能以最安全的方式建立一個臨時目錄,建立該目錄時不會有 race condition 的情" "況,該目錄只能由建立者讀取、寫入和搜尋。" -#: ../../library/tempfile.rst:223 +#: ../../library/tempfile.rst:276 msgid "" "The user of :func:`mkdtemp` is responsible for deleting the temporary " "directory and its contents when done with it." msgstr ":func:`mkdtemp` 的使用者用完臨時目錄後需要自行將其刪除。" -#: ../../library/tempfile.rst:226 +#: ../../library/tempfile.rst:279 msgid "" "The *prefix*, *suffix*, and *dir* arguments are the same as for :func:" "`mkstemp`." msgstr "" "引數 *prefix*、*suffix* 和 *dir* 的含義與它們在 :func:`mkstemp` 中相同。" -#: ../../library/tempfile.rst:229 +#: ../../library/tempfile.rst:282 +msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." +msgstr "" + +#: ../../library/tempfile.rst:295 msgid "" -":func:`mkdtemp` returns the absolute pathname of the new directory if *dir* " -"is ``None`` or is an absolute path. If *dir* is a relative path, :func:" -"`mkdtemp` returns a relative path on Python 3.11 and lower. However, on 3.12 " -"it will return an absolute path in all situations." +":func:`mkdtemp` now always returns an absolute path, even if *dir* is " +"relative." msgstr "" -#: ../../library/tempfile.rst:248 +#: ../../library/tempfile.rst:301 msgid "" "Return the name of the directory used for temporary files. This defines the " "default value for the *dir* argument to all functions in this module." msgstr "" "回傳儲存臨時檔案的目錄名稱。這設定了此 module 所有函式 *dir* 引數的預設值。" -#: ../../library/tempfile.rst:252 +#: ../../library/tempfile.rst:305 msgid "" "Python searches a standard list of directories to find one which the calling " "user can create files in. The list is:" msgstr "" "Python 搜尋標準目錄列表來找到呼叫者可以在其中建立檔案的目錄。這個列表是:" -#: ../../library/tempfile.rst:255 +#: ../../library/tempfile.rst:308 msgid "The directory named by the :envvar:`TMPDIR` environment variable." msgstr ":envvar:`TMPDIR` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:257 +#: ../../library/tempfile.rst:310 msgid "The directory named by the :envvar:`TEMP` environment variable." msgstr ":envvar:`TEMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:259 +#: ../../library/tempfile.rst:312 msgid "The directory named by the :envvar:`TMP` environment variable." msgstr ":envvar:`TMP` 環境變數指向的目錄。" -#: ../../library/tempfile.rst:261 +#: ../../library/tempfile.rst:314 msgid "A platform-specific location:" msgstr "與平臺相關的位置:" -#: ../../library/tempfile.rst:263 +#: ../../library/tempfile.rst:316 msgid "" "On Windows, the directories :file:`C:\\\\TEMP`, :file:`C:\\\\TMP`, :file:`\\" "\\TEMP`, and :file:`\\\\TMP`, in that order." @@ -447,7 +542,7 @@ msgstr "" "在 Windows 上,目錄依次為 :file:`C:\\\\TEMP`、:file:`C:\\\\TMP`、:file:`\\" "\\TEMP` 和 :file:`\\\\TMP`。" -#: ../../library/tempfile.rst:266 +#: ../../library/tempfile.rst:319 msgid "" "On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :" "file:`/usr/tmp`, in that order." @@ -455,17 +550,17 @@ msgstr "" "在所有其他平臺上,目錄依次為 :file:`/tmp`、:file:`/var/tmp` 和 :file:`/usr/" "tmp`。" -#: ../../library/tempfile.rst:269 +#: ../../library/tempfile.rst:322 msgid "As a last resort, the current working directory." msgstr "不得已時,使用當前工作目錄。" -#: ../../library/tempfile.rst:271 +#: ../../library/tempfile.rst:324 msgid "" "The result of this search is cached, see the description of :data:`tempdir` " "below." msgstr "搜尋的結果會被 cache(快取)起來,請見下面 :data:`tempdir` 的描述。" -#: ../../library/tempfile.rst:276 +#: ../../library/tempfile.rst:329 msgid "" "Always returns a str. Previously it would return any :data:`tempdir` value " "regardless of type so long as it was not ``None``." @@ -473,21 +568,21 @@ msgstr "" "回傳一個字串。在之前的版本中它會回傳任意 :data:`tempdir` 的值而不考慮它的型" "別,只要它不為 ``None``。" -#: ../../library/tempfile.rst:281 +#: ../../library/tempfile.rst:334 msgid "Same as :func:`gettempdir` but the return value is in bytes." msgstr "與 :func:`gettempdir` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:287 +#: ../../library/tempfile.rst:340 msgid "" "Return the filename prefix used to create temporary files. This does not " "contain the directory component." msgstr "回傳用於建立臨時檔案的檔名前綴,它不包含目錄部分。" -#: ../../library/tempfile.rst:292 +#: ../../library/tempfile.rst:345 msgid "Same as :func:`gettempprefix` but the return value is in bytes." msgstr "與 :func:`gettempprefix` 相同,但回傳值為位元組串型別。" -#: ../../library/tempfile.rst:296 +#: ../../library/tempfile.rst:349 msgid "" "The module uses a global variable to store the name of the directory used " "for temporary files returned by :func:`gettempdir`. It can be set directly " @@ -501,7 +596,7 @@ msgstr "" "式都接受一個 *dir* 引數,它可被用於指定目錄。這是個推薦的做法,它不會透過改變" "全域性 API 行為而對其他不預期此行為的程式造成影響。" -#: ../../library/tempfile.rst:305 +#: ../../library/tempfile.rst:358 msgid "" "When set to a value other than ``None``, this variable defines the default " "value for the *dir* argument to the functions defined in this module, " @@ -511,7 +606,7 @@ msgstr "" "預設值,包括確定其型別為位元組串還是字串。它不可以為 :term:`path-like " "object`。" -#: ../../library/tempfile.rst:310 +#: ../../library/tempfile.rst:363 msgid "" "If ``tempdir`` is ``None`` (the default) at any call to any of the above " "functions except :func:`gettempprefix` it is initialized following the " @@ -520,7 +615,7 @@ msgstr "" "如果在呼叫除 :func:`gettempprefix` 外的上述任何函式時 ``tempdir`` 為 " "``None`` (預設值) 則它會按照 :func:`gettempdir` 中所描述的演算法來初始化。" -#: ../../library/tempfile.rst:316 +#: ../../library/tempfile.rst:369 msgid "" "Beware that if you set ``tempdir`` to a bytes value, there is a nasty side " "effect: The global default return type of :func:`mkstemp` and :func:" @@ -534,22 +629,22 @@ msgstr "" "``prefix``、``suffix`` 或 ``dir`` 時被改為位元組串。請不要編寫預期此行為或依" "賴於此行為的程式。這個奇怪的行為是為了維持與以往實作版本的相容性。" -#: ../../library/tempfile.rst:327 +#: ../../library/tempfile.rst:380 msgid "Examples" msgstr "範例" -#: ../../library/tempfile.rst:329 +#: ../../library/tempfile.rst:382 msgid "Here are some examples of typical usage of the :mod:`tempfile` module::" msgstr "" "以下是 :mod:`tempfile` module 的一些常見用法範例:\n" "\n" "::" -#: ../../library/tempfile.rst:361 +#: ../../library/tempfile.rst:427 msgid "Deprecated functions and variables" msgstr "已棄用的函式和變數" -#: ../../library/tempfile.rst:363 +#: ../../library/tempfile.rst:429 msgid "" "A historical way to create temporary files was to first generate a file name " "with the :func:`mktemp` function and then create a file using this name. " @@ -564,11 +659,11 @@ msgstr "" "之間的時間裡,其他程式可能會使用該名稱建立檔案。解決方案是將兩個步驟結合起" "來,並立即建立檔案。這個方案目前被 :func:`mkstemp` 和上述其他函式所採用。" -#: ../../library/tempfile.rst:374 +#: ../../library/tempfile.rst:440 msgid "Use :func:`mkstemp` instead." msgstr "使用 :func:`mkstemp` 代替。" -#: ../../library/tempfile.rst:377 +#: ../../library/tempfile.rst:443 msgid "" "Return an absolute pathname of a file that did not exist at the time the " "call is made. The *prefix*, *suffix*, and *dir* arguments are similar to " @@ -579,7 +674,7 @@ msgstr "" "與 :func:`mkstemp` 中所用的類似,除了在於不支援位元組串型別的檔名且不支援 " "``suffix=None`` 和 ``prefix=None``。" -#: ../../library/tempfile.rst:384 +#: ../../library/tempfile.rst:450 msgid "" "Use of this function may introduce a security hole in your program. By the " "time you get around to doing anything with the file name it returns, someone " @@ -604,3 +699,25 @@ msgstr "file name(檔案名稱)" #: ../../library/tempfile.rst:11 msgid "file" msgstr "file(檔案)" + +#~ msgid "" +#~ "This function operates exactly as :func:`TemporaryFile` does, except that " +#~ "the file is guaranteed to have a visible name in the file system (on " +#~ "Unix, the directory entry is not unlinked). That name can be retrieved " +#~ "from the :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). 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 "" +#~ "此函式執行的操作與 :func:`TemporaryFile` 幾乎相同,不同之處為確保該臨時檔" +#~ "案在檔案系統中具有可見的名稱(在 Unix 上目錄條目不會被 unlink)。檔名可以" +#~ "由回傳 file-like object 的 :attr:`name` 屬性取得。在臨時檔案仍開啟時,是否" +#~ "允許用檔名第二次開啟檔案,在各個平臺上是不同的(在 Unix 上可以;在 " +#~ "Windows NT 版本以上不行)。如果 *delete* 為 true(預設值),則檔案會在關閉" +#~ "後立即被刪除。該函式回傳的物件始終是 file-like object,它的 :attr:`!file` " +#~ "屬性是底層的真實檔案物件。file-like object 可以像普通檔案一樣在 :keyword:" +#~ "`with` 陳述句中使用。" diff --git a/library/test.po b/library/test.po index 47069f3f84..6985003524 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-03 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -383,106 +383,158 @@ msgstr "" #: ../../library/test.rst:324 msgid "" +"True if Python is built with the :c:macro:`Py_DEBUG` macro defined: if " +"Python is :ref:`built in debug mode ` (:option:`./configure --" +"with-pydebug <--with-pydebug>`)." +msgstr "" + +#: ../../library/test.rst:333 +msgid "" "A constant that is likely larger than the underlying OS socket buffer size, " "to make writes blocking." msgstr "" -#: ../../library/test.rst:330 +#: ../../library/test.rst:339 msgid "Set to the top level directory that contains :mod:`test.support`." msgstr "" -#: ../../library/test.rst:335 +#: ../../library/test.rst:344 msgid "Set to the top level directory for the test package." msgstr "" -#: ../../library/test.rst:340 +#: ../../library/test.rst:349 msgid "Set to the ``data`` directory within the test package." msgstr "" -#: ../../library/test.rst:345 +#: ../../library/test.rst:354 msgid "Set to :data:`sys.maxsize` for big memory tests." msgstr "" -#: ../../library/test.rst:350 +#: ../../library/test.rst:359 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. " "Limited by :data:`MAX_Py_ssize_t`." msgstr "" -#: ../../library/test.rst:356 +#: ../../library/test.rst:365 msgid "" "Set by :func:`set_memlimit` as the memory limit for big memory tests. Not " "limited by :data:`MAX_Py_ssize_t`." msgstr "" -#: ../../library/test.rst:362 +#: ../../library/test.rst:371 msgid "" "Set to ``True`` if Python is built without docstrings (the :c:macro:" "`WITH_DOC_STRINGS` macro is not defined). See the :option:`configure --" "without-doc-strings <--without-doc-strings>` option." msgstr "" -#: ../../library/test.rst:366 +#: ../../library/test.rst:375 msgid "See also the :data:`HAVE_DOCSTRINGS` variable." msgstr "" -#: ../../library/test.rst:371 +#: ../../library/test.rst:380 msgid "" "Set to ``True`` if function docstrings are available. See the :option:" "`python -OO <-O>` option, which strips docstrings of functions implemented " "in Python." msgstr "" -#: ../../library/test.rst:374 +#: ../../library/test.rst:383 msgid "See also the :data:`MISSING_C_DOCSTRINGS` variable." msgstr "" -#: ../../library/test.rst:379 +#: ../../library/test.rst:388 msgid "Define the URL of a dedicated HTTP server for the network tests." msgstr "" -#: ../../library/test.rst:384 +#: ../../library/test.rst:393 msgid "Object that is equal to anything. Used to test mixed type comparison." msgstr "" -#: ../../library/test.rst:389 +#: ../../library/test.rst:398 msgid "" "Object that is not equal to anything (even to :data:`ALWAYS_EQ`). Used to " "test mixed type comparison." msgstr "" -#: ../../library/test.rst:395 +#: ../../library/test.rst:404 msgid "" "Object that is greater than anything (except itself). Used to test mixed " "type comparison." msgstr "" -#: ../../library/test.rst:401 +#: ../../library/test.rst:410 msgid "" "Object that is less than anything (except itself). Used to test mixed type " "comparison." msgstr "" -#: ../../library/test.rst:405 +#: ../../library/test.rst:414 msgid "The :mod:`test.support` module defines the following functions:" msgstr "" -#: ../../library/test.rst:409 +#: ../../library/test.rst:418 +msgid "Run the loop body until ``break`` stops the loop." +msgstr "" + +#: ../../library/test.rst:420 +msgid "" +"After *timeout* seconds, raise an :exc:`AssertionError` if *error* is true, " +"or just stop the loop if *error* is false." +msgstr "" + +#: ../../library/test.rst:423 +#, fuzzy +msgid "Example::" +msgstr "" +"用法範例:\n" +"\n" +"::" + +#: ../../library/test.rst:429 ../../library/test.rst:453 +#, fuzzy +msgid "Example of error=False usage::" +msgstr "" +"用法範例:\n" +"\n" +"::" + +#: ../../library/test.rst:439 +msgid "Wait strategy that applies exponential backoff." +msgstr "" + +#: ../../library/test.rst:441 +msgid "" +"Run the loop body until ``break`` stops the loop. Sleep at each loop " +"iteration, but not at the first iteration. The sleep delay is doubled at " +"each iteration (up to *max_delay* seconds)." +msgstr "" + +#: ../../library/test.rst:445 +msgid "See :func:`busy_retry` documentation for the parameters usage." +msgstr "" + +#: ../../library/test.rst:447 +msgid "Example raising an exception after SHORT_TIMEOUT seconds::" +msgstr "" + +#: ../../library/test.rst:463 msgid "" "Return ``True`` if *resource* is enabled and available. The list of " "available resources is only set when :mod:`test.regrtest` is executing the " "tests." msgstr "" -#: ../../library/test.rst:416 +#: ../../library/test.rst:470 msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." msgstr "" -#: ../../library/test.rst:421 +#: ../../library/test.rst:475 msgid "Return :data:`_testcapi.WITH_PYMALLOC`." msgstr "" -#: ../../library/test.rst:426 +#: ../../library/test.rst:480 msgid "" "Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the " "argument to :exc:`ResourceDenied` if it is raised. Always returns ``True`` " @@ -490,42 +542,42 @@ msgid "" "tests are executed by :mod:`test.regrtest`." msgstr "" -#: ../../library/test.rst:434 +#: ../../library/test.rst:488 msgid "Return a repr of *dict* with keys sorted." msgstr "" -#: ../../library/test.rst:439 +#: ../../library/test.rst:493 msgid "" "Return the path to the file named *filename*. If no match is found " "*filename* is returned. This does not equal a failure since it could be the " "path to the file." msgstr "" -#: ../../library/test.rst:443 +#: ../../library/test.rst:497 msgid "" "Setting *subdir* indicates a relative path to use to find the file rather " "than looking directly in the path directories." msgstr "" -#: ../../library/test.rst:449 +#: ../../library/test.rst:503 msgid "" "Determine whether *test* matches the patterns set in :func:`set_match_tests`." msgstr "" -#: ../../library/test.rst:454 +#: ../../library/test.rst:508 msgid "" "Define match patterns on test filenames and test method names for filtering " "tests." msgstr "" -#: ../../library/test.rst:459 +#: ../../library/test.rst:513 msgid "" "Execute :class:`unittest.TestCase` subclasses passed to the function. The " "function scans the classes for methods starting with the prefix ``test_`` " "and executes the tests individually." msgstr "" -#: ../../library/test.rst:463 +#: ../../library/test.rst:517 msgid "" "It is also legal to pass strings as parameters; these should be keys in " "``sys.modules``. Each associated module will be scanned by ``unittest." @@ -533,17 +585,17 @@ msgid "" "func:`test_main` function::" msgstr "" -#: ../../library/test.rst:471 +#: ../../library/test.rst:525 msgid "This will run all tests defined in the named module." msgstr "" -#: ../../library/test.rst:476 +#: ../../library/test.rst:530 msgid "" "Run :func:`doctest.testmod` on the given *module*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/test.rst:479 +#: ../../library/test.rst:533 msgid "" "If *verbosity* is ``None``, :func:`doctest.testmod` is run with verbosity " "set to :data:`verbose`. Otherwise, it is run with verbosity set to " @@ -551,68 +603,72 @@ msgid "" "testmod`." msgstr "" -#: ../../library/test.rst:487 +#: ../../library/test.rst:541 +msgid "Get size of a page in bytes." +msgstr "" + +#: ../../library/test.rst:548 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:493 +#: ../../library/test.rst:554 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " "them only on the implementations guarded by the arguments. This function " "returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:505 +#: ../../library/test.rst:566 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:511 +#: ../../library/test.rst:572 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:517 +#: ../../library/test.rst:578 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:523 +#: ../../library/test.rst:584 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:529 +#: ../../library/test.rst:590 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:537 +#: ../../library/test.rst:598 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:540 +#: ../../library/test.rst:601 msgid "Example use with output streams::" msgstr "" -#: ../../library/test.rst:548 +#: ../../library/test.rst:609 msgid "Example use with input stream::" msgstr "" -#: ../../library/test.rst:560 +#: ../../library/test.rst:621 msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:565 +#: ../../library/test.rst:626 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -620,115 +676,115 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:573 +#: ../../library/test.rst:634 msgid "" "A context manager that disables the garbage collector on entry. On exit, the " "garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:579 +#: ../../library/test.rst:640 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:581 ../../library/test.rst:599 -#: ../../library/test.rst:828 ../../library/test.rst:1301 +#: ../../library/test.rst:642 ../../library/test.rst:660 +#: ../../library/test.rst:895 ../../library/test.rst:1361 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/test.rst:586 +#: ../../library/test.rst:647 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:591 ../../library/test.rst:609 +#: ../../library/test.rst:652 ../../library/test.rst:670 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:597 +#: ../../library/test.rst:658 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:604 +#: ../../library/test.rst:665 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:615 +#: ../../library/test.rst:676 msgid "" "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys." "stderr`. It can be used to make sure that the logs order is consistent " "before writing into stderr." msgstr "" -#: ../../library/test.rst:624 +#: ../../library/test.rst:685 msgid "" "Print a warning into :data:`sys.__stderr__`. Format the message as: " "``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " "``\"Warning -- \"`` prefix to each line." msgstr "" -#: ../../library/test.rst:633 +#: ../../library/test.rst:694 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:636 +#: ../../library/test.rst:697 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." msgstr "" -#: ../../library/test.rst:639 +#: ../../library/test.rst:700 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:648 +#: ../../library/test.rst:709 msgid "" "Return the size of the :c:type:`PyObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:654 +#: ../../library/test.rst:715 msgid "" "Return the size of the :c:type:`PyVarObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:660 +#: ../../library/test.rst:721 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:666 +#: ../../library/test.rst:727 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:673 +#: ../../library/test.rst:734 msgid "" "A decorator that skips the decorated test on TLS certification validation " "failures." msgstr "" -#: ../../library/test.rst:678 +#: ../../library/test.rst:739 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -736,73 +792,79 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:686 +#: ../../library/test.rst:747 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:692 +#: ../../library/test.rst:753 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " "FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:698 +#: ../../library/test.rst:759 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:704 +#: ../../library/test.rst:765 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:710 +#: ../../library/test.rst:771 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:715 +#: ../../library/test.rst:776 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: ../../library/test.rst:720 +#: ../../library/test.rst:781 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: ../../library/test.rst:725 +#: ../../library/test.rst:786 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: ../../library/test.rst:730 +#: ../../library/test.rst:791 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: ../../library/test.rst:735 +#: ../../library/test.rst:796 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: ../../library/test.rst:740 +#: ../../library/test.rst:801 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:745 +#: ../../library/test.rst:806 +msgid "" +"Decorator for only running the test if :ref:`Limited C API ` " +"is available." +msgstr "" + +#: ../../library/test.rst:812 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:750 +#: ../../library/test.rst:817 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:756 +#: ../../library/test.rst:823 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:761 +#: ../../library/test.rst:828 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -810,11 +872,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:769 +#: ../../library/test.rst:836 msgid "Decorator for bigmem tests." msgstr "" -#: ../../library/test.rst:771 +#: ../../library/test.rst:838 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -822,7 +884,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:776 +#: ../../library/test.rst:843 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -830,11 +892,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:784 +#: ../../library/test.rst:851 msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:789 +#: ../../library/test.rst:856 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -844,44 +906,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:799 +#: ../../library/test.rst:866 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:804 +#: ../../library/test.rst:871 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:811 +#: ../../library/test.rst:878 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:817 +#: ../../library/test.rst:884 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:820 +#: ../../library/test.rst:887 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:824 +#: ../../library/test.rst:891 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:845 +#: ../../library/test.rst:912 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -890,55 +952,55 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:860 +#: ../../library/test.rst:927 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:864 +#: ../../library/test.rst:931 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: ../../library/test.rst:872 +#: ../../library/test.rst:939 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:880 +#: ../../library/test.rst:947 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:886 +#: ../../library/test.rst:953 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:891 +#: ../../library/test.rst:958 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:899 +#: ../../library/test.rst:966 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:901 +#: ../../library/test.rst:968 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:905 +#: ../../library/test.rst:972 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -946,7 +1008,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:910 +#: ../../library/test.rst:977 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -954,31 +1016,31 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:914 +#: ../../library/test.rst:981 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:917 ../../library/test.rst:1550 +#: ../../library/test.rst:984 ../../library/test.rst:1610 msgid "Example use::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/test.rst:940 +#: ../../library/test.rst:1007 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:949 +#: ../../library/test.rst:1016 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:956 +#: ../../library/test.rst:1023 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -986,76 +1048,72 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: ../../library/test.rst:964 +#: ../../library/test.rst:1031 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: ../../library/test.rst:969 +#: ../../library/test.rst:1036 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:972 +#: ../../library/test.rst:1039 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:975 +#: ../../library/test.rst:1042 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :attr:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:979 +#: ../../library/test.rst:1046 msgid "On both platforms, the old value is restored by :meth:`__exit__`." msgstr "" -#: ../../library/test.rst:984 +#: ../../library/test.rst:1051 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:989 +#: ../../library/test.rst:1056 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: ../../library/test.rst:994 +#: ../../library/test.rst:1061 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: ../../library/test.rst:1002 +#: ../../library/test.rst:1069 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:1007 +#: ../../library/test.rst:1074 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:1014 -msgid "Run *test* and return the result." -msgstr "" - -#: ../../library/test.rst:1018 +#: ../../library/test.rst:1078 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: ../../library/test.rst:1024 +#: ../../library/test.rst:1084 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:1031 +#: ../../library/test.rst:1091 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1036 +#: ../../library/test.rst:1096 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1066,7 +1124,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1045 +#: ../../library/test.rst:1105 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1079,7 +1137,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1059 +#: ../../library/test.rst:1119 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1092,7 +1150,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1070 +#: ../../library/test.rst:1130 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1100,58 +1158,58 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1078 +#: ../../library/test.rst:1138 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1084 +#: ../../library/test.rst:1144 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1090 +#: ../../library/test.rst:1150 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1096 +#: ../../library/test.rst:1156 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: ../../library/test.rst:1102 +#: ../../library/test.rst:1162 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: ../../library/test.rst:1107 +#: ../../library/test.rst:1167 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1110 +#: ../../library/test.rst:1170 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1114 +#: ../../library/test.rst:1174 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1118 +#: ../../library/test.rst:1178 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1159,85 +1217,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1126 +#: ../../library/test.rst:1186 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1130 ../../library/test.rst:1146 -#: ../../library/test.rst:1158 +#: ../../library/test.rst:1190 ../../library/test.rst:1206 +#: ../../library/test.rst:1218 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: ../../library/test.rst:1136 +#: ../../library/test.rst:1196 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1140 +#: ../../library/test.rst:1200 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: ../../library/test.rst:1143 +#: ../../library/test.rst:1203 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1152 +#: ../../library/test.rst:1212 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1156 +#: ../../library/test.rst:1216 msgid "See :func:`assert_python_ok` for more options." msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" -#: ../../library/test.rst:1164 +#: ../../library/test.rst:1224 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1166 +#: ../../library/test.rst:1226 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1172 +#: ../../library/test.rst:1232 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1178 +#: ../../library/test.rst:1238 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1185 +#: ../../library/test.rst:1245 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1192 +#: ../../library/test.rst:1252 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1199 +#: ../../library/test.rst:1259 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1246,60 +1304,60 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1207 +#: ../../library/test.rst:1267 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: ../../library/test.rst:1212 +#: ../../library/test.rst:1272 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1217 +#: ../../library/test.rst:1277 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1221 +#: ../../library/test.rst:1281 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1225 +#: ../../library/test.rst:1285 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1230 +#: ../../library/test.rst:1290 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1235 +#: ../../library/test.rst:1295 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1239 +#: ../../library/test.rst:1299 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1244 +#: ../../library/test.rst:1304 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1251 +#: ../../library/test.rst:1311 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1257 +#: ../../library/test.rst:1317 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1262 +#: ../../library/test.rst:1322 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1307,79 +1365,79 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1270 +#: ../../library/test.rst:1330 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1276 +#: ../../library/test.rst:1336 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1281 +#: ../../library/test.rst:1341 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1287 +#: ../../library/test.rst:1347 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1290 +#: ../../library/test.rst:1350 msgid "Attributes set when an exception is caught:" msgstr "" -#: ../../library/test.rst:1292 +#: ../../library/test.rst:1352 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1293 +#: ../../library/test.rst:1353 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1294 +#: ../../library/test.rst:1354 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1295 +#: ../../library/test.rst:1355 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1297 +#: ../../library/test.rst:1357 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1299 +#: ../../library/test.rst:1359 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: ../../library/test.rst:1319 +#: ../../library/test.rst:1379 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: ../../library/test.rst:1324 +#: ../../library/test.rst:1384 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: ../../library/test.rst:1331 +#: ../../library/test.rst:1391 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1336 +#: ../../library/test.rst:1396 msgid "Set to :func:`os.getcwd`." msgstr "" -#: ../../library/test.rst:1341 +#: ../../library/test.rst:1401 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1347 +#: ../../library/test.rst:1407 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1387,25 +1445,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1355 +#: ../../library/test.rst:1415 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1362 +#: ../../library/test.rst:1422 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1369 +#: ../../library/test.rst:1429 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1374 +#: ../../library/test.rst:1434 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1414,75 +1472,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1380 +#: ../../library/test.rst:1440 msgid "Added dictionary interface." msgstr "" -#: ../../library/test.rst:1386 +#: ../../library/test.rst:1446 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1393 +#: ../../library/test.rst:1453 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1399 +#: ../../library/test.rst:1459 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: ../../library/test.rst:1404 +#: ../../library/test.rst:1464 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1410 +#: ../../library/test.rst:1470 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1416 +#: ../../library/test.rst:1476 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1419 +#: ../../library/test.rst:1479 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1426 +#: ../../library/test.rst:1486 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1431 +#: ../../library/test.rst:1491 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1436 +#: ../../library/test.rst:1496 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1441 +#: ../../library/test.rst:1501 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1447 +#: ../../library/test.rst:1507 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1455 +#: ../../library/test.rst:1515 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1490,21 +1548,21 @@ msgid "" "the files." msgstr "" -#: ../../library/test.rst:1463 +#: ../../library/test.rst:1523 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1468 +#: ../../library/test.rst:1528 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1473 +#: ../../library/test.rst:1533 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1476 +#: ../../library/test.rst:1536 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1512,20 +1570,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1481 +#: ../../library/test.rst:1541 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1488 +#: ../../library/test.rst:1548 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1491 +#: ../../library/test.rst:1551 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1533,34 +1591,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1499 +#: ../../library/test.rst:1559 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1504 +#: ../../library/test.rst:1564 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: ../../library/test.rst:1510 +#: ../../library/test.rst:1570 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: ../../library/test.rst:1515 +#: ../../library/test.rst:1575 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: ../../library/test.rst:1522 +#: ../../library/test.rst:1582 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1528 +#: ../../library/test.rst:1588 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1568,46 +1626,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1533 +#: ../../library/test.rst:1593 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1536 +#: ../../library/test.rst:1596 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1540 +#: ../../library/test.rst:1600 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1544 +#: ../../library/test.rst:1604 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1547 +#: ../../library/test.rst:1607 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1564 +#: ../../library/test.rst:1624 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1568 +#: ../../library/test.rst:1628 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1615,21 +1673,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1578 +#: ../../library/test.rst:1638 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: ../../library/test.rst:1583 +#: ../../library/test.rst:1643 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1589 +#: ../../library/test.rst:1649 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: ../../library/test.rst:1594 +#: ../../library/test.rst:1654 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1637,42 +1695,42 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1602 +#: ../../library/test.rst:1662 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1612 +#: ../../library/test.rst:1672 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1614 +#: ../../library/test.rst:1674 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1618 +#: ../../library/test.rst:1678 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1624 +#: ../../library/test.rst:1684 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: ../../library/test.rst:1629 +#: ../../library/test.rst:1689 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: ../../library/test.rst:1636 +#: ../../library/test.rst:1696 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1680,14 +1738,14 @@ msgid "" "category=category) `. For example::" msgstr "" -#: ../../library/test.rst:1651 +#: ../../library/test.rst:1711 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1658 +#: ../../library/test.rst:1718 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1699,7 +1757,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1732 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1708,7 +1766,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1738 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1720,15 +1778,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1687 +#: ../../library/test.rst:1747 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1691 +#: ../../library/test.rst:1751 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1693 +#: ../../library/test.rst:1753 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1740,39 +1798,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1702 +#: ../../library/test.rst:1762 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1705 +#: ../../library/test.rst:1765 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1712 +#: ../../library/test.rst:1772 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1715 +#: ../../library/test.rst:1775 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1729 +#: ../../library/test.rst:1789 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1732 +#: ../../library/test.rst:1792 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1738 +#: ../../library/test.rst:1798 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/threading.po b/library/threading.po index 38d37f47f8..fc1f5efc0b 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -195,10 +195,10 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:130 +#: ../../library/threading.rst:130 ../../library/threading.rst:465 msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX." +"NetBSD, AIX, DragonFlyBSD." msgstr "" #: ../../library/threading.rst:137 @@ -223,22 +223,46 @@ msgid "" "before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:168 -msgid "Get the trace function as set by :func:`settrace`." +#: ../../library/threading.rst:163 +msgid "" +"Set a trace function for all threads started from the :mod:`threading` " +"module and all Python threads that are currently executing." +msgstr "" + +#: ../../library/threading.rst:166 +msgid "" +"The *func* will be passed to :func:`sys.settrace` for each thread, before " +"its :meth:`~Thread.run` method is called." msgstr "" #: ../../library/threading.rst:177 +msgid "Get the trace function as set by :func:`settrace`." +msgstr "" + +#: ../../library/threading.rst:186 msgid "" "Set a profile function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.setprofile` for each " "thread, before its :meth:`~Thread.run` method is called." msgstr "" -#: ../../library/threading.rst:186 +#: ../../library/threading.rst:192 +msgid "" +"Set a profile function for all threads started from the :mod:`threading` " +"module and all Python threads that are currently executing." +msgstr "" + +#: ../../library/threading.rst:195 +msgid "" +"The *func* will be passed to :func:`sys.setprofile` for each thread, before " +"its :meth:`~Thread.run` method is called." +msgstr "" + +#: ../../library/threading.rst:204 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/threading.rst:193 +#: ../../library/threading.rst:211 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -257,19 +281,19 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:208 +#: ../../library/threading.rst:226 msgid ":ref:`Availability `: Windows, pthreads." msgstr ":ref:`適用 `:Windows, pthreads。" -#: ../../library/threading.rst:210 +#: ../../library/threading.rst:228 msgid "Unix platforms with POSIX threads support." msgstr "" -#: ../../library/threading.rst:213 +#: ../../library/threading.rst:231 msgid "This module also defines the following constant:" msgstr "" -#: ../../library/threading.rst:217 +#: ../../library/threading.rst:235 msgid "" "The maximum value allowed for the *timeout* parameter of blocking functions " "(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). " @@ -277,13 +301,13 @@ msgid "" "`OverflowError`." msgstr "" -#: ../../library/threading.rst:225 +#: ../../library/threading.rst:243 msgid "" "This module defines a number of classes, which are detailed in the sections " "below." msgstr "" -#: ../../library/threading.rst:228 +#: ../../library/threading.rst:246 msgid "" "The design of this module is loosely based on Java's threading model. " "However, where Java makes locks and condition variables basic behavior of " @@ -294,40 +318,40 @@ msgid "" "Thread class, when implemented, are mapped to module-level functions." msgstr "" -#: ../../library/threading.rst:236 +#: ../../library/threading.rst:254 msgid "All of the methods described below are executed atomically." msgstr "" -#: ../../library/threading.rst:240 +#: ../../library/threading.rst:258 msgid "Thread-Local Data" msgstr "" -#: ../../library/threading.rst:242 +#: ../../library/threading.rst:260 msgid "" "Thread-local data is data whose values are thread specific. To manage " "thread-local data, just create an instance of :class:`local` (or a subclass) " "and store attributes on it::" msgstr "" -#: ../../library/threading.rst:249 +#: ../../library/threading.rst:267 msgid "The instance's values will be different for separate threads." msgstr "" -#: ../../library/threading.rst:254 +#: ../../library/threading.rst:272 msgid "A class that represents thread-local data." msgstr "" -#: ../../library/threading.rst:256 +#: ../../library/threading.rst:274 msgid "" "For more details and extensive examples, see the documentation string of " "the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" -#: ../../library/threading.rst:263 +#: ../../library/threading.rst:281 msgid "Thread Objects" msgstr "" -#: ../../library/threading.rst:265 +#: ../../library/threading.rst:283 msgid "" "The :class:`Thread` class represents an activity that is run in a separate " "thread of control. There are two ways to specify the activity: by passing a " @@ -337,14 +361,14 @@ msgid "" "`~Thread.__init__` and :meth:`~Thread.run` methods of this class." msgstr "" -#: ../../library/threading.rst:272 +#: ../../library/threading.rst:290 msgid "" "Once a thread object is created, its activity must be started by calling the " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" -#: ../../library/threading.rst:276 +#: ../../library/threading.rst:294 msgid "" "Once the thread's activity is started, the thread is considered 'alive'. It " "stops being alive when its :meth:`~Thread.run` method terminates -- either " @@ -352,27 +376,27 @@ msgid "" "is_alive` method tests whether the thread is alive." msgstr "" -#: ../../library/threading.rst:281 +#: ../../library/threading.rst:299 msgid "" "Other threads can call a thread's :meth:`~Thread.join` method. This blocks " "the calling thread until the thread whose :meth:`~Thread.join` method is " "called is terminated." msgstr "" -#: ../../library/threading.rst:285 +#: ../../library/threading.rst:303 msgid "" "A thread has a name. The name can be passed to the constructor, and read or " "changed through the :attr:`~Thread.name` attribute." msgstr "" -#: ../../library/threading.rst:288 +#: ../../library/threading.rst:306 msgid "" "If the :meth:`~Thread.run` method raises an exception, :func:`threading." "excepthook` is called to handle it. By default, :func:`threading.excepthook` " "ignores silently :exc:`SystemExit`." msgstr "" -#: ../../library/threading.rst:292 +#: ../../library/threading.rst:310 msgid "" "A thread can be flagged as a \"daemon thread\". The significance of this " "flag is that the entire Python program exits when only daemon threads are " @@ -381,7 +405,7 @@ msgid "" "constructor argument." msgstr "" -#: ../../library/threading.rst:299 +#: ../../library/threading.rst:317 msgid "" "Daemon threads are abruptly stopped at shutdown. Their resources (such as " "open files, database transactions, etc.) may not be released properly. If " @@ -389,13 +413,13 @@ msgid "" "suitable signalling mechanism such as an :class:`Event`." msgstr "" -#: ../../library/threading.rst:304 +#: ../../library/threading.rst:322 msgid "" "There is a \"main thread\" object; this corresponds to the initial thread of " "control in the Python program. It is not a daemon thread." msgstr "" -#: ../../library/threading.rst:307 +#: ../../library/threading.rst:325 msgid "" "There is the possibility that \"dummy thread objects\" are created. These " "are thread objects corresponding to \"alien threads\", which are threads of " @@ -406,25 +430,25 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:318 +#: ../../library/threading.rst:336 msgid "" "This constructor should always be called with keyword arguments. Arguments " "are:" msgstr "" -#: ../../library/threading.rst:321 +#: ../../library/threading.rst:339 msgid "" "*group* should be ``None``; reserved for future extension when a :class:" "`ThreadGroup` class is implemented." msgstr "" -#: ../../library/threading.rst:324 +#: ../../library/threading.rst:342 msgid "" "*target* is the callable object to be invoked by the :meth:`run` method. " "Defaults to ``None``, meaning nothing is called." msgstr "" -#: ../../library/threading.rst:327 +#: ../../library/threading.rst:345 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* " @@ -432,62 +456,62 @@ msgid "" "is specified." msgstr "" -#: ../../library/threading.rst:332 +#: ../../library/threading.rst:350 msgid "" "*args* is a list or tuple of arguments for the target invocation. Defaults " "to ``()``." msgstr "" -#: ../../library/threading.rst:334 +#: ../../library/threading.rst:352 msgid "" "*kwargs* is a dictionary of keyword arguments for the target invocation. " "Defaults to ``{}``." msgstr "" -#: ../../library/threading.rst:337 +#: ../../library/threading.rst:355 msgid "" "If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If " "``None`` (the default), the daemonic property is inherited from the current " "thread." msgstr "" -#: ../../library/threading.rst:341 +#: ../../library/threading.rst:359 msgid "" "If the subclass overrides the constructor, it must make sure to invoke the " "base class constructor (``Thread.__init__()``) before doing anything else to " "the thread." msgstr "" -#: ../../library/threading.rst:345 +#: ../../library/threading.rst:363 msgid "Use the *target* name if *name* argument is omitted." msgstr "" -#: ../../library/threading.rst:348 +#: ../../library/threading.rst:366 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/threading.rst:353 +#: ../../library/threading.rst:371 msgid "Start the thread's activity." msgstr "" -#: ../../library/threading.rst:355 +#: ../../library/threading.rst:373 msgid "" "It must be called at most once per thread object. It arranges for the " "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" -#: ../../library/threading.rst:359 +#: ../../library/threading.rst:377 msgid "" "This method will raise a :exc:`RuntimeError` if called more than once on the " "same thread object." msgstr "" -#: ../../library/threading.rst:364 +#: ../../library/threading.rst:382 msgid "Method representing the thread's activity." msgstr "" -#: ../../library/threading.rst:366 +#: ../../library/threading.rst:384 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the " @@ -495,20 +519,20 @@ msgid "" "the *args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/threading.rst:371 +#: ../../library/threading.rst:389 msgid "" "Using list or tuple as the *args* argument which passed to the :class:" "`Thread` could achieve the same effect." msgstr "" -#: ../../library/threading.rst:374 +#: ../../library/threading.rst:392 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/threading.rst:388 +#: ../../library/threading.rst:406 msgid "" "Wait until the thread terminates. This blocks the calling thread until the " "thread whose :meth:`~Thread.join` method is called terminates -- either " @@ -516,7 +540,7 @@ msgid "" "occurs." msgstr "" -#: ../../library/threading.rst:393 +#: ../../library/threading.rst:411 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " @@ -526,17 +550,17 @@ msgid "" "`~Thread.join` call timed out." msgstr "" -#: ../../library/threading.rst:400 +#: ../../library/threading.rst:418 msgid "" "When the *timeout* argument is not present or ``None``, the operation will " "block until the thread terminates." msgstr "" -#: ../../library/threading.rst:403 +#: ../../library/threading.rst:421 msgid "A thread can be joined many times." msgstr "" -#: ../../library/threading.rst:405 +#: ../../library/threading.rst:423 msgid "" ":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to " "join the current thread as that would cause a deadlock. It is also an error " @@ -544,20 +568,20 @@ msgid "" "do so raise the same exception." msgstr "" -#: ../../library/threading.rst:412 +#: ../../library/threading.rst:430 msgid "" "A string used for identification purposes only. It has no semantics. " "Multiple threads may be given the same name. The initial name is set by the " "constructor." msgstr "" -#: ../../library/threading.rst:419 +#: ../../library/threading.rst:437 msgid "" "Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a " "property instead." msgstr "" -#: ../../library/threading.rst:426 +#: ../../library/threading.rst:444 msgid "" "The 'thread identifier' of this thread or ``None`` if the thread has not " "been started. This is a nonzero integer. See the :func:`get_ident` " @@ -566,7 +590,7 @@ msgid "" "thread has exited." msgstr "" -#: ../../library/threading.rst:434 +#: ../../library/threading.rst:452 msgid "" "The Thread ID (``TID``) of this thread, as assigned by the OS (kernel). This " "is a non-negative integer, or ``None`` if the thread has not been started. " @@ -575,31 +599,25 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:443 +#: ../../library/threading.rst:461 msgid "" "Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-" "wide) from the time the thread is created until the thread has been " "terminated." msgstr "" -#: ../../library/threading.rst:447 -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD." -msgstr "" - -#: ../../library/threading.rst:453 +#: ../../library/threading.rst:471 msgid "Return whether the thread is alive." msgstr "" -#: ../../library/threading.rst:455 +#: ../../library/threading.rst:473 msgid "" "This method returns ``True`` just before the :meth:`~Thread.run` method " "starts until just after the :meth:`~Thread.run` method terminates. The " "module function :func:`.enumerate` returns a list of all alive threads." msgstr "" -#: ../../library/threading.rst:461 +#: ../../library/threading.rst:479 msgid "" "A boolean value indicating whether this thread is a daemon thread (``True``) " "or not (``False``). This must be set before :meth:`~Thread.start` is " @@ -609,22 +627,22 @@ msgid "" "`~Thread.daemon` = ``False``." msgstr "" -#: ../../library/threading.rst:468 +#: ../../library/threading.rst:486 msgid "" "The entire Python program exits when no alive non-daemon threads are left." msgstr "" -#: ../../library/threading.rst:473 +#: ../../library/threading.rst:491 msgid "" "Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as " "a property instead." msgstr "" -#: ../../library/threading.rst:482 +#: ../../library/threading.rst:500 msgid "Lock Objects" msgstr "" -#: ../../library/threading.rst:484 +#: ../../library/threading.rst:502 msgid "" "A primitive lock is a synchronization primitive that is not owned by a " "particular thread when locked. In Python, it is currently the lowest level " @@ -632,7 +650,7 @@ msgid "" "`_thread` extension module." msgstr "" -#: ../../library/threading.rst:489 +#: ../../library/threading.rst:507 msgid "" "A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is " "created in the unlocked state. It has two basic methods, :meth:`~Lock." @@ -646,11 +664,11 @@ msgid "" "an unlocked lock, a :exc:`RuntimeError` will be raised." msgstr "" -#: ../../library/threading.rst:500 +#: ../../library/threading.rst:518 msgid "Locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:502 +#: ../../library/threading.rst:520 msgid "" "When more than one thread is blocked in :meth:`~Lock.acquire` waiting for " "the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock." @@ -658,42 +676,42 @@ msgid "" "proceeds is not defined, and may vary across implementations." msgstr "" -#: ../../library/threading.rst:507 +#: ../../library/threading.rst:525 msgid "All methods are executed atomically." msgstr "" -#: ../../library/threading.rst:512 +#: ../../library/threading.rst:530 msgid "" "The class implementing primitive lock objects. Once a thread has acquired a " "lock, subsequent attempts to acquire it block, until it is released; any " "thread may release it." msgstr "" -#: ../../library/threading.rst:516 +#: ../../library/threading.rst:534 msgid "" "Note that ``Lock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete Lock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:523 ../../library/threading.rst:603 +#: ../../library/threading.rst:541 ../../library/threading.rst:621 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/threading.rst:525 +#: ../../library/threading.rst:543 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default), " "block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:528 +#: ../../library/threading.rst:546 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. If " "a call with *blocking* set to ``True`` would block, return ``False`` " "immediately; otherwise, set the lock to locked and return ``True``." msgstr "" -#: ../../library/threading.rst:532 +#: ../../library/threading.rst:550 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -702,53 +720,53 @@ msgid "" "*blocking* is ``False``." msgstr "" -#: ../../library/threading.rst:538 +#: ../../library/threading.rst:556 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not (for example if the *timeout* expired)." msgstr "" -#: ../../library/threading.rst:541 ../../library/threading.rst:625 -#: ../../library/threading.rst:872 +#: ../../library/threading.rst:559 ../../library/threading.rst:643 +#: ../../library/threading.rst:890 msgid "The *timeout* parameter is new." msgstr "" -#: ../../library/threading.rst:544 +#: ../../library/threading.rst:562 msgid "" "Lock acquisition can now be interrupted by signals on POSIX if the " "underlying threading implementation supports it." msgstr "" -#: ../../library/threading.rst:551 +#: ../../library/threading.rst:569 msgid "" "Release a lock. This can be called from any thread, not only the thread " "which has acquired the lock." msgstr "" -#: ../../library/threading.rst:554 +#: ../../library/threading.rst:572 msgid "" "When the lock is locked, reset it to unlocked, and return. If any other " "threads are blocked waiting for the lock to become unlocked, allow exactly " "one of them to proceed." msgstr "" -#: ../../library/threading.rst:558 +#: ../../library/threading.rst:576 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:560 ../../library/threading.rst:641 +#: ../../library/threading.rst:578 ../../library/threading.rst:659 msgid "There is no return value." msgstr "" -#: ../../library/threading.rst:564 +#: ../../library/threading.rst:582 msgid "Return ``True`` if the lock is acquired." msgstr "" -#: ../../library/threading.rst:571 +#: ../../library/threading.rst:589 msgid "RLock Objects" msgstr "RLock 物件" -#: ../../library/threading.rst:573 +#: ../../library/threading.rst:591 msgid "" "A reentrant lock is a synchronization primitive that may be acquired " "multiple times by the same thread. Internally, it uses the concepts of " @@ -757,7 +775,7 @@ msgid "" "lock; in the unlocked state, no thread owns it." msgstr "" -#: ../../library/threading.rst:579 +#: ../../library/threading.rst:597 msgid "" "To lock the lock, a thread calls its :meth:`~RLock.acquire` method; this " "returns once the thread owns the lock. To unlock the lock, a thread calls " @@ -768,13 +786,13 @@ msgid "" "proceed." msgstr "" -#: ../../library/threading.rst:586 +#: ../../library/threading.rst:604 msgid "" "Reentrant locks also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:591 +#: ../../library/threading.rst:609 msgid "" "This class implements reentrant lock objects. A reentrant lock must be " "released by the thread that acquired it. Once a thread has acquired a " @@ -782,14 +800,14 @@ msgid "" "thread must release it once for each time it has acquired it." msgstr "" -#: ../../library/threading.rst:596 +#: ../../library/threading.rst:614 msgid "" "Note that ``RLock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete RLock class that is supported " "by the platform." msgstr "" -#: ../../library/threading.rst:605 +#: ../../library/threading.rst:623 msgid "" "When invoked without arguments: if this thread already owns the lock, " "increment the recursion level by one, and return immediately. Otherwise, if " @@ -800,13 +818,13 @@ msgid "" "ownership of the lock. There is no return value in this case." msgstr "" -#: ../../library/threading.rst:613 +#: ../../library/threading.rst:631 msgid "" "When invoked with the *blocking* argument set to ``True``, do the same thing " "as when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:616 +#: ../../library/threading.rst:634 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. " "If a call without an argument would block, return ``False`` immediately; " @@ -814,7 +832,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/threading.rst:620 +#: ../../library/threading.rst:638 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -822,7 +840,7 @@ msgid "" "acquired, ``False`` if the timeout has elapsed." msgstr "" -#: ../../library/threading.rst:631 +#: ../../library/threading.rst:649 msgid "" "Release a lock, decrementing the recursion level. If after the decrement it " "is zero, reset the lock to unlocked (not owned by any thread), and if any " @@ -831,17 +849,17 @@ msgid "" "is still nonzero, the lock remains locked and owned by the calling thread." msgstr "" -#: ../../library/threading.rst:637 +#: ../../library/threading.rst:655 msgid "" "Only call this method when the calling thread owns the lock. A :exc:" "`RuntimeError` is raised if this method is called when the lock is unlocked." msgstr "" -#: ../../library/threading.rst:647 +#: ../../library/threading.rst:665 msgid "Condition Objects" msgstr "" -#: ../../library/threading.rst:649 +#: ../../library/threading.rst:667 msgid "" "A condition variable is always associated with some kind of lock; this can " "be passed in or one will be created by default. Passing one in is useful " @@ -849,7 +867,7 @@ msgid "" "of the condition object: you don't have to track it separately." msgstr "" -#: ../../library/threading.rst:654 +#: ../../library/threading.rst:672 msgid "" "A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the " @@ -858,7 +876,7 @@ msgid "" "associated lock." msgstr "" -#: ../../library/threading.rst:660 +#: ../../library/threading.rst:678 msgid "" "Other methods must be called with the associated lock held. The :meth:" "`~Condition.wait` method releases the lock, and then blocks until another " @@ -867,14 +885,14 @@ msgid "" "and returns. It is also possible to specify a timeout." msgstr "" -#: ../../library/threading.rst:666 +#: ../../library/threading.rst:684 msgid "" "The :meth:`~Condition.notify` method wakes up one of the threads waiting for " "the condition variable, if any are waiting. The :meth:`~Condition." "notify_all` method wakes up all threads waiting for the condition variable." msgstr "" -#: ../../library/threading.rst:670 +#: ../../library/threading.rst:688 msgid "" "Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` " "methods don't release the lock; this means that the thread or threads " @@ -883,7 +901,7 @@ msgid "" "or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." msgstr "" -#: ../../library/threading.rst:676 +#: ../../library/threading.rst:694 msgid "" "The typical programming style using condition variables uses the lock to " "synchronize access to some shared state; threads that are interested in a " @@ -895,7 +913,7 @@ msgid "" "situation with unlimited buffer capacity::" msgstr "" -#: ../../library/threading.rst:696 +#: ../../library/threading.rst:714 msgid "" "The ``while`` loop checking for the application's condition is necessary " "because :meth:`~Condition.wait` can return after an arbitrary long time, and " @@ -905,7 +923,7 @@ msgid "" "checking, and eases the computation of timeouts::" msgstr "" -#: ../../library/threading.rst:708 +#: ../../library/threading.rst:726 msgid "" "To choose between :meth:`~Condition.notify` and :meth:`~Condition." "notify_all`, consider whether one state change can be interesting for only " @@ -914,45 +932,45 @@ msgid "" "thread." msgstr "" -#: ../../library/threading.rst:716 +#: ../../library/threading.rst:734 msgid "" "This class implements condition variable objects. A condition variable " "allows one or more threads to wait until they are notified by another thread." msgstr "" -#: ../../library/threading.rst:719 +#: ../../library/threading.rst:737 msgid "" "If the *lock* argument is given and not ``None``, it must be a :class:`Lock` " "or :class:`RLock` object, and it is used as the underlying lock. Otherwise, " "a new :class:`RLock` object is created and used as the underlying lock." msgstr "" -#: ../../library/threading.rst:723 ../../library/threading.rst:847 -#: ../../library/threading.rst:893 ../../library/threading.rst:945 -#: ../../library/threading.rst:1016 +#: ../../library/threading.rst:741 ../../library/threading.rst:865 +#: ../../library/threading.rst:911 ../../library/threading.rst:963 +#: ../../library/threading.rst:1034 msgid "changed from a factory function to a class." msgstr "" -#: ../../library/threading.rst:728 +#: ../../library/threading.rst:746 msgid "" "Acquire the underlying lock. This method calls the corresponding method on " "the underlying lock; the return value is whatever that method returns." msgstr "" -#: ../../library/threading.rst:733 +#: ../../library/threading.rst:751 msgid "" "Release the underlying lock. This method calls the corresponding method on " "the underlying lock; there is no return value." msgstr "" -#: ../../library/threading.rst:738 +#: ../../library/threading.rst:756 msgid "" "Wait until notified or until a timeout occurs. If the calling thread has not " "acquired the lock when this method is called, a :exc:`RuntimeError` is " "raised." msgstr "" -#: ../../library/threading.rst:742 +#: ../../library/threading.rst:760 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call for the same " @@ -960,14 +978,14 @@ msgid "" "Once awakened or timed out, it re-acquires the lock and returns." msgstr "" -#: ../../library/threading.rst:747 +#: ../../library/threading.rst:765 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:751 +#: ../../library/threading.rst:769 msgid "" "When the underlying lock is an :class:`RLock`, it is not released using its :" "meth:`release` method, since this may not actually unlock the lock when it " @@ -977,24 +995,24 @@ msgid "" "used to restore the recursion level when the lock is reacquired." msgstr "" -#: ../../library/threading.rst:759 +#: ../../library/threading.rst:777 msgid "" "The return value is ``True`` unless a given *timeout* expired, in which case " "it is ``False``." msgstr "" -#: ../../library/threading.rst:762 ../../library/threading.rst:981 +#: ../../library/threading.rst:780 ../../library/threading.rst:999 msgid "Previously, the method always returned ``None``." msgstr "" -#: ../../library/threading.rst:767 +#: ../../library/threading.rst:785 msgid "" "Wait until a condition evaluates to true. *predicate* should be a callable " "which result will be interpreted as a boolean value. A *timeout* may be " "provided giving the maximum time to wait." msgstr "" -#: ../../library/threading.rst:771 +#: ../../library/threading.rst:789 msgid "" "This utility method may call :meth:`wait` repeatedly until the predicate is " "satisfied, or until a timeout occurs. The return value is the last return " @@ -1002,33 +1020,33 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:776 +#: ../../library/threading.rst:794 msgid "" "Ignoring the timeout feature, calling this method is roughly equivalent to " "writing::" msgstr "" -#: ../../library/threading.rst:782 +#: ../../library/threading.rst:800 msgid "" "Therefore, the same rules apply as with :meth:`wait`: The lock must be held " "when called and is re-acquired on return. The predicate is evaluated with " "the lock held." msgstr "" -#: ../../library/threading.rst:790 +#: ../../library/threading.rst:808 msgid "" "By default, wake up one thread waiting on this condition, if any. If the " "calling thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:794 +#: ../../library/threading.rst:812 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" -#: ../../library/threading.rst:797 +#: ../../library/threading.rst:815 msgid "" "The current implementation wakes up exactly *n* threads, if at least *n* " "threads are waiting. However, it's not safe to rely on this behavior. A " @@ -1036,14 +1054,14 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:802 +#: ../../library/threading.rst:820 msgid "" "Note: an awakened thread does not actually return from its :meth:`wait` call " "until it can reacquire the lock. Since :meth:`notify` does not release the " "lock, its caller should." msgstr "" -#: ../../library/threading.rst:808 +#: ../../library/threading.rst:826 msgid "" "Wake up all threads waiting on this condition. This method acts like :meth:" "`notify`, but wakes up all waiting threads instead of one. If the calling " @@ -1051,15 +1069,15 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/threading.rst:813 +#: ../../library/threading.rst:831 msgid "The method ``notifyAll`` is a deprecated alias for this method." msgstr "" -#: ../../library/threading.rst:819 +#: ../../library/threading.rst:837 msgid "Semaphore Objects" msgstr "" -#: ../../library/threading.rst:821 +#: ../../library/threading.rst:839 msgid "" "This is one of the oldest synchronization primitives in the history of " "computer science, invented by the early Dutch computer scientist Edsger W. " @@ -1067,7 +1085,7 @@ msgid "" "acquire` and :meth:`~Semaphore.release`)." msgstr "" -#: ../../library/threading.rst:826 +#: ../../library/threading.rst:844 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` " @@ -1076,12 +1094,12 @@ msgid "" "meth:`~Semaphore.release`." msgstr "" -#: ../../library/threading.rst:832 +#: ../../library/threading.rst:850 msgid "" "Semaphores also support the :ref:`context management protocol `." msgstr "" -#: ../../library/threading.rst:837 +#: ../../library/threading.rst:855 msgid "" "This class implements semaphore objects. A semaphore manages an atomic " "counter representing the number of :meth:`release` calls minus the number " @@ -1090,28 +1108,28 @@ msgid "" "If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:843 +#: ../../library/threading.rst:861 msgid "" "The optional argument gives the initial *value* for the internal counter; it " "defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is " "raised." msgstr "" -#: ../../library/threading.rst:852 +#: ../../library/threading.rst:870 msgid "Acquire a semaphore." msgstr "" -#: ../../library/threading.rst:854 +#: ../../library/threading.rst:872 msgid "When invoked without arguments:" msgstr "" -#: ../../library/threading.rst:856 +#: ../../library/threading.rst:874 msgid "" "If the internal counter is larger than zero on entry, decrement it by one " "and return ``True`` immediately." msgstr "" -#: ../../library/threading.rst:858 +#: ../../library/threading.rst:876 msgid "" "If the internal counter is zero on entry, block until awoken by a call to :" "meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), " @@ -1120,32 +1138,32 @@ msgid "" "threads are awoken should not be relied on." msgstr "" -#: ../../library/threading.rst:864 +#: ../../library/threading.rst:882 msgid "" "When invoked with *blocking* set to ``False``, do not block. If a call " "without an argument would block, return ``False`` immediately; otherwise, do " "the same thing as when called without arguments, and return ``True``." msgstr "" -#: ../../library/threading.rst:868 +#: ../../library/threading.rst:886 msgid "" "When invoked with a *timeout* other than ``None``, it will block for at most " "*timeout* seconds. If acquire does not complete successfully in that " "interval, return ``False``. Return ``True`` otherwise." msgstr "" -#: ../../library/threading.rst:877 +#: ../../library/threading.rst:895 msgid "" "Release a semaphore, incrementing the internal counter by *n*. When it was " "zero on entry and other threads are waiting for it to become larger than " "zero again, wake up *n* of those threads." msgstr "" -#: ../../library/threading.rst:881 +#: ../../library/threading.rst:899 msgid "Added the *n* parameter to release multiple waiting threads at once." msgstr "" -#: ../../library/threading.rst:887 +#: ../../library/threading.rst:905 msgid "" "Class implementing bounded semaphore objects. A bounded semaphore checks to " "make sure its current value doesn't exceed its initial value. If it does, :" @@ -1154,11 +1172,11 @@ msgid "" "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" -#: ../../library/threading.rst:900 +#: ../../library/threading.rst:918 msgid ":class:`Semaphore` Example" msgstr ":class:`Semaphore` 範例" -#: ../../library/threading.rst:902 +#: ../../library/threading.rst:920 msgid "" "Semaphores are often used to guard resources with limited capacity, for " "example, a database server. In any situation where the size of the resource " @@ -1166,37 +1184,37 @@ msgid "" "threads, your main thread would initialize the semaphore::" msgstr "" -#: ../../library/threading.rst:911 +#: ../../library/threading.rst:929 msgid "" "Once spawned, worker threads call the semaphore's acquire and release " "methods when they need to connect to the server::" msgstr "" -#: ../../library/threading.rst:921 +#: ../../library/threading.rst:939 msgid "" "The use of a bounded semaphore reduces the chance that a programming error " "which causes the semaphore to be released more than it's acquired will go " "undetected." msgstr "" -#: ../../library/threading.rst:928 +#: ../../library/threading.rst:946 msgid "Event Objects" msgstr "" -#: ../../library/threading.rst:930 +#: ../../library/threading.rst:948 msgid "" "This is one of the simplest mechanisms for communication between threads: " "one thread signals an event and other threads wait for it." msgstr "" -#: ../../library/threading.rst:933 +#: ../../library/threading.rst:951 msgid "" "An event object manages an internal flag that can be set to true with the :" "meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " "method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" -#: ../../library/threading.rst:940 +#: ../../library/threading.rst:958 msgid "" "Class implementing event objects. An event manages a flag that can be set " "to true with the :meth:`~Event.set` method and reset to false with the :meth:" @@ -1204,43 +1222,43 @@ msgid "" "flag is initially false." msgstr "" -#: ../../library/threading.rst:950 +#: ../../library/threading.rst:968 msgid "Return ``True`` if and only if the internal flag is true." msgstr "" -#: ../../library/threading.rst:952 +#: ../../library/threading.rst:970 msgid "The method ``isSet`` is a deprecated alias for this method." msgstr "" -#: ../../library/threading.rst:956 +#: ../../library/threading.rst:974 msgid "" "Set the internal flag to true. All threads waiting for it to become true are " "awakened. Threads that call :meth:`wait` once the flag is true will not " "block at all." msgstr "" -#: ../../library/threading.rst:962 +#: ../../library/threading.rst:980 msgid "" "Reset the internal flag to false. Subsequently, threads calling :meth:`wait` " "will block until :meth:`.set` is called to set the internal flag to true " "again." msgstr "" -#: ../../library/threading.rst:968 +#: ../../library/threading.rst:986 msgid "" "Block until the internal flag is true. If the internal flag is true on " "entry, return immediately. Otherwise, block until another thread calls :" "meth:`.set` to set the flag to true, or until the optional timeout occurs." msgstr "" -#: ../../library/threading.rst:972 +#: ../../library/threading.rst:990 msgid "" "When the timeout argument is present and not ``None``, it should be a " "floating point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: ../../library/threading.rst:976 +#: ../../library/threading.rst:994 msgid "" "This method returns ``True`` if and only if the internal flag has been set " "to true, either before the wait call or after the wait starts, so it will " @@ -1248,11 +1266,11 @@ msgid "" "out." msgstr "" -#: ../../library/threading.rst:988 +#: ../../library/threading.rst:1006 msgid "Timer Objects" msgstr "" -#: ../../library/threading.rst:990 +#: ../../library/threading.rst:1008 msgid "" "This class represents an action that should be run only after a certain " "amount of time has passed --- a timer. :class:`Timer` is a subclass of :" @@ -1260,7 +1278,7 @@ msgid "" "threads." msgstr "" -#: ../../library/threading.rst:994 +#: ../../library/threading.rst:1012 msgid "" "Timers are started, as with threads, by calling their :meth:`~Timer.start` " "method. The timer can be stopped (before its action has begun) by calling " @@ -1269,14 +1287,14 @@ msgid "" "by the user." msgstr "" -#: ../../library/threading.rst:1000 +#: ../../library/threading.rst:1018 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/threading.rst:1011 +#: ../../library/threading.rst:1029 msgid "" "Create a timer that will run *function* with arguments *args* and keyword " "arguments *kwargs*, after *interval* seconds have passed. If *args* is " @@ -1284,17 +1302,17 @@ msgid "" "``None`` (the default) then an empty dict will be used." msgstr "" -#: ../../library/threading.rst:1021 +#: ../../library/threading.rst:1039 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" -#: ../../library/threading.rst:1026 +#: ../../library/threading.rst:1044 msgid "Barrier Objects" msgstr "" -#: ../../library/threading.rst:1030 +#: ../../library/threading.rst:1048 msgid "" "This class provides a simple synchronization primitive for use by a fixed " "number of threads that need to wait for each other. Each of the threads " @@ -1303,18 +1321,18 @@ msgid "" "calls. At this point, the threads are released simultaneously." msgstr "" -#: ../../library/threading.rst:1036 +#: ../../library/threading.rst:1054 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" -#: ../../library/threading.rst:1038 +#: ../../library/threading.rst:1056 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" -#: ../../library/threading.rst:1058 +#: ../../library/threading.rst:1076 msgid "" "Create a barrier object for *parties* number of threads. An *action*, when " "provided, is a callable to be called by one of the threads when they are " @@ -1322,7 +1340,7 @@ msgid "" "the :meth:`wait` method." msgstr "" -#: ../../library/threading.rst:1065 +#: ../../library/threading.rst:1083 msgid "" "Pass the barrier. When all the threads party to the barrier have called " "this function, they are all released simultaneously. If a *timeout* is " @@ -1330,44 +1348,44 @@ msgid "" "constructor." msgstr "" -#: ../../library/threading.rst:1070 +#: ../../library/threading.rst:1088 msgid "" "The return value is an integer in the range 0 to *parties* -- 1, different " "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" -#: ../../library/threading.rst:1079 +#: ../../library/threading.rst:1097 msgid "" "If an *action* was provided to the constructor, one of the threads will have " "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1083 +#: ../../library/threading.rst:1101 msgid "If the call times out, the barrier is put into the broken state." msgstr "" -#: ../../library/threading.rst:1085 +#: ../../library/threading.rst:1103 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" -#: ../../library/threading.rst:1090 +#: ../../library/threading.rst:1108 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: ../../library/threading.rst:1093 +#: ../../library/threading.rst:1111 msgid "" "Note that using this function may require some external synchronization if " "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" -#: ../../library/threading.rst:1099 +#: ../../library/threading.rst:1117 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " @@ -1375,36 +1393,36 @@ msgid "" "application." msgstr "" -#: ../../library/threading.rst:1104 +#: ../../library/threading.rst:1122 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" -#: ../../library/threading.rst:1110 +#: ../../library/threading.rst:1128 msgid "The number of threads required to pass the barrier." msgstr "" -#: ../../library/threading.rst:1114 +#: ../../library/threading.rst:1132 msgid "The number of threads currently waiting in the barrier." msgstr "" -#: ../../library/threading.rst:1118 +#: ../../library/threading.rst:1136 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: ../../library/threading.rst:1123 +#: ../../library/threading.rst:1141 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: ../../library/threading.rst:1130 +#: ../../library/threading.rst:1148 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" -#: ../../library/threading.rst:1132 +#: ../../library/threading.rst:1150 msgid "" "All of the objects provided by this module that have :meth:`acquire` and :" "meth:`release` methods can be used as context managers for a :keyword:`with` " @@ -1413,25 +1431,25 @@ msgid "" "Hence, the following snippet::" msgstr "" -#: ../../library/threading.rst:1141 +#: ../../library/threading.rst:1159 msgid "is equivalent to::" msgstr "" -#: ../../library/threading.rst:1149 +#: ../../library/threading.rst:1167 msgid "" "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" "`with` statement context managers." msgstr "" -#: ../../library/threading.rst:155 ../../library/threading.rst:164 +#: ../../library/threading.rst:155 ../../library/threading.rst:173 msgid "trace function" msgstr "" -#: ../../library/threading.rst:164 +#: ../../library/threading.rst:173 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/threading.rst:175 ../../library/threading.rst:184 +#: ../../library/threading.rst:184 ../../library/threading.rst:202 msgid "profile function" msgstr "" diff --git a/library/token.po b/library/token.po index 91b5da5daa..11985c4d6f 100644 --- a/library/token.po +++ b/library/token.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -252,17 +252,21 @@ msgstr "" msgid "Token value for ``\":=\"``." msgstr "" +#: ../../library/token-list.inc:206 +msgid "Token value for ``\"!\"``." +msgstr "" + #: ../../library/token.rst:49 msgid "" "The following token type values aren't used by the C tokenizer but are " "needed for the :mod:`tokenize` module." msgstr "" -#: ../../library/token.rst:54 +#: ../../library/token.rst:55 msgid "Token value used to indicate a comment." msgstr "" -#: ../../library/token.rst:59 +#: ../../library/token.rst:61 msgid "" "Token value used to indicate a non-terminating newline. The :data:`NEWLINE` " "token indicates the end of a logical line of Python code; ``NL`` tokens are " @@ -270,35 +274,35 @@ msgid "" "lines." msgstr "" -#: ../../library/token.rst:67 +#: ../../library/token.rst:69 msgid "" "Token value that indicates the encoding used to decode the source bytes into " "text. The first token returned by :func:`tokenize.tokenize` will always be " "an ``ENCODING`` token." msgstr "" -#: ../../library/token.rst:75 +#: ../../library/token.rst:77 msgid "" "Token value indicating that a type comment was recognized. Such tokens are " "only produced when :func:`ast.parse()` is invoked with " "``type_comments=True``." msgstr "" -#: ../../library/token.rst:80 +#: ../../library/token.rst:82 msgid "Added :data:`AWAIT` and :data:`ASYNC` tokens." msgstr "" -#: ../../library/token.rst:83 +#: ../../library/token.rst:85 msgid "Added :data:`COMMENT`, :data:`NL` and :data:`ENCODING` tokens." msgstr "" -#: ../../library/token.rst:86 +#: ../../library/token.rst:88 msgid "" "Removed :data:`AWAIT` and :data:`ASYNC` tokens. \"async\" and \"await\" are " "now tokenized as :data:`NAME` tokens." msgstr "" -#: ../../library/token.rst:90 +#: ../../library/token.rst:92 msgid "" "Added :data:`TYPE_COMMENT`, :data:`TYPE_IGNORE`, :data:`COLONEQUAL`. Added :" "data:`AWAIT` and :data:`ASYNC` tokens back (they're needed to support " diff --git a/library/tokenize.po b/library/tokenize.po index 0090e91077..431c129a23 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-10 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,56 +212,49 @@ msgstr "" "\n" "::" -#: ../../library/tokenize.rst:151 -msgid "" -"Note that unclosed single-quoted strings do not cause an error to be raised. " -"They are tokenized as :data:`~token.ERRORTOKEN`, followed by the " -"tokenization of their contents." -msgstr "" - -#: ../../library/tokenize.rst:159 +#: ../../library/tokenize.rst:154 msgid "Command-Line Usage" msgstr "" -#: ../../library/tokenize.rst:163 +#: ../../library/tokenize.rst:158 msgid "" "The :mod:`tokenize` module can be executed as a script from the command " "line. It is as simple as:" msgstr "" -#: ../../library/tokenize.rst:170 +#: ../../library/tokenize.rst:165 msgid "The following options are accepted:" msgstr "" -#: ../../library/tokenize.rst:176 +#: ../../library/tokenize.rst:171 msgid "show this help message and exit" msgstr "" -#: ../../library/tokenize.rst:180 +#: ../../library/tokenize.rst:175 msgid "display token names using the exact type" msgstr "" -#: ../../library/tokenize.rst:182 +#: ../../library/tokenize.rst:177 msgid "" "If :file:`filename.py` is specified its contents are tokenized to stdout. " "Otherwise, tokenization is performed on stdin." msgstr "" -#: ../../library/tokenize.rst:186 +#: ../../library/tokenize.rst:181 msgid "Examples" msgstr "範例" -#: ../../library/tokenize.rst:188 +#: ../../library/tokenize.rst:183 msgid "" "Example of a script rewriter that transforms float literals into Decimal " "objects::" msgstr "" -#: ../../library/tokenize.rst:230 +#: ../../library/tokenize.rst:225 msgid "Example of tokenizing from the command line. The script::" msgstr "" -#: ../../library/tokenize.rst:237 +#: ../../library/tokenize.rst:232 msgid "" "will be tokenized to the following output where the first column is the " "range of the line/column coordinates where the token is found, the second " @@ -269,17 +262,17 @@ msgid "" "token (if any)" msgstr "" -#: ../../library/tokenize.rst:265 +#: ../../library/tokenize.rst:260 msgid "" "The exact token type names can be displayed using the :option:`-e` option:" msgstr "" -#: ../../library/tokenize.rst:291 +#: ../../library/tokenize.rst:286 msgid "" "Example of tokenizing a file programmatically, reading unicode strings " "instead of bytes with :func:`generate_tokens`::" msgstr "" -#: ../../library/tokenize.rst:301 +#: ../../library/tokenize.rst:296 msgid "Or reading bytes directly with :func:`.tokenize`::" msgstr "" diff --git a/library/traceback.po b/library/traceback.po index b3a048cbcb..fc9931a2fe 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -74,7 +74,7 @@ msgid "" "the output." msgstr "" -#: ../../library/traceback.rst:41 ../../library/traceback.rst:104 +#: ../../library/traceback.rst:41 ../../library/traceback.rst:103 msgid "Added negative *limit* support." msgstr "" @@ -117,11 +117,11 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:73 ../../library/traceback.rst:166 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:165 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:76 ../../library/traceback.rst:153 +#: ../../library/traceback.rst:76 ../../library/traceback.rst:152 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" @@ -134,12 +134,12 @@ msgstr "" #: ../../library/traceback.rst:89 msgid "" -"This is a shorthand for ``print_exception(sys.last_type, sys.last_value, sys." -"last_traceback, limit, file, chain)``. In general it will work only after " -"an exception has reached an interactive prompt (see :data:`sys.last_type`)." +"This is a shorthand for ``print_exception(sys.last_exc, limit, file, " +"chain)``. In general it will work only after an exception has reached an " +"interactive prompt (see :data:`sys.last_exc`)." msgstr "" -#: ../../library/traceback.rst:97 +#: ../../library/traceback.rst:96 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -148,7 +148,7 @@ msgid "" "optional *file* argument has the same meaning as for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:110 +#: ../../library/traceback.rst:109 msgid "" "Return a :class:`StackSummary` object representing a list of \"pre-" "processed\" stack trace entries extracted from the traceback object *tb*. " @@ -162,14 +162,14 @@ msgid "" "stripped; if the source is not available it is ``None``." msgstr "" -#: ../../library/traceback.rst:124 +#: ../../library/traceback.rst:123 msgid "" "Extract the raw traceback from the current stack frame. The return value " "has the same format as for :func:`extract_tb`. The optional *f* and *limit* " "arguments have the same meaning as for :func:`print_stack`." msgstr "" -#: ../../library/traceback.rst:131 +#: ../../library/traceback.rst:130 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -179,7 +179,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:141 +#: ../../library/traceback.rst:140 msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " @@ -190,14 +190,14 @@ msgid "" "the list." msgstr "" -#: ../../library/traceback.rst:149 +#: ../../library/traceback.rst:148 msgid "" "Since Python 3.10, instead of passing *value*, an exception object can be " "passed as the first argument. If *value* is provided, the first argument is " "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:160 +#: ../../library/traceback.rst:159 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +206,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:169 +#: ../../library/traceback.rst:168 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:176 +#: ../../library/traceback.rst:175 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:182 +#: ../../library/traceback.rst:181 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:187 +#: ../../library/traceback.rst:186 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:191 +#: ../../library/traceback.rst:190 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:198 +#: ../../library/traceback.rst:197 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:206 +#: ../../library/traceback.rst:205 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:211 +#: ../../library/traceback.rst:210 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:214 +#: ../../library/traceback.rst:213 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:218 +#: ../../library/traceback.rst:217 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:223 ../../library/traceback.rst:311 +#: ../../library/traceback.rst:222 ../../library/traceback.rst:310 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:226 +#: ../../library/traceback.rst:225 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,12 +273,12 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:231 ../../library/traceback.rst:314 +#: ../../library/traceback.rst:230 ../../library/traceback.rst:313 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:233 +#: ../../library/traceback.rst:232 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -287,140 +287,140 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:241 +#: ../../library/traceback.rst:240 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:245 +#: ../../library/traceback.rst:244 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:249 +#: ../../library/traceback.rst:248 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:257 +#: ../../library/traceback.rst:256 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:261 +#: ../../library/traceback.rst:260 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:269 +#: ../../library/traceback.rst:268 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:273 +#: ../../library/traceback.rst:272 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:277 +#: ../../library/traceback.rst:276 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:281 +#: ../../library/traceback.rst:280 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:285 +#: ../../library/traceback.rst:284 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:292 +#: ../../library/traceback.rst:291 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:296 +#: ../../library/traceback.rst:295 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:300 +#: ../../library/traceback.rst:299 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:307 +#: ../../library/traceback.rst:306 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:318 +#: ../../library/traceback.rst:317 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:325 +#: ../../library/traceback.rst:324 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:327 +#: ../../library/traceback.rst:326 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:330 +#: ../../library/traceback.rst:329 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:334 ../../library/traceback.rst:348 +#: ../../library/traceback.rst:333 ../../library/traceback.rst:347 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:339 +#: ../../library/traceback.rst:338 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:341 +#: ../../library/traceback.rst:340 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:343 +#: ../../library/traceback.rst:342 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:351 +#: ../../library/traceback.rst:350 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:354 +#: ../../library/traceback.rst:353 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "" -#: ../../library/traceback.rst:359 +#: ../../library/traceback.rst:358 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:363 +#: ../../library/traceback.rst:362 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:369 +#: ../../library/traceback.rst:368 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:373 +#: ../../library/traceback.rst:372 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -430,14 +430,20 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:383 +#: ../../library/traceback.rst:380 +msgid "" +"Exceptions raised from :func:`repr` on a local variable (when " +"*capture_locals* is ``True``) are no longer propagated to the caller." +msgstr "" + +#: ../../library/traceback.rst:386 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:389 +#: ../../library/traceback.rst:392 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -445,18 +451,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:394 +#: ../../library/traceback.rst:397 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:398 +#: ../../library/traceback.rst:401 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:403 +#: ../../library/traceback.rst:406 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -464,16 +470,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:412 +#: ../../library/traceback.rst:415 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:416 +#: ../../library/traceback.rst:419 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:420 +#: ../../library/traceback.rst:423 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -486,11 +492,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:433 +#: ../../library/traceback.rst:436 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:435 +#: ../../library/traceback.rst:438 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -498,23 +504,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:457 +#: ../../library/traceback.rst:460 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:492 +#: ../../library/traceback.rst:495 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:534 +#: ../../library/traceback.rst:537 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:560 +#: ../../library/traceback.rst:563 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/library/tty.po b/library/tty.po index 8899a84f07..80cf99694c 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,26 +46,42 @@ msgstr ":mod:`tty` 模組定義了以下函式:" #: ../../library/tty.rst:25 msgid "" +"Convert the tty attribute list *mode*, which is a list like the one returned " +"by :func:`termios.tcgetattr`, to that of a tty in raw mode." +msgstr "" + +#: ../../library/tty.rst:33 +msgid "" +"Convert the tty attribute list *mode*, which is a list like the one returned " +"by :func:`termios.tcgetattr`, to that of a tty in cbreak mode." +msgstr "" + +#: ../../library/tty.rst:41 +#, fuzzy +msgid "" "Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it " "defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios." -"tcsetattr`." +"tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before " +"setting *fd* to raw mode; this value is returned." msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:32 +#: ../../library/tty.rst:49 +#, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " "defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios." -"tcsetattr`." +"tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before " +"setting *fd* to cbreak mode; this value is returned." msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:39 +#: ../../library/tty.rst:57 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:40 +#: ../../library/tty.rst:58 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/turtle.po b/library/turtle.po index 9277d4a28c..4e18c0b85c 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-14 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,11 +165,11 @@ msgstr "" msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:132 ../../library/turtle.rst:242 +#: ../../library/turtle.rst:133 ../../library/turtle.rst:243 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:120 +#: ../../library/turtle.rst:121 msgid "Move and draw" msgstr "" @@ -193,6 +193,11 @@ msgstr ":func:`left` | :func:`lt`" msgid ":func:`goto` | :func:`setpos` | :func:`setposition`" msgstr ":func:`goto` | :func:`setpos` | :func:`setposition`" +#: ../../library/turtle.rst:0 +#, fuzzy +msgid ":func:`teleport`" +msgstr ":func:`tilt`" + #: ../../library/turtle.rst:0 msgid ":func:`setx`" msgstr ":func:`setx`" @@ -209,7 +214,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2498 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -217,7 +222,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2476 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -237,7 +242,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:128 ../../library/turtle.rst:644 +#: ../../library/turtle.rst:129 ../../library/turtle.rst:675 msgid "Tell Turtle's state" msgstr "" @@ -265,7 +270,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:132 +#: ../../library/turtle.rst:133 msgid "Setting and measurement" msgstr "" @@ -277,11 +282,11 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:155 ../../library/turtle.rst:795 +#: ../../library/turtle.rst:156 ../../library/turtle.rst:826 msgid "Pen control" msgstr "" -#: ../../library/turtle.rst:140 ../../library/turtle.rst:798 +#: ../../library/turtle.rst:141 ../../library/turtle.rst:829 msgid "Drawing state" msgstr "" @@ -305,7 +310,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:145 ../../library/turtle.rst:890 +#: ../../library/turtle.rst:146 ../../library/turtle.rst:921 msgid "Color control" msgstr "" @@ -321,7 +326,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:150 ../../library/turtle.rst:1022 +#: ../../library/turtle.rst:151 ../../library/turtle.rst:1053 msgid "Filling" msgstr "" @@ -337,7 +342,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:155 ../../library/turtle.rst:1069 +#: ../../library/turtle.rst:156 ../../library/turtle.rst:1100 msgid "More drawing control" msgstr "" @@ -353,11 +358,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:172 ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:173 ../../library/turtle.rst:1146 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:161 ../../library/turtle.rst:1118 +#: ../../library/turtle.rst:162 ../../library/turtle.rst:1149 msgid "Visibility" msgstr "" @@ -373,7 +378,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:172 ../../library/turtle.rst:1157 +#: ../../library/turtle.rst:173 ../../library/turtle.rst:1188 msgid "Appearance" msgstr "" @@ -413,11 +418,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:177 ../../library/turtle.rst:1362 +#: ../../library/turtle.rst:178 ../../library/turtle.rst:1393 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2470 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -425,11 +430,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2453 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:188 ../../library/turtle.rst:1436 +#: ../../library/turtle.rst:189 ../../library/turtle.rst:1467 msgid "Special Turtle methods" msgstr "" @@ -445,7 +450,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2492 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -465,11 +470,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:191 +#: ../../library/turtle.rst:192 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:199 ../../library/turtle.rst:1590 +#: ../../library/turtle.rst:200 ../../library/turtle.rst:1621 msgid "Window control" msgstr "" @@ -497,7 +502,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:204 ../../library/turtle.rst:1713 +#: ../../library/turtle.rst:205 ../../library/turtle.rst:1744 msgid "Animation control" msgstr "" @@ -513,7 +518,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:212 ../../library/turtle.rst:1766 +#: ../../library/turtle.rst:213 ../../library/turtle.rst:1797 msgid "Using screen events" msgstr "" @@ -541,7 +546,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:222 ../../library/turtle.rst:1911 +#: ../../library/turtle.rst:223 ../../library/turtle.rst:1942 msgid "Settings and special methods" msgstr "" @@ -577,7 +582,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:226 ../../library/turtle.rst:1875 +#: ../../library/turtle.rst:227 ../../library/turtle.rst:1906 msgid "Input methods" msgstr "" @@ -589,7 +594,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:233 +#: ../../library/turtle.rst:234 msgid "Methods specific to Screen" msgstr "" @@ -609,11 +614,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:236 +#: ../../library/turtle.rst:237 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:238 +#: ../../library/turtle.rst:239 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -623,135 +628,150 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:247 ../../library/turtle.rst:292 -#: ../../library/turtle.rst:317 ../../library/turtle.rst:377 -#: ../../library/turtle.rst:400 ../../library/turtle.rst:423 +#: ../../library/turtle.rst:248 ../../library/turtle.rst:293 +#: ../../library/turtle.rst:318 ../../library/turtle.rst:416 +#: ../../library/turtle.rst:439 ../../library/turtle.rst:462 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:249 +#: ../../library/turtle.rst:250 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:269 ../../library/turtle.rst:473 -#: ../../library/turtle.rst:748 ../../library/turtle.rst:1256 -#: ../../library/turtle.rst:1275 +#: ../../library/turtle.rst:270 ../../library/turtle.rst:512 +#: ../../library/turtle.rst:779 ../../library/turtle.rst:1287 +#: ../../library/turtle.rst:1306 msgid "a number" msgstr "" -#: ../../library/turtle.rst:271 +#: ../../library/turtle.rst:272 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:294 +#: ../../library/turtle.rst:295 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:319 +#: ../../library/turtle.rst:320 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:343 +#: ../../library/turtle.rst:344 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:344 +#: ../../library/turtle.rst:345 ../../library/turtle.rst:378 +#: ../../library/turtle.rst:379 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:346 +#: ../../library/turtle.rst:347 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:349 +#: ../../library/turtle.rst:350 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:379 +#: ../../library/turtle.rst:380 +msgid "a boolean" +msgstr "" + +#: ../../library/turtle.rst:382 +msgid "" +"Move turtle to an absolute position. Unlike goto(x, y), a line will not be " +"drawn. The turtle's orientation does not change. If currently filling, the " +"polygon(s) teleported from will be filled after leaving, and filling will " +"begin again after teleporting. This can be disabled with fill_gap=True, " +"which makes the imaginary line traveled during teleporting act as a fill " +"barrier like in goto(x, y)." +msgstr "" + +#: ../../library/turtle.rst:418 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:402 +#: ../../library/turtle.rst:441 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:425 +#: ../../library/turtle.rst:464 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:429 +#: ../../library/turtle.rst:468 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:429 +#: ../../library/turtle.rst:468 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:431 +#: ../../library/turtle.rst:470 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:431 +#: ../../library/turtle.rst:470 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:432 +#: ../../library/turtle.rst:471 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:432 +#: ../../library/turtle.rst:471 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:433 +#: ../../library/turtle.rst:472 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:433 +#: ../../library/turtle.rst:472 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:434 +#: ../../library/turtle.rst:473 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:434 +#: ../../library/turtle.rst:473 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:447 +#: ../../library/turtle.rst:486 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:474 +#: ../../library/turtle.rst:513 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:475 ../../library/turtle.rst:569 +#: ../../library/turtle.rst:514 ../../library/turtle.rst:607 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:477 +#: ../../library/turtle.rst:516 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -762,117 +782,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:485 +#: ../../library/turtle.rst:524 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:511 +#: ../../library/turtle.rst:550 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:512 +#: ../../library/turtle.rst:551 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:514 +#: ../../library/turtle.rst:553 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:532 +#: ../../library/turtle.rst:571 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:547 +#: ../../library/turtle.rst:585 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:550 +#: ../../library/turtle.rst:588 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:571 +#: ../../library/turtle.rst:609 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:594 +#: ../../library/turtle.rst:625 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:609 +#: ../../library/turtle.rst:640 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:611 +#: ../../library/turtle.rst:642 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:614 +#: ../../library/turtle.rst:645 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:617 +#: ../../library/turtle.rst:648 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:618 +#: ../../library/turtle.rst:649 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:619 +#: ../../library/turtle.rst:650 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:620 +#: ../../library/turtle.rst:651 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:621 +#: ../../library/turtle.rst:652 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:623 +#: ../../library/turtle.rst:654 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:626 +#: ../../library/turtle.rst:657 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:649 +#: ../../library/turtle.rst:680 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:660 ../../library/turtle.rst:723 +#: ../../library/turtle.rst:691 ../../library/turtle.rst:754 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:661 ../../library/turtle.rst:724 +#: ../../library/turtle.rst:692 ../../library/turtle.rst:755 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:663 +#: ../../library/turtle.rst:694 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -880,116 +900,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:677 +#: ../../library/turtle.rst:708 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:693 +#: ../../library/turtle.rst:724 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:709 +#: ../../library/turtle.rst:740 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:726 +#: ../../library/turtle.rst:757 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:744 +#: ../../library/turtle.rst:775 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:750 +#: ../../library/turtle.rst:781 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:773 +#: ../../library/turtle.rst:804 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:804 +#: ../../library/turtle.rst:835 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:811 +#: ../../library/turtle.rst:842 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:817 +#: ../../library/turtle.rst:848 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:819 +#: ../../library/turtle.rst:850 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:833 +#: ../../library/turtle.rst:864 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:834 +#: ../../library/turtle.rst:865 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:836 +#: ../../library/turtle.rst:867 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:839 +#: ../../library/turtle.rst:870 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:840 +#: ../../library/turtle.rst:871 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:841 +#: ../../library/turtle.rst:872 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:842 +#: ../../library/turtle.rst:873 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:843 +#: ../../library/turtle.rst:874 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:844 +#: ../../library/turtle.rst:875 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:845 +#: ../../library/turtle.rst:876 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:846 +#: ../../library/turtle.rst:877 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:847 +#: ../../library/turtle.rst:878 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:848 +#: ../../library/turtle.rst:879 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:850 +#: ../../library/turtle.rst:881 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -997,182 +1017,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:876 +#: ../../library/turtle.rst:907 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:894 +#: ../../library/turtle.rst:925 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:896 ../../library/turtle.rst:945 +#: ../../library/turtle.rst:927 ../../library/turtle.rst:976 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:901 +#: ../../library/turtle.rst:932 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:899 +#: ../../library/turtle.rst:930 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:905 +#: ../../library/turtle.rst:936 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:904 +#: ../../library/turtle.rst:935 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:910 +#: ../../library/turtle.rst:941 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:908 +#: ../../library/turtle.rst:939 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:914 +#: ../../library/turtle.rst:945 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:913 +#: ../../library/turtle.rst:944 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:916 +#: ../../library/turtle.rst:947 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:943 +#: ../../library/turtle.rst:974 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:950 +#: ../../library/turtle.rst:981 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:948 +#: ../../library/turtle.rst:979 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:954 +#: ../../library/turtle.rst:985 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:953 +#: ../../library/turtle.rst:984 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:959 +#: ../../library/turtle.rst:990 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:957 +#: ../../library/turtle.rst:988 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:963 +#: ../../library/turtle.rst:994 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:962 +#: ../../library/turtle.rst:993 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:965 +#: ../../library/turtle.rst:996 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:986 +#: ../../library/turtle.rst:1017 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:988 +#: ../../library/turtle.rst:1019 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:994 +#: ../../library/turtle.rst:1025 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:992 +#: ../../library/turtle.rst:1023 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:998 +#: ../../library/turtle.rst:1029 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:997 +#: ../../library/turtle.rst:1028 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1002 +#: ../../library/turtle.rst:1033 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1001 +#: ../../library/turtle.rst:1032 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1004 +#: ../../library/turtle.rst:1035 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1018 +#: ../../library/turtle.rst:1049 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1032 +#: ../../library/turtle.rst:1063 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1047 +#: ../../library/turtle.rst:1078 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1052 +#: ../../library/turtle.rst:1083 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1054 +#: ../../library/turtle.rst:1085 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1180,36 +1200,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1073 +#: ../../library/turtle.rst:1104 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1094 +#: ../../library/turtle.rst:1125 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1100 +#: ../../library/turtle.rst:1131 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1101 +#: ../../library/turtle.rst:1132 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1102 +#: ../../library/turtle.rst:1133 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1103 +#: ../../library/turtle.rst:1134 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1105 +#: ../../library/turtle.rst:1136 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1217,26 +1237,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1123 +#: ../../library/turtle.rst:1154 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1136 +#: ../../library/turtle.rst:1167 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1146 +#: ../../library/turtle.rst:1177 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1161 +#: ../../library/turtle.rst:1192 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1163 +#: ../../library/turtle.rst:1194 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1246,45 +1266,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1181 +#: ../../library/turtle.rst:1212 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1183 +#: ../../library/turtle.rst:1214 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1187 +#: ../../library/turtle.rst:1218 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1188 +#: ../../library/turtle.rst:1219 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1191 +#: ../../library/turtle.rst:1222 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1193 +#: ../../library/turtle.rst:1224 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1208 ../../library/turtle.rst:1209 -#: ../../library/turtle.rst:1210 +#: ../../library/turtle.rst:1239 ../../library/turtle.rst:1240 +#: ../../library/turtle.rst:1241 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1212 +#: ../../library/turtle.rst:1243 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1294,12 +1314,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1235 ../../library/turtle.rst:1894 -#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 +#: ../../library/turtle.rst:1266 ../../library/turtle.rst:1925 +#: ../../library/turtle.rst:1926 ../../library/turtle.rst:1927 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1237 +#: ../../library/turtle.rst:1268 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1308,26 +1328,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1258 +#: ../../library/turtle.rst:1289 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1277 +#: ../../library/turtle.rst:1308 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1297 ../../library/turtle.rst:1320 -#: ../../library/turtle.rst:1321 ../../library/turtle.rst:1322 -#: ../../library/turtle.rst:1323 +#: ../../library/turtle.rst:1328 ../../library/turtle.rst:1351 +#: ../../library/turtle.rst:1352 ../../library/turtle.rst:1353 +#: ../../library/turtle.rst:1354 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1299 +#: ../../library/turtle.rst:1330 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1337,11 +1357,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1325 +#: ../../library/turtle.rst:1356 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1327 +#: ../../library/turtle.rst:1358 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1351,101 +1371,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1349 +#: ../../library/turtle.rst:1380 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1367 ../../library/turtle.rst:1389 -#: ../../library/turtle.rst:1414 ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1398 ../../library/turtle.rst:1420 +#: ../../library/turtle.rst:1445 ../../library/turtle.rst:1849 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1369 ../../library/turtle.rst:1391 -#: ../../library/turtle.rst:1416 ../../library/turtle.rst:1820 +#: ../../library/turtle.rst:1400 ../../library/turtle.rst:1422 +#: ../../library/turtle.rst:1447 ../../library/turtle.rst:1851 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1370 ../../library/turtle.rst:1392 -#: ../../library/turtle.rst:1417 ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1401 ../../library/turtle.rst:1423 +#: ../../library/turtle.rst:1448 ../../library/turtle.rst:1852 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1373 +#: ../../library/turtle.rst:1404 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1426 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1420 +#: ../../library/turtle.rst:1451 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1423 +#: ../../library/turtle.rst:1454 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1431 +#: ../../library/turtle.rst:1462 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1440 +#: ../../library/turtle.rst:1471 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1446 +#: ../../library/turtle.rst:1477 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1452 +#: ../../library/turtle.rst:1483 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1471 +#: ../../library/turtle.rst:1502 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1484 +#: ../../library/turtle.rst:1515 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1498 +#: ../../library/turtle.rst:1529 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1512 +#: ../../library/turtle.rst:1543 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1514 +#: ../../library/turtle.rst:1545 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1453,71 +1473,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1527 +#: ../../library/turtle.rst:1558 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1540 +#: ../../library/turtle.rst:1571 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1542 +#: ../../library/turtle.rst:1573 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1546 +#: ../../library/turtle.rst:1577 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1547 +#: ../../library/turtle.rst:1578 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1550 +#: ../../library/turtle.rst:1581 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1561 +#: ../../library/turtle.rst:1592 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1572 +#: ../../library/turtle.rst:1603 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1609 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1580 +#: ../../library/turtle.rst:1611 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:1625 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1629 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1613 +#: ../../library/turtle.rst:1644 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1615 +#: ../../library/turtle.rst:1646 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1525,44 +1545,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1631 +#: ../../library/turtle.rst:1662 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1638 +#: ../../library/turtle.rst:1669 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1647 +#: ../../library/turtle.rst:1678 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1654 +#: ../../library/turtle.rst:1685 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1659 +#: ../../library/turtle.rst:1690 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1660 +#: ../../library/turtle.rst:1691 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1661 +#: ../../library/turtle.rst:1692 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1663 +#: ../../library/turtle.rst:1694 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1571,59 +1591,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1675 +#: ../../library/turtle.rst:1706 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1680 +#: ../../library/turtle.rst:1711 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1681 +#: ../../library/turtle.rst:1712 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1682 +#: ../../library/turtle.rst:1713 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1683 +#: ../../library/turtle.rst:1714 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1716 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1689 +#: ../../library/turtle.rst:1720 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1717 +#: ../../library/turtle.rst:1748 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1750 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1723 +#: ../../library/turtle.rst:1754 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1737 ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1768 ../../library/turtle.rst:1769 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1740 +#: ../../library/turtle.rst:1771 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1632,75 +1652,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1760 +#: ../../library/turtle.rst:1791 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1762 +#: ../../library/turtle.rst:1793 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1770 +#: ../../library/turtle.rst:1801 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1777 ../../library/turtle.rst:1797 +#: ../../library/turtle.rst:1808 ../../library/turtle.rst:1828 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1778 ../../library/turtle.rst:1798 +#: ../../library/turtle.rst:1809 ../../library/turtle.rst:1829 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1780 +#: ../../library/turtle.rst:1811 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1800 +#: ../../library/turtle.rst:1831 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1824 +#: ../../library/turtle.rst:1855 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1827 +#: ../../library/turtle.rst:1858 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:1869 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:1845 +#: ../../library/turtle.rst:1876 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:1846 +#: ../../library/turtle.rst:1877 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:1848 +#: ../../library/turtle.rst:1879 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:1866 +#: ../../library/turtle.rst:1897 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1708,12 +1728,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:1879 ../../library/turtle.rst:1880 -#: ../../library/turtle.rst:1892 ../../library/turtle.rst:1893 +#: ../../library/turtle.rst:1910 ../../library/turtle.rst:1911 +#: ../../library/turtle.rst:1923 ../../library/turtle.rst:1924 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:1882 +#: ../../library/turtle.rst:1913 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1721,7 +1741,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:1929 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1732,17 +1752,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:1915 +#: ../../library/turtle.rst:1946 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:1917 +#: ../../library/turtle.rst:1948 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:1920 +#: ../../library/turtle.rst:1951 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1750,121 +1770,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1957 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1957 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1957 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1959 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1959 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:1959 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1960 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1960 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:1960 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:1942 +#: ../../library/turtle.rst:1973 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:1944 +#: ../../library/turtle.rst:1975 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:1965 +#: ../../library/turtle.rst:1996 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:1978 +#: ../../library/turtle.rst:2009 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:1990 +#: ../../library/turtle.rst:2021 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:1992 +#: ../../library/turtle.rst:2023 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:1998 +#: ../../library/turtle.rst:2029 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2001 +#: ../../library/turtle.rst:2032 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2009 +#: ../../library/turtle.rst:2040 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2012 +#: ../../library/turtle.rst:2043 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2018 +#: ../../library/turtle.rst:2049 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2029 +#: ../../library/turtle.rst:2060 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2037 +#: ../../library/turtle.rst:2068 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2046 +#: ../../library/turtle.rst:2077 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2050 +#: ../../library/turtle.rst:2081 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2055 +#: ../../library/turtle.rst:2086 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2058 +#: ../../library/turtle.rst:2089 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -1873,246 +1893,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2067 +#: ../../library/turtle.rst:2098 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2071 +#: ../../library/turtle.rst:2102 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2073 +#: ../../library/turtle.rst:2104 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2075 +#: ../../library/turtle.rst:2106 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2078 +#: ../../library/turtle.rst:2109 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2093 +#: ../../library/turtle.rst:2124 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2096 +#: ../../library/turtle.rst:2127 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2105 +#: ../../library/turtle.rst:2136 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2111 +#: ../../library/turtle.rst:2142 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2114 +#: ../../library/turtle.rst:2145 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2120 +#: ../../library/turtle.rst:2151 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2126 +#: ../../library/turtle.rst:2157 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2128 +#: ../../library/turtle.rst:2159 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2133 +#: ../../library/turtle.rst:2164 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2138 +#: ../../library/turtle.rst:2169 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2141 +#: ../../library/turtle.rst:2172 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2146 +#: ../../library/turtle.rst:2177 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2148 +#: ../../library/turtle.rst:2179 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2184 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2153 +#: ../../library/turtle.rst:2184 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2186 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2155 +#: ../../library/turtle.rst:2186 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2187 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2187 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2188 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2188 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2163 +#: ../../library/turtle.rst:2194 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2164 +#: ../../library/turtle.rst:2195 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2165 +#: ../../library/turtle.rst:2196 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2198 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2177 +#: ../../library/turtle.rst:2208 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2182 +#: ../../library/turtle.rst:2213 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2186 +#: ../../library/turtle.rst:2217 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2188 +#: ../../library/turtle.rst:2219 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2189 +#: ../../library/turtle.rst:2220 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2190 +#: ../../library/turtle.rst:2221 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2191 +#: ../../library/turtle.rst:2222 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2192 +#: ../../library/turtle.rst:2223 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2193 +#: ../../library/turtle.rst:2224 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2197 +#: ../../library/turtle.rst:2228 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2231 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2202 +#: ../../library/turtle.rst:2233 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2206 +#: ../../library/turtle.rst:2237 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2209 +#: ../../library/turtle.rst:2240 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2240 +#: ../../library/turtle.rst:2271 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2274 +#: ../../library/turtle.rst:2305 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2279 +#: ../../library/turtle.rst:2310 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2281 +#: ../../library/turtle.rst:2312 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2287 +#: ../../library/turtle.rst:2318 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2289 +#: ../../library/turtle.rst:2320 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2121,37 +2141,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2295 +#: ../../library/turtle.rst:2326 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2299 +#: ../../library/turtle.rst:2330 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2302 +#: ../../library/turtle.rst:2333 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2308 +#: ../../library/turtle.rst:2339 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2310 +#: ../../library/turtle.rst:2341 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2344 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2160,54 +2180,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2318 +#: ../../library/turtle.rst:2349 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2374 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2376 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2378 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2380 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2351 +#: ../../library/turtle.rst:2382 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2354 +#: ../../library/turtle.rst:2385 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2356 +#: ../../library/turtle.rst:2387 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2359 +#: ../../library/turtle.rst:2390 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2215,301 +2235,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2363 +#: ../../library/turtle.rst:2394 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2367 +#: ../../library/turtle.rst:2398 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2371 +#: ../../library/turtle.rst:2402 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2377 +#: ../../library/turtle.rst:2408 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2382 +#: ../../library/turtle.rst:2413 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2387 +#: ../../library/turtle.rst:2418 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2391 +#: ../../library/turtle.rst:2422 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2393 +#: ../../library/turtle.rst:2424 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2395 +#: ../../library/turtle.rst:2426 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2429 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2401 +#: ../../library/turtle.rst:2432 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2439 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2439 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2439 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2441 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2441 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2441 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2444 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2444 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2444 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2450 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2450 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2419 +#: ../../library/turtle.rst:2450 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2453 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2453 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2455 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2455 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2455 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2457 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2457 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2457 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2459 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2459 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2459 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2462 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2462 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2431 +#: ../../library/turtle.rst:2462 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2466 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2466 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2466 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2470 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2470 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2473 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2473 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2442 +#: ../../library/turtle.rst:2473 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2476 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2476 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2479 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2479 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2448 +#: ../../library/turtle.rst:2479 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2482 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2482 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2482 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2485 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2485 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2485 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2489 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2489 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2489 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:2492 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:2492 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2495 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2495 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2495 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:2498 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2467 +#: ../../library/turtle.rst:2498 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2501 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2474 +#: ../../library/turtle.rst:2505 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2507 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2520,14 +2540,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2484 +#: ../../library/turtle.rst:2515 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2489 +#: ../../library/turtle.rst:2520 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2535,11 +2555,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2495 +#: ../../library/turtle.rst:2526 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2497 +#: ../../library/turtle.rst:2528 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2548,28 +2568,28 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2504 +#: ../../library/turtle.rst:2535 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2508 +#: ../../library/turtle.rst:2539 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2543 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2516 +#: ../../library/turtle.rst:2547 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/library/types.po b/library/types.po index c7024caa9a..c3c7b079c2 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,14 +130,33 @@ msgid "" msgstr "" #: ../../library/types.rst:87 +msgid "" +"Return the tuple of objects originally given as the bases of *cls* before " +"the :meth:`~object.__mro_entries__` method has been called on any bases " +"(following the mechanisms laid out in :pep:`560`). This is useful for " +"introspecting :ref:`Generics `." +msgstr "" + +#: ../../library/types.rst:92 +msgid "" +"For classes that have an ``__orig_bases__`` attribute, this function returns " +"the value of ``cls.__orig_bases__``. For classes without the " +"``__orig_bases__`` attribute, ``cls.__bases__`` is returned." +msgstr "" + +#: ../../library/types.rst:97 +msgid "Examples::" +msgstr "" + +#: ../../library/types.rst:127 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../library/types.rst:91 +#: ../../library/types.rst:131 msgid "Standard Interpreter Types" msgstr "" -#: ../../library/types.rst:93 +#: ../../library/types.rst:133 msgid "" "This module provides names for many of the types that are required to " "implement a Python interpreter. It deliberately avoids including some of the " @@ -145,33 +164,33 @@ msgid "" "``listiterator`` type." msgstr "" -#: ../../library/types.rst:98 +#: ../../library/types.rst:138 msgid "" "Typical use of these names is for :func:`isinstance` or :func:`issubclass` " "checks." msgstr "" -#: ../../library/types.rst:102 +#: ../../library/types.rst:142 msgid "" "If you instantiate any of these types, note that signatures may vary between " "Python versions." msgstr "" -#: ../../library/types.rst:104 +#: ../../library/types.rst:144 msgid "Standard names are defined for the following types:" msgstr "" -#: ../../library/types.rst:108 +#: ../../library/types.rst:148 msgid "The type of :data:`None`." msgstr "" -#: ../../library/types.rst:116 +#: ../../library/types.rst:156 msgid "" "The type of user-defined functions and functions created by :keyword:" "`lambda` expressions." msgstr "" -#: ../../library/types.rst:119 +#: ../../library/types.rst:159 msgid "" "Raises an :ref:`auditing event ` ``function.__new__`` with " "argument ``code``." @@ -179,35 +198,35 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``function." "__new__``。" -#: ../../library/types.rst:121 +#: ../../library/types.rst:161 msgid "" "The audit event only occurs for direct instantiation of function objects, " "and is not raised for normal compilation." msgstr "" -#: ../../library/types.rst:127 +#: ../../library/types.rst:167 msgid "" "The type of :term:`generator`-iterator objects, created by generator " "functions." msgstr "" -#: ../../library/types.rst:133 +#: ../../library/types.rst:173 msgid "" "The type of :term:`coroutine` objects, created by :keyword:`async def` " "functions." msgstr "" -#: ../../library/types.rst:141 +#: ../../library/types.rst:181 msgid "" "The type of :term:`asynchronous generator`-iterator objects, created by " "asynchronous generator functions." msgstr "" -#: ../../library/types.rst:151 +#: ../../library/types.rst:191 msgid "The type for code objects such as returned by :func:`compile`." msgstr "" -#: ../../library/types.rst:153 +#: ../../library/types.rst:193 msgid "" "Raises an :ref:`auditing event ` ``code.__new__`` with arguments " "``code``, ``filename``, ``name``, ``argcount``, ``posonlyargcount``, " @@ -217,89 +236,89 @@ msgstr "" "``posonlyargcount``、``kwonlyargcount``、``nlocals``、``stacksize``、" "``flags`` 的\\ :ref:`稽核事件 ` ``code.__new__``。" -#: ../../library/types.rst:155 +#: ../../library/types.rst:195 msgid "" "Note that the audited arguments may not match the names or positions " "required by the initializer. The audit event only occurs for direct " "instantiation of code objects, and is not raised for normal compilation." msgstr "" -#: ../../library/types.rst:161 +#: ../../library/types.rst:201 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../library/types.rst:167 +#: ../../library/types.rst:207 msgid "" "The type for cell objects: such objects are used as containers for a " "function's free variables." msgstr "" -#: ../../library/types.rst:175 +#: ../../library/types.rst:215 msgid "The type of methods of user-defined class instances." msgstr "" -#: ../../library/types.rst:181 +#: ../../library/types.rst:221 msgid "" "The type of built-in functions like :func:`len` or :func:`sys.exit`, and " "methods of built-in classes. (Here, the term \"built-in\" means \"written " "in C\".)" msgstr "" -#: ../../library/types.rst:188 +#: ../../library/types.rst:228 msgid "" "The type of methods of some built-in data types and base classes such as :" "meth:`object.__init__` or :meth:`object.__lt__`." msgstr "" -#: ../../library/types.rst:196 +#: ../../library/types.rst:236 msgid "" "The type of *bound* methods of some built-in data types and base classes. " "For example it is the type of :code:`object().__str__`." msgstr "" -#: ../../library/types.rst:204 +#: ../../library/types.rst:244 msgid "The type of :data:`NotImplemented`." msgstr "" -#: ../../library/types.rst:211 +#: ../../library/types.rst:251 msgid "" "The type of methods of some built-in data types such as :meth:`str.join`." msgstr "" -#: ../../library/types.rst:218 +#: ../../library/types.rst:258 msgid "" "The type of *unbound* class methods of some built-in data types such as " "``dict.__dict__['fromkeys']``." msgstr "" -#: ../../library/types.rst:226 +#: ../../library/types.rst:266 msgid "" "The type of :term:`modules `. The constructor takes the name of the " "module to be created and optionally its :term:`docstring`." msgstr "" -#: ../../library/types.rst:230 +#: ../../library/types.rst:270 msgid "" "Use :func:`importlib.util.module_from_spec` to create a new module if you " "wish to set the various import-controlled attributes." msgstr "" -#: ../../library/types.rst:235 +#: ../../library/types.rst:275 msgid "The :term:`docstring` of the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:239 +#: ../../library/types.rst:279 msgid "The :term:`loader` which loaded the module. Defaults to ``None``." msgstr "" -#: ../../library/types.rst:241 +#: ../../library/types.rst:281 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " "stored in the :attr:`__spec__` object." msgstr "" -#: ../../library/types.rst:245 +#: ../../library/types.rst:285 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" @@ -307,17 +326,17 @@ msgid "" "None)`` if you explicitly need to use this attribute." msgstr "" -#: ../../library/types.rst:251 ../../library/types.rst:276 +#: ../../library/types.rst:291 ../../library/types.rst:316 msgid "Defaults to ``None``. Previously the attribute was optional." msgstr "" -#: ../../library/types.rst:256 +#: ../../library/types.rst:296 msgid "" "The name of the module. Expected to match :attr:`importlib.machinery." "ModuleSpec.name`." msgstr "" -#: ../../library/types.rst:261 +#: ../../library/types.rst:301 msgid "" "Which :term:`package` a module belongs to. If the module is top-level (i.e. " "not a part of any specific package) then the attribute should be set to " @@ -325,13 +344,13 @@ msgid "" "`__name__` if the module is a package itself). Defaults to ``None``." msgstr "" -#: ../../library/types.rst:266 +#: ../../library/types.rst:306 msgid "" "This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " "stored in the :attr:`__spec__` object." msgstr "" -#: ../../library/types.rst:270 +#: ../../library/types.rst:310 msgid "" "A future version of Python may stop setting this attribute by default. To " "guard against this potential change, preferably read from the :attr:" @@ -339,79 +358,79 @@ msgid "" "None)`` if you explicitly need to use this attribute." msgstr "" -#: ../../library/types.rst:281 +#: ../../library/types.rst:321 msgid "" "A record of the module's import-system-related state. Expected to be an " "instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -#: ../../library/types.rst:289 +#: ../../library/types.rst:329 msgid "The type of :data:`Ellipsis`." msgstr "" -#: ../../library/types.rst:295 +#: ../../library/types.rst:335 msgid "" "The type of :ref:`parameterized generics ` such as " "``list[int]``." msgstr "" -#: ../../library/types.rst:298 +#: ../../library/types.rst:338 msgid "" "``t_origin`` should be a non-parameterized generic class, such as ``list``, " "``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " "length 1) of types which parameterize ``t_origin``::" msgstr "" -#: ../../library/types.rst:311 +#: ../../library/types.rst:351 msgid "This type can now be subclassed." msgstr "" -#: ../../library/types.rst:317 +#: ../../library/types.rst:357 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../library/types.rst:317 +#: ../../library/types.rst:357 msgid "In-depth documentation on instances of :class:`!types.GenericAlias`" msgstr "" -#: ../../library/types.rst:319 +#: ../../library/types.rst:359 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/types.rst:320 +#: ../../library/types.rst:360 msgid "Introducing the :class:`!types.GenericAlias` class" msgstr "" -#: ../../library/types.rst:324 +#: ../../library/types.rst:364 msgid "The type of :ref:`union type expressions`." msgstr "" -#: ../../library/types.rst:330 +#: ../../library/types.rst:370 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" -#: ../../library/types.rst:332 +#: ../../library/types.rst:372 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:339 +#: ../../library/types.rst:379 msgid "" "The type of frame objects such as found in ``tb.tb_frame`` if ``tb`` is a " "traceback object." msgstr "" -#: ../../library/types.rst:342 +#: ../../library/types.rst:382 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations." msgstr "" -#: ../../library/types.rst:348 +#: ../../library/types.rst:388 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as ``FrameType.f_locals`` or ``array.array.typecode``. This type is used as " @@ -419,7 +438,7 @@ msgid "" "`property` type, but for classes defined in extension modules." msgstr "" -#: ../../library/types.rst:356 +#: ../../library/types.rst:396 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -428,113 +447,117 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:363 +#: ../../library/types.rst:403 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:368 +#: ../../library/types.rst:408 msgid "" "Read-only proxy of a mapping. It provides a dynamic view on the mapping's " "entries, which means that when the mapping changes, the view reflects these " "changes." msgstr "" -#: ../../library/types.rst:376 +#: ../../library/types.rst:416 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:381 +#: ../../library/types.rst:421 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:386 +#: ../../library/types.rst:426 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" -#: ../../library/types.rst:391 +#: ../../library/types.rst:431 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:396 +#: ../../library/types.rst:436 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:400 +#: ../../library/types.rst:440 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:404 +#: ../../library/types.rst:444 msgid "" "Return the value for *key* if *key* is in the underlying mapping, else " "*default*. If *default* is not given, it defaults to ``None``, so that this " "method never raises a :exc:`KeyError`." msgstr "" -#: ../../library/types.rst:410 +#: ../../library/types.rst:450 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:415 +#: ../../library/types.rst:455 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:419 +#: ../../library/types.rst:459 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:423 +#: ../../library/types.rst:463 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:429 +#: ../../library/types.rst:469 +msgid "Return a hash of the underlying mapping." +msgstr "" + +#: ../../library/types.rst:475 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:433 +#: ../../library/types.rst:479 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:436 +#: ../../library/types.rst:482 msgid "" "Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " "attributes. If a ``SimpleNamespace`` object is initialized with keyword " "arguments, those are directly added to the underlying namespace." msgstr "" -#: ../../library/types.rst:440 +#: ../../library/types.rst:486 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:455 +#: ../../library/types.rst:501 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: ../../library/types.rst:461 +#: ../../library/types.rst:507 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:467 +#: ../../library/types.rst:513 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:469 +#: ../../library/types.rst:515 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -542,18 +565,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:474 +#: ../../library/types.rst:520 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: ../../library/types.rst:481 +#: ../../library/types.rst:527 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:485 +#: ../../library/types.rst:531 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -563,11 +586,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:492 +#: ../../library/types.rst:538 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:494 +#: ../../library/types.rst:540 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " @@ -575,10 +598,10 @@ msgid "" "returned as is." msgstr "" -#: ../../library/types.rst:149 +#: ../../library/types.rst:189 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/types.rst:149 +#: ../../library/types.rst:189 msgid "compile" msgstr "compile(編譯)" diff --git a/library/typing.po b/library/typing.po index 33219e2836..06f09f068e 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-16 00:22+0000\n" +"POT-Creation-Date: 2023-06-27 00:19+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-" @@ -241,7 +241,7 @@ msgstr "" msgid "*Introducing* :data:`LiteralString`" msgstr "*引入* :data:`LiteralString`" -#: ../../library/typing.rst:112 +#: ../../library/typing.rst:111 msgid ":pep:`681`: Data Class Transforms" msgstr "" @@ -250,43 +250,79 @@ msgid "" "*Introducing* the :func:`@dataclass_transform` decorator" msgstr "*引入* :func:`@dataclass_transform` 裝飾器" -#: ../../library/typing.rst:122 +#: ../../library/typing.rst:114 +msgid ":pep:`692`: Using ``TypedDict`` for more precise ``**kwargs`` typing" +msgstr "" + +#: ../../library/typing.rst:114 +msgid "" +"*Introducing* a new way of typing ``**kwargs`` with :data:`Unpack` and :data:" +"`TypedDict`" +msgstr "" + +#: ../../library/typing.rst:116 +msgid ":pep:`695`: Type Parameter Syntax" +msgstr "" + +#: ../../library/typing.rst:117 +msgid "" +"*Introducing* builtin syntax for creating generic functions, classes, and " +"type aliases." +msgstr "" + +#: ../../library/typing.rst:119 +msgid ":pep:`698`: Adding an override decorator to typing" +msgstr "" + +#: ../../library/typing.rst:119 +#, fuzzy +msgid "*Introducing* the :func:`@override` decorator" +msgstr "*引入* :func:`@dataclass_transform` 裝飾器" + +#: ../../library/typing.rst:129 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:124 +#: ../../library/typing.rst:131 msgid "" -"A type alias is defined by assigning the type to the alias. In this example, " -"``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" +"A type alias is defined using the :keyword:`type` statement, which creates " +"an instance of :class:`TypeAliasType`. In this example, ``Vector`` and " +"``list[float]`` will be treated equivalently by static type checkers::" msgstr "" -#: ../../library/typing.rst:135 +#: ../../library/typing.rst:144 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:153 +#: ../../library/typing.rst:162 msgid "" -"Type aliases may be marked with :data:`TypeAlias` to make it explicit that " -"the statement is a type alias declaration, not a normal variable assignment::" +"The :keyword:`type` statement is new in Python 3.12. For backwards " +"compatibility, type aliases can also be created through simple assignment::" msgstr "" -#: ../../library/typing.rst:163 +#: ../../library/typing.rst:167 +msgid "" +"Or marked with :data:`TypeAlias` to make it explicit that this is a type " +"alias, not a normal variable assignment::" +msgstr "" + +#: ../../library/typing.rst:177 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:165 +#: ../../library/typing.rst:179 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:172 +#: ../../library/typing.rst:186 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:184 +#: ../../library/typing.rst:198 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -294,7 +330,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:192 +#: ../../library/typing.rst:206 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -303,39 +339,39 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:198 +#: ../../library/typing.rst:212 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:201 +#: ../../library/typing.rst:215 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:210 +#: ../../library/typing.rst:224 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:218 +#: ../../library/typing.rst:232 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:220 +#: ../../library/typing.rst:234 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:224 +#: ../../library/typing.rst:238 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " -"one another. Doing ``Alias = Original`` will make the static type checker " -"treat ``Alias`` as being *exactly equivalent* to ``Original`` in all cases. " -"This is useful when you want to simplify complex type signatures." +"one another. Doing ``type Alias = Original`` will make the static type " +"checker treat ``Alias`` as being *exactly equivalent* to ``Original`` in all " +"cases. This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:229 +#: ../../library/typing.rst:243 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -345,24 +381,24 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:238 +#: ../../library/typing.rst:252 msgid "" "``NewType`` is now a class rather than a function. As a result, there is " "some additional runtime cost when calling ``NewType`` over a regular " "function." msgstr "" -#: ../../library/typing.rst:243 +#: ../../library/typing.rst:257 msgid "" "The performance of calling ``NewType`` has been restored to its level in " "Python 3.9." msgstr "" -#: ../../library/typing.rst:250 -msgid "Annotating callable objects" +#: ../../library/typing.rst:249 +msgid "Callable" msgstr "" -#: ../../library/typing.rst:252 +#: ../../library/typing.rst:251 msgid "" "Functions -- or other :term:`callable` objects -- can be annotated using :" "class:`collections.abc.Callable` or :data:`typing.Callable`. " @@ -370,11 +406,11 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:257 ../../library/typing.rst:2684 +#: ../../library/typing.rst:254 ../../library/typing.rst:2679 msgid "For example:" msgstr "舉例來說" -#: ../../library/typing.rst:275 +#: ../../library/typing.rst:272 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 " @@ -382,22 +418,7 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:280 -msgid "" -"If a literal ellipsis ``...`` is given as the argument list, it indicates " -"that a callable with any arbitrary parameter list would be acceptable:" -msgstr "" - -#: ../../library/typing.rst:292 -msgid "" -"``Callable`` cannot express complex signatures such as functions that take a " -"variadic number of arguments, :func:`overloaded functions `, or " -"functions that have keyword-only parameters. However, these signatures can " -"be expressed by defining a :class:`Protocol` class with a :meth:`~object." -"__call__` method:" -msgstr "" - -#: ../../library/typing.rst:319 +#: ../../library/typing.rst:276 ../../library/typing.rst:1008 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -408,46 +429,46 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:327 ../../library/typing.rst:3211 +#: ../../library/typing.rst:284 ../../library/typing.rst:1020 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:289 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:338 +#: ../../library/typing.rst:295 msgid "Generics" msgstr "" -#: ../../library/typing.rst:340 +#: ../../library/typing.rst:297 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:357 +#: ../../library/typing.rst:314 msgid "" -"Generics can be parameterized by using a factory available in typing called :" -"class:`TypeVar`." +"Generic functions and classes can be parameterized by using :ref:`type " +"parameter syntax `::" msgstr "" -#: ../../library/typing.rst:373 +#: ../../library/typing.rst:330 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:375 +#: ../../library/typing.rst:332 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:390 +#: ../../library/typing.rst:347 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -455,7 +476,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:396 +#: ../../library/typing.rst:353 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -463,7 +484,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:412 +#: ../../library/typing.rst:369 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -471,11 +492,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:435 +#: ../../library/typing.rst:392 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:437 +#: ../../library/typing.rst:394 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -483,115 +504,114 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:447 +#: ../../library/typing.rst:404 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:463 +#: ../../library/typing.rst:420 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:475 +#: ../../library/typing.rst:432 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:481 +#: ../../library/typing.rst:438 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:483 +#: ../../library/typing.rst:440 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:509 +#: ../../library/typing.rst:466 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." +"This syntax indicates that the class ``LoggedVar`` is parameterised around a " +"single :class:`type variable ` ``T`` . This also makes ``T`` valid " +"as a type within the class body." msgstr "" -#: ../../library/typing.rst:513 +#: ../../library/typing.rst:470 msgid "" -"The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " -"that ``LoggedVar[T]`` is valid as a type::" +"Generic classes implicitly inherit from :class:`Generic`. For compatibility " +"with Python 3.11 and lower, it is also possible to inherit explicitly from :" +"class:`Generic` to indicate a generic class::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:479 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:534 +#: ../../library/typing.rst:491 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:545 +#: ../../library/typing.rst:502 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:512 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:565 +#: ../../library/typing.rst:522 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:524 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:578 +#: ../../library/typing.rst:535 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:552 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:555 msgid "" "User-defined generics for parameter expressions are also supported via " -"parameter specification variables in the form ``Generic[P]``. The behavior " -"is consistent with type variables' described above as parameter " -"specification variables are treated by the typing module as a specialized " -"type variable. The one exception to this is that a list of types can be " -"used to substitute a :class:`ParamSpec`::" +"parameter specification variables in the form ``[**P]``. The behavior is " +"consistent with type variables' described above as parameter specification " +"variables are treated by the typing module as a specialized type variable. " +"The one exception to this is that a list of types can be used to substitute " +"a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:614 +#: ../../library/typing.rst:571 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, so the following are equivalent::" +"Classes generic over a :class:`ParamSpec` can also be created using explicit " +"inheritance from :class:`Generic`. In this case, ``**`` is not used::" msgstr "" -#: ../../library/typing.rst:626 +#: ../../library/typing.rst:583 msgid "" "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:630 +#: ../../library/typing.rst:587 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:634 +#: ../../library/typing.rst:591 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -599,24 +619,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:598 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:643 +#: ../../library/typing.rst:600 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:647 +#: ../../library/typing.rst:604 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:665 +#: ../../library/typing.rst:622 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -625,19 +645,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:628 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:684 +#: ../../library/typing.rst:641 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:687 +#: ../../library/typing.rst:644 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, " @@ -645,7 +665,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:692 +#: ../../library/typing.rst:649 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 " @@ -653,24 +673,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:714 +#: ../../library/typing.rst:671 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:719 +#: ../../library/typing.rst:676 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:678 msgid "" "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:725 +#: ../../library/typing.rst:682 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -679,7 +699,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:695 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 " @@ -688,85 +708,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:711 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:759 +#: ../../library/typing.rst:716 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:761 +#: ../../library/typing.rst:718 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:764 +#: ../../library/typing.rst:721 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:767 +#: ../../library/typing.rst:724 msgid "Special types" msgstr "" -#: ../../library/typing.rst:769 +#: ../../library/typing.rst:726 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:774 +#: ../../library/typing.rst:731 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:776 +#: ../../library/typing.rst:733 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:777 +#: ../../library/typing.rst:734 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:779 +#: ../../library/typing.rst:736 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:743 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:788 +#: ../../library/typing.rst:745 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:749 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:795 ../../library/typing.rst:871 -#: ../../library/typing.rst:891 ../../library/typing.rst:937 -#: ../../library/typing.rst:1096 ../../library/typing.rst:1153 -#: ../../library/typing.rst:1361 ../../library/typing.rst:2524 +#: ../../library/typing.rst:752 ../../library/typing.rst:828 +#: ../../library/typing.rst:848 ../../library/typing.rst:894 +#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 +#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:806 +#: ../../library/typing.rst:763 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:808 +#: ../../library/typing.rst:765 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -774,14 +794,14 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:814 +#: ../../library/typing.rst:771 msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:830 +#: ../../library/typing.rst:787 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -789,33 +809,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:792 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:841 +#: ../../library/typing.rst:798 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:844 +#: ../../library/typing.rst:801 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:864 +#: ../../library/typing.rst:821 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:869 +#: ../../library/typing.rst:826 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:878 +#: ../../library/typing.rst:835 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -823,126 +843,126 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:889 +#: ../../library/typing.rst:846 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:901 +#: ../../library/typing.rst:858 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:913 +#: ../../library/typing.rst:870 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:877 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:923 +#: ../../library/typing.rst:880 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:882 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:884 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:929 +#: ../../library/typing.rst:886 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:935 +#: ../../library/typing.rst:892 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:943 +#: ../../library/typing.rst:900 msgid "" -"``TypeAlias`` is particularly useful for annotating aliases that make use of " -"forward references, as it can be hard for type checkers to distinguish these " -"from normal variable assignments:" +"``TypeAlias`` is particularly useful on older Python versions for annotating " +"aliases that make use of forward references, as it can be hard for type " +"checkers to distinguish these from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:963 +#: ../../library/typing.rst:920 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:968 +#: ../../library/typing.rst:925 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:970 +#: ../../library/typing.rst:927 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:975 +#: ../../library/typing.rst:932 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:934 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:979 +#: ../../library/typing.rst:936 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:981 +#: ../../library/typing.rst:938 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:985 +#: ../../library/typing.rst:942 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:989 +#: ../../library/typing.rst:946 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:993 +#: ../../library/typing.rst:950 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:997 +#: ../../library/typing.rst:954 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:999 +#: ../../library/typing.rst:956 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:1001 +#: ../../library/typing.rst:958 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:1004 +#: ../../library/typing.rst:961 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:1010 +#: ../../library/typing.rst:967 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:1012 +#: ../../library/typing.rst:969 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 " @@ -950,24 +970,64 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:1020 +#: ../../library/typing.rst:977 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:1027 +#: ../../library/typing.rst:984 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:1033 +#: ../../library/typing.rst:990 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "" + +#: ../../library/typing.rst:992 +msgid "" +"``Callable[[int], str]`` signifies a function that takes a single parameter " +"of type :class:`int` and returns a :class:`str`." +msgstr "" + +#: ../../library/typing.rst:995 +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, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " +"type must be a single type." +msgstr "" + +#: ../../library/typing.rst:1000 +msgid "" +"There is no syntax to indicate optional or keyword arguments; such function " +"types are rarely used as callback types. ``Callable[..., ReturnType]`` " +"(literal ellipsis) can be used to type hint a callable taking any number of " +"arguments and returning ``ReturnType``. A plain :data:`Callable` is " +"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." +"Callable`." +msgstr "" + +#: ../../library/typing.rst:1016 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:1025 +msgid "" +"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " +"examples of usage with ``Callable``." +msgstr "" + +#: ../../library/typing.rst:1030 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1035 +#: ../../library/typing.rst:1032 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -978,7 +1038,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1044 +#: ../../library/typing.rst:1041 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -989,38 +1049,34 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1083 ../../library/typing.rst:1740 +#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1085 -msgid ":class:`ParamSpec`" -msgstr ":class:`ParamSpec`" +#: ../../library/typing.rst:1082 +msgid ":class:`ParamSpec` and :class:`Callable`." +msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1086 ../../library/typing.rst:1743 -msgid ":ref:`annotating-callables`" -msgstr "" - -#: ../../library/typing.rst:1090 +#: ../../library/typing.rst:1086 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1092 +#: ../../library/typing.rst:1088 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1108 +#: ../../library/typing.rst:1104 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:1114 +#: ../../library/typing.rst:1110 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1028,22 +1084,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1122 +#: ../../library/typing.rst:1118 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1124 +#: ../../library/typing.rst:1120 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:1132 +#: ../../library/typing.rst:1128 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1134 +#: ../../library/typing.rst:1130 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 " @@ -1051,27 +1107,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1148 +#: ../../library/typing.rst:1144 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1150 +#: ../../library/typing.rst:1146 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1164 ../../library/typing.rst:2540 +#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1171 +#: ../../library/typing.rst:1167 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1173 +#: ../../library/typing.rst:1169 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1079,21 +1135,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1180 +#: ../../library/typing.rst:1176 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1183 +#: ../../library/typing.rst:1179 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1189 +#: ../../library/typing.rst:1185 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1191 +#: ../../library/typing.rst:1187 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1101,7 +1157,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1196 +#: ../../library/typing.rst:1192 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1110,7 +1166,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1202 +#: ../../library/typing.rst:1198 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1120,7 +1176,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1209 +#: ../../library/typing.rst:1205 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1128,108 +1184,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1213 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1226 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1232 +#: ../../library/typing.rst:1228 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1234 +#: ../../library/typing.rst:1230 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1239 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1247 +#: ../../library/typing.rst:1243 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1250 +#: ../../library/typing.rst:1246 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1257 +#: ../../library/typing.rst:1253 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1264 +#: ../../library/typing.rst:1260 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1270 +#: ../../library/typing.rst:1266 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1279 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1283 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1291 +#: ../../library/typing.rst:1287 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1294 +#: ../../library/typing.rst:1290 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1307 +#: ../../library/typing.rst:1303 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1321 +#: ../../library/typing.rst:1317 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1322 +#: ../../library/typing.rst:1318 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1329 +#: ../../library/typing.rst:1325 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1331 +#: ../../library/typing.rst:1327 msgid "" "``TypeGuard`` can be 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:1335 +#: ../../library/typing.rst:1331 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 " @@ -1238,44 +1294,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1350 +#: ../../library/typing.rst:1346 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:1354 +#: ../../library/typing.rst:1350 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1353 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1358 +#: ../../library/typing.rst:1354 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1375 +#: ../../library/typing.rst:1371 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:1379 +#: ../../library/typing.rst:1375 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:1385 +#: ../../library/typing.rst:1381 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]`` " @@ -1284,24 +1340,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1391 +#: ../../library/typing.rst:1387 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1398 +#: ../../library/typing.rst:1394 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1400 +#: ../../library/typing.rst:1396 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1409 +#: ../../library/typing.rst:1405 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1309,45 +1365,42 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1426 +#: ../../library/typing.rst:1422 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1428 +#: ../../library/typing.rst:1424 msgid "" "The following classes should not be used directly as annotations. Their " -"intended purpose is to be building blocks for creating generic types." +"intended purpose is to be building blocks for creating generic types and " +"type aliases." msgstr "" -#: ../../library/typing.rst:1434 +#: ../../library/typing.rst:1430 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1436 +#: ../../library/typing.rst:1432 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::" +"A generic type is typically declared by adding a list of type parameters " +"after the class name::" msgstr "" -#: ../../library/typing.rst:1445 +#: ../../library/typing.rst:1441 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1458 +#: ../../library/typing.rst:1454 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1460 ../../library/typing.rst:1555 -#: ../../library/typing.rst:1665 ../../library/typing.rst:1779 -#: ../../library/typing.rst:1850 ../../library/typing.rst:2724 +#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 +#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 +#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 msgid "Usage::" msgstr "" -"用法:\n" -"\n" -"::" -#: ../../library/typing.rst:1466 +#: ../../library/typing.rst:1462 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 " @@ -1355,69 +1408,72 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1487 +#: ../../library/typing.rst:1483 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1486 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." +"The variance of type variables is inferred by type checkers when they are " +"created through the :ref:`type parameter syntax ` or when " +"``infer_variance=True`` is passed. Manually created type variables may be " +"explicitly marked covariant or contravariant by passing ``covariant=True`` " +"or ``contravariant=True``. By default, manually created type variables are " +"invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1494 +#: ../../library/typing.rst:1490 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1509 +#: ../../library/typing.rst:1505 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1517 +#: ../../library/typing.rst:1513 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1524 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1532 +#: ../../library/typing.rst:1528 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1536 +#: ../../library/typing.rst:1532 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1536 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1540 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1544 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1552 +#: ../../library/typing.rst:1548 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1563 +#: ../../library/typing.rst:1559 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1425,7 +1481,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1585 +#: ../../library/typing.rst:1581 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1435,36 +1491,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1593 +#: ../../library/typing.rst:1589 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1600 +#: ../../library/typing.rst:1596 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1609 +#: ../../library/typing.rst:1605 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1624 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1635 +#: ../../library/typing.rst:1631 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1645 +#: ../../library/typing.rst:1641 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1473,21 +1529,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1648 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1652 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1662 +#: ../../library/typing.rst:1658 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1669 +#: ../../library/typing.rst:1665 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1497,7 +1553,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1672 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 " @@ -1505,27 +1561,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1700 +#: ../../library/typing.rst:1696 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:1704 +#: ../../library/typing.rst:1700 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:1706 +#: ../../library/typing.rst:1702 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:1713 +#: ../../library/typing.rst:1709 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1538,11 +1594,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1725 +#: ../../library/typing.rst:1721 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1723 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1551,17 +1607,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1736 +#: ../../library/typing.rst:1732 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1742 -msgid ":data:`Concatenate`" -msgstr "" +#: ../../library/typing.rst:1738 +msgid ":class:`Callable` and :class:`Concatenate`." +msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1743 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1569,45 +1625,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1753 +#: ../../library/typing.rst:1748 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1769 +#: ../../library/typing.rst:1764 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1771 +#: ../../library/typing.rst:1766 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1777 +#: ../../library/typing.rst:1772 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1780 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1789 +#: ../../library/typing.rst:1784 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1798 +#: ../../library/typing.rst:1793 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1800 +#: ../../library/typing.rst:1795 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 " @@ -1616,83 +1672,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1806 +#: ../../library/typing.rst:1801 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1816 +#: ../../library/typing.rst:1811 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1822 +#: ../../library/typing.rst:1817 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1826 +#: ../../library/typing.rst:1821 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1824 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1832 +#: ../../library/typing.rst:1827 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1836 +#: ../../library/typing.rst:1831 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1835 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1845 +#: ../../library/typing.rst:1840 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1847 +#: ../../library/typing.rst:1842 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1852 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1861 +#: ../../library/typing.rst:1856 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1865 +#: ../../library/typing.rst:1860 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:1864 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1869 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1876 +#: ../../library/typing.rst:1871 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1877 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1889 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1700,15 +1756,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1899 +#: ../../library/typing.rst:1894 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1906 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1913 +#: ../../library/typing.rst:1908 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 " @@ -1717,7 +1773,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1928 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1728,7 +1784,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1944 +#: ../../library/typing.rst:1939 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1736,13 +1792,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1955 +#: ../../library/typing.rst:1950 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1953 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 " @@ -1750,53 +1806,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1969 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:1978 +#: ../../library/typing.rst:1973 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1982 +#: ../../library/typing.rst:1977 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1989 +#: ../../library/typing.rst:1984 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1990 +#: ../../library/typing.rst:1985 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::" msgstr "" -#: ../../library/typing.rst:2002 +#: ../../library/typing.rst:1997 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2013 +#: ../../library/typing.rst:2008 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2016 +#: ../../library/typing.rst:2011 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2021 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 " @@ -1804,61 +1860,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2031 +#: ../../library/typing.rst:2026 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2046 +#: ../../library/typing.rst:2041 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:2053 +#: ../../library/typing.rst:2048 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2061 +#: ../../library/typing.rst:2056 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2079 +#: ../../library/typing.rst:2074 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:2084 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:2095 +#: ../../library/typing.rst:2090 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2112 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2120 +#: ../../library/typing.rst:2115 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2123 +#: ../../library/typing.rst:2118 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1867,133 +1923,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2146 +#: ../../library/typing.rst:2141 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2150 +#: ../../library/typing.rst:2145 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2149 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2153 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2155 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2160 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2170 +#: ../../library/typing.rst:2165 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2169 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2178 +#: ../../library/typing.rst:2173 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2182 +#: ../../library/typing.rst:2177 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2183 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2192 +#: ../../library/typing.rst:2187 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2191 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2202 +#: ../../library/typing.rst:2197 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:2208 +#: ../../library/typing.rst:2203 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2207 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2214 +#: ../../library/typing.rst:2209 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:2221 +#: ../../library/typing.rst:2216 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2218 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2226 +#: ../../library/typing.rst:2221 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2233 +#: ../../library/typing.rst:2228 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2247 +#: ../../library/typing.rst:2242 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2249 +#: ../../library/typing.rst:2244 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2255 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2260 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2003,59 +2059,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2268 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2276 +#: ../../library/typing.rst:2271 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2279 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2286 +#: ../../library/typing.rst:2281 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2292 +#: ../../library/typing.rst:2287 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2290 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2295 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2305 +#: ../../library/typing.rst:2300 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2317 +#: ../../library/typing.rst:2312 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2320 +#: ../../library/typing.rst:2315 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2064,19 +2120,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2327 +#: ../../library/typing.rst:2322 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2343 +#: ../../library/typing.rst:2338 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2352 +#: ../../library/typing.rst:2347 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2363 +#: ../../library/typing.rst:2358 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2494 +#: ../../library/typing.rst:2489 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2281,32 +2337,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2496 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2509 +#: ../../library/typing.rst:2504 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2506 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2518 +#: ../../library/typing.rst:2513 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2515 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2545 +#: ../../library/typing.rst:2540 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2316,11 +2372,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2556 +#: ../../library/typing.rst:2551 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2558 +#: ../../library/typing.rst:2553 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2328,48 +2384,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2559 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2563 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2565 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2570 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2577 +#: ../../library/typing.rst:2572 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:2588 +#: ../../library/typing.rst:2583 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2592 +#: ../../library/typing.rst:2587 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2596 +#: ../../library/typing.rst:2591 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2599 +#: ../../library/typing.rst:2594 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2378,21 +2434,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2605 +#: ../../library/typing.rst:2600 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:2622 +#: ../../library/typing.rst:2617 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:2627 +#: ../../library/typing.rst:2622 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2400,20 +2456,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2631 +#: ../../library/typing.rst:2626 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2638 +#: ../../library/typing.rst:2633 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2641 +#: ../../library/typing.rst:2636 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2421,17 +2477,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2647 ../../library/typing.rst:2670 +#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2662 +#: ../../library/typing.rst:2657 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2665 +#: ../../library/typing.rst:2660 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2439,40 +2495,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2677 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2703 +#: ../../library/typing.rst:2698 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:2700 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2710 +#: ../../library/typing.rst:2705 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:2717 +#: ../../library/typing.rst:2712 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2721 +#: ../../library/typing.rst:2716 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2732 +#: ../../library/typing.rst:2727 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2480,7 +2536,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2739 +#: ../../library/typing.rst:2734 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2488,11 +2544,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2751 +#: ../../library/typing.rst:2745 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2747 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2501,7 +2557,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2760 +#: ../../library/typing.rst:2753 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2509,7 +2565,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2758 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2517,182 +2573,176 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:2770 -msgid "" -"Type checkers are encouraged to flag uses of the deprecated types if the " -"program they are checking targets a minimum Python version of 3.9 or newer." -msgstr "" - -#: ../../library/typing.rst:2776 +#: ../../library/typing.rst:2765 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2769 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2782 +#: ../../library/typing.rst:2771 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2786 ../../library/typing.rst:3026 +#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2791 +#: ../../library/typing.rst:2780 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2786 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2799 +#: ../../library/typing.rst:2788 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2803 +#: ../../library/typing.rst:2792 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2802 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2808 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2821 +#: ../../library/typing.rst:2810 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2825 +#: ../../library/typing.rst:2814 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2820 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2833 +#: ../../library/typing.rst:2822 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2829 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:2831 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2834 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2851 +#: ../../library/typing.rst:2840 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:2853 +#: ../../library/typing.rst:2842 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2847 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2854 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2869 +#: ../../library/typing.rst:2858 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2873 +#: ../../library/typing.rst:2862 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2879 +#: ../../library/typing.rst:2868 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2872 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2878 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2883 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2889 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2894 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2900 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2916 +#: ../../library/typing.rst:2905 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2912 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2917 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2931 +#: ../../library/typing.rst:2920 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2700,383 +2750,367 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2928 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2940 +#: ../../library/typing.rst:2929 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2946 +#: ../../library/typing.rst:2935 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2948 +#: ../../library/typing.rst:2937 msgid "" "``Text`` 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:2952 +#: ../../library/typing.rst:2941 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:2960 +#: ../../library/typing.rst:2949 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2970 +#: ../../library/typing.rst:2959 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2974 +#: ../../library/typing.rst:2963 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2976 +#: ../../library/typing.rst:2965 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2982 +#: ../../library/typing.rst:2971 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2986 +#: ../../library/typing.rst:2975 msgid "" -"Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " -"memoryview``." +"Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " +"| memoryview``." msgstr "" -#: ../../library/typing.rst:2990 +#: ../../library/typing.rst:2979 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2994 +#: ../../library/typing.rst:2983 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3000 +#: ../../library/typing.rst:2989 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:3002 +#: ../../library/typing.rst:2991 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3008 +#: ../../library/typing.rst:2997 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:3010 +#: ../../library/typing.rst:2999 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3005 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:3018 +#: ../../library/typing.rst:3007 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3024 +#: ../../library/typing.rst:3013 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3031 +#: ../../library/typing.rst:3020 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3037 +#: ../../library/typing.rst:3026 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3039 +#: ../../library/typing.rst:3028 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3034 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3047 +#: ../../library/typing.rst:3036 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3043 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3056 +#: ../../library/typing.rst:3045 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3052 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3065 +#: ../../library/typing.rst:3054 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3071 +#: ../../library/typing.rst:3060 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3073 +#: ../../library/typing.rst:3062 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3079 +#: ../../library/typing.rst:3068 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3070 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3077 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3092 +#: ../../library/typing.rst:3081 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3083 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3105 +#: ../../library/typing.rst:3094 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3100 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3102 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3111 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:3126 +#: ../../library/typing.rst:3115 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3134 +#: ../../library/typing.rst:3123 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3133 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3151 +#: ../../library/typing.rst:3140 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3155 +#: ../../library/typing.rst:3144 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3161 +#: ../../library/typing.rst:3150 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3154 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3164 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3171 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3186 +#: ../../library/typing.rst:3175 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3188 +#: ../../library/typing.rst:3177 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3194 +#: ../../library/typing.rst:3183 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3196 +#: ../../library/typing.rst:3185 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3202 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:3204 -msgid "" -"See :ref:`annotating-callables` for details on how to use :class:" -"`collections.abc.Callable` and ``typing.Callable`` in type annotations." -msgstr "" - -#: ../../library/typing.rst:3207 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:3217 +#: ../../library/typing.rst:3191 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3219 +#: ../../library/typing.rst:3193 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3202 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:3232 +#: ../../library/typing.rst:3206 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3214 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3248 +#: ../../library/typing.rst:3222 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3228 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3258 +#: ../../library/typing.rst:3232 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3260 +#: ../../library/typing.rst:3234 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3240 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3271 +#: ../../library/typing.rst:3245 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3275 +#: ../../library/typing.rst:3249 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3280 +#: ../../library/typing.rst:3254 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3261 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3292 +#: ../../library/typing.rst:3266 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3298 +#: ../../library/typing.rst:3272 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3300 +#: ../../library/typing.rst:3274 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3084,81 +3118,74 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3279 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3308 +#: ../../library/typing.rst:3279 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3279 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3310 +#: ../../library/typing.rst:3279 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3311 +#: ../../library/typing.rst:3281 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3312 +#: ../../library/typing.rst:3281 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3313 +#: ../../library/typing.rst:3281 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3314 +#: ../../library/typing.rst:3281 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3315 +#: ../../library/typing.rst:3284 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3316 ../../library/typing.rst:3320 +#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3317 -msgid "Undecided (see :ref:`deprecated-typing-aliases` for more information)" +#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 +msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3318 +#: ../../library/typing.rst:3284 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3319 -msgid ":class:`typing.ByteString`" -msgstr ":class:`typing.ByteString`" +#: ../../library/typing.rst:3287 +msgid "``typing.ByteString``" +msgstr "``typing.Text``" -#: ../../library/typing.rst:3321 +#: ../../library/typing.rst:3287 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3322 +#: ../../library/typing.rst:3287 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3323 -msgid ":data:`typing.Text`" -msgstr ":data:`typing.Text`" +#: ../../library/typing.rst:3289 +msgid "``typing.Text``" +msgstr "``typing.Text``" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3289 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3325 -msgid "Undecided" -msgstr "" - -#: ../../library/typing.rst:3326 +#: ../../library/typing.rst:3289 msgid ":gh:`92332`" msgstr ":gh:`92332`" - -#~ msgid ":class:`Callable` and :class:`Concatenate`." -#~ msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" diff --git a/library/unicodedata.po b/library/unicodedata.po index 77979f1c1b..02e972c55f 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,8 +26,8 @@ msgstr "" msgid "" "This module provides access to the Unicode Character Database (UCD) which " "defines character properties for all Unicode characters. The data contained " -"in this database is compiled from the `UCD version 14.0.0 `_." +"in this database is compiled from the `UCD version 15.0.0 `_." msgstr "" #: ../../library/unicodedata.rst:23 @@ -188,11 +188,13 @@ msgid "Footnotes" msgstr "註解" #: ../../library/unicodedata.rst:178 -msgid "https://www.unicode.org/Public/14.0.0/ucd/NameAliases.txt" +#, fuzzy +msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/14.0.0/ucd/NameAliases.txt" #: ../../library/unicodedata.rst:180 -msgid "https://www.unicode.org/Public/14.0.0/ucd/NamedSequences.txt" +#, fuzzy +msgid "https://www.unicode.org/Public/15.0.0/ucd/NamedSequences.txt" msgstr "https://www.unicode.org/Public/14.0.0/ucd/NamedSequences.txt" #: ../../library/unicodedata.rst:11 diff --git a/library/unittest.mock.po b/library/unittest.mock.po index ea3c4e16a6..f480a65cd1 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 19:36+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,7 +82,7 @@ msgid "" "exception when a mock is called:" msgstr "" -#: ../../library/unittest.mock.rst:92 +#: ../../library/unittest.mock.rst:93 msgid "" "Mock has many other ways you can configure it and control its behaviour. For " "example the *spec* argument configures the mock to take its specification " @@ -90,7 +90,7 @@ msgid "" "that don't exist on the spec will fail with an :exc:`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:97 +#: ../../library/unittest.mock.rst:98 msgid "" "The :func:`patch` decorator / context manager makes it easy to mock classes " "or objects in a module under test. The object you specify will be replaced " @@ -98,7 +98,7 @@ msgid "" "ends::" msgstr "" -#: ../../library/unittest.mock.rst:116 +#: ../../library/unittest.mock.rst:117 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " @@ -106,34 +106,34 @@ msgid "" "above the mock for ``module.ClassName1`` is passed in first." msgstr "" -#: ../../library/unittest.mock.rst:121 +#: ../../library/unittest.mock.rst:122 msgid "" "With :func:`patch` it matters that you patch objects in the namespace where " "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock.rst:125 +#: ../../library/unittest.mock.rst:126 msgid "" "As well as a decorator :func:`patch` can be used as a context manager in a " "with statement:" msgstr "" -#: ../../library/unittest.mock.rst:135 +#: ../../library/unittest.mock.rst:136 msgid "" "There is also :func:`patch.dict` for setting values in a dictionary just " "during a scope and restoring the dictionary to its original state when the " "test ends:" msgstr "" -#: ../../library/unittest.mock.rst:146 +#: ../../library/unittest.mock.rst:147 msgid "" "Mock supports the mocking of Python :ref:`magic methods `. " "The easiest way of using magic methods is with the :class:`MagicMock` class. " "It allows you to do things like:" msgstr "" -#: ../../library/unittest.mock.rst:156 +#: ../../library/unittest.mock.rst:157 msgid "" "Mock allows you to assign functions (or other Mock instances) to magic " "methods and they will be called appropriately. The :class:`MagicMock` class " @@ -141,13 +141,13 @@ msgid "" "(well, all the useful ones anyway)." msgstr "" -#: ../../library/unittest.mock.rst:161 +#: ../../library/unittest.mock.rst:162 msgid "" "The following is an example of using magic methods with the ordinary Mock " "class:" msgstr "" -#: ../../library/unittest.mock.rst:169 +#: ../../library/unittest.mock.rst:170 msgid "" "For ensuring that the mock objects in your tests have the same api as the " "objects they are replacing, you can use :ref:`auto-speccing `." msgstr "" -#: ../../library/unittest.mock.rst:651 +#: ../../library/unittest.mock.rst:652 msgid "Added ``args`` and ``kwargs`` properties." msgstr "新增 ``args`` 與 ``kwargs`` 特性。" -#: ../../library/unittest.mock.rst:657 +#: ../../library/unittest.mock.rst:658 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " @@ -537,47 +537,47 @@ msgid "" "`call_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:673 +#: ../../library/unittest.mock.rst:674 msgid "" "Members of :attr:`call_args_list` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:680 +#: ../../library/unittest.mock.rst:681 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" -#: ../../library/unittest.mock.rst:691 +#: ../../library/unittest.mock.rst:692 msgid "" "Members of :attr:`method_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:698 +#: ../../library/unittest.mock.rst:699 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." msgstr "" -#: ../../library/unittest.mock.rst:716 +#: ../../library/unittest.mock.rst:717 msgid "" "Members of :attr:`mock_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: ../../library/unittest.mock.rst:722 +#: ../../library/unittest.mock.rst:723 msgid "" "The way :attr:`mock_calls` are recorded means that where nested calls are " "made, the parameters of ancestor calls are not recorded and so will always " "compare equal:" msgstr "" -#: ../../library/unittest.mock.rst:736 +#: ../../library/unittest.mock.rst:737 msgid "" "Normally the :attr:`__class__` attribute of an object will return its type. " "For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " @@ -585,32 +585,32 @@ msgid "" "object they are replacing / masquerading as:" msgstr "" -#: ../../library/unittest.mock.rst:745 +#: ../../library/unittest.mock.rst:746 msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" -#: ../../library/unittest.mock.rst:755 +#: ../../library/unittest.mock.rst:756 msgid "" "A non-callable version of :class:`Mock`. The constructor parameters have the " "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" -#: ../../library/unittest.mock.rst:759 +#: ../../library/unittest.mock.rst:760 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -#: ../../library/unittest.mock.rst:769 +#: ../../library/unittest.mock.rst:770 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" -#: ../../library/unittest.mock.rst:772 +#: ../../library/unittest.mock.rst:773 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " "arguments for configuration. For the :func:`patch` decorators the keywords " @@ -618,14 +618,14 @@ msgid "" "arguments are for configuring attributes of the mock:" msgstr "" -#: ../../library/unittest.mock.rst:783 +#: ../../library/unittest.mock.rst:784 msgid "" "The return value and side effect of child mocks can be set in the same way, " "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" -#: ../../library/unittest.mock.rst:798 +#: ../../library/unittest.mock.rst:799 msgid "" "A callable mock which was created with a *spec* (or a *spec_set*) will " "introspect the specification object's signature when matching calls to the " @@ -633,7 +633,7 @@ msgid "" "whether they were passed positionally or by name::" msgstr "" -#: ../../library/unittest.mock.rst:811 +#: ../../library/unittest.mock.rst:812 msgid "" "This applies to :meth:`~Mock.assert_called_with`, :meth:`~Mock." "assert_called_once_with`, :meth:`~Mock.assert_has_calls` and :meth:`~Mock." @@ -641,76 +641,76 @@ msgid "" "calls on the mock object." msgstr "" -#: ../../library/unittest.mock.rst:816 +#: ../../library/unittest.mock.rst:817 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" -#: ../../library/unittest.mock.rst:822 +#: ../../library/unittest.mock.rst:823 msgid "" "A mock intended to be used as a property, or other descriptor, on a class. :" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" -#: ../../library/unittest.mock.rst:826 +#: ../../library/unittest.mock.rst:827 msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" -#: ../../library/unittest.mock.rst:847 +#: ../../library/unittest.mock.rst:848 msgid "" "Because of the way mock attributes are stored you can't directly attach a :" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " "type object::" msgstr "" -#: ../../library/unittest.mock.rst:861 +#: ../../library/unittest.mock.rst:862 msgid "" "An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object " "will behave so the object is recognized as an async function, and the result " "of a call is an awaitable." msgstr "" -#: ../../library/unittest.mock.rst:871 +#: ../../library/unittest.mock.rst:872 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" msgstr "" -#: ../../library/unittest.mock.rst:874 +#: ../../library/unittest.mock.rst:875 msgid "" "if ``side_effect`` is a function, the async function will return the result " "of that function," msgstr "" -#: ../../library/unittest.mock.rst:876 +#: ../../library/unittest.mock.rst:877 msgid "" "if ``side_effect`` is an exception, the async function will raise the " "exception," msgstr "" -#: ../../library/unittest.mock.rst:878 +#: ../../library/unittest.mock.rst:879 msgid "" "if ``side_effect`` is an iterable, the async function will return the next " "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" -#: ../../library/unittest.mock.rst:881 +#: ../../library/unittest.mock.rst:882 msgid "" "if ``side_effect`` is not defined, the async function will return the value " "defined by ``return_value``, hence, by default, the async function returns a " "new :class:`AsyncMock` object." msgstr "" -#: ../../library/unittest.mock.rst:886 +#: ../../library/unittest.mock.rst:887 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" -#: ../../library/unittest.mock.rst:898 +#: ../../library/unittest.mock.rst:899 msgid "" "Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:" "`AsyncMock` to a class with asynchronous and synchronous functions will " @@ -720,82 +720,82 @@ msgid "" "functions will be :class:`AsyncMock`." msgstr "" -#: ../../library/unittest.mock.rst:926 +#: ../../library/unittest.mock.rst:927 msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" msgstr "" -#: ../../library/unittest.mock.rst:945 +#: ../../library/unittest.mock.rst:946 msgid "Assert that the mock was awaited exactly once." msgstr "" -#: ../../library/unittest.mock.rst:961 +#: ../../library/unittest.mock.rst:962 msgid "Assert that the last await was with the specified arguments." msgstr "" -#: ../../library/unittest.mock.rst:978 +#: ../../library/unittest.mock.rst:979 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." msgstr "" -#: ../../library/unittest.mock.rst:995 +#: ../../library/unittest.mock.rst:996 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" -#: ../../library/unittest.mock.rst:1011 +#: ../../library/unittest.mock.rst:1012 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" -#: ../../library/unittest.mock.rst:1014 +#: ../../library/unittest.mock.rst:1015 msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." msgstr "" -#: ../../library/unittest.mock.rst:1018 +#: ../../library/unittest.mock.rst:1019 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1038 +#: ../../library/unittest.mock.rst:1039 msgid "Assert that the mock was never awaited." msgstr "" -#: ../../library/unittest.mock.rst:1045 +#: ../../library/unittest.mock.rst:1046 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1050 +#: ../../library/unittest.mock.rst:1051 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" -#: ../../library/unittest.mock.rst:1065 +#: ../../library/unittest.mock.rst:1066 msgid "" "This is either ``None`` (if the mock hasn’t been awaited), or the arguments " "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" -#: ../../library/unittest.mock.rst:1083 +#: ../../library/unittest.mock.rst:1084 msgid "" "This is a list of all the awaits made to the mock object in sequence (so the " "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" -#: ../../library/unittest.mock.rst:1102 +#: ../../library/unittest.mock.rst:1103 msgid "Calling" msgstr "" -#: ../../library/unittest.mock.rst:1104 +#: ../../library/unittest.mock.rst:1105 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" "`~Mock.return_value` attribute. The default return value is a new Mock " @@ -804,26 +804,26 @@ msgid "" "returned each time." msgstr "" -#: ../../library/unittest.mock.rst:1110 +#: ../../library/unittest.mock.rst:1111 msgid "" "Calls made to the object will be recorded in the attributes like :attr:" "`~Mock.call_args` and :attr:`~Mock.call_args_list`." msgstr "" -#: ../../library/unittest.mock.rst:1113 +#: ../../library/unittest.mock.rst:1114 msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " "has been recorded, so if :attr:`side_effect` raises an exception the call is " "still recorded." msgstr "" -#: ../../library/unittest.mock.rst:1117 +#: ../../library/unittest.mock.rst:1118 msgid "" "The simplest way to make a mock raise an exception when called is to make :" "attr:`~Mock.side_effect` an exception class or instance:" msgstr "" -#: ../../library/unittest.mock.rst:1135 +#: ../../library/unittest.mock.rst:1136 msgid "" "If :attr:`side_effect` is a function then whatever that function returns is " "what calls to the mock return. The :attr:`side_effect` function is called " @@ -831,7 +831,7 @@ msgid "" "value of the call dynamically, based on the input:" msgstr "" -#: ../../library/unittest.mock.rst:1151 +#: ../../library/unittest.mock.rst:1152 msgid "" "If you want the mock to still return the default return value (a new mock), " "or any set return value, then there are two ways of doing this. Either " @@ -839,36 +839,36 @@ msgid "" "data:`DEFAULT`:" msgstr "" -#: ../../library/unittest.mock.rst:1170 +#: ../../library/unittest.mock.rst:1171 msgid "" "To remove a :attr:`side_effect`, and return to the default behaviour, set " "the :attr:`side_effect` to ``None``:" msgstr "" -#: ../../library/unittest.mock.rst:1184 +#: ../../library/unittest.mock.rst:1185 msgid "" "The :attr:`side_effect` can also be any iterable object. Repeated calls to " "the mock will return values from the iterable (until the iterable is " "exhausted and a :exc:`StopIteration` is raised):" msgstr "" -#: ../../library/unittest.mock.rst:1200 +#: ../../library/unittest.mock.rst:1201 msgid "" "If any members of the iterable are exceptions they will be raised instead of " "returned::" msgstr "" -#: ../../library/unittest.mock.rst:1218 +#: ../../library/unittest.mock.rst:1219 msgid "Deleting Attributes" msgstr "" -#: ../../library/unittest.mock.rst:1220 +#: ../../library/unittest.mock.rst:1221 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "" -#: ../../library/unittest.mock.rst:1223 +#: ../../library/unittest.mock.rst:1224 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " "raise an :exc:`AttributeError` when an attribute is fetched. You can do this " @@ -876,17 +876,17 @@ msgid "" "convenient." msgstr "" -#: ../../library/unittest.mock.rst:1227 +#: ../../library/unittest.mock.rst:1228 msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:1244 +#: ../../library/unittest.mock.rst:1245 msgid "Mock names and the name attribute" msgstr "" -#: ../../library/unittest.mock.rst:1246 +#: ../../library/unittest.mock.rst:1247 msgid "" "Since \"name\" is an argument to the :class:`Mock` constructor, if you want " "your mock object to have a \"name\" attribute you can't just pass it in at " @@ -894,17 +894,17 @@ msgid "" "configure_mock`::" msgstr "" -#: ../../library/unittest.mock.rst:1256 +#: ../../library/unittest.mock.rst:1257 msgid "" "A simpler option is to simply set the \"name\" attribute after mock " "creation::" msgstr "" -#: ../../library/unittest.mock.rst:1263 +#: ../../library/unittest.mock.rst:1264 msgid "Attaching Mocks as Attributes" msgstr "" -#: ../../library/unittest.mock.rst:1265 +#: ../../library/unittest.mock.rst:1266 msgid "" "When you attach a mock as an attribute of another mock (or as the return " "value) it becomes a \"child\" of that mock. Calls to the child are recorded " @@ -915,20 +915,20 @@ msgid "" "calls between mocks:" msgstr "" -#: ../../library/unittest.mock.rst:1283 +#: ../../library/unittest.mock.rst:1284 msgid "" "The exception to this is if the mock has a name. This allows you to prevent " "the \"parenting\" if for some reason you don't want it to happen." msgstr "" -#: ../../library/unittest.mock.rst:1294 +#: ../../library/unittest.mock.rst:1295 msgid "" "Mocks created for you by :func:`patch` are automatically given names. To " "attach mocks that have names to a parent you use the :meth:`~Mock." "attach_mock` method::" msgstr "" -#: ../../library/unittest.mock.rst:1312 +#: ../../library/unittest.mock.rst:1313 msgid "" "The only exceptions are magic methods and attributes (those that have " "leading and trailing double underscores). Mock doesn't create these but " @@ -938,11 +938,11 @@ msgid "" "support see :ref:`magic methods `." msgstr "" -#: ../../library/unittest.mock.rst:1321 +#: ../../library/unittest.mock.rst:1322 msgid "The patchers" msgstr "" -#: ../../library/unittest.mock.rst:1323 +#: ../../library/unittest.mock.rst:1324 msgid "" "The patch decorators are used for patching objects only within the scope of " "the function they decorate. They automatically handle the unpatching for " @@ -950,17 +950,17 @@ msgid "" "in with statements or as class decorators." msgstr "" -#: ../../library/unittest.mock.rst:1330 +#: ../../library/unittest.mock.rst:1331 msgid "patch" msgstr "" -#: ../../library/unittest.mock.rst:1334 +#: ../../library/unittest.mock.rst:1335 msgid "" "The key is to do the patching in the right namespace. See the section `where " "to patch`_." msgstr "" -#: ../../library/unittest.mock.rst:1338 +#: ../../library/unittest.mock.rst:1339 msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " @@ -968,7 +968,7 @@ msgid "" "patch is undone." msgstr "" -#: ../../library/unittest.mock.rst:1343 +#: ../../library/unittest.mock.rst:1344 msgid "" "If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " "if the patched object is an async function or a :class:`MagicMock` " @@ -978,7 +978,7 @@ msgid "" "by the context manager." msgstr "" -#: ../../library/unittest.mock.rst:1351 +#: ../../library/unittest.mock.rst:1352 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " "*target* is imported and the specified object replaced with the *new* " @@ -987,26 +987,26 @@ msgid "" "function is executed, not at decoration time." msgstr "" -#: ../../library/unittest.mock.rst:1357 +#: ../../library/unittest.mock.rst:1358 msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" -#: ../../library/unittest.mock.rst:1360 +#: ../../library/unittest.mock.rst:1361 msgid "" "In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " "patch to pass in the object being mocked as the spec/spec_set object." msgstr "" -#: ../../library/unittest.mock.rst:1363 +#: ../../library/unittest.mock.rst:1364 msgid "" "*new_callable* allows you to specify a different class, or callable object, " "that will be called to create the *new* object. By default :class:" "`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" -#: ../../library/unittest.mock.rst:1367 +#: ../../library/unittest.mock.rst:1368 msgid "" "A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " "then the mock will be created with a spec from the object being replaced. " @@ -1018,13 +1018,13 @@ msgid "" "func:`create_autospec` function and :ref:`auto-speccing`." msgstr "" -#: ../../library/unittest.mock.rst:1377 +#: ../../library/unittest.mock.rst:1378 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." msgstr "" -#: ../../library/unittest.mock.rst:1380 +#: ../../library/unittest.mock.rst:1381 msgid "" "By default :func:`patch` will fail to replace attributes that don't exist. " "If you pass in ``create=True``, and the attribute doesn't exist, patch will " @@ -1035,13 +1035,13 @@ msgid "" "write passing tests against APIs that don't actually exist!" msgstr "" -#: ../../library/unittest.mock.rst:1390 +#: ../../library/unittest.mock.rst:1391 msgid "" "If you are patching builtins in a module then you don't need to pass " "``create=True``, it will be added by default." msgstr "" -#: ../../library/unittest.mock.rst:1394 +#: ../../library/unittest.mock.rst:1395 msgid "" "Patch can be used as a :class:`TestCase` class decorator. It works by " "decorating each test method in the class. This reduces the boilerplate code " @@ -1052,7 +1052,7 @@ msgid "" "TEST_PREFIX``." msgstr "" -#: ../../library/unittest.mock.rst:1401 +#: ../../library/unittest.mock.rst:1402 msgid "" "Patch can be used as a context manager, with the with statement. Here the " "patching applies to the indented block after the with statement. If you use " @@ -1060,65 +1060,65 @@ msgid "" "very useful if :func:`patch` is creating a mock object for you." msgstr "" -#: ../../library/unittest.mock.rst:1406 +#: ../../library/unittest.mock.rst:1407 msgid "" ":func:`patch` takes arbitrary keyword arguments. These will be passed to :" "class:`AsyncMock` if the patched object is asynchronous, to :class:" "`MagicMock` otherwise or to *new_callable* if specified." msgstr "" -#: ../../library/unittest.mock.rst:1410 +#: ../../library/unittest.mock.rst:1411 msgid "" "``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are " "available for alternate use-cases." msgstr "" -#: ../../library/unittest.mock.rst:1413 +#: ../../library/unittest.mock.rst:1414 msgid "" ":func:`patch` as function decorator, creating the mock for you and passing " "it into the decorated function::" msgstr "" -#: ../../library/unittest.mock.rst:1423 +#: ../../library/unittest.mock.rst:1424 msgid "" "Patching a class replaces the class with a :class:`MagicMock` *instance*. If " "the class is instantiated in the code under test then it will be the :attr:" "`~Mock.return_value` of the mock that will be used." msgstr "" -#: ../../library/unittest.mock.rst:1427 +#: ../../library/unittest.mock.rst:1428 msgid "" "If the class is instantiated multiple times you could use :attr:`~Mock." "side_effect` to return a new mock each time. Alternatively you can set the " "*return_value* to be anything you want." msgstr "" -#: ../../library/unittest.mock.rst:1431 +#: ../../library/unittest.mock.rst:1432 msgid "" "To configure return values on methods of *instances* on the patched class " "you must do this on the :attr:`return_value`. For example::" msgstr "" -#: ../../library/unittest.mock.rst:1445 +#: ../../library/unittest.mock.rst:1446 msgid "" "If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " "then the return value of the created mock will have the same spec. ::" msgstr "" -#: ../../library/unittest.mock.rst:1455 +#: ../../library/unittest.mock.rst:1456 msgid "" "The *new_callable* argument is useful where you want to use an alternative " "class to the default :class:`MagicMock` for the created mock. For example, " "if you wanted a :class:`NonCallableMock` to be used::" msgstr "" -#: ../../library/unittest.mock.rst:1468 +#: ../../library/unittest.mock.rst:1469 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "" -#: ../../library/unittest.mock.rst:1481 +#: ../../library/unittest.mock.rst:1482 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " "thing you need to do is to configure the mock. Some of that configuration " @@ -1126,7 +1126,7 @@ msgid "" "call will be used to set attributes on the created mock::" msgstr "" -#: ../../library/unittest.mock.rst:1493 +#: ../../library/unittest.mock.rst:1494 msgid "" "As well as attributes on the created mock attributes, like the :attr:`~Mock." "return_value` and :attr:`~Mock.side_effect`, of child mocks can also be " @@ -1135,36 +1135,36 @@ msgid "" "func:`patch` call using ``**``::" msgstr "" -#: ../../library/unittest.mock.rst:1509 +#: ../../library/unittest.mock.rst:1510 msgid "" "By default, attempting to patch a function in a module (or a method or an " "attribute in a class) that does not exist will fail with :exc:" "`AttributeError`::" msgstr "" -#: ../../library/unittest.mock.rst:1521 +#: ../../library/unittest.mock.rst:1522 msgid "" "but adding ``create=True`` in the call to :func:`patch` will make the " "previous example work as expected::" msgstr "" -#: ../../library/unittest.mock.rst:1532 +#: ../../library/unittest.mock.rst:1533 msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" -#: ../../library/unittest.mock.rst:1536 +#: ../../library/unittest.mock.rst:1537 msgid "patch.object" msgstr "patch.object" -#: ../../library/unittest.mock.rst:1540 +#: ../../library/unittest.mock.rst:1541 msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." msgstr "" -#: ../../library/unittest.mock.rst:1543 +#: ../../library/unittest.mock.rst:1544 msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a " "context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " @@ -1173,112 +1173,112 @@ msgid "" "configuring the mock object it creates." msgstr "" -#: ../../library/unittest.mock.rst:1549 +#: ../../library/unittest.mock.rst:1550 msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: ../../library/unittest.mock.rst:1552 +#: ../../library/unittest.mock.rst:1553 msgid "" "You can either call :func:`patch.object` with three arguments or two " "arguments. The three argument form takes the object to be patched, the " "attribute name and the object to replace the attribute with." msgstr "" -#: ../../library/unittest.mock.rst:1556 +#: ../../library/unittest.mock.rst:1557 msgid "" "When calling with the two argument form you omit the replacement object, and " "a mock is created for you and passed in as an extra argument to the " "decorated function:" msgstr "" -#: ../../library/unittest.mock.rst:1567 +#: ../../library/unittest.mock.rst:1568 msgid "" "*spec*, *create* and the other arguments to :func:`patch.object` have the " "same meaning as they do for :func:`patch`." msgstr "" -#: ../../library/unittest.mock.rst:1572 +#: ../../library/unittest.mock.rst:1573 msgid "patch.dict" msgstr "patch.dict" -#: ../../library/unittest.mock.rst:1576 +#: ../../library/unittest.mock.rst:1577 msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "" -#: ../../library/unittest.mock.rst:1579 +#: ../../library/unittest.mock.rst:1580 msgid "" "*in_dict* can be a dictionary or a mapping like container. If it is a " "mapping then it must at least support getting, setting and deleting items " "plus iterating over keys." msgstr "" -#: ../../library/unittest.mock.rst:1583 +#: ../../library/unittest.mock.rst:1584 msgid "" "*in_dict* can also be a string specifying the name of the dictionary, which " "will then be fetched by importing it." msgstr "" -#: ../../library/unittest.mock.rst:1586 +#: ../../library/unittest.mock.rst:1587 msgid "" "*values* can be a dictionary of values to set in the dictionary. *values* " "can also be an iterable of ``(key, value)`` pairs." msgstr "" -#: ../../library/unittest.mock.rst:1589 +#: ../../library/unittest.mock.rst:1590 msgid "" "If *clear* is true then the dictionary will be cleared before the new values " "are set." msgstr "" -#: ../../library/unittest.mock.rst:1592 +#: ../../library/unittest.mock.rst:1593 msgid "" ":func:`patch.dict` can also be called with arbitrary keyword arguments to " "set values in the dictionary." msgstr "" -#: ../../library/unittest.mock.rst:1597 +#: ../../library/unittest.mock.rst:1598 msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr "" -#: ../../library/unittest.mock.rst:1600 +#: ../../library/unittest.mock.rst:1601 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr "" -#: ../../library/unittest.mock.rst:1610 +#: ../../library/unittest.mock.rst:1612 msgid "" "When used as a class decorator :func:`patch.dict` honours ``patch." "TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" msgstr "" -#: ../../library/unittest.mock.rst:1621 +#: ../../library/unittest.mock.rst:1623 msgid "" "If you want to use a different prefix for your test, you can inform the " "patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more " "details about how to change the value of see :ref:`test-prefix`." msgstr "" -#: ../../library/unittest.mock.rst:1625 +#: ../../library/unittest.mock.rst:1627 msgid "" ":func:`patch.dict` can be used to add members to a dictionary, or simply let " "a test change a dictionary, and ensure the dictionary is restored when the " "test ends." msgstr "" -#: ../../library/unittest.mock.rst:1646 +#: ../../library/unittest.mock.rst:1648 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "" -#: ../../library/unittest.mock.rst:1656 +#: ../../library/unittest.mock.rst:1658 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " @@ -1287,18 +1287,18 @@ msgid "" "`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" -#: ../../library/unittest.mock.rst:1685 +#: ../../library/unittest.mock.rst:1687 msgid "patch.multiple" msgstr "patch.multiple" -#: ../../library/unittest.mock.rst:1689 +#: ../../library/unittest.mock.rst:1691 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " "(either as an object or a string to fetch the object by importing) and " "keyword arguments for the patches::" msgstr "" -#: ../../library/unittest.mock.rst:1696 +#: ../../library/unittest.mock.rst:1698 msgid "" "Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " "create mocks for you. In this case the created mocks are passed into a " @@ -1306,7 +1306,7 @@ msgid "" "`patch.multiple` is used as a context manager." msgstr "" -#: ../../library/unittest.mock.rst:1701 +#: ../../library/unittest.mock.rst:1703 msgid "" ":func:`patch.multiple` can be used as a decorator, class decorator or a " "context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " @@ -1314,13 +1314,13 @@ msgid "" "will be applied to *all* patches done by :func:`patch.multiple`." msgstr "" -#: ../../library/unittest.mock.rst:1706 +#: ../../library/unittest.mock.rst:1708 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: ../../library/unittest.mock.rst:1709 +#: ../../library/unittest.mock.rst:1711 msgid "" "If you want :func:`patch.multiple` to create mocks for you, then you can " "use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " @@ -1328,32 +1328,32 @@ msgid "" "keyword. ::" msgstr "" -#: ../../library/unittest.mock.rst:1723 +#: ../../library/unittest.mock.rst:1725 msgid "" ":func:`patch.multiple` can be nested with other ``patch`` decorators, but " "put arguments passed by keyword *after* any of the standard arguments " "created by :func:`patch`::" msgstr "" -#: ../../library/unittest.mock.rst:1735 +#: ../../library/unittest.mock.rst:1737 msgid "" "If :func:`patch.multiple` is used as a context manager, the value returned " "by the context manager is a dictionary where created mocks are keyed by " "name::" msgstr "" -#: ../../library/unittest.mock.rst:1749 +#: ../../library/unittest.mock.rst:1751 msgid "patch methods: start and stop" msgstr "" -#: ../../library/unittest.mock.rst:1751 +#: ../../library/unittest.mock.rst:1753 msgid "" "All the patchers have :meth:`start` and :meth:`stop` methods. These make it " "simpler to do patching in ``setUp`` methods or where you want to do multiple " "patches without nesting decorators or with statements." msgstr "" -#: ../../library/unittest.mock.rst:1755 +#: ../../library/unittest.mock.rst:1757 msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " "as normal and keep a reference to the returned ``patcher`` object. You can " @@ -1361,19 +1361,19 @@ msgid "" "it." msgstr "" -#: ../../library/unittest.mock.rst:1759 +#: ../../library/unittest.mock.rst:1761 msgid "" "If you are using :func:`patch` to create a mock for you then it will be " "returned by the call to ``patcher.start``. ::" msgstr "" -#: ../../library/unittest.mock.rst:1773 +#: ../../library/unittest.mock.rst:1775 msgid "" "A typical use case for this might be for doing multiple patches in the " "``setUp`` method of a :class:`TestCase`::" msgstr "" -#: ../../library/unittest.mock.rst:1795 +#: ../../library/unittest.mock.rst:1797 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -1381,37 +1381,37 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: ../../library/unittest.mock.rst:1810 +#: ../../library/unittest.mock.rst:1812 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "" -#: ../../library/unittest.mock.rst:1813 +#: ../../library/unittest.mock.rst:1815 msgid "" "It is also possible to stop all patches which have been started by using :" "func:`patch.stopall`." msgstr "" -#: ../../library/unittest.mock.rst:1818 +#: ../../library/unittest.mock.rst:1820 msgid "Stop all active patches. Only stops patches started with ``start``." msgstr "" -#: ../../library/unittest.mock.rst:1824 +#: ../../library/unittest.mock.rst:1826 msgid "patch builtins" msgstr "" -#: ../../library/unittest.mock.rst:1825 +#: ../../library/unittest.mock.rst:1827 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" -#: ../../library/unittest.mock.rst:1840 +#: ../../library/unittest.mock.rst:1842 msgid "TEST_PREFIX" msgstr "TEST_PREFIX" -#: ../../library/unittest.mock.rst:1842 +#: ../../library/unittest.mock.rst:1844 msgid "" "All of the patchers can be used as class decorators. When used in this way " "they wrap every test method on the class. The patchers recognise methods " @@ -1419,39 +1419,39 @@ msgid "" "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" -#: ../../library/unittest.mock.rst:1847 +#: ../../library/unittest.mock.rst:1849 msgid "" "It is possible that you want to use a different prefix for your tests. You " "can inform the patchers of the different prefix by setting ``patch." "TEST_PREFIX``::" msgstr "" -#: ../../library/unittest.mock.rst:1870 +#: ../../library/unittest.mock.rst:1872 msgid "Nesting Patch Decorators" msgstr "" -#: ../../library/unittest.mock.rst:1872 +#: ../../library/unittest.mock.rst:1874 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." msgstr "" -#: ../../library/unittest.mock.rst:1875 +#: ../../library/unittest.mock.rst:1877 msgid "You can stack up multiple patch decorators using this pattern:" msgstr "" -#: ../../library/unittest.mock.rst:1891 +#: ../../library/unittest.mock.rst:1893 msgid "" "Note that the decorators are applied from the bottom upwards. This is the " "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" -#: ../../library/unittest.mock.rst:1899 +#: ../../library/unittest.mock.rst:1901 msgid "Where to patch" msgstr "" -#: ../../library/unittest.mock.rst:1901 +#: ../../library/unittest.mock.rst:1903 msgid "" ":func:`patch` works by (temporarily) changing the object that a *name* " "points to with another one. There can be many names pointing to any " @@ -1459,19 +1459,19 @@ msgid "" "the name used by the system under test." msgstr "" -#: ../../library/unittest.mock.rst:1906 +#: ../../library/unittest.mock.rst:1908 msgid "" "The basic principle is that you patch where an object is *looked up*, which " "is not necessarily the same place as where it is defined. A couple of " "examples will help to clarify this." msgstr "" -#: ../../library/unittest.mock.rst:1910 +#: ../../library/unittest.mock.rst:1912 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "" -#: ../../library/unittest.mock.rst:1919 +#: ../../library/unittest.mock.rst:1921 msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " "using :func:`patch`. The problem is that when we import module b, which we " @@ -1481,7 +1481,7 @@ msgid "" "like our patching had no effect." msgstr "" -#: ../../library/unittest.mock.rst:1926 +#: ../../library/unittest.mock.rst:1928 msgid "" "The key is to patch out ``SomeClass`` where it is used (or where it is " "looked up). In this case ``some_function`` will actually look up " @@ -1489,7 +1489,7 @@ msgid "" "look like::" msgstr "" -#: ../../library/unittest.mock.rst:1932 +#: ../../library/unittest.mock.rst:1934 msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." @@ -1498,11 +1498,11 @@ msgid "" "``a.SomeClass`` instead::" msgstr "" -#: ../../library/unittest.mock.rst:1941 +#: ../../library/unittest.mock.rst:1943 msgid "Patching Descriptors and Proxy Objects" msgstr "" -#: ../../library/unittest.mock.rst:1943 +#: ../../library/unittest.mock.rst:1945 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the " @@ -1512,22 +1512,22 @@ msgid "" "arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" -#: ../../library/unittest.mock.rst:1951 +#: ../../library/unittest.mock.rst:1953 msgid "MagicMock and magic method support" msgstr "" -#: ../../library/unittest.mock.rst:1956 +#: ../../library/unittest.mock.rst:1958 msgid "Mocking Magic Methods" msgstr "" -#: ../../library/unittest.mock.rst:1958 +#: ../../library/unittest.mock.rst:1960 msgid "" ":class:`Mock` supports mocking the Python protocol methods, also known as " "\"magic methods\". This allows mock objects to replace containers or other " "objects that implement Python protocols." msgstr "" -#: ../../library/unittest.mock.rst:1962 +#: ../../library/unittest.mock.rst:1964 msgid "" "Because magic methods are looked up differently from normal methods [#]_, " "this support has been specially implemented. This means that only specific " @@ -1535,73 +1535,73 @@ msgid "" "them. If there are any missing that you need please let us know." msgstr "" -#: ../../library/unittest.mock.rst:1967 +#: ../../library/unittest.mock.rst:1969 msgid "" "You mock magic methods by setting the method you are interested in to a " "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" -#: ../../library/unittest.mock.rst:1990 +#: ../../library/unittest.mock.rst:1992 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "" -#: ../../library/unittest.mock.rst:2002 +#: ../../library/unittest.mock.rst:2004 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" -#: ../../library/unittest.mock.rst:2007 +#: ../../library/unittest.mock.rst:2009 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " "set a magic method that isn't in the spec will raise an :exc:" "`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:2010 +#: ../../library/unittest.mock.rst:2012 msgid "The full list of supported magic methods is:" msgstr "" -#: ../../library/unittest.mock.rst:2012 +#: ../../library/unittest.mock.rst:2014 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" msgstr "``__hash__``\\ 、\\ ``__sizeof__``\\ 、\\ ``__repr__`` 和 ``__str__``" -#: ../../library/unittest.mock.rst:2013 +#: ../../library/unittest.mock.rst:2015 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" msgstr "``__dir__``\\ 、\\ ``__format__`` 和 ``__subclasses__``" -#: ../../library/unittest.mock.rst:2014 +#: ../../library/unittest.mock.rst:2016 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" msgstr "" "``__round__``\\ 、\\ ``__floor__``\\ 、\\ ``__trunc__`` 和 ``__ceil__``" -#: ../../library/unittest.mock.rst:2015 +#: ../../library/unittest.mock.rst:2017 msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" msgstr "" -#: ../../library/unittest.mock.rst:2017 +#: ../../library/unittest.mock.rst:2019 msgid "" "Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, " "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " "``__missing__``" msgstr "" -#: ../../library/unittest.mock.rst:2020 +#: ../../library/unittest.mock.rst:2022 msgid "" "Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " "``__aexit__``" msgstr "" -#: ../../library/unittest.mock.rst:2021 +#: ../../library/unittest.mock.rst:2023 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" msgstr "" -#: ../../library/unittest.mock.rst:2022 +#: ../../library/unittest.mock.rst:2024 msgid "" "The numeric methods (including right hand and in-place variants): " "``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__truediv__``, " @@ -1609,103 +1609,103 @@ msgid "" "``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``" msgstr "" -#: ../../library/unittest.mock.rst:2026 +#: ../../library/unittest.mock.rst:2028 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" -#: ../../library/unittest.mock.rst:2028 +#: ../../library/unittest.mock.rst:2030 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" msgstr "" -#: ../../library/unittest.mock.rst:2029 +#: ../../library/unittest.mock.rst:2031 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" msgstr "" -#: ../../library/unittest.mock.rst:2031 +#: ../../library/unittest.mock.rst:2033 msgid "File system path representation: ``__fspath__``" msgstr "" -#: ../../library/unittest.mock.rst:2032 +#: ../../library/unittest.mock.rst:2034 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" msgstr "" -#: ../../library/unittest.mock.rst:2034 +#: ../../library/unittest.mock.rst:2036 msgid "Added support for :func:`os.PathLike.__fspath__`." msgstr "" -#: ../../library/unittest.mock.rst:2037 +#: ../../library/unittest.mock.rst:2039 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" -#: ../../library/unittest.mock.rst:2041 +#: ../../library/unittest.mock.rst:2043 msgid "" "The following methods exist but are *not* supported as they are either in " "use by mock, can't be set dynamically, or can cause problems:" msgstr "" -#: ../../library/unittest.mock.rst:2044 +#: ../../library/unittest.mock.rst:2046 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" msgstr "" "``__getattr__``\\ 、\\ ``__setattr__``\\ 、\\ ``__init__`` 和 ``__new__``" -#: ../../library/unittest.mock.rst:2045 +#: ../../library/unittest.mock.rst:2047 msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" "``__prepare__``\\ 、\\ ``__instancecheck__``\\ 、\\ " "``__subclasscheck__``\\ 、\\ ``__del__``" -#: ../../library/unittest.mock.rst:2050 +#: ../../library/unittest.mock.rst:2052 msgid "Magic Mock" msgstr "" -#: ../../library/unittest.mock.rst:2052 +#: ../../library/unittest.mock.rst:2054 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" -#: ../../library/unittest.mock.rst:2057 +#: ../../library/unittest.mock.rst:2059 msgid "" "``MagicMock`` is a subclass of :class:`Mock` with default implementations of " "most of the magic methods. You can use ``MagicMock`` without having to " "configure the magic methods yourself." msgstr "" -#: ../../library/unittest.mock.rst:2061 +#: ../../library/unittest.mock.rst:2063 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "" -#: ../../library/unittest.mock.rst:2063 +#: ../../library/unittest.mock.rst:2065 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." msgstr "" -#: ../../library/unittest.mock.rst:2069 +#: ../../library/unittest.mock.rst:2071 msgid "A non-callable version of :class:`MagicMock`." msgstr "" -#: ../../library/unittest.mock.rst:2071 +#: ../../library/unittest.mock.rst:2073 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " "with the exception of *return_value* and *side_effect* which have no meaning " "on a non-callable mock." msgstr "" -#: ../../library/unittest.mock.rst:2075 +#: ../../library/unittest.mock.rst:2077 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" msgstr "" -#: ../../library/unittest.mock.rst:2085 +#: ../../library/unittest.mock.rst:2087 msgid "" "By default many of the protocol methods are required to return objects of a " "specific type. These methods are preconfigured with a default return value, " @@ -1714,83 +1714,83 @@ msgid "" "manually if you want to change the default." msgstr "" -#: ../../library/unittest.mock.rst:2091 +#: ../../library/unittest.mock.rst:2093 msgid "Methods and their defaults:" msgstr "" -#: ../../library/unittest.mock.rst:2093 +#: ../../library/unittest.mock.rst:2095 msgid "``__lt__``: ``NotImplemented``" msgstr "``__lt__``\\ :\\ ``NotImplemented``" -#: ../../library/unittest.mock.rst:2094 +#: ../../library/unittest.mock.rst:2096 msgid "``__gt__``: ``NotImplemented``" msgstr "``__gt__``\\ :\\ ``NotImplemented``" -#: ../../library/unittest.mock.rst:2095 +#: ../../library/unittest.mock.rst:2097 msgid "``__le__``: ``NotImplemented``" msgstr "``__le__``\\ :\\ ``NotImplemented``" -#: ../../library/unittest.mock.rst:2096 +#: ../../library/unittest.mock.rst:2098 msgid "``__ge__``: ``NotImplemented``" msgstr "``__ge__``\\ :\\ ``NotImplemented``" -#: ../../library/unittest.mock.rst:2097 +#: ../../library/unittest.mock.rst:2099 msgid "``__int__``: ``1``" msgstr "``__int__``\\ :\\ ``1``" -#: ../../library/unittest.mock.rst:2098 +#: ../../library/unittest.mock.rst:2100 msgid "``__contains__``: ``False``" msgstr "``__contains__``\\ :\\ ``False``" -#: ../../library/unittest.mock.rst:2099 +#: ../../library/unittest.mock.rst:2101 msgid "``__len__``: ``0``" msgstr "``__len__``\\ :\\ ``0``" -#: ../../library/unittest.mock.rst:2100 +#: ../../library/unittest.mock.rst:2102 msgid "``__iter__``: ``iter([])``" msgstr "``__iter__``\\ :\\ ``iter([])``" -#: ../../library/unittest.mock.rst:2101 +#: ../../library/unittest.mock.rst:2103 msgid "``__exit__``: ``False``" msgstr "``__exit__``\\ :\\ ``False``" -#: ../../library/unittest.mock.rst:2102 +#: ../../library/unittest.mock.rst:2104 msgid "``__aexit__``: ``False``" msgstr "``__aexit__``\\ :\\ ``False``" -#: ../../library/unittest.mock.rst:2103 +#: ../../library/unittest.mock.rst:2105 msgid "``__complex__``: ``1j``" msgstr "``__complex__``\\ :\\ ``1j``" -#: ../../library/unittest.mock.rst:2104 +#: ../../library/unittest.mock.rst:2106 msgid "``__float__``: ``1.0``" msgstr "``__float__``\\ :\\ ``1.0``" -#: ../../library/unittest.mock.rst:2105 +#: ../../library/unittest.mock.rst:2107 msgid "``__bool__``: ``True``" msgstr "``__bool__``\\ :\\ ``True``" -#: ../../library/unittest.mock.rst:2106 +#: ../../library/unittest.mock.rst:2108 msgid "``__index__``: ``1``" msgstr "``__index__``\\ :\\ ``1``" -#: ../../library/unittest.mock.rst:2107 +#: ../../library/unittest.mock.rst:2109 msgid "``__hash__``: default hash for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2108 +#: ../../library/unittest.mock.rst:2110 msgid "``__str__``: default str for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2109 +#: ../../library/unittest.mock.rst:2111 msgid "``__sizeof__``: default sizeof for the mock" msgstr "" -#: ../../library/unittest.mock.rst:2111 +#: ../../library/unittest.mock.rst:2113 msgid "For example:" msgstr "舉例來說:" -#: ../../library/unittest.mock.rst:2123 +#: ../../library/unittest.mock.rst:2125 msgid "" "The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. " "They do the default equality comparison on identity, using the :attr:`~Mock." @@ -1798,102 +1798,102 @@ msgid "" "something else::" msgstr "" -#: ../../library/unittest.mock.rst:2137 +#: ../../library/unittest.mock.rst:2139 msgid "" "The return value of :meth:`MagicMock.__iter__` can be any iterable object " "and isn't required to be an iterator:" msgstr "" -#: ../../library/unittest.mock.rst:2147 +#: ../../library/unittest.mock.rst:2149 msgid "" "If the return value *is* an iterator, then iterating over it once will " "consume it and subsequent iterations will result in an empty list:" msgstr "" -#: ../../library/unittest.mock.rst:2156 +#: ../../library/unittest.mock.rst:2158 msgid "" "``MagicMock`` has all of the supported magic methods configured except for " "some of the obscure and obsolete ones. You can still set these up if you " "want." msgstr "" -#: ../../library/unittest.mock.rst:2159 +#: ../../library/unittest.mock.rst:2161 msgid "" "Magic methods that are supported but not setup by default in ``MagicMock`` " "are:" msgstr "" -#: ../../library/unittest.mock.rst:2161 +#: ../../library/unittest.mock.rst:2163 msgid "``__subclasses__``" msgstr "``__subclasses__``" -#: ../../library/unittest.mock.rst:2162 +#: ../../library/unittest.mock.rst:2164 msgid "``__dir__``" msgstr "``__dir__``" -#: ../../library/unittest.mock.rst:2163 +#: ../../library/unittest.mock.rst:2165 msgid "``__format__``" msgstr "``__format__``" -#: ../../library/unittest.mock.rst:2164 +#: ../../library/unittest.mock.rst:2166 msgid "``__get__``, ``__set__`` and ``__delete__``" msgstr "``__get__``\\ 、\\ ``__set__`` 和 ``__delete__``" -#: ../../library/unittest.mock.rst:2165 +#: ../../library/unittest.mock.rst:2167 msgid "``__reversed__`` and ``__missing__``" msgstr "``__reversed__`` 和 ``__missing__``" -#: ../../library/unittest.mock.rst:2166 +#: ../../library/unittest.mock.rst:2168 msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" msgstr "" -#: ../../library/unittest.mock.rst:2168 +#: ../../library/unittest.mock.rst:2170 msgid "``__getformat__``" msgstr "``__getformat__``" -#: ../../library/unittest.mock.rst:2172 +#: ../../library/unittest.mock.rst:2174 msgid "" "Magic methods *should* be looked up on the class rather than the instance. " "Different versions of Python are inconsistent about applying this rule. The " "supported protocol methods should work with all supported versions of Python." msgstr "" -#: ../../library/unittest.mock.rst:2176 +#: ../../library/unittest.mock.rst:2178 msgid "" "The function is basically hooked up to the class, but each ``Mock`` instance " "is kept isolated from the others." msgstr "" -#: ../../library/unittest.mock.rst:2181 +#: ../../library/unittest.mock.rst:2183 msgid "Helpers" msgstr "" -#: ../../library/unittest.mock.rst:2184 +#: ../../library/unittest.mock.rst:2186 msgid "sentinel" msgstr "" -#: ../../library/unittest.mock.rst:2188 +#: ../../library/unittest.mock.rst:2190 msgid "" "The ``sentinel`` object provides a convenient way of providing unique " "objects for your tests." msgstr "" -#: ../../library/unittest.mock.rst:2191 +#: ../../library/unittest.mock.rst:2193 msgid "" "Attributes are created on demand when you access them by name. Accessing the " "same attribute will always return the same object. The objects returned have " "a sensible repr so that test failure messages are readable." msgstr "" -#: ../../library/unittest.mock.rst:2195 +#: ../../library/unittest.mock.rst:2197 msgid "" "The ``sentinel`` attributes now preserve their identity when they are :mod:" "`copied ` or :mod:`pickled `." msgstr "" -#: ../../library/unittest.mock.rst:2199 +#: ../../library/unittest.mock.rst:2201 msgid "" "Sometimes when testing you need to test that a specific object is passed as " "an argument to another method, or returned. It can be common to create named " @@ -1901,28 +1901,28 @@ msgid "" "creating and testing the identity of objects like this." msgstr "" -#: ../../library/unittest.mock.rst:2204 +#: ../../library/unittest.mock.rst:2206 msgid "" "In this example we monkey patch ``method`` to return ``sentinel." "some_object``:" msgstr "" -#: ../../library/unittest.mock.rst:2216 +#: ../../library/unittest.mock.rst:2218 msgid "DEFAULT" msgstr "DEFAULT" -#: ../../library/unittest.mock.rst:2221 +#: ../../library/unittest.mock.rst:2223 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." "DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " "indicate that the normal return value should be used." msgstr "" -#: ../../library/unittest.mock.rst:2227 +#: ../../library/unittest.mock.rst:2229 msgid "call" msgstr "" -#: ../../library/unittest.mock.rst:2231 +#: ../../library/unittest.mock.rst:2233 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." @@ -1930,13 +1930,13 @@ msgid "" "with :meth:`~Mock.assert_has_calls`." msgstr "" -#: ../../library/unittest.mock.rst:2244 +#: ../../library/unittest.mock.rst:2246 msgid "" "For a call object that represents multiple calls, :meth:`call_list` returns " "a list of all the intermediate calls as well as the final call." msgstr "" -#: ../../library/unittest.mock.rst:2248 +#: ../../library/unittest.mock.rst:2250 msgid "" "``call_list`` is particularly useful for making assertions on \"chained " "calls\". A chained call is multiple calls on a single line of code. This " @@ -1944,13 +1944,13 @@ msgid "" "constructing the sequence of calls can be tedious." msgstr "" -#: ../../library/unittest.mock.rst:2253 +#: ../../library/unittest.mock.rst:2255 msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr "" -#: ../../library/unittest.mock.rst:2270 +#: ../../library/unittest.mock.rst:2272 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " @@ -1960,7 +1960,7 @@ msgid "" "to get at the individual arguments they contain." msgstr "" -#: ../../library/unittest.mock.rst:2277 +#: ../../library/unittest.mock.rst:2279 msgid "" "The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." "call_args_list` are two-tuples of (positional args, keyword args) whereas " @@ -1969,7 +1969,7 @@ msgid "" "args)." msgstr "" -#: ../../library/unittest.mock.rst:2282 +#: ../../library/unittest.mock.rst:2284 msgid "" "You can use their \"tupleness\" to pull out the individual arguments for " "more complex introspection and assertions. The positional arguments are a " @@ -1977,29 +1977,29 @@ msgid "" "arguments are a dictionary:" msgstr "" -#: ../../library/unittest.mock.rst:2315 +#: ../../library/unittest.mock.rst:2317 msgid "create_autospec" msgstr "create_autospec" -#: ../../library/unittest.mock.rst:2319 +#: ../../library/unittest.mock.rst:2321 msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." msgstr "" -#: ../../library/unittest.mock.rst:2323 +#: ../../library/unittest.mock.rst:2325 msgid "" "Functions or methods being mocked will have their arguments checked to " "ensure that they are called with the correct signature." msgstr "" -#: ../../library/unittest.mock.rst:2326 +#: ../../library/unittest.mock.rst:2328 msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/unittest.mock.rst:2329 +#: ../../library/unittest.mock.rst:2331 msgid "" "If a class is used as a spec then the return value of the mock (the instance " "of the class) will have the same spec. You can use a class as the spec for " @@ -2007,29 +2007,29 @@ msgid "" "be callable if instances of the mock are callable." msgstr "" -#: ../../library/unittest.mock.rst:2334 +#: ../../library/unittest.mock.rst:2336 msgid "" ":func:`create_autospec` also takes arbitrary keyword arguments that are " "passed to the constructor of the created mock." msgstr "" -#: ../../library/unittest.mock.rst:2337 +#: ../../library/unittest.mock.rst:2339 msgid "" "See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" "`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" -#: ../../library/unittest.mock.rst:2343 +#: ../../library/unittest.mock.rst:2345 msgid "" ":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " "an async function." msgstr "" -#: ../../library/unittest.mock.rst:2348 +#: ../../library/unittest.mock.rst:2350 msgid "ANY" msgstr "ANY" -#: ../../library/unittest.mock.rst:2352 +#: ../../library/unittest.mock.rst:2354 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " "call to mock, but either not care about some of the arguments or want to " @@ -2037,24 +2037,24 @@ msgid "" "assertions on them." msgstr "" -#: ../../library/unittest.mock.rst:2357 +#: ../../library/unittest.mock.rst:2359 msgid "" "To ignore certain arguments you can pass in objects that compare equal to " "*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" -#: ../../library/unittest.mock.rst:2366 +#: ../../library/unittest.mock.rst:2368 msgid "" ":data:`ANY` can also be used in comparisons with call lists like :attr:" "`~Mock.mock_calls`:" msgstr "" -#: ../../library/unittest.mock.rst:2379 +#: ../../library/unittest.mock.rst:2381 msgid "FILTER_DIR" msgstr "FILTER_DIR" -#: ../../library/unittest.mock.rst:2383 +#: ../../library/unittest.mock.rst:2385 msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir`. The default is ``True``, which uses the " @@ -2063,7 +2063,7 @@ msgid "" "FILTER_DIR = False``." msgstr "" -#: ../../library/unittest.mock.rst:2389 +#: ../../library/unittest.mock.rst:2391 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " "include any dynamically created attributes that wouldn't normally be shown. " @@ -2072,7 +2072,7 @@ msgid "" "yet:" msgstr "" -#: ../../library/unittest.mock.rst:2416 +#: ../../library/unittest.mock.rst:2418 msgid "" "Many of the not-very-useful (private to :class:`Mock` rather than the thing " "being mocked) underscore and double underscore prefixed attributes have been " @@ -2081,31 +2081,31 @@ msgid "" "switch :data:`FILTER_DIR`:" msgstr "" -#: ../../library/unittest.mock.rst:2437 +#: ../../library/unittest.mock.rst:2439 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " "of :data:`mock.FILTER_DIR`." msgstr "" -#: ../../library/unittest.mock.rst:2443 +#: ../../library/unittest.mock.rst:2445 msgid "mock_open" msgstr "mock_open" -#: ../../library/unittest.mock.rst:2447 +#: ../../library/unittest.mock.rst:2449 msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." msgstr "" -#: ../../library/unittest.mock.rst:2450 +#: ../../library/unittest.mock.rst:2452 msgid "" "The *mock* argument is the mock object to configure. If ``None`` (the " "default) then a :class:`MagicMock` will be created for you, with the API " "limited to methods or attributes available on standard file handles." msgstr "" -#: ../../library/unittest.mock.rst:2454 +#: ../../library/unittest.mock.rst:2456 msgid "" "*read_data* is a string for the :meth:`~io.IOBase.read`, :meth:`~io.IOBase." "readline`, and :meth:`~io.IOBase.readlines` methods of the file handle to " @@ -2118,51 +2118,51 @@ msgid "" "realistic filesystem for testing." msgstr "" -#: ../../library/unittest.mock.rst:2464 +#: ../../library/unittest.mock.rst:2466 msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " "The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -#: ../../library/unittest.mock.rst:2469 +#: ../../library/unittest.mock.rst:2471 msgid "*read_data* is now reset on each call to the *mock*." msgstr "" -#: ../../library/unittest.mock.rst:2472 +#: ../../library/unittest.mock.rst:2474 msgid "" "Added :meth:`__iter__` to implementation so that iteration (such as in for " "loops) correctly consumes *read_data*." msgstr "" -#: ../../library/unittest.mock.rst:2476 +#: ../../library/unittest.mock.rst:2478 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" -#: ../../library/unittest.mock.rst:2482 +#: ../../library/unittest.mock.rst:2484 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " "*returned object* that is used as a context manager (and has :meth:" "`__enter__` and :meth:`__exit__` called)." msgstr "" -#: ../../library/unittest.mock.rst:2486 +#: ../../library/unittest.mock.rst:2488 msgid "" "Mocking context managers with a :class:`MagicMock` is common enough and " "fiddly enough that a helper function is useful. ::" msgstr "" -#: ../../library/unittest.mock.rst:2503 +#: ../../library/unittest.mock.rst:2505 msgid "And for reading files::" msgstr "" -#: ../../library/unittest.mock.rst:2516 +#: ../../library/unittest.mock.rst:2518 msgid "Autospeccing" msgstr "" -#: ../../library/unittest.mock.rst:2518 +#: ../../library/unittest.mock.rst:2520 msgid "" "Autospeccing is based on the existing :attr:`spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " @@ -2172,11 +2172,11 @@ msgid "" "`TypeError` if they are called incorrectly." msgstr "" -#: ../../library/unittest.mock.rst:2525 +#: ../../library/unittest.mock.rst:2527 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "" -#: ../../library/unittest.mock.rst:2527 +#: ../../library/unittest.mock.rst:2529 msgid "" ":class:`Mock` is a very powerful and flexible object, but it suffers from " "two flaws when used to mock out objects from a system under test. One of " @@ -2184,25 +2184,25 @@ msgid "" "general problem with using mock objects." msgstr "" -#: ../../library/unittest.mock.rst:2532 +#: ../../library/unittest.mock.rst:2534 msgid "" "First the problem specific to :class:`Mock`. :class:`Mock` has two assert " "methods that are extremely handy: :meth:`~Mock.assert_called_with` and :meth:" "`~Mock.assert_called_once_with`." msgstr "" -#: ../../library/unittest.mock.rst:2545 +#: ../../library/unittest.mock.rst:2547 msgid "" "Because mocks auto-create attributes on demand, and allow you to call them " "with arbitrary arguments, if you misspell one of these assert methods then " "your assertion is gone:" msgstr "" -#: ../../library/unittest.mock.rst:2555 +#: ../../library/unittest.mock.rst:2557 msgid "Your tests can pass silently and incorrectly because of the typo." msgstr "" -#: ../../library/unittest.mock.rst:2557 +#: ../../library/unittest.mock.rst:2559 msgid "" "The second issue is more general to mocking. If you refactor some of your " "code, rename members and so on, any tests for code that is still using the " @@ -2210,7 +2210,7 @@ msgid "" "means your tests can all pass even though your code is broken." msgstr "" -#: ../../library/unittest.mock.rst:2562 +#: ../../library/unittest.mock.rst:2564 msgid "" "Note that this is another reason why you need integration tests as well as " "unit tests. Testing everything in isolation is all fine and dandy, but if " @@ -2218,20 +2218,20 @@ msgid "" "room for bugs that tests might have caught." msgstr "" -#: ../../library/unittest.mock.rst:2567 +#: ../../library/unittest.mock.rst:2569 msgid "" ":mod:`mock` already provides a feature to help with this, called speccing. " "If you use a class or instance as the :attr:`spec` for a mock then you can " "only access attributes on the mock that exist on the real class:" msgstr "" -#: ../../library/unittest.mock.rst:2578 +#: ../../library/unittest.mock.rst:2580 msgid "" "The spec only applies to the mock itself, so we still have the same issue " "with any methods on the mock:" msgstr "" -#: ../../library/unittest.mock.rst:2587 +#: ../../library/unittest.mock.rst:2589 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " @@ -2243,24 +2243,24 @@ msgid "" "import modules) without a big performance hit." msgstr "" -#: ../../library/unittest.mock.rst:2596 +#: ../../library/unittest.mock.rst:2598 msgid "Here's an example of it in use::" msgstr "" -#: ../../library/unittest.mock.rst:2606 +#: ../../library/unittest.mock.rst:2608 msgid "" "You can see that :class:`request.Request` has a spec. :class:`request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" -#: ../../library/unittest.mock.rst:2615 +#: ../../library/unittest.mock.rst:2617 msgid "" "The spec also applies to instantiated classes (i.e. the return value of " "specced mocks)::" msgstr "" -#: ../../library/unittest.mock.rst:2622 +#: ../../library/unittest.mock.rst:2624 msgid "" ":class:`Request` objects are not callable, so the return value of " "instantiating our mocked out :class:`request.Request` is a non-callable " @@ -2268,20 +2268,20 @@ msgid "" "error::" msgstr "" -#: ../../library/unittest.mock.rst:2634 +#: ../../library/unittest.mock.rst:2636 msgid "" "In many cases you will just be able to add ``autospec=True`` to your " "existing :func:`patch` calls and then be protected against bugs due to typos " "and api changes." msgstr "" -#: ../../library/unittest.mock.rst:2638 +#: ../../library/unittest.mock.rst:2640 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" -#: ../../library/unittest.mock.rst:2646 +#: ../../library/unittest.mock.rst:2648 msgid "" "This isn't without caveats and limitations however, which is why it is not " "the default behaviour. In order to know what attributes are available on the " @@ -2293,7 +2293,7 @@ msgid "" "objects so that introspection is safe [#]_." msgstr "" -#: ../../library/unittest.mock.rst:2655 +#: ../../library/unittest.mock.rst:2657 msgid "" "A more serious problem is that it is common for instance attributes to be " "created in the :meth:`__init__` method and not to exist on the class at all. " @@ -2301,7 +2301,7 @@ msgid "" "the api to visible attributes. ::" msgstr "" -#: ../../library/unittest.mock.rst:2672 +#: ../../library/unittest.mock.rst:2674 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -2310,7 +2310,7 @@ msgid "" "setting them::" msgstr "" -#: ../../library/unittest.mock.rst:2683 +#: ../../library/unittest.mock.rst:2685 msgid "" "There is a more aggressive version of both *spec* and *autospec* that *does* " "prevent you setting non-existent attributes. This is useful if you want to " @@ -2318,7 +2318,7 @@ msgid "" "this particular scenario:" msgstr "" -#: ../../library/unittest.mock.rst:2696 +#: ../../library/unittest.mock.rst:2698 msgid "" "Probably the best way of solving the problem is to add class attributes as " "default values for instance members initialised in :meth:`__init__`. Note " @@ -2327,7 +2327,7 @@ msgid "" "faster too. e.g." msgstr "" -#: ../../library/unittest.mock.rst:2706 +#: ../../library/unittest.mock.rst:2708 msgid "" "This brings up another issue. It is relatively common to provide a default " "value of ``None`` for members that will later be an object of a different " @@ -2338,7 +2338,7 @@ msgid "" "These will just be ordinary mocks (well - MagicMocks):" msgstr "" -#: ../../library/unittest.mock.rst:2721 +#: ../../library/unittest.mock.rst:2723 msgid "" "If modifying your production classes to add defaults isn't to your liking " "then there are more options. One of these is simply to use an instance as " @@ -2349,25 +2349,25 @@ msgid "" "alternative object as the *autospec* argument::" msgstr "" -#: ../../library/unittest.mock.rst:2742 +#: ../../library/unittest.mock.rst:2744 msgid "" "This only applies to classes or already instantiated objects. Calling a " "mocked class to create a mock instance *does not* create a real instance. It " "is only attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" -#: ../../library/unittest.mock.rst:2747 +#: ../../library/unittest.mock.rst:2749 msgid "Sealing mocks" msgstr "" -#: ../../library/unittest.mock.rst:2756 +#: ../../library/unittest.mock.rst:2758 msgid "" "Seal will disable the automatic creation of mocks when accessing an " "attribute of the mock being sealed or any of its attributes that are already " "mocks recursively." msgstr "" -#: ../../library/unittest.mock.rst:2759 +#: ../../library/unittest.mock.rst:2761 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it " "won't be considered in the sealing chain. This allows one to prevent seal " diff --git a/library/unittest.po b/library/unittest.po index 5c6db614bb..96d1a30188 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -413,30 +413,39 @@ msgstr "" msgid "Show local variables in tracebacks." msgstr "透過 traceback 顯示本地變數。" -#: ../../library/unittest.rst:247 +#: ../../library/unittest.rst:249 +msgid "Show the N slowest test cases (N=0 for all)." +msgstr "" + +#: ../../library/unittest.rst:251 msgid "The command-line options ``-b``, ``-c`` and ``-f`` were added." msgstr "增加命令列模式選項 ``-b`` 、 ``-c`` 與 ``-f``\\ 。" -#: ../../library/unittest.rst:250 +#: ../../library/unittest.rst:254 msgid "The command-line option ``--locals``." msgstr "命令列選項 ``--locals``\\ 。" -#: ../../library/unittest.rst:253 +#: ../../library/unittest.rst:257 msgid "The command-line option ``-k``." msgstr "命令列選項 ``-k``\\ 。" -#: ../../library/unittest.rst:256 +#: ../../library/unittest.rst:260 +#, fuzzy +msgid "The command-line option ``--durations``." +msgstr "命令列選項 ``--locals``\\ 。" + +#: ../../library/unittest.rst:263 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:263 +#: ../../library/unittest.rst:269 msgid "Test Discovery" msgstr "Test Discovery(測試探索)" -#: ../../library/unittest.rst:267 +#: ../../library/unittest.rst:273 msgid "" "Unittest supports simple test discovery. In order to be compatible with test " "discovery, all of the test files must be :ref:`modules ` or :" @@ -449,7 +458,7 @@ msgstr "" "並能從專案的最上層目錄中 import(代表它們的檔案名稱必須是有效的 :ref:" "`identifiers `\\ )。" -#: ../../library/unittest.rst:273 +#: ../../library/unittest.rst:279 msgid "" "Test discovery is implemented in :meth:`TestLoader.discover`, but can also " "be used from the command line. The basic command-line usage is::" @@ -459,7 +468,7 @@ msgstr "" "\n" "::" -#: ../../library/unittest.rst:281 +#: ../../library/unittest.rst:287 msgid "" "As a shortcut, ``python -m unittest`` is the equivalent of ``python -m " "unittest discover``. If you want to pass arguments to test discovery the " @@ -469,27 +478,27 @@ msgstr "" "discover``\\ 。假如你想傳遞引數至探索測試的話,一定要明確地加入 ``discover`` " "子指令。" -#: ../../library/unittest.rst:285 +#: ../../library/unittest.rst:291 msgid "The ``discover`` sub-command has the following options:" msgstr "``discover`` 子指令有以下幾個選項:" -#: ../../library/unittest.rst:291 +#: ../../library/unittest.rst:297 msgid "Verbose output" msgstr "詳細(verbose)輸出" -#: ../../library/unittest.rst:295 +#: ../../library/unittest.rst:301 msgid "Directory to start discovery (``.`` default)" msgstr "開始尋找的資料夾(預設為 ``.``\\ )" -#: ../../library/unittest.rst:299 +#: ../../library/unittest.rst:305 msgid "Pattern to match test files (``test*.py`` default)" msgstr "匹配測試檔案的模式(預設為 ``test*.py``\\ )" -#: ../../library/unittest.rst:303 +#: ../../library/unittest.rst:309 msgid "Top level directory of project (defaults to start directory)" msgstr "專案的最高階層目錄 (defaults to start directory)" -#: ../../library/unittest.rst:305 +#: ../../library/unittest.rst:311 msgid "" "The :option:`-s`, :option:`-p`, and :option:`-t` options can be passed in as " "positional arguments in that order. The following two command lines are " @@ -500,7 +509,7 @@ msgstr "" "\n" "::" -#: ../../library/unittest.rst:312 +#: ../../library/unittest.rst:318 msgid "" "As well as being a path it is possible to pass a package name, for example " "``myproject.subpackage.test``, as the start directory. The package name you " @@ -508,7 +517,7 @@ msgid "" "as the start directory." msgstr "" -#: ../../library/unittest.rst:319 +#: ../../library/unittest.rst:325 msgid "" "Test discovery loads tests by importing them. Once test discovery has found " "all the test files from the start directory you specify it turns the paths " @@ -516,34 +525,34 @@ msgid "" "imported as ``foo.bar.baz``." msgstr "" -#: ../../library/unittest.rst:324 +#: ../../library/unittest.rst:330 msgid "" "If you have a package installed globally and attempt test discovery on a " "different copy of the package then the import *could* happen from the wrong " "place. If this happens test discovery will warn you and exit." msgstr "" -#: ../../library/unittest.rst:328 +#: ../../library/unittest.rst:334 msgid "" "If you supply the start directory as a package name rather than a path to a " "directory then discover assumes that whichever location it imports from is " "the location you intended, so you will not get the warning." msgstr "" -#: ../../library/unittest.rst:333 +#: ../../library/unittest.rst:339 msgid "" "Test modules and packages can customize test loading and discovery by " "through the `load_tests protocol`_." msgstr "" -#: ../../library/unittest.rst:336 +#: ../../library/unittest.rst:342 msgid "" "Test discovery supports :term:`namespace packages ` for " "the start directory. Note that you need to specify the top level directory " "too (e.g. ``python -m unittest discover -s root/namespace -t root``)." msgstr "" -#: ../../library/unittest.rst:342 +#: ../../library/unittest.rst:348 msgid "" "Python 3.11 dropped the :term:`namespace packages ` " "support. It has been broken since Python 3.7. Start directory and " @@ -551,18 +560,18 @@ msgid "" "py`` file." msgstr "" -#: ../../library/unittest.rst:348 +#: ../../library/unittest.rst:354 msgid "" "Directories containing start directory still can be a namespace package. In " "this case, you need to specify start directory as dotted package name, and " "target directory explicitly. For example::" msgstr "" -#: ../../library/unittest.rst:364 +#: ../../library/unittest.rst:370 msgid "Organizing test code" msgstr "" -#: ../../library/unittest.rst:366 +#: ../../library/unittest.rst:372 msgid "" "The basic building blocks of unit testing are :dfn:`test cases` --- single " "scenarios that must be set up and checked for correctness. In :mod:" @@ -571,21 +580,21 @@ msgid "" "`TestCase` or use :class:`FunctionTestCase`." msgstr "" -#: ../../library/unittest.rst:372 +#: ../../library/unittest.rst:378 msgid "" "The testing code of a :class:`TestCase` instance should be entirely self " "contained, such that it can be run either in isolation or in arbitrary " "combination with any number of other test cases." msgstr "" -#: ../../library/unittest.rst:376 +#: ../../library/unittest.rst:382 msgid "" "The simplest :class:`TestCase` subclass will simply implement a test method " "(i.e. a method whose name starts with ``test``) in order to perform specific " "testing code::" msgstr "" -#: ../../library/unittest.rst:387 +#: ../../library/unittest.rst:393 msgid "" "Note that in order to test something, we use one of the :meth:`assert\\*` " "methods provided by the :class:`TestCase` base class. If the test fails, an " @@ -594,7 +603,7 @@ msgid "" "be treated as :dfn:`errors`." msgstr "" -#: ../../library/unittest.rst:393 +#: ../../library/unittest.rst:399 msgid "" "Tests can be numerous, and their set-up can be repetitive. Luckily, we can " "factor out set-up code by implementing a method called :meth:`~TestCase." @@ -602,32 +611,32 @@ msgid "" "test we run::" msgstr "" -#: ../../library/unittest.rst:414 +#: ../../library/unittest.rst:420 msgid "" "The order in which the various tests will be run is determined by sorting " "the test method names with respect to the built-in ordering for strings." msgstr "" -#: ../../library/unittest.rst:418 +#: ../../library/unittest.rst:424 msgid "" "If the :meth:`~TestCase.setUp` method raises an exception while the test is " "running, the framework will consider the test to have suffered an error, and " "the test method will not be executed." msgstr "" -#: ../../library/unittest.rst:422 +#: ../../library/unittest.rst:428 msgid "" "Similarly, we can provide a :meth:`~TestCase.tearDown` method that tidies up " "after the test method has been run::" msgstr "" -#: ../../library/unittest.rst:434 +#: ../../library/unittest.rst:440 msgid "" "If :meth:`~TestCase.setUp` succeeded, :meth:`~TestCase.tearDown` will be run " "whether the test method succeeded or not." msgstr "" -#: ../../library/unittest.rst:437 +#: ../../library/unittest.rst:443 msgid "" "Such a working environment for the testing code is called a :dfn:`test " "fixture`. A new TestCase instance is created as a unique test fixture used " @@ -636,7 +645,7 @@ msgid "" "test." msgstr "" -#: ../../library/unittest.rst:443 +#: ../../library/unittest.rst:449 msgid "" "It is recommended that you use TestCase implementations to group tests " "together according to the features they test. :mod:`unittest` provides a " @@ -646,13 +655,13 @@ msgid "" "execute them." msgstr "" -#: ../../library/unittest.rst:450 +#: ../../library/unittest.rst:456 msgid "" "However, should you want to customize the building of your test suite, you " "can do it yourself::" msgstr "" -#: ../../library/unittest.rst:463 +#: ../../library/unittest.rst:469 msgid "" "You can place the definitions of test cases and test suites in the same " "modules as the code they are to test (such as :file:`widget.py`), but there " @@ -660,69 +669,69 @@ msgid "" "as :file:`test_widget.py`:" msgstr "" -#: ../../library/unittest.rst:468 +#: ../../library/unittest.rst:474 msgid "The test module can be run standalone from the command line." msgstr "" -#: ../../library/unittest.rst:470 +#: ../../library/unittest.rst:476 msgid "The test code can more easily be separated from shipped code." msgstr "" -#: ../../library/unittest.rst:472 +#: ../../library/unittest.rst:478 msgid "" "There is less temptation to change test code to fit the code it tests " "without a good reason." msgstr "" -#: ../../library/unittest.rst:475 +#: ../../library/unittest.rst:481 msgid "" "Test code should be modified much less frequently than the code it tests." msgstr "" -#: ../../library/unittest.rst:477 +#: ../../library/unittest.rst:483 msgid "Tested code can be refactored more easily." msgstr "" -#: ../../library/unittest.rst:479 +#: ../../library/unittest.rst:485 msgid "" "Tests for modules written in C must be in separate modules anyway, so why " "not be consistent?" msgstr "" -#: ../../library/unittest.rst:482 +#: ../../library/unittest.rst:488 msgid "" "If the testing strategy changes, there is no need to change the source code." msgstr "" -#: ../../library/unittest.rst:488 +#: ../../library/unittest.rst:494 msgid "Re-using old test code" msgstr "" -#: ../../library/unittest.rst:490 +#: ../../library/unittest.rst:496 msgid "" "Some users will find that they have existing test code that they would like " "to run from :mod:`unittest`, without converting every old test function to " "a :class:`TestCase` subclass." msgstr "" -#: ../../library/unittest.rst:494 +#: ../../library/unittest.rst:500 msgid "" "For this reason, :mod:`unittest` provides a :class:`FunctionTestCase` class. " "This subclass of :class:`TestCase` can be used to wrap an existing test " "function. Set-up and tear-down functions can also be provided." msgstr "" -#: ../../library/unittest.rst:498 +#: ../../library/unittest.rst:504 msgid "Given the following test function::" msgstr "" -#: ../../library/unittest.rst:505 +#: ../../library/unittest.rst:511 msgid "" "one can create an equivalent test case instance as follows, with optional " "set-up and tear-down methods::" msgstr "" -#: ../../library/unittest.rst:514 +#: ../../library/unittest.rst:520 msgid "" "Even though :class:`FunctionTestCase` can be used to quickly convert an " "existing test base over to a :mod:`unittest`\\ -based system, this approach " @@ -730,7 +739,7 @@ msgid "" "subclasses will make future test refactorings infinitely easier." msgstr "" -#: ../../library/unittest.rst:519 +#: ../../library/unittest.rst:525 msgid "" "In some cases, the existing tests may have been written using the :mod:" "`doctest` module. If so, :mod:`doctest` provides a :class:`DocTestSuite` " @@ -738,11 +747,11 @@ msgid "" "from the existing :mod:`doctest`\\ -based tests." msgstr "" -#: ../../library/unittest.rst:528 +#: ../../library/unittest.rst:534 msgid "Skipping tests and expected failures" msgstr "" -#: ../../library/unittest.rst:532 +#: ../../library/unittest.rst:538 msgid "" "Unittest supports skipping individual test methods and even whole classes of " "tests. In addition, it supports marking a test as an \"expected failure,\" " @@ -750,7 +759,7 @@ msgid "" "on a :class:`TestResult`." msgstr "" -#: ../../library/unittest.rst:537 +#: ../../library/unittest.rst:543 msgid "" "Skipping a test is simply a matter of using the :func:`skip` :term:" "`decorator` or one of its conditional variants, calling :meth:`TestCase." @@ -758,56 +767,56 @@ msgid "" "`SkipTest` directly." msgstr "" -#: ../../library/unittest.rst:541 +#: ../../library/unittest.rst:547 msgid "Basic skipping looks like this::" msgstr "" -#: ../../library/unittest.rst:566 +#: ../../library/unittest.rst:572 msgid "This is the output of running the example above in verbose mode::" msgstr "" -#: ../../library/unittest.rst:578 +#: ../../library/unittest.rst:584 msgid "Classes can be skipped just like methods::" msgstr "" -#: ../../library/unittest.rst:585 +#: ../../library/unittest.rst:591 msgid "" ":meth:`TestCase.setUp` can also skip the test. This is useful when a " "resource that needs to be set up is not available." msgstr "" -#: ../../library/unittest.rst:588 +#: ../../library/unittest.rst:594 msgid "Expected failures use the :func:`expectedFailure` decorator. ::" msgstr "" -#: ../../library/unittest.rst:595 +#: ../../library/unittest.rst:601 msgid "" "It's easy to roll your own skipping decorators by making a decorator that " "calls :func:`skip` on the test when it wants it to be skipped. This " "decorator skips the test unless the passed object has a certain attribute::" msgstr "" -#: ../../library/unittest.rst:604 +#: ../../library/unittest.rst:610 msgid "" "The following decorators and exception implement test skipping and expected " "failures:" msgstr "" -#: ../../library/unittest.rst:608 +#: ../../library/unittest.rst:614 msgid "" "Unconditionally skip the decorated test. *reason* should describe why the " "test is being skipped." msgstr "" -#: ../../library/unittest.rst:613 +#: ../../library/unittest.rst:619 msgid "Skip the decorated test if *condition* is true." msgstr "" -#: ../../library/unittest.rst:617 +#: ../../library/unittest.rst:623 msgid "Skip the decorated test unless *condition* is true." msgstr "" -#: ../../library/unittest.rst:621 +#: ../../library/unittest.rst:627 msgid "" "Mark the test as an expected failure or error. If the test fails or errors " "in the test function itself (rather than in one of the :dfn:`test fixture` " @@ -815,17 +824,17 @@ msgid "" "be considered a failure." msgstr "" -#: ../../library/unittest.rst:628 +#: ../../library/unittest.rst:634 msgid "This exception is raised to skip a test." msgstr "" -#: ../../library/unittest.rst:630 +#: ../../library/unittest.rst:636 msgid "" "Usually you can use :meth:`TestCase.skipTest` or one of the skipping " "decorators instead of raising this directly." msgstr "" -#: ../../library/unittest.rst:633 +#: ../../library/unittest.rst:639 msgid "" "Skipped tests will not have :meth:`~TestCase.setUp` or :meth:`~TestCase." "tearDown` run around them. Skipped classes will not have :meth:`~TestCase." @@ -833,51 +842,51 @@ msgid "" "have :func:`setUpModule` or :func:`tearDownModule` run." msgstr "" -#: ../../library/unittest.rst:641 +#: ../../library/unittest.rst:647 msgid "Distinguishing test iterations using subtests" msgstr "" -#: ../../library/unittest.rst:645 +#: ../../library/unittest.rst:651 msgid "" "When there are very small differences among your tests, for instance some " "parameters, unittest allows you to distinguish them inside the body of a " "test method using the :meth:`~TestCase.subTest` context manager." msgstr "" -#: ../../library/unittest.rst:649 +#: ../../library/unittest.rst:655 msgid "For example, the following test::" msgstr "" "舉例來說,以下測試:\n" "\n" "::" -#: ../../library/unittest.rst:661 +#: ../../library/unittest.rst:667 msgid "will produce the following output::" msgstr "" "會有以下輸出:\n" "\n" "::" -#: ../../library/unittest.rst:693 +#: ../../library/unittest.rst:699 msgid "" "Without using a subtest, execution would stop after the first failure, and " "the error would be less easy to diagnose because the value of ``i`` wouldn't " "be displayed::" msgstr "" -#: ../../library/unittest.rst:709 +#: ../../library/unittest.rst:715 msgid "Classes and functions" msgstr "" -#: ../../library/unittest.rst:711 +#: ../../library/unittest.rst:717 msgid "This section describes in depth the API of :mod:`unittest`." msgstr "" -#: ../../library/unittest.rst:717 +#: ../../library/unittest.rst:723 msgid "Test cases" msgstr "" -#: ../../library/unittest.rst:721 +#: ../../library/unittest.rst:727 msgid "" "Instances of the :class:`TestCase` class represent the logical test units in " "the :mod:`unittest` universe. This class is intended to be used as a base " @@ -887,21 +896,21 @@ msgid "" "report various kinds of failure." msgstr "" -#: ../../library/unittest.rst:728 +#: ../../library/unittest.rst:734 msgid "" "Each instance of :class:`TestCase` will run a single base method: the method " "named *methodName*. In most uses of :class:`TestCase`, you will neither " "change the *methodName* nor reimplement the default ``runTest()`` method." msgstr "" -#: ../../library/unittest.rst:733 +#: ../../library/unittest.rst:739 msgid "" ":class:`TestCase` can be instantiated successfully without providing a " "*methodName*. This makes it easier to experiment with :class:`TestCase` from " "the interactive interpreter." msgstr "" -#: ../../library/unittest.rst:738 +#: ../../library/unittest.rst:744 msgid "" ":class:`TestCase` instances provide three groups of methods: one group used " "to run the test, another used by the test implementation to check conditions " @@ -909,11 +918,11 @@ msgid "" "test itself to be gathered." msgstr "" -#: ../../library/unittest.rst:743 +#: ../../library/unittest.rst:749 msgid "Methods in the first group (running the test) are:" msgstr "" -#: ../../library/unittest.rst:747 +#: ../../library/unittest.rst:753 msgid "" "Method called to prepare the test fixture. This is called immediately " "before calling the test method; other than :exc:`AssertionError` or :exc:" @@ -921,7 +930,7 @@ msgid "" "rather than a test failure. The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:755 +#: ../../library/unittest.rst:761 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called even if the test method raised an " @@ -934,25 +943,25 @@ msgid "" "The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:768 +#: ../../library/unittest.rst:774 msgid "" "A class method called before tests in an individual class are run. " "``setUpClass`` is called with the class as the only argument and must be " "decorated as a :func:`classmethod`::" msgstr "" -#: ../../library/unittest.rst:776 ../../library/unittest.rst:791 +#: ../../library/unittest.rst:782 ../../library/unittest.rst:797 msgid "See `Class and Module Fixtures`_ for more details." msgstr "更多細節請見 `Class and Module Fixtures`_\\ 。" -#: ../../library/unittest.rst:783 +#: ../../library/unittest.rst:789 msgid "" "A class method called after tests in an individual class have run. " "``tearDownClass`` is called with the class as the only argument and must be " "decorated as a :meth:`classmethod`::" msgstr "" -#: ../../library/unittest.rst:798 +#: ../../library/unittest.rst:804 msgid "" "Run the test, collecting the result into the :class:`TestResult` object " "passed as *result*. If *result* is omitted or ``None``, a temporary result " @@ -960,184 +969,184 @@ msgid "" "used. The result object is returned to :meth:`run`'s caller." msgstr "" -#: ../../library/unittest.rst:804 +#: ../../library/unittest.rst:810 msgid "" "The same effect may be had by simply calling the :class:`TestCase` instance." msgstr "" -#: ../../library/unittest.rst:807 +#: ../../library/unittest.rst:813 msgid "" "Previous versions of ``run`` did not return the result. Neither did calling " "an instance." msgstr "" -#: ../../library/unittest.rst:813 +#: ../../library/unittest.rst:819 msgid "" "Calling this during a test method or :meth:`setUp` skips the current test. " "See :ref:`unittest-skipping` for more information." msgstr "" -#: ../../library/unittest.rst:821 +#: ../../library/unittest.rst:827 msgid "" "Return a context manager which executes the enclosed code block as a " "subtest. *msg* and *params* are optional, arbitrary values which are " "displayed whenever a subtest fails, allowing you to identify them clearly." msgstr "" -#: ../../library/unittest.rst:826 +#: ../../library/unittest.rst:832 msgid "" "A test case can contain any number of subtest declarations, and they can be " "arbitrarily nested." msgstr "" -#: ../../library/unittest.rst:829 +#: ../../library/unittest.rst:835 msgid "See :ref:`subtests` for more information." msgstr "更多資訊請見 :ref:`subtests`\\ 。" -#: ../../library/unittest.rst:836 +#: ../../library/unittest.rst:842 msgid "" "Run the test without collecting the result. This allows exceptions raised " "by the test to be propagated to the caller, and can be used to support " "running tests under a debugger." msgstr "" -#: ../../library/unittest.rst:842 +#: ../../library/unittest.rst:848 msgid "" "The :class:`TestCase` class provides several assert methods to check for and " "report failures. The following table lists the most commonly used methods " "(see the tables below for more assert methods):" msgstr "" -#: ../../library/unittest.rst:847 ../../library/unittest.rst:968 -#: ../../library/unittest.rst:1182 ../../library/unittest.rst:1309 +#: ../../library/unittest.rst:853 ../../library/unittest.rst:974 +#: ../../library/unittest.rst:1188 ../../library/unittest.rst:1312 msgid "Method" msgstr "" -#: ../../library/unittest.rst:847 ../../library/unittest.rst:968 -#: ../../library/unittest.rst:1182 +#: ../../library/unittest.rst:853 ../../library/unittest.rst:974 +#: ../../library/unittest.rst:1188 msgid "Checks that" msgstr "" -#: ../../library/unittest.rst:847 ../../library/unittest.rst:968 -#: ../../library/unittest.rst:1182 ../../library/unittest.rst:1309 +#: ../../library/unittest.rst:853 ../../library/unittest.rst:974 +#: ../../library/unittest.rst:1188 ../../library/unittest.rst:1312 msgid "New in" msgstr "" -#: ../../library/unittest.rst:849 +#: ../../library/unittest.rst:855 msgid ":meth:`assertEqual(a, b) `" msgstr ":meth:`assertEqual(a, b) `" -#: ../../library/unittest.rst:849 +#: ../../library/unittest.rst:855 msgid "``a == b``" msgstr "``a == b``" -#: ../../library/unittest.rst:852 +#: ../../library/unittest.rst:858 msgid ":meth:`assertNotEqual(a, b) `" msgstr ":meth:`assertNotEqual(a, b) `" -#: ../../library/unittest.rst:852 +#: ../../library/unittest.rst:858 msgid "``a != b``" msgstr "``a != b``" -#: ../../library/unittest.rst:855 +#: ../../library/unittest.rst:861 msgid ":meth:`assertTrue(x) `" msgstr ":meth:`assertTrue(x) `" -#: ../../library/unittest.rst:855 +#: ../../library/unittest.rst:861 msgid "``bool(x) is True``" msgstr "``bool(x) is True``" -#: ../../library/unittest.rst:858 +#: ../../library/unittest.rst:864 msgid ":meth:`assertFalse(x) `" msgstr ":meth:`assertFalse(x) `" -#: ../../library/unittest.rst:858 +#: ../../library/unittest.rst:864 msgid "``bool(x) is False``" msgstr "``bool(x) is False``" -#: ../../library/unittest.rst:861 +#: ../../library/unittest.rst:867 msgid ":meth:`assertIs(a, b) `" msgstr ":meth:`assertIs(a, b) `" -#: ../../library/unittest.rst:861 +#: ../../library/unittest.rst:867 msgid "``a is b``" msgstr "``a is b``" -#: ../../library/unittest.rst:861 ../../library/unittest.rst:864 #: ../../library/unittest.rst:867 ../../library/unittest.rst:870 #: ../../library/unittest.rst:873 ../../library/unittest.rst:876 -#: ../../library/unittest.rst:973 ../../library/unittest.rst:1190 -#: ../../library/unittest.rst:1193 ../../library/unittest.rst:1196 +#: ../../library/unittest.rst:879 ../../library/unittest.rst:882 +#: ../../library/unittest.rst:979 ../../library/unittest.rst:1196 #: ../../library/unittest.rst:1199 ../../library/unittest.rst:1202 -#: ../../library/unittest.rst:1311 ../../library/unittest.rst:1314 -#: ../../library/unittest.rst:1317 ../../library/unittest.rst:1320 -#: ../../library/unittest.rst:1323 ../../library/unittest.rst:1326 +#: ../../library/unittest.rst:1205 ../../library/unittest.rst:1208 +#: ../../library/unittest.rst:1314 ../../library/unittest.rst:1317 +#: ../../library/unittest.rst:1320 ../../library/unittest.rst:1323 +#: ../../library/unittest.rst:1326 ../../library/unittest.rst:1329 msgid "3.1" msgstr "3.1" -#: ../../library/unittest.rst:864 +#: ../../library/unittest.rst:870 msgid ":meth:`assertIsNot(a, b) `" msgstr ":meth:`assertIsNot(a, b) `" -#: ../../library/unittest.rst:864 +#: ../../library/unittest.rst:870 msgid "``a is not b``" msgstr "``a is not b``" -#: ../../library/unittest.rst:867 +#: ../../library/unittest.rst:873 msgid ":meth:`assertIsNone(x) `" msgstr ":meth:`assertIsNone(x) `" -#: ../../library/unittest.rst:867 +#: ../../library/unittest.rst:873 msgid "``x is None``" msgstr "``x is None``" -#: ../../library/unittest.rst:870 +#: ../../library/unittest.rst:876 msgid ":meth:`assertIsNotNone(x) `" msgstr ":meth:`assertIsNotNone(x) `" -#: ../../library/unittest.rst:870 +#: ../../library/unittest.rst:876 msgid "``x is not None``" msgstr "``x is not None``" -#: ../../library/unittest.rst:873 +#: ../../library/unittest.rst:879 msgid ":meth:`assertIn(a, b) `" msgstr ":meth:`assertIn(a, b) `" -#: ../../library/unittest.rst:873 +#: ../../library/unittest.rst:879 msgid "``a in b``" msgstr "``a in b``" -#: ../../library/unittest.rst:876 +#: ../../library/unittest.rst:882 msgid ":meth:`assertNotIn(a, b) `" msgstr ":meth:`assertNotIn(a, b) `" -#: ../../library/unittest.rst:876 +#: ../../library/unittest.rst:882 msgid "``a not in b``" msgstr "``a not in b``" -#: ../../library/unittest.rst:879 +#: ../../library/unittest.rst:885 msgid ":meth:`assertIsInstance(a, b) `" msgstr ":meth:`assertIsInstance(a, b) `" -#: ../../library/unittest.rst:879 +#: ../../library/unittest.rst:885 msgid "``isinstance(a, b)``" msgstr "``isinstance(a, b)``" -#: ../../library/unittest.rst:879 ../../library/unittest.rst:882 -#: ../../library/unittest.rst:976 ../../library/unittest.rst:979 -#: ../../library/unittest.rst:1205 ../../library/unittest.rst:1208 +#: ../../library/unittest.rst:885 ../../library/unittest.rst:888 +#: ../../library/unittest.rst:982 ../../library/unittest.rst:985 +#: ../../library/unittest.rst:1211 ../../library/unittest.rst:1214 msgid "3.2" msgstr "3.2" -#: ../../library/unittest.rst:882 +#: ../../library/unittest.rst:888 msgid ":meth:`assertNotIsInstance(a, b) `" msgstr ":meth:`assertNotIsInstance(a, b) `" -#: ../../library/unittest.rst:882 +#: ../../library/unittest.rst:888 msgid "``not isinstance(a, b)``" msgstr "``not isinstance(a, b)``" -#: ../../library/unittest.rst:886 +#: ../../library/unittest.rst:892 msgid "" "All the assert methods accept a *msg* argument that, if specified, is used " "as the error message on failure (see also :data:`longMessage`). Note that " @@ -1146,13 +1155,13 @@ msgid "" "they are used as a context manager." msgstr "" -#: ../../library/unittest.rst:894 +#: ../../library/unittest.rst:900 msgid "" "Test that *first* and *second* are equal. If the values do not compare " "equal, the test will fail." msgstr "" -#: ../../library/unittest.rst:897 +#: ../../library/unittest.rst:903 msgid "" "In addition, if *first* and *second* are the exact same type and one of " "list, tuple, dict, set, frozenset or str or any type that a subclass " @@ -1162,27 +1171,27 @@ msgid "" "methods>`)." msgstr "" -#: ../../library/unittest.rst:904 +#: ../../library/unittest.rst:910 msgid "Added the automatic calling of type-specific equality function." msgstr "" -#: ../../library/unittest.rst:907 +#: ../../library/unittest.rst:913 msgid "" ":meth:`assertMultiLineEqual` added as the default type equality function for " "comparing strings." msgstr "" -#: ../../library/unittest.rst:914 +#: ../../library/unittest.rst:920 msgid "" "Test that *first* and *second* are not equal. If the values do compare " "equal, the test will fail." msgstr "" -#: ../../library/unittest.rst:920 +#: ../../library/unittest.rst:926 msgid "Test that *expr* is true (or false)." msgstr "" -#: ../../library/unittest.rst:922 +#: ../../library/unittest.rst:928 msgid "" "Note that this is equivalent to ``bool(expr) is True`` and not to ``expr is " "True`` (use ``assertIs(expr, True)`` for the latter). This method should " @@ -1191,96 +1200,96 @@ msgid "" "provide a better error message in case of failure." msgstr "" -#: ../../library/unittest.rst:932 +#: ../../library/unittest.rst:938 msgid "Test that *first* and *second* are (or are not) the same object." msgstr "" -#: ../../library/unittest.rst:940 +#: ../../library/unittest.rst:946 msgid "Test that *expr* is (or is not) ``None``." msgstr "" -#: ../../library/unittest.rst:948 +#: ../../library/unittest.rst:954 msgid "Test that *member* is (or is not) in *container*." msgstr "" -#: ../../library/unittest.rst:956 +#: ../../library/unittest.rst:962 msgid "" "Test that *obj* is (or is not) an instance of *cls* (which can be a class or " "a tuple of classes, as supported by :func:`isinstance`). To check for the " "exact type, use :func:`assertIs(type(obj), cls) `." msgstr "" -#: ../../library/unittest.rst:964 +#: ../../library/unittest.rst:970 msgid "" "It is also possible to check the production of exceptions, warnings, and log " "messages using the following methods:" msgstr "" -#: ../../library/unittest.rst:970 +#: ../../library/unittest.rst:976 msgid ":meth:`assertRaises(exc, fun, *args, **kwds) `" msgstr ":meth:`assertRaises(exc, fun, *args, **kwds) `" -#: ../../library/unittest.rst:970 +#: ../../library/unittest.rst:976 msgid "``fun(*args, **kwds)`` raises *exc*" msgstr "" -#: ../../library/unittest.rst:973 +#: ../../library/unittest.rst:979 msgid "" ":meth:`assertRaisesRegex(exc, r, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:973 +#: ../../library/unittest.rst:979 msgid "``fun(*args, **kwds)`` raises *exc* and the message matches regex *r*" msgstr "" -#: ../../library/unittest.rst:976 +#: ../../library/unittest.rst:982 msgid ":meth:`assertWarns(warn, fun, *args, **kwds) `" msgstr ":meth:`assertWarns(warn, fun, *args, **kwds) `" -#: ../../library/unittest.rst:976 +#: ../../library/unittest.rst:982 msgid "``fun(*args, **kwds)`` raises *warn*" msgstr "" -#: ../../library/unittest.rst:979 +#: ../../library/unittest.rst:985 msgid "" ":meth:`assertWarnsRegex(warn, r, fun, *args, **kwds) `" msgstr "" -#: ../../library/unittest.rst:979 +#: ../../library/unittest.rst:985 msgid "``fun(*args, **kwds)`` raises *warn* and the message matches regex *r*" msgstr "" -#: ../../library/unittest.rst:982 +#: ../../library/unittest.rst:988 msgid ":meth:`assertLogs(logger, level) `" msgstr ":meth:`assertLogs(logger, level) `" -#: ../../library/unittest.rst:982 +#: ../../library/unittest.rst:988 msgid "The ``with`` block logs on *logger* with minimum *level*" msgstr "" -#: ../../library/unittest.rst:982 +#: ../../library/unittest.rst:988 msgid "3.4" msgstr "3.4" -#: ../../library/unittest.rst:985 +#: ../../library/unittest.rst:991 msgid ":meth:`assertNoLogs(logger, level) `" msgstr ":meth:`assertNoLogs(logger, level) `" -#: ../../library/unittest.rst:985 +#: ../../library/unittest.rst:991 msgid "The ``with`` block does not log on" msgstr "" -#: ../../library/unittest.rst:986 +#: ../../library/unittest.rst:992 msgid "*logger* with minimum *level*" msgstr "" -#: ../../library/unittest.rst:985 +#: ../../library/unittest.rst:991 msgid "3.10" msgstr "3.10" -#: ../../library/unittest.rst:992 +#: ../../library/unittest.rst:998 msgid "" "Test that an exception is raised when *callable* is called with any " "positional or keyword arguments that are also passed to :meth:" @@ -1290,40 +1299,40 @@ msgid "" "be passed as *exception*." msgstr "" -#: ../../library/unittest.rst:999 +#: ../../library/unittest.rst:1005 msgid "" "If only the *exception* and possibly the *msg* arguments are given, return a " "context manager so that the code under test can be written inline rather " "than as a function::" msgstr "" -#: ../../library/unittest.rst:1006 +#: ../../library/unittest.rst:1012 msgid "" "When used as a context manager, :meth:`assertRaises` accepts the additional " "keyword argument *msg*." msgstr "" -#: ../../library/unittest.rst:1009 +#: ../../library/unittest.rst:1015 msgid "" "The context manager will store the caught exception object in its :attr:" "`exception` attribute. This can be useful if the intention is to perform " "additional checks on the exception raised::" msgstr "" -#: ../../library/unittest.rst:1019 +#: ../../library/unittest.rst:1025 msgid "Added the ability to use :meth:`assertRaises` as a context manager." msgstr "" -#: ../../library/unittest.rst:1022 +#: ../../library/unittest.rst:1028 msgid "Added the :attr:`exception` attribute." msgstr "新增 :attr:`exception` 屬性。" -#: ../../library/unittest.rst:1025 ../../library/unittest.rst:1051 -#: ../../library/unittest.rst:1092 ../../library/unittest.rst:1115 +#: ../../library/unittest.rst:1031 ../../library/unittest.rst:1057 +#: ../../library/unittest.rst:1098 ../../library/unittest.rst:1121 msgid "Added the *msg* keyword argument when used as a context manager." msgstr "" -#: ../../library/unittest.rst:1032 +#: ../../library/unittest.rst:1038 msgid "" "Like :meth:`assertRaises` but also tests that *regex* matches on the string " "representation of the raised exception. *regex* may be a regular expression " @@ -1331,22 +1340,22 @@ msgid "" "`re.search`. Examples::" msgstr "" -#: ../../library/unittest.rst:1040 ../../library/unittest.rst:1108 +#: ../../library/unittest.rst:1046 ../../library/unittest.rst:1114 msgid "or::" msgstr "" "或是:\n" "\n" "::" -#: ../../library/unittest.rst:1045 +#: ../../library/unittest.rst:1051 msgid "Added under the name ``assertRaisesRegexp``." msgstr "" -#: ../../library/unittest.rst:1048 +#: ../../library/unittest.rst:1054 msgid "Renamed to :meth:`assertRaisesRegex`." msgstr "重新命名為 :meth:`assertRaisesRegex`\\ 。" -#: ../../library/unittest.rst:1058 +#: ../../library/unittest.rst:1064 msgid "" "Test that a warning is triggered when *callable* is called with any " "positional or keyword arguments that are also passed to :meth:" @@ -1355,20 +1364,20 @@ msgid "" "tuple containing the warning classes may be passed as *warnings*." msgstr "" -#: ../../library/unittest.rst:1065 +#: ../../library/unittest.rst:1071 msgid "" "If only the *warning* and possibly the *msg* arguments are given, return a " "context manager so that the code under test can be written inline rather " "than as a function::" msgstr "" -#: ../../library/unittest.rst:1072 +#: ../../library/unittest.rst:1078 msgid "" "When used as a context manager, :meth:`assertWarns` accepts the additional " "keyword argument *msg*." msgstr "" -#: ../../library/unittest.rst:1075 +#: ../../library/unittest.rst:1081 msgid "" "The context manager will store the caught warning object in its :attr:" "`warning` attribute, and the source line which triggered the warnings in " @@ -1376,13 +1385,13 @@ msgid "" "the intention is to perform additional checks on the warning caught::" msgstr "" -#: ../../library/unittest.rst:1087 +#: ../../library/unittest.rst:1093 msgid "" "This method works regardless of the warning filters in place when it is " "called." msgstr "" -#: ../../library/unittest.rst:1099 +#: ../../library/unittest.rst:1105 msgid "" "Like :meth:`assertWarns` but also tests that *regex* matches on the message " "of the triggered warning. *regex* may be a regular expression object or a " @@ -1390,13 +1399,13 @@ msgid "" "search`. Example::" msgstr "" -#: ../../library/unittest.rst:1120 +#: ../../library/unittest.rst:1126 msgid "" "A context manager to test that at least one message is logged on the " "*logger* or one of its children, with at least the given *level*." msgstr "" -#: ../../library/unittest.rst:1124 +#: ../../library/unittest.rst:1130 msgid "" "If given, *logger* should be a :class:`logging.Logger` object or a :class:" "`str` giving the name of a logger. The default is the root logger, which " @@ -1404,141 +1413,141 @@ msgid "" "descendent logger." msgstr "" -#: ../../library/unittest.rst:1129 ../../library/unittest.rst:1170 +#: ../../library/unittest.rst:1135 ../../library/unittest.rst:1176 msgid "" "If given, *level* should be either a numeric logging level or its string " "equivalent (for example either ``\"ERROR\"`` or :attr:`logging.ERROR`). The " "default is :attr:`logging.INFO`." msgstr "" -#: ../../library/unittest.rst:1133 +#: ../../library/unittest.rst:1139 msgid "" "The test passes if at least one message emitted inside the ``with`` block " "matches the *logger* and *level* conditions, otherwise it fails." msgstr "" -#: ../../library/unittest.rst:1136 +#: ../../library/unittest.rst:1142 msgid "" "The object returned by the context manager is a recording helper which keeps " "tracks of the matching log messages. It has two attributes:" msgstr "" -#: ../../library/unittest.rst:1142 +#: ../../library/unittest.rst:1148 msgid "" "A list of :class:`logging.LogRecord` objects of the matching log messages." msgstr "" -#: ../../library/unittest.rst:1147 +#: ../../library/unittest.rst:1153 msgid "" "A list of :class:`str` objects with the formatted output of matching " "messages." msgstr "" -#: ../../library/unittest.rst:1150 +#: ../../library/unittest.rst:1156 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/unittest.rst:1162 +#: ../../library/unittest.rst:1168 msgid "" "A context manager to test that no messages are logged on the *logger* or one " "of its children, with at least the given *level*." msgstr "" -#: ../../library/unittest.rst:1166 +#: ../../library/unittest.rst:1172 msgid "" "If given, *logger* should be a :class:`logging.Logger` object or a :class:" "`str` giving the name of a logger. The default is the root logger, which " "will catch all messages." msgstr "" -#: ../../library/unittest.rst:1174 +#: ../../library/unittest.rst:1180 msgid "" "Unlike :meth:`assertLogs`, nothing will be returned by the context manager." msgstr "" -#: ../../library/unittest.rst:1179 +#: ../../library/unittest.rst:1185 msgid "" "There are also other methods used to perform more specific checks, such as:" msgstr "" -#: ../../library/unittest.rst:1184 +#: ../../library/unittest.rst:1190 msgid ":meth:`assertAlmostEqual(a, b) `" msgstr ":meth:`assertAlmostEqual(a, b) `" -#: ../../library/unittest.rst:1184 +#: ../../library/unittest.rst:1190 msgid "``round(a-b, 7) == 0``" msgstr "``round(a-b, 7) == 0``" -#: ../../library/unittest.rst:1187 +#: ../../library/unittest.rst:1193 msgid ":meth:`assertNotAlmostEqual(a, b) `" msgstr ":meth:`assertNotAlmostEqual(a, b) `" -#: ../../library/unittest.rst:1187 +#: ../../library/unittest.rst:1193 msgid "``round(a-b, 7) != 0``" msgstr "``round(a-b, 7) != 0``" -#: ../../library/unittest.rst:1190 +#: ../../library/unittest.rst:1196 msgid ":meth:`assertGreater(a, b) `" msgstr ":meth:`assertGreater(a, b) `" -#: ../../library/unittest.rst:1190 +#: ../../library/unittest.rst:1196 msgid "``a > b``" msgstr "``a > b``" -#: ../../library/unittest.rst:1193 +#: ../../library/unittest.rst:1199 msgid ":meth:`assertGreaterEqual(a, b) `" msgstr ":meth:`assertGreaterEqual(a, b) `" -#: ../../library/unittest.rst:1193 +#: ../../library/unittest.rst:1199 msgid "``a >= b``" msgstr "``a >= b``" -#: ../../library/unittest.rst:1196 +#: ../../library/unittest.rst:1202 msgid ":meth:`assertLess(a, b) `" msgstr ":meth:`assertLess(a, b) `" -#: ../../library/unittest.rst:1196 +#: ../../library/unittest.rst:1202 msgid "``a < b``" msgstr "``a < b``" -#: ../../library/unittest.rst:1199 +#: ../../library/unittest.rst:1205 msgid ":meth:`assertLessEqual(a, b) `" msgstr ":meth:`assertLessEqual(a, b) `" -#: ../../library/unittest.rst:1199 +#: ../../library/unittest.rst:1205 msgid "``a <= b``" msgstr "``a <= b``" -#: ../../library/unittest.rst:1202 +#: ../../library/unittest.rst:1208 msgid ":meth:`assertRegex(s, r) `" msgstr ":meth:`assertRegex(s, r) `" -#: ../../library/unittest.rst:1202 +#: ../../library/unittest.rst:1208 msgid "``r.search(s)``" msgstr "``r.search(s)``" -#: ../../library/unittest.rst:1205 +#: ../../library/unittest.rst:1211 msgid ":meth:`assertNotRegex(s, r) `" msgstr ":meth:`assertNotRegex(s, r) `" -#: ../../library/unittest.rst:1205 +#: ../../library/unittest.rst:1211 msgid "``not r.search(s)``" msgstr "``not r.search(s)``" -#: ../../library/unittest.rst:1208 +#: ../../library/unittest.rst:1214 msgid ":meth:`assertCountEqual(a, b) `" msgstr ":meth:`assertCountEqual(a, b) `" -#: ../../library/unittest.rst:1208 +#: ../../library/unittest.rst:1214 msgid "" "*a* and *b* have the same elements in the same number, regardless of their " "order." msgstr "" -#: ../../library/unittest.rst:1217 +#: ../../library/unittest.rst:1223 msgid "" "Test that *first* and *second* are approximately (or not approximately) " "equal by computing the difference, rounding to the given number of decimal " @@ -1547,30 +1556,30 @@ msgid "" "`round` function) and not *significant digits*." msgstr "" -#: ../../library/unittest.rst:1223 +#: ../../library/unittest.rst:1229 msgid "" "If *delta* is supplied instead of *places* then the difference between " "*first* and *second* must be less or equal to (or greater than) *delta*." msgstr "" -#: ../../library/unittest.rst:1226 +#: ../../library/unittest.rst:1232 msgid "Supplying both *delta* and *places* raises a :exc:`TypeError`." msgstr "" -#: ../../library/unittest.rst:1228 +#: ../../library/unittest.rst:1234 msgid "" ":meth:`assertAlmostEqual` automatically considers almost equal objects that " "compare equal. :meth:`assertNotAlmostEqual` automatically fails if the " "objects compare equal. Added the *delta* keyword argument." msgstr "" -#: ../../library/unittest.rst:1239 +#: ../../library/unittest.rst:1245 msgid "" "Test that *first* is respectively >, >=, < or <= than *second* depending on " "the method name. If not, the test will fail::" msgstr "" -#: ../../library/unittest.rst:1251 +#: ../../library/unittest.rst:1257 msgid "" "Test that a *regex* search matches (or does not match) *text*. In case of " "failure, the error message will include the pattern and the *text* (or the " @@ -1579,34 +1588,28 @@ msgid "" "suitable for use by :func:`re.search`." msgstr "" -#: ../../library/unittest.rst:1257 +#: ../../library/unittest.rst:1263 msgid "Added under the name ``assertRegexpMatches``." msgstr "" -#: ../../library/unittest.rst:1259 +#: ../../library/unittest.rst:1265 msgid "" "The method ``assertRegexpMatches()`` has been renamed to :meth:`." "assertRegex`." msgstr "" -#: ../../library/unittest.rst:1262 +#: ../../library/unittest.rst:1268 msgid ":meth:`.assertNotRegex`." msgstr ":meth:`.assertNotRegex`\\ 。" -#: ../../library/unittest.rst:1264 -msgid "" -"The name ``assertNotRegexpMatches`` is a deprecated alias for :meth:`." -"assertNotRegex`." -msgstr "" - -#: ../../library/unittest.rst:1271 +#: ../../library/unittest.rst:1274 msgid "" "Test that sequence *first* contains the same elements as *second*, " "regardless of their order. When they don't, an error message listing the " "differences between the sequences will be generated." msgstr "" -#: ../../library/unittest.rst:1275 +#: ../../library/unittest.rst:1278 msgid "" "Duplicate elements are *not* ignored when comparing *first* and *second*. It " "verifies whether each element has the same count in both sequences. " @@ -1614,7 +1617,7 @@ msgid "" "but works with sequences of unhashable objects as well." msgstr "" -#: ../../library/unittest.rst:1286 +#: ../../library/unittest.rst:1289 msgid "" "The :meth:`assertEqual` method dispatches the equality check for objects of " "the same type to different type-specific methods. These methods are already " @@ -1622,7 +1625,7 @@ msgid "" "register new methods using :meth:`addTypeEqualityFunc`:" msgstr "" -#: ../../library/unittest.rst:1293 +#: ../../library/unittest.rst:1296 msgid "" "Registers a type-specific method called by :meth:`assertEqual` to check if " "two objects of exactly the same *typeobj* (not subclasses) compare equal. " @@ -1633,66 +1636,66 @@ msgid "" "explaining the inequalities in details in the error message." msgstr "" -#: ../../library/unittest.rst:1304 +#: ../../library/unittest.rst:1307 msgid "" "The list of type-specific methods automatically used by :meth:`~TestCase." "assertEqual` are summarized in the following table. Note that it's usually " "not necessary to invoke these methods directly." msgstr "" -#: ../../library/unittest.rst:1309 +#: ../../library/unittest.rst:1312 msgid "Used to compare" msgstr "" -#: ../../library/unittest.rst:1311 +#: ../../library/unittest.rst:1314 msgid ":meth:`assertMultiLineEqual(a, b) `" msgstr ":meth:`assertMultiLineEqual(a, b) `" -#: ../../library/unittest.rst:1311 +#: ../../library/unittest.rst:1314 msgid "strings" msgstr "" -#: ../../library/unittest.rst:1314 +#: ../../library/unittest.rst:1317 msgid ":meth:`assertSequenceEqual(a, b) `" msgstr ":meth:`assertSequenceEqual(a, b) `" -#: ../../library/unittest.rst:1314 +#: ../../library/unittest.rst:1317 msgid "sequences" msgstr "" -#: ../../library/unittest.rst:1317 +#: ../../library/unittest.rst:1320 msgid ":meth:`assertListEqual(a, b) `" msgstr ":meth:`assertListEqual(a, b) `" -#: ../../library/unittest.rst:1317 +#: ../../library/unittest.rst:1320 msgid "lists" msgstr "" -#: ../../library/unittest.rst:1320 +#: ../../library/unittest.rst:1323 msgid ":meth:`assertTupleEqual(a, b) `" msgstr ":meth:`assertTupleEqual(a, b) `" -#: ../../library/unittest.rst:1320 +#: ../../library/unittest.rst:1323 msgid "tuples" msgstr "" -#: ../../library/unittest.rst:1323 +#: ../../library/unittest.rst:1326 msgid ":meth:`assertSetEqual(a, b) `" msgstr ":meth:`assertSetEqual(a, b) `" -#: ../../library/unittest.rst:1323 +#: ../../library/unittest.rst:1326 msgid "sets or frozensets" msgstr "" -#: ../../library/unittest.rst:1326 +#: ../../library/unittest.rst:1329 msgid ":meth:`assertDictEqual(a, b) `" msgstr ":meth:`assertDictEqual(a, b) `" -#: ../../library/unittest.rst:1326 +#: ../../library/unittest.rst:1329 msgid "dicts" msgstr "" -#: ../../library/unittest.rst:1334 +#: ../../library/unittest.rst:1337 msgid "" "Test that the multiline string *first* is equal to the string *second*. When " "not equal a diff of the two strings highlighting the differences will be " @@ -1700,7 +1703,7 @@ msgid "" "strings with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1344 +#: ../../library/unittest.rst:1347 msgid "" "Tests that two sequences are equal. If a *seq_type* is supplied, both " "*first* and *second* must be instances of *seq_type* or a failure will be " @@ -1708,13 +1711,13 @@ msgid "" "shows the difference between the two." msgstr "" -#: ../../library/unittest.rst:1349 +#: ../../library/unittest.rst:1352 msgid "" "This method is not called directly by :meth:`assertEqual`, but it's used to " "implement :meth:`assertListEqual` and :meth:`assertTupleEqual`." msgstr "" -#: ../../library/unittest.rst:1359 +#: ../../library/unittest.rst:1362 msgid "" "Tests that two lists or tuples are equal. If not, an error message is " "constructed that shows only the differences between the two. An error is " @@ -1722,38 +1725,38 @@ msgid "" "are used by default when comparing lists or tuples with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1370 +#: ../../library/unittest.rst:1373 msgid "" "Tests that two sets are equal. If not, an error message is constructed that " "lists the differences between the sets. This method is used by default when " "comparing sets or frozensets with :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1374 +#: ../../library/unittest.rst:1377 msgid "" "Fails if either of *first* or *second* does not have a :meth:`set." "difference` method." msgstr "" -#: ../../library/unittest.rst:1382 +#: ../../library/unittest.rst:1385 msgid "" "Test that two dictionaries are equal. If not, an error message is " "constructed that shows the differences in the dictionaries. This method will " "be used by default to compare dictionaries in calls to :meth:`assertEqual`." msgstr "" -#: ../../library/unittest.rst:1393 +#: ../../library/unittest.rst:1396 msgid "" "Finally the :class:`TestCase` provides the following methods and attributes:" msgstr "" -#: ../../library/unittest.rst:1398 +#: ../../library/unittest.rst:1401 msgid "" "Signals a test failure unconditionally, with *msg* or ``None`` for the error " "message." msgstr "" -#: ../../library/unittest.rst:1404 +#: ../../library/unittest.rst:1407 msgid "" "This class attribute gives the exception raised by the test method. If a " "test framework needs to use a specialized exception, possibly to carry " @@ -1762,7 +1765,7 @@ msgid "" "`AssertionError`." msgstr "" -#: ../../library/unittest.rst:1413 +#: ../../library/unittest.rst:1416 msgid "" "This class attribute determines what happens when a custom failure message " "is passed as the msg argument to an assertXYY call that fails. ``True`` is " @@ -1771,18 +1774,18 @@ msgid "" "replaces the standard message." msgstr "" -#: ../../library/unittest.rst:1419 +#: ../../library/unittest.rst:1422 msgid "" "The class setting can be overridden in individual test methods by assigning " "an instance attribute, self.longMessage, to ``True`` or ``False`` before " "calling the assert methods." msgstr "" -#: ../../library/unittest.rst:1423 +#: ../../library/unittest.rst:1426 msgid "The class setting gets reset before each test call." msgstr "" -#: ../../library/unittest.rst:1430 +#: ../../library/unittest.rst:1433 msgid "" "This attribute controls the maximum length of diffs output by assert methods " "that report diffs on failure. It defaults to 80*8 characters. Assert methods " @@ -1791,52 +1794,52 @@ msgid "" "`assertDictEqual` and :meth:`assertMultiLineEqual`." msgstr "" -#: ../../library/unittest.rst:1437 +#: ../../library/unittest.rst:1440 msgid "" "Setting ``maxDiff`` to ``None`` means that there is no maximum length of " "diffs." msgstr "" -#: ../../library/unittest.rst:1443 +#: ../../library/unittest.rst:1446 msgid "" "Testing frameworks can use the following methods to collect information on " "the test:" msgstr "" -#: ../../library/unittest.rst:1449 +#: ../../library/unittest.rst:1452 msgid "" "Return the number of tests represented by this test object. For :class:" "`TestCase` instances, this will always be ``1``." msgstr "" -#: ../../library/unittest.rst:1455 +#: ../../library/unittest.rst:1458 msgid "" "Return an instance of the test result class that should be used for this " "test case class (if no other result instance is provided to the :meth:`run` " "method)." msgstr "" -#: ../../library/unittest.rst:1459 +#: ../../library/unittest.rst:1462 msgid "" "For :class:`TestCase` instances, this will always be an instance of :class:" "`TestResult`; subclasses of :class:`TestCase` should override this as " "necessary." msgstr "" -#: ../../library/unittest.rst:1466 +#: ../../library/unittest.rst:1469 msgid "" "Return a string identifying the specific test case. This is usually the " "full name of the test method, including the module and class name." msgstr "" -#: ../../library/unittest.rst:1472 +#: ../../library/unittest.rst:1475 msgid "" "Returns a description of the test, or ``None`` if no description has been " "provided. The default implementation of this method returns the first line " "of the test method's docstring, if available, or ``None``." msgstr "" -#: ../../library/unittest.rst:1477 +#: ../../library/unittest.rst:1480 msgid "" "In 3.1 this was changed to add the test name to the short description even " "in the presence of a docstring. This caused compatibility issues with " @@ -1844,7 +1847,7 @@ msgid "" "`TextTestResult` in Python 3.2." msgstr "" -#: ../../library/unittest.rst:1486 +#: ../../library/unittest.rst:1489 msgid "" "Add a function to be called after :meth:`tearDown` to cleanup resources used " "during the test. Functions will be called in reverse order to the order they " @@ -1853,39 +1856,39 @@ msgid "" "added." msgstr "" -#: ../../library/unittest.rst:1492 +#: ../../library/unittest.rst:1495 msgid "" "If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, then " "any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:1500 +#: ../../library/unittest.rst:1503 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :meth:`addCleanup` " "and return the result of the :meth:`~object.__enter__` method." msgstr "" -#: ../../library/unittest.rst:1510 +#: ../../library/unittest.rst:1513 msgid "" "This method is called unconditionally after :meth:`tearDown`, or after :meth:" "`setUp` if :meth:`setUp` raises an exception." msgstr "" -#: ../../library/unittest.rst:1513 +#: ../../library/unittest.rst:1516 msgid "" "It is responsible for calling all the cleanup functions added by :meth:" "`addCleanup`. If you need cleanup functions to be called *prior* to :meth:" "`tearDown` then you can call :meth:`doCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:1518 +#: ../../library/unittest.rst:1521 msgid "" ":meth:`doCleanups` pops methods off the stack of cleanup functions one at a " "time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:1526 +#: ../../library/unittest.rst:1529 msgid "" "Add a function to be called after :meth:`tearDownClass` to cleanup resources " "used during the test class. Functions will be called in reverse order to the " @@ -1894,13 +1897,13 @@ msgid "" "when they are added." msgstr "" -#: ../../library/unittest.rst:1532 +#: ../../library/unittest.rst:1535 msgid "" "If :meth:`setUpClass` fails, meaning that :meth:`tearDownClass` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:1540 +#: ../../library/unittest.rst:1543 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :meth:" @@ -1908,32 +1911,32 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:1550 +#: ../../library/unittest.rst:1553 msgid "" "This method is called unconditionally after :meth:`tearDownClass`, or after :" "meth:`setUpClass` if :meth:`setUpClass` raises an exception." msgstr "" -#: ../../library/unittest.rst:1553 +#: ../../library/unittest.rst:1556 msgid "" "It is responsible for calling all the cleanup functions added by :meth:" "`addClassCleanup`. If you need cleanup functions to be called *prior* to :" "meth:`tearDownClass` then you can call :meth:`doClassCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:1558 +#: ../../library/unittest.rst:1561 msgid "" ":meth:`doClassCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:1566 +#: ../../library/unittest.rst:1569 msgid "" "This class provides an API similar to :class:`TestCase` and also accepts " "coroutines as test functions." msgstr "" -#: ../../library/unittest.rst:1573 +#: ../../library/unittest.rst:1576 msgid "" "Method called to prepare the test fixture. This is called after :meth:" "`setUp`. This is called immediately before calling the test method; other " @@ -1942,7 +1945,7 @@ msgid "" "implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1581 +#: ../../library/unittest.rst:1584 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called before :meth:`tearDown`. This is called " @@ -1955,11 +1958,11 @@ msgid "" "the outcome of the test method. The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:1593 +#: ../../library/unittest.rst:1596 msgid "This method accepts a coroutine that can be used as a cleanup function." msgstr "" -#: ../../library/unittest.rst:1597 +#: ../../library/unittest.rst:1600 msgid "" "Enter the supplied :term:`asynchronous context manager`. If successful, " "also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:" @@ -1967,7 +1970,7 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:1607 +#: ../../library/unittest.rst:1610 msgid "" "Sets up a new event loop to run the test, collecting the result into the :" "class:`TestResult` object passed as *result*. If *result* is omitted or " @@ -1977,18 +1980,18 @@ msgid "" "cancelled." msgstr "" -#: ../../library/unittest.rst:1615 +#: ../../library/unittest.rst:1618 msgid "An example illustrating the order::" msgstr "" -#: ../../library/unittest.rst:1651 +#: ../../library/unittest.rst:1654 msgid "" "After running the test, ``events`` would contain ``[\"setUp\", " "\"asyncSetUp\", \"test_response\", \"asyncTearDown\", \"tearDown\", " "\"cleanup\"]``." msgstr "" -#: ../../library/unittest.rst:1656 +#: ../../library/unittest.rst:1659 msgid "" "This class implements the portion of the :class:`TestCase` interface which " "allows the test runner to drive the test, but does not provide the methods " @@ -1997,150 +2000,11 @@ msgid "" "`unittest`-based test framework." msgstr "" -#: ../../library/unittest.rst:1666 -msgid "Deprecated aliases" -msgstr "" - -#: ../../library/unittest.rst:1668 -msgid "" -"For historical reasons, some of the :class:`TestCase` methods had one or " -"more aliases that are now deprecated. The following table lists the correct " -"names along with their deprecated aliases:" -msgstr "" - -#: ../../library/unittest.rst:1673 -msgid "Method Name" -msgstr "" - -#: ../../library/unittest.rst:1673 -msgid "Deprecated alias" -msgstr "" - -#: ../../library/unittest.rst:1675 -msgid ":meth:`.assertEqual`" -msgstr ":meth:`.assertEqual`" - -#: ../../library/unittest.rst:1675 -msgid "failUnlessEqual" -msgstr "failUnlessEqual" - -#: ../../library/unittest.rst:1675 -msgid "assertEquals" -msgstr "assertEquals" - -#: ../../library/unittest.rst:1676 -msgid ":meth:`.assertNotEqual`" -msgstr ":meth:`.assertNotEqual`" - -#: ../../library/unittest.rst:1676 -msgid "failIfEqual" -msgstr "failIfEqual" - -#: ../../library/unittest.rst:1676 -msgid "assertNotEquals" -msgstr "assertNotEquals" - -#: ../../library/unittest.rst:1677 -msgid ":meth:`.assertTrue`" -msgstr ":meth:`.assertTrue`" - -#: ../../library/unittest.rst:1677 -msgid "failUnless" -msgstr "failUnless" - -#: ../../library/unittest.rst:1677 -msgid "assert\\_" -msgstr "assert\\_" - -#: ../../library/unittest.rst:1678 -msgid ":meth:`.assertFalse`" -msgstr ":meth:`.assertFalse`" - -#: ../../library/unittest.rst:1678 -msgid "failIf" -msgstr "failIf" - -#: ../../library/unittest.rst:1679 -msgid ":meth:`.assertRaises`" -msgstr ":meth:`.assertRaises`" - -#: ../../library/unittest.rst:1679 -msgid "failUnlessRaises" -msgstr "failUnlessRaises" - -#: ../../library/unittest.rst:1680 -msgid ":meth:`.assertAlmostEqual`" -msgstr ":meth:`.assertAlmostEqual`" - -#: ../../library/unittest.rst:1680 -msgid "failUnlessAlmostEqual" -msgstr "failUnlessAlmostEqual" - -#: ../../library/unittest.rst:1680 -msgid "assertAlmostEquals" -msgstr "assertAlmostEquals" - -#: ../../library/unittest.rst:1681 -msgid ":meth:`.assertNotAlmostEqual`" -msgstr ":meth:`.assertNotAlmostEqual`" - -#: ../../library/unittest.rst:1681 -msgid "failIfAlmostEqual" -msgstr "failIfAlmostEqual" - -#: ../../library/unittest.rst:1681 -msgid "assertNotAlmostEquals" -msgstr "assertNotAlmostEquals" - -#: ../../library/unittest.rst:1682 -msgid ":meth:`.assertRegex`" -msgstr ":meth:`.assertRegex`" - -#: ../../library/unittest.rst:1682 -msgid "assertRegexpMatches" -msgstr "assertRegexpMatches" - -#: ../../library/unittest.rst:1683 -msgid ":meth:`.assertNotRegex`" -msgstr ":meth:`.assertNotRegex`" - -#: ../../library/unittest.rst:1683 -msgid "assertNotRegexpMatches" -msgstr "assertNotRegexpMatches" - -#: ../../library/unittest.rst:1684 -msgid ":meth:`.assertRaisesRegex`" -msgstr ":meth:`.assertRaisesRegex`" - -#: ../../library/unittest.rst:1684 -msgid "assertRaisesRegexp" -msgstr "assertRaisesRegexp" - -#: ../../library/unittest.rst:1687 -msgid "The fail* aliases listed in the second column have been deprecated." -msgstr "" - -#: ../../library/unittest.rst:1689 -msgid "The assert* aliases listed in the third column have been deprecated." -msgstr "" - -#: ../../library/unittest.rst:1691 -msgid "" -"``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to :" -"meth:`.assertRegex` and :meth:`.assertRaisesRegex`." -msgstr "" - -#: ../../library/unittest.rst:1694 -msgid "" -"The ``assertNotRegexpMatches`` name is deprecated in favor of :meth:`." -"assertNotRegex`." -msgstr "" - -#: ../../library/unittest.rst:1700 +#: ../../library/unittest.rst:1669 msgid "Grouping tests" msgstr "" -#: ../../library/unittest.rst:1704 +#: ../../library/unittest.rst:1673 msgid "" "This class represents an aggregation of individual test cases and test " "suites. The class presents the interface needed by the test runner to allow " @@ -2148,14 +2012,14 @@ msgid "" "is the same as iterating over the suite, running each test individually." msgstr "" -#: ../../library/unittest.rst:1709 +#: ../../library/unittest.rst:1678 msgid "" "If *tests* is given, it must be an iterable of individual test cases or " "other test suites that will be used to build the suite initially. Additional " "methods are provided to add test cases and suites to the collection later on." msgstr "" -#: ../../library/unittest.rst:1713 +#: ../../library/unittest.rst:1682 msgid "" ":class:`TestSuite` objects behave much like :class:`TestCase` objects, " "except they do not actually implement a test. Instead, they are used to " @@ -2164,47 +2028,47 @@ msgid "" "instances:" msgstr "" -#: ../../library/unittest.rst:1721 +#: ../../library/unittest.rst:1690 msgid "Add a :class:`TestCase` or :class:`TestSuite` to the suite." msgstr "" -#: ../../library/unittest.rst:1726 +#: ../../library/unittest.rst:1695 msgid "" "Add all the tests from an iterable of :class:`TestCase` and :class:" "`TestSuite` instances to this test suite." msgstr "" -#: ../../library/unittest.rst:1729 +#: ../../library/unittest.rst:1698 msgid "" "This is equivalent to iterating over *tests*, calling :meth:`addTest` for " "each element." msgstr "" -#: ../../library/unittest.rst:1732 +#: ../../library/unittest.rst:1701 msgid ":class:`TestSuite` shares the following methods with :class:`TestCase`:" msgstr "" -#: ../../library/unittest.rst:1737 +#: ../../library/unittest.rst:1706 msgid "" "Run the tests associated with this suite, collecting the result into the " "test result object passed as *result*. Note that unlike :meth:`TestCase." "run`, :meth:`TestSuite.run` requires the result object to be passed in." msgstr "" -#: ../../library/unittest.rst:1745 +#: ../../library/unittest.rst:1714 msgid "" "Run the tests associated with this suite without collecting the result. This " "allows exceptions raised by the test to be propagated to the caller and can " "be used to support running tests under a debugger." msgstr "" -#: ../../library/unittest.rst:1752 +#: ../../library/unittest.rst:1721 msgid "" "Return the number of tests represented by this test object, including all " "individual tests and sub-suites." msgstr "" -#: ../../library/unittest.rst:1758 +#: ../../library/unittest.rst:1727 msgid "" "Tests grouped by a :class:`TestSuite` are always accessed by iteration. " "Subclasses can lazily provide tests by overriding :meth:`__iter__`. Note " @@ -2216,31 +2080,31 @@ msgid "" "overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references." msgstr "" -#: ../../library/unittest.rst:1768 +#: ../../library/unittest.rst:1737 msgid "" "In earlier versions the :class:`TestSuite` accessed tests directly rather " "than through iteration, so overriding :meth:`__iter__` wasn't sufficient for " "providing tests." msgstr "" -#: ../../library/unittest.rst:1773 +#: ../../library/unittest.rst:1742 msgid "" "In earlier versions the :class:`TestSuite` held references to each :class:" "`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that behavior " "by overriding :meth:`TestSuite._removeTestAtIndex`." msgstr "" -#: ../../library/unittest.rst:1778 +#: ../../library/unittest.rst:1747 msgid "" "In the typical usage of a :class:`TestSuite` object, the :meth:`run` method " "is invoked by a :class:`TestRunner` rather than by the end-user test harness." msgstr "" -#: ../../library/unittest.rst:1783 +#: ../../library/unittest.rst:1752 msgid "Loading and running tests" msgstr "" -#: ../../library/unittest.rst:1787 +#: ../../library/unittest.rst:1756 msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " @@ -2249,11 +2113,11 @@ msgid "" "customization of some configurable properties." msgstr "" -#: ../../library/unittest.rst:1793 +#: ../../library/unittest.rst:1762 msgid ":class:`TestLoader` objects have the following attributes:" msgstr "" -#: ../../library/unittest.rst:1798 +#: ../../library/unittest.rst:1767 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " "the loader at any point. Fatal errors are signalled by the relevant method " @@ -2261,17 +2125,17 @@ msgid "" "synthetic test that will raise the original error when run." msgstr "" -#: ../../library/unittest.rst:1807 +#: ../../library/unittest.rst:1776 msgid ":class:`TestLoader` objects have the following methods:" msgstr "" -#: ../../library/unittest.rst:1812 +#: ../../library/unittest.rst:1781 msgid "" "Return a suite of all test cases contained in the :class:`TestCase`\\ -" "derived :class:`testCaseClass`." msgstr "" -#: ../../library/unittest.rst:1815 +#: ../../library/unittest.rst:1784 msgid "" "A test case instance is created for each method named by :meth:" "`getTestCaseNames`. By default these are the method names beginning with " @@ -2280,14 +2144,14 @@ msgid "" "method instead." msgstr "" -#: ../../library/unittest.rst:1824 +#: ../../library/unittest.rst:1793 msgid "" "Return a suite of all test cases contained in the given module. This method " "searches *module* for classes derived from :class:`TestCase` and creates an " "instance of the class for each test method defined for the class." msgstr "" -#: ../../library/unittest.rst:1831 +#: ../../library/unittest.rst:1800 msgid "" "While using a hierarchy of :class:`TestCase`\\ -derived classes can be " "convenient in sharing fixtures and helper functions, defining test methods " @@ -2296,7 +2160,7 @@ msgid "" "fixtures are different and defined in subclasses." msgstr "" -#: ../../library/unittest.rst:1837 +#: ../../library/unittest.rst:1806 msgid "" "If a module provides a ``load_tests`` function it will be called to load the " "tests. This allows modules to customize test loading. This is the " @@ -2304,23 +2168,24 @@ msgid "" "argument to ``load_tests``." msgstr "" -#: ../../library/unittest.rst:1842 +#: ../../library/unittest.rst:1811 msgid "Support for ``load_tests`` added." msgstr "" -#: ../../library/unittest.rst:1845 +#: ../../library/unittest.rst:1814 +msgid "Support for a keyword-only argument *pattern* has been added." +msgstr "" + +#: ../../library/unittest.rst:1817 msgid "" -"The undocumented and unofficial *use_load_tests* default argument is " -"deprecated and ignored, although it is still accepted for backward " -"compatibility. The method also now accepts a keyword-only argument " -"*pattern* which is passed to ``load_tests`` as the third argument." +"The undocumented and unofficial *use_load_tests* parameter has been removed." msgstr "" -#: ../../library/unittest.rst:1854 +#: ../../library/unittest.rst:1824 msgid "Return a suite of all test cases given a string specifier." msgstr "" -#: ../../library/unittest.rst:1856 +#: ../../library/unittest.rst:1826 msgid "" "The specifier *name* is a \"dotted name\" that may resolve either to a " "module, a test case class, a test method within a test case class, a :class:" @@ -2331,7 +2196,7 @@ msgid "" "object\"." msgstr "" -#: ../../library/unittest.rst:1864 +#: ../../library/unittest.rst:1834 msgid "" "For example, if you have a module :mod:`SampleTests` containing a :class:" "`TestCase`\\ -derived class :class:`SampleTestCase` with three test methods " @@ -2344,31 +2209,31 @@ msgid "" "a side-effect." msgstr "" -#: ../../library/unittest.rst:1874 +#: ../../library/unittest.rst:1844 msgid "The method optionally resolves *name* relative to the given *module*." msgstr "" -#: ../../library/unittest.rst:1876 +#: ../../library/unittest.rst:1846 msgid "" "If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing " "*name* then a synthetic test that raises that error when run will be " "returned. These errors are included in the errors accumulated by self.errors." msgstr "" -#: ../../library/unittest.rst:1885 +#: ../../library/unittest.rst:1855 msgid "" "Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather " "than a single name. The return value is a test suite which supports all the " "tests defined for each name." msgstr "" -#: ../../library/unittest.rst:1892 +#: ../../library/unittest.rst:1862 msgid "" "Return a sorted sequence of method names found within *testCaseClass*; this " "should be a subclass of :class:`TestCase`." msgstr "" -#: ../../library/unittest.rst:1898 +#: ../../library/unittest.rst:1868 msgid "" "Find all the test modules by recursing into subdirectories from the " "specified start directory, and return a TestSuite object containing them. " @@ -2377,14 +2242,14 @@ msgid "" "Python identifiers) will be loaded." msgstr "" -#: ../../library/unittest.rst:1904 +#: ../../library/unittest.rst:1874 msgid "" "All test modules must be importable from the top level of the project. If " "the start directory is not the top level directory then the top level " "directory must be specified separately." msgstr "" -#: ../../library/unittest.rst:1908 +#: ../../library/unittest.rst:1878 msgid "" "If importing a module fails, for example due to a syntax error, then this " "will be recorded as a single error and discovery will continue. If the " @@ -2392,7 +2257,7 @@ msgid "" "as a skip instead of an error." msgstr "" -#: ../../library/unittest.rst:1913 +#: ../../library/unittest.rst:1883 msgid "" "If a package (a directory containing a file named :file:`__init__.py`) is " "found, the package will be checked for a ``load_tests`` function. If this " @@ -2402,13 +2267,13 @@ msgid "" "itself calls ``loader.discover``." msgstr "" -#: ../../library/unittest.rst:1921 +#: ../../library/unittest.rst:1891 msgid "" "If ``load_tests`` exists then discovery does *not* recurse into the package, " "``load_tests`` is responsible for loading all tests in the package." msgstr "" -#: ../../library/unittest.rst:1925 +#: ../../library/unittest.rst:1895 msgid "" "The pattern is deliberately not stored as a loader attribute so that " "packages can continue discovery themselves. *top_level_dir* is stored so " @@ -2416,81 +2281,81 @@ msgid "" "discover()``." msgstr "" -#: ../../library/unittest.rst:1930 +#: ../../library/unittest.rst:1900 msgid "*start_dir* can be a dotted module name as well as a directory." msgstr "" -#: ../../library/unittest.rst:1934 +#: ../../library/unittest.rst:1904 msgid "" "Modules that raise :exc:`SkipTest` on import are recorded as skips, not " "errors." msgstr "" -#: ../../library/unittest.rst:1938 +#: ../../library/unittest.rst:1908 msgid "*start_dir* can be a :term:`namespace packages `." msgstr "" -#: ../../library/unittest.rst:1941 +#: ../../library/unittest.rst:1911 msgid "" "Paths are sorted before being imported so that execution order is the same " "even if the underlying file system's ordering is not dependent on file name." msgstr "" -#: ../../library/unittest.rst:1946 +#: ../../library/unittest.rst:1916 msgid "" "Found packages are now checked for ``load_tests`` regardless of whether " "their path matches *pattern*, because it is impossible for a package name to " "match the default pattern." msgstr "" -#: ../../library/unittest.rst:1951 +#: ../../library/unittest.rst:1921 msgid "" "*start_dir* can not be a :term:`namespace packages `. It " "has been broken since Python 3.7 and Python 3.11 officially remove it." msgstr "" -#: ../../library/unittest.rst:1956 +#: ../../library/unittest.rst:1926 msgid "" "The following attributes of a :class:`TestLoader` can be configured either " "by subclassing or assignment on an instance:" msgstr "" -#: ../../library/unittest.rst:1962 +#: ../../library/unittest.rst:1932 msgid "" "String giving the prefix of method names which will be interpreted as test " "methods. The default value is ``'test'``." msgstr "" -#: ../../library/unittest.rst:1965 +#: ../../library/unittest.rst:1935 msgid "" "This affects :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\\*` " "methods." msgstr "" -#: ../../library/unittest.rst:1971 +#: ../../library/unittest.rst:1941 msgid "" "Function to be used to compare method names when sorting them in :meth:" "`getTestCaseNames` and all the :meth:`loadTestsFrom\\*` methods." msgstr "" -#: ../../library/unittest.rst:1977 +#: ../../library/unittest.rst:1947 msgid "" "Callable object that constructs a test suite from a list of tests. No " "methods on the resulting object are needed. The default value is the :class:" "`TestSuite` class." msgstr "" -#: ../../library/unittest.rst:1981 ../../library/unittest.rst:1994 +#: ../../library/unittest.rst:1951 ../../library/unittest.rst:1964 msgid "This affects all the :meth:`loadTestsFrom\\*` methods." msgstr "" -#: ../../library/unittest.rst:1985 +#: ../../library/unittest.rst:1955 msgid "" "List of Unix shell-style wildcard test name patterns that test methods have " "to match to be included in test suites (see ``-k`` option)." msgstr "" -#: ../../library/unittest.rst:1988 +#: ../../library/unittest.rst:1958 msgid "" "If this attribute is not ``None`` (the default), all test methods to be " "included in test suites must match one of the patterns in this list. Note " @@ -2499,13 +2364,13 @@ msgid "" "have to be converted using ``*`` wildcards." msgstr "" -#: ../../library/unittest.rst:2001 +#: ../../library/unittest.rst:1971 msgid "" "This class is used to compile information about which tests have succeeded " "and which have failed." msgstr "" -#: ../../library/unittest.rst:2004 +#: ../../library/unittest.rst:1974 msgid "" "A :class:`TestResult` object stores the results of a set of tests. The :" "class:`TestCase` and :class:`TestSuite` classes ensure that results are " @@ -2513,7 +2378,7 @@ msgid "" "outcome of tests." msgstr "" -#: ../../library/unittest.rst:2009 +#: ../../library/unittest.rst:1979 msgid "" "Testing frameworks built on top of :mod:`unittest` may want access to the :" "class:`TestResult` object generated by running a set of tests for reporting " @@ -2521,55 +2386,61 @@ msgid "" "`TestRunner.run` method for this purpose." msgstr "" -#: ../../library/unittest.rst:2014 +#: ../../library/unittest.rst:1984 msgid "" ":class:`TestResult` instances have the following attributes that will be of " "interest when inspecting the results of running a set of tests:" msgstr "" -#: ../../library/unittest.rst:2020 +#: ../../library/unittest.rst:1990 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test which raised an " "unexpected exception." msgstr "" -#: ../../library/unittest.rst:2026 +#: ../../library/unittest.rst:1996 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test where a failure " "was explicitly signalled using the :meth:`TestCase.assert\\*` methods." msgstr "" -#: ../../library/unittest.rst:2032 +#: ../../library/unittest.rst:2002 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding the reason for skipping the test." msgstr "" -#: ../../library/unittest.rst:2039 +#: ../../library/unittest.rst:2009 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents an expected failure or " "error of the test case." msgstr "" -#: ../../library/unittest.rst:2045 +#: ../../library/unittest.rst:2015 msgid "" "A list containing :class:`TestCase` instances that were marked as expected " "failures, but succeeded." msgstr "" -#: ../../library/unittest.rst:2050 +#: ../../library/unittest.rst:2020 +msgid "" +"A list containing 2-tuples of :class:`TestCase` instances and floats " +"representing the elapsed time of each test which was run." +msgstr "" + +#: ../../library/unittest.rst:2027 msgid "" "Set to ``True`` when the execution of tests should stop by :meth:`stop`." msgstr "" -#: ../../library/unittest.rst:2054 +#: ../../library/unittest.rst:2031 msgid "The total number of tests run so far." msgstr "" -#: ../../library/unittest.rst:2058 +#: ../../library/unittest.rst:2035 msgid "" "If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in " "between :meth:`startTest` and :meth:`stopTest` being called. Collected " @@ -2578,29 +2449,29 @@ msgid "" "error message." msgstr "" -#: ../../library/unittest.rst:2067 +#: ../../library/unittest.rst:2044 msgid "" "If set to true :meth:`stop` will be called on the first failure or error, " "halting the test run." msgstr "" -#: ../../library/unittest.rst:2074 +#: ../../library/unittest.rst:2051 msgid "If set to true then local variables will be shown in tracebacks." msgstr "" -#: ../../library/unittest.rst:2080 +#: ../../library/unittest.rst:2057 msgid "" "Return ``True`` if all tests run so far have passed, otherwise returns " "``False``." msgstr "" -#: ../../library/unittest.rst:2083 +#: ../../library/unittest.rst:2060 msgid "" "Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests " "marked with the :func:`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2089 +#: ../../library/unittest.rst:2066 msgid "" "This method can be called to signal that the set of tests being run should " "be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:" @@ -2608,7 +2479,7 @@ msgid "" "additional tests." msgstr "" -#: ../../library/unittest.rst:2094 +#: ../../library/unittest.rst:2071 msgid "" "For example, this feature is used by the :class:`TextTestRunner` class to " "stop the test framework when the user signals an interrupt from the " @@ -2616,7 +2487,7 @@ msgid "" "implementations can use this in a similar manner." msgstr "" -#: ../../library/unittest.rst:2099 +#: ../../library/unittest.rst:2076 msgid "" "The following methods of the :class:`TestResult` class are used to maintain " "the internal data structures, and may be extended in subclasses to support " @@ -2624,136 +2495,141 @@ msgid "" "tools which support interactive reporting while tests are being run." msgstr "" -#: ../../library/unittest.rst:2107 +#: ../../library/unittest.rst:2084 msgid "Called when the test case *test* is about to be run." msgstr "" -#: ../../library/unittest.rst:2111 +#: ../../library/unittest.rst:2088 msgid "" "Called after the test case *test* has been executed, regardless of the " "outcome." msgstr "" -#: ../../library/unittest.rst:2116 +#: ../../library/unittest.rst:2093 msgid "Called once before any tests are executed." msgstr "" -#: ../../library/unittest.rst:2123 +#: ../../library/unittest.rst:2100 msgid "Called once after all tests are executed." msgstr "" -#: ../../library/unittest.rst:2130 +#: ../../library/unittest.rst:2107 msgid "" "Called when the test case *test* raises an unexpected exception. *err* is a " "tuple of the form returned by :func:`sys.exc_info`: ``(type, value, " "traceback)``." msgstr "" -#: ../../library/unittest.rst:2134 +#: ../../library/unittest.rst:2111 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`errors` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2141 +#: ../../library/unittest.rst:2118 msgid "" "Called when the test case *test* signals a failure. *err* is a tuple of the " "form returned by :func:`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2144 +#: ../../library/unittest.rst:2121 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`failures` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2151 +#: ../../library/unittest.rst:2128 msgid "Called when the test case *test* succeeds." msgstr "" -#: ../../library/unittest.rst:2153 +#: ../../library/unittest.rst:2130 msgid "The default implementation does nothing." msgstr "" -#: ../../library/unittest.rst:2158 +#: ../../library/unittest.rst:2135 msgid "" "Called when the test case *test* is skipped. *reason* is the reason the " "test gave for skipping." msgstr "" -#: ../../library/unittest.rst:2161 +#: ../../library/unittest.rst:2138 msgid "" "The default implementation appends a tuple ``(test, reason)`` to the " "instance's :attr:`skipped` attribute." msgstr "" -#: ../../library/unittest.rst:2167 +#: ../../library/unittest.rst:2144 msgid "" "Called when the test case *test* fails or errors, but was marked with the :" "func:`expectedFailure` decorator." msgstr "" -#: ../../library/unittest.rst:2170 +#: ../../library/unittest.rst:2147 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`expectedFailures` attribute, where *formatted_err* is a " "formatted traceback derived from *err*." msgstr "" -#: ../../library/unittest.rst:2177 +#: ../../library/unittest.rst:2154 msgid "" "Called when the test case *test* was marked with the :func:`expectedFailure` " "decorator, but succeeded." msgstr "" -#: ../../library/unittest.rst:2180 +#: ../../library/unittest.rst:2157 msgid "" "The default implementation appends the test to the instance's :attr:" "`unexpectedSuccesses` attribute." msgstr "" -#: ../../library/unittest.rst:2186 +#: ../../library/unittest.rst:2163 msgid "" "Called when a subtest finishes. *test* is the test case corresponding to " "the test method. *subtest* is a custom :class:`TestCase` instance " "describing the subtest." msgstr "" -#: ../../library/unittest.rst:2190 +#: ../../library/unittest.rst:2167 msgid "" "If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed " "with an exception where *outcome* is a tuple of the form returned by :func:" "`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: ../../library/unittest.rst:2194 +#: ../../library/unittest.rst:2171 msgid "" "The default implementation does nothing when the outcome is a success, and " "records subtest failures as normal failures." msgstr "" -#: ../../library/unittest.rst:2202 +#: ../../library/unittest.rst:2178 msgid "" -"A concrete implementation of :class:`TestResult` used by the :class:" -"`TextTestRunner`." +"Called when the test case finishes. *elapsed* is the time represented in " +"seconds, and it includes the execution of cleanup functions." msgstr "" -#: ../../library/unittest.rst:2205 +#: ../../library/unittest.rst:2185 msgid "" -"This class was previously named ``_TextTestResult``. The old name still " -"exists as an alias but is deprecated." +"A concrete implementation of :class:`TestResult` used by the :class:" +"`TextTestRunner`. Subclasses should accept ``**kwargs`` to ensure " +"compatibility as the interface changes." msgstr "" -#: ../../library/unittest.rst:2212 +#: ../../library/unittest.rst:2191 +msgid "Added *durations* keyword argument." +msgstr "" + +#: ../../library/unittest.rst:2196 msgid "" "Instance of the :class:`TestLoader` class intended to be shared. If no " "customization of the :class:`TestLoader` is needed, this instance can be " "used instead of repeatedly creating new instances." msgstr "" -#: ../../library/unittest.rst:2220 +#: ../../library/unittest.rst:2205 msgid "" "A basic test runner implementation that outputs results to a stream. If " "*stream* is ``None``, the default, :data:`sys.stderr` is used as the output " @@ -2764,41 +2640,45 @@ msgid "" "unittest." msgstr "" -#: ../../library/unittest.rst:2227 +#: ../../library/unittest.rst:2212 msgid "" "By default this runner shows :exc:`DeprecationWarning`, :exc:" "`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`ImportWarning` " -"even if they are :ref:`ignored by default `. Deprecation " -"warnings caused by :ref:`deprecated unittest methods ` " -"are also special-cased and, when the warning filters are ``'default'`` or " -"``'always'``, they will appear only once per-module, in order to avoid too " -"many warning messages. This behavior can be overridden using Python's :" -"option:`!-Wd` or :option:`!-Wa` options (see :ref:`Warning control `) and leaving *warnings* to ``None``." +"even if they are :ref:`ignored by default `. This behavior " +"can be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options " +"(see :ref:`Warning control `) and leaving *warnings* to " +"``None``." msgstr "" -#: ../../library/unittest.rst:2238 -msgid "Added the ``warnings`` argument." +#: ../../library/unittest.rst:2220 +#, fuzzy +msgid "Added the *warnings* parameter." msgstr "新增 ``warnings`` 引數。" -#: ../../library/unittest.rst:2241 +#: ../../library/unittest.rst:2223 msgid "" "The default stream is set to :data:`sys.stderr` at instantiation time rather " "than import time." msgstr "" -#: ../../library/unittest.rst:2245 -msgid "Added the tb_locals parameter." +#: ../../library/unittest.rst:2227 +#, fuzzy +msgid "Added the *tb_locals* parameter." msgstr "新增 tb_locals 參數。" -#: ../../library/unittest.rst:2250 +#: ../../library/unittest.rst:2230 +#, fuzzy +msgid "Added the *durations* parameter." +msgstr "新增 tb_locals 參數。" + +#: ../../library/unittest.rst:2235 msgid "" "This method returns the instance of ``TestResult`` used by :meth:`run`. It " "is not intended to be called directly, but can be overridden in subclasses " "to provide a custom ``TestResult``." msgstr "" -#: ../../library/unittest.rst:2254 +#: ../../library/unittest.rst:2239 msgid "" "``_makeResult()`` instantiates the class or callable passed in the " "``TextTestRunner`` constructor as the ``resultclass`` argument. It defaults " @@ -2806,7 +2686,7 @@ msgid "" "class is instantiated with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2263 +#: ../../library/unittest.rst:2248 msgid "" "This method is the main public interface to the ``TextTestRunner``. This " "method takes a :class:`TestSuite` or :class:`TestCase` instance. A :class:" @@ -2814,7 +2694,7 @@ msgid "" "run and the results printed to stdout." msgstr "" -#: ../../library/unittest.rst:2274 +#: ../../library/unittest.rst:2259 msgid "" "A command-line program that loads a set of tests from *module* and runs " "them; this is primarily for making test modules conveniently executable. The " @@ -2822,13 +2702,13 @@ msgid "" "of a test script::" msgstr "" -#: ../../library/unittest.rst:2282 +#: ../../library/unittest.rst:2267 msgid "" "You can run tests with more detailed information by passing in the verbosity " "argument::" msgstr "" -#: ../../library/unittest.rst:2288 +#: ../../library/unittest.rst:2273 msgid "" "The *defaultTest* argument is either the name of a single test or an " "iterable of test names to run if no test names are specified via *argv*. If " @@ -2836,40 +2716,41 @@ msgid "" "tests found in *module* are run." msgstr "" -#: ../../library/unittest.rst:2293 +#: ../../library/unittest.rst:2278 msgid "" "The *argv* argument can be a list of options passed to the program, with the " "first element being the program name. If not specified or ``None``, the " "values of :data:`sys.argv` are used." msgstr "" -#: ../../library/unittest.rst:2297 +#: ../../library/unittest.rst:2282 msgid "" "The *testRunner* argument can either be a test runner class or an already " "created instance of it. By default ``main`` calls :func:`sys.exit` with an " -"exit code indicating success or failure of the tests run." +"exit code indicating success (0) or failure (1) of the tests run. An exit " +"code of 5 indicates that no tests were run." msgstr "" -#: ../../library/unittest.rst:2301 +#: ../../library/unittest.rst:2287 msgid "" "The *testLoader* argument has to be a :class:`TestLoader` instance, and " "defaults to :data:`defaultTestLoader`." msgstr "" -#: ../../library/unittest.rst:2304 +#: ../../library/unittest.rst:2290 msgid "" "``main`` supports being used from the interactive interpreter by passing in " "the argument ``exit=False``. This displays the result on standard output " "without calling :func:`sys.exit`::" msgstr "" -#: ../../library/unittest.rst:2311 +#: ../../library/unittest.rst:2297 msgid "" "The *failfast*, *catchbreak* and *buffer* parameters have the same effect as " "the same-name `command-line options`_." msgstr "" -#: ../../library/unittest.rst:2314 +#: ../../library/unittest.rst:2300 msgid "" "The *warnings* argument specifies the :ref:`warning filter ` " "that should be used while running the tests. If it's not specified, it will " @@ -2878,56 +2759,56 @@ msgid "" "to ``'default'``." msgstr "" -#: ../../library/unittest.rst:2320 +#: ../../library/unittest.rst:2306 msgid "" "Calling ``main`` actually returns an instance of the ``TestProgram`` class. " "This stores the result of the tests run as the ``result`` attribute." msgstr "" -#: ../../library/unittest.rst:2323 +#: ../../library/unittest.rst:2309 msgid "The *exit* parameter was added." msgstr "新增 *exit* 參數。" -#: ../../library/unittest.rst:2326 +#: ../../library/unittest.rst:2312 msgid "" "The *verbosity*, *failfast*, *catchbreak*, *buffer* and *warnings* " "parameters were added." msgstr "" -#: ../../library/unittest.rst:2330 +#: ../../library/unittest.rst:2316 msgid "" "The *defaultTest* parameter was changed to also accept an iterable of test " "names." msgstr "" -#: ../../library/unittest.rst:2336 +#: ../../library/unittest.rst:2322 msgid "load_tests Protocol" msgstr "" -#: ../../library/unittest.rst:2340 +#: ../../library/unittest.rst:2326 msgid "" "Modules or packages can customize how tests are loaded from them during " "normal test runs or test discovery by implementing a function called " "``load_tests``." msgstr "" -#: ../../library/unittest.rst:2343 +#: ../../library/unittest.rst:2329 msgid "" "If a test module defines ``load_tests`` it will be called by :meth:" "`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2348 +#: ../../library/unittest.rst:2334 msgid "" "where *pattern* is passed straight through from ``loadTestsFromModule``. It " "defaults to ``None``." msgstr "" -#: ../../library/unittest.rst:2351 +#: ../../library/unittest.rst:2337 msgid "It should return a :class:`TestSuite`." msgstr "" -#: ../../library/unittest.rst:2353 +#: ../../library/unittest.rst:2339 msgid "" "*loader* is the instance of :class:`TestLoader` doing the loading. " "*standard_tests* are the tests that would be loaded by default from the " @@ -2936,13 +2817,13 @@ msgid "" "packages as part of test discovery." msgstr "" -#: ../../library/unittest.rst:2359 +#: ../../library/unittest.rst:2345 msgid "" "A typical ``load_tests`` function that loads tests from a specific set of :" "class:`TestCase` classes may look like::" msgstr "" -#: ../../library/unittest.rst:2371 +#: ../../library/unittest.rst:2357 msgid "" "If discovery is started in a directory containing a package, either from the " "command line or by calling :meth:`TestLoader.discover`, then the package :" @@ -2952,31 +2833,31 @@ msgid "" "left up to ``load_tests`` which is called with the following arguments::" msgstr "" -#: ../../library/unittest.rst:2380 +#: ../../library/unittest.rst:2366 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " "package. (``standard_tests`` will only contain tests collected from :file:" "`__init__.py`.)" msgstr "" -#: ../../library/unittest.rst:2384 +#: ../../library/unittest.rst:2370 msgid "" "Because the pattern is passed into ``load_tests`` the package is free to " "continue (and potentially modify) test discovery. A 'do nothing' " "``load_tests`` function for a test package would look like::" msgstr "" -#: ../../library/unittest.rst:2395 +#: ../../library/unittest.rst:2381 msgid "" "Discovery no longer checks package names for matching *pattern* due to the " "impossibility of package names matching the default pattern." msgstr "" -#: ../../library/unittest.rst:2402 +#: ../../library/unittest.rst:2388 msgid "Class and Module Fixtures" msgstr "" -#: ../../library/unittest.rst:2404 +#: ../../library/unittest.rst:2390 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " "the test suite encounters a test from a new class then :meth:`tearDownClass` " @@ -2984,27 +2865,27 @@ msgid "" "`setUpClass` from the new class." msgstr "" -#: ../../library/unittest.rst:2409 +#: ../../library/unittest.rst:2395 msgid "" "Similarly if a test is from a different module from the previous test then " "``tearDownModule`` from the previous module is run, followed by " "``setUpModule`` from the new module." msgstr "" -#: ../../library/unittest.rst:2413 +#: ../../library/unittest.rst:2399 msgid "" "After all the tests have run the final ``tearDownClass`` and " "``tearDownModule`` are run." msgstr "" -#: ../../library/unittest.rst:2416 +#: ../../library/unittest.rst:2402 msgid "" "Note that shared fixtures do not play well with [potential] features like " "test parallelization and they break test isolation. They should be used with " "care." msgstr "" -#: ../../library/unittest.rst:2419 +#: ../../library/unittest.rst:2405 msgid "" "The default ordering of tests created by the unittest test loaders is to " "group all tests from the same modules and classes together. This will lead " @@ -3014,14 +2895,14 @@ msgid "" "functions may be called multiple times in a single test run." msgstr "" -#: ../../library/unittest.rst:2426 +#: ../../library/unittest.rst:2412 msgid "" "Shared fixtures are not intended to work with suites with non-standard " "ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to " "support shared fixtures." msgstr "" -#: ../../library/unittest.rst:2430 +#: ../../library/unittest.rst:2416 msgid "" "If there are any exceptions raised during one of the shared fixture " "functions the test is reported as an error. Because there is no " @@ -3031,22 +2912,22 @@ msgid "" "matter, but if you are a framework author it may be relevant." msgstr "" -#: ../../library/unittest.rst:2439 +#: ../../library/unittest.rst:2425 msgid "setUpClass and tearDownClass" msgstr "" -#: ../../library/unittest.rst:2441 +#: ../../library/unittest.rst:2427 msgid "These must be implemented as class methods::" msgstr "" -#: ../../library/unittest.rst:2454 +#: ../../library/unittest.rst:2440 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " "then you must call up to them yourself. The implementations in :class:" "`TestCase` are empty." msgstr "" -#: ../../library/unittest.rst:2458 +#: ../../library/unittest.rst:2444 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " @@ -3055,15 +2936,15 @@ msgid "" "instead of as an error." msgstr "" -#: ../../library/unittest.rst:2466 +#: ../../library/unittest.rst:2452 msgid "setUpModule and tearDownModule" msgstr "" -#: ../../library/unittest.rst:2468 +#: ../../library/unittest.rst:2454 msgid "These should be implemented as functions::" msgstr "" -#: ../../library/unittest.rst:2476 +#: ../../library/unittest.rst:2462 msgid "" "If an exception is raised in a ``setUpModule`` then none of the tests in the " "module will be run and the ``tearDownModule`` will not be run. If the " @@ -3071,13 +2952,13 @@ msgid "" "having been skipped instead of as an error." msgstr "" -#: ../../library/unittest.rst:2481 +#: ../../library/unittest.rst:2467 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" -#: ../../library/unittest.rst:2487 +#: ../../library/unittest.rst:2473 msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " @@ -3086,13 +2967,13 @@ msgid "" "`addModuleCleanup` when they are added." msgstr "" -#: ../../library/unittest.rst:2493 +#: ../../library/unittest.rst:2479 msgid "" "If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: ../../library/unittest.rst:2501 +#: ../../library/unittest.rst:2487 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :func:" @@ -3100,30 +2981,30 @@ msgid "" "method." msgstr "" -#: ../../library/unittest.rst:2511 +#: ../../library/unittest.rst:2497 msgid "" "This function is called unconditionally after :func:`tearDownModule`, or " "after :func:`setUpModule` if :func:`setUpModule` raises an exception." msgstr "" -#: ../../library/unittest.rst:2514 +#: ../../library/unittest.rst:2500 msgid "" "It is responsible for calling all the cleanup functions added by :func:" "`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" -#: ../../library/unittest.rst:2519 +#: ../../library/unittest.rst:2505 msgid "" ":func:`doModuleCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: ../../library/unittest.rst:2526 +#: ../../library/unittest.rst:2512 msgid "Signal Handling" msgstr "" -#: ../../library/unittest.rst:2530 +#: ../../library/unittest.rst:2516 msgid "" "The :option:`-c/--catch ` command-line option to unittest, " "along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide " @@ -3133,7 +3014,7 @@ msgid "" "A second control-c will raise a :exc:`KeyboardInterrupt` in the usual way." msgstr "" -#: ../../library/unittest.rst:2537 +#: ../../library/unittest.rst:2523 msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " @@ -3145,43 +3026,118 @@ msgid "" "disabled the :func:`removeHandler` decorator can be used." msgstr "" -#: ../../library/unittest.rst:2546 +#: ../../library/unittest.rst:2532 msgid "" "There are a few utility functions for framework authors to enable control-c " "handling functionality within test frameworks." msgstr "" -#: ../../library/unittest.rst:2551 +#: ../../library/unittest.rst:2537 msgid "" "Install the control-c handler. When a :const:`signal.SIGINT` is received " "(usually in response to the user pressing control-c) all registered results " "have :meth:`~TestResult.stop` called." msgstr "" -#: ../../library/unittest.rst:2558 +#: ../../library/unittest.rst:2544 msgid "" "Register a :class:`TestResult` object for control-c handling. Registering a " "result stores a weak reference to it, so it doesn't prevent the result from " "being garbage collected." msgstr "" -#: ../../library/unittest.rst:2562 +#: ../../library/unittest.rst:2548 msgid "" "Registering a :class:`TestResult` object has no side-effects if control-c " "handling is not enabled, so test frameworks can unconditionally register all " "results they create independently of whether or not handling is enabled." msgstr "" -#: ../../library/unittest.rst:2569 +#: ../../library/unittest.rst:2555 msgid "" "Remove a registered result. Once a result has been removed then :meth:" "`~TestResult.stop` will no longer be called on that result object in " "response to a control-c." msgstr "" -#: ../../library/unittest.rst:2576 +#: ../../library/unittest.rst:2562 msgid "" "When called without arguments this function removes the control-c handler if " "it has been installed. This function can also be used as a test decorator to " "temporarily remove the handler while the test is being executed::" msgstr "" + +#~ msgid ":meth:`.assertEqual`" +#~ msgstr ":meth:`.assertEqual`" + +#~ msgid "failUnlessEqual" +#~ msgstr "failUnlessEqual" + +#~ msgid "assertEquals" +#~ msgstr "assertEquals" + +#~ msgid ":meth:`.assertNotEqual`" +#~ msgstr ":meth:`.assertNotEqual`" + +#~ msgid "failIfEqual" +#~ msgstr "failIfEqual" + +#~ msgid "assertNotEquals" +#~ msgstr "assertNotEquals" + +#~ msgid ":meth:`.assertTrue`" +#~ msgstr ":meth:`.assertTrue`" + +#~ msgid "failUnless" +#~ msgstr "failUnless" + +#~ msgid "assert\\_" +#~ msgstr "assert\\_" + +#~ msgid ":meth:`.assertFalse`" +#~ msgstr ":meth:`.assertFalse`" + +#~ msgid "failIf" +#~ msgstr "failIf" + +#~ msgid ":meth:`.assertRaises`" +#~ msgstr ":meth:`.assertRaises`" + +#~ msgid "failUnlessRaises" +#~ msgstr "failUnlessRaises" + +#~ msgid ":meth:`.assertAlmostEqual`" +#~ msgstr ":meth:`.assertAlmostEqual`" + +#~ msgid "failUnlessAlmostEqual" +#~ msgstr "failUnlessAlmostEqual" + +#~ msgid "assertAlmostEquals" +#~ msgstr "assertAlmostEquals" + +#~ msgid ":meth:`.assertNotAlmostEqual`" +#~ msgstr ":meth:`.assertNotAlmostEqual`" + +#~ msgid "failIfAlmostEqual" +#~ msgstr "failIfAlmostEqual" + +#~ msgid "assertNotAlmostEquals" +#~ msgstr "assertNotAlmostEquals" + +#~ msgid ":meth:`.assertRegex`" +#~ msgstr ":meth:`.assertRegex`" + +#~ msgid "assertRegexpMatches" +#~ msgstr "assertRegexpMatches" + +#~ msgid ":meth:`.assertNotRegex`" +#~ msgstr ":meth:`.assertNotRegex`" + +#~ msgid "assertNotRegexpMatches" +#~ msgstr "assertNotRegexpMatches" + +#~ msgid ":meth:`.assertRaisesRegex`" +#~ msgstr ":meth:`.assertRaisesRegex`" + +#~ msgid "assertRaisesRegexp" +#~ msgstr "assertRaisesRegexp" diff --git a/library/urllib.error.po b/library/urllib.error.po index e95f1a8aab..262e027a29 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,6 +77,10 @@ msgstr "" "同)。這適用於處理特殊 HTTP 錯誤,例如為請求認證。" #: ../../library/urllib.error.rst:44 +msgid "Contains the request URL. An alias for *filename* attribute." +msgstr "" + +#: ../../library/urllib.error.rst:49 msgid "" "An HTTP status code as defined in :rfc:`2616`. This numeric value " "corresponds to a value found in the dictionary of codes as found in :attr:" @@ -85,17 +89,25 @@ msgstr "" "一個 HTTP 狀態碼,具體定義見 :rfc:`2616`。這個數值會對應到存放在 :attr:`http." "server.BaseHTTPRequestHandler.responses` 程式碼 dictionary 中的某個值。" -#: ../../library/urllib.error.rst:50 -msgid "This is usually a string explaining the reason for this error." +#: ../../library/urllib.error.rst:55 +#, fuzzy +msgid "" +"This is usually a string explaining the reason for this error. An alias for " +"*msg* attribute." msgstr "這通常是一個解釋本次錯誤原因的字串。" -#: ../../library/urllib.error.rst:54 +#: ../../library/urllib.error.rst:60 +#, fuzzy msgid "" "The HTTP response headers for the HTTP request that caused the :exc:" -"`HTTPError`." +"`HTTPError`. An alias for *hdrs* attribute." msgstr "導致 :exc:`HTTPError` 的特定 HTTP 請求的 HTTP 回應 header。" -#: ../../library/urllib.error.rst:61 +#: ../../library/urllib.error.rst:68 +msgid "A file-like object where the HTTP error body can be read from." +msgstr "" + +#: ../../library/urllib.error.rst:72 msgid "" "This exception is raised when the :func:`~urllib.request.urlretrieve` " "function detects that the amount of the downloaded data is less than the " diff --git a/library/uuid.po b/library/uuid.po index 0e7f4d577c..c06c6d05d5 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -251,85 +251,134 @@ msgstr "" #: ../../library/uuid.rst:188 msgid "" "Generate a UUID based on the MD5 hash of a namespace identifier (which is a " -"UUID) and a name (which is a string)." +"UUID) and a name (which is a :class:`bytes` object or a string that will be " +"encoded using UTF-8)." msgstr "" -#: ../../library/uuid.rst:196 +#: ../../library/uuid.rst:197 msgid "Generate a random UUID." msgstr "" -#: ../../library/uuid.rst:203 +#: ../../library/uuid.rst:204 msgid "" "Generate a UUID based on the SHA-1 hash of a namespace identifier (which is " -"a UUID) and a name (which is a string)." +"a UUID) and a name (which is a :class:`bytes` object or a string that will " +"be encoded using UTF-8)." msgstr "" -#: ../../library/uuid.rst:208 +#: ../../library/uuid.rst:210 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." msgstr "" -#: ../../library/uuid.rst:214 +#: ../../library/uuid.rst:216 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." msgstr "" -#: ../../library/uuid.rst:220 +#: ../../library/uuid.rst:222 msgid "When this namespace is specified, the *name* string is a URL." msgstr "" -#: ../../library/uuid.rst:225 +#: ../../library/uuid.rst:227 msgid "When this namespace is specified, the *name* string is an ISO OID." msgstr "" -#: ../../library/uuid.rst:230 +#: ../../library/uuid.rst:232 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" -#: ../../library/uuid.rst:233 +#: ../../library/uuid.rst:235 msgid "" "The :mod:`uuid` module defines the following constants for the possible " "values of the :attr:`variant` attribute:" msgstr "" -#: ../../library/uuid.rst:239 +#: ../../library/uuid.rst:241 msgid "Reserved for NCS compatibility." msgstr "" -#: ../../library/uuid.rst:244 +#: ../../library/uuid.rst:246 msgid "Specifies the UUID layout given in :rfc:`4122`." msgstr "" -#: ../../library/uuid.rst:249 +#: ../../library/uuid.rst:251 msgid "Reserved for Microsoft compatibility." msgstr "" -#: ../../library/uuid.rst:254 +#: ../../library/uuid.rst:256 msgid "Reserved for future definition." msgstr "" -#: ../../library/uuid.rst:260 +#: ../../library/uuid.rst:262 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" -#: ../../library/uuid.rst:260 +#: ../../library/uuid.rst:262 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." msgstr "" -#: ../../library/uuid.rst:267 +#: ../../library/uuid.rst:269 +msgid "Command-Line Usage" +msgstr "" + +#: ../../library/uuid.rst:273 +msgid "" +"The :mod:`uuid` module can be executed as a script from the command line." +msgstr "" + +#: ../../library/uuid.rst:279 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/uuid.rst:285 +msgid "Show the help message and exit." +msgstr "" + +#: ../../library/uuid.rst:290 +msgid "" +"Specify the function name to use to generate the uuid. By default :func:" +"`uuid4` is used." +msgstr "" + +#: ../../library/uuid.rst:296 +msgid "" +"The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known " +"predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, " +"``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` " +"functions." +msgstr "" + +#: ../../library/uuid.rst:303 +msgid "" +"The name used as part of generating the uuid. Only required for :func:" +"`uuid3` / :func:`uuid5` functions." +msgstr "" + +#: ../../library/uuid.rst:310 msgid "Example" msgstr "範例" -#: ../../library/uuid.rst:269 +#: ../../library/uuid.rst:312 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" +#: ../../library/uuid.rst:351 +msgid "Command-Line Example" +msgstr "" + +#: ../../library/uuid.rst:353 +msgid "" +"Here are some examples of typical usage of the :mod:`uuid` command line " +"interface:" +msgstr "" + #: ../../library/uuid.rst:173 msgid "getnode" msgstr "getnode" @@ -338,14 +387,14 @@ msgstr "getnode" msgid "uuid1" msgstr "uuid1" -#: ../../library/uuid.rst:191 +#: ../../library/uuid.rst:192 msgid "uuid3" msgstr "uuid3" -#: ../../library/uuid.rst:198 +#: ../../library/uuid.rst:199 msgid "uuid4" msgstr "uuid4" -#: ../../library/uuid.rst:206 +#: ../../library/uuid.rst:208 msgid "uuid5" msgstr "uuid5" diff --git a/library/venv.po b/library/venv.po index 64a8512b80..d23f89ac5e 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,13 +29,13 @@ msgstr "**原始碼:**\\ :source:`Lib/venv/`" #: ../../library/venv.rst:21 msgid "" -"The :mod:`!venv` module supports creating lightweight \"virtual environments" -"\", each with their own independent set of Python packages installed in " -"their :mod:`site` directories. A virtual environment is created on top of an " -"existing Python installation, known as the virtual environment's \"base\" " -"Python, and may optionally be isolated from the packages in the base " -"environment, so only those explicitly installed in the virtual environment " -"are available." +"The :mod:`!venv` module supports creating lightweight \"virtual " +"environments\", each with their own independent set of Python packages " +"installed in their :mod:`site` directories. A virtual environment is created " +"on top of an existing Python installation, known as the virtual " +"environment's \"base\" Python, and may optionally be isolated from the " +"packages in the base environment, so only those explicitly installed in the " +"virtual environment are available." msgstr "" #: ../../library/venv.rst:29 @@ -90,8 +90,8 @@ msgid "" "this is ``Lib\\site-packages``). If an existing directory is specified, it " "will be re-used." msgstr "" -"執行此命令會建立目標目錄(同時也會建立任何還不存在的父目錄)並在目錄中放置一個名為 " -"``pyvenv.cfg`` 的檔案,其中包含一個指向執行該命令的 Python 安裝路徑的 " +"執行此命令會建立目標目錄(同時也會建立任何還不存在的父目錄)並在目錄中放置一" +"個名為 ``pyvenv.cfg`` 的檔案,其中包含一個指向執行該命令的 Python 安裝路徑的 " "``home`` 鍵(目標目錄的常見名稱為 ``.venv``)。同時,它會建立一個 ``bin`` " "(在 Windows 上為 ``Scripts``)子目錄,其中包含一個 Python 二進位檔案的副本/" "符號連結(根據建立環境時使用的平台或引數而定)。此外,它還會建立一個(最初為" @@ -127,20 +127,24 @@ msgstr "" msgid "The command, if run with ``-h``, will show the available options::" msgstr "如果使用 ``-h`` 選項執行該命令,將會顯示可用的選項:" -#: ../../using/venv-create.inc:70 +#: ../../library/venv.rst:294 ../../using/venv-create.inc:72 +msgid "``setuptools`` is no longer a core venv dependency." +msgstr "" + +#: ../../using/venv-create.inc:74 msgid "" "Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " "PyPI" msgstr "" "新增 ``--upgrade-deps`` 選項以將 pip 和 setuptools 升級至 PyPI 上的最新版本" -#: ../../using/venv-create.inc:73 +#: ../../using/venv-create.inc:77 msgid "" "Installs pip by default, added the ``--without-pip`` and ``--copies`` " "options" msgstr "預設情況下安裝 pip,並新增了 ``--without-pip`` 和 ``--copies`` 選項" -#: ../../using/venv-create.inc:77 +#: ../../using/venv-create.inc:81 msgid "" "In earlier versions, if the target directory already existed, an error was " "raised, unless the ``--clear`` or ``--upgrade`` option was provided." @@ -148,7 +152,7 @@ msgstr "" "在較早的版本中,如果目標目錄已存在,除非提供了 ``--clear`` 或 ``--upgrade`` " "選項,否則會引發錯誤。" -#: ../../using/venv-create.inc:82 +#: ../../using/venv-create.inc:86 msgid "" "While symlinks are supported on Windows, they are not recommended. Of " "particular note is that double-clicking ``python.exe`` in File Explorer will " @@ -157,7 +161,7 @@ msgstr "" "雖然在 Windows 上支援符號連結,但並不建議使用。特別需要注意的是,在檔案總管中" "按兩下 ``python.exe`` 會急切地解析符號連結並忽略虛擬環境。" -#: ../../using/venv-create.inc:87 +#: ../../using/venv-create.inc:91 msgid "" "On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " "script by setting the execution policy for the user. You can do this by " @@ -166,12 +170,12 @@ msgstr "" "在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 ``Activate." "ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" -#: ../../using/venv-create.inc:91 +#: ../../using/venv-create.inc:95 msgid "" "PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" msgstr "" -#: ../../using/venv-create.inc:93 +#: ../../using/venv-create.inc:97 msgid "" "See `About Execution Policies `_ for more information." @@ -179,7 +183,7 @@ msgstr "" "有關更多資訊,請參閱\\ `關於執行策略 `_。" -#: ../../using/venv-create.inc:97 +#: ../../using/venv-create.inc:101 msgid "" "The created ``pyvenv.cfg`` file also includes the ``include-system-site-" "packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" @@ -189,7 +193,7 @@ msgstr "" "如果使用 ``venv`` 執行時帶有 ``--system-site-packages`` 選項,則設置為 " "``true``,否則設置為 ``false``。" -#: ../../using/venv-create.inc:101 +#: ../../using/venv-create.inc:105 msgid "" "Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " "invoked to bootstrap ``pip`` into the virtual environment." @@ -197,7 +201,7 @@ msgstr "" "除非 ``--without-pip`` 選項被提供,否則將調用 :mod:`ensurepip` 來啟動 " "``pip`` 到虛擬環境中。" -#: ../../using/venv-create.inc:104 +#: ../../using/venv-create.inc:108 msgid "" "Multiple paths can be given to ``venv``, in which case an identical virtual " "environment will be created, according to the given options, at each " @@ -219,10 +223,10 @@ msgid "" "environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " "determine if the current interpreter is running from a virtual environment." msgstr "" -"當 Python 直譯器跑在虛擬環境時,:data:`sys.prefix` 和 :data:`sys.exec_prefix` 會指" -"向虛擬環境的目錄,而 :data:`sys.base_prefix` 和 :data:`sys.base_exec_prefix` " -"會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix != sys." -"base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" +"當 Python 直譯器跑在虛擬環境時,:data:`sys.prefix` 和 :data:`sys." +"exec_prefix` 會指向虛擬環境的目錄,而 :data:`sys.base_prefix` 和 :data:`sys." +"base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix !" +"= sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" #: ../../library/venv.rst:61 msgid "" @@ -372,9 +376,8 @@ msgid "" "customize environment creation according to their needs, the :class:" "`EnvBuilder` class." msgstr "" -"上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者" -"提供可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` " -"class。" +"上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" +"可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" #: ../../library/venv.rst:148 msgid "" @@ -396,16 +399,16 @@ msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." msgstr "" -"``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目" -"標目錄內所有存在的內容。" +"``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目標目錄內所" +"有存在的內容。" #: ../../library/venv.rst:157 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." msgstr "" -"``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建" -"立符號連結而不是複製該檔案。" +"``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建立符號連" +"結而不是複製該檔案。" #: ../../library/venv.rst:160 msgid "" @@ -413,8 +416,8 @@ msgid "" "environment with the running Python - for use when that Python has been " "upgraded in-place (defaults to ``False``)." msgstr "" -"``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現" -"有的環境進行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" +"``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現有的環境進" +"行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" #: ../../library/venv.rst:164 msgid "" @@ -422,8 +425,8 @@ msgid "" "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" "pip`` option." msgstr "" -"``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬" -"環境之中。當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" +"``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。" +"當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" #: ../../library/venv.rst:168 msgid "" @@ -440,15 +443,15 @@ msgstr "" msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:175 ../../library/venv.rst:350 +#: ../../library/venv.rst:175 ../../library/venv.rst:353 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:178 ../../library/venv.rst:353 +#: ../../library/venv.rst:178 ../../library/venv.rst:356 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:181 ../../library/venv.rst:356 +#: ../../library/venv.rst:181 ../../library/venv.rst:359 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" @@ -457,8 +460,8 @@ msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." msgstr "" -"第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作" -"為 base class(基底類別)使用." +"第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 base " +"class(基底類別)使用." #: ../../library/venv.rst:187 msgid "The returned env-builder is an object which has a method, ``create``:" @@ -471,18 +474,17 @@ msgid "" "environment. The ``create`` method will either create the environment in " "the specified directory, or raise an appropriate exception." msgstr "" -"透過指定將會容納虛擬環境的目標目錄來建立一個虛擬環境(絕對路徑或" -"相對路徑到該目錄),也就是在該目錄中容納虛擬環境。" -"``create`` method 將會在指定的目錄下建立環境,或是觸發" -"適當的例外。" +"透過指定將會容納虛擬環境的目標目錄來建立一個虛擬環境(絕對路徑或相對路徑到該" +"目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" +"立環境,或是觸發適當的例外。" #: ../../library/venv.rst:197 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" msgstr "" -":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 " -"Hooks 以客製化 subclass (子類別)::" +":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " +"subclass (子類別)::" #: ../../library/venv.rst:212 msgid "" @@ -490,9 +492,8 @@ msgid "" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" "meth:`post_setup` can be overridden." msgstr "" -"每個 methods :meth:`ensure_directories`、:meth:" -"`create_configuration`、:meth:`setup_python`、:meth:`setup_scripts` 及 :meth:" -"`post_setup` 都可以被覆寫。" +"每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" +"`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" #: ../../library/venv.rst:218 msgid "" @@ -503,18 +504,18 @@ msgid "" "of the environment directory will be cleared and then all necessary " "subdirectories will be recreated." msgstr "" -"建立還不存在的環境目錄及必要的子目錄,並回傳一個情境物件(context object)。這個情境物件" -"只是一個屬性 (例如:路徑) 的所有者,可被其他 method 使用。如" -"果 :class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內" -"容將被清空,以及所有必要的子目錄將被重新建立。" +"建立還不存在的環境目錄及必要的子目錄,並回傳一個情境物件(context object)。" +"這個情境物件只是一個屬性 (例如:路徑) 的所有者,可被其他 method 使用。如果 :" +"class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" +"被清空,以及所有必要的子目錄將被重新建立。" #: ../../library/venv.rst:225 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" msgstr "" -"回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`," -"並包含以下屬性:" +"回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" +"包含以下屬性:" #: ../../library/venv.rst:228 msgid "" @@ -606,106 +607,106 @@ msgstr "" #: ../../library/venv.rst:287 msgid "" -"Upgrades the core venv dependency packages (currently ``pip`` and " -"``setuptools``) in the environment. This is done by shelling out to the " -"``pip`` executable in the environment." +"Upgrades the core venv dependency packages (currently ``pip``) in the " +"environment. This is done by shelling out to the ``pip`` executable in the " +"environment." msgstr "" -#: ../../library/venv.rst:295 +#: ../../library/venv.rst:298 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:299 +#: ../../library/venv.rst:302 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " "running from a build in the source tree." msgstr "" -#: ../../library/venv.rst:304 +#: ../../library/venv.rst:307 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -#: ../../library/venv.rst:309 +#: ../../library/venv.rst:312 msgid "" "In addition, :class:`EnvBuilder` provides this utility method that can be " "called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " "assist in installing custom scripts into the virtual environment." msgstr "" -#: ../../library/venv.rst:315 +#: ../../library/venv.rst:318 msgid "" -"*path* is the path to a directory that should contain subdirectories \"common" -"\", \"posix\", \"nt\", each containing scripts destined for the bin " +"*path* is the path to a directory that should contain subdirectories " +"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " "directory in the environment. The contents of \"common\" and the directory " "corresponding to :data:`os.name` are copied after some text replacement of " "placeholders:" msgstr "" -#: ../../library/venv.rst:321 +#: ../../library/venv.rst:324 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:327 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:330 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:333 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:336 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:336 +#: ../../library/venv.rst:339 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:339 +#: ../../library/venv.rst:342 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:345 +#: ../../library/venv.rst:348 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:360 +#: ../../library/venv.rst:363 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:362 +#: ../../library/venv.rst:365 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:581 +#: ../../library/venv.rst:576 msgid "" "This script is also available for download `online `_." diff --git a/library/warnings.po b/library/warnings.po index ba92d6bea6..22c4030933 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -584,22 +584,45 @@ msgstr "" #: ../../library/warnings.rst:413 msgid "" -"This makes the warning refer to :func:`deprecation`'s caller, rather than to " -"the source of :func:`deprecation` itself (since the latter would defeat the " +"This makes the warning refer to ``deprecated_api``'s caller, rather than to " +"the source of ``deprecated_api`` itself (since the latter would defeat the " "purpose of the warning message)." msgstr "" -#: ../../library/warnings.rst:417 ../../library/warnings.rst:440 +#: ../../library/warnings.rst:417 +msgid "" +"The *skip_file_prefixes* keyword argument can be used to indicate which " +"stack frames are ignored when counting stack levels. This can be useful when " +"you want the warning to always appear at call sites outside of a package " +"when a constant *stacklevel* does not fit all call paths or is otherwise " +"challenging to maintain. If supplied, it must be a tuple of strings. When " +"prefixes are supplied, stacklevel is implicitly overridden to be ``max(2, " +"stacklevel)``. To cause a warning to be attributed to the caller from " +"outside of the current package you might write::" +msgstr "" + +#: ../../library/warnings.rst:440 +msgid "" +"This makes the warning refer to both the ``example.lower.one_way()`` and " +"``package.higher.another_way()`` call sites only from calling code living " +"outside of ``example`` package." +msgstr "" + +#: ../../library/warnings.rst:444 ../../library/warnings.rst:470 msgid "" "*source*, if supplied, is the destroyed object which emitted a :exc:" "`ResourceWarning`." msgstr "" -#: ../../library/warnings.rst:420 +#: ../../library/warnings.rst:447 msgid "Added *source* parameter." msgstr "新增 *source* 參數。" -#: ../../library/warnings.rst:426 +#: ../../library/warnings.rst:450 +msgid "Added *skip_file_prefixes*." +msgstr "" + +#: ../../library/warnings.rst:456 msgid "" "This is a low-level interface to the functionality of :func:`warn`, passing " "in explicitly the message, category, filename and line number, and " @@ -611,7 +634,7 @@ msgid "" "case *category* will be ignored." msgstr "" -#: ../../library/warnings.rst:435 +#: ../../library/warnings.rst:465 msgid "" "*module_globals*, if supplied, should be the global namespace in use by the " "code for which the warning is issued. (This argument is used to support " @@ -619,11 +642,11 @@ msgid "" "import sources)." msgstr "" -#: ../../library/warnings.rst:443 +#: ../../library/warnings.rst:473 msgid "Add the *source* parameter." msgstr "" -#: ../../library/warnings.rst:449 +#: ../../library/warnings.rst:479 msgid "" "Write a warning to a file. The default implementation calls " "``formatwarning(message, category, filename, lineno, line)`` and writes the " @@ -634,7 +657,7 @@ msgid "" "line specified by *filename* and *lineno*." msgstr "" -#: ../../library/warnings.rst:460 +#: ../../library/warnings.rst:490 msgid "" "Format a warning the standard way. This returns a string which may contain " "embedded newlines and ends in a newline. *line* is a line of source code to " @@ -643,7 +666,7 @@ msgid "" "*lineno*." msgstr "" -#: ../../library/warnings.rst:469 +#: ../../library/warnings.rst:499 msgid "" "Insert an entry into the list of :ref:`warnings filter specifications " "`. The entry is inserted at the front by default; if " @@ -655,7 +678,7 @@ msgid "" "everything." msgstr "" -#: ../../library/warnings.rst:481 +#: ../../library/warnings.rst:511 msgid "" "Insert a simple entry into the list of :ref:`warnings filter specifications " "`. The meaning of the function parameters is as for :func:" @@ -664,18 +687,18 @@ msgid "" "and line number match." msgstr "" -#: ../../library/warnings.rst:490 +#: ../../library/warnings.rst:520 msgid "" "Reset the warnings filter. This discards the effect of all previous calls " "to :func:`filterwarnings`, including that of the :option:`-W` command line " "options and calls to :func:`simplefilter`." msgstr "" -#: ../../library/warnings.rst:496 +#: ../../library/warnings.rst:526 msgid "Available Context Managers" msgstr "" -#: ../../library/warnings.rst:500 +#: ../../library/warnings.rst:530 msgid "" "A context manager that copies and, upon exit, restores the warnings filter " "and the :func:`showwarning` function. If the *record* argument is :const:" @@ -686,21 +709,21 @@ msgid "" "has attributes with the same names as the arguments to :func:`showwarning`." msgstr "" -#: ../../library/warnings.rst:509 +#: ../../library/warnings.rst:539 msgid "" "The *module* argument takes a module that will be used instead of the module " "returned when you import :mod:`warnings` whose filter will be protected. " "This argument exists primarily for testing the :mod:`warnings` module itself." msgstr "" -#: ../../library/warnings.rst:514 +#: ../../library/warnings.rst:544 msgid "" "If the *action* argument is not ``None``, the remaining arguments are passed " "to :func:`simplefilter` as if it were called immediately on entering the " "context." msgstr "" -#: ../../library/warnings.rst:520 +#: ../../library/warnings.rst:550 msgid "" "The :class:`catch_warnings` manager works by replacing and then later " "restoring the module's :func:`showwarning` function and internal list of " @@ -708,7 +731,7 @@ msgid "" "state and therefore is not thread-safe." msgstr "" -#: ../../library/warnings.rst:528 +#: ../../library/warnings.rst:558 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." msgstr "" diff --git a/library/wave.po b/library/wave.po index 1737b46582..28a7e207c1 100644 --- a/library/wave.po +++ b/library/wave.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-01 00:22+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,42 +29,47 @@ msgstr "**原始碼:**\\ :source:`Lib/wave.py`" #: ../../library/wave.rst:14 msgid "" "The :mod:`wave` module provides a convenient interface to the Waveform Audio " -"\"WAVE\" (or \"WAV\") file format. Only files using ``WAVE_FORMAT_PCM`` are " -"supported. Note that this does not include files using " -"``WAVE_FORMAT_EXTENSIBLE`` even if the subformat is PCM." +"\"WAVE\" (or \"WAV\") file format. Only uncompressed PCM encoded wave files " +"are supported." msgstr "" -#: ../../library/wave.rst:19 +#: ../../library/wave.rst:20 +msgid "" +"Support for ``WAVE_FORMAT_EXTENSIBLE`` headers was added, provided that the " +"extended format is ``KSDATAFORMAT_SUBTYPE_PCM``." +msgstr "" + +#: ../../library/wave.rst:23 msgid "The :mod:`wave` module defines the following function and exception:" msgstr "" -#: ../../library/wave.rst:24 +#: ../../library/wave.rst:28 msgid "" "If *file* is a string, open the file by that name, otherwise treat it as a " "file-like object. *mode* can be:" msgstr "" -#: ../../library/wave.rst:28 +#: ../../library/wave.rst:32 msgid "``'rb'``" msgstr "``'rb'``" -#: ../../library/wave.rst:28 +#: ../../library/wave.rst:32 msgid "Read only mode." msgstr "" -#: ../../library/wave.rst:31 +#: ../../library/wave.rst:35 msgid "``'wb'``" msgstr "``'wb'``" -#: ../../library/wave.rst:31 +#: ../../library/wave.rst:35 msgid "Write only mode." msgstr "" -#: ../../library/wave.rst:33 +#: ../../library/wave.rst:37 msgid "Note that it does not allow read/write WAV files." msgstr "" -#: ../../library/wave.rst:35 +#: ../../library/wave.rst:39 msgid "" "A *mode* of ``'rb'`` returns a :class:`Wave_read` object, while a *mode* of " "``'wb'`` returns a :class:`Wave_write` object. If *mode* is omitted and a " @@ -72,132 +77,132 @@ msgid "" "value for *mode*." msgstr "" -#: ../../library/wave.rst:40 +#: ../../library/wave.rst:44 msgid "" "If you pass in a file-like object, the wave object will not close it when " "its ``close()`` method is called; it is the caller's responsibility to close " "the file object." msgstr "" -#: ../../library/wave.rst:44 +#: ../../library/wave.rst:48 msgid "" "The :func:`.open` function may be used in a :keyword:`with` statement. When " "the :keyword:`!with` block completes, the :meth:`Wave_read.close()` or :meth:" "`Wave_write.close()` method is called." msgstr "" -#: ../../library/wave.rst:48 ../../library/wave.rst:172 +#: ../../library/wave.rst:52 ../../library/wave.rst:176 msgid "Added support for unseekable files." msgstr "" -#: ../../library/wave.rst:53 +#: ../../library/wave.rst:57 msgid "" "An error raised when something is impossible because it violates the WAV " "specification or hits an implementation deficiency." msgstr "" -#: ../../library/wave.rst:60 +#: ../../library/wave.rst:64 msgid "Wave_read Objects" msgstr "Wave_read 物件" -#: ../../library/wave.rst:64 +#: ../../library/wave.rst:68 msgid "Read a WAV file." msgstr "" -#: ../../library/wave.rst:66 +#: ../../library/wave.rst:70 msgid "" "Wave_read objects, as returned by :func:`.open`, have the following methods:" msgstr "" -#: ../../library/wave.rst:71 +#: ../../library/wave.rst:75 msgid "" "Close the stream if it was opened by :mod:`wave`, and make the instance " "unusable. This is called automatically on object collection." msgstr "" -#: ../../library/wave.rst:77 +#: ../../library/wave.rst:81 msgid "Returns number of audio channels (``1`` for mono, ``2`` for stereo)." msgstr "" -#: ../../library/wave.rst:82 +#: ../../library/wave.rst:86 msgid "Returns sample width in bytes." msgstr "" -#: ../../library/wave.rst:87 +#: ../../library/wave.rst:91 msgid "Returns sampling frequency." msgstr "" -#: ../../library/wave.rst:92 +#: ../../library/wave.rst:96 msgid "Returns number of audio frames." msgstr "" -#: ../../library/wave.rst:97 +#: ../../library/wave.rst:101 msgid "Returns compression type (``'NONE'`` is the only supported type)." msgstr "" -#: ../../library/wave.rst:102 +#: ../../library/wave.rst:106 msgid "" "Human-readable version of :meth:`getcomptype`. Usually ``'not compressed'`` " "parallels ``'NONE'``." msgstr "" -#: ../../library/wave.rst:108 +#: ../../library/wave.rst:112 msgid "" "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " "framerate, nframes, comptype, compname)``, equivalent to output of the " "``get*()`` methods." msgstr "" -#: ../../library/wave.rst:115 +#: ../../library/wave.rst:119 msgid "" "Reads and returns at most *n* frames of audio, as a :class:`bytes` object." msgstr "" -#: ../../library/wave.rst:120 +#: ../../library/wave.rst:124 msgid "Rewind the file pointer to the beginning of the audio stream." msgstr "" -#: ../../library/wave.rst:122 +#: ../../library/wave.rst:126 msgid "" "The following two methods are defined for compatibility with the :mod:`aifc` " "module, and don't do anything interesting." msgstr "" -#: ../../library/wave.rst:128 +#: ../../library/wave.rst:132 msgid "Returns ``None``." msgstr "" -#: ../../library/wave.rst:133 +#: ../../library/wave.rst:137 msgid "Raise an error." msgstr "" -#: ../../library/wave.rst:135 +#: ../../library/wave.rst:139 msgid "" "The following two methods define a term \"position\" which is compatible " "between them, and is otherwise implementation dependent." msgstr "" -#: ../../library/wave.rst:141 +#: ../../library/wave.rst:145 msgid "Set the file pointer to the specified position." msgstr "" -#: ../../library/wave.rst:146 +#: ../../library/wave.rst:150 msgid "Return current file pointer position." msgstr "" -#: ../../library/wave.rst:152 +#: ../../library/wave.rst:156 msgid "Wave_write Objects" msgstr "Wave_write 物件" -#: ../../library/wave.rst:156 +#: ../../library/wave.rst:160 msgid "Write a WAV file." msgstr "" -#: ../../library/wave.rst:158 +#: ../../library/wave.rst:162 msgid "Wave_write objects, as returned by :func:`.open`." msgstr "" -#: ../../library/wave.rst:160 +#: ../../library/wave.rst:164 msgid "" "For seekable output streams, the ``wave`` header will automatically be " "updated to reflect the number of frames actually written. For unseekable " @@ -211,11 +216,11 @@ msgid "" "*nframes* accordingly before writing the frame data." msgstr "" -#: ../../library/wave.rst:175 +#: ../../library/wave.rst:179 msgid "Wave_write objects have the following methods:" msgstr "" -#: ../../library/wave.rst:179 +#: ../../library/wave.rst:183 msgid "" "Make sure *nframes* is correct, and close the file if it was opened by :mod:" "`wave`. This method is called upon object collection. It will raise an " @@ -223,57 +228,57 @@ msgid "" "the number of frames actually written." msgstr "" -#: ../../library/wave.rst:187 +#: ../../library/wave.rst:191 msgid "Set the number of channels." msgstr "" -#: ../../library/wave.rst:192 +#: ../../library/wave.rst:196 msgid "Set the sample width to *n* bytes." msgstr "" -#: ../../library/wave.rst:197 +#: ../../library/wave.rst:201 msgid "Set the frame rate to *n*." msgstr "" -#: ../../library/wave.rst:199 +#: ../../library/wave.rst:203 msgid "A non-integral input to this method is rounded to the nearest integer." msgstr "" -#: ../../library/wave.rst:206 +#: ../../library/wave.rst:210 msgid "" "Set the number of frames to *n*. This will be changed later if the number " "of frames actually written is different (this update attempt will raise an " "error if the output stream is not seekable)." msgstr "" -#: ../../library/wave.rst:213 +#: ../../library/wave.rst:217 msgid "" "Set the compression type and description. At the moment, only compression " "type ``NONE`` is supported, meaning no compression." msgstr "" -#: ../../library/wave.rst:219 +#: ../../library/wave.rst:223 msgid "" "The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, " "compname)``, with values valid for the ``set*()`` methods. Sets all " "parameters." msgstr "" -#: ../../library/wave.rst:226 +#: ../../library/wave.rst:230 msgid "" "Return current position in the file, with the same disclaimer for the :meth:" "`Wave_read.tell` and :meth:`Wave_read.setpos` methods." msgstr "" -#: ../../library/wave.rst:232 +#: ../../library/wave.rst:236 msgid "Write audio frames, without correcting *nframes*." msgstr "" -#: ../../library/wave.rst:234 ../../library/wave.rst:245 +#: ../../library/wave.rst:238 ../../library/wave.rst:249 msgid "Any :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/wave.rst:240 +#: ../../library/wave.rst:244 msgid "" "Write audio frames and make sure *nframes* is correct. It will raise an " "error if the output stream is not seekable and the total number of frames " @@ -281,7 +286,7 @@ msgid "" "previously set value for *nframes*." msgstr "" -#: ../../library/wave.rst:248 +#: ../../library/wave.rst:252 msgid "" "Note that it is invalid to set any parameters after calling :meth:" "`writeframes` or :meth:`writeframesraw`, and any attempt to do so will " diff --git a/library/webbrowser.po b/library/webbrowser.po index 008be12284..014f0591bc 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,7 +114,8 @@ msgid "" "Raises an :ref:`auditing event ` ``webbrowser.open`` with argument " "``url``." msgstr "" -"引發一個附帶引數 ``url`` 的\\ :ref:`稽核事件 ` ``webbrowser.open``。" +"引發一個附帶引數 ``url`` 的\\ :ref:`稽核事件 ` ``webbrowser." +"open``。" #: ../../library/webbrowser.rst:74 msgid "" @@ -189,184 +190,145 @@ msgid "``'firefox'``" msgstr "``'firefox'``" #: ../../library/webbrowser.rst:118 -msgid "``'netscape'``" -msgstr "``'netscape'``" - -#: ../../library/webbrowser.rst:118 -msgid ":class:`Mozilla('netscape')`" -msgstr ":class:`Mozilla('netscape')`" - -#: ../../library/webbrowser.rst:120 -msgid "``'galeon'``" -msgstr "``'galeon'``" - -#: ../../library/webbrowser.rst:120 -msgid ":class:`Galeon('galeon')`" -msgstr ":class:`Galeon('galeon')`" - -#: ../../library/webbrowser.rst:122 msgid "``'epiphany'``" msgstr "``'epiphany'``" -#: ../../library/webbrowser.rst:122 -msgid ":class:`Galeon('epiphany')`" +#: ../../library/webbrowser.rst:118 +#, fuzzy +msgid ":class:`Epiphany('epiphany')`" msgstr ":class:`Galeon('epiphany')`" -#: ../../library/webbrowser.rst:124 -msgid "``'skipstone'``" -msgstr "``'skipstone'``" - -#: ../../library/webbrowser.rst:124 -msgid ":class:`BackgroundBrowser('skipstone')`" -msgstr ":class:`BackgroundBrowser('skipstone')`" - -#: ../../library/webbrowser.rst:126 +#: ../../library/webbrowser.rst:120 msgid "``'kfmclient'``" msgstr "``'kfmclient'``" -#: ../../library/webbrowser.rst:126 ../../library/webbrowser.rst:128 -#: ../../library/webbrowser.rst:130 +#: ../../library/webbrowser.rst:120 ../../library/webbrowser.rst:122 +#: ../../library/webbrowser.rst:124 msgid ":class:`Konqueror()`" msgstr ":class:`Konqueror()`" -#: ../../library/webbrowser.rst:126 ../../library/webbrowser.rst:128 -#: ../../library/webbrowser.rst:130 +#: ../../library/webbrowser.rst:120 ../../library/webbrowser.rst:122 +#: ../../library/webbrowser.rst:124 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/webbrowser.rst:128 +#: ../../library/webbrowser.rst:122 msgid "``'konqueror'``" msgstr "``'konqueror'``" -#: ../../library/webbrowser.rst:130 +#: ../../library/webbrowser.rst:124 msgid "``'kfm'``" msgstr "``'kfm'``" -#: ../../library/webbrowser.rst:132 -msgid "``'mosaic'``" -msgstr "``'mosaic'``" - -#: ../../library/webbrowser.rst:132 -msgid ":class:`BackgroundBrowser('mosaic')`" -msgstr ":class:`BackgroundBrowser('mosaic')`" - -#: ../../library/webbrowser.rst:134 +#: ../../library/webbrowser.rst:126 msgid "``'opera'``" msgstr "``'opera'``" -#: ../../library/webbrowser.rst:134 +#: ../../library/webbrowser.rst:126 msgid ":class:`Opera()`" msgstr ":class:`Opera()`" -#: ../../library/webbrowser.rst:136 -msgid "``'grail'``" -msgstr "``'grail'``" - -#: ../../library/webbrowser.rst:136 -msgid ":class:`Grail()`" -msgstr ":class:`Grail()`" - -#: ../../library/webbrowser.rst:138 +#: ../../library/webbrowser.rst:128 msgid "``'links'``" msgstr "``'links'``" -#: ../../library/webbrowser.rst:138 +#: ../../library/webbrowser.rst:128 msgid ":class:`GenericBrowser('links')`" msgstr ":class:`GenericBrowser('links')`" -#: ../../library/webbrowser.rst:140 +#: ../../library/webbrowser.rst:130 msgid "``'elinks'``" msgstr "``'elinks'``" -#: ../../library/webbrowser.rst:140 +#: ../../library/webbrowser.rst:130 msgid ":class:`Elinks('elinks')`" msgstr ":class:`Elinks('elinks')`" -#: ../../library/webbrowser.rst:142 +#: ../../library/webbrowser.rst:132 msgid "``'lynx'``" msgstr "``'lynx'``" -#: ../../library/webbrowser.rst:142 +#: ../../library/webbrowser.rst:132 msgid ":class:`GenericBrowser('lynx')`" msgstr ":class:`GenericBrowser('lynx')`" -#: ../../library/webbrowser.rst:144 +#: ../../library/webbrowser.rst:134 msgid "``'w3m'``" msgstr "``'w3m'``" -#: ../../library/webbrowser.rst:144 +#: ../../library/webbrowser.rst:134 msgid ":class:`GenericBrowser('w3m')`" msgstr ":class:`GenericBrowser('w3m')`" -#: ../../library/webbrowser.rst:146 +#: ../../library/webbrowser.rst:136 msgid "``'windows-default'``" msgstr "``'windows-default'``" -#: ../../library/webbrowser.rst:146 +#: ../../library/webbrowser.rst:136 msgid ":class:`WindowsDefault`" msgstr ":class:`WindowsDefault`" -#: ../../library/webbrowser.rst:146 +#: ../../library/webbrowser.rst:136 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/webbrowser.rst:148 +#: ../../library/webbrowser.rst:138 msgid "``'macosx'``" msgstr "``'macosx'``" -#: ../../library/webbrowser.rst:148 +#: ../../library/webbrowser.rst:138 msgid ":class:`MacOSXOSAScript('default')`" msgstr ":class:`MacOSXOSAScript('default')`" -#: ../../library/webbrowser.rst:148 ../../library/webbrowser.rst:150 +#: ../../library/webbrowser.rst:138 ../../library/webbrowser.rst:140 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/webbrowser.rst:150 +#: ../../library/webbrowser.rst:140 msgid "``'safari'``" msgstr "``'safari'``" -#: ../../library/webbrowser.rst:150 +#: ../../library/webbrowser.rst:140 msgid ":class:`MacOSXOSAScript('safari')`" msgstr ":class:`MacOSXOSAScript('safari')`" -#: ../../library/webbrowser.rst:152 +#: ../../library/webbrowser.rst:142 msgid "``'google-chrome'``" msgstr "``'google-chrome'``" -#: ../../library/webbrowser.rst:152 +#: ../../library/webbrowser.rst:142 msgid ":class:`Chrome('google-chrome')`" msgstr ":class:`Chrome('google-chrome')`" -#: ../../library/webbrowser.rst:154 +#: ../../library/webbrowser.rst:144 msgid "``'chrome'``" msgstr "``'chrome'``" -#: ../../library/webbrowser.rst:154 +#: ../../library/webbrowser.rst:144 msgid ":class:`Chrome('chrome')`" msgstr ":class:`Chrome('chrome')`" -#: ../../library/webbrowser.rst:156 +#: ../../library/webbrowser.rst:146 msgid "``'chromium'``" msgstr "``'chromium'``" -#: ../../library/webbrowser.rst:156 +#: ../../library/webbrowser.rst:146 msgid ":class:`Chromium('chromium')`" msgstr ":class:`Chromium('chromium')`" -#: ../../library/webbrowser.rst:158 +#: ../../library/webbrowser.rst:148 msgid "``'chromium-browser'``" msgstr "``'chromium-browser'``" -#: ../../library/webbrowser.rst:158 +#: ../../library/webbrowser.rst:148 msgid ":class:`Chromium('chromium-browser')`" msgstr ":class:`Chromium('chromium-browser')`" -#: ../../library/webbrowser.rst:161 +#: ../../library/webbrowser.rst:151 msgid "Notes:" msgstr "註解:" -#: ../../library/webbrowser.rst:164 +#: ../../library/webbrowser.rst:154 msgid "" "\"Konqueror\" is the file manager for the KDE desktop environment for Unix, " "and only makes sense to use if KDE is running. Some way of reliably " @@ -376,69 +338,106 @@ msgid "" "best strategy for running Konqueror." msgstr "" -#: ../../library/webbrowser.rst:171 +#: ../../library/webbrowser.rst:161 msgid "Only on Windows platforms." msgstr "" -#: ../../library/webbrowser.rst:174 +#: ../../library/webbrowser.rst:164 msgid "Only on macOS platform." msgstr "" -#: ../../library/webbrowser.rst:176 +#: ../../library/webbrowser.rst:166 msgid "Support for Chrome/Chromium has been added." msgstr "" -#: ../../library/webbrowser.rst:181 +#: ../../library/webbrowser.rst:169 +msgid "" +"Support for several obsolete browsers has been removed. Removed browsers " +"include Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, and Firefox " +"versions 35 and below." +msgstr "" + +#: ../../library/webbrowser.rst:176 msgid ":class:`MacOSX` is deprecated, use :class:`MacOSXOSAScript` instead." msgstr "" -#: ../../library/webbrowser.rst:182 +#: ../../library/webbrowser.rst:177 msgid "Here are some simple examples::" msgstr "" "以下是一些簡單範例:\n" "\n" "::" -#: ../../library/webbrowser.rst:196 +#: ../../library/webbrowser.rst:191 msgid "Browser Controller Objects" msgstr "" -#: ../../library/webbrowser.rst:198 +#: ../../library/webbrowser.rst:193 msgid "" "Browser controllers provide these methods which parallel three of the module-" "level convenience functions:" msgstr "" -#: ../../library/webbrowser.rst:204 +#: ../../library/webbrowser.rst:199 msgid "System-dependent name for the browser." msgstr "" -#: ../../library/webbrowser.rst:209 +#: ../../library/webbrowser.rst:204 msgid "" "Display *url* using the browser handled by this controller. If *new* is 1, a " "new browser window is opened if possible. If *new* is 2, a new browser page " "(\"tab\") is opened if possible." msgstr "" -#: ../../library/webbrowser.rst:216 +#: ../../library/webbrowser.rst:211 msgid "" "Open *url* in a new window of the browser handled by this controller, if " "possible, otherwise, open *url* in the only browser window. Alias :func:" "`open_new`." msgstr "" -#: ../../library/webbrowser.rst:223 +#: ../../library/webbrowser.rst:218 msgid "" "Open *url* in a new page (\"tab\") of the browser handled by this " "controller, if possible, otherwise equivalent to :func:`open_new`." msgstr "" -#: ../../library/webbrowser.rst:228 +#: ../../library/webbrowser.rst:223 msgid "Footnotes" msgstr "註解" -#: ../../library/webbrowser.rst:229 +#: ../../library/webbrowser.rst:224 msgid "" "Executables named here without a full path will be searched in the " "directories given in the :envvar:`PATH` environment variable." msgstr "" + +#~ msgid "``'netscape'``" +#~ msgstr "``'netscape'``" + +#~ msgid ":class:`Mozilla('netscape')`" +#~ msgstr ":class:`Mozilla('netscape')`" + +#~ msgid "``'galeon'``" +#~ msgstr "``'galeon'``" + +#~ msgid ":class:`Galeon('galeon')`" +#~ msgstr ":class:`Galeon('galeon')`" + +#~ msgid "``'skipstone'``" +#~ msgstr "``'skipstone'``" + +#~ msgid ":class:`BackgroundBrowser('skipstone')`" +#~ msgstr ":class:`BackgroundBrowser('skipstone')`" + +#~ msgid "``'mosaic'``" +#~ msgstr "``'mosaic'``" + +#~ msgid ":class:`BackgroundBrowser('mosaic')`" +#~ msgstr ":class:`BackgroundBrowser('mosaic')`" + +#~ msgid "``'grail'``" +#~ msgstr "``'grail'``" + +#~ msgid ":class:`Grail()`" +#~ msgstr ":class:`Grail()`" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 01c3e654cf..76d2b746c6 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -640,14 +640,14 @@ 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` " "containing XML data. *events* is a sequence of events to report back. The " -"supported events are the strings ``\"start\"``, ``\"end\"``, ``\"comment" -"\"``, ``\"pi\"``, ``\"start-ns\"`` and ``\"end-ns\"`` (the \"ns\" events are " -"used to get detailed namespace information). If *events* is omitted, only ``" -"\"end\"`` events are reported. *parser* is an optional parser instance. If " -"not given, the standard :class:`XMLParser` parser is used. *parser* must be " -"a subclass of :class:`XMLParser` and can only use the default :class:" -"`TreeBuilder` as a target. Returns an :term:`iterator` providing ``(event, " -"elem)`` pairs." +"supported events are the strings ``\"start\"``, ``\"end\"``, " +"``\"comment\"``, ``\"pi\"``, ``\"start-ns\"`` and ``\"end-ns\"`` (the \"ns\" " +"events are used to get detailed namespace information). If *events* is " +"omitted, only ``\"end\"`` events are reported. *parser* is an optional " +"parser instance. If not given, the standard :class:`XMLParser` parser is " +"used. *parser* must be a subclass of :class:`XMLParser` and can only use " +"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " +"providing ``(event, elem)`` pairs." msgstr "" #: ../../library/xml.etree.elementtree.rst:626 @@ -668,7 +668,7 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1469 +#: ../../library/xml.etree.elementtree.rst:1473 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" @@ -677,7 +677,7 @@ msgid "The *parser* argument." msgstr "*parser* 引數。" #: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1473 +#: ../../library/xml.etree.elementtree.rst:1477 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" @@ -735,15 +735,15 @@ msgid "" "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " "the output encoding (default is US-ASCII). Use ``encoding=\"unicode\"`` to " "generate a Unicode string (otherwise, a bytestring is generated). *method* " -"is either ``\"xml\"``, ``\"html\"`` or ``\"text\"`` (default is ``\"xml" -"\"``). *xml_declaration*, *default_namespace* and *short_empty_elements* has " -"the same meaning as in :meth:`ElementTree.write`. Returns an (optionally) " -"encoded string containing the XML data." +"is either ``\"xml\"``, ``\"html\"`` or ``\"text\"`` (default is " +"``\"xml\"``). *xml_declaration*, *default_namespace* and " +"*short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. " +"Returns an (optionally) encoded string containing the XML data." msgstr "" #: ../../library/xml.etree.elementtree.rst:705 #: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1181 +#: ../../library/xml.etree.elementtree.rst:1184 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" @@ -764,12 +764,12 @@ msgid "" "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " "the output encoding (default is US-ASCII). Use ``encoding=\"unicode\"`` to " "generate a Unicode string (otherwise, a bytestring is generated). *method* " -"is either ``\"xml\"``, ``\"html\"`` or ``\"text\"`` (default is ``\"xml" -"\"``). *xml_declaration*, *default_namespace* and *short_empty_elements* has " -"the same meaning as in :meth:`ElementTree.write`. Returns a list of " -"(optionally) encoded strings containing the XML data. It does not guarantee " -"any specific sequence, except that ``b\"\".join(tostringlist(element)) == " -"tostring(element)``." +"is either ``\"xml\"``, ``\"html\"`` or ``\"text\"`` (default is " +"``\"xml\"``). *xml_declaration*, *default_namespace* and " +"*short_empty_elements* has the same meaning as in :meth:`ElementTree.write`. " +"Returns a list of (optionally) encoded strings containing the XML data. It " +"does not guarantee any specific sequence, except that ``b\"\"." +"join(tostringlist(element)) == tostring(element)``." msgstr "" #: ../../library/xml.etree.elementtree.rst:738 @@ -856,10 +856,10 @@ 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\". " "*encoding* is an optional text encoding. If not given, encoding is " -"``utf-8``. 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." +"``utf-8``. Returns the expanded resource. If the parse mode is " +"``\"xml\"``, this is an ElementTree instance. If the parse mode is " +"\"text\", this is a Unicode string. If the loader fails, it can return None " +"or raise an exception." msgstr "" #: ../../library/xml.etree.elementtree.rst:843 @@ -929,8 +929,8 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:902 msgid "" -"To collect the inner text of an element, see :meth:`itertext`, for example ``" -"\"\".join(element.itertext())``." +"To collect the inner text of an element, see :meth:`itertext`, for example " +"``\"\".join(element.itertext())``." msgstr "" #: ../../library/xml.etree.elementtree.rst:905 @@ -1078,12 +1078,16 @@ msgstr "" #: ../../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. ::" +"Caution: Elements with no subelements will test as ``False``. Testing the " +"truth value of an Element is deprecated and will raise an exception in " +"Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" #: ../../library/xml.etree.elementtree.rst:1060 +msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." +msgstr "" + +#: ../../library/xml.etree.elementtree.rst:1063 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1092,7 +1096,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1066 +#: ../../library/xml.etree.elementtree.rst:1069 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 " @@ -1327,11 +1332,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1344 +#: ../../library/xml.etree.elementtree.rst:1348 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1349 +#: ../../library/xml.etree.elementtree.rst:1353 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 " @@ -1342,24 +1347,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1357 +#: ../../library/xml.etree.elementtree.rst:1361 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1364 +#: ../../library/xml.etree.elementtree.rst:1368 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:1371 +#: ../../library/xml.etree.elementtree.rst:1375 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1373 +#: ../../library/xml.etree.elementtree.rst:1377 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 " @@ -1370,27 +1375,27 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1417 +#: ../../library/xml.etree.elementtree.rst:1421 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1421 +#: ../../library/xml.etree.elementtree.rst:1425 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 " "callback target, :class:`XMLPullParser` collects an internal list of parsing " "events and lets the user read from it. *events* is a sequence of events to " -"report back. The supported events are the strings ``\"start\"``, ``\"end" -"\"``, ``\"comment\"``, ``\"pi\"``, ``\"start-ns\"`` and ``\"end-ns\"`` (the " -"\"ns\" events are used to get detailed namespace information). If *events* " -"is omitted, only ``\"end\"`` events are reported." +"report back. The supported events are the strings ``\"start\"``, " +"``\"end\"``, ``\"comment\"``, ``\"pi\"``, ``\"start-ns\"`` and ``\"end-" +"ns\"`` (the \"ns\" events are used to get detailed namespace information). " +"If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1432 +#: ../../library/xml.etree.elementtree.rst:1436 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1436 +#: ../../library/xml.etree.elementtree.rst:1440 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1398,7 +1403,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1443 +#: ../../library/xml.etree.elementtree.rst:1447 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 " @@ -1407,25 +1412,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1449 +#: ../../library/xml.etree.elementtree.rst:1453 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1450 +#: ../../library/xml.etree.elementtree.rst:1454 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1451 +#: ../../library/xml.etree.elementtree.rst:1455 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1453 +#: ../../library/xml.etree.elementtree.rst:1457 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1459 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 " @@ -1434,7 +1439,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1463 +#: ../../library/xml.etree.elementtree.rst:1467 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 " @@ -1443,11 +1448,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1478 +#: ../../library/xml.etree.elementtree.rst:1482 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:1486 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 " @@ -1455,22 +1460,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1489 +#: ../../library/xml.etree.elementtree.rst:1493 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:1494 +#: ../../library/xml.etree.elementtree.rst:1498 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1497 +#: ../../library/xml.etree.elementtree.rst:1501 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1502 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.utils.po b/library/xml.sax.utils.po index 814663f8e2..66cd30312f 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,11 +45,18 @@ msgid "" "``'<'`` and ``'>'`` are always escaped, even if *entities* is provided." msgstr "" -#: ../../library/xml.sax.utils.rst:31 +#: ../../library/xml.sax.utils.rst:30 +msgid "" +"This function should only be used to escape characters that can't be used " +"directly in XML. Do not use this function as a general string translation " +"function." +msgstr "" + +#: ../../library/xml.sax.utils.rst:36 msgid "Unescape ``'&'``, ``'<'``, and ``'>'`` in a string of data." msgstr "" -#: ../../library/xml.sax.utils.rst:33 +#: ../../library/xml.sax.utils.rst:38 msgid "" "You can unescape other strings of data by passing a dictionary as the " "optional *entities* parameter. The keys and values must all be strings; " @@ -58,7 +65,7 @@ msgid "" "provided." msgstr "" -#: ../../library/xml.sax.utils.rst:41 +#: ../../library/xml.sax.utils.rst:46 msgid "" "Similar to :func:`escape`, but also prepares *data* to be used as an " "attribute value. The return value is a quoted version of *data* with any " @@ -70,13 +77,13 @@ msgid "" "directly as an attribute value::" msgstr "" -#: ../../library/xml.sax.utils.rst:53 +#: ../../library/xml.sax.utils.rst:58 msgid "" "This function is useful when generating attribute values for HTML or any " "SGML using the reference concrete syntax." msgstr "" -#: ../../library/xml.sax.utils.rst:59 +#: ../../library/xml.sax.utils.rst:64 msgid "" "This class implements the :class:`~xml.sax.handler.ContentHandler` interface " "by writing SAX events back into an XML document. In other words, using an :" @@ -89,11 +96,11 @@ msgid "" "a single self-closed tag." msgstr "" -#: ../../library/xml.sax.utils.rst:69 +#: ../../library/xml.sax.utils.rst:74 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" -#: ../../library/xml.sax.utils.rst:75 +#: ../../library/xml.sax.utils.rst:80 msgid "" "This class is designed to sit between an :class:`~xml.sax.xmlreader." "XMLReader` and the client application's event handlers. By default, it does " @@ -102,7 +109,7 @@ msgid "" "stream or the configuration requests as they pass through." msgstr "" -#: ../../library/xml.sax.utils.rst:85 +#: ../../library/xml.sax.utils.rst:90 msgid "" "This function takes an input source and an optional base URL and returns a " "fully resolved :class:`~xml.sax.xmlreader.InputSource` object ready for " diff --git a/library/zipapp.po b/library/zipapp.po index 1c50c3da90..98ba7517a7 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -385,73 +385,10 @@ msgid "" msgstr "" #: ../../library/zipapp.rst:307 -msgid "Making a Windows executable" -msgstr "" - -#: ../../library/zipapp.rst:309 -msgid "" -"On Windows, registration of the ``.pyz`` extension is optional, and " -"furthermore, there are certain places that don't recognise registered " -"extensions \"transparently\" (the simplest example is that ``subprocess." -"run(['myapp'])`` won't find your application - you need to explicitly " -"specify the extension)." -msgstr "" - -#: ../../library/zipapp.rst:315 -msgid "" -"On Windows, therefore, it is often preferable to create an executable from " -"the zipapp. This is relatively easy, although it does require a C " -"compiler. The basic approach relies on the fact that zipfiles can have " -"arbitrary data prepended, and Windows exe files can have arbitrary data " -"appended. So by creating a suitable launcher and tacking the ``.pyz`` file " -"onto the end of it, you end up with a single-file executable that runs your " -"application." -msgstr "" - -#: ../../library/zipapp.rst:322 -msgid "A suitable launcher can be as simple as the following::" -msgstr "" - -#: ../../library/zipapp.rst:347 -msgid "" -"If you define the ``WINDOWS`` preprocessor symbol, this will generate a GUI " -"executable, and without it, a console executable." -msgstr "" - -#: ../../library/zipapp.rst:350 -msgid "" -"To compile the executable, you can either just use the standard MSVC command " -"line tools, or you can take advantage of the fact that distutils knows how " -"to compile Python source::" -msgstr "" - -#: ../../library/zipapp.rst:377 -msgid "" -"The resulting launcher uses the \"Limited ABI\", so it will run unchanged " -"with any version of Python 3.x. All it needs is for Python (``python3." -"dll``) to be on the user's ``PATH``." -msgstr "" - -#: ../../library/zipapp.rst:381 -msgid "" -"For a fully standalone distribution, you can distribute the launcher with " -"your application appended, bundled with the Python \"embedded\" " -"distribution. This will run on any PC with the appropriate architecture (32 " -"bit or 64 bit)." -msgstr "" - -#: ../../library/zipapp.rst:387 msgid "Caveats" msgstr "" -#: ../../library/zipapp.rst:389 -msgid "" -"There are some limitations to the process of bundling your application into " -"a single file. In most, if not all, cases they can be addressed without " -"needing major changes to your application." -msgstr "" - -#: ../../library/zipapp.rst:393 +#: ../../library/zipapp.rst:309 msgid "" "If your application depends on a package that includes a C extension, that " "package cannot be run from a zip file (this is an OS limitation, as " @@ -465,30 +402,11 @@ msgid "" "based on the user's machine)." msgstr "" -#: ../../library/zipapp.rst:403 -msgid "" -"If you are shipping a Windows executable as described above, you either need " -"to ensure that your users have ``python3.dll`` on their PATH (which is not " -"the default behaviour of the installer) or you should bundle your " -"application with the embedded distribution." -msgstr "" - -#: ../../library/zipapp.rst:408 -msgid "" -"The suggested launcher above uses the Python embedding API. This means that " -"in your application, ``sys.executable`` will be your application, and *not* " -"a conventional Python interpreter. Your code and its dependencies need to " -"be prepared for this possibility. For example, if your application uses " -"the :mod:`multiprocessing` module, it will need to call :func:" -"`multiprocessing.set_executable` to let the module know where to find the " -"standard Python interpreter." -msgstr "" - -#: ../../library/zipapp.rst:418 +#: ../../library/zipapp.rst:321 msgid "The Python Zip Application Archive Format" msgstr "" -#: ../../library/zipapp.rst:420 +#: ../../library/zipapp.rst:323 msgid "" "Python has been able to execute zip files which contain a ``__main__.py`` " "file since version 2.6. In order to be executed by Python, an application " @@ -499,18 +417,18 @@ msgid "" "the zip file." msgstr "" -#: ../../library/zipapp.rst:427 +#: ../../library/zipapp.rst:330 msgid "" "The zip file format allows arbitrary data to be prepended to a zip file. " "The zip application format uses this ability to prepend a standard POSIX " "\"shebang\" line to the file (``#!/path/to/interpreter``)." msgstr "" -#: ../../library/zipapp.rst:431 +#: ../../library/zipapp.rst:334 msgid "Formally, the Python zip application format is therefore:" msgstr "" -#: ../../library/zipapp.rst:433 +#: ../../library/zipapp.rst:336 msgid "" "An optional shebang line, containing the characters ``b'#!'`` followed by an " "interpreter name, and then a newline (``b'\\n'``) character. The " @@ -520,7 +438,7 @@ msgid "" "POSIX." msgstr "" -#: ../../library/zipapp.rst:438 +#: ../../library/zipapp.rst:341 msgid "" "Standard zipfile data, as generated by the :mod:`zipfile` module. The " "zipfile content *must* include a file called ``__main__.py`` (which must be " @@ -528,13 +446,13 @@ msgid "" "zipfile data can be compressed or uncompressed." msgstr "" -#: ../../library/zipapp.rst:443 +#: ../../library/zipapp.rst:346 msgid "" "If an application archive has a shebang line, it may have the executable bit " "set on POSIX systems, to allow it to be executed directly." msgstr "" -#: ../../library/zipapp.rst:446 +#: ../../library/zipapp.rst:349 msgid "" "There is no requirement that the tools in this module are used to create " "application archives - the module is a convenience, but archives in the " diff --git a/library/zipfile.po b/library/zipfile.po index 8034c45e3f..a880489ce4 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,7 +23,8 @@ msgid ":mod:`zipfile` --- Work with ZIP archives" msgstr "" #: ../../library/zipfile.rst:10 -msgid "**Source code:** :source:`Lib/zipfile.py`" +#, fuzzy +msgid "**Source code:** :source:`Lib/zipfile/`" msgstr "**原始碼:**\\ :source:`Lib/zipfile.py`" #: ../../library/zipfile.rst:14 @@ -206,7 +207,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:182 ../../library/zipfile.rst:734 +#: ../../library/zipfile.rst:182 ../../library/zipfile.rst:735 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -283,7 +284,7 @@ msgstr "" msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:239 ../../library/zipfile.rst:745 +#: ../../library/zipfile.rst:239 ../../library/zipfile.rst:746 msgid "The *strict_timestamps* keyword-only argument" msgstr "" @@ -790,286 +791,286 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:691 +#: ../../library/zipfile.rst:692 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:700 +#: ../../library/zipfile.rst:701 msgid "The *filterfunc* parameter." msgstr "*filterfunc* 參數。" -#: ../../library/zipfile.rst:703 +#: ../../library/zipfile.rst:704 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:706 +#: ../../library/zipfile.rst:707 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:713 +#: ../../library/zipfile.rst:714 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:715 +#: ../../library/zipfile.rst:716 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:719 +#: ../../library/zipfile.rst:720 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:725 +#: ../../library/zipfile.rst:726 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:728 +#: ../../library/zipfile.rst:729 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:730 +#: ../../library/zipfile.rst:731 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:742 +#: ../../library/zipfile.rst:743 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:749 +#: ../../library/zipfile.rst:750 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:753 +#: ../../library/zipfile.rst:754 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:755 +#: ../../library/zipfile.rst:756 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:762 +#: ../../library/zipfile.rst:763 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:767 +#: ../../library/zipfile.rst:768 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:771 +#: ../../library/zipfile.rst:772 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:771 +#: ../../library/zipfile.rst:772 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:773 +#: ../../library/zipfile.rst:774 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:773 +#: ../../library/zipfile.rst:774 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:775 +#: ../../library/zipfile.rst:776 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:775 +#: ../../library/zipfile.rst:776 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:777 +#: ../../library/zipfile.rst:778 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:777 +#: ../../library/zipfile.rst:778 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:779 +#: ../../library/zipfile.rst:780 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:779 +#: ../../library/zipfile.rst:780 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:781 +#: ../../library/zipfile.rst:782 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:781 +#: ../../library/zipfile.rst:782 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:783 +#: ../../library/zipfile.rst:784 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:783 +#: ../../library/zipfile.rst:784 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:788 +#: ../../library/zipfile.rst:789 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:793 +#: ../../library/zipfile.rst:794 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:798 +#: ../../library/zipfile.rst:799 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:803 +#: ../../library/zipfile.rst:804 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:810 +#: ../../library/zipfile.rst:811 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:815 +#: ../../library/zipfile.rst:816 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:820 +#: ../../library/zipfile.rst:821 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:825 +#: ../../library/zipfile.rst:826 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:830 +#: ../../library/zipfile.rst:831 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:835 +#: ../../library/zipfile.rst:836 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:840 +#: ../../library/zipfile.rst:841 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:845 +#: ../../library/zipfile.rst:846 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:850 +#: ../../library/zipfile.rst:851 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:855 +#: ../../library/zipfile.rst:856 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:860 +#: ../../library/zipfile.rst:861 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:865 +#: ../../library/zipfile.rst:866 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:872 +#: ../../library/zipfile.rst:873 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:874 +#: ../../library/zipfile.rst:875 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:877 +#: ../../library/zipfile.rst:878 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:884 +#: ../../library/zipfile.rst:885 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:890 +#: ../../library/zipfile.rst:891 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:897 +#: ../../library/zipfile.rst:898 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:905 +#: ../../library/zipfile.rst:906 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:910 +#: ../../library/zipfile.rst:911 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:915 +#: ../../library/zipfile.rst:916 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:920 +#: ../../library/zipfile.rst:921 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:925 +#: ../../library/zipfile.rst:926 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:929 +#: ../../library/zipfile.rst:930 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "" -#: ../../library/zipfile.rst:936 +#: ../../library/zipfile.rst:937 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:938 +#: ../../library/zipfile.rst:939 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:941 +#: ../../library/zipfile.rst:942 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:943 +#: ../../library/zipfile.rst:944 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:947 +#: ../../library/zipfile.rst:948 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:949 +#: ../../library/zipfile.rst:950 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1077,33 +1078,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:956 +#: ../../library/zipfile.rst:957 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:958 +#: ../../library/zipfile.rst:959 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:963 +#: ../../library/zipfile.rst:964 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:965 +#: ../../library/zipfile.rst:966 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:969 +#: ../../library/zipfile.rst:970 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:971 +#: ../../library/zipfile.rst:972 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " diff --git a/library/zipimport.po b/library/zipimport.po index e14f1c1a71..9e1b04e390 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-16 19:25+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -128,111 +128,100 @@ msgstr "" #: ../../library/zipimport.rst:79 msgid "" +"Methods ``find_loader()`` and ``find_module()``, deprecated in 3.10 are now " +"removed. Use :meth:`find_spec` instead." +msgstr "" + +#: ../../library/zipimport.rst:84 +msgid "" "Implementation of :meth:`importlib.abc.Loader.create_module` that returns :" "const:`None` to explicitly request the default semantics." msgstr "" -#: ../../library/zipimport.rst:87 +#: ../../library/zipimport.rst:92 msgid "Implementation of :meth:`importlib.abc.Loader.exec_module`." msgstr "" -#: ../../library/zipimport.rst:94 -msgid "An implementation of :meth:`importlib.abc.PathEntryFinder.find_loader`." -msgstr "" - -#: ../../library/zipimport.rst:98 ../../library/zipimport.rst:111 -msgid "Use :meth:`find_spec` instead." -msgstr "" - -#: ../../library/zipimport.rst:103 -msgid "" -"Search for a module specified by *fullname*. *fullname* must be the fully " -"qualified (dotted) module name. It returns the zipimporter instance itself " -"if the module was found, or :const:`None` if it wasn't. The optional *path* " -"argument is ignored---it's there for compatibility with the importer " -"protocol." -msgstr "" - -#: ../../library/zipimport.rst:116 +#: ../../library/zipimport.rst:99 msgid "An implementation of :meth:`importlib.abc.PathEntryFinder.find_spec`." msgstr "" -#: ../../library/zipimport.rst:123 +#: ../../library/zipimport.rst:106 msgid "" "Return the code object for the specified module. Raise :exc:`ZipImportError` " "if the module couldn't be imported." msgstr "" -#: ../../library/zipimport.rst:129 +#: ../../library/zipimport.rst:112 msgid "" "Return the data associated with *pathname*. Raise :exc:`OSError` if the file " "wasn't found." msgstr "" -#: ../../library/zipimport.rst:132 +#: ../../library/zipimport.rst:115 msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." msgstr "" -#: ../../library/zipimport.rst:138 +#: ../../library/zipimport.rst:121 msgid "" "Return the value ``__file__`` would be set to if the specified module was " "imported. Raise :exc:`ZipImportError` if the module couldn't be imported." msgstr "" -#: ../../library/zipimport.rst:147 +#: ../../library/zipimport.rst:130 msgid "" "Return the source code for the specified module. Raise :exc:`ZipImportError` " "if the module couldn't be found, return :const:`None` if the archive does " "contain the module, but has no source for it." msgstr "" -#: ../../library/zipimport.rst:155 +#: ../../library/zipimport.rst:138 msgid "" "Return ``True`` if the module specified by *fullname* is a package. Raise :" "exc:`ZipImportError` if the module couldn't be found." msgstr "" -#: ../../library/zipimport.rst:161 +#: ../../library/zipimport.rst:144 msgid "" "Load the module specified by *fullname*. *fullname* must be the fully " "qualified (dotted) module name. Returns the imported module on success, " "raises :exc:`ZipImportError` on failure." msgstr "" -#: ../../library/zipimport.rst:167 +#: ../../library/zipimport.rst:150 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/zipimport.rst:172 +#: ../../library/zipimport.rst:155 msgid "" "Clear out the internal cache of information about files found within the ZIP " "archive." msgstr "" -#: ../../library/zipimport.rst:180 +#: ../../library/zipimport.rst:163 msgid "" "The file name of the importer's associated ZIP file, without a possible " "subpath." msgstr "" -#: ../../library/zipimport.rst:186 +#: ../../library/zipimport.rst:169 msgid "" "The subpath within the ZIP file where modules are searched. This is the " "empty string for zipimporter objects which point to the root of the ZIP file." msgstr "" -#: ../../library/zipimport.rst:190 +#: ../../library/zipimport.rst:173 msgid "" "The :attr:`archive` and :attr:`prefix` attributes, when combined with a " "slash, equal the original *archivepath* argument given to the :class:" "`zipimporter` constructor." msgstr "" -#: ../../library/zipimport.rst:198 +#: ../../library/zipimport.rst:181 msgid "Examples" msgstr "範例" -#: ../../library/zipimport.rst:200 +#: ../../library/zipimport.rst:183 msgid "" "Here is an example that imports a module from a ZIP archive - note that the :" "mod:`zipimport` module is not explicitly used." diff --git a/library/zoneinfo.po b/library/zoneinfo.po index e75341cb80..427b63ace7 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -299,8 +299,8 @@ msgstr "" #: ../../library/zoneinfo.rst:243 msgid "" "Invoking this function may change the semantics of datetimes using " -"``ZoneInfo`` in surprising ways; this modifies process-wide global state and " -"thus may have wide-ranging effects. Only use it if you know that you need to." +"``ZoneInfo`` in surprising ways; this modifies module state and thus may " +"have wide-ranging effects. Only use it if you know that you need to." msgstr "" #: ../../library/zoneinfo.rst:248 diff --git a/license.po b/license.po index 54591426cb..8c9a3468e6 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-25 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -303,10 +303,12 @@ msgid "Mersenne Twister" msgstr "Mersenne Twister" #: ../../license.rst:305 +#, fuzzy msgid "" -"The :mod:`_random` module includes code based on a download from http://www." -"math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html. The following " -"are the verbatim comments from the original code::" +"The :mod:`!_random` C extension underlying the :mod:`random` module includes " +"code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/" +"MT/MT2002/emt19937ar.html. The following are the verbatim comments from the " +"original code::" msgstr "" ":mod:`_random` 模組包含了以 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/" "MT2002/emt19937ar.html 的下載內容為基礎的程式碼。以下是原始程式碼的完整聲" @@ -314,11 +316,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:352 +#: ../../license.rst:353 msgid "Sockets" msgstr "Sockets" -#: ../../license.rst:354 +#: ../../license.rst:355 msgid "" "The :mod:`socket` module uses the functions, :func:`getaddrinfo`, and :func:" "`getnameinfo`, which are coded in separate source files from the WIDE " @@ -329,79 +331,80 @@ msgstr "" "\n" "::" -#: ../../license.rst:387 +#: ../../license.rst:388 msgid "Asynchronous socket services" msgstr "非同步 socket 服務" -#: ../../license.rst:389 +#: ../../license.rst:390 +#, fuzzy msgid "" -"The :mod:`asynchat` and :mod:`asyncore` modules contain the following " -"notice::" +"The :mod:`test.support.asynchat` and :mod:`test.support.asyncore` modules " +"contain the following notice::" msgstr "" ":mod:`asynchat` 和 :mod:`asyncore` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:414 +#: ../../license.rst:416 msgid "Cookie management" msgstr "Cookie 管理" -#: ../../license.rst:416 +#: ../../license.rst:418 msgid "The :mod:`http.cookies` module contains the following notice::" msgstr "" ":mod:`http.cookies` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:442 +#: ../../license.rst:444 msgid "Execution tracing" msgstr "執行追蹤" -#: ../../license.rst:444 +#: ../../license.rst:446 msgid "The :mod:`trace` module contains the following notice::" msgstr "" ":mod:`trace` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:475 +#: ../../license.rst:477 msgid "UUencode and UUdecode functions" msgstr "UUencode 與 UUdecode 函式" -#: ../../license.rst:477 +#: ../../license.rst:479 msgid "The :mod:`uu` module contains the following notice::" msgstr "" ":mod:`uu` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:505 +#: ../../license.rst:507 msgid "XML Remote Procedure Calls" msgstr "XML 遠端程序呼叫" -#: ../../license.rst:507 +#: ../../license.rst:509 msgid "The :mod:`xmlrpc.client` module contains the following notice::" msgstr "" ":mod:`xmlrpc.client` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:538 +#: ../../license.rst:540 msgid "test_epoll" msgstr "test_epoll" -#: ../../license.rst:540 +#: ../../license.rst:542 msgid "The :mod:`test_epoll` module contains the following notice::" msgstr "" ":mod:`test_epoll` 模組包含以下聲明:\n" "\n" "::" -#: ../../license.rst:564 +#: ../../license.rst:566 msgid "Select kqueue" msgstr "Select kqueue" -#: ../../license.rst:566 +#: ../../license.rst:568 msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" @@ -410,11 +413,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:595 +#: ../../license.rst:597 msgid "SipHash24" msgstr "SipHash24" -#: ../../license.rst:597 +#: ../../license.rst:599 msgid "" "The file :file:`Python/pyhash.c` contains Marek Majkowski' implementation of " "Dan Bernstein's SipHash24 algorithm. It contains the following note::" @@ -424,11 +427,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:624 +#: ../../license.rst:626 msgid "strtod and dtoa" msgstr "strtod 與 dtoa" -#: ../../license.rst:626 +#: ../../license.rst:628 msgid "" "The file :file:`Python/dtoa.c`, which supplies C functions dtoa and strtod " "for conversion of C doubles to and from strings, is derived from the file of " @@ -444,11 +447,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:654 +#: ../../license.rst:656 msgid "OpenSSL" msgstr "OpenSSL" -#: ../../license.rst:656 +#: ../../license.rst:658 msgid "" "The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use the " "OpenSSL library for added performance if made available by the operating " @@ -463,11 +466,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:791 +#: ../../license.rst:793 msgid "expat" msgstr "expat" -#: ../../license.rst:793 +#: ../../license.rst:795 msgid "" "The :mod:`pyexpat` extension is built using an included copy of the expat " "sources unless the build is configured ``--with-system-expat``::" @@ -477,25 +480,27 @@ msgstr "" "\n" "::" -#: ../../license.rst:820 +#: ../../license.rst:822 msgid "libffi" msgstr "libffi" -#: ../../license.rst:822 +#: ../../license.rst:824 +#, fuzzy msgid "" -"The :mod:`_ctypes` extension is built using an included copy of the libffi " -"sources unless the build is configured ``--with-system-libffi``::" +"The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " +"using an included copy of the libffi sources unless the build is configured " +"``--with-system-libffi``::" msgstr "" "除非在建置 :mod:`_ctypes` 擴充時設定為 ``--with-system-libffi``\\ ,否則該擴" "充會用一個內含 libffi 原始碼的副本來建置:\n" "\n" "::" -#: ../../license.rst:849 +#: ../../license.rst:852 msgid "zlib" msgstr "zlib" -#: ../../license.rst:851 +#: ../../license.rst:854 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " @@ -506,11 +511,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:880 +#: ../../license.rst:883 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:882 +#: ../../license.rst:885 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" @@ -520,25 +525,27 @@ msgstr "" "\n" "::" -#: ../../license.rst:921 +#: ../../license.rst:924 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:923 +#: ../../license.rst:926 +#, fuzzy msgid "" -"The :mod:`_decimal` module is built using an included copy of the libmpdec " -"library unless the build is configured ``--with-system-libmpdec``::" +"The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " +"built using an included copy of the libmpdec library unless the build is " +"configured ``--with-system-libmpdec``::" msgstr "" "除非在建置 :mod:`_decimal` 模組時設定為 ``--with-system-libmpdec``\\ ,否則該" "模組會用一個內含 libmpdec 函式庫的副本來建置:\n" "\n" "::" -#: ../../license.rst:953 +#: ../../license.rst:957 msgid "W3C C14N test suite" msgstr "W3C C14N 測試套件" -#: ../../license.rst:955 +#: ../../license.rst:959 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" @@ -550,11 +557,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:990 +#: ../../license.rst:994 msgid "Audioop" msgstr "" -#: ../../license.rst:992 +#: ../../license.rst:996 msgid "" "The audioop module uses the code base in g771.c file of the SoX project::" msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 98e1cd0b92..a2d8f30f3c 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,25 +290,19 @@ msgstr "" #: ../../reference/compound_stmts.rst:364 msgid "" "Any remaining exceptions that were not handled by any :keyword:`!except*` " -"clause are re-raised at the end, combined into an exception group along with " -"all exceptions that were raised from within :keyword:`!except*` clauses." +"clause are re-raised at the end, along with all exceptions that were raised " +"from within the :keyword:`!except*` clauses. If this list contains more than " +"one exception to reraise, they are combined into an exception group." msgstr "" -#: ../../reference/compound_stmts.rst:368 -msgid "" -"From version 3.11.4, when the entire :exc:`ExceptionGroup` is handled and " -"only one exception is raised from an :keyword:`!except*` clause, this " -"exception is no longer wrapped to form a new :exc:`ExceptionGroup`." -msgstr "" - -#: ../../reference/compound_stmts.rst:372 +#: ../../reference/compound_stmts.rst:370 msgid "" "If the raised exception is not an exception group and its type matches one " "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" -#: ../../reference/compound_stmts.rst:383 +#: ../../reference/compound_stmts.rst:381 msgid "" "An :keyword:`!except*` clause must have a matching type, and this type " "cannot be a subclass of :exc:`BaseExceptionGroup`. It is not possible to " @@ -317,11 +311,11 @@ msgid "" "an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:400 +#: ../../reference/compound_stmts.rst:398 msgid ":keyword:`!else` clause" msgstr "" -#: ../../reference/compound_stmts.rst:402 +#: ../../reference/compound_stmts.rst:400 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -330,11 +324,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:414 +#: ../../reference/compound_stmts.rst:412 msgid ":keyword:`!finally` clause" msgstr "" -#: ../../reference/compound_stmts.rst:416 +#: ../../reference/compound_stmts.rst:414 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -348,13 +342,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:435 +#: ../../reference/compound_stmts.rst:433 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:443 +#: ../../reference/compound_stmts.rst:441 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -362,7 +356,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:447 +#: ../../reference/compound_stmts.rst:445 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -370,17 +364,17 @@ msgid "" "will always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:461 +#: ../../reference/compound_stmts.rst:459 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:468 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:479 +#: ../../reference/compound_stmts.rst:477 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -388,37 +382,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:489 +#: ../../reference/compound_stmts.rst:487 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:491 +#: ../../reference/compound_stmts.rst:489 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:494 +#: ../../reference/compound_stmts.rst:492 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:496 +#: ../../reference/compound_stmts.rst:494 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:498 +#: ../../reference/compound_stmts.rst:496 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:500 +#: ../../reference/compound_stmts.rst:498 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:505 +#: ../../reference/compound_stmts.rst:503 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -427,11 +421,11 @@ msgid "" "See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:511 +#: ../../reference/compound_stmts.rst:509 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:513 +#: ../../reference/compound_stmts.rst:511 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -439,7 +433,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:518 +#: ../../reference/compound_stmts.rst:516 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -447,119 +441,119 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:523 +#: ../../reference/compound_stmts.rst:521 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:527 -#: ../../reference/compound_stmts.rst:1518 -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:525 +#: ../../reference/compound_stmts.rst:1534 +#: ../../reference/compound_stmts.rst:1575 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:532 -#: ../../reference/compound_stmts.rst:557 -#: ../../reference/compound_stmts.rst:1564 +#: ../../reference/compound_stmts.rst:530 +#: ../../reference/compound_stmts.rst:555 +#: ../../reference/compound_stmts.rst:1580 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:551 +#: ../../reference/compound_stmts.rst:549 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:563 +#: ../../reference/compound_stmts.rst:561 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:572 +#: ../../reference/compound_stmts.rst:570 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:575 +#: ../../reference/compound_stmts.rst:573 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:581 +#: ../../reference/compound_stmts.rst:579 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:581 +#: ../../reference/compound_stmts.rst:579 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:585 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:601 +#: ../../reference/compound_stmts.rst:599 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:610 +#: ../../reference/compound_stmts.rst:608 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:613 +#: ../../reference/compound_stmts.rst:611 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:617 +#: ../../reference/compound_stmts.rst:615 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:619 +#: ../../reference/compound_stmts.rst:617 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:620 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1181 +#: ../../reference/compound_stmts.rst:624 +#: ../../reference/compound_stmts.rst:1179 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:627 -#: ../../reference/compound_stmts.rst:1182 +#: ../../reference/compound_stmts.rst:625 +#: ../../reference/compound_stmts.rst:1180 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:631 +#: ../../reference/compound_stmts.rst:629 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:633 +#: ../../reference/compound_stmts.rst:631 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:636 +#: ../../reference/compound_stmts.rst:634 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:640 +#: ../../reference/compound_stmts.rst:638 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -569,7 +563,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:647 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -578,87 +572,87 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:654 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:659 +#: ../../reference/compound_stmts.rst:657 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:662 +#: ../../reference/compound_stmts.rst:660 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:664 +#: ../../reference/compound_stmts.rst:662 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:668 +#: ../../reference/compound_stmts.rst:666 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:672 +#: ../../reference/compound_stmts.rst:670 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:688 +#: ../../reference/compound_stmts.rst:686 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:691 +#: ../../reference/compound_stmts.rst:689 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:698 +#: ../../reference/compound_stmts.rst:696 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:703 +#: ../../reference/compound_stmts.rst:701 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:705 +#: ../../reference/compound_stmts.rst:703 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:709 +#: ../../reference/compound_stmts.rst:707 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:711 +#: ../../reference/compound_stmts.rst:709 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:714 +#: ../../reference/compound_stmts.rst:712 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:717 +#: ../../reference/compound_stmts.rst:715 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:720 +#: ../../reference/compound_stmts.rst:718 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -667,17 +661,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:730 +#: ../../reference/compound_stmts.rst:728 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:734 +#: ../../reference/compound_stmts.rst:732 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:737 +#: ../../reference/compound_stmts.rst:735 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -685,47 +679,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:742 +#: ../../reference/compound_stmts.rst:740 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:744 +#: ../../reference/compound_stmts.rst:742 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:746 +#: ../../reference/compound_stmts.rst:744 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:748 +#: ../../reference/compound_stmts.rst:746 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:748 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:754 +#: ../../reference/compound_stmts.rst:752 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:761 +#: ../../reference/compound_stmts.rst:759 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:763 +#: ../../reference/compound_stmts.rst:761 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:765 +#: ../../reference/compound_stmts.rst:763 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:768 +#: ../../reference/compound_stmts.rst:766 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:782 +#: ../../reference/compound_stmts.rst:780 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -735,70 +729,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:792 +#: ../../reference/compound_stmts.rst:790 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:794 +#: ../../reference/compound_stmts.rst:792 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:800 +#: ../../reference/compound_stmts.rst:798 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:803 +#: ../../reference/compound_stmts.rst:801 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:807 +#: ../../reference/compound_stmts.rst:805 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:813 +#: ../../reference/compound_stmts.rst:811 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:815 +#: ../../reference/compound_stmts.rst:813 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:821 +#: ../../reference/compound_stmts.rst:819 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:825 +#: ../../reference/compound_stmts.rst:823 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:832 +#: ../../reference/compound_stmts.rst:830 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:834 +#: ../../reference/compound_stmts.rst:832 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:847 +#: ../../reference/compound_stmts.rst:845 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -806,42 +800,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:852 +#: ../../reference/compound_stmts.rst:850 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:856 +#: ../../reference/compound_stmts.rst:854 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:862 +#: ../../reference/compound_stmts.rst:860 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:864 +#: ../../reference/compound_stmts.rst:862 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:870 +#: ../../reference/compound_stmts.rst:868 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:874 +#: ../../reference/compound_stmts.rst:872 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:877 +#: ../../reference/compound_stmts.rst:875 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -849,55 +843,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:882 +#: ../../reference/compound_stmts.rst:880 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:887 +#: ../../reference/compound_stmts.rst:885 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:889 +#: ../../reference/compound_stmts.rst:887 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:895 +#: ../../reference/compound_stmts.rst:893 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:899 +#: ../../reference/compound_stmts.rst:897 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:904 +#: ../../reference/compound_stmts.rst:902 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:906 +#: ../../reference/compound_stmts.rst:904 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:914 +#: ../../reference/compound_stmts.rst:912 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:919 +#: ../../reference/compound_stmts.rst:917 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:923 +#: ../../reference/compound_stmts.rst:921 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -905,44 +899,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:931 +#: ../../reference/compound_stmts.rst:929 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:933 +#: ../../reference/compound_stmts.rst:931 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:940 +#: ../../reference/compound_stmts.rst:938 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:945 +#: ../../reference/compound_stmts.rst:943 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:947 +#: ../../reference/compound_stmts.rst:945 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:958 +#: ../../reference/compound_stmts.rst:956 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:962 +#: ../../reference/compound_stmts.rst:960 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:967 +#: ../../reference/compound_stmts.rst:965 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -950,40 +944,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:972 +#: ../../reference/compound_stmts.rst:970 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:975 +#: ../../reference/compound_stmts.rst:973 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:978 +#: ../../reference/compound_stmts.rst:976 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:981 +#: ../../reference/compound_stmts.rst:979 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:984 +#: ../../reference/compound_stmts.rst:982 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:986 +#: ../../reference/compound_stmts.rst:984 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:989 +#: ../../reference/compound_stmts.rst:987 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -991,118 +985,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:994 +#: ../../reference/compound_stmts.rst:992 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:996 +#: ../../reference/compound_stmts.rst:994 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:999 +#: ../../reference/compound_stmts.rst:997 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1002 +#: ../../reference/compound_stmts.rst:1000 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1006 +#: ../../reference/compound_stmts.rst:1004 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1009 +#: ../../reference/compound_stmts.rst:1007 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1015 +#: ../../reference/compound_stmts.rst:1013 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1016 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1019 +#: ../../reference/compound_stmts.rst:1017 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1020 +#: ../../reference/compound_stmts.rst:1018 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1021 +#: ../../reference/compound_stmts.rst:1019 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1022 +#: ../../reference/compound_stmts.rst:1020 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1027 +#: ../../reference/compound_stmts.rst:1025 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1029 +#: ../../reference/compound_stmts.rst:1027 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1040 +#: ../../reference/compound_stmts.rst:1038 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1043 +#: ../../reference/compound_stmts.rst:1041 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1047 +#: ../../reference/compound_stmts.rst:1045 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1050 +#: ../../reference/compound_stmts.rst:1048 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1052 +#: ../../reference/compound_stmts.rst:1050 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1056 +#: ../../reference/compound_stmts.rst:1054 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1060 +#: ../../reference/compound_stmts.rst:1058 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1110,256 +1104,256 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1065 +#: ../../reference/compound_stmts.rst:1063 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1066 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1069 +#: ../../reference/compound_stmts.rst:1067 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1070 +#: ../../reference/compound_stmts.rst:1068 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1071 +#: ../../reference/compound_stmts.rst:1069 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1077 +#: ../../reference/compound_stmts.rst:1075 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1079 +#: ../../reference/compound_stmts.rst:1077 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1090 +#: ../../reference/compound_stmts.rst:1088 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1092 +#: ../../reference/compound_stmts.rst:1090 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1095 +#: ../../reference/compound_stmts.rst:1093 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1098 +#: ../../reference/compound_stmts.rst:1096 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1101 +#: ../../reference/compound_stmts.rst:1099 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1105 +#: ../../reference/compound_stmts.rst:1103 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1109 +#: ../../reference/compound_stmts.rst:1107 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1112 +#: ../../reference/compound_stmts.rst:1110 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1114 +#: ../../reference/compound_stmts.rst:1112 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1117 +#: ../../reference/compound_stmts.rst:1115 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1119 +#: ../../reference/compound_stmts.rst:1117 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1124 +#: ../../reference/compound_stmts.rst:1122 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1126 +#: ../../reference/compound_stmts.rst:1124 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1130 +#: ../../reference/compound_stmts.rst:1128 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1132 +#: ../../reference/compound_stmts.rst:1130 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1134 +#: ../../reference/compound_stmts.rst:1132 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1137 +#: ../../reference/compound_stmts.rst:1135 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1140 +#: ../../reference/compound_stmts.rst:1138 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1144 +#: ../../reference/compound_stmts.rst:1142 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1146 +#: ../../reference/compound_stmts.rst:1144 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1149 +#: ../../reference/compound_stmts.rst:1147 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1149 +#: ../../reference/compound_stmts.rst:1147 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1151 +#: ../../reference/compound_stmts.rst:1149 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1152 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1157 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1161 -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1850 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1160 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1163 +#: ../../reference/compound_stmts.rst:1161 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1164 -#: ../../reference/compound_stmts.rst:1615 +#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1853 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1166 +#: ../../reference/compound_stmts.rst:1164 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1170 +#: ../../reference/compound_stmts.rst:1168 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1170 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1171 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1173 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1173 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1174 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1177 +#: ../../reference/compound_stmts.rst:1175 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1190 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1207 +#: ../../reference/compound_stmts.rst:1205 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1226 +#: ../../reference/compound_stmts.rst:1224 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1368,13 +1362,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1232 +#: ../../reference/compound_stmts.rst:1230 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1238 +#: ../../reference/compound_stmts.rst:1236 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1385,28 +1379,43 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1249 -#: ../../reference/compound_stmts.rst:1426 +#: ../../reference/compound_stmts.rst:1247 +#: ../../reference/compound_stmts.rst:1433 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1254 +#: ../../reference/compound_stmts.rst:1252 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1254 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1266 +#: ../../reference/compound_stmts.rst:1259 +msgid "" +"A list of :ref:`type parameters ` may be given in square " +"brackets between the function's name and the opening parenthesis for its " +"parameter list. This indicates to static type checkers that the function is " +"generic. At runtime, the type parameters can be retrieved from the " +"function's ``__type_params__`` attribute. See :ref:`generic-functions` for " +"more." +msgstr "" + +#: ../../reference/compound_stmts.rst:1265 +#: ../../reference/compound_stmts.rst:1452 +msgid "Type parameter lists are new in Python 3.12." +msgstr "" + +#: ../../reference/compound_stmts.rst:1273 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1417,7 +1426,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1274 +#: ../../reference/compound_stmts.rst:1281 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1430,7 +1439,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1295 +#: ../../reference/compound_stmts.rst:1302 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1446,13 +1455,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1314 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1316 +#: ../../reference/compound_stmts.rst:1323 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1469,7 +1478,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1331 +#: ../../reference/compound_stmts.rst:1338 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1481,7 +1490,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1339 +#: ../../reference/compound_stmts.rst:1346 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1490,51 +1499,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1355 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1355 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1358 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1358 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1362 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1361 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1365 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1365 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1372 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1380 +#: ../../reference/compound_stmts.rst:1387 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1394 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1543,11 +1552,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1396 +#: ../../reference/compound_stmts.rst:1403 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1401 +#: ../../reference/compound_stmts.rst:1408 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1559,7 +1568,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1410 +#: ../../reference/compound_stmts.rst:1417 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1567,30 +1576,39 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1415 +#: ../../reference/compound_stmts.rst:1422 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1420 +#: ../../reference/compound_stmts.rst:1427 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1431 +#: ../../reference/compound_stmts.rst:1438 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1434 +#: ../../reference/compound_stmts.rst:1441 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1439 +#: ../../reference/compound_stmts.rst:1446 +msgid "" +"A list of :ref:`type parameters ` may be given in square " +"brackets immediately after the class's name. This indicates to static type " +"checkers that the class is generic. At runtime, the type parameters can be " +"retrieved from the class's ``__type_params__`` attribute. See :ref:`generic-" +"classes` for more." +msgstr "" + +#: ../../reference/compound_stmts.rst:1455 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1603,35 +1621,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1454 +#: ../../reference/compound_stmts.rst:1470 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1452 +#: ../../reference/compound_stmts.rst:1468 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1457 +#: ../../reference/compound_stmts.rst:1473 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1457 +#: ../../reference/compound_stmts.rst:1473 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1464 +#: ../../reference/compound_stmts.rst:1480 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1472 +#: ../../reference/compound_stmts.rst:1488 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1482 +#: ../../reference/compound_stmts.rst:1498 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1639,189 +1657,390 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1502 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1489 +#: ../../reference/compound_stmts.rst:1505 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1492 +#: ../../reference/compound_stmts.rst:1508 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1514 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1506 +#: ../../reference/compound_stmts.rst:1522 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1527 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1531 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1525 +#: ../../reference/compound_stmts.rst:1541 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1557 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1543 +#: ../../reference/compound_stmts.rst:1559 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1551 +#: ../../reference/compound_stmts.rst:1567 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1572 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1583 +#: ../../reference/compound_stmts.rst:1599 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1601 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1591 +#: ../../reference/compound_stmts.rst:1607 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1591 +#: ../../reference/compound_stmts.rst:1607 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1596 +#: ../../reference/compound_stmts.rst:1613 +#, fuzzy +msgid "Type parameter lists" +msgstr "parameter list(參數列表)" + +#: ../../reference/compound_stmts.rst:1627 +msgid "" +":ref:`Functions ` (including :ref:`coroutines `), :ref:" +"`classes ` and :ref:`type aliases ` may contain a type " +"parameter list::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1646 +msgid "" +"Semantically, this indicates that the function, class, or type alias is " +"generic over a type variable. This information is primarily used by static " +"type checkers, and at runtime, generic objects behave much like their non-" +"generic counterparts." +msgstr "" + +#: ../../reference/compound_stmts.rst:1651 +msgid "" +"Type parameters are declared in square brackets (``[]``) immediately after " +"the name of the function, class, or type alias. The type parameters are " +"accessible within the scope of the generic object, but not elsewhere. Thus, " +"after a declaration ``def func[T](): pass``, the name ``T`` is not available " +"in the module scope. Below, the semantics of generic objects are described " +"with more precision. The scope of type parameters is modeled with a special " +"function (technically, an :ref:`annotation scope `) that " +"wraps the creation of the generic object." +msgstr "" + +#: ../../reference/compound_stmts.rst:1660 +msgid "" +"Generic functions, classes, and type aliases have a :attr:`!__type_params__` " +"attribute listing their type parameters." +msgstr "" + +#: ../../reference/compound_stmts.rst:1663 +msgid "Type parameters come in three kinds:" +msgstr "" + +#: ../../reference/compound_stmts.rst:1665 +msgid "" +":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " +"Semantically, this represents a single type to a type checker." +msgstr "" + +#: ../../reference/compound_stmts.rst:1667 +msgid "" +":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " +"asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " +"number of types." +msgstr "" + +#: ../../reference/compound_stmts.rst:1670 +msgid "" +":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " +"(e.g., ``**P``). Semantically, this stands for the parameters of a callable." +msgstr "" + +#: ../../reference/compound_stmts.rst:1673 +msgid "" +":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " +"with a colon (``:``) followed by an expression. A single expression after " +"the colon indicates a bound (e.g. ``T: int``). Semantically, this means that " +"the :data:`!typing.TypeVar` can only represent types that are a subtype of " +"this bound. A parenthesized tuple of expressions after the colon indicates a " +"set of constraints (e.g. ``T: (str, bytes)``). Each member of the tuple " +"should be a type (again, this is not enforced at runtime). Constrained type " +"variables can only take on one of the types in the list of constraints." +msgstr "" + +#: ../../reference/compound_stmts.rst:1682 +msgid "" +"For :data:`!typing.TypeVar`\\ s declared using the type parameter list " +"syntax, the bound and constraints are not evaluated when the generic object " +"is created, but only when the value is explicitly accessed through the " +"attributes ``__bound__`` and ``__constraints__``. To accomplish this, the " +"bounds or constraints are evaluated in a separate :ref:`annotation scope " +"`." +msgstr "" + +#: ../../reference/compound_stmts.rst:1688 +msgid "" +":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " +"bounds or constraints." +msgstr "" + +#: ../../reference/compound_stmts.rst:1691 +msgid "" +"The following example indicates the full set of allowed type parameter " +"declarations::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1709 +#, fuzzy +msgid "Generic functions" +msgstr "function (函式)" + +#: ../../reference/compound_stmts.rst:1711 +msgid "Generic functions are declared as follows::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1715 +#: ../../reference/compound_stmts.rst:1775 +#, fuzzy +msgid "This syntax is equivalent to::" +msgstr "" +"大致等價於:\n" +"\n" +"::" + +#: ../../reference/compound_stmts.rst:1724 +msgid "" +"Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " +"liberty is taken in the translation: the syntax does not go through " +"attribute access on the :mod:`typing` module, but creates an instance of :" +"data:`typing.TypeVar` directly.)" +msgstr "" + +#: ../../reference/compound_stmts.rst:1730 +msgid "" +"The annotations of generic functions are evaluated within the annotation " +"scope used for declaring the type parameters, but the function's defaults " +"and decorators are not." +msgstr "" + +#: ../../reference/compound_stmts.rst:1734 +msgid "" +"The following example illustrates the scoping rules for these cases, as well " +"as for additional flavors of type parameters::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1741 +msgid "" +"Except for the :ref:`lazy evaluation ` of the :class:" +"`~typing.TypeVar` bound, this is equivalent to::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1763 +msgid "" +"The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " +"runtime." +msgstr "" + +#: ../../reference/compound_stmts.rst:1769 +msgid "Generic classes" +msgstr "" + +#: ../../reference/compound_stmts.rst:1771 +msgid "Generic classes are declared as follows::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1785 +msgid "" +"Here again ``annotation-def`` (not a real keyword) indicates an :ref:" +"`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " +"is not actually bound at runtime." +msgstr "" + +#: ../../reference/compound_stmts.rst:1789 +msgid "" +"Generic classes implicitly inherit from :data:`typing.Generic`. The base " +"classes and keyword arguments of generic classes are evaluated within the " +"type scope for the type parameters, and decorators are evaluated outside " +"that scope. This is illustrated by this example::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1798 +#, fuzzy +msgid "This is equivalent to::" +msgstr "" +"大致等價於:\n" +"\n" +"::" + +#: ../../reference/compound_stmts.rst:1811 +msgid "Generic type aliases" +msgstr "" + +#: ../../reference/compound_stmts.rst:1813 +msgid "" +"The :keyword:`type` statement can also be used to create a generic type " +"alias::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1817 +msgid "" +"Except for the :ref:`lazy evaluation ` of the value, this " +"is equivalent to::" +msgstr "" + +#: ../../reference/compound_stmts.rst:1829 +msgid "" +"Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " +"scope `. The capitalized names like " +"``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." +msgstr "" + +#: ../../reference/compound_stmts.rst:1834 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1597 +#: ../../reference/compound_stmts.rst:1835 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1839 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1603 +#: ../../reference/compound_stmts.rst:1841 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1842 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1605 +#: ../../reference/compound_stmts.rst:1843 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1606 -#: ../../reference/compound_stmts.rst:1625 +#: ../../reference/compound_stmts.rst:1844 +#: ../../reference/compound_stmts.rst:1863 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1608 +#: ../../reference/compound_stmts.rst:1846 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1848 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1849 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1851 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1852 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1855 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1858 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1622 +#: ../../reference/compound_stmts.rst:1860 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1861 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1862 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1865 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1868 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1634 +#: ../../reference/compound_stmts.rst:1872 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" @@ -1838,15 +2057,15 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:169 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:391 -#: ../../reference/compound_stmts.rst:438 -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:589 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 -#: ../../reference/compound_stmts.rst:1468 -#: ../../reference/compound_stmts.rst:1502 -#: ../../reference/compound_stmts.rst:1547 +#: ../../reference/compound_stmts.rst:389 +#: ../../reference/compound_stmts.rst:436 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1484 +#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1563 msgid "statement" msgstr "statement(陳述式)" @@ -1878,11 +2097,11 @@ msgstr "" #: ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:391 +#: ../../reference/compound_stmts.rst:389 msgid "else" msgstr "else" -#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:587 msgid "if" msgstr "if" @@ -1890,11 +2109,11 @@ msgstr "if" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:328 -#: ../../reference/compound_stmts.rst:391 -#: ../../reference/compound_stmts.rst:409 -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:589 -#: ../../reference/compound_stmts.rst:1478 +#: ../../reference/compound_stmts.rst:389 +#: ../../reference/compound_stmts.rst:407 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:1494 msgid "keyword" msgstr "keyword(關鍵字)" @@ -1905,21 +2124,21 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:589 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1311 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1374 msgid ": (colon)" msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:589 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:587 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -1934,15 +2153,15 @@ msgstr "loop(迴圈)" #: ../../reference/compound_stmts.rst:129 #: ../../reference/compound_stmts.rst:169 -#: ../../reference/compound_stmts.rst:391 -#: ../../reference/compound_stmts.rst:438 +#: ../../reference/compound_stmts.rst:389 +#: ../../reference/compound_stmts.rst:436 msgid "break" msgstr "break" #: ../../reference/compound_stmts.rst:129 #: ../../reference/compound_stmts.rst:169 -#: ../../reference/compound_stmts.rst:391 -#: ../../reference/compound_stmts.rst:438 +#: ../../reference/compound_stmts.rst:389 +#: ../../reference/compound_stmts.rst:436 msgid "continue" msgstr "continue" @@ -1964,8 +2183,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:299 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "object" msgstr "object(物件)" @@ -1990,14 +2209,14 @@ msgid "except" msgstr "except" #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:409 +#: ../../reference/compound_stmts.rst:407 msgid "finally" msgstr "finally" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:266 -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:587 msgid "as" msgstr "as" @@ -2021,209 +2240,214 @@ msgstr "traceback" msgid "except_star" msgstr "except_star" -#: ../../reference/compound_stmts.rst:391 -#: ../../reference/compound_stmts.rst:438 +#: ../../reference/compound_stmts.rst:389 +#: ../../reference/compound_stmts.rst:436 msgid "return" msgstr "return (回傳)" -#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:470 msgid "with" msgstr "with" -#: ../../reference/compound_stmts.rst:472 +#: ../../reference/compound_stmts.rst:470 msgid "with statement" msgstr "with statement(with 陳述式)" -#: ../../reference/compound_stmts.rst:472 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:470 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:587 msgid "match" msgstr "match" -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:587 msgid "case" msgstr "case" -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:587 msgid "pattern matching" msgstr "pattern matching(模式匹配)" -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:587 msgid "match statement" msgstr "match statement(匹配陳述式)" -#: ../../reference/compound_stmts.rst:693 +#: ../../reference/compound_stmts.rst:691 msgid "guard" msgstr "guard" -#: ../../reference/compound_stmts.rst:732 +#: ../../reference/compound_stmts.rst:730 msgid "irrefutable case block" msgstr "" -#: ../../reference/compound_stmts.rst:732 +#: ../../reference/compound_stmts.rst:730 msgid "case block" msgstr "" -#: ../../reference/compound_stmts.rst:756 +#: ../../reference/compound_stmts.rst:754 msgid "! patterns" msgstr "" -#: ../../reference/compound_stmts.rst:756 +#: ../../reference/compound_stmts.rst:754 msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1185 -#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1268 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1185 -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1235 -#: ../../reference/compound_stmts.rst:1261 -#: ../../reference/compound_stmts.rst:1290 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1233 +#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1297 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1192 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1311 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1318 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1192 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1374 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1192 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1235 -#: ../../reference/compound_stmts.rst:1417 +#: ../../reference/compound_stmts.rst:1233 +#: ../../reference/compound_stmts.rst:1424 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1268 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1268 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1268 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1261 +#: ../../reference/compound_stmts.rst:1268 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1290 +#: ../../reference/compound_stmts.rst:1297 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1290 +#: ../../reference/compound_stmts.rst:1297 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1290 +#: ../../reference/compound_stmts.rst:1297 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1311 +#: ../../reference/compound_stmts.rst:1318 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1311 +#: ../../reference/compound_stmts.rst:1318 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1311 +#: ../../reference/compound_stmts.rst:1318 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1329 +#: ../../reference/compound_stmts.rst:1336 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1329 +#: ../../reference/compound_stmts.rst:1336 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "execution" -msgstr "execution(執行)" +msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1367 -#: ../../reference/compound_stmts.rst:1417 +#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1424 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1374 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1484 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1478 +#: ../../reference/compound_stmts.rst:1494 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1478 +#: ../../reference/compound_stmts.rst:1494 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1518 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1547 +#: ../../reference/compound_stmts.rst:1563 msgid "async with" msgstr "async with" + +#: ../../reference/compound_stmts.rst:1617 +#, fuzzy +msgid "type parameters" +msgstr "parameter(參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index 8d97ab992c..36fbd3753b 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -577,7 +577,7 @@ msgid "" "implementation detail at that time rather than a language guarantee." msgstr "" -#: ../../reference/datamodel.rst:726 +#: ../../reference/datamodel.rst:733 msgid "Callable types" msgstr "" @@ -587,7 +587,7 @@ msgid "" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:579 +#: ../../reference/datamodel.rst:586 msgid "User-defined functions" msgstr "" @@ -598,119 +598,119 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:487 ../../reference/datamodel.rst:841 +#: ../../reference/datamodel.rst:487 ../../reference/datamodel.rst:849 msgid "Special attributes:" msgstr "" -#: ../../reference/datamodel.rst:505 +#: ../../reference/datamodel.rst:506 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:505 +#: ../../reference/datamodel.rst:506 msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:507 ../../reference/datamodel.rst:762 -#: ../../reference/datamodel.rst:857 +#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:769 +#: ../../reference/datamodel.rst:865 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" -#: ../../reference/datamodel.rst:507 +#: ../../reference/datamodel.rst:508 msgid "" "The function's documentation string, or ``None`` if unavailable; not " "inherited by subclasses." msgstr "" -#: ../../reference/datamodel.rst:507 ../../reference/datamodel.rst:512 -#: ../../reference/datamodel.rst:515 ../../reference/datamodel.rst:520 -#: ../../reference/datamodel.rst:524 ../../reference/datamodel.rst:530 -#: ../../reference/datamodel.rst:540 ../../reference/datamodel.rst:551 -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:516 ../../reference/datamodel.rst:521 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:531 +#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:552 +#: ../../reference/datamodel.rst:562 ../../reference/datamodel.rst:565 msgid "Writable" msgstr "" -#: ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:513 msgid ":attr:`~definition.\\ __name__`" msgstr ":attr:`~definition.\\ __name__`" -#: ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:513 msgid "The function's name." msgstr "" -#: ../../reference/datamodel.rst:515 +#: ../../reference/datamodel.rst:516 msgid ":attr:`~definition.\\ __qualname__`" msgstr ":attr:`~definition.\\ __qualname__`" -#: ../../reference/datamodel.rst:515 +#: ../../reference/datamodel.rst:516 msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:520 ../../reference/datamodel.rst:847 +#: ../../reference/datamodel.rst:521 ../../reference/datamodel.rst:855 msgid ":attr:`__module__`" msgstr ":attr:`__module__`" -#: ../../reference/datamodel.rst:520 +#: ../../reference/datamodel.rst:521 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:524 +#: ../../reference/datamodel.rst:525 msgid ":attr:`__defaults__`" msgstr ":attr:`__defaults__`" -#: ../../reference/datamodel.rst:524 +#: ../../reference/datamodel.rst:525 msgid "" "A tuple containing default argument values for those arguments that have " "defaults, or ``None`` if no arguments have a default value." msgstr "" -#: ../../reference/datamodel.rst:530 +#: ../../reference/datamodel.rst:531 msgid ":attr:`__code__`" msgstr ":attr:`__code__`" -#: ../../reference/datamodel.rst:530 +#: ../../reference/datamodel.rst:531 msgid "The code object representing the compiled function body." msgstr "" -#: ../../reference/datamodel.rst:533 +#: ../../reference/datamodel.rst:534 msgid ":attr:`__globals__`" msgstr ":attr:`__globals__`" -#: ../../reference/datamodel.rst:533 +#: ../../reference/datamodel.rst:534 msgid "" "A reference to the dictionary that holds the function's global variables --- " "the global namespace of the module in which the function was defined." msgstr "" -#: ../../reference/datamodel.rst:533 ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:545 msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:540 ../../reference/datamodel.rst:850 +#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:858 msgid ":attr:`~object.__dict__`" msgstr ":attr:`~object.__dict__`" -#: ../../reference/datamodel.rst:540 +#: ../../reference/datamodel.rst:541 msgid "The namespace supporting arbitrary function attributes." msgstr "" -#: ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:545 msgid ":attr:`__closure__`" msgstr ":attr:`__closure__`" -#: ../../reference/datamodel.rst:544 +#: ../../reference/datamodel.rst:545 msgid "" "``None`` or a tuple of cells that contain bindings for the function's free " "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:551 ../../reference/datamodel.rst:777 -#: ../../reference/datamodel.rst:864 +#: ../../reference/datamodel.rst:552 ../../reference/datamodel.rst:784 +#: ../../reference/datamodel.rst:872 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" -#: ../../reference/datamodel.rst:551 +#: ../../reference/datamodel.rst:552 msgid "" "A dict containing annotations of parameters. The keys of the dict are the " "parameter names, and ``'return'`` for the return annotation, if provided. " @@ -718,21 +718,32 @@ msgid "" "howto`." msgstr "" -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:562 msgid ":attr:`__kwdefaults__`" msgstr ":attr:`__kwdefaults__`" -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:562 msgid "A dict containing defaults for keyword-only parameters." msgstr "" +#: ../../reference/datamodel.rst:565 ../../reference/datamodel.rst:876 +#, fuzzy +msgid ":attr:`__type_params__`" +msgstr ":attr:`__name__`" + #: ../../reference/datamodel.rst:565 msgid "" +"A tuple containing the :ref:`type parameters ` of a :ref:" +"`generic function `." +msgstr "" + +#: ../../reference/datamodel.rst:572 +msgid "" "Most of the attributes labelled \"Writable\" check the type of the assigned " "value." msgstr "" -#: ../../reference/datamodel.rst:567 +#: ../../reference/datamodel.rst:574 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " @@ -742,30 +753,30 @@ msgid "" "future.*" msgstr "" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:580 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:576 +#: ../../reference/datamodel.rst:583 msgid "" "Additional information about a function's definition can be retrieved from " "its code object; see the description of internal types below. The :data:" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:642 +#: ../../reference/datamodel.rst:649 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:587 +#: ../../reference/datamodel.rst:594 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:604 msgid "" "Special read-only attributes: :attr:`__self__` is the class instance " "object, :attr:`__func__` is the function object; :attr:`__doc__` is the " @@ -775,20 +786,20 @@ msgid "" "``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:603 +#: ../../reference/datamodel.rst:610 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying function object." msgstr "" -#: ../../reference/datamodel.rst:606 +#: ../../reference/datamodel.rst:613 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" "defined function object or a class method object." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:617 msgid "" "When an instance method object is created by retrieving a user-defined " "function object from a class via one of its instances, its :attr:`__self__` " @@ -796,7 +807,7 @@ msgid "" "new method's :attr:`__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:616 +#: ../../reference/datamodel.rst:623 msgid "" "When an instance method object is created by retrieving a class method " "object from a class or instance, its :attr:`__self__` attribute is the class " @@ -804,7 +815,7 @@ msgid "" "the class method." msgstr "" -#: ../../reference/datamodel.rst:621 +#: ../../reference/datamodel.rst:628 msgid "" "When an instance method object is called, the underlying function (:attr:" "`__func__`) is called, inserting the class instance (:attr:`__self__`) in " @@ -813,7 +824,7 @@ msgid "" "class:`C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:628 +#: ../../reference/datamodel.rst:635 msgid "" "When an instance method object is derived from a class method object, the " "\"class instance\" stored in :attr:`__self__` will actually be the class " @@ -821,7 +832,7 @@ msgid "" "calling ``f(C,1)`` where ``f`` is the underlying function." msgstr "" -#: ../../reference/datamodel.rst:633 +#: ../../reference/datamodel.rst:640 msgid "" "Note that the transformation from function object to instance method object " "happens each time the attribute is retrieved from the instance. In some " @@ -834,11 +845,11 @@ msgid "" "the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:657 +#: ../../reference/datamodel.rst:664 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:649 +#: ../../reference/datamodel.rst:656 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -851,11 +862,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:667 +#: ../../reference/datamodel.rst:674 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:663 +#: ../../reference/datamodel.rst:670 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -864,11 +875,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:687 +#: ../../reference/datamodel.rst:694 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:674 +#: ../../reference/datamodel.rst:681 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -877,7 +888,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:687 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -888,11 +899,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:702 +#: ../../reference/datamodel.rst:709 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:695 +#: ../../reference/datamodel.rst:702 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -904,11 +915,11 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:714 +#: ../../reference/datamodel.rst:721 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:717 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -917,11 +928,11 @@ msgid "" "attr:`__self__` is set to the object denoted by *alist*." msgstr "" -#: ../../reference/datamodel.rst:721 +#: ../../reference/datamodel.rst:728 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:724 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -930,21 +941,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:726 +#: ../../reference/datamodel.rst:733 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:731 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:789 +#: ../../reference/datamodel.rst:796 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:740 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -958,33 +969,33 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:745 +#: ../../reference/datamodel.rst:752 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:762 msgid "Predefined (writable) attributes:" msgstr "" -#: ../../reference/datamodel.rst:758 +#: ../../reference/datamodel.rst:765 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../reference/datamodel.rst:758 +#: ../../reference/datamodel.rst:765 msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:761 +#: ../../reference/datamodel.rst:768 msgid "The module's documentation string, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:771 +#: ../../reference/datamodel.rst:778 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:772 msgid "" "The pathname of the file from which the module was loaded, if it was loaded " "from a file. The :attr:`__file__` attribute may be missing for certain types " @@ -993,20 +1004,20 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:774 +#: ../../reference/datamodel.rst:781 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:781 +#: ../../reference/datamodel.rst:788 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:786 +#: ../../reference/datamodel.rst:793 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1014,11 +1025,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:864 +#: ../../reference/datamodel.rst:876 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:792 +#: ../../reference/datamodel.rst:799 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1034,7 +1045,7 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:816 +#: ../../reference/datamodel.rst:823 msgid "" "When a class attribute reference (for class :class:`C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1045,60 +1056,66 @@ msgid "" "in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:826 +#: ../../reference/datamodel.rst:833 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:838 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:844 +#: ../../reference/datamodel.rst:852 msgid ":attr:`~definition.__name__`" msgstr ":attr:`~definition.__name__`" -#: ../../reference/datamodel.rst:844 +#: ../../reference/datamodel.rst:852 msgid "The class name." msgstr "" -#: ../../reference/datamodel.rst:847 +#: ../../reference/datamodel.rst:855 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:850 +#: ../../reference/datamodel.rst:858 msgid "The dictionary containing the class's namespace." msgstr "" -#: ../../reference/datamodel.rst:854 +#: ../../reference/datamodel.rst:862 msgid ":attr:`~class.__bases__`" msgstr ":attr:`~class.__bases__`" -#: ../../reference/datamodel.rst:853 +#: ../../reference/datamodel.rst:861 msgid "" "A tuple containing the base classes, in the order of their occurrence in the " "base class list." msgstr "" -#: ../../reference/datamodel.rst:857 +#: ../../reference/datamodel.rst:865 msgid "The class's documentation string, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:868 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:907 +#: ../../reference/datamodel.rst:875 +msgid "" +"A tuple containing the :ref:`type parameters ` of a :ref:" +"`generic class `." +msgstr "" + +#: ../../reference/datamodel.rst:919 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:873 +#: ../../reference/datamodel.rst:885 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1115,7 +1132,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:889 +#: ../../reference/datamodel.rst:901 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1123,23 +1140,23 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:911 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:918 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:933 +#: ../../reference/datamodel.rst:945 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:923 +#: ../../reference/datamodel.rst:935 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1148,7 +1165,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:929 +#: ../../reference/datamodel.rst:941 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1156,22 +1173,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1220 +#: ../../reference/datamodel.rst:1233 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:940 +#: ../../reference/datamodel.rst:952 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1050 +#: ../../reference/datamodel.rst:1063 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:947 +#: ../../reference/datamodel.rst:959 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1183,7 +1200,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:975 +#: ../../reference/datamodel.rst:987 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1203,12 +1220,13 @@ msgid "" "bytecode; :attr:`co_filename` is the filename from which the code was " "compiled; :attr:`co_firstlineno` is the first line number of the function; :" "attr:`co_lnotab` is a string encoding the mapping from bytecode offsets to " -"line numbers (for details see the source code of the interpreter); :attr:" -"`co_stacksize` is the required stack size; :attr:`co_flags` is an integer " -"encoding a number of flags for the interpreter." +"line numbers (for details see the source code of the interpreter, is " +"deprecated since 3.12 and may be removed in 3.14); :attr:`co_stacksize` is " +"the required stack size; :attr:`co_flags` is an integer encoding a number of " +"flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1000 +#: ../../reference/datamodel.rst:1013 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1217,7 +1235,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1006 +#: ../../reference/datamodel.rst:1019 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1226,23 +1244,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1012 +#: ../../reference/datamodel.rst:1025 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1016 +#: ../../reference/datamodel.rst:1029 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1021 +#: ../../reference/datamodel.rst:1034 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1024 +#: ../../reference/datamodel.rst:1037 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1250,37 +1268,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1030 +#: ../../reference/datamodel.rst:1043 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1033 +#: ../../reference/datamodel.rst:1046 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1047 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1035 +#: ../../reference/datamodel.rst:1048 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1049 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1039 +#: ../../reference/datamodel.rst:1052 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1045 +#: ../../reference/datamodel.rst:1058 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1290,17 +1308,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1112 +#: ../../reference/datamodel.rst:1125 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1070 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1068 +#: ../../reference/datamodel.rst:1081 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1311,7 +1329,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1089 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1319,7 +1337,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1085 +#: ../../reference/datamodel.rst:1098 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1327,7 +1345,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1090 +#: ../../reference/datamodel.rst:1103 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1335,7 +1353,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1095 +#: ../../reference/datamodel.rst:1108 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1343,11 +1361,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:1113 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:1117 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1355,22 +1373,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1110 +#: ../../reference/datamodel.rst:1123 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1176 +#: ../../reference/datamodel.rst:1189 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1128 +#: ../../reference/datamodel.rst:1141 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1145 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1380,21 +1398,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1140 +#: ../../reference/datamodel.rst:1153 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1145 +#: ../../reference/datamodel.rst:1158 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1155 +#: ../../reference/datamodel.rst:1168 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1404,7 +1422,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1164 +#: ../../reference/datamodel.rst:1177 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1412,41 +1430,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1170 +#: ../../reference/datamodel.rst:1183 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1174 +#: ../../reference/datamodel.rst:1187 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1203 +#: ../../reference/datamodel.rst:1216 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1194 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1190 +#: ../../reference/datamodel.rst:1203 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1194 +#: ../../reference/datamodel.rst:1207 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1211 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1456,11 +1474,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1212 +#: ../../reference/datamodel.rst:1225 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1206 +#: ../../reference/datamodel.rst:1219 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1471,11 +1489,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1220 +#: ../../reference/datamodel.rst:1233 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1228 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1484,11 +1502,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1238 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1231 +#: ../../reference/datamodel.rst:1244 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1502,7 +1520,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1242 +#: ../../reference/datamodel.rst:1255 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1511,7 +1529,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1248 +#: ../../reference/datamodel.rst:1261 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1521,11 +1539,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1272 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1278 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1535,7 +1553,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1285 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1543,7 +1561,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1277 +#: ../../reference/datamodel.rst:1290 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1552,13 +1570,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1295 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1285 +#: ../../reference/datamodel.rst:1298 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1566,7 +1584,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1294 +#: ../../reference/datamodel.rst:1307 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1576,7 +1594,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1314 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1584,7 +1602,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1314 +#: ../../reference/datamodel.rst:1327 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1593,7 +1611,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1333 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1603,20 +1621,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1327 +#: ../../reference/datamodel.rst:1340 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1345 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1337 +#: ../../reference/datamodel.rst:1350 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1627,18 +1645,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1347 +#: ../../reference/datamodel.rst:1360 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1351 +#: ../../reference/datamodel.rst:1364 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1355 +#: ../../reference/datamodel.rst:1368 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1647,7 +1665,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1361 +#: ../../reference/datamodel.rst:1374 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1658,7 +1676,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1389 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1670,13 +1688,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1385 +#: ../../reference/datamodel.rst:1398 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1396 +#: ../../reference/datamodel.rst:1409 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1684,26 +1702,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1414 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1405 +#: ../../reference/datamodel.rst:1418 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1415 +#: ../../reference/datamodel.rst:1428 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1439 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1715,28 +1733,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1449 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1451 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1440 +#: ../../reference/datamodel.rst:1453 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:1457 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1460 +#: ../../reference/datamodel.rst:1473 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1549 +#: ../../reference/datamodel.rst:1562 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1855,7 +1873,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1558 +#: ../../reference/datamodel.rst:1571 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1863,7 +1881,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1563 +#: ../../reference/datamodel.rst:1576 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1871,22 +1889,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1568 +#: ../../reference/datamodel.rst:1581 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1572 +#: ../../reference/datamodel.rst:1585 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1587 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1582 +#: ../../reference/datamodel.rst:1595 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1895,18 +1913,18 @@ msgid "" "`__len__` nor :meth:`__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1606 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1595 +#: ../../reference/datamodel.rst:1608 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1603 +#: ../../reference/datamodel.rst:1616 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1916,7 +1934,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1610 +#: ../../reference/datamodel.rst:1623 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1929,7 +1947,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1636 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1941,14 +1959,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1634 +#: ../../reference/datamodel.rst:1647 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1638 +#: ../../reference/datamodel.rst:1651 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1956,27 +1974,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1640 +#: ../../reference/datamodel.rst:1653 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1647 +#: ../../reference/datamodel.rst:1660 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1651 +#: ../../reference/datamodel.rst:1664 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1655 +#: ../../reference/datamodel.rst:1668 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -1984,21 +2002,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1657 +#: ../../reference/datamodel.rst:1670 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1664 +#: ../../reference/datamodel.rst:1677 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1667 +#: ../../reference/datamodel.rst:1680 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2006,23 +2024,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1669 +#: ../../reference/datamodel.rst:1682 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1676 +#: ../../reference/datamodel.rst:1689 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1681 +#: ../../reference/datamodel.rst:1694 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1688 +#: ../../reference/datamodel.rst:1701 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2034,21 +2052,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1710 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1701 +#: ../../reference/datamodel.rst:1714 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1719 +#: ../../reference/datamodel.rst:1732 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2056,27 +2074,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1724 +#: ../../reference/datamodel.rst:1737 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1740 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1732 +#: ../../reference/datamodel.rst:1745 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1733 +#: ../../reference/datamodel.rst:1746 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1739 +#: ../../reference/datamodel.rst:1752 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1741 +#: ../../reference/datamodel.rst:1754 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2086,7 +2104,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1764 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2095,13 +2113,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1770 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1760 +#: ../../reference/datamodel.rst:1773 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2111,25 +2129,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1769 +#: ../../reference/datamodel.rst:1782 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1772 +#: ../../reference/datamodel.rst:1785 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1778 +#: ../../reference/datamodel.rst:1791 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1794 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2140,11 +2158,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1792 +#: ../../reference/datamodel.rst:1805 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1794 +#: ../../reference/datamodel.rst:1807 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2153,7 +2171,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1813 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2161,7 +2179,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1818 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2169,54 +2187,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1810 +#: ../../reference/datamodel.rst:1823 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1815 +#: ../../reference/datamodel.rst:1828 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1827 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1819 +#: ../../reference/datamodel.rst:1832 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1831 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:1836 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1822 +#: ../../reference/datamodel.rst:1835 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1829 +#: ../../reference/datamodel.rst:1842 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1826 +#: ../../reference/datamodel.rst:1839 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1863 +#: ../../reference/datamodel.rst:1876 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2233,7 +2251,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1890 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2242,30 +2260,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1883 +#: ../../reference/datamodel.rst:1896 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1890 +#: ../../reference/datamodel.rst:1903 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:1892 +#: ../../reference/datamodel.rst:1905 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:1896 +#: ../../reference/datamodel.rst:1909 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:1901 +#: ../../reference/datamodel.rst:1914 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2273,18 +2291,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1911 +#: ../../reference/datamodel.rst:1924 msgid "Notes on using *__slots__*" msgstr "" -#: ../../reference/datamodel.rst:1913 +#: ../../reference/datamodel.rst:1926 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:1917 +#: ../../reference/datamodel.rst:1930 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2293,7 +2311,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1924 +#: ../../reference/datamodel.rst:1937 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2301,7 +2319,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1930 +#: ../../reference/datamodel.rst:1943 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2309,7 +2327,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1936 +#: ../../reference/datamodel.rst:1949 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2318,7 +2336,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1942 +#: ../../reference/datamodel.rst:1955 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2327,7 +2345,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1947 +#: ../../reference/datamodel.rst:1960 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2335,11 +2353,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1952 +#: ../../reference/datamodel.rst:1965 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1954 +#: ../../reference/datamodel.rst:1967 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2347,13 +2365,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1959 +#: ../../reference/datamodel.rst:1972 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1962 +#: ../../reference/datamodel.rst:1975 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2361,18 +2379,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1968 +#: ../../reference/datamodel.rst:1981 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:1989 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1978 +#: ../../reference/datamodel.rst:1991 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2382,14 +2400,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:1987 +#: ../../reference/datamodel.rst:2000 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:2004 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2397,13 +2415,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2005 +#: ../../reference/datamodel.rst:2018 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2010 +#: ../../reference/datamodel.rst:2023 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2411,41 +2429,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2031 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2036 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2042 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2040 +#: ../../reference/datamodel.rst:2053 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2048 +#: ../../reference/datamodel.rst:2061 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2055 +#: ../../reference/datamodel.rst:2068 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2059 +#: ../../reference/datamodel.rst:2072 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2453,41 +2471,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2086 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2089 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2091 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2092 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2080 +#: ../../reference/datamodel.rst:2093 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2081 +#: ../../reference/datamodel.rst:2094 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2082 +#: ../../reference/datamodel.rst:2095 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2099 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2103 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2499,49 +2517,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2115 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2115 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2119 +msgid ":func:`types.get_original_bases`" +msgstr "" + +#: ../../reference/datamodel.rst:2118 +msgid "" +"Retrieve a class's \"original bases\" prior to modifications by :meth:" +"`~object.__mro_entries__`." +msgstr "" + +#: ../../reference/datamodel.rst:2121 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2122 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2126 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2130 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2115 +#: ../../reference/datamodel.rst:2132 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2116 +#: ../../reference/datamodel.rst:2133 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2118 +#: ../../reference/datamodel.rst:2135 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2138 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2550,11 +2578,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2131 +#: ../../reference/datamodel.rst:2148 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2136 +#: ../../reference/datamodel.rst:2153 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2566,25 +2594,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2162 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2167 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2151 +#: ../../reference/datamodel.rst:2168 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2172 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2160 +#: ../../reference/datamodel.rst:2177 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2593,7 +2621,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2183 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2602,11 +2630,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2192 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2182 +#: ../../reference/datamodel.rst:2199 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2614,7 +2642,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2187 +#: ../../reference/datamodel.rst:2204 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2625,7 +2653,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2214 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2634,39 +2662,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2203 +#: ../../reference/datamodel.rst:2220 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2207 +#: ../../reference/datamodel.rst:2224 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2226 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2211 +#: ../../reference/datamodel.rst:2228 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2231 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2235 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2674,19 +2702,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2242 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2226 +#: ../../reference/datamodel.rst:2243 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2247 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2249 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2694,17 +2722,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2256 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2258 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2244 +#: ../../reference/datamodel.rst:2261 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2712,21 +2740,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2268 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2275 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2263 +#: ../../reference/datamodel.rst:2280 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2734,11 +2762,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2274 +#: ../../reference/datamodel.rst:2291 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2271 +#: ../../reference/datamodel.rst:2288 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2747,11 +2775,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2279 +#: ../../reference/datamodel.rst:2296 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2298 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2759,65 +2787,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2289 +#: ../../reference/datamodel.rst:2306 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2289 +#: ../../reference/datamodel.rst:2306 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2309 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2292 +#: ../../reference/datamodel.rst:2309 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2312 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2312 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2315 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2303 +#: ../../reference/datamodel.rst:2320 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2323 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2329 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2314 +#: ../../reference/datamodel.rst:2331 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2318 +#: ../../reference/datamodel.rst:2335 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2826,7 +2854,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2341 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2834,11 +2862,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2351 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2336 +#: ../../reference/datamodel.rst:2353 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2848,14 +2876,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2343 +#: ../../reference/datamodel.rst:2360 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2371 +#: ../../reference/datamodel.rst:2388 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2865,40 +2893,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2390 +#: ../../reference/datamodel.rst:2407 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2432 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2431 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2422 +#: ../../reference/datamodel.rst:2439 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2429 +#: ../../reference/datamodel.rst:2446 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2453 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2455 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2934,7 +2962,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2478 +#: ../../reference/datamodel.rst:2495 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2942,7 +2970,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2485 +#: ../../reference/datamodel.rst:2502 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2951,7 +2979,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2494 +#: ../../reference/datamodel.rst:2511 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2961,20 +2989,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2525 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2512 +#: ../../reference/datamodel.rst:2529 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2516 +#: ../../reference/datamodel.rst:2533 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:2538 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2987,20 +3015,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2550 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2555 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2563 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3009,7 +3037,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2572 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3018,13 +3046,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2564 +#: ../../reference/datamodel.rst:2581 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2587 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3032,14 +3060,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2595 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2582 +#: ../../reference/datamodel.rst:2599 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3048,7 +3076,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2606 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3056,14 +3084,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2596 +#: ../../reference/datamodel.rst:2613 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2600 +#: ../../reference/datamodel.rst:2617 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3071,11 +3099,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2609 +#: ../../reference/datamodel.rst:2626 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2611 +#: ../../reference/datamodel.rst:2628 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3083,7 +3111,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2637 +#: ../../reference/datamodel.rst:2654 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3097,13 +3125,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2648 +#: ../../reference/datamodel.rst:2665 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2671 +#: ../../reference/datamodel.rst:2688 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3116,13 +3144,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2683 +#: ../../reference/datamodel.rst:2700 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2688 +#: ../../reference/datamodel.rst:2705 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3131,7 +3159,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2709 +#: ../../reference/datamodel.rst:2726 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3147,19 +3175,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2730 +#: ../../reference/datamodel.rst:2747 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2743 +#: ../../reference/datamodel.rst:2760 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2750 +#: ../../reference/datamodel.rst:2767 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3168,14 +3196,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2773 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2785 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3184,21 +3212,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2774 +#: ../../reference/datamodel.rst:2791 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2777 +#: ../../reference/datamodel.rst:2794 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2784 +#: ../../reference/datamodel.rst:2801 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2786 +#: ../../reference/datamodel.rst:2803 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3208,32 +3236,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2797 +#: ../../reference/datamodel.rst:2814 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2817 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2822 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:2829 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2816 +#: ../../reference/datamodel.rst:2833 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3241,27 +3269,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2820 +#: ../../reference/datamodel.rst:2837 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2827 +#: ../../reference/datamodel.rst:2844 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2827 +#: ../../reference/datamodel.rst:2844 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2834 +#: ../../reference/datamodel.rst:2851 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2836 +#: ../../reference/datamodel.rst:2853 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3269,7 +3297,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2843 +#: ../../reference/datamodel.rst:2860 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3278,7 +3306,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:2866 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3288,19 +3316,73 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2859 +#: ../../reference/datamodel.rst:2876 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2877 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2883 +msgid "Emulating buffer types" +msgstr "" + +#: ../../reference/datamodel.rst:2885 +msgid "" +"The :ref:`buffer protocol ` provides a way for Python objects " +"to expose efficient access to a low-level memory array. This protocol is " +"implemented by builtin types such as :class:`bytes` and :class:`memoryview`, " +"and third-party libraries may define additional buffer types." +msgstr "" + +#: ../../reference/datamodel.rst:2890 +msgid "" +"While buffer types are usually implemented in C, it is also possible to " +"implement the protocol in Python." +msgstr "" + +#: ../../reference/datamodel.rst:2895 +msgid "" +"Called when a buffer is requested from *self* (for example, by the :class:" +"`memoryview` constructor). The *flags* argument is an integer representing " +"the kind of buffer requested, affecting for example whether the returned " +"buffer is read-only or writable. :class:`inspect.BufferFlags` provides a " +"convenient way to interpret the flags. The method must return a :class:" +"`memoryview` object." +msgstr "" + +#: ../../reference/datamodel.rst:2904 +msgid "" +"Called when a buffer is no longer needed. The *buffer* argument is a :class:" +"`memoryview` object that was previously returned by :meth:`~object." +"__buffer__`. The method must release any resources associated with the " +"buffer. This method should return ``None``. Buffer objects that do not need " +"to perform any cleanup are not required to implement this method." +msgstr "" + +#: ../../reference/datamodel.rst:2916 +msgid ":pep:`688` - Making the buffer protocol accessible in Python" +msgstr "" + +#: ../../reference/datamodel.rst:2916 +msgid "" +"Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." +msgstr "" + +#: ../../reference/datamodel.rst:2918 +msgid ":class:`collections.abc.Buffer`" +msgstr "" + +#: ../../reference/datamodel.rst:2919 +msgid "ABC for buffer types." +msgstr "" + +#: ../../reference/datamodel.rst:2924 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2868 +#: ../../reference/datamodel.rst:2926 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3308,7 +3390,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2883 +#: ../../reference/datamodel.rst:2941 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3317,21 +3399,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2955 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2964 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2990 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3340,36 +3422,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2943 +#: ../../reference/datamodel.rst:3001 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:3005 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:3007 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:3013 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2961 +#: ../../reference/datamodel.rst:3019 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2967 +#: ../../reference/datamodel.rst:3025 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3377,15 +3459,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2975 +#: ../../reference/datamodel.rst:3033 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2981 +#: ../../reference/datamodel.rst:3039 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2983 +#: ../../reference/datamodel.rst:3041 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3396,18 +3478,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2991 +#: ../../reference/datamodel.rst:3049 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2995 +#: ../../reference/datamodel.rst:3053 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3059 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3418,7 +3500,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3070 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3429,7 +3511,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3023 +#: ../../reference/datamodel.rst:3081 +msgid "" +"The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " +"and may be removed in a future version of Python." +msgstr "" + +#: ../../reference/datamodel.rst:3086 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3439,99 +3527,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3031 +#: ../../reference/datamodel.rst:3094 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3100 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3039 +#: ../../reference/datamodel.rst:3102 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3042 +#: ../../reference/datamodel.rst:3105 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3046 +#: ../../reference/datamodel.rst:3109 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3050 +#: ../../reference/datamodel.rst:3113 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3053 +#: ../../reference/datamodel.rst:3116 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3133 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3075 +#: ../../reference/datamodel.rst:3138 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3083 +#: ../../reference/datamodel.rst:3146 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:3148 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3151 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3092 +#: ../../reference/datamodel.rst:3155 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3097 +#: ../../reference/datamodel.rst:3160 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:3163 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3176 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3114 +#: ../../reference/datamodel.rst:3177 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3181 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3539,7 +3627,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3124 +#: ../../reference/datamodel.rst:3187 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3547,7 +3635,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3130 +#: ../../reference/datamodel.rst:3193 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3564,13 +3652,13 @@ msgstr "" #: ../../reference/datamodel.rst:386 ../../reference/datamodel.rst:405 #: ../../reference/datamodel.rst:412 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:467 -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:582 -#: ../../reference/datamodel.rst:690 ../../reference/datamodel.rst:705 -#: ../../reference/datamodel.rst:729 ../../reference/datamodel.rst:807 -#: ../../reference/datamodel.rst:867 ../../reference/datamodel.rst:894 -#: ../../reference/datamodel.rst:944 ../../reference/datamodel.rst:998 -#: ../../reference/datamodel.rst:1055 ../../reference/datamodel.rst:1117 -#: ../../reference/datamodel.rst:1499 ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:697 ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:736 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:956 ../../reference/datamodel.rst:1011 +#: ../../reference/datamodel.rst:1068 ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2521 msgid "object" msgstr "object(物件)" @@ -3580,14 +3668,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:269 #: ../../reference/datamodel.rst:310 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:690 -#: ../../reference/datamodel.rst:910 ../../reference/datamodel.rst:1179 -#: ../../reference/datamodel.rst:1413 ../../reference/datamodel.rst:1418 -#: ../../reference/datamodel.rst:1499 ../../reference/datamodel.rst:2050 -#: ../../reference/datamodel.rst:2474 ../../reference/datamodel.rst:2632 -#: ../../reference/datamodel.rst:2667 ../../reference/datamodel.rst:2681 -#: ../../reference/datamodel.rst:2728 ../../reference/datamodel.rst:2738 -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:922 ../../reference/datamodel.rst:1192 +#: ../../reference/datamodel.rst:1426 ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2491 ../../reference/datamodel.rst:2649 +#: ../../reference/datamodel.rst:2684 ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2745 ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2783 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3596,7 +3684,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2063 msgid "type" msgstr "type(型別)" @@ -3632,7 +3720,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:807 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:814 msgid "container" msgstr "container(容器)" @@ -3645,24 +3733,24 @@ msgid "extension" msgstr "extension(擴充)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:380 -#: ../../reference/datamodel.rst:453 ../../reference/datamodel.rst:729 -#: ../../reference/datamodel.rst:748 ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:453 ../../reference/datamodel.rst:736 +#: ../../reference/datamodel.rst:755 ../../reference/datamodel.rst:922 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:690 +#: ../../reference/datamodel.rst:697 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:690 +#: ../../reference/datamodel.rst:697 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:807 -#: ../../reference/datamodel.rst:824 ../../reference/datamodel.rst:867 -#: ../../reference/datamodel.rst:887 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:831 ../../reference/datamodel.rst:879 +#: ../../reference/datamodel.rst:899 msgid "attribute" msgstr "attribute(屬性)" @@ -3682,7 +3770,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:894 +#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:906 msgid "numeric" msgstr "numeric(數值)" @@ -3719,16 +3807,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:2755 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:2474 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:2491 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:894 +#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:906 msgid "sequence" msgstr "sequence(序列)" @@ -3757,8 +3845,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:306 ../../reference/datamodel.rst:1388 -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:306 ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1431 msgid "string" msgstr "string(字串)" @@ -3794,7 +3882,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:1413 +#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:1426 msgid "bytes" msgstr "bytes(位元組)" @@ -3810,14 +3898,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:824 -#: ../../reference/datamodel.rst:887 +#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:899 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:729 -#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:1309 -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:736 +#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:2810 msgid "statement" msgstr "statement(陳述式)" @@ -3845,12 +3933,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:894 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:906 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:807 -#: ../../reference/datamodel.rst:1499 +#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:1512 msgid "dictionary" msgstr "dictionary(字典)" @@ -3867,13 +3955,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:477 -#: ../../reference/datamodel.rst:645 ../../reference/datamodel.rst:660 -#: ../../reference/datamodel.rst:670 ../../reference/datamodel.rst:690 +#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:667 +#: ../../reference/datamodel.rst:677 ../../reference/datamodel.rst:697 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:807 -#: ../../reference/datamodel.rst:829 ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:836 ../../reference/datamodel.rst:2444 msgid "call" msgstr "call(呼叫)" @@ -3885,7 +3973,7 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -3933,563 +4021,573 @@ msgstr "__annotations__ (函式屬性)" msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" +#: ../../reference/datamodel.rst:491 +#, fuzzy +msgid "__type_params__ (function attribute)" +msgstr "__name__ (函式屬性)" + #: ../../reference/datamodel.rst:491 msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:491 ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:491 ../../reference/datamodel.rst:755 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:582 ../../reference/datamodel.rst:705 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:712 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:589 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:597 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:597 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:597 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:597 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:597 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:645 ../../reference/datamodel.rst:998 +#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:1011 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:645 +#: ../../reference/datamodel.rst:652 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:2939 +#: ../../reference/datamodel.rst:667 ../../reference/datamodel.rst:2997 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:677 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:677 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:705 +#: ../../reference/datamodel.rst:712 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:705 +#: ../../reference/datamodel.rst:712 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:736 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:755 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:755 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:755 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:748 +#: ../../reference/datamodel.rst:755 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:779 +#: ../../reference/datamodel.rst:786 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:824 -#: ../../reference/datamodel.rst:867 ../../reference/datamodel.rst:1292 -#: ../../reference/datamodel.rst:2157 +#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:2174 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:867 -#: ../../reference/datamodel.rst:887 +#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 +#: ../../reference/datamodel.rst:899 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:867 -#: ../../reference/datamodel.rst:2427 +#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 +#: ../../reference/datamodel.rst:2444 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:807 ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:836 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:840 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:902 +#: ../../reference/datamodel.rst:840 +#, fuzzy +msgid "__type_params__ (class attribute)" +msgstr "__name__ (類別屬性)" + +#: ../../reference/datamodel.rst:914 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:902 +#: ../../reference/datamodel.rst:914 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:910 +#: ../../reference/datamodel.rst:922 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:936 +#: ../../reference/datamodel.rst:948 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:936 +#: ../../reference/datamodel.rst:948 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:956 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:956 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:956 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:968 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1014 +#: ../../reference/datamodel.rst:1027 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1055 +#: ../../reference/datamodel.rst:1068 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1060 +#: ../../reference/datamodel.rst:1073 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1079 +#: ../../reference/datamodel.rst:1092 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1079 +#: ../../reference/datamodel.rst:1092 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1079 +#: ../../reference/datamodel.rst:1092 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1079 +#: ../../reference/datamodel.rst:1092 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1130 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:1162 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:1162 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:1162 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1149 +#: ../../reference/datamodel.rst:1162 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1167 +#: ../../reference/datamodel.rst:1180 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1179 ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:1192 ../../reference/datamodel.rst:2521 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1185 +#: ../../reference/datamodel.rst:1198 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1185 +#: ../../reference/datamodel.rst:1198 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1185 +#: ../../reference/datamodel.rst:1198 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1240 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1240 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1240 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1276 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1276 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1305 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1322 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1322 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1322 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1371 +#: ../../reference/datamodel.rst:1384 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1371 +#: ../../reference/datamodel.rst:1384 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1401 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1401 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1401 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1431 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1431 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1431 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1457 +#: ../../reference/datamodel.rst:1470 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1499 +#: ../../reference/datamodel.rst:1512 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1580 +#: ../../reference/datamodel.rst:1593 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1683 +#: ../../reference/datamodel.rst:1696 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1683 +#: ../../reference/datamodel.rst:1696 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1683 +#: ../../reference/datamodel.rst:1696 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2063 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2063 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2063 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2110 +#: ../../reference/datamodel.rst:2127 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2150 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2157 +#: ../../reference/datamodel.rst:2174 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2194 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2194 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2474 +#: ../../reference/datamodel.rst:2491 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2632 ../../reference/datamodel.rst:2667 +#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2632 ../../reference/datamodel.rst:2667 -#: ../../reference/datamodel.rst:2681 +#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2698 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2728 +#: ../../reference/datamodel.rst:2745 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2755 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2755 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2766 +#: ../../reference/datamodel.rst:2783 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2810 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2810 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 165be0e3d2..6262f8927a 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -106,26 +106,35 @@ msgstr "" msgid ":keyword:`import` statements." msgstr "" +#: ../../reference/executionmodel.rst:74 +#, fuzzy +msgid ":keyword:`type` statements." +msgstr "import statement(引入陳述式)" + #: ../../reference/executionmodel.rst:75 +msgid ":ref:`type parameter lists `." +msgstr "" + +#: ../../reference/executionmodel.rst:77 msgid "" "The :keyword:`!import` statement of the form ``from ... import *`` binds all " "names defined in the imported module, except those beginning with an " "underscore. This form may only be used at the module level." msgstr "" -#: ../../reference/executionmodel.rst:79 +#: ../../reference/executionmodel.rst:81 msgid "" "A target occurring in a :keyword:`del` statement is also considered bound " "for this purpose (though the actual semantics are to unbind the name)." msgstr "" -#: ../../reference/executionmodel.rst:82 +#: ../../reference/executionmodel.rst:84 msgid "" "Each assignment or import statement occurs within a block defined by a class " "or function definition or at the module level (the top-level code block)." msgstr "" -#: ../../reference/executionmodel.rst:87 +#: ../../reference/executionmodel.rst:89 msgid "" "If a name is bound in a block, it is a local variable of that block, unless " "declared as :keyword:`nonlocal` or :keyword:`global`. If a name is bound at " @@ -134,17 +143,17 @@ msgid "" "not defined there, it is a :dfn:`free variable`." msgstr "" -#: ../../reference/executionmodel.rst:93 +#: ../../reference/executionmodel.rst:95 msgid "" "Each occurrence of a name in the program text refers to the :dfn:`binding` " "of that name established by the following name resolution rules." msgstr "" -#: ../../reference/executionmodel.rst:99 +#: ../../reference/executionmodel.rst:101 msgid "Resolution of names" msgstr "" -#: ../../reference/executionmodel.rst:103 +#: ../../reference/executionmodel.rst:105 msgid "" "A :dfn:`scope` defines the visibility of a name within a block. If a local " "variable is defined in a block, its scope includes that block. If the " @@ -153,14 +162,14 @@ msgid "" "different binding for the name." msgstr "" -#: ../../reference/executionmodel.rst:111 +#: ../../reference/executionmodel.rst:113 msgid "" "When a name is used in a code block, it is resolved using the nearest " "enclosing scope. The set of all such scopes visible to a code block is " "called the block's :dfn:`environment`." msgstr "" -#: ../../reference/executionmodel.rst:119 +#: ../../reference/executionmodel.rst:121 msgid "" "When a name is not found at all, a :exc:`NameError` exception is raised. If " "the current scope is a function scope, and the name refers to a local " @@ -169,7 +178,7 @@ msgid "" "`UnboundLocalError` is a subclass of :exc:`NameError`." msgstr "" -#: ../../reference/executionmodel.rst:125 +#: ../../reference/executionmodel.rst:127 msgid "" "If a name binding operation occurs anywhere within a code block, all uses of " "the name within the block are treated as references to the current block. " @@ -181,7 +190,7 @@ msgid "" "UnboundLocalError ` for examples." msgstr "" -#: ../../reference/executionmodel.rst:134 +#: ../../reference/executionmodel.rst:136 msgid "" "If the :keyword:`global` statement occurs within a block, all uses of the " "names specified in the statement refer to the bindings of those names in the " @@ -193,7 +202,7 @@ msgid "" "statement must precede all uses of the listed names." msgstr "" -#: ../../reference/executionmodel.rst:143 +#: ../../reference/executionmodel.rst:145 msgid "" "The :keyword:`global` statement has the same scope as a name binding " "operation in the same block. If the nearest enclosing scope for a free " @@ -201,21 +210,22 @@ msgid "" "global." msgstr "" -#: ../../reference/executionmodel.rst:149 +#: ../../reference/executionmodel.rst:151 msgid "" "The :keyword:`nonlocal` statement causes corresponding names to refer to " "previously bound variables in the nearest enclosing function scope. :exc:" "`SyntaxError` is raised at compile time if the given name does not exist in " -"any enclosing function scope." +"any enclosing function scope. :ref:`Type parameters ` cannot be " +"rebound with the :keyword:`!nonlocal` statement." msgstr "" -#: ../../reference/executionmodel.rst:156 +#: ../../reference/executionmodel.rst:159 msgid "" "The namespace for a module is automatically created the first time a module " "is imported. The main module for a script is always called :mod:`__main__`." msgstr "" -#: ../../reference/executionmodel.rst:159 +#: ../../reference/executionmodel.rst:162 msgid "" "Class definition blocks and arguments to :func:`exec` and :func:`eval` are " "special in the context of name resolution. A class definition is an " @@ -224,16 +234,148 @@ msgid "" "variables are looked up in the global namespace. The namespace of the class " "definition becomes the attribute dictionary of the class. The scope of names " "defined in a class block is limited to the class block; it does not extend " -"to the code blocks of methods -- this includes comprehensions and generator " -"expressions since they are implemented using a function scope. This means " -"that the following will fail::" +"to the code blocks of methods. This includes comprehensions and generator " +"expressions, but it does not include :ref:`annotation scopes `, which have access to their enclosing class scopes. This means that " +"the following will fail::" +msgstr "" + +#: ../../reference/executionmodel.rst:179 +msgid "However, the following will succeed::" +msgstr "" + +#: ../../reference/executionmodel.rst:190 +msgid "Annotation scopes" +msgstr "" + +#: ../../reference/executionmodel.rst:192 +msgid "" +":ref:`Type parameter lists ` and :keyword:`type` statements " +"introduce *annotation scopes*, which behave mostly like function scopes, but " +"with some exceptions discussed below. :term:`Annotations ` " +"currently do not use annotation scopes, but they are expected to use " +"annotation scopes in Python 3.13 when :pep:`649` is implemented." +msgstr "" + +#: ../../reference/executionmodel.rst:198 +msgid "Annotation scopes are used in the following contexts:" +msgstr "" + +#: ../../reference/executionmodel.rst:200 +msgid "" +"Type parameter lists for :ref:`generic type aliases `." +msgstr "" + +#: ../../reference/executionmodel.rst:201 +msgid "" +"Type parameter lists for :ref:`generic functions `. A " +"generic function's annotations are executed within the annotation scope, but " +"its defaults and decorators are not." +msgstr "" + +#: ../../reference/executionmodel.rst:204 +msgid "" +"Type parameter lists for :ref:`generic classes `. A generic " +"class's base classes and keyword arguments are executed within the " +"annotation scope, but its decorators are not." +msgstr "" + +#: ../../reference/executionmodel.rst:207 +msgid "" +"The bounds and constraints for type variables (:ref:`lazily evaluated `)." +msgstr "" + +#: ../../reference/executionmodel.rst:209 +msgid "The value of type aliases (:ref:`lazily evaluated `)." +msgstr "" + +#: ../../reference/executionmodel.rst:211 +msgid "Annotation scopes differ from function scopes in the following ways:" +msgstr "" + +#: ../../reference/executionmodel.rst:213 +msgid "" +"Annotation scopes have access to their enclosing class namespace. If an " +"annotation scope is immediately within a class scope, or within another " +"annotation scope that is immediately within a class scope, the code in the " +"annotation scope can use names defined in the class scope as if it were " +"executed directly within the class body. This contrasts with regular " +"functions defined within classes, which cannot access names defined in the " +"class scope." +msgstr "" + +#: ../../reference/executionmodel.rst:219 +msgid "" +"Expressions in annotation scopes cannot contain :keyword:`yield`, ``yield " +"from``, :keyword:`await`, or :token:`:= ` expressions. (These expressions are allowed in other " +"scopes contained within the annotation scope.)" +msgstr "" + +#: ../../reference/executionmodel.rst:223 +msgid "" +"Names defined in annotation scopes cannot be rebound with :keyword:" +"`nonlocal` statements in inner scopes. This includes only type parameters, " +"as no other syntactic elements that can appear within annotation scopes can " +"introduce new names." +msgstr "" + +#: ../../reference/executionmodel.rst:226 +msgid "" +"While annotation scopes have an internal name, that name is not reflected in " +"the :term:`__qualname__ ` of objects defined within the " +"scope. Instead, the :attr:`!__qualname__` of such objects is as if the " +"object were defined in the enclosing scope." +msgstr "" + +#: ../../reference/executionmodel.rst:231 +msgid "Annotation scopes were introduced in Python 3.12 as part of :pep:`695`." +msgstr "" + +#: ../../reference/executionmodel.rst:237 +msgid "Lazy evaluation" +msgstr "" + +#: ../../reference/executionmodel.rst:239 +msgid "" +"The values of type aliases created through the :keyword:`type` statement are " +"*lazily evaluated*. The same applies to the bounds and constraints of type " +"variables created through the :ref:`type parameter syntax `. " +"This means that they are not evaluated when the type alias or type variable " +"is created. Instead, they are only evaluated when doing so is necessary to " +"resolve an attribute access." +msgstr "" + +#: ../../reference/executionmodel.rst:246 +msgid "Example:" +msgstr "" + +#: ../../reference/executionmodel.rst:262 +msgid "" +"Here the exception is raised only when the ``__value__`` attribute of the " +"type alias or the ``__bound__`` attribute of the type variable is accessed." msgstr "" -#: ../../reference/executionmodel.rst:177 +#: ../../reference/executionmodel.rst:266 +msgid "" +"This behavior is primarily useful for references to types that have not yet " +"been defined when the type alias or type variable is created. For example, " +"lazy evaluation enables creation of mutually recursive type aliases::" +msgstr "" + +#: ../../reference/executionmodel.rst:276 +msgid "" +"Lazily evaluated values are evaluated in :ref:`annotation scope `, which means that names that appear inside the lazily evaluated " +"value are looked up as if they were used in the immediately enclosing scope." +msgstr "" + +#: ../../reference/executionmodel.rst:285 msgid "Builtins and restricted execution" msgstr "" -#: ../../reference/executionmodel.rst:183 +#: ../../reference/executionmodel.rst:291 msgid "" "Users should not touch ``__builtins__``; it is strictly an implementation " "detail. Users wanting to override values in the builtins namespace should :" @@ -241,7 +383,7 @@ msgid "" "appropriately." msgstr "" -#: ../../reference/executionmodel.rst:188 +#: ../../reference/executionmodel.rst:296 msgid "" "The builtins namespace associated with the execution of a code block is " "actually found by looking up the name ``__builtins__`` in its global " @@ -252,17 +394,17 @@ msgid "" "`builtins` module itself." msgstr "" -#: ../../reference/executionmodel.rst:200 +#: ../../reference/executionmodel.rst:308 msgid "Interaction with dynamic features" msgstr "" -#: ../../reference/executionmodel.rst:202 +#: ../../reference/executionmodel.rst:310 msgid "" "Name resolution of free variables occurs at runtime, not at compile time. " "This means that the following code will print 42::" msgstr "" -#: ../../reference/executionmodel.rst:213 +#: ../../reference/executionmodel.rst:321 msgid "" "The :func:`eval` and :func:`exec` functions do not have access to the full " "environment for resolving names. Names may be resolved in the local and " @@ -273,11 +415,11 @@ msgid "" "for both." msgstr "" -#: ../../reference/executionmodel.rst:224 +#: ../../reference/executionmodel.rst:332 msgid "Exceptions" msgstr "例外" -#: ../../reference/executionmodel.rst:235 +#: ../../reference/executionmodel.rst:343 msgid "" "Exceptions are a means of breaking out of the normal flow of control of a " "code block in order to handle errors or other exceptional conditions. An " @@ -286,7 +428,7 @@ msgid "" "or indirectly invoked the code block where the error occurred." msgstr "" -#: ../../reference/executionmodel.rst:241 +#: ../../reference/executionmodel.rst:349 msgid "" "The Python interpreter raises an exception when it detects a run-time error " "(such as division by zero). A Python program can also explicitly raise an " @@ -297,7 +439,7 @@ msgid "" "exception occurred or not in the preceding code." msgstr "" -#: ../../reference/executionmodel.rst:251 +#: ../../reference/executionmodel.rst:359 msgid "" "Python uses the \"termination\" model of error handling: an exception " "handler can find out what happened and continue execution at an outer level, " @@ -305,7 +447,7 @@ msgid "" "(except by re-entering the offending piece of code from the top)." msgstr "" -#: ../../reference/executionmodel.rst:258 +#: ../../reference/executionmodel.rst:366 msgid "" "When an exception is not handled at all, the interpreter terminates " "execution of the program, or returns to its interactive main loop. In " @@ -313,7 +455,7 @@ msgid "" "`SystemExit`." msgstr "" -#: ../../reference/executionmodel.rst:262 +#: ../../reference/executionmodel.rst:370 msgid "" "Exceptions are identified by class instances. The :keyword:`except` clause " "is selected depending on the class of the instance: it must reference the " @@ -322,7 +464,7 @@ msgid "" "additional information about the exceptional condition." msgstr "" -#: ../../reference/executionmodel.rst:270 +#: ../../reference/executionmodel.rst:378 msgid "" "Exception messages are not part of the Python API. Their contents may " "change from one version of Python to the next without warning and should not " @@ -330,17 +472,17 @@ msgid "" "interpreter." msgstr "" -#: ../../reference/executionmodel.rst:274 +#: ../../reference/executionmodel.rst:382 msgid "" "See also the description of the :keyword:`try` statement in section :ref:" "`try` and :keyword:`raise` statement in section :ref:`raise`." msgstr "" -#: ../../reference/executionmodel.rst:279 +#: ../../reference/executionmodel.rst:387 msgid "Footnotes" msgstr "註解" -#: ../../reference/executionmodel.rst:280 +#: ../../reference/executionmodel.rst:388 msgid "" "This limitation occurs because the code that is executed by these operations " "is not available at the time the module is compiled." @@ -358,7 +500,7 @@ msgstr "code(程式碼)" msgid "block" msgstr "block" -#: ../../reference/executionmodel.rst:31 ../../reference/executionmodel.rst:179 +#: ../../reference/executionmodel.rst:31 ../../reference/executionmodel.rst:287 msgid "execution" msgstr "execution(執行)" @@ -370,7 +512,7 @@ msgstr "frame" msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/executionmodel.rst:42 ../../reference/executionmodel.rst:101 +#: ../../reference/executionmodel.rst:42 ../../reference/executionmodel.rst:103 msgid "scope" msgstr "scope(作用域)" @@ -390,66 +532,66 @@ msgstr "from" msgid "import statement" msgstr "import statement(引入陳述式)" -#: ../../reference/executionmodel.rst:85 +#: ../../reference/executionmodel.rst:87 msgid "free" msgstr "free" -#: ../../reference/executionmodel.rst:85 +#: ../../reference/executionmodel.rst:87 msgid "variable" msgstr "variable(變數)" -#: ../../reference/executionmodel.rst:109 +#: ../../reference/executionmodel.rst:111 msgid "environment" msgstr "environment(環境)" -#: ../../reference/executionmodel.rst:115 +#: ../../reference/executionmodel.rst:117 msgid "NameError (built-in exception)" msgstr "NameError(內建例外)" -#: ../../reference/executionmodel.rst:115 +#: ../../reference/executionmodel.rst:117 msgid "UnboundLocalError" msgstr "UnboundLocalError" -#: ../../reference/executionmodel.rst:154 +#: ../../reference/executionmodel.rst:157 msgid "module" msgstr "module(模組)" -#: ../../reference/executionmodel.rst:154 +#: ../../reference/executionmodel.rst:157 msgid "__main__" msgstr "__main__" -#: ../../reference/executionmodel.rst:179 +#: ../../reference/executionmodel.rst:287 msgid "restricted" msgstr "restricted(受限)" -#: ../../reference/executionmodel.rst:226 +#: ../../reference/executionmodel.rst:334 msgid "exception" msgstr "exception(例外)" -#: ../../reference/executionmodel.rst:228 +#: ../../reference/executionmodel.rst:336 msgid "raise an exception" msgstr "raise an exception(引發例外)" -#: ../../reference/executionmodel.rst:228 +#: ../../reference/executionmodel.rst:336 msgid "handle an exception" msgstr "handle an exception(處理例外)" -#: ../../reference/executionmodel.rst:228 +#: ../../reference/executionmodel.rst:336 msgid "exception handler" msgstr "exception handler(例外處理器)" -#: ../../reference/executionmodel.rst:228 +#: ../../reference/executionmodel.rst:336 msgid "errors" msgstr "errors(錯誤)" -#: ../../reference/executionmodel.rst:228 +#: ../../reference/executionmodel.rst:336 msgid "error handling" msgstr "error handling(錯誤處理)" -#: ../../reference/executionmodel.rst:249 +#: ../../reference/executionmodel.rst:357 msgid "termination model" msgstr "termination model(終止模型)" -#: ../../reference/executionmodel.rst:256 +#: ../../reference/executionmodel.rst:364 msgid "SystemExit (built-in exception)" msgstr "SystemExit(內建例外)" diff --git a/reference/expressions.po b/reference/expressions.po index ebb1508065..0da0aafa72 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -645,7 +645,13 @@ msgid "" "*value* may be cleared." msgstr "" -#: ../../reference/expressions.rst:592 +#: ../../reference/expressions.rst:589 ../../reference/expressions.rst:763 +msgid "" +"The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " +"and may be removed in a future version of Python." +msgstr "" + +#: ../../reference/expressions.rst:597 msgid "" "Raises a :exc:`GeneratorExit` at the point where the generator function was " "paused. If the generator function then exits gracefully, is already closed, " @@ -656,34 +662,34 @@ msgid "" "has already exited due to an exception or normal exit." msgstr "" -#: ../../reference/expressions.rst:603 +#: ../../reference/expressions.rst:608 msgid "Examples" msgstr "模組" -#: ../../reference/expressions.rst:605 +#: ../../reference/expressions.rst:610 msgid "" "Here is a simple example that demonstrates the behavior of generators and " "generator functions::" msgstr "" -#: ../../reference/expressions.rst:632 +#: ../../reference/expressions.rst:637 msgid "" "For examples using ``yield from``, see :ref:`pep-380` in \"What's New in " "Python.\"" msgstr "" -#: ../../reference/expressions.rst:638 +#: ../../reference/expressions.rst:643 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/expressions.rst:640 +#: ../../reference/expressions.rst:645 msgid "" "The presence of a yield expression in a function or method defined using :" "keyword:`async def` further defines the function as an :term:`asynchronous " "generator` function." msgstr "" -#: ../../reference/expressions.rst:644 +#: ../../reference/expressions.rst:649 msgid "" "When an asynchronous generator function is called, it returns an " "asynchronous iterator known as an asynchronous generator object. That object " @@ -693,7 +699,7 @@ msgid "" "keyword:`for` statement." msgstr "" -#: ../../reference/expressions.rst:651 +#: ../../reference/expressions.rst:656 msgid "" "Calling one of the asynchronous generator's methods returns an :term:" "`awaitable` object, and the execution starts when this object is awaited on. " @@ -712,7 +718,7 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:666 +#: ../../reference/expressions.rst:671 msgid "" "If an asynchronous generator happens to exit early by :keyword:`break`, the " "caller task being cancelled, or other exceptions, the generator's async " @@ -724,7 +730,7 @@ msgid "" "generator and ultimately detach it from the event loop." msgstr "" -#: ../../reference/expressions.rst:676 +#: ../../reference/expressions.rst:681 msgid "" "In an asynchronous generator function, yield expressions are allowed " "anywhere in a :keyword:`try` construct. However, if an asynchronous " @@ -738,7 +744,7 @@ msgid "" "finally` clauses to execute." msgstr "" -#: ../../reference/expressions.rst:687 +#: ../../reference/expressions.rst:692 msgid "" "To take care of finalization upon event loop termination, an event loop " "should define a *finalizer* function which takes an asynchronous generator-" @@ -751,23 +757,23 @@ msgid "" "asyncio/base_events.py`." msgstr "" -#: ../../reference/expressions.rst:696 +#: ../../reference/expressions.rst:701 msgid "" "The expression ``yield from `` is a syntax error when used in an " "asynchronous generator function." msgstr "" -#: ../../reference/expressions.rst:703 +#: ../../reference/expressions.rst:708 msgid "Asynchronous generator-iterator methods" msgstr "" -#: ../../reference/expressions.rst:705 +#: ../../reference/expressions.rst:710 msgid "" "This subsection describes the methods of an asynchronous generator iterator, " "which are used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:713 +#: ../../reference/expressions.rst:718 msgid "" "Returns an awaitable which when run starts to execute the asynchronous " "generator or resumes it at the last executed yield expression. When an " @@ -782,12 +788,12 @@ msgid "" "has completed." msgstr "" -#: ../../reference/expressions.rst:725 +#: ../../reference/expressions.rst:730 msgid "" "This method is normally called implicitly by a :keyword:`async for` loop." msgstr "" -#: ../../reference/expressions.rst:730 +#: ../../reference/expressions.rst:735 msgid "" "Returns an awaitable which when run resumes the execution of the " "asynchronous generator. As with the :meth:`~generator.send()` method for a " @@ -802,7 +808,7 @@ msgid "" "receive the value." msgstr "" -#: ../../reference/expressions.rst:746 +#: ../../reference/expressions.rst:751 msgid "" "Returns an awaitable that raises an exception of type ``type`` at the point " "where the asynchronous generator was paused, and returns the next value " @@ -814,7 +820,7 @@ msgid "" "that exception propagates to the caller of the awaitable." msgstr "" -#: ../../reference/expressions.rst:761 +#: ../../reference/expressions.rst:771 msgid "" "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " "the asynchronous generator function at the point where it was paused. If the " @@ -830,25 +836,25 @@ msgid "" "will return an awaitable that does nothing." msgstr "" -#: ../../reference/expressions.rst:777 +#: ../../reference/expressions.rst:787 msgid "Primaries" msgstr "" -#: ../../reference/expressions.rst:781 +#: ../../reference/expressions.rst:791 msgid "" "Primaries represent the most tightly bound operations of the language. Their " "syntax is:" msgstr "" -#: ../../reference/expressions.rst:791 +#: ../../reference/expressions.rst:801 msgid "Attribute references" msgstr "" -#: ../../reference/expressions.rst:797 +#: ../../reference/expressions.rst:807 msgid "An attribute reference is a primary followed by a period and a name:" msgstr "" -#: ../../reference/expressions.rst:807 +#: ../../reference/expressions.rst:817 msgid "" "The primary must evaluate to an object of a type that supports attribute " "references, which most objects do. This object is then asked to produce the " @@ -859,11 +865,11 @@ msgid "" "evaluations of the same attribute reference may yield different objects." msgstr "" -#: ../../reference/expressions.rst:819 +#: ../../reference/expressions.rst:829 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:834 +#: ../../reference/expressions.rst:844 msgid "" "The subscription of an instance of a :ref:`container class ` " "will generally select an element from the container. The subscription of a :" @@ -871,13 +877,13 @@ msgid "" "`GenericAlias ` object." msgstr "" -#: ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:852 msgid "" "When an object is subscripted, the interpreter will evaluate the primary and " "the expression list." msgstr "" -#: ../../reference/expressions.rst:845 +#: ../../reference/expressions.rst:855 msgid "" "The primary must evaluate to an object that supports subscription. An object " "may support subscription through defining one or both of :meth:`~object." @@ -887,20 +893,20 @@ msgid "" "called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:852 +#: ../../reference/expressions.rst:862 msgid "" "If the expression list contains at least one comma, it will evaluate to a :" "class:`tuple` containing the items of the expression list. Otherwise, the " "expression list will evaluate to the value of the list's sole member." msgstr "" -#: ../../reference/expressions.rst:856 +#: ../../reference/expressions.rst:866 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:859 +#: ../../reference/expressions.rst:869 msgid "" "Mappings. If the primary is a :term:`mapping`, the expression list must " "evaluate to an object whose value is one of the keys of the mapping, and the " @@ -908,7 +914,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:863 +#: ../../reference/expressions.rst:873 msgid "" "Sequences. If the primary is a :term:`sequence`, the expression list must " "evaluate to an :class:`int` or a :class:`slice` (as discussed in the " @@ -916,7 +922,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:868 +#: ../../reference/expressions.rst:878 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences `. However, built-in sequences all provide a :meth:" @@ -930,25 +936,25 @@ msgid "" "support." msgstr "" -#: ../../reference/expressions.rst:882 +#: ../../reference/expressions.rst:892 msgid "" "A :class:`string ` is a special kind of sequence whose items are " "*characters*. A character is not a separate data type but a string of " "exactly one character." msgstr "" -#: ../../reference/expressions.rst:890 +#: ../../reference/expressions.rst:900 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:904 +#: ../../reference/expressions.rst:914 msgid "" "A slicing selects a range of items in a sequence object (e.g., a string, " "tuple or list). Slicings may be used as expressions or as targets in " "assignment or :keyword:`del` statements. The syntax for a slicing:" msgstr "" -#: ../../reference/expressions.rst:917 +#: ../../reference/expressions.rst:927 msgid "" "There is ambiguity in the formal syntax here: anything that looks like an " "expression list also looks like a slice list, so any subscription can be " @@ -958,7 +964,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:929 +#: ../../reference/expressions.rst:939 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`__getitem__` method as normal subscription) with a key that " @@ -973,23 +979,23 @@ msgid "" "expressions." msgstr "" -#: ../../reference/expressions.rst:953 +#: ../../reference/expressions.rst:963 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:955 +#: ../../reference/expressions.rst:965 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:972 +#: ../../reference/expressions.rst:982 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:978 +#: ../../reference/expressions.rst:988 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " @@ -999,7 +1005,7 @@ msgid "" "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:986 +#: ../../reference/expressions.rst:996 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -1020,7 +1026,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1006 +#: ../../reference/expressions.rst:1016 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1029,7 +1035,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1012 +#: ../../reference/expressions.rst:1022 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1038,7 +1044,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1018 +#: ../../reference/expressions.rst:1028 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -1048,7 +1054,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1029 +#: ../../reference/expressions.rst:1039 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1058,20 +1064,20 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1036 +#: ../../reference/expressions.rst:1046 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1052 +#: ../../reference/expressions.rst:1062 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not often arise." msgstr "" -#: ../../reference/expressions.rst:1058 +#: ../../reference/expressions.rst:1068 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1080,7 +1086,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1064 +#: ../../reference/expressions.rst:1074 msgid "" "When ``**expression`` is used, each key in this mapping must be a string. " "Each value from the mapping is assigned to the first formal parameter " @@ -1092,35 +1098,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1074 +#: ../../reference/expressions.rst:1084 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1077 +#: ../../reference/expressions.rst:1087 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1083 +#: ../../reference/expressions.rst:1093 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1087 +#: ../../reference/expressions.rst:1097 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1100 +#: ../../reference/expressions.rst:1110 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1096 +#: ../../reference/expressions.rst:1106 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1129,73 +1135,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1114 +#: ../../reference/expressions.rst:1124 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1123 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1121 +#: ../../reference/expressions.rst:1131 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1121 +#: ../../reference/expressions.rst:1131 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1131 +#: ../../reference/expressions.rst:1141 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1129 +#: ../../reference/expressions.rst:1139 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1140 +#: ../../reference/expressions.rst:1150 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1138 +#: ../../reference/expressions.rst:1148 msgid "" "The class must define a :meth:`__call__` method; the effect is then the same " "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1146 ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1156 ../../reference/expressions.rst:1937 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1148 +#: ../../reference/expressions.rst:1158 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1160 +#: ../../reference/expressions.rst:1170 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1166 +#: ../../reference/expressions.rst:1176 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1182 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1186 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1203,7 +1209,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1181 +#: ../../reference/expressions.rst:1191 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1211,40 +1217,40 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1186 +#: ../../reference/expressions.rst:1196 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1190 +#: ../../reference/expressions.rst:1200 msgid "" "This operation can be customized using the special :meth:`__pow__` method." msgstr "" -#: ../../reference/expressions.rst:1195 +#: ../../reference/expressions.rst:1205 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1201 +#: ../../reference/expressions.rst:1211 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1212 +#: ../../reference/expressions.rst:1222 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`__neg__` special " "method." msgstr "" -#: ../../reference/expressions.rst:1220 +#: ../../reference/expressions.rst:1230 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1227 +#: ../../reference/expressions.rst:1237 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1252,17 +1258,17 @@ msgid "" "meth:`__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1236 +#: ../../reference/expressions.rst:1246 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1243 +#: ../../reference/expressions.rst:1253 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1247 +#: ../../reference/expressions.rst:1257 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1270,7 +1276,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1262 +#: ../../reference/expressions.rst:1272 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1280,19 +1286,19 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1268 +#: ../../reference/expressions.rst:1278 msgid "" "This operation can be customized using the special :meth:`__mul__` and :meth:" "`__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1285 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1286 +#: ../../reference/expressions.rst:1296 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1302,13 +1308,13 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1293 +#: ../../reference/expressions.rst:1303 msgid "" "This operation can be customized using the special :meth:`__truediv__` and :" "meth:`__floordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1300 +#: ../../reference/expressions.rst:1310 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1320,7 +1326,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1309 +#: ../../reference/expressions.rst:1319 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1328,7 +1334,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1314 +#: ../../reference/expressions.rst:1324 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1337,20 +1343,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1319 +#: ../../reference/expressions.rst:1329 msgid "" "The *modulo* operation can be customized using the special :meth:`__mod__` " "method." msgstr "" -#: ../../reference/expressions.rst:1321 +#: ../../reference/expressions.rst:1331 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1330 +#: ../../reference/expressions.rst:1340 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1358,84 +1364,84 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1345 msgid "" "This operation can be customized using the special :meth:`__add__` and :meth:" "`__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1353 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1346 +#: ../../reference/expressions.rst:1356 msgid "" "This operation can be customized using the special :meth:`__sub__` method." msgstr "" -#: ../../reference/expressions.rst:1352 +#: ../../reference/expressions.rst:1362 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1359 +#: ../../reference/expressions.rst:1369 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1364 +#: ../../reference/expressions.rst:1374 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1367 +#: ../../reference/expressions.rst:1377 msgid "" "This operation can be customized using the special :meth:`__lshift__` and :" "meth:`__rshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1372 +#: ../../reference/expressions.rst:1382 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1379 +#: ../../reference/expressions.rst:1389 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1383 +#: ../../reference/expressions.rst:1393 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1394 +#: ../../reference/expressions.rst:1404 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`__and__` " "or :meth:`__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1403 +#: ../../reference/expressions.rst:1413 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`__xor__` or :meth:`__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1412 +#: ../../reference/expressions.rst:1422 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`__or__` or :meth:`__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1420 +#: ../../reference/expressions.rst:1430 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1432 +#: ../../reference/expressions.rst:1442 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1443,14 +1449,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1442 +#: ../../reference/expressions.rst:1452 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1448 +#: ../../reference/expressions.rst:1458 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1458,7 +1464,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1452 +#: ../../reference/expressions.rst:1462 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1466,24 +1472,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1457 +#: ../../reference/expressions.rst:1467 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1464 +#: ../../reference/expressions.rst:1474 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1466 +#: ../../reference/expressions.rst:1476 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1469 +#: ../../reference/expressions.rst:1479 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1495,7 +1501,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1478 +#: ../../reference/expressions.rst:1488 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1503,7 +1509,7 @@ msgid "" "methods` like :meth:`__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1484 +#: ../../reference/expressions.rst:1494 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1513,14 +1519,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1501 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1495 +#: ../../reference/expressions.rst:1505 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1529,13 +1535,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1501 +#: ../../reference/expressions.rst:1511 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1504 +#: ../../reference/expressions.rst:1514 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1545,7 +1551,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1521 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1555,32 +1561,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1518 +#: ../../reference/expressions.rst:1528 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1522 +#: ../../reference/expressions.rst:1532 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1526 +#: ../../reference/expressions.rst:1536 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1530 +#: ../../reference/expressions.rst:1540 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1532 +#: ../../reference/expressions.rst:1542 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1589,7 +1595,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1548 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1597,19 +1603,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1543 +#: ../../reference/expressions.rst:1553 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1545 +#: ../../reference/expressions.rst:1555 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1550 +#: ../../reference/expressions.rst:1560 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1618,25 +1624,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1556 +#: ../../reference/expressions.rst:1566 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1560 +#: ../../reference/expressions.rst:1570 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1562 +#: ../../reference/expressions.rst:1572 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1565 +#: ../../reference/expressions.rst:1575 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1647,110 +1653,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1573 +#: ../../reference/expressions.rst:1583 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1575 +#: ../../reference/expressions.rst:1585 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1578 +#: ../../reference/expressions.rst:1588 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1581 +#: ../../reference/expressions.rst:1591 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1584 +#: ../../reference/expressions.rst:1594 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1586 +#: ../../reference/expressions.rst:1596 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1589 +#: ../../reference/expressions.rst:1599 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1591 +#: ../../reference/expressions.rst:1601 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1593 +#: ../../reference/expressions.rst:1603 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1595 +#: ../../reference/expressions.rst:1605 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1597 +#: ../../reference/expressions.rst:1607 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1600 +#: ../../reference/expressions.rst:1610 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1602 +#: ../../reference/expressions.rst:1612 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1604 +#: ../../reference/expressions.rst:1614 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1607 +#: ../../reference/expressions.rst:1617 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1609 +#: ../../reference/expressions.rst:1619 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1611 +#: ../../reference/expressions.rst:1621 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1613 +#: ../../reference/expressions.rst:1623 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1617 +#: ../../reference/expressions.rst:1627 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1621 +#: ../../reference/expressions.rst:1631 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1630 +#: ../../reference/expressions.rst:1640 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1632 +#: ../../reference/expressions.rst:1642 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1761,7 +1767,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1640 +#: ../../reference/expressions.rst:1650 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1769,14 +1775,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1645 +#: ../../reference/expressions.rst:1655 msgid "" "For user-defined classes which define the :meth:`__contains__` method, ``x " "in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1649 +#: ../../reference/expressions.rst:1659 msgid "" "For user-defined classes which do not define :meth:`__contains__` but do " "define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " @@ -1785,7 +1791,7 @@ msgid "" "as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1655 +#: ../../reference/expressions.rst:1665 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " @@ -1794,17 +1800,17 @@ msgid "" "raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1667 +#: ../../reference/expressions.rst:1677 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1690 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1682 +#: ../../reference/expressions.rst:1692 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1812,11 +1818,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1694 +#: ../../reference/expressions.rst:1704 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1705 +#: ../../reference/expressions.rst:1715 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1827,25 +1833,25 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:1714 +#: ../../reference/expressions.rst:1724 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1719 +#: ../../reference/expressions.rst:1729 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1724 +#: ../../reference/expressions.rst:1734 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1727 +#: ../../reference/expressions.rst:1737 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1856,11 +1862,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1743 +#: ../../reference/expressions.rst:1753 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1748 +#: ../../reference/expressions.rst:1758 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1868,15 +1874,15 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1753 +#: ../../reference/expressions.rst:1763 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1760 +#: ../../reference/expressions.rst:1770 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1767 +#: ../../reference/expressions.rst:1777 msgid "" "Assignment expressions must be surrounded by parentheses when used as sub-" "expressions in slicing, conditional, lambda, keyword-argument, and " @@ -1885,36 +1891,36 @@ msgid "" "including in ``if`` and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1774 +#: ../../reference/expressions.rst:1784 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1781 +#: ../../reference/expressions.rst:1791 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1803 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1796 +#: ../../reference/expressions.rst:1806 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:1810 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1807 +#: ../../reference/expressions.rst:1817 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1818 +#: ../../reference/expressions.rst:1828 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1922,25 +1928,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1827 +#: ../../reference/expressions.rst:1837 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1835 +#: ../../reference/expressions.rst:1845 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1859 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1858 +#: ../../reference/expressions.rst:1868 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1948,12 +1954,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1863 +#: ../../reference/expressions.rst:1873 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1868 +#: ../../reference/expressions.rst:1878 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1962,28 +1968,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1878 +#: ../../reference/expressions.rst:1888 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1892 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1885 +#: ../../reference/expressions.rst:1895 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1899 +#: ../../reference/expressions.rst:1909 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1914 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1993,176 +1999,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1920 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1926 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1926 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1928 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1930 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1928 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1934 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1934 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1937 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1939 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1939 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:1941 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:1941 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1943 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1943 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1947 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1947 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1949 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1949 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1951 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1951 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1953 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1953 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1955 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1955 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1957 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1947 +#: ../../reference/expressions.rst:1957 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1951 +#: ../../reference/expressions.rst:1961 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1951 +#: ../../reference/expressions.rst:1961 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1953 +#: ../../reference/expressions.rst:1963 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1953 +#: ../../reference/expressions.rst:1963 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1965 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1965 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1967 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1967 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1969 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1969 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1971 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1971 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1966 +#: ../../reference/expressions.rst:1976 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1977 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2174,7 +2180,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1986 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2182,7 +2188,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1991 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2196,7 +2202,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1992 +#: ../../reference/expressions.rst:2002 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2204,13 +2210,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:2007 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:2000 +#: ../../reference/expressions.rst:2010 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2218,22 +2224,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2005 +#: ../../reference/expressions.rst:2015 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2018 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1696 -#: ../../reference/expressions.rst:1783 ../../reference/expressions.rst:1809 -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1706 +#: ../../reference/expressions.rst:1793 ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1847 #, fuzzy msgid "expression" msgstr "``(expressions...)``," @@ -2242,8 +2248,8 @@ msgstr "``(expressions...)``," msgid "BNF" msgstr "" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1197 -#: ../../reference/expressions.rst:1245 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1207 +#: ../../reference/expressions.rst:1255 msgid "arithmetic" msgstr "" @@ -2264,10 +2270,10 @@ msgid "identifier" msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:537 -#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:709 -#: ../../reference/expressions.rst:756 ../../reference/expressions.rst:802 -#: ../../reference/expressions.rst:1234 ../../reference/expressions.rst:1280 -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:592 ../../reference/expressions.rst:714 +#: ../../reference/expressions.rst:766 ../../reference/expressions.rst:812 +#: ../../reference/expressions.rst:1244 ../../reference/expressions.rst:1290 +#: ../../reference/expressions.rst:1380 #, fuzzy msgid "exception" msgstr "描述" @@ -2307,12 +2313,12 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:117 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 #: ../../reference/expressions.rst:341 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:525 ../../reference/expressions.rst:699 -#: ../../reference/expressions.rst:802 ../../reference/expressions.rst:825 -#: ../../reference/expressions.rst:898 ../../reference/expressions.rst:942 -#: ../../reference/expressions.rst:1090 ../../reference/expressions.rst:1103 -#: ../../reference/expressions.rst:1117 ../../reference/expressions.rst:1124 -#: ../../reference/expressions.rst:1661 ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:525 ../../reference/expressions.rst:704 +#: ../../reference/expressions.rst:812 ../../reference/expressions.rst:835 +#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:1100 ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1127 ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:1671 ../../reference/expressions.rst:1857 msgid "object" msgstr "object(物件)" @@ -2321,7 +2327,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:133 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:952 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2333,19 +2339,19 @@ msgstr "" msgid "empty" msgstr "" -#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:825 -#: ../../reference/expressions.rst:898 ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:835 +#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:1857 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1876 msgid "comma" msgstr "" #: ../../reference/expressions.rst:152 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 -#: ../../reference/expressions.rst:892 ../../reference/expressions.rst:942 -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:902 ../../reference/expressions.rst:952 +#: ../../reference/expressions.rst:1847 msgid ", (comma)" msgstr ", (逗號)" @@ -2362,7 +2368,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1793 msgid "if" msgstr "if" @@ -2370,13 +2376,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1142 +#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1152 msgid "await" msgstr "await" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:802 -#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:898 -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:812 +#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:1847 msgid "list" msgstr "list(串列)" @@ -2385,7 +2391,7 @@ msgstr "list(串列)" msgid "display" msgstr "" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:821 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:831 msgid "[] (square brackets)" msgstr "[] (方括號)" @@ -2394,7 +2400,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:1847 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2411,7 +2417,7 @@ msgid "set expression" msgstr "set expression(集合運算式)" #: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 -#: ../../reference/expressions.rst:825 +#: ../../reference/expressions.rst:835 msgid "dictionary" msgstr "dictionary(字典)" @@ -2431,8 +2437,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:892 -#: ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:902 +#: ../../reference/expressions.rst:1819 msgid ": (colon)" msgstr ": (冒號)" @@ -2444,13 +2450,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1025 -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1035 +#: ../../reference/expressions.rst:1864 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1055 -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1065 +#: ../../reference/expressions.rst:1172 msgid "**" msgstr "**" @@ -2467,11 +2473,11 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1142 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1152 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:600 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:605 msgid "yield" msgstr "yield" @@ -2479,8 +2485,8 @@ msgstr "yield" msgid "from" msgstr "from" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1090 -#: ../../reference/expressions.rst:1103 ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1100 +#: ../../reference/expressions.rst:1113 ../../reference/expressions.rst:1819 msgid "function" msgstr "function (函式)" @@ -2496,499 +2502,502 @@ msgstr "yield from expression(yield from 運算式)" msgid "StopIteration" msgstr "StopIteration" -#: ../../reference/expressions.rst:587 ../../reference/expressions.rst:756 +#: ../../reference/expressions.rst:592 ../../reference/expressions.rst:766 msgid "GeneratorExit" msgstr "GeneratorExit" -#: ../../reference/expressions.rst:600 +#: ../../reference/expressions.rst:605 msgid "examples" msgstr "範例" -#: ../../reference/expressions.rst:699 +#: ../../reference/expressions.rst:704 msgid "asynchronous-generator" msgstr "asynchronous-generator(非同步產生器)" -#: ../../reference/expressions.rst:709 +#: ../../reference/expressions.rst:714 msgid "StopAsyncIteration" msgstr "StopAsyncIteration" -#: ../../reference/expressions.rst:779 +#: ../../reference/expressions.rst:789 msgid "primary" msgstr "primary(主要)" -#: ../../reference/expressions.rst:793 +#: ../../reference/expressions.rst:803 msgid "attribute" msgstr "attribute(屬性)" -#: ../../reference/expressions.rst:793 +#: ../../reference/expressions.rst:803 msgid "reference" msgstr "reference(參照)" -#: ../../reference/expressions.rst:793 +#: ../../reference/expressions.rst:803 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/expressions.rst:793 +#: ../../reference/expressions.rst:803 msgid "attribute reference" msgstr "attribute reference(屬性參照)" -#: ../../reference/expressions.rst:802 +#: ../../reference/expressions.rst:812 msgid "AttributeError" msgstr "AttributeError" -#: ../../reference/expressions.rst:802 +#: ../../reference/expressions.rst:812 msgid "module" msgstr "module(模組)" -#: ../../reference/expressions.rst:821 +#: ../../reference/expressions.rst:831 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:898 -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:1671 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/expressions.rst:825 +#: ../../reference/expressions.rst:835 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:878 -#: ../../reference/expressions.rst:898 +#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:888 +#: ../../reference/expressions.rst:908 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:825 ../../reference/expressions.rst:878 +#: ../../reference/expressions.rst:835 ../../reference/expressions.rst:888 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:878 +#: ../../reference/expressions.rst:888 msgid "character" msgstr "character(字元)" -#: ../../reference/expressions.rst:892 +#: ../../reference/expressions.rst:902 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:892 +#: ../../reference/expressions.rst:902 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:924 +#: ../../reference/expressions.rst:934 msgid "start (slice object attribute)" msgstr "start(切片物件屬性)" -#: ../../reference/expressions.rst:924 +#: ../../reference/expressions.rst:934 msgid "stop (slice object attribute)" msgstr "stop(切片物件屬性)" -#: ../../reference/expressions.rst:924 +#: ../../reference/expressions.rst:934 msgid "step (slice object attribute)" msgstr "step(切片物件屬性)" -#: ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:952 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1090 -#: ../../reference/expressions.rst:1103 ../../reference/expressions.rst:1117 -#: ../../reference/expressions.rst:1124 ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:1100 +#: ../../reference/expressions.rst:1113 ../../reference/expressions.rst:1127 +#: ../../reference/expressions.rst:1134 ../../reference/expressions.rst:1144 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:952 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:975 +#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:985 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:952 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:942 +#: ../../reference/expressions.rst:952 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/expressions.rst:942 ../../reference/expressions.rst:1025 -#: ../../reference/expressions.rst:1055 +#: ../../reference/expressions.rst:952 ../../reference/expressions.rst:1035 +#: ../../reference/expressions.rst:1065 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:975 +#: ../../reference/expressions.rst:985 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1025 ../../reference/expressions.rst:1258 -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1035 ../../reference/expressions.rst:1268 +#: ../../reference/expressions.rst:1864 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1090 +#: ../../reference/expressions.rst:1100 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1090 +#: ../../reference/expressions.rst:1100 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1113 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1113 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1113 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1117 +#: ../../reference/expressions.rst:1127 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1117 +#: ../../reference/expressions.rst:1127 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1124 +#: ../../reference/expressions.rst:1134 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1124 ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:1134 ../../reference/expressions.rst:1144 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:1144 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1172 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1197 -#: ../../reference/expressions.rst:1245 ../../reference/expressions.rst:1354 -#: ../../reference/expressions.rst:1381 ../../reference/expressions.rst:1696 +#: ../../reference/expressions.rst:1172 ../../reference/expressions.rst:1207 +#: ../../reference/expressions.rst:1255 ../../reference/expressions.rst:1364 +#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1706 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1206 -#: ../../reference/expressions.rst:1215 ../../reference/expressions.rst:1223 -#: ../../reference/expressions.rst:1258 ../../reference/expressions.rst:1271 -#: ../../reference/expressions.rst:1280 ../../reference/expressions.rst:1296 -#: ../../reference/expressions.rst:1325 ../../reference/expressions.rst:1338 -#: ../../reference/expressions.rst:1354 ../../reference/expressions.rst:1390 -#: ../../reference/expressions.rst:1398 ../../reference/expressions.rst:1407 -#: ../../reference/expressions.rst:1422 ../../reference/expressions.rst:1661 -#: ../../reference/expressions.rst:1670 ../../reference/expressions.rst:1712 -#: ../../reference/expressions.rst:1717 ../../reference/expressions.rst:1722 -#: ../../reference/expressions.rst:1783 ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1172 ../../reference/expressions.rst:1216 +#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1233 +#: ../../reference/expressions.rst:1268 ../../reference/expressions.rst:1281 +#: ../../reference/expressions.rst:1290 ../../reference/expressions.rst:1306 +#: ../../reference/expressions.rst:1335 ../../reference/expressions.rst:1348 +#: ../../reference/expressions.rst:1364 ../../reference/expressions.rst:1400 +#: ../../reference/expressions.rst:1408 ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1432 ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1680 ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1727 ../../reference/expressions.rst:1732 +#: ../../reference/expressions.rst:1793 ../../reference/expressions.rst:1911 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1207 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1197 ../../reference/expressions.rst:1381 -#: ../../reference/expressions.rst:1390 ../../reference/expressions.rst:1398 -#: ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1207 ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1400 ../../reference/expressions.rst:1408 +#: ../../reference/expressions.rst:1417 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1206 +#: ../../reference/expressions.rst:1216 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1206 +#: ../../reference/expressions.rst:1216 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1216 ../../reference/expressions.rst:1348 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:1215 +#: ../../reference/expressions.rst:1216 ../../reference/expressions.rst:1225 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1215 +#: ../../reference/expressions.rst:1225 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1215 ../../reference/expressions.rst:1325 +#: ../../reference/expressions.rst:1225 ../../reference/expressions.rst:1335 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1223 +#: ../../reference/expressions.rst:1233 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1223 +#: ../../reference/expressions.rst:1233 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1234 +#: ../../reference/expressions.rst:1244 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1245 ../../reference/expressions.rst:1381 +#: ../../reference/expressions.rst:1255 ../../reference/expressions.rst:1391 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1268 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1281 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1271 +#: ../../reference/expressions.rst:1281 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1290 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1290 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1290 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1290 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1306 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1306 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1325 +#: ../../reference/expressions.rst:1335 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1325 ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1335 ../../reference/expressions.rst:1348 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1348 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1364 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1364 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1364 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1380 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1390 ../../reference/expressions.rst:1717 +#: ../../reference/expressions.rst:1400 ../../reference/expressions.rst:1727 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1390 +#: ../../reference/expressions.rst:1400 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1408 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1408 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1398 ../../reference/expressions.rst:1407 -#: ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1408 ../../reference/expressions.rst:1417 +#: ../../reference/expressions.rst:1732 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1408 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1417 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1417 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1432 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1446 +#: ../../reference/expressions.rst:1456 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1446 +#: ../../reference/expressions.rst:1456 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1671 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1671 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1671 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1661 ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1671 ../../reference/expressions.rst:1680 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1680 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1680 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1670 +#: ../../reference/expressions.rst:1680 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1696 +#: ../../reference/expressions.rst:1706 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1696 +#: ../../reference/expressions.rst:1706 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1722 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1746 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1746 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1746 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1746 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1793 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1793 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1793 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1793 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:1819 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:1819 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:1819 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1809 +#: ../../reference/expressions.rst:1819 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1864 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1864 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1876 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1890 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1890 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1911 msgid "precedence" msgstr "precedence(優先順序)" + +#~ msgid "datum" +#~ msgstr "datum(資料元)" diff --git a/reference/import.po b/reference/import.po index 0dd9230391..a1884e2a73 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -416,39 +416,43 @@ msgstr "" #: ../../reference/import.rst:325 msgid "" "The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path " -"finders replaced :meth:`~importlib.abc.MetaPathFinder.find_module`, which is " -"now deprecated. While it will continue to work without change, the import " -"machinery will try it only if the finder does not implement ``find_spec()``." +"finders replaced :meth:`!find_module`, which is now deprecated. While it " +"will continue to work without change, the import machinery will try it only " +"if the finder does not implement ``find_spec()``." msgstr "" #: ../../reference/import.rst:332 msgid "" -"Use of :meth:`~importlib.abc.MetaPathFinder.find_module` by the import " -"system now raises :exc:`ImportWarning`." +"Use of :meth:`!find_module` by the import system now raises :exc:" +"`ImportWarning`." msgstr "" -#: ../../reference/import.rst:338 +#: ../../reference/import.rst:336 +msgid "``find_module()`` has been removed. Use :meth:`find_spec` instead." +msgstr "" + +#: ../../reference/import.rst:341 msgid "Loading" msgstr "" -#: ../../reference/import.rst:340 +#: ../../reference/import.rst:343 msgid "" "If and when a module spec is found, the import machinery will use it (and " "the loader it contains) when loading the module. Here is an approximation " "of what happens during the loading portion of import::" msgstr "" -#: ../../reference/import.rst:374 +#: ../../reference/import.rst:376 msgid "Note the following details:" msgstr "" -#: ../../reference/import.rst:376 +#: ../../reference/import.rst:378 msgid "" "If there is an existing module object with the given name in :data:`sys." "modules`, import will have already returned it." msgstr "" -#: ../../reference/import.rst:379 +#: ../../reference/import.rst:381 msgid "" "The module will exist in :data:`sys.modules` before the loader executes the " "module code. This is crucial because the module code may (directly or " @@ -457,7 +461,7 @@ msgid "" "best." msgstr "" -#: ../../reference/import.rst:385 +#: ../../reference/import.rst:387 msgid "" "If loading fails, the failing module -- and only the failing module -- gets " "removed from :data:`sys.modules`. Any module already in the :data:`sys." @@ -466,7 +470,7 @@ msgid "" "the failing module is left in :data:`sys.modules`." msgstr "" -#: ../../reference/import.rst:391 +#: ../../reference/import.rst:393 msgid "" "After the module is created but before execution, the import machinery sets " "the import-related module attributes (\"_init_module_attrs\" in the pseudo-" @@ -474,31 +478,31 @@ msgid "" "attrs>`." msgstr "" -#: ../../reference/import.rst:396 +#: ../../reference/import.rst:398 msgid "" "Module execution is the key moment of loading in which the module's " "namespace gets populated. Execution is entirely delegated to the loader, " "which gets to decide what gets populated and how." msgstr "" -#: ../../reference/import.rst:400 +#: ../../reference/import.rst:402 msgid "" "The module created during loading and passed to exec_module() may not be the " "one returned at the end of import [#fnlo]_." msgstr "" -#: ../../reference/import.rst:403 +#: ../../reference/import.rst:405 msgid "" "The import system has taken over the boilerplate responsibilities of " "loaders. These were previously performed by the :meth:`importlib.abc.Loader." "load_module` method." msgstr "" -#: ../../reference/import.rst:409 +#: ../../reference/import.rst:411 msgid "Loaders" msgstr "" -#: ../../reference/import.rst:411 +#: ../../reference/import.rst:413 msgid "" "Module loaders provide the critical function of loading: module execution. " "The import machinery calls the :meth:`importlib.abc.Loader.exec_module` " @@ -506,32 +510,32 @@ msgid "" "returned from :meth:`~importlib.abc.Loader.exec_module` is ignored." msgstr "" -#: ../../reference/import.rst:416 +#: ../../reference/import.rst:418 msgid "Loaders must satisfy the following requirements:" msgstr "" -#: ../../reference/import.rst:418 +#: ../../reference/import.rst:420 msgid "" "If the module is a Python module (as opposed to a built-in module or a " "dynamically loaded extension), the loader should execute the module's code " "in the module's global name space (``module.__dict__``)." msgstr "" -#: ../../reference/import.rst:422 +#: ../../reference/import.rst:424 msgid "" "If the loader cannot execute the module, it should raise an :exc:" "`ImportError`, although any other exception raised during :meth:`~importlib." "abc.Loader.exec_module` will be propagated." msgstr "" -#: ../../reference/import.rst:426 +#: ../../reference/import.rst:428 msgid "" "In many cases, the finder and loader can be the same object; in such cases " "the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return " "a spec with the loader set to ``self``." msgstr "" -#: ../../reference/import.rst:430 +#: ../../reference/import.rst:432 msgid "" "Module loaders may opt in to creating the module object during loading by " "implementing a :meth:`~importlib.abc.Loader.create_module` method. It takes " @@ -541,18 +545,18 @@ msgid "" "will create the new module itself." msgstr "" -#: ../../reference/import.rst:437 +#: ../../reference/import.rst:439 msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders." msgstr "" -#: ../../reference/import.rst:440 +#: ../../reference/import.rst:442 msgid "" "The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:" "`~importlib.abc.Loader.exec_module` and the import machinery assumed all the " "boilerplate responsibilities of loading." msgstr "" -#: ../../reference/import.rst:445 +#: ../../reference/import.rst:447 msgid "" "For compatibility with existing loaders, the import machinery will use the " "``load_module()`` method of loaders if it exists and the loader does not " @@ -560,14 +564,14 @@ msgid "" "deprecated and loaders should implement ``exec_module()`` instead." msgstr "" -#: ../../reference/import.rst:450 +#: ../../reference/import.rst:452 msgid "" "The ``load_module()`` method must implement all the boilerplate loading " "functionality described above in addition to executing the module. All the " "same constraints apply, with some additional clarification:" msgstr "" -#: ../../reference/import.rst:454 +#: ../../reference/import.rst:456 msgid "" "If there is an existing module object with the given name in :data:`sys." "modules`, the loader must use that existing module. (Otherwise, :func:" @@ -576,40 +580,40 @@ msgid "" "add it to :data:`sys.modules`." msgstr "" -#: ../../reference/import.rst:460 +#: ../../reference/import.rst:462 msgid "" "The module *must* exist in :data:`sys.modules` before the loader executes " "the module code, to prevent unbounded recursion or multiple loading." msgstr "" -#: ../../reference/import.rst:464 +#: ../../reference/import.rst:466 msgid "" "If loading fails, the loader must remove any modules it has inserted into :" "data:`sys.modules`, but it must remove **only** the failing module(s), and " "only if the loader itself has loaded the module(s) explicitly." msgstr "" -#: ../../reference/import.rst:469 +#: ../../reference/import.rst:471 msgid "" "A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -#: ../../reference/import.rst:473 +#: ../../reference/import.rst:475 msgid "" "An :exc:`ImportError` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -#: ../../reference/import.rst:477 +#: ../../reference/import.rst:479 msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:481 +#: ../../reference/import.rst:483 msgid "Submodules" msgstr "" -#: ../../reference/import.rst:483 +#: ../../reference/import.rst:485 msgid "" "When a submodule is loaded using any mechanism (e.g. ``importlib`` APIs, the " "``import`` or ``import-from`` statements, or built-in ``__import__()``) a " @@ -619,17 +623,17 @@ msgid "" "submodule. Let's say you have the following directory structure::" msgstr "" -#: ../../reference/import.rst:494 +#: ../../reference/import.rst:496 msgid "and ``spam/__init__.py`` has the following line in it::" msgstr "" -#: ../../reference/import.rst:498 +#: ../../reference/import.rst:500 msgid "" "then executing the following puts name bindings for ``foo`` and ``Foo`` in " "the ``spam`` module::" msgstr "" -#: ../../reference/import.rst:507 +#: ../../reference/import.rst:509 msgid "" "Given Python's familiar name binding rules this might seem surprising, but " "it's actually a fundamental feature of the import system. The invariant " @@ -638,11 +642,11 @@ msgid "" "``foo`` attribute of the former." msgstr "" -#: ../../reference/import.rst:514 +#: ../../reference/import.rst:516 msgid "Module spec" msgstr "" -#: ../../reference/import.rst:516 +#: ../../reference/import.rst:518 msgid "" "The import machinery uses a variety of information about each module during " "import, especially before loading. Most of the information is common to all " @@ -650,7 +654,7 @@ msgid "" "related information on a per-module basis." msgstr "" -#: ../../reference/import.rst:521 +#: ../../reference/import.rst:523 msgid "" "Using a spec during import allows state to be transferred between import " "system components, e.g. between the finder that creates the module spec and " @@ -659,18 +663,18 @@ msgid "" "a module spec the loader had that responsibility." msgstr "" -#: ../../reference/import.rst:527 +#: ../../reference/import.rst:529 msgid "" "The module's spec is exposed as the ``__spec__`` attribute on a module " "object. See :class:`~importlib.machinery.ModuleSpec` for details on the " "contents of the module spec." msgstr "" -#: ../../reference/import.rst:536 +#: ../../reference/import.rst:538 msgid "Import-related module attributes" msgstr "" -#: ../../reference/import.rst:538 +#: ../../reference/import.rst:540 msgid "" "The import machinery fills in these attributes on each module object during " "loading, based on the module's spec, before the loader executes the module." @@ -678,12 +682,18 @@ msgstr "" #: ../../reference/import.rst:544 msgid "" +"It is **strongly** recommended that you rely on :attr:`__spec__` and its " +"attributes instead of any of the other individual attributes listed below." +msgstr "" + +#: ../../reference/import.rst:550 +msgid "" "The ``__name__`` attribute must be set to the fully qualified name of the " "module. This name is used to uniquely identify the module in the import " "system." msgstr "" -#: ../../reference/import.rst:550 +#: ../../reference/import.rst:556 msgid "" "The ``__loader__`` attribute must be set to the loader object that the " "import machinery used when loading the module. This is mostly for " @@ -691,9 +701,22 @@ msgid "" "for example getting data associated with a loader." msgstr "" -#: ../../reference/import.rst:557 +#: ../../reference/import.rst:561 ../../reference/import.rst:582 +msgid "" +"It is **strongly** recommended that you rely on :attr:`__spec__` instead " +"instead of this attribute." +msgstr "" + +#: ../../reference/import.rst:564 +msgid "" +"The value of ``__loader__`` is expected to be the same as ``__spec__." +"loader``. The use of ``__loader__`` is deprecated and slated for removal in " +"Python 3.14." +msgstr "" + +#: ../../reference/import.rst:571 msgid "" -"The module's ``__package__`` attribute must be set. Its value must be a " +"The module's ``__package__`` attribute may be set. Its value must be a " "string, but it can be the same value as its ``__name__``. When the module " "is a package, its ``__package__`` value should be set to its ``__name__``. " "When the module is not a package, ``__package__`` should be set to the empty " @@ -701,20 +724,31 @@ msgid "" "name. See :pep:`366` for further details." msgstr "" -#: ../../reference/import.rst:565 +#: ../../reference/import.rst:579 msgid "" "This attribute is used instead of ``__name__`` to calculate explicit " -"relative imports for main modules, as defined in :pep:`366`. It is expected " -"to have the same value as ``__spec__.parent``." +"relative imports for main modules, as defined in :pep:`366`." msgstr "" -#: ../../reference/import.rst:569 +#: ../../reference/import.rst:585 msgid "" "The value of ``__package__`` is expected to be the same as ``__spec__." "parent``." msgstr "" -#: ../../reference/import.rst:575 +#: ../../reference/import.rst:589 +msgid "" +":exc:`ImportWarning` is raised if import falls back to ``__package__`` " +"instead of :attr:`~importlib.machinery.ModuleSpec.parent`." +msgstr "" + +#: ../../reference/import.rst:594 +msgid "" +"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " +"back to ``__package__``." +msgstr "" + +#: ../../reference/import.rst:601 msgid "" "The ``__spec__`` attribute must be set to the module spec that was used when " "importing the module. Setting ``__spec__`` appropriately applies equally to :" @@ -723,19 +757,18 @@ msgid "" "cases `." msgstr "" -#: ../../reference/import.rst:581 +#: ../../reference/import.rst:607 msgid "" -"When ``__package__`` is not defined, ``__spec__.parent`` is used as a " -"fallback." +"When ``__spec__.parent`` is not set, ``__package__`` is used as a fallback." msgstr "" -#: ../../reference/import.rst:586 +#: ../../reference/import.rst:612 msgid "" "``__spec__.parent`` is used as a fallback when ``__package__`` is not " "defined." msgstr "" -#: ../../reference/import.rst:592 +#: ../../reference/import.rst:618 msgid "" "If the module is a package (either regular or namespace), the module " "object's ``__path__`` attribute must be set. The value must be iterable, " @@ -745,11 +778,11 @@ msgid "" "rules>`." msgstr "" -#: ../../reference/import.rst:599 +#: ../../reference/import.rst:625 msgid "Non-package modules should not have a ``__path__`` attribute." msgstr "" -#: ../../reference/import.rst:604 +#: ../../reference/import.rst:630 msgid "" "``__file__`` is optional (if set, value must be a string). It indicates the " "pathname of the file from which the module was loaded (if loaded from a " @@ -760,7 +793,7 @@ msgid "" "semantic meaning (e.g. a module loaded from a database)." msgstr "" -#: ../../reference/import.rst:613 +#: ../../reference/import.rst:639 msgid "" "If ``__file__`` is set then the ``__cached__`` attribute might also be set, " "which is the path to any compiled version of the code (e.g. byte-compiled " @@ -768,7 +801,7 @@ msgid "" "simply point to where the compiled file would exist (see :pep:`3147`)." msgstr "" -#: ../../reference/import.rst:619 +#: ../../reference/import.rst:645 msgid "" "Note that ``__cached__`` may be set even if ``__file__`` is not set. " "However, that scenario is quite atypical. Ultimately, the loader is what " @@ -778,16 +811,22 @@ msgid "" "be appropriate." msgstr "" -#: ../../reference/import.rst:629 +#: ../../reference/import.rst:652 +msgid "" +"It is **strongly** recommended that you rely on :attr:`__spec__` instead " +"instead of ``__cached__``." +msgstr "" + +#: ../../reference/import.rst:658 msgid "module.__path__" msgstr "module.__path__" -#: ../../reference/import.rst:631 +#: ../../reference/import.rst:660 msgid "" "By definition, if a module has a ``__path__`` attribute, it is a package." msgstr "" -#: ../../reference/import.rst:633 +#: ../../reference/import.rst:662 msgid "" "A package's ``__path__`` attribute is used during imports of its " "subpackages. Within the import machinery, it functions much the same as :" @@ -796,7 +835,7 @@ msgid "" "than :data:`sys.path`." msgstr "" -#: ../../reference/import.rst:639 +#: ../../reference/import.rst:668 msgid "" "``__path__`` must be an iterable of strings, but it may be empty. The same " "rules used for :data:`sys.path` also apply to a package's ``__path__``, and :" @@ -804,7 +843,7 @@ msgid "" "package's ``__path__``." msgstr "" -#: ../../reference/import.rst:644 +#: ../../reference/import.rst:673 msgid "" "A package's ``__init__.py`` file may set or alter the package's ``__path__`` " "attribute, and this was typically the way namespace packages were " @@ -814,18 +853,18 @@ msgid "" "``__path__`` correctly for the namespace package." msgstr "" -#: ../../reference/import.rst:652 +#: ../../reference/import.rst:681 msgid "Module reprs" msgstr "" -#: ../../reference/import.rst:654 +#: ../../reference/import.rst:683 msgid "" "By default, all modules have a usable repr, however depending on the " "attributes set above, and in the module's spec, you can more explicitly " "control the repr of module objects." msgstr "" -#: ../../reference/import.rst:658 +#: ../../reference/import.rst:687 msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " @@ -835,61 +874,45 @@ msgid "" "for whatever information is missing." msgstr "" -#: ../../reference/import.rst:665 +#: ../../reference/import.rst:694 msgid "Here are the exact rules used:" msgstr "" -#: ../../reference/import.rst:667 +#: ../../reference/import.rst:696 msgid "" "If the module has a ``__spec__`` attribute, the information in the spec is " "used to generate the repr. The \"name\", \"loader\", \"origin\", and " "\"has_location\" attributes are consulted." msgstr "" -#: ../../reference/import.rst:671 +#: ../../reference/import.rst:700 msgid "" "If the module has a ``__file__`` attribute, this is used as part of the " "module's repr." msgstr "" -#: ../../reference/import.rst:674 +#: ../../reference/import.rst:703 msgid "" "If the module has no ``__file__`` but does have a ``__loader__`` that is not " "``None``, then the loader's repr is used as part of the module's repr." msgstr "" -#: ../../reference/import.rst:677 +#: ../../reference/import.rst:706 msgid "Otherwise, just use the module's ``__name__`` in the repr." msgstr "" -#: ../../reference/import.rst:679 -msgid "" -"Use of :meth:`loader.module_repr() ` has " -"been deprecated and the module spec is now used by the import machinery to " -"generate a module repr." -msgstr "" - -#: ../../reference/import.rst:684 -msgid "" -"For backward compatibility with Python 3.3, the module repr will be " -"generated by calling the loader's :meth:`~importlib.abc.Loader.module_repr` " -"method, if defined, before trying either approach described above. However, " -"the method is deprecated." -msgstr "" - -#: ../../reference/import.rst:691 +#: ../../reference/import.rst:708 msgid "" -"Calling :meth:`~importlib.abc.Loader.module_repr` now occurs after trying to " -"use a module's ``__spec__`` attribute but before falling back on " -"``__file__``. Use of :meth:`~importlib.abc.Loader.module_repr` is slated to " -"stop in Python 3.12." +"Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was " +"removed in Python 3.12 and is no longer called during the resolution of a " +"module's repr." msgstr "" -#: ../../reference/import.rst:699 +#: ../../reference/import.rst:716 msgid "Cached bytecode invalidation" msgstr "" -#: ../../reference/import.rst:701 +#: ../../reference/import.rst:718 msgid "" "Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " @@ -899,7 +922,7 @@ msgid "" "source's metadata." msgstr "" -#: ../../reference/import.rst:708 +#: ../../reference/import.rst:725 msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " @@ -913,17 +936,17 @@ msgid "" "option:`--check-hash-based-pycs` flag." msgstr "" -#: ../../reference/import.rst:719 +#: ../../reference/import.rst:736 msgid "" "Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-" "based invalidation of bytecode caches." msgstr "" -#: ../../reference/import.rst:725 +#: ../../reference/import.rst:742 msgid "The Path Based Finder" msgstr "" -#: ../../reference/import.rst:730 +#: ../../reference/import.rst:747 msgid "" "As mentioned previously, Python comes with several default meta path " "finders. One of these, called the :term:`path based finder` (:class:" @@ -932,14 +955,14 @@ msgid "" "a location to search for modules." msgstr "" -#: ../../reference/import.rst:736 +#: ../../reference/import.rst:753 msgid "" "The path based finder itself doesn't know how to import anything. Instead, " "it traverses the individual path entries, associating each of them with a " "path entry finder that knows how to handle that particular kind of path." msgstr "" -#: ../../reference/import.rst:740 +#: ../../reference/import.rst:757 msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " @@ -950,14 +973,14 @@ msgid "" "from zipfiles." msgstr "" -#: ../../reference/import.rst:747 +#: ../../reference/import.rst:764 msgid "" "Path entries need not be limited to file system locations. They can refer " "to URLs, database queries, or any other location that can be specified as a " "string." msgstr "" -#: ../../reference/import.rst:751 +#: ../../reference/import.rst:768 msgid "" "The path based finder provides additional hooks and protocols so that you " "can extend and customize the types of searchable path entries. For example, " @@ -968,7 +991,7 @@ msgid "" "from the web." msgstr "" -#: ../../reference/import.rst:759 +#: ../../reference/import.rst:776 msgid "" "A word of warning: this section and the previous both use the term *finder*, " "distinguishing between them by using the terms :term:`meta path finder` and :" @@ -979,7 +1002,7 @@ msgid "" "process, as keyed off the :data:`sys.meta_path` traversal." msgstr "" -#: ../../reference/import.rst:767 +#: ../../reference/import.rst:784 msgid "" "By contrast, path entry finders are in a sense an implementation detail of " "the path based finder, and in fact, if the path based finder were to be " @@ -987,11 +1010,11 @@ msgid "" "would be invoked." msgstr "" -#: ../../reference/import.rst:774 +#: ../../reference/import.rst:791 msgid "Path entry finders" msgstr "" -#: ../../reference/import.rst:782 +#: ../../reference/import.rst:799 msgid "" "The :term:`path based finder` is responsible for finding and loading Python " "modules and packages whose location is specified with a string :term:`path " @@ -999,7 +1022,7 @@ msgid "" "not be limited to this." msgstr "" -#: ../../reference/import.rst:787 +#: ../../reference/import.rst:804 msgid "" "As a meta path finder, the :term:`path based finder` implements the :meth:" "`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " @@ -1007,7 +1030,7 @@ msgid "" "modules are found and loaded from the :term:`import path`." msgstr "" -#: ../../reference/import.rst:792 +#: ../../reference/import.rst:809 msgid "" "Three variables are used by the :term:`path based finder`, :data:`sys." "path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " @@ -1015,7 +1038,7 @@ msgid "" "additional ways that the import machinery can be customized." msgstr "" -#: ../../reference/import.rst:797 +#: ../../reference/import.rst:814 msgid "" ":data:`sys.path` contains a list of strings providing search locations for " "modules and packages. It is initialized from the :data:`PYTHONPATH` " @@ -1027,7 +1050,7 @@ msgid "" "other data types are ignored." msgstr "" -#: ../../reference/import.rst:806 +#: ../../reference/import.rst:823 msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " @@ -1039,7 +1062,7 @@ msgid "" "top level import and :data:`sys.path` is used." msgstr "" -#: ../../reference/import.rst:815 +#: ../../reference/import.rst:832 msgid "" "The path based finder iterates over every entry in the search path, and for " "each of these, looks for an appropriate :term:`path entry finder` (:class:" @@ -1052,10 +1075,10 @@ msgid "" "the expensive search for a particular :term:`path entry` location's :term:" "`path entry finder` need only be done once. User code is free to remove " "cache entries from :data:`sys.path_importer_cache` forcing the path based " -"finder to perform the path entry search again [#fnpic]_." +"finder to perform the path entry search again." msgstr "" -#: ../../reference/import.rst:828 +#: ../../reference/import.rst:845 msgid "" "If the path entry is not present in the cache, the path based finder " "iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" @@ -1071,7 +1094,7 @@ msgid "" "decode the argument, it should raise :exc:`ImportError`." msgstr "" -#: ../../reference/import.rst:842 +#: ../../reference/import.rst:859 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " "being returned, then the path based finder's :meth:`~importlib.machinery." @@ -1081,7 +1104,7 @@ msgid "" "could not find the module." msgstr "" -#: ../../reference/import.rst:849 +#: ../../reference/import.rst:866 msgid "" "If a :term:`path entry finder` *is* returned by one of the :term:`path entry " "hook` callables on :data:`sys.path_hooks`, then the following protocol is " @@ -1089,7 +1112,7 @@ msgid "" "the module." msgstr "" -#: ../../reference/import.rst:854 +#: ../../reference/import.rst:871 msgid "" "The current working directory -- denoted by an empty string -- is handled " "slightly differently from other entries on :data:`sys.path`. First, if the " @@ -1101,18 +1124,18 @@ msgid "" "and not the empty string." msgstr "" -#: ../../reference/import.rst:864 +#: ../../reference/import.rst:881 msgid "Path entry finder protocol" msgstr "" -#: ../../reference/import.rst:866 +#: ../../reference/import.rst:883 msgid "" "In order to support imports of modules and initialized packages and also to " "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" -#: ../../reference/import.rst:870 +#: ../../reference/import.rst:887 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` takes two arguments: the " "fully qualified name of the module being imported, and the (optional) target " @@ -1120,22 +1143,21 @@ msgid "" "spec will always have \"loader\" set (with one exception)." msgstr "" -#: ../../reference/import.rst:875 +#: ../../reference/import.rst:892 msgid "" "To indicate to the import machinery that the spec represents a namespace :" -"term:`portion`, the path entry finder sets \"submodule_search_locations\" to " +"term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" -#: ../../reference/import.rst:879 +#: ../../reference/import.rst:896 msgid "" -":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`~importlib." -"abc.PathEntryFinder.find_loader` and :meth:`~importlib.abc.PathEntryFinder." -"find_module`, both of which are now deprecated, but will be used if " -"``find_spec()`` is not defined." +":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`!" +"find_loader` and :meth:`!find_module`, both of which are now deprecated, but " +"will be used if ``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:885 +#: ../../reference/import.rst:902 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1143,15 +1165,14 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:890 +#: ../../reference/import.rst:907 msgid "" -":meth:`~importlib.abc.PathEntryFinder.find_loader` takes one argument, the " -"fully qualified name of the module being imported. ``find_loader()`` " -"returns a 2-tuple where the first item is the loader and the second item is " -"a namespace :term:`portion`." +":meth:`!find_loader` takes one argument, the fully qualified name of the " +"module being imported. ``find_loader()`` returns a 2-tuple where the first " +"item is the loader and the second item is a namespace :term:`portion`." msgstr "" -#: ../../reference/import.rst:895 +#: ../../reference/import.rst:912 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1161,7 +1182,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:902 +#: ../../reference/import.rst:919 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1170,25 +1191,28 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:908 +#: ../../reference/import.rst:925 msgid "" -"Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` and :meth:" -"`~importlib.abc.PathEntryFinder.find_loader` by the import system will " -"raise :exc:`ImportWarning`." +"Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " +"will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:915 +#: ../../reference/import.rst:930 +msgid "``find_module()`` and ``find_loader()`` have been removed." +msgstr "" + +#: ../../reference/import.rst:935 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:917 +#: ../../reference/import.rst:937 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:921 +#: ../../reference/import.rst:941 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1197,7 +1221,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:927 +#: ../../reference/import.rst:947 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1207,11 +1231,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:937 +#: ../../reference/import.rst:957 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:939 +#: ../../reference/import.rst:959 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1219,30 +1243,30 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:955 +#: ../../reference/import.rst:975 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:965 +#: ../../reference/import.rst:985 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:971 +#: ../../reference/import.rst:991 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:978 +#: ../../reference/import.rst:998 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:980 +#: ../../reference/import.rst:1000 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " @@ -1253,17 +1277,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:991 +#: ../../reference/import.rst:1011 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:993 +#: ../../reference/import.rst:1013 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:996 +#: ../../reference/import.rst:1016 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1271,30 +1295,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:1001 +#: ../../reference/import.rst:1021 msgid "" "In :ref:`the remaining cases ` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:1005 +#: ../../reference/import.rst:1025 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:1006 +#: ../../reference/import.rst:1026 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:1007 +#: ../../reference/import.rst:1027 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:1008 +#: ../../reference/import.rst:1028 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:1010 +#: ../../reference/import.rst:1030 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1302,7 +1326,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:1015 +#: ../../reference/import.rst:1035 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1311,11 +1335,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:1023 +#: ../../reference/import.rst:1043 msgid "References" msgstr "" -#: ../../reference/import.rst:1025 +#: ../../reference/import.rst:1045 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " -"Python 3.3. :pep:`420` also introduced the :meth:`find_loader` protocol as " -"an alternative to :meth:`find_module`." +"Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " +"an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:1037 +#: ../../reference/import.rst:1057 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1040 +#: ../../reference/import.rst:1060 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1044 +#: ../../reference/import.rst:1064 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1046 +#: ../../reference/import.rst:1066 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1362,15 +1386,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1053 +#: ../../reference/import.rst:1073 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1054 +#: ../../reference/import.rst:1074 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`\\ 。" -#: ../../reference/import.rst:1056 +#: ../../reference/import.rst:1076 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1379,14 +1403,6 @@ msgid "" "behavior that is not guaranteed to work in other Python implementations." msgstr "" -#: ../../reference/import.rst:1063 -msgid "" -"In legacy code, it is possible to find instances of :class:`imp." -"NullImporter` in the :data:`sys.path_importer_cache`. It is recommended " -"that code be changed to use ``None`` instead. See :ref:`portingpythoncode` " -"for more details." -msgstr "" - #: ../../reference/import.rst:8 msgid "import machinery" msgstr "import machinery(引入機制)" @@ -1460,22 +1476,22 @@ msgstr "sys.meta_path" msgid "find_spec" msgstr "find_spec" -#: ../../reference/import.rst:727 +#: ../../reference/import.rst:744 msgid "path based finder" msgstr "path based finder(基於路徑的搜尋器)" -#: ../../reference/import.rst:776 +#: ../../reference/import.rst:793 msgid "sys.path" msgstr "sys.path" -#: ../../reference/import.rst:776 +#: ../../reference/import.rst:793 msgid "sys.path_hooks" msgstr "sys.path_hooks" -#: ../../reference/import.rst:776 +#: ../../reference/import.rst:793 msgid "sys.path_importer_cache" msgstr "sys.path_importer_cache" -#: ../../reference/import.rst:776 +#: ../../reference/import.rst:793 msgid "PYTHONPATH" msgstr "PYTHONPATH" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 9b8d7ce2ae..bc52da5efe 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -378,7 +378,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:317 msgid "" "*Other_ID_Start* - explicit list of characters in `PropList.txt `_ to support backwards " +"unicode.org/Public/15.0.0/ucd/PropList.txt>`_ to support backwards " "compatibility" msgstr "" @@ -395,7 +395,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:325 msgid "" "A non-normative HTML file listing all valid identifier characters for " -"Unicode 14.0.0 can be found at https://www.unicode.org/Public/14.0.0/ucd/" +"Unicode 15.0.0 can be found at https://www.unicode.org/Public/15.0.0/ucd/" "DerivedCoreProperties.txt" msgstr "" @@ -417,78 +417,87 @@ msgstr "" #: ../../reference/lexical_analysis.rst:363 msgid "" "Some identifiers are only reserved under specific contexts. These are known " -"as *soft keywords*. The identifiers ``match``, ``case`` and ``_`` can " -"syntactically act as keywords in contexts related to the pattern matching " -"statement, but this distinction is done at the parser level, not when " -"tokenizing." +"as *soft keywords*. The identifiers ``match``, ``case``, ``type`` and ``_`` " +"can syntactically act as keywords in certain contexts, but this distinction " +"is done at the parser level, not when tokenizing." msgstr "" -#: ../../reference/lexical_analysis.rst:369 +#: ../../reference/lexical_analysis.rst:368 msgid "" -"As soft keywords, their use with pattern matching is possible while still " -"preserving compatibility with existing code that uses ``match``, ``case`` " -"and ``_`` as identifier names." +"As soft keywords, their use in the grammar is possible while still " +"preserving compatibility with existing code that uses these names as " +"identifier names." msgstr "" -#: ../../reference/lexical_analysis.rst:380 +#: ../../reference/lexical_analysis.rst:372 +msgid "" +"``match``, ``case``, and ``_`` are used in the :keyword:`match` statement. " +"``type`` is used in the :keyword:`type` statement." +msgstr "" + +#: ../../reference/lexical_analysis.rst:375 +msgid "``type`` is now a soft keyword." +msgstr "" + +#: ../../reference/lexical_analysis.rst:384 msgid "Reserved classes of identifiers" msgstr "" -#: ../../reference/lexical_analysis.rst:382 +#: ../../reference/lexical_analysis.rst:386 msgid "" "Certain classes of identifiers (besides keywords) have special meanings. " "These classes are identified by the patterns of leading and trailing " "underscore characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:387 +#: ../../reference/lexical_analysis.rst:391 msgid "``_*``" msgstr "``_*``" -#: ../../reference/lexical_analysis.rst:387 +#: ../../reference/lexical_analysis.rst:391 msgid "Not imported by ``from module import *``." msgstr "" -#: ../../reference/lexical_analysis.rst:408 +#: ../../reference/lexical_analysis.rst:412 msgid "``_``" msgstr "``_``" -#: ../../reference/lexical_analysis.rst:390 +#: ../../reference/lexical_analysis.rst:394 msgid "" "In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" "`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" -#: ../../reference/lexical_analysis.rst:394 +#: ../../reference/lexical_analysis.rst:398 msgid "" "Separately, the interactive interpreter makes the result of the last " "evaluation available in the variable ``_``. (It is stored in the :mod:" "`builtins` module, alongside built-in functions like ``print``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:399 +#: ../../reference/lexical_analysis.rst:403 msgid "" "Elsewhere, ``_`` is a regular identifier. It is often used to name " "\"special\" items, but it is not special to Python itself." msgstr "" -#: ../../reference/lexical_analysis.rst:404 +#: ../../reference/lexical_analysis.rst:408 msgid "" "The name ``_`` is often used in conjunction with internationalization; refer " "to the documentation for the :mod:`gettext` module for more information on " "this convention." msgstr "" -#: ../../reference/lexical_analysis.rst:408 +#: ../../reference/lexical_analysis.rst:412 msgid "It is also commonly used for unused variables." msgstr "" -#: ../../reference/lexical_analysis.rst:416 +#: ../../reference/lexical_analysis.rst:420 msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:411 +#: ../../reference/lexical_analysis.rst:415 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -498,11 +507,11 @@ msgid "" "explicitly documented use, is subject to breakage without warning." msgstr "" -#: ../../reference/lexical_analysis.rst:423 +#: ../../reference/lexical_analysis.rst:427 msgid "``__*``" msgstr "``__*``" -#: ../../reference/lexical_analysis.rst:419 +#: ../../reference/lexical_analysis.rst:423 msgid "" "Class-private names. Names in this category, when used within the context " "of a class definition, are re-written to use a mangled form to help avoid " @@ -510,23 +519,23 @@ msgid "" "section :ref:`atom-identifiers`." msgstr "" -#: ../../reference/lexical_analysis.rst:428 +#: ../../reference/lexical_analysis.rst:432 msgid "Literals" msgstr "" -#: ../../reference/lexical_analysis.rst:432 +#: ../../reference/lexical_analysis.rst:436 msgid "Literals are notations for constant values of some built-in types." msgstr "" -#: ../../reference/lexical_analysis.rst:443 +#: ../../reference/lexical_analysis.rst:447 msgid "String and Bytes literals" msgstr "" -#: ../../reference/lexical_analysis.rst:445 +#: ../../reference/lexical_analysis.rst:449 msgid "String literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:470 +#: ../../reference/lexical_analysis.rst:474 msgid "" "One syntactic restriction not indicated by these productions is that " "whitespace is not allowed between the :token:`~python-grammar:stringprefix` " @@ -536,17 +545,20 @@ msgid "" "`encodings`." msgstr "" -#: ../../reference/lexical_analysis.rst:480 +#: ../../reference/lexical_analysis.rst:484 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:497 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 +566,7 @@ msgid "" "greater must be expressed with escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:500 +#: ../../reference/lexical_analysis.rst:506 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 +576,20 @@ msgid "" "3.x's the ``'ur'`` syntax is not supported." msgstr "" -#: ../../reference/lexical_analysis.rst:507 +#: ../../reference/lexical_analysis.rst:513 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:517 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:526 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 +597,7 @@ msgid "" "are possible, but formatted bytes literals are not." msgstr "" -#: ../../reference/lexical_analysis.rst:525 +#: ../../reference/lexical_analysis.rst:531 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,236 +605,242 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:544 +#: ../../reference/lexical_analysis.rst:552 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:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:549 -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Meaning" msgstr "" -#: ../../reference/lexical_analysis.rst:549 -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:559 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:559 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:559 msgid "\\(1)" msgstr "\\(1)" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:561 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:561 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:555 +#: ../../reference/lexical_analysis.rst:563 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:555 +#: ../../reference/lexical_analysis.rst:563 msgid "Single quote (``'``)" msgstr "" -#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:565 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:565 msgid "Double quote (``\"``)" msgstr "" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:567 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:567 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:569 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:569 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:571 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:571 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:573 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:573 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:575 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:577 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:577 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:579 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:579 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:581 msgid "``\\ooo``" msgstr "``\\ooo``" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:581 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:581 msgid "(2,4)" msgstr "(2,4)" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:584 msgid "``\\xhh``" msgstr "``\\xhh``" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:584 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:584 msgid "(3,4)" msgstr "(3,4)" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:587 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:592 msgid "``\\N{name}``" msgstr "``\\N{name}``" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:592 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:592 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:595 msgid "``\\uxxxx``" msgstr "``\\uxxxx``" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:595 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:595 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:598 msgid "``\\Uxxxxxxxx``" msgstr "``\\Uxxxxxxxx``" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:598 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:598 msgid "\\(7)" msgstr "\\(7)" -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:602 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:597 +#: ../../reference/lexical_analysis.rst:605 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:603 +#: ../../reference/lexical_analysis.rst:611 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:608 +#: ../../reference/lexical_analysis.rst:616 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:610 +#: ../../reference/lexical_analysis.rst:618 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" -"`DeprecationWarning`. In a future Python version they will be a :exc:" -"`SyntaxWarning` and eventually a :exc:`SyntaxError`." +"`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:616 +#: ../../reference/lexical_analysis.rst:622 +msgid "" +"Octal escapes with value larger than ``0o377`` produce a :exc:" +"`SyntaxWarning`. In a future Python version they will be eventually a :exc:" +"`SyntaxError`." +msgstr "" + +#: ../../reference/lexical_analysis.rst:628 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:619 +#: ../../reference/lexical_analysis.rst:631 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:624 +#: ../../reference/lexical_analysis.rst:636 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:628 +#: ../../reference/lexical_analysis.rst:640 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:631 +#: ../../reference/lexical_analysis.rst:643 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:637 +#: ../../reference/lexical_analysis.rst:649 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 " @@ -832,14 +850,17 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:656 +msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." +msgstr "" + +#: ../../reference/lexical_analysis.rst:659 msgid "" -"Unrecognized escape sequences produce a :exc:`DeprecationWarning`. In a " -"future Python version they will be a :exc:`SyntaxWarning` and eventually a :" -"exc:`SyntaxError`." +"Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " +"Python version they will be eventually a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:649 +#: ../../reference/lexical_analysis.rst:663 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 " @@ -852,11 +873,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:662 +#: ../../reference/lexical_analysis.rst:676 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:664 +#: ../../reference/lexical_analysis.rst:678 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -866,7 +887,7 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:675 +#: ../../reference/lexical_analysis.rst:689 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -876,11 +897,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:710 msgid "Formatted string literals" msgstr "" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:714 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 " @@ -889,14 +910,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:706 +#: ../../reference/lexical_analysis.rst:720 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:720 +#: ../../reference/lexical_analysis.rst:734 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -909,25 +930,34 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:730 +#: ../../reference/lexical_analysis.rst:744 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " "expression is not allowed, and both :keyword:`lambda` and assignment " -"expressions ``:=`` must be surrounded by explicit parentheses. Replacement " -"expressions can contain line breaks (e.g. in triple-quoted strings), but " -"they cannot contain comments. Each expression is evaluated in the context " -"where the formatted string literal appears, in order from left to right." +"expressions ``:=`` must be surrounded by explicit parentheses. Each " +"expression is evaluated in the context where the formatted string literal " +"appears, in order from left to right. Replacement expressions can contain " +"newlines in both single-quoted and triple-quoted f-strings and they can " +"contain comments. Everything that comes after a ``#`` inside a replacement " +"field is a comment (even closing braces and quotes). In that case, " +"replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:739 +#: ../../reference/lexical_analysis.rst:761 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:744 +#: ../../reference/lexical_analysis.rst:766 +msgid "" +"Prior to Python 3.12, comments were not allowed inside f-string replacement " +"fields." +msgstr "" + +#: ../../reference/lexical_analysis.rst:770 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -938,18 +968,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:752 +#: ../../reference/lexical_analysis.rst:778 msgid "The equal sign ``'='``." msgstr "" -#: ../../reference/lexical_analysis.rst:755 +#: ../../reference/lexical_analysis.rst:781 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:759 +#: ../../reference/lexical_analysis.rst:785 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 " @@ -958,7 +988,7 @@ msgid "" "whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:765 +#: ../../reference/lexical_analysis.rst:791 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -967,111 +997,117 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:771 +#: ../../reference/lexical_analysis.rst:797 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:774 +#: ../../reference/lexical_analysis.rst:800 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:806 +#: ../../reference/lexical_analysis.rst:832 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::" +"Reusing the outer f-string quoting type inside a replacement field is " +"permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:813 +#: ../../reference/lexical_analysis.rst:839 msgid "" -"Backslashes are not allowed in format expressions and will raise an error::" +"Prior to Python 3.12, reuse of the same quoting type of the outer f-string " +"inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:818 +#: ../../reference/lexical_analysis.rst:843 msgid "" -"To include a value in which a backslash escape is required, create a " -"temporary variable." +"Backslashes are also allowed in replacement fields and are evaluated the " +"same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:825 +#: ../../reference/lexical_analysis.rst:853 +msgid "" +"Prior to Python 3.12, backslashes were not permitted inside an f-string " +"replacement field." +msgstr "" + +#: ../../reference/lexical_analysis.rst:857 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:836 +#: ../../reference/lexical_analysis.rst:868 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:843 +#: ../../reference/lexical_analysis.rst:875 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:849 +#: ../../reference/lexical_analysis.rst:881 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:853 +#: ../../reference/lexical_analysis.rst:885 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:867 +#: ../../reference/lexical_analysis.rst:899 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:869 +#: ../../reference/lexical_analysis.rst:901 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:883 +#: ../../reference/lexical_analysis.rst:915 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:886 +#: ../../reference/lexical_analysis.rst:918 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:890 +#: ../../reference/lexical_analysis.rst:922 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:894 +#: ../../reference/lexical_analysis.rst:926 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:900 #: ../../reference/lexical_analysis.rst:932 +#: ../../reference/lexical_analysis.rst:964 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:911 +#: ../../reference/lexical_analysis.rst:943 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:913 +#: ../../reference/lexical_analysis.rst:945 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:923 +#: ../../reference/lexical_analysis.rst:955 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 " @@ -1080,19 +1116,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:928 +#: ../../reference/lexical_analysis.rst:960 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:941 +#: ../../reference/lexical_analysis.rst:973 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:943 +#: ../../reference/lexical_analysis.rst:975 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:948 +#: ../../reference/lexical_analysis.rst:980 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 " @@ -1101,23 +1137,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:960 +#: ../../reference/lexical_analysis.rst:992 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:964 +#: ../../reference/lexical_analysis.rst:996 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:977 +#: ../../reference/lexical_analysis.rst:1009 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:981 +#: ../../reference/lexical_analysis.rst:1013 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:990 +#: ../../reference/lexical_analysis.rst:1022 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 " @@ -1125,24 +1161,25 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:995 +#: ../../reference/lexical_analysis.rst:1027 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:1002 +#: ../../reference/lexical_analysis.rst:1034 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:1011 +#: ../../reference/lexical_analysis.rst:1043 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1012 -msgid "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" +#: ../../reference/lexical_analysis.rst:1044 +#, fuzzy +msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" #: ../../reference/lexical_analysis.rst:8 @@ -1167,7 +1204,7 @@ msgstr "logical line(邏輯列)" #: ../../reference/lexical_analysis.rst:35 #: ../../reference/lexical_analysis.rst:115 -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "physical line" msgstr "physical line(物理列)" @@ -1270,301 +1307,301 @@ msgstr "reserved word(保留字)" msgid "soft keyword" msgstr "soft keyword(軟關鍵字)" -#: ../../reference/lexical_analysis.rst:374 +#: ../../reference/lexical_analysis.rst:378 msgid "_, identifiers" msgstr "_, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:374 +#: ../../reference/lexical_analysis.rst:378 msgid "__, identifiers" msgstr "__, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:430 +#: ../../reference/lexical_analysis.rst:434 msgid "literal" msgstr "literal(常數)" -#: ../../reference/lexical_analysis.rst:430 +#: ../../reference/lexical_analysis.rst:434 msgid "constant" msgstr "constant(常數)" -#: ../../reference/lexical_analysis.rst:435 -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:439 +#: ../../reference/lexical_analysis.rst:480 msgid "string literal" msgstr "string literal(字串常數)" -#: ../../reference/lexical_analysis.rst:435 -#: ../../reference/lexical_analysis.rst:487 +#: ../../reference/lexical_analysis.rst:439 +#: ../../reference/lexical_analysis.rst:493 msgid "bytes literal" msgstr "bytes literal(位元組常數)" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:439 msgid "ASCII" msgstr "ASCII" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:439 msgid "' (single quote)" msgstr "' (單引號)" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:439 msgid "\" (double quote)" msgstr "\" (雙引號)" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:439 msgid "u'" -msgstr "u'" +msgstr "u'" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:439 msgid "u\"" msgstr "u\"" -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:480 msgid "triple-quoted string" msgstr "triple-quoted string(三引號字串)" -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:480 msgid "Unicode Consortium" msgstr "Unicode Consortium" -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:480 msgid "raw string" msgstr "raw string(原始字串)" -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:480 msgid "\"\"\"" msgstr "\"\"\"" -#: ../../reference/lexical_analysis.rst:476 +#: ../../reference/lexical_analysis.rst:480 msgid "'''" msgstr "'''" -#: ../../reference/lexical_analysis.rst:487 +#: ../../reference/lexical_analysis.rst:493 msgid "b'" msgstr "b'" -#: ../../reference/lexical_analysis.rst:487 +#: ../../reference/lexical_analysis.rst:493 msgid "b\"" msgstr "b\"" -#: ../../reference/lexical_analysis.rst:496 +#: ../../reference/lexical_analysis.rst:502 msgid "r'" msgstr "r'" -#: ../../reference/lexical_analysis.rst:496 +#: ../../reference/lexical_analysis.rst:502 msgid "raw string literal" msgstr "raw string literal(原始字串常數)" -#: ../../reference/lexical_analysis.rst:496 +#: ../../reference/lexical_analysis.rst:502 msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:516 +#: ../../reference/lexical_analysis.rst:522 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:516 -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:522 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:516 +#: ../../reference/lexical_analysis.rst:522 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:535 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:635 +#: ../../reference/lexical_analysis.rst:647 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:696 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:845 -#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:890 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "floating point literal" msgstr "floating point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:877 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:890 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:890 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:858 +#: ../../reference/lexical_analysis.rst:890 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:858 -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:890 +#: ../../reference/lexical_analysis.rst:936 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:858 -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:890 #: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:968 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:936 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:936 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:968 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:962 +#: ../../reference/lexical_analysis.rst:994 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:979 +#: ../../reference/lexical_analysis.rst:1011 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 2228049d6c..8629a41451 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -29,11 +29,11 @@ msgid "" "for simple statements is:" msgstr "" -#: ../../reference/simple_stmts.rst:36 +#: ../../reference/simple_stmts.rst:37 msgid "Expression statements" msgstr "" -#: ../../reference/simple_stmts.rst:43 +#: ../../reference/simple_stmts.rst:44 msgid "" "Expression statements are used (mostly interactively) to compute and write a " "value, or (usually) to call a procedure (a function that returns no " @@ -42,13 +42,13 @@ msgid "" "syntax for an expression statement is:" msgstr "" -#: ../../reference/simple_stmts.rst:52 +#: ../../reference/simple_stmts.rst:53 msgid "" "An expression statement evaluates the expression list (which may be a single " "expression)." msgstr "" -#: ../../reference/simple_stmts.rst:64 +#: ../../reference/simple_stmts.rst:65 msgid "" "In interactive mode, if the value is not ``None``, it is converted to a " "string using the built-in :func:`repr` function and the resulting string is " @@ -56,23 +56,23 @@ msgid "" "``None``, so that procedure calls do not cause any output.)" msgstr "" -#: ../../reference/simple_stmts.rst:72 +#: ../../reference/simple_stmts.rst:73 msgid "Assignment statements" msgstr "" -#: ../../reference/simple_stmts.rst:82 +#: ../../reference/simple_stmts.rst:83 msgid "" "Assignment statements are used to (re)bind names to values and to modify " "attributes or items of mutable objects:" msgstr "" -#: ../../reference/simple_stmts.rst:96 +#: ../../reference/simple_stmts.rst:97 msgid "" "(See section :ref:`primaries` for the syntax definitions for *attributeref*, " "*subscription*, and *slicing*.)" msgstr "" -#: ../../reference/simple_stmts.rst:99 +#: ../../reference/simple_stmts.rst:100 msgid "" "An assignment statement evaluates the expression list (remember that this " "can be a single expression or a comma-separated list, the latter yielding a " @@ -80,7 +80,7 @@ msgid "" "from left to right." msgstr "" -#: ../../reference/simple_stmts.rst:108 +#: ../../reference/simple_stmts.rst:109 msgid "" "Assignment is defined recursively depending on the form of the target " "(list). When a target is part of a mutable object (an attribute reference, " @@ -91,23 +91,23 @@ msgid "" "section :ref:`types`)." msgstr "" -#: ../../reference/simple_stmts.rst:121 +#: ../../reference/simple_stmts.rst:122 msgid "" "Assignment of an object to a target list, optionally enclosed in parentheses " "or square brackets, is recursively defined as follows." msgstr "" -#: ../../reference/simple_stmts.rst:124 +#: ../../reference/simple_stmts.rst:125 msgid "" "If the target list is a single target with no trailing comma, optionally in " "parentheses, the object is assigned to that target." msgstr "" -#: ../../reference/simple_stmts.rst:127 +#: ../../reference/simple_stmts.rst:128 msgid "Else:" msgstr "" -#: ../../reference/simple_stmts.rst:129 +#: ../../reference/simple_stmts.rst:130 msgid "" "If the target list contains one target prefixed with an asterisk, called a " "\"starred\" target: The object must be an iterable with at least as many " @@ -118,43 +118,43 @@ msgid "" "then assigned to the starred target (the list can be empty)." msgstr "" -#: ../../reference/simple_stmts.rst:137 +#: ../../reference/simple_stmts.rst:138 msgid "" "Else: The object must be an iterable with the same number of items as there " "are targets in the target list, and the items are assigned, from left to " "right, to the corresponding targets." msgstr "" -#: ../../reference/simple_stmts.rst:141 +#: ../../reference/simple_stmts.rst:142 msgid "" "Assignment of an object to a single target is recursively defined as follows." msgstr "" -#: ../../reference/simple_stmts.rst:143 +#: ../../reference/simple_stmts.rst:144 msgid "If the target is an identifier (name):" msgstr "" -#: ../../reference/simple_stmts.rst:145 +#: ../../reference/simple_stmts.rst:146 msgid "" "If the name does not occur in a :keyword:`global` or :keyword:`nonlocal` " "statement in the current code block: the name is bound to the object in the " "current local namespace." msgstr "" -#: ../../reference/simple_stmts.rst:149 +#: ../../reference/simple_stmts.rst:150 msgid "" "Otherwise: the name is bound to the object in the global namespace or the " "outer namespace determined by :keyword:`nonlocal`, respectively." msgstr "" -#: ../../reference/simple_stmts.rst:154 +#: ../../reference/simple_stmts.rst:155 msgid "" "The name is rebound if it was already bound. This may cause the reference " "count for the object previously bound to the name to reach zero, causing the " "object to be deallocated and its destructor (if it has one) to be called." msgstr "" -#: ../../reference/simple_stmts.rst:160 +#: ../../reference/simple_stmts.rst:161 msgid "" "If the target is an attribute reference: The primary expression in the " "reference is evaluated. It should yield an object with assignable " @@ -164,7 +164,7 @@ msgid "" "necessarily :exc:`AttributeError`)." msgstr "" -#: ../../reference/simple_stmts.rst:169 +#: ../../reference/simple_stmts.rst:170 msgid "" "Note: If the object is a class instance and the attribute reference occurs " "on both sides of the assignment operator, the right-hand side expression, " @@ -176,13 +176,13 @@ msgid "" "side creates a new instance attribute as the target of the assignment::" msgstr "" -#: ../../reference/simple_stmts.rst:183 +#: ../../reference/simple_stmts.rst:184 msgid "" "This description does not necessarily apply to descriptor attributes, such " "as properties created with :func:`property`." msgstr "" -#: ../../reference/simple_stmts.rst:190 +#: ../../reference/simple_stmts.rst:191 msgid "" "If the target is a subscription: The primary expression in the reference is " "evaluated. It should yield either a mutable sequence object (such as a " @@ -190,7 +190,7 @@ msgid "" "expression is evaluated." msgstr "" -#: ../../reference/simple_stmts.rst:199 +#: ../../reference/simple_stmts.rst:200 msgid "" "If the primary is a mutable sequence object (such as a list), the subscript " "must yield an integer. If it is negative, the sequence's length is added to " @@ -201,7 +201,7 @@ msgid "" "items to a list)." msgstr "" -#: ../../reference/simple_stmts.rst:210 +#: ../../reference/simple_stmts.rst:211 msgid "" "If the primary is a mapping object (such as a dictionary), the subscript " "must have a type compatible with the mapping's key type, and the mapping is " @@ -211,13 +211,13 @@ msgid "" "value existed)." msgstr "" -#: ../../reference/simple_stmts.rst:216 +#: ../../reference/simple_stmts.rst:217 msgid "" "For user-defined objects, the :meth:`__setitem__` method is called with " "appropriate arguments." msgstr "" -#: ../../reference/simple_stmts.rst:221 +#: ../../reference/simple_stmts.rst:222 msgid "" "If the target is a slicing: The primary expression in the reference is " "evaluated. It should yield a mutable sequence object (such as a list). The " @@ -232,14 +232,14 @@ msgid "" "length of the target sequence, if the target sequence allows it." msgstr "" -#: ../../reference/simple_stmts.rst:235 +#: ../../reference/simple_stmts.rst:236 msgid "" "In the current implementation, the syntax for targets is taken to be the " "same as for expressions, and invalid syntax is rejected during the code " "generation phase, causing less detailed error messages." msgstr "" -#: ../../reference/simple_stmts.rst:239 +#: ../../reference/simple_stmts.rst:240 msgid "" "Although the definition of assignment implies that overlaps between the left-" "hand side and the right-hand side are 'simultaneous' (for example ``a, b = " @@ -248,31 +248,31 @@ msgid "" "instance, the following program prints ``[0, 2]``::" msgstr "" -#: ../../reference/simple_stmts.rst:253 +#: ../../reference/simple_stmts.rst:254 msgid ":pep:`3132` - Extended Iterable Unpacking" msgstr "" -#: ../../reference/simple_stmts.rst:254 +#: ../../reference/simple_stmts.rst:255 msgid "The specification for the ``*target`` feature." msgstr "" -#: ../../reference/simple_stmts.rst:260 +#: ../../reference/simple_stmts.rst:261 msgid "Augmented assignment statements" msgstr "" -#: ../../reference/simple_stmts.rst:278 +#: ../../reference/simple_stmts.rst:279 msgid "" "Augmented assignment is the combination, in a single statement, of a binary " "operation and an assignment statement:" msgstr "" -#: ../../reference/simple_stmts.rst:287 +#: ../../reference/simple_stmts.rst:288 msgid "" "(See section :ref:`primaries` for the syntax definitions of the last three " "symbols.)" msgstr "" -#: ../../reference/simple_stmts.rst:290 +#: ../../reference/simple_stmts.rst:291 msgid "" "An augmented assignment evaluates the target (which, unlike normal " "assignment statements, cannot be an unpacking) and the expression list, " @@ -281,7 +281,7 @@ msgid "" "evaluated once." msgstr "" -#: ../../reference/simple_stmts.rst:295 +#: ../../reference/simple_stmts.rst:296 msgid "" "An augmented assignment expression like ``x += 1`` can be rewritten as ``x = " "x + 1`` to achieve a similar, but not exactly equal effect. In the augmented " @@ -290,7 +290,7 @@ msgid "" "object and assigning that to the target, the old object is modified instead." msgstr "" -#: ../../reference/simple_stmts.rst:301 +#: ../../reference/simple_stmts.rst:302 msgid "" "Unlike normal assignments, augmented assignments evaluate the left-hand side " "*before* evaluating the right-hand side. For example, ``a[i] += f(x)`` " @@ -298,7 +298,7 @@ msgid "" "addition, and lastly, it writes the result back to ``a[i]``." msgstr "" -#: ../../reference/simple_stmts.rst:306 +#: ../../reference/simple_stmts.rst:307 msgid "" "With the exception of assigning to tuples and multiple targets in a single " "statement, the assignment done by augmented assignment statements is handled " @@ -307,31 +307,31 @@ msgid "" "assignment is the same as the normal binary operations." msgstr "" -#: ../../reference/simple_stmts.rst:312 +#: ../../reference/simple_stmts.rst:313 msgid "" "For targets which are attribute references, the same :ref:`caveat about " "class and instance attributes ` applies as for regular " "assignments." msgstr "" -#: ../../reference/simple_stmts.rst:319 +#: ../../reference/simple_stmts.rst:320 msgid "Annotated assignment statements" msgstr "" -#: ../../reference/simple_stmts.rst:326 +#: ../../reference/simple_stmts.rst:327 msgid "" ":term:`Annotation ` assignment is the combination, in a " "single statement, of a variable or attribute annotation and an optional " "assignment statement:" msgstr "" -#: ../../reference/simple_stmts.rst:333 +#: ../../reference/simple_stmts.rst:334 msgid "" "The difference from normal :ref:`assignment` is that only a single target is " "allowed." msgstr "" -#: ../../reference/simple_stmts.rst:335 +#: ../../reference/simple_stmts.rst:336 msgid "" "For simple names as assignment targets, if in class or module scope, the " "annotations are evaluated and stored in a special class or module attribute :" @@ -341,19 +341,19 @@ msgid "" "if annotations are found statically." msgstr "" -#: ../../reference/simple_stmts.rst:343 +#: ../../reference/simple_stmts.rst:344 msgid "" "For expressions as assignment targets, the annotations are evaluated if in " "class or module scope, but not stored." msgstr "" -#: ../../reference/simple_stmts.rst:346 +#: ../../reference/simple_stmts.rst:347 msgid "" "If a name is annotated in a function scope, then this name is local for that " "scope. Annotations are never evaluated and stored in function scopes." msgstr "" -#: ../../reference/simple_stmts.rst:349 +#: ../../reference/simple_stmts.rst:350 msgid "" "If the right hand side is present, an annotated assignment performs the " "actual assignment before evaluating annotations (where applicable). If the " @@ -362,55 +362,55 @@ msgid "" "meth:`__setattr__` call." msgstr "" -#: ../../reference/simple_stmts.rst:360 +#: ../../reference/simple_stmts.rst:361 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/simple_stmts.rst:358 +#: ../../reference/simple_stmts.rst:359 msgid "" "The proposal that added syntax for annotating the types of variables " "(including class variables and instance variables), instead of expressing " "them through comments." msgstr "" -#: ../../reference/simple_stmts.rst:364 +#: ../../reference/simple_stmts.rst:365 msgid ":pep:`484` - Type hints" msgstr "" -#: ../../reference/simple_stmts.rst:363 +#: ../../reference/simple_stmts.rst:364 msgid "" "The proposal that added the :mod:`typing` module to provide a standard " "syntax for type annotations that can be used in static analysis tools and " "IDEs." msgstr "" -#: ../../reference/simple_stmts.rst:367 +#: ../../reference/simple_stmts.rst:368 msgid "" "Now annotated assignments allow the same expressions in the right hand side " "as regular assignments. Previously, some expressions (like un-parenthesized " "tuple expressions) caused a syntax error." msgstr "" -#: ../../reference/simple_stmts.rst:376 +#: ../../reference/simple_stmts.rst:377 msgid "The :keyword:`!assert` statement" msgstr "" -#: ../../reference/simple_stmts.rst:383 +#: ../../reference/simple_stmts.rst:384 msgid "" "Assert statements are a convenient way to insert debugging assertions into a " "program:" msgstr "" -#: ../../reference/simple_stmts.rst:389 +#: ../../reference/simple_stmts.rst:390 msgid "The simple form, ``assert expression``, is equivalent to ::" msgstr "" -#: ../../reference/simple_stmts.rst:394 +#: ../../reference/simple_stmts.rst:395 msgid "" "The extended form, ``assert expression1, expression2``, is equivalent to ::" msgstr "" -#: ../../reference/simple_stmts.rst:403 +#: ../../reference/simple_stmts.rst:404 msgid "" "These equivalences assume that :const:`__debug__` and :exc:`AssertionError` " "refer to the built-in variables with those names. In the current " @@ -422,40 +422,40 @@ msgid "" "in the error message; it will be displayed as part of the stack trace." msgstr "" -#: ../../reference/simple_stmts.rst:412 +#: ../../reference/simple_stmts.rst:413 msgid "" "Assignments to :const:`__debug__` are illegal. The value for the built-in " "variable is determined when the interpreter starts." msgstr "" -#: ../../reference/simple_stmts.rst:419 +#: ../../reference/simple_stmts.rst:420 msgid "The :keyword:`!pass` statement" msgstr "" -#: ../../reference/simple_stmts.rst:429 +#: ../../reference/simple_stmts.rst:430 msgid "" ":keyword:`pass` is a null operation --- when it is executed, nothing " "happens. It is useful as a placeholder when a statement is required " "syntactically, but no code needs to be executed, for example::" msgstr "" -#: ../../reference/simple_stmts.rst:441 +#: ../../reference/simple_stmts.rst:442 msgid "The :keyword:`!del` statement" msgstr "" -#: ../../reference/simple_stmts.rst:451 +#: ../../reference/simple_stmts.rst:452 msgid "" "Deletion is recursively defined very similar to the way assignment is " "defined. Rather than spelling it out in full details, here are some hints." msgstr "" -#: ../../reference/simple_stmts.rst:454 +#: ../../reference/simple_stmts.rst:455 msgid "" "Deletion of a target list recursively deletes each target, from left to " "right." msgstr "" -#: ../../reference/simple_stmts.rst:460 +#: ../../reference/simple_stmts.rst:461 msgid "" "Deletion of a name removes the binding of that name from the local or global " "namespace, depending on whether the name occurs in a :keyword:`global` " @@ -463,7 +463,7 @@ msgid "" "`NameError` exception will be raised." msgstr "" -#: ../../reference/simple_stmts.rst:467 +#: ../../reference/simple_stmts.rst:468 msgid "" "Deletion of attribute references, subscriptions and slicings is passed to " "the primary object involved; deletion of a slicing is in general equivalent " @@ -471,42 +471,42 @@ msgid "" "determined by the sliced object)." msgstr "" -#: ../../reference/simple_stmts.rst:472 +#: ../../reference/simple_stmts.rst:473 msgid "" "Previously it was illegal to delete a name from the local namespace if it " "occurs as a free variable in a nested block." msgstr "" -#: ../../reference/simple_stmts.rst:480 +#: ../../reference/simple_stmts.rst:481 msgid "The :keyword:`!return` statement" msgstr "" -#: ../../reference/simple_stmts.rst:490 +#: ../../reference/simple_stmts.rst:491 msgid "" ":keyword:`return` may only occur syntactically nested in a function " "definition, not within a nested class definition." msgstr "" -#: ../../reference/simple_stmts.rst:493 +#: ../../reference/simple_stmts.rst:494 msgid "" "If an expression list is present, it is evaluated, else ``None`` is " "substituted." msgstr "" -#: ../../reference/simple_stmts.rst:495 +#: ../../reference/simple_stmts.rst:496 msgid "" ":keyword:`return` leaves the current function call with the expression list " "(or ``None``) as return value." msgstr "" -#: ../../reference/simple_stmts.rst:500 +#: ../../reference/simple_stmts.rst:501 msgid "" "When :keyword:`return` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the function." msgstr "" -#: ../../reference/simple_stmts.rst:504 +#: ../../reference/simple_stmts.rst:505 msgid "" "In a generator function, the :keyword:`return` statement indicates that the " "generator is done and will cause :exc:`StopIteration` to be raised. The " @@ -514,7 +514,7 @@ msgid "" "`StopIteration` and becomes the :attr:`StopIteration.value` attribute." msgstr "" -#: ../../reference/simple_stmts.rst:509 +#: ../../reference/simple_stmts.rst:510 msgid "" "In an asynchronous generator function, an empty :keyword:`return` statement " "indicates that the asynchronous generator is done and will cause :exc:" @@ -522,11 +522,11 @@ msgid "" "is a syntax error in an asynchronous generator function." msgstr "" -#: ../../reference/simple_stmts.rst:517 +#: ../../reference/simple_stmts.rst:518 msgid "The :keyword:`!yield` statement" msgstr "" -#: ../../reference/simple_stmts.rst:529 +#: ../../reference/simple_stmts.rst:530 msgid "" "A :keyword:`yield` statement is semantically equivalent to a :ref:`yield " "expression `. The yield statement can be used to omit the " @@ -534,11 +534,11 @@ msgid "" "expression statement. For example, the yield statements ::" msgstr "" -#: ../../reference/simple_stmts.rst:537 +#: ../../reference/simple_stmts.rst:538 msgid "are equivalent to the yield expression statements ::" msgstr "" -#: ../../reference/simple_stmts.rst:542 +#: ../../reference/simple_stmts.rst:543 msgid "" "Yield expressions and statements are only used when defining a :term:" "`generator` function, and are only used in the body of the generator " @@ -546,17 +546,17 @@ msgid "" "definition to create a generator function instead of a normal function." msgstr "" -#: ../../reference/simple_stmts.rst:547 +#: ../../reference/simple_stmts.rst:548 msgid "" "For full details of :keyword:`yield` semantics, refer to the :ref:" "`yieldexpr` section." msgstr "" -#: ../../reference/simple_stmts.rst:553 +#: ../../reference/simple_stmts.rst:554 msgid "The :keyword:`!raise` statement" msgstr "" -#: ../../reference/simple_stmts.rst:564 +#: ../../reference/simple_stmts.rst:565 msgid "" "If no expressions are present, :keyword:`raise` re-raises the exception that " "is currently being handled, which is also known as the *active exception*. " @@ -564,7 +564,7 @@ msgid "" "exception is raised indicating that this is an error." msgstr "" -#: ../../reference/simple_stmts.rst:569 +#: ../../reference/simple_stmts.rst:570 msgid "" "Otherwise, :keyword:`raise` evaluates the first expression as the exception " "object. It must be either a subclass or an instance of :class:" @@ -572,13 +572,13 @@ msgid "" "when needed by instantiating the class with no arguments." msgstr "" -#: ../../reference/simple_stmts.rst:574 +#: ../../reference/simple_stmts.rst:575 msgid "" "The :dfn:`type` of the exception is the exception instance's class, the :dfn:" "`value` is the instance itself." msgstr "" -#: ../../reference/simple_stmts.rst:579 +#: ../../reference/simple_stmts.rst:580 msgid "" "A traceback object is normally created automatically when an exception is " "raised and attached to it as the :attr:`__traceback__` attribute, which is " @@ -588,7 +588,7 @@ msgid "" "argument), like so::" msgstr "" -#: ../../reference/simple_stmts.rst:591 +#: ../../reference/simple_stmts.rst:592 msgid "" "The ``from`` clause is used for exception chaining: if given, the second " "*expression* must be another exception class or instance. If the second " @@ -600,7 +600,7 @@ msgid "" "both exceptions will be printed::" msgstr "" -#: ../../reference/simple_stmts.rst:615 +#: ../../reference/simple_stmts.rst:616 msgid "" "A similar mechanism works implicitly if a new exception is raised when an " "exception is already being handled. An exception may be handled when an :" @@ -609,30 +609,30 @@ msgid "" "exception's :attr:`__context__` attribute::" msgstr "" -#: ../../reference/simple_stmts.rst:636 +#: ../../reference/simple_stmts.rst:637 msgid "" "Exception chaining can be explicitly suppressed by specifying :const:`None` " "in the ``from`` clause::" msgstr "" -#: ../../reference/simple_stmts.rst:648 +#: ../../reference/simple_stmts.rst:649 msgid "" "Additional information on exceptions can be found in section :ref:" "`exceptions`, and information about handling exceptions is in section :ref:" "`try`." msgstr "" -#: ../../reference/simple_stmts.rst:651 +#: ../../reference/simple_stmts.rst:652 msgid ":const:`None` is now permitted as ``Y`` in ``raise X from Y``." msgstr "" -#: ../../reference/simple_stmts.rst:654 +#: ../../reference/simple_stmts.rst:655 msgid "" "The ``__suppress_context__`` attribute to suppress automatic display of the " "exception context." msgstr "" -#: ../../reference/simple_stmts.rst:658 +#: ../../reference/simple_stmts.rst:659 msgid "" "If the traceback of the active exception is modified in an :keyword:`except` " "clause, a subsequent ``raise`` statement re-raises the exception with the " @@ -640,41 +640,41 @@ msgid "" "traceback it had when it was caught." msgstr "" -#: ../../reference/simple_stmts.rst:667 +#: ../../reference/simple_stmts.rst:668 msgid "The :keyword:`!break` statement" msgstr "" -#: ../../reference/simple_stmts.rst:678 +#: ../../reference/simple_stmts.rst:679 msgid "" ":keyword:`break` may only occur syntactically nested in a :keyword:`for` or :" "keyword:`while` loop, but not nested in a function or class definition " "within that loop." msgstr "" -#: ../../reference/simple_stmts.rst:685 +#: ../../reference/simple_stmts.rst:686 msgid "" "It terminates the nearest enclosing loop, skipping the optional :keyword:`!" "else` clause if the loop has one." msgstr "" -#: ../../reference/simple_stmts.rst:688 +#: ../../reference/simple_stmts.rst:689 msgid "" "If a :keyword:`for` loop is terminated by :keyword:`break`, the loop control " "target keeps its current value." msgstr "" -#: ../../reference/simple_stmts.rst:693 +#: ../../reference/simple_stmts.rst:694 msgid "" "When :keyword:`break` passes control out of a :keyword:`try` statement with " "a :keyword:`finally` clause, that :keyword:`!finally` clause is executed " "before really leaving the loop." msgstr "" -#: ../../reference/simple_stmts.rst:701 +#: ../../reference/simple_stmts.rst:702 msgid "The :keyword:`!continue` statement" msgstr "" -#: ../../reference/simple_stmts.rst:713 +#: ../../reference/simple_stmts.rst:714 msgid "" ":keyword:`continue` may only occur syntactically nested in a :keyword:`for` " "or :keyword:`while` loop, but not nested in a function or class definition " @@ -682,41 +682,41 @@ msgid "" "loop." msgstr "" -#: ../../reference/simple_stmts.rst:717 +#: ../../reference/simple_stmts.rst:718 msgid "" "When :keyword:`continue` passes control out of a :keyword:`try` statement " "with a :keyword:`finally` clause, that :keyword:`!finally` clause is " "executed before really starting the next loop cycle." msgstr "" -#: ../../reference/simple_stmts.rst:726 +#: ../../reference/simple_stmts.rst:727 msgid "The :keyword:`!import` statement" msgstr "" -#: ../../reference/simple_stmts.rst:747 +#: ../../reference/simple_stmts.rst:748 msgid "" "The basic import statement (no :keyword:`from` clause) is executed in two " "steps:" msgstr "" -#: ../../reference/simple_stmts.rst:750 +#: ../../reference/simple_stmts.rst:751 msgid "find a module, loading and initializing it if necessary" msgstr "" -#: ../../reference/simple_stmts.rst:751 +#: ../../reference/simple_stmts.rst:752 msgid "" "define a name or names in the local namespace for the scope where the :" "keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:754 +#: ../../reference/simple_stmts.rst:755 msgid "" "When the statement contains multiple clauses (separated by commas) the two " "steps are carried out separately for each clause, just as though the clauses " "had been separated out into individual import statements." msgstr "" -#: ../../reference/simple_stmts.rst:759 +#: ../../reference/simple_stmts.rst:760 msgid "" "The details of the first step, finding and loading modules, are described in " "greater detail in the section on the :ref:`import system `, " @@ -727,26 +727,26 @@ msgid "" "module, which includes execution of the module's code." msgstr "" -#: ../../reference/simple_stmts.rst:767 +#: ../../reference/simple_stmts.rst:768 msgid "" "If the requested module is retrieved successfully, it will be made available " "in the local namespace in one of three ways:" msgstr "" -#: ../../reference/simple_stmts.rst:772 +#: ../../reference/simple_stmts.rst:773 msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -#: ../../reference/simple_stmts.rst:774 +#: ../../reference/simple_stmts.rst:775 msgid "" "If no other name is specified, and the module being imported is a top level " "module, the module's name is bound in the local namespace as a reference to " "the imported module" msgstr "" -#: ../../reference/simple_stmts.rst:777 +#: ../../reference/simple_stmts.rst:778 msgid "" "If the module being imported is *not* a top level module, then the name of " "the top level package that contains the module is bound in the local " @@ -754,56 +754,56 @@ msgid "" "be accessed using its full qualified name rather than directly" msgstr "" -#: ../../reference/simple_stmts.rst:787 +#: ../../reference/simple_stmts.rst:788 msgid "The :keyword:`from` form uses a slightly more complex process:" msgstr "" -#: ../../reference/simple_stmts.rst:789 +#: ../../reference/simple_stmts.rst:790 msgid "" "find the module specified in the :keyword:`from` clause, loading and " "initializing it if necessary;" msgstr "" -#: ../../reference/simple_stmts.rst:791 +#: ../../reference/simple_stmts.rst:792 msgid "for each of the identifiers specified in the :keyword:`import` clauses:" msgstr "" -#: ../../reference/simple_stmts.rst:793 +#: ../../reference/simple_stmts.rst:794 msgid "check if the imported module has an attribute by that name" msgstr "" -#: ../../reference/simple_stmts.rst:794 +#: ../../reference/simple_stmts.rst:795 msgid "" "if not, attempt to import a submodule with that name and then check the " "imported module again for that attribute" msgstr "" -#: ../../reference/simple_stmts.rst:796 +#: ../../reference/simple_stmts.rst:797 msgid "if the attribute is not found, :exc:`ImportError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:797 +#: ../../reference/simple_stmts.rst:798 msgid "" "otherwise, a reference to that value is stored in the local namespace, using " "the name in the :keyword:`!as` clause if it is present, otherwise using the " "attribute name" msgstr "" -#: ../../reference/simple_stmts.rst:801 +#: ../../reference/simple_stmts.rst:802 msgid "Examples::" msgstr "" "範例:\n" "\n" "::" -#: ../../reference/simple_stmts.rst:811 +#: ../../reference/simple_stmts.rst:812 msgid "" "If the list of identifiers is replaced by a star (``'*'``), all public names " "defined in the module are bound in the local namespace for the scope where " "the :keyword:`import` statement occurs." msgstr "" -#: ../../reference/simple_stmts.rst:817 +#: ../../reference/simple_stmts.rst:818 msgid "" "The *public names* defined by a module are determined by checking the " "module's namespace for a variable named ``__all__``; if defined, it must be " @@ -816,14 +816,14 @@ msgid "" "API (such as library modules which were imported and used within the module)." msgstr "" -#: ../../reference/simple_stmts.rst:827 +#: ../../reference/simple_stmts.rst:828 msgid "" "The wild card form of import --- ``from module import *`` --- is only " "allowed at the module level. Attempting to use it in class or function " "definitions will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/simple_stmts.rst:834 +#: ../../reference/simple_stmts.rst:835 msgid "" "When specifying what module to import you do not have to specify the " "absolute name of the module. When a module or package is contained within " @@ -840,13 +840,13 @@ msgid "" "the :ref:`relativeimports` section." msgstr "" -#: ../../reference/simple_stmts.rst:848 +#: ../../reference/simple_stmts.rst:849 msgid "" ":func:`importlib.import_module` is provided to support applications that " "determine dynamically the modules to be loaded." msgstr "" -#: ../../reference/simple_stmts.rst:851 +#: ../../reference/simple_stmts.rst:852 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." @@ -855,18 +855,18 @@ msgstr "" "引發一個附帶引數 ``module``、``filename``、``sys.path``、``sys.meta_path``、" "``sys.path_hooks`` 的\\ :ref:`稽核事件 ` ``import``。" -#: ../../reference/simple_stmts.rst:856 +#: ../../reference/simple_stmts.rst:857 msgid "Future statements" msgstr "" -#: ../../reference/simple_stmts.rst:862 +#: ../../reference/simple_stmts.rst:863 msgid "" "A :dfn:`future statement` is a directive to the compiler that a particular " "module should be compiled using syntax or semantics that will be available " "in a specified future release of Python where the feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:866 +#: ../../reference/simple_stmts.rst:867 msgid "" "The future statement is intended to ease migration to future versions of " "Python that introduce incompatible changes to the language. It allows use " @@ -874,35 +874,35 @@ msgid "" "feature becomes standard." msgstr "" -#: ../../reference/simple_stmts.rst:878 +#: ../../reference/simple_stmts.rst:879 msgid "" "A future statement must appear near the top of the module. The only lines " "that can appear before a future statement are:" msgstr "" -#: ../../reference/simple_stmts.rst:881 +#: ../../reference/simple_stmts.rst:882 msgid "the module docstring (if any)," msgstr "" -#: ../../reference/simple_stmts.rst:882 +#: ../../reference/simple_stmts.rst:883 msgid "comments," msgstr "" -#: ../../reference/simple_stmts.rst:883 +#: ../../reference/simple_stmts.rst:884 msgid "blank lines, and" msgstr "" -#: ../../reference/simple_stmts.rst:884 +#: ../../reference/simple_stmts.rst:885 msgid "other future statements." msgstr "" -#: ../../reference/simple_stmts.rst:886 +#: ../../reference/simple_stmts.rst:887 msgid "" "The only feature that requires using the future statement is ``annotations`` " "(see :pep:`563`)." msgstr "" -#: ../../reference/simple_stmts.rst:889 +#: ../../reference/simple_stmts.rst:890 msgid "" "All historical features enabled by the future statement are still recognized " "by Python 3. The list includes ``absolute_import``, ``division``, " @@ -912,7 +912,7 @@ msgid "" "compatibility." msgstr "" -#: ../../reference/simple_stmts.rst:896 +#: ../../reference/simple_stmts.rst:897 msgid "" "A future statement is recognized and treated specially at compile time: " "Changes to the semantics of core constructs are often implemented by " @@ -922,37 +922,37 @@ msgid "" "cannot be pushed off until runtime." msgstr "" -#: ../../reference/simple_stmts.rst:903 +#: ../../reference/simple_stmts.rst:904 msgid "" "For any given release, the compiler knows which feature names have been " "defined, and raises a compile-time error if a future statement contains a " "feature not known to it." msgstr "" -#: ../../reference/simple_stmts.rst:907 +#: ../../reference/simple_stmts.rst:908 msgid "" "The direct runtime semantics are the same as for any import statement: there " "is a standard module :mod:`__future__`, described later, and it will be " "imported in the usual way at the time the future statement is executed." msgstr "" -#: ../../reference/simple_stmts.rst:911 +#: ../../reference/simple_stmts.rst:912 msgid "" "The interesting runtime semantics depend on the specific feature enabled by " "the future statement." msgstr "" -#: ../../reference/simple_stmts.rst:914 +#: ../../reference/simple_stmts.rst:915 msgid "Note that there is nothing special about the statement::" msgstr "" -#: ../../reference/simple_stmts.rst:918 +#: ../../reference/simple_stmts.rst:919 msgid "" "That is not a future statement; it's an ordinary import statement with no " "special semantics or syntax restrictions." msgstr "" -#: ../../reference/simple_stmts.rst:921 +#: ../../reference/simple_stmts.rst:922 msgid "" "Code compiled by calls to the built-in functions :func:`exec` and :func:" "`compile` that occur in a module :mod:`M` containing a future statement " @@ -961,7 +961,7 @@ msgid "" "--- see the documentation of that function for details." msgstr "" -#: ../../reference/simple_stmts.rst:927 +#: ../../reference/simple_stmts.rst:928 msgid "" "A future statement typed at an interactive interpreter prompt will take " "effect for the rest of the interpreter session. If an interpreter is " @@ -970,19 +970,19 @@ msgid "" "interactive session started after the script is executed." msgstr "" -#: ../../reference/simple_stmts.rst:935 +#: ../../reference/simple_stmts.rst:936 msgid ":pep:`236` - Back to the __future__" msgstr "" -#: ../../reference/simple_stmts.rst:936 +#: ../../reference/simple_stmts.rst:937 msgid "The original proposal for the __future__ mechanism." msgstr "" -#: ../../reference/simple_stmts.rst:942 +#: ../../reference/simple_stmts.rst:943 msgid "The :keyword:`!global` statement" msgstr "" -#: ../../reference/simple_stmts.rst:952 +#: ../../reference/simple_stmts.rst:953 msgid "" "The :keyword:`global` statement is a declaration which holds for the entire " "current code block. It means that the listed identifiers are to be " @@ -991,13 +991,13 @@ msgid "" "globals without being declared global." msgstr "" -#: ../../reference/simple_stmts.rst:958 +#: ../../reference/simple_stmts.rst:959 msgid "" "Names listed in a :keyword:`global` statement must not be used in the same " "code block textually preceding that :keyword:`!global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:961 +#: ../../reference/simple_stmts.rst:962 msgid "" "Names listed in a :keyword:`global` statement must not be defined as formal " "parameters, or as targets in :keyword:`with` statements or :keyword:`except` " @@ -1005,14 +1005,14 @@ msgid "" "function definition, :keyword:`import` statement, or variable annotation." msgstr "" -#: ../../reference/simple_stmts.rst:968 +#: ../../reference/simple_stmts.rst:969 msgid "" "The current implementation does not enforce some of these restrictions, but " "programs should not abuse this freedom, as future implementations may " "enforce them or silently change the meaning of the program." msgstr "" -#: ../../reference/simple_stmts.rst:977 +#: ../../reference/simple_stmts.rst:978 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1024,11 +1024,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:989 +#: ../../reference/simple_stmts.rst:990 msgid "The :keyword:`!nonlocal` statement" msgstr "" -#: ../../reference/simple_stmts.rst:997 +#: ../../reference/simple_stmts.rst:998 msgid "" "The :keyword:`nonlocal` statement causes the listed identifiers to refer to " "previously bound variables in the nearest enclosing scope excluding globals. " @@ -1037,7 +1037,7 @@ msgid "" "variables outside of the local scope besides the global (module) scope." msgstr "" -#: ../../reference/simple_stmts.rst:1003 +#: ../../reference/simple_stmts.rst:1004 msgid "" "Names listed in a :keyword:`nonlocal` statement, unlike those listed in a :" "keyword:`global` statement, must refer to pre-existing bindings in an " @@ -1045,488 +1045,546 @@ msgid "" "be determined unambiguously)." msgstr "" -#: ../../reference/simple_stmts.rst:1008 +#: ../../reference/simple_stmts.rst:1009 msgid "" "Names listed in a :keyword:`nonlocal` statement must not collide with pre-" "existing bindings in the local scope." msgstr "" -#: ../../reference/simple_stmts.rst:1013 +#: ../../reference/simple_stmts.rst:1014 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1014 +#: ../../reference/simple_stmts.rst:1015 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" +#: ../../reference/simple_stmts.rst:1020 +msgid "The :keyword:`!type` statement" +msgstr "" + +#: ../../reference/simple_stmts.rst:1027 +msgid "" +"The :keyword:`!type` statement declares a type alias, which is an instance " +"of :class:`typing.TypeAliasType`." +msgstr "" + +#: ../../reference/simple_stmts.rst:1030 +msgid "For example, the following statement creates a type alias::" +msgstr "" + +#: ../../reference/simple_stmts.rst:1034 +msgid "This code is roughly equivalent to::" +msgstr "" + +#: ../../reference/simple_stmts.rst:1040 +msgid "" +"``annotation-def`` indicates an :ref:`annotation scope `, " +"which behaves mostly like a function, but with several small differences." +msgstr "" + +#: ../../reference/simple_stmts.rst:1043 +msgid "" +"The value of the type alias is evaluated in the annotation scope. It is not " +"evaluated when the type alias is created, but only when the value is " +"accessed through the type alias's :attr:`!__value__` attribute (see :ref:" +"`lazy-evaluation`). This allows the type alias to refer to names that are " +"not yet defined." +msgstr "" + +#: ../../reference/simple_stmts.rst:1049 +msgid "" +"Type aliases may be made generic by adding a :ref:`type parameter list ` after the name. See :ref:`generic-type-aliases` for more." +msgstr "" + +#: ../../reference/simple_stmts.rst:1052 +msgid ":keyword:`!type` is a :ref:`soft keyword `." +msgstr "" + +#: ../../reference/simple_stmts.rst:1059 +msgid ":pep:`695` - Type Parameter Syntax" +msgstr "" + +#: ../../reference/simple_stmts.rst:1059 +msgid "" +"Introduced the :keyword:`!type` statement and syntax for generic classes and " +"functions." +msgstr "" + #: ../../reference/simple_stmts.rst:8 msgid "simple" msgstr "" -#: ../../reference/simple_stmts.rst:8 ../../reference/simple_stmts.rst:38 -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:262 -#: ../../reference/simple_stmts.rst:321 ../../reference/simple_stmts.rst:378 -#: ../../reference/simple_stmts.rst:421 ../../reference/simple_stmts.rst:443 -#: ../../reference/simple_stmts.rst:456 ../../reference/simple_stmts.rst:482 -#: ../../reference/simple_stmts.rst:519 ../../reference/simple_stmts.rst:555 -#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:858 -#: ../../reference/simple_stmts.rst:944 ../../reference/simple_stmts.rst:991 +#: ../../reference/simple_stmts.rst:8 ../../reference/simple_stmts.rst:39 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:322 ../../reference/simple_stmts.rst:379 +#: ../../reference/simple_stmts.rst:422 ../../reference/simple_stmts.rst:444 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:483 +#: ../../reference/simple_stmts.rst:520 ../../reference/simple_stmts.rst:556 +#: ../../reference/simple_stmts.rst:670 ../../reference/simple_stmts.rst:704 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:859 +#: ../../reference/simple_stmts.rst:945 ../../reference/simple_stmts.rst:992 +#: ../../reference/simple_stmts.rst:1022 msgid "statement" msgstr "statement(陳述式)" -#: ../../reference/simple_stmts.rst:38 ../../reference/simple_stmts.rst:41 +#: ../../reference/simple_stmts.rst:39 ../../reference/simple_stmts.rst:42 msgid "expression" msgstr "" -#: ../../reference/simple_stmts.rst:38 ../../reference/simple_stmts.rst:41 -#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 -#: ../../reference/simple_stmts.rst:195 ../../reference/simple_stmts.rst:443 +#: ../../reference/simple_stmts.rst:39 ../../reference/simple_stmts.rst:42 +#: ../../reference/simple_stmts.rst:105 ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:196 ../../reference/simple_stmts.rst:444 msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:55 ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:973 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "repr" msgstr "" -#: ../../reference/simple_stmts.rst:55 ../../reference/simple_stmts.rst:74 -#: ../../reference/simple_stmts.rst:186 ../../reference/simple_stmts.rst:195 -#: ../../reference/simple_stmts.rst:206 ../../reference/simple_stmts.rst:577 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:75 +#: ../../reference/simple_stmts.rst:187 ../../reference/simple_stmts.rst:196 +#: ../../reference/simple_stmts.rst:207 ../../reference/simple_stmts.rst:578 msgid "object" msgstr "object(物件)" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "None" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "string" msgstr "string(字串)" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "conversion" msgstr "conversion" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "output" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "standard" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "writing" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "values" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "procedure" msgstr "" -#: ../../reference/simple_stmts.rst:55 +#: ../../reference/simple_stmts.rst:56 msgid "call" msgstr "" -#: ../../reference/simple_stmts.rst:74 +#: ../../reference/simple_stmts.rst:75 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/simple_stmts.rst:74 +#: ../../reference/simple_stmts.rst:75 msgid "assignment statement" msgstr "assignment statement(賦值陳述式)" -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:115 -#: ../../reference/simple_stmts.rst:158 ../../reference/simple_stmts.rst:186 -#: ../../reference/simple_stmts.rst:219 ../../reference/simple_stmts.rst:262 -#: ../../reference/simple_stmts.rst:321 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:159 ../../reference/simple_stmts.rst:187 +#: ../../reference/simple_stmts.rst:220 ../../reference/simple_stmts.rst:263 +#: ../../reference/simple_stmts.rst:322 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:728 -#: ../../reference/simple_stmts.rst:783 ../../reference/simple_stmts.rst:944 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:729 +#: ../../reference/simple_stmts.rst:784 ../../reference/simple_stmts.rst:945 msgid "binding" msgstr "binding(繫結)" -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:456 -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:783 -#: ../../reference/simple_stmts.rst:944 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:457 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:784 +#: ../../reference/simple_stmts.rst:945 msgid "name" msgstr "name(名稱)" -#: ../../reference/simple_stmts.rst:74 +#: ../../reference/simple_stmts.rst:75 msgid "rebinding" msgstr "rebinding(重新繫結)" -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:186 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:187 msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/simple_stmts.rst:74 ../../reference/simple_stmts.rst:158 -#: ../../reference/simple_stmts.rst:465 +#: ../../reference/simple_stmts.rst:75 ../../reference/simple_stmts.rst:159 +#: ../../reference/simple_stmts.rst:466 msgid "attribute" msgstr "attribute(屬性)" -#: ../../reference/simple_stmts.rst:104 ../../reference/simple_stmts.rst:115 -#: ../../reference/simple_stmts.rst:443 ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:105 ../../reference/simple_stmts.rst:116 +#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:683 msgid "target" msgstr "target" -#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:378 -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:944 -#: ../../reference/simple_stmts.rst:991 +#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:379 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:945 +#: ../../reference/simple_stmts.rst:992 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:116 msgid "in target list" msgstr "於目標列表中" -#: ../../reference/simple_stmts.rst:115 ../../reference/simple_stmts.rst:809 +#: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:810 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:116 msgid "in assignment target list" msgstr "於賦值目標列表中" -#: ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:116 msgid "[] (square brackets)" msgstr "[] (方括號)" -#: ../../reference/simple_stmts.rst:115 +#: ../../reference/simple_stmts.rst:116 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/simple_stmts.rst:152 +#: ../../reference/simple_stmts.rst:153 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/simple_stmts.rst:186 +#: ../../reference/simple_stmts.rst:187 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/simple_stmts.rst:195 +#: ../../reference/simple_stmts.rst:196 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/simple_stmts.rst:206 +#: ../../reference/simple_stmts.rst:207 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/simple_stmts.rst:206 +#: ../../reference/simple_stmts.rst:207 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../reference/simple_stmts.rst:219 +#: ../../reference/simple_stmts.rst:220 msgid "slicing" msgstr "slice(切片)" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "augmented" msgstr "augmented(增強)" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "assignment, augmented" msgstr "assignment(賦值)、augmented(增強)" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "+=" msgstr "+=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "augmented assignment" msgstr "augmented assignment(增強賦值)" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "-=" msgstr "-=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "*=" msgstr "*=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "/=" msgstr "/=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "%=" msgstr "%=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "&=" msgstr "&=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "^=" msgstr "^=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "|=" msgstr "|=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "**=" msgstr "**=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "//=" msgstr "//=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid ">>=" msgstr ">>=" -#: ../../reference/simple_stmts.rst:262 +#: ../../reference/simple_stmts.rst:263 msgid "<<=" msgstr "<<=" -#: ../../reference/simple_stmts.rst:321 +#: ../../reference/simple_stmts.rst:322 msgid "annotated" msgstr "annotated(註釋)" -#: ../../reference/simple_stmts.rst:321 +#: ../../reference/simple_stmts.rst:322 msgid "assignment, annotated" msgstr "assignment(賦值)、annotated(註釋)" -#: ../../reference/simple_stmts.rst:321 +#: ../../reference/simple_stmts.rst:322 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/simple_stmts.rst:321 +#: ../../reference/simple_stmts.rst:322 msgid "annotated variable" msgstr "annotated variable(註釋變數)" -#: ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:379 msgid "assert" msgstr "assert" -#: ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:379 msgid "debugging" msgstr "debugging(除錯)" -#: ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:379 msgid "assertions" msgstr "assertions(斷言)" -#: ../../reference/simple_stmts.rst:378 +#: ../../reference/simple_stmts.rst:379 msgid "expression list" msgstr "expression list(運算式列表)" -#: ../../reference/simple_stmts.rst:399 +#: ../../reference/simple_stmts.rst:400 msgid "__debug__" msgstr "__debug__" -#: ../../reference/simple_stmts.rst:399 ../../reference/simple_stmts.rst:519 -#: ../../reference/simple_stmts.rst:555 ../../reference/simple_stmts.rst:587 -#: ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:400 ../../reference/simple_stmts.rst:520 +#: ../../reference/simple_stmts.rst:556 ../../reference/simple_stmts.rst:588 +#: ../../reference/simple_stmts.rst:729 msgid "exception" msgstr "exception(例外)" -#: ../../reference/simple_stmts.rst:399 +#: ../../reference/simple_stmts.rst:400 msgid "AssertionError" msgstr "AssertionError" -#: ../../reference/simple_stmts.rst:421 +#: ../../reference/simple_stmts.rst:422 msgid "pass" msgstr "pass" -#: ../../reference/simple_stmts.rst:421 +#: ../../reference/simple_stmts.rst:422 msgid "null" msgstr "null" -#: ../../reference/simple_stmts.rst:421 +#: ../../reference/simple_stmts.rst:422 msgid "operation" msgstr "operation(操作)" -#: ../../reference/simple_stmts.rst:443 +#: ../../reference/simple_stmts.rst:444 msgid "del" msgstr "del" -#: ../../reference/simple_stmts.rst:443 ../../reference/simple_stmts.rst:465 +#: ../../reference/simple_stmts.rst:444 ../../reference/simple_stmts.rst:466 msgid "deletion" msgstr "deletion(刪除)" -#: ../../reference/simple_stmts.rst:456 ../../reference/simple_stmts.rst:944 +#: ../../reference/simple_stmts.rst:457 ../../reference/simple_stmts.rst:945 msgid "global" msgstr "global" -#: ../../reference/simple_stmts.rst:456 +#: ../../reference/simple_stmts.rst:457 msgid "unbinding" msgstr "unbinding(解除繫結)" -#: ../../reference/simple_stmts.rst:482 +#: ../../reference/simple_stmts.rst:483 msgid "return" msgstr "return (回傳)" -#: ../../reference/simple_stmts.rst:482 ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:483 ../../reference/simple_stmts.rst:520 msgid "function" msgstr "function (函式)" -#: ../../reference/simple_stmts.rst:482 +#: ../../reference/simple_stmts.rst:483 msgid "definition" msgstr "definition(定義)" -#: ../../reference/simple_stmts.rst:482 +#: ../../reference/simple_stmts.rst:483 msgid "class" msgstr "class(類別)" -#: ../../reference/simple_stmts.rst:498 ../../reference/simple_stmts.rst:682 -#: ../../reference/simple_stmts.rst:691 ../../reference/simple_stmts.rst:703 -#: ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:683 +#: ../../reference/simple_stmts.rst:692 ../../reference/simple_stmts.rst:704 +#: ../../reference/simple_stmts.rst:729 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/simple_stmts.rst:498 ../../reference/simple_stmts.rst:691 -#: ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:499 ../../reference/simple_stmts.rst:692 +#: ../../reference/simple_stmts.rst:704 msgid "finally" msgstr "finally" -#: ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:520 msgid "yield" msgstr "yield" -#: ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:520 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:520 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../reference/simple_stmts.rst:519 +#: ../../reference/simple_stmts.rst:520 msgid "StopIteration" msgstr "StopIteration" -#: ../../reference/simple_stmts.rst:555 +#: ../../reference/simple_stmts.rst:556 msgid "raise" msgstr "raise" -#: ../../reference/simple_stmts.rst:555 +#: ../../reference/simple_stmts.rst:556 msgid "raising" msgstr "raiseing" -#: ../../reference/simple_stmts.rst:555 +#: ../../reference/simple_stmts.rst:556 msgid "__traceback__ (exception attribute)" msgstr "__traceback__(例外屬性)" -#: ../../reference/simple_stmts.rst:577 +#: ../../reference/simple_stmts.rst:578 msgid "traceback" msgstr "traceback" -#: ../../reference/simple_stmts.rst:587 +#: ../../reference/simple_stmts.rst:588 msgid "chaining" msgstr "chaining(鏈結)" -#: ../../reference/simple_stmts.rst:587 +#: ../../reference/simple_stmts.rst:588 msgid "__cause__ (exception attribute)" msgstr "__cause__(例外屬性)" -#: ../../reference/simple_stmts.rst:587 +#: ../../reference/simple_stmts.rst:588 msgid "__context__ (exception attribute)" msgstr "__context__(例外屬性)" -#: ../../reference/simple_stmts.rst:669 +#: ../../reference/simple_stmts.rst:670 msgid "break" msgstr "break" -#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:670 ../../reference/simple_stmts.rst:704 msgid "for" msgstr "for" -#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:670 ../../reference/simple_stmts.rst:704 msgid "while" msgstr "while" -#: ../../reference/simple_stmts.rst:669 ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:670 ../../reference/simple_stmts.rst:704 msgid "loop" msgstr "loop(迴圈)" -#: ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:683 msgid "else" msgstr "else" -#: ../../reference/simple_stmts.rst:682 +#: ../../reference/simple_stmts.rst:683 msgid "loop control" msgstr "loop control(迴圈控制)" -#: ../../reference/simple_stmts.rst:703 +#: ../../reference/simple_stmts.rst:704 msgid "continue" msgstr "continue" -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:831 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:832 msgid "import" msgstr "import(引入)" -#: ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:729 msgid "module" msgstr "module(模組)" -#: ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:729 msgid "importing" msgstr "importing(引入)" -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:783 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:784 msgid "from" msgstr "from" -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:770 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:771 msgid "as" msgstr "as" -#: ../../reference/simple_stmts.rst:728 +#: ../../reference/simple_stmts.rst:729 msgid "ImportError" msgstr "ImportError" -#: ../../reference/simple_stmts.rst:728 ../../reference/simple_stmts.rst:770 -#: ../../reference/simple_stmts.rst:783 ../../reference/simple_stmts.rst:809 +#: ../../reference/simple_stmts.rst:729 ../../reference/simple_stmts.rst:771 +#: ../../reference/simple_stmts.rst:784 ../../reference/simple_stmts.rst:810 msgid "import statement" msgstr "import statement(引入陳述式)" -#: ../../reference/simple_stmts.rst:815 +#: ../../reference/simple_stmts.rst:816 msgid "__all__ (optional module attribute)" msgstr "__all__(可選模組屬性)" -#: ../../reference/simple_stmts.rst:831 +#: ../../reference/simple_stmts.rst:832 msgid "relative" msgstr "relative(相對)" -#: ../../reference/simple_stmts.rst:858 +#: ../../reference/simple_stmts.rst:859 msgid "future" msgstr "future" -#: ../../reference/simple_stmts.rst:858 +#: ../../reference/simple_stmts.rst:859 msgid "__future__" msgstr "__future__" -#: ../../reference/simple_stmts.rst:858 +#: ../../reference/simple_stmts.rst:859 msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:944 ../../reference/simple_stmts.rst:991 +#: ../../reference/simple_stmts.rst:945 ../../reference/simple_stmts.rst:992 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:973 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:973 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:972 +#: ../../reference/simple_stmts.rst:973 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:991 +#: ../../reference/simple_stmts.rst:992 msgid "nonlocal" msgstr "nonlocal" + +#: ../../reference/simple_stmts.rst:1022 +msgid "type" +msgstr "" diff --git a/tutorial/classes.po b/tutorial/classes.po index 9d67acc7fc..347741b58a 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -852,11 +852,12 @@ msgstr "" "::" #: ../../tutorial/classes.rst:584 +#, fuzzy msgid "" -"The name :class:`BaseClassName` must be defined in a scope containing the " -"derived class definition. In place of a base class name, other arbitrary " -"expressions are also allowed. This can be useful, for example, when the " -"base class is defined in another module::" +"The name :class:`BaseClassName` must be defined in a namespace accessible " +"from the scope containing the derived class definition. In place of a base " +"class name, other arbitrary expressions are also allowed. This can be " +"useful, for example, when the base class is defined in another module::" msgstr "" "名稱 :class:`BaseClassName` 被定義的作用域必須是包含 derived class 定義的作用" "域。要代替 base class(基底類別)的名稱,用其他任意的運算式也是被允許的。這會" @@ -864,7 +865,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:591 +#: ../../tutorial/classes.rst:592 msgid "" "Execution of a derived class definition proceeds the same as for a base " "class. When the class object is constructed, the base class is remembered. " @@ -878,7 +879,7 @@ msgstr "" "class 中找到,則會繼續在 base class 中搜尋。假如該 base class 本身也是衍生自" "其他 class,則這個規則會遞迴地被應用。" -#: ../../tutorial/classes.rst:597 +#: ../../tutorial/classes.rst:598 msgid "" "There's nothing special about instantiation of derived classes: " "``DerivedClassName()`` creates a new instance of the class. Method " @@ -891,7 +892,7 @@ msgstr "" "果需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 " "method 的參照是有效的。" -#: ../../tutorial/classes.rst:603 +#: ../../tutorial/classes.rst:604 msgid "" "Derived classes may override methods of their base classes. Because methods " "have no special privileges when calling other methods of the same object, a " @@ -905,7 +906,7 @@ msgstr "" "class 中的 method。(給 C++ 程式設計師:Python 中所有 method 實際上都是 " "``virtual``。)" -#: ../../tutorial/classes.rst:609 +#: ../../tutorial/classes.rst:610 msgid "" "An overriding method in a derived class may in fact want to extend rather " "than simply replace the base class method of the same name. There is a " @@ -920,11 +921,11 @@ msgstr "" "用。(請注意,只有在 base class 在全域作用域可以用 ``BaseClassName`` 被存取" "時,這方法才有效。)" -#: ../../tutorial/classes.rst:616 +#: ../../tutorial/classes.rst:617 msgid "Python has two built-in functions that work with inheritance:" msgstr "Python 有兩個內建函式可以用於繼承:" -#: ../../tutorial/classes.rst:618 +#: ../../tutorial/classes.rst:619 msgid "" "Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)`` " "will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " @@ -934,7 +935,7 @@ msgstr "" "在 ``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " "``True``。" -#: ../../tutorial/classes.rst:622 +#: ../../tutorial/classes.rst:623 msgid "" "Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)`` " "is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " @@ -946,11 +947,11 @@ msgstr "" "``issubclass(float, int)`` 是 ``False``,因為 :class:`float` 並不是 :class:" "`int` 的 subclass。" -#: ../../tutorial/classes.rst:632 +#: ../../tutorial/classes.rst:633 msgid "Multiple Inheritance" msgstr "多重繼承" -#: ../../tutorial/classes.rst:634 +#: ../../tutorial/classes.rst:635 msgid "" "Python supports a form of multiple inheritance as well. A class definition " "with multiple base classes looks like this::" @@ -960,7 +961,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:644 +#: ../../tutorial/classes.rst:645 msgid "" "For most purposes, in the simplest cases, you can think of the search for " "attributes inherited from a parent class as depth-first, left-to-right, not " @@ -976,7 +977,7 @@ msgstr "" "class:`Base1` 搜尋它,接著(遞迴地)在 :class:`Base1` 的 base class 中搜尋," "假如在那裡又沒有找到的話,會在 :class:`Base2` 搜尋,依此類推。" -#: ../../tutorial/classes.rst:651 +#: ../../tutorial/classes.rst:652 msgid "" "In fact, it is slightly more complex than that; the method resolution order " "changes dynamically to support cooperative calls to :func:`super`. This " @@ -988,7 +989,7 @@ msgstr "" "`super` 的合作呼叫。這個方式在其他的多重繼承語言中,稱為呼叫下一個方法 (call-" "next-method),且比在單一繼承語言中的 super call(超級呼叫)來得更強大。" -#: ../../tutorial/classes.rst:657 +#: ../../tutorial/classes.rst:658 msgid "" "Dynamic ordering is necessary because all cases of multiple inheritance " "exhibit one or more diamond relationships (where at least one of the parent " @@ -1014,11 +1015,11 @@ msgstr "" "靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python." "org/download/releases/2.3/mro/。" -#: ../../tutorial/classes.rst:674 +#: ../../tutorial/classes.rst:675 msgid "Private Variables" msgstr "私有變數" -#: ../../tutorial/classes.rst:676 +#: ../../tutorial/classes.rst:677 msgid "" "\"Private\" instance variables that cannot be accessed except from inside an " "object don't exist in Python. However, there is a convention that is " @@ -1033,7 +1034,7 @@ msgstr "" "(無論它是函式、方法或是資料成員)。這被視為一個實作細節,如有調整,亦不另行" "通知。" -#: ../../tutorial/classes.rst:686 +#: ../../tutorial/classes.rst:687 msgid "" "Since there is a valid use-case for class-private members (namely to avoid " "name clashes of names with names defined by subclasses), there is limited " @@ -1051,7 +1052,7 @@ msgstr "" "``classname`` 就是去掉前導下底線的當前 class 名稱。只要這個修飾是在 class 的" "定義之中發生,它就會在不考慮該物件名稱的語法位置的情況下完成。" -#: ../../tutorial/classes.rst:695 +#: ../../tutorial/classes.rst:696 msgid "" "Name mangling is helpful for letting subclasses override methods without " "breaking intraclass method calls. For example::" @@ -1061,7 +1062,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:717 +#: ../../tutorial/classes.rst:718 msgid "" "The above example would work even if ``MappingSubclass`` were to introduce a " "``__update`` identifier since it is replaced with ``_Mapping__update`` in " @@ -1072,7 +1073,7 @@ msgstr "" "作,因為在 ``Mapping`` class 中,它會被替換為 ``_Mapping__update``,而在 " "``MappingSubclass`` class 中,它會被替換為 ``_MappingSubclass__update``。" -#: ../../tutorial/classes.rst:722 +#: ../../tutorial/classes.rst:723 msgid "" "Note that the mangling rules are designed mostly to avoid accidents; it " "still is possible to access or modify a variable that is considered " @@ -1082,7 +1083,7 @@ msgstr "" "請注意,修飾規則是被設計來避免意外;它仍可能存取或修改一個被視為私有的變數。" "這在特殊情況下甚至可能很有用,例如在除錯器 (debugger)。" -#: ../../tutorial/classes.rst:726 +#: ../../tutorial/classes.rst:727 msgid "" "Notice that code passed to ``exec()`` or ``eval()`` does not consider the " "classname of the invoking class to be the current class; this is similar to " @@ -1096,11 +1097,11 @@ msgstr "" "組編譯後 (byte-compiled) 的程式碼。同樣的限制適用於 ``getattr()``," "``setattr()`` 和 ``delattr()``,以及直接參照 ``__dict__`` 時。" -#: ../../tutorial/classes.rst:737 +#: ../../tutorial/classes.rst:738 msgid "Odds and Ends" msgstr "補充說明" -#: ../../tutorial/classes.rst:739 +#: ../../tutorial/classes.rst:740 msgid "" "Sometimes it is useful to have a data type similar to the Pascal \"record\" " "or C \"struct\", bundling together a few named data items. The idiomatic " @@ -1112,7 +1113,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:759 +#: ../../tutorial/classes.rst:760 msgid "" "A piece of Python code that expects a particular abstract data type can " "often be passed a class that emulates the methods of that data type " @@ -1126,7 +1127,7 @@ msgstr "" "物件來格式化某些資料,你也可以定義一個有 :meth:`read` 和 :meth:`!readline` " "method 的 class 作為替代方式,從字串緩衝區取得資料,並將其作為引數來傳遞。" -#: ../../tutorial/classes.rst:770 +#: ../../tutorial/classes.rst:771 msgid "" "Instance method objects have attributes, too: ``m.__self__`` is the instance " "object with the method :meth:`m`, and ``m.__func__`` is the function object " @@ -1135,11 +1136,11 @@ msgstr "" "實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`m` 的實例" "物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" -#: ../../tutorial/classes.rst:778 +#: ../../tutorial/classes.rst:779 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:780 +#: ../../tutorial/classes.rst:781 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1149,7 +1150,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:794 +#: ../../tutorial/classes.rst:795 msgid "" "This style of access is clear, concise, and convenient. The use of " "iterators pervades and unifies Python. Behind the scenes, the :keyword:" @@ -1171,7 +1172,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:819 +#: ../../tutorial/classes.rst:820 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " "iterator behavior to your classes. Define an :meth:`__iter__` method which " @@ -1185,11 +1186,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:856 +#: ../../tutorial/classes.rst:857 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:858 +#: ../../tutorial/classes.rst:859 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1205,7 +1206,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:879 +#: ../../tutorial/classes.rst:880 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " @@ -1216,7 +1217,7 @@ msgstr "" "描述。而讓產生器的程式碼更為精簡的原因是,\\ :meth:`__iter__` 和 :meth:" "`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:884 +#: ../../tutorial/classes.rst:885 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " @@ -1227,7 +1228,7 @@ msgstr "" "函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" "清晰。" -#: ../../tutorial/classes.rst:889 +#: ../../tutorial/classes.rst:890 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1238,11 +1239,11 @@ msgstr "" "`StopIteration`\\ 。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容" "易。" -#: ../../tutorial/classes.rst:898 +#: ../../tutorial/classes.rst:899 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:900 +#: ../../tutorial/classes.rst:901 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1257,18 +1258,18 @@ msgstr "" "產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" "省記憶體。" -#: ../../tutorial/classes.rst:907 +#: ../../tutorial/classes.rst:908 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:928 +#: ../../tutorial/classes.rst:929 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:929 +#: ../../tutorial/classes.rst:930 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " @@ -1290,10 +1291,10 @@ msgstr "object(物件)" msgid "method" msgstr "method(方法)" -#: ../../tutorial/classes.rst:683 +#: ../../tutorial/classes.rst:684 msgid "name" msgstr "name(名稱)" -#: ../../tutorial/classes.rst:683 +#: ../../tutorial/classes.rst:684 msgid "mangling" msgstr "mangling(修飾)" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 7429ec20fb..0c6a8ef783 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-27 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-22 14:43+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,16 +23,17 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.3.1\n" -#: ../../tutorial/floatingpoint.rst:9 +#: ../../tutorial/floatingpoint.rst:10 msgid "Floating Point Arithmetic: Issues and Limitations" msgstr "浮點數運算:問題與限制" -#: ../../tutorial/floatingpoint.rst:14 +#: ../../tutorial/floatingpoint.rst:16 +#, fuzzy msgid "" "Floating-point numbers are represented in computer hardware as base 2 " -"(binary) fractions. For example, the **decimal** fraction ``0.125`` has " -"value 1/10 + 2/100 + 5/1000, and in the same way the **binary** fraction " -"``0.001`` has value 0/2 + 0/4 + 1/8. These two fractions have identical " +"(binary) fractions. For example, the **decimal** fraction ``0.625`` has " +"value 6/10 + 2/100 + 5/1000, and in the same way the **binary** fraction " +"``0.101`` has value 1/2 + 0/4 + 1/8. These two fractions have identical " "values, the only real difference being that the first is written in base 10 " "fractional notation, and the second in base 2." msgstr "" @@ -42,7 +43,7 @@ msgstr "" "這兩個小數有相同的數值,而唯一真正的不同在於前者以十進位表示,後者以二進位表" "示。" -#: ../../tutorial/floatingpoint.rst:21 +#: ../../tutorial/floatingpoint.rst:23 msgid "" "Unfortunately, most decimal fractions cannot be represented exactly as " "binary fractions. A consequence is that, in general, the decimal floating-" @@ -52,7 +53,7 @@ msgstr "" "不幸的是,大多數十進位小數無法精準地以二進位小數表示。一般的結果為,你輸入的" "十進位浮點數只能由實際儲存在計算機中的二進位浮點數近似。" -#: ../../tutorial/floatingpoint.rst:26 +#: ../../tutorial/floatingpoint.rst:28 msgid "" "The problem is easier to understand at first in base 10. Consider the " "fraction 1/3. You can approximate that as a base 10 fraction::" @@ -62,14 +63,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:31 ../../tutorial/floatingpoint.rst:35 +#: ../../tutorial/floatingpoint.rst:33 ../../tutorial/floatingpoint.rst:37 msgid "or, better, ::" msgstr "" "或者,更好的近似:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:39 +#: ../../tutorial/floatingpoint.rst:41 msgid "" "and so on. No matter how many digits you're willing to write down, the " "result will never be exactly 1/3, but will be an increasingly better " @@ -78,7 +79,7 @@ msgstr "" "依此類推,不論你使用多少位數表示小數,最後的結果都無法精準地表示 1/3,但你還" "是能越來越精準地表示 1/3。" -#: ../../tutorial/floatingpoint.rst:43 +#: ../../tutorial/floatingpoint.rst:45 msgid "" "In the same way, no matter how many base 2 digits you're willing to use, the " "decimal value 0.1 cannot be represented exactly as a base 2 fraction. In " @@ -89,7 +90,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:49 +#: ../../tutorial/floatingpoint.rst:51 msgid "" "Stop at any finite number of bits, and you get an approximation. On most " "machines today, floats are approximated using a binary fraction with the " @@ -103,13 +104,14 @@ msgstr "" "則是以二為底的指數。在 1/10 的例子中,二進位分數為 ``3602879701896397 / 2 ** " "55``,而這樣的表示十分地接近,但不完全等同於 1/10 的真正數值。" -#: ../../tutorial/floatingpoint.rst:56 +#: ../../tutorial/floatingpoint.rst:58 +#, fuzzy msgid "" "Many users are not aware of the approximation because of the way values are " "displayed. Python only prints a decimal approximation to the true decimal " "value of the binary approximation stored by the machine. On most machines, " "if Python were to print the true decimal value of the binary approximation " -"stored for 0.1, it would have to display ::" +"stored for 0.1, it would have to display::" msgstr "" "由於數值顯示的方式,很多使用者並沒有發現數值是個近似值。Python 只會印出一個十" "進位近似值,其近似了儲存在計算機中的二進位近似值的真正十進位數值。在大多數的" @@ -118,17 +120,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:65 +#: ../../tutorial/floatingpoint.rst:67 +#, fuzzy msgid "" "That is more digits than most people find useful, so Python keeps the number " -"of digits manageable by displaying a rounded value instead ::" +"of digits manageable by displaying a rounded value instead:" msgstr "" "這比一般人感到有用的位數還多,所以 Python 將位數保持在可以接受的範圍,只顯示" "捨入後的數值:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:71 +#: ../../tutorial/floatingpoint.rst:75 msgid "" "Just remember, even though the printed result looks like the exact value of " "1/10, the actual stored value is the nearest representable binary fraction." @@ -136,7 +139,7 @@ msgstr "" "一定要記住,雖然印出的數字看起來是精準的 1/10,但真正儲存的數值是能表示的二進" "位分數中,最接近精準數值的數。" -#: ../../tutorial/floatingpoint.rst:74 +#: ../../tutorial/floatingpoint.rst:78 msgid "" "Interestingly, there are many different decimal numbers that share the same " "nearest approximate binary fraction. For example, the numbers ``0.1`` and " @@ -152,7 +155,7 @@ msgstr "" "``3602879701896397 / 2 ** 55`` 近似。由於這三個十進位數值共用同一個近似值,任" "何一個數值都可以被顯示,同時保持 ``eval(repr(x)) == x``。" -#: ../../tutorial/floatingpoint.rst:82 +#: ../../tutorial/floatingpoint.rst:86 msgid "" "Historically, the Python prompt and built-in :func:`repr` function would " "choose the one with 17 significant digits, ``0.10000000000000001``. " @@ -163,7 +166,7 @@ msgstr "" "有 17 個有效位元的數:``0.10000000000000001``。從 Python 3.1 版開始,Python" "(在大部分的系統上)現在能選擇其中最短的數並簡單地顯示為 ``0.1``。" -#: ../../tutorial/floatingpoint.rst:87 +#: ../../tutorial/floatingpoint.rst:91 msgid "" "Note that this is in the very nature of binary floating-point: this is not a " "bug in Python, and it is not a bug in your code either. You'll see the same " @@ -176,17 +179,18 @@ msgstr "" "中(雖然有些程式語言預設不會\\ *顯示*\\ 該差異,有些甚至是在所有的輸出模式中" "都不會顯示。)" -#: ../../tutorial/floatingpoint.rst:93 +#: ../../tutorial/floatingpoint.rst:97 +#, fuzzy msgid "" "For more pleasant output, you may wish to use string formatting to produce a " -"limited number of significant digits::" +"limited number of significant digits:" msgstr "" "為求更優雅的輸出,你可能想要使用字串的格式化 (string formatting) 產生限定的有" "效位數:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:105 +#: ../../tutorial/floatingpoint.rst:111 msgid "" "It's important to realize that this is, in a real sense, an illusion: you're " "simply rounding the *display* of the true machine value." @@ -194,39 +198,47 @@ msgstr "" "要了解一件很重要的事,在真正意義上,浮點數的表示是一種幻覺:你基本上在捨入真" "正機器數值所\\ *展示的值*\\ 。" -#: ../../tutorial/floatingpoint.rst:108 +#: ../../tutorial/floatingpoint.rst:114 +#, fuzzy msgid "" "One illusion may beget another. For example, since 0.1 is not exactly 1/10, " -"summing three values of 0.1 may not yield exactly 0.3, either::" +"summing three values of 0.1 may not yield exactly 0.3, either:" msgstr "" "這種幻覺可能會產生下一個幻覺。舉例來說,因為 0.1 不是真正的 1/10,把三個 0.1 " "的值相加,也不會產生精準的 0.3:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:114 +#: ../../tutorial/floatingpoint.rst:122 +#, fuzzy msgid "" "Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 " "cannot get any closer to the exact value of 3/10, then pre-rounding with :" -"func:`round` function cannot help::" +"func:`round` function cannot help:" msgstr "" "同時,因為 0.1 不能再更接近精準的 1/10,還有 0.3 不能再更接近精準的 3/10,預" "先用 :func:`round` 函式捨入並不會有幫助:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:121 +#: ../../tutorial/floatingpoint.rst:131 +#, fuzzy msgid "" "Though the numbers cannot be made closer to their intended exact values, " -"the :func:`round` function can be useful for post-rounding so that results " -"with inexact values become comparable to one another::" +"the :func:`math.isclose` function can be useful for comparing inexact values:" msgstr "" "雖然數字不會再更接近他們的精準數值,但 :func:`round` 函式可以對事後的捨入有所" "幫助,如此一來,不精確的數值就變得可以互相比較:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:128 +#: ../../tutorial/floatingpoint.rst:139 +msgid "" +"Alternatively, the :func:`round` function can be used to compare rough " +"approximations::" +msgstr "" + +#: ../../tutorial/floatingpoint.rst:147 msgid "" "Binary floating-point arithmetic holds many surprises like this. The " "problem with \"0.1\" is explained in precise detail below, in the " @@ -244,7 +256,7 @@ msgstr "" "錄。如果想要其他常見問題的更完整描述,可以參考 `The Perils of Floating Point" "(浮點數的風險) `_。" -#: ../../tutorial/floatingpoint.rst:137 +#: ../../tutorial/floatingpoint.rst:156 msgid "" "As that says near the end, \"there are no easy answers.\" Still, don't be " "unduly wary of floating-point! The errors in Python float operations are " @@ -260,7 +272,7 @@ msgstr "" "經相當足夠,但你需要記住,它並非十進位運算,且每一次 float 運算都可能會承受新" "的捨入誤差。" -#: ../../tutorial/floatingpoint.rst:144 +#: ../../tutorial/floatingpoint.rst:163 msgid "" "While pathological cases do exist, for most casual use of floating-point " "arithmetic you'll see the result you expect in the end if you simply round " @@ -273,7 +285,7 @@ msgstr "" "能滿足要求,而若想要更細緻的控制,可參閱\\ :ref:`formatstrings`\\ 中關於 :" "meth:`str.format` method(方法)的格式規範。" -#: ../../tutorial/floatingpoint.rst:150 +#: ../../tutorial/floatingpoint.rst:169 msgid "" "For use cases which require exact decimal representation, try using the :mod:" "`decimal` module which implements decimal arithmetic suitable for accounting " @@ -282,7 +294,7 @@ msgstr "" "對於需要精準十進位表示法的用例,可以試著用 :mod:`decimal` 模組,它可實作適用" "於會計應用程式與高精確度應用程式的十進位運算。" -#: ../../tutorial/floatingpoint.rst:154 +#: ../../tutorial/floatingpoint.rst:173 msgid "" "Another form of exact arithmetic is supported by the :mod:`fractions` module " "which implements arithmetic based on rational numbers (so the numbers like " @@ -291,7 +303,7 @@ msgstr "" "另一種支援精準運算的格式為 :mod:`fractions` 模組,該模組基於有理數來實作運算" "(因此可以精確表示像 1/3 這樣的數字)。" -#: ../../tutorial/floatingpoint.rst:158 +#: ../../tutorial/floatingpoint.rst:177 msgid "" "If you are a heavy user of floating-point operations you should take a look " "at the NumPy package and many other packages for mathematical and " @@ -301,11 +313,12 @@ msgstr "" "如果你是浮點運算的重度使用者,你應該看一下 NumPy 套件,以及由 SciPy 專案提供" "的許多用於數學和統計學運算的其他套件。請參閱 。" -#: ../../tutorial/floatingpoint.rst:162 +#: ../../tutorial/floatingpoint.rst:181 +#, fuzzy msgid "" "Python provides tools that may help on those rare occasions when you really " "*do* want to know the exact value of a float. The :meth:`float." -"as_integer_ratio` method expresses the value of a float as a fraction::" +"as_integer_ratio` method expresses the value of a float as a fraction:" msgstr "" "在罕見情況下,當你\\ *真的*\\ 想知道一個 float 的精準值,Python 提供的工具可" "協助達成。\\ :meth:`float.as_integer_ratio` method 可將一個 float 的值表示為" @@ -313,35 +326,38 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:171 +#: ../../tutorial/floatingpoint.rst:192 +#, fuzzy msgid "" "Since the ratio is exact, it can be used to losslessly recreate the original " -"value::" +"value:" msgstr "" "由於該比率是精準的,它可無損地再現該原始值:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:177 +#: ../../tutorial/floatingpoint.rst:200 +#, fuzzy msgid "" "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " -"again giving the exact value stored by your computer::" +"again giving the exact value stored by your computer:" msgstr "" ":meth:`float.hex` method 以十六進位(基數為 16)表示 float,一樣可以給出你的" "電腦所儲存的精準值:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:183 +#: ../../tutorial/floatingpoint.rst:208 +#, fuzzy msgid "" "This precise hexadecimal representation can be used to reconstruct the float " -"value exactly::" +"value exactly:" msgstr "" "這種精確的十六進位表示法可用於精準地重建 float 值:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:189 +#: ../../tutorial/floatingpoint.rst:216 msgid "" "Since the representation is exact, it is useful for reliably porting values " "across different versions of Python (platform independence) and exchanging " @@ -351,24 +367,34 @@ msgstr "" "由於該表示法是精準的,因此適用於在不同版本的 Python 之間可靠地傳送數值(獨立" "於系統平台),並與支援相同格式的其他語言(如 JAVA 和 C99)交換資料。" -#: ../../tutorial/floatingpoint.rst:193 +#: ../../tutorial/floatingpoint.rst:220 +#, fuzzy msgid "" -"Another helpful tool is the :func:`math.fsum` function which helps mitigate " -"loss-of-precision during summation. It tracks \"lost digits\" as values are " -"added onto a running total. That can make a difference in overall accuracy " -"so that the errors do not accumulate to the point where they affect the " -"final total:" +"Another helpful tool is the :func:`sum` function which helps mitigate loss-" +"of-precision during summation. It uses extended precision for intermediate " +"rounding steps as values are added onto a running total. That can make a " +"difference in overall accuracy so that the errors do not accumulate to the " +"point where they affect the final total:" msgstr "" "另一個有用的工具是 :func:`math.fsum` 函式,能在計算總和時幫忙減少精確度的損" "失。當數值被加到運行中的總計值時,它會追蹤「失去的位數 (lost digits)」。這可" "以明顯改善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的" "程度:" -#: ../../tutorial/floatingpoint.rst:207 +#: ../../tutorial/floatingpoint.rst:233 +msgid "" +"The :func:`math.fsum()` goes further and tracks all of the \"lost digits\" " +"as values are added onto a running total so that the result has only a " +"single rounding. This is slower than :func:`sum` but will be more accurate " +"in uncommon cases where large magnitude inputs mostly cancel each other out " +"leaving a final sum near zero:" +msgstr "" + +#: ../../tutorial/floatingpoint.rst:260 msgid "Representation Error" msgstr "表示法誤差 (Representation Error)" -#: ../../tutorial/floatingpoint.rst:209 +#: ../../tutorial/floatingpoint.rst:262 msgid "" "This section explains the \"0.1\" example in detail, and shows how you can " "perform an exact analysis of cases like this yourself. Basic familiarity " @@ -377,7 +403,7 @@ msgstr "" "本節將會詳細解釋「0.1」的例子,並說明你自己要如何對類似案例執行精準的分析。 " "以下假設你對二進位浮點表示法已有基本程度的熟悉。" -#: ../../tutorial/floatingpoint.rst:213 +#: ../../tutorial/floatingpoint.rst:266 msgid "" ":dfn:`Representation error` refers to the fact that some (most, actually) " "decimal fractions cannot be represented exactly as binary (base 2) " @@ -390,7 +416,7 @@ msgstr "" "Perl、C、C++、JAVA、Fortran 和其他許多)通常不會顯示你期望的精準十進位數字的" "主要原因。" -#: ../../tutorial/floatingpoint.rst:218 +#: ../../tutorial/floatingpoint.rst:271 msgid "" "Why is that? 1/10 is not exactly representable as a binary fraction. Since " "at least 2000, almost all machines use IEEE 754 binary floating-point " @@ -409,43 +435,46 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:229 +#: ../../tutorial/floatingpoint.rst:282 msgid "as ::" msgstr "" "重寫為:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:233 +#: ../../tutorial/floatingpoint.rst:286 +#, fuzzy msgid "" "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " -"2**53``), the best value for *N* is 56::" +"2**53``), the best value for *N* is 56:" msgstr "" "而前面提到 *J* 有精準的 53 位元(即 ``>= 2**52`` 但 ``< 2**53``),所以 *N* " "的最佳數值是 56:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:239 +#: ../../tutorial/floatingpoint.rst:294 +#, fuzzy msgid "" "That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. " -"The best possible value for *J* is then that quotient rounded::" +"The best possible value for *J* is then that quotient rounded:" msgstr "" "意即,要使 *J* 正好有 53 位元,則 56 會是 *N* 的唯一值。而 *J* 最有可能的數值" "就是經過捨入後的該商數:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:246 +#: ../../tutorial/floatingpoint.rst:303 +#, fuzzy msgid "" "Since the remainder is more than half of 10, the best approximation is " -"obtained by rounding up::" +"obtained by rounding up:" msgstr "" "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:252 +#: ../../tutorial/floatingpoint.rst:313 msgid "" "Therefore the best possible approximation to 1/10 in IEEE 754 double " "precision is::" @@ -454,7 +483,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:257 +#: ../../tutorial/floatingpoint.rst:318 msgid "" "Dividing both the numerator and denominator by two reduces the fraction to::" msgstr "" @@ -462,7 +491,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:261 +#: ../../tutorial/floatingpoint.rst:322 msgid "" "Note that since we rounded up, this is actually a little bit larger than " "1/10; if we had not rounded up, the quotient would have been a little bit " @@ -471,7 +500,7 @@ msgstr "" "請注意,由於我們有進位,所以這實際上比 1/10 大了一點;如果我們沒有進位,商數" "將會有點小於 1/10。但在任何情況下都不可能是\\ *精準的* 1/10!" -#: ../../tutorial/floatingpoint.rst:265 +#: ../../tutorial/floatingpoint.rst:326 msgid "" "So the computer never \"sees\" 1/10: what it sees is the exact fraction " "given above, the best IEEE 754 double approximation it can get:" @@ -481,21 +510,23 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:271 +#: ../../tutorial/floatingpoint.rst:334 +#, fuzzy msgid "" "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " -"decimal digits::" +"decimal digits:" msgstr "" "如果將該分數乘以 10\\*\\*55,則可以看到該值以 55 個十進位數字顯示:\n" "\n" "::" -#: ../../tutorial/floatingpoint.rst:277 +#: ../../tutorial/floatingpoint.rst:342 +#, fuzzy msgid "" "meaning that the exact number stored in the computer is equal to the decimal " "value 0.1000000000000000055511151231257827021181583404541015625. Instead of " "displaying the full decimal value, many languages (including older versions " -"of Python), round the result to 17 significant digits::" +"of Python), round the result to 17 significant digits:" msgstr "" "這表示儲存在電腦中的精準數值等於十進位值 " "0.1000000000000000055511151231257827021181583404541015625。與其顯示完整的十進" @@ -503,10 +534,10 @@ msgstr "" "\n" "::" -#: ../../tutorial/floatingpoint.rst:285 +#: ../../tutorial/floatingpoint.rst:352 +#, fuzzy msgid "" -"The :mod:`fractions` and :mod:`decimal` modules make these calculations " -"easy::" +"The :mod:`fractions` and :mod:`decimal` modules make these calculations easy:" msgstr "" ":mod:`fractions` 與 :mod:`decimal` 模組能使這些計算變得容易:\n" "\n" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index 6b8f1551e8..8e93a7563d 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-05-18 16:28+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,9 +29,10 @@ msgid "Invoking the Interpreter" msgstr "啟動直譯器" #: ../../tutorial/interpreter.rst:13 +#, fuzzy msgid "" "The Python interpreter is usually installed as :file:`/usr/local/bin/" -"python3.11` on those machines where it is available; putting :file:`/usr/" +"python3.12` on those machines where it is available; putting :file:`/usr/" "local/bin` in your Unix shell's search path makes it possible to start it by " "typing the command:" msgstr "" @@ -50,9 +51,10 @@ msgstr "" "python` 是個很常見的另類存放路徑。)" #: ../../tutorial/interpreter.rst:26 +#, fuzzy msgid "" "On Windows machines where you have installed Python from the :ref:`Microsoft " -"Store `, the :file:`python3.11` command will be available. If " +"Store `, the :file:`python3.12` command will be available. If " "you have the :ref:`py.exe launcher ` installed, you can use the :" "file:`py` command. See :ref:`setting-envvars` for other ways to launch " "Python." @@ -89,8 +91,9 @@ msgstr "" "php/chet/readline/rltop.html>`_ 函式庫的系統上包含:互動編輯、歷史取代、指令" "補完等功能。最快檢查有無支援指令列編輯的方法為:在第一個 Python 提示符後輸" "入 :kbd:`Control-P`\\ ,如果出現嗶嗶聲,就代表有支援;見附錄\\ :ref:`tut-" -"interacting`\\ 介紹相關的快速鍵。如果什麼事都沒有發生,或者出現一個 ``^P``" -"\\ ,就代表並沒有指令列編輯功能;此時只能使用 backspace 去除該行的字元。" +"interacting`\\ 介紹相關的快速鍵。如果什麼事都沒有發生,或者出現一個 " +"``^P``\\ ,就代表並沒有指令列編輯功能;此時只能使用 backspace 去除該行的字" +"元。" #: ../../tutorial/interpreter.rst:46 msgid "" @@ -159,11 +162,12 @@ msgstr "" "當直擇器收到腳本的名稱和額外的引數後,他們會轉換為由字串所組成的 list(串列)" "並指派給 ``sys`` 模組的 ``argv`` 變數。你可以執行 ``import sys`` 取得這個串" "列。這個串列的長度至少為一;當沒有給任何腳本名稱和引數時, ``sys.argv[0]`` 為" -"空字串。當腳本名為 ``'-'``\\ (指標準輸入)時, ``sys.argv[0]`` 為 ``'-'``" -"\\ 。當使用 :option:`-c` *command* 時, ``sys.argv[0]`` 為 ``'-c'``\\ 。當使" -"用 :option:`-m` *module* 時, ``sys.argv[0]`` 為該模組存在的完整路徑。其餘" -"非 :option:`-c` *command* 或 :option:`-m` *module* 的選項不會被 Python 直譯器" -"吸收掉,而是留在 ``sys.argv`` 變數中給後續的 command 或 module 使用。" +"空字串。當腳本名為 ``'-'``\\ (指標準輸入)時, ``sys.argv[0]`` 為 " +"``'-'``\\ 。當使用 :option:`-c` *command* 時, ``sys.argv[0]`` 為 ``'-" +"c'``\\ 。當使用 :option:`-m` *module* 時, ``sys.argv[0]`` 為該模組存在的完整" +"路徑。其餘非 :option:`-c` *command* 或 :option:`-m` *module* 的選項不會被 " +"Python 直譯器吸收掉,而是留在 ``sys.argv`` 變數中給後續的 command 或 module " +"使用。" #: ../../tutorial/interpreter.rst:89 msgid "Interactive Mode" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 5477e0e8a7..d3cae4b3ec 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,8 +99,8 @@ msgid "" "grouping. For example::" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" -"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 的行為如同" -"大多數的程式語言(例如:Pascal 或 C);括號 ``()`` 可以用來分群。例如:\n" +"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 的行為如" +"同大多數的程式語言(例如:Pascal 或 C);括號 ``()`` 可以用來分群。例如:\n" "\n" "::" @@ -337,9 +337,10 @@ msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" #: ../../tutorial/introduction.rst:276 +#, fuzzy msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " -"used to obtain individual characters, *slicing* allows you to obtain " +"used to obtain individual characters, *slicing* allows you to obtain a " "substring::" msgstr "" "除了索引外,字串亦支援「切片 *slicing*」。索引用來拿到單獨的字元,而切片則可" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 6b7628b10c..ee3bc8a42c 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -90,11 +90,11 @@ msgid "Command Line Arguments" msgstr "命令列引數" #: ../../tutorial/stdlib.rst:66 +#, fuzzy msgid "" "Common utility scripts often need to process command line arguments. These " "arguments are stored in the :mod:`sys` module's *argv* attribute as a list. " -"For instance the following output results from running ``python demo.py one " -"two three`` at the command line::" +"For instance, let's take the following :file:`demo.py` file::" msgstr "" "通用工具腳本常需要處理命令列引數。這些引數會以 list(串列)形式存放在 :mod:" "`sys` 模組的 *argv* 屬性中。例如在命令列執行 ``python demo.py one two " @@ -102,7 +102,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:75 +#: ../../tutorial/stdlib.rst:74 +msgid "" +"Here is the output from running ``python demo.py one two three`` at the " +"command line::" +msgstr "" + +#: ../../tutorial/stdlib.rst:79 msgid "" "The :mod:`argparse` module provides a more sophisticated mechanism to " "process command line arguments. The following script extracts one or more " @@ -113,7 +119,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:89 +#: ../../tutorial/stdlib.rst:93 msgid "" "When run at the command line with ``python top.py --lines=5 alpha.txt beta." "txt``, the script sets ``args.lines`` to ``5`` and ``args.filenames`` to " @@ -123,11 +129,11 @@ msgstr "" "``args.lines`` 設為 ``5``,並將 ``args.filenames`` 設為 ``['alpha.txt', " "'beta.txt']``。" -#: ../../tutorial/stdlib.rst:97 +#: ../../tutorial/stdlib.rst:101 msgid "Error Output Redirection and Program Termination" msgstr "錯誤輸出重新導向與程式終止" -#: ../../tutorial/stdlib.rst:99 +#: ../../tutorial/stdlib.rst:103 msgid "" "The :mod:`sys` module also has attributes for *stdin*, *stdout*, and " "*stderr*. The latter is useful for emitting warnings and error messages to " @@ -138,15 +144,15 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:106 +#: ../../tutorial/stdlib.rst:110 msgid "The most direct way to terminate a script is to use ``sys.exit()``." msgstr "終止腳本最直接的方式就是利用 ``sys.exit()``。" -#: ../../tutorial/stdlib.rst:112 +#: ../../tutorial/stdlib.rst:116 msgid "String Pattern Matching" msgstr "字串樣式比對" -#: ../../tutorial/stdlib.rst:114 +#: ../../tutorial/stdlib.rst:118 msgid "" "The :mod:`re` module provides regular expression tools for advanced string " "processing. For complex matching and manipulation, regular expressions offer " @@ -157,7 +163,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:124 +#: ../../tutorial/stdlib.rst:128 msgid "" "When only simple capabilities are needed, string methods are preferred " "because they are easier to read and debug::" @@ -167,11 +173,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:134 +#: ../../tutorial/stdlib.rst:138 msgid "Mathematics" msgstr "數學相關" -#: ../../tutorial/stdlib.rst:136 +#: ../../tutorial/stdlib.rst:140 msgid "" "The :mod:`math` module gives access to the underlying C library functions " "for floating point math::" @@ -180,14 +186,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:145 +#: ../../tutorial/stdlib.rst:149 msgid "The :mod:`random` module provides tools for making random selections::" msgstr "" ":mod:`random` 模組提供了隨機選擇的工具:\n" "\n" "::" -#: ../../tutorial/stdlib.rst:157 +#: ../../tutorial/stdlib.rst:161 msgid "" "The :mod:`statistics` module calculates basic statistical properties (the " "mean, median, variance, etc.) of numeric data::" @@ -197,17 +203,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:169 +#: ../../tutorial/stdlib.rst:173 msgid "" "The SciPy project has many other modules for numerical " "computations." msgstr "SciPy 專案 上也有許多數值計算相關的模組。" -#: ../../tutorial/stdlib.rst:175 +#: ../../tutorial/stdlib.rst:179 msgid "Internet Access" msgstr "網路存取" -#: ../../tutorial/stdlib.rst:177 +#: ../../tutorial/stdlib.rst:181 msgid "" "There are a number of modules for accessing the internet and processing " "internet protocols. Two of the simplest are :mod:`urllib.request` for " @@ -218,15 +224,15 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:200 +#: ../../tutorial/stdlib.rst:204 msgid "(Note that the second example needs a mailserver running on localhost.)" msgstr "(注意第二個例子中需要在本地端執行一個郵件伺服器。)" -#: ../../tutorial/stdlib.rst:206 +#: ../../tutorial/stdlib.rst:210 msgid "Dates and Times" msgstr "日期與時間" -#: ../../tutorial/stdlib.rst:208 +#: ../../tutorial/stdlib.rst:212 msgid "" "The :mod:`datetime` module supplies classes for manipulating dates and times " "in both simple and complex ways. While date and time arithmetic is " @@ -240,11 +246,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:232 +#: ../../tutorial/stdlib.rst:236 msgid "Data Compression" msgstr "資料壓縮" -#: ../../tutorial/stdlib.rst:234 +#: ../../tutorial/stdlib.rst:238 msgid "" "Common data archiving and compression formats are directly supported by " "modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:" @@ -256,11 +262,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:254 +#: ../../tutorial/stdlib.rst:258 msgid "Performance Measurement" msgstr "效能量測" -#: ../../tutorial/stdlib.rst:256 +#: ../../tutorial/stdlib.rst:260 msgid "" "Some Python users develop a deep interest in knowing the relative " "performance of different approaches to the same problem. Python provides a " @@ -269,7 +275,7 @@ msgstr "" "有一些 Python 使用者很想了解同個問題的不同實作方法的效能差異。Python 提供了評" "估效能差異的工具。" -#: ../../tutorial/stdlib.rst:260 +#: ../../tutorial/stdlib.rst:264 msgid "" "For example, it may be tempting to use the tuple packing and unpacking " "feature instead of the traditional approach to swapping arguments. The :mod:" @@ -280,7 +286,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:270 +#: ../../tutorial/stdlib.rst:274 msgid "" "In contrast to :mod:`timeit`'s fine level of granularity, the :mod:`profile` " "and :mod:`pstats` modules provide tools for identifying time critical " @@ -290,11 +296,11 @@ msgstr "" "`pstats` 模組則提供了一些在大型的程式碼識別時間使用上關鍵的區塊 (time " "critical section) 的工具。" -#: ../../tutorial/stdlib.rst:278 +#: ../../tutorial/stdlib.rst:282 msgid "Quality Control" msgstr "品質控管" -#: ../../tutorial/stdlib.rst:280 +#: ../../tutorial/stdlib.rst:284 msgid "" "One approach for developing high quality software is to write tests for each " "function as it is developed and to run those tests frequently during the " @@ -303,7 +309,7 @@ msgstr "" "達到高品質軟體的一個方法,是在開發時對每個函式寫測試,以及在開發過程中要不斷" "地跑這些測試。" -#: ../../tutorial/stdlib.rst:284 +#: ../../tutorial/stdlib.rst:288 msgid "" "The :mod:`doctest` module provides a tool for scanning a module and " "validating tests embedded in a program's docstrings. Test construction is " @@ -319,7 +325,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:302 +#: ../../tutorial/stdlib.rst:306 msgid "" "The :mod:`unittest` module is not as effortless as the :mod:`doctest` " "module, but it allows a more comprehensive set of tests to be maintained in " @@ -330,11 +336,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/stdlib.rst:324 +#: ../../tutorial/stdlib.rst:328 msgid "Batteries Included" msgstr "標準模組庫" -#: ../../tutorial/stdlib.rst:326 +#: ../../tutorial/stdlib.rst:330 msgid "" "Python has a \"batteries included\" philosophy. This is best seen through " "the sophisticated and robust capabilities of its larger packages. For " @@ -343,7 +349,7 @@ msgstr "" "\"Batteries included\" 是 Python 的設計哲學。這個理念可以透過使用它的大型套" "件,感受複雜與強大的功能,來得到印證。例如:" -#: ../../tutorial/stdlib.rst:329 +#: ../../tutorial/stdlib.rst:333 msgid "" "The :mod:`xmlrpc.client` and :mod:`xmlrpc.server` modules make implementing " "remote procedure calls into an almost trivial task. Despite the modules' " @@ -353,7 +359,7 @@ msgstr "" "更為容易。即使模組名稱裡有 XML,使用者並不需要直接操作 XML 檔案或事先具備相關" "知識。" -#: ../../tutorial/stdlib.rst:333 +#: ../../tutorial/stdlib.rst:337 msgid "" "The :mod:`email` package is a library for managing email messages, including " "MIME and other :rfc:`2822`-based message documents. Unlike :mod:`smtplib` " @@ -367,7 +373,7 @@ msgstr "" "email 套件擁有更完整的工具集,可用於建立與解碼複雜訊息結構(包含附件檔案)以" "及實作編碼與標頭協定。" -#: ../../tutorial/stdlib.rst:340 +#: ../../tutorial/stdlib.rst:344 msgid "" "The :mod:`json` package provides robust support for parsing this popular " "data interchange format. The :mod:`csv` module supports direct reading and " @@ -383,7 +389,7 @@ msgstr "" "sax` 套件則支援 XML 的處理。綜觀所有,這些模組和套件都簡化了 Python 應用程式" "與其他工具之間的資料交換。" -#: ../../tutorial/stdlib.rst:349 +#: ../../tutorial/stdlib.rst:353 msgid "" "The :mod:`sqlite3` module is a wrapper for the SQLite database library, " "providing a persistent database that can be updated and accessed using " @@ -392,7 +398,7 @@ msgstr "" ":mod:`sqllite3` 模組是 SQLite 資料庫函式庫的一層包裝,提供一個具持久性的資料" "庫,可以使用稍微非標準的 SQL 語法來對它進行更新與存取。" -#: ../../tutorial/stdlib.rst:353 +#: ../../tutorial/stdlib.rst:357 msgid "" "Internationalization is supported by a number of modules including :mod:" "`gettext`, :mod:`locale`, and the :mod:`codecs` package." diff --git a/using/cmdline.po b/using/cmdline.po index 7e52b7f34f..a49ecb2b4a 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -366,21 +366,27 @@ msgstr "" #: ../../using/cmdline.rst:274 msgid "" -"Turn on parser debugging output (for expert only, depending on compilation " -"options). See also :envvar:`PYTHONDEBUG`." +"Turn on parser debugging output (for expert only). See also the :envvar:" +"`PYTHONDEBUG` environment variable." msgstr "" -#: ../../using/cmdline.rst:280 +#: ../../using/cmdline.rst:277 +msgid "" +"This option requires a :ref:`debug build of Python `, otherwise " +"it's ignored." +msgstr "" + +#: ../../using/cmdline.rst:283 msgid "" "Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" -#: ../../using/cmdline.rst:283 +#: ../../using/cmdline.rst:286 msgid "See also the :option:`-P` and :option:`-I` (isolated) options." msgstr "" -#: ../../using/cmdline.rst:288 +#: ../../using/cmdline.rst:291 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " @@ -388,19 +394,19 @@ msgid "" "`PYTHONSTARTUP` file is not read." msgstr "" -#: ../../using/cmdline.rst:293 +#: ../../using/cmdline.rst:296 msgid "" "This can be useful to inspect global variables or a stack trace when a " "script raises an exception. See also :envvar:`PYTHONINSPECT`." msgstr "" -#: ../../using/cmdline.rst:299 +#: ../../using/cmdline.rst:302 msgid "" "Run Python in isolated mode. This also implies :option:`-E`, :option:`-P` " "and :option:`-s` options." msgstr "" -#: ../../using/cmdline.rst:302 +#: ../../using/cmdline.rst:305 msgid "" "In isolated mode :data:`sys.path` contains neither the script's directory " "nor the user's site-packages directory. All :envvar:`PYTHON*` environment " @@ -408,7 +414,7 @@ msgid "" "the user from injecting malicious code." msgstr "" -#: ../../using/cmdline.rst:312 +#: ../../using/cmdline.rst:315 msgid "" "Remove assert statements and any code conditional on the value of :const:" "`__debug__`. Augment the filename for compiled (:term:`bytecode`) files by " @@ -416,58 +422,58 @@ msgid "" "envvar:`PYTHONOPTIMIZE`." msgstr "" -#: ../../using/cmdline.rst:317 ../../using/cmdline.rst:327 +#: ../../using/cmdline.rst:320 ../../using/cmdline.rst:330 msgid "Modify ``.pyc`` filenames according to :pep:`488`." msgstr "" -#: ../../using/cmdline.rst:323 +#: ../../using/cmdline.rst:326 msgid "" "Do :option:`-O` and also discard docstrings. Augment the filename for " "compiled (:term:`bytecode`) files by adding ``.opt-2`` before the ``.pyc`` " "extension (see :pep:`488`)." msgstr "" -#: ../../using/cmdline.rst:333 +#: ../../using/cmdline.rst:336 msgid "Don't prepend a potentially unsafe path to :data:`sys.path`:" msgstr "" -#: ../../using/cmdline.rst:335 +#: ../../using/cmdline.rst:338 msgid "" "``python -m module`` command line: Don't prepend the current working " "directory." msgstr "" -#: ../../using/cmdline.rst:337 +#: ../../using/cmdline.rst:340 msgid "" "``python script.py`` command line: Don't prepend the script's directory. If " "it's a symbolic link, resolve symbolic links." msgstr "" -#: ../../using/cmdline.rst:339 +#: ../../using/cmdline.rst:342 msgid "" "``python -c code`` and ``python`` (REPL) command lines: Don't prepend an " "empty string, which means the current working directory." msgstr "" -#: ../../using/cmdline.rst:342 +#: ../../using/cmdline.rst:345 msgid "" "See also the :envvar:`PYTHONSAFEPATH` environment variable, and :option:`-E` " "and :option:`-I` (isolated) options." msgstr "" -#: ../../using/cmdline.rst:350 +#: ../../using/cmdline.rst:353 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -#: ../../using/cmdline.rst:357 +#: ../../using/cmdline.rst:360 msgid "" "Turn on hash randomization. This option only has an effect if the :envvar:" "`PYTHONHASHSEED` environment variable is set to ``0``, since hash " "randomization is enabled by default." msgstr "" -#: ../../using/cmdline.rst:361 +#: ../../using/cmdline.rst:364 msgid "" "On previous versions of Python, this option turns on hash randomization, so " "that the :meth:`__hash__` values of str and bytes objects are \"salted\" " @@ -476,7 +482,7 @@ msgid "" "invocations of Python." msgstr "" -#: ../../using/cmdline.rst:367 +#: ../../using/cmdline.rst:370 msgid "" "Hash randomization is intended to provide protection against a denial-of-" "service caused by carefully chosen inputs that exploit the worst case " @@ -484,28 +490,28 @@ msgid "" "ocert.org/advisories/ocert-2011-003.html for details." msgstr "" -#: ../../using/cmdline.rst:372 +#: ../../using/cmdline.rst:375 msgid "" ":envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash seed " "secret." msgstr "" -#: ../../using/cmdline.rst:375 +#: ../../using/cmdline.rst:378 msgid "The option is no longer ignored." msgstr "" -#: ../../using/cmdline.rst:383 +#: ../../using/cmdline.rst:386 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" -#: ../../using/cmdline.rst:388 ../../using/cmdline.rst:793 -#: ../../using/cmdline.rst:805 +#: ../../using/cmdline.rst:391 ../../using/cmdline.rst:807 +#: ../../using/cmdline.rst:819 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" -#: ../../using/cmdline.rst:393 +#: ../../using/cmdline.rst:396 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -513,21 +519,21 @@ msgid "" "main` if you want them to be triggered)." msgstr "" -#: ../../using/cmdline.rst:401 +#: ../../using/cmdline.rst:404 msgid "" "Force the stdout and stderr streams to be unbuffered. This option has no " "effect on the stdin stream." msgstr "" -#: ../../using/cmdline.rst:404 +#: ../../using/cmdline.rst:407 msgid "See also :envvar:`PYTHONUNBUFFERED`." msgstr "另請參閱 :envvar:`PYTHONUNBUFFERED`\\ 。" -#: ../../using/cmdline.rst:406 +#: ../../using/cmdline.rst:409 msgid "The text layer of the stdout and stderr streams now is unbuffered." msgstr "" -#: ../../using/cmdline.rst:412 +#: ../../using/cmdline.rst:415 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. When given twice (:" @@ -535,60 +541,60 @@ msgid "" "searching for a module. Also provides information on module cleanup at exit." msgstr "" -#: ../../using/cmdline.rst:417 +#: ../../using/cmdline.rst:420 msgid "" "The :mod:`site` module reports the site-specific paths and :file:`.pth` " "files being processed." msgstr "" -#: ../../using/cmdline.rst:421 +#: ../../using/cmdline.rst:424 msgid "See also :envvar:`PYTHONVERBOSE`." msgstr "另請參閱 :envvar:`PYTHONVERBOSE`\\ 。" -#: ../../using/cmdline.rst:427 +#: ../../using/cmdline.rst:430 msgid "" "Warning control. Python's warning machinery by default prints warning " "messages to :data:`sys.stderr`." msgstr "" -#: ../../using/cmdline.rst:430 ../../using/cmdline.rst:821 +#: ../../using/cmdline.rst:433 ../../using/cmdline.rst:835 msgid "" "The simplest settings apply a particular action unconditionally to all " "warnings emitted by a process (even those that are otherwise ignored by " "default)::" msgstr "" -#: ../../using/cmdline.rst:441 +#: ../../using/cmdline.rst:444 msgid "" "The action names can be abbreviated as desired and the interpreter will " "resolve them to the appropriate action name. For example, ``-Wi`` is the " "same as ``-Wignore``." msgstr "" -#: ../../using/cmdline.rst:445 +#: ../../using/cmdline.rst:448 msgid "The full form of argument is::" msgstr "" -#: ../../using/cmdline.rst:449 +#: ../../using/cmdline.rst:452 msgid "" "Empty fields match all values; trailing empty fields may be omitted. For " "example ``-W ignore::DeprecationWarning`` ignores all DeprecationWarning " "warnings." msgstr "" -#: ../../using/cmdline.rst:453 +#: ../../using/cmdline.rst:456 msgid "" "The *action* field is as explained above but only applies to warnings that " "match the remaining fields." msgstr "" -#: ../../using/cmdline.rst:456 +#: ../../using/cmdline.rst:459 msgid "" "The *message* field must match the whole warning message; this match is case-" "insensitive." msgstr "" -#: ../../using/cmdline.rst:459 +#: ../../using/cmdline.rst:462 msgid "" "The *category* field matches the warning category (ex: " "``DeprecationWarning``). This must be a class name; the match test whether " @@ -596,19 +602,19 @@ msgid "" "warning category." msgstr "" -#: ../../using/cmdline.rst:464 +#: ../../using/cmdline.rst:467 msgid "" "The *module* field matches the (fully qualified) module name; this match is " "case-sensitive." msgstr "" -#: ../../using/cmdline.rst:467 +#: ../../using/cmdline.rst:470 msgid "" "The *lineno* field matches the line number, where zero matches all line " "numbers and is thus equivalent to an omitted line number." msgstr "" -#: ../../using/cmdline.rst:470 +#: ../../using/cmdline.rst:473 msgid "" "Multiple :option:`-W` options can be given; when a warning matches more than " "one option, the action for the last matching option is performed. Invalid :" @@ -616,7 +622,7 @@ msgid "" "invalid options when the first warning is issued)." msgstr "" -#: ../../using/cmdline.rst:475 +#: ../../using/cmdline.rst:478 msgid "" "Warnings can also be controlled using the :envvar:`PYTHONWARNINGS` " "environment variable and from within a Python program using the :mod:" @@ -624,31 +630,31 @@ msgid "" "can be used to use a regular expression on the warning message." msgstr "" -#: ../../using/cmdline.rst:480 ../../using/cmdline.rst:832 +#: ../../using/cmdline.rst:483 ../../using/cmdline.rst:846 msgid "" "See :ref:`warning-filter` and :ref:`describing-warning-filters` for more " "details." msgstr "" -#: ../../using/cmdline.rst:486 +#: ../../using/cmdline.rst:489 msgid "" "Skip the first line of the source, allowing use of non-Unix forms of ``#!" "cmd``. This is intended for a DOS specific hack only." msgstr "" -#: ../../using/cmdline.rst:492 +#: ../../using/cmdline.rst:495 msgid "" "Reserved for various implementation-specific options. CPython currently " "defines the following possible values:" msgstr "" -#: ../../using/cmdline.rst:495 +#: ../../using/cmdline.rst:498 msgid "" "``-X faulthandler`` to enable :mod:`faulthandler`. See also :envvar:" "`PYTHONFAULTHANDLER`." msgstr "" -#: ../../using/cmdline.rst:497 +#: ../../using/cmdline.rst:500 msgid "" "``-X showrefcount`` to output the total reference count and number of used " "memory blocks when the program finishes or after each statement in the " @@ -656,7 +662,7 @@ msgid "" "build>`." msgstr "" -#: ../../using/cmdline.rst:501 +#: ../../using/cmdline.rst:504 msgid "" "``-X tracemalloc`` to start tracing Python memory allocations using the :mod:" "`tracemalloc` module. By default, only the most recent frame is stored in a " @@ -665,14 +671,14 @@ msgid "" "envvar:`PYTHONTRACEMALLOC` for more information." msgstr "" -#: ../../using/cmdline.rst:507 +#: ../../using/cmdline.rst:510 msgid "" "``-X int_max_str_digits`` configures the :ref:`integer string conversion " "length limitation `. See also :envvar:" "`PYTHONINTMAXSTRDIGITS`." msgstr "" -#: ../../using/cmdline.rst:510 +#: ../../using/cmdline.rst:513 msgid "" "``-X importtime`` to show how long each import takes. It shows module name, " "cumulative time (including nested imports) and self time (excluding nested " @@ -681,34 +687,34 @@ msgid "" "asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`." msgstr "" -#: ../../using/cmdline.rst:515 +#: ../../using/cmdline.rst:518 msgid "" "``-X dev``: enable :ref:`Python Development Mode `, introducing " "additional runtime checks that are too expensive to be enabled by default." msgstr "" -#: ../../using/cmdline.rst:518 +#: ../../using/cmdline.rst:521 msgid "" "``-X utf8`` enables the :ref:`Python UTF-8 Mode `. ``-X utf8=0`` " "explicitly disables :ref:`Python UTF-8 Mode ` (even when it would " "otherwise activate automatically). See also :envvar:`PYTHONUTF8`." msgstr "" -#: ../../using/cmdline.rst:522 +#: ../../using/cmdline.rst:525 msgid "" "``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree " "rooted at the given directory instead of to the code tree. See also :envvar:" "`PYTHONPYCACHEPREFIX`." msgstr "" -#: ../../using/cmdline.rst:525 +#: ../../using/cmdline.rst:528 msgid "" "``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the " "locale-specific default encoding is used for opening files. See also :envvar:" "`PYTHONWARNDEFAULTENCODING`." msgstr "" -#: ../../using/cmdline.rst:528 +#: ../../using/cmdline.rst:531 msgid "" "``-X no_debug_ranges`` disables the inclusion of the tables mapping extra " "location information (end line, start column offset and end column offset) " @@ -718,7 +724,7 @@ msgid "" "envvar:`PYTHONNODEBUGRANGES`." msgstr "" -#: ../../using/cmdline.rst:534 +#: ../../using/cmdline.rst:537 msgid "" "``-X frozen_modules`` determines whether or not frozen modules are ignored " "by the import machinery. A value of \"on\" means they get imported and " @@ -729,81 +735,95 @@ msgid "" "are always used, even if this flag is set to \"off\"." msgstr "" -#: ../../using/cmdline.rst:542 +#: ../../using/cmdline.rst:544 +msgid "" +"``-X perf`` enables support for the Linux ``perf`` profiler. When this " +"option is provided, the ``perf`` profiler will be able to report Python " +"calls. This option is only available on some platforms and will do nothing " +"if is not supported on the current system. The default value is \"off\". See " +"also :envvar:`PYTHONPERFSUPPORT` and :ref:`perf_profiling`." +msgstr "" + +#: ../../using/cmdline.rst:550 msgid "" "It also allows passing arbitrary values and retrieving them through the :" "data:`sys._xoptions` dictionary." msgstr "" -#: ../../using/cmdline.rst:545 +#: ../../using/cmdline.rst:553 msgid "The :option:`-X` option was added." msgstr "新增 :option:`-X` 選項。" -#: ../../using/cmdline.rst:548 +#: ../../using/cmdline.rst:556 msgid "The ``-X faulthandler`` option." msgstr "``-X faulthandler`` 選項。" -#: ../../using/cmdline.rst:551 +#: ../../using/cmdline.rst:559 msgid "The ``-X showrefcount`` and ``-X tracemalloc`` options." msgstr "``-X showrefcount`` 和 ``-X tracemalloc`` 選項。" -#: ../../using/cmdline.rst:554 +#: ../../using/cmdline.rst:562 msgid "The ``-X showalloccount`` option." msgstr "``-X showalloccount`` 選項。" -#: ../../using/cmdline.rst:557 +#: ../../using/cmdline.rst:565 msgid "The ``-X importtime``, ``-X dev`` and ``-X utf8`` options." msgstr "``-X importtime``、``-X dev`` 和 ``-X utf8`` 選項。" -#: ../../using/cmdline.rst:560 +#: ../../using/cmdline.rst:568 msgid "" "The ``-X pycache_prefix`` option. The ``-X dev`` option now logs ``close()`` " "exceptions in :class:`io.IOBase` destructor." msgstr "" -#: ../../using/cmdline.rst:564 +#: ../../using/cmdline.rst:572 msgid "" "Using ``-X dev`` option, check *encoding* and *errors* arguments on string " "encoding and decoding operations." msgstr "" -#: ../../using/cmdline.rst:568 +#: ../../using/cmdline.rst:576 msgid "The ``-X showalloccount`` option has been removed." msgstr "``-X showalloccount`` 選項已被移除。" -#: ../../using/cmdline.rst:570 +#: ../../using/cmdline.rst:578 msgid "The ``-X warn_default_encoding`` option." msgstr "``-X warn_default_encoding`` 選項。" -#: ../../using/cmdline.rst:575 +#: ../../using/cmdline.rst:583 msgid "The ``-X oldparser`` option." msgstr "``-X oldparser`` 選項。" -#: ../../using/cmdline.rst:576 +#: ../../using/cmdline.rst:584 msgid "The ``-X no_debug_ranges`` option." msgstr "``-X no_debug_ranges`` 選項。" -#: ../../using/cmdline.rst:579 +#: ../../using/cmdline.rst:587 msgid "The ``-X frozen_modules`` option." msgstr "``-X frozen_modules`` 選項。" -#: ../../using/cmdline.rst:582 +#: ../../using/cmdline.rst:590 msgid "The ``-X int_max_str_digits`` option." msgstr "``-X int_max_str_digits`` 選項。" -#: ../../using/cmdline.rst:587 +#: ../../using/cmdline.rst:593 +#, fuzzy +msgid "The ``-X perf`` option." +msgstr "``-X oldparser`` 選項。" + +#: ../../using/cmdline.rst:598 msgid "Options you shouldn't use" msgstr "你不該使用的選項" -#: ../../using/cmdline.rst:591 +#: ../../using/cmdline.rst:602 msgid "Reserved for use by Jython_." msgstr "" -#: ../../using/cmdline.rst:599 +#: ../../using/cmdline.rst:610 msgid "Environment variables" msgstr "環境變數" -#: ../../using/cmdline.rst:601 +#: ../../using/cmdline.rst:612 msgid "" "These environment variables influence Python's behavior, they are processed " "before the command-line switches other than -E or -I. It is customary that " @@ -811,7 +831,7 @@ msgid "" "conflict." msgstr "" -#: ../../using/cmdline.rst:608 +#: ../../using/cmdline.rst:619 msgid "" "Change the location of the standard Python libraries. By default, the " "libraries are searched in :file:`{prefix}/lib/python{version}` and :file:" @@ -820,14 +840,14 @@ msgid "" "file:`/usr/local`." msgstr "" -#: ../../using/cmdline.rst:614 +#: ../../using/cmdline.rst:625 msgid "" "When :envvar:`PYTHONHOME` is set to a single directory, its value replaces " "both :file:`{prefix}` and :file:`{exec_prefix}`. To specify different " "values for these, set :envvar:`PYTHONHOME` to :file:`{prefix}:{exec_prefix}`." msgstr "" -#: ../../using/cmdline.rst:621 +#: ../../using/cmdline.rst:632 msgid "" "Augment the default search path for module files. The format is the same as " "the shell's :envvar:`PATH`: one or more directory pathnames separated by :" @@ -835,21 +855,21 @@ msgid "" "existent directories are silently ignored." msgstr "" -#: ../../using/cmdline.rst:626 +#: ../../using/cmdline.rst:637 msgid "" "In addition to normal directories, individual :envvar:`PYTHONPATH` entries " "may refer to zipfiles containing pure Python modules (in either source or " "compiled form). Extension modules cannot be imported from zipfiles." msgstr "" -#: ../../using/cmdline.rst:630 +#: ../../using/cmdline.rst:641 msgid "" "The default search path is installation dependent, but generally begins " "with :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above). " "It is *always* appended to :envvar:`PYTHONPATH`." msgstr "" -#: ../../using/cmdline.rst:634 +#: ../../using/cmdline.rst:645 msgid "" "An additional directory will be inserted in the search path in front of :" "envvar:`PYTHONPATH` as described above under :ref:`using-on-interface-" @@ -857,19 +877,19 @@ msgid "" "the variable :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:642 +#: ../../using/cmdline.rst:653 msgid "" "If this is set to a non-empty string, don't prepend a potentially unsafe " "path to :data:`sys.path`: see the :option:`-P` option for details." msgstr "" -#: ../../using/cmdline.rst:650 +#: ../../using/cmdline.rst:661 msgid "" "If this is set to a non-empty string, it overrides the :data:`sys." "platlibdir` value." msgstr "" -#: ../../using/cmdline.rst:658 +#: ../../using/cmdline.rst:669 msgid "" "If this is the name of a readable file, the Python commands in that file are " "executed before the first prompt is displayed in interactive mode. The file " @@ -880,7 +900,7 @@ msgid "" "file." msgstr "" -#: ../../using/cmdline.rst:665 +#: ../../using/cmdline.rst:676 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with " "argument ``filename``." @@ -888,7 +908,7 @@ msgstr "" "引發一個附帶引數 ``filename`` 的\\ :ref:`稽核事件 ` ``cpython." "run_startup``。" -#: ../../using/cmdline.rst:667 +#: ../../using/cmdline.rst:678 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_startup`` with the " "filename as the argument when called on startup." @@ -896,14 +916,14 @@ msgstr "" "引發一個附帶呼叫啟動時的檔案名稱為引數的\\ :ref:`稽核事件 ` " "``cpython.run_startup``。" -#: ../../using/cmdline.rst:673 +#: ../../using/cmdline.rst:684 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-O` option. If set to an integer, it is equivalent to specifying :" "option:`-O` multiple times." msgstr "" -#: ../../using/cmdline.rst:680 +#: ../../using/cmdline.rst:691 msgid "" "If this is set, it names a callable using dotted-path notation. The module " "containing the callable will be imported and then the callable will be run " @@ -914,52 +934,58 @@ msgid "" "breakpointhook` to do nothing but return immediately." msgstr "" -#: ../../using/cmdline.rst:692 +#: ../../using/cmdline.rst:703 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-d` option. If set to an integer, it is equivalent to specifying :" "option:`-d` multiple times." msgstr "" -#: ../../using/cmdline.rst:699 +#: ../../using/cmdline.rst:707 +msgid "" +"This environment variable requires a :ref:`debug build of Python `, otherwise it's ignored." +msgstr "" + +#: ../../using/cmdline.rst:713 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-i` option." msgstr "" -#: ../../using/cmdline.rst:702 +#: ../../using/cmdline.rst:716 msgid "" "This variable can also be modified by Python code using :data:`os.environ` " "to force inspect mode on program termination." msgstr "" -#: ../../using/cmdline.rst:708 +#: ../../using/cmdline.rst:722 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-u` option." msgstr "" -#: ../../using/cmdline.rst:714 +#: ../../using/cmdline.rst:728 msgid "" "If this is set to a non-empty string it is equivalent to specifying the :" "option:`-v` option. If set to an integer, it is equivalent to specifying :" "option:`-v` multiple times." msgstr "" -#: ../../using/cmdline.rst:721 +#: ../../using/cmdline.rst:735 msgid "" "If this is set, Python ignores case in :keyword:`import` statements. This " "only works on Windows and macOS." msgstr "" -#: ../../using/cmdline.rst:727 +#: ../../using/cmdline.rst:741 msgid "" "If this is set to a non-empty string, Python won't try to write ``.pyc`` " "files on the import of source modules. This is equivalent to specifying " "the :option:`-B` option." msgstr "" -#: ../../using/cmdline.rst:734 +#: ../../using/cmdline.rst:748 msgid "" "If this is set, Python will write ``.pyc`` files in a mirror directory tree " "at this path, instead of in ``__pycache__`` directories within the source " @@ -967,40 +993,40 @@ msgid "" "``pycache_prefix=PATH`` option." msgstr "" -#: ../../using/cmdline.rst:744 +#: ../../using/cmdline.rst:758 msgid "" "If this variable is not set or set to ``random``, a random value is used to " "seed the hashes of str and bytes objects." msgstr "" -#: ../../using/cmdline.rst:747 +#: ../../using/cmdline.rst:761 msgid "" "If :envvar:`PYTHONHASHSEED` is set to an integer value, it is used as a " "fixed seed for generating the hash() of the types covered by the hash " "randomization." msgstr "" -#: ../../using/cmdline.rst:751 +#: ../../using/cmdline.rst:765 msgid "" "Its purpose is to allow repeatable hashing, such as for selftests for the " "interpreter itself, or to allow a cluster of python processes to share hash " "values." msgstr "" -#: ../../using/cmdline.rst:755 +#: ../../using/cmdline.rst:769 msgid "" "The integer must be a decimal number in the range [0,4294967295]. " "Specifying the value 0 will disable hash randomization." msgstr "" -#: ../../using/cmdline.rst:762 +#: ../../using/cmdline.rst:776 msgid "" "If this variable is set to an integer, it is used to configure the " "interpreter's global :ref:`integer string conversion length limitation " "`." msgstr "" -#: ../../using/cmdline.rst:770 +#: ../../using/cmdline.rst:784 msgid "" "If this is set before running the interpreter, it overrides the encoding " "used for stdin/stdout/stderr, in the syntax ``encodingname:errorhandler``. " @@ -1008,17 +1034,17 @@ msgid "" "have the same meaning as in :func:`str.encode`." msgstr "" -#: ../../using/cmdline.rst:775 +#: ../../using/cmdline.rst:789 msgid "" "For stderr, the ``:errorhandler`` part is ignored; the handler will always " "be ``'backslashreplace'``." msgstr "" -#: ../../using/cmdline.rst:778 +#: ../../using/cmdline.rst:792 msgid "The ``encodingname`` part is now optional." msgstr "" -#: ../../using/cmdline.rst:781 +#: ../../using/cmdline.rst:795 msgid "" "On Windows, the encoding specified by this variable is ignored for " "interactive console buffers unless :envvar:`PYTHONLEGACYWINDOWSSTDIO` is " @@ -1026,13 +1052,13 @@ msgid "" "not affected." msgstr "" -#: ../../using/cmdline.rst:788 +#: ../../using/cmdline.rst:802 msgid "" "If this is set, Python won't add the :data:`user site-packages directory " "` to :data:`sys.path`." msgstr "" -#: ../../using/cmdline.rst:798 +#: ../../using/cmdline.rst:812 msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:879 +#: ../../using/cmdline.rst:893 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:881 +#: ../../using/cmdline.rst:895 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:883 +#: ../../using/cmdline.rst:897 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:885 +#: ../../using/cmdline.rst:899 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:data:`PYMEM_DOMAIN_RAW`, :c:data:`PYMEM_DOMAIN_MEM`, :c:data:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:888 +#: ../../using/cmdline.rst:902 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:data:" "`PYMEM_DOMAIN_MEM` and :c:data:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:data:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:892 +#: ../../using/cmdline.rst:906 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:894 +#: ../../using/cmdline.rst:908 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:896 +#: ../../using/cmdline.rst:910 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:897 +#: ../../using/cmdline.rst:911 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:899 +#: ../../using/cmdline.rst:913 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:907 +#: ../../using/cmdline.rst:921 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:911 +#: ../../using/cmdline.rst:925 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:915 +#: ../../using/cmdline.rst:929 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:922 +#: ../../using/cmdline.rst:936 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1163,41 +1189,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:927 +#: ../../using/cmdline.rst:941 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:930 ../../using/cmdline.rst:944 +#: ../../using/cmdline.rst:944 ../../using/cmdline.rst:958 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:932 +#: ../../using/cmdline.rst:946 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../using/cmdline.rst:937 +#: ../../using/cmdline.rst:951 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:941 +#: ../../using/cmdline.rst:955 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:951 +#: ../../using/cmdline.rst:965 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:955 +#: ../../using/cmdline.rst:969 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1208,19 +1234,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:963 +#: ../../using/cmdline.rst:977 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:964 +#: ../../using/cmdline.rst:978 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:965 +#: ../../using/cmdline.rst:979 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:967 +#: ../../using/cmdline.rst:981 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1233,7 +1259,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:977 +#: ../../using/cmdline.rst:991 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1243,7 +1269,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:984 +#: ../../using/cmdline.rst:998 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1251,7 +1277,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:989 +#: ../../using/cmdline.rst:1003 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1260,15 +1286,15 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:995 +#: ../../using/cmdline.rst:1009 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:997 +#: ../../using/cmdline.rst:1011 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`\\ 。" -#: ../../using/cmdline.rst:1003 +#: ../../using/cmdline.rst:1017 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " @@ -1276,31 +1302,31 @@ msgid "" "setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1012 +#: ../../using/cmdline.rst:1026 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1014 +#: ../../using/cmdline.rst:1028 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1016 +#: ../../using/cmdline.rst:1030 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1023 +#: ../../using/cmdline.rst:1037 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1040 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../using/cmdline.rst:1032 +#: ../../using/cmdline.rst:1046 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1309,30 +1335,38 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1043 -msgid "Debug-mode variables" -msgstr "除錯模式變數" +#: ../../using/cmdline.rst:1056 +msgid "" +"If this variable is set to a nonzero value, it enables support for the Linux " +"``perf`` profiler so Python calls can be detected by it." +msgstr "" -#: ../../using/cmdline.rst:1047 -msgid "If set, Python will print threading debug info into stdout." +#: ../../using/cmdline.rst:1059 +msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" -#: ../../using/cmdline.rst:1049 -msgid "Need a :ref:`debug build of Python `." +#: ../../using/cmdline.rst:1061 +msgid "" +"See also the :option:`-X perf <-X>` command-line option and :ref:" +"`perf_profiling`." msgstr "" -#: ../../using/cmdline.rst:1056 +#: ../../using/cmdline.rst:1068 +msgid "Debug-mode variables" +msgstr "除錯模式變數" + +#: ../../using/cmdline.rst:1072 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1059 ../../using/cmdline.rst:1066 +#: ../../using/cmdline.rst:1075 ../../using/cmdline.rst:1082 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1063 +#: ../../using/cmdline.rst:1079 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." diff --git a/using/configure.po b/using/configure.po index 59052b6722..1d619d5fc3 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -22,69 +22,127 @@ msgstr "" msgid "Configure Python" msgstr "" +#: ../../using/configure.rst:6 +msgid "Build Requirements" +msgstr "" + #: ../../using/configure.rst:8 -msgid "Configure Options" +msgid "Features required to build CPython:" msgstr "" #: ../../using/configure.rst:10 +msgid "" +"A `C11 `_ compiler. `Optional C11 " +"features `_ are not required." +msgstr "" + +#: ../../using/configure.rst:15 +msgid "" +"Support for `IEEE 754 `_ floating " +"point numbers and `floating point Not-a-Number (NaN) `_." +msgstr "" + +#: ../../using/configure.rst:19 +msgid "Support for threads." +msgstr "" + +#: ../../using/configure.rst:21 +msgid "OpenSSL 1.1.1 or newer for the :mod:`ssl` and :mod:`hashlib` modules." +msgstr "" + +#: ../../using/configure.rst:23 +msgid "On Windows, Microsoft Visual Studio 2017 or later is required." +msgstr "" + +#: ../../using/configure.rst:25 +msgid "" +"C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " +"Studio 2017 or later is required." +msgstr "" + +#: ../../using/configure.rst:29 +msgid "OpenSSL 1.1.1 is now required." +msgstr "" + +#: ../../using/configure.rst:32 +msgid "Thread support and OpenSSL 1.0.2 are now required." +msgstr "" + +#: ../../using/configure.rst:35 +msgid "" +"Selected C99 features are now required, like ```` and ``static " +"inline`` functions." +msgstr "" + +#: ../../using/configure.rst:39 +msgid "On Windows, Visual Studio 2015 or later is required." +msgstr "" + +#: ../../using/configure.rst:42 +msgid "" +"See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " +"platform support\"." +msgstr "" + +#: ../../using/configure.rst:49 +msgid "Configure Options" +msgstr "" + +#: ../../using/configure.rst:51 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:14 +#: ../../using/configure.rst:55 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "" -#: ../../using/configure.rst:17 +#: ../../using/configure.rst:58 msgid "General Options" msgstr "" -#: ../../using/configure.rst:21 +#: ../../using/configure.rst:62 msgid "" "Support loadable extensions in the :mod:`_sqlite` extension module (default " "is no)." msgstr "" -#: ../../using/configure.rst:24 +#: ../../using/configure.rst:65 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" -#: ../../using/configure.rst:31 +#: ../../using/configure.rst:72 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "" -#: ../../using/configure.rst:36 +#: ../../using/configure.rst:77 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:38 +#: ../../using/configure.rst:79 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:40 +#: ../../using/configure.rst:81 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" -#: ../../using/configure.rst:42 +#: ../../using/configure.rst:83 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" -#: ../../using/configure.rst:47 -msgid "" -"Compile the Python ``main()`` function and link Python executable with C++ " -"compiler: ``$CXX``, or *COMPILER* if specified." -msgstr "" - -#: ../../using/configure.rst:52 +#: ../../using/configure.rst:87 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "" -#: ../../using/configure.rst:54 +#: ../../using/configure.rst:89 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -92,91 +150,95 @@ msgid "" "executable)." msgstr "" -#: ../../using/configure.rst:59 +#: ../../using/configure.rst:94 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "" -#: ../../using/configure.rst:65 +#: ../../using/configure.rst:100 msgid "" "Select the default time zone search path for :data:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:69 +#: ../../using/configure.rst:104 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" -#: ../../using/configure.rst:71 +#: ../../using/configure.rst:106 msgid "See :data:`os.pathsep` path separator." msgstr "" -#: ../../using/configure.rst:77 +#: ../../using/configure.rst:112 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:80 +#: ../../using/configure.rst:115 msgid "See :data:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" -#: ../../using/configure.rst:86 +#: ../../using/configure.rst:121 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:88 +#: ../../using/configure.rst:123 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:90 +#: ../../using/configure.rst:125 msgid "``ndbm``;" msgstr "" -#: ../../using/configure.rst:91 +#: ../../using/configure.rst:126 msgid "``gdbm``;" msgstr "" -#: ../../using/configure.rst:92 +#: ../../using/configure.rst:127 msgid "``bdb``." msgstr "" -#: ../../using/configure.rst:96 +#: ../../using/configure.rst:131 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:98 +#: ../../using/configure.rst:133 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "" -#: ../../using/configure.rst:100 +#: ../../using/configure.rst:135 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:139 +msgid "Disable all freelists except the empty tuple singleton." +msgstr "" + +#: ../../using/configure.rst:145 msgid "Python library directory name (default is ``lib``)." msgstr "" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:147 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "" -#: ../../using/configure.rst:108 +#: ../../using/configure.rst:149 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`\\ 。" -#: ../../using/configure.rst:114 +#: ../../using/configure.rst:155 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:117 +#: ../../using/configure.rst:158 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -184,266 +246,314 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:126 +#: ../../using/configure.rst:167 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:129 +#: ../../using/configure.rst:170 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "" -#: ../../using/configure.rst:130 +#: ../../using/configure.rst:171 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "" -#: ../../using/configure.rst:131 +#: ../../using/configure.rst:172 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "" -#: ../../using/configure.rst:137 +#: ../../using/configure.rst:178 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:139 +#: ../../using/configure.rst:180 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" -"tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows." +"tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows. If that directory " +"does not exist, results will be printed on stdout." msgstr "" -#: ../../using/configure.rst:142 +#: ../../using/configure.rst:184 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "" -#: ../../using/configure.rst:147 +#: ../../using/configure.rst:189 msgid "WebAssembly Options" msgstr "" -#: ../../using/configure.rst:151 +#: ../../using/configure.rst:193 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:153 +#: ../../using/configure.rst:195 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:154 +#: ../../using/configure.rst:196 msgid "``node``: NODERAWFS and pthread support." msgstr "" -#: ../../using/configure.rst:160 +#: ../../using/configure.rst:202 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:162 +#: ../../using/configure.rst:204 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:169 +#: ../../using/configure.rst:211 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:175 +#: ../../using/configure.rst:217 msgid "Install Options" msgstr "" -#: ../../using/configure.rst:179 +#: ../../using/configure.rst:221 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:182 +#: ../../using/configure.rst:224 msgid "This value can be retrived at runtime using :data:`sys.prefix`." msgstr "" -#: ../../using/configure.rst:184 +#: ../../using/configure.rst:226 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:189 +#: ../../using/configure.rst:231 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:191 +#: ../../using/configure.rst:233 msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." msgstr "" -#: ../../using/configure.rst:195 +#: ../../using/configure.rst:237 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:244 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:246 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:206 +#: ../../using/configure.rst:248 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:207 +#: ../../using/configure.rst:249 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:213 +#: ../../using/configure.rst:255 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:215 +#: ../../using/configure.rst:257 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " -"is recommended for best performance." +"is recommended for best performance. The experimental ``--enable-bolt`` flag " +"can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:220 +#: ../../using/configure.rst:263 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:223 +#: ../../using/configure.rst:266 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:226 +#: ../../using/configure.rst:269 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:232 +#: ../../using/configure.rst:275 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:280 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:240 +#: ../../using/configure.rst:283 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:246 +#: ../../using/configure.rst:289 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:248 +#: ../../using/configure.rst:291 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:253 +#: ../../using/configure.rst:296 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:258 +#: ../../using/configure.rst:299 +msgid "" +"Use ThinLTO as the default optimization policy on Clang if the compiler " +"accepts the flag." +msgstr "" + +#: ../../using/configure.rst:304 +msgid "" +"Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." +msgstr "" + +#: ../../using/configure.rst:308 +msgid "" +"BOLT is part of the LLVM project but is not always included in their binary " +"distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " +"available." +msgstr "" + +#: ../../using/configure.rst:312 +msgid "" +"BOLT is still a fairly new project so this flag should be considered " +"experimental for now. Because this tool operates on machine code its success " +"is dependent on a combination of the build environment + the other " +"optimization configure args + the CPU architecture, and not all combinations " +"are supported. BOLT versions before LLVM 16 are known to crash BOLT under " +"some scenarios. Use of LLVM 16 or newer for BOLT optimization is strongly " +"encouraged." +msgstr "" + +#: ../../using/configure.rst:320 +msgid "" +"The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" +"program:`configure` variables can be defined to override the default set of " +"arguments for :program:`llvm-bolt` to instrument and apply BOLT data to " +"binaries, respectively." +msgstr "" + +#: ../../using/configure.rst:329 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:334 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:266 +#: ../../using/configure.rst:337 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:270 +#: ../../using/configure.rst:341 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:273 +#: ../../using/configure.rst:344 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:275 +#: ../../using/configure.rst:346 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:350 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:285 +#: ../../using/configure.rst:354 +msgid "" +"Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" +"strict-overflow`` instead)." +msgstr "" + +#: ../../using/configure.rst:361 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:363 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:290 +#: ../../using/configure.rst:366 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:292 +#: ../../using/configure.rst:368 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:294 +#: ../../using/configure.rst:370 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:295 +#: ../../using/configure.rst:371 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "" -#: ../../using/configure.rst:296 +#: ../../using/configure.rst:372 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../using/configure.rst:297 -msgid "Add :envvar:`PYTHONTHREADDEBUG` environment variable." +#: ../../using/configure.rst:373 +msgid "" +"Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " +"variable to debug the parser." msgstr "" -#: ../../using/configure.rst:298 +#: ../../using/configure.rst:375 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:300 +#: ../../using/configure.rst:377 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:302 +#: ../../using/configure.rst:379 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "" -#: ../../using/configure.rst:303 +#: ../../using/configure.rst:380 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -451,45 +561,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:385 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:309 +#: ../../using/configure.rst:386 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:311 +#: ../../using/configure.rst:388 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:313 +#: ../../using/configure.rst:390 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:314 +#: ../../using/configure.rst:391 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:316 +#: ../../using/configure.rst:393 msgid "" "The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:319 +#: ../../using/configure.rst:396 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:322 +#: ../../using/configure.rst:399 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -497,326 +607,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:330 +#: ../../using/configure.rst:407 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:411 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:339 +#: ../../using/configure.rst:416 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:418 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:343 +#: ../../using/configure.rst:420 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "" -#: ../../using/configure.rst:344 +#: ../../using/configure.rst:421 msgid "Add :func:`sys.getobjects` function." msgstr "" -#: ../../using/configure.rst:345 +#: ../../using/configure.rst:422 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../using/configure.rst:347 +#: ../../using/configure.rst:424 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:431 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:357 +#: ../../using/configure.rst:434 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:360 +#: ../../using/configure.rst:437 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:367 +#: ../../using/configure.rst:444 msgid "Enable Valgrind support (default is no)." msgstr "" -#: ../../using/configure.rst:371 +#: ../../using/configure.rst:448 msgid "Enable DTrace support (default is no)." msgstr "" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:450 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:380 +#: ../../using/configure.rst:457 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:386 +#: ../../using/configure.rst:463 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:392 +#: ../../using/configure.rst:469 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:399 +#: ../../using/configure.rst:476 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:403 +#: ../../using/configure.rst:480 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:407 +#: ../../using/configure.rst:484 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:414 +#: ../../using/configure.rst:491 msgid "Libraries options" msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:495 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:422 +#: ../../using/configure.rst:499 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:427 -msgid "" -"Build the :mod:`_ctypes` extension module using an installed ``ffi`` " -"library, see the :mod:`ctypes` module (default is system-dependent)." -msgstr "" - -#: ../../using/configure.rst:432 +#: ../../using/configure.rst:504 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:439 +#: ../../using/configure.rst:511 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:441 +#: ../../using/configure.rst:513 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "" -#: ../../using/configure.rst:447 +#: ../../using/configure.rst:519 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:449 +#: ../../using/configure.rst:521 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "" -#: ../../using/configure.rst:455 +#: ../../using/configure.rst:527 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:459 +#: ../../using/configure.rst:531 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:535 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:469 +#: ../../using/configure.rst:541 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:471 +#: ../../using/configure.rst:543 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:472 +#: ../../using/configure.rst:544 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:474 +#: ../../using/configure.rst:546 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:552 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:556 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:486 +#: ../../using/configure.rst:558 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:487 +#: ../../using/configure.rst:559 msgid "``siphash24``;" msgstr "" -#: ../../using/configure.rst:488 +#: ../../using/configure.rst:560 msgid "``fnv``." msgstr "" -#: ../../using/configure.rst:492 +#: ../../using/configure.rst:564 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:497 +#: ../../using/configure.rst:569 msgid "Built-in hash modules:" msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:571 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:500 +#: ../../using/configure.rst:572 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:501 +#: ../../using/configure.rst:573 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:502 +#: ../../using/configure.rst:574 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:575 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:504 +#: ../../using/configure.rst:576 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:510 +#: ../../using/configure.rst:582 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:512 +#: ../../using/configure.rst:584 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:513 +#: ../../using/configure.rst:585 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:514 +#: ../../using/configure.rst:586 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:516 +#: ../../using/configure.rst:588 msgid "See the :mod:`ssl` module." msgstr "" -#: ../../using/configure.rst:522 +#: ../../using/configure.rst:594 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:526 +#: ../../using/configure.rst:598 msgid "macOS Options" msgstr "" -#: ../../using/configure.rst:528 +#: ../../using/configure.rst:600 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``\\ 。" -#: ../../using/configure.rst:533 +#: ../../using/configure.rst:605 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:539 +#: ../../using/configure.rst:611 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:616 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:547 +#: ../../using/configure.rst:619 msgid "Options:" msgstr "" -#: ../../using/configure.rst:549 +#: ../../using/configure.rst:621 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:550 +#: ../../using/configure.rst:622 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:623 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:552 +#: ../../using/configure.rst:624 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:553 +#: ../../using/configure.rst:625 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:554 +#: ../../using/configure.rst:626 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:555 +#: ../../using/configure.rst:627 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:628 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:632 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:565 +#: ../../using/configure.rst:637 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:567 +#: ../../using/configure.rst:639 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -824,101 +928,101 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:646 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:578 +#: ../../using/configure.rst:650 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:654 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:660 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:590 +#: ../../using/configure.rst:662 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:670 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:679 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:610 +#: ../../using/configure.rst:682 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:612 +#: ../../using/configure.rst:684 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:685 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:614 +#: ../../using/configure.rst:686 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:615 +#: ../../using/configure.rst:687 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:617 -msgid ":file:`setup.py`: C extensions built using the :mod:`distutils` module." +#: ../../using/configure.rst:689 +msgid ":file:`setup.py`: C extensions built using the ``setuptools`` package." msgstr "" -#: ../../using/configure.rst:620 +#: ../../using/configure.rst:692 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:622 +#: ../../using/configure.rst:694 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:695 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:624 +#: ../../using/configure.rst:696 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:698 msgid "" "C extensions are built by the Makefile (see :file:`Modules/Setup`) and " "``python setup.py build``." msgstr "" -#: ../../using/configure.rst:630 +#: ../../using/configure.rst:702 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:704 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:633 +#: ../../using/configure.rst:705 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:635 +#: ../../using/configure.rst:707 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -926,53 +1030,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:639 +#: ../../using/configure.rst:711 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:642 +#: ../../using/configure.rst:714 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:643 +#: ../../using/configure.rst:715 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:718 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:647 +#: ../../using/configure.rst:719 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:651 +#: ../../using/configure.rst:723 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:653 +#: ../../using/configure.rst:725 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:665 +#: ../../using/configure.rst:737 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:675 +#: ../../using/configure.rst:747 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -980,322 +1084,309 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:751 msgid "" "The :file:`setup.py` script only builds C extensions as shared libraries " "using the :mod:`distutils` module." msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:754 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and :c:macro:" "`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined " "differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:686 +#: ../../using/configure.rst:758 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:687 +#: ../../using/configure.rst:759 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:689 +#: ../../using/configure.rst:761 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:767 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:769 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:701 +#: ../../using/configure.rst:773 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:777 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:711 +#: ../../using/configure.rst:783 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:714 ../../using/configure.rst:909 +#: ../../using/configure.rst:786 ../../using/configure.rst:976 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value for setup.py to be able to build extension modules using the " "directories specified in the environment variables." msgstr "" -#: ../../using/configure.rst:724 +#: ../../using/configure.rst:796 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:726 +#: ../../using/configure.rst:798 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:731 +#: ../../using/configure.rst:803 msgid "Compiler flags" msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:807 msgid "C compiler command." msgstr "" -#: ../../using/configure.rst:737 +#: ../../using/configure.rst:809 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:741 -msgid "" -"C compiler command used to build the ``main()`` function of programs like " -"``python``." -msgstr "" - -#: ../../using/configure.rst:744 -msgid "" -"Variable set by the :option:`--with-cxx-main` option of the configure script." -msgstr "" - -#: ../../using/configure.rst:747 -msgid "Default: ``$(CC)``." -msgstr "" - -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:813 msgid "C++ compiler command." msgstr "" -#: ../../using/configure.rst:753 -msgid "Used if the :option:`--with-cxx-main` option is used." -msgstr "" - -#: ../../using/configure.rst:755 +#: ../../using/configure.rst:815 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:819 msgid "C compiler flags." msgstr "" -#: ../../using/configure.rst:763 +#: ../../using/configure.rst:823 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of the " "distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`)." msgstr "" -#: ../../using/configure.rst:767 +#: ../../using/configure.rst:827 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:769 +#: ../../using/configure.rst:829 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:774 +#: ../../using/configure.rst:834 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:782 +#: ../../using/configure.rst:842 +msgid "" +"Options passed to the :mod:`compileall` command line when building PYC files " +"in ``make install``. Default: ``-j0``." +msgstr "" + +#: ../../using/configure.rst:849 msgid "Extra C compiler flags." msgstr "" -#: ../../using/configure.rst:786 +#: ../../using/configure.rst:853 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:793 +#: ../../using/configure.rst:860 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:867 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:871 msgid "Optimization flags." msgstr "" -#: ../../using/configure.rst:808 +#: ../../using/configure.rst:875 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:814 +#: ../../using/configure.rst:881 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:816 +#: ../../using/configure.rst:883 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:820 +#: ../../using/configure.rst:887 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:822 +#: ../../using/configure.rst:889 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:827 +#: ../../using/configure.rst:894 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:831 +#: ../../using/configure.rst:898 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:904 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:839 +#: ../../using/configure.rst:906 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:845 +#: ../../using/configure.rst:912 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:851 +#: ../../using/configure.rst:918 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:921 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:927 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:929 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:866 +#: ../../using/configure.rst:933 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:937 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:872 -msgid "Default: ``$(PURIFY) $(MAINCC)``." +#: ../../using/configure.rst:939 +msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:943 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:945 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:953 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of the " "distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`)." msgstr "" -#: ../../using/configure.rst:890 +#: ../../using/configure.rst:957 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:892 +#: ../../using/configure.rst:959 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:966 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:973 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:915 +#: ../../using/configure.rst:982 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:985 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:989 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:991 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:995 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:930 +#: ../../using/configure.rst:997 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:1001 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:1005 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "" -#: ../../using/configure.rst:944 +#: ../../using/configure.rst:1011 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/using/mac.po b/using/mac.po index 957a5cb3fa..e34333f54c 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -151,10 +151,9 @@ msgstr "" "腳本。macOS 附帶了許多標準的 Unix 命令列編輯器,如 :program:`vim` 和 :" "program:`emacs`。如果你想要一個更 Mac 化的編輯器,那麼來自 Bare Bones " "Software 的 :program:`BBEdit` 或 :program:`TextWrangler` (參見 http://www." -"barebones.com/products/bbedit/index.html)是不錯的選擇,:program:" -"`TextMate` (參見 https://macromates.com/)也是個選擇。其他編輯器包括 :" -"program:`Gvim` (https://macvim.org/macvim/) 和 :program:" -"`Aquamacs` (https://aquamacs.org/)。" +"barebones.com/products/bbedit/index.html)是不錯的選擇,:program:`TextMate` " +"(參見 https://macromates.com/)也是個選擇。其他編輯器包括 :program:`Gvim` " +"(https://macvim.org/macvim/) 和 :program:`Aquamacs` (https://aquamacs.org/)。" #: ../../using/mac.rst:72 msgid "" @@ -290,10 +289,11 @@ msgstr "" "pyobjc/。" #: ../../using/mac.rst:146 +#, fuzzy msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " -"bundled with OS X by Apple, and the latest version can be downloaded and " +"bundled with macOS by Apple, and the latest version can be downloaded and " "installed from https://www.activestate.com; it can also be built from source." msgstr "" "標準的 Python GUI 工具套件是 :mod:`tkinter`\\ ,基於跨平臺的 Tk 工具套件 " diff --git a/using/unix.po b/using/unix.po index eb1c27b679..2078fa374b 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 00:18+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,24 +112,11 @@ msgstr "" "\n" "::" -#: ../../using/unix.rst:58 -msgid "On OpenSolaris" -msgstr "在 OpenSolaris 系統上" - #: ../../using/unix.rst:60 -msgid "" -"You can get Python from `OpenCSW `_. Various " -"versions of Python are available and can be installed with e.g. ``pkgutil -i " -"python27``." -msgstr "" -"你可以從 `OpenCSW `_ 獲取、安裝及使用各種版本的 " -"Python。比如 ``pkgutil -i python27``。" - -#: ../../using/unix.rst:67 msgid "Building Python" msgstr "建置 Python" -#: ../../using/unix.rst:69 +#: ../../using/unix.rst:62 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -142,14 +129,14 @@ msgstr "" "(克隆) `_。(如" "果你想要貢獻修補程式碼,也會需要一份 clone。)" -#: ../../using/unix.rst:75 +#: ../../using/unix.rst:68 msgid "The build process consists of the usual commands::" msgstr "" "建置過程由幾個常用命令組成:\n" "\n" "::" -#: ../../using/unix.rst:81 +#: ../../using/unix.rst:74 msgid "" ":ref:`Configuration options ` and caveats for specific " "Unix platforms are extensively documented in the :source:`README.rst` file " @@ -159,7 +146,7 @@ msgstr "" "地記錄在 Python 原始碼樹 (source tree) 根目錄下的 :source:`README.rst` 檔案" "中。" -#: ../../using/unix.rst:87 +#: ../../using/unix.rst:80 msgid "" "``make install`` can overwrite or masquerade the :file:`python3` binary. " "``make altinstall`` is therefore recommended instead of ``make install`` " @@ -169,11 +156,11 @@ msgstr "" "``make altinstall`` 而不是 ``make install``,因為它只安裝 :file:" "`{exec_prefix}/bin/python{version}`。" -#: ../../using/unix.rst:93 +#: ../../using/unix.rst:86 msgid "Python-related paths and files" msgstr "與 Python 相關的路徑和檔案" -#: ../../using/unix.rst:95 +#: ../../using/unix.rst:88 msgid "" "These are subject to difference depending on local installation " "conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" @@ -183,28 +170,28 @@ msgstr "" "這取決於本地安裝慣例;:option:`prefix <--prefix>` 和 :option:`exec_prefix <--" "exec-prefix>` 相依於安裝方式,應被直譯來讓 GNU 軟體使用;它們也可能相同。" -#: ../../using/unix.rst:100 +#: ../../using/unix.rst:93 msgid "" "For example, on most Linux systems, the default for both is :file:`/usr`." msgstr "例如,在大多數 Linux 系統上,兩者的預設值皆是 :file:`/usr`。" -#: ../../using/unix.rst:103 +#: ../../using/unix.rst:96 msgid "File/directory" msgstr "檔案/目錄" -#: ../../using/unix.rst:103 +#: ../../using/unix.rst:96 msgid "Meaning" msgstr "含意" -#: ../../using/unix.rst:105 +#: ../../using/unix.rst:98 msgid ":file:`{exec_prefix}/bin/python3`" msgstr ":file:`{exec_prefix}/bin/python3`" -#: ../../using/unix.rst:105 +#: ../../using/unix.rst:98 msgid "Recommended location of the interpreter." msgstr "直譯器的推薦位置。" -#: ../../using/unix.rst:107 +#: ../../using/unix.rst:100 msgid "" ":file:`{prefix}/lib/python{version}`, :file:`{exec_prefix}/lib/" "python{version}`" @@ -212,12 +199,12 @@ msgstr "" ":file:`{prefix}/lib/python{version}`、:file:`{exec_prefix}/lib/" "python{version}`" -#: ../../using/unix.rst:107 +#: ../../using/unix.rst:100 msgid "" "Recommended locations of the directories containing the standard modules." msgstr "包含標準模組目錄的推薦位置。" -#: ../../using/unix.rst:110 +#: ../../using/unix.rst:103 msgid "" ":file:`{prefix}/include/python{version}`, :file:`{exec_prefix}/include/" "python{version}`" @@ -225,25 +212,25 @@ msgstr "" ":file:`{prefix}/include/python{version}`、:file:`{exec_prefix}/include/" "python{version}`" -#: ../../using/unix.rst:110 +#: ../../using/unix.rst:103 msgid "" "Recommended locations of the directories containing the include files needed " "for developing Python extensions and embedding the interpreter." msgstr "" "包含開發 Python 擴充套件和嵌入直譯器所需 include 檔案之目錄的推薦位置。" -#: ../../using/unix.rst:118 +#: ../../using/unix.rst:111 msgid "Miscellaneous" msgstr "雜項" -#: ../../using/unix.rst:120 +#: ../../using/unix.rst:113 msgid "" "To easily use Python scripts on Unix, you need to make them executable, e.g. " "with" msgstr "" "要在 Unix 上使用 Python 腳本,你需要讓他們是可執行的 (executable),例如用" -#: ../../using/unix.rst:127 +#: ../../using/unix.rst:120 msgid "" "and put an appropriate Shebang line at the top of the script. A good choice " "is usually ::" @@ -252,7 +239,7 @@ msgstr "" "\n" "::" -#: ../../using/unix.rst:132 +#: ../../using/unix.rst:125 msgid "" "which searches for the Python interpreter in the whole :envvar:`PATH`. " "However, some Unices may not have the :program:`env` command, so you may " @@ -262,17 +249,17 @@ msgstr "" "program:`env` 命令,因此你可能需要將 ``/usr/bin/python3`` 寫死 (hardcode) 成" "直譯器路徑。" -#: ../../using/unix.rst:136 +#: ../../using/unix.rst:129 msgid "" "To use shell commands in your Python scripts, look at the :mod:`subprocess` " "module." msgstr "要在 Python 腳本中使用 shell 命令,請見 :mod:`subprocess` 模組。" -#: ../../using/unix.rst:141 +#: ../../using/unix.rst:134 msgid "Custom OpenSSL" msgstr "客製化 OpenSSL" -#: ../../using/unix.rst:143 +#: ../../using/unix.rst:136 msgid "" "To use your vendor's OpenSSL configuration and system trust store, locate " "the directory with ``openssl.cnf`` file or symlink in ``/etc``. On most " @@ -285,7 +272,7 @@ msgstr "" "(symlink)。在大多數發行版上,該檔案會是在 ``/etc/ssl`` 或者 ``/etc/pki/tls`` " "中。該目錄亦應包含一個 ``cert.pem`` 檔案和/或一個 ``certs`` 目錄。" -#: ../../using/unix.rst:154 +#: ../../using/unix.rst:147 msgid "" "Download, build, and install OpenSSL. Make sure you use ``install_sw`` and " "not ``install``. The ``install_sw`` target does not override ``openssl.cnf``." @@ -293,7 +280,7 @@ msgstr "" "下載、建置並安裝 OpenSSL。請確保你使用 ``install_sw`` 而不是 ``install``。" "``install_sw`` 的目標不會覆蓋 ``openssl.cnf``。" -#: ../../using/unix.rst:172 +#: ../../using/unix.rst:165 msgid "" "Build Python with custom OpenSSL (see the configure ``--with-openssl`` and " "``--with-openssl-rpath`` options)" @@ -301,7 +288,7 @@ msgstr "" "使用客製化 OpenSSL 建置 Python(參見配置 ``--with-openssl`` 和 ``--with-" "openssl-rpath`` 選項)" -#: ../../using/unix.rst:187 +#: ../../using/unix.rst:180 msgid "" "Patch releases of OpenSSL have a backwards compatible ABI. You don't need to " "recompile Python to update OpenSSL. It's sufficient to replace the custom " @@ -309,3 +296,14 @@ msgid "" msgstr "" "OpenSSL 的修補釋出版 (patch releases) 具有向後相容的 ABI。你不需要重新編譯 " "Python 來更新 OpenSSL。使用一個新的版本來替代客製化 OpenSSL 安裝版就可以了。" + +#~ msgid "On OpenSolaris" +#~ msgstr "在 OpenSolaris 系統上" + +#~ msgid "" +#~ "You can get Python from `OpenCSW `_. Various " +#~ "versions of Python are available and can be installed with e.g. ``pkgutil " +#~ "-i python27``." +#~ msgstr "" +#~ "你可以從 `OpenCSW `_ 獲取、安裝及使用各種版本的 " +#~ "Python。比如 ``pkgutil -i python27``。" diff --git a/using/windows.po b/using/windows.po index 384bd87cc9..be19c9630e 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,303 +231,351 @@ msgstr "" #: ../../using/windows.rst:129 msgid "" -"To completely hide the installer UI and install Python silently, pass the ``/" -"quiet`` option. To skip past the user interaction but still display progress " -"and errors, pass the ``/passive`` option. The ``/uninstall`` option may be " -"passed to immediately begin removing Python - no confirmation prompt will be " -"displayed." +"The following options (found by executing the installer with ``/?``) can be " +"passed into the installer:" msgstr "" +#: ../../using/windows.rst:133 ../../using/windows.rst:153 +#: ../../using/windows.rst:1082 +msgid "Name" +msgstr "" + +#: ../../using/windows.rst:133 ../../using/windows.rst:153 +#: ../../using/windows.rst:1082 +msgid "Description" +msgstr "描述" + #: ../../using/windows.rst:135 +msgid "/passive" +msgstr "" + +#: ../../using/windows.rst:135 +msgid "to display progress without requiring user interaction" +msgstr "" + +#: ../../using/windows.rst:137 +msgid "/quiet" +msgstr "" + +#: ../../using/windows.rst:137 +msgid "to install/uninstall without displaying any UI" +msgstr "" + +#: ../../using/windows.rst:139 +msgid "/simple" +msgstr "" + +#: ../../using/windows.rst:139 +msgid "to prevent user customization" +msgstr "" + +#: ../../using/windows.rst:141 +#, fuzzy +msgid "/uninstall" +msgstr "SimpleInstall" + +#: ../../using/windows.rst:141 +msgid "to remove Python (without confirmation)" +msgstr "" + +#: ../../using/windows.rst:143 +msgid "/layout [directory]" +msgstr "" + +#: ../../using/windows.rst:143 +msgid "to pre-download all components" +msgstr "" + +#: ../../using/windows.rst:145 +msgid "/log [filename]" +msgstr "" + +#: ../../using/windows.rst:145 +msgid "to specify log files location" +msgstr "" + +#: ../../using/windows.rst:148 msgid "" "All other options are passed as ``name=value``, where the value is usually " "``0`` to disable a feature, ``1`` to enable a feature, or a path. The full " "list of available options is shown below." msgstr "" -#: ../../using/windows.rst:140 ../../using/windows.rst:1069 -msgid "Name" -msgstr "" - -#: ../../using/windows.rst:140 ../../using/windows.rst:1069 -msgid "Description" -msgstr "描述" - -#: ../../using/windows.rst:140 +#: ../../using/windows.rst:153 msgid "Default" msgstr "預設" -#: ../../using/windows.rst:142 +#: ../../using/windows.rst:155 msgid "InstallAllUsers" msgstr "InstallAllUsers" -#: ../../using/windows.rst:142 +#: ../../using/windows.rst:155 msgid "Perform a system-wide installation." msgstr "" -#: ../../using/windows.rst:142 ../../using/windows.rst:168 -#: ../../using/windows.rst:171 ../../using/windows.rst:175 -#: ../../using/windows.rst:184 ../../using/windows.rst:206 -#: ../../using/windows.rst:214 ../../using/windows.rst:217 +#: ../../using/windows.rst:155 ../../using/windows.rst:181 +#: ../../using/windows.rst:184 ../../using/windows.rst:188 +#: ../../using/windows.rst:197 ../../using/windows.rst:219 +#: ../../using/windows.rst:227 ../../using/windows.rst:230 msgid "0" msgstr "0" -#: ../../using/windows.rst:144 +#: ../../using/windows.rst:157 msgid "TargetDir" msgstr "TargetDir" -#: ../../using/windows.rst:144 +#: ../../using/windows.rst:157 msgid "The installation directory" msgstr "安裝目錄" -#: ../../using/windows.rst:144 +#: ../../using/windows.rst:157 msgid "Selected based on InstallAllUsers" msgstr "" -#: ../../using/windows.rst:147 +#: ../../using/windows.rst:160 msgid "DefaultAllUsersTargetDir" msgstr "DefaultAllUsersTargetDir" -#: ../../using/windows.rst:147 +#: ../../using/windows.rst:160 msgid "The default installation directory for all-user installs" msgstr "" -#: ../../using/windows.rst:147 +#: ../../using/windows.rst:160 msgid "" ":file:`%ProgramFiles%\\\\\\ Python X.Y` or :file:`\\ %ProgramFiles(x86)%\\\\" "\\ Python X.Y`" msgstr "" -#: ../../using/windows.rst:152 +#: ../../using/windows.rst:165 msgid "DefaultJustForMeTargetDir" msgstr "DefaultJustForMeTargetDir" -#: ../../using/windows.rst:152 +#: ../../using/windows.rst:165 msgid "The default install directory for just-for-me installs" msgstr "預設安裝目錄給 只有給我 安裝方式" -#: ../../using/windows.rst:152 +#: ../../using/windows.rst:165 msgid "" ":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:" "`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:" "`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" msgstr "" -#: ../../using/windows.rst:162 +#: ../../using/windows.rst:175 msgid "DefaultCustomTargetDir" msgstr "DefaultCustomTargetDir" -#: ../../using/windows.rst:162 +#: ../../using/windows.rst:175 msgid "The default custom install directory displayed in the UI" msgstr "" -#: ../../using/windows.rst:162 ../../using/windows.rst:219 +#: ../../using/windows.rst:175 ../../using/windows.rst:232 msgid "(empty)" msgstr "" -#: ../../using/windows.rst:165 +#: ../../using/windows.rst:178 msgid "AssociateFiles" msgstr "AssociateFiles" -#: ../../using/windows.rst:165 +#: ../../using/windows.rst:178 msgid "Create file associations if the launcher is also installed." msgstr "當執行程序也被安裝時創造檔案關聯" -#: ../../using/windows.rst:165 ../../using/windows.rst:179 -#: ../../using/windows.rst:182 ../../using/windows.rst:186 -#: ../../using/windows.rst:190 ../../using/windows.rst:194 -#: ../../using/windows.rst:196 ../../using/windows.rst:200 -#: ../../using/windows.rst:204 ../../using/windows.rst:208 -#: ../../using/windows.rst:210 ../../using/windows.rst:212 +#: ../../using/windows.rst:178 ../../using/windows.rst:192 +#: ../../using/windows.rst:195 ../../using/windows.rst:199 +#: ../../using/windows.rst:203 ../../using/windows.rst:207 +#: ../../using/windows.rst:209 ../../using/windows.rst:213 +#: ../../using/windows.rst:217 ../../using/windows.rst:221 +#: ../../using/windows.rst:223 ../../using/windows.rst:225 msgid "1" msgstr "1" -#: ../../using/windows.rst:168 +#: ../../using/windows.rst:181 msgid "CompileAll" msgstr "CompileAll" -#: ../../using/windows.rst:168 +#: ../../using/windows.rst:181 msgid "Compile all ``.py`` files to ``.pyc``." msgstr "編譯所有 ``.py`` 檔案為 ``.pyc``\\ 。" -#: ../../using/windows.rst:171 +#: ../../using/windows.rst:184 msgid "PrependPath" msgstr "PrependPath" -#: ../../using/windows.rst:171 +#: ../../using/windows.rst:184 msgid "" "Prepend install and Scripts directories to :envvar:`PATH` and add ``.PY`` " "to :envvar:`PATHEXT`" msgstr "" -#: ../../using/windows.rst:175 +#: ../../using/windows.rst:188 msgid "AppendPath" msgstr "AppendPath" -#: ../../using/windows.rst:175 +#: ../../using/windows.rst:188 msgid "" "Append install and Scripts directories to :envvar:`PATH` and add ``.PY`` " "to :envvar:`PATHEXT`" msgstr "" -#: ../../using/windows.rst:179 +#: ../../using/windows.rst:192 msgid "Shortcuts" msgstr "Shortcuts" -#: ../../using/windows.rst:179 +#: ../../using/windows.rst:192 msgid "" "Create shortcuts for the interpreter, documentation and IDLE if installed." msgstr "" -#: ../../using/windows.rst:182 +#: ../../using/windows.rst:195 msgid "Include_doc" msgstr "Include_doc" -#: ../../using/windows.rst:182 +#: ../../using/windows.rst:195 msgid "Install Python manual" msgstr "安裝Python文件" -#: ../../using/windows.rst:184 +#: ../../using/windows.rst:197 msgid "Include_debug" msgstr "Include_debug" -#: ../../using/windows.rst:184 +#: ../../using/windows.rst:197 msgid "Install debug binaries" msgstr "" -#: ../../using/windows.rst:186 +#: ../../using/windows.rst:199 msgid "Include_dev" msgstr "Include_dev" -#: ../../using/windows.rst:186 +#: ../../using/windows.rst:199 msgid "" "Install developer headers and libraries. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:190 +#: ../../using/windows.rst:203 msgid "Include_exe" msgstr "Include_exe" -#: ../../using/windows.rst:190 +#: ../../using/windows.rst:203 msgid "" "Install :file:`python.exe` and related files. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:194 +#: ../../using/windows.rst:207 msgid "Include_launcher" msgstr "Include_launcher" -#: ../../using/windows.rst:194 +#: ../../using/windows.rst:207 msgid "Install :ref:`launcher`." msgstr "安裝 :ref:`launcher`。" -#: ../../using/windows.rst:196 +#: ../../using/windows.rst:209 msgid "InstallLauncherAllUsers" msgstr "InstallLauncherAllUsers" -#: ../../using/windows.rst:196 +#: ../../using/windows.rst:209 msgid "" "Installs the launcher for all users. Also requires ``Include_launcher`` to " "be set to 1" msgstr "" -#: ../../using/windows.rst:200 +#: ../../using/windows.rst:213 msgid "Include_lib" msgstr "Include_lib" -#: ../../using/windows.rst:200 +#: ../../using/windows.rst:213 msgid "" "Install standard library and extension modules. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:204 +#: ../../using/windows.rst:217 msgid "Include_pip" msgstr "Include_pip" -#: ../../using/windows.rst:204 +#: ../../using/windows.rst:217 msgid "Install bundled pip and setuptools" msgstr "" -#: ../../using/windows.rst:206 +#: ../../using/windows.rst:219 msgid "Include_symbols" msgstr "Include_symbols" -#: ../../using/windows.rst:206 +#: ../../using/windows.rst:219 msgid "Install debugging symbols (``*.pdb``)" msgstr "" -#: ../../using/windows.rst:208 +#: ../../using/windows.rst:221 msgid "Include_tcltk" msgstr "Include_tcltk" -#: ../../using/windows.rst:208 +#: ../../using/windows.rst:221 msgid "Install Tcl/Tk support and IDLE" msgstr "" -#: ../../using/windows.rst:210 +#: ../../using/windows.rst:223 msgid "Include_test" msgstr "Include_test" -#: ../../using/windows.rst:210 +#: ../../using/windows.rst:223 msgid "Install standard library test suite" msgstr "" -#: ../../using/windows.rst:212 +#: ../../using/windows.rst:225 msgid "Include_tools" msgstr "Include_tools" -#: ../../using/windows.rst:212 +#: ../../using/windows.rst:225 msgid "Install utility scripts" msgstr "" -#: ../../using/windows.rst:214 +#: ../../using/windows.rst:227 msgid "LauncherOnly" msgstr "LauncherOnly" -#: ../../using/windows.rst:214 +#: ../../using/windows.rst:227 msgid "Only installs the launcher. This will override most other options." msgstr "" -#: ../../using/windows.rst:217 +#: ../../using/windows.rst:230 msgid "SimpleInstall" msgstr "SimpleInstall" -#: ../../using/windows.rst:217 +#: ../../using/windows.rst:230 msgid "Disable most install UI" msgstr "" -#: ../../using/windows.rst:219 +#: ../../using/windows.rst:232 msgid "SimpleInstallDescription" msgstr "SimpleInstallDescription" -#: ../../using/windows.rst:219 +#: ../../using/windows.rst:232 msgid "A custom message to display when the simplified install UI is used." msgstr "" -#: ../../using/windows.rst:223 +#: ../../using/windows.rst:236 msgid "" "For example, to silently install a default, system-wide Python installation, " "you could use the following command (from an elevated command prompt)::" msgstr "" -#: ../../using/windows.rst:228 +#: ../../using/windows.rst:241 msgid "" "To allow users to easily install a personal copy of Python without the test " "suite, you could provide a shortcut with the following command. This will " "display a simplified initial page and disallow customization::" msgstr "" -#: ../../using/windows.rst:235 +#: ../../using/windows.rst:248 msgid "" "(Note that omitting the launcher also omits file associations, and is only " "recommended for per-user installs when there is also a system-wide " "installation that included the launcher.)" msgstr "" -#: ../../using/windows.rst:239 +#: ../../using/windows.rst:252 msgid "" "The options listed above can also be provided in a file named ``unattend." "xml`` alongside the executable. This file specifies a list of options and " @@ -536,11 +584,11 @@ msgid "" "strings. This example file sets the same options as the previous example:" msgstr "" -#: ../../using/windows.rst:258 +#: ../../using/windows.rst:271 msgid "Installing Without Downloading" msgstr "當安裝時不下載" -#: ../../using/windows.rst:260 +#: ../../using/windows.rst:273 msgid "" "As some features of Python are not included in the initial installer " "download, selecting those features may require an internet connection. To " @@ -551,7 +599,7 @@ msgid "" "to be performed it is very useful to have a locally cached copy." msgstr "" -#: ../../using/windows.rst:268 +#: ../../using/windows.rst:281 msgid "" "Execute the following command from Command Prompt to download all possible " "required files. Remember to substitute ``python-3.9.0.exe`` for the actual " @@ -559,23 +607,23 @@ msgid "" "avoid collisions between files with the same name." msgstr "" -#: ../../using/windows.rst:277 +#: ../../using/windows.rst:290 msgid "" "You may also specify the ``/quiet`` option to hide the progress display." msgstr "" -#: ../../using/windows.rst:280 +#: ../../using/windows.rst:293 msgid "Modifying an install" msgstr "" -#: ../../using/windows.rst:282 +#: ../../using/windows.rst:295 msgid "" "Once Python has been installed, you can add or remove features through the " "Programs and Features tool that is part of Windows. Select the Python entry " "and choose \"Uninstall/Change\" to open the installer in maintenance mode." msgstr "" -#: ../../using/windows.rst:286 +#: ../../using/windows.rst:299 msgid "" "\"Modify\" allows you to add or remove features by modifying the checkboxes " "- unchanged checkboxes will not install or remove anything. Some options " @@ -583,42 +631,42 @@ msgid "" "these, you will need to remove and then reinstall Python completely." msgstr "" -#: ../../using/windows.rst:291 +#: ../../using/windows.rst:304 msgid "" "\"Repair\" will verify all the files that should be installed using the " "current settings and replace any that have been removed or modified." msgstr "" -#: ../../using/windows.rst:294 +#: ../../using/windows.rst:307 msgid "" "\"Uninstall\" will remove Python entirely, with the exception of the :ref:" "`launcher`, which has its own entry in Programs and Features." msgstr "" -#: ../../using/windows.rst:301 +#: ../../using/windows.rst:314 msgid "The Microsoft Store package" msgstr "" -#: ../../using/windows.rst:305 +#: ../../using/windows.rst:318 msgid "" "The Microsoft Store package is an easily installable Python interpreter that " "is intended mainly for interactive use, for example, by students." msgstr "" -#: ../../using/windows.rst:308 +#: ../../using/windows.rst:321 msgid "" "To install the package, ensure you have the latest Windows 10 updates and " "search the Microsoft Store app for \"Python |version|\". Ensure that the app " "you select is published by the Python Software Foundation, and install it." msgstr "" -#: ../../using/windows.rst:313 +#: ../../using/windows.rst:326 msgid "" "Python will always be available for free on the Microsoft Store. If you are " "asked to pay for it, you have not selected the correct package." msgstr "" -#: ../../using/windows.rst:316 +#: ../../using/windows.rst:329 msgid "" "After installation, Python may be launched by finding it in Start. " "Alternatively, it will be available from any Command Prompt or PowerShell " @@ -626,7 +674,7 @@ msgid "" "``pip`` or ``idle``. IDLE can also be found in Start." msgstr "" -#: ../../using/windows.rst:321 +#: ../../using/windows.rst:334 msgid "" "All three commands are also available with version number suffixes, for " "example, as ``python3.exe`` and ``python3.x.exe`` as well as ``python.exe`` " @@ -637,13 +685,13 @@ msgid "" "of ``python`` is selected." msgstr "" -#: ../../using/windows.rst:329 +#: ../../using/windows.rst:342 msgid "" "Virtual environments can be created with ``python -m venv`` and activated " "and used as normal." msgstr "" -#: ../../using/windows.rst:332 +#: ../../using/windows.rst:345 msgid "" "If you have installed another version of Python and added it to your " "``PATH`` variable, it will be available as ``python.exe`` rather than the " @@ -651,13 +699,13 @@ msgid "" "exe`` or ``python3.x.exe``." msgstr "" -#: ../../using/windows.rst:337 +#: ../../using/windows.rst:350 msgid "" "The ``py.exe`` launcher will detect this Python installation, but will " "prefer installations from the traditional installer." msgstr "" -#: ../../using/windows.rst:340 +#: ../../using/windows.rst:353 msgid "" "To remove Python, open Settings and use Apps and Features, or else find " "Python in Start and right-click to select Uninstall. Uninstalling will " @@ -665,15 +713,15 @@ msgid "" "but will not remove any virtual environments" msgstr "" -#: ../../using/windows.rst:346 +#: ../../using/windows.rst:359 msgid "Known issues" msgstr "" -#: ../../using/windows.rst:349 +#: ../../using/windows.rst:362 msgid "Redirection of local data, registry, and temporary paths" msgstr "" -#: ../../using/windows.rst:351 +#: ../../using/windows.rst:364 msgid "" "Because of restrictions on Microsoft Store apps, Python scripts may not have " "full write access to shared locations such as :envvar:`TEMP` and the " @@ -681,7 +729,7 @@ msgid "" "modify the shared locations, you will need to install the full installer." msgstr "" -#: ../../using/windows.rst:356 +#: ../../using/windows.rst:369 msgid "" "At runtime, Python will use a private copy of well-known Windows folders and " "the registry. For example, if the environment variable :envvar:`%APPDATA%` " @@ -692,7 +740,7 @@ msgid "" "\\`." msgstr "" -#: ../../using/windows.rst:361 +#: ../../using/windows.rst:374 msgid "" "When reading files, Windows will return the file from the private folder, or " "if that does not exist, the real Windows directory. For example reading :" @@ -701,36 +749,36 @@ msgid "" "\\WindowsApps\\\\package_name\\\\VFS\\\\SystemX86`." msgstr "" -#: ../../using/windows.rst:365 +#: ../../using/windows.rst:378 msgid "" "You can find the real path of any existing file using :func:`os.path." "realpath`:" msgstr "" -#: ../../using/windows.rst:374 +#: ../../using/windows.rst:387 msgid "When writing to the Windows Registry, the following behaviors exist:" msgstr "" -#: ../../using/windows.rst:376 +#: ../../using/windows.rst:389 msgid "" "Reading from ``HKLM\\\\Software`` is allowed and results are merged with " "the :file:`registry.dat` file in the package." msgstr "" -#: ../../using/windows.rst:377 +#: ../../using/windows.rst:390 msgid "" "Writing to ``HKLM\\\\Software`` is not allowed if the corresponding key/" "value exists, i.e. modifying existing keys." msgstr "" -#: ../../using/windows.rst:378 +#: ../../using/windows.rst:391 msgid "" "Writing to ``HKLM\\\\Software`` is allowed as long as a corresponding key/" "value does not exist in the package and the user has the correct access " "permissions." msgstr "" -#: ../../using/windows.rst:381 +#: ../../using/windows.rst:394 msgid "" "For more detail on the technical basis for these limitations, please consult " "Microsoft's documentation on packaged full-trust apps, currently available " @@ -739,11 +787,11 @@ msgid "" "behind-the-scenes>`_" msgstr "" -#: ../../using/windows.rst:390 +#: ../../using/windows.rst:403 msgid "The nuget.org packages" msgstr "nuget.org 套件" -#: ../../using/windows.rst:394 +#: ../../using/windows.rst:407 msgid "" "The nuget.org package is a reduced size Python environment intended for use " "on continuous integration and build systems that do not have a system-wide " @@ -751,14 +799,14 @@ msgid "" "works perfectly fine for packages containing build-time tools." msgstr "" -#: ../../using/windows.rst:399 +#: ../../using/windows.rst:412 msgid "" "Visit `nuget.org `_ for the most up-to-date " "information on using nuget. What follows is a summary that is sufficient for " "Python developers." msgstr "" -#: ../../using/windows.rst:403 +#: ../../using/windows.rst:416 msgid "" "The ``nuget.exe`` command line tool may be downloaded directly from " "``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With " @@ -766,7 +814,7 @@ msgid "" "installed using::" msgstr "" -#: ../../using/windows.rst:411 +#: ../../using/windows.rst:424 msgid "" "To select a particular version, add a ``-Version 3.x.y``. The output " "directory may be changed from ``.``, and the package will be installed into " @@ -776,7 +824,7 @@ msgid "" "directory that contains the Python installation:" msgstr "" -#: ../../using/windows.rst:428 +#: ../../using/windows.rst:441 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " @@ -784,7 +832,7 @@ msgid "" "will do this automatically if they do not preserve files between builds." msgstr "" -#: ../../using/windows.rst:433 +#: ../../using/windows.rst:446 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+" @@ -792,7 +840,7 @@ msgid "" "automatically use the headers and import libraries in your build." msgstr "" -#: ../../using/windows.rst:438 +#: ../../using/windows.rst:451 msgid "" "The package information pages on nuget.org are `www.nuget.org/packages/" "python `_ for the 64-bit version and " @@ -800,18 +848,18 @@ msgid "" "pythonx86>`_ for the 32-bit version." msgstr "" -#: ../../using/windows.rst:447 +#: ../../using/windows.rst:460 msgid "The embeddable package" msgstr "" -#: ../../using/windows.rst:451 +#: ../../using/windows.rst:464 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:455 +#: ../../using/windows.rst:468 msgid "" "When extracted, the embedded distribution is (almost) fully isolated from " "the user's system, including environment variables, system registry " @@ -822,7 +870,7 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:464 +#: ../../using/windows.rst:477 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_" msgstr "`ActivePython `_" -#: ../../using/windows.rst:532 +#: ../../using/windows.rst:545 msgid "Installer with multi-platform compatibility, documentation, PyWin32" msgstr "" -#: ../../using/windows.rst:536 +#: ../../using/windows.rst:549 msgid "`Anaconda `_" msgstr "`Anaconda `_" -#: ../../using/windows.rst:535 +#: ../../using/windows.rst:548 msgid "" "Popular scientific modules (such as numpy, scipy and pandas) and the " "``conda`` package manager." msgstr "" -#: ../../using/windows.rst:542 +#: ../../using/windows.rst:555 msgid "`Enthought Deployment Manager `_" msgstr "`Enthought Deployment Manager `_" -#: ../../using/windows.rst:539 +#: ../../using/windows.rst:552 msgid "\"The Next Generation Python Environment and Package Manager\"." msgstr "" -#: ../../using/windows.rst:541 +#: ../../using/windows.rst:554 msgid "" "Previously Enthought provided Canopy, but it `reached end of life in 2016 " "`_." msgstr "" -#: ../../using/windows.rst:546 +#: ../../using/windows.rst:559 msgid "`WinPython `_" msgstr "`WinPython `_" -#: ../../using/windows.rst:545 +#: ../../using/windows.rst:558 msgid "" "Windows-specific distribution with prebuilt scientific packages and tools " "for building packages." msgstr "" -#: ../../using/windows.rst:548 +#: ../../using/windows.rst:561 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:554 +#: ../../using/windows.rst:567 msgid "Configuring Python" msgstr "設定 Python" -#: ../../using/windows.rst:556 +#: ../../using/windows.rst:569 msgid "" "To run Python conveniently from a command prompt, you might consider " "changing some default environment variables in Windows. While the installer " @@ -987,29 +1035,29 @@ msgid "" "use multiple versions of Python, consider using the :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:566 +#: ../../using/windows.rst:579 msgid "Excursus: Setting environment variables" msgstr "" -#: ../../using/windows.rst:568 +#: ../../using/windows.rst:581 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:571 +#: ../../using/windows.rst:584 msgid "" "To temporarily set environment variables, open Command Prompt and use the :" "command:`set` command:" msgstr "" -#: ../../using/windows.rst:580 +#: ../../using/windows.rst:593 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:583 +#: ../../using/windows.rst:596 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. " @@ -1018,7 +1066,7 @@ msgid "" "launched." msgstr "" -#: ../../using/windows.rst:589 +#: ../../using/windows.rst:602 msgid "" "To permanently modify the default environment variables, click Start and " "search for 'edit environment variables', or open System properties, :" @@ -1028,20 +1076,20 @@ msgid "" "your machine (i.e. Administrator rights)." msgstr "" -#: ../../using/windows.rst:598 +#: ../../using/windows.rst:611 msgid "" "Windows will concatenate User variables *after* System variables, which may " "cause unexpected results when modifying :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:601 +#: ../../using/windows.rst:614 msgid "" "The :envvar:`PYTHONPATH` variable is used by all versions of Python, so you " "should not permanently configure it unless the listed paths only include " "code that is compatible with all of your installed Python versions." msgstr "" -#: ../../using/windows.rst:609 +#: ../../using/windows.rst:622 msgid "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" @@ -1049,11 +1097,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" -#: ../../using/windows.rst:609 +#: ../../using/windows.rst:622 msgid "Overview of environment variables on Windows" msgstr "Windows 上的環境變數概要" -#: ../../using/windows.rst:612 +#: ../../using/windows.rst:625 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" @@ -1061,11 +1109,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" -#: ../../using/windows.rst:612 +#: ../../using/windows.rst:625 msgid "The ``set`` command, for temporarily modifying environment variables" msgstr "" -#: ../../using/windows.rst:614 +#: ../../using/windows.rst:627 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" @@ -1073,22 +1121,22 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" -#: ../../using/windows.rst:615 +#: ../../using/windows.rst:628 msgid "The ``setx`` command, for permanently modifying environment variables" msgstr "" -#: ../../using/windows.rst:621 +#: ../../using/windows.rst:634 msgid "Finding the Python executable" msgstr "" -#: ../../using/windows.rst:625 +#: ../../using/windows.rst:638 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:629 +#: ../../using/windows.rst:642 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 " @@ -1099,7 +1147,7 @@ msgid "" "documentation." msgstr "" -#: ../../using/windows.rst:636 +#: ../../using/windows.rst:649 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 " @@ -1110,24 +1158,24 @@ msgid "" "entries already existed)::" msgstr "" -#: ../../using/windows.rst:649 +#: ../../using/windows.rst:662 msgid "UTF-8 mode" msgstr "UTF-8 模式" -#: ../../using/windows.rst:653 +#: ../../using/windows.rst:666 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.getencoding`)." msgstr "" -#: ../../using/windows.rst:657 +#: ../../using/windows.rst:670 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:660 +#: ../../using/windows.rst:673 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:669 +#: ../../using/windows.rst:682 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 " @@ -1151,27 +1199,27 @@ msgid "" "utf8`` command line option." msgstr "" -#: ../../using/windows.rst:676 +#: ../../using/windows.rst:689 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" -#: ../../using/windows.rst:679 +#: ../../using/windows.rst:692 msgid "Console I/O including standard I/O (see :pep:`528` for details)." msgstr "" -#: ../../using/windows.rst:680 +#: ../../using/windows.rst:693 msgid "" "The :term:`filesystem encoding ` " "(see :pep:`529` for details)." msgstr "" -#: ../../using/windows.rst:687 +#: ../../using/windows.rst:700 msgid "Python Launcher for Windows" msgstr "" -#: ../../using/windows.rst:691 +#: ../../using/windows.rst:704 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-" @@ -1179,7 +1227,7 @@ msgid "" "locate and execute that version." msgstr "" -#: ../../using/windows.rst:696 +#: ../../using/windows.rst:709 msgid "" "Unlike the :envvar:`PATH` variable, the launcher will correctly select the " "most appropriate version of Python. It will prefer per-user installations " @@ -1187,19 +1235,19 @@ msgid "" "most recently installed version." msgstr "" -#: ../../using/windows.rst:701 +#: ../../using/windows.rst:714 msgid "The launcher was originally specified in :pep:`397`." msgstr "" -#: ../../using/windows.rst:704 +#: ../../using/windows.rst:717 msgid "Getting started" msgstr "開始" -#: ../../using/windows.rst:707 +#: ../../using/windows.rst:720 msgid "From the command-line" msgstr "" -#: ../../using/windows.rst:711 +#: ../../using/windows.rst:724 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 " @@ -1207,43 +1255,43 @@ msgid "" "the launcher is available, execute the following command in Command Prompt::" msgstr "" -#: ../../using/windows.rst:718 +#: ../../using/windows.rst:731 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:722 +#: ../../using/windows.rst:735 msgid "" "If you have multiple versions of Python installed (e.g., 3.7 and |version|) " "you will have noticed that Python |version| was started - to launch Python " "3.7, try the command::" msgstr "" -#: ../../using/windows.rst:728 +#: ../../using/windows.rst:741 msgid "" "If you want the latest version of Python 2 you have installed, try the " "command::" msgstr "" -#: ../../using/windows.rst:733 +#: ../../using/windows.rst:746 msgid "" "If you see the following error, you do not have the launcher installed::" msgstr "" -#: ../../using/windows.rst:738 +#: ../../using/windows.rst:751 msgid "The command::" msgstr "" "指令:\n" "\n" "::" -#: ../../using/windows.rst:742 +#: ../../using/windows.rst:755 msgid "displays the currently installed version(s) of Python." msgstr "" -#: ../../using/windows.rst:744 +#: ../../using/windows.rst:757 msgid "" "The ``-x.y`` argument is the short form of the ``-V:Company/Tag`` argument, " "which allows selecting a specific Python runtime, including those that may " @@ -1252,21 +1300,21 @@ msgid "" "available runtimes using the ``-V:`` format." msgstr "" -#: ../../using/windows.rst:750 +#: ../../using/windows.rst:763 msgid "" "When using the ``-V:`` argument, specifying the Company will limit selection " "to runtimes from that provider, while specifying only the Tag will select " "from all providers. Note that omitting the slash implies a tag::" msgstr "" -#: ../../using/windows.rst:763 +#: ../../using/windows.rst:776 msgid "" "The short form of the argument (``-3``) only ever selects from core Python " "releases, and not other distributions. However, the longer form (``-V:3``) " "will select from any." msgstr "" -#: ../../using/windows.rst:767 +#: ../../using/windows.rst:780 msgid "" "The Company is matched on the full string, case-insenitive. The Tag is " "matched oneither the full string, or a prefix, provided the next character " @@ -1275,11 +1323,11 @@ msgid "" "``3.1``), but are compared using text (``-V:3.01`` does not match ``3.1``)." msgstr "" -#: ../../using/windows.rst:775 +#: ../../using/windows.rst:788 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:779 +#: ../../using/windows.rst:792 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 " @@ -1289,27 +1337,27 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:787 +#: ../../using/windows.rst:800 msgid "From a script" msgstr "" -#: ../../using/windows.rst:789 +#: ../../using/windows.rst:802 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:798 +#: ../../using/windows.rst:811 msgid "From the directory in which hello.py lives, execute the command::" msgstr "" -#: ../../using/windows.rst:802 +#: ../../using/windows.rst:815 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:809 +#: ../../using/windows.rst:822 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 " @@ -1318,7 +1366,7 @@ msgid "" "information printed." msgstr "" -#: ../../using/windows.rst:815 +#: ../../using/windows.rst:828 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 " @@ -1326,11 +1374,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:821 +#: ../../using/windows.rst:834 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:823 +#: ../../using/windows.rst:836 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 " @@ -1339,17 +1387,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:829 +#: ../../using/windows.rst:842 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:833 +#: ../../using/windows.rst:846 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:835 +#: ../../using/windows.rst:848 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 " @@ -1359,34 +1407,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:842 +#: ../../using/windows.rst:855 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:846 +#: ../../using/windows.rst:859 msgid "``/usr/bin/env``" msgstr "``/usr/bin/env``" -#: ../../using/windows.rst:847 +#: ../../using/windows.rst:860 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:848 +#: ../../using/windows.rst:861 msgid "``/usr/local/bin/python``" msgstr "``/usr/local/bin/python``" -#: ../../using/windows.rst:849 +#: ../../using/windows.rst:862 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:851 +#: ../../using/windows.rst:864 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:857 +#: ../../using/windows.rst:870 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 " @@ -1395,7 +1443,7 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:863 +#: ../../using/windows.rst:876 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 " @@ -1404,21 +1452,21 @@ msgid "" "python 3.7." msgstr "" -#: ../../using/windows.rst:871 +#: ../../using/windows.rst:884 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:877 +#: ../../using/windows.rst:890 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " "not provably i386/32-bit\". To request a specific environment, use the new " "``-V:`` argument with the complete tag." msgstr "" -#: ../../using/windows.rst:881 +#: ../../using/windows.rst:894 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 " @@ -1432,7 +1480,7 @@ msgid "" "of :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:892 +#: ../../using/windows.rst:905 msgid "" "Shebang lines that do not match any of these patterns are looked up in the " "``[commands]`` section of the launcher's :ref:`.INI file `. " @@ -1443,7 +1491,7 @@ msgid "" "part of the filename)." msgstr "" -#: ../../using/windows.rst:905 +#: ../../using/windows.rst:918 msgid "" "Any commands not found in the .INI file are treated as **Windows** " "executable paths that are absolute or relative to the directory containing " @@ -1454,29 +1502,29 @@ msgid "" "will be appended." msgstr "" -#: ../../using/windows.rst:914 +#: ../../using/windows.rst:927 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:916 +#: ../../using/windows.rst:929 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:923 +#: ../../using/windows.rst:936 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:926 +#: ../../using/windows.rst:939 msgid "Customization" msgstr "" -#: ../../using/windows.rst:931 +#: ../../using/windows.rst:944 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:933 +#: ../../using/windows.rst:946 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's application data directory (``%LOCALAPPDATA%`` or ``$env:" @@ -1485,7 +1533,7 @@ msgid "" "e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:939 +#: ../../using/windows.rst:952 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1493,11 +1541,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:944 +#: ../../using/windows.rst:957 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:946 +#: ../../using/windows.rst:959 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 " @@ -1507,13 +1555,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:952 +#: ../../using/windows.rst:965 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:955 +#: ../../using/windows.rst:968 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 " @@ -1523,7 +1571,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:962 +#: ../../using/windows.rst:975 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1534,7 +1582,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:970 +#: ../../using/windows.rst:983 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 " @@ -1548,30 +1596,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:981 +#: ../../using/windows.rst:994 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:983 +#: ../../using/windows.rst:996 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:987 +#: ../../using/windows.rst:1000 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:990 +#: ../../using/windows.rst:1003 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:993 +#: ../../using/windows.rst:1006 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1579,13 +1627,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:998 +#: ../../using/windows.rst:1011 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:1001 +#: ../../using/windows.rst:1014 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 " @@ -1595,25 +1643,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:1008 +#: ../../using/windows.rst:1021 msgid "For example:" msgstr "" -#: ../../using/windows.rst:1010 +#: ../../using/windows.rst:1023 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:1017 +#: ../../using/windows.rst:1030 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:1027 +#: ../../using/windows.rst:1040 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:1029 +#: ../../using/windows.rst:1042 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DEBUG` is set (to any value), " "the launcher will print diagnostic information to stderr (i.e. to the " @@ -1623,11 +1671,11 @@ msgid "" "the target Python. It is primarily intended for testing and debugging." msgstr "" -#: ../../using/windows.rst:1037 +#: ../../using/windows.rst:1050 msgid "Dry Run" msgstr "" -#: ../../using/windows.rst:1039 +#: ../../using/windows.rst:1052 msgid "" "If an environment variable :envvar:`PYLAUNCHER_DRYRUN` is set (to any " "value), the launcher will output the command it would have run, but will not " @@ -1637,11 +1685,11 @@ msgid "" "correctly in the console." msgstr "" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1060 msgid "Install on demand" msgstr "安裝隨選" -#: ../../using/windows.rst:1049 +#: ../../using/windows.rst:1062 msgid "" "If an environment variable :envvar:`PYLAUNCHER_ALLOW_INSTALL` is set (to any " "value), and the requested Python version is not installed but is available " @@ -1650,7 +1698,7 @@ msgid "" "again." msgstr "" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1067 msgid "" "An additional :envvar:`PYLAUNCHER_ALWAYS_INSTALL` variable causes the " "launcher to always try to install Python, even if it is detected. This is " @@ -1658,137 +1706,137 @@ msgid "" "`PYLAUNCHER_DRYRUN`)." msgstr "" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1072 msgid "Return codes" msgstr "" -#: ../../using/windows.rst:1061 +#: ../../using/windows.rst:1074 msgid "" "The following exit codes may be returned by the Python launcher. " "Unfortunately, there is no way to distinguish these from the exit code of " "Python itself." msgstr "" -#: ../../using/windows.rst:1064 +#: ../../using/windows.rst:1077 msgid "" "The names of codes are as used in the sources, and are only for reference. " "There is no way to access or resolve them apart from reading this page. " "Entries are listed in alphabetical order of names." msgstr "" -#: ../../using/windows.rst:1069 +#: ../../using/windows.rst:1082 msgid "Value" msgstr "" -#: ../../using/windows.rst:1071 +#: ../../using/windows.rst:1084 msgid "RC_BAD_VENV_CFG" msgstr "RC_BAD_VENV_CFG" -#: ../../using/windows.rst:1071 +#: ../../using/windows.rst:1084 msgid "107" msgstr "107" -#: ../../using/windows.rst:1071 +#: ../../using/windows.rst:1084 msgid "A :file:`pyvenv.cfg` was found but is corrupt." msgstr "" -#: ../../using/windows.rst:1073 +#: ../../using/windows.rst:1086 msgid "RC_CREATE_PROCESS" msgstr "RC_CREATE_PROCESS" -#: ../../using/windows.rst:1073 +#: ../../using/windows.rst:1086 msgid "101" msgstr "101" -#: ../../using/windows.rst:1073 +#: ../../using/windows.rst:1086 msgid "Failed to launch Python." msgstr "" -#: ../../using/windows.rst:1075 +#: ../../using/windows.rst:1088 msgid "RC_INSTALLING" msgstr "RC_INSTALLING" -#: ../../using/windows.rst:1075 +#: ../../using/windows.rst:1088 msgid "111" msgstr "111" -#: ../../using/windows.rst:1075 +#: ../../using/windows.rst:1088 msgid "" "An install was started, but the command will need to be re-run after it " "completes." msgstr "" -#: ../../using/windows.rst:1078 +#: ../../using/windows.rst:1091 msgid "RC_INTERNAL_ERROR" msgstr "RC_INTERNAL_ERROR" -#: ../../using/windows.rst:1078 +#: ../../using/windows.rst:1091 msgid "109" msgstr "109" -#: ../../using/windows.rst:1078 +#: ../../using/windows.rst:1091 msgid "Unexpected error. Please report a bug." msgstr "" -#: ../../using/windows.rst:1080 +#: ../../using/windows.rst:1093 msgid "RC_NO_COMMANDLINE" msgstr "RC_NO_COMMANDLINE" -#: ../../using/windows.rst:1080 +#: ../../using/windows.rst:1093 msgid "108" msgstr "108" -#: ../../using/windows.rst:1080 +#: ../../using/windows.rst:1093 msgid "Unable to obtain command line from the operating system." msgstr "" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1096 msgid "RC_NO_PYTHON" msgstr "RC_NO_PYTHON" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1096 msgid "103" msgstr "103" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1096 msgid "Unable to locate the requested version." msgstr "" -#: ../../using/windows.rst:1085 +#: ../../using/windows.rst:1098 msgid "RC_NO_VENV_CFG" msgstr "RC_NO_VENV_CFG" -#: ../../using/windows.rst:1085 +#: ../../using/windows.rst:1098 msgid "106" msgstr "106" -#: ../../using/windows.rst:1085 +#: ../../using/windows.rst:1098 msgid "A :file:`pyvenv.cfg` was required but not found." msgstr "" -#: ../../using/windows.rst:1093 +#: ../../using/windows.rst:1106 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:1095 +#: ../../using/windows.rst:1108 msgid "" "These notes supplement the description at :ref:`sys-path-init` with detailed " "Windows notes." msgstr "" -#: ../../using/windows.rst:1098 +#: ../../using/windows.rst:1111 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:1101 +#: ../../using/windows.rst:1114 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1104 +#: ../../using/windows.rst:1117 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1796,7 +1844,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1109 +#: ../../using/windows.rst:1122 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1806,7 +1854,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1116 +#: ../../using/windows.rst:1129 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 " @@ -1817,31 +1865,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1124 +#: ../../using/windows.rst:1137 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:1128 +#: ../../using/windows.rst:1141 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:1131 +#: ../../using/windows.rst:1144 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:1135 +#: ../../using/windows.rst:1148 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1137 +#: ../../using/windows.rst:1150 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1849,7 +1897,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1142 +#: ../../using/windows.rst:1155 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 " @@ -1857,20 +1905,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1146 +#: ../../using/windows.rst:1159 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:1150 +#: ../../using/windows.rst:1163 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:1153 +#: ../../using/windows.rst:1166 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1878,20 +1926,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1158 +#: ../../using/windows.rst:1171 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:1162 +#: ../../using/windows.rst:1175 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1165 +#: ../../using/windows.rst:1178 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1900,7 +1948,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1171 +#: ../../using/windows.rst:1184 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 " @@ -1910,19 +1958,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1180 +#: ../../using/windows.rst:1193 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1182 +#: ../../using/windows.rst:1195 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1188 +#: ../../using/windows.rst:1201 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1930,101 +1978,100 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1194 +#: ../../using/windows.rst:1207 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1196 +#: ../../using/windows.rst:1209 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:1200 +#: ../../using/windows.rst:1213 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1204 +#: ../../using/windows.rst:1217 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1206 +#: ../../using/windows.rst:1219 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:1210 +#: ../../using/windows.rst:1223 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1213 +#: ../../using/windows.rst:1226 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1214 +#: ../../using/windows.rst:1227 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1215 +#: ../../using/windows.rst:1228 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1216 +#: ../../using/windows.rst:1229 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1220 +#: ../../using/windows.rst:1233 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1227 +#: ../../using/windows.rst:1240 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1227 +#: ../../using/windows.rst:1240 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1242 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1230 +#: ../../using/windows.rst:1243 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1234 +#: ../../using/windows.rst:1247 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1236 +#: ../../using/windows.rst:1249 msgid "" -"`cx_Freeze `_ is a :mod:" -"`distutils` extension (see :ref:`extending-distutils`) which wraps Python " -"scripts into executable Windows programs (:file:`{*}.exe` files). When you " -"have done this, you can distribute your application without requiring your " -"users to install Python." +"`cx_Freeze `_ is a " +"``distutils`` extension which wraps Python scripts into executable Windows " +"programs (:file:`{*}.exe` files). When you have done this, you can " +"distribute your application without requiring your users to install Python." msgstr "" -#: ../../using/windows.rst:1244 +#: ../../using/windows.rst:1256 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1246 +#: ../../using/windows.rst:1258 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2032,48 +2079,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1251 +#: ../../using/windows.rst:1263 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1255 +#: ../../using/windows.rst:1267 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1257 +#: ../../using/windows.rst:1269 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1261 +#: ../../using/windows.rst:1273 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1263 +#: ../../using/windows.rst:1275 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:1267 +#: ../../using/windows.rst:1279 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1270 +#: ../../using/windows.rst:1282 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1274 +#: ../../using/windows.rst:1286 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 9905c1e242..76c848a335 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1029,10 +1029,10 @@ msgstr "" #: ../../whatsnew/2.0.rst:821 msgid "" "The SIG for distribution utilities, shepherded by Greg Ward, has created the " -"Distutils, a system to make package installation much easier. They form " -"the :mod:`distutils` package, a new part of Python's standard library. In " -"the best case, installing a Python module from source will require the same " -"steps: first you simply mean unpack the tarball or zip archive, and the run " +"Distutils, a system to make package installation much easier. They form the " +"``distutils`` package, a new part of Python's standard library. In the best " +"case, installing a Python module from source will require the same steps: " +"first you simply mean unpack the tarball or zip archive, and the run " "\"``python setup.py install``\". The platform will be automatically " "detected, the compiler will be recognized, C extension modules will be " "compiled, and the distribution installed into the proper directory. " diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index cd87eae21a..c36d78a5a6 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -779,9 +779,9 @@ msgstr "" msgid "" "Importer objects must have a single method, ``find_module(fullname, " "path=None)``. *fullname* will be a module or package name, e.g. ``string`` " -"or ``distutils.core``. :meth:`find_module` must return a loader object that " -"has a single method, ``load_module(fullname)``, that creates and returns the " -"corresponding module object." +"or ``distutils.core``. :meth:`!find_module` must return a loader object " +"that has a single method, ``load_module(fullname)``, that creates and " +"returns the corresponding module object." msgstr "" #: ../../whatsnew/2.3.rst:735 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 06c21377d2..67026e0d7e 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -881,7 +881,7 @@ msgid "" "after a suggestion by George Sakkis; :issue:`5982`.)" msgstr "" -#: ../../whatsnew/2.7.rst:867 ../../whatsnew/2.7.rst:2462 +#: ../../whatsnew/2.7.rst:867 ../../whatsnew/2.7.rst:2463 msgid "" "When a restricted set of attributes were set using ``__slots__``, deleting " "an unset attribute would not raise :exc:`AttributeError` as you would " @@ -1444,11 +1444,11 @@ msgid "" "dictionary mapping argument names to their values. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:1343 +#: ../../whatsnew/2.7.rst:1344 msgid "Contributed by George Sakkis; :issue:`3135`." msgstr "" -#: ../../whatsnew/2.7.rst:1345 +#: ../../whatsnew/2.7.rst:1346 msgid "" "Updated module: The :mod:`io` library has been upgraded to the version " "shipped with Python 3.1. For 3.1, the I/O library was entirely rewritten in " @@ -1456,14 +1456,14 @@ msgid "" "original Python version was renamed to the :mod:`_pyio` module." msgstr "" -#: ../../whatsnew/2.7.rst:1350 +#: ../../whatsnew/2.7.rst:1351 msgid "" "One minor resulting change: the :class:`io.TextIOBase` class now has an :" "attr:`errors` attribute giving the error setting used for encoding and " "decoding errors (one of ``'strict'``, ``'replace'``, ``'ignore'``)." msgstr "" -#: ../../whatsnew/2.7.rst:1355 +#: ../../whatsnew/2.7.rst:1356 msgid "" "The :class:`io.FileIO` class now raises an :exc:`OSError` when passed an " "invalid file descriptor. (Implemented by Benjamin Peterson; :issue:" @@ -1472,14 +1472,14 @@ msgid "" "file. (Fixed by Pascal Chambon; :issue:`6939`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1361 +#: ../../whatsnew/2.7.rst:1362 msgid "" "New function: ``itertools.compress(data, selectors)`` takes two iterators. " "Elements of *data* are returned if the corresponding value in *selectors* is " "true::" msgstr "" -#: ../../whatsnew/2.7.rst:1370 +#: ../../whatsnew/2.7.rst:1371 msgid "" "New function: ``itertools.combinations_with_replacement(iter, r)`` returns " "all the possible *r*-length combinations of elements from the iterable " @@ -1487,13 +1487,13 @@ msgid "" "repeated in the generated combinations::" msgstr "" -#: ../../whatsnew/2.7.rst:1379 +#: ../../whatsnew/2.7.rst:1380 msgid "" "Note that elements are treated as unique depending on their position in the " "input, not their actual values." msgstr "" -#: ../../whatsnew/2.7.rst:1382 +#: ../../whatsnew/2.7.rst:1383 msgid "" "The :func:`itertools.count` function now has a *step* argument that allows " "incrementing by values other than 1. :func:`~itertools.count` also now " @@ -1502,7 +1502,7 @@ msgid "" "issue:`5032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1388 +#: ../../whatsnew/2.7.rst:1389 msgid "" ":func:`itertools.combinations` and :func:`itertools.product` previously " "raised :exc:`ValueError` for values of *r* larger than the input iterable. " @@ -1510,14 +1510,14 @@ msgid "" "iterator. (Fixed by Raymond Hettinger; :issue:`4816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1393 +#: ../../whatsnew/2.7.rst:1394 msgid "" "Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the " "simplejson package, which includes a C extension that makes encoding and " "decoding faster. (Contributed by Bob Ippolito; :issue:`4136`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1398 +#: ../../whatsnew/2.7.rst:1399 msgid "" "To support the new :class:`collections.OrderedDict` type, :func:`json.load` " "now has an optional *object_pairs_hook* parameter that will be called with " @@ -1525,7 +1525,7 @@ msgid "" "Hettinger; :issue:`5381`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1403 +#: ../../whatsnew/2.7.rst:1404 msgid "" "The :mod:`mailbox` module's :class:`~mailbox.Maildir` class now records the " "timestamp on the directories it reads, and only re-reads them if the " @@ -1534,7 +1534,7 @@ msgid "" "Pitrou; :issue:`1607951`, :issue:`6896`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1409 +#: ../../whatsnew/2.7.rst:1410 msgid "" "New functions: the :mod:`math` module gained :func:`~math.erf` and :func:" "`~math.erfc` for the error function and the complementary error function, :" @@ -1545,7 +1545,7 @@ msgid "" "`3366`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1417 +#: ../../whatsnew/2.7.rst:1418 msgid "" "The :mod:`multiprocessing` module's :class:`Manager*` classes can now be " "passed a callable that will be called whenever a subprocess is started, " @@ -1553,7 +1553,7 @@ msgid "" "(Contributed by lekma; :issue:`5585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1423 +#: ../../whatsnew/2.7.rst:1424 msgid "" "The :class:`~multiprocessing.Pool` class, which controls a pool of worker " "processes, now has an optional *maxtasksperchild* parameter. Worker " @@ -1563,13 +1563,13 @@ msgid "" "worker to become very large. (Contributed by Charles Cazabon; :issue:`6963`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1431 +#: ../../whatsnew/2.7.rst:1432 msgid "" "The :mod:`nntplib` module now supports IPv6 addresses. (Contributed by Derek " "Morr; :issue:`1664`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1434 +#: ../../whatsnew/2.7.rst:1435 msgid "" "New functions: the :mod:`os` module wraps the following POSIX system calls: :" "func:`~os.getresgid` and :func:`~os.getresuid`, which return the real, " @@ -1580,14 +1580,14 @@ msgid "" "`6508`. Support for initgroups added by Jean-Paul Calderone; :issue:`7333`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1444 +#: ../../whatsnew/2.7.rst:1445 msgid "" "The :func:`os.fork` function now re-initializes the import lock in the child " "process; this fixes problems on Solaris when :func:`~os.fork` is called from " "a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1448 +#: ../../whatsnew/2.7.rst:1449 msgid "" "In the :mod:`os.path` module, the :func:`~os.path.normpath` and :func:`~os." "path.abspath` functions now preserve Unicode; if their input path is a " @@ -1596,21 +1596,21 @@ msgid "" "fixed by Ezio Melotti in :issue:`3426`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1454 +#: ../../whatsnew/2.7.rst:1455 msgid "" "The :mod:`pydoc` module now has help for the various symbols that Python " "uses. You can now do ``help('<<')`` or ``help('@')``, for example. " "(Contributed by David Laban; :issue:`4739`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1458 +#: ../../whatsnew/2.7.rst:1459 msgid "" "The :mod:`re` module's :func:`~re.split`, :func:`~re.sub`, and :func:`~re." "subn` now accept an optional *flags* argument, for consistency with the " "other functions in the module. (Added by Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.7.rst:1462 +#: ../../whatsnew/2.7.rst:1463 msgid "" "New function: :func:`~runpy.run_path` in the :mod:`runpy` module will " "execute the code at a provided *path* argument. *path* can be the path of a " @@ -1625,7 +1625,7 @@ msgid "" "processes an explicit path name. (Added by Nick Coghlan; :issue:`6816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1476 +#: ../../whatsnew/2.7.rst:1477 msgid "" "New function: in the :mod:`shutil` module, :func:`~shutil.make_archive` " "takes a filename, archive type (zip or tar-format), and a directory path, " @@ -1633,7 +1633,7 @@ msgid "" "Ziadé.)" msgstr "" -#: ../../whatsnew/2.7.rst:1481 +#: ../../whatsnew/2.7.rst:1482 msgid "" ":mod:`shutil`'s :func:`~shutil.copyfile` and :func:`~shutil.copytree` " "functions now raise a :exc:`~shutil.SpecialFileError` exception when asked " @@ -1642,7 +1642,7 @@ msgid "" "indefinitely. (Fixed by Antoine Pitrou; :issue:`3002`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1487 +#: ../../whatsnew/2.7.rst:1488 msgid "" "The :mod:`signal` module no longer re-installs the signal handler unless " "this is truly necessary, which fixes a bug that could make it impossible to " @@ -1650,7 +1650,7 @@ msgid "" "`8354`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1492 +#: ../../whatsnew/2.7.rst:1493 msgid "" "New functions: in the :mod:`site` module, three new functions return various " "site- and user-specific paths. :func:`~site.getsitepackages` returns a list " @@ -1661,7 +1661,7 @@ msgid "" "store data. (Contributed by Tarek Ziadé; :issue:`6693`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1503 +#: ../../whatsnew/2.7.rst:1504 msgid "" "The :mod:`site` module now reports exceptions occurring when the :mod:" "`sitecustomize` module is imported, and will no longer catch and swallow " @@ -1669,14 +1669,14 @@ msgid "" "`3137`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1508 +#: ../../whatsnew/2.7.rst:1509 msgid "" "The :func:`~socket.create_connection` function gained a *source_address* " "parameter, a ``(host, port)`` 2-tuple giving the source address that will be " "used for the connection. (Contributed by Eldon Ziegler; :issue:`3972`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1513 +#: ../../whatsnew/2.7.rst:1514 msgid "" "The :meth:`~socket.socket.recv_into` and :meth:`~socket.socket." "recvfrom_into` methods will now write into objects that support the buffer " @@ -1684,7 +1684,7 @@ msgid "" "(Implemented by Antoine Pitrou; :issue:`8104`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1518 +#: ../../whatsnew/2.7.rst:1519 msgid "" "The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now " "supports socket timeouts and disabling the Nagle algorithm. The :attr:" @@ -1699,7 +1699,7 @@ msgid "" "Jónsson; :issue:`6192` and :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1530 +#: ../../whatsnew/2.7.rst:1531 msgid "" "Updated module: the :mod:`sqlite3` module has been updated to version 2.6.0 " "of the `pysqlite package `__. Version " @@ -1710,7 +1710,7 @@ msgid "" "Häring.)" msgstr "" -#: ../../whatsnew/2.7.rst:1537 +#: ../../whatsnew/2.7.rst:1538 msgid "" "The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the " "buffer API, which fixed a test suite failure (fix by Antoine Pitrou; :issue:" @@ -1719,7 +1719,7 @@ msgid "" "that trigger an SSL renegotiation (fix by Antoine Pitrou; :issue:`8222`)." msgstr "" -#: ../../whatsnew/2.7.rst:1544 +#: ../../whatsnew/2.7.rst:1545 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument that's a string listing the encryption algorithms to be allowed; " @@ -1728,7 +1728,7 @@ msgid "" "Pitrou; :issue:`8322`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1551 +#: ../../whatsnew/2.7.rst:1552 msgid "" "Another change makes the extension load all of OpenSSL's ciphers and digest " "algorithms so that they're all available. Some SSL certificates couldn't be " @@ -1736,7 +1736,7 @@ msgid "" "Kosata, and fixed by Antoine Pitrou; :issue:`8484`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1557 +#: ../../whatsnew/2.7.rst:1558 msgid "" "The version of OpenSSL being used is now available as the module attributes :" "data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl.OPENSSL_VERSION_INFO` (a 5-" @@ -1744,7 +1744,7 @@ msgid "" "Antoine Pitrou; :issue:`8321`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1563 +#: ../../whatsnew/2.7.rst:1564 msgid "" "The :mod:`struct` module will no longer silently ignore overflow errors when " "a value is too large for a particular integer format code (one of " @@ -1755,7 +1755,7 @@ msgid "" "(Changed by Mark Dickinson; :issue:`8300`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1572 +#: ../../whatsnew/2.7.rst:1573 msgid "" "New function: the :mod:`subprocess` module's :func:`~subprocess." "check_output` runs a command with a specified set of arguments and returns " @@ -1763,18 +1763,18 @@ msgid "" "raises a :exc:`~subprocess.CalledProcessError` exception otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1587 +#: ../../whatsnew/2.7.rst:1588 msgid "(Contributed by Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.7.rst:1589 +#: ../../whatsnew/2.7.rst:1590 msgid "" "The :mod:`subprocess` module will now retry its internal system calls on " "receiving an :const:`EINTR` signal. (Reported by several people; final " "patch by Gregory P. Smith in :issue:`1068268`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1593 +#: ../../whatsnew/2.7.rst:1594 msgid "" "New function: :func:`~symtable.Symbol.is_declared_global` in the :mod:" "`symtable` module returns true for variables that are explicitly declared to " @@ -1782,21 +1782,21 @@ msgid "" "Hylton.)" msgstr "" -#: ../../whatsnew/2.7.rst:1598 ../../whatsnew/2.7.rst:2496 +#: ../../whatsnew/2.7.rst:1599 ../../whatsnew/2.7.rst:2497 msgid "" "The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the " "identifier instead of the previous default value of ``'python'``. (Changed " "by Sean Reifschneider; :issue:`8451`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1602 +#: ../../whatsnew/2.7.rst:1603 msgid "" "The ``sys.version_info`` value is now a named tuple, with attributes named :" "attr:`major`, :attr:`minor`, :attr:`micro`, :attr:`releaselevel`, and :attr:" "`serial`. (Contributed by Ross Light; :issue:`4285`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1607 +#: ../../whatsnew/2.7.rst:1608 msgid "" ":func:`sys.getwindowsversion` also returns a named tuple, with attributes " "named :attr:`major`, :attr:`minor`, :attr:`build`, :attr:`platform`, :attr:" @@ -1805,7 +1805,7 @@ msgid "" "issue:`7766`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1613 ../../whatsnew/2.7.rst:2500 +#: ../../whatsnew/2.7.rst:1614 ../../whatsnew/2.7.rst:2501 msgid "" "The :mod:`tarfile` module's default error handling has changed, to no longer " "suppress fatal errors. The default error level was previously 0, which " @@ -1815,7 +1815,7 @@ msgid "" "there's an error. (Changed by Lars Gustäbel; :issue:`7357`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1621 +#: ../../whatsnew/2.7.rst:1622 msgid "" ":mod:`tarfile` now supports filtering the :class:`~tarfile.TarInfo` objects " "being added to a tar file. When you call :meth:`~tarfile.TarFile.add`, you " @@ -1829,7 +1829,7 @@ msgid "" "issue:`7232`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1633 +#: ../../whatsnew/2.7.rst:1634 msgid "" "The :meth:`~threading.Event.wait` method of the :class:`threading.Event` " "class now returns the internal flag on exit. This means the method will " @@ -1839,7 +1839,7 @@ msgid "" "Tim Lesher; :issue:`1674032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1640 +#: ../../whatsnew/2.7.rst:1641 msgid "" "The Unicode database provided by the :mod:`unicodedata` module is now used " "internally to determine which characters are numeric, whitespace, or " @@ -1849,7 +1849,7 @@ msgid "" "Florent Xicluna; :issue:`8024`)." msgstr "" -#: ../../whatsnew/2.7.rst:1648 ../../whatsnew/2.7.rst:2508 +#: ../../whatsnew/2.7.rst:1649 ../../whatsnew/2.7.rst:2509 msgid "" "The :mod:`urlparse` module's :func:`~urlparse.urlsplit` now handles unknown " "URL schemes in a fashion compliant with :rfc:`3986`: if the URL is of the " @@ -1859,23 +1859,23 @@ msgid "" "For example, Python 2.6.4 or 2.5 will return the following:" msgstr "" -#: ../../whatsnew/2.7.rst:1663 ../../whatsnew/2.7.rst:2523 +#: ../../whatsnew/2.7.rst:1664 ../../whatsnew/2.7.rst:2524 msgid "Python 2.7 (and Python 2.6.5) will return:" msgstr "" -#: ../../whatsnew/2.7.rst:1672 ../../whatsnew/2.7.rst:2532 +#: ../../whatsnew/2.7.rst:1673 ../../whatsnew/2.7.rst:2533 msgid "" "(Python 2.7 actually produces slightly different output, since it returns a " "named tuple instead of a standard tuple.)" msgstr "" -#: ../../whatsnew/2.7.rst:1675 +#: ../../whatsnew/2.7.rst:1676 msgid "" "The :mod:`urlparse` module also supports IPv6 literal addresses as defined " "by :rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`)." msgstr "" -#: ../../whatsnew/2.7.rst:1685 +#: ../../whatsnew/2.7.rst:1686 msgid "" "New class: the :class:`~weakref.WeakSet` class in the :mod:`weakref` module " "is a set that only holds weak references to its elements; elements will be " @@ -1884,7 +1884,7 @@ msgid "" "Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:1691 ../../whatsnew/2.7.rst:2486 +#: ../../whatsnew/2.7.rst:1692 ../../whatsnew/2.7.rst:2487 msgid "" "The ElementTree library, :mod:`xml.etree`, no longer escapes ampersands and " "angle brackets when outputting an XML processing instruction (which looks " @@ -1892,7 +1892,7 @@ msgid "" "````). (Patch by Neil Muller; :issue:`2746`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1697 +#: ../../whatsnew/2.7.rst:1698 msgid "" "The XML-RPC client and server, provided by the :mod:`xmlrpclib` and :mod:" "`SimpleXMLRPCServer` modules, have improved performance by supporting " @@ -1903,14 +1903,14 @@ msgid "" "(Contributed by Kristján Valur Jónsson; :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1706 +#: ../../whatsnew/2.7.rst:1707 msgid "" "The :mod:`zipfile` module's :class:`~zipfile.ZipFile` now supports the " "context management protocol, so you can write ``with zipfile.ZipFile(...) as " "f:``. (Contributed by Brian Curtin; :issue:`5511`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1710 +#: ../../whatsnew/2.7.rst:1711 msgid "" ":mod:`zipfile` now also supports archiving empty directories and extracts " "them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.) Reading files out " @@ -1919,14 +1919,14 @@ msgid "" "Aides; :issue:`7610`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1716 +#: ../../whatsnew/2.7.rst:1717 msgid "" "The :func:`~zipfile.is_zipfile` function now accepts a file object, in " "addition to the path names accepted in earlier versions. (Contributed by " "Gabriel Genellina; :issue:`4756`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1720 +#: ../../whatsnew/2.7.rst:1721 msgid "" "The :meth:`~zipfile.ZipFile.writestr` method now has an optional " "*compress_type* parameter that lets you override the default compression " @@ -1934,11 +1934,11 @@ msgid "" "by Ronald Oussoren; :issue:`6003`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1733 +#: ../../whatsnew/2.7.rst:1734 msgid "New module: importlib" msgstr "" -#: ../../whatsnew/2.7.rst:1735 +#: ../../whatsnew/2.7.rst:1736 msgid "" "Python 3.1 includes the :mod:`importlib` package, a re-implementation of the " "logic underlying Python's :keyword:`import` statement. :mod:`importlib` is " @@ -1949,7 +1949,7 @@ msgid "" "import_module`." msgstr "" -#: ../../whatsnew/2.7.rst:1743 +#: ../../whatsnew/2.7.rst:1744 msgid "" "``import_module(name, package=None)`` imports a module. *name* is a string " "containing the module or package's name. It's possible to do relative " @@ -1960,24 +1960,24 @@ msgid "" "imported module into ``sys.modules`` and returns the module object." msgstr "" -#: ../../whatsnew/2.7.rst:1752 +#: ../../whatsnew/2.7.rst:1753 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../whatsnew/2.7.rst:1763 +#: ../../whatsnew/2.7.rst:1764 msgid "" ":mod:`importlib` was implemented by Brett Cannon and introduced in Python " "3.1." msgstr "" -#: ../../whatsnew/2.7.rst:1768 +#: ../../whatsnew/2.7.rst:1769 msgid "New module: sysconfig" msgstr "" -#: ../../whatsnew/2.7.rst:1770 +#: ../../whatsnew/2.7.rst:1771 msgid "" "The :mod:`sysconfig` module has been pulled out of the Distutils package, " "becoming a new top-level module in its own right. :mod:`sysconfig` provides " @@ -1986,42 +1986,42 @@ msgid "" "running from its source directory." msgstr "" -#: ../../whatsnew/2.7.rst:1777 +#: ../../whatsnew/2.7.rst:1778 msgid "Some of the functions in the module are:" msgstr "" -#: ../../whatsnew/2.7.rst:1779 +#: ../../whatsnew/2.7.rst:1780 msgid "" ":func:`~sysconfig.get_config_var` returns variables from Python's Makefile " "and the :file:`pyconfig.h` file." msgstr "" -#: ../../whatsnew/2.7.rst:1781 +#: ../../whatsnew/2.7.rst:1782 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary containing all of " "the configuration variables." msgstr "" -#: ../../whatsnew/2.7.rst:1783 +#: ../../whatsnew/2.7.rst:1784 msgid "" ":func:`~sysconfig.get_path` returns the configured path for a particular " "type of module: the standard library, site-specific modules, platform-" "specific modules, etc." msgstr "" -#: ../../whatsnew/2.7.rst:1786 +#: ../../whatsnew/2.7.rst:1787 msgid "" ":func:`~sysconfig.is_python_build` returns true if you're running a binary " "from a Python source tree, and false otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1789 +#: ../../whatsnew/2.7.rst:1790 msgid "" "Consult the :mod:`sysconfig` documentation for more details and for a " "complete list of functions." msgstr "" -#: ../../whatsnew/2.7.rst:1792 +#: ../../whatsnew/2.7.rst:1793 msgid "" "The Distutils package and :mod:`sysconfig` are now maintained by Tarek " "Ziadé, who has also started a Distutils2 package (source repository at " @@ -2029,11 +2029,11 @@ msgid "" "of Distutils." msgstr "" -#: ../../whatsnew/2.7.rst:1799 +#: ../../whatsnew/2.7.rst:1800 msgid "ttk: Themed Widgets for Tk" msgstr "" -#: ../../whatsnew/2.7.rst:1801 +#: ../../whatsnew/2.7.rst:1802 msgid "" "Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk " "widgets but have a more customizable appearance and can therefore more " @@ -2042,7 +2042,7 @@ msgid "" "added to Tcl/Tck release 8.5." msgstr "" -#: ../../whatsnew/2.7.rst:1807 +#: ../../whatsnew/2.7.rst:1808 msgid "" "To learn more, read the :mod:`ttk` module documentation. You may also wish " "to read the Tcl/Tk manual page describing the Ttk theme engine, available at " @@ -2051,7 +2051,7 @@ msgid "" "wikis/Screenshots.wiki." msgstr "" -#: ../../whatsnew/2.7.rst:1814 +#: ../../whatsnew/2.7.rst:1815 msgid "" "The :mod:`ttk` module was written by Guilherme Polo and added in :issue:" "`2983`. An alternate version called ``Tile.py``, written by Martin Franklin " @@ -2059,11 +2059,11 @@ msgid "" "but the authors argued that Guilherme Polo's work was more comprehensive." msgstr "" -#: ../../whatsnew/2.7.rst:1824 +#: ../../whatsnew/2.7.rst:1825 msgid "Updated module: unittest" msgstr "" -#: ../../whatsnew/2.7.rst:1826 +#: ../../whatsnew/2.7.rst:1827 msgid "" "The :mod:`unittest` module was greatly enhanced; many new features were " "added. Most of these features were implemented by Michael Foord, unless " @@ -2072,7 +2072,7 @@ msgid "" "`unittest2` package, from https://pypi.org/project/unittest2." msgstr "" -#: ../../whatsnew/2.7.rst:1833 +#: ../../whatsnew/2.7.rst:1834 msgid "" "When used from the command line, the module can automatically discover " "tests. It's not as fancy as `py.test `__ or `nose " @@ -2082,17 +2082,17 @@ msgid "" "files named ``test*.py``::" msgstr "" -#: ../../whatsnew/2.7.rst:1842 +#: ../../whatsnew/2.7.rst:1843 msgid "" "Consult the :mod:`unittest` module documentation for more details. " "(Developed in :issue:`6001`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1845 +#: ../../whatsnew/2.7.rst:1846 msgid "The :func:`~unittest.main` function supports some other new options:" msgstr "" -#: ../../whatsnew/2.7.rst:1847 +#: ../../whatsnew/2.7.rst:1848 msgid "" ":option:`-b ` or :option:`!--buffer` will buffer the standard " "output and standard error streams during each test. If the test passes, any " @@ -2100,7 +2100,7 @@ msgid "" "displayed." msgstr "" -#: ../../whatsnew/2.7.rst:1852 +#: ../../whatsnew/2.7.rst:1853 msgid "" ":option:`-c ` or :option:`!--catch` will cause the control-C " "interrupt to be handled more gracefully. Instead of interrupting the test " @@ -2109,7 +2109,7 @@ msgid "" "impatient, a second press of control-C will cause an immediate interruption." msgstr "" -#: ../../whatsnew/2.7.rst:1859 +#: ../../whatsnew/2.7.rst:1860 msgid "" "This control-C handler tries to avoid causing problems when the code being " "tested or the tests being run have defined a signal handler of their own, by " @@ -2119,7 +2119,7 @@ msgid "" "disabled." msgstr "" -#: ../../whatsnew/2.7.rst:1866 +#: ../../whatsnew/2.7.rst:1867 msgid "" ":option:`-f ` or :option:`!--failfast` makes test execution " "stop immediately when a test fails instead of continuing to execute further " @@ -2127,20 +2127,20 @@ msgid "" "`8074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1871 +#: ../../whatsnew/2.7.rst:1872 msgid "" "The progress messages now show 'x' for expected failures and 'u' for " "unexpected successes when run in verbose mode. (Contributed by Benjamin " "Peterson.)" msgstr "" -#: ../../whatsnew/2.7.rst:1875 +#: ../../whatsnew/2.7.rst:1876 msgid "" "Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a test " "(:issue:`1034053`)." msgstr "" -#: ../../whatsnew/2.7.rst:1878 +#: ../../whatsnew/2.7.rst:1879 msgid "" "The error messages for :meth:`~unittest.TestCase.assertEqual`, :meth:" "`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse` " @@ -2151,18 +2151,18 @@ msgid "" "`5663`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1885 +#: ../../whatsnew/2.7.rst:1886 msgid "" "The :meth:`~unittest.TestCase.assertRaises` method now returns a context " "handler when called without providing a callable object to run. For " "example, you can write this::" msgstr "" -#: ../../whatsnew/2.7.rst:1892 +#: ../../whatsnew/2.7.rst:1893 msgid "(Implemented by Antoine Pitrou; :issue:`4444`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1896 +#: ../../whatsnew/2.7.rst:1897 msgid "" "Module- and class-level setup and teardown fixtures are now supported. " "Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest." @@ -2173,7 +2173,7 @@ msgid "" "case in a different module or class." msgstr "" -#: ../../whatsnew/2.7.rst:1904 +#: ../../whatsnew/2.7.rst:1905 msgid "" "The methods :meth:`~unittest.TestCase.addCleanup` and :meth:`~unittest." "TestCase.doCleanups` were added. :meth:`~unittest.TestCase.addCleanup` lets " @@ -2183,7 +2183,7 @@ msgid "" "simpler resource allocation and deallocation during tests (:issue:`5679`)." msgstr "" -#: ../../whatsnew/2.7.rst:1912 +#: ../../whatsnew/2.7.rst:1913 msgid "" "A number of new methods were added that provide more specialized tests. " "Many of these methods were written by Google engineers for use in their test " @@ -2191,21 +2191,21 @@ msgid "" "Python's version of :mod:`unittest`." msgstr "" -#: ../../whatsnew/2.7.rst:1917 +#: ../../whatsnew/2.7.rst:1918 msgid "" ":meth:`~unittest.TestCase.assertIsNone` and :meth:`~unittest.TestCase." "assertIsNotNone` take one expression and verify that the result is or is not " "``None``." msgstr "" -#: ../../whatsnew/2.7.rst:1920 +#: ../../whatsnew/2.7.rst:1921 msgid "" ":meth:`~unittest.TestCase.assertIs` and :meth:`~unittest.TestCase." "assertIsNot` take two values and check whether the two values evaluate to " "the same object or not. (Added by Michael Foord; :issue:`2578`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1924 +#: ../../whatsnew/2.7.rst:1925 msgid "" ":meth:`~unittest.TestCase.assertIsInstance` and :meth:`~unittest.TestCase." "assertNotIsInstance` check whether the resulting object is an instance of a " @@ -2213,14 +2213,14 @@ msgid "" "issue:`7031`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1929 +#: ../../whatsnew/2.7.rst:1930 msgid "" ":meth:`~unittest.TestCase.assertGreater`, :meth:`~unittest.TestCase." "assertGreaterEqual`, :meth:`~unittest.TestCase.assertLess`, and :meth:" "`~unittest.TestCase.assertLessEqual` compare two quantities." msgstr "" -#: ../../whatsnew/2.7.rst:1933 +#: ../../whatsnew/2.7.rst:1934 msgid "" ":meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if " "they're not equal, displays a helpful comparison that highlights the " @@ -2228,7 +2228,7 @@ msgid "" "Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`." msgstr "" -#: ../../whatsnew/2.7.rst:1938 +#: ../../whatsnew/2.7.rst:1939 msgid "" ":meth:`~unittest.TestCase.assertRegexpMatches` and :meth:`~unittest.TestCase." "assertNotRegexpMatches` checks whether the first argument is a string " @@ -2236,32 +2236,32 @@ msgid "" "argument (:issue:`8038`)." msgstr "" -#: ../../whatsnew/2.7.rst:1943 +#: ../../whatsnew/2.7.rst:1944 msgid "" ":meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular " "exception is raised, and then also checks that the string representation of " "the exception matches the provided regular expression." msgstr "" -#: ../../whatsnew/2.7.rst:1947 +#: ../../whatsnew/2.7.rst:1948 msgid "" ":meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase." "assertNotIn` tests whether *first* is or is not in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1950 +#: ../../whatsnew/2.7.rst:1951 msgid "" ":meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided " "sequences contain the same elements." msgstr "" -#: ../../whatsnew/2.7.rst:1953 +#: ../../whatsnew/2.7.rst:1954 msgid "" ":meth:`~unittest.TestCase.assertSetEqual` compares whether two sets are " "equal, and only reports the differences between the sets in case of error." msgstr "" -#: ../../whatsnew/2.7.rst:1956 +#: ../../whatsnew/2.7.rst:1957 msgid "" "Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest." "TestCase.assertTupleEqual` compare the specified types and explain any " @@ -2272,7 +2272,7 @@ msgid "" "both sequences are of a particular type." msgstr "" -#: ../../whatsnew/2.7.rst:1964 +#: ../../whatsnew/2.7.rst:1965 msgid "" ":meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and " "reports the differences; it's now used by default when you compare two " @@ -2281,7 +2281,7 @@ msgid "" "in *first* are found in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1969 +#: ../../whatsnew/2.7.rst:1970 msgid "" ":meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase." "assertNotAlmostEqual` test whether *first* and *second* are approximately " @@ -2290,14 +2290,14 @@ msgid "" "require the difference to be smaller than a supplied *delta* value." msgstr "" -#: ../../whatsnew/2.7.rst:1975 +#: ../../whatsnew/2.7.rst:1976 msgid "" ":meth:`~unittest.TestLoader.loadTestsFromName` properly honors the :attr:" "`~unittest.TestLoader.suiteClass` attribute of the :class:`~unittest." "TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1979 +#: ../../whatsnew/2.7.rst:1980 msgid "" "A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method " "to handle new data types. The :meth:`~unittest.TestCase." @@ -2309,7 +2309,7 @@ msgid "" "sequence comparison methods do." msgstr "" -#: ../../whatsnew/2.7.rst:1988 +#: ../../whatsnew/2.7.rst:1989 msgid "" ":func:`unittest.main` now takes an optional ``exit`` argument. If false, :" "func:`~unittest.main` doesn't call :func:`sys.exit`, allowing :func:" @@ -2317,7 +2317,7 @@ msgid "" "by J. Pablo Fernández; :issue:`3379`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1993 +#: ../../whatsnew/2.7.rst:1994 msgid "" ":class:`~unittest.TestResult` has new :meth:`~unittest.TestResult." "startTestRun` and :meth:`~unittest.TestResult.stopTestRun` methods that are " @@ -2325,7 +2325,7 @@ msgid "" "Collins; :issue:`5728`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1997 +#: ../../whatsnew/2.7.rst:1998 msgid "" "With all these changes, the :file:`unittest.py` was becoming awkwardly " "large, so the module was turned into a package and the code split into " @@ -2333,7 +2333,7 @@ msgid "" "imported or used." msgstr "" -#: ../../whatsnew/2.7.rst:2005 +#: ../../whatsnew/2.7.rst:2006 msgid "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" @@ -2341,37 +2341,37 @@ msgstr "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" -#: ../../whatsnew/2.7.rst:2005 +#: ../../whatsnew/2.7.rst:2006 msgid "" "Describes the new features, how to use them, and the rationale for various " "design decisions. (By Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:2011 +#: ../../whatsnew/2.7.rst:2012 msgid "Updated module: ElementTree 1.3" msgstr "" -#: ../../whatsnew/2.7.rst:2013 +#: ../../whatsnew/2.7.rst:2014 msgid "" "The version of the ElementTree library included with Python was updated to " "version 1.3. Some of the new features are:" msgstr "" -#: ../../whatsnew/2.7.rst:2016 +#: ../../whatsnew/2.7.rst:2017 msgid "" "The various parsing functions now take a *parser* keyword argument giving " "an :class:`~xml.etree.ElementTree.XMLParser` instance that will be used. " "This makes it possible to override the file's internal encoding::" msgstr "" -#: ../../whatsnew/2.7.rst:2023 +#: ../../whatsnew/2.7.rst:2024 msgid "" "Errors in parsing XML now raise a :exc:`ParseError` exception, whose " "instances have a :attr:`position` attribute containing a (*line*, *column*) " "tuple giving the location of the problem." msgstr "" -#: ../../whatsnew/2.7.rst:2027 +#: ../../whatsnew/2.7.rst:2028 msgid "" "ElementTree's code for converting trees to a string has been significantly " "reworked, making it roughly twice as fast in many cases. The :meth:" @@ -2385,7 +2385,7 @@ msgid "" "to do more extensive rearrangement to remove a single element." msgstr "" -#: ../../whatsnew/2.7.rst:2039 +#: ../../whatsnew/2.7.rst:2040 msgid "" "Namespace handling has also been improved. All ``xmlns:`` " "declarations are now output on the root element, not scattered throughout " @@ -2395,7 +2395,7 @@ msgid "" "the true/false *xml_declaration* parameter to suppress the XML declaration." msgstr "" -#: ../../whatsnew/2.7.rst:2047 +#: ../../whatsnew/2.7.rst:2048 msgid "" "New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." "ElementTree.Element.extend` appends the items from a sequence to the " @@ -2403,7 +2403,7 @@ msgid "" "to move children from one element to another::" msgstr "" -#: ../../whatsnew/2.7.rst:2064 +#: ../../whatsnew/2.7.rst:2065 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.iter` " "yields the children of the element as a generator. It's also possible to " @@ -2412,13 +2412,13 @@ msgid "" "`getchildren` which constructs and returns a list of children." msgstr "" -#: ../../whatsnew/2.7.rst:2071 +#: ../../whatsnew/2.7.rst:2072 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.itertext` " "yields all chunks of text that are descendants of the element. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:2082 +#: ../../whatsnew/2.7.rst:2083 msgid "" "Deprecated: using an element as a Boolean (i.e., ``if elem:``) would return " "true if the element had any children, or false if there were no children. " @@ -2428,7 +2428,7 @@ msgid "" "number of children, or ``elem is not None``." msgstr "" -#: ../../whatsnew/2.7.rst:2090 +#: ../../whatsnew/2.7.rst:2091 msgid "" "Fredrik Lundh develops ElementTree and produced the 1.3 version; you can " "read his article describing 1.3 at https://web.archive.org/" @@ -2437,15 +2437,15 @@ msgid "" "python-dev and in :issue:`6472`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2100 +#: ../../whatsnew/2.7.rst:2101 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2102 +#: ../../whatsnew/2.7.rst:2103 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.7.rst:2104 +#: ../../whatsnew/2.7.rst:2105 msgid "" "The latest release of the GNU Debugger, GDB 7, can be `scripted using Python " "`_; discussed in :issue:`5753`, and fixed by " "Antoine Pitrou." msgstr "" -#: ../../whatsnew/2.7.rst:2179 +#: ../../whatsnew/2.7.rst:2180 msgid "" "New macros: the Python header files now define the following macros: :c:" "macro:`Py_ISALNUM`, :c:macro:`Py_ISALPHA`, :c:macro:`Py_ISDIGIT`, :c:macro:" @@ -2564,7 +2564,7 @@ msgid "" "Eric Smith; :issue:`5793`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2197 +#: ../../whatsnew/2.7.rst:2198 msgid "" "Removed function: :c:macro:`PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " @@ -2572,7 +2572,7 @@ msgid "" "(Removed by Antoine Pitrou; :issue:`8276`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2202 +#: ../../whatsnew/2.7.rst:2203 msgid "" "New format codes: the :c:func:`PyFormat_FromString`, :c:func:" "`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept " @@ -2580,7 +2580,7 @@ msgid "" "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2208 +#: ../../whatsnew/2.7.rst:2209 msgid "" "The complicated interaction between threads and process forking has been " "changed. Previously, the child process created by :func:`os.fork` might " @@ -2592,7 +2592,7 @@ msgid "" "replicated, and the child process would no longer be able to perform imports." msgstr "" -#: ../../whatsnew/2.7.rst:2218 +#: ../../whatsnew/2.7.rst:2219 msgid "" "Python 2.7 acquires the import lock before performing an :func:`os.fork`, " "and will also clean up any locks created using the :mod:`threading` module. " @@ -2600,38 +2600,38 @@ msgid "" "themselves, will not benefit from this clean-up." msgstr "" -#: ../../whatsnew/2.7.rst:2224 +#: ../../whatsnew/2.7.rst:2225 msgid "(Fixed by Thomas Wouters; :issue:`1590864`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2226 +#: ../../whatsnew/2.7.rst:2227 msgid "" "The :c:func:`Py_Finalize` function now calls the internal :func:`threading." "_shutdown` function; this prevents some exceptions from being raised when an " "interpreter shuts down. (Patch by Adam Olsen; :issue:`1722344`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2231 +#: ../../whatsnew/2.7.rst:2232 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " "type, Python will no longer let you try to delete or set a :const:" "`T_STRING_INPLACE` attribute." msgstr "" -#: ../../whatsnew/2.7.rst:2237 +#: ../../whatsnew/2.7.rst:2238 msgid "" "Global symbols defined by the :mod:`ctypes` module are now prefixed with " "``Py``, or with ``_ctypes``. (Implemented by Thomas Heller; :issue:`3102`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2241 +#: ../../whatsnew/2.7.rst:2242 msgid "" "New configure option: the :option:`!--with-system-expat` switch allows " "building the :mod:`pyexpat` module to use the system Expat library. " "(Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2245 +#: ../../whatsnew/2.7.rst:2246 msgid "" "New configure option: the :option:`!--with-valgrind` option will now disable " "the pymalloc allocator, which is difficult for the Valgrind memory-error " @@ -2640,14 +2640,14 @@ msgid "" "issue:`2422`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2252 +#: ../../whatsnew/2.7.rst:2253 msgid "" "New configure option: you can now supply an empty string to :option:`!--with-" "dbmliborder=` in order to disable all of the various DBM modules. (Added by " "Arfrever Frehtes Taifersar Arahesis; :issue:`6491`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2257 +#: ../../whatsnew/2.7.rst:2258 msgid "" "The :program:`configure` script now checks for floating-point rounding bugs " "on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING` " @@ -2656,30 +2656,30 @@ msgid "" "`2937`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2263 +#: ../../whatsnew/2.7.rst:2264 msgid "" ":program:`configure` also now sets a :envvar:`LDCXXSHARED` Makefile variable " "for supporting C++ linking. (Contributed by Arfrever Frehtes Taifersar " "Arahesis; :issue:`1222585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2267 +#: ../../whatsnew/2.7.rst:2268 msgid "" "The build process now creates the necessary files for pkg-config support. " "(Contributed by Clinton Roy; :issue:`3585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2270 +#: ../../whatsnew/2.7.rst:2271 msgid "" "The build process now supports Subversion 1.7. (Contributed by Arfrever " "Frehtes Taifersar Arahesis; :issue:`6094`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2277 +#: ../../whatsnew/2.7.rst:2278 msgid "Capsules" msgstr "" -#: ../../whatsnew/2.7.rst:2279 +#: ../../whatsnew/2.7.rst:2280 msgid "" "Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a C API " "to an extension module. A capsule is essentially the holder of a C ``void " @@ -2691,7 +2691,7 @@ msgid "" "module's various API functions." msgstr "" -#: ../../whatsnew/2.7.rst:2288 +#: ../../whatsnew/2.7.rst:2289 msgid "" "There is an existing data type already used for this, :c:type:`PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " @@ -2700,7 +2700,7 @@ msgid "" "know their own name, and getting the pointer requires providing the name:" msgstr "" -#: ../../whatsnew/2.7.rst:2306 +#: ../../whatsnew/2.7.rst:2307 msgid "" "You are assured that ``vtable`` points to whatever you're expecting. If a " "different capsule was passed in, :c:func:`PyCapsule_IsValid` would detect " @@ -2708,7 +2708,7 @@ msgid "" "more information on using these objects." msgstr "" -#: ../../whatsnew/2.7.rst:2311 +#: ../../whatsnew/2.7.rst:2312 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " "APIs, but the :c:func:`PyCObject_AsVoidPtr` was modified to handle capsules, " @@ -2717,17 +2717,17 @@ msgid "" "`PendingDeprecationWarning`, which is silent by default." msgstr "" -#: ../../whatsnew/2.7.rst:2318 +#: ../../whatsnew/2.7.rst:2319 msgid "" "Implemented in Python 3.1 and backported to 2.7 by Larry Hastings; discussed " "in :issue:`5630`." msgstr "" -#: ../../whatsnew/2.7.rst:2325 +#: ../../whatsnew/2.7.rst:2326 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.7.rst:2327 +#: ../../whatsnew/2.7.rst:2328 msgid "" "The :mod:`msvcrt` module now contains some constants from the :file:" "`crtassem.h` header file: :data:`CRT_ASSEMBLY_VERSION`, :data:" @@ -2735,7 +2735,7 @@ msgid "" "(Contributed by David Cournapeau; :issue:`4365`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2334 +#: ../../whatsnew/2.7.rst:2335 msgid "" "The :mod:`_winreg` module for accessing the registry now implements the :" "func:`~_winreg.CreateKeyEx` and :func:`~_winreg.DeleteKeyEx` functions, " @@ -2745,14 +2745,14 @@ msgid "" "tested and documented. (Implemented by Brian Curtin: :issue:`7347`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2342 +#: ../../whatsnew/2.7.rst:2343 msgid "" "The new :c:func:`_beginthreadex` API is used to start threads, and the " "native thread-local storage functions are now used. (Contributed by Kristján " "Valur Jónsson; :issue:`3582`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2346 +#: ../../whatsnew/2.7.rst:2347 msgid "" "The :func:`os.kill` function now works on Windows. The signal value can be " "the constants :const:`CTRL_C_EVENT`, :const:`CTRL_BREAK_EVENT`, or any " @@ -2762,23 +2762,23 @@ msgid "" "`1220212`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2353 +#: ../../whatsnew/2.7.rst:2354 msgid "" "The :func:`os.listdir` function now correctly fails for an empty path. " "(Fixed by Hirokazu Yamamoto; :issue:`5913`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2356 +#: ../../whatsnew/2.7.rst:2357 msgid "" "The :mod:`mimelib` module will now read the MIME database from the Windows " "registry when initializing. (Patch by Gabriel Genellina; :issue:`4969`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2363 +#: ../../whatsnew/2.7.rst:2364 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.7.rst:2365 +#: ../../whatsnew/2.7.rst:2366 msgid "" "The path ``/Library/Python/2.7/site-packages`` is now appended to ``sys." "path``, in order to share added packages between the system installation and " @@ -2786,7 +2786,7 @@ msgid "" "issue:`4865`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2372 +#: ../../whatsnew/2.7.rst:2373 msgid "" "As of 2.7.13, this change was removed. ``/Library/Python/2.7/site-" "packages``, the site-packages directory used by the Apple-supplied system " @@ -2798,11 +2798,11 @@ msgid "" "Pythons. (:issue:`28440`)" msgstr "" -#: ../../whatsnew/2.7.rst:2383 +#: ../../whatsnew/2.7.rst:2384 msgid "Port-Specific Changes: FreeBSD" msgstr "" -#: ../../whatsnew/2.7.rst:2385 +#: ../../whatsnew/2.7.rst:2386 msgid "" "FreeBSD 7.1's :const:`SO_SETFIB` constant, used with :func:`~socket." "getsockopt`/:func:`~socket.setsockopt` to select an alternate routing table, " @@ -2810,11 +2810,11 @@ msgid "" "issue:`8235`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2391 +#: ../../whatsnew/2.7.rst:2392 msgid "Other Changes and Fixes" msgstr "" -#: ../../whatsnew/2.7.rst:2393 +#: ../../whatsnew/2.7.rst:2394 msgid "" "Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were added to " "the :file:`Tools` directory. :file:`iobench` measures the speed of the " @@ -2824,13 +2824,13 @@ msgid "" "bandwidth when performing several tasks using a varying number of threads." msgstr "" -#: ../../whatsnew/2.7.rst:2401 +#: ../../whatsnew/2.7.rst:2402 msgid "" "The :file:`Tools/i18n/msgfmt.py` script now understands plural forms in :" "file:`.po` files. (Fixed by Martin von Löwis; :issue:`5464`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2405 +#: ../../whatsnew/2.7.rst:2406 msgid "" "When importing a module from a :file:`.pyc` or :file:`.pyo` file with an " "existing :file:`.py` counterpart, the :attr:`co_filename` attributes of the " @@ -2840,7 +2840,7 @@ msgid "" "Calderone; :issue:`1180193`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2412 +#: ../../whatsnew/2.7.rst:2413 msgid "" "The :file:`regrtest.py` script now takes a :option:`!--randseed=` switch " "that takes an integer that will be used as the random seed for the :option:" @@ -2848,7 +2848,7 @@ msgid "" "also reports the seed that was used (Added by Collin Winter.)" msgstr "" -#: ../../whatsnew/2.7.rst:2418 +#: ../../whatsnew/2.7.rst:2419 msgid "" "Another :file:`regrtest.py` switch is :option:`!-j`, which takes an integer " "specifying how many tests run in parallel. This allows reducing the total " @@ -2859,31 +2859,31 @@ msgid "" "they fail. (Added by Antoine Pitrou; :issue:`7312`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2427 +#: ../../whatsnew/2.7.rst:2428 msgid "" "When executed as a script, the :file:`py_compile.py` module now accepts " "``'-'`` as an argument, which will read standard input for the list of " "filenames to be compiled. (Contributed by Piotr Ożarowski; :issue:`8233`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2435 +#: ../../whatsnew/2.7.rst:2436 msgid "Porting to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2437 +#: ../../whatsnew/2.7.rst:2438 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.7.rst:2440 +#: ../../whatsnew/2.7.rst:2441 msgid "" "The :func:`range` function processes its arguments more consistently; it " "will now call :meth:`__int__` on non-float, non-integer arguments that are " "supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2445 +#: ../../whatsnew/2.7.rst:2446 msgid "" "The string :meth:`format` method changed the default precision used for " "floating-point and complex numbers from 6 decimal places to 12, which " @@ -2891,7 +2891,7 @@ msgid "" "`5920`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2450 +#: ../../whatsnew/2.7.rst:2451 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " "methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's " @@ -2900,7 +2900,7 @@ msgid "" "types. (:issue:`6101`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2456 +#: ../../whatsnew/2.7.rst:2457 msgid "" "Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`__exit__` " "methods was often the string representation of the exception, not an " @@ -2908,11 +2908,11 @@ msgid "" "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2466 +#: ../../whatsnew/2.7.rst:2467 msgid "In the standard library:" msgstr "" -#: ../../whatsnew/2.7.rst:2468 +#: ../../whatsnew/2.7.rst:2469 msgid "" "Operations with :class:`~datetime.datetime` instances that resulted in a " "year falling outside the supported range didn't always raise :exc:" @@ -2921,7 +2921,7 @@ msgid "" "Alexander Belopolsky; :issue:`7150`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2474 +#: ../../whatsnew/2.7.rst:2475 msgid "" "When using :class:`~decimal.Decimal` instances with a string's :meth:" "`format` method, the default alignment was previously left-alignment. This " @@ -2929,7 +2929,7 @@ msgid "" "programs. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2480 +#: ../../whatsnew/2.7.rst:2481 msgid "" "Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" "`~decimal.InvalidOperation` instead of silently returning a true or false " @@ -2937,36 +2937,36 @@ msgid "" "are now hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2492 +#: ../../whatsnew/2.7.rst:2493 msgid "" "The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO." "StringIO` objects now does nothing when a negative length is requested, as " "other file-like objects do. (:issue:`7348`)." msgstr "" -#: ../../whatsnew/2.7.rst:2535 +#: ../../whatsnew/2.7.rst:2536 msgid "For C extensions:" msgstr "" -#: ../../whatsnew/2.7.rst:2537 +#: ../../whatsnew/2.7.rst:2538 msgid "" "C extensions that use integer format codes with the ``PyArg_Parse*`` family " "of functions will now raise a :exc:`TypeError` exception instead of " "triggering a :exc:`DeprecationWarning` (:issue:`5080`)." msgstr "" -#: ../../whatsnew/2.7.rst:2541 +#: ../../whatsnew/2.7.rst:2542 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" "func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions, which are " "now deprecated." msgstr "" -#: ../../whatsnew/2.7.rst:2545 +#: ../../whatsnew/2.7.rst:2546 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.7.rst:2547 +#: ../../whatsnew/2.7.rst:2548 msgid "" "The :c:func:`PySys_SetArgvEx` function was added, letting applications close " "a security hole when the existing :c:func:`PySys_SetArgv` function was " @@ -2975,11 +2975,11 @@ msgid "" "with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.7.rst:2560 +#: ../../whatsnew/2.7.rst:2561 msgid "New Features Added to Python 2.7 Maintenance Releases" msgstr "" -#: ../../whatsnew/2.7.rst:2562 +#: ../../whatsnew/2.7.rst:2563 msgid "" "New features may be added to Python 2.7 maintenance releases when the " "situation genuinely calls for it. Any such additions must go through the " @@ -2988,25 +2988,25 @@ msgid "" "Python 3, or else by publishing it on the Python Package Index." msgstr "" -#: ../../whatsnew/2.7.rst:2568 +#: ../../whatsnew/2.7.rst:2569 msgid "" "In addition to the specific proposals listed below, there is a general " "exemption allowing new ``-3`` warnings to be added in any Python 2.7 " "maintenance release." msgstr "" -#: ../../whatsnew/2.7.rst:2574 +#: ../../whatsnew/2.7.rst:2575 msgid "Two new environment variables for debug mode" msgstr "" -#: ../../whatsnew/2.7.rst:2576 +#: ../../whatsnew/2.7.rst:2577 msgid "" "In debug mode, the ``[xxx refs]`` statistic is not written by default, the :" "envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set. " "(Contributed by Victor Stinner; :issue:`31733`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2580 +#: ../../whatsnew/2.7.rst:2581 msgid "" "When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are " "no longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` " @@ -3015,11 +3015,11 @@ msgid "" "issue:`31692`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2589 +#: ../../whatsnew/2.7.rst:2590 msgid "PEP 434: IDLE Enhancement Exception for All Branches" msgstr "" -#: ../../whatsnew/2.7.rst:2591 +#: ../../whatsnew/2.7.rst:2592 msgid "" ":pep:`434` describes a general exemption for changes made to the IDLE " "development environment shipped along with Python. This exemption makes it " @@ -3027,62 +3027,62 @@ msgid "" "experience across all supported versions of Python 2 and 3." msgstr "" -#: ../../whatsnew/2.7.rst:2596 +#: ../../whatsnew/2.7.rst:2597 msgid "" "For details of any IDLE changes, refer to the NEWS file for the specific " "release." msgstr "" -#: ../../whatsnew/2.7.rst:2601 +#: ../../whatsnew/2.7.rst:2602 msgid "PEP 466: Network Security Enhancements for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2603 +#: ../../whatsnew/2.7.rst:2604 msgid "" ":pep:`466` describes a number of network security enhancement proposals that " "have been approved for inclusion in Python 2.7 maintenance releases, with " "the first of those changes appearing in the Python 2.7.7 release." msgstr "" -#: ../../whatsnew/2.7.rst:2607 +#: ../../whatsnew/2.7.rst:2608 msgid ":pep:`466` related features added in Python 2.7.7:" msgstr "" -#: ../../whatsnew/2.7.rst:2609 +#: ../../whatsnew/2.7.rst:2610 msgid "" ":func:`hmac.compare_digest` was backported from Python 3 to make a timing " "attack resistant comparison operation available to Python 2 applications. " "(Contributed by Alex Gaynor; :issue:`21306`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2613 +#: ../../whatsnew/2.7.rst:2614 msgid "" "OpenSSL 1.0.1g was upgraded in the official Windows installers published on " "python.org. (Contributed by Zachary Ware; :issue:`21462`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2616 +#: ../../whatsnew/2.7.rst:2617 msgid ":pep:`466` related features added in Python 2.7.8:" msgstr "" -#: ../../whatsnew/2.7.rst:2618 +#: ../../whatsnew/2.7.rst:2619 msgid "" ":func:`hashlib.pbkdf2_hmac` was backported from Python 3 to make a hashing " "algorithm suitable for secure password storage broadly available to Python 2 " "applications. (Contributed by Alex Gaynor; :issue:`21304`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2622 +#: ../../whatsnew/2.7.rst:2623 msgid "" "OpenSSL 1.0.1h was upgraded for the official Windows installers published on " "python.org. (contributed by Zachary Ware in :issue:`21671` for CVE-2014-0224)" msgstr "" -#: ../../whatsnew/2.7.rst:2625 +#: ../../whatsnew/2.7.rst:2626 msgid ":pep:`466` related features added in Python 2.7.9:" msgstr "" -#: ../../whatsnew/2.7.rst:2627 +#: ../../whatsnew/2.7.rst:2628 msgid "" "Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl` " "now supports Server Name Indication, TLS1.x settings, access to the platform " @@ -3090,20 +3090,20 @@ msgid "" "(Contributed by Alex Gaynor and David Reid; :issue:`21308`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2632 +#: ../../whatsnew/2.7.rst:2633 msgid "" "Refer to the \"Version added: 2.7.9\" notes in the module documentation for " "specific details." msgstr "" -#: ../../whatsnew/2.7.rst:2635 +#: ../../whatsnew/2.7.rst:2636 msgid "" ":func:`os.urandom` was changed to cache a file descriptor to ``/dev/" "urandom`` instead of reopening ``/dev/urandom`` on every call. (Contributed " "by Alex Gaynor; :issue:`21305`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2639 +#: ../../whatsnew/2.7.rst:2640 msgid "" ":data:`hashlib.algorithms_guaranteed` and :data:`hashlib." "algorithms_available` were backported from Python 3 to make it easier for " @@ -3111,22 +3111,22 @@ msgid "" "(Contributed by Alex Gaynor in :issue:`21307`)" msgstr "" -#: ../../whatsnew/2.7.rst:2646 +#: ../../whatsnew/2.7.rst:2647 msgid "PEP 477: Backport ensurepip (PEP 453) to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2648 +#: ../../whatsnew/2.7.rst:2649 msgid "" ":pep:`477` approves the inclusion of the :pep:`453` ensurepip module and the " "improved documentation that was enabled by it in the Python 2.7 maintenance " "releases, appearing first in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2654 +#: ../../whatsnew/2.7.rst:2655 msgid "Bootstrapping pip By Default" msgstr "" -#: ../../whatsnew/2.7.rst:2656 +#: ../../whatsnew/2.7.rst:2657 msgid "" "The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard " "cross-platform mechanism to bootstrap the pip installer into Python " @@ -3136,14 +3136,14 @@ msgid "" "the release candidate." msgstr "" -#: ../../whatsnew/2.7.rst:2663 +#: ../../whatsnew/2.7.rst:2664 msgid "" "By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed " "on all platforms (where X.Y stands for the version of the Python " "installation), along with the ``pip`` Python package and its dependencies." msgstr "" -#: ../../whatsnew/2.7.rst:2667 +#: ../../whatsnew/2.7.rst:2668 msgid "" "For CPython :ref:`source builds on POSIX systems `, " "the ``make install`` and ``make altinstall`` commands do not bootstrap " @@ -3151,7 +3151,7 @@ msgid "" "options, and overridden through Makefile options." msgstr "" -#: ../../whatsnew/2.7.rst:2672 +#: ../../whatsnew/2.7.rst:2673 msgid "" "On Windows and Mac OS X, the CPython installers now default to installing " "``pip`` along with CPython itself (users may opt out of installing it during " @@ -3161,7 +3161,7 @@ msgid "" "Windows as ``py -m pip``." msgstr "" -#: ../../whatsnew/2.7.rst:2679 +#: ../../whatsnew/2.7.rst:2680 msgid "" "As `discussed in the PEP`__, platform packagers may choose not to install " "these commands by default, as long as, when invoked, they provide clear and " @@ -3169,11 +3169,11 @@ msgid "" "system package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2688 +#: ../../whatsnew/2.7.rst:2689 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2690 +#: ../../whatsnew/2.7.rst:2691 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3183,29 +3183,29 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2698 +#: ../../whatsnew/2.7.rst:2699 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" -"ref:`distutils-index`." +"ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/2.7.rst:2705 +#: ../../whatsnew/2.7.rst:2706 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2705 +#: ../../whatsnew/2.7.rst:2706 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/2.7.rst:2709 +#: ../../whatsnew/2.7.rst:2710 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2711 +#: ../../whatsnew/2.7.rst:2712 msgid "" ":pep:`476` updated :mod:`httplib` and modules which use it, such as :mod:" "`urllib2` and :mod:`xmlrpclib`, to now verify that the server presents a " @@ -3215,17 +3215,17 @@ msgid "" "in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2718 +#: ../../whatsnew/2.7.rst:2719 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2735 +#: ../../whatsnew/2.7.rst:2736 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2737 +#: ../../whatsnew/2.7.rst:2738 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3234,14 +3234,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2743 +#: ../../whatsnew/2.7.rst:2744 msgid "" "These tools are intended for use in cases where affected applications and " "services can't be modified to explicitly pass a more permissive SSL context " "when establishing the connection." msgstr "" -#: ../../whatsnew/2.7.rst:2747 +#: ../../whatsnew/2.7.rst:2748 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3249,18 +3249,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2752 +#: ../../whatsnew/2.7.rst:2753 msgid "" "For cases where the connection establishment code can't be modified, but the " "overall application can be, the new :func:`ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2758 +#: ../../whatsnew/2.7.rst:2759 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2760 +#: ../../whatsnew/2.7.rst:2761 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3268,43 +3268,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2765 +#: ../../whatsnew/2.7.rst:2766 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/2.7.rst:2769 +#: ../../whatsnew/2.7.rst:2770 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2772 ../../whatsnew/2.7.rst:2785 +#: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2778 +#: ../../whatsnew/2.7.rst:2779 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2780 +#: ../../whatsnew/2.7.rst:2781 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/2.7.rst:2783 +#: ../../whatsnew/2.7.rst:2784 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/2.7.rst:2794 +#: ../../whatsnew/2.7.rst:2795 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2796 +#: ../../whatsnew/2.7.rst:2797 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index e58e968232..1a3a24ffea 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,9 +97,9 @@ msgstr "" #: ../../whatsnew/3.0.rst:128 msgid "" "The :func:`print` function doesn't support the \"softspace\" feature of the " -"old ``print`` statement. For example, in Python 2.x, ``print \"A\\n\", \"B" -"\"`` would write ``\"A\\nB\\n\"``; but in Python 3.0, ``print(\"A\\n\", \"B" -"\")`` writes ``\"A\\n B\\n\"``." +"old ``print`` statement. For example, in Python 2.x, ``print \"A\\n\", " +"\"B\"`` would write ``\"A\\nB\\n\"``; but in Python 3.0, ``print(\"A\\n\", " +"\"B\")`` writes ``\"A\\n B\\n\"``." msgstr "" #: ../../whatsnew/3.0.rst:133 @@ -1197,7 +1197,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:843 -msgid "Removed :func:`reload`. Use :func:`imp.reload`." +msgid "Removed :func:`reload`. Use :func:`!imp.reload`." msgstr "" #: ../../whatsnew/3.0.rst:845 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index d1cb3f8891..bfad96a182 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-11 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -126,7 +126,7 @@ msgstr ":pep:`624`,刪除 Py_UNICODE 編碼器 API" msgid ":pep:`597`, Add optional EncodingWarning" msgstr ":pep:`597`,新增可選的 EncodingWarning" -#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2041 +#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2042 msgid "New Features" msgstr "新功能" @@ -737,7 +737,7 @@ msgstr "" "附名常數 (named constant) 可以在模式中使用。這些附名常數必須有帶有點的名稱 " "(dotted name),以防止常數被直譯為捕獲的變數:" -#: ../../whatsnew/3.10.rst:679 +#: ../../whatsnew/3.10.rst:680 msgid "" "For the full specification see :pep:`634`. Motivation and rationale are in :" "pep:`635`, and a longer tutorial is in :pep:`636`." @@ -745,11 +745,11 @@ msgstr "" "有關完整規範,請參閱 :pep:`634`。動機和基本原理位於 :pep:`635` 中,較完整的教" "學位於 :pep:`636` 中。" -#: ../../whatsnew/3.10.rst:686 +#: ../../whatsnew/3.10.rst:687 msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option" msgstr "可選的 ``EncodingWarning`` 和 ``encoding=\"locale\"`` 選項" -#: ../../whatsnew/3.10.rst:688 +#: ../../whatsnew/3.10.rst:689 msgid "" "The default encoding of :class:`TextIOWrapper` and :func:`open` is platform " "and locale dependent. Since UTF-8 is used on most Unix platforms, omitting " @@ -760,7 +760,7 @@ msgstr "" "多數 Unix 平台都使用 UTF-8,因此在打開 UTF-8 檔案(例如 JSON、YAML、TOML、" "Markdown)時省略 ``encoding`` 選項是個常見的 bug,例如:" -#: ../../whatsnew/3.10.rst:697 +#: ../../whatsnew/3.10.rst:698 msgid "" "To find this type of bug, an optional ``EncodingWarning`` is added. It is " "emitted when :data:`sys.flags.warn_default_encoding ` is true and " @@ -770,7 +770,7 @@ msgstr "" "warn_default_encoding ` 為 true 且使用特定於語言環境的預設編碼時," "會發出該信號。" -#: ../../whatsnew/3.10.rst:701 +#: ../../whatsnew/3.10.rst:702 msgid "" "``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` " "are added to enable the warning." @@ -778,25 +778,25 @@ msgstr "" "新增 ``-X warn_default_encoding`` 選項和 :envvar:`PYTHONWARNDEFAULTENCODING` " "來啟用警告。" -#: ../../whatsnew/3.10.rst:704 +#: ../../whatsnew/3.10.rst:705 msgid "See :ref:`io-text-encoding` for more information." msgstr "更多資訊請見 :ref:`io-text-encoding`\\ 。" -#: ../../whatsnew/3.10.rst:709 +#: ../../whatsnew/3.10.rst:710 msgid "New Features Related to Type Hints" msgstr "與型別提示相關的新功能" -#: ../../whatsnew/3.10.rst:711 +#: ../../whatsnew/3.10.rst:712 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要更改。" -#: ../../whatsnew/3.10.rst:716 +#: ../../whatsnew/3.10.rst:717 msgid "PEP 604: New Type Union Operator" msgstr "PEP 604:新型聯集運算子" -#: ../../whatsnew/3.10.rst:718 +#: ../../whatsnew/3.10.rst:719 msgid "" "A new type union operator was introduced which enables the syntax ``X | Y``. " "This provides a cleaner way of expressing 'either type X or type Y' instead " @@ -806,7 +806,7 @@ msgstr "" "別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使用 :data:`typing." "Union`。" -#: ../../whatsnew/3.10.rst:722 +#: ../../whatsnew/3.10.rst:723 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :data:`typing.Union` was used::" @@ -814,22 +814,22 @@ msgstr "" "在以前版本的 Python 中,要使用接受多種型別參數之型別提示的函式,要使用 :data:" "`typing.Union`:" -#: ../../whatsnew/3.10.rst:729 +#: ../../whatsnew/3.10.rst:730 msgid "Type hints can now be written in a more succinct manner::" msgstr "現在可以用更簡潔的方式編寫型別提示:" -#: ../../whatsnew/3.10.rst:735 +#: ../../whatsnew/3.10.rst:736 msgid "" "This new syntax is also accepted as the second argument to :func:" "`isinstance` and :func:`issubclass`::" msgstr "" "這種新語法也接受作為 :func:`isinstance` 和 :func:`issubclass` 的第二個引數:" -#: ../../whatsnew/3.10.rst:741 +#: ../../whatsnew/3.10.rst:742 msgid "See :ref:`types-union` and :pep:`604` for more details." msgstr "更多資訊請見 :ref:`types-union` 與 :pep:`604`\\ 。" -#: ../../whatsnew/3.10.rst:743 +#: ../../whatsnew/3.10.rst:744 msgid "" "(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`, with " "additions by Yurii Karabas and Serhiy Storchaka in :issue:`44490`.)" @@ -837,11 +837,11 @@ msgstr "" "(由 Maggie Moss 和 Philippe Prados 在 :issue:`41428` 中貢獻,由 Yurii " "Karabas 和 Serhiy Storchaka 在 :issue:`44490` 中補充。)" -#: ../../whatsnew/3.10.rst:748 +#: ../../whatsnew/3.10.rst:749 msgid "PEP 612: Parameter Specification Variables" msgstr "PEP 612:參數規範變數" -#: ../../whatsnew/3.10.rst:750 +#: ../../whatsnew/3.10.rst:751 msgid "" "Two new options to improve the information provided to static type checkers " "for :pep:`484`\\ 's ``Callable`` have been added to the :mod:`typing` module." @@ -849,7 +849,7 @@ msgstr "" ":mod:`typing` 模組中新增了兩個新選項,用於改進為 :pep:`484` ``Callable`` 的靜" "態型別檢查器 (static type checker) 所提供的資訊。" -#: ../../whatsnew/3.10.rst:753 +#: ../../whatsnew/3.10.rst:754 msgid "" "The first is the parameter specification variable. They are used to forward " "the parameter types of one callable to another callable -- a pattern " @@ -862,7 +862,7 @@ msgstr "" "用範例可以在 :class:`typing.ParamSpec` 中找到。在過去是沒有簡單的方法可以如此" "精確地來為參數型別的依賴關係做型別註釋。" -#: ../../whatsnew/3.10.rst:759 +#: ../../whatsnew/3.10.rst:760 msgid "" "The second option is the new ``Concatenate`` operator. It's used in " "conjunction with parameter specification variables to type annotate a higher " @@ -873,7 +873,7 @@ msgstr "" "階、會新增或刪除另一個可呼叫物件參數的可呼叫物件進行型別註釋。使用範例可以" "在 :class:`typing.Concatenate` 中找到。" -#: ../../whatsnew/3.10.rst:764 +#: ../../whatsnew/3.10.rst:765 msgid "" "See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." "Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." @@ -883,7 +883,7 @@ msgstr "" "Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " "和 :pep:`612` 以了解更多詳情。" -#: ../../whatsnew/3.10.rst:768 +#: ../../whatsnew/3.10.rst:769 msgid "" "(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle " "Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.)" @@ -891,11 +891,11 @@ msgstr "" "(由 Ken Jin 在 :issue:`41559` 中貢獻、Jelle Zijlstra 在 :issue:`43783` 中進" "行了小幅改進。PEP 由 Mark Mendoza 編寫。)" -#: ../../whatsnew/3.10.rst:773 +#: ../../whatsnew/3.10.rst:774 msgid "PEP 613: TypeAlias" msgstr "PEP 613:型別別名 (TypeAlias)" -#: ../../whatsnew/3.10.rst:775 +#: ../../whatsnew/3.10.rst:776 msgid "" ":pep:`484` introduced the concept of type aliases, only requiring them to be " "top-level unannotated assignments. This simplicity sometimes made it " @@ -907,7 +907,7 @@ msgstr "" "賦值 (top-level unannotated assignments)。這種簡單性有時使型別檢查器難以區分" "型別別名和普通賦值,尤其是在涉及傳遞參照 (reference) 或無效型別時。比較如下:" -#: ../../whatsnew/3.10.rst:783 +#: ../../whatsnew/3.10.rst:784 msgid "" "Now the :mod:`typing` module has a special value :data:`TypeAlias` which " "lets you declare type aliases more explicitly::" @@ -915,19 +915,19 @@ msgstr "" "現在 :mod:`typing` 模組有一個特殊值 :data:`TypeAlias`,它可以讓你更明確地宣告" "型別別名:" -#: ../../whatsnew/3.10.rst:789 +#: ../../whatsnew/3.10.rst:790 msgid "See :pep:`613` for more details." msgstr "更多資訊請見 :pep:`613`\\ 。" -#: ../../whatsnew/3.10.rst:791 +#: ../../whatsnew/3.10.rst:792 msgid "(Contributed by Mikhail Golubev in :issue:`41923`.)" msgstr "(由 Mikhail Golubev 在 :issue:`41923` 中貢獻。)" -#: ../../whatsnew/3.10.rst:794 +#: ../../whatsnew/3.10.rst:795 msgid "PEP 647: User-Defined Type Guards" msgstr "PEP 647:使用者定義的型別防護" -#: ../../whatsnew/3.10.rst:796 +#: ../../whatsnew/3.10.rst:797 msgid "" ":data:`TypeGuard` has been added to the :mod:`typing` module to annotate " "type guard functions and improve information provided to static type " @@ -938,7 +938,7 @@ msgstr "" "護函式並改進在型別窄縮 (type narrowing) 期間提供給靜態型別檢查器的資訊。有關" "更多資訊,請參閱 :data:`TypeGuard` 的文件和 :pep:`647`。" -#: ../../whatsnew/3.10.rst:801 +#: ../../whatsnew/3.10.rst:802 msgid "" "(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`. PEP written " "by Eric Traut.)" @@ -946,11 +946,11 @@ msgstr "" "(由 Ken Jin 和 Guido van Rossum 在 :issue:`43766` 中貢獻。PEP 由 Eric Traut " "編寫。)" -#: ../../whatsnew/3.10.rst:805 +#: ../../whatsnew/3.10.rst:806 msgid "Other Language Changes" msgstr "其他語言變化" -#: ../../whatsnew/3.10.rst:807 +#: ../../whatsnew/3.10.rst:808 msgid "" "The :class:`int` type has a new method :meth:`int.bit_count`, returning the " "number of ones in the binary expansion of a given integer, also known as the " @@ -960,7 +960,7 @@ msgstr "" "式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas 在 :" "issue:`29882` 中貢獻。)" -#: ../../whatsnew/3.10.rst:811 +#: ../../whatsnew/3.10.rst:812 msgid "" "The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." "items` now all have a ``mapping`` attribute that gives a :class:`types." @@ -972,7 +972,7 @@ msgstr "" "MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney 在 :issue:`40890` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:816 +#: ../../whatsnew/3.10.rst:817 msgid "" ":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, " "used to require that all the iterables have an equal length." @@ -980,7 +980,7 @@ msgstr "" ":pep:`618`::func:`zip` 函式現在有一個可選的 ``strict`` 旗標,用於要求所有可" "疊代物件具有相同的長度。" -#: ../../whatsnew/3.10.rst:819 +#: ../../whatsnew/3.10.rst:820 msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " @@ -993,7 +993,7 @@ msgstr "" "meth:`~object.__int__` 方法,但沒有 :meth:`~object.__index__` 方法)。(由 " "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" -#: ../../whatsnew/3.10.rst:826 +#: ../../whatsnew/3.10.rst:827 msgid "" "If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " "will correctly fall back to :func:`object.__pow__` and :func:`object." @@ -1003,7 +1003,7 @@ msgstr "" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " "Shkop 在 :issue:`38302` 中貢獻。)" -#: ../../whatsnew/3.10.rst:830 +#: ../../whatsnew/3.10.rst:831 msgid "" "Assignment expressions can now be used unparenthesized within set literals " "and set comprehensions, as well as in sequence indexes (but not slices)." @@ -1011,7 +1011,7 @@ msgstr "" "現在可以在集合字面值 (set literals) 和集合綜合運算 (set comprehensions) 以及" "序列索引(但不能是切片)中使用不帶括號的賦值運算式 (assignment expressions)。" -#: ../../whatsnew/3.10.rst:833 +#: ../../whatsnew/3.10.rst:834 msgid "" "Functions have a new ``__builtins__`` attribute which is used to look for " "builtin symbols when a function is executed, instead of looking into " @@ -1024,7 +1024,7 @@ msgstr "" "存在,則屬性會以此做初始化,否則從當前內建物件 (builtins) 初始化。(由 Mark " "Shannon 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:839 +#: ../../whatsnew/3.10.rst:840 msgid "" "Two new builtin functions -- :func:`aiter` and :func:`anext` have been added " "to provide asynchronous counterparts to :func:`iter` and :func:`next`, " @@ -1035,7 +1035,7 @@ msgstr "" "func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 Justin " "Wang 在 :issue:`31861` 中貢獻。)" -#: ../../whatsnew/3.10.rst:844 +#: ../../whatsnew/3.10.rst:845 msgid "" "Static methods (:func:`@staticmethod `) and class methods (:" "func:`@classmethod `) now inherit the method attributes " @@ -1050,7 +1050,7 @@ msgstr "" "的 ``__wrapped__`` 屬性。此外,靜態方法現在可以像是常規函式般呼叫。(由 " "Victor Stinner 在 :issue:`43682` 中貢獻。)" -#: ../../whatsnew/3.10.rst:851 +#: ../../whatsnew/3.10.rst:852 msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " @@ -1061,7 +1061,7 @@ msgstr "" "使用 ``from __future__ import comments`` 造成任何執行環境 (runtime) 影響。" "(由 Batuhan Taskaya 在 :issue:`42737` 中貢獻。)" -#: ../../whatsnew/3.10.rst:855 +#: ../../whatsnew/3.10.rst:856 msgid "" "Class and module objects now lazy-create empty annotations dicts on demand. " "The annotations dicts are stored in the object’s ``__dict__`` for backwards " @@ -1074,7 +1074,7 @@ msgstr "" "改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參閱 :ref:" "`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" -#: ../../whatsnew/3.10.rst:862 +#: ../../whatsnew/3.10.rst:863 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " @@ -1085,7 +1085,7 @@ msgstr "" "__future__ import comments`` 下被禁止,因為它們有些不預期的行為。(由 " "Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:867 +#: ../../whatsnew/3.10.rst:868 msgid "" "Usage of unbound variables, ``super()`` and other expressions that might " "alter the processing of symbol table as annotations are now rendered " @@ -1096,7 +1096,7 @@ msgstr "" "(symbol table) 的運算式,現在在 ``from __future__ import comments`` 下變得無" "效。(由 Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:872 +#: ../../whatsnew/3.10.rst:873 msgid "" "Hashes of NaN values of both :class:`float` type and :class:`decimal." "Decimal` type now depend on object identity. Formerly, they always hashed to " @@ -1111,7 +1111,7 @@ msgstr "" "collision),可能導致潛在的二次方執行環境行為 (quadratic runtime behavior)。" "(由 Raymond Hettinger 在 :issue:`43475` 中貢獻。)" -#: ../../whatsnew/3.10.rst:879 +#: ../../whatsnew/3.10.rst:880 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " "deleting the :const:`__debug__` constant. (Contributed by Dong-hee Na in :" @@ -1120,7 +1120,7 @@ msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" "`NameError`)。(由 Dong-hee Na 在 :issue:`45000` 中貢獻。)" -#: ../../whatsnew/3.10.rst:882 +#: ../../whatsnew/3.10.rst:883 msgid "" ":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " "attributes. They will be ``None`` if not determined. (Contributed by Pablo " @@ -1129,23 +1129,23 @@ msgstr "" ":exc:`SyntaxError` 例外現在具有 ``end_lineno`` 和 ``end_offset`` 屬性。如果未" "被決定,它們將會是 ``None``。(由 Pablo Galindo 在 :issue:`43914` 中貢獻。)" -#: ../../whatsnew/3.10.rst:887 +#: ../../whatsnew/3.10.rst:888 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.10.rst:889 +#: ../../whatsnew/3.10.rst:890 msgid "None yet." msgstr "還沒有出現。" -#: ../../whatsnew/3.10.rst:893 +#: ../../whatsnew/3.10.rst:894 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.10.rst:896 +#: ../../whatsnew/3.10.rst:897 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.10.rst:898 +#: ../../whatsnew/3.10.rst:899 msgid "" "Add missing :meth:`~asyncio.events.AbstractEventLoop." "connect_accepted_socket` method. (Contributed by Alex Grönholm in :issue:" @@ -1154,11 +1154,11 @@ msgstr "" "新增缺少的 :meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket` " "方法。(由 Alex Grönholm 在 :issue:`41332` 中貢獻。)" -#: ../../whatsnew/3.10.rst:903 +#: ../../whatsnew/3.10.rst:904 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.10.rst:905 +#: ../../whatsnew/3.10.rst:906 msgid "" "Misleading phrase \"optional arguments\" was replaced with \"options\" in " "argparse help. Some tests might require adaptation if they rely on exact " @@ -1168,11 +1168,11 @@ msgstr "" "(options)」。某些依賴於精確輸出匹配的測試可能需要進行調整。(由 Raymond " "Hettinger 在 :issue:`9694` 中貢獻。)" -#: ../../whatsnew/3.10.rst:909 +#: ../../whatsnew/3.10.rst:910 msgid "array" msgstr "array" -#: ../../whatsnew/3.10.rst:911 +#: ../../whatsnew/3.10.rst:912 msgid "" "The :meth:`~array.array.index` method of :class:`array.array` now has " "optional *start* and *stop* parameters. (Contributed by Anders Lorentsen and " @@ -1182,11 +1182,11 @@ msgstr "" "*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz 在 :issue:" "`31956` 中貢獻。)" -#: ../../whatsnew/3.10.rst:916 +#: ../../whatsnew/3.10.rst:917 msgid "asynchat, asyncore, smtpd" msgstr "asynchat, asyncore, smtpd" -#: ../../whatsnew/3.10.rst:917 +#: ../../whatsnew/3.10.rst:918 msgid "" "These modules have been marked as deprecated in their module documentation " "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " @@ -1195,11 +1195,11 @@ msgstr "" "自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時的 :class:" "`DeprecationWarning` 現已新增到這三個模組中。" -#: ../../whatsnew/3.10.rst:922 +#: ../../whatsnew/3.10.rst:923 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.10.rst:924 +#: ../../whatsnew/3.10.rst:925 msgid "" "Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support " "the Base32 Encoding with Extended Hex Alphabet." @@ -1207,11 +1207,11 @@ msgstr "" "新增 :func:`base64.b32hexencode` 和 :func:`base64.b32hexdecode` 以支援擴充十" "六進位字母的 Base32 編碼 (Base32 Encoding with Extended Hex Alphabet)。" -#: ../../whatsnew/3.10.rst:928 +#: ../../whatsnew/3.10.rst:929 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.10.rst:930 +#: ../../whatsnew/3.10.rst:931 msgid "" "Add :meth:`~bdb.Breakpoint.clearBreakpoints` to reset all set breakpoints. " "(Contributed by Irit Katriel in :issue:`24160`.)" @@ -1219,11 +1219,11 @@ msgstr "" "新增 :meth:`~bdb.Breakpoint.clearBreakpoints` 來重置所有設定的斷點。(由 " "Irit Katriel 在 :issue:`24160` 中貢獻。)" -#: ../../whatsnew/3.10.rst:934 +#: ../../whatsnew/3.10.rst:935 msgid "bisect" msgstr "bisect" -#: ../../whatsnew/3.10.rst:936 +#: ../../whatsnew/3.10.rst:937 msgid "" "Added the possibility of providing a *key* function to the APIs in the :mod:" "`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" @@ -1231,11 +1231,11 @@ msgstr "" "新增向 :mod:`bisect` 模組 API 提供 *key* 函式的可能性。(由 Raymond " "Hettinger 在 :issue:`4356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:940 +#: ../../whatsnew/3.10.rst:941 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.10.rst:942 +#: ../../whatsnew/3.10.rst:943 msgid "" "Add a :func:`codecs.unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -1243,11 +1243,11 @@ msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" "功能。 (Hai Shi在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:946 +#: ../../whatsnew/3.10.rst:947 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.10.rst:948 +#: ../../whatsnew/3.10.rst:949 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " "for :class:`collections.abc.Callable` are now consistent with :data:`typing." @@ -1273,11 +1273,11 @@ msgstr "" "Callable` 參數化可能會引發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無" "引發例外地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:961 +#: ../../whatsnew/3.10.rst:962 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.10.rst:963 +#: ../../whatsnew/3.10.rst:964 msgid "" "Add a :func:`contextlib.aclosing` context manager to safely close async " "generators and objects representing asynchronously released resources. " @@ -1287,7 +1287,7 @@ msgstr "" "步釋放資源的物件。(由 Joongi Kim 和 John Belmonte 在 :issue:`41229` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:967 +#: ../../whatsnew/3.10.rst:968 msgid "" "Add asynchronous context manager support to :func:`contextlib.nullcontext`. " "(Contributed by Tom Gringauz in :issue:`41543`.)" @@ -1295,7 +1295,7 @@ msgstr "" "向 :func:`contextlib.nullcontext` 新增非同步情境管理器支援。(由 Tom " "Gringauz 在 :issue:`41543` 中貢獻。)" -#: ../../whatsnew/3.10.rst:970 +#: ../../whatsnew/3.10.rst:971 msgid "" "Add :class:`AsyncContextDecorator`, for supporting usage of async context " "managers as decorators." @@ -1303,11 +1303,11 @@ msgstr "" "新增 :class:`AsyncContextDecorator`,用於支援將非同步情境管理器作為裝飾器使" "用。" -#: ../../whatsnew/3.10.rst:974 +#: ../../whatsnew/3.10.rst:975 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.10.rst:976 +#: ../../whatsnew/3.10.rst:977 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " "by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." @@ -1322,7 +1322,7 @@ msgstr "" "ncurses 函式庫是否支援擴充顏色。 (由 Jeffrey Kintscher 和 Hans Petter " "Jansson 在 :issue:`36982` 中貢獻。)" -#: ../../whatsnew/3.10.rst:983 +#: ../../whatsnew/3.10.rst:984 msgid "" "The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if " "they are provided by the underlying curses library. (Contributed by Zackery " @@ -1331,15 +1331,15 @@ msgstr "" "如果 ``BUTTON5_*`` 常數是由底層 :mod:`curses` 函式庫提供的,那麼它們現在會在 " "curses 模組中公開。(由 Zackery Spytz 在 :issue:`39273` 中貢獻。)" -#: ../../whatsnew/3.10.rst:988 +#: ../../whatsnew/3.10.rst:989 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.10.rst:991 +#: ../../whatsnew/3.10.rst:992 msgid "__slots__" msgstr "__slots__" -#: ../../whatsnew/3.10.rst:993 +#: ../../whatsnew/3.10.rst:994 msgid "" "Added ``slots`` parameter in :func:`dataclasses.dataclass` decorator. " "(Contributed by Yurii Karabas in :issue:`42269`)" @@ -1347,11 +1347,11 @@ msgstr "" "在 :func:`dataclasses.dataclass` 裝飾器中新增了 ``slots`` 參數。(由 Yurii " "Karabas 在 :issue:`42269` 中貢獻)" -#: ../../whatsnew/3.10.rst:997 +#: ../../whatsnew/3.10.rst:998 msgid "Keyword-only fields" msgstr "僅限關鍵字欄位 (Keyword-only fields)" -#: ../../whatsnew/3.10.rst:999 +#: ../../whatsnew/3.10.rst:1000 msgid "" "dataclasses now supports fields that are keyword-only in the generated " "__init__ method. There are a number of ways of specifying keyword-only " @@ -1360,21 +1360,21 @@ msgstr "" "dataclasses 現在支援在產生的 __init__ 方法中包含僅限關鍵字的欄位。有多種方法" "可以指定僅限關鍵字欄位。" -#: ../../whatsnew/3.10.rst:1003 +#: ../../whatsnew/3.10.rst:1004 msgid "You can say that every field is keyword-only:" msgstr "你可以說每個欄位都是關鍵字:" -#: ../../whatsnew/3.10.rst:1014 +#: ../../whatsnew/3.10.rst:1015 msgid "" "Both ``name`` and ``birthday`` are keyword-only parameters to the generated " "__init__ method." msgstr "``name`` 和 ``birthday`` 都是產生的 __init__ 方法的僅限關鍵字參數。" -#: ../../whatsnew/3.10.rst:1017 +#: ../../whatsnew/3.10.rst:1018 msgid "You can specify keyword-only on a per-field basis:" msgstr "你可以在每個欄位的基礎上指定僅限關鍵字:" -#: ../../whatsnew/3.10.rst:1028 +#: ../../whatsnew/3.10.rst:1029 msgid "" "Here only ``birthday`` is keyword-only. If you set ``kw_only`` on " "individual fields, be aware that there are rules about re-ordering fields " @@ -1385,7 +1385,7 @@ msgstr "" "意,由於僅限關鍵字欄位需要遵循非僅限關鍵字欄位,因此會有欄位重新排序的相關規" "則。詳細資訊請參閱完整的 dataclasses 文件。" -#: ../../whatsnew/3.10.rst:1033 +#: ../../whatsnew/3.10.rst:1034 msgid "" "You can also specify that all fields following a KW_ONLY marker are keyword-" "only. This will probably be the most common usage:" @@ -1393,7 +1393,7 @@ msgstr "" "你還可以指定 KW_ONLY 標記後面的所有欄位均為僅限關鍵字欄位。這可能是最常見的用" "法:" -#: ../../whatsnew/3.10.rst:1048 +#: ../../whatsnew/3.10.rst:1049 msgid "" "Here, ``z`` and ``t`` are keyword-only parameters, while ``x`` and ``y`` are " "not. (Contributed by Eric V. Smith in :issue:`43532`.)" @@ -1401,11 +1401,11 @@ msgstr "" "這裡的 ``z`` 和 ``t`` 是僅限關鍵字參數,而 ``x`` 和 ``y`` 則不是。(由 Eric " "V. Smith 在 :issue:`43532` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1055 +#: ../../whatsnew/3.10.rst:1056 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.10.rst:1057 +#: ../../whatsnew/3.10.rst:1058 msgid "" "The entire ``distutils`` package is deprecated, to be removed in Python " "3.12. Its functionality for specifying package builds has already been " @@ -1424,7 +1424,7 @@ msgstr "" "遷移任何其他地方的計畫,且使用其他功能的應用程式應該開始規劃如何取得程式碼的" "私有副本。請參閱 :pep:`632` 的討論。" -#: ../../whatsnew/3.10.rst:1067 +#: ../../whatsnew/3.10.rst:1068 msgid "" "The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The " "``bdist_wheel`` command is now recommended to distribute binary packages on " @@ -1434,12 +1434,12 @@ msgstr "" "``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner 在 :" "issue:`42802` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1073 +#: ../../whatsnew/3.10.rst:1074 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1075 ../../whatsnew/3.10.rst:1210 -#: ../../whatsnew/3.10.rst:1237 ../../whatsnew/3.10.rst:1336 +#: ../../whatsnew/3.10.rst:1076 ../../whatsnew/3.10.rst:1211 +#: ../../whatsnew/3.10.rst:1238 ../../whatsnew/3.10.rst:1337 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1447,11 +1447,11 @@ msgstr "" "當模組未定義 ``__loader__`` 時,回退到 ``__spec__.loader`` 。(由 Brett " "Cannon 在 :issue:`42133` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1079 +#: ../../whatsnew/3.10.rst:1080 msgid "encodings" msgstr "encodings" -#: ../../whatsnew/3.10.rst:1081 +#: ../../whatsnew/3.10.rst:1082 msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" @@ -1459,11 +1459,11 @@ msgstr "" ":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi 在 :" "issue:`39337` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1085 +#: ../../whatsnew/3.10.rst:1086 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.10.rst:1087 +#: ../../whatsnew/3.10.rst:1088 msgid "" ":class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and :" "func:`__str__` now returns ``member_name``. Stdlib enums available as " @@ -1475,7 +1475,7 @@ msgstr "" "``module_name.member_name`` 的 :func:`repr`。(由 Ethan Furman 在 :issue:" "`40066` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1092 +#: ../../whatsnew/3.10.rst:1093 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" @@ -1483,11 +1483,11 @@ msgstr "" "新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman 在 :" "issue:`41816` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1096 +#: ../../whatsnew/3.10.rst:1097 msgid "fileinput" msgstr "fileinput" -#: ../../whatsnew/3.10.rst:1098 +#: ../../whatsnew/3.10.rst:1099 msgid "" "Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" "`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" @@ -1495,7 +1495,7 @@ msgstr "" "在 :func:`fileinput.input` 和 :class:`fileinput.FileInput` 中新增 *encoding* " "和 *errors* 參數。(由 Inada Naoki 在 :issue:`43712` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1102 +#: ../../whatsnew/3.10.rst:1103 msgid "" ":func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object " "when *mode* is \"r\" and file is compressed, like uncompressed files. " @@ -1505,11 +1505,11 @@ msgstr "" "會回傳 :class:`TextIOWrapper` 物件(和未壓縮檔案一樣)。(由 Inada Naoki 在 :" "issue:`5758` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1107 +#: ../../whatsnew/3.10.rst:1108 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.10.rst:1109 +#: ../../whatsnew/3.10.rst:1110 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " "garbage collector collection. (Contributed by Victor Stinner in :issue:" @@ -1518,11 +1518,11 @@ msgstr "" ":mod:`faulthandler` 模組現在可以檢測垃圾收集器 (garbage collector) 在收集期間" "是否發生嚴重錯誤。(由 Victor Stinner 在 :issue:`44466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1114 +#: ../../whatsnew/3.10.rst:1115 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.10.rst:1116 +#: ../../whatsnew/3.10.rst:1117 msgid "" "Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" "func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" @@ -1531,11 +1531,11 @@ msgstr "" "get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo 在 :issue:" "`43439` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1120 +#: ../../whatsnew/3.10.rst:1121 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.10.rst:1122 +#: ../../whatsnew/3.10.rst:1123 msgid "" "Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" "`~glob.iglob` which allow to specify the root directory for searching. " @@ -1544,11 +1544,11 @@ msgstr "" "在 :func:`~glob.glob` 和 :func:`~glob.iglob` 中新增 *root_dir* 和 *dir_fd* 參" "數,允許指定搜索的根目錄。(由 Serhiy Storchaka 在 :issue:`38144` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1127 +#: ../../whatsnew/3.10.rst:1128 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.10.rst:1129 +#: ../../whatsnew/3.10.rst:1130 msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" @@ -1556,7 +1556,7 @@ msgstr "" "hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes 在 :pep:" "`644` 和 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1132 +#: ../../whatsnew/3.10.rst:1133 msgid "" "The hashlib module has preliminary support for OpenSSL 3.0.0. (Contributed " "by Christian Heimes in :issue:`38820` and other issues.)" @@ -1564,7 +1564,7 @@ msgstr "" "hashlib 模組初步支援 OpenSSL 3.0.0。(由 Christian Heimes 在 :issue:`38820` " "和其他問題中貢獻。)" -#: ../../whatsnew/3.10.rst:1135 +#: ../../whatsnew/3.10.rst:1136 msgid "" "The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In " "the future PBKDF2-HMAC will only be available when Python has been built " @@ -1574,11 +1574,11 @@ msgstr "" "支援的建置 Python 中才能夠使用 PBKDF2-HMAC。(由 Christian Heimes 在 :issue:" "`43880` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1141 +#: ../../whatsnew/3.10.rst:1142 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.10.rst:1143 +#: ../../whatsnew/3.10.rst:1144 msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" @@ -1586,11 +1586,11 @@ msgstr "" "hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。 (由 Christian Heimes 在 :" "issue:`40645` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1147 +#: ../../whatsnew/3.10.rst:1148 msgid "IDLE and idlelib" msgstr "IDLE 和 idlelib" -#: ../../whatsnew/3.10.rst:1149 +#: ../../whatsnew/3.10.rst:1150 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" @@ -1600,7 +1600,7 @@ msgstr "" "掛鉤 (user hooks) 在以前是被忽略的。(由 Ken Hilton 在 :issue:`43008` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1153 +#: ../../whatsnew/3.10.rst:1154 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -1616,11 +1616,11 @@ msgstr "" "獻。)將縮排空間設定從 Font 分頁移至新的 Windows 分頁。(由 Mark Roseman 和 " "Terry Jan Reedy 在 :issue:`33962` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1161 +#: ../../whatsnew/3.10.rst:1162 msgid "The changes above were backported to a 3.9 maintenance release." msgstr "上述更改已向後移植到 3.9 維護版本。" -#: ../../whatsnew/3.10.rst:1163 +#: ../../whatsnew/3.10.rst:1164 msgid "" "Add a Shell sidebar. Move the primary prompt ('>>>') to the sidebar. Add " "secondary prompts ('...') to the sidebar. Left click and optional drag " @@ -1636,7 +1636,7 @@ msgstr "" "prompts)」的情境選單,這會將側邊欄中提示字元與所選文字並排,此選項也會出現在" "文字的情境選單上。(由 Tal Einat 在 :issue:`37903` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1172 +#: ../../whatsnew/3.10.rst:1173 msgid "" "Use spaces instead of tabs to indent interactive code. This makes " "interactive code entries 'look right'. Making this feasible was a major " @@ -1647,7 +1647,7 @@ msgstr "" "起來正確」。新增 shell 側邊欄的主要動機是實現這一點。(由 Terry Jan Reedy " "在 :issue:`37892` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1177 +#: ../../whatsnew/3.10.rst:1178 msgid "" "Highlight the new :ref:`soft keywords ` :keyword:`match`, :" "keyword:`case `, and :keyword:`_ ` in pattern-" @@ -1660,11 +1660,11 @@ msgstr "" "`。然而這種突顯並不完美,並且在某些罕見的情況下會出錯,包" "括 ``case`` 模式中的一些 ``_``。(由 Tal Einat 在 :issue:`44010` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1183 +#: ../../whatsnew/3.10.rst:1184 msgid "New in 3.10 maintenance releases." msgstr "3.10 維護版本中的新增功能。" -#: ../../whatsnew/3.10.rst:1185 +#: ../../whatsnew/3.10.rst:1186 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1672,7 +1672,7 @@ msgstr "" "將語法突顯 (syntax highlighting) 應用於 ``.pyi`` 檔案。(由 Alex Waygood 和 " "Terry Jan Reedy 在 :issue:`45447` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1188 +#: ../../whatsnew/3.10.rst:1189 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1680,11 +1680,11 @@ msgstr "" "保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy 在 :gh:" "`95191` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1192 +#: ../../whatsnew/3.10.rst:1193 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1194 +#: ../../whatsnew/3.10.rst:1195 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." @@ -1692,7 +1692,7 @@ msgstr "" "與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" -#: ../../whatsnew/3.10.rst:1197 +#: ../../whatsnew/3.10.rst:1198 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1703,7 +1703,7 @@ msgstr "" "`importlib.metadata.EntryPoints` 類別提供了以群組和名稱選擇入口點的更好體驗。" "有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" -#: ../../whatsnew/3.10.rst:1203 +#: ../../whatsnew/3.10.rst:1204 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." @@ -1712,11 +1712,11 @@ msgstr "" "新增了 :func:`importlib.metadata.packages_distributions` 用於將頂階 Python 模" "組和套件解析出 :class:`importlib.metadata.Distribution`。" -#: ../../whatsnew/3.10.rst:1208 +#: ../../whatsnew/3.10.rst:1209 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1213 +#: ../../whatsnew/3.10.rst:1214 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1744,11 +1744,11 @@ msgstr "" "著 :func:`inspect.signature` 和 :func:`inspect.Signature.from_callable` 現在" "也可以取消字串化註釋。(由 Larry Hastings 在 :issue:`43817` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1229 +#: ../../whatsnew/3.10.rst:1230 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.10.rst:1231 +#: ../../whatsnew/3.10.rst:1232 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" @@ -1756,15 +1756,15 @@ msgstr "" "新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1235 +#: ../../whatsnew/3.10.rst:1236 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1241 +#: ../../whatsnew/3.10.rst:1242 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1243 +#: ../../whatsnew/3.10.rst:1244 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" @@ -1772,7 +1772,7 @@ msgstr "" "為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:" "`41440` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1246 +#: ../../whatsnew/3.10.rst:1247 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" @@ -1781,7 +1781,7 @@ msgstr "" "新增函式 :func:`os.eventfd` 和相關幫助程式來包裝 Linux 上的 ``eventfd2`` 系統" "呼叫。 (由 Christian Heimes 在 :issue:`41001` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1250 +#: ../../whatsnew/3.10.rst:1251 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1793,7 +1793,7 @@ msgstr "" "address space) 之間進行複製,其中檔案描述器之一必須是個 pipe。(由 Pablo " "Galindo 在 :issue:`41625` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1255 +#: ../../whatsnew/3.10.rst:1256 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:" @@ -1803,11 +1803,11 @@ msgstr "" "O_SYMLINK` 和 :data:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:`43106` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1260 +#: ../../whatsnew/3.10.rst:1261 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1262 +#: ../../whatsnew/3.10.rst:1263 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 " @@ -1817,11 +1817,11 @@ msgstr "" "``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引發 :exc:" "`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1268 +#: ../../whatsnew/3.10.rst:1269 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1270 +#: ../../whatsnew/3.10.rst:1271 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" @@ -1829,7 +1829,7 @@ msgstr "" "新增 :attr:`PurePath.parents ` 對於切片的支援。 " "(由 Joshua Cannon 在 :issue:`35498` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1273 +#: ../../whatsnew/3.10.rst:1274 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" @@ -1837,7 +1837,7 @@ msgstr "" "向 :attr:`PurePath.parents ` 新增負索引支援。(由 " "Yaroslav Pankovych 在 :issue:`21041` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1277 +#: ../../whatsnew/3.10.rst:1278 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1848,7 +1848,7 @@ msgstr "" "Path.hardlink_to>` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的" "引數順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1282 +#: ../../whatsnew/3.10.rst:1283 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1859,11 +1859,11 @@ msgstr "" "*follow_symlinks* 僅限關鍵字引數,以與 :mod:`os` 模組中的相應函式保持一致。" "(由 Barney Gale 在 :issue:`39906` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1288 +#: ../../whatsnew/3.10.rst:1289 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1290 +#: ../../whatsnew/3.10.rst:1291 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release `\\ 包含已棄用功能的列表。(由 Christian Heimes 在 :issue:`43880` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1371 +#: ../../whatsnew/3.10.rst:1372 msgid "" "The ssl module now has more secure default settings. Ciphers without forward " "secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits " @@ -2035,7 +2035,7 @@ msgstr "" "`~ssl.SSLContext` 預設為最低協議版本 TLS 1.2。設定基於 Hynek Schlawack 的研" "究。 (由 Christian Heimes 在 :issue:`43998` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1378 +#: ../../whatsnew/3.10.rst:1379 msgid "" "The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer " "officially supported. Python does not block them actively. However OpenSSL " @@ -2046,7 +2046,7 @@ msgstr "" "們。然而,OpenSSL 建置選項、發行版配置、發行商補丁和密碼套件可能會阻止交握的" "成功。" -#: ../../whatsnew/3.10.rst:1383 +#: ../../whatsnew/3.10.rst:1384 msgid "" "Add a *timeout* parameter to the :func:`ssl.get_server_certificate` " "function. (Contributed by Zackery Spytz in :issue:`31870`.)" @@ -2054,7 +2054,7 @@ msgstr "" "向 :func:`ssl.get_server_certificate` 函式新增 *timeout* 參數。(由 Zackery " "Spytz 在 :issue:`31870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1386 +#: ../../whatsnew/3.10.rst:1387 msgid "" "The ssl module uses heap-types and multi-phase initialization. (Contributed " "by Christian Heimes in :issue:`42333`.)" @@ -2062,7 +2062,7 @@ msgstr "" "ssl 模組使用堆疊類型 (heap-types) 和多階段初始化 (multi-phase " "initialization)。(由 Christian Heimes 在 :issue:`42333` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1389 +#: ../../whatsnew/3.10.rst:1390 msgid "" "A new verify flag :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" @@ -2070,11 +2070,11 @@ msgstr "" "新增驗證旗標 :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" "`40849` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1393 +#: ../../whatsnew/3.10.rst:1394 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.10.rst:1395 +#: ../../whatsnew/3.10.rst:1396 msgid "" "Add audit events for :func:`~sqlite3.connect/handle`, :meth:`~sqlite3." "Connection.enable_load_extension`, and :meth:`~sqlite3.Connection." @@ -2084,11 +2084,11 @@ msgstr "" "enable_load_extension` 和 :meth:`~sqlite3.Connection.load_extension` 的稽核事" "件。(由 Erlend E. Aasland 在 :issue:`43762` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1401 +#: ../../whatsnew/3.10.rst:1402 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.10.rst:1403 +#: ../../whatsnew/3.10.rst:1404 msgid "" "Add :data:`sys.orig_argv` attribute: the list of the original command line " "arguments passed to the Python executable. (Contributed by Victor Stinner " @@ -2097,7 +2097,7 @@ msgstr "" "新增 :data:`sys.orig_argv` 屬性:傳遞給 Python 可執行檔案的原始命令列引數列" "表。(由 Victor Stinner 在 :issue:`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1407 +#: ../../whatsnew/3.10.rst:1408 msgid "" "Add :data:`sys.stdlib_module_names`, containing the list of the standard " "library module names. (Contributed by Victor Stinner in :issue:`42955`.)" @@ -2105,11 +2105,11 @@ msgstr "" "新增 :data:`sys.stdlib_module_names`,其中包含標準函式庫模組的名稱列表。 " "(由 Victor Stinner 在 :issue:`42955` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1412 +#: ../../whatsnew/3.10.rst:1413 msgid "_thread" msgstr "_thread" -#: ../../whatsnew/3.10.rst:1414 +#: ../../whatsnew/3.10.rst:1415 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " "simulate (the default is still :data:`signal.SIGINT`). (Contributed by " @@ -2119,11 +2119,11 @@ msgstr "" "然是 :data:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1419 +#: ../../whatsnew/3.10.rst:1420 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.10.rst:1421 +#: ../../whatsnew/3.10.rst:1422 msgid "" "Add :func:`threading.gettrace` and :func:`threading.getprofile` to retrieve " "the functions set by :func:`threading.settrace` and :func:`threading." @@ -2133,7 +2133,7 @@ msgstr "" "func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。(由 " "Mario Corchero 在 :issue:`42251` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1426 +#: ../../whatsnew/3.10.rst:1427 msgid "" "Add :data:`threading.__excepthook__` to allow retrieving the original value " "of :func:`threading.excepthook` in case it is set to a broken or a different " @@ -2143,11 +2143,11 @@ msgstr "" "excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 Mario Corchero 在 :" "issue:`42308` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1432 +#: ../../whatsnew/3.10.rst:1433 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.10.rst:1434 +#: ../../whatsnew/3.10.rst:1435 msgid "" "The :func:`~traceback.format_exception`, :func:`~traceback." "format_exception_only`, and :func:`~traceback.print_exception` functions can " @@ -2159,11 +2159,11 @@ msgstr "" "外物件作為僅限位置引數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:" "`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1441 +#: ../../whatsnew/3.10.rst:1442 msgid "types" msgstr "types" -#: ../../whatsnew/3.10.rst:1443 +#: ../../whatsnew/3.10.rst:1444 msgid "" "Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` and :data:" "`types.NotImplementedType` classes, providing a new set of types readily " @@ -2174,15 +2174,15 @@ msgstr "" "NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型別。(由 Bas van " "Beek 在 :issue:`41810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1449 +#: ../../whatsnew/3.10.rst:1450 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.10.rst:1451 +#: ../../whatsnew/3.10.rst:1452 msgid "For major changes, see :ref:`new-feat-related-type-hints`." msgstr "有關重大更改,請參閱\\ :ref:`new-feat-related-type-hints`。" -#: ../../whatsnew/3.10.rst:1453 +#: ../../whatsnew/3.10.rst:1454 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." @@ -2190,16 +2190,16 @@ msgstr "" ":class:`typing.Literal` 的行為已更改為符合 :pep:`586` 並匹配 PEP 中指定的靜態" "型別檢查器的行為。" -#: ../../whatsnew/3.10.rst:1456 +#: ../../whatsnew/3.10.rst:1457 msgid "``Literal`` now de-duplicates parameters." msgstr "``Literal`` 現在可以刪除重複參數。" -#: ../../whatsnew/3.10.rst:1457 +#: ../../whatsnew/3.10.rst:1458 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "``Literal`` 物件之間的相等性比較現在與順序無關。" -#: ../../whatsnew/3.10.rst:1458 +#: ../../whatsnew/3.10.rst:1459 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2210,7 +2210,7 @@ msgstr "" "Literal[False]`` 先前之求值為 ``True``,但現在它是 ``False``。為了支援此更" "改,內部使用的型別快取現在支援了型別的辨認。" -#: ../../whatsnew/3.10.rst:1462 +#: ../../whatsnew/3.10.rst:1463 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2221,11 +2221,11 @@ msgstr "" "在將在相等性比較期間引發 :exc:`TypeError` 例外。請注意,使用不可雜湊的參數宣" "告 ``Literal`` 不會引發錯誤:" -#: ../../whatsnew/3.10.rst:1474 +#: ../../whatsnew/3.10.rst:1475 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1476 +#: ../../whatsnew/3.10.rst:1477 msgid "" "Add new function :func:`typing.is_typeddict` to introspect if an annotation " "is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:" @@ -2234,7 +2234,7 @@ msgstr "" "新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否為 :" "class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1480 +#: ../../whatsnew/3.10.rst:1481 msgid "" "Subclasses of ``typing.Protocol`` which only have data variables declared " "will now raise a ``TypeError`` when checked with ``isinstance`` unless they " @@ -2249,7 +2249,7 @@ msgstr "" "該使用 :func:`runtime_checkable` 裝飾器來裝飾其子類別。(由 Yurii Karabas " "在 :issue:`38908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1488 +#: ../../whatsnew/3.10.rst:1489 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules have been deprecated since " @@ -2262,11 +2262,11 @@ msgstr "" "Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引入。 " "(由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1496 +#: ../../whatsnew/3.10.rst:1497 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.10.rst:1498 +#: ../../whatsnew/3.10.rst:1499 msgid "" "Add new method :meth:`~unittest.TestCase.assertNoLogs` to complement the " "existing :meth:`~unittest.TestCase.assertLogs`. (Contributed by Kit Yan Choi " @@ -2276,11 +2276,11 @@ msgstr "" "`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi 在 :issue:`39385` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1503 +#: ../../whatsnew/3.10.rst:1504 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.10.rst:1505 +#: ../../whatsnew/3.10.rst:1506 msgid "" "Python versions earlier than Python 3.10 allowed using both ``;`` and ``&`` " "as query parameter separators in :func:`urllib.parse.parse_qs` and :func:" @@ -2300,11 +2300,11 @@ msgstr "" "訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" "issue:`42967` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1516 +#: ../../whatsnew/3.10.rst:1517 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.10.rst:1518 +#: ../../whatsnew/3.10.rst:1519 msgid "" "Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." "handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" @@ -2313,11 +2313,11 @@ msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1523 +#: ../../whatsnew/3.10.rst:1524 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.10.rst:1524 +#: ../../whatsnew/3.10.rst:1525 msgid "" "Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." "find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" @@ -2328,7 +2328,7 @@ msgstr "" "meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." "exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1529 +#: ../../whatsnew/3.10.rst:1530 msgid "" "Add :meth:`~zipimport.zipimporter.invalidate_caches` method. (Contributed by " "Desmond Cheong in :issue:`14678`.)" @@ -2336,11 +2336,11 @@ msgstr "" "新增 :meth:`~zipimport.zipimporter.invalidate_caches` 方法。(由 Desmond " "Cheong 在 :issue:`14678` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1534 +#: ../../whatsnew/3.10.rst:1535 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.10.rst:1536 +#: ../../whatsnew/3.10.rst:1537 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " "(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" @@ -2349,7 +2349,7 @@ msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1540 +#: ../../whatsnew/3.10.rst:1541 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" "name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" @@ -2362,7 +2362,7 @@ msgstr "" "引入 69 個模組,而在 Python 3.10 上僅引入 51 個模組 (-18)。(由 Victor " "Stinner 在 :issue:`41006` 和 :issue:`41718` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1546 +#: ../../whatsnew/3.10.rst:1547 msgid "" "The ``LOAD_ATTR`` instruction now uses new \"per opcode cache\" mechanism. " "It is about 36% faster now for regular attributes and 44% faster for slots. " @@ -2375,7 +2375,7 @@ msgstr "" "Yury Selivanov 在 :issue:`42093` 中以及 Guido van Rossum 在 :issue:`42927` 中" "貢獻,基於最初在 PyPy 和 MicroPython 中實作的想法。)" -#: ../../whatsnew/3.10.rst:1552 +#: ../../whatsnew/3.10.rst:1553 msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " @@ -2392,7 +2392,7 @@ msgstr "" "linux-8-2-brings-faster-python-3-8-run-speeds/>`_ 以了解詳情。(由 Victor " "Stinner 和 Pablo Galindo 在 :issue:`38980` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1560 +#: ../../whatsnew/3.10.rst:1561 msgid "" "Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" "`zlib` modules, and add ``.readall()`` function to ``_compression." @@ -2407,7 +2407,7 @@ msgstr "" "``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" "`41486` 貢獻、由 Gregory P. Smith 審閱)" -#: ../../whatsnew/3.10.rst:1566 +#: ../../whatsnew/3.10.rst:1567 msgid "" "When using stringized annotations, annotations dicts for functions are no " "longer created when the function is created. Instead, they are stored as a " @@ -2421,7 +2421,7 @@ msgstr "" "最佳化將定義帶有註釋的函式所需的 CPU 時間減少了一半。(由 Yurii Karabas 和 " "Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1573 +#: ../../whatsnew/3.10.rst:1574 msgid "" "Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` " "now sometimes use Crochemore & Perrin's \"Two-Way\" string searching " @@ -2432,7 +2432,7 @@ msgstr "" "用 Crochemore & Perrin 的「雙向」字串搜索演算法來避免作用於長字串上時發生二次" "方行為 (quadratic behavior)。(由 Dennis Sweeney 在 :issue:`41972` 中貢獻)" -#: ../../whatsnew/3.10.rst:1578 +#: ../../whatsnew/3.10.rst:1579 msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " @@ -2443,7 +2443,7 @@ msgstr "" "查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" "`43452` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1582 +#: ../../whatsnew/3.10.rst:1583 msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" @@ -2456,7 +2456,7 @@ msgstr "" "hee Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1586 +#: ../../whatsnew/3.10.rst:1587 msgid "" ":class:`BZ2File` performance is improved by removing internal ``RLock``. " "This makes :class:`BZ2File` thread unsafe in the face of multiple " @@ -2468,11 +2468,11 @@ msgstr "" "`BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:`gzip` 和 :" "mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1594 ../../whatsnew/3.10.rst:2200 +#: ../../whatsnew/3.10.rst:1595 ../../whatsnew/3.10.rst:2201 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.10.rst:1596 +#: ../../whatsnew/3.10.rst:1597 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2492,15 +2492,14 @@ msgstr "" "其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1607 +#: ../../whatsnew/3.10.rst:1608 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " -"Specifically, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" -"`~importlib.abc.Finder.find_module` (superseded by :meth:`~importlib.abc." -"Finder.find_spec`), :meth:`~importlib.abc.Loader.load_module` (superseded " -"by :meth:`~importlib.abc.Loader.exec_module`), :meth:`~importlib.abc.Loader." -"module_repr` (which the import system takes care of for you), the " +"Specifically, :meth:`!find_loader`/:meth:`!find_module` (superseded by :meth:" +"`~importlib.abc.Finder.find_spec`), :meth:`~importlib.abc.Loader." +"load_module` (superseded by :meth:`~importlib.abc.Loader.exec_module`), :" +"meth:`!module_repr` (which the import system takes care of for you), the " "``__package__`` attribute (superseded by ``__spec__.parent``), the " "``__loader__`` attribute (superseded by ``__spec__.loader``), and the " "``__cached__`` attribute (superseded by ``__spec__.cached``) will slowly be " @@ -2509,18 +2508,8 @@ msgid "" "appropriate to help identify code which needs updating during this " "transition." msgstr "" -"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語義。" -"具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" -"`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." -"find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" -"`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." -"module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." -"parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " -"``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" -"`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" -"`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" -#: ../../whatsnew/3.10.rst:1624 +#: ../../whatsnew/3.10.rst:1625 msgid "" "The entire ``distutils`` namespace is deprecated, to be removed in Python " "3.12. Refer to the :ref:`module changes ` section for " @@ -2529,7 +2518,7 @@ msgstr "" "整個 ``distutils`` 命名空間已棄用,將在 Python 3.12 中刪除。請參閱\\ :ref:`模" "組更改 ` 以獲取更多資訊。" -#: ../../whatsnew/3.10.rst:1628 +#: ../../whatsnew/3.10.rst:1629 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " @@ -2539,7 +2528,7 @@ msgstr "" "代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" "issue:`37319` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1632 +#: ../../whatsnew/3.10.rst:1633 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:" @@ -2550,7 +2539,7 @@ msgstr "" "用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." "Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1638 +#: ../../whatsnew/3.10.rst:1639 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " @@ -2559,7 +2548,7 @@ msgstr "" ":meth:`zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." "zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1642 +#: ../../whatsnew/3.10.rst:1643 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." @@ -2569,114 +2558,77 @@ msgstr "" "`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是當前首選。" "(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1647 +#: ../../whatsnew/3.10.rst:1648 msgid "" -"The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" -"`importlib.abc.PathEntryFinder.find_module` by the import system now trigger " +"The use of :meth:`!importlib.abc.MetaPathFinder.find_module` and :meth:`!" +"importlib.abc.PathEntryFinder.find_module` by the import system now trigger " "an :exc:`ImportWarning` as :meth:`importlib.abc.MetaPathFinder.find_spec` " "and :meth:`importlib.abc.PathEntryFinder.find_spec` are preferred, " "respectively. You can use :func:`importlib.util.spec_from_loader` to help in " "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" -"引入系統使用 :meth:`importlib.abc.MetaPathFinder.find_module` 和 :meth:" -"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:`ImportWarning` " -"作為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :meth:`importlib.abc." -"PathEntryFinder.find_spec` 分別是首選。你可以使用 :func:`importlib.util." -"spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1656 +#: ../../whatsnew/3.10.rst:1657 msgid "" -"The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import " +"The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." "PathEntryFinder.find_spec` is preferred. You can use :func:`importlib.util." "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :issue:" "`43672`.)" msgstr "" -"引入系統使用 :meth:`importlib.abc.PathEntryFinder.find_loader` 現在會觸發 :" -"exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder.find_spec` 是" -"首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " -"Brett Cannon 在 :issue:`43672` 中貢獻。)" - -#: ../../whatsnew/3.10.rst:1662 -msgid "" -"The various implementations of :meth:`importlib.abc.MetaPathFinder." -"find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" -"meth:`importlib.machinery.FrozenImporter.find_module`, :meth:`importlib." -"machinery.WindowsRegistryFinder.find_module`, :meth:`importlib.machinery." -"PathFinder.find_module`, :meth:`importlib.abc.MetaPathFinder." -"find_module` ), :meth:`importlib.abc.PathEntryFinder.find_module` ( :meth:" -"`importlib.machinery.FileFinder.find_module` ), and :meth:`importlib.abc." -"PathEntryFinder.find_loader` ( :meth:`importlib.machinery.FileFinder." + +#: ../../whatsnew/3.10.rst:1663 +msgid "" +"The various implementations of :meth:`!importlib.abc.MetaPathFinder." +"find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" +"meth:`!importlib.machinery.FrozenImporter.find_module`, :meth:`!importlib." +"machinery.WindowsRegistryFinder.find_module`, :meth:`!importlib.machinery." +"PathFinder.find_module`, :meth:`!importlib.abc.MetaPathFinder." +"find_module` ), :meth:`!importlib.abc.PathEntryFinder.find_module` ( :meth:`!" +"importlib.machinery.FileFinder.find_module` ), and :meth:`!importlib.abc." +"PathEntryFinder.find_loader` ( :meth:`!importlib.machinery.FileFinder." "find_loader` ) now raise :exc:`DeprecationWarning` and are slated for " "removal in Python 3.12 (previously they were documented as deprecated in " "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -":meth:`importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" -"`importlib.machinery.BuiltinImporter.find_module`、:meth:`importlib." -"machinery.FrozenImporter.find_module`、:meth:`importlib.machinery." -"WindowsRegistryFinder.find_module`、:meth:`importlib.machinery.PathFinder." -"find_module`、:meth:`importlib.abc.MetaPathFinder.find_module` )、:meth:" -"`importlib.abc.PathEntryFinder.find_module` (:meth:`importlib.machinery." -"FileFinder.find_module` ) 和 :meth:`importlib.abc.PathEntryFinder." -"find_loader` (:meth:`importlib.machinery.FileFinder.find_loader` ) 現在引發 :" -"exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 Python " -"3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" - -#: ../../whatsnew/3.10.rst:1677 -msgid "" -":class:`importlib.abc.Finder` is deprecated (including its sole method, :" -"meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." -"MetaPathFinder` and :class:`importlib.abc.PathEntryFinder` no longer inherit " -"from the class. Users should inherit from one of these two classes as " -"appropriate instead. (Contributed by Brett Cannon in :issue:`42135`.)" -msgstr "" -":class:`importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`~importlib.abc." -"Finder.find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :class:" -"`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇" -"其一以繼承。 (由 Brett Cannon 在 :issue:`42135` 中貢獻。)" - -#: ../../whatsnew/3.10.rst:1684 -msgid "" -"The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" -"`importlib.util.set_package_wrapper`, :func:`importlib.util." -"set_loader_wrapper`, :func:`importlib.util.module_for_loader`, :class:" -"`pkgutil.ImpImporter`, and :class:`pkgutil.ImpLoader` have all been updated " + +#: ../../whatsnew/3.10.rst:1678 +msgid "" +":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" +"meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" +"`importlib.abc.PathEntryFinder` no longer inherit from the class. Users " +"should inherit from one of these two classes as appropriate instead. " +"(Contributed by Brett Cannon in :issue:`42135`.)" +msgstr "" + +#: ../../whatsnew/3.10.rst:1685 +msgid "" +"The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" +"importlib.util.set_package_wrapper`, :func:`!importlib.util." +"set_loader_wrapper`, :func:`!importlib.util.module_for_loader`, :class:`!" +"pkgutil.ImpImporter`, and :class:`!pkgutil.ImpLoader` have all been updated " "to list Python 3.12 as the slated version of removal (they began raising :" "exc:`DeprecationWarning` in previous versions of Python). (Contributed by " "Brett Cannon in :issue:`43720`.)" msgstr "" -"棄用 :mod:`imp`、:func:`importlib.find_loader`、:func:`importlib.util." -"set_package_wrapper`、:func:`importlib.util.set_loader_wrapper`、:func:" -"`importlib.util.module_for_loader`、:class:`pkgutil.ImpImporter` 和 :class:" -"`pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本(它們開始在" -"過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" -"issue:`43720` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1694 +#: ../../whatsnew/3.10.rst:1695 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 " -"``__repr__()`` method. Removal of the use of ``module_repr()`` is scheduled " -"for Python 3.12. (Contributed by Brett Cannon in :issue:`42137`.)" +"falling back on :meth:`!module_repr` for a module's ``__repr__()`` method. " +"Removal of the use of ``module_repr()`` is scheduled for Python 3.12. " +"(Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:" -"`~importlib.abc.Loader.module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 " -"Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:" -"`42137` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1700 +#: ../../whatsnew/3.10.rst:1701 msgid "" -":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." -"FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." +":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." +"FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." "module_repr` are deprecated and slated for removal in Python 3.12. " "(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" -":meth:`importlib.abc.Loader.module_repr`、:meth:`importlib.machinery." -"FrozenLoader.module_repr` 和 :meth:`importlib.machinery.BuiltinLoader." -"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" -"`42136` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1706 +#: ../../whatsnew/3.10.rst:1707 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, " @@ -2687,7 +2639,7 @@ msgstr "" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" "(由 Erlend E. Aasland 在 :issue:`42264` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1711 +#: ../../whatsnew/3.10.rst:1712 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2702,49 +2654,49 @@ msgstr "" "使用共享快取,請使用 ``cache=shared`` 查詢參數以 URI 模式打開資料庫。(由 " "Erlend E. Aasland 在 :issue:`24464` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1719 +#: ../../whatsnew/3.10.rst:1720 msgid "The following ``threading`` methods are now deprecated:" msgstr "以下 ``threading`` 方法現已棄用:" -#: ../../whatsnew/3.10.rst:1721 +#: ../../whatsnew/3.10.rst:1722 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1723 +#: ../../whatsnew/3.10.rst:1724 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1725 +#: ../../whatsnew/3.10.rst:1726 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1728 +#: ../../whatsnew/3.10.rst:1729 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1730 +#: ../../whatsnew/3.10.rst:1731 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1732 +#: ../../whatsnew/3.10.rst:1733 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1734 +#: ../../whatsnew/3.10.rst:1735 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1736 +#: ../../whatsnew/3.10.rst:1737 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1738 +#: ../../whatsnew/3.10.rst:1739 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "(由 Jelle Zijlstra 在 :gh:`87889` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1740 +#: ../../whatsnew/3.10.rst:1741 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 " @@ -2753,7 +2705,7 @@ msgstr "" ":meth:`pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :meth:" "`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1744 +#: ../../whatsnew/3.10.rst:1745 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" @@ -2761,7 +2713,7 @@ msgstr "" "``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" "`41139` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1747 +#: ../../whatsnew/3.10.rst:1748 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:" @@ -2769,7 +2721,7 @@ msgstr "" "自 Python 3.6、Python 3.7 或 OpenSSL 1.1.0 起,以下 :mod:`ssl` 功能已被棄用," "並將在 3.11 中刪除:" -#: ../../whatsnew/3.10.rst:1750 +#: ../../whatsnew/3.10.rst:1751 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 :" @@ -2781,7 +2733,7 @@ msgstr "" "data:`~ssl.OP_NO_TLSv1_3` 已被替換為 :attr:`sslSSLContext.minimum_version` " "和 :attr:`sslSSLContext.maximum_version`。" -#: ../../whatsnew/3.10.rst:1756 +#: ../../whatsnew/3.10.rst:1757 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2795,20 +2747,20 @@ msgstr "" "PROTOCOL_TLS` 已棄用,取而代之的是 :data:`~ssl.PROTOCOL_TLS_CLIENT` 和 :data:" "`~ssl.PROTOCOL_TLS_SERVER`" -#: ../../whatsnew/3.10.rst:1762 +#: ../../whatsnew/3.10.rst:1763 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr ":func:`~ssl.wrap_socket` 被替換為 :meth:`ssl.SSLContext.wrap_socket`" -#: ../../whatsnew/3.10.rst:1764 +#: ../../whatsnew/3.10.rst:1765 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1766 +#: ../../whatsnew/3.10.rst:1767 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1768 +#: ../../whatsnew/3.10.rst:1769 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." @@ -2816,7 +2768,7 @@ msgstr "" "NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." "SSLContext.set_npn_protocols` 已被 ALPN 取代。" -#: ../../whatsnew/3.10.rst:1771 +#: ../../whatsnew/3.10.rst:1772 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2827,7 +2779,7 @@ msgstr "" "將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 `。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1776 +#: ../../whatsnew/3.10.rst:1777 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2840,11 +2792,11 @@ msgstr "" "的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" "`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1785 ../../whatsnew/3.10.rst:2208 +#: ../../whatsnew/3.10.rst:1786 ../../whatsnew/3.10.rst:2209 msgid "Removed" msgstr "已刪除" -#: ../../whatsnew/3.10.rst:1787 +#: ../../whatsnew/3.10.rst:1788 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2856,7 +2808,7 @@ msgstr "" "``__rmod__`` 和 ``__rdivmod__`` 。它們都會引發 :exc:`TypeError`。(由 Serhiy " "Storchaka 在 :issue:`41974` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1793 +#: ../../whatsnew/3.10.rst:1794 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2869,7 +2821,7 @@ msgstr "" "``error()`` 實作已在 Python 3.5 中刪除。(由 Berker Peksag 在 :issue:`31844` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1799 +#: ../../whatsnew/3.10.rst:1800 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2880,7 +2832,7 @@ msgstr "" "私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" "issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1804 +#: ../../whatsnew/3.10.rst:1805 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 " @@ -2891,7 +2843,7 @@ msgstr "" "析器使用的所有 C 原始碼和標頭檔也已被刪除,包括 ``node.h``、``parser.h``、" "``graminit.h`` 和 ``grammar.h``。" -#: ../../whatsnew/3.10.rst:1809 +#: ../../whatsnew/3.10.rst:1810 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2903,7 +2855,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags`` 和 ``PyNode_Compile``,這些函式由於切換到新" "的 PEG 剖析器而在 3.9 中被棄用。" -#: ../../whatsnew/3.10.rst:1814 +#: ../../whatsnew/3.10.rst:1815 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 " @@ -2917,7 +2869,7 @@ msgstr "" "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" "(由 Dong-hee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1821 +#: ../../whatsnew/3.10.rst:1822 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. " @@ -2927,7 +2879,7 @@ msgstr "" "_warnings 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1825 +#: ../../whatsnew/3.10.rst:1826 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" @@ -2936,7 +2888,7 @@ msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1829 +#: ../../whatsnew/3.10.rst:1830 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -2945,11 +2897,11 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" -#: ../../whatsnew/3.10.rst:1833 +#: ../../whatsnew/3.10.rst:1834 msgid "This simplifies the high-level API." msgstr "這簡化了高階 API。" -#: ../../whatsnew/3.10.rst:1834 +#: ../../whatsnew/3.10.rst:1835 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 " @@ -2958,13 +2910,13 @@ msgstr "" "自 Python 3.7 以來,高階 API 中的函式一直隱式獲取當前執行緒正在運行的事件循" "環。在大多數正常用例中,不需要將事件循環傳遞給 API。" -#: ../../whatsnew/3.10.rst:1837 +#: ../../whatsnew/3.10.rst:1838 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "事件循環的傳遞很容易出錯,尤其是在處理在不同執行緒中運行的循環時。" -#: ../../whatsnew/3.10.rst:1840 +#: ../../whatsnew/3.10.rst:1841 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." @@ -2972,7 +2924,7 @@ msgstr "" "請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" "ref:`changes-python-api`。" -#: ../../whatsnew/3.10.rst:1843 ../../whatsnew/3.10.rst:1915 +#: ../../whatsnew/3.10.rst:1844 ../../whatsnew/3.10.rst:1916 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" @@ -2980,21 +2932,21 @@ msgstr "" "(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" "`42392` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1848 ../../whatsnew/3.10.rst:2135 +#: ../../whatsnew/3.10.rst:1849 ../../whatsnew/3.10.rst:2136 msgid "Porting to Python 3.10" msgstr "移植到 Python 3.10" -#: ../../whatsnew/3.10.rst:1850 +#: ../../whatsnew/3.10.rst:1851 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.10.rst:1855 +#: ../../whatsnew/3.10.rst:1856 msgid "Changes in the Python syntax" msgstr "Python 語法的變化" -#: ../../whatsnew/3.10.rst:1857 +#: ../../whatsnew/3.10.rst:1858 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -3008,11 +2960,11 @@ msgstr "" "要消除警告並使程式碼與未來版本相容,只需在數字字面值和以下關鍵字之間新增一個" "空格即可。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1868 +#: ../../whatsnew/3.10.rst:1869 msgid "Changes in the Python API" msgstr "Python API 的變化" -#: ../../whatsnew/3.10.rst:1870 +#: ../../whatsnew/3.10.rst:1871 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -3024,7 +2976,7 @@ msgstr "" "print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " "Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1876 +#: ../../whatsnew/3.10.rst:1877 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -3035,7 +2987,7 @@ msgstr "" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" "一個例外總是被默默地忽略。(由 Victor Stinner 在 :issue:`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1882 +#: ../../whatsnew/3.10.rst:1883 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -3055,7 +3007,7 @@ msgstr "" "可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" "(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1892 +#: ../../whatsnew/3.10.rst:1893 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -3067,7 +3019,7 @@ msgstr "" "是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1897 +#: ../../whatsnew/3.10.rst:1898 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -3076,21 +3028,21 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" -#: ../../whatsnew/3.10.rst:1901 +#: ../../whatsnew/3.10.rst:1902 msgid "A coroutine that currently looks like this::" msgstr "" "目前如下所示的協程:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1906 +#: ../../whatsnew/3.10.rst:1907 msgid "Should be replaced with this::" msgstr "" "應替換為:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1911 +#: ../../whatsnew/3.10.rst:1912 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 " @@ -3099,7 +3051,7 @@ msgstr "" "如果 ``foo()`` 被專門設計為 *不* 在當前執行緒的事件循環中運行(例如在另一個執" "行緒的事件循環中運行),請考慮改用 :func:`asyncio.run_coroutine_threadsafe`。" -#: ../../whatsnew/3.10.rst:1918 +#: ../../whatsnew/3.10.rst:1919 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -3115,11 +3067,11 @@ msgstr "" "function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承當前" "的內建物件。 (由 Victor Stinner 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1927 +#: ../../whatsnew/3.10.rst:1928 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1929 +#: ../../whatsnew/3.10.rst:1930 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -3132,7 +3084,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags``、``PyNode_Compile`` 和被這些函式使用的型別 " "``struct _node`` 被刪除。" -#: ../../whatsnew/3.10.rst:1935 +#: ../../whatsnew/3.10.rst:1936 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 " @@ -3142,11 +3094,11 @@ msgstr "" "件。然後可以(例如透過 :c:func:`PyEval_EvalCode`)為產生的程式碼物件求值 " "(evaluated)。" -#: ../../whatsnew/3.10.rst:1939 +#: ../../whatsnew/3.10.rst:1940 msgid "Specifically:" msgstr "具體來說:" -#: ../../whatsnew/3.10.rst:1941 +#: ../../whatsnew/3.10.rst:1942 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." @@ -3154,7 +3106,7 @@ msgstr "" "後跟有 ``PyNode_Compile`` 呼叫的 ``PyParser_SimpleParseStringFlags`` 呼叫,可" "以替換為呼叫 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1944 +#: ../../whatsnew/3.10.rst:1945 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 " @@ -3163,7 +3115,7 @@ msgstr "" "沒有 ``PyParser_SimpleParseFileFlags`` 的直接替代品。要從 ``FILE *`` 引數編譯" "程式碼,你需要用 C 讀取檔案並將結果緩衝區傳遞給 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1948 +#: ../../whatsnew/3.10.rst:1949 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` " @@ -3176,7 +3128,7 @@ msgstr "" "`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" "`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。):" -#: ../../whatsnew/3.10.rst:1961 +#: ../../whatsnew/3.10.rst:1962 msgid "" "For ``FrameObject`` objects, the ``f_lasti`` member now represents a " "wordcode offset instead of a simple offset into the bytecode string. This " @@ -3191,11 +3143,11 @@ msgstr "" "``FrameObject`` 物件的 ``f_lasti`` 成員不被認為是穩定的:請改用 :c:func:" "`PyFrame_GetLineNumber`。" -#: ../../whatsnew/3.10.rst:1969 +#: ../../whatsnew/3.10.rst:1970 msgid "CPython bytecode changes" msgstr "CPython 位元組碼更改" -#: ../../whatsnew/3.10.rst:1971 +#: ../../whatsnew/3.10.rst:1972 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 " @@ -3204,11 +3156,11 @@ msgstr "" "``MAKE_FUNCTION`` 指令現在接受字典或字串元組作為函式的註釋。(由 Yurii " "Karabas 和 Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1976 +#: ../../whatsnew/3.10.rst:1977 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.10.rst:1978 +#: ../../whatsnew/3.10.rst:1979 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`.)" @@ -3216,7 +3168,7 @@ msgstr "" ":pep:`644`:Python 現在需要 OpenSSL 1.1.1 或更高版本。不再支援 OpenSSL " "1.0.2。(由 Christian Heimes 在 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1982 +#: ../../whatsnew/3.10.rst:1983 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" @@ -3224,7 +3176,7 @@ msgstr "" "現在需要 C99 函式 :c:func:`snprintf` 和 :c:func:`vsnprintf` 來建置 Python。 " "(由 Victor Stinner 在 :issue:`36020` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1986 +#: ../../whatsnew/3.10.rst:1987 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" @@ -3232,7 +3184,7 @@ msgstr "" ":mod:`sqlite3` 需要 SQLite 3.7.15 或更新版本。(由 Sergey Fedoseev 和 Erlend " "E. Aasland 在 :issue:`40744` 和 :issue:`40810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1989 +#: ../../whatsnew/3.10.rst:1990 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" @@ -3240,7 +3192,7 @@ msgstr "" ":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" "`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1992 +#: ../../whatsnew/3.10.rst:1993 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " @@ -3250,7 +3202,7 @@ msgstr "" "不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" "issue:`27640` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1996 +#: ../../whatsnew/3.10.rst:1997 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 " @@ -3263,7 +3215,7 @@ msgstr "" "``setuptools`` 和 ``pip`` wheel 套件:如果兩者都存在,則使用這些 wheel 套件而" "不是 ensurepip 捆綁的 wheel 套件。" -#: ../../whatsnew/3.10.rst:2002 +#: ../../whatsnew/3.10.rst:2003 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -3274,11 +3226,11 @@ msgstr "" "share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." "_bundled`` 套件。" -#: ../../whatsnew/3.10.rst:2007 +#: ../../whatsnew/3.10.rst:2008 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "(由 Victor Stinner 在 :issue:`42856` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2009 +#: ../../whatsnew/3.10.rst:2010 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " @@ -3288,11 +3240,11 @@ msgstr "" "libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." "o`` 目標檔案。" -#: ../../whatsnew/3.10.rst:2013 +#: ../../whatsnew/3.10.rst:2014 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "(由 Victor Stinner 在 :issue:`43103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2015 +#: ../../whatsnew/3.10.rst:2016 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 " @@ -3305,7 +3257,7 @@ msgstr "" "includes`` 和 ``--with-tcltk-libs`` 配置選項顯式指定這些位置。(由 Manolis " "Stamatogiannakis 在 :issue:`42603` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2021 +#: ../../whatsnew/3.10.rst:2022 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -3317,15 +3269,15 @@ msgstr "" "openssl=/path/to/openssl --with-openssl-rpath=auto``。(由 Christian Heimes " "在 :issue:`43466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2028 +#: ../../whatsnew/3.10.rst:2029 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.10.rst:2031 +#: ../../whatsnew/3.10.rst:2032 msgid "PEP 652: Maintaining the Stable ABI" msgstr "PEP 652:維護穩定 ABI" -#: ../../whatsnew/3.10.rst:2033 +#: ../../whatsnew/3.10.rst:2034 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -3335,11 +3287,11 @@ msgstr "" "用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" "ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" -#: ../../whatsnew/3.10.rst:2038 +#: ../../whatsnew/3.10.rst:2039 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2043 +#: ../../whatsnew/3.10.rst:2044 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 " @@ -3349,7 +3301,7 @@ msgstr "" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2047 +#: ../../whatsnew/3.10.rst:2048 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 " @@ -3359,7 +3311,7 @@ msgstr "" "遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" "`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2052 +#: ../../whatsnew/3.10.rst:2053 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -3371,7 +3323,7 @@ msgstr "" "class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" "`30155` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2058 +#: ../../whatsnew/3.10.rst:2059 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -3379,7 +3331,7 @@ msgstr "" "新增 :c:func:`PyCodec_Unregister` 函式來取消註冊編解碼器搜索函式。(由 Hai " "Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2062 +#: ../../whatsnew/3.10.rst:2063 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " @@ -3388,7 +3340,7 @@ msgstr "" "新增了 :c:func:`PyIter_Send` 函式,以允許將值發送到疊代器中,而不會引發 " "``StopIteration`` 例外。(由 Vladimir Matveev 在 :issue:`41756` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2066 +#: ../../whatsnew/3.10.rst:2067 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" @@ -3396,7 +3348,7 @@ msgstr "" "將 :c:func:`PyUnicode_AsUTF8AndSize` 新增到受限 C API (limited C API) 中。" "(由 Alex Gaynor 在 :issue:`41784` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2069 +#: ../../whatsnew/3.10.rst:2070 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " @@ -3406,7 +3358,7 @@ msgstr "" "`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" "`1635741` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2074 +#: ../../whatsnew/3.10.rst:2075 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 " @@ -3415,7 +3367,7 @@ msgstr "" "新增 :c:func:`Py_NewRef` 和 :c:func:`Py_XNewRef` 函式來增加物件的參照計數並回" "傳物件。 (由 Victor Stinner 在 :issue:`42262` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2078 +#: ../../whatsnew/3.10.rst:2079 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " @@ -3425,7 +3377,7 @@ msgstr "" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2082 +#: ../../whatsnew/3.10.rst:2083 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" @@ -3433,7 +3385,7 @@ msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " "Hai Shi在 :issue:`41832` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2086 +#: ../../whatsnew/3.10.rst:2087 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" @@ -3441,7 +3393,7 @@ msgstr "" ":c:func:`PyType_GetSlot` 函式可以接受\\ :ref:`靜態型別 (static type) `。(由 Hai Shi 和 Petr Viktorin 在 :issue:`41073` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2090 +#: ../../whatsnew/3.10.rst:2091 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. " @@ -3450,7 +3402,7 @@ msgstr "" "向 C-API 新增 :c:func:`PySet_CheckExact` 函式,以檢查物件是否是 :class:`set` " "的實例而不是子型別的實例。(由 Pablo Galindo 在 :issue:`43277` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2094 +#: ../../whatsnew/3.10.rst:2095 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" @@ -3458,7 +3410,7 @@ msgstr "" "新增 :c:func:`PyErr_SetInterruptEx`,它允許傳遞信號編號來進行模擬。 (由 " "Antoine Pitrou 在 :issue:`43356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2098 +#: ../../whatsnew/3.10.rst:2099 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, " @@ -3478,7 +3430,7 @@ msgstr "" "C API 成為可能,因為自 Python 3.8 以來,:c:type:`PyObject` 結構在發布和除錯模" "式下是相同的(請參閱:issue:`36465`)。" -#: ../../whatsnew/3.10.rst:2108 +#: ../../whatsnew/3.10.rst:2109 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 :" @@ -3487,7 +3439,7 @@ msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2112 +#: ../../whatsnew/3.10.rst:2113 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:" @@ -3502,7 +3454,7 @@ msgstr "" "``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2119 +#: ../../whatsnew/3.10.rst:2120 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 " @@ -3513,7 +3465,7 @@ msgstr "" "`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" "用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" -#: ../../whatsnew/3.10.rst:2126 +#: ../../whatsnew/3.10.rst:2127 msgid "" "Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" @@ -3521,7 +3473,7 @@ msgstr "" "新增 :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實例。" "(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2130 +#: ../../whatsnew/3.10.rst:2131 msgid "" "Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " @@ -3531,7 +3483,7 @@ msgstr "" "設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 43908 號中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2137 +#: ../../whatsnew/3.10.rst:2138 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 ``#``: " @@ -3544,7 +3496,7 @@ msgstr "" "``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" "`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2143 +#: ../../whatsnew/3.10.rst:2144 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, " @@ -3556,11 +3508,11 @@ msgstr "" "new_refcnt)`` :參見 :c:func:`Py_SET_REFCNT()` (自 Python 3.9 起可用)。為了" "向後相容,可以使用該巨集:" -#: ../../whatsnew/3.10.rst:2152 +#: ../../whatsnew/3.10.rst:2153 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 在 :issue:`39573` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2154 +#: ../../whatsnew/3.10.rst:2155 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " @@ -3570,7 +3522,7 @@ msgstr "" "`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" "`40839` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2158 +#: ../../whatsnew/3.10.rst:2159 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -3582,7 +3534,7 @@ msgstr "" "分配沒有初始資料的 Unicode 物件。(由 Inada Naoki 在 :issue:`36346` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2163 +#: ../../whatsnew/3.10.rst:2164 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " @@ -3591,7 +3543,7 @@ msgstr "" "PyCapsule API ``unicodedata.ucnhash_CAPI`` 的私有 ``_PyUnicode_Name_CAPI`` 結" "構已移至內部 C API。(由 Victor Stinner 在 :issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2167 +#: ../../whatsnew/3.10.rst:2168 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -3606,7 +3558,7 @@ msgstr "" "`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來獲" "取 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2174 +#: ../../whatsnew/3.10.rst:2175 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 " @@ -3621,7 +3573,7 @@ msgstr "" "現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" "類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2181 +#: ../../whatsnew/3.10.rst:2182 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -3637,7 +3589,7 @@ msgstr "" "``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" "引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2189 +#: ../../whatsnew/3.10.rst:2190 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 " @@ -3650,7 +3602,7 @@ msgstr "" "了 :c:data:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " "Aasland 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2195 +#: ../../whatsnew/3.10.rst:2196 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " @@ -3659,7 +3611,7 @@ msgstr "" "未以說明文件記錄的函式 ``Py_FrozenMain`` 已從受限 API 中刪除。該函式主要用於 " "Python 的自定義建置。(由 Petr Viktorin 在 :issue:`26241` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2202 +#: ../../whatsnew/3.10.rst:2203 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " @@ -3669,7 +3621,7 @@ msgstr "" "用 :c:func:`PyUnicode_InternInPlace`。(由 Victor Stinner 在 :issue:`41692` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2210 +#: ../../whatsnew/3.10.rst:2211 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" @@ -3677,7 +3629,7 @@ msgstr "" "刪除了操作 ``Py_UNICODE*`` 字串的 ``Py_UNICODE_str*`` 函式。(由 Inada Naoki " "在 :issue:`41123` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2213 +#: ../../whatsnew/3.10.rst:2214 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" @@ -3685,7 +3637,7 @@ msgstr "" "``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" "`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.10.rst:2215 +#: ../../whatsnew/3.10.rst:2216 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" @@ -3693,7 +3645,7 @@ msgstr "" "``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_FromFormat`" -#: ../../whatsnew/3.10.rst:2217 +#: ../../whatsnew/3.10.rst:2218 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" @@ -3701,15 +3653,15 @@ msgstr "" "``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" "`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.10.rst:2219 +#: ../../whatsnew/3.10.rst:2220 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "``Py_UNICODE_strcmp``:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.10.rst:2220 +#: ../../whatsnew/3.10.rst:2221 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.10.rst:2221 +#: ../../whatsnew/3.10.rst:2222 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" @@ -3717,7 +3669,7 @@ msgstr "" "``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" "`PyUnicode_FindChar`" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2225 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" @@ -3725,7 +3677,7 @@ msgstr "" "刪除了 ``PyUnicode_GetMax()``。請改用新的 (:pep:`393`) API。(由 Inada Naoki " "在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2227 +#: ../../whatsnew/3.10.rst:2228 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" @@ -3733,7 +3685,7 @@ msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2230 +#: ../../whatsnew/3.10.rst:2231 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " @@ -3743,7 +3695,7 @@ msgstr "" "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2234 +#: ../../whatsnew/3.10.rst:2235 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " @@ -3753,7 +3705,7 @@ msgstr "" "結構的 ``ceval.recursion_limit`` 取代。(由 Victor Stinner 在 :issue:`41834` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2238 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -3764,7 +3716,7 @@ msgstr "" "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " "``recursion_ritic`` 欄位。(由 Serhiy Storchaka 在 :issue:`41936` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2243 +#: ../../whatsnew/3.10.rst:2244 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." @@ -3774,7 +3726,7 @@ msgstr "" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" "(由 Victor Stinner 在 :issue:`41713` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2248 +#: ../../whatsnew/3.10.rst:2249 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 " @@ -3785,35 +3737,35 @@ msgstr "" "(``mod_ty`` 類型)。該函式已被排除在受限 C API 之外 (:pep:`384`)。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2253 +#: ../../whatsnew/3.10.rst:2254 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "刪除 ``symtable.h`` 標頭檔和未被說明文件記錄的函式:" -#: ../../whatsnew/3.10.rst:2255 +#: ../../whatsnew/3.10.rst:2256 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2256 +#: ../../whatsnew/3.10.rst:2257 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2257 +#: ../../whatsnew/3.10.rst:2258 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2259 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2259 +#: ../../whatsnew/3.10.rst:2260 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2261 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2263 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 " @@ -3822,7 +3774,7 @@ msgstr "" "``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." "h`` 標頭檔被排除在受限 C API 之外而無法使用。" -#: ../../whatsnew/3.10.rst:2266 +#: ../../whatsnew/3.10.rst:2267 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" @@ -3830,7 +3782,7 @@ msgstr "" "請改用 Python :mod:`symtable` 模組。(由 Victor Stinner 在 :issue:`43244` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2269 +#: ../../whatsnew/3.10.rst:2270 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3841,7 +3793,7 @@ msgstr "" "刪除 :c:func:`PyOS_ReadlineFunctionPointer`。由於該函式採用 FILE* 引數,因此" "無法保證其 ABI 穩定性。(由 Petr Viktorin 在 :issue:`43868` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2275 +#: ../../whatsnew/3.10.rst:2276 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 " @@ -3857,54 +3809,54 @@ msgstr "" "Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" "`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2283 +#: ../../whatsnew/3.10.rst:2284 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" "刪除編譯器和使用 ``struct _mod`` 的剖析器函式,因為公開 AST C API 已被刪除:" -#: ../../whatsnew/3.10.rst:2286 +#: ../../whatsnew/3.10.rst:2287 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2287 +#: ../../whatsnew/3.10.rst:2288 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2288 +#: ../../whatsnew/3.10.rst:2289 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2290 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2290 +#: ../../whatsnew/3.10.rst:2291 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2292 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2293 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2294 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2295 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2296 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2298 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" @@ -3912,27 +3864,27 @@ msgstr "" "這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" "issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2301 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "刪除包含以下函式的 ``pyarena.h`` 標頭檔:" -#: ../../whatsnew/3.10.rst:2302 +#: ../../whatsnew/3.10.rst:2303 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2304 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2304 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2308 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" @@ -3941,10 +3893,142 @@ msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2311 +#: ../../whatsnew/3.10.rst:2312 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" msgstr "" "為了 Python 最佳化,已刪除 ``PyThreadState.use_tracing`` 成員。(由 Mark " "Shannon 在 :issue:`43760` 中貢獻。)" + +#~ msgid "" +#~ "Starting in this release, there will be a concerted effort to begin " +#~ "cleaning up old import semantics that were kept for Python 2.7 " +#~ "compatibility. Specifically, :meth:`~importlib.abc.PathEntryFinder." +#~ "find_loader`/:meth:`~importlib.abc.Finder.find_module` (superseded by :" +#~ "meth:`~importlib.abc.Finder.find_spec`), :meth:`~importlib.abc.Loader." +#~ "load_module` (superseded by :meth:`~importlib.abc.Loader.exec_module`), :" +#~ "meth:`~importlib.abc.Loader.module_repr` (which the import system takes " +#~ "care of for you), the ``__package__`` attribute (superseded by ``__spec__." +#~ "parent``), the ``__loader__`` attribute (superseded by ``__spec__." +#~ "loader``), and the ``__cached__`` attribute (superseded by ``__spec__." +#~ "cached``) will slowly be removed (as well as other classes and methods " +#~ "in :mod:`importlib`). :exc:`ImportWarning` and/or :exc:" +#~ "`DeprecationWarning` will be raised as appropriate to help identify code " +#~ "which needs updating during this transition." +#~ msgstr "" +#~ "從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語" +#~ "義。具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" +#~ "`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." +#~ "find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" +#~ "`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." +#~ "module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." +#~ "parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " +#~ "``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" +#~ "`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :" +#~ "exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" + +#~ msgid "" +#~ "The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" +#~ "`importlib.abc.PathEntryFinder.find_module` by the import system now " +#~ "trigger an :exc:`ImportWarning` as :meth:`importlib.abc.MetaPathFinder." +#~ "find_spec` and :meth:`importlib.abc.PathEntryFinder.find_spec` are " +#~ "preferred, respectively. You can use :func:`importlib.util." +#~ "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :" +#~ "issue:`42134`.)" +#~ msgstr "" +#~ "引入系統使用 :meth:`importlib.abc.MetaPathFinder.find_module` 和 :meth:" +#~ "`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:" +#~ "`ImportWarning` 作為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :" +#~ "meth:`importlib.abc.PathEntryFinder.find_spec` 分別是首選。你可以使用 :" +#~ "func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :" +#~ "issue:`42134` 中貢獻。)" + +#~ msgid "" +#~ "The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the " +#~ "import system now triggers an :exc:`ImportWarning` as :meth:`importlib." +#~ "abc.PathEntryFinder.find_spec` is preferred. You can use :func:`importlib." +#~ "util.spec_from_loader` to help in porting. (Contributed by Brett Cannon " +#~ "in :issue:`43672`.)" +#~ msgstr "" +#~ "引入系統使用 :meth:`importlib.abc.PathEntryFinder.find_loader` 現在會觸" +#~ "發 :exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder." +#~ "find_spec` 是首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫" +#~ "助移植。(由 Brett Cannon 在 :issue:`43672` 中貢獻。)" + +#~ msgid "" +#~ "The various implementations of :meth:`importlib.abc.MetaPathFinder." +#~ "find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" +#~ "meth:`importlib.machinery.FrozenImporter.find_module`, :meth:`importlib." +#~ "machinery.WindowsRegistryFinder.find_module`, :meth:`importlib.machinery." +#~ "PathFinder.find_module`, :meth:`importlib.abc.MetaPathFinder." +#~ "find_module` ), :meth:`importlib.abc.PathEntryFinder.find_module` ( :meth:" +#~ "`importlib.machinery.FileFinder.find_module` ), and :meth:`importlib.abc." +#~ "PathEntryFinder.find_loader` ( :meth:`importlib.machinery.FileFinder." +#~ "find_loader` ) now raise :exc:`DeprecationWarning` and are slated for " +#~ "removal in Python 3.12 (previously they were documented as deprecated in " +#~ "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" +#~ msgstr "" +#~ ":meth:`importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" +#~ "`importlib.machinery.BuiltinImporter.find_module`、:meth:`importlib." +#~ "machinery.FrozenImporter.find_module`、:meth:`importlib.machinery." +#~ "WindowsRegistryFinder.find_module`、:meth:`importlib.machinery.PathFinder." +#~ "find_module`、:meth:`importlib.abc.MetaPathFinder.find_module` )、:meth:" +#~ "`importlib.abc.PathEntryFinder.find_module` (:meth:`importlib.machinery." +#~ "FileFinder.find_module` ) 和 :meth:`importlib.abc.PathEntryFinder." +#~ "find_loader` (:meth:`importlib.machinery.FileFinder.find_loader` ) 現在引" +#~ "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " +#~ "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢" +#~ "獻。)" + +#~ msgid "" +#~ ":class:`importlib.abc.Finder` is deprecated (including its sole method, :" +#~ "meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." +#~ "MetaPathFinder` and :class:`importlib.abc.PathEntryFinder` no longer " +#~ "inherit from the class. Users should inherit from one of these two " +#~ "classes as appropriate instead. (Contributed by Brett Cannon in :issue:" +#~ "`42135`.)" +#~ msgstr "" +#~ ":class:`importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`~importlib." +#~ "abc.Finder.find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :" +#~ "class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需" +#~ "求來選擇其一以繼承。 (由 Brett Cannon 在 :issue:`42135` 中貢獻。)" + +#~ msgid "" +#~ "The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" +#~ "`importlib.util.set_package_wrapper`, :func:`importlib.util." +#~ "set_loader_wrapper`, :func:`importlib.util.module_for_loader`, :class:" +#~ "`pkgutil.ImpImporter`, and :class:`pkgutil.ImpLoader` have all been " +#~ "updated to list Python 3.12 as the slated version of removal (they began " +#~ "raising :exc:`DeprecationWarning` in previous versions of Python). " +#~ "(Contributed by Brett Cannon in :issue:`43720`.)" +#~ msgstr "" +#~ "棄用 :mod:`imp`、:func:`importlib.find_loader`、:func:`importlib.util." +#~ "set_package_wrapper`、:func:`importlib.util.set_loader_wrapper`、:func:" +#~ "`importlib.util.module_for_loader`、:class:`pkgutil.ImpImporter` 和 :" +#~ "class:`pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本" +#~ "(它們開始在過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 " +#~ "Brett Cannon 在 :issue:`43720` 中貢獻。)" + +#~ 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 " +#~ "``__repr__()`` method. Removal of the use of ``module_repr()`` is " +#~ "scheduled for Python 3.12. (Contributed by Brett Cannon in :issue:" +#~ "`42137`.)" +#~ msgstr "" +#~ "引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:" +#~ "`~importlib.abc.Loader.module_repr` 作為模組的 ``__repr__()`` 方法。計劃" +#~ "在 Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :" +#~ "issue:`42137` 中貢獻。)" + +#~ msgid "" +#~ ":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." +#~ "FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." +#~ "module_repr` are deprecated and slated for removal in Python 3.12. " +#~ "(Contributed by Brett Cannon in :issue:`42136`.)" +#~ msgstr "" +#~ ":meth:`importlib.abc.Loader.module_repr`、:meth:`importlib.machinery." +#~ "FrozenLoader.module_repr` 和 :meth:`importlib.machinery.BuiltinLoader." +#~ "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :" +#~ "issue:`42136` 中貢獻。)" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 84aa17826e..94ed447578 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-28 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,44 +23,28 @@ msgstr "" msgid "What's New In Python 3.11" msgstr "Python 3.11 有什麼新功能" -#: ../../whatsnew/3.11.rst:0 -msgid "Release" -msgstr "發行版本" - -#: ../../whatsnew/3.11.rst:5 -msgid "|release|" -msgstr "|release|" - -#: ../../whatsnew/3.11.rst:0 -msgid "Date" -msgstr "日期" - -#: ../../whatsnew/3.11.rst:6 -msgid "|today|" -msgstr "|today|" - #: ../../whatsnew/3.11.rst:0 msgid "Editor" msgstr "編輯者" -#: ../../whatsnew/3.11.rst:7 +#: ../../whatsnew/3.11.rst:5 msgid "Pablo Galindo Salgado" msgstr "Pablo Galindo Salgado" -#: ../../whatsnew/3.11.rst:49 +#: ../../whatsnew/3.11.rst:47 msgid "" "This article explains the new features in Python 3.11, compared to 3.10." msgstr "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。" -#: ../../whatsnew/3.11.rst:51 +#: ../../whatsnew/3.11.rst:49 msgid "For full details, see the :ref:`changelog `." msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" -#: ../../whatsnew/3.11.rst:57 +#: ../../whatsnew/3.11.rst:55 msgid "Summary -- Release highlights" msgstr "發布重點摘要" -#: ../../whatsnew/3.11.rst:62 +#: ../../whatsnew/3.11.rst:60 msgid "" "Python 3.11 is between 10-60% faster than Python 3.10. On average, we " "measured a 1.25x speedup on the standard benchmark suite. See :ref:" @@ -70,27 +54,27 @@ msgstr "" "(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-" "cpython`。" -#: ../../whatsnew/3.11.rst:68 +#: ../../whatsnew/3.11.rst:66 msgid "New syntax features:" msgstr "新增語法特性:" -#: ../../whatsnew/3.11.rst:70 +#: ../../whatsnew/3.11.rst:68 msgid ":ref:`whatsnew311-pep654`" msgstr ":ref:`whatsnew311-pep654`" -#: ../../whatsnew/3.11.rst:72 +#: ../../whatsnew/3.11.rst:70 msgid "New built-in features:" msgstr "新增內建特性:" -#: ../../whatsnew/3.11.rst:74 +#: ../../whatsnew/3.11.rst:72 msgid ":ref:`whatsnew311-pep678`" msgstr ":ref:`whatsnew311-pep678`" -#: ../../whatsnew/3.11.rst:76 +#: ../../whatsnew/3.11.rst:74 msgid "New standard library modules:" msgstr "新增標準函式庫模組:" -#: ../../whatsnew/3.11.rst:78 +#: ../../whatsnew/3.11.rst:76 msgid "" ":pep:`680`: :mod:`tomllib` — Support for parsing `TOML `_ " "in the Standard Library" @@ -98,15 +82,15 @@ msgstr "" ":pep:`680`:\\ :mod:`tomllib` — 在標準函式庫中支援 `TOML `_ 檔案的剖析" -#: ../../whatsnew/3.11.rst:81 +#: ../../whatsnew/3.11.rst:79 msgid "Interpreter improvements:" msgstr "直譯器的改進:" -#: ../../whatsnew/3.11.rst:83 +#: ../../whatsnew/3.11.rst:81 msgid ":ref:`whatsnew311-pep657`" msgstr ":ref:`whatsnew311-pep657`" -#: ../../whatsnew/3.11.rst:84 +#: ../../whatsnew/3.11.rst:82 msgid "" "New :option:`-P` command line option and :envvar:`PYTHONSAFEPATH` " "environment variable to :ref:`disable automatically prepending potentially " @@ -116,35 +100,35 @@ msgstr "" "於 :data:`sys.path` 的開頭\\ :ref:`加上一個有潛在安全問題的路徑 `" -#: ../../whatsnew/3.11.rst:88 +#: ../../whatsnew/3.11.rst:86 msgid "New typing features:" msgstr "新增型別特性:" -#: ../../whatsnew/3.11.rst:90 +#: ../../whatsnew/3.11.rst:88 msgid ":ref:`whatsnew311-pep646`" msgstr ":ref:`whatsnew311-pep646`" -#: ../../whatsnew/3.11.rst:91 +#: ../../whatsnew/3.11.rst:89 msgid ":ref:`whatsnew311-pep655`" msgstr ":ref:`whatsnew311-pep655`" -#: ../../whatsnew/3.11.rst:92 +#: ../../whatsnew/3.11.rst:90 msgid ":ref:`whatsnew311-pep673`" msgstr ":ref:`whatsnew311-pep673`" -#: ../../whatsnew/3.11.rst:93 +#: ../../whatsnew/3.11.rst:91 msgid ":ref:`whatsnew311-pep675`" msgstr ":ref:`whatsnew311-pep675`" -#: ../../whatsnew/3.11.rst:94 +#: ../../whatsnew/3.11.rst:92 msgid ":ref:`whatsnew311-pep681`" msgstr ":ref:`whatsnew311-pep681`" -#: ../../whatsnew/3.11.rst:96 +#: ../../whatsnew/3.11.rst:94 msgid "Important deprecations, removals and restrictions:" msgstr "重要的棄用、移除與限制:" -#: ../../whatsnew/3.11.rst:98 +#: ../../whatsnew/3.11.rst:96 msgid "" ":pep:`594`: :ref:`Many legacy standard library modules have been deprecated " "` and will be removed in Python 3.13" @@ -152,28 +136,28 @@ msgstr "" ":pep:`594`:\\ :ref:`許多標準函式庫中的遺留模組已被棄用 `\\ 且將於 Python 3.13 移除" -#: ../../whatsnew/3.11.rst:101 +#: ../../whatsnew/3.11.rst:99 msgid "" ":pep:`624`: :ref:`Py_UNICODE encoder APIs have been removed `" msgstr "" ":pep:`624`:\\ :ref:`Py_UNICODE 編碼器 API 已被移除 `" -#: ../../whatsnew/3.11.rst:103 +#: ../../whatsnew/3.11.rst:101 msgid "" ":pep:`670`: :ref:`Macros converted to static inline functions `" msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2195 +#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2193 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.11.rst:115 +#: ../../whatsnew/3.11.rst:113 msgid "PEP 657: Fine-grained error locations in tracebacks" msgstr "PEP 657:回溯 (traceback) 中更細緻的錯誤位置" -#: ../../whatsnew/3.11.rst:117 +#: ../../whatsnew/3.11.rst:115 msgid "" "When printing tracebacks, the interpreter will now point to the exact " "expression that caused the error, instead of just the line. For example:" @@ -181,7 +165,7 @@ msgstr "" "當要印出回溯,直譯器現在會指出造成錯誤的確切運算式,而非只說明是哪一行。例" "如:" -#: ../../whatsnew/3.11.rst:131 +#: ../../whatsnew/3.11.rst:129 msgid "" "Previous versions of the interpreter would point to just the line, making it " "ambiguous which object was ``None``. These enhanced errors can also be " @@ -191,11 +175,11 @@ msgstr "" "前一版本的直譯器只會標明是哪一行,無法辨認哪一個物件是 ``None``。當處理多層的" "巢狀 :class:`dict` 物件和多個函式呼叫時,這種強化錯誤提示也可能非常有用:" -#: ../../whatsnew/3.11.rst:151 +#: ../../whatsnew/3.11.rst:149 msgid "As well as complex arithmetic expressions:" msgstr "在複雜的計算運算式中也是:" -#: ../../whatsnew/3.11.rst:161 +#: ../../whatsnew/3.11.rst:159 msgid "" "Additionally, the information used by the enhanced traceback feature is made " "available via a general API, that can be used to correlate :term:`bytecode` :" @@ -206,15 +190,15 @@ msgstr "" "`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互關聯。此項" "資訊可以用以下方式取得:" -#: ../../whatsnew/3.11.rst:166 +#: ../../whatsnew/3.11.rst:164 msgid "The :meth:`codeobject.co_positions` method in Python." msgstr "Python 中的 :meth:`codeobject.co_positions` 方法。" -#: ../../whatsnew/3.11.rst:167 +#: ../../whatsnew/3.11.rst:165 msgid "The :c:func:`PyCode_Addr2Location` function in the C API." msgstr "C API 中的 :c:func:`PyCode_Addr2Location` 函式。" -#: ../../whatsnew/3.11.rst:169 +#: ../../whatsnew/3.11.rst:167 msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" @@ -222,7 +206,7 @@ msgstr "" "詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :" "issue:`43950` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:173 +#: ../../whatsnew/3.11.rst:171 msgid "" "This feature requires storing column positions in :ref:`codeobjects`, which " "may result in a small increase in interpreter memory usage and disk usage " @@ -236,11 +220,11 @@ msgstr "" "多餘的資訊且停用印出多餘的回溯資訊,請用 :option:`-X no_debug_ranges <-X>` 命" "令列選項或是 :envvar:`PYTHONNODEBUGRANGES` 環境變數。" -#: ../../whatsnew/3.11.rst:185 +#: ../../whatsnew/3.11.rst:183 msgid "PEP 654: Exception Groups and ``except*``" msgstr "PEP 654:例外群組與 ``except*``" -#: ../../whatsnew/3.11.rst:187 +#: ../../whatsnew/3.11.rst:185 msgid "" ":pep:`654` introduces language features that enable a program to raise and " "handle multiple unrelated exceptions simultaneously. The builtin types :exc:" @@ -254,11 +238,11 @@ msgstr "" "外組成群組並同時引發,新的 :keyword:`except* ` 語法也將 :" "keyword:`except` 泛用化、能夠比對例外群組的子群組。" -#: ../../whatsnew/3.11.rst:194 +#: ../../whatsnew/3.11.rst:192 msgid "See :pep:`654` for more details." msgstr "詳情請見 :pep:`654`。" -#: ../../whatsnew/3.11.rst:196 +#: ../../whatsnew/3.11.rst:194 msgid "" "(Contributed by Irit Katriel in :issue:`45292`. PEP written by Irit Katriel, " "Yury Selivanov and Guido van Rossum.)" @@ -266,11 +250,11 @@ msgstr "" "(由 Irit Katriel 於 :issue:`45292` 中所貢獻。PEP 由 Irit Katriel、Yury " "Selivanov 與 Guido van Rossum 撰寫。)" -#: ../../whatsnew/3.11.rst:203 +#: ../../whatsnew/3.11.rst:201 msgid "PEP 678: Exceptions can be enriched with notes" msgstr "PEP 678:運用例外註解使其更加詳盡" -#: ../../whatsnew/3.11.rst:205 +#: ../../whatsnew/3.11.rst:203 msgid "" "The :meth:`~BaseException.add_note` method is added to :exc:`BaseException`. " "It can be used to enrich exceptions with context information that is not " @@ -281,11 +265,11 @@ msgstr "" "訊在例外被引發時無法被取得,這個方法就可以用來為例外添加更多資訊。被添加的註" "解會在預設回溯中出現。" -#: ../../whatsnew/3.11.rst:210 +#: ../../whatsnew/3.11.rst:208 msgid "See :pep:`678` for more details." msgstr "詳情請見 :pep:`678`。" -#: ../../whatsnew/3.11.rst:212 +#: ../../whatsnew/3.11.rst:210 msgid "" "(Contributed by Irit Katriel in :issue:`45607`. PEP written by Zac Hatfield-" "Dodds.)" @@ -293,11 +277,11 @@ msgstr "" "(由 Irit Katriel 於 :issue:`45607` 中所貢獻。PEP 由 Zac Hatfield-Dodds 所撰" "寫)" -#: ../../whatsnew/3.11.rst:219 +#: ../../whatsnew/3.11.rst:217 msgid "Windows ``py.exe`` launcher improvements" msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" -#: ../../whatsnew/3.11.rst:221 +#: ../../whatsnew/3.11.rst:219 msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " "significantly updated. It now supports company/tag syntax as defined in :pep:" @@ -310,7 +294,7 @@ msgstr "" "限的 ``-.``。這允許了 `python.org `_ 上" "的 ``PythonCore`` 以外的發行版本發布。" -#: ../../whatsnew/3.11.rst:227 +#: ../../whatsnew/3.11.rst:225 msgid "" "When using ``-V:`` selectors, either company or tag can be omitted, but all " "installs will be searched. For example, ``-V:OtherPython/`` will select the " @@ -321,7 +305,7 @@ msgstr "" "OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 " "``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" -#: ../../whatsnew/3.11.rst:232 +#: ../../whatsnew/3.11.rst:230 msgid "" "When using the legacy ``-``, ``-.``, ``--" "`` or ``-.-`` arguments, all existing " @@ -339,11 +323,11 @@ msgstr "" "式會在檢查運行程式之標籤是否帶有 ``-32`` 後綴時被偵測出來。所有 Python 3.5 以" "後發布版本的 32-bit 建置中都有這個行為。" -#: ../../whatsnew/3.11.rst:246 +#: ../../whatsnew/3.11.rst:244 msgid "New Features Related to Type Hints" msgstr "型別提示相關的新特性" -#: ../../whatsnew/3.11.rst:248 +#: ../../whatsnew/3.11.rst:246 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." @@ -351,11 +335,11 @@ msgstr "" "這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大" "變更。" -#: ../../whatsnew/3.11.rst:255 +#: ../../whatsnew/3.11.rst:253 msgid "PEP 646: Variadic generics" msgstr "PEP 646:可變參數泛型 (variadic generics)" -#: ../../whatsnew/3.11.rst:257 +#: ../../whatsnew/3.11.rst:255 msgid "" ":pep:`484` previously introduced :data:`~typing.TypeVar`, enabling creation " "of generics parameterised with a single type. :pep:`646` adds :data:`~typing." @@ -368,7 +352,7 @@ msgstr "" "型別的參數化 (parameterisation)。換句話說,:data:`~typing.TypeVarTuple` 是\\ " "*可變的*\\ 型別變數,啟用了\\ *可變的*\\ 泛型。" -#: ../../whatsnew/3.11.rst:264 +#: ../../whatsnew/3.11.rst:262 msgid "" "This enables a wide variety of use cases. In particular, it allows the type " "of array-like structures in numerical computing libraries such as NumPy and " @@ -380,11 +364,11 @@ msgstr "" "類似陣列結構的型別可用 *shape* 陣列來被參數化。靜態型別檢查工具現在也能夠為使" "用這些函式庫的程式捕捉到維度相關的錯誤。" -#: ../../whatsnew/3.11.rst:270 +#: ../../whatsnew/3.11.rst:268 msgid "See :pep:`646` for more details." msgstr "詳情請見 :pep:`646`。" -#: ../../whatsnew/3.11.rst:272 +#: ../../whatsnew/3.11.rst:270 msgid "" "(Contributed by Matthew Rahtz in :issue:`43224`, with contributions by " "Serhiy Storchaka and Jelle Zijlstra. PEP written by Mark Mendoza, Matthew " @@ -394,12 +378,12 @@ msgstr "" "Zijlstra 協助。PEP 由 Mark Mendoza、Matthew Rahtz、Pradeep Kumar Srinivasan " "與 Vincent Siles 所撰寫)" -#: ../../whatsnew/3.11.rst:280 +#: ../../whatsnew/3.11.rst:278 msgid "" "PEP 655: Marking individual ``TypedDict`` items as required or not-required" msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要" -#: ../../whatsnew/3.11.rst:282 +#: ../../whatsnew/3.11.rst:280 msgid "" ":data:`~typing.Required` and :data:`~typing.NotRequired` provide a " "straightforward way to mark whether individual items in a :class:`~typing." @@ -410,7 +394,7 @@ msgstr "" "目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透" "過繼承才有可能做得到。" -#: ../../whatsnew/3.11.rst:287 +#: ../../whatsnew/3.11.rst:285 msgid "" "All fields are still required by default, unless the *total* parameter is " "set to ``False``, in which case all fields are still not-required by " @@ -421,18 +405,18 @@ msgstr "" "會是非必要的。例如,這個範例指定了要有一個必要鍵與一個非必要鍵的 :class:`!" "TypedDict`:" -#: ../../whatsnew/3.11.rst:301 +#: ../../whatsnew/3.11.rst:299 msgid "The following definition is equivalent::" msgstr "" "以下定義等同於:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:307 +#: ../../whatsnew/3.11.rst:305 msgid "See :pep:`655` for more details." msgstr "詳情請見 :pep:`655`。" -#: ../../whatsnew/3.11.rst:309 +#: ../../whatsnew/3.11.rst:307 msgid "" "(Contributed by David Foster and Jelle Zijlstra in :issue:`47087`. PEP " "written by David Foster.)" @@ -440,11 +424,11 @@ msgstr "" "(由 David Foster 與 Jelle Zijlstra 於 :issue:`47087` 中所貢獻。PEP 由 David " "Foster 所撰寫)" -#: ../../whatsnew/3.11.rst:316 +#: ../../whatsnew/3.11.rst:314 msgid "PEP 673: ``Self`` type" msgstr "PEP 673:``Self`` 型別" -#: ../../whatsnew/3.11.rst:318 +#: ../../whatsnew/3.11.rst:316 msgid "" "The new :data:`~typing.Self` annotation provides a simple and intuitive way " "to annotate methods that return an instance of their class. This behaves the " @@ -456,7 +440,7 @@ msgstr "" "實例的方法。這與 :pep:`PEP 484 <484#annotating-instance-and-class-methods>` " "中指定的基於 :class:`~typing.TypeVar` 的方法相同,但更簡潔且更易於遵循。" -#: ../../whatsnew/3.11.rst:324 +#: ../../whatsnew/3.11.rst:322 msgid "" "Common use cases include alternative constructors provided as :func:" "`classmethod `\\s, and :meth:`~object.__enter__` methods that " @@ -467,7 +451,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:342 +#: ../../whatsnew/3.11.rst:340 msgid "" ":data:`~typing.Self` can also be used to annotate method parameters or " "attributes of the same type as their enclosing class." @@ -475,11 +459,11 @@ msgstr "" ":data:`~typing.Self` 也可用於標註與其封閉類類別 (enclosing class) 相同的方法" "參數或屬性。" -#: ../../whatsnew/3.11.rst:345 +#: ../../whatsnew/3.11.rst:343 msgid "See :pep:`673` for more details." msgstr "詳情請見 :pep:`673`。" -#: ../../whatsnew/3.11.rst:347 +#: ../../whatsnew/3.11.rst:345 msgid "" "(Contributed by James Hilton-Balfe in :issue:`46534`. PEP written by Pradeep " "Kumar Srinivasan and James Hilton-Balfe.)" @@ -487,11 +471,11 @@ msgstr "" "(由 James Hilton-Balfe 於 :issue:`46534` 中所貢獻。PEP 由 Pradeep Kumar " "Srinivasan 與 James Hilton-Balfe 所撰寫)" -#: ../../whatsnew/3.11.rst:354 +#: ../../whatsnew/3.11.rst:352 msgid "PEP 675: Arbitrary literal string type" msgstr "PEP 675:任意的文本字串型別 (Arbitrary literal string type)" -#: ../../whatsnew/3.11.rst:356 +#: ../../whatsnew/3.11.rst:354 msgid "" "The new :data:`~typing.LiteralString` annotation may be used to indicate " "that a function parameter can be of any literal string type. This allows a " @@ -506,18 +490,18 @@ msgstr "" "字串創建的字串。型別檢查器就可以強制需審慎處理的函式(例如會執行 SQL 陳述式" "或 shell 命令的函式)僅會以靜態引數呼叫,從而提供針對注入攻擊的保護。" -#: ../../whatsnew/3.11.rst:364 +#: ../../whatsnew/3.11.rst:362 msgid "For example, a SQL query function could be annotated as follows::" msgstr "" "例如一個 SQL 查詢函式 (query function) 可以被標註為:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:382 +#: ../../whatsnew/3.11.rst:380 msgid "See :pep:`675` for more details." msgstr "詳情請見 :pep:`675`。" -#: ../../whatsnew/3.11.rst:384 +#: ../../whatsnew/3.11.rst:382 msgid "" "(Contributed by Jelle Zijlstra in :issue:`47088`. PEP written by Pradeep " "Kumar Srinivasan and Graham Bleaney.)" @@ -525,11 +509,11 @@ msgstr "" "(由 Jelle Zijlstra 於 :issue:`47088` 中所貢獻。PEP 由 Pradeep Kumar " "Srinivasan 與 Graham Bleaney 所撰寫)" -#: ../../whatsnew/3.11.rst:391 +#: ../../whatsnew/3.11.rst:389 msgid "PEP 681: Data class transforms" msgstr "PEP 681:資料類別轉換 (Data class transforms)" -#: ../../whatsnew/3.11.rst:393 +#: ../../whatsnew/3.11.rst:391 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -542,18 +526,18 @@ msgstr "" "會讓一個靜態型別檢查器知道被裝飾物件會在運行程式做出轉換類別的「魔法」,賦予" "其類似 :func:`dataclass ` 的行為。" -#: ../../whatsnew/3.11.rst:399 +#: ../../whatsnew/3.11.rst:397 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:417 +#: ../../whatsnew/3.11.rst:415 msgid "See :pep:`681` for more details." msgstr "詳情請見 :pep:`681`。" -#: ../../whatsnew/3.11.rst:419 +#: ../../whatsnew/3.11.rst:417 msgid "" "(Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte " "and Eric Traut.)" @@ -561,11 +545,11 @@ msgstr "" "(由 Jelle Zijlstra 於 :gh:`91860` 中所貢獻。PEP 由 Erik De Bonte 與 Eric " "Traut 所撰寫)" -#: ../../whatsnew/3.11.rst:426 +#: ../../whatsnew/3.11.rst:424 msgid "PEP 563 may not be the future" msgstr "PEP 563 可能不是未來" -#: ../../whatsnew/3.11.rst:428 +#: ../../whatsnew/3.11.rst:426 msgid "" ":pep:`563` Postponed Evaluation of Annotations (the ``from __future__ import " "annotations`` :ref:`future statement `) that was originally planned " @@ -580,11 +564,11 @@ msgstr "" "Counsil) 的訊息 `__\\ 以獲得更多資訊。" -#: ../../whatsnew/3.11.rst:439 +#: ../../whatsnew/3.11.rst:437 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.11.rst:441 +#: ../../whatsnew/3.11.rst:439 msgid "" "Starred unpacking expressions can now be used in :keyword:`for` statements. " "(See :issue:`46725` for more details.)" @@ -592,7 +576,7 @@ msgstr "" "星號拆解 (starred unpacking) 運算式現在可以在 :keyword:`for` 陳述式中使用。" "(詳情請見 :issue:`46725`。)" -#: ../../whatsnew/3.11.rst:444 +#: ../../whatsnew/3.11.rst:442 msgid "" "Asynchronous :ref:`comprehensions ` are now allowed inside " "comprehensions in :ref:`asynchronous functions `. Outer " @@ -604,7 +588,7 @@ msgstr "" "下,外部綜合運算 (outer comprehension) 隱晦地變成了非同步的了。 (由 Serhiy " "Storchaka 在 :issue:`33346` 中貢獻。)" -#: ../../whatsnew/3.11.rst:449 +#: ../../whatsnew/3.11.rst:447 msgid "" "A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in :" "keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` for " @@ -621,7 +605,7 @@ msgstr "" "是 :exc:`AttributeError`。 (由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:" "`44471` 中貢獻。)" -#: ../../whatsnew/3.11.rst:457 +#: ../../whatsnew/3.11.rst:455 msgid "" "Added :meth:`object.__getstate__`, which provides the default implementation " "of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :mod:`pickle`\\ing " @@ -638,7 +622,7 @@ msgstr "" "在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬性。 (由 Serhiy " "Storchaka 在 :issue:`26579` 中貢獻。)" -#: ../../whatsnew/3.11.rst:468 +#: ../../whatsnew/3.11.rst:466 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " "environment variable, which disable the automatic prepending to :data:`sys." @@ -655,7 +639,7 @@ msgstr "" "keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" "的)目錄中的模組重疊。 (由 Victor Stinner 在 :gh:`57684` 中貢獻。)" -#: ../../whatsnew/3.11.rst:479 +#: ../../whatsnew/3.11.rst:477 msgid "" "A ``\"z\"`` option was added to the :ref:`formatspec` that coerces negative " "to positive zero after rounding to the format precision. See :pep:`682` for " @@ -664,7 +648,7 @@ msgstr "" "``\"z\"`` 選項被新增到 :ref:`formatspec`,它會強迫負的 0 在進位到格式精度後成" "為正的。更多詳情請見 :pep:`682`。(由 John Belmonte 於 :gh:`90153` 中貢獻。)" -#: ../../whatsnew/3.11.rst:484 +#: ../../whatsnew/3.11.rst:482 msgid "" "Bytes are no longer accepted on :data:`sys.path`. Support broke sometime " "between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0 " @@ -679,11 +663,11 @@ msgstr "" "會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" "`91181` 中貢獻。)" -#: ../../whatsnew/3.11.rst:495 +#: ../../whatsnew/3.11.rst:493 msgid "Other CPython Implementation Changes" msgstr "其他 CPython 實作更動" -#: ../../whatsnew/3.11.rst:497 +#: ../../whatsnew/3.11.rst:495 msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" @@ -695,7 +679,7 @@ msgstr "" "__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " "Na 於 :issue:`24234` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:502 +#: ../../whatsnew/3.11.rst:500 msgid "" "``siphash13`` is added as a new internal hashing algorithm. It has similar " "security properties as ``siphash24``, but it is slightly faster for long " @@ -710,7 +694,7 @@ msgstr "" "案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" "`29410` 中貢獻。)" -#: ../../whatsnew/3.11.rst:511 +#: ../../whatsnew/3.11.rst:509 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " "no parameters, the traceback attached to this exception is now always ``sys." @@ -723,7 +707,7 @@ msgstr "" "當前 :keyword:`except` 子句的追蹤上做的改動會反映在被重複引發的例外上。(由 " "Irit Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:517 +#: ../../whatsnew/3.11.rst:515 msgid "" "The interpreter state's representation of handled exceptions (aka " "``exc_info`` or ``_PyErr_StackItem``) now only has the ``exc_value`` field; " @@ -735,7 +719,7 @@ msgstr "" "``exc_traceback`` 已被移除,現在只能透過 ``exc_value`` 來取得它們。(由 Irit " "Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:523 +#: ../../whatsnew/3.11.rst:521 msgid "" "A new :ref:`command line option `, ``AppendPath``, has " "been added for the Windows installer. It behaves similarly to " @@ -746,7 +730,7 @@ msgstr "" "Windows 安裝程式。它的行為類似於 ``PrependPath``,但在安裝和腳本目錄後面附加" "而非新增於它們前面。 (由 Bastian Neuburger 在 :issue:`44934` 中貢獻。)" -#: ../../whatsnew/3.11.rst:529 +#: ../../whatsnew/3.11.rst:527 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to " "``1`` for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -757,7 +741,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:534 +#: ../../whatsnew/3.11.rst:532 msgid "" "The output of the :option:`--help` option now fits in 50 lines/80 columns. " "Information about :ref:`Python environment variables ` " @@ -770,7 +754,7 @@ msgstr "" "option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " "一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" -#: ../../whatsnew/3.11.rst:541 +#: ../../whatsnew/3.11.rst:539 msgid "" "Converting between :class:`int` and :class:`str` in bases other than 2 " "(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " @@ -792,11 +776,11 @@ msgstr "" "或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度限制 " "` 文件。預設限制為字串形式的 4300 位數字。" -#: ../../whatsnew/3.11.rst:556 +#: ../../whatsnew/3.11.rst:554 msgid "New Modules" msgstr "新增模組" -#: ../../whatsnew/3.11.rst:558 +#: ../../whatsnew/3.11.rst:556 msgid "" ":mod:`tomllib`: For parsing `TOML `_. See :pep:`680` for " "more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)" @@ -804,7 +788,7 @@ msgstr "" ":mod:`tomllib`:用於剖析 `TOML `_。詳情請見 :pep:`680`。" "(由 Taneli Hukkinen 於 :issue:`40059` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:562 +#: ../../whatsnew/3.11.rst:560 msgid "" ":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type " "checking. (Contributed by Sebastian Rittau in :issue:`42012`.)" @@ -812,15 +796,15 @@ msgstr "" ":mod:`wsgiref.types`:\\ :pep:`WSGI <3333>` 限定型別,用於靜態型別檢查。" "(Sebastian Rittau 於 :issue:`42012` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:570 +#: ../../whatsnew/3.11.rst:568 msgid "Improved Modules" msgstr "模組改進" -#: ../../whatsnew/3.11.rst:575 +#: ../../whatsnew/3.11.rst:573 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.11.rst:577 +#: ../../whatsnew/3.11.rst:575 msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " @@ -834,7 +818,7 @@ msgstr "" "和 :func:`~asyncio.gather`。(由 Yury Selivanov 和其他人在 :gh:`90908` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:584 +#: ../../whatsnew/3.11.rst:582 msgid "" "Added :func:`~asyncio.timeout`, an asynchronous context manager for setting " "a timeout on asynchronous operations. For new code this is recommended over " @@ -845,7 +829,7 @@ msgstr "" "管理器,新的程式建議直接使用它以取代 :func:`~asyncio.wait_for`。(由 Andrew " "Svetlov 於 :gh:`90927` 貢獻。)" -#: ../../whatsnew/3.11.rst:589 +#: ../../whatsnew/3.11.rst:587 msgid "" "Added the :class:`~asyncio.Runner` class, which exposes the machinery used " "by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)" @@ -853,7 +837,7 @@ msgstr "" "新增 :class:`~asyncio.Runner` 類別,它會對外公布了 :func:`~asyncio.run` 的使" "用機制。(由 Andrew Svetlov 於 :gh:`91218` 貢獻。)" -#: ../../whatsnew/3.11.rst:593 +#: ../../whatsnew/3.11.rst:591 msgid "" "Added the :class:`~asyncio.Barrier` class to the synchronization primitives " "in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` " @@ -863,7 +847,7 @@ msgstr "" "相關的 :exc:`~asyncio.BrokenBarrierError` 例外。(由 Yves Duprat 和 Andrew " "Svetlov in :gh:`87518` 貢獻。)" -#: ../../whatsnew/3.11.rst:598 +#: ../../whatsnew/3.11.rst:596 msgid "" "Added keyword argument *all_errors* to :meth:`asyncio.loop." "create_connection` so that multiple connection errors can be raised as an :" @@ -872,7 +856,7 @@ msgstr "" "在 :meth:`asyncio.loop.create_connection` 新增關鍵字引數 *all_errors*,這樣多" "個連接錯誤就可以一起用一個 :exc:`ExceptionGroup` 來引發。" -#: ../../whatsnew/3.11.rst:601 +#: ../../whatsnew/3.11.rst:599 msgid "" "Added the :meth:`asyncio.StreamWriter.start_tls` method for upgrading " "existing stream-based connections to TLS. (Contributed by Ian Good in :issue:" @@ -881,7 +865,7 @@ msgstr "" "新增 :meth:`asyncio.StreamWriter.start_tls` 方法,用來將已存在的串流連線升級" "至 TLS。(由 Ian Good 於 :issue:`34975` 中貢獻。)" -#: ../../whatsnew/3.11.rst:605 +#: ../../whatsnew/3.11.rst:603 msgid "" "Added raw datagram socket functions to the event loop: :meth:`~asyncio.loop." "sock_sendto`, :meth:`~asyncio.loop.sock_recvfrom` and :meth:`~asyncio.loop." @@ -895,7 +879,7 @@ msgstr "" "`~asyncio.ProactorEventLoop` 中都有實作。(由 Alex Grönholm 在 :issue:" "`46805` 中貢獻。)" -#: ../../whatsnew/3.11.rst:613 +#: ../../whatsnew/3.11.rst:611 msgid "" "Added :meth:`~asyncio.Task.cancelling` and :meth:`~asyncio.Task.uncancel` " "methods to :class:`~asyncio.Task`. These are primarily intended for internal " @@ -905,11 +889,11 @@ msgstr "" "`~asyncio.Task.uncancel` 方法。這些預期是只用於內部,尤其是 :class:`~asyncio." "TaskGroup`。" -#: ../../whatsnew/3.11.rst:622 +#: ../../whatsnew/3.11.rst:620 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.11.rst:624 +#: ../../whatsnew/3.11.rst:622 msgid "" "Added non parallel-safe :func:`~contextlib.chdir` context manager to change " "the current working directory and then restore it on exit. Simple wrapper " @@ -919,11 +903,11 @@ msgstr "" "後在退出時恢復它。:func:`~os.chdir` 的簡單包裝器。(由 Filipe Laíns 在 :" "issue:`25625` 中貢獻)" -#: ../../whatsnew/3.11.rst:632 +#: ../../whatsnew/3.11.rst:630 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.11.rst:634 +#: ../../whatsnew/3.11.rst:632 msgid "" "Change field default mutability check, allowing only defaults which are :" "term:`hashable` instead of any object which is not an instance of :class:" @@ -934,11 +918,11 @@ msgstr "" "而不是任何非 :class:`dict`、:class:`list` 或 :class:`set` 實例的物件。(由 " "Eric V. Smith 在 :issue:`44674` 中貢獻。)" -#: ../../whatsnew/3.11.rst:643 +#: ../../whatsnew/3.11.rst:641 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.11.rst:645 +#: ../../whatsnew/3.11.rst:643 msgid "" "Add :attr:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" @@ -946,7 +930,7 @@ msgstr "" "新增 :attr:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" "(由 Kabir Kwatra 於 :gh:`91973` 所貢獻。)" -#: ../../whatsnew/3.11.rst:648 +#: ../../whatsnew/3.11.rst:646 msgid "" ":meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` " "and :meth:`datetime.datetime.fromisoformat` can now be used to parse most " @@ -958,11 +942,11 @@ msgstr "" "(除了那些支援分數形式的小時與分鐘)。(由 Paul Ganssle 於 :gh:`80010` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:657 +#: ../../whatsnew/3.11.rst:655 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.11.rst:659 +#: ../../whatsnew/3.11.rst:657 msgid "" "Renamed :class:`!EnumMeta` to :class:`~enum.EnumType` (:class:`!EnumMeta` " "kept as an alias)." @@ -970,13 +954,13 @@ msgstr "" ":class:`!EnumMeta` 更名為 :class:`~enum.EnumType`\\ (:class:`!EnumMeta` 保留" "為別名)。" -#: ../../whatsnew/3.11.rst:662 +#: ../../whatsnew/3.11.rst:660 msgid "" "Added :class:`~enum.StrEnum`, with members that can be used as (and must be) " "strings." msgstr "增加 :class:`~enum.StrEnum`,列舉 (enum) 內的成員必須是字串。" -#: ../../whatsnew/3.11.rst:665 +#: ../../whatsnew/3.11.rst:663 msgid "" "Added :class:`~enum.ReprEnum`, which only modifies the :meth:`~object." "__repr__` of members while returning their literal values (rather than " @@ -988,7 +972,7 @@ msgstr "" "`format` 和 :term:`f-string` 所使用的)\\ :meth:`~object.__str__` 和 :meth:" "`~object.__format__`。" -#: ../../whatsnew/3.11.rst:671 +#: ../../whatsnew/3.11.rst:669 msgid "" "Changed :meth:`Enum.__format__() ` (the default for :" "func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " @@ -1001,7 +985,7 @@ msgstr "" "`enum.Enum.__str__` 產生相同結果:對於繼承自 :class:`~enum.ReprEnum` 的列舉," "這會是成員之值;而其他的列舉會是列舉與成員名稱(例如 ``Color.RED``)。" -#: ../../whatsnew/3.11.rst:677 +#: ../../whatsnew/3.11.rst:675 msgid "" "Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" "class:`~enum.FlagBoundary` enum with its options, to control how to handle " @@ -1010,7 +994,7 @@ msgstr "" "新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." "FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" -#: ../../whatsnew/3.11.rst:681 +#: ../../whatsnew/3.11.rst:679 msgid "" "Added the :func:`~enum.verify` enum decorator and the :class:`~enum." "EnumCheck` enum with its options, to check enum classes against several " @@ -1019,7 +1003,7 @@ msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" -#: ../../whatsnew/3.11.rst:685 +#: ../../whatsnew/3.11.rst:683 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." @@ -1027,7 +1011,7 @@ msgstr "" "新增 :func:`~enum.member` 與 :func:`~enum.nonmember` 裝飾器以確保被裝飾的物件" "會/不會被轉換成一個列舉成員。" -#: ../../whatsnew/3.11.rst:688 +#: ../../whatsnew/3.11.rst:686 msgid "" "Added the :func:`~enum.property` decorator, which works like :func:" "`property` except for enums. Use this instead of :func:`types." @@ -1036,7 +1020,7 @@ msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" -#: ../../whatsnew/3.11.rst:692 +#: ../../whatsnew/3.11.rst:690 msgid "" "Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" "`~object.__repr__` and :meth:`~object.__str__` to show values as members of " @@ -1049,7 +1033,7 @@ msgstr "" "`re.RegexFlag` 的 :data:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." "ASCII'``。" -#: ../../whatsnew/3.11.rst:698 +#: ../../whatsnew/3.11.rst:696 msgid "" "Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" "`in`/:keyword:`not in` on its members. For example, the following now works: " @@ -1059,7 +1043,7 @@ msgstr "" "keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" -#: ../../whatsnew/3.11.rst:703 +#: ../../whatsnew/3.11.rst:701 msgid "" "Changed :class:`~enum.Enum` and :class:`~enum.Flag` so that members are now " "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " @@ -1069,7 +1053,7 @@ msgstr "" "__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" "法。" -#: ../../whatsnew/3.11.rst:708 +#: ../../whatsnew/3.11.rst:706 msgid "" "Changed :class:`~enum.Flag` to only consider primary values (power of two) " "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " @@ -1079,11 +1063,11 @@ msgstr "" "``6``、``10`` 等)被視為別名;倒置旗標 (inverted flags) 會被強制轉換為正等價" "的值。" -#: ../../whatsnew/3.11.rst:717 +#: ../../whatsnew/3.11.rst:715 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.11.rst:719 +#: ../../whatsnew/3.11.rst:717 msgid "" "On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags " "respectively are supported, the former equals to ``dup2`` usage while the " @@ -1092,11 +1076,11 @@ msgstr "" "FreeBSD 上,:data:`!F_DUP2FD` 和 :data:`!F_DUP2FD_CLOEXEC` 旗標分別有被支援," "前者等同於 ``dup2`` 用法,而後者設定了 ``FD_CLOEXEC`` 旗標。" -#: ../../whatsnew/3.11.rst:727 +#: ../../whatsnew/3.11.rst:725 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.11.rst:729 +#: ../../whatsnew/3.11.rst:727 msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" @@ -1104,7 +1088,7 @@ msgstr "" "支援有 :PEP:`515` 風格的 :class:`~fractions.Fraction` 以字串初始化。(Sergey " "B Kirpichev 於 :issue:`44258` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:732 +#: ../../whatsnew/3.11.rst:730 msgid "" ":class:`~fractions.Fraction` now implements an ``__int__`` method, so that " "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " @@ -1114,11 +1098,11 @@ msgstr "" "``isinstance(some_fraction, typing.SupportsInt)`` 的檢查會通過。(由 Mark " "Dickinson 在 :issue:`44547` 中貢獻。)" -#: ../../whatsnew/3.11.rst:740 +#: ../../whatsnew/3.11.rst:738 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.11.rst:742 +#: ../../whatsnew/3.11.rst:740 msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" @@ -1128,15 +1112,15 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:767 +#: ../../whatsnew/3.11.rst:765 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" msgstr "(由 Yurii Karabas 於 :issue:`46014` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:773 +#: ../../whatsnew/3.11.rst:771 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.11.rst:775 +#: ../../whatsnew/3.11.rst:773 msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" @@ -1145,7 +1129,7 @@ msgstr "" "於 Python 自發行版的複製。(由 Christian Heimes 於 :issue:`47095` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:779 +#: ../../whatsnew/3.11.rst:777 msgid "" "The internal ``_sha3`` module with SHA3 and SHAKE algorithms now uses " "*tiny_sha3* instead of the *Keccak Code Package* to reduce code and binary " @@ -1158,7 +1142,7 @@ msgstr "" "來自 OpenSSL 的 SHA3 和 SHAKE 最佳化實作。此更改僅影響沒有 OpenSSL 支援的安" "裝。(由 Christian Heimes 在 :issue:`47098` 中貢獻。)" -#: ../../whatsnew/3.11.rst:786 +#: ../../whatsnew/3.11.rst:784 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" @@ -1166,11 +1150,11 @@ msgstr "" "新增 :func:`hashlib.file_digest`,是個能夠為檔案或類檔案物件做高效率雜湊的幫" "助函式。(由 Christian Heimes 於 :gh:`89313` 中貢獻。)" -#: ../../whatsnew/3.11.rst:794 +#: ../../whatsnew/3.11.rst:792 msgid "IDLE and idlelib" msgstr "IDLE 與 idlelib" -#: ../../whatsnew/3.11.rst:796 +#: ../../whatsnew/3.11.rst:794 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1178,7 +1162,7 @@ msgstr "" "在 `.pyi` 檔案施用語法突顯 (syntax highlight)。(由 Alex Waygood 與 Terry " "Jan Reedy 於 :issue:`45447` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:799 +#: ../../whatsnew/3.11.rst:797 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1186,11 +1170,11 @@ msgstr "" "當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" "gh:`95191` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:806 +#: ../../whatsnew/3.11.rst:804 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.11.rst:808 +#: ../../whatsnew/3.11.rst:806 msgid "" "Add :func:`~inspect.getmembers_static` to return all members without " "triggering dynamic lookup via the descriptor protocol. (Contributed by " @@ -1200,7 +1184,7 @@ msgstr "" "(descriptor protocol) 觸發動態查找。 (由 Weipeng Hong 在 :issue:`30533` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:812 +#: ../../whatsnew/3.11.rst:810 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " "is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" @@ -1209,7 +1193,7 @@ msgstr "" "新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" "`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:816 +#: ../../whatsnew/3.11.rst:814 msgid "" "Change the frame-related functions in the :mod:`inspect` module to return " "new :class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class " @@ -1222,35 +1206,35 @@ msgstr "" "`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" "欄)。受影響的功能是:" -#: ../../whatsnew/3.11.rst:822 +#: ../../whatsnew/3.11.rst:820 msgid ":func:`inspect.getframeinfo`" msgstr ":func:`inspect.getframeinfo`" -#: ../../whatsnew/3.11.rst:823 +#: ../../whatsnew/3.11.rst:821 msgid ":func:`inspect.getouterframes`" msgstr ":func:`inspect.getouterframes`" -#: ../../whatsnew/3.11.rst:824 +#: ../../whatsnew/3.11.rst:822 msgid ":func:`inspect.getinnerframes`," msgstr ":func:`inspect.getinnerframes`," -#: ../../whatsnew/3.11.rst:825 +#: ../../whatsnew/3.11.rst:823 msgid ":func:`inspect.stack`" msgstr ":func:`inspect.stack`" -#: ../../whatsnew/3.11.rst:826 +#: ../../whatsnew/3.11.rst:824 msgid ":func:`inspect.trace`" msgstr ":func:`inspect.trace`" -#: ../../whatsnew/3.11.rst:828 +#: ../../whatsnew/3.11.rst:826 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" msgstr "(由 Pablo Galindo 於 :gh:`88116` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:834 +#: ../../whatsnew/3.11.rst:832 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.11.rst:836 +#: ../../whatsnew/3.11.rst:834 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " "similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" @@ -1260,11 +1244,11 @@ msgstr "" "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " "`。" -#: ../../whatsnew/3.11.rst:844 +#: ../../whatsnew/3.11.rst:842 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.11.rst:846 +#: ../../whatsnew/3.11.rst:844 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " "level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" @@ -1275,7 +1259,7 @@ msgstr "" "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的映射。" "(由 Andrei Kulakovin 於 :gh:`88024` 中貢獻。)" -#: ../../whatsnew/3.11.rst:851 +#: ../../whatsnew/3.11.rst:849 msgid "" "Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" "class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." @@ -1289,11 +1273,11 @@ msgstr "" "用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。 (由 Kirill " "Pinchuk 在 :gh:`88457` 中貢獻。)" -#: ../../whatsnew/3.11.rst:863 +#: ../../whatsnew/3.11.rst:861 msgid "math" msgstr "math" -#: ../../whatsnew/3.11.rst:865 +#: ../../whatsnew/3.11.rst:863 msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" @@ -1301,7 +1285,7 @@ msgstr "" "新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" "`45917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:868 +#: ../../whatsnew/3.11.rst:866 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" @@ -1309,7 +1293,7 @@ msgstr "" "新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" "`44357` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:871 +#: ../../whatsnew/3.11.rst:869 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " "consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" @@ -1322,7 +1306,7 @@ msgstr "" "現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" "issue:`44339` 中貢獻。)" -#: ../../whatsnew/3.11.rst:877 +#: ../../whatsnew/3.11.rst:875 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" @@ -1330,11 +1314,11 @@ msgstr "" ":data:`math.nan` 現為隨時可用。(由 Victor Stinner 於 :issue:`46917` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:884 +#: ../../whatsnew/3.11.rst:882 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.11.rst:886 +#: ../../whatsnew/3.11.rst:884 msgid "" "A new function ``operator.call`` has been added, such that ``operator." "call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " @@ -1343,11 +1327,11 @@ msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:894 +#: ../../whatsnew/3.11.rst:892 msgid "os" msgstr "os" -#: ../../whatsnew/3.11.rst:896 +#: ../../whatsnew/3.11.rst:894 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" @@ -1356,11 +1340,11 @@ msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:904 +#: ../../whatsnew/3.11.rst:902 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.11.rst:906 +#: ../../whatsnew/3.11.rst:904 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " "directories if *pattern* ends with a pathname components separator: :data:" @@ -1371,11 +1355,11 @@ msgstr "" "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" "(由 Eisuke Kawasima 於 :issue:`22276` 與 :issue:`33392` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:915 +#: ../../whatsnew/3.11.rst:913 msgid "re" msgstr "re" -#: ../../whatsnew/3.11.rst:917 +#: ../../whatsnew/3.11.rst:915 msgid "" "Atomic grouping (``(?>...)``) and possessive quantifiers (``*+``, ``++``, ``?" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " @@ -1386,11 +1370,11 @@ msgstr "" "``{m,n}+``) 的。 (由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" "`433030` 中貢獻。)" -#: ../../whatsnew/3.11.rst:925 +#: ../../whatsnew/3.11.rst:923 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.11.rst:927 +#: ../../whatsnew/3.11.rst:925 msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" @@ -1398,11 +1382,11 @@ msgstr "" "新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" "issue:`46245` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:934 +#: ../../whatsnew/3.11.rst:932 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.11.rst:936 +#: ../../whatsnew/3.11.rst:934 msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" @@ -1410,7 +1394,7 @@ msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:939 +#: ../../whatsnew/3.11.rst:937 msgid "" ":meth:`~socket.create_connection` has an option to raise, in case of failure " "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " @@ -1420,11 +1404,11 @@ msgstr "" "錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" "issue:`29980` 中貢獻。)" -#: ../../whatsnew/3.11.rst:948 +#: ../../whatsnew/3.11.rst:946 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.11.rst:950 +#: ../../whatsnew/3.11.rst:948 msgid "" "You can now disable the authorizer by passing :const:`None` to :meth:" "`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" @@ -1434,7 +1418,7 @@ msgstr "" "set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:954 +#: ../../whatsnew/3.11.rst:952 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " "any Unicode character. Collation names with invalid characters now raise :" @@ -1446,7 +1430,7 @@ msgstr "" "`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " "Aasland 在 :issue:`44688` 中貢獻。)" -#: ../../whatsnew/3.11.rst:959 +#: ../../whatsnew/3.11.rst:957 msgid "" ":mod:`sqlite3` exceptions now include the SQLite extended error code as :" "attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" @@ -1458,7 +1442,7 @@ msgstr "" "sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " "在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" -#: ../../whatsnew/3.11.rst:965 +#: ../../whatsnew/3.11.rst:963 msgid "" "Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." "getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " @@ -1469,7 +1453,7 @@ msgstr "" "getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" "制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" -#: ../../whatsnew/3.11.rst:970 +#: ../../whatsnew/3.11.rst:968 msgid "" ":mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on the default " "threading mode the underlying SQLite library has been compiled with. " @@ -1479,7 +1463,7 @@ msgstr "" "定 :attr:`sqlite3.threadsafety`。(由 Erlend E. Aasland 在 :issue:`45613` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:974 +#: ../../whatsnew/3.11.rst:972 msgid "" ":mod:`sqlite3` C callbacks now use unraisable exceptions if callback " "tracebacks are enabled. Users can now register an :func:`unraisable hook " @@ -1491,7 +1475,7 @@ msgstr "" "(unraisable hook handler) ` 來改善他們的除錯體驗。(由 " "Erlend E. Aasland 在 :issue:`45828` 中貢獻。)" -#: ../../whatsnew/3.11.rst:980 +#: ../../whatsnew/3.11.rst:978 msgid "" "Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`. " "Instead we leave it to the SQLite library to handle these cases. " @@ -1501,7 +1485,7 @@ msgstr "" "們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" "`44092` 中貢獻。)" -#: ../../whatsnew/3.11.rst:984 +#: ../../whatsnew/3.11.rst:982 msgid "" "Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." "deserialize` to :class:`sqlite3.Connection` for serializing and " @@ -1512,7 +1496,7 @@ msgstr "" "deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" "庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" -#: ../../whatsnew/3.11.rst:989 +#: ../../whatsnew/3.11.rst:987 msgid "" "Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." "Connection` for creating aggregate window functions. (Contributed by Erlend " @@ -1522,7 +1506,7 @@ msgstr "" "create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " "Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" -#: ../../whatsnew/3.11.rst:993 +#: ../../whatsnew/3.11.rst:991 msgid "" "Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" "class:`sqlite3.Blob` allows incremental I/O operations on blobs. " @@ -1533,11 +1517,11 @@ msgstr "" "operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1001 +#: ../../whatsnew/3.11.rst:999 msgid "string" msgstr "string" -#: ../../whatsnew/3.11.rst:1003 +#: ../../whatsnew/3.11.rst:1001 msgid "" "Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." "is_valid` to :class:`string.Template`, which respectively return all valid " @@ -1549,11 +1533,11 @@ msgstr "" "(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" "`90465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1013 +#: ../../whatsnew/3.11.rst:1011 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.11.rst:1015 +#: ../../whatsnew/3.11.rst:1013 msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " @@ -1565,7 +1549,7 @@ msgstr "" "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" "exc_info` 後續呼叫的結果中。 (由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1021 +#: ../../whatsnew/3.11.rst:1019 msgid "" "Add :func:`sys.exception` which returns the active exception instance " "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" @@ -1575,7 +1559,7 @@ msgstr "" "exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" "issue:`46328` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1025 +#: ../../whatsnew/3.11.rst:1023 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -1583,11 +1567,11 @@ msgstr "" "新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" "gh:`57684` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1032 +#: ../../whatsnew/3.11.rst:1030 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.11.rst:1034 +#: ../../whatsnew/3.11.rst:1032 msgid "" "Three new :ref:`installation schemes ` (*posix_venv*, " "*nt_venv* and *venv*) were added and are used when Python creates new " @@ -1608,11 +1592,11 @@ msgstr "" "的第三方程式碼應該使用新的 *venv* 安裝方案來確定路徑,就像 :mod:`venv` 一樣。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1051 +#: ../../whatsnew/3.11.rst:1049 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.11.rst:1053 +#: ../../whatsnew/3.11.rst:1051 msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " @@ -1625,11 +1609,11 @@ msgstr "" "能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" "`70363` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1064 +#: ../../whatsnew/3.11.rst:1062 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.11.rst:1066 +#: ../../whatsnew/3.11.rst:1064 msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " @@ -1644,11 +1628,11 @@ msgstr "" "`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" "issue:`41710` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1077 +#: ../../whatsnew/3.11.rst:1075 msgid "time" msgstr "time" -#: ../../whatsnew/3.11.rst:1079 +#: ../../whatsnew/3.11.rst:1077 msgid "" "On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or " "``nanosleep()`` function, if available, which has a resolution of 1 " @@ -1661,7 +1645,7 @@ msgstr "" "`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" "(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1085 +#: ../../whatsnew/3.11.rst:1083 msgid "" "On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based " "on `high-resolution timers `. " @@ -1835,7 +1819,7 @@ msgstr "" "`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1176 +#: ../../whatsnew/3.11.rst:1174 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " "parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" @@ -1844,7 +1828,7 @@ msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1180 +#: ../../whatsnew/3.11.rst:1178 msgid "" ":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" @@ -1854,7 +1838,7 @@ msgstr "" "的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" "`90711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1184 +#: ../../whatsnew/3.11.rst:1182 msgid "" ":func:`typing.no_type_check` no longer modifies external classes and " "functions. It also now correctly marks classmethods as not to be type " @@ -1863,11 +1847,11 @@ msgstr "" ":func:`typing.no_type_check` 不再修改外部類別和函式。它現在也正確地將類別方法" "標記為不需進行型別檢查。(由 Nikita Sobolev 在 :gh:`90729` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1192 +#: ../../whatsnew/3.11.rst:1190 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.11.rst:1194 +#: ../../whatsnew/3.11.rst:1192 msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." @@ -1875,11 +1859,11 @@ msgstr "" "Unicode 資料庫被更新為 14.0.0 版本。(Benjamin Peterson 於 :issue:`45190` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:1201 +#: ../../whatsnew/3.11.rst:1199 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.11.rst:1203 +#: ../../whatsnew/3.11.rst:1201 msgid "" "Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." "TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" @@ -1893,11 +1877,11 @@ msgstr "" "IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." "enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" -#: ../../whatsnew/3.11.rst:1215 +#: ../../whatsnew/3.11.rst:1213 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.11.rst:1217 +#: ../../whatsnew/3.11.rst:1215 msgid "" "When new Python virtual environments are created, the *venv* :ref:`sysconfig " "installation scheme ` is used to determine the paths " @@ -1914,11 +1898,11 @@ msgstr "" "下更改預設的 sysconfig 安裝方案。建立新虛擬環境的第三方程式碼也應該這樣做。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1231 +#: ../../whatsnew/3.11.rst:1229 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.11.rst:1233 +#: ../../whatsnew/3.11.rst:1231 msgid "" ":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." "simplefilter`, providing a more concise way to locally ignore warnings or " @@ -1929,11 +1913,11 @@ msgstr "" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。 (由 Zac " "Hatfield-Dodds 在 :issue:`47074` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1241 +#: ../../whatsnew/3.11.rst:1239 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.11.rst:1243 +#: ../../whatsnew/3.11.rst:1241 msgid "" "Added support for specifying member name encoding for reading metadata in a :" "class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " @@ -1943,7 +1927,7 @@ msgstr "" "標頭中讀取元資料 (metadata)。(由 Stephen J. Turnbull 和 Serhiy Storchaka " "在 :issue:`28080` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1247 +#: ../../whatsnew/3.11.rst:1245 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" @@ -1951,7 +1935,7 @@ msgstr "" "新增 :meth:`ZipFile.mkdir() ` 以在 ZIP 歸檔中建立新的" "目錄。(由 Sam Ezeh 於 :gh:`49083` 貢獻。)" -#: ../../whatsnew/3.11.rst:1251 +#: ../../whatsnew/3.11.rst:1249 msgid "" "Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" "`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " @@ -1961,11 +1945,11 @@ msgstr "" "Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" "`88261` 貢獻。)" -#: ../../whatsnew/3.11.rst:1259 +#: ../../whatsnew/3.11.rst:1257 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.11.rst:1261 +#: ../../whatsnew/3.11.rst:1259 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." @@ -1973,7 +1957,7 @@ msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" -#: ../../whatsnew/3.11.rst:1264 +#: ../../whatsnew/3.11.rst:1262 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes " @@ -1985,7 +1969,7 @@ msgstr "" "` 最佳化並使其與相應的 :term:`f-string` 運算式一樣快。" "(由 Serhiy Storchaka 在 :issue:`28307` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1270 +#: ../../whatsnew/3.11.rst:1268 msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " @@ -1996,7 +1980,7 @@ msgstr "" "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " "Peters 在 :gh:`90564` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1275 +#: ../../whatsnew/3.11.rst:1273 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" @@ -2004,7 +1988,7 @@ msgstr "" "針對小於 ``2**30`` 的整數,:func:`sum` 現在快了將近 30%。(由 Stefan Behnel " "於 :gh:`68264` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1278 +#: ../../whatsnew/3.11.rst:1276 msgid "" "Resizing lists is streamlined for the common case, speeding up :meth:`list." "append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " @@ -2014,7 +1998,7 @@ msgstr "" "為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" "gh:`91165` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1283 +#: ../../whatsnew/3.11.rst:1281 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " "decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." @@ -2026,7 +2010,7 @@ msgstr "" "元組減少到 272 位元組(減少 23%)。(由 Inada Naoki 在 :issue:`46845` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1289 +#: ../../whatsnew/3.11.rst:1287 msgid "" "Using :class:`asyncio.DatagramProtocol` is now orders of magnitude faster " "when transferring large files over UDP, with speeds over 100 times higher " @@ -2036,7 +2020,7 @@ msgstr "" "了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" "`91487` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1294 +#: ../../whatsnew/3.11.rst:1292 msgid "" ":mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now ≈10 " "times faster for large arguments (with a larger speedup for larger *k*). " @@ -2046,7 +2030,7 @@ msgstr "" "了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" "`37295` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1298 +#: ../../whatsnew/3.11.rst:1296 msgid "" "The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." "variance` and :func:`~statistics.stdev` now consume iterators in one pass " @@ -2059,7 +2043,7 @@ msgstr "" "們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " "Raymond Hettinger 在 :gh:`90415` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1304 +#: ../../whatsnew/3.11.rst:1302 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" @@ -2067,11 +2051,11 @@ msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" "串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1312 +#: ../../whatsnew/3.11.rst:1310 msgid "Faster CPython" msgstr "更快的 CPython" -#: ../../whatsnew/3.11.rst:1314 +#: ../../whatsnew/3.11.rst:1312 msgid "" "CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " @@ -2084,7 +2068,7 @@ msgstr "" "Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,整體加速程度可達 10-60%。" -#: ../../whatsnew/3.11.rst:1321 +#: ../../whatsnew/3.11.rst:1319 msgid "" "This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " @@ -2094,15 +2078,15 @@ msgstr "" "`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" "`whatsnew311-optimizations`。" -#: ../../whatsnew/3.11.rst:1330 +#: ../../whatsnew/3.11.rst:1328 msgid "Faster Startup" msgstr "更快的啟動" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1333 msgid "Frozen imports / Static code objects" msgstr "凍結引入 (Frozen imports) / 靜態程式碼物件 (Static code objects)" -#: ../../whatsnew/3.11.rst:1337 +#: ../../whatsnew/3.11.rst:1335 msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." @@ -2110,11 +2094,11 @@ msgstr "" "Python 將\\ :term:`位元組碼 `\\ 於 :ref:`__pycache__` " "目錄中存為快取來加速模組的載入。" -#: ../../whatsnew/3.11.rst:1340 +#: ../../whatsnew/3.11.rst:1338 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "在先前的 3.10 中,執行 Python 模組會像是這樣:" -#: ../../whatsnew/3.11.rst:1346 +#: ../../whatsnew/3.11.rst:1344 msgid "" "In Python 3.11, the core modules essential for Python startup are " "\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " @@ -2125,7 +2109,7 @@ msgstr "" "ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" "執行過程中的步驟減少為:" -#: ../../whatsnew/3.11.rst:1355 +#: ../../whatsnew/3.11.rst:1353 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." @@ -2133,21 +2117,21 @@ msgstr "" "在 Python 3.11 中直譯器啟動速度快了 10-15%。這對於使用 Python 所撰寫的短暫程" "式有著巨大影響。" -#: ../../whatsnew/3.11.rst:1358 +#: ../../whatsnew/3.11.rst:1356 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" "(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" -#: ../../whatsnew/3.11.rst:1364 +#: ../../whatsnew/3.11.rst:1362 msgid "Faster Runtime" msgstr "更快的運行程式" -#: ../../whatsnew/3.11.rst:1369 +#: ../../whatsnew/3.11.rst:1367 msgid "Cheaper, lazy Python frames" msgstr "所需資源更少 (cheaper) 且惰性的 (lazy)) Python 幀 (frame)" -#: ../../whatsnew/3.11.rst:1371 +#: ../../whatsnew/3.11.rst:1369 msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" @@ -2155,16 +2139,16 @@ msgstr "" "每當 Python 呼叫 Python 函式時,就會建立保存執行資訊的 Python 幀。以下是針對" "幀而做的新最佳化:" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1373 msgid "Streamlined the frame creation process." msgstr "使幀的建立過程更有效率。" -#: ../../whatsnew/3.11.rst:1376 +#: ../../whatsnew/3.11.rst:1374 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "在 C 堆疊 (stack) 中盡量重複利用幀的空間來避免記憶體分配。" -#: ../../whatsnew/3.11.rst:1377 +#: ../../whatsnew/3.11.rst:1375 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." @@ -2172,7 +2156,7 @@ msgstr "" "讓內部幀結構只包含必要資訊,使其更加精簡。在過去,幀必須帶有額外的偵錯與記憶" "體管理的資訊。" -#: ../../whatsnew/3.11.rst:1380 +#: ../../whatsnew/3.11.rst:1378 msgid "" "Old-style :ref:`frame objects ` are now created only when " "requested by debuggers or by Python introspection functions such as :func:" @@ -2186,15 +2170,15 @@ msgstr "" "對於大多數使用者程式碼,根本不會建立任何幀物件。結果幾乎所有 Python 函式呼叫" "都顯著加速。我們以 pyperformance 測得了 3-7% 的加速。" -#: ../../whatsnew/3.11.rst:1387 +#: ../../whatsnew/3.11.rst:1385 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "(由 Mark Shannon 於 :issue:`44590` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1394 +#: ../../whatsnew/3.11.rst:1392 msgid "Inlined Python function calls" msgstr "行內 Python 函式呼叫" -#: ../../whatsnew/3.11.rst:1396 +#: ../../whatsnew/3.11.rst:1394 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " @@ -2203,7 +2187,7 @@ msgstr "" "在 Python 函式呼叫期間,Python 將呼叫一個正在求值的 C 函式來直譯該函式的程式" "碼,這有效地將純 Python 遞迴限制在對 C 堆疊的安全範圍內。" -#: ../../whatsnew/3.11.rst:1400 +#: ../../whatsnew/3.11.rst:1398 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " @@ -2213,7 +2197,7 @@ msgstr "" "一個新框架 (frame),並「跳轉」到新框架內的新程式碼,這避免了呼叫整個 C 直譯函" "式。" -#: ../../whatsnew/3.11.rst:1404 +#: ../../whatsnew/3.11.rst:1402 msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " @@ -2226,15 +2210,15 @@ msgstr "" "以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" -#: ../../whatsnew/3.11.rst:1411 +#: ../../whatsnew/3.11.rst:1409 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "(由 Pablo Galindo 與 Mark Shannon 於 :issue:`45256` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1417 +#: ../../whatsnew/3.11.rst:1415 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "PEP 659:特化的適應性直譯器" -#: ../../whatsnew/3.11.rst:1419 +#: ../../whatsnew/3.11.rst:1417 msgid "" ":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " @@ -2245,7 +2229,7 @@ msgstr "" "種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" "型別穩定 (type stability)*\\ 。" -#: ../../whatsnew/3.11.rst:1423 +#: ../../whatsnew/3.11.rst:1421 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " @@ -2261,7 +2245,7 @@ msgstr "" "稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" "快取在\\ :term:`位元組碼 `\\ 中。" -#: ../../whatsnew/3.11.rst:1431 +#: ../../whatsnew/3.11.rst:1429 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." @@ -2269,7 +2253,7 @@ msgstr "" "特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" "示 (superinstruction),這減少了執行期間的開銷。" -#: ../../whatsnew/3.11.rst:1434 +#: ../../whatsnew/3.11.rst:1432 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " "multiple times). This prevents Python from wasting time on run-once code. " @@ -2283,7 +2267,7 @@ msgstr "" "特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" "得以適應新的環境。" -#: ../../whatsnew/3.11.rst:1441 +#: ../../whatsnew/3.11.rst:1439 msgid "" "(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" "pep:`659` for more information. Implementation by Mark Shannon and Brandt " @@ -2293,43 +2277,43 @@ msgstr "" "`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " "亦提供了額外的幫助。)" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Operation" msgstr "操作" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Form" msgstr "形式" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Specialization" msgstr "特化" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Operation speedup (up to)" msgstr "操作加速程度(上限)" -#: ../../whatsnew/3.11.rst:1449 +#: ../../whatsnew/3.11.rst:1447 msgid "Contributor(s)" msgstr "貢獻者" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "Binary operations" msgstr "二元操作" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "``x + x``" msgstr "``x + x``" -#: ../../whatsnew/3.11.rst:1454 +#: ../../whatsnew/3.11.rst:1452 msgid "``x - x``" msgstr "``x - x``" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1454 msgid "``x * x``" msgstr "``x * x``" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "" "Binary add, multiply and subtract for common types such as :class:`int`, :" "class:`float` and :class:`str` take custom fast paths for their underlying " @@ -2338,23 +2322,23 @@ msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1450 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "Subscript" msgstr "下標" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." @@ -2362,7 +2346,7 @@ msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" -#: ../../whatsnew/3.11.rst:1462 +#: ../../whatsnew/3.11.rst:1460 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." @@ -2370,43 +2354,43 @@ msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" -#: ../../whatsnew/3.11.rst:1458 ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1456 ../../whatsnew/3.11.rst:1463 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1458 +#: ../../whatsnew/3.11.rst:1456 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Store subscript" msgstr "儲存下標" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Similar to subscripting specialization above." msgstr "類似於上面的下標特化。" -#: ../../whatsnew/3.11.rst:1465 +#: ../../whatsnew/3.11.rst:1463 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "Calls" msgstr "呼叫" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "``f(arg)``" msgstr "``f(arg)``" -#: ../../whatsnew/3.11.rst:1470 +#: ../../whatsnew/3.11.rst:1468 msgid "``C(arg)``" msgstr "``C(arg)``" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "" "Calls to common builtin (C) functions and types such as :func:`len` and :" "class:`str` directly call their underlying C version. This avoids going " @@ -2415,27 +2399,27 @@ msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" "們的 C 版本底層,這避免了通過內部呼叫的慣例。" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1466 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "Load global variable" msgstr "載入全域變數" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "``print``" msgstr "``print``" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1473 msgid "``len``" msgstr "``len``" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." @@ -2443,24 +2427,24 @@ msgstr "" "全域/內建之命名空間內的物件索引被快取起來。載入全域與內建變數不需要任何命名空" "間的查找。" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1471 msgid "[#load-global]_" msgstr "[#load-global]_" -#: ../../whatsnew/3.11.rst:1473 ../../whatsnew/3.11.rst:1477 -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1471 ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1484 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "Load attribute" msgstr "載入屬性" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " @@ -2469,19 +2453,19 @@ msgstr "" "和載入全域變數類似,類別/物件之命名空間內的屬性索引被快取起來。在大部分情況" "中,載入屬性不需要任何命名空間的查找。" -#: ../../whatsnew/3.11.rst:1477 +#: ../../whatsnew/3.11.rst:1475 msgid "[#load-attr]_" msgstr "[#load-attr]_" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "Load methods for call" msgstr "載入要呼叫的方法" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." @@ -2489,54 +2473,54 @@ msgstr "" "方法的真實記憶體地址被快取 (cache) 起來,方法的載入現在不需要命名空間的查找 " "-- 即便有很長繼承鏈結的類別也是。" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1482 +#: ../../whatsnew/3.11.rst:1480 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "Store attribute" msgstr "儲存屬性" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "Similar to load attribute optimization." msgstr "和載入屬性的最佳化相似。" -#: ../../whatsnew/3.11.rst:1486 +#: ../../whatsnew/3.11.rst:1484 msgid "2% in pyperformance" msgstr "2% 於 pyperformance 中" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "Unpack Sequence" msgstr "拆解 (unpack) 序列" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "" "Specialized for common containers such as :class:`list` and :class:`tuple`. " "Avoids internal calling convention." msgstr "" "為像是 :class:`list` 和 :class:`tuple` 的常見容器所特化,避免了內部呼叫慣例。" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1489 +#: ../../whatsnew/3.11.rst:1487 msgid "Brandt Bucher" msgstr "Brandt Bucher" -#: ../../whatsnew/3.11.rst:1494 +#: ../../whatsnew/3.11.rst:1492 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." @@ -2544,7 +2528,7 @@ msgstr "" "類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " "(overhead)。" -#: ../../whatsnew/3.11.rst:1497 +#: ../../whatsnew/3.11.rst:1495 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " "for more forms. Furthermore, all attribute loads should be sped up by :issue:" @@ -2553,11 +2537,11 @@ msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" -#: ../../whatsnew/3.11.rst:1505 +#: ../../whatsnew/3.11.rst:1503 msgid "Misc" msgstr "雜項" -#: ../../whatsnew/3.11.rst:1507 +#: ../../whatsnew/3.11.rst:1505 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " @@ -2567,7 +2551,7 @@ msgstr "" "字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" "`40116` 貢獻。 )" -#: ../../whatsnew/3.11.rst:1511 +#: ../../whatsnew/3.11.rst:1509 msgid "" "\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" "`try` statements when no exception is raised. (Contributed by Mark Shannon " @@ -2576,7 +2560,7 @@ msgstr "" "實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" "`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" -#: ../../whatsnew/3.11.rst:1515 +#: ../../whatsnew/3.11.rst:1513 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " @@ -2585,7 +2569,7 @@ msgstr "" "在直譯器內使用更簡潔的例外表示法將捕獲一個例外所需的時間減少了大約 10%。 由 " "Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1519 +#: ../../whatsnew/3.11.rst:1517 msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " @@ -2600,15 +2584,15 @@ msgstr "" "benchmarks.html#regex-dna>`_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1530 +#: ../../whatsnew/3.11.rst:1528 msgid "FAQ" msgstr "FAQ" -#: ../../whatsnew/3.11.rst:1535 +#: ../../whatsnew/3.11.rst:1533 msgid "How should I write my code to utilize these speedups?" msgstr "我該如何在程式碼中獲取這些加速?" -#: ../../whatsnew/3.11.rst:1537 +#: ../../whatsnew/3.11.rst:1535 msgid "" "Write Pythonic code that follows common best practices; you don't have to " "change your code. The Faster CPython project optimizes for common code " @@ -2617,11 +2601,11 @@ msgstr "" "撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實踐的程式碼就好,你不需要改變" "你的程式碼。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳化。" -#: ../../whatsnew/3.11.rst:1545 +#: ../../whatsnew/3.11.rst:1543 msgid "Will CPython 3.11 use more memory?" msgstr "Python 3.11 會不會使用更多記憶體?" -#: ../../whatsnew/3.11.rst:1547 +#: ../../whatsnew/3.11.rst:1545 msgid "" "Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " @@ -2630,11 +2614,11 @@ msgstr "" "也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物件與" "物件字典的記憶體最佳化而有所偏差。" -#: ../../whatsnew/3.11.rst:1555 +#: ../../whatsnew/3.11.rst:1553 msgid "I don't see any speedups in my workload. Why?" msgstr "我在我的程式當中沒感覺到任何加速,為什麼?" -#: ../../whatsnew/3.11.rst:1557 +#: ../../whatsnew/3.11.rst:1555 msgid "" "Certain code won't have noticeable benefits. If your code spends most of its " "time on I/O operations, or already does most of its computation in a C " @@ -2645,7 +2629,7 @@ msgstr "" "將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個計畫" "是對純 Python 的工作負荷最有幫助。" -#: ../../whatsnew/3.11.rst:1562 +#: ../../whatsnew/3.11.rst:1560 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " @@ -2654,19 +2638,19 @@ msgstr "" "此外,pyperformance 數值為一個幾何平均數 (geometric mean)。即便在 " "pyperformance 基準量測中,某些測試稍微慢了一些,但其他加快了將近兩倍!" -#: ../../whatsnew/3.11.rst:1570 +#: ../../whatsnew/3.11.rst:1568 msgid "Is there a JIT compiler?" msgstr "有用到 JIT 編譯器嗎?" -#: ../../whatsnew/3.11.rst:1572 +#: ../../whatsnew/3.11.rst:1570 msgid "No. We're still exploring other optimizations." msgstr "沒有,我們還在探索其他最佳化方式。" -#: ../../whatsnew/3.11.rst:1578 +#: ../../whatsnew/3.11.rst:1576 msgid "About" msgstr "關於" -#: ../../whatsnew/3.11.rst:1580 +#: ../../whatsnew/3.11.rst:1578 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2677,11 +2661,11 @@ msgstr "" "(microsoft) 所資助以全職發展該計畫,Pablo Galindo Salgado 亦由彭博有限合夥企" "業 (Bloomberg LP) 資助來兼職開發,更有許許多多來自社群的自發性貢獻者。" -#: ../../whatsnew/3.11.rst:1589 +#: ../../whatsnew/3.11.rst:1587 msgid "CPython bytecode changes" msgstr "CPython 位元組碼 (bytecode) 變更" -#: ../../whatsnew/3.11.rst:1591 +#: ../../whatsnew/3.11.rst:1589 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2695,11 +2679,11 @@ msgstr "" "(populated) 快取看起來像任意指示,因此在讀取或修改包含加速資料的原始且適應 " "(adaptive) 位元組碼時應格外小心。" -#: ../../whatsnew/3.11.rst:1603 +#: ../../whatsnew/3.11.rst:1601 msgid "New opcodes" msgstr "新增 opcode" -#: ../../whatsnew/3.11.rst:1605 +#: ../../whatsnew/3.11.rst:1603 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." @@ -2707,7 +2691,7 @@ msgstr "" ":opcode:`ASYNC_GEN_WRAP`、:opcode:`RETURN_GENERATOR` 和 :opcode:`SEND` 被用於" "產生器與協程。" -#: ../../whatsnew/3.11.rst:1608 +#: ../../whatsnew/3.11.rst:1606 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." @@ -2715,17 +2699,17 @@ msgstr "" ":opcode:`COPY_FREE_VARS`,避免了為閉包 (closure) 而生的特殊呼叫方 (caller-" "side) 程式碼的需求。" -#: ../../whatsnew/3.11.rst:1611 +#: ../../whatsnew/3.11.rst:1609 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`,用於某些不需要處理中斷的循環。" -#: ../../whatsnew/3.11.rst:1614 +#: ../../whatsnew/3.11.rst:1612 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" -#: ../../whatsnew/3.11.rst:1616 +#: ../../whatsnew/3.11.rst:1614 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" @@ -2734,29 +2718,29 @@ msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`PREP_RERAISE_STAR`,處理 :pep:`654` 所加" "入的\\ :ref:`新增例外群組和 except* `。" -#: ../../whatsnew/3.11.rst:1620 +#: ../../whatsnew/3.11.rst:1618 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr ":opcode:`PUSH_EXC_INFO` 被用於例外處理函式。" -#: ../../whatsnew/3.11.rst:1622 +#: ../../whatsnew/3.11.rst:1620 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr ":opcode:`RESUME`,為無操作 (no-po),用於內部追查、除錯和最佳化檢查。" -#: ../../whatsnew/3.11.rst:1629 +#: ../../whatsnew/3.11.rst:1627 msgid "Replaced opcodes" msgstr "被取代的操作碼 (opcode)" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "Replaced Opcode(s)" msgstr "被取代的操作碼" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "New Opcode(s)" msgstr "新的操作碼" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1630 msgid "Notes" msgstr "註記" @@ -2768,11 +2752,11 @@ msgstr ":opcode:`!BINARY_*`" msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" -#: ../../whatsnew/3.11.rst:1634 +#: ../../whatsnew/3.11.rst:1632 msgid ":opcode:`BINARY_OP`" msgstr ":opcode:`BINARY_OP`" -#: ../../whatsnew/3.11.rst:1634 +#: ../../whatsnew/3.11.rst:1632 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" @@ -2804,7 +2788,7 @@ msgstr ":opcode:`PRECALL`" msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" -#: ../../whatsnew/3.11.rst:1637 +#: ../../whatsnew/3.11.rst:1635 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2844,7 +2828,7 @@ msgstr ":opcode:`COPY`" msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" -#: ../../whatsnew/3.11.rst:1642 +#: ../../whatsnew/3.11.rst:1640 msgid "Stack manipulation instructions" msgstr "堆疊操作指示" @@ -2856,7 +2840,7 @@ msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:1649 +#: ../../whatsnew/3.11.rst:1647 msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" @@ -2884,7 +2868,7 @@ msgstr ":opcode:`POP_JUMP_BACKWARD_IF_* `" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr ":opcode:`POP_JUMP_FORWARD_IF_* `" -#: ../../whatsnew/3.11.rst:1651 +#: ../../whatsnew/3.11.rst:1649 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2900,15 +2884,15 @@ msgstr ":opcode:`!SETUP_WITH`" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" -#: ../../whatsnew/3.11.rst:1657 +#: ../../whatsnew/3.11.rst:1655 msgid ":opcode:`BEFORE_WITH`" msgstr ":opcode:`BEFORE_WITH`" -#: ../../whatsnew/3.11.rst:1657 +#: ../../whatsnew/3.11.rst:1655 msgid ":keyword:`with` block setup" msgstr ":keyword:`with` 區塊設置" -#: ../../whatsnew/3.11.rst:1661 +#: ../../whatsnew/3.11.rst:1659 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " @@ -2918,11 +2902,11 @@ msgstr "" "`JUMP_IF_TRUE_OR_POP` 和 :opcode:`JUMP_IF_FALSE_OR_POP`。該引數現在是當前指" "示 (instruction) 的偏移量而不是絕對位置。" -#: ../../whatsnew/3.11.rst:1672 +#: ../../whatsnew/3.11.rst:1670 msgid "Changed/removed opcodes" msgstr "有更動/被移除的 opcode" -#: ../../whatsnew/3.11.rst:1674 +#: ../../whatsnew/3.11.rst:1672 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " @@ -2932,7 +2916,7 @@ msgstr "" "值來表示成功/失敗。取而代之的是會在失敗時推送 ``None``,而非一個包含提取值的" "元組。" -#: ../../whatsnew/3.11.rst:1679 +#: ../../whatsnew/3.11.rst:1677 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." @@ -2940,7 +2924,7 @@ msgstr "" "更改了運作於例外的操作碼以反映它們現在在堆疊中的表示為一項而不是三項(請參" "閱 :gh:`89874`)。" -#: ../../whatsnew/3.11.rst:1683 +#: ../../whatsnew/3.11.rst:1681 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." @@ -2948,26 +2932,26 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1691 ../../whatsnew/3.11.rst:2563 +#: ../../whatsnew/3.11.rst:1689 ../../whatsnew/3.11.rst:2561 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.11.rst:1693 +#: ../../whatsnew/3.11.rst:1691 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "這個部分列出了在 Python 3.11 中棄用的 Python API。" -#: ../../whatsnew/3.11.rst:1695 +#: ../../whatsnew/3.11.rst:1693 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "被棄用的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1702 +#: ../../whatsnew/3.11.rst:1700 msgid "Language/Builtins" msgstr "語言/內建" -#: ../../whatsnew/3.11.rst:1704 +#: ../../whatsnew/3.11.rst:1702 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2982,7 +2966,7 @@ msgstr "" "慮使用 Python 3.10 中添加的 :attr:`!__wrapped__` 屬性。(由 Raymond " "Hettinger 在 :gh:`89519` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1712 +#: ../../whatsnew/3.11.rst:1710 msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " @@ -2994,7 +2978,7 @@ msgstr "" "Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" "`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1718 +#: ../../whatsnew/3.11.rst:1716 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -3007,93 +2991,93 @@ msgstr "" "meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" "`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1728 +#: ../../whatsnew/3.11.rst:1726 msgid "Modules" msgstr "模組" -#: ../../whatsnew/3.11.rst:1732 +#: ../../whatsnew/3.11.rst:1730 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr ":pep:`594` 引領下列模組的棄用,並排訂於 Python 3.13 移除:" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1734 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1736 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1742 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1745 +#: ../../whatsnew/3.11.rst:1743 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" @@ -3101,7 +3085,7 @@ msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:1748 +#: ../../whatsnew/3.11.rst:1746 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -3112,7 +3096,7 @@ msgstr "" "用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" "(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1753 +#: ../../whatsnew/3.11.rst:1751 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -3123,7 +3107,7 @@ msgstr "" "析 Python 3.10 或更新版本。有關詳細資訊請參閱 :pep:`617`,它引入了新的 PEG 剖" "析器。(由 Victor Stinner 在 :issue:`40360` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1758 +#: ../../whatsnew/3.11.rst:1756 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" @@ -3133,11 +3117,11 @@ msgstr "" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1764 msgid "Standard Library" msgstr "標準函式庫" -#: ../../whatsnew/3.11.rst:1768 +#: ../../whatsnew/3.11.rst:1766 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " @@ -3146,23 +3130,23 @@ msgstr "" "以下 :mod:`configparser` 相關項目已在 Python 3.2 中棄用,它們的棄用警告現在會" "提示它們即將於 Python 3.12 中移除:" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1770 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr ":class:`!configparser.SafeConfigParser` 類別" -#: ../../whatsnew/3.11.rst:1773 +#: ../../whatsnew/3.11.rst:1771 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr ":attr:`!configparser.ParsingError.filename` 屬性" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1772 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1776 +#: ../../whatsnew/3.11.rst:1774 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45173` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1778 +#: ../../whatsnew/3.11.rst:1776 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -3177,7 +3161,7 @@ msgstr "" "BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " "Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1785 +#: ../../whatsnew/3.11.rst:1783 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -3188,35 +3172,35 @@ msgstr "" "用、並將在未來的 Python 版本中刪除,取而代之的是在 Python 3.9 中添加的替代方" "案:" -#: ../../whatsnew/3.11.rst:1790 +#: ../../whatsnew/3.11.rst:1788 msgid ":func:`importlib.resources.contents`" msgstr ":func:`importlib.resources.contents`" -#: ../../whatsnew/3.11.rst:1791 +#: ../../whatsnew/3.11.rst:1789 msgid ":func:`importlib.resources.is_resource`" msgstr ":func:`importlib.resources.is_resource`" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1790 msgid ":func:`importlib.resources.open_binary`" msgstr ":func:`importlib.resources.open_binary`" -#: ../../whatsnew/3.11.rst:1793 +#: ../../whatsnew/3.11.rst:1791 msgid ":func:`importlib.resources.open_text`" msgstr ":func:`importlib.resources.open_text`" -#: ../../whatsnew/3.11.rst:1794 +#: ../../whatsnew/3.11.rst:1792 msgid ":func:`importlib.resources.read_binary`" msgstr ":func:`importlib.resources.read_binary`" -#: ../../whatsnew/3.11.rst:1795 +#: ../../whatsnew/3.11.rst:1793 msgid ":func:`importlib.resources.read_text`" msgstr ":func:`importlib.resources.read_text`" -#: ../../whatsnew/3.11.rst:1796 +#: ../../whatsnew/3.11.rst:1794 msgid ":func:`importlib.resources.path`" msgstr ":func:`importlib.resources.path`" -#: ../../whatsnew/3.11.rst:1798 +#: ../../whatsnew/3.11.rst:1796 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -3228,7 +3212,7 @@ msgstr "" "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1804 +#: ../../whatsnew/3.11.rst:1802 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " @@ -3238,7 +3222,7 @@ msgstr "" "``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" "`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1808 +#: ../../whatsnew/3.11.rst:1806 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -3254,7 +3238,7 @@ msgstr "" "字母、數字和底線。目前,會針對違反這些規則的語法發出棄用警告。(由 Serhiy " "Storchaka 在 :gh:`91760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1816 +#: ../../whatsnew/3.11.rst:1814 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " @@ -3267,7 +3251,7 @@ msgstr "" "將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" "`92728` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1822 +#: ../../whatsnew/3.11.rst:1820 msgid "" ":func:`turtle.settiltangle` has been deprecated since Python 3.1; it now " "emits a deprecation warning and will be removed in Python 3.13. Use :func:" @@ -3280,7 +3264,7 @@ msgstr "" "誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" "`45837` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1828 +#: ../../whatsnew/3.11.rst:1826 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -3291,7 +3275,7 @@ msgstr "" "用。目前未計劃刪除它,但鼓勵用戶盡可能使用 :class:`str` 代替。(由 Alex " "Waygood 在 :gh:`92332` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1834 +#: ../../whatsnew/3.11.rst:1832 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " @@ -3300,7 +3284,7 @@ msgstr "" "用於建構 :data:`typing.TypedDict` 型別的關鍵字引數語法現已棄用。將在 Python " "3.13 中停止支援。(由 Jingchen Ye 在 :gh:`90224` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1838 +#: ../../whatsnew/3.11.rst:1836 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " @@ -3310,7 +3294,7 @@ msgstr "" "過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" "issue:`42255`。)" -#: ../../whatsnew/3.11.rst:1842 +#: ../../whatsnew/3.11.rst:1840 msgid "" "The behavior of returning a value from a :class:`~unittest.TestCase` and :" "class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " @@ -3320,7 +3304,7 @@ msgstr "" "IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" "用。" -#: ../../whatsnew/3.11.rst:1846 +#: ../../whatsnew/3.11.rst:1844 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" @@ -3328,39 +3312,39 @@ msgstr "" "棄用以下並沒有正式紀錄於文件中的 :mod:`unittest` 函式,並預計於 Python 3.13 " "中移除:" -#: ../../whatsnew/3.11.rst:1849 +#: ../../whatsnew/3.11.rst:1847 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.11.rst:1850 +#: ../../whatsnew/3.11.rst:1848 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1849 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1851 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "改用 :class:`~unittest.TestLoader` 方法:" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1853 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1856 +#: ../../whatsnew/3.11.rst:1854 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1855 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1857 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1861 +#: ../../whatsnew/3.11.rst:1859 msgid "" ":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " "in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" @@ -3368,17 +3352,17 @@ msgstr "" ":meth:`~!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" "(由 Carlos Damázio 在 :gh:`67048` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1870 ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:1868 ../../whatsnew/3.11.rst:2589 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" -#: ../../whatsnew/3.11.rst:1872 +#: ../../whatsnew/3.11.rst:1870 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "下列 API 已在先前的 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:1875 +#: ../../whatsnew/3.11.rst:1873 msgid "" "C APIs pending removal are :ref:`listed separately `." @@ -3386,270 +3370,270 @@ msgstr "" "待定的 C API 移除項目為\\ :ref:`獨立列出的 `。" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1876 msgid "The :mod:`asynchat` module" msgstr ":mod:`asynchat` 模組" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1877 msgid "The :mod:`asyncore` module" msgstr ":mod:`asyncore` 模組" -#: ../../whatsnew/3.11.rst:1880 +#: ../../whatsnew/3.11.rst:1878 msgid "The :ref:`entire distutils package `" msgstr ":ref:`整個 distutils 套件 `" -#: ../../whatsnew/3.11.rst:1881 -msgid "The :mod:`imp` module" -msgstr ":mod:`imp` 模組" +#: ../../whatsnew/3.11.rst:1879 +msgid "The :mod:`!imp` module" +msgstr "" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1880 msgid "The :class:`typing.io ` namespace" msgstr ":class:`typing.io ` 命名空間" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1881 msgid "The :class:`typing.re ` namespace" msgstr ":class:`typing.re ` 命名空間" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1882 msgid ":func:`!cgi.log`" msgstr ":func:`!cgi.log`" +#: ../../whatsnew/3.11.rst:1883 +msgid ":func:`!importlib.find_loader`" +msgstr "" + +#: ../../whatsnew/3.11.rst:1884 +msgid ":meth:`!importlib.abc.Loader.module_repr`" +msgstr "" + #: ../../whatsnew/3.11.rst:1885 -msgid ":func:`importlib.find_loader`" -msgstr ":func:`importlib.find_loader`" +msgid ":meth:`!importlib.abc.MetaPathFinder.find_module`" +msgstr "" #: ../../whatsnew/3.11.rst:1886 -msgid ":meth:`importlib.abc.Loader.module_repr`" -msgstr ":meth:`importlib.abc.Loader.module_repr`" +msgid ":meth:`!importlib.abc.PathEntryFinder.find_loader`" +msgstr "" #: ../../whatsnew/3.11.rst:1887 -msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" -msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" +msgid ":meth:`!importlib.abc.PathEntryFinder.find_module`" +msgstr "" #: ../../whatsnew/3.11.rst:1888 -msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" -msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" - -#: ../../whatsnew/3.11.rst:1889 -msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" -msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" - -#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr ":meth:`!importlib.machinery.BuiltinImporter.find_module`" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr ":meth:`!importlib.machinery.FileFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr ":meth:`!importlib.machinery.FileFinder.find_module`" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr ":meth:`!importlib.machinery.FrozenImporter.find_module`" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1896 -msgid ":meth:`importlib.machinery.PathFinder.find_module`" -msgstr ":meth:`importlib.machinery.PathFinder.find_module`" +#: ../../whatsnew/3.11.rst:1894 +msgid ":meth:`!importlib.machinery.PathFinder.find_module`" +msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1898 -msgid ":func:`importlib.util.module_for_loader`" -msgstr ":func:`importlib.util.module_for_loader`" +#: ../../whatsnew/3.11.rst:1896 +msgid ":func:`!importlib.util.module_for_loader`" +msgstr "" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1897 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr ":func:`!importlib.util.set_loader_wrapper`" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1898 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr ":func:`!importlib.util.set_package_wrapper`" -#: ../../whatsnew/3.11.rst:1901 -msgid ":class:`pkgutil.ImpImporter`" -msgstr ":class:`pkgutil.ImpImporter`" +#: ../../whatsnew/3.11.rst:1899 +msgid ":class:`!pkgutil.ImpImporter`" +msgstr "" -#: ../../whatsnew/3.11.rst:1902 -msgid ":class:`pkgutil.ImpLoader`" -msgstr ":class:`pkgutil.ImpLoader`" +#: ../../whatsnew/3.11.rst:1900 +msgid ":class:`!pkgutil.ImpLoader`" +msgstr "" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1901 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1904 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr ":func:`!sqlite3.enable_shared_cache`" -#: ../../whatsnew/3.11.rst:1905 +#: ../../whatsnew/3.11.rst:1903 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr ":func:`!sqlite3.OptimizedUnicode`" -#: ../../whatsnew/3.11.rst:1906 +#: ../../whatsnew/3.11.rst:1904 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" -#: ../../whatsnew/3.11.rst:1907 +#: ../../whatsnew/3.11.rst:1905 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr ":mod:`unittest` 中被棄用的別名:" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1908 msgid "Deprecated in" msgstr "棄用於" -#: ../../whatsnew/3.11.rst:1912 +#: ../../whatsnew/3.11.rst:1910 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1917 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" +#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 #: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 #: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1915 -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1911 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1911 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1912 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1913 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1915 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1917 msgid "``assert_``" msgstr "``assert_``" +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 #: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 #: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1922 -#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1918 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1919 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1920 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1921 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.11.rst:1925 +#: ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1924 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1933 ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:1931 ../../whatsnew/3.11.rst:2615 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.11.rst:1935 +#: ../../whatsnew/3.11.rst:1933 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "此部分列出 Python 3.11 中移除的 Python API。" -#: ../../whatsnew/3.11.rst:1937 +#: ../../whatsnew/3.11.rst:1935 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "被移除的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1939 +#: ../../whatsnew/3.11.rst:1937 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -3662,7 +3646,7 @@ msgstr "" "相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" "keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1946 +#: ../../whatsnew/3.11.rst:1944 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " @@ -3671,7 +3655,7 @@ msgstr "" "移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." "CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1950 +#: ../../whatsnew/3.11.rst:1948 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3684,7 +3668,7 @@ msgstr "" "socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" "`45129` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1956 +#: ../../whatsnew/3.11.rst:1954 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" @@ -3692,31 +3676,31 @@ msgstr "" "移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" "`binascii` 函式也一併被移除:" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1957 msgid ":func:`!binascii.a2b_hqx`" msgstr ":func:`!binascii.a2b_hqx`" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1958 msgid ":func:`!binascii.b2a_hqx`" msgstr ":func:`!binascii.b2a_hqx`" -#: ../../whatsnew/3.11.rst:1961 +#: ../../whatsnew/3.11.rst:1959 msgid ":func:`!binascii.rlecode_hqx`" msgstr ":func:`!binascii.rlecode_hqx`" -#: ../../whatsnew/3.11.rst:1962 +#: ../../whatsnew/3.11.rst:1960 msgid ":func:`!binascii.rldecode_hqx`" msgstr ":func:`!binascii.rldecode_hqx`" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1962 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr ":func:`binascii.crc_hqx` 維持可用。" -#: ../../whatsnew/3.11.rst:1966 +#: ../../whatsnew/3.11.rst:1964 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "(由 Victor Stinner 於 :issue:`45085` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1968 +#: ../../whatsnew/3.11.rst:1966 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " @@ -3726,7 +3710,7 @@ msgstr "" "``bdist_wheel``\\ (wheel 套件)。(由 Hugo van Kemenade 於 :issue:`45124` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:1972 +#: ../../whatsnew/3.11.rst:1970 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3738,7 +3722,7 @@ msgstr "" "`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1977 +#: ../../whatsnew/3.11.rst:1975 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3755,11 +3739,11 @@ msgstr "" "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" "式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:1985 msgid "Removed from the :mod:`inspect` module:" msgstr "於 :mod:`inspect` 模組中移除:" -#: ../../whatsnew/3.11.rst:1989 +#: ../../whatsnew/3.11.rst:1987 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." @@ -3767,7 +3751,7 @@ msgstr "" "Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" "func:`inspect.getfullargspec`。" -#: ../../whatsnew/3.11.rst:1992 +#: ../../whatsnew/3.11.rst:1990 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " @@ -3776,7 +3760,7 @@ msgstr "" "Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." "signature` 函式或 :class:`inspect.Signature` 物件。" -#: ../../whatsnew/3.11.rst:1996 +#: ../../whatsnew/3.11.rst:1994 msgid "" "The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." "from_function` methods, deprecated since Python 3.5; use the :meth:" @@ -3786,11 +3770,11 @@ msgstr "" "meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " "` 方法。" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:1999 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2003 +#: ../../whatsnew/3.11.rst:2001 msgid "" "Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." "PurePath`, because it was not used and added by mistake in previous " @@ -3800,7 +3784,7 @@ msgstr "" "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:2008 +#: ../../whatsnew/3.11.rst:2006 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " @@ -3809,7 +3793,7 @@ msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" "套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" -#: ../../whatsnew/3.11.rst:2012 +#: ../../whatsnew/3.11.rst:2010 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" @@ -3817,7 +3801,7 @@ msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" -#: ../../whatsnew/3.11.rst:2015 +#: ../../whatsnew/3.11.rst:2013 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " @@ -3826,7 +3810,7 @@ msgstr "" "從 :mod:`unittest` 中刪除了命名空間套件支援。它在 Python 3.4 中引入,但自 " "Python 3.7 以來已無法運作。(由 Inada Naoki 在 :issue:`23882` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2019 +#: ../../whatsnew/3.11.rst:2017 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3839,7 +3823,7 @@ msgstr "" "到:「你大概不會想要使用這個函式,它只為了讓 Python 測試系列套件 (suite) 使用" "而存在。」(由 Victor Stinner 於 :issue:`46852` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2025 +#: ../../whatsnew/3.11.rst:2023 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " @@ -3848,7 +3832,7 @@ msgstr "" "移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" "c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" -#: ../../whatsnew/3.11.rst:2029 +#: ../../whatsnew/3.11.rst:2027 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3859,11 +3843,11 @@ msgstr "" "編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" -#: ../../whatsnew/3.11.rst:2039 ../../whatsnew/3.11.rst:2261 +#: ../../whatsnew/3.11.rst:2037 ../../whatsnew/3.11.rst:2259 msgid "Porting to Python 3.11" msgstr "移植至 Python 3.11" -#: ../../whatsnew/3.11.rst:2041 +#: ../../whatsnew/3.11.rst:2039 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." @@ -3871,13 +3855,13 @@ msgstr "" "本部分列出了之前描述的 Python API 中可能需要你去更改 Python 程式碼的變更和其" "他錯誤修復。" -#: ../../whatsnew/3.11.rst:2044 +#: ../../whatsnew/3.11.rst:2042 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "C API 的移植被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:2047 +#: ../../whatsnew/3.11.rst:2045 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3894,7 +3878,7 @@ msgstr "" "ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" "(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2056 +#: ../../whatsnew/3.11.rst:2054 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3905,7 +3889,7 @@ msgstr "" "證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" "gh:`93351` 中貢獻)" -#: ../../whatsnew/3.11.rst:2060 +#: ../../whatsnew/3.11.rst:2058 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " @@ -3915,7 +3899,7 @@ msgstr "" "ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" "(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2065 +#: ../../whatsnew/3.11.rst:2063 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3927,7 +3911,7 @@ msgstr "" "getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" "issue:`46659` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2071 +#: ../../whatsnew/3.11.rst:2069 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " @@ -3936,7 +3920,7 @@ msgstr "" ":mod:`pdb` 模組現在會讀取 ``'UTF-8'`` 編碼的 :file:`.pdbrc` 配置檔案。" "(Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 於 :issue:`41137` 貢獻。)" -#: ../../whatsnew/3.11.rst:2075 +#: ../../whatsnew/3.11.rst:2073 msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " @@ -3948,7 +3932,7 @@ msgstr "" "`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" "exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2081 +#: ../../whatsnew/3.11.rst:2079 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " "was previously an arbitrary random function to use for the shuffle; now, :" @@ -3958,7 +3942,7 @@ msgstr "" "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" "預設值)。" -#: ../../whatsnew/3.11.rst:2085 +#: ../../whatsnew/3.11.rst:2083 msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " @@ -3969,7 +3953,7 @@ msgstr "" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。 (由 " "Serhiy Storchaka 在 :issue:`47066` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2090 +#: ../../whatsnew/3.11.rst:2088 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3980,11 +3964,11 @@ msgstr "" "致捕獲群組 (capture group) 得到錯誤的結果。因此,這可能會在這些情況下更改捕獲" "的輸出。(Ma Lin 在 :issue:`35859` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2097 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.11.rst:2101 +#: ../../whatsnew/3.11.rst:2099 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -4008,11 +3992,11 @@ msgstr "" "Christian Heimes 和 Ethan Smith 在 :gh:`84461` 貢獻,WASI 由 Christian " "Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" -#: ../../whatsnew/3.11.rst:2115 +#: ../../whatsnew/3.11.rst:2113 msgid "Building CPython now requires:" msgstr "建置 CPython 現在必須要有:" -#: ../../whatsnew/3.11.rst:2117 +#: ../../whatsnew/3.11.rst:2115 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ 並非必要。(由 Victor Stinner " "於 :issue:`46656`、:issue:`45440` 和 :issue:`46640` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2124 +#: ../../whatsnew/3.11.rst:2122 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" @@ -4033,7 +4017,7 @@ msgstr "" "對 `IEEE 754 `_ 浮點數的支援(由 " "Victor Stinner 於 :issue:`46917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2128 +#: ../../whatsnew/3.11.rst:2126 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " @@ -4042,7 +4026,7 @@ msgstr "" ":c:macro:`!Py_NO_NAN` 巨集已被移除。因為 CPython 現在需要 IEEE 754 浮點數," "NaN 數值皆為可得的。(由 Victor Stinner 在 :issue:`46656` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2132 +#: ../../whatsnew/3.11.rst:2130 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" @@ -4050,7 +4034,7 @@ msgstr "" ":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" "的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2136 +#: ../../whatsnew/3.11.rst:2134 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -4069,7 +4053,7 @@ msgstr "" "和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" "issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2146 +#: ../../whatsnew/3.11.rst:2144 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" @@ -4077,7 +4061,7 @@ msgstr "" "libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2149 +#: ../../whatsnew/3.11.rst:2147 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -4089,18 +4073,15 @@ msgstr "" "html>`_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2154 +#: ../../whatsnew/3.11.rst:2152 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " -"option :option:`!--without-freelists` can be used to disable all freelists " +"option :option:`--without-freelists` can be used to disable all freelists " "except empty tuple singleton. (Contributed by Christian Heimes in :issue:" "`45522`.)" msgstr "" -"物件結構的空閒列表現在可被禁用。一個新的 :program:`configure` 選項 :option:`!" -"—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。(由 Christian " -"Heimes 在 :issue:`45522` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2159 +#: ../../whatsnew/3.11.rst:2157 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -4113,7 +4094,7 @@ msgstr "" "的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" "`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2166 +#: ../../whatsnew/3.11.rst:2164 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -4124,7 +4105,7 @@ msgstr "" "Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" "includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" -#: ../../whatsnew/3.11.rst:2172 +#: ../../whatsnew/3.11.rst:2170 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -4136,7 +4117,7 @@ msgstr "" "pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" "示。" -#: ../../whatsnew/3.11.rst:2177 +#: ../../whatsnew/3.11.rst:2175 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " @@ -4154,11 +4135,11 @@ msgstr "" "此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:2190 +#: ../../whatsnew/3.11.rst:2188 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.11.rst:2197 +#: ../../whatsnew/3.11.rst:2195 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" @@ -4166,7 +4147,7 @@ msgstr "" "新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" "`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2200 +#: ../../whatsnew/3.11.rst:2198 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" @@ -4174,7 +4155,7 @@ msgstr "" "新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" "(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2203 +#: ../../whatsnew/3.11.rst:2201 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -4185,7 +4166,7 @@ msgstr "" "c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" "析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2208 +#: ../../whatsnew/3.11.rst:2206 msgid "" "Added the :c:data:`Py_Version` constant which bears the same value as :c:" "macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" @@ -4194,61 +4175,61 @@ msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2210 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr ":c:type:`Py_buffer` 與 API 目前是受限 API 與穩定 ABI 中的一部分:" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2213 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2214 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2215 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2218 +#: ../../whatsnew/3.11.rst:2216 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2219 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2225 +#: ../../whatsnew/3.11.rst:2223 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2226 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2225 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" @@ -4256,11 +4237,11 @@ msgstr "" ":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." "bf_releasebuffer` 型別插槽 (type slot)" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2228 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2232 +#: ../../whatsnew/3.11.rst:2230 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -4271,7 +4252,7 @@ msgstr "" "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2237 +#: ../../whatsnew/3.11.rst:2235 msgid "" "Add new functions to pack and unpack C double (serialize and deserialize): :" "c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" @@ -4283,7 +4264,7 @@ msgstr "" "`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" "(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2243 +#: ../../whatsnew/3.11.rst:2241 msgid "" "Add new functions to get frame object attributes: :c:func:" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" @@ -4293,7 +4274,7 @@ msgstr "" "`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" "`PyFrame_GetLasti`。" -#: ../../whatsnew/3.11.rst:2247 +#: ../../whatsnew/3.11.rst:2245 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -4307,7 +4288,7 @@ msgstr "" "例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2254 +#: ../../whatsnew/3.11.rst:2252 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -4315,7 +4296,7 @@ msgstr "" "新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " "中所貢獻。)" -#: ../../whatsnew/3.11.rst:2265 +#: ../../whatsnew/3.11.rst:2263 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -4333,7 +4314,7 @@ msgstr "" "要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2276 +#: ../../whatsnew/3.11.rst:2274 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -4344,7 +4325,7 @@ msgstr "" "現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" "照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2282 +#: ../../whatsnew/3.11.rst:2280 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " @@ -4354,7 +4335,7 @@ msgstr "" "``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2286 +#: ../../whatsnew/3.11.rst:2284 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -4365,7 +4346,7 @@ msgstr "" "件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " "Kumar Aditya 在 :issue:`46608` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2292 +#: ../../whatsnew/3.11.rst:2290 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " @@ -4375,7 +4356,7 @@ msgstr "" "數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" "閱 :pep:`523`。" -#: ../../whatsnew/3.11.rst:2296 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -4388,7 +4369,7 @@ msgstr "" "碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" "版本。" -#: ../../whatsnew/3.11.rst:2302 +#: ../../whatsnew/3.11.rst:2300 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -4403,7 +4384,7 @@ msgstr "" "和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" "`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2310 +#: ../../whatsnew/3.11.rst:2308 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " @@ -4413,21 +4394,21 @@ msgstr "" "``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " "``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" -#: ../../whatsnew/3.11.rst:2314 +#: ../../whatsnew/3.11.rst:2312 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" "一個用到老舊巨集的 tp_dealloc 函式,像是:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2325 +#: ../../whatsnew/3.11.rst:2323 msgid "should migrate to the new macros as follows::" msgstr "" "應該要搬遷到新的巨集,如下所示:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2336 +#: ../../whatsnew/3.11.rst:2334 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." @@ -4435,7 +4416,7 @@ msgstr "" "請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函式 " "(deallocation function)。" -#: ../../whatsnew/3.11.rst:2339 +#: ../../whatsnew/3.11.rst:2337 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " @@ -4446,7 +4427,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2351 +#: ../../whatsnew/3.11.rst:2349 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -4458,7 +4439,7 @@ msgstr "" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:2356 +#: ../../whatsnew/3.11.rst:2354 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -4469,7 +4450,7 @@ msgstr "" "向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2361 +#: ../../whatsnew/3.11.rst:2359 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -4481,11 +4462,11 @@ msgstr "" "c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" "個巨集:" -#: ../../whatsnew/3.11.rst:2373 ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2371 ../../whatsnew/3.11.rst:2385 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2375 +#: ../../whatsnew/3.11.rst:2373 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -4497,7 +4478,7 @@ msgstr "" "`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" "集:" -#: ../../whatsnew/3.11.rst:2389 +#: ../../whatsnew/3.11.rst:2387 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -4510,7 +4491,7 @@ msgstr "" "和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" "標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2395 +#: ../../whatsnew/3.11.rst:2393 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -4527,7 +4508,7 @@ msgstr "" "檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " "(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2403 +#: ../../whatsnew/3.11.rst:2401 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -4538,7 +4519,7 @@ msgstr "" "使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" "`46007` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2408 +#: ../../whatsnew/3.11.rst:2406 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " @@ -4547,49 +4528,49 @@ msgstr "" "以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" "用,不必再加上 ``#include ``:" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2410 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2413 +#: ../../whatsnew/3.11.rst:2411 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2414 +#: ../../whatsnew/3.11.rst:2412 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2413 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2418 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2421 +#: ../../whatsnew/3.11.rst:2419 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2423 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr ":c:type:`PyFrameObject` 結構成員已經從公開的 C API 中移除。" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2426 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " @@ -4598,7 +4579,7 @@ msgstr "" "雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" "長時間,並被用於幾個流行的擴充套件中。" -#: ../../whatsnew/3.11.rst:2432 +#: ../../whatsnew/3.11.rst:2430 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " @@ -4607,39 +4588,39 @@ msgstr "" "Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" "位被整個移除。" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2434 msgid ":c:type:`PyFrameObject` fields:" msgstr ":c:type:`PyFrameObject` 欄位:" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2436 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2439 +#: ../../whatsnew/3.11.rst:2437 msgid "``f_blockstack``: removed." msgstr "``f_blockstack``:已移除。" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2438 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" -#: ../../whatsnew/3.11.rst:2441 +#: ../../whatsnew/3.11.rst:2439 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" -#: ../../whatsnew/3.11.rst:2442 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2441 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_iblock``: removed." msgstr "``f_iblock``:已移除。" -#: ../../whatsnew/3.11.rst:2445 +#: ../../whatsnew/3.11.rst:2443 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " @@ -4649,27 +4630,27 @@ msgstr "" "``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" "`PyFrame_GetLineNumber`;它可能會更快。" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2447 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_stackdepth``: removed." msgstr "``f_stackdepth``:已移除。" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2449 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_trace``: no public API." msgstr "``f_trace``:無公開 API。" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2451 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." @@ -4677,7 +4658,7 @@ msgstr "" "``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_lines”)``。" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2452 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." @@ -4685,15 +4666,15 @@ msgstr "" "``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_opcodes”)``。" -#: ../../whatsnew/3.11.rst:2455 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_valuestack``: removed." msgstr "``f_valuestack``:已移除。" -#: ../../whatsnew/3.11.rst:2458 +#: ../../whatsnew/3.11.rst:2456 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -4703,7 +4684,7 @@ msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" "接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2463 +#: ../../whatsnew/3.11.rst:2461 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -4716,21 +4697,21 @@ msgstr "" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2469 +#: ../../whatsnew/3.11.rst:2467 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2479 +#: ../../whatsnew/3.11.rst:2477 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2489 +#: ../../whatsnew/3.11.rst:2487 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4738,11 +4719,11 @@ msgstr "" "或是使用 `pythoncap_compat 計畫 `__\\ 來在舊版 Python 函式中取得這兩個函式。" -#: ../../whatsnew/3.11.rst:2493 +#: ../../whatsnew/3.11.rst:2491 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2495 +#: ../../whatsnew/3.11.rst:2493 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4752,7 +4733,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2499 +#: ../../whatsnew/3.11.rst:2497 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4762,7 +4743,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2502 +#: ../../whatsnew/3.11.rst:2500 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4770,18 +4751,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2504 +#: ../../whatsnew/3.11.rst:2502 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2506 +#: ../../whatsnew/3.11.rst:2504 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2516 +#: ../../whatsnew/3.11.rst:2514 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4791,7 +4772,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2542 +#: ../../whatsnew/3.11.rst:2540 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." @@ -4799,13 +4780,13 @@ msgstr "" "或是使用 `pythoncap-compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2546 +#: ../../whatsnew/3.11.rst:2544 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2549 +#: ../../whatsnew/3.11.rst:2547 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -4816,7 +4797,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2552 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " @@ -4829,60 +4810,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2565 +#: ../../whatsnew/3.11.rst:2563 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2567 +#: ../../whatsnew/3.11.rst:2565 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2568 +#: ../../whatsnew/3.11.rst:2566 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2569 +#: ../../whatsnew/3.11.rst:2567 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2570 +#: ../../whatsnew/3.11.rst:2568 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2571 +#: ../../whatsnew/3.11.rst:2569 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2572 +#: ../../whatsnew/3.11.rst:2570 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2573 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2574 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2576 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2578 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2578 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4891,7 +4872,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2582 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4899,77 +4880,77 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2593 +#: ../../whatsnew/3.11.rst:2591 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:2596 +#: ../../whatsnew/3.11.rst:2594 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2597 +#: ../../whatsnew/3.11.rst:2595 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2598 +#: ../../whatsnew/3.11.rst:2596 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2599 +#: ../../whatsnew/3.11.rst:2597 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2600 +#: ../../whatsnew/3.11.rst:2598 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2601 +#: ../../whatsnew/3.11.rst:2599 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2602 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2604 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2606 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2607 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:2617 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" @@ -4977,35 +4958,35 @@ msgstr "" "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " "Shannon 於 :issue:`40222` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2621 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2623 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2624 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2625 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2628 +#: ../../whatsnew/3.11.rst:2626 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2627 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2629 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2633 +#: ../../whatsnew/3.11.rst:2631 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -5017,7 +4998,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2638 +#: ../../whatsnew/3.11.rst:2636 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5026,7 +5007,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2642 +#: ../../whatsnew/3.11.rst:2640 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5035,41 +5016,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2646 +#: ../../whatsnew/3.11.rst:2644 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2647 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2648 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2649 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2652 +#: ../../whatsnew/3.11.rst:2650 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2651 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2655 -msgid "These are not part of the :ref:`limited API `." -msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" +#: ../../whatsnew/3.11.rst:2653 +msgid "These are not part of the :ref:`limited API `." +msgstr "" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2655 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2659 +#: ../../whatsnew/3.11.rst:2657 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " @@ -5079,7 +5060,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2662 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -5090,7 +5071,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2667 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5098,7 +5079,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2675 +#: ../../whatsnew/3.11.rst:2673 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " @@ -5107,63 +5088,63 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2680 +#: ../../whatsnew/3.11.rst:2678 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2680 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2683 +#: ../../whatsnew/3.11.rst:2681 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2682 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2683 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2693 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2694 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" @@ -5171,26 +5152,79 @@ msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2702 -msgid "Notable Changes in 3.11.4" -msgstr "3.11.4 中值得注意的變更" - -#: ../../whatsnew/3.11.rst:2705 -msgid "tarfile" -msgstr "tarfile" - -#: ../../whatsnew/3.11.rst:2707 -msgid "" -"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " -"have a new a *filter* argument that allows limiting tar features than may be " -"surprising or dangerous, such as creating files outside the destination " -"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.12, " -"use without the *filter* argument will show a :exc:`DeprecationWarning`. In " -"Python 3.14, the default will switch to ``'data'``. (Contributed by Petr " -"Viktorin in :pep:`706`.)" -msgstr "" -":mod:`tarfile` 和 :func:`shutil.unpack_archive` 中的提取方法有一個新的 " -"*filter* 引數,它僅允許有限的 tar 功能、停用一些危險的功能,例如在目標目錄之" -"外建立檔案。詳細資訊請參閱 :ref:`tarfile-extraction-filter`。在 Python 3.12 " -"中,不帶 *filter* 引數使用將顯示 :exc:`DeprecationWarning`。在 Python 3.14 中" -"會將預設切換為 ``'data'``。(由 Petr Viktorin 在 :pep:`706` 中貢獻。)" +#~ msgid "Release" +#~ msgstr "發行版本" + +#~ msgid "|release|" +#~ msgstr "|release|" + +#~ msgid "Date" +#~ msgstr "日期" + +#~ msgid "|today|" +#~ msgstr "|today|" + +#~ msgid "The :mod:`imp` module" +#~ msgstr ":mod:`imp` 模組" + +#~ msgid ":func:`importlib.find_loader`" +#~ msgstr ":func:`importlib.find_loader`" + +#~ msgid ":meth:`importlib.abc.Loader.module_repr`" +#~ msgstr ":meth:`importlib.abc.Loader.module_repr`" + +#~ msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" +#~ msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" + +#~ msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" +#~ msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" + +#~ msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" +#~ msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" + +#~ msgid ":meth:`importlib.machinery.PathFinder.find_module`" +#~ msgstr ":meth:`importlib.machinery.PathFinder.find_module`" + +#~ msgid ":func:`importlib.util.module_for_loader`" +#~ msgstr ":func:`importlib.util.module_for_loader`" + +#~ msgid ":class:`pkgutil.ImpImporter`" +#~ msgstr ":class:`pkgutil.ImpImporter`" + +#~ msgid ":class:`pkgutil.ImpLoader`" +#~ msgstr ":class:`pkgutil.ImpLoader`" + +#~ msgid "" +#~ "Freelists for object structs can now be disabled. A new :program:" +#~ "`configure` option :option:`!--without-freelists` can be used to disable " +#~ "all freelists except empty tuple singleton. (Contributed by Christian " +#~ "Heimes in :issue:`45522`.)" +#~ msgstr "" +#~ "物件結構的空閒列表現在可被禁用。一個新的 :program:`configure` 選項 :" +#~ "option:`!—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。" +#~ "(由 Christian Heimes 在 :issue:`45522` 中貢獻。)" + +#~ msgid "These are not part of the :ref:`limited API `." +#~ msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" + +#~ msgid "Notable Changes in 3.11.4" +#~ msgstr "3.11.4 中值得注意的變更" + +#~ msgid "tarfile" +#~ msgstr "tarfile" + +#~ msgid "" +#~ "The extraction methods in :mod:`tarfile`, and :func:`shutil." +#~ "unpack_archive`, have a new a *filter* argument that allows limiting tar " +#~ "features than may be surprising or dangerous, such as creating files " +#~ "outside the destination directory. See :ref:`tarfile-extraction-filter` " +#~ "for details. In Python 3.12, use without the *filter* argument will show " +#~ "a :exc:`DeprecationWarning`. In Python 3.14, the default will switch to " +#~ "``'data'``. (Contributed by Petr Viktorin in :pep:`706`.)" +#~ msgstr "" +#~ ":mod:`tarfile` 和 :func:`shutil.unpack_archive` 中的提取方法有一個新的 " +#~ "*filter* 引數,它僅允許有限的 tar 功能、停用一些危險的功能,例如在目標目錄" +#~ "之外建立檔案。詳細資訊請參閱 :ref:`tarfile-extraction-filter`。在 Python " +#~ "3.12 中,不帶 *filter* 引數使用將顯示 :exc:`DeprecationWarning`。在 " +#~ "Python 3.14 中會將預設切換為 ``'data'``。(由 Petr Viktorin 在 :pep:`706` " +#~ "中貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po new file mode 100644 index 0000000000..6fa6961f79 --- /dev/null +++ b/whatsnew/3.12.po @@ -0,0 +1,3225 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../whatsnew/3.12.rst:4 +msgid "What's New In Python 3.12" +msgstr "" + +#: ../../whatsnew/3.12.rst:0 +msgid "Release" +msgstr "" + +#: ../../whatsnew/3.12.rst:6 +msgid "|release|" +msgstr "" + +#: ../../whatsnew/3.12.rst:0 +msgid "Date" +msgstr "" + +#: ../../whatsnew/3.12.rst:7 +msgid "|today|" +msgstr "" + +#: ../../whatsnew/3.12.rst:49 +msgid "" +"This article explains the new features in Python 3.12, compared to 3.11." +msgstr "" + +#: ../../whatsnew/3.12.rst:51 +msgid "For full details, see the :ref:`changelog `." +msgstr "" + +#: ../../whatsnew/3.12.rst:55 +msgid "" +"Prerelease users should be aware that this document is currently in draft " +"form. It will be updated substantially as Python 3.12 moves towards release, " +"so it's worth checking back even after reading earlier versions." +msgstr "" + +#: ../../whatsnew/3.12.rst:61 +msgid "Summary -- Release highlights" +msgstr "" + +#: ../../whatsnew/3.12.rst:69 +msgid "New grammar features:" +msgstr "" + +#: ../../whatsnew/3.12.rst:71 +msgid ":pep:`701`: Syntactic formalization of f-strings" +msgstr "" + +#: ../../whatsnew/3.12.rst:73 +msgid "New typing features:" +msgstr "" + +#: ../../whatsnew/3.12.rst:75 +msgid ":pep:`688`: Making the buffer protocol accessible in Python" +msgstr "" + +#: ../../whatsnew/3.12.rst:77 +msgid ":ref:`whatsnew312-pep692`" +msgstr "" + +#: ../../whatsnew/3.12.rst:79 +msgid ":ref:`whatsnew312-pep695`" +msgstr "" + +#: ../../whatsnew/3.12.rst:81 +msgid ":pep:`698`: Override Decorator for Static Typing" +msgstr "" + +#: ../../whatsnew/3.12.rst:83 +msgid "Important deprecations, removals or restrictions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:85 +msgid ":pep:`623`: Remove wstr from Unicode" +msgstr "" + +#: ../../whatsnew/3.12.rst:87 +msgid ":pep:`632`: Remove the ``distutils`` package" +msgstr "" + +#: ../../whatsnew/3.12.rst:90 +msgid "Improved Error Messages" +msgstr "" + +#: ../../whatsnew/3.12.rst:92 +msgid "" +"Modules from the standard library are now potentially suggested as part of " +"the error messages displayed by the interpreter when a :exc:`NameError` is " +"raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." +msgstr "" + +#: ../../whatsnew/3.12.rst:101 +msgid "" +"Improve the error suggestion for :exc:`NameError` exceptions for instances. " +"Now if a :exc:`NameError` is raised in a method and the instance has an " +"attribute that's exactly equal to the name in the exception, the suggestion " +"will include ``self.`` instead of the closest match in the method " +"scope. Contributed by Pablo Galindo in :gh:`99139`." +msgstr "" + +#: ../../whatsnew/3.12.rst:122 +msgid "" +"Improve the :exc:`SyntaxError` error message when the user types ``import x " +"from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" +"`98931`." +msgstr "" + +#: ../../whatsnew/3.12.rst:132 +msgid "" +":exc:`ImportError` exceptions raised from failed ``from import " +"`` statements now include suggestions for the value of ```` " +"based on the available names in ````. Contributed by Pablo Galindo " +"in :gh:`91058`." +msgstr "" + +#: ../../whatsnew/3.12.rst:143 ../../whatsnew/3.12.rst:1600 +msgid "New Features" +msgstr "" + +#: ../../whatsnew/3.12.rst:148 +msgid "PEP 701: Syntactic formalization of f-strings" +msgstr "" + +#: ../../whatsnew/3.12.rst:150 +msgid "" +":pep:`701` lifts some restrictions on the usage of f-strings. Expression " +"components inside f-strings can now be any valid Python expression including " +"backslashes, unicode escaped sequences, multi-line expressions, comments and " +"strings reusing the same quote as the containing f-string. Let's cover these " +"in detail:" +msgstr "" + +#: ../../whatsnew/3.12.rst:155 +msgid "" +"Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" +"string raises a :exc:`SyntaxError`, forcing the user to either use other " +"available quotes (like using double quotes or triple quotes if the f-string " +"uses single quotes). In Python 3.12, you can now do things like this:" +msgstr "" + +#: ../../whatsnew/3.12.rst:164 +msgid "" +"Note that before this change there was no explicit limit in how f-strings " +"can be nested, but the fact that string quotes cannot be reused inside the " +"expression component of f-strings made it impossible to nest f-strings " +"arbitrarily. In fact, this is the most nested f-string that could be written:" +msgstr "" + +#: ../../whatsnew/3.12.rst:172 +msgid "" +"As now f-strings can contain any valid Python expression inside expression " +"components, it is now possible to nest f-strings arbitrarily:" +msgstr "" + +#: ../../whatsnew/3.12.rst:178 +msgid "" +"Multi-line expressions and comments: In Python 3.11, f-strings expressions " +"must be defined in a single line even if outside f-strings expressions could " +"span multiple lines (like literal lists being defined over multiple lines), " +"making them harder to read. In Python 3.12 you can now define expressions " +"spanning multiple lines and include comments on them:" +msgstr "" + +#: ../../whatsnew/3.12.rst:191 +msgid "" +"Backslashes and unicode characters: before Python 3.12 f-string expressions " +"couldn't contain any ``\\`` character. This also affected unicode escaped " +"sequences (such as ``\\N{snowman}``) as these contain the ``\\N`` part that " +"previously could not be part of expression components of f-strings. Now, you " +"can define expressions like this:" +msgstr "" + +#: ../../whatsnew/3.12.rst:204 +msgid "See :pep:`701` for more details." +msgstr "" + +#: ../../whatsnew/3.12.rst:206 +msgid "" +"As a positive side-effect of how this feature has been implemented (by " +"parsing f-strings with the PEG parser (see :pep:`617`), now error messages " +"for f-strings are more precise and include the exact location of the error. " +"For example, in Python 3.11, the following f-string raises a :exc:" +"`SyntaxError`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:219 +msgid "" +"but the error message doesn't include the exact location of the error within " +"the line and also has the expression artificially surrounded by parentheses. " +"In Python 3.12, as f-strings are parsed with the PEG parser, error messages " +"can be more precise and show the entire line:" +msgstr "" + +#: ../../whatsnew/3.12.rst:231 +msgid "" +"(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " +"Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " +"Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." +msgstr "" + +#: ../../whatsnew/3.12.rst:238 +msgid "PEP 709: Comprehension inlining" +msgstr "" + +#: ../../whatsnew/3.12.rst:240 +msgid "" +"Dictionary, list, and set comprehensions are now inlined, rather than " +"creating a new single-use function object for each execution of the " +"comprehension. This speeds up execution of a comprehension by up to 2x." +msgstr "" + +#: ../../whatsnew/3.12.rst:244 +msgid "" +"Comprehension iteration variables remain isolated; they don't overwrite a " +"variable of the same name in the outer scope, nor are they visible after the " +"comprehension. This isolation is now maintained via stack/locals " +"manipulation, not via separate function scope." +msgstr "" + +#: ../../whatsnew/3.12.rst:249 +msgid "Inlining does result in a few visible behavior changes:" +msgstr "" + +#: ../../whatsnew/3.12.rst:251 +msgid "" +"There is no longer a separate frame for the comprehension in tracebacks, and " +"tracing/profiling no longer shows the comprehension as a function call." +msgstr "" + +#: ../../whatsnew/3.12.rst:253 +msgid "" +"Calling :func:`locals` inside a comprehension now includes variables from " +"outside the comprehension, and no longer includes the synthetic ``.0`` " +"variable for the comprehension \"argument\"." +msgstr "" + +#: ../../whatsnew/3.12.rst:256 +msgid "" +"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " +"locals()]``) may see \"RuntimeError: dictionary changed size during " +"iteration\" when run under tracing (e.g. code coverage measurement). This is " +"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " +"error, first create a list of keys to iterate over: ``keys = list(locals()); " +"[k for k in keys]``." +msgstr "" + +#: ../../whatsnew/3.12.rst:263 +msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." +msgstr "" + +#: ../../whatsnew/3.12.rst:266 +msgid "PEP 688: Making the buffer protocol accessible in Python" +msgstr "" + +#: ../../whatsnew/3.12.rst:268 +msgid "" +":pep:`688` introduces a way to use the :ref:`buffer protocol " +"` from Python code. Classes that implement the :meth:`~object." +"__buffer__` method are now usable as buffer types." +msgstr "" + +#: ../../whatsnew/3.12.rst:272 +msgid "" +"The new :class:`collections.abc.Buffer` ABC provides a standard way to " +"represent buffer objects, for example in type annotations. The new :class:" +"`inspect.BufferFlags` enum represents the flags that can be used to " +"customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:279 +msgid "New Features Related to Type Hints" +msgstr "" + +#: ../../whatsnew/3.12.rst:281 +msgid "" +"This section covers major changes affecting :pep:`484` type hints and the :" +"mod:`typing` module." +msgstr "" + +#: ../../whatsnew/3.12.rst:287 +msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" +msgstr "" + +#: ../../whatsnew/3.12.rst:289 +msgid "" +"Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " +"allowed for valid annotations only in cases where all of the ``**kwargs`` " +"were of the same type." +msgstr "" + +#: ../../whatsnew/3.12.rst:293 +msgid "" +"This PEP specifies a more precise way of typing ``**kwargs`` by relying on " +"typed dictionaries::" +msgstr "" + +#: ../../whatsnew/3.12.rst:304 +msgid "See :pep:`692` for more details." +msgstr "" + +#: ../../whatsnew/3.12.rst:306 +msgid "(Contributed by Franek Magiera in :gh:`103629`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:309 +msgid "PEP 698: Override Decorator for Static Typing" +msgstr "" + +#: ../../whatsnew/3.12.rst:311 +msgid "" +"A new decorator :func:`typing.override` has been added to the :mod:`typing` " +"module. It indicates to type checkers that the method is intended to " +"override a method in a superclass. This allows type checkers to catch " +"mistakes where a method that is intended to override something in a base " +"class does not in fact do so." +msgstr "" + +#: ../../whatsnew/3.12.rst:317 +msgid "Example::" +msgstr "" + +#: ../../whatsnew/3.12.rst:335 +msgid "(Contributed by Steven Troxler in :gh:`101561`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:340 +msgid "PEP 695: Type Parameter Syntax" +msgstr "" + +#: ../../whatsnew/3.12.rst:342 +msgid "" +"Generic classes and functions under :pep:`484` were declared using a verbose " +"syntax that left the scope of type parameters unclear and required explicit " +"declarations of variance." +msgstr "" + +#: ../../whatsnew/3.12.rst:346 +msgid "" +":pep:`695` introduces a new, more compact and explicit way to create :ref:" +"`generic classes ` and :ref:`functions `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:359 +msgid "" +"In addition, the PEP introduces a new way to declare :ref:`type aliases " +"` using the :keyword:`type` statement, which creates an " +"instance of :class:`~typing.TypeAliasType`::" +msgstr "" + +#: ../../whatsnew/3.12.rst:365 +msgid "Type aliases can also be :ref:`generic `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:369 +msgid "" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" +"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " +"parameters with bounds or constraints::" +msgstr "" + +#: ../../whatsnew/3.12.rst:378 +msgid "" +"The value of type aliases and the bound and constraints of type variables " +"created through this syntax are evaluated only on demand (see :ref:`lazy-" +"evaluation`). This means type aliases are able to refer to other types " +"defined later in the file." +msgstr "" + +#: ../../whatsnew/3.12.rst:383 +msgid "" +"Type parameters declared through a type parameter list are visible within " +"the scope of the declaration and any nested scopes, but not in the outer " +"scope. For example, they can be used in the type annotations for the methods " +"of a generic class or in the class body. However, they cannot be used in the " +"module scope after the class is defined. See :ref:`type-params` for a " +"detailed description of the runtime semantics of type parameters." +msgstr "" + +#: ../../whatsnew/3.12.rst:390 +msgid "" +"In order to support these scoping semantics, a new kind of scope is " +"introduced, the :ref:`annotation scope `. Annotation " +"scopes behave for the most part like function scopes, but interact " +"differently with enclosing class scopes. In Python 3.13, :term:`annotations " +"` will also be evaluated in annotation scopes." +msgstr "" + +#: ../../whatsnew/3.12.rst:396 +msgid "See :pep:`695` for more details." +msgstr "" + +#: ../../whatsnew/3.12.rst:398 +msgid "" +"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " +"and others in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:402 +msgid "Other Language Changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:404 +msgid "" +"Add :ref:`perf_profiling` through the new environment variable :envvar:" +"`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " +"well as the new :func:`sys.activate_stack_trampoline`, :func:`sys." +"deactivate_stack_trampoline`, and :func:`sys.is_stack_trampoline_active` " +"APIs. (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian " +"Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon " +"in :gh:`96123`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:414 +msgid "" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.14, " +"the default will switch to ``'data'``. (Contributed by Petr Viktorin in :pep:" +"`706`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:422 +msgid "" +":class:`types.MappingProxyType` instances are now hashable if the underlying " +"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:426 +msgid "" +":class:`memoryview` now supports the half-float type (the \"e\" format " +"code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:429 +msgid "" +"The parser now raises :exc:`SyntaxError` when parsing source code containing " +"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:432 +msgid "" +":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " +"when parsing source code containing null bytes. (Contributed by Pablo " +"Galindo in :gh:`96670`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:436 +msgid "" +"The Garbage Collector now runs only on the eval breaker mechanism of the " +"Python bytecode evaluation loop instead of object allocations. The GC can " +"also run when :c:func:`PyErr_CheckSignals` is called so C extensions that " +"need to run for a long time without executing any Python code also have a " +"chance to execute the GC periodically. (Contributed by Pablo Galindo in :gh:" +"`97922`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:443 +msgid "" +"A backslash-character pair that is not a valid escape sequence now generates " +"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " +"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " +"(``\"\\d\"`` is an invalid escape sequence), use raw strings for regular " +"expression: ``re.compile(r\"\\d+\\.\\d+\")``. In a future Python version, :" +"exc:`SyntaxError` will eventually be raised, instead of :exc:" +"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:452 +msgid "" +"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" +"exc:`DeprecationWarning`. In a future Python version they will be eventually " +"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:458 +msgid "" +"All builtin and extension callables expecting boolean parameters now accept " +"arguments of any type instead of just :class:`bool` and :class:`int`. " +"(Contributed by Serhiy Storchaka in :gh:`60203`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:462 +msgid "" +"Variables used in the target part of comprehensions that are not stored to " +"can now be used in assignment expressions (``:=``). For example, in ``[(b := " +"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " +"Note that assigning to variables stored to in the target part of " +"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " +"(Contributed by Nikita Sobolev in :gh:`100581`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:469 +msgid "" +":class:`slice` objects are now hashable, allowing them to be used as dict " +"keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " +"Hettinger in :gh:`101264`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:472 +msgid "" +":func:`sum` now uses Neumaier summation to improve accuracy when summing " +"floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" +"`100425`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:476 +msgid "" +"Exceptions raised in a typeobject's ``__set_name__`` method are no longer " +"wrapped by a :exc:`RuntimeError`. Context information is added to the " +"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:480 +msgid "" +"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " +"and raises one other exception, that exception is no longer wrapped in an :" +"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " +"Katriel in :gh:`103590`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:487 +msgid "New Modules" +msgstr "" + +#: ../../whatsnew/3.12.rst:489 +msgid "None yet." +msgstr "" + +#: ../../whatsnew/3.12.rst:493 +msgid "Improved Modules" +msgstr "" + +#: ../../whatsnew/3.12.rst:496 +msgid "array" +msgstr "" + +#: ../../whatsnew/3.12.rst:498 +msgid "" +"The :class:`array.array` class now supports subscripting, making it a :term:" +"`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:502 +msgid "asyncio" +msgstr "" + +#: ../../whatsnew/3.12.rst:504 +msgid "" +"The performance of writing to sockets in :mod:`asyncio` has been " +"significantly improved. ``asyncio`` now avoids unnecessary copying when " +"writing to sockets and uses :meth:`~socket.socket.sendmsg` if the platform " +"supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:509 +msgid "" +"Added :func:`asyncio.eager_task_factory` and :func:`asyncio." +"create_eager_task_factory` functions to allow opting an event loop in to " +"eager task execution, making some use-cases 2x to 5x faster. (Contributed by " +"Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:514 +msgid "" +"On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " +"if :func:`os.pidfd_open` is available and functional instead of :class:" +"`~asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:" +"`98024`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:519 +msgid "" +"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" +"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" +"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. It is recommended to not manually configure a child watcher as " +"the event loop now uses the best available child watcher for each platform (:" +"class:`~asyncio.PidfdChildWatcher` if supported and :class:`~asyncio." +"ThreadedChildWatcher` otherwise). (Contributed by Kumar Aditya in :gh:" +"`94597`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:528 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:534 +msgid "" +"Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " +"custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:538 +msgid "" +"Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " +"(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:541 +msgid "" +":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" +"`asyncio` does not support legacy generator-based coroutines. (Contributed " +"by Kumar Aditya in :gh:`102748`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:545 +msgid "" +":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " +"yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:550 +msgid "calendar" +msgstr "" + +#: ../../whatsnew/3.12.rst:552 +msgid "" +"Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " +"Prince Roshan in :gh:`103636`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:556 +msgid "csv" +msgstr "" + +#: ../../whatsnew/3.12.rst:558 +msgid "" +"Add :data:`~csv.QUOTE_NOTNULL` and :data:`~csv.QUOTE_STRINGS` flags to " +"provide finer grained control of ``None`` and empty strings by :class:`~csv." +"writer` objects." +msgstr "" + +#: ../../whatsnew/3.12.rst:563 +msgid "dis" +msgstr "" + +#: ../../whatsnew/3.12.rst:565 +msgid "" +"Pseudo instruction opcodes (which are used by the compiler but do not appear " +"in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" +"`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " +"pseudo instructions. Use the new :data:`~dis.hasarg` collection instead. " +"(Contributed by Irit Katriel in :gh:`94216`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:574 +msgid "email" +msgstr "" + +#: ../../whatsnew/3.12.rst:576 +msgid "" +":func:`email.utils.getaddresses` and :func:`email.utils.parseaddr` now " +"return ``('', '')`` 2-tuples in more situations where invalid email " +"addresses are encountered instead of potentially inaccurate values. " +"(Contributed by Thomas Dwyer for :gh:`102988` to ameliorate CVE-2023-27043.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:582 +msgid "fractions" +msgstr "" + +#: ../../whatsnew/3.12.rst:584 +msgid "" +"Objects of type :class:`fractions.Fraction` now support float-style " +"formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:588 +msgid "inspect" +msgstr "" + +#: ../../whatsnew/3.12.rst:590 +msgid "" +"Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " +"a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " +"(Contributed Carlton Gibson in :gh:`99247`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:594 +msgid "" +"Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " +"for determining the current state of asynchronous generators. (Contributed " +"by Thomas Krennwallner in :issue:`35759`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:598 +msgid "" +"The performance of :func:`inspect.getattr_static` has been considerably " +"improved. Most calls to the function should be at least 2x faster than they " +"were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex " +"Waygood in :gh:`103193`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:604 +msgid "itertools" +msgstr "" + +#: ../../whatsnew/3.12.rst:606 +msgid "" +"Added :class:`itertools.batched()` for collecting into even-sized tuples " +"where the last batch may be shorter than the rest. (Contributed by Raymond " +"Hettinger in :gh:`98363`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:611 +msgid "math" +msgstr "" + +#: ../../whatsnew/3.12.rst:613 +msgid "" +"Added :func:`math.sumprod` for computing a sum of products. (Contributed by " +"Raymond Hettinger in :gh:`100485`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:616 +msgid "" +"Extended :func:`math.nextafter` to include a *steps* argument for moving up " +"or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " +"Raymond Hettinger in :gh:`94906`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:621 +msgid "os" +msgstr "" + +#: ../../whatsnew/3.12.rst:623 +msgid "" +"Add :data:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" +"func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" +"gh:`93312`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:627 +msgid "" +":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " +"to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" +"`99547`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:631 +msgid "" +"Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " +"functions on Windows for enumerating drives, volumes and mount points. " +"(Contributed by Steve Dower in :gh:`102519`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:635 +msgid "" +":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " +"``st_birthtime`` field will now be filled with the creation time of the " +"file, and ``st_ctime`` is deprecated but still contains the creation time " +"(but in the future will return the last metadata change, for consistency " +"with other platforms). ``st_dev`` may be up to 64 bits and ``st_ino`` up to " +"128 bits depending on your file system, and ``st_rdev`` is always set to " +"zero rather than incorrect values. Both functions may be significantly " +"faster on newer releases of Windows. (Contributed by Steve Dower in :gh:" +"`99726`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:646 +msgid "os.path" +msgstr "" + +#: ../../whatsnew/3.12.rst:648 +msgid "" +"Add :func:`os.path.isjunction` to check if a given path is a junction. " +"(Contributed by Charles Machalow in :gh:`99547`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:651 +msgid "" +"Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " +"tail)``. (Contributed by Barney Gale in :gh:`101000`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:655 +msgid "pathlib" +msgstr "" + +#: ../../whatsnew/3.12.rst:657 +msgid "" +"Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." +"Path`, plus their Posix- and Windows-specific variants. Subclasses may " +"override the :meth:`~pathlib.PurePath.with_segments` method to pass " +"information between path instances." +msgstr "" + +#: ../../whatsnew/3.12.rst:662 +msgid "" +"Add :meth:`~pathlib.Path.walk` for walking the directory trees and " +"generating all file or directory names within them, similar to :func:`os." +"walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:666 +msgid "" +"Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " +"allow the insertion of ``..`` entries in the result; this behavior is more " +"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" +"issue:`40358`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:671 +msgid "" +"Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." +"isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:674 +msgid "" +"Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" +"`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " +"path's case sensitivity, allowing for more precise control over the matching " +"process." +msgstr "" + +#: ../../whatsnew/3.12.rst:679 +msgid "pdb" +msgstr "" + +#: ../../whatsnew/3.12.rst:681 +msgid "" +"Add convenience variables to hold values temporarily for debug session and " +"provide quick access to values like the current frame or the return value. " +"(Contributed by Tian Gao in :gh:`103693`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:687 +msgid "random" +msgstr "" + +#: ../../whatsnew/3.12.rst:689 +msgid "" +"Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" +"gh:`81620`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:692 +msgid "" +"Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " +"by Raymond Hettinger in :gh:`100234`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:696 +msgid "shutil" +msgstr "" + +#: ../../whatsnew/3.12.rst:698 +msgid "" +":func:`shutil.make_archive` now passes the *root_dir* argument to custom " +"archivers which support it. In this case it no longer temporarily changes " +"the current working directory of the process to *root_dir* to perform " +"archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:704 +msgid "" +":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " +"handler like *onerror* but which expects an exception instance rather than a " +"*(typ, val, tb)* triplet. *onerror* is deprecated and will be removed in " +"Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:710 +msgid "" +":func:`shutil.which` now consults the *PATHEXT* environment variable to find " +"matches within *PATH* on Windows even when the given *cmd* includes a " +"directory component. (Contributed by Charles Machalow in :gh:`103179`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:715 +msgid "" +":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " +"querying for executables on Windows to determine if the current working " +"directory should be prepended to the search path. (Contributed by Charles " +"Machalow in :gh:`103179`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:720 +msgid "" +":func:`shutil.which` will return a path matching the *cmd* with a component " +"from ``PATHEXT`` prior to a direct match elsewhere in the search path on " +"Windows. (Contributed by Charles Machalow in :gh:`103179`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:726 +msgid "sqlite3" +msgstr "" + +#: ../../whatsnew/3.12.rst:728 +msgid "" +"Add a :ref:`command-line interface `. (Contributed by Erlend E. " +"Aasland in :gh:`77617`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:731 +msgid "" +"Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." +"Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " +"control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:738 +msgid "" +"Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." +"load_extension`, for overriding the SQLite extension entry point. " +"(Contributed by Erlend E. Aasland in :gh:`103015`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:743 +msgid "" +"Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." +"setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " +"a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:749 +msgid "statistics" +msgstr "" + +#: ../../whatsnew/3.12.rst:751 +msgid "" +"Extended :func:`statistics.correlation` to include as a ``ranked`` method " +"for computing the Spearman correlation of ranked data. (Contributed by " +"Raymond Hettinger in :gh:`95861`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:756 +msgid "sys" +msgstr "" + +#: ../../whatsnew/3.12.rst:758 +msgid "" +"Add :func:`sys.activate_stack_trampoline` and :func:`sys." +"deactivate_stack_trampoline` for activating and deactivating stack profiler " +"trampolines, and :func:`sys.is_stack_trampoline_active` for querying if " +"stack profiler trampolines are active. (Contributed by Pablo Galindo and " +"Christian Heimes with contributions from Gregory P. Smith [Google] and Mark " +"Shannon in :gh:`96123`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:767 +msgid "" +"Add :data:`sys.last_exc` which holds the last unhandled exception that was " +"raised (for post-mortem debugging use cases). Deprecate the three fields " +"that have the same information in its legacy form: :data:`sys.last_type`, :" +"data:`sys.last_value` and :data:`sys.last_traceback`. (Contributed by Irit " +"Katriel in :gh:`102778`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:773 ../../whatsnew/3.12.rst:1510 +msgid "" +":func:`sys._current_exceptions` now returns a mapping from thread-id to an " +"exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " +"by Irit Katriel in :gh:`103176`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:778 +msgid "tempfile" +msgstr "" + +#: ../../whatsnew/3.12.rst:780 +msgid "" +"The :class:`tempfile.NamedTemporaryFile` function has a new optional " +"parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:782 +msgid "" +":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " +"argument provided to the *dir* parameter is a relative path." +msgstr "" + +#: ../../whatsnew/3.12.rst:788 +msgid "threading" +msgstr "" + +#: ../../whatsnew/3.12.rst:790 +msgid "" +"Add :func:`threading.settrace_all_threads` and :func:`threading." +"setprofile_all_threads` that allow to set tracing and profiling functions in " +"all running threads in addition to the calling one. (Contributed by Pablo " +"Galindo in :gh:`93503`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:796 +msgid "tkinter" +msgstr "" + +#: ../../whatsnew/3.12.rst:798 +msgid "" +"``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " +"only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " +"sequence of coordinates (``[x1, y1, x2, y2, ...]``), but also coordinates " +"grouped in pairs (``(x1, y1), (x2, y2), ...`` and ``[(x1, y1), (x2, " +"y2), ...]``), like ``create_*()`` methods. (Contributed by Serhiy Storchaka " +"in :gh:`94473`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:807 +msgid "tokenize" +msgstr "" + +#: ../../whatsnew/3.12.rst:809 +msgid "" +"The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " +"( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" +"ref:`whatsnew312-porting-to-python312` for more information on the changes " +"to the :mod:`tokenize` module." +msgstr "" + +#: ../../whatsnew/3.12.rst:815 +msgid "types" +msgstr "" + +#: ../../whatsnew/3.12.rst:817 +msgid "" +"Add :func:`types.get_original_bases` to allow for further introspection of :" +"ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" +"Balfe and Alex Waygood in :gh:`101827`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:822 +msgid "typing" +msgstr "" + +#: ../../whatsnew/3.12.rst:824 +msgid "" +":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" +"`hasattr` to lookup whether attributes exist. This means that descriptors " +"and :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated " +"during ``isinstance()`` checks against runtime-checkable protocols. However, " +"it may also mean that some objects which used to be considered instances of " +"a runtime-checkable protocol may no longer be considered instances of that " +"protocol on Python 3.12+, and vice versa. Most users are unlikely to be " +"affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:835 +msgid "" +"The members of a runtime-checkable protocol are now considered \"frozen\" at " +"runtime as soon as the class has been created. Monkey-patching attributes " +"onto a runtime-checkable protocol will still work, but will have no impact " +"on :func:`isinstance` checks comparing objects to the protocol. For example::" +msgstr "" + +#: ../../whatsnew/3.12.rst:857 +msgid "" +"This change was made in order to speed up ``isinstance()`` checks against " +"runtime-checkable protocols." +msgstr "" + +#: ../../whatsnew/3.12.rst:860 +msgid "" +"The performance profile of :func:`isinstance` checks against :func:`runtime-" +"checkable protocols ` has changed significantly. " +"Most ``isinstance()`` checks against protocols with only a few members " +"should be at least 2x faster than in 3.11, and some may be 20x faster or " +"more. However, ``isinstance()`` checks against protocols with fourteen or " +"more members may be slower than in Python 3.11. (Contributed by Alex Waygood " +"in :gh:`74690` and :gh:`103193`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:868 +msgid "" +"All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " +"the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " +"in :gh:`103699`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:872 +msgid "" +"Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " +"(Contributed by Erik De Bonte in :gh:`99957`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:876 +msgid "unicodedata" +msgstr "" + +#: ../../whatsnew/3.12.rst:878 +msgid "" +"The Unicode database has been updated to version 15.0.0. (Contributed by " +"Benjamin Peterson in :gh:`96734`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:882 +msgid "unittest" +msgstr "" + +#: ../../whatsnew/3.12.rst:884 +msgid "" +"Added ``--durations`` command line option, showing the N slowest test cases::" +msgstr "" + +#: ../../whatsnew/3.12.rst:900 +msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:903 +msgid "uuid" +msgstr "" + +#: ../../whatsnew/3.12.rst:905 +msgid "" +"Add a :ref:`command-line interface `. (Contributed by Adam Chhina " +"in :gh:`88597`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:910 +msgid "Optimizations" +msgstr "" + +#: ../../whatsnew/3.12.rst:912 +msgid "" +"Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " +"reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " +"(Contributed by Inada Naoki in :gh:`92536`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:916 +msgid "" +"Added experimental support for using the BOLT binary optimizer in the build " +"process, which improves performance by 1-5%. (Contributed by Kevin " +"Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:920 +msgid "" +"Speed up the regular expression substitution (functions :func:`re.sub` and :" +"func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " +"replacement strings containing group references by 2--3 times. (Contributed " +"by Serhiy Storchaka in :gh:`91524`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:925 +msgid "" +"Speed up :class:`asyncio.Task` creation by deferring expensive string " +"formatting. (Contributed by Itamar O in :gh:`103793`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:928 +msgid "" +"The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " +"are up to 64% faster as a side effect of the changes required to cover :pep:" +"`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez Macías and " +"Pablo Galindo in :gh:`102856`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:933 +msgid "" +"Speed up :func:`super` method calls and attribute loads via the new :opcode:" +"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " +"Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:939 +msgid "CPython bytecode changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:941 +msgid "" +"Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" +"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" +"`LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " +"by Ken Jin in :gh:`93429`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:946 +msgid "" +"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" +"`102859`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:949 +msgid "" +"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " +"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:952 +msgid "" +"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" +"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " +"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " +"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" +"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:958 +msgid "" +"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " +"and Vladimir Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:962 +msgid "Demos and Tools" +msgstr "" + +#: ../../whatsnew/3.12.rst:964 +msgid "" +"Remove the ``Tools/demo/`` directory which contained old demo scripts. A " +"copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:969 +msgid "" +"Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " +"can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:976 ../../whatsnew/3.12.rst:1875 +msgid "Deprecated" +msgstr "" + +#: ../../whatsnew/3.12.rst:978 +msgid "" +":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" +"`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:981 +msgid "" +"The :mod:`sqlite3` :ref:`default adapters and converters ` are now deprecated. Instead, use the :ref:`sqlite3-adapter-" +"converter-recipes` and tailor them to your needs. (Contributed by Erlend E. " +"Aasland in :gh:`90016`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:987 +msgid "" +"In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " +"when :ref:`named placeholders ` are used together with " +"parameters supplied as a :term:`sequence` instead of as a :class:`dict`. " +"Starting from Python 3.14, using named placeholders with parameters supplied " +"as a sequence will raise a :exc:`~sqlite3.ProgrammingError`. (Contributed by " +"Erlend E. Aasland in :gh:`101698`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:994 +msgid "" +"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" +"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " +"removed in a future version of Python. Use the single-arg versions of these " +"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:999 +msgid "" +":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " +"differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " +"(Contributed by Brett Cannon in :gh:`65961`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1004 +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1009 +msgid "" +"The :mod:`xml.etree.ElementTree` module now emits :exc:`DeprecationWarning` " +"when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " +"Before, the Python implementation emitted :exc:`FutureWarning`, and the C " +"implementation emitted nothing." +msgstr "" + +#: ../../whatsnew/3.12.rst:1014 +msgid "" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1019 +msgid "" +"The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " +"Windows are deprecated. In a future release, they will contain the last " +"metadata change time, consistent with other platforms. For now, they still " +"contain the creation time, which is also available in the new " +"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1025 +msgid "" +"The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." +"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " +"(Contributed by Irit Katriel in :gh:`102778`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1029 +msgid "" +"The *onerror* argument of :func:`shutil.rmtree` is deprecated as will be " +"removed in Python 3.14. Use *onexc* instead. (Contributed by Irit Katriel " +"in :gh:`102828`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1032 +msgid "" +"Extracting tar archives without specifying *filter* is deprecated until " +"Python 3.14, when ``'data'`` filter will become the default. See :ref:" +"`tarfile-extraction-filter` for details." +msgstr "" + +#: ../../whatsnew/3.12.rst:1036 +msgid "" +"``calendar.January`` and ``calendar.February`` constants are deprecated and " +"replaced by :data:`calendar.Month.JANUARY` and :data:`calendar.Month." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1040 +msgid "" +"The bitwise inversion operator (``~``) on bool is deprecated. It will throw " +"an error in Python 3.14. Use ``not`` for logical negation of bools instead. " +"In the rare case that you really need the bitwise inversion of the " +"underlying ``int``, convert to int explicitly with ``~int(x)``. (Contributed " +"by Tim Hoffmann in :gh:`103487`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1046 +msgid "" +":class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` and :meth:" +"`~datetime.datetime.utcfromtimestamp` are deprecated and will be removed in " +"a future version. Instead, use timezone-aware objects to represent datetimes " +"in UTC: respectively, call :meth:`~datetime.datetime.now` and :meth:" +"`~datetime.datetime.fromtimestamp` with the *tz* parameter set to :attr:" +"`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1057 +msgid "Pending Removal in Python 3.13" +msgstr "" + +#: ../../whatsnew/3.12.rst:1059 +msgid "" +"The following modules and APIs have been deprecated in earlier Python " +"releases, and will be removed in Python 3.13." +msgstr "" + +#: ../../whatsnew/3.12.rst:1062 +msgid "Modules (see :pep:`594`):" +msgstr "" + +#: ../../whatsnew/3.12.rst:1064 +msgid ":mod:`aifc`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1065 +msgid ":mod:`audioop`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1066 +msgid ":mod:`cgi`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1067 +msgid ":mod:`cgitb`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1068 +msgid ":mod:`chunk`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1069 +msgid ":mod:`crypt`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1070 +msgid ":mod:`imghdr`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1071 +msgid ":mod:`mailcap`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1072 +msgid ":mod:`msilib`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1073 +msgid ":mod:`nis`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1074 +msgid ":mod:`nntplib`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1075 +msgid ":mod:`ossaudiodev`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1076 +msgid ":mod:`pipes`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1077 +msgid ":mod:`sndhdr`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1078 +msgid ":mod:`spwd`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1079 +msgid ":mod:`sunau`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1080 +msgid ":mod:`telnetlib`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1081 +msgid ":mod:`uu`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1082 +msgid ":mod:`xdrlib`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1084 +msgid "APIs:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1086 +msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1087 +msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1088 +msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1089 +msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1090 +msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1091 +msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1092 +msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1093 +msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1094 +msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1097 +msgid "Pending Removal in Python 3.14" +msgstr "" + +#: ../../whatsnew/3.12.rst:1099 +msgid "" +"Deprecated the following :mod:`importlib.abc` classes, scheduled for removal " +"in Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1102 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1103 +msgid ":class:`!importlib.abc.Traversable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1104 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1106 +msgid "Use :mod:`importlib.resources.abc` classes instead:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1108 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1109 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1111 +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1113 +msgid "" +"Deprecated :class:`collections.abc.ByteString`. Prefer :class:`Sequence` or :" +"class:`collections.abc.Buffer`. For use in typing, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1118 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" +"`DeprecationWarning` to be emitted when it is used." +msgstr "" + +#: ../../whatsnew/3.12.rst:1121 +msgid "" +"Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " +"bases using the C API." +msgstr "" + +#: ../../whatsnew/3.12.rst:1124 +msgid "" +"Deprecated the *isdst* parameter in :func:`email.utils.localtime`. " +"(Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1127 +msgid "" +"``__package__`` and ``__cached__`` will cease to be set or taken into " +"consideration by the import system (:gh:`97879`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1130 +msgid "" +"Testing the truth value of an :class:`xml.etree.ElementTree.Element` is " +"deprecated and will raise an exception in Python 3.14." +msgstr "" + +#: ../../whatsnew/3.12.rst:1133 +msgid "" +"The default :mod:`multiprocessing` start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this was " +"deemed too disruptive as the majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1141 +msgid "" +":mod:`pty` has two undocumented ``master_open()`` and ``slave_open()`` " +"functions that have been deprecated since Python 2 but only gained a proper :" +"exc:`DeprecationWarning` in 3.12. Remove them in 3.14." +msgstr "" + +#: ../../whatsnew/3.12.rst:1145 +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will be " +"removed in 3.14 for a significant reduction in code volume and maintenance " +"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1151 +msgid "" +"Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " +"planned to be removed in 3.12 but it only got a proper :exc:" +"`DeprecationWarning` in 3.12. May be removed in 3.14. (Contributed by Nikita " +"Sobolev in :gh:`101866`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1157 +msgid "" +"The *onerror* argument of :func:`shutil.rmtree` is deprecated in 3.12, and " +"will be removed in 3.14." +msgstr "" + +#: ../../whatsnew/3.12.rst:1160 +msgid "" +"The *type*, *choices*, and *metavar* parameters of :class:`!argparse." +"BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1165 +msgid "" +":func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` now raise :exc:" +"`DeprecationWarning`; use :func:`importlib.util.find_spec` instead. " +"(Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1170 +msgid "" +"The following :mod:`ast` features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1174 +msgid ":class:`!ast.Num`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1175 +msgid ":class:`!ast.Str`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1176 +msgid ":class:`!ast.Bytes`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1177 +msgid ":class:`!ast.NameConstant`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1178 +msgid ":class:`!ast.Ellipsis`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1180 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1184 +msgid "Pending Removal in Future Versions" +msgstr "" + +#: ../../whatsnew/3.12.rst:1186 +msgid "" +"The following APIs were deprecated in earlier Python versions and will be " +"removed, although there is currently no date scheduled for their removal." +msgstr "" + +#: ../../whatsnew/3.12.rst:1189 +msgid ":class:`typing.Text` (:gh:`92332`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1191 +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised if " +"the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1957 +msgid "Removed" +msgstr "" + +#: ../../whatsnew/3.12.rst:1204 +msgid "" +"Remove the ``distutils`` package. It was deprecated in Python 3.10 by :pep:" +"`632` \"Deprecate distutils module\". For projects still using ``distutils`` " +"and cannot be updated to something else, the ``setuptools`` project can be " +"installed: it still provides ``distutils``. (Contributed by Victor Stinner " +"in :gh:`92584`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1210 +msgid "" +"Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " +"installing setuptools in environments created by :mod:`venv`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1213 +msgid "" +"``pip (>= 22.1)`` does not require setuptools to be installed in the " +"environment. ``setuptools``-based (and ``distutils``-based) packages can " +"still be used with ``pip install``, since pip will provide ``setuptools`` in " +"the build environment it uses for building a package." +msgstr "" + +#: ../../whatsnew/3.12.rst:1219 +msgid "" +"``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " +"longer provided by default in environments created with ``venv`` or " +"bootstrapped with ``ensurepip``, since they are part of the ``setuptools`` " +"package. For projects relying on these at runtime, the ``setuptools`` " +"project should be declared as a dependency and installed separately " +"(typically, using pip)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1226 +msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1228 +msgid "Removed many old deprecated :mod:`unittest` features:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1230 +msgid "A number of :class:`~unittest.TestCase` method aliases:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1233 +msgid "Deprecated alias" +msgstr "" + +#: ../../whatsnew/3.12.rst:1233 +msgid "Method Name" +msgstr "" + +#: ../../whatsnew/3.12.rst:1233 +msgid "Deprecated in" +msgstr "" + +#: ../../whatsnew/3.12.rst:1235 +msgid "``failUnless``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1242 +msgid ":meth:`.assertTrue`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1238 +#: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1240 +#: ../../whatsnew/3.12.rst:1241 +msgid "3.1" +msgstr "" + +#: ../../whatsnew/3.12.rst:1236 +msgid "``failIf``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1236 +msgid ":meth:`.assertFalse`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1237 +msgid "``failUnlessEqual``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1243 +msgid ":meth:`.assertEqual`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1238 +msgid "``failIfEqual``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1238 ../../whatsnew/3.12.rst:1244 +msgid ":meth:`.assertNotEqual`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1239 +msgid "``failUnlessAlmostEqual``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1245 +msgid ":meth:`.assertAlmostEqual`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1240 +msgid "``failIfAlmostEqual``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1240 ../../whatsnew/3.12.rst:1246 +msgid ":meth:`.assertNotAlmostEqual`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1241 +msgid "``failUnlessRaises``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1241 +msgid ":meth:`.assertRaises`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1242 +msgid "``assert_``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1242 ../../whatsnew/3.12.rst:1243 +#: ../../whatsnew/3.12.rst:1244 ../../whatsnew/3.12.rst:1245 +#: ../../whatsnew/3.12.rst:1246 ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1248 +msgid "3.2" +msgstr "" + +#: ../../whatsnew/3.12.rst:1243 +msgid "``assertEquals``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1244 +msgid "``assertNotEquals``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1245 +msgid "``assertAlmostEquals``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1246 +msgid "``assertNotAlmostEquals``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1247 +msgid "``assertRegexpMatches``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1247 +msgid ":meth:`.assertRegex`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1248 +msgid "``assertRaisesRegexp``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1248 +msgid ":meth:`.assertRaisesRegex`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1249 +msgid "``assertNotRegexpMatches``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1249 +msgid ":meth:`.assertNotRegex`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1249 +msgid "3.5" +msgstr "" + +#: ../../whatsnew/3.12.rst:1252 +msgid "" +"You can use https://github.com/isidentical/teyit to automatically modernise " +"your unit tests." +msgstr "" + +#: ../../whatsnew/3.12.rst:1255 +msgid "" +"Undocumented and broken :class:`~unittest.TestCase` method " +"``assertDictContainsSubset`` (deprecated in Python 3.2)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1258 +msgid "" +"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " +"since Python 3.2)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1262 +msgid "" +"An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " +"(deprecated in Python 3.2)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1265 +msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1267 +msgid "" +"Several names deprecated in the :mod:`configparser` way back in 3.2 have " +"been removed per :gh:`89336`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1270 +msgid "" +":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " +"argument. Use the ``source`` attribute and argument instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1272 +msgid "" +":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " +"shorter :class:`~configparser.ConfigParser` name instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1274 +msgid "" +":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" +"meth:`~configparser.ConfigParser.read_file` instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1277 +msgid "" +"The following undocumented :mod:`sqlite3` features, deprecated in Python " +"3.10, are now removed:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1280 +msgid "``sqlite3.enable_shared_cache()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1281 +msgid "``sqlite3.OptimizedUnicode``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1283 +msgid "" +"If a shared cache must be used, open the database in URI mode using the " +"``cache=shared`` query parameter." +msgstr "" + +#: ../../whatsnew/3.12.rst:1286 +msgid "" +"The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" +"`str` since Python 3.3. Code that previously set the text factory to " +"``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " +"default value which is also ``str``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1291 +msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1293 +msgid "" +"``smtpd`` has been removed according to the schedule in :pep:`594`, having " +"been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI module or any " +"other :mod:`asyncio`-based server instead. (Contributed by Oleg Iarygin in :" +"gh:`93243`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1301 +msgid "" +"``asynchat`` and ``asyncore`` have been removed according to the schedule " +"in :pep:`594`, having been deprecated in Python 3.6. Use :mod:`asyncio` " +"instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1307 +msgid "" +"Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python " +"3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`) " +"function is a built-in function. Since Python 3.10, :func:`!_pyio.open` is " +"also a static method. (Contributed by Victor Stinner in :gh:`94169`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1313 +msgid "" +"Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " +"3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " +"by Victor Stinner in :gh:`94199`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1317 +msgid "" +":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " +"deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " +"instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " +"extension if it was not present. (Contributed by Victor Stinner in :gh:" +"`94196`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1323 +msgid "" +"Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " +"3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " +"uses the :func:`!ssl.match_hostname` function. (Contributed by Victor " +"Stinner in :gh:`94199`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1329 +msgid "" +"Remove the :func:`!locale.format` function, deprecated in Python 3.7: use :" +"func:`locale.format_string` instead. (Contributed by Victor Stinner in :gh:" +"`94226`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1333 +msgid "" +":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." +"pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " +"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " +"of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " +"Stinner in :gh:`94199`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1339 +msgid "" +":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " +"method of the pure Python implementation, deprecated in Python 3.10, use " +"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." +"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " +"(Contributed by Victor Stinner in :gh:`94383`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1345 +msgid "" +":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " +"deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" +"`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1350 +msgid "" +"Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " +"instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." +"SSLContext.wrap_socket` method. Any package that still uses :func:`!ssl." +"wrap_socket` is broken and insecure. The function neither sends a SNI TLS " +"extension nor validates server hostname. Code is subject to `CWE-295 " +"`_: Improper Certificate " +"Validation. (Contributed by Victor Stinner in :gh:`94199`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1359 +msgid "" +"Many previously deprecated cleanups in :mod:`importlib` have now been " +"completed:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1362 +msgid "" +"References to, and support for :meth:`!module_repr()` has been removed. " +"(Contributed by Barry Warsaw in :gh:`97850`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1365 +msgid "" +"``importlib.util.set_package`` has been removed. (Contributed by Brett " +"Cannon in :gh:`65961`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1368 +msgid "" +"Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " +"(Contributed by Barry Warsaw in :gh:`98040`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1371 +msgid "" +"``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " +"have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1374 +msgid "" +"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" +"gh:`98040`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1377 +msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1380 +msgid "imp" +msgstr "" + +#: ../../whatsnew/3.12.rst:1380 +msgid "importlib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1382 +msgid "``imp.NullImporter``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1382 +msgid "Insert ``None`` into ``sys.path_importer_cache``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1383 +msgid "``imp.cache_from_source()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1383 +msgid ":func:`importlib.util.cache_from_source`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1384 +msgid "``imp.find_module()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1384 +msgid ":func:`importlib.util.find_spec`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1385 +msgid "``imp.get_magic()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1385 +msgid ":attr:`importlib.util.MAGIC_NUMBER`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1386 +msgid "``imp.get_suffixes()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1386 +msgid "" +":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." +"EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1387 +msgid "``imp.get_tag()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1387 +msgid ":attr:`sys.implementation.cache_tag `" +msgstr "" + +#: ../../whatsnew/3.12.rst:1388 +msgid "``imp.load_module()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1388 +msgid ":func:`importlib.import_module`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1389 +msgid "``imp.new_module(name)``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1389 +msgid "``types.ModuleType(name)``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1390 +msgid "``imp.reload()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1390 +msgid ":func:`importlib.reload`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1391 +msgid "``imp.source_from_cache()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1391 +msgid ":func:`importlib.util.source_from_cache`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1394 +msgid "Replace ``imp.load_source()`` with::" +msgstr "" + +#: ../../whatsnew/3.12.rst:1409 +msgid "Removed :mod:`!imp` functions and attributes with no replacements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1411 +msgid "undocumented functions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1413 +msgid "``imp.init_builtin()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1414 +msgid "``imp.load_compiled()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1415 +msgid "``imp.load_dynamic()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1416 +msgid "``imp.load_package()``" +msgstr "" + +#: ../../whatsnew/3.12.rst:1418 +msgid "" +"``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " +"locking scheme has changed in Python 3.3 to per-module locks." +msgstr "" + +#: ../../whatsnew/3.12.rst:1420 +msgid "" +"``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " +"``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " +"``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1424 +msgid "" +"Removed the ``suspicious`` rule from the documentation Makefile, and removed " +"``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1429 +msgid "" +"Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" +"`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " +"*cert_file* and *check_hostname* parameters from the :mod:`http.client` " +"module, all deprecated since Python 3.6. Use the *context* parameter " +"(*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner " +"in :gh:`94172`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1437 +msgid "" +":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " +"*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1441 +msgid "" +"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " +"Firebird, and Firefox versions 35 and below (:gh:`102871`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1449 ../../whatsnew/3.12.rst:1753 +msgid "Porting to Python 3.12" +msgstr "" + +#: ../../whatsnew/3.12.rst:1451 +msgid "" +"This section lists previously described changes and other bugfixes that may " +"require changes to your code." +msgstr "" + +#: ../../whatsnew/3.12.rst:1455 +msgid "Changes in the Python API" +msgstr "" + +#: ../../whatsnew/3.12.rst:1457 +msgid "" +"More strict rules are now applied for numerical group references and group " +"names in regular expressions. Only sequence of ASCII digits is now accepted " +"as a numerical reference. The group name in bytes patterns and replacement " +"strings can now only contain ASCII letters and digits and underscore. " +"(Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1464 +msgid "" +"Removed ``randrange()`` functionality deprecated since Python 3.10. " +"Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " +"Now, it raises a :exc:`TypeError`. Also, the exception raised for non-" +"integral values such as ``randrange(10.5)`` or ``randrange('10')`` has been " +"changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs " +"where ``randrange(1e25)`` would silently select from a larger range than " +"``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" +"`86388`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1472 +msgid "" +":class:`argparse.ArgumentParser` changed encoding and error handler for " +"reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " +"default text encoding (e.g. :func:`locale.getpreferredencoding(False) " +"`) to :term:`filesystem encoding and error " +"handler`. Argument files should be encoded in UTF-8 instead of ANSI Codepage " +"on Windows." +msgstr "" + +#: ../../whatsnew/3.12.rst:1478 +msgid "" +"Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " +"and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " +"PyPI module." +msgstr "" + +#: ../../whatsnew/3.12.rst:1482 +msgid "" +":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " +"exception, rather than reading :data:`sys.stdin`. The feature was deprecated " +"in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1487 +msgid "" +"The :mod:`os` module no longer accepts bytes-like paths, like :class:" +"`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " +"type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" +"`98393`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1492 +msgid "" +":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " +"subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " +"but now only if :func:`syslog.openlog` has already been called in the main " +"interpreter. These new restrictions do not apply to the main interpreter, so " +"only a very small set of users might be affected. This change helps with " +"interpreter isolation. Furthermore, :mod:`syslog` is a wrapper around " +"process-global resources, which are best managed from the main interpreter. " +"(Contributed by Dong-hee Na in :gh:`99127`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1501 +msgid "" +"The undocumented locking behavior of :func:`~functools.cached_property` is " +"removed, because it locked across all instances of the class, leading to " +"high lock contention. This means that a cached property getter function " +"could now run more than once for a single instance, if two threads race. For " +"most simple cached properties (e.g. those that are idempotent and simply " +"calculate a value based on other attributes of the instance) this will be " +"fine. If synchronization is needed, implement locking within the cached " +"property getter function or around multi-threaded access points." +msgstr "" + +#: ../../whatsnew/3.12.rst:1514 +msgid "" +"When extracting tar files using :mod:`tarfile` or :func:`shutil." +"unpack_archive`, pass the *filter* argument to limit features that may be " +"surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." +msgstr "" + +#: ../../whatsnew/3.12.rst:1519 +msgid "" +"The output of the :func:`tokenize.tokenize` and :func:`tokenize." +"generate_tokens` functions is now changed due to the changes introduced in :" +"pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" +"strings and the tokens described in :pep:`701` are now produced instead: " +"``FSTRING_START``, ``FSRING_MIDDLE`` and ``FSTRING_END`` are now emitted for " +"f-string \"string\" parts in addition to the appropriate tokens for the " +"tokenization in the expression components. For example for the f-string " +"``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" +msgstr "" + +#: ../../whatsnew/3.12.rst:1530 +msgid "while the new version emits::" +msgstr "" + +#: ../../whatsnew/3.12.rst:1542 +msgid "" +"Additionally, there may be some minor behavioral changes as a consecuence of " +"the changes required to support :pep:`701`. Some of these changes include:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1545 +msgid "" +"The ``type`` attribute of the tokens emitted when tokenizing some invalid " +"Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1548 +msgid "" +"Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " +"incomplete multiline strings do." +msgstr "" + +#: ../../whatsnew/3.12.rst:1551 +msgid "" +"Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " +"instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." +msgstr "" + +#: ../../whatsnew/3.12.rst:1554 +msgid "" +"Mixing tabs and spaces as indentation in the same file is not supported " +"anymore and will raise a :exc:`TabError`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1558 +msgid "Build Changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:1560 +msgid "" +"Python no longer uses ``setup.py`` to build shared C extension modules. " +"Build parameters like headers and libraries are detected in ``configure`` " +"script. Extensions are built by ``Makefile``. Most extensions use ``pkg-" +"config`` and fall back to manual detection. (Contributed by Christian Heimes " +"in :gh:`93939`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1566 +msgid "" +"``va_start()`` with two parameters, like ``va_start(args, format),`` is now " +"required to build Python. ``va_start()`` is no longer called with a single " +"parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1571 +msgid "" +"CPython now uses the ThinLTO option as the default link time optimization " +"policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " +"in :gh:`89536`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1575 +msgid "" +"Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " +"options (default: ``-j0``) in ``make install``. Also merged the 3 " +"``compileall`` commands into a single command to build .pyc files for all " +"optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" +"`99289`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1581 +msgid "Add platform triplets for 64-bit LoongArch:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1583 +msgid "loongarch64-linux-gnusf" +msgstr "" + +#: ../../whatsnew/3.12.rst:1584 +msgid "loongarch64-linux-gnuf32" +msgstr "" + +#: ../../whatsnew/3.12.rst:1585 +msgid "loongarch64-linux-gnu" +msgstr "" + +#: ../../whatsnew/3.12.rst:1587 +msgid "(Contributed by Zhang Na in :gh:`90656`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1589 +msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." +msgstr "" + +#: ../../whatsnew/3.12.rst:1591 +msgid "" +"Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" +"configure`. (Contributed by Christian Heimes in :gh:`89886`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1597 +msgid "C API Changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:1603 +msgid "" +":pep:`697`: Introduced the :ref:`Unstable C API tier `, " +"intended for low-level tools like debuggers and JIT compilers. This API may " +"change in each minor release of CPython without deprecation warnings. Its " +"contents are marked by the ``PyUnstable_`` prefix in names." +msgstr "" + +#: ../../whatsnew/3.12.rst:1609 +msgid "Code object constructors:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1611 +msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1612 +msgid "" +"``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " +"``PyCode_NewWithPosOnlyArgs``)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1614 +msgid "Extra storage for code objects (:pep:`523`):" +msgstr "" + +#: ../../whatsnew/3.12.rst:1616 +msgid "" +"``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " +"``_PyEval_RequestCodeExtraIndex``)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1617 +msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1618 +msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1620 +msgid "" +"The original names will continue to be available until the respective API " +"changes." +msgstr "" + +#: ../../whatsnew/3.12.rst:1623 +msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1625 +msgid "" +":pep:`697`: Added API for extending types whose instance memory layout is " +"opaque:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1628 +msgid "" +":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " +"inheriting or extending the base class size." +msgstr "" + +#: ../../whatsnew/3.12.rst:1630 +msgid "" +":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " +"allow access to subclass-specific instance data." +msgstr "" + +#: ../../whatsnew/3.12.rst:1632 +msgid "" +":const:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added to " +"allow safely extending certain variable-sized types, including :c:var:" +"`PyType_Type`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1635 +msgid "" +":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " +"` in terms of a subclass-specific struct." +msgstr "" + +#: ../../whatsnew/3.12.rst:1638 +msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1640 +msgid "" +"Added the new :ref:`limited C API ` function :c:func:" +"`PyType_FromMetaclass`, which generalizes the existing :c:func:" +"`PyType_FromModuleAndSpec` using an additional metaclass argument. " +"(Contributed by Wenzel Jakob in :gh:`93012`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1645 +msgid "" +"API for creating objects that can be called using :ref:`the vectorcall " +"protocol ` was added to the :ref:`Limited API `:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1649 +msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1650 +msgid ":c:func:`PyVectorcall_NARGS`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1651 +msgid ":c:func:`PyVectorcall_Call`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1652 +msgid ":c:type:`vectorcallfunc`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1654 +msgid "" +"The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " +"when the class's :py:meth:`~object.__call__` method is reassigned. This " +"makes vectorcall safe to use with mutable types (i.e. heap types without the " +"immutable flag, :const:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " +"not override :c:member:`~PyTypeObject.tp_call` now inherit the " +"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" +"`93274`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1662 +msgid "" +"The :const:`Py_TPFLAGS_MANAGED_DICT` and :const:`Py_TPFLAGS_MANAGED_WEAKREF` " +"flags have been added. This allows extensions classes to support object " +"``__dict__`` and weakrefs with less bookkeeping, using less memory and with " +"faster access." +msgstr "" + +#: ../../whatsnew/3.12.rst:1667 +msgid "" +"API for performing calls using :ref:`the vectorcall protocol ` " +"was added to the :ref:`Limited API `:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1671 +msgid ":c:func:`PyObject_Vectorcall`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1672 +msgid ":c:func:`PyObject_VectorcallMethod`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1673 +msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1675 +msgid "" +"This means that both the incoming and outgoing ends of the vector call " +"protocol are now available in the :ref:`Limited API `. (Contributed " +"by Wenzel Jakob in :gh:`98586`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1679 +msgid "" +"Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" +"func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " +"functions in all running threads in addition to the calling one. " +"(Contributed by Pablo Galindo in :gh:`93503`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1685 +msgid "" +"Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " +"sets the vectorcall field of a given :c:type:`PyFunctionObject`. " +"(Contributed by Andrew Frost in :gh:`92257`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1689 +msgid "" +"The C API now permits registering callbacks via :c:func:" +"`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " +"whenever a dictionary is modified. This is intended for use by optimizing " +"interpreters, JIT compilers, or debuggers. (Contributed by Carl Meyer in :gh:" +"`91052`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1695 +msgid "" +"Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " +"callbacks to receive notification on changes to a type. (Contributed by Carl " +"Meyer in :gh:`91051`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1699 +msgid "" +"Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " +"register callbacks to receive notification on creation and destruction of " +"code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1704 +msgid "" +"Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " +"get a frame variable by its name. (Contributed by Victor Stinner in :gh:" +"`91248`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1708 +msgid "" +"Add :c:func:`PyErr_GetRaisedException` and :c:func:" +"`PyErr_SetRaisedException` for saving and restoring the current exception. " +"These functions return and accept a single exception object, rather than the " +"triple arguments of the now-deprecated :c:func:`PyErr_Fetch` and :c:func:" +"`PyErr_Restore`. This is less error prone and a bit more efficient. " +"(Contributed by Mark Shannon in :gh:`101578`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1716 +msgid "" +"Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " +"replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " +"(Contributed by Mark Shannon in :gh:`101578`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1720 +msgid "" +"Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " +"convenience functions for retrieving and modifying the :attr:`~BaseException." +"args` passed to the exception's constructor. (Contributed by Mark Shannon " +"in :gh:`101578`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1725 +msgid "" +"Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " +"replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " +"Katriel in :gh:`102755`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1729 +msgid "" +":pep:`683`: Introduced Immortal Objects to Python which allows objects to " +"bypass reference counts and introduced changes to the C-API:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1732 +msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" +msgstr "" + +#: ../../whatsnew/3.12.rst:1733 +msgid "as immortal." +msgstr "" + +#: ../../whatsnew/3.12.rst:1734 +msgid "" +"``_Py_IsImmortal`` Checks if an object has the immortal reference count." +msgstr "" + +#: ../../whatsnew/3.12.rst:1735 +msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" +msgstr "" + +#: ../../whatsnew/3.12.rst:1736 +msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1737 +msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" +msgstr "" + +#: ../../whatsnew/3.12.rst:1738 +msgid "that are immortal." +msgstr "" + +#: ../../whatsnew/3.12.rst:1739 +msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" +msgstr "" + +#: ../../whatsnew/3.12.rst:1740 +msgid "objects that are immortal and static" +msgstr "" + +#: ../../whatsnew/3.12.rst:1743 +msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" +msgstr "" + +#: ../../whatsnew/3.12.rst:1742 +msgid "" +"objects that have been interned. This is now needed for refleak.py to " +"correctly track reference counts and allocated blocks" +msgstr "" + +#: ../../whatsnew/3.12.rst:1745 +msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1747 +msgid "" +"In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" +"`Py_DECREF` functions are now implemented as opaque function calls to hide " +"implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1755 +msgid "" +"Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " +"removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1758 +msgid "" +"Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " +"``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " +"other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1762 +msgid "" +"``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " +"internal-only field on ``PyTypeObject`` but we're pointing out the change in " +"case someone happens to be accessing the field directly anyway. To avoid " +"breakage, consider using the existing public C-API instead, or, if " +"necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." +msgstr "" + +#: ../../whatsnew/3.12.rst:1769 +msgid "" +"This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " +"valid object pointer. Its type was changed to :c:expr:`void *` to reflect " +"this. We mention this in case someone happens to be accessing the internal-" +"only field directly." +msgstr "" + +#: ../../whatsnew/3.12.rst:1774 +msgid "" +"To get a list of subclasses, call the Python method :py:meth:`~class." +"__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1778 +msgid "" +"Add support of more formatting options (left aligning, octals, uppercase " +"hexadecimals, ``intmax_t``, ``ptrdiff_t``, ``wchar_t`` C strings, variable " +"width and precision) in :c:func:`PyUnicode_FromFormat` and :c:func:" +"`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:`98836`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1784 +msgid "" +"An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" +"func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " +"versions it caused all the rest of the format string to be copied as-is to " +"the result string, and any extra arguments discarded. (Contributed by Serhiy " +"Storchaka in :gh:`95781`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1790 +msgid "" +"Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" +"`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1794 +msgid "" +"Extension classes wanting to add a ``__dict__`` or weak reference slot " +"should use :const:`Py_TPFLAGS_MANAGED_DICT` and :const:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " +"``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " +"``tp_weaklistoffset`` is still supported, but does not fully support " +"multiple inheritance (:gh:`95589`), and performance may be worse. Classes " +"declaring :const:`Py_TPFLAGS_MANAGED_DICT` should call :c:func:`!" +"_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict` to " +"traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" +"func:`PyObject_ClearWeakRefs`, as before." +msgstr "" + +#: ../../whatsnew/3.12.rst:1806 +msgid "" +"The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " +"paths, like :class:`bytearray` and :class:`memoryview` types: only the " +"exact :class:`bytes` type is accepted for bytes strings. (Contributed by " +"Victor Stinner in :gh:`98393`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1811 +msgid "" +"The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " +"macros now only evaluate their arguments once. If an argument has side " +"effects, these side effects are no longer duplicated. (Contributed by Victor " +"Stinner in :gh:`98724`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1816 +msgid "" +"The interpreter's error indicator is now always normalized. This means that :" +"c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " +"that set the error indicator now normalize the exception before storing it. " +"(Contributed by Mark Shannon in :gh:`101578`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1821 +msgid "" +"``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " +"compatibility. Note that it is an internal global and only available on " +"debug builds. If you happen to be using it then you'll need to start using " +"``_Py_GetGlobalRefTotal()``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1826 +msgid "" +"The following functions now select an appropriate metaclass for the newly " +"created type:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1829 +msgid ":c:func:`PyType_FromSpec`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1830 +msgid ":c:func:`PyType_FromSpecWithBases`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1831 +msgid ":c:func:`PyType_FromModuleAndSpec`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1833 +msgid "" +"Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " +"is deprecated, and in Python 3.14+ it will be disallowed. Note that these " +"functions ignore ``tp_new`` of the metaclass, possibly allowing incomplete " +"initialization." +msgstr "" + +#: ../../whatsnew/3.12.rst:1838 +msgid "" +"Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " +"disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" +"`~object.__new__` in Python)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1842 +msgid "" +"Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " +"the two are incompatible with each other. The existing behavior -- ignoring " +"the metaclass for several steps of type creation -- is unsafe in general, " +"since (meta)classes assume that ``tp_new`` was called. There is no simple " +"general workaround. One of the following may work for you:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1849 +msgid "If you control the metaclass, avoid using ``tp_new`` in it:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1851 +msgid "" +"If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." +"tp_init` instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1853 +msgid "" +"If the metaclass doesn't need to be instantiated from Python, set its " +"``tp_new`` to ``NULL`` using the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` " +"flag. This makes it acceptable for ``PyType_From*`` functions." +msgstr "" + +#: ../../whatsnew/3.12.rst:1858 +msgid "" +"Avoid ``PyType_From*`` functions: if you don't need C-specific features " +"(slots or setting the instance size), create types by :ref:`calling ` " +"the metaclass." +msgstr "" + +#: ../../whatsnew/3.12.rst:1862 +msgid "" +"If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " +"warning out using :func:`warnings.catch_warnings` from Python." +msgstr "" + +#: ../../whatsnew/3.12.rst:1865 +msgid "" +":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " +"longer called in :ref:`subinterpreters `. This is " +"because clients generally rely on process-wide global state (since these " +"callbacks have no way of recovering extension module state)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1870 +msgid "" +"This also avoids situations where extensions may find themselves running in " +"a subinterpreter that they don't support (or haven't yet been loaded in). " +"See :gh:`104668` for more info." +msgstr "" + +#: ../../whatsnew/3.12.rst:1877 +msgid "Deprecate global configuration variable:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1879 +msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1880 +msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1881 +msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1882 +msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1883 +msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1884 +msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1885 +msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1886 +msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1887 +msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1888 +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1889 +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1890 +msgid "" +":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1891 +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1892 +msgid "" +":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1894 +msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1895 +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1896 +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1897 +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1898 +msgid "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1899 +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1900 +msgid "" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" +"`Py_PreInitialize`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1902 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1906 +msgid "" +"Creating immutable types (:const:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " +"bases is deprecated and will be disabled in Python 3.14." +msgstr "" + +#: ../../whatsnew/3.12.rst:1909 +msgid "" +"The ``structmember.h`` header is deprecated, though it continues to be " +"available and there are no plans to remove it." +msgstr "" + +#: ../../whatsnew/3.12.rst:1912 +msgid "" +"Its contents are now available just by including ``Python.h``, with a ``Py`` " +"prefix added if it was missing:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1915 +msgid "" +":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" +"`PyMember_SetOne`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1917 +msgid "" +"Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " +"(previously ``T_INT``, ``T_DOUBLE``, etc.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1919 +msgid "" +"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" +"`Py_AUDIT_READ` (previously all uppercase)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1922 +msgid "Several items are not exposed from ``Python.h``:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1924 +msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1925 +msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1926 +msgid "The macro ``WRITE_RESTRICTED`` which does nothing." +msgstr "" + +#: ../../whatsnew/3.12.rst:1927 +msgid "" +"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" +"`Py_AUDIT_READ`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1929 +msgid "" +"In some configurations, ```` is not included from ``Python.h``. It " +"should be included manually when using ``offsetof()``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1932 +msgid "" +"The deprecated header continues to provide its original contents under the " +"original names. Your old code can stay unchanged, unless the extra include " +"and non-namespaced macros bother you greatly." +msgstr "" + +#: ../../whatsnew/3.12.rst:1937 +msgid "" +"(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " +"Alexander Belopolsky and Matthias Braun.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1940 +msgid "" +":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" +"func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " +"instead. (Contributed by Mark Shannon in :gh:`101578`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1945 +msgid "" +":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " +"instead. (Contributed by Irit Katriel in :gh:`102755`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1948 +msgid "" +"``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " +"instead. (Contributed by Irit Katriel in :gh:`102192`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1951 +msgid "" +"Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" +"func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" +"c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1959 +msgid "" +"Remove the ``token.h`` header file. There was never any public tokenizer C " +"API. The ``token.h`` header file was only designed to be used by Python " +"internals. (Contributed by Victor Stinner in :gh:`92651`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1964 +msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." +msgstr "" + +#: ../../whatsnew/3.12.rst:1966 +msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1967 +msgid ":c:func:`!PyUnicode_AS_UNICODE`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1968 +msgid ":c:func:`!PyUnicode_AsUnicode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1969 +msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1970 +msgid ":c:func:`!PyUnicode_AS_DATA`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1971 +msgid ":c:func:`!PyUnicode_FromUnicode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1972 +msgid ":c:func:`!PyUnicode_GET_SIZE`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1973 +msgid ":c:func:`!PyUnicode_GetSize`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1974 +msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1976 +msgid "" +"Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " +"Victor Stinner in :gh:`85858`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1979 +msgid "" +"Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " +"(Contributed by Nikita Sobolev in :gh:`99482`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1982 +msgid "" +"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" +"`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" +msgstr "" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 64d79cc65a..a2346bf4c7 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -294,15 +294,15 @@ msgstr "" #: ../../whatsnew/3.2.rst:322 msgid "" -"The tag that is unique to each interpreter is accessible from the :mod:`imp` " -"module:" +"The tag that is unique to each interpreter is accessible from the :mod:`!" +"imp` module:" msgstr "" #: ../../whatsnew/3.2.rst:329 msgid "" "Scripts that try to deduce source filename from the imported file now need " "to be smarter. It is no longer sufficient to simply strip the \"c\" from a " -"\".pyc\" filename. Instead, use the new functions in the :mod:`imp` module:" +"\".pyc\" filename. Instead, use the new functions in the :mod:`!imp` module:" msgstr "" #: ../../whatsnew/3.2.rst:338 @@ -472,13 +472,13 @@ msgid "" "meth:`__missing__` method for unknown keys::" msgstr "" -#: ../../whatsnew/3.2.rst:481 +#: ../../whatsnew/3.2.rst:483 msgid "" "(Suggested by Raymond Hettinger and implemented by Eric Smith in :issue:" "`6081`.)" msgstr "" -#: ../../whatsnew/3.2.rst:484 +#: ../../whatsnew/3.2.rst:486 msgid "" "The interpreter can now be started with a quiet option, ``-q``, to prevent " "the copyright and version information from being displayed in the " @@ -486,11 +486,11 @@ msgid "" "flags` attribute:" msgstr "" -#: ../../whatsnew/3.2.rst:496 +#: ../../whatsnew/3.2.rst:498 msgid "(Contributed by Marcin Wojdyr in :issue:`1772833`)." msgstr "" -#: ../../whatsnew/3.2.rst:498 +#: ../../whatsnew/3.2.rst:500 msgid "" "The :func:`hasattr` function works by calling :func:`getattr` and detecting " "whether an exception is raised. This technique allows it to detect methods " @@ -501,12 +501,12 @@ msgid "" "exceptions pass through::" msgstr "" -#: ../../whatsnew/3.2.rst:517 +#: ../../whatsnew/3.2.rst:519 msgid "" "(Discovered by Yury Selivanov and fixed by Benjamin Peterson; :issue:`9666`.)" msgstr "" -#: ../../whatsnew/3.2.rst:519 +#: ../../whatsnew/3.2.rst:521 msgid "" "The :func:`str` of a float or complex number is now the same as its :func:" "`repr`. Previously, the :func:`str` form was shorter but that just caused " @@ -514,11 +514,11 @@ msgid "" "`repr` is displayed by default:" msgstr "" -#: ../../whatsnew/3.2.rst:530 +#: ../../whatsnew/3.2.rst:532 msgid "(Proposed and implemented by Mark Dickinson; :issue:`9337`.)" msgstr "" -#: ../../whatsnew/3.2.rst:532 +#: ../../whatsnew/3.2.rst:534 msgid "" ":class:`memoryview` objects now have a :meth:`~memoryview.release()` method " "and they also now support the context management protocol. This allows " @@ -526,28 +526,28 @@ msgid "" "from the original object." msgstr "" -#: ../../whatsnew/3.2.rst:541 +#: ../../whatsnew/3.2.rst:543 msgid "(Added by Antoine Pitrou; :issue:`9757`.)" msgstr "" -#: ../../whatsnew/3.2.rst:543 +#: ../../whatsnew/3.2.rst:545 msgid "" "Previously it was illegal to delete a name from the local namespace if it " "occurs as a free variable in a nested block::" msgstr "" -#: ../../whatsnew/3.2.rst:552 +#: ../../whatsnew/3.2.rst:554 msgid "" "This is now allowed. Remember that the target of an :keyword:`except` " "clause is cleared, so this code which used to work with Python 2.6, raised " "a :exc:`SyntaxError` with Python 3.1 and now works again::" msgstr "" -#: ../../whatsnew/3.2.rst:565 +#: ../../whatsnew/3.2.rst:567 msgid "(See :issue:`4617`.)" msgstr "(請見 :issue:`4617`\\ 。)" -#: ../../whatsnew/3.2.rst:567 +#: ../../whatsnew/3.2.rst:569 msgid "" "The internal :c:type:`structsequence` tool now creates subclasses of tuple. " "This means that C structures like those returned by :func:`os.stat`, :func:" @@ -557,25 +557,25 @@ msgid "" "as their pure Python counterparts:" msgstr "" -#: ../../whatsnew/3.2.rst:580 +#: ../../whatsnew/3.2.rst:582 msgid "" "(Suggested by Arfrever Frehtes Taifersar Arahesis and implemented by " "Benjamin Peterson in :issue:`8413`.)" msgstr "" -#: ../../whatsnew/3.2.rst:583 +#: ../../whatsnew/3.2.rst:585 msgid "" "Warnings are now easier to control using the :envvar:`PYTHONWARNINGS` " "environment variable as an alternative to using ``-W`` at the command line:" msgstr "" -#: ../../whatsnew/3.2.rst:590 +#: ../../whatsnew/3.2.rst:592 msgid "" "(Suggested by Barry Warsaw and implemented by Philip Jenvey in :issue:" "`7301`.)" msgstr "" -#: ../../whatsnew/3.2.rst:592 +#: ../../whatsnew/3.2.rst:594 msgid "" "A new warning category, :exc:`ResourceWarning`, has been added. It is " "emitted when potential issues with resource consumption or cleanup are " @@ -584,7 +584,7 @@ msgid "" "command line." msgstr "" -#: ../../whatsnew/3.2.rst:598 +#: ../../whatsnew/3.2.rst:600 msgid "" "A :exc:`ResourceWarning` is issued at interpreter shutdown if the :data:`gc." "garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is set, all " @@ -592,7 +592,7 @@ msgid "" "aware that their code contains object finalization issues." msgstr "" -#: ../../whatsnew/3.2.rst:603 +#: ../../whatsnew/3.2.rst:605 msgid "" "A :exc:`ResourceWarning` is also issued when a :term:`file object` is " "destroyed without having been explicitly closed. While the deallocator for " @@ -602,13 +602,13 @@ msgid "" "enabling the warning from the command line:" msgstr "" -#: ../../whatsnew/3.2.rst:617 +#: ../../whatsnew/3.2.rst:619 msgid "" "(Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:" "`477863`.)" msgstr "" -#: ../../whatsnew/3.2.rst:619 +#: ../../whatsnew/3.2.rst:621 msgid "" ":class:`range` objects now support *index* and *count* methods. This is part " "of an effort to make more objects fully implement the :class:`collections." @@ -618,45 +618,45 @@ msgid "" "This makes *range* more interoperable with lists::" msgstr "" -#: ../../whatsnew/3.2.rst:635 +#: ../../whatsnew/3.2.rst:637 msgid "" "(Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky " "in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)" msgstr "" -#: ../../whatsnew/3.2.rst:638 +#: ../../whatsnew/3.2.rst:640 msgid "" "The :func:`callable` builtin function from Py2.x was resurrected. It " "provides a concise, readable alternative to using an :term:`abstract base " "class` in an expression like ``isinstance(x, collections.Callable)``:" msgstr "" -#: ../../whatsnew/3.2.rst:647 +#: ../../whatsnew/3.2.rst:649 msgid "(See :issue:`10518`.)" msgstr "(請見 :issue:`10518`\\ 。)" -#: ../../whatsnew/3.2.rst:649 +#: ../../whatsnew/3.2.rst:651 msgid "" "Python's import mechanism can now load modules installed in directories with " "non-ASCII characters in the path name. This solved an aggravating problem " "with home directories for users with non-ASCII characters in their usernames." msgstr "" -#: ../../whatsnew/3.2.rst:653 +#: ../../whatsnew/3.2.rst:655 msgid "(Required extensive work by Victor Stinner in :issue:`9425`.)" msgstr "" -#: ../../whatsnew/3.2.rst:657 +#: ../../whatsnew/3.2.rst:659 msgid "New, Improved, and Deprecated Modules" msgstr "" -#: ../../whatsnew/3.2.rst:659 +#: ../../whatsnew/3.2.rst:661 msgid "" "Python's standard library has undergone significant maintenance efforts and " "quality improvements." msgstr "" -#: ../../whatsnew/3.2.rst:662 +#: ../../whatsnew/3.2.rst:664 msgid "" "The biggest news for Python 3.2 is that the :mod:`email` package, :mod:" "`mailbox` module, and :mod:`nntplib` modules now work correctly with the " @@ -664,7 +664,7 @@ msgid "" "of messages with mixed encodings." msgstr "" -#: ../../whatsnew/3.2.rst:667 +#: ../../whatsnew/3.2.rst:669 msgid "" "Throughout the standard library, there has been more careful attention to " "encodings and text versus bytes issues. In particular, interactions with " @@ -672,23 +672,23 @@ msgid "" "the Windows MBCS encoding, locale-aware encodings, or UTF-8." msgstr "" -#: ../../whatsnew/3.2.rst:672 +#: ../../whatsnew/3.2.rst:674 msgid "" "Another significant win is the addition of substantially better support for " "*SSL* connections and security certificates." msgstr "" -#: ../../whatsnew/3.2.rst:675 +#: ../../whatsnew/3.2.rst:677 msgid "" "In addition, more classes now implement a :term:`context manager` to support " "convenient and reliable resource clean-up using a :keyword:`with` statement." msgstr "" -#: ../../whatsnew/3.2.rst:679 +#: ../../whatsnew/3.2.rst:681 msgid "email" msgstr "email" -#: ../../whatsnew/3.2.rst:681 +#: ../../whatsnew/3.2.rst:683 msgid "" "The usability of the :mod:`email` package in Python 3 has been mostly fixed " "by the extensive efforts of R. David Murray. The problem was that emails " @@ -698,7 +698,7 @@ msgid "" "messages in bytes format." msgstr "" -#: ../../whatsnew/3.2.rst:688 +#: ../../whatsnew/3.2.rst:690 msgid "" "New functions :func:`~email.message_from_bytes` and :func:`~email." "message_from_binary_file`, and new classes :class:`~email.parser." @@ -706,7 +706,7 @@ msgid "" "data to be parsed into model objects." msgstr "" -#: ../../whatsnew/3.2.rst:693 +#: ../../whatsnew/3.2.rst:695 msgid "" "Given bytes input to the model, :meth:`~email.message.Message.get_payload` " "will by default decode a message body that has a :mailheader:`Content-" @@ -714,20 +714,20 @@ msgid "" "and return the resulting string." msgstr "" -#: ../../whatsnew/3.2.rst:698 +#: ../../whatsnew/3.2.rst:700 msgid "" "Given bytes input to the model, :class:`~email.generator.Generator` will " "convert message bodies that have a :mailheader:`Content-Transfer-Encoding` " "of *8bit* to instead have a *7bit* :mailheader:`Content-Transfer-Encoding`." msgstr "" -#: ../../whatsnew/3.2.rst:702 +#: ../../whatsnew/3.2.rst:704 msgid "" "Headers with unencoded non-ASCII bytes are deemed to be :rfc:`2047`\\ -" "encoded using the *unknown-8bit* character set." msgstr "" -#: ../../whatsnew/3.2.rst:705 +#: ../../whatsnew/3.2.rst:707 msgid "" "A new class :class:`~email.generator.BytesGenerator` produces bytes as " "output, preserving any unchanged non-ASCII data that was present in the " @@ -735,7 +735,7 @@ msgid "" "`Content-Transfer-Encoding` of *8bit*." msgstr "" -#: ../../whatsnew/3.2.rst:710 +#: ../../whatsnew/3.2.rst:712 msgid "" "The :mod:`smtplib` :class:`~smtplib.SMTP` class now accepts a byte string " "for the *msg* argument to the :meth:`~smtplib.SMTP.sendmail` method, and a " @@ -744,126 +744,126 @@ msgid "" "*to_addrs* addresses directly from the object." msgstr "" -#: ../../whatsnew/3.2.rst:716 +#: ../../whatsnew/3.2.rst:718 msgid "" "(Proposed and implemented by R. David Murray, :issue:`4661` and :issue:" "`10321`.)" msgstr "" -#: ../../whatsnew/3.2.rst:719 +#: ../../whatsnew/3.2.rst:721 msgid "elementtree" msgstr "elementtree" -#: ../../whatsnew/3.2.rst:721 +#: ../../whatsnew/3.2.rst:723 msgid "" "The :mod:`xml.etree.ElementTree` package and its :mod:`xml.etree." "cElementTree` counterpart have been updated to version 1.3." msgstr "" -#: ../../whatsnew/3.2.rst:724 +#: ../../whatsnew/3.2.rst:726 msgid "Several new and useful functions and methods have been added:" msgstr "" -#: ../../whatsnew/3.2.rst:726 +#: ../../whatsnew/3.2.rst:728 msgid "" ":func:`xml.etree.ElementTree.fromstringlist` which builds an XML document " "from a sequence of fragments" msgstr "" -#: ../../whatsnew/3.2.rst:728 +#: ../../whatsnew/3.2.rst:730 msgid "" ":func:`xml.etree.ElementTree.register_namespace` for registering a global " "namespace prefix" msgstr "" -#: ../../whatsnew/3.2.rst:730 +#: ../../whatsnew/3.2.rst:732 msgid "" ":func:`xml.etree.ElementTree.tostringlist` for string representation " "including all sublists" msgstr "" -#: ../../whatsnew/3.2.rst:732 +#: ../../whatsnew/3.2.rst:734 msgid "" ":meth:`xml.etree.ElementTree.Element.extend` for appending a sequence of " "zero or more elements" msgstr "" -#: ../../whatsnew/3.2.rst:734 +#: ../../whatsnew/3.2.rst:736 msgid "" ":meth:`xml.etree.ElementTree.Element.iterfind` searches an element and " "subelements" msgstr "" -#: ../../whatsnew/3.2.rst:736 +#: ../../whatsnew/3.2.rst:738 msgid "" ":meth:`xml.etree.ElementTree.Element.itertext` creates a text iterator over " "an element and its subelements" msgstr "" -#: ../../whatsnew/3.2.rst:738 +#: ../../whatsnew/3.2.rst:740 msgid "" ":meth:`xml.etree.ElementTree.TreeBuilder.end` closes the current element" msgstr "" -#: ../../whatsnew/3.2.rst:739 +#: ../../whatsnew/3.2.rst:741 msgid "" ":meth:`xml.etree.ElementTree.TreeBuilder.doctype` handles a doctype " "declaration" msgstr "" -#: ../../whatsnew/3.2.rst:742 +#: ../../whatsnew/3.2.rst:744 msgid "Two methods have been deprecated:" msgstr "" -#: ../../whatsnew/3.2.rst:744 +#: ../../whatsnew/3.2.rst:746 msgid ":meth:`xml.etree.ElementTree.getchildren` use ``list(elem)`` instead." msgstr "" -#: ../../whatsnew/3.2.rst:745 +#: ../../whatsnew/3.2.rst:747 msgid ":meth:`xml.etree.ElementTree.getiterator` use ``Element.iter`` instead." msgstr "" -#: ../../whatsnew/3.2.rst:747 +#: ../../whatsnew/3.2.rst:749 msgid "" "For details of the update, see `Introducing ElementTree `_ on " "Fredrik Lundh's website." msgstr "" -#: ../../whatsnew/3.2.rst:751 +#: ../../whatsnew/3.2.rst:753 msgid "(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)" msgstr "" -#: ../../whatsnew/3.2.rst:754 +#: ../../whatsnew/3.2.rst:756 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.2.rst:756 +#: ../../whatsnew/3.2.rst:758 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:760 +#: ../../whatsnew/3.2.rst:762 msgid "" "For example, adding a caching decorator to a database query function can " "save database accesses for popular searches:" msgstr "" -#: ../../whatsnew/3.2.rst:773 +#: ../../whatsnew/3.2.rst:775 msgid "" "To help with choosing an effective cache size, the wrapped function is " "instrumented for tracking cache statistics:" msgstr "" -#: ../../whatsnew/3.2.rst:779 +#: ../../whatsnew/3.2.rst:781 msgid "" "If the phonelist table gets updated, the outdated contents of the cache can " "be cleared with:" msgstr "" -#: ../../whatsnew/3.2.rst:784 +#: ../../whatsnew/3.2.rst:786 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:790 +#: ../../whatsnew/3.2.rst:792 msgid "" "The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` " "attribute pointing to the original callable function. This allows wrapped " @@ -880,84 +880,84 @@ msgid "" "attr:`__doc__` which might not be defined for the wrapped callable." msgstr "" -#: ../../whatsnew/3.2.rst:796 +#: ../../whatsnew/3.2.rst:798 msgid "" "In the above example, the cache can be removed by recovering the original " "function:" msgstr "" -#: ../../whatsnew/3.2.rst:801 +#: ../../whatsnew/3.2.rst:803 msgid "" "(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and :issue:" "`8814`.)" msgstr "" -#: ../../whatsnew/3.2.rst:804 +#: ../../whatsnew/3.2.rst:806 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:808 +#: ../../whatsnew/3.2.rst:810 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:821 +#: ../../whatsnew/3.2.rst:823 msgid "" "With the *total_ordering* decorator, the remaining comparison methods are " "filled in automatically." msgstr "" -#: ../../whatsnew/3.2.rst:824 ../../whatsnew/3.2.rst:836 -#: ../../whatsnew/3.2.rst:880 ../../whatsnew/3.2.rst:901 -#: ../../whatsnew/3.2.rst:915 ../../whatsnew/3.2.rst:1785 -#: ../../whatsnew/3.2.rst:1830 +#: ../../whatsnew/3.2.rst:826 ../../whatsnew/3.2.rst:838 +#: ../../whatsnew/3.2.rst:882 ../../whatsnew/3.2.rst:903 +#: ../../whatsnew/3.2.rst:917 ../../whatsnew/3.2.rst:1787 +#: ../../whatsnew/3.2.rst:1831 msgid "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/3.2.rst:826 +#: ../../whatsnew/3.2.rst:828 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:833 +#: ../../whatsnew/3.2.rst:835 msgid "" "For sorting examples and a brief sorting tutorial, see the `Sorting HowTo " "`_ tutorial." msgstr "" -#: ../../whatsnew/3.2.rst:839 +#: ../../whatsnew/3.2.rst:841 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.2.rst:841 +#: ../../whatsnew/3.2.rst:843 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:852 +#: ../../whatsnew/3.2.rst:854 msgid "" "For an example using :func:`~itertools.accumulate`, see the :ref:`examples " "for the random module `." msgstr "" -#: ../../whatsnew/3.2.rst:855 +#: ../../whatsnew/3.2.rst:857 msgid "" "(Contributed by Raymond Hettinger and incorporating design suggestions from " "Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:859 +#: ../../whatsnew/3.2.rst:861 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.2.rst:861 +#: ../../whatsnew/3.2.rst:863 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:930 +#: ../../whatsnew/3.2.rst:932 msgid "" "Implemented as a two-phase cyclic barrier, :class:`~threading.Barrier` " "objects are suitable for use in loops. The separate *filling* and " @@ -1024,11 +1024,11 @@ msgid "" "resets after each cycle." msgstr "" -#: ../../whatsnew/3.2.rst:935 +#: ../../whatsnew/3.2.rst:937 msgid "Example of using barriers::" msgstr "" -#: ../../whatsnew/3.2.rst:949 +#: ../../whatsnew/3.2.rst:951 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 " @@ -1037,7 +1037,7 @@ msgid "" "barrier point is crossed." msgstr "" -#: ../../whatsnew/3.2.rst:955 +#: ../../whatsnew/3.2.rst:957 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 " @@ -1046,14 +1046,14 @@ msgid "" "exception is raised::" msgstr "" -#: ../../whatsnew/3.2.rst:971 +#: ../../whatsnew/3.2.rst:973 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:975 +#: ../../whatsnew/3.2.rst:977 msgid "" "See `Barrier Synchronization Patterns `_ for more examples " @@ -1063,17 +1063,17 @@ msgid "" "*section 3.6*." msgstr "" -#: ../../whatsnew/3.2.rst:981 +#: ../../whatsnew/3.2.rst:983 msgid "" "(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin " "in :issue:`8777`.)" msgstr "" -#: ../../whatsnew/3.2.rst:985 +#: ../../whatsnew/3.2.rst:987 msgid "datetime and time" msgstr "datetime 和 time" -#: ../../whatsnew/3.2.rst:987 +#: ../../whatsnew/3.2.rst:989 msgid "" "The :mod:`datetime` module has a new type :class:`~datetime.timezone` that " "implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC " @@ -1081,20 +1081,20 @@ msgid "" "datetime objects::" msgstr "" -#: ../../whatsnew/3.2.rst:1000 +#: ../../whatsnew/3.2.rst:1002 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:1004 +#: ../../whatsnew/3.2.rst:1006 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:1007 +#: ../../whatsnew/3.2.rst:1009 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 " @@ -1102,7 +1102,7 @@ msgid "" "POSIX rules governing the ``%y`` strptime format." msgstr "" -#: ../../whatsnew/3.2.rst:1012 +#: ../../whatsnew/3.2.rst:1014 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" "`DeprecationWarning`. Instead, it is recommended that :attr:`time." @@ -1110,7 +1110,7 @@ msgid "" "without guesswork::" msgstr "" -#: ../../whatsnew/3.2.rst:1031 +#: ../../whatsnew/3.2.rst:1033 msgid "" "Several functions now have significantly expanded date ranges. When :attr:" "`time.accept2dyear` is false, the :func:`time.asctime` function will accept " @@ -1119,45 +1119,45 @@ msgid "" "corresponding operating system functions." msgstr "" -#: ../../whatsnew/3.2.rst:1037 +#: ../../whatsnew/3.2.rst:1039 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:1044 +#: ../../whatsnew/3.2.rst:1046 msgid "math" msgstr "math" -#: ../../whatsnew/3.2.rst:1046 +#: ../../whatsnew/3.2.rst:1048 msgid "" "The :mod:`math` module has been updated with six new functions inspired by " "the C99 standard." msgstr "" -#: ../../whatsnew/3.2.rst:1049 +#: ../../whatsnew/3.2.rst:1051 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:1057 +#: ../../whatsnew/3.2.rst:1059 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:1065 +#: ../../whatsnew/3.2.rst:1067 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:1080 +#: ../../whatsnew/3.2.rst:1082 msgid "" "The :func:`~math.gamma` function is a continuous extension of the factorial " "function. See https://en.wikipedia.org/wiki/Gamma_function for details. " @@ -1166,36 +1166,36 @@ msgid "" "computing the natural logarithm of the gamma function:" msgstr "" -#: ../../whatsnew/3.2.rst:1092 +#: ../../whatsnew/3.2.rst:1094 msgid "(Contributed by Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:1095 +#: ../../whatsnew/3.2.rst:1097 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.2.rst:1097 +#: ../../whatsnew/3.2.rst:1099 msgid "" "The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and :" "func:`~abc.abstractstaticmethod`." msgstr "" -#: ../../whatsnew/3.2.rst:1100 +#: ../../whatsnew/3.2.rst:1102 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:1112 +#: ../../whatsnew/3.2.rst:1114 msgid "(Patch submitted by Daniel Urban; :issue:`5867`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1115 +#: ../../whatsnew/3.2.rst:1117 msgid "io" msgstr "io" -#: ../../whatsnew/3.2.rst:1117 +#: ../../whatsnew/3.2.rst:1119 msgid "" "The :class:`io.BytesIO` has a new method, :meth:`~io.BytesIO.getbuffer`, " "which provides functionality similar to :func:`memoryview`. It creates an " @@ -1203,15 +1203,15 @@ msgid "" "and support for slice notation are well-suited to in-place editing::" msgstr "" -#: ../../whatsnew/3.2.rst:1143 +#: ../../whatsnew/3.2.rst:1145 msgid "(Contributed by Antoine Pitrou in :issue:`5506`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1146 +#: ../../whatsnew/3.2.rst:1148 msgid "reprlib" msgstr "reprlib" -#: ../../whatsnew/3.2.rst:1148 +#: ../../whatsnew/3.2.rst:1150 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 " @@ -1220,28 +1220,28 @@ msgid "" "representation string." msgstr "" -#: ../../whatsnew/3.2.rst:1154 +#: ../../whatsnew/3.2.rst:1156 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:1169 +#: ../../whatsnew/3.2.rst:1171 msgid "(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1172 +#: ../../whatsnew/3.2.rst:1174 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.2.rst:1174 +#: ../../whatsnew/3.2.rst:1176 msgid "" "In addition to dictionary-based configuration described above, the :mod:" "`logging` package has many other improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1177 +#: ../../whatsnew/3.2.rst:1179 msgid "" "The logging documentation has been augmented by a :ref:`basic tutorial " "`\\, an :ref:`advanced tutorial ` for zipfiles, uncompressed tarfiles, " @@ -1666,7 +1666,7 @@ msgid "" "tarfiles or custom formats)." msgstr "" -#: ../../whatsnew/3.2.rst:1558 +#: ../../whatsnew/3.2.rst:1560 msgid "" "The principal functions are :func:`~shutil.make_archive` and :func:`~shutil." "unpack_archive`. By default, both operate on the current directory (which " @@ -1675,23 +1675,23 @@ msgid "" "non-destructive (the original files are left unchanged)." msgstr "" -#: ../../whatsnew/3.2.rst:1592 +#: ../../whatsnew/3.2.rst:1594 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.2.rst:1594 +#: ../../whatsnew/3.2.rst:1596 msgid "" "The :mod:`sqlite3` module was updated to pysqlite version 2.6.0. It has two " "new capabilities." msgstr "" -#: ../../whatsnew/3.2.rst:1596 +#: ../../whatsnew/3.2.rst:1598 msgid "" "The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an " "active transaction for uncommitted changes." msgstr "" -#: ../../whatsnew/3.2.rst:1599 +#: ../../whatsnew/3.2.rst:1601 msgid "" "The :meth:`sqlite3.Connection.enable_load_extension` and :meth:`sqlite3." "Connection.load_extension` methods allows you to load SQLite extensions from " @@ -1699,30 +1699,30 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../whatsnew/3.2.rst:1604 +#: ../../whatsnew/3.2.rst:1606 msgid "(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1607 +#: ../../whatsnew/3.2.rst:1609 msgid "html" msgstr "html" -#: ../../whatsnew/3.2.rst:1609 +#: ../../whatsnew/3.2.rst:1611 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:1618 +#: ../../whatsnew/3.2.rst:1620 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.2.rst:1620 +#: ../../whatsnew/3.2.rst:1622 msgid "The :mod:`socket` module has two new improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1622 +#: ../../whatsnew/3.2.rst:1624 msgid "" "Socket objects now have a :meth:`~socket.socket.detach()` method which puts " "the socket into closed state without actually closing the underlying file " @@ -1730,24 +1730,24 @@ msgid "" "Antoine Pitrou; :issue:`8524`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1627 +#: ../../whatsnew/3.2.rst:1629 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:1633 +#: ../../whatsnew/3.2.rst:1635 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.2.rst:1635 +#: ../../whatsnew/3.2.rst:1637 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:1638 +#: ../../whatsnew/3.2.rst:1640 msgid "" "A new class, :class:`~ssl.SSLContext`, serves as a container for persistent " "SSL data, such as protocol settings, certificates, private keys, and various " @@ -1755,14 +1755,14 @@ msgid "" "creating an SSL socket from an SSL context." msgstr "" -#: ../../whatsnew/3.2.rst:1643 +#: ../../whatsnew/3.2.rst:1645 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:1647 +#: ../../whatsnew/3.2.rst:1649 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument. The *ciphers* string lists the allowed encryption algorithms " @@ -1770,7 +1770,7 @@ msgid "" "openssl.org/docs/man1.0.2/man1/ciphers.html#CIPHER-LIST-FORMAT>`__." msgstr "" -#: ../../whatsnew/3.2.rst:1652 +#: ../../whatsnew/3.2.rst:1654 msgid "" "When linked against recent versions of OpenSSL, the :mod:`ssl` module now " "supports the Server Name Indication extension to the TLS protocol, allowing " @@ -1779,20 +1779,20 @@ msgid "" "the *server_hostname* argument to :meth:`ssl.SSLContext.wrap_socket`." msgstr "" -#: ../../whatsnew/3.2.rst:1658 +#: ../../whatsnew/3.2.rst:1660 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:1662 +#: ../../whatsnew/3.2.rst:1664 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:1666 +#: ../../whatsnew/3.2.rst:1668 msgid "" "The version of OpenSSL being used is now accessible using the module " "attributes :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl." @@ -1800,17 +1800,17 @@ msgid "" "(an integer)." msgstr "" -#: ../../whatsnew/3.2.rst:1671 +#: ../../whatsnew/3.2.rst:1673 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:1675 +#: ../../whatsnew/3.2.rst:1677 msgid "nntp" msgstr "nntp" -#: ../../whatsnew/3.2.rst:1677 +#: ../../whatsnew/3.2.rst:1679 msgid "" "The :mod:`nntplib` module has a revamped implementation with better bytes " "and text semantics as well as more practical APIs. These improvements break " @@ -1818,24 +1818,24 @@ msgid "" "dysfunctional in itself." msgstr "" -#: ../../whatsnew/3.2.rst:1682 +#: ../../whatsnew/3.2.rst:1684 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:1686 +#: ../../whatsnew/3.2.rst:1688 msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1689 +#: ../../whatsnew/3.2.rst:1691 msgid "certificates" msgstr "certificates" -#: ../../whatsnew/3.2.rst:1691 +#: ../../whatsnew/3.2.rst:1693 msgid "" ":class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler` " "and :func:`urllib.request.urlopen` now take optional arguments to allow for " @@ -1843,49 +1843,49 @@ msgid "" "recommended in public uses of HTTPS." msgstr "" -#: ../../whatsnew/3.2.rst:1696 +#: ../../whatsnew/3.2.rst:1698 msgid "(Added by Antoine Pitrou, :issue:`9003`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1699 +#: ../../whatsnew/3.2.rst:1701 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.2.rst:1701 +#: ../../whatsnew/3.2.rst:1703 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:1704 +#: ../../whatsnew/3.2.rst:1706 msgid "(Contributed by Lorenzo M. Catucci and Antoine Pitrou, :issue:`4471`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1707 +#: ../../whatsnew/3.2.rst:1709 msgid "http.client" msgstr "http.client" -#: ../../whatsnew/3.2.rst:1709 +#: ../../whatsnew/3.2.rst:1711 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:1713 +#: ../../whatsnew/3.2.rst:1715 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:1718 +#: ../../whatsnew/3.2.rst:1720 msgid "" "Support for certificate checking and HTTPS virtual hosts were added to :" "class:`~http.client.HTTPSConnection`." msgstr "" -#: ../../whatsnew/3.2.rst:1721 +#: ../../whatsnew/3.2.rst:1723 msgid "" "The :meth:`~http.client.HTTPConnection.request` method on connection objects " "allowed an optional *body* argument so that a :term:`file object` could be " @@ -1895,14 +1895,14 @@ msgid "" "flexible than before." msgstr "" -#: ../../whatsnew/3.2.rst:1728 +#: ../../whatsnew/3.2.rst:1730 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:1732 +#: ../../whatsnew/3.2.rst:1734 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 " @@ -1911,11 +1911,11 @@ msgid "" "`10980`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1738 +#: ../../whatsnew/3.2.rst:1740 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.2.rst:1740 +#: ../../whatsnew/3.2.rst:1742 msgid "" "The unittest module has a number of improvements supporting test discovery " "for packages, easier experimentation at the interactive prompt, new testcase " @@ -1923,7 +1923,7 @@ msgid "" "names." msgstr "" -#: ../../whatsnew/3.2.rst:1745 +#: ../../whatsnew/3.2.rst:1747 msgid "" "The command-line call ``python -m unittest`` can now accept file paths " "instead of module names for running specific tests (:issue:`10620`). The " @@ -1933,29 +1933,29 @@ msgid "" "and a directory to start discovery with ``-s``:" msgstr "" -#: ../../whatsnew/3.2.rst:1756 ../../whatsnew/3.2.rst:1765 -#: ../../whatsnew/3.2.rst:1921 +#: ../../whatsnew/3.2.rst:1758 ../../whatsnew/3.2.rst:1767 +#: ../../whatsnew/3.2.rst:1923 msgid "(Contributed by Michael Foord.)" msgstr "" -#: ../../whatsnew/3.2.rst:1758 +#: ../../whatsnew/3.2.rst:1760 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:1767 +#: ../../whatsnew/3.2.rst:1769 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:1775 +#: ../../whatsnew/3.2.rst:1777 msgid "(Contributed by Antoine Pitrou, :issue:`9754`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1777 +#: ../../whatsnew/3.2.rst:1779 msgid "" "Another new method, :meth:`~unittest.TestCase.assertCountEqual` is used to " "compare two iterables to determine if their element counts are equal " @@ -1963,7 +1963,7 @@ msgid "" "regardless of order)::" msgstr "" -#: ../../whatsnew/3.2.rst:1787 +#: ../../whatsnew/3.2.rst:1789 msgid "" "A principal feature of the unittest module is an effort to produce " "meaningful diagnostics when a test fails. When possible, the failure is " @@ -1973,13 +1973,13 @@ msgid "" "that sets maximum length of diffs displayed." msgstr "" -#: ../../whatsnew/3.2.rst:1794 +#: ../../whatsnew/3.2.rst:1796 msgid "" "In addition, the method names in the module have undergone a number of clean-" "ups." msgstr "" -#: ../../whatsnew/3.2.rst:1796 +#: ../../whatsnew/3.2.rst:1798 msgid "" "For example, :meth:`~unittest.TestCase.assertRegex` is the new name for :" "meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the " @@ -1990,76 +1990,75 @@ msgid "" "has unambiguous camel-casing." msgstr "" -#: ../../whatsnew/3.2.rst:1804 +#: ../../whatsnew/3.2.rst:1806 msgid "(Contributed by Raymond Hettinger and implemented by Ezio Melotti.)" msgstr "" -#: ../../whatsnew/3.2.rst:1806 +#: ../../whatsnew/3.2.rst:1808 msgid "" "To improve consistency, some long-standing method aliases are being " "deprecated in favor of the preferred names:" msgstr "" -#: ../../whatsnew/3.2.rst:1810 +#: ../../whatsnew/3.2.rst:1812 msgid "Old Name" msgstr "" -#: ../../whatsnew/3.2.rst:1810 +#: ../../whatsnew/3.2.rst:1812 msgid "Preferred Name" msgstr "" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`assert_`" msgstr ":meth:`assert_`" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`assertEquals`" msgstr ":meth:`assertEquals`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1816 msgid ":meth:`assertNotEquals`" msgstr ":meth:`assertNotEquals`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1816 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.2.rst:1815 +#: ../../whatsnew/3.2.rst:1817 msgid ":meth:`assertAlmostEquals`" msgstr ":meth:`assertAlmostEquals`" -#: ../../whatsnew/3.2.rst:1815 +#: ../../whatsnew/3.2.rst:1817 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.2.rst:1816 +#: ../../whatsnew/3.2.rst:1818 msgid ":meth:`assertNotAlmostEquals`" msgstr ":meth:`assertNotAlmostEquals`" -#: ../../whatsnew/3.2.rst:1816 +#: ../../whatsnew/3.2.rst:1818 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.2.rst:1819 +#: ../../whatsnew/3.2.rst:1821 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." +"expected to be removed in Python 3.3." msgstr "" -#: ../../whatsnew/3.2.rst:1823 +#: ../../whatsnew/3.2.rst:1824 msgid "(Contributed by Ezio Melotti; :issue:`9424`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1825 +#: ../../whatsnew/3.2.rst:1826 msgid "" "The :meth:`~unittest.TestCase.assertDictContainsSubset` method was " "deprecated because it was misimplemented with the arguments in the wrong " @@ -2067,11 +2066,11 @@ msgid "" "``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail." msgstr "" -#: ../../whatsnew/3.2.rst:1833 +#: ../../whatsnew/3.2.rst:1834 msgid "random" msgstr "random" -#: ../../whatsnew/3.2.rst:1835 +#: ../../whatsnew/3.2.rst:1836 msgid "" "The integer methods in the :mod:`random` module now do a better job of " "producing uniform distributions. Previously, they computed selections with " @@ -2083,15 +2082,15 @@ msgid "" "func:`~random.sample`." msgstr "" -#: ../../whatsnew/3.2.rst:1844 +#: ../../whatsnew/3.2.rst:1845 msgid "(Contributed by Raymond Hettinger; :issue:`9025`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1847 +#: ../../whatsnew/3.2.rst:1848 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.2.rst:1849 +#: ../../whatsnew/3.2.rst:1850 msgid "" ":class:`~poplib.POP3_SSL` class now accepts a *context* parameter, which is " "a :class:`ssl.SSLContext` object allowing bundling SSL configuration " @@ -2099,15 +2098,15 @@ msgid "" "lived) structure." msgstr "" -#: ../../whatsnew/3.2.rst:1854 +#: ../../whatsnew/3.2.rst:1855 msgid "(Contributed by Giampaolo Rodolà; :issue:`8807`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1857 +#: ../../whatsnew/3.2.rst:1858 msgid "asyncore" msgstr "asyncore" -#: ../../whatsnew/3.2.rst:1859 +#: ../../whatsnew/3.2.rst:1860 msgid "" ":class:`asyncore.dispatcher` now provides a :meth:`~asyncore.dispatcher." "handle_accepted()` method returning a ``(sock, addr)`` pair which is called " @@ -2117,41 +2116,41 @@ msgid "" "dispatcher.accept()` directly." msgstr "" -#: ../../whatsnew/3.2.rst:1866 +#: ../../whatsnew/3.2.rst:1867 msgid "(Contributed by Giampaolo Rodolà; :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1869 +#: ../../whatsnew/3.2.rst:1870 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.2.rst:1871 +#: ../../whatsnew/3.2.rst:1872 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:1878 +#: ../../whatsnew/3.2.rst:1879 msgid "(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1881 +#: ../../whatsnew/3.2.rst:1882 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.2.rst:1883 +#: ../../whatsnew/3.2.rst:1884 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:1901 +#: ../../whatsnew/3.2.rst:1903 msgid "(Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1903 +#: ../../whatsnew/3.2.rst:1905 msgid "" "To support lookups without the possibility of activating a dynamic " "attribute, the :mod:`inspect` module has a new function, :func:`~inspect." @@ -2159,26 +2158,26 @@ msgid "" "guaranteed not to change state while it is searching::" msgstr "" -#: ../../whatsnew/3.2.rst:1924 +#: ../../whatsnew/3.2.rst:1926 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.2.rst:1926 +#: ../../whatsnew/3.2.rst:1928 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:1934 +#: ../../whatsnew/3.2.rst:1936 msgid "(Contributed by Ron Adam; :issue:`2001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1937 +#: ../../whatsnew/3.2.rst:1939 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.2.rst:1939 +#: ../../whatsnew/3.2.rst:1941 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 " @@ -2186,197 +2185,197 @@ msgid "" "code object. The former returns a string and the latter prints it::" msgstr "" -#: ../../whatsnew/3.2.rst:1966 +#: ../../whatsnew/3.2.rst:1968 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:1988 +#: ../../whatsnew/3.2.rst:1990 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:1992 +#: ../../whatsnew/3.2.rst:1994 msgid "(Contributed by Nick Coghlan in :issue:`9147`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1995 +#: ../../whatsnew/3.2.rst:1997 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.2.rst:1997 +#: ../../whatsnew/3.2.rst:1999 msgid "" "All database modules now support the :meth:`get` and :meth:`setdefault` " "methods." msgstr "" -#: ../../whatsnew/3.2.rst:1999 +#: ../../whatsnew/3.2.rst:2001 msgid "(Suggested by Ray Allen in :issue:`9523`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2002 +#: ../../whatsnew/3.2.rst:2004 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.2.rst:2004 +#: ../../whatsnew/3.2.rst:2006 msgid "" "A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` " "datatype." msgstr "" -#: ../../whatsnew/3.2.rst:2007 +#: ../../whatsnew/3.2.rst:2009 msgid "site" msgstr "site" -#: ../../whatsnew/3.2.rst:2009 +#: ../../whatsnew/3.2.rst:2011 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:2012 +#: ../../whatsnew/3.2.rst:2014 msgid "" ":func:`~site.getsitepackages` lists all global site-packages directories." msgstr "" -#: ../../whatsnew/3.2.rst:2014 +#: ../../whatsnew/3.2.rst:2016 msgid "" ":func:`~site.getuserbase` reports on the user's base directory where data " "can be stored." msgstr "" -#: ../../whatsnew/3.2.rst:2017 +#: ../../whatsnew/3.2.rst:2019 msgid "" ":func:`~site.getusersitepackages` reveals the user-specific site-packages " "directory path." msgstr "" -#: ../../whatsnew/3.2.rst:2032 +#: ../../whatsnew/3.2.rst:2034 msgid "" "Conveniently, some of site's functionality is accessible directly from the " "command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2042 +#: ../../whatsnew/3.2.rst:2044 msgid "(Contributed by Tarek Ziadé in :issue:`6693`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2045 +#: ../../whatsnew/3.2.rst:2047 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.2.rst:2047 +#: ../../whatsnew/3.2.rst:2049 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:2051 +#: ../../whatsnew/3.2.rst:2053 msgid "" "The module offers access simple access functions for platform and version " "information:" msgstr "" -#: ../../whatsnew/3.2.rst:2054 +#: ../../whatsnew/3.2.rst:2056 msgid "" ":func:`~sysconfig.get_platform` returning values like *linux-i586* or " "*macosx-10.6-ppc*." msgstr "" -#: ../../whatsnew/3.2.rst:2056 +#: ../../whatsnew/3.2.rst:2058 msgid "" ":func:`~sysconfig.get_python_version` returns a Python version string such " "as \"3.2\"." msgstr "" -#: ../../whatsnew/3.2.rst:2059 +#: ../../whatsnew/3.2.rst:2061 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*, " +"seven named schemes used by ``distutils``. Those include *posix_prefix*, " "*posix_home*, *posix_user*, *nt*, *nt_user*, *os2*, *os2_home*:" msgstr "" -#: ../../whatsnew/3.2.rst:2063 +#: ../../whatsnew/3.2.rst:2065 msgid "" ":func:`~sysconfig.get_paths` makes a dictionary containing installation " "paths for the current installation scheme." msgstr "" -#: ../../whatsnew/3.2.rst:2065 +#: ../../whatsnew/3.2.rst:2067 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary of platform specific " "variables." msgstr "" -#: ../../whatsnew/3.2.rst:2068 +#: ../../whatsnew/3.2.rst:2070 msgid "There is also a convenient command-line interface:" msgstr "" -#: ../../whatsnew/3.2.rst:2107 +#: ../../whatsnew/3.2.rst:2109 msgid "(Moved out of Distutils by Tarek Ziadé.)" msgstr "" -#: ../../whatsnew/3.2.rst:2110 +#: ../../whatsnew/3.2.rst:2112 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.2.rst:2112 +#: ../../whatsnew/3.2.rst:2114 msgid "" "The :mod:`pdb` debugger module gained a number of usability improvements:" msgstr "" -#: ../../whatsnew/3.2.rst:2114 +#: ../../whatsnew/3.2.rst:2116 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:2116 +#: ../../whatsnew/3.2.rst:2118 msgid "" "A :file:`.pdbrc` script file can contain ``continue`` and ``next`` commands " "that continue debugging." msgstr "" -#: ../../whatsnew/3.2.rst:2118 +#: ../../whatsnew/3.2.rst:2120 msgid "The :class:`Pdb` class constructor now accepts a *nosigint* argument." msgstr "" -#: ../../whatsnew/3.2.rst:2119 +#: ../../whatsnew/3.2.rst:2121 msgid "" "New commands: ``l(list)``, ``ll(long list)`` and ``source`` for listing " "source code." msgstr "" -#: ../../whatsnew/3.2.rst:2121 +#: ../../whatsnew/3.2.rst:2123 msgid "" "New commands: ``display`` and ``undisplay`` for showing or hiding the value " "of an expression if it has changed." msgstr "" -#: ../../whatsnew/3.2.rst:2123 +#: ../../whatsnew/3.2.rst:2125 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:2125 +#: ../../whatsnew/3.2.rst:2127 msgid "Breakpoints can be cleared by breakpoint number." msgstr "" -#: ../../whatsnew/3.2.rst:2127 +#: ../../whatsnew/3.2.rst:2129 msgid "(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)" msgstr "" -#: ../../whatsnew/3.2.rst:2130 +#: ../../whatsnew/3.2.rst:2132 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.2.rst:2132 +#: ../../whatsnew/3.2.rst:2134 msgid "" "The :mod:`configparser` module was modified to improve usability and " "predictability of the default parser and its supported INI syntax. The old :" @@ -2386,63 +2385,63 @@ msgid "" "option duplicates are not allowed in a single configuration source." msgstr "" -#: ../../whatsnew/3.2.rst:2139 +#: ../../whatsnew/3.2.rst:2141 msgid "Config parsers gained a new API based on the mapping protocol::" msgstr "" -#: ../../whatsnew/3.2.rst:2167 +#: ../../whatsnew/3.2.rst:2169 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:2170 +#: ../../whatsnew/3.2.rst:2172 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:2174 +#: ../../whatsnew/3.2.rst:2176 msgid "" "There is support for pluggable interpolation including an additional " "interpolation handler :class:`~configparser.ExtendedInterpolation`::" msgstr "" -#: ../../whatsnew/3.2.rst:2207 +#: ../../whatsnew/3.2.rst:2209 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:2211 +#: ../../whatsnew/3.2.rst:2213 msgid "(All changes contributed by Łukasz Langa.)" msgstr "" -#: ../../whatsnew/3.2.rst:2216 +#: ../../whatsnew/3.2.rst:2218 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.2.rst:2218 +#: ../../whatsnew/3.2.rst:2220 msgid "" "A number of usability improvements were made for the :mod:`urllib.parse` " "module." msgstr "" -#: ../../whatsnew/3.2.rst:2220 +#: ../../whatsnew/3.2.rst:2222 msgid "" "The :func:`~urllib.parse.urlparse` function now supports `IPv6 `_ addresses as described in :rfc:`2732`:" msgstr "" -#: ../../whatsnew/3.2.rst:2232 +#: ../../whatsnew/3.2.rst:2234 msgid "" "The :func:`~urllib.parse.urldefrag` function now returns a :term:`named " "tuple`::" msgstr "" -#: ../../whatsnew/3.2.rst:2242 +#: ../../whatsnew/3.2.rst:2244 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 " @@ -2450,7 +2449,7 @@ msgid "" "func:`~urllib.parse.quote_plus` for encoding::" msgstr "" -#: ../../whatsnew/3.2.rst:2253 +#: ../../whatsnew/3.2.rst:2255 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 " @@ -2459,17 +2458,17 @@ msgid "" "strings:" msgstr "" -#: ../../whatsnew/3.2.rst:2262 +#: ../../whatsnew/3.2.rst:2264 msgid "" "(Work by Nick Coghlan, Dan Mahn, and Senthil Kumaran in :issue:`2987`, :" "issue:`5468`, and :issue:`9873`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2266 +#: ../../whatsnew/3.2.rst:2268 msgid "mailbox" msgstr "mailbox" -#: ../../whatsnew/3.2.rst:2268 +#: ../../whatsnew/3.2.rst:2270 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 " @@ -2478,27 +2477,27 @@ msgid "" "different encodings." msgstr "" -#: ../../whatsnew/3.2.rst:2273 +#: ../../whatsnew/3.2.rst:2275 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:2277 +#: ../../whatsnew/3.2.rst:2279 msgid "" "As expected, the :meth:`~mailbox.Mailbox.add` method for :class:`mailbox." "Mailbox` objects now accepts binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2280 +#: ../../whatsnew/3.2.rst:2282 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:2284 +#: ../../whatsnew/3.2.rst:2286 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 " @@ -2507,7 +2506,7 @@ msgid "" "message corresponding to a given *key*." msgstr "" -#: ../../whatsnew/3.2.rst:2290 +#: ../../whatsnew/3.2.rst:2292 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. " @@ -2515,17 +2514,17 @@ msgid "" "object or to load them from binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2295 +#: ../../whatsnew/3.2.rst:2297 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:2299 +#: ../../whatsnew/3.2.rst:2301 msgid "turtledemo" msgstr "turtledemo" -#: ../../whatsnew/3.2.rst:2301 +#: ../../whatsnew/3.2.rst:2303 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 " @@ -2533,16 +2532,16 @@ msgid "" "from the command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2310 +#: ../../whatsnew/3.2.rst:2312 msgid "" "(Moved from the Demo directory by Alexander Belopolsky in :issue:`10199`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2313 +#: ../../whatsnew/3.2.rst:2315 msgid "Multi-threading" msgstr "" -#: ../../whatsnew/3.2.rst:2315 +#: ../../whatsnew/3.2.rst:2317 msgid "" "The mechanism for serializing execution of concurrently running Python " "threads (generally known as the :term:`GIL` or Global Interpreter Lock) has " @@ -2554,7 +2553,7 @@ msgid "" "setswitchinterval()`. It currently defaults to 5 milliseconds." msgstr "" -#: ../../whatsnew/3.2.rst:2324 +#: ../../whatsnew/3.2.rst:2326 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 " @@ -2638,35 +2637,35 @@ msgid "" "saves time lost to delegating comparisons." msgstr "" -#: ../../whatsnew/3.2.rst:2379 +#: ../../whatsnew/3.2.rst:2381 msgid "(Patch by Daniel Stutzbach in :issue:`9915`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2381 +#: ../../whatsnew/3.2.rst:2383 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:2385 +#: ../../whatsnew/3.2.rst:2387 msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2388 +#: ../../whatsnew/3.2.rst:2390 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:2392 +#: ../../whatsnew/3.2.rst:2394 msgid "(Contributed by Antoine Pitrou; :issue:`3001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2394 +#: ../../whatsnew/3.2.rst:2396 msgid "" "The fast-search algorithm in stringlib is now used by the :meth:`split`, :" "meth:`rsplit`, :meth:`splitlines` and :meth:`replace` methods on :class:" @@ -2675,21 +2674,21 @@ msgid "" "meth:`rpartition`." msgstr "" -#: ../../whatsnew/3.2.rst:2400 +#: ../../whatsnew/3.2.rst:2402 msgid "(Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2403 +#: ../../whatsnew/3.2.rst:2405 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:2406 +#: ../../whatsnew/3.2.rst:2408 msgid "(:issue:`6713` by Gawain Bolton, Mark Dickinson, and Victor Stinner.)" msgstr "" -#: ../../whatsnew/3.2.rst:2408 +#: ../../whatsnew/3.2.rst:2410 msgid "" "There were several other minor optimizations. Set differencing now runs " "faster when one operand is much larger than the other (patch by Andress " @@ -2701,11 +2700,11 @@ msgid "" "line arguments a bit faster (:issue:`7113` by Łukasz Langa)." msgstr "" -#: ../../whatsnew/3.2.rst:2419 +#: ../../whatsnew/3.2.rst:2421 msgid "Unicode" msgstr "Unicode" -#: ../../whatsnew/3.2.rst:2421 +#: ../../whatsnew/3.2.rst:2423 msgid "" "Python has been updated to `Unicode 6.0.0 `_. The update to the standard adds over 2,000 new characters " @@ -2713,7 +2712,7 @@ msgid "" "important for mobile phones." msgstr "" -#: ../../whatsnew/3.2.rst:2426 +#: ../../whatsnew/3.2.rst:2428 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 " @@ -2723,15 +2722,15 @@ msgid "" "#Database_Changes>`_." msgstr "" -#: ../../whatsnew/3.2.rst:2434 +#: ../../whatsnew/3.2.rst:2436 msgid "Codecs" msgstr "" -#: ../../whatsnew/3.2.rst:2436 +#: ../../whatsnew/3.2.rst:2438 msgid "Support was added for *cp720* Arabic DOS encoding (:issue:`1616979`)." msgstr "" -#: ../../whatsnew/3.2.rst:2438 +#: ../../whatsnew/3.2.rst:2440 msgid "" "MBCS encoding no longer ignores the error handler argument. In the default " "strict mode, it raises an :exc:`UnicodeDecodeError` when it encounters an " @@ -2739,40 +2738,40 @@ msgid "" "unencodable character." msgstr "" -#: ../../whatsnew/3.2.rst:2443 +#: ../../whatsnew/3.2.rst:2445 msgid "" "The MBCS codec supports ``'strict'`` and ``'ignore'`` error handlers for " "decoding, and ``'strict'`` and ``'replace'`` for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2446 +#: ../../whatsnew/3.2.rst:2448 msgid "" "To emulate Python3.1 MBCS encoding, select the ``'ignore'`` handler for " "decoding and the ``'replace'`` handler for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2449 +#: ../../whatsnew/3.2.rst:2451 msgid "" "On Mac OS X, Python decodes command line arguments with ``'utf-8'`` rather " "than the locale encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2452 +#: ../../whatsnew/3.2.rst:2454 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:2458 +#: ../../whatsnew/3.2.rst:2460 msgid "Documentation" msgstr "文件" -#: ../../whatsnew/3.2.rst:2460 +#: ../../whatsnew/3.2.rst:2462 msgid "The documentation continues to be improved." msgstr "" -#: ../../whatsnew/3.2.rst:2462 +#: ../../whatsnew/3.2.rst:2464 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 " @@ -2780,7 +2779,7 @@ msgid "" "and memory jog without having to read all of the docs." msgstr "" -#: ../../whatsnew/3.2.rst:2467 +#: ../../whatsnew/3.2.rst:2469 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 " @@ -2788,80 +2787,80 @@ msgid "" "documentation has a quick link at the top labeled:" msgstr "" -#: ../../whatsnew/3.2.rst:2472 +#: ../../whatsnew/3.2.rst:2474 msgid "**Source code** :source:`Lib/functools.py`." msgstr "" -#: ../../whatsnew/3.2.rst:2474 +#: ../../whatsnew/3.2.rst:2476 msgid "" "(Contributed by Raymond Hettinger; see `rationale `_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2477 +#: ../../whatsnew/3.2.rst:2479 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:2482 +#: ../../whatsnew/3.2.rst:2484 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:2486 +#: ../../whatsnew/3.2.rst:2488 msgid "(Contributed by Alexander Belopolsky in :issue:`9528`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2488 +#: ../../whatsnew/3.2.rst:2490 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:2492 +#: ../../whatsnew/3.2.rst:2494 msgid "(Contributed by Georg Brandl in :issue:`7962`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2496 +#: ../../whatsnew/3.2.rst:2498 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.2.rst:2498 +#: ../../whatsnew/3.2.rst:2500 msgid "" "The format menu now has an option to clean source files by stripping " "trailing whitespace." msgstr "" -#: ../../whatsnew/3.2.rst:2501 +#: ../../whatsnew/3.2.rst:2503 msgid "(Contributed by Raymond Hettinger; :issue:`5150`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2503 +#: ../../whatsnew/3.2.rst:2505 msgid "IDLE on Mac OS X now works with both Carbon AquaTk and Cocoa AquaTk." msgstr "" -#: ../../whatsnew/3.2.rst:2505 +#: ../../whatsnew/3.2.rst:2507 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2508 +#: ../../whatsnew/3.2.rst:2510 msgid "Code Repository" msgstr "" -#: ../../whatsnew/3.2.rst:2510 +#: ../../whatsnew/3.2.rst:2512 msgid "" "In addition to the existing Subversion code repository at https://svn.python." "org there is now a `Mercurial `_ repository " "at https://hg.python.org/\\ ." msgstr "" -#: ../../whatsnew/3.2.rst:2514 +#: ../../whatsnew/3.2.rst:2516 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 " @@ -2869,28 +2868,28 @@ msgid "" "pep:`385` for details." msgstr "" -#: ../../whatsnew/3.2.rst:2519 +#: ../../whatsnew/3.2.rst:2521 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:2525 +#: ../../whatsnew/3.2.rst:2527 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.2.rst:2527 +#: ../../whatsnew/3.2.rst:2529 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.2.rst:2529 +#: ../../whatsnew/3.2.rst:2531 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:2532 +#: ../../whatsnew/3.2.rst:2534 msgid "" "The C functions that access the Unicode Database now accept and return " "characters from the full Unicode range, even on narrow unicode builds " @@ -2900,33 +2899,33 @@ msgid "" "characters as printable." msgstr "" -#: ../../whatsnew/3.2.rst:2539 +#: ../../whatsnew/3.2.rst:2541 msgid "" "(Reported by Bupjoe Lee and fixed by Amaury Forgeot D'Arc; :issue:`5127`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2541 +#: ../../whatsnew/3.2.rst:2543 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:2545 +#: ../../whatsnew/3.2.rst:2547 msgid "(Contributed by Antoine Pitrou; :issue:`9203`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2547 +#: ../../whatsnew/3.2.rst:2549 msgid "" "The option ``--with-wctype-functions`` was removed. The built-in unicode " "database is now used for all functions." msgstr "" -#: ../../whatsnew/3.2.rst:2550 +#: ../../whatsnew/3.2.rst:2552 msgid "(Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2552 +#: ../../whatsnew/3.2.rst:2554 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 " @@ -2936,34 +2935,34 @@ msgid "" "grow to that size but their performance degraded catastrophically)." msgstr "" -#: ../../whatsnew/3.2.rst:2559 +#: ../../whatsnew/3.2.rst:2561 msgid "" "(Suggested by Raymond Hettinger and implemented by Benjamin Peterson; :issue:" "`9778`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2562 +#: ../../whatsnew/3.2.rst:2564 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:2566 +#: ../../whatsnew/3.2.rst:2568 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:2570 +#: ../../whatsnew/3.2.rst:2572 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:2574 +#: ../../whatsnew/3.2.rst:2576 msgid "" "There is a new function :c:func:`PyLong_AsLongLongAndOverflow` which is " "analogous to :c:func:`PyLong_AsLongAndOverflow`. They both serve to convert " @@ -2971,13 +2970,13 @@ msgid "" "of cases where the conversion won't fit (:issue:`7767`)." msgstr "" -#: ../../whatsnew/3.2.rst:2579 +#: ../../whatsnew/3.2.rst:2581 msgid "" "The :c:func:`PyUnicode_CompareWithASCIIString` function now returns *not " "equal* if the Python string is *NUL* terminated." msgstr "" -#: ../../whatsnew/3.2.rst:2582 +#: ../../whatsnew/3.2.rst:2584 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 " @@ -2985,7 +2984,7 @@ msgid "" "Python counterparts (:issue:`7033`)." msgstr "" -#: ../../whatsnew/3.2.rst:2587 +#: ../../whatsnew/3.2.rst:2589 msgid "" "When compiled with the ``--with-valgrind`` option, the pymalloc allocator " "will be automatically disabled when running under Valgrind. This gives " @@ -2993,20 +2992,20 @@ msgid "" "advantage of pymalloc at other times (:issue:`2422`)." msgstr "" -#: ../../whatsnew/3.2.rst:2592 +#: ../../whatsnew/3.2.rst:2594 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:2595 +#: ../../whatsnew/3.2.rst:2597 msgid "" "There were a number of other small changes to the C-API. See the `Misc/NEWS " "`__ file for a " "complete list." msgstr "" -#: ../../whatsnew/3.2.rst:2599 +#: ../../whatsnew/3.2.rst:2601 msgid "" "Also, there were a number of updates to the Mac OS X build, see `Mac/" "BuildScript/README.txt `_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2696 +#: ../../whatsnew/3.2.rst:2698 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 " @@ -3169,32 +3168,32 @@ msgid "" "writing to fixed length segment of a structure." msgstr "" -#: ../../whatsnew/3.2.rst:2702 +#: ../../whatsnew/3.2.rst:2704 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:2705 +#: ../../whatsnew/3.2.rst:2707 msgid "" "(Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2707 +#: ../../whatsnew/3.2.rst:2709 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:2711 +#: ../../whatsnew/3.2.rst:2713 msgid "" "The new, longer :func:`str` value on floats may break doctests which rely on " "the old output format." msgstr "" -#: ../../whatsnew/3.2.rst:2714 +#: ../../whatsnew/3.2.rst:2716 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 " @@ -3203,28 +3202,28 @@ msgid "" "race conditions when open file descriptors would leak into the child process." msgstr "" -#: ../../whatsnew/3.2.rst:2721 +#: ../../whatsnew/3.2.rst:2723 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:2725 +#: ../../whatsnew/3.2.rst:2727 msgid "(Contributed by Antoine Pitrou, :issue:`10711`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2727 +#: ../../whatsnew/3.2.rst:2729 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:2730 +#: ../../whatsnew/3.2.rst:2732 msgid "(Contributed by Antoine Pitrou, :issue:`10272`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2732 +#: ../../whatsnew/3.2.rst:2734 msgid "" "The misleading functions :c:func:`PyEval_AcquireLock()` and :c:func:" "`PyEval_ReleaseLock()` have been officially deprecated. The thread-state " @@ -3232,18 +3231,18 @@ msgid "" "`PyEval_RestoreThread()`) should be used instead." msgstr "" -#: ../../whatsnew/3.2.rst:2737 +#: ../../whatsnew/3.2.rst:2739 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:2740 +#: ../../whatsnew/3.2.rst:2742 msgid "(Contributed by Giampaolo Rodola in :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2742 +#: ../../whatsnew/3.2.rst:2744 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.3.po b/whatsnew/3.3.po index 11b11271b7..26214522d4 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -217,7 +217,7 @@ msgid "" "dimensional NumPy-style arrays is explained." msgstr "" -#: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1122 +#: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1123 msgid "Features" msgstr "" @@ -254,7 +254,7 @@ msgid "" "now possible to reverse a memoryview in O(1) by using a negative step." msgstr "" -#: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1132 +#: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1133 msgid "API changes" msgstr "" @@ -719,39 +719,39 @@ msgstr "" msgid "Example with (non-bound) methods::" msgstr "" -#: ../../whatsnew/3.3.rst:568 +#: ../../whatsnew/3.3.rst:569 msgid "Example with nested classes::" msgstr "" "巢狀類別範例:\n" "\n" "::" -#: ../../whatsnew/3.3.rst:584 +#: ../../whatsnew/3.3.rst:585 msgid "Example with nested functions::" msgstr "" "巢狀函式範例:\n" "\n" "::" -#: ../../whatsnew/3.3.rst:596 +#: ../../whatsnew/3.3.rst:597 msgid "" "The string representation of those objects is also changed to include the " "new, more precise information::" msgstr "" -#: ../../whatsnew/3.3.rst:606 +#: ../../whatsnew/3.3.rst:607 msgid ":pep:`3155` - Qualified name for classes and functions" msgstr "" -#: ../../whatsnew/3.3.rst:607 +#: ../../whatsnew/3.3.rst:608 msgid "PEP written and implemented by Antoine Pitrou." msgstr "由 Antoine Pitrou 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:613 +#: ../../whatsnew/3.3.rst:614 msgid "PEP 412: Key-Sharing Dictionary" msgstr "" -#: ../../whatsnew/3.3.rst:615 +#: ../../whatsnew/3.3.rst:616 msgid "" "Dictionaries used for the storage of objects' attributes are now able to " "share part of their internal storage between each other (namely, the part " @@ -759,19 +759,19 @@ msgid "" "consumption of programs creating many instances of non-builtin types." msgstr "" -#: ../../whatsnew/3.3.rst:622 +#: ../../whatsnew/3.3.rst:623 msgid ":pep:`412` - Key-Sharing Dictionary" msgstr "" -#: ../../whatsnew/3.3.rst:623 +#: ../../whatsnew/3.3.rst:624 msgid "PEP written and implemented by Mark Shannon." msgstr "由 Mark Shannon 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:627 +#: ../../whatsnew/3.3.rst:628 msgid "PEP 362: Function Signature Object" msgstr "" -#: ../../whatsnew/3.3.rst:629 +#: ../../whatsnew/3.3.rst:630 msgid "" "A new function :func:`inspect.signature` makes introspection of python " "callables easy and straightforward. A broad range of callables is " @@ -783,21 +783,21 @@ msgid "" "code that validates or amends calling signatures or arguments." msgstr "" -#: ../../whatsnew/3.3.rst:641 +#: ../../whatsnew/3.3.rst:642 msgid ":pep:`362`: - Function Signature Object" msgstr "" -#: ../../whatsnew/3.3.rst:641 +#: ../../whatsnew/3.3.rst:642 msgid "" "PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo; " "implemented by Yury Selivanov." msgstr "" -#: ../../whatsnew/3.3.rst:646 +#: ../../whatsnew/3.3.rst:647 msgid "PEP 421: Adding sys.implementation" msgstr "" -#: ../../whatsnew/3.3.rst:648 +#: ../../whatsnew/3.3.rst:649 msgid "" "A new attribute on the :mod:`sys` module exposes details specific to the " "implementation of the currently running interpreter. The initial set of " @@ -805,7 +805,7 @@ msgid "" "``hexversion``, and ``cache_tag``." msgstr "" -#: ../../whatsnew/3.3.rst:653 +#: ../../whatsnew/3.3.rst:654 msgid "" "The intention of ``sys.implementation`` is to consolidate into one namespace " "the implementation-specific data used by the standard library. This allows " @@ -815,7 +815,7 @@ msgid "" "ratio will shift in order to make the standard library more portable." msgstr "" -#: ../../whatsnew/3.3.rst:660 +#: ../../whatsnew/3.3.rst:661 msgid "" "One example of improved standard library portability is ``cache_tag``. As " "of Python 3.3, ``sys.implementation.cache_tag`` is used by :mod:`importlib` " @@ -824,11 +824,11 @@ msgid "" "control the caching behavior for modules." msgstr "" -#: ../../whatsnew/3.3.rst:667 +#: ../../whatsnew/3.3.rst:668 msgid "SimpleNamespace" msgstr "SimpleNamespace" -#: ../../whatsnew/3.3.rst:669 +#: ../../whatsnew/3.3.rst:670 msgid "" "The implementation of ``sys.implementation`` also introduces a new type to " "Python: :class:`types.SimpleNamespace`. In contrast to a mapping-based " @@ -838,27 +838,27 @@ msgid "" "through normal attribute access." msgstr "" -#: ../../whatsnew/3.3.rst:678 +#: ../../whatsnew/3.3.rst:679 msgid ":pep:`421` - Adding sys.implementation" msgstr "" -#: ../../whatsnew/3.3.rst:679 +#: ../../whatsnew/3.3.rst:680 msgid "PEP written and implemented by Eric Snow." msgstr "由 Eric Snow 撰寫 PEP 與實作。" -#: ../../whatsnew/3.3.rst:685 +#: ../../whatsnew/3.3.rst:686 msgid "Using importlib as the Implementation of Import" msgstr "" -#: ../../whatsnew/3.3.rst:686 +#: ../../whatsnew/3.3.rst:687 msgid "" ":issue:`2377` - Replace __import__ w/ importlib.__import__ :issue:`13959` - " -"Re-implement parts of :mod:`imp` in pure Python :issue:`14605` - Make import " -"machinery explicit :issue:`14646` - Require loaders set __loader__ and " -"__package__" +"Re-implement parts of :mod:`!imp` in pure Python :issue:`14605` - Make " +"import machinery explicit :issue:`14646` - Require loaders set __loader__ " +"and __package__" msgstr "" -#: ../../whatsnew/3.3.rst:691 +#: ../../whatsnew/3.3.rst:692 msgid "" "The :func:`__import__` function is now powered by :func:`importlib." "__import__`. This work leads to the completion of \"phase 2\" of :pep:`302`. " @@ -870,7 +870,7 @@ msgid "" "import, allowing for future growth to occur." msgstr "" -#: ../../whatsnew/3.3.rst:700 +#: ../../whatsnew/3.3.rst:701 msgid "" "For the common user, there should be no visible change in semantics. For " "those whose code currently manipulates import or calls import " @@ -878,36 +878,36 @@ msgid "" "covered in the `Porting Python code`_ section of this document." msgstr "" -#: ../../whatsnew/3.3.rst:706 +#: ../../whatsnew/3.3.rst:707 msgid "New APIs" msgstr "" -#: ../../whatsnew/3.3.rst:707 +#: ../../whatsnew/3.3.rst:708 msgid "" "One of the large benefits of this work is the exposure of what goes into " "making the import statement work. That means the various importers that were " "once implicit are now fully exposed as part of the :mod:`importlib` package." msgstr "" -#: ../../whatsnew/3.3.rst:711 +#: ../../whatsnew/3.3.rst:712 msgid "" "The abstract base classes defined in :mod:`importlib.abc` have been expanded " "to properly delineate between :term:`meta path finders ` " "and :term:`path entry finders ` by introducing :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.PathEntryFinder`, " -"respectively. The old ABC of :class:`importlib.abc.Finder` is now only " +"respectively. The old ABC of :class:`!importlib.abc.Finder` is now only " "provided for backwards-compatibility and does not enforce any method " "requirements." msgstr "" -#: ../../whatsnew/3.3.rst:719 +#: ../../whatsnew/3.3.rst:720 msgid "" "In terms of finders, :class:`importlib.machinery.FileFinder` exposes the " "mechanism used to search for source and bytecode files of a module. " "Previously this class was an implicit member of :attr:`sys.path_hooks`." msgstr "" -#: ../../whatsnew/3.3.rst:723 +#: ../../whatsnew/3.3.rst:724 msgid "" "For loaders, the new abstract base class :class:`importlib.abc.FileLoader` " "helps write a loader that uses the file system as the storage mechanism for " @@ -917,7 +917,7 @@ msgid "" "ExtensionFileLoader`) are now available for direct use." msgstr "" -#: ../../whatsnew/3.3.rst:731 +#: ../../whatsnew/3.3.rst:732 msgid "" ":exc:`ImportError` now has ``name`` and ``path`` attributes which are set " "when there is relevant data to provide. The message for failed imports will " @@ -925,24 +925,24 @@ msgid "" "the module's name." msgstr "" -#: ../../whatsnew/3.3.rst:736 +#: ../../whatsnew/3.3.rst:737 msgid "" "The :func:`importlib.invalidate_caches` function will now call the method " "with the same name on all finders cached in :attr:`sys.path_importer_cache` " "to help clean up any stored state as necessary." msgstr "" -#: ../../whatsnew/3.3.rst:741 +#: ../../whatsnew/3.3.rst:742 msgid "Visible Changes" msgstr "" -#: ../../whatsnew/3.3.rst:743 +#: ../../whatsnew/3.3.rst:744 msgid "" "For potential required changes to code, see the `Porting Python code`_ " "section." msgstr "" -#: ../../whatsnew/3.3.rst:746 +#: ../../whatsnew/3.3.rst:747 msgid "" "Beyond the expanse of what :mod:`importlib` now exposes, there are other " "visible changes to import. The biggest is that :attr:`sys.meta_path` and :" @@ -953,7 +953,7 @@ msgid "" "fit one's needs." msgstr "" -#: ../../whatsnew/3.3.rst:753 +#: ../../whatsnew/3.3.rst:754 msgid "" "Another change is that all modules have a ``__loader__`` attribute, storing " "the loader used to create the module. :pep:`302` has been updated to make " @@ -963,81 +963,81 @@ msgid "" "load." msgstr "" -#: ../../whatsnew/3.3.rst:759 +#: ../../whatsnew/3.3.rst:760 msgid "" "Loaders are also now expected to set the ``__package__`` attribute from :pep:" "`366`. Once again, import itself is already setting this on all loaders " "from :mod:`importlib` and import itself is setting the attribute post-load." msgstr "" -#: ../../whatsnew/3.3.rst:763 +#: ../../whatsnew/3.3.rst:764 msgid "" "``None`` is now inserted into :attr:`sys.path_importer_cache` when no finder " -"can be found on :attr:`sys.path_hooks`. Since :class:`imp.NullImporter` is " +"can be found on :attr:`sys.path_hooks`. Since :class:`!imp.NullImporter` is " "not directly exposed on :attr:`sys.path_hooks` it could no longer be relied " "upon to always be available to use as a value representing no finder found." msgstr "" -#: ../../whatsnew/3.3.rst:768 +#: ../../whatsnew/3.3.rst:769 msgid "" "All other changes relate to semantic changes which should be taken into " "consideration when updating code for Python 3.3, and thus should be read " "about in the `Porting Python code`_ section of this document." msgstr "" -#: ../../whatsnew/3.3.rst:772 +#: ../../whatsnew/3.3.rst:773 msgid "(Implementation by Brett Cannon)" msgstr "" -#: ../../whatsnew/3.3.rst:776 +#: ../../whatsnew/3.3.rst:777 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.3.rst:778 +#: ../../whatsnew/3.3.rst:779 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/3.3.rst:780 +#: ../../whatsnew/3.3.rst:781 msgid "" "Added support for Unicode name aliases and named sequences. Both :func:" "`unicodedata.lookup()` and ``'\\N{...}'`` now resolve name aliases, and :" "func:`unicodedata.lookup()` resolves named sequences too." msgstr "" -#: ../../whatsnew/3.3.rst:784 +#: ../../whatsnew/3.3.rst:785 msgid "(Contributed by Ezio Melotti in :issue:`12753`.)" msgstr "" -#: ../../whatsnew/3.3.rst:786 +#: ../../whatsnew/3.3.rst:787 msgid "Unicode database updated to UCD version 6.1.0" msgstr "" -#: ../../whatsnew/3.3.rst:788 +#: ../../whatsnew/3.3.rst:789 msgid "" "Equality comparisons on :func:`range` objects now return a result reflecting " "the equality of the underlying sequences generated by those range objects. (:" "issue:`13201`)" msgstr "" -#: ../../whatsnew/3.3.rst:792 +#: ../../whatsnew/3.3.rst:793 msgid "" "The ``count()``, ``find()``, ``rfind()``, ``index()`` and ``rindex()`` " "methods of :class:`bytes` and :class:`bytearray` objects now accept an " "integer between 0 and 255 as their first argument." msgstr "" -#: ../../whatsnew/3.3.rst:796 +#: ../../whatsnew/3.3.rst:797 msgid "(Contributed by Petri Lehtinen in :issue:`12170`.)" msgstr "" -#: ../../whatsnew/3.3.rst:798 +#: ../../whatsnew/3.3.rst:799 msgid "" "The ``rjust()``, ``ljust()``, and ``center()`` methods of :class:`bytes` " "and :class:`bytearray` now accept a :class:`bytearray` for the ``fill`` " "argument. (Contributed by Petri Lehtinen in :issue:`12380`.)" msgstr "" -#: ../../whatsnew/3.3.rst:802 +#: ../../whatsnew/3.3.rst:803 msgid "" "New methods have been added to :class:`list` and :class:`bytearray`: " "``copy()`` and ``clear()`` (:issue:`10516`). Consequently, :class:" @@ -1045,40 +1045,40 @@ msgid "" "abc.MutableSequence.clear` method (:issue:`11388`)." msgstr "" -#: ../../whatsnew/3.3.rst:807 +#: ../../whatsnew/3.3.rst:808 msgid "" "Raw bytes literals can now be written ``rb\"...\"`` as well as ``br\"...\"``." msgstr "" -#: ../../whatsnew/3.3.rst:809 +#: ../../whatsnew/3.3.rst:810 msgid "(Contributed by Antoine Pitrou in :issue:`13748`.)" msgstr "" -#: ../../whatsnew/3.3.rst:811 +#: ../../whatsnew/3.3.rst:812 msgid "" ":meth:`dict.setdefault` now does only one lookup for the given key, making " "it atomic when used with built-in types." msgstr "" -#: ../../whatsnew/3.3.rst:814 +#: ../../whatsnew/3.3.rst:815 msgid "(Contributed by Filip Gruszczyński in :issue:`13521`.)" msgstr "" -#: ../../whatsnew/3.3.rst:816 +#: ../../whatsnew/3.3.rst:817 msgid "" "The error messages produced when a function call does not match the function " "signature have been significantly improved." msgstr "" -#: ../../whatsnew/3.3.rst:819 +#: ../../whatsnew/3.3.rst:820 msgid "(Contributed by Benjamin Peterson.)" msgstr "" -#: ../../whatsnew/3.3.rst:823 +#: ../../whatsnew/3.3.rst:824 msgid "A Finer-Grained Import Lock" msgstr "" -#: ../../whatsnew/3.3.rst:825 +#: ../../whatsnew/3.3.rst:826 msgid "" "Previous versions of CPython have always relied on a global import lock. " "This led to unexpected annoyances, such as deadlocks when importing a module " @@ -1087,7 +1087,7 @@ msgid "" "`PyImport_ImportModuleNoBlock` C API function." msgstr "" -#: ../../whatsnew/3.3.rst:831 +#: ../../whatsnew/3.3.rst:832 msgid "" "In Python 3.3, importing a module takes a per-module lock. This correctly " "serializes importation of a given module from multiple threads (preventing " @@ -1095,15 +1095,15 @@ msgid "" "aforementioned annoyances." msgstr "" -#: ../../whatsnew/3.3.rst:836 +#: ../../whatsnew/3.3.rst:837 msgid "(Contributed by Antoine Pitrou in :issue:`9260`.)" msgstr "" -#: ../../whatsnew/3.3.rst:840 +#: ../../whatsnew/3.3.rst:841 msgid "Builtin functions and types" msgstr "" -#: ../../whatsnew/3.3.rst:842 +#: ../../whatsnew/3.3.rst:843 msgid "" ":func:`open` gets a new *opener* parameter: the underlying file descriptor " "for the file object is then obtained by calling *opener* with (*file*, " @@ -1112,26 +1112,26 @@ msgid "" "the file already exists." msgstr "" -#: ../../whatsnew/3.3.rst:847 +#: ../../whatsnew/3.3.rst:848 msgid "" ":func:`print`: added the *flush* keyword argument. If the *flush* keyword " "argument is true, the stream is forcibly flushed." msgstr "" -#: ../../whatsnew/3.3.rst:849 +#: ../../whatsnew/3.3.rst:850 msgid "" ":func:`hash`: hash randomization is enabled by default, see :meth:`object." "__hash__` and :envvar:`PYTHONHASHSEED`." msgstr "" -#: ../../whatsnew/3.3.rst:851 +#: ../../whatsnew/3.3.rst:852 msgid "" "The :class:`str` type gets a new :meth:`~str.casefold` method: return a " "casefolded copy of the string, casefolded strings may be used for caseless " "matching. For example, ``'ß'.casefold()`` returns ``'ss'``." msgstr "" -#: ../../whatsnew/3.3.rst:854 +#: ../../whatsnew/3.3.rst:855 msgid "" "The sequence documentation has been substantially rewritten to better " "explain the binary/text sequence distinction and to provide specific " @@ -1139,15 +1139,15 @@ msgid "" "`4966`)." msgstr "" -#: ../../whatsnew/3.3.rst:861 +#: ../../whatsnew/3.3.rst:862 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.3.rst:864 +#: ../../whatsnew/3.3.rst:865 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.3.rst:866 +#: ../../whatsnew/3.3.rst:867 msgid "" "This new debug module :mod:`faulthandler` contains functions to dump Python " "tracebacks explicitly, on a fault (a crash like a segmentation fault), after " @@ -1158,49 +1158,49 @@ msgid "" "by using :option:`-X` ``faulthandler`` command line option." msgstr "" -#: ../../whatsnew/3.3.rst:874 +#: ../../whatsnew/3.3.rst:875 msgid "Example of a segmentation fault on Linux:" msgstr "" -#: ../../whatsnew/3.3.rst:890 +#: ../../whatsnew/3.3.rst:891 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.3.rst:892 +#: ../../whatsnew/3.3.rst:893 msgid "" "The new :mod:`ipaddress` module provides tools for creating and manipulating " "objects representing IPv4 and IPv6 addresses, networks and interfaces (i.e. " "an IP address associated with a specific IP subnet)." msgstr "" -#: ../../whatsnew/3.3.rst:896 +#: ../../whatsnew/3.3.rst:897 msgid "(Contributed by Google and Peter Moody in :pep:`3144`.)" msgstr "" -#: ../../whatsnew/3.3.rst:899 +#: ../../whatsnew/3.3.rst:900 msgid "lzma" msgstr "lzma" -#: ../../whatsnew/3.3.rst:901 +#: ../../whatsnew/3.3.rst:902 msgid "" "The newly added :mod:`lzma` module provides data compression and " "decompression using the LZMA algorithm, including support for the ``.xz`` " "and ``.lzma`` file formats." msgstr "" -#: ../../whatsnew/3.3.rst:905 +#: ../../whatsnew/3.3.rst:906 msgid "(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`.)" msgstr "" -#: ../../whatsnew/3.3.rst:909 +#: ../../whatsnew/3.3.rst:910 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.3.rst:912 +#: ../../whatsnew/3.3.rst:913 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.3.rst:914 +#: ../../whatsnew/3.3.rst:915 msgid "" "Improved support for abstract base classes containing descriptors composed " "with abstract methods. The recommended approach to declaring abstract " @@ -1208,53 +1208,53 @@ msgid "" "updated property. The built-in descriptors have been updated accordingly." msgstr "" -#: ../../whatsnew/3.3.rst:919 ../../whatsnew/3.3.rst:2245 +#: ../../whatsnew/3.3.rst:920 ../../whatsnew/3.3.rst:2246 msgid "" ":class:`abc.abstractproperty` has been deprecated, use :class:`property` " "with :func:`abc.abstractmethod` instead." msgstr "" -#: ../../whatsnew/3.3.rst:921 ../../whatsnew/3.3.rst:2247 +#: ../../whatsnew/3.3.rst:922 ../../whatsnew/3.3.rst:2248 msgid "" ":class:`abc.abstractclassmethod` has been deprecated, use :class:" "`classmethod` with :func:`abc.abstractmethod` instead." msgstr "" -#: ../../whatsnew/3.3.rst:923 ../../whatsnew/3.3.rst:2249 +#: ../../whatsnew/3.3.rst:924 ../../whatsnew/3.3.rst:2250 msgid "" ":class:`abc.abstractstaticmethod` has been deprecated, use :class:" "`staticmethod` with :func:`abc.abstractmethod` instead." msgstr "" -#: ../../whatsnew/3.3.rst:926 +#: ../../whatsnew/3.3.rst:927 msgid "(Contributed by Darren Dale in :issue:`11610`.)" msgstr "" -#: ../../whatsnew/3.3.rst:928 +#: ../../whatsnew/3.3.rst:929 msgid "" ":meth:`abc.ABCMeta.register` now returns the registered subclass, which " "means it can now be used as a class decorator (:issue:`10868`)." msgstr "" -#: ../../whatsnew/3.3.rst:933 +#: ../../whatsnew/3.3.rst:934 msgid "array" msgstr "array" -#: ../../whatsnew/3.3.rst:935 +#: ../../whatsnew/3.3.rst:936 msgid "" "The :mod:`array` module supports the :c:expr:`long long` type using ``q`` " "and ``Q`` type codes." msgstr "" -#: ../../whatsnew/3.3.rst:938 +#: ../../whatsnew/3.3.rst:939 msgid "(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`.)" msgstr "" -#: ../../whatsnew/3.3.rst:942 +#: ../../whatsnew/3.3.rst:943 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.3.rst:944 +#: ../../whatsnew/3.3.rst:945 msgid "" "ASCII-only Unicode strings are now accepted by the decoding functions of " "the :mod:`base64` modern interface. For example, ``base64." @@ -1262,44 +1262,44 @@ msgid "" "issue:`13641`.)" msgstr "" -#: ../../whatsnew/3.3.rst:950 +#: ../../whatsnew/3.3.rst:951 msgid "binascii" msgstr "binascii" -#: ../../whatsnew/3.3.rst:952 +#: ../../whatsnew/3.3.rst:953 msgid "" "In addition to the binary objects they normally accept, the ``a2b_`` " "functions now all also accept ASCII-only strings as input. (Contributed by " "Antoine Pitrou in :issue:`13637`.)" msgstr "" -#: ../../whatsnew/3.3.rst:958 +#: ../../whatsnew/3.3.rst:959 msgid "bz2" msgstr "bz2" -#: ../../whatsnew/3.3.rst:960 +#: ../../whatsnew/3.3.rst:961 msgid "" "The :mod:`bz2` module has been rewritten from scratch. In the process, " "several new features have been added:" msgstr "" -#: ../../whatsnew/3.3.rst:963 +#: ../../whatsnew/3.3.rst:964 msgid "" "New :func:`bz2.open` function: open a bzip2-compressed file in binary or " "text mode." msgstr "" -#: ../../whatsnew/3.3.rst:966 +#: ../../whatsnew/3.3.rst:967 msgid "" ":class:`bz2.BZ2File` can now read from and write to arbitrary file-like " "objects, by means of its constructor's *fileobj* argument." msgstr "" -#: ../../whatsnew/3.3.rst:969 +#: ../../whatsnew/3.3.rst:970 msgid "(Contributed by Nadeem Vawda in :issue:`5863`.)" msgstr "" -#: ../../whatsnew/3.3.rst:971 +#: ../../whatsnew/3.3.rst:972 msgid "" ":class:`bz2.BZ2File` and :func:`bz2.decompress` can now decompress multi-" "stream inputs (such as those produced by the :program:`pbzip2` tool). :class:" @@ -1307,21 +1307,21 @@ msgid "" "``'a'`` (append) mode." msgstr "" -#: ../../whatsnew/3.3.rst:976 +#: ../../whatsnew/3.3.rst:977 msgid "(Contributed by Nir Aides in :issue:`1625`.)" msgstr "" -#: ../../whatsnew/3.3.rst:978 +#: ../../whatsnew/3.3.rst:979 msgid "" ":class:`bz2.BZ2File` now implements all of the :class:`io.BufferedIOBase` " "API, except for the :meth:`detach` and :meth:`truncate` methods." msgstr "" -#: ../../whatsnew/3.3.rst:983 +#: ../../whatsnew/3.3.rst:984 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.3.rst:985 +#: ../../whatsnew/3.3.rst:986 msgid "" "The :mod:`~encodings.mbcs` codec has been rewritten to handle correctly " "``replace`` and ``ignore`` error handlers on all Windows versions. The :mod:" @@ -1329,7 +1329,7 @@ msgid "" "``replace`` to encode and ``ignore`` to decode." msgstr "" -#: ../../whatsnew/3.3.rst:990 +#: ../../whatsnew/3.3.rst:991 msgid "" "A new Windows-only codec has been added: ``cp65001`` (:issue:`13216`). It is " "the Windows code page 65001 (Windows UTF-8, ``CP_UTF8``). For example, it " @@ -1337,7 +1337,7 @@ msgid "" "(e.g., using ``chcp 65001`` command)." msgstr "" -#: ../../whatsnew/3.3.rst:995 +#: ../../whatsnew/3.3.rst:996 msgid "" "Multibyte CJK decoders now resynchronize faster. They only ignore the first " "byte of an invalid byte sequence. For example, ``b'\\xff\\n'." @@ -1345,42 +1345,42 @@ msgid "" "character." msgstr "" -#: ../../whatsnew/3.3.rst:999 +#: ../../whatsnew/3.3.rst:1000 msgid "(:issue:`12016`)" msgstr "(:issue:`12016`)" -#: ../../whatsnew/3.3.rst:1001 +#: ../../whatsnew/3.3.rst:1002 msgid "" "Incremental CJK codec encoders are no longer reset at each call to their " "encode() methods. For example::" msgstr "" -#: ../../whatsnew/3.3.rst:1009 +#: ../../whatsnew/3.3.rst:1010 msgid "" "This example gives ``b'~{Np~}~{J)~}~{l6~}~{HK~}~{!#~} Bye.'`` with older " "Python versions." msgstr "" -#: ../../whatsnew/3.3.rst:1012 +#: ../../whatsnew/3.3.rst:1013 msgid "(:issue:`12100`)" msgstr "(:issue:`12100`)" -#: ../../whatsnew/3.3.rst:1014 +#: ../../whatsnew/3.3.rst:1015 msgid "The ``unicode_internal`` codec has been deprecated." msgstr "" -#: ../../whatsnew/3.3.rst:1018 +#: ../../whatsnew/3.3.rst:1019 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.3.rst:1020 +#: ../../whatsnew/3.3.rst:1021 msgid "" "Addition of a new :class:`~collections.ChainMap` class to allow treating a " "number of mappings as a single unit. (Written by Raymond Hettinger for :" "issue:`11089`, made public in :issue:`11297`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1024 +#: ../../whatsnew/3.3.rst:1025 msgid "" "The abstract base classes have been moved in a new :mod:`collections.abc` " "module, to better differentiate between the abstract and the concrete " @@ -1388,18 +1388,18 @@ msgid "" "`collections` module to preserve existing imports. (:issue:`11085`)" msgstr "" -#: ../../whatsnew/3.3.rst:1031 +#: ../../whatsnew/3.3.rst:1032 msgid "" "The :class:`~collections.Counter` class now supports the unary ``+`` and ``-" "`` operators, as well as the in-place operators ``+=``, ``-=``, ``|=``, and " "``&=``. (Contributed by Raymond Hettinger in :issue:`13121`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1037 +#: ../../whatsnew/3.3.rst:1038 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.3.rst:1039 +#: ../../whatsnew/3.3.rst:1040 msgid "" ":class:`~contextlib.ExitStack` now provides a solid foundation for " "programmatic manipulation of context managers and similar cleanup " @@ -1411,103 +1411,103 @@ msgid "" "module)." msgstr "" -#: ../../whatsnew/3.3.rst:1048 +#: ../../whatsnew/3.3.rst:1049 msgid "(:issue:`13585`)" msgstr "(:issue:`13585`)" -#: ../../whatsnew/3.3.rst:1052 +#: ../../whatsnew/3.3.rst:1053 msgid "crypt" msgstr "crypt" -#: ../../whatsnew/3.3.rst:1054 +#: ../../whatsnew/3.3.rst:1055 msgid "" "Addition of salt and modular crypt format (hashing method) and the :func:" "`~crypt.mksalt` function to the :mod:`crypt` module." msgstr "" -#: ../../whatsnew/3.3.rst:1057 +#: ../../whatsnew/3.3.rst:1058 msgid "(:issue:`10924`)" msgstr "(:issue:`10924`)" -#: ../../whatsnew/3.3.rst:1060 +#: ../../whatsnew/3.3.rst:1061 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.3.rst:1062 +#: ../../whatsnew/3.3.rst:1063 msgid "" "If the :mod:`curses` module is linked to the ncursesw library, use Unicode " "functions when Unicode strings or characters are passed (e.g. :c:func:" "`waddwstr`), and bytes functions otherwise (e.g. :c:func:`waddstr`)." msgstr "" -#: ../../whatsnew/3.3.rst:1065 +#: ../../whatsnew/3.3.rst:1066 msgid "Use the locale encoding instead of ``utf-8`` to encode Unicode strings." msgstr "" -#: ../../whatsnew/3.3.rst:1066 +#: ../../whatsnew/3.3.rst:1067 msgid "" ":class:`curses.window` has a new :attr:`curses.window.encoding` attribute." msgstr "" -#: ../../whatsnew/3.3.rst:1067 +#: ../../whatsnew/3.3.rst:1068 msgid "" "The :class:`curses.window` class has a new :meth:`~curses.window.get_wch` " "method to get a wide character" msgstr "" -#: ../../whatsnew/3.3.rst:1069 +#: ../../whatsnew/3.3.rst:1070 msgid "" "The :mod:`curses` module has a new :meth:`~curses.unget_wch` function to " "push a wide character so the next :meth:`~curses.window.get_wch` will return " "it" msgstr "" -#: ../../whatsnew/3.3.rst:1073 +#: ../../whatsnew/3.3.rst:1074 msgid "(Contributed by Iñigo Serna in :issue:`6755`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1076 +#: ../../whatsnew/3.3.rst:1077 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.3.rst:1078 +#: ../../whatsnew/3.3.rst:1079 msgid "" "Equality comparisons between naive and aware :class:`~datetime.datetime` " "instances now return :const:`False` instead of raising :exc:`TypeError` (:" "issue:`15006`)." msgstr "" -#: ../../whatsnew/3.3.rst:1081 +#: ../../whatsnew/3.3.rst:1082 msgid "" "New :meth:`datetime.datetime.timestamp` method: Return POSIX timestamp " "corresponding to the :class:`~datetime.datetime` instance." msgstr "" -#: ../../whatsnew/3.3.rst:1083 +#: ../../whatsnew/3.3.rst:1084 msgid "" "The :meth:`datetime.datetime.strftime` method supports formatting years " "older than 1000." msgstr "" -#: ../../whatsnew/3.3.rst:1085 +#: ../../whatsnew/3.3.rst:1086 msgid "" "The :meth:`datetime.datetime.astimezone` method can now be called without " "arguments to convert datetime instance to the system timezone." msgstr "" -#: ../../whatsnew/3.3.rst:1093 +#: ../../whatsnew/3.3.rst:1094 msgid "decimal" msgstr "decimal" -#: ../../whatsnew/3.3.rst:1096 +#: ../../whatsnew/3.3.rst:1097 msgid ":issue:`7652` - integrate fast native decimal arithmetic." msgstr "" -#: ../../whatsnew/3.3.rst:1096 +#: ../../whatsnew/3.3.rst:1097 msgid "C-module and libmpdec written by Stefan Krah." msgstr "" -#: ../../whatsnew/3.3.rst:1098 +#: ../../whatsnew/3.3.rst:1099 msgid "" "The new C version of the decimal module integrates the high speed libmpdec " "library for arbitrary precision correctly rounded decimal floating point " @@ -1515,7 +1515,7 @@ msgid "" "Specification." msgstr "" -#: ../../whatsnew/3.3.rst:1102 +#: ../../whatsnew/3.3.rst:1103 msgid "" "Performance gains range from 10x for database applications to 100x for " "numerically intensive applications. These numbers are expected gains for " @@ -1524,128 +1524,128 @@ msgid "" "integer bignum arithmetic the differences can be significantly higher." msgstr "" -#: ../../whatsnew/3.3.rst:1108 +#: ../../whatsnew/3.3.rst:1109 msgid "" "The following table is meant as an illustration. Benchmarks are available at " "https://www.bytereef.org/mpdecimal/quickstart.html." msgstr "" -#: ../../whatsnew/3.3.rst:1112 +#: ../../whatsnew/3.3.rst:1113 msgid "decimal.py" msgstr "decimal.py" -#: ../../whatsnew/3.3.rst:1112 +#: ../../whatsnew/3.3.rst:1113 msgid "_decimal" msgstr "_decimal" -#: ../../whatsnew/3.3.rst:1112 +#: ../../whatsnew/3.3.rst:1113 msgid "speedup" msgstr "speedup" -#: ../../whatsnew/3.3.rst:1114 +#: ../../whatsnew/3.3.rst:1115 msgid "pi" msgstr "pi" -#: ../../whatsnew/3.3.rst:1114 +#: ../../whatsnew/3.3.rst:1115 msgid "42.02s" msgstr "42.02s" -#: ../../whatsnew/3.3.rst:1114 +#: ../../whatsnew/3.3.rst:1115 msgid "0.345s" msgstr "0.345s" -#: ../../whatsnew/3.3.rst:1114 +#: ../../whatsnew/3.3.rst:1115 msgid "120x" msgstr "120x" -#: ../../whatsnew/3.3.rst:1116 +#: ../../whatsnew/3.3.rst:1117 msgid "telco" msgstr "telco" -#: ../../whatsnew/3.3.rst:1116 +#: ../../whatsnew/3.3.rst:1117 msgid "172.19s" msgstr "172.19s" -#: ../../whatsnew/3.3.rst:1116 +#: ../../whatsnew/3.3.rst:1117 msgid "5.68s" msgstr "5.68s" -#: ../../whatsnew/3.3.rst:1116 +#: ../../whatsnew/3.3.rst:1117 msgid "30x" msgstr "30x" -#: ../../whatsnew/3.3.rst:1118 +#: ../../whatsnew/3.3.rst:1119 msgid "psycopg" msgstr "psycopg" -#: ../../whatsnew/3.3.rst:1118 +#: ../../whatsnew/3.3.rst:1119 msgid "3.57s" msgstr "3.57s" -#: ../../whatsnew/3.3.rst:1118 +#: ../../whatsnew/3.3.rst:1119 msgid "0.29s" msgstr "0.29s" -#: ../../whatsnew/3.3.rst:1118 +#: ../../whatsnew/3.3.rst:1119 msgid "12x" msgstr "12x" -#: ../../whatsnew/3.3.rst:1124 +#: ../../whatsnew/3.3.rst:1125 msgid "" "The :exc:`~decimal.FloatOperation` signal optionally enables stricter " "semantics for mixing floats and Decimals." msgstr "" -#: ../../whatsnew/3.3.rst:1127 +#: ../../whatsnew/3.3.rst:1128 msgid "" "If Python is compiled without threads, the C version automatically disables " "the expensive thread local context machinery. In this case, the variable :" "data:`~decimal.HAVE_THREADS` is set to ``False``." msgstr "" -#: ../../whatsnew/3.3.rst:1134 +#: ../../whatsnew/3.3.rst:1135 msgid "" "The C module has the following context limits, depending on the machine " "architecture:" msgstr "" -#: ../../whatsnew/3.3.rst:1138 +#: ../../whatsnew/3.3.rst:1139 msgid "32-bit" msgstr "" -#: ../../whatsnew/3.3.rst:1138 +#: ../../whatsnew/3.3.rst:1139 msgid "64-bit" msgstr "" -#: ../../whatsnew/3.3.rst:1140 +#: ../../whatsnew/3.3.rst:1141 msgid ":const:`MAX_PREC`" msgstr ":const:`MAX_PREC`" -#: ../../whatsnew/3.3.rst:1140 ../../whatsnew/3.3.rst:1142 +#: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 msgid ":const:`425000000`" msgstr ":const:`425000000`" -#: ../../whatsnew/3.3.rst:1140 ../../whatsnew/3.3.rst:1142 +#: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 msgid ":const:`999999999999999999`" msgstr ":const:`999999999999999999`" -#: ../../whatsnew/3.3.rst:1142 +#: ../../whatsnew/3.3.rst:1143 msgid ":const:`MAX_EMAX`" msgstr ":const:`MAX_EMAX`" -#: ../../whatsnew/3.3.rst:1144 +#: ../../whatsnew/3.3.rst:1145 msgid ":const:`MIN_EMIN`" msgstr ":const:`MIN_EMIN`" -#: ../../whatsnew/3.3.rst:1144 +#: ../../whatsnew/3.3.rst:1145 msgid ":const:`-425000000`" msgstr ":const:`-425000000`" -#: ../../whatsnew/3.3.rst:1144 +#: ../../whatsnew/3.3.rst:1145 msgid ":const:`-999999999999999999`" msgstr ":const:`-999999999999999999`" -#: ../../whatsnew/3.3.rst:1147 +#: ../../whatsnew/3.3.rst:1148 msgid "" "In the context templates (:class:`~decimal.DefaultContext`, :class:`~decimal." "BasicContext` and :class:`~decimal.ExtendedContext`) the magnitude of :attr:" @@ -1653,7 +1653,7 @@ msgid "" "const:`999999`." msgstr "" -#: ../../whatsnew/3.3.rst:1152 +#: ../../whatsnew/3.3.rst:1153 msgid "" "The :class:`~decimal.Decimal` constructor in decimal.py does not observe the " "context limits and converts values with arbitrary exponents or precision " @@ -1664,7 +1664,7 @@ msgid "" "obtain a rounded or inexact value." msgstr "" -#: ../../whatsnew/3.3.rst:1161 +#: ../../whatsnew/3.3.rst:1162 msgid "" "The power function in decimal.py is always correctly rounded. In the C " "version, it is defined in terms of the correctly rounded :meth:`~decimal." @@ -1672,7 +1672,7 @@ msgid "" "is only \"almost always correctly rounded\"." msgstr "" -#: ../../whatsnew/3.3.rst:1167 +#: ../../whatsnew/3.3.rst:1168 msgid "" "In the C version, the context dictionary containing the signals is a :class:" "`~collections.abc.MutableMapping`. For speed reasons, :attr:`~decimal." @@ -1683,33 +1683,33 @@ msgid "" "do not reference the RHS dictionary." msgstr "" -#: ../../whatsnew/3.3.rst:1177 +#: ../../whatsnew/3.3.rst:1178 msgid "" "Pickling a :class:`~decimal.Context` produces a different output in order to " "have a common interchange format for the Python and C versions." msgstr "" -#: ../../whatsnew/3.3.rst:1181 +#: ../../whatsnew/3.3.rst:1182 msgid "" "The order of arguments in the :class:`~decimal.Context` constructor has been " "changed to match the order displayed by :func:`repr`." msgstr "" -#: ../../whatsnew/3.3.rst:1185 +#: ../../whatsnew/3.3.rst:1186 msgid "" "The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method " "is deprecated." msgstr "" -#: ../../whatsnew/3.3.rst:1192 +#: ../../whatsnew/3.3.rst:1193 msgid "email" msgstr "email" -#: ../../whatsnew/3.3.rst:1195 +#: ../../whatsnew/3.3.rst:1196 msgid "Policy Framework" msgstr "" -#: ../../whatsnew/3.3.rst:1197 +#: ../../whatsnew/3.3.rst:1198 msgid "" "The email package now has a :mod:`~email.policy` framework. A :class:" "`~email.policy.Policy` is an object with several methods and properties that " @@ -1725,52 +1725,52 @@ msgid "" "data:`~email.policy.compat32`." msgstr "" -#: ../../whatsnew/3.3.rst:1210 +#: ../../whatsnew/3.3.rst:1211 msgid "The minimum set of controls implemented by all ``policy`` objects are:" msgstr "" -#: ../../whatsnew/3.3.rst:1215 +#: ../../whatsnew/3.3.rst:1216 msgid "max_line_length" msgstr "max_line_length" -#: ../../whatsnew/3.3.rst:1215 +#: ../../whatsnew/3.3.rst:1216 msgid "" "The maximum length, excluding the linesep character(s), individual lines may " "have when a ``Message`` is serialized. Defaults to 78." msgstr "" -#: ../../whatsnew/3.3.rst:1219 +#: ../../whatsnew/3.3.rst:1220 msgid "linesep" msgstr "linesep" -#: ../../whatsnew/3.3.rst:1219 +#: ../../whatsnew/3.3.rst:1220 msgid "" "The character used to separate individual lines when a ``Message`` is " "serialized. Defaults to ``\\n``." msgstr "" -#: ../../whatsnew/3.3.rst:1222 +#: ../../whatsnew/3.3.rst:1223 msgid "cte_type" msgstr "cte_type" -#: ../../whatsnew/3.3.rst:1222 +#: ../../whatsnew/3.3.rst:1223 msgid "" "``7bit`` or ``8bit``. ``8bit`` applies only to a ``Bytes`` ``generator``, " "and means that non-ASCII may be used where allowed by the protocol (or where " "it exists in the original input)." msgstr "" -#: ../../whatsnew/3.3.rst:1227 +#: ../../whatsnew/3.3.rst:1228 msgid "raise_on_defect" msgstr "raise_on_defect" -#: ../../whatsnew/3.3.rst:1227 +#: ../../whatsnew/3.3.rst:1228 msgid "" "Causes a ``parser`` to raise error when defects are encountered instead of " "adding them to the ``Message`` object's ``defects`` list." msgstr "" -#: ../../whatsnew/3.3.rst:1232 +#: ../../whatsnew/3.3.rst:1233 msgid "" "A new policy instance, with new settings, is created using the :meth:`~email." "policy.Policy.clone` method of policy objects. ``clone`` takes any of the " @@ -1779,7 +1779,7 @@ msgid "" "``\\r\\n`` linesep characters like this::" msgstr "" -#: ../../whatsnew/3.3.rst:1240 +#: ../../whatsnew/3.3.rst:1241 msgid "" "Policies can be used to make the generation of messages in the format needed " "by your application simpler. Instead of having to remember to specify " @@ -1792,11 +1792,11 @@ msgid "" "when you create the ``generator``." msgstr "" -#: ../../whatsnew/3.3.rst:1252 +#: ../../whatsnew/3.3.rst:1253 msgid "Provisional Policy with New Header API" msgstr "" -#: ../../whatsnew/3.3.rst:1254 +#: ../../whatsnew/3.3.rst:1255 msgid "" "While the policy framework is worthwhile all by itself, the main motivation " "for introducing it is to allow the creation of new policies that implement " @@ -1808,17 +1808,17 @@ msgid "" "the core developers." msgstr "" -#: ../../whatsnew/3.3.rst:1262 +#: ../../whatsnew/3.3.rst:1263 msgid "" "The new policies are instances of :class:`~email.policy.EmailPolicy`, and " "add the following additional controls:" msgstr "" -#: ../../whatsnew/3.3.rst:1268 +#: ../../whatsnew/3.3.rst:1269 msgid "refold_source" msgstr "refold_source" -#: ../../whatsnew/3.3.rst:1268 +#: ../../whatsnew/3.3.rst:1269 msgid "" "Controls whether or not headers parsed by a :mod:`~email.parser` are " "refolded by the :mod:`~email.generator`. It can be ``none``, ``long``, or " @@ -1827,17 +1827,17 @@ msgid "" "get refolded, and ``all`` means that all lines get refolded." msgstr "" -#: ../../whatsnew/3.3.rst:1277 +#: ../../whatsnew/3.3.rst:1278 msgid "header_factory" msgstr "header_factory" -#: ../../whatsnew/3.3.rst:1277 +#: ../../whatsnew/3.3.rst:1278 msgid "" "A callable that take a ``name`` and ``value`` and produces a custom header " "object." msgstr "" -#: ../../whatsnew/3.3.rst:1281 +#: ../../whatsnew/3.3.rst:1282 msgid "" "The ``header_factory`` is the key to the new features provided by the new " "policies. When one of the new policies is used, any header retrieved from a " @@ -1849,7 +1849,7 @@ msgid "" "now do things like this::" msgstr "" -#: ../../whatsnew/3.3.rst:1309 +#: ../../whatsnew/3.3.rst:1310 msgid "" "You will note that the unicode display name is automatically encoded as " "``utf-8`` when the message is serialized, but that when the header is " @@ -1858,22 +1858,22 @@ msgid "" "meth:`~email.header.make_header` functions." msgstr "" -#: ../../whatsnew/3.3.rst:1315 +#: ../../whatsnew/3.3.rst:1316 msgid "You can also create addresses from parts::" msgstr "" -#: ../../whatsnew/3.3.rst:1325 +#: ../../whatsnew/3.3.rst:1326 msgid "Decoding to unicode is done automatically::" msgstr "" -#: ../../whatsnew/3.3.rst:1331 +#: ../../whatsnew/3.3.rst:1332 msgid "" "When you parse a message, you can use the ``addresses`` and ``groups`` " "attributes of the header objects to access the groups and individual " "addresses::" msgstr "" -#: ../../whatsnew/3.3.rst:1340 +#: ../../whatsnew/3.3.rst:1341 msgid "" "In summary, if you use one of the new policies, header manipulation works " "the way it ought to: your application works with unicode strings, and the " @@ -1881,35 +1881,35 @@ msgid "" "RFC standard Content Transfer Encodings." msgstr "" -#: ../../whatsnew/3.3.rst:1346 +#: ../../whatsnew/3.3.rst:1347 msgid "Other API Changes" msgstr "" -#: ../../whatsnew/3.3.rst:1348 +#: ../../whatsnew/3.3.rst:1349 msgid "" "New :class:`~email.parser.BytesHeaderParser`, added to the :mod:`~email." "parser` module to complement :class:`~email.parser.HeaderParser` and " "complete the Bytes API." msgstr "" -#: ../../whatsnew/3.3.rst:1352 +#: ../../whatsnew/3.3.rst:1353 msgid "New utility functions:" msgstr "" -#: ../../whatsnew/3.3.rst:1354 +#: ../../whatsnew/3.3.rst:1355 msgid "" ":func:`~email.utils.format_datetime`: given a :class:`~datetime.datetime`, " "produce a string formatted for use in an email header." msgstr "" -#: ../../whatsnew/3.3.rst:1357 +#: ../../whatsnew/3.3.rst:1358 msgid "" ":func:`~email.utils.parsedate_to_datetime`: given a date string from an " "email header, convert it into an aware :class:`~datetime.datetime`, or a " "naive :class:`~datetime.datetime` if the offset is ``-0000``." msgstr "" -#: ../../whatsnew/3.3.rst:1361 +#: ../../whatsnew/3.3.rst:1362 msgid "" ":func:`~email.utils.localtime`: With no argument, returns the current local " "time as an aware :class:`~datetime.datetime` using the local :class:" @@ -1918,11 +1918,11 @@ msgid "" "`~datetime.timezone`." msgstr "" -#: ../../whatsnew/3.3.rst:1369 +#: ../../whatsnew/3.3.rst:1370 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.3.rst:1371 +#: ../../whatsnew/3.3.rst:1372 msgid "" ":class:`ftplib.FTP` now accepts a ``source_address`` keyword argument to " "specify the ``(host, port)`` to use as the source address in the bind call " @@ -1930,7 +1930,7 @@ msgid "" "issue:`8594`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1376 +#: ../../whatsnew/3.3.rst:1377 msgid "" "The :class:`~ftplib.FTP_TLS` class now provides a new :func:`~ftplib.FTP_TLS." "ccc` function to revert control channel back to plaintext. This can be " @@ -1939,18 +1939,18 @@ msgid "" "in :issue:`12139`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1382 +#: ../../whatsnew/3.3.rst:1383 msgid "" "Added :meth:`ftplib.FTP.mlsd` method which provides a parsable directory " "listing format and deprecates :meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP." "dir`. (Contributed by Giampaolo Rodolà in :issue:`11072`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1388 +#: ../../whatsnew/3.3.rst:1389 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.3.rst:1390 +#: ../../whatsnew/3.3.rst:1391 msgid "" "The :func:`functools.lru_cache` decorator now accepts a ``typed`` keyword " "argument (that defaults to ``False`` to ensure that it caches values of " @@ -1958,32 +1958,32 @@ msgid "" "Raymond Hettinger in :issue:`13227`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1397 +#: ../../whatsnew/3.3.rst:1398 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.3.rst:1399 +#: ../../whatsnew/3.3.rst:1400 msgid "" "It is now possible to register callbacks invoked by the garbage collector " "before and after collection using the new :data:`~gc.callbacks` list." msgstr "" -#: ../../whatsnew/3.3.rst:1404 +#: ../../whatsnew/3.3.rst:1405 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.3.rst:1406 +#: ../../whatsnew/3.3.rst:1407 msgid "" "A new :func:`~hmac.compare_digest` function has been added to prevent side " "channel attacks on digests through timing analysis. (Contributed by Nick " "Coghlan and Christian Heimes in :issue:`15061`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1412 +#: ../../whatsnew/3.3.rst:1413 msgid "http" msgstr "http" -#: ../../whatsnew/3.3.rst:1414 +#: ../../whatsnew/3.3.rst:1415 msgid "" ":class:`http.server.BaseHTTPRequestHandler` now buffers the headers and " "writes them all at once when :meth:`~http.server.BaseHTTPRequestHandler." @@ -1993,24 +1993,24 @@ msgid "" "`3709`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1420 +#: ../../whatsnew/3.3.rst:1421 msgid "" ":class:`http.server` now produces valid ``HTML 4.01 strict`` output. " "(Contributed by Ezio Melotti in :issue:`13295`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1423 +#: ../../whatsnew/3.3.rst:1424 msgid "" ":class:`http.client.HTTPResponse` now has a :meth:`~http.client.HTTPResponse." "readinto` method, which means it can be used as an :class:`io.RawIOBase` " "class. (Contributed by John Kuhn in :issue:`13464`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1430 +#: ../../whatsnew/3.3.rst:1431 msgid "html" msgstr "html" -#: ../../whatsnew/3.3.rst:1432 +#: ../../whatsnew/3.3.rst:1433 msgid "" ":class:`html.parser.HTMLParser` is now able to parse broken markup without " "raising errors, therefore the *strict* argument of the constructor and the :" @@ -2023,7 +2023,7 @@ msgid "" "`12888`, :issue:`7311`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1442 +#: ../../whatsnew/3.3.rst:1443 msgid "" "A new :data:`~html.entities.html5` dictionary that maps HTML5 named " "character references to the equivalent Unicode character(s) (e.g. " @@ -2032,25 +2032,25 @@ msgid "" "(Contributed by Ezio Melotti in :issue:`11113` and :issue:`15156`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1450 +#: ../../whatsnew/3.3.rst:1451 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.3.rst:1452 +#: ../../whatsnew/3.3.rst:1453 msgid "" "The :class:`~imaplib.IMAP4_SSL` constructor now accepts an SSLContext " "parameter to control parameters of the secure channel." msgstr "" -#: ../../whatsnew/3.3.rst:1455 +#: ../../whatsnew/3.3.rst:1456 msgid "(Contributed by Sijin Joseph in :issue:`8808`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1459 +#: ../../whatsnew/3.3.rst:1460 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.3.rst:1461 +#: ../../whatsnew/3.3.rst:1462 msgid "" "A new :func:`~inspect.getclosurevars` function has been added. This function " "reports the current binding of all names referenced from the function body " @@ -2058,11 +2058,11 @@ msgid "" "internal state when testing code that relies on stateful closures." msgstr "" -#: ../../whatsnew/3.3.rst:1466 +#: ../../whatsnew/3.3.rst:1467 msgid "(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1468 +#: ../../whatsnew/3.3.rst:1469 msgid "" "A new :func:`~inspect.getgeneratorlocals` function has been added. This " "function reports the current binding of local variables in the generator's " @@ -2070,26 +2070,26 @@ msgid "" "generators." msgstr "" -#: ../../whatsnew/3.3.rst:1473 +#: ../../whatsnew/3.3.rst:1474 msgid "(Contributed by Meador Inge in :issue:`15153`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1476 +#: ../../whatsnew/3.3.rst:1477 msgid "io" msgstr "io" -#: ../../whatsnew/3.3.rst:1478 +#: ../../whatsnew/3.3.rst:1479 msgid "" "The :func:`~io.open` function has a new ``'x'`` mode that can be used to " "exclusively create a new file, and raise a :exc:`FileExistsError` if the " "file already exists. It is based on the C11 'x' mode to fopen()." msgstr "" -#: ../../whatsnew/3.3.rst:1482 +#: ../../whatsnew/3.3.rst:1483 msgid "(Contributed by David Townshend in :issue:`12760`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1484 +#: ../../whatsnew/3.3.rst:1485 msgid "" "The constructor of the :class:`~io.TextIOWrapper` class has a new " "*write_through* optional argument. If *write_through* is ``True``, calls to :" @@ -2098,28 +2098,28 @@ msgid "" "its underlying binary buffer." msgstr "" -#: ../../whatsnew/3.3.rst:1492 +#: ../../whatsnew/3.3.rst:1493 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.3.rst:1494 +#: ../../whatsnew/3.3.rst:1495 msgid "" ":func:`~itertools.accumulate` now takes an optional ``func`` argument for " "providing a user-supplied binary function." msgstr "" -#: ../../whatsnew/3.3.rst:1499 +#: ../../whatsnew/3.3.rst:1500 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.3.rst:1501 +#: ../../whatsnew/3.3.rst:1502 msgid "" "The :func:`~logging.basicConfig` function now supports an optional " "``handlers`` argument taking an iterable of handlers to be added to the root " "logger." msgstr "" -#: ../../whatsnew/3.3.rst:1504 +#: ../../whatsnew/3.3.rst:1505 msgid "" "A class level attribute :attr:`~logging.handlers.SysLogHandler.append_nul` " "has been added to :class:`~logging.handlers.SysLogHandler` to allow control " @@ -2128,25 +2128,25 @@ msgid "" "log." msgstr "" -#: ../../whatsnew/3.3.rst:1512 +#: ../../whatsnew/3.3.rst:1513 msgid "math" msgstr "math" -#: ../../whatsnew/3.3.rst:1514 +#: ../../whatsnew/3.3.rst:1515 msgid "" "The :mod:`math` module has a new function, :func:`~math.log2`, which " "returns the base-2 logarithm of *x*." msgstr "" -#: ../../whatsnew/3.3.rst:1517 +#: ../../whatsnew/3.3.rst:1518 msgid "(Written by Mark Dickinson in :issue:`11888`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1521 +#: ../../whatsnew/3.3.rst:1522 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.3.rst:1523 +#: ../../whatsnew/3.3.rst:1524 msgid "" "The :meth:`~mmap.mmap.read` method is now more compatible with other file-" "like objects: if the argument is omitted or specified as ``None``, it " @@ -2154,39 +2154,39 @@ msgid "" "(Contributed by Petri Lehtinen in :issue:`12021`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1530 +#: ../../whatsnew/3.3.rst:1531 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.3.rst:1532 +#: ../../whatsnew/3.3.rst:1533 msgid "" "The new :func:`multiprocessing.connection.wait` function allows polling " "multiple objects (such as connections, sockets and pipes) with a timeout. " "(Contributed by Richard Oudkerk in :issue:`12328`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1536 +#: ../../whatsnew/3.3.rst:1537 msgid "" ":class:`multiprocessing.Connection` objects can now be transferred over " "multiprocessing connections. (Contributed by Richard Oudkerk in :issue:" "`4892`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1540 +#: ../../whatsnew/3.3.rst:1541 msgid "" ":class:`multiprocessing.Process` now accepts a ``daemon`` keyword argument " "to override the default behavior of inheriting the ``daemon`` flag from the " "parent process (:issue:`6064`)." msgstr "" -#: ../../whatsnew/3.3.rst:1544 +#: ../../whatsnew/3.3.rst:1545 msgid "" "New attribute :data:`multiprocessing.Process.sentinel` allows a program to " "wait on multiple :class:`~multiprocessing.Process` objects at one time using " "the appropriate OS primitives (for example, :mod:`select` on posix systems)." msgstr "" -#: ../../whatsnew/3.3.rst:1549 +#: ../../whatsnew/3.3.rst:1550 msgid "" "New methods :meth:`multiprocessing.pool.Pool.starmap` and :meth:" "`~multiprocessing.pool.Pool.starmap_async` provide :func:`itertools.starmap` " @@ -2195,26 +2195,26 @@ msgid "" "Schlawack in :issue:`12708`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1558 +#: ../../whatsnew/3.3.rst:1559 msgid "nntplib" msgstr "nntplib" -#: ../../whatsnew/3.3.rst:1560 +#: ../../whatsnew/3.3.rst:1561 msgid "" "The :class:`nntplib.NNTP` class now supports the context management protocol " "to unconditionally consume :exc:`socket.error` exceptions and to close the " "NNTP connection when done::" msgstr "" -#: ../../whatsnew/3.3.rst:1571 +#: ../../whatsnew/3.3.rst:1572 msgid "(Contributed by Giampaolo Rodolà in :issue:`9795`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1575 +#: ../../whatsnew/3.3.rst:1576 msgid "os" msgstr "os" -#: ../../whatsnew/3.3.rst:1577 +#: ../../whatsnew/3.3.rst:1578 msgid "" "The :mod:`os` module has a new :func:`~os.pipe2` function that makes it " "possible to create a pipe with :data:`~os.O_CLOEXEC` or :data:`~os." @@ -2222,7 +2222,7 @@ msgid "" "conditions in multi-threaded programs." msgstr "" -#: ../../whatsnew/3.3.rst:1582 +#: ../../whatsnew/3.3.rst:1583 msgid "" "The :mod:`os` module has a new :func:`~os.sendfile` function which provides " "an efficient \"zero-copy\" way for copying data from one file (or socket) " @@ -2233,12 +2233,12 @@ msgid "" "socket, e.g. for downloading a file." msgstr "" -#: ../../whatsnew/3.3.rst:1590 +#: ../../whatsnew/3.3.rst:1591 msgid "" "(Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1592 +#: ../../whatsnew/3.3.rst:1593 msgid "" "To avoid race conditions like symlink attacks and issues with temporary " "files and directories, it is more reliable (and also faster) to manipulate " @@ -2247,14 +2247,14 @@ msgid "" "`4761`, :issue:`10755` and :issue:`14626`)." msgstr "" -#: ../../whatsnew/3.3.rst:1598 +#: ../../whatsnew/3.3.rst:1599 msgid "" "The :mod:`os` module has a new :func:`~os.fwalk` function similar to :func:" "`~os.walk` except that it also yields file descriptors referring to the " "directories visited. This is especially useful to avoid symlink races." msgstr "" -#: ../../whatsnew/3.3.rst:1602 +#: ../../whatsnew/3.3.rst:1603 msgid "" "The following functions get new optional *dir_fd* (:ref:`paths relative to " "directory descriptors `) and/or *follow_symlinks* (:ref:`not " @@ -2268,7 +2268,7 @@ msgid "" "`os.supports_follows_symlinks`." msgstr "" -#: ../../whatsnew/3.3.rst:1613 +#: ../../whatsnew/3.3.rst:1614 msgid "" "The following functions now support a file descriptor for their path " "argument: :func:`~os.chdir`, :func:`~os.chmod`, :func:`~os.chown`, :func:" @@ -2277,7 +2277,7 @@ msgid "" "support for this can be checked via the :data:`os.supports_fd` set." msgstr "" -#: ../../whatsnew/3.3.rst:1619 +#: ../../whatsnew/3.3.rst:1620 msgid "" ":func:`~os.access` accepts an ``effective_ids`` keyword argument to turn on " "using the effective uid/gid rather than the real uid/gid in the access " @@ -2285,7 +2285,7 @@ msgid "" "supports_effective_ids` set." msgstr "" -#: ../../whatsnew/3.3.rst:1624 +#: ../../whatsnew/3.3.rst:1625 msgid "" "The :mod:`os` module has two new functions: :func:`~os.getpriority` and :" "func:`~os.setpriority`. They can be used to get or set process niceness/" @@ -2293,11 +2293,11 @@ msgid "" "processes instead of just the current one." msgstr "" -#: ../../whatsnew/3.3.rst:1629 +#: ../../whatsnew/3.3.rst:1630 msgid "(Patch submitted by Giampaolo Rodolà in :issue:`10784`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1631 +#: ../../whatsnew/3.3.rst:1632 msgid "" "The new :func:`os.replace` function allows cross-platform renaming of a file " "with overwriting the destination. With :func:`os.rename`, an existing " @@ -2305,7 +2305,7 @@ msgid "" "Windows. (Contributed by Antoine Pitrou in :issue:`8828`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1637 +#: ../../whatsnew/3.3.rst:1638 msgid "" "The stat family of functions (:func:`~os.stat`, :func:`~os.fstat`, and :func:" "`~os.lstat`) now support reading a file's timestamps with nanosecond " @@ -2314,7 +2314,7 @@ msgid "" "`14127`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1643 +#: ../../whatsnew/3.3.rst:1644 msgid "" "The new :func:`os.get_terminal_size` function queries the size of the " "terminal attached to a file descriptor. See also :func:`shutil." @@ -2322,14 +2322,14 @@ msgid "" "`13609`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1650 +#: ../../whatsnew/3.3.rst:1651 msgid "" "New functions to support Linux extended attributes (:issue:`12720`): :func:" "`~os.getxattr`, :func:`~os.listxattr`, :func:`~os.removexattr`, :func:`~os." "setxattr`." msgstr "" -#: ../../whatsnew/3.3.rst:1654 +#: ../../whatsnew/3.3.rst:1655 msgid "" "New interface to the scheduler. These functions control how a process is " "allocated CPU time by the operating system. New functions: :func:`~os." @@ -2340,90 +2340,90 @@ msgid "" "sched_setscheduler`, :func:`~os.sched_yield`," msgstr "" -#: ../../whatsnew/3.3.rst:1663 +#: ../../whatsnew/3.3.rst:1664 msgid "New functions to control the file system:" msgstr "" -#: ../../whatsnew/3.3.rst:1665 +#: ../../whatsnew/3.3.rst:1666 msgid "" ":func:`~os.posix_fadvise`: Announces an intention to access data in a " "specific pattern thus allowing the kernel to make optimizations." msgstr "" -#: ../../whatsnew/3.3.rst:1667 +#: ../../whatsnew/3.3.rst:1668 msgid "" ":func:`~os.posix_fallocate`: Ensures that enough disk space is allocated for " "a file." msgstr "" -#: ../../whatsnew/3.3.rst:1669 +#: ../../whatsnew/3.3.rst:1670 msgid ":func:`~os.sync`: Force write of everything to disk." msgstr "" -#: ../../whatsnew/3.3.rst:1671 +#: ../../whatsnew/3.3.rst:1672 msgid "Additional new posix functions:" msgstr "" -#: ../../whatsnew/3.3.rst:1673 +#: ../../whatsnew/3.3.rst:1674 msgid "" ":func:`~os.lockf`: Apply, test or remove a POSIX lock on an open file " "descriptor." msgstr "" -#: ../../whatsnew/3.3.rst:1674 +#: ../../whatsnew/3.3.rst:1675 msgid "" ":func:`~os.pread`: Read from a file descriptor at an offset, the file offset " "remains unchanged." msgstr "" -#: ../../whatsnew/3.3.rst:1676 +#: ../../whatsnew/3.3.rst:1677 msgid "" ":func:`~os.pwrite`: Write to a file descriptor from an offset, leaving the " "file offset unchanged." msgstr "" -#: ../../whatsnew/3.3.rst:1678 +#: ../../whatsnew/3.3.rst:1679 msgid "" ":func:`~os.readv`: Read from a file descriptor into a number of writable " "buffers." msgstr "" -#: ../../whatsnew/3.3.rst:1679 +#: ../../whatsnew/3.3.rst:1680 msgid "" ":func:`~os.truncate`: Truncate the file corresponding to *path*, so that it " "is at most *length* bytes in size." msgstr "" -#: ../../whatsnew/3.3.rst:1681 +#: ../../whatsnew/3.3.rst:1682 msgid "" ":func:`~os.waitid`: Wait for the completion of one or more child processes." msgstr "" -#: ../../whatsnew/3.3.rst:1682 +#: ../../whatsnew/3.3.rst:1683 msgid "" ":func:`~os.writev`: Write the contents of *buffers* to a file descriptor, " "where *buffers* is an arbitrary sequence of buffers." msgstr "" -#: ../../whatsnew/3.3.rst:1684 +#: ../../whatsnew/3.3.rst:1685 msgid "" ":func:`~os.getgrouplist` (:issue:`9344`): Return list of group ids that " "specified user belongs to." msgstr "" -#: ../../whatsnew/3.3.rst:1687 +#: ../../whatsnew/3.3.rst:1688 msgid "" ":func:`~os.times` and :func:`~os.uname`: Return type changed from a tuple to " "a tuple-like object with named attributes." msgstr "" -#: ../../whatsnew/3.3.rst:1690 +#: ../../whatsnew/3.3.rst:1691 msgid "" "Some platforms now support additional constants for the :func:`~os.lseek` " "function, such as ``os.SEEK_HOLE`` and ``os.SEEK_DATA``." msgstr "" -#: ../../whatsnew/3.3.rst:1693 +#: ../../whatsnew/3.3.rst:1694 msgid "" "New constants :data:`~os.RTLD_LAZY`, :data:`~os.RTLD_NOW`, :data:`~os." "RTLD_GLOBAL`, :data:`~os.RTLD_LOCAL`, :data:`~os.RTLD_NODELETE`, :data:`~os." @@ -2433,70 +2433,70 @@ msgid "" "mod:`DLFCN`. (Contributed by Victor Stinner in :issue:`13226`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1701 +#: ../../whatsnew/3.3.rst:1702 msgid "" ":func:`os.symlink` now accepts (and ignores) the ``target_is_directory`` " "keyword argument on non-Windows platforms, to ease cross-platform support." msgstr "" -#: ../../whatsnew/3.3.rst:1706 +#: ../../whatsnew/3.3.rst:1707 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.3.rst:1708 +#: ../../whatsnew/3.3.rst:1709 msgid "" "Tab-completion is now available not only for command names, but also their " "arguments. For example, for the ``break`` command, function and file names " "are completed." msgstr "" -#: ../../whatsnew/3.3.rst:1712 +#: ../../whatsnew/3.3.rst:1713 msgid "(Contributed by Georg Brandl in :issue:`14210`)" msgstr "" -#: ../../whatsnew/3.3.rst:1716 +#: ../../whatsnew/3.3.rst:1717 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.3.rst:1718 +#: ../../whatsnew/3.3.rst:1719 msgid "" ":class:`pickle.Pickler` objects now have an optional :attr:`~pickle.Pickler." "dispatch_table` attribute allowing per-pickler reduction functions to be set." msgstr "" -#: ../../whatsnew/3.3.rst:1722 +#: ../../whatsnew/3.3.rst:1723 msgid "(Contributed by Richard Oudkerk in :issue:`14166`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1726 +#: ../../whatsnew/3.3.rst:1727 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.3.rst:1728 +#: ../../whatsnew/3.3.rst:1729 msgid "" "The Tk GUI and the :func:`~pydoc.serve` function have been removed from the :" "mod:`pydoc` module: ``pydoc -g`` and :func:`~pydoc.serve` have been " "deprecated in Python 3.2." msgstr "" -#: ../../whatsnew/3.3.rst:1734 +#: ../../whatsnew/3.3.rst:1735 msgid "re" msgstr "re" -#: ../../whatsnew/3.3.rst:1736 +#: ../../whatsnew/3.3.rst:1737 msgid "" ":class:`str` regular expressions now support ``\\u`` and ``\\U`` escapes." msgstr "" -#: ../../whatsnew/3.3.rst:1738 +#: ../../whatsnew/3.3.rst:1739 msgid "(Contributed by Serhiy Storchaka in :issue:`3665`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1742 +#: ../../whatsnew/3.3.rst:1743 msgid "sched" msgstr "sched" -#: ../../whatsnew/3.3.rst:1744 +#: ../../whatsnew/3.3.rst:1745 msgid "" ":meth:`~sched.scheduler.run` now accepts a *blocking* parameter which when " "set to false makes the method execute the scheduled events due to expire " @@ -2505,49 +2505,49 @@ msgid "" "(Contributed by Giampaolo Rodolà in :issue:`13449`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1750 +#: ../../whatsnew/3.3.rst:1751 msgid "" ":class:`~sched.scheduler` class can now be safely used in multi-threaded " "environments. (Contributed by Josiah Carlson and Giampaolo Rodolà in :issue:" "`8684`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1754 +#: ../../whatsnew/3.3.rst:1755 msgid "" "*timefunc* and *delayfunct* parameters of :class:`~sched.scheduler` class " "constructor are now optional and defaults to :func:`time.time` and :func:" "`time.sleep` respectively. (Contributed by Chris Clark in :issue:`13245`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1759 +#: ../../whatsnew/3.3.rst:1760 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` " "*argument* parameter is now optional. (Contributed by Chris Clark in :issue:" "`13245`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1763 +#: ../../whatsnew/3.3.rst:1764 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` now " "accept a *kwargs* parameter. (Contributed by Chris Clark in :issue:`13245`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1769 +#: ../../whatsnew/3.3.rst:1770 msgid "select" msgstr "select" -#: ../../whatsnew/3.3.rst:1771 +#: ../../whatsnew/3.3.rst:1772 msgid "" "Solaris and derivative platforms have a new class :class:`select.devpoll` " "for high performance asynchronous sockets via :file:`/dev/poll`. " "(Contributed by Jesús Cea Avión in :issue:`6397`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1777 +#: ../../whatsnew/3.3.rst:1778 msgid "shlex" msgstr "shlex" -#: ../../whatsnew/3.3.rst:1779 +#: ../../whatsnew/3.3.rst:1780 msgid "" "The previously undocumented helper function ``quote`` from the :mod:`pipes` " "modules has been moved to the :mod:`shlex` module and documented. :func:" @@ -2555,35 +2555,35 @@ msgid "" "otherwise given special meaning by the shell." msgstr "" -#: ../../whatsnew/3.3.rst:1786 +#: ../../whatsnew/3.3.rst:1787 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.3.rst:1788 +#: ../../whatsnew/3.3.rst:1789 msgid "New functions:" msgstr "" -#: ../../whatsnew/3.3.rst:1790 +#: ../../whatsnew/3.3.rst:1791 msgid "" ":func:`~shutil.disk_usage`: provides total, used and free disk space " "statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1792 +#: ../../whatsnew/3.3.rst:1793 msgid "" ":func:`~shutil.chown`: allows one to change user and/or group of the given " "path also specifying the user/group names and not only their numeric ids. " "(Contributed by Sandro Tosi in :issue:`12191`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1795 +#: ../../whatsnew/3.3.rst:1796 msgid "" ":func:`shutil.get_terminal_size`: returns the size of the terminal window to " "which the interpreter is attached. (Contributed by Zbigniew Jędrzejewski-" "Szmek in :issue:`13609`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1799 +#: ../../whatsnew/3.3.rst:1800 msgid "" ":func:`~shutil.copy2` and :func:`~shutil.copystat` now preserve file " "timestamps with nanosecond precision on platforms that support it. They also " @@ -2591,7 +2591,7 @@ msgid "" "Hastings in :issue:`14127` and :issue:`15238`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1804 +#: ../../whatsnew/3.3.rst:1805 msgid "" "Several functions now take an optional ``symlinks`` argument: when that " "parameter is true, symlinks aren't dereferenced and the operation instead " @@ -2599,7 +2599,7 @@ msgid "" "Hynek Schlawack in :issue:`12715`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1809 +#: ../../whatsnew/3.3.rst:1810 msgid "" "When copying files to a different file system, :func:`~shutil.move` now " "handles symlinks the way the posix ``mv`` command does, recreating the " @@ -2608,7 +2608,7 @@ msgid "" "the ``dst`` argument as its result." msgstr "" -#: ../../whatsnew/3.3.rst:1815 +#: ../../whatsnew/3.3.rst:1816 msgid "" ":func:`~shutil.rmtree` is now resistant to symlink attacks on platforms " "which support the new ``dir_fd`` parameter in :func:`os.open` and :func:`os." @@ -2616,80 +2616,80 @@ msgid "" "`4489`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1822 +#: ../../whatsnew/3.3.rst:1823 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.3.rst:1824 +#: ../../whatsnew/3.3.rst:1825 msgid "The :mod:`signal` module has new functions:" msgstr ":mod:`signal` 模組有了新的函式:" -#: ../../whatsnew/3.3.rst:1826 +#: ../../whatsnew/3.3.rst:1827 msgid "" ":func:`~signal.pthread_sigmask`: fetch and/or change the signal mask of the " "calling thread (Contributed by Jean-Paul Calderone in :issue:`8407`);" msgstr "" -#: ../../whatsnew/3.3.rst:1828 +#: ../../whatsnew/3.3.rst:1829 msgid ":func:`~signal.pthread_kill`: send a signal to a thread;" msgstr "" -#: ../../whatsnew/3.3.rst:1829 +#: ../../whatsnew/3.3.rst:1830 msgid ":func:`~signal.sigpending`: examine pending functions;" msgstr "" -#: ../../whatsnew/3.3.rst:1830 +#: ../../whatsnew/3.3.rst:1831 msgid ":func:`~signal.sigwait`: wait a signal;" msgstr "" -#: ../../whatsnew/3.3.rst:1831 +#: ../../whatsnew/3.3.rst:1832 msgid "" ":func:`~signal.sigwaitinfo`: wait for a signal, returning detailed " "information about it;" msgstr "" -#: ../../whatsnew/3.3.rst:1833 +#: ../../whatsnew/3.3.rst:1834 msgid "" ":func:`~signal.sigtimedwait`: like :func:`~signal.sigwaitinfo` but with a " "timeout." msgstr "" -#: ../../whatsnew/3.3.rst:1836 +#: ../../whatsnew/3.3.rst:1837 msgid "" "The signal handler writes the signal number as a single byte instead of a " "nul byte into the wakeup file descriptor. So it is possible to wait more " "than one signal and know which signals were raised." msgstr "" -#: ../../whatsnew/3.3.rst:1840 +#: ../../whatsnew/3.3.rst:1841 msgid "" ":func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError, " "instead of a RuntimeError: OSError has an errno attribute." msgstr "" -#: ../../whatsnew/3.3.rst:1845 +#: ../../whatsnew/3.3.rst:1846 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.3.rst:1847 +#: ../../whatsnew/3.3.rst:1848 msgid "" "The :mod:`smtpd` module now supports :rfc:`5321` (extended SMTP) and :rfc:" "`1870` (size extension). Per the standard, these extensions are enabled if " "and only if the client initiates the session with an ``EHLO`` command." msgstr "" -#: ../../whatsnew/3.3.rst:1851 +#: ../../whatsnew/3.3.rst:1852 msgid "" "(Initial ``ELHO`` support by Alberto Trevino. Size extension by Juhana " "Jauhiainen. Substantial additional work on the patch contributed by Michele " "Orrù and Dan Boswell. :issue:`8739`)" msgstr "" -#: ../../whatsnew/3.3.rst:1857 +#: ../../whatsnew/3.3.rst:1858 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.3.rst:1859 +#: ../../whatsnew/3.3.rst:1860 msgid "" "The :class:`~smtplib.SMTP`, :class:`~smtplib.SMTP_SSL`, and :class:`~smtplib." "LMTP` classes now accept a ``source_address`` keyword argument to specify " @@ -2698,62 +2698,62 @@ msgid "" "`11281`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1865 +#: ../../whatsnew/3.3.rst:1866 msgid "" ":class:`~smtplib.SMTP` now supports the context management protocol, " "allowing an ``SMTP`` instance to be used in a ``with`` statement. " "(Contributed by Giampaolo Rodolà in :issue:`11289`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1869 +#: ../../whatsnew/3.3.rst:1870 msgid "" "The :class:`~smtplib.SMTP_SSL` constructor and the :meth:`~smtplib.SMTP." "starttls` method now accept an SSLContext parameter to control parameters of " "the secure channel. (Contributed by Kasun Herath in :issue:`8809`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1875 +#: ../../whatsnew/3.3.rst:1876 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.3.rst:1877 +#: ../../whatsnew/3.3.rst:1878 msgid "" "The :class:`~socket.socket` class now exposes additional methods to process " "ancillary data when supported by the underlying platform:" msgstr "" -#: ../../whatsnew/3.3.rst:1880 +#: ../../whatsnew/3.3.rst:1881 msgid ":func:`~socket.socket.sendmsg`" msgstr ":func:`~socket.socket.sendmsg`" -#: ../../whatsnew/3.3.rst:1881 +#: ../../whatsnew/3.3.rst:1882 msgid ":func:`~socket.socket.recvmsg`" msgstr ":func:`~socket.socket.recvmsg`" -#: ../../whatsnew/3.3.rst:1882 +#: ../../whatsnew/3.3.rst:1883 msgid ":func:`~socket.socket.recvmsg_into`" msgstr ":func:`~socket.socket.recvmsg_into`" -#: ../../whatsnew/3.3.rst:1884 +#: ../../whatsnew/3.3.rst:1885 msgid "" "(Contributed by David Watson in :issue:`6560`, based on an earlier patch by " "Heiko Wundram)" msgstr "" -#: ../../whatsnew/3.3.rst:1887 +#: ../../whatsnew/3.3.rst:1888 msgid "" "The :class:`~socket.socket` class now supports the PF_CAN protocol family " "(https://en.wikipedia.org/wiki/Socketcan), on Linux (https://lwn.net/" "Articles/253425)." msgstr "" -#: ../../whatsnew/3.3.rst:1891 +#: ../../whatsnew/3.3.rst:1892 msgid "" "(Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:" "`10141`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1893 +#: ../../whatsnew/3.3.rst:1894 msgid "" "The :class:`~socket.socket` class now supports the PF_RDS protocol family " "(https://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and `https://oss." @@ -2761,24 +2761,24 @@ msgid "" "oss.oracle.com/projects/rds/>`__)." msgstr "" -#: ../../whatsnew/3.3.rst:1897 +#: ../../whatsnew/3.3.rst:1898 msgid "" "The :class:`~socket.socket` class now supports the ``PF_SYSTEM`` protocol " "family on OS X. (Contributed by Michael Goderbauer in :issue:`13777`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1900 +#: ../../whatsnew/3.3.rst:1901 msgid "" "New function :func:`~socket.sethostname` allows the hostname to be set on " "Unix systems if the calling process has sufficient privileges. (Contributed " "by Ross Lagerwall in :issue:`10866`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1906 +#: ../../whatsnew/3.3.rst:1907 msgid "socketserver" msgstr "socketserver" -#: ../../whatsnew/3.3.rst:1908 +#: ../../whatsnew/3.3.rst:1909 msgid "" ":class:`~socketserver.BaseServer` now has an overridable method :meth:" "`~socketserver.BaseServer.service_actions` that is called by the :meth:" @@ -2787,54 +2787,54 @@ msgid "" "processes. (Contributed by Justin Warkentin in :issue:`11109`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1916 +#: ../../whatsnew/3.3.rst:1917 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.3.rst:1918 +#: ../../whatsnew/3.3.rst:1919 msgid "" "New :class:`sqlite3.Connection` method :meth:`~sqlite3.Connection." "set_trace_callback` can be used to capture a trace of all sql commands " "processed by sqlite. (Contributed by Torsten Landschoff in :issue:`11688`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1925 +#: ../../whatsnew/3.3.rst:1926 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.3.rst:1927 +#: ../../whatsnew/3.3.rst:1928 msgid "The :mod:`ssl` module has two new random generation functions:" msgstr "" -#: ../../whatsnew/3.3.rst:1929 +#: ../../whatsnew/3.3.rst:1930 msgid "" ":func:`~ssl.RAND_bytes`: generate cryptographically strong pseudo-random " "bytes." msgstr "" -#: ../../whatsnew/3.3.rst:1931 +#: ../../whatsnew/3.3.rst:1932 msgid ":func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes." msgstr "" -#: ../../whatsnew/3.3.rst:1933 +#: ../../whatsnew/3.3.rst:1934 msgid "(Contributed by Victor Stinner in :issue:`12049`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1935 +#: ../../whatsnew/3.3.rst:1936 msgid "" "The :mod:`ssl` module now exposes a finer-grained exception hierarchy in " "order to make it easier to inspect the various kinds of errors. (Contributed " "by Antoine Pitrou in :issue:`11183`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1939 +#: ../../whatsnew/3.3.rst:1940 msgid "" ":meth:`~ssl.SSLContext.load_cert_chain` now accepts a *password* argument to " "be used if the private key is encrypted. (Contributed by Adam Simpkins in :" "issue:`12803`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1943 +#: ../../whatsnew/3.3.rst:1944 msgid "" "Diffie-Hellman key exchange, both regular and Elliptic Curve-based, is now " "supported through the :meth:`~ssl.SSLContext.load_dh_params` and :meth:`~ssl." @@ -2842,14 +2842,14 @@ msgid "" "`13626` and :issue:`13627`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1948 +#: ../../whatsnew/3.3.rst:1949 msgid "" "SSL sockets have a new :meth:`~ssl.SSLSocket.get_channel_binding` method " "allowing the implementation of certain authentication mechanisms such as " "SCRAM-SHA-1-PLUS. (Contributed by Jacek Konieczny in :issue:`12551`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1952 +#: ../../whatsnew/3.3.rst:1953 msgid "" "You can query the SSL compression algorithm used by an SSL socket, thanks to " "its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :attr:" @@ -2857,123 +2857,123 @@ msgid "" "Antoine Pitrou in :issue:`13634`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1957 +#: ../../whatsnew/3.3.rst:1958 msgid "" "Support has been added for the Next Protocol Negotiation extension using " "the :meth:`ssl.SSLContext.set_npn_protocols` method. (Contributed by Colin " "Marc in :issue:`14204`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1961 +#: ../../whatsnew/3.3.rst:1962 msgid "" "SSL errors can now be introspected more easily thanks to :attr:`~ssl." "SSLError.library` and :attr:`~ssl.SSLError.reason` attributes. (Contributed " "by Antoine Pitrou in :issue:`14837`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1965 +#: ../../whatsnew/3.3.rst:1966 msgid "" "The :func:`~ssl.get_server_certificate` function now supports IPv6. " "(Contributed by Charles-François Natali in :issue:`11811`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1968 +#: ../../whatsnew/3.3.rst:1969 msgid "" "New attribute :attr:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting SSLv3 " "server sockets to use the server's cipher ordering preference rather than " "the client's (:issue:`13635`)." msgstr "" -#: ../../whatsnew/3.3.rst:1974 +#: ../../whatsnew/3.3.rst:1975 msgid "stat" msgstr "stat" -#: ../../whatsnew/3.3.rst:1976 +#: ../../whatsnew/3.3.rst:1977 msgid "" "The undocumented tarfile.filemode function has been moved to :func:`stat." "filemode`. It can be used to convert a file's mode to a string of the form '-" "rwxrwxrwx'." msgstr "" -#: ../../whatsnew/3.3.rst:1980 +#: ../../whatsnew/3.3.rst:1981 msgid "(Contributed by Giampaolo Rodolà in :issue:`14807`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1984 +#: ../../whatsnew/3.3.rst:1985 msgid "struct" msgstr "struct" -#: ../../whatsnew/3.3.rst:1986 +#: ../../whatsnew/3.3.rst:1987 msgid "" "The :mod:`struct` module now supports ``ssize_t`` and ``size_t`` via the new " "codes ``n`` and ``N``, respectively. (Contributed by Antoine Pitrou in :" "issue:`3163`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1992 +#: ../../whatsnew/3.3.rst:1993 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.3.rst:1994 +#: ../../whatsnew/3.3.rst:1995 msgid "" "Command strings can now be bytes objects on posix platforms. (Contributed " "by Victor Stinner in :issue:`8513`.)" msgstr "" -#: ../../whatsnew/3.3.rst:1997 +#: ../../whatsnew/3.3.rst:1998 msgid "" "A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a " "platform-independent fashion. (Contributed by Ross Lagerwall in :issue:" "`5870`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2003 +#: ../../whatsnew/3.3.rst:2004 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.3.rst:2005 +#: ../../whatsnew/3.3.rst:2006 msgid "" "The :mod:`sys` module has a new :data:`~sys.thread_info` :term:`named tuple` " "holding information about the thread implementation (:issue:`11223`)." msgstr "" -#: ../../whatsnew/3.3.rst:2011 +#: ../../whatsnew/3.3.rst:2012 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.3.rst:2013 +#: ../../whatsnew/3.3.rst:2014 msgid "" ":mod:`tarfile` now supports ``lzma`` encoding via the :mod:`lzma` module. " "(Contributed by Lars Gustäbel in :issue:`5689`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2018 +#: ../../whatsnew/3.3.rst:2019 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.3.rst:2020 +#: ../../whatsnew/3.3.rst:2021 msgid "" ":class:`tempfile.SpooledTemporaryFile`\\'s :meth:`~tempfile." "SpooledTemporaryFile.truncate` method now accepts a ``size`` parameter. " "(Contributed by Ryan Kelly in :issue:`9957`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2026 +#: ../../whatsnew/3.3.rst:2027 msgid "textwrap" msgstr "textwrap" -#: ../../whatsnew/3.3.rst:2028 +#: ../../whatsnew/3.3.rst:2029 msgid "" "The :mod:`textwrap` module has a new :func:`~textwrap.indent` that makes it " "straightforward to add a common prefix to selected lines in a block of text " "(:issue:`13857`)." msgstr "" -#: ../../whatsnew/3.3.rst:2034 +#: ../../whatsnew/3.3.rst:2035 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.3.rst:2036 +#: ../../whatsnew/3.3.rst:2037 msgid "" ":class:`threading.Condition`, :class:`threading.Semaphore`, :class:" "`threading.BoundedSemaphore`, :class:`threading.Event`, and :class:" @@ -2982,14 +2982,14 @@ msgid "" "Araujo in :issue:`10968`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2042 +#: ../../whatsnew/3.3.rst:2043 msgid "" "The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword " "argument to override the default behavior of inheriting the ``daemon`` flag " "value from the parent thread (:issue:`6064`)." msgstr "" -#: ../../whatsnew/3.3.rst:2046 +#: ../../whatsnew/3.3.rst:2047 msgid "" "The formerly private function ``_thread.get_ident`` is now available as the " "public function :func:`threading.get_ident`. This eliminates several cases " @@ -2998,76 +2998,76 @@ msgid "" "public interface." msgstr "" -#: ../../whatsnew/3.3.rst:2054 +#: ../../whatsnew/3.3.rst:2055 msgid "time" msgstr "time" -#: ../../whatsnew/3.3.rst:2056 +#: ../../whatsnew/3.3.rst:2057 msgid "The :pep:`418` added new functions to the :mod:`time` module:" msgstr "" -#: ../../whatsnew/3.3.rst:2058 +#: ../../whatsnew/3.3.rst:2059 msgid ":func:`~time.get_clock_info`: Get information on a clock." msgstr "" -#: ../../whatsnew/3.3.rst:2059 +#: ../../whatsnew/3.3.rst:2060 msgid "" ":func:`~time.monotonic`: Monotonic clock (cannot go backward), not affected " "by system clock updates." msgstr "" -#: ../../whatsnew/3.3.rst:2061 +#: ../../whatsnew/3.3.rst:2062 msgid "" ":func:`~time.perf_counter`: Performance counter with the highest available " "resolution to measure a short duration." msgstr "" -#: ../../whatsnew/3.3.rst:2063 +#: ../../whatsnew/3.3.rst:2064 msgid "" ":func:`~time.process_time`: Sum of the system and user CPU time of the " "current process." msgstr "" -#: ../../whatsnew/3.3.rst:2066 +#: ../../whatsnew/3.3.rst:2067 msgid "Other new functions:" msgstr "" -#: ../../whatsnew/3.3.rst:2068 +#: ../../whatsnew/3.3.rst:2069 msgid "" ":func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time." "clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2072 +#: ../../whatsnew/3.3.rst:2073 msgid "" "To improve cross platform consistency, :func:`~time.sleep` now raises a :exc:" "`ValueError` when passed a negative sleep value. Previously this was an " "error on posix, but produced an infinite sleep on Windows." msgstr "" -#: ../../whatsnew/3.3.rst:2078 +#: ../../whatsnew/3.3.rst:2079 msgid "types" msgstr "types" -#: ../../whatsnew/3.3.rst:2080 +#: ../../whatsnew/3.3.rst:2081 msgid "" "Add a new :class:`types.MappingProxyType` class: Read-only proxy of a " "mapping. (:issue:`14386`)" msgstr "" -#: ../../whatsnew/3.3.rst:2084 +#: ../../whatsnew/3.3.rst:2085 msgid "" "The new functions :func:`types.new_class` and :func:`types.prepare_class` " "provide support for :pep:`3115` compliant dynamic type creation. (:issue:" "`14588`)" msgstr "" -#: ../../whatsnew/3.3.rst:2089 +#: ../../whatsnew/3.3.rst:2090 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.3.rst:2091 +#: ../../whatsnew/3.3.rst:2092 msgid "" ":meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, " "and :meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used " @@ -3075,32 +3075,32 @@ msgid "" "issue:`10775`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2096 +#: ../../whatsnew/3.3.rst:2097 msgid "" ":meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult` " "object." msgstr "" -#: ../../whatsnew/3.3.rst:2101 +#: ../../whatsnew/3.3.rst:2102 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.3.rst:2103 +#: ../../whatsnew/3.3.rst:2104 msgid "" "The :class:`~urllib.request.Request` class, now accepts a *method* argument " "used by :meth:`~urllib.request.Request.get_method` to determine what HTTP " "method should be used. For example, this will send a ``'HEAD'`` request::" msgstr "" -#: ../../whatsnew/3.3.rst:2109 +#: ../../whatsnew/3.3.rst:2110 msgid "(:issue:`1673007`)" msgstr "" -#: ../../whatsnew/3.3.rst:2113 +#: ../../whatsnew/3.3.rst:2114 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.3.rst:2115 +#: ../../whatsnew/3.3.rst:2116 msgid "" "The :mod:`webbrowser` module supports more \"browsers\": Google Chrome " "(named :program:`chrome`, :program:`chromium`, :program:`chrome-browser` or :" @@ -3111,11 +3111,11 @@ msgid "" "latter by Matthias Klose in :issue:`14493`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2125 +#: ../../whatsnew/3.3.rst:2126 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.3.rst:2127 +#: ../../whatsnew/3.3.rst:2128 msgid "" "The :mod:`xml.etree.ElementTree` module now imports its C accelerator by " "default; there is no longer a need to explicitly import :mod:`xml.etree." @@ -3126,140 +3126,140 @@ msgid "" "detailed reference." msgstr "" -#: ../../whatsnew/3.3.rst:2137 +#: ../../whatsnew/3.3.rst:2138 msgid "zlib" msgstr "zlib" -#: ../../whatsnew/3.3.rst:2139 +#: ../../whatsnew/3.3.rst:2140 msgid "" "New attribute :attr:`zlib.Decompress.eof` makes it possible to distinguish " "between a properly formed compressed stream and an incomplete or truncated " "one. (Contributed by Nadeem Vawda in :issue:`12646`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2143 +#: ../../whatsnew/3.3.rst:2144 msgid "" "New attribute :attr:`zlib.ZLIB_RUNTIME_VERSION` reports the version string " "of the underlying ``zlib`` library that is loaded at runtime. (Contributed " "by Torsten Landschoff in :issue:`12306`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2149 +#: ../../whatsnew/3.3.rst:2150 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.3.rst:2151 +#: ../../whatsnew/3.3.rst:2152 msgid "Major performance enhancements have been added:" msgstr "" -#: ../../whatsnew/3.3.rst:2153 +#: ../../whatsnew/3.3.rst:2154 msgid "" "Thanks to :pep:`393`, some operations on Unicode strings have been optimized:" msgstr "" -#: ../../whatsnew/3.3.rst:2155 +#: ../../whatsnew/3.3.rst:2156 msgid "the memory footprint is divided by 2 to 4 depending on the text" msgstr "" -#: ../../whatsnew/3.3.rst:2156 +#: ../../whatsnew/3.3.rst:2157 msgid "" "encode an ASCII string to UTF-8 doesn't need to encode characters anymore, " "the UTF-8 representation is shared with the ASCII representation" msgstr "" -#: ../../whatsnew/3.3.rst:2158 +#: ../../whatsnew/3.3.rst:2159 msgid "the UTF-8 encoder has been optimized" msgstr "" -#: ../../whatsnew/3.3.rst:2159 +#: ../../whatsnew/3.3.rst:2160 msgid "" "repeating a single ASCII letter and getting a substring of an ASCII string " "is 4 times faster" msgstr "" -#: ../../whatsnew/3.3.rst:2162 +#: ../../whatsnew/3.3.rst:2163 msgid "UTF-8 is now 2x to 4x faster. UTF-16 encoding is now up to 10x faster." msgstr "" -#: ../../whatsnew/3.3.rst:2164 +#: ../../whatsnew/3.3.rst:2165 msgid "" "(Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:" "`15026`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2169 +#: ../../whatsnew/3.3.rst:2170 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.3.rst:2171 +#: ../../whatsnew/3.3.rst:2172 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.3.rst:2173 +#: ../../whatsnew/3.3.rst:2174 msgid "New :pep:`3118` related function:" msgstr "" -#: ../../whatsnew/3.3.rst:2175 +#: ../../whatsnew/3.3.rst:2176 msgid ":c:func:`PyMemoryView_FromMemory`" msgstr ":c:func:`PyMemoryView_FromMemory`" -#: ../../whatsnew/3.3.rst:2177 +#: ../../whatsnew/3.3.rst:2178 msgid ":pep:`393` added new Unicode types, macros and functions:" msgstr "" -#: ../../whatsnew/3.3.rst:2179 +#: ../../whatsnew/3.3.rst:2180 msgid "High-level API:" msgstr "" -#: ../../whatsnew/3.3.rst:2181 +#: ../../whatsnew/3.3.rst:2182 msgid ":c:func:`PyUnicode_CopyCharacters`" msgstr ":c:func:`PyUnicode_CopyCharacters`" -#: ../../whatsnew/3.3.rst:2182 +#: ../../whatsnew/3.3.rst:2183 msgid ":c:func:`PyUnicode_FindChar`" msgstr ":c:func:`PyUnicode_FindChar`" -#: ../../whatsnew/3.3.rst:2183 +#: ../../whatsnew/3.3.rst:2184 msgid ":c:func:`PyUnicode_GetLength`, :c:macro:`PyUnicode_GET_LENGTH`" msgstr ":c:func:`PyUnicode_GetLength`, :c:macro:`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.3.rst:2184 +#: ../../whatsnew/3.3.rst:2185 msgid ":c:func:`PyUnicode_New`" msgstr ":c:func:`PyUnicode_New`" -#: ../../whatsnew/3.3.rst:2185 +#: ../../whatsnew/3.3.rst:2186 msgid ":c:func:`PyUnicode_Substring`" msgstr ":c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.3.rst:2186 +#: ../../whatsnew/3.3.rst:2187 msgid ":c:func:`PyUnicode_ReadChar`, :c:func:`PyUnicode_WriteChar`" msgstr ":c:func:`PyUnicode_ReadChar`, :c:func:`PyUnicode_WriteChar`" -#: ../../whatsnew/3.3.rst:2188 +#: ../../whatsnew/3.3.rst:2189 msgid "Low-level API:" msgstr "" -#: ../../whatsnew/3.3.rst:2190 +#: ../../whatsnew/3.3.rst:2191 msgid ":c:type:`Py_UCS1`, :c:type:`Py_UCS2`, :c:type:`Py_UCS4` types" msgstr "" -#: ../../whatsnew/3.3.rst:2191 +#: ../../whatsnew/3.3.rst:2192 msgid ":c:type:`PyASCIIObject` and :c:type:`PyCompactUnicodeObject` structures" msgstr "" -#: ../../whatsnew/3.3.rst:2192 +#: ../../whatsnew/3.3.rst:2193 msgid ":c:macro:`PyUnicode_READY`" msgstr ":c:macro:`PyUnicode_READY`" -#: ../../whatsnew/3.3.rst:2193 +#: ../../whatsnew/3.3.rst:2194 msgid ":c:func:`PyUnicode_FromKindAndData`" msgstr ":c:func:`PyUnicode_FromKindAndData`" -#: ../../whatsnew/3.3.rst:2194 +#: ../../whatsnew/3.3.rst:2195 msgid ":c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsUCS4Copy`" msgstr ":c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsUCS4Copy`" -#: ../../whatsnew/3.3.rst:2195 +#: ../../whatsnew/3.3.rst:2196 msgid "" ":c:macro:`PyUnicode_DATA`, :c:macro:`PyUnicode_1BYTE_DATA`, :c:macro:" "`PyUnicode_2BYTE_DATA`, :c:macro:`PyUnicode_4BYTE_DATA`" @@ -3267,7 +3267,7 @@ msgstr "" ":c:macro:`PyUnicode_DATA`, :c:macro:`PyUnicode_1BYTE_DATA`, :c:macro:" "`PyUnicode_2BYTE_DATA`, :c:macro:`PyUnicode_4BYTE_DATA`" -#: ../../whatsnew/3.3.rst:2197 +#: ../../whatsnew/3.3.rst:2198 msgid "" ":c:macro:`PyUnicode_KIND` with :c:type:`PyUnicode_Kind` enum: :c:data:" "`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" @@ -3277,7 +3277,7 @@ msgstr "" "`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" "`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" -#: ../../whatsnew/3.3.rst:2200 +#: ../../whatsnew/3.3.rst:2201 msgid "" ":c:macro:`PyUnicode_READ`, :c:macro:`PyUnicode_READ_CHAR`, :c:macro:" "`PyUnicode_WRITE`" @@ -3285,100 +3285,100 @@ msgstr "" ":c:macro:`PyUnicode_READ`, :c:macro:`PyUnicode_READ_CHAR`, :c:macro:" "`PyUnicode_WRITE`" -#: ../../whatsnew/3.3.rst:2201 +#: ../../whatsnew/3.3.rst:2202 msgid ":c:macro:`PyUnicode_MAX_CHAR_VALUE`" msgstr ":c:macro:`PyUnicode_MAX_CHAR_VALUE`" -#: ../../whatsnew/3.3.rst:2203 +#: ../../whatsnew/3.3.rst:2204 msgid "" ":c:macro:`PyArg_ParseTuple` now accepts a :class:`bytearray` for the ``c`` " "format (:issue:`12380`)." msgstr "" -#: ../../whatsnew/3.3.rst:2209 +#: ../../whatsnew/3.3.rst:2210 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.3.rst:2212 +#: ../../whatsnew/3.3.rst:2213 msgid "Unsupported Operating Systems" msgstr "" -#: ../../whatsnew/3.3.rst:2214 +#: ../../whatsnew/3.3.rst:2215 msgid "OS/2 and VMS are no longer supported due to the lack of a maintainer." msgstr "" -#: ../../whatsnew/3.3.rst:2216 +#: ../../whatsnew/3.3.rst:2217 msgid "" "Windows 2000 and Windows platforms which set ``COMSPEC`` to ``command.com`` " "are no longer supported due to maintenance burden." msgstr "" -#: ../../whatsnew/3.3.rst:2219 +#: ../../whatsnew/3.3.rst:2220 msgid "OSF support, which was deprecated in 3.2, has been completely removed." msgstr "" -#: ../../whatsnew/3.3.rst:2223 +#: ../../whatsnew/3.3.rst:2224 msgid "Deprecated Python modules, functions and methods" msgstr "" -#: ../../whatsnew/3.3.rst:2225 +#: ../../whatsnew/3.3.rst:2226 msgid "" "Passing a non-empty string to ``object.__format__()`` is deprecated, and " "will produce a :exc:`TypeError` in Python 3.4 (:issue:`9856`)." msgstr "" -#: ../../whatsnew/3.3.rst:2227 +#: ../../whatsnew/3.3.rst:2228 msgid "" "The ``unicode_internal`` codec has been deprecated because of the :pep:" "`393`, use UTF-8, UTF-16 (``utf-16-le`` or ``utf-16-be``), or UTF-32 " "(``utf-32-le`` or ``utf-32-be``)" msgstr "" -#: ../../whatsnew/3.3.rst:2230 +#: ../../whatsnew/3.3.rst:2231 msgid "" ":meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use :meth:`ftplib.FTP." "mlsd`" msgstr "" -#: ../../whatsnew/3.3.rst:2232 +#: ../../whatsnew/3.3.rst:2233 msgid "" ":func:`platform.popen`: use the :mod:`subprocess` module. Check especially " "the :ref:`subprocess-replacements` section (:issue:`11377`)." msgstr "" -#: ../../whatsnew/3.3.rst:2234 +#: ../../whatsnew/3.3.rst:2235 msgid "" ":issue:`13374`: The Windows bytes API has been deprecated in the :mod:`os` " "module. Use Unicode filenames, instead of bytes filenames, to not depend on " "the ANSI code page anymore and to support any filename." msgstr "" -#: ../../whatsnew/3.3.rst:2237 +#: ../../whatsnew/3.3.rst:2238 msgid "" ":issue:`13988`: The :mod:`xml.etree.cElementTree` module is deprecated. The " "accelerator is used automatically whenever available." msgstr "" -#: ../../whatsnew/3.3.rst:2239 +#: ../../whatsnew/3.3.rst:2240 msgid "" "The behaviour of :func:`time.clock` depends on the platform: use the new :" "func:`time.perf_counter` or :func:`time.process_time` function instead, " "depending on your requirements, to have a well defined behaviour." msgstr "" -#: ../../whatsnew/3.3.rst:2242 +#: ../../whatsnew/3.3.rst:2243 msgid "The :func:`os.stat_float_times` function is deprecated." msgstr "" -#: ../../whatsnew/3.3.rst:2243 +#: ../../whatsnew/3.3.rst:2244 msgid ":mod:`abc` module:" msgstr ":mod:`abc` 模組:" -#: ../../whatsnew/3.3.rst:2252 +#: ../../whatsnew/3.3.rst:2253 msgid ":mod:`importlib` package:" msgstr "" -#: ../../whatsnew/3.3.rst:2254 +#: ../../whatsnew/3.3.rst:2255 msgid "" ":meth:`importlib.abc.SourceLoader.path_mtime` is now deprecated in favour " "of :meth:`importlib.abc.SourceLoader.path_stats` as bytecode files now store " @@ -3386,206 +3386,206 @@ msgid "" "compiled from." msgstr "" -#: ../../whatsnew/3.3.rst:2264 +#: ../../whatsnew/3.3.rst:2265 msgid "Deprecated functions and types of the C API" msgstr "" -#: ../../whatsnew/3.3.rst:2266 +#: ../../whatsnew/3.3.rst:2267 msgid "" "The :c:type:`Py_UNICODE` has been deprecated by :pep:`393` and will be " "removed in Python 4. All functions using this type are deprecated:" msgstr "" -#: ../../whatsnew/3.3.rst:2269 +#: ../../whatsnew/3.3.rst:2270 msgid "" "Unicode functions and methods using :c:type:`Py_UNICODE` and :c:expr:" "`Py_UNICODE*` types:" msgstr "" -#: ../../whatsnew/3.3.rst:2272 +#: ../../whatsnew/3.3.rst:2273 msgid "" ":c:macro:`PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :c:" "func:`PyUnicode_FromKindAndData`" msgstr "" -#: ../../whatsnew/3.3.rst:2274 +#: ../../whatsnew/3.3.rst:2275 msgid "" ":c:macro:`PyUnicode_AS_UNICODE`, :c:func:`PyUnicode_AsUnicode`, :c:func:" "`PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" msgstr "" -#: ../../whatsnew/3.3.rst:2276 +#: ../../whatsnew/3.3.rst:2277 msgid "" ":c:macro:`PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" "`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`" msgstr "" -#: ../../whatsnew/3.3.rst:2278 +#: ../../whatsnew/3.3.rst:2279 msgid "" ":c:macro:`PyUnicode_GET_SIZE`, :c:func:`PyUnicode_GetSize`: use :c:macro:" "`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`" msgstr "" -#: ../../whatsnew/3.3.rst:2280 +#: ../../whatsnew/3.3.rst:2281 msgid "" ":c:macro:`PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " "PyUnicode_KIND(str)`` (only work on ready strings)" msgstr "" -#: ../../whatsnew/3.3.rst:2283 +#: ../../whatsnew/3.3.rst:2284 msgid "" ":c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" "func:`PyUnicode_AsWideCharString`" msgstr "" -#: ../../whatsnew/3.3.rst:2285 +#: ../../whatsnew/3.3.rst:2286 msgid ":c:func:`PyUnicode_GetMax`" msgstr ":c:func:`PyUnicode_GetMax`" -#: ../../whatsnew/3.3.rst:2288 +#: ../../whatsnew/3.3.rst:2289 msgid "Functions and macros manipulating Py_UNICODE* strings:" msgstr "" -#: ../../whatsnew/3.3.rst:2290 +#: ../../whatsnew/3.3.rst:2291 msgid "" ":c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" msgstr "" -#: ../../whatsnew/3.3.rst:2292 +#: ../../whatsnew/3.3.rst:2293 msgid "" ":c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or :c:" "func:`PyUnicode_FromFormat`" msgstr "" -#: ../../whatsnew/3.3.rst:2294 +#: ../../whatsnew/3.3.rst:2295 msgid "" ":c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`, :c:macro:" "`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_Substring`" msgstr "" -#: ../../whatsnew/3.3.rst:2297 +#: ../../whatsnew/3.3.rst:2298 msgid ":c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`" msgstr "" -#: ../../whatsnew/3.3.rst:2298 +#: ../../whatsnew/3.3.rst:2299 msgid ":c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`" msgstr "" -#: ../../whatsnew/3.3.rst:2299 +#: ../../whatsnew/3.3.rst:2300 msgid "" ":c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use :c:func:" "`PyUnicode_FindChar`" msgstr "" -#: ../../whatsnew/3.3.rst:2301 +#: ../../whatsnew/3.3.rst:2302 msgid ":c:macro:`Py_UNICODE_FILL`: use :c:func:`PyUnicode_Fill`" msgstr "" -#: ../../whatsnew/3.3.rst:2302 +#: ../../whatsnew/3.3.rst:2303 msgid ":c:macro:`Py_UNICODE_MATCH`" msgstr ":c:macro:`Py_UNICODE_MATCH`" -#: ../../whatsnew/3.3.rst:2304 +#: ../../whatsnew/3.3.rst:2305 msgid "Encoders:" msgstr "" -#: ../../whatsnew/3.3.rst:2306 +#: ../../whatsnew/3.3.rst:2307 msgid ":c:func:`PyUnicode_Encode`: use :c:func:`PyUnicode_AsEncodedObject`" msgstr "" -#: ../../whatsnew/3.3.rst:2307 +#: ../../whatsnew/3.3.rst:2308 msgid ":c:func:`PyUnicode_EncodeUTF7`" msgstr ":c:func:`PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.3.rst:2308 +#: ../../whatsnew/3.3.rst:2309 msgid "" ":c:func:`PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" "`PyUnicode_AsUTF8String`" msgstr "" -#: ../../whatsnew/3.3.rst:2310 +#: ../../whatsnew/3.3.rst:2311 msgid ":c:func:`PyUnicode_EncodeUTF32`" msgstr ":c:func:`PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.3.rst:2311 +#: ../../whatsnew/3.3.rst:2312 msgid ":c:func:`PyUnicode_EncodeUTF16`" msgstr ":c:func:`PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.3.rst:2312 +#: ../../whatsnew/3.3.rst:2313 msgid "" ":c:func:`PyUnicode_EncodeUnicodeEscape` use :c:func:" "`PyUnicode_AsUnicodeEscapeString`" msgstr "" -#: ../../whatsnew/3.3.rst:2314 +#: ../../whatsnew/3.3.rst:2315 msgid "" ":c:func:`PyUnicode_EncodeRawUnicodeEscape` use :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" msgstr "" -#: ../../whatsnew/3.3.rst:2316 +#: ../../whatsnew/3.3.rst:2317 msgid "" ":c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" msgstr "" -#: ../../whatsnew/3.3.rst:2317 +#: ../../whatsnew/3.3.rst:2318 msgid ":c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" msgstr "" -#: ../../whatsnew/3.3.rst:2318 +#: ../../whatsnew/3.3.rst:2319 msgid ":c:func:`PyUnicode_EncodeCharmap`" msgstr ":c:func:`PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.3.rst:2319 +#: ../../whatsnew/3.3.rst:2320 msgid ":c:func:`PyUnicode_TranslateCharmap`" msgstr ":c:func:`PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.3.rst:2320 +#: ../../whatsnew/3.3.rst:2321 msgid "" ":c:func:`PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" "func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)" msgstr "" -#: ../../whatsnew/3.3.rst:2322 +#: ../../whatsnew/3.3.rst:2323 msgid "" ":c:func:`PyUnicode_EncodeDecimal`, :c:func:" "`PyUnicode_TransformDecimalToASCII`" msgstr "" -#: ../../whatsnew/3.3.rst:2327 +#: ../../whatsnew/3.3.rst:2328 msgid "Deprecated features" msgstr "" -#: ../../whatsnew/3.3.rst:2329 +#: ../../whatsnew/3.3.rst:2330 msgid "" "The :mod:`array` module's ``'u'`` format code is now deprecated and will be " "removed in Python 4 together with the rest of the (:c:type:`Py_UNICODE`) API." msgstr "" -#: ../../whatsnew/3.3.rst:2334 +#: ../../whatsnew/3.3.rst:2335 msgid "Porting to Python 3.3" msgstr "" -#: ../../whatsnew/3.3.rst:2336 +#: ../../whatsnew/3.3.rst:2337 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.3.rst:2342 +#: ../../whatsnew/3.3.rst:2343 msgid "Porting Python code" msgstr "" -#: ../../whatsnew/3.3.rst:2344 +#: ../../whatsnew/3.3.rst:2345 msgid "" "Hash randomization is enabled by default. Set the :envvar:`PYTHONHASHSEED` " "environment variable to ``0`` to disable hash randomization. See also the :" "meth:`object.__hash__` method." msgstr "" -#: ../../whatsnew/3.3.rst:2348 +#: ../../whatsnew/3.3.rst:2349 msgid "" ":issue:`12326`: On Linux, sys.platform doesn't contain the major version " "anymore. It is now always 'linux', instead of 'linux2' or 'linux3' depending " @@ -3594,7 +3594,7 @@ msgid "" "if you don't need to support older Python versions." msgstr "" -#: ../../whatsnew/3.3.rst:2354 +#: ../../whatsnew/3.3.rst:2355 msgid "" ":issue:`13847`, :issue:`14180`: :mod:`time` and :mod:`datetime`: :exc:" "`OverflowError` is now raised instead of :exc:`ValueError` if a timestamp is " @@ -3602,7 +3602,7 @@ msgid "" "or :c:func:`localtime` failed." msgstr "" -#: ../../whatsnew/3.3.rst:2359 +#: ../../whatsnew/3.3.rst:2360 msgid "" "The default finders used by import now utilize a cache of what is contained " "within a specific directory. If you create a Python source file or " @@ -3611,7 +3611,7 @@ msgid "" "file." msgstr "" -#: ../../whatsnew/3.3.rst:2364 +#: ../../whatsnew/3.3.rst:2365 msgid "" ":exc:`ImportError` now uses the full name of the module that was attempted " "to be imported. Doctests that check ImportErrors' message will need to be " @@ -3619,7 +3619,7 @@ msgid "" "name." msgstr "" -#: ../../whatsnew/3.3.rst:2369 +#: ../../whatsnew/3.3.rst:2370 msgid "" "The *index* argument to :func:`__import__` now defaults to 0 instead of -1 " "and no longer support negative values. It was an oversight when :pep:`328` " @@ -3630,40 +3630,40 @@ msgid "" "import_module` rather than call :func:`__import__` directly." msgstr "" -#: ../../whatsnew/3.3.rst:2377 +#: ../../whatsnew/3.3.rst:2378 msgid "" ":func:`__import__` no longer allows one to use an index value other than 0 " "for top-level modules. E.g. ``__import__('sys', level=1)`` is now an error." msgstr "" -#: ../../whatsnew/3.3.rst:2380 +#: ../../whatsnew/3.3.rst:2381 msgid "" "Because :attr:`sys.meta_path` and :attr:`sys.path_hooks` now have finders on " "them by default, you will most likely want to use :meth:`list.insert` " "instead of :meth:`list.append` to add to those lists." msgstr "" -#: ../../whatsnew/3.3.rst:2384 +#: ../../whatsnew/3.3.rst:2385 msgid "" "Because ``None`` is now inserted into :attr:`sys.path_importer_cache`, if " "you are clearing out entries in the dictionary of paths that do not have a " "finder, you will need to remove keys paired with values of ``None`` **and** :" -"class:`imp.NullImporter` to be backwards-compatible. This will lead to extra " -"overhead on older versions of Python that re-insert ``None`` into :attr:`sys." -"path_importer_cache` where it represents the use of implicit finders, but " -"semantically it should not change anything." +"class:`!imp.NullImporter` to be backwards-compatible. This will lead to " +"extra overhead on older versions of Python that re-insert ``None`` into :" +"attr:`sys.path_importer_cache` where it represents the use of implicit " +"finders, but semantically it should not change anything." msgstr "" -#: ../../whatsnew/3.3.rst:2392 +#: ../../whatsnew/3.3.rst:2393 msgid "" -":class:`importlib.abc.Finder` no longer specifies a ``find_module()`` " +":class:`!importlib.abc.Finder` no longer specifies a ``find_module()`` " "abstract method that must be implemented. If you were relying on subclasses " "to implement that method, make sure to check for the method's existence " "first. You will probably want to check for ``find_loader()`` first, though, " "in the case of working with :term:`path entry finders `." msgstr "" -#: ../../whatsnew/3.3.rst:2398 +#: ../../whatsnew/3.3.rst:2399 msgid "" ":mod:`pkgutil` has been converted to use :mod:`importlib` internally. This " "eliminates many edge cases where the old behaviour of the :pep:`302` import " @@ -3674,7 +3674,7 @@ msgid "" "do not provide the non-standard ``iter_modules()`` method." msgstr "" -#: ../../whatsnew/3.3.rst:2406 +#: ../../whatsnew/3.3.rst:2407 msgid "" "A longstanding RFC-compliance bug (:issue:`1079`) in the parsing done by :" "func:`email.header.decode_header` has been fixed. Code that uses the " @@ -3688,7 +3688,7 @@ msgid "" "already present in the input strings." msgstr "" -#: ../../whatsnew/3.3.rst:2417 +#: ../../whatsnew/3.3.rst:2418 msgid "" ":func:`email.utils.formataddr` now does the correct content transfer " "encoding when passed non-``ASCII`` display names. Any code that depended on " @@ -3696,7 +3696,7 @@ msgid "" "formatted output string will need to be changed (:issue:`1690608`)." msgstr "" -#: ../../whatsnew/3.3.rst:2422 +#: ../../whatsnew/3.3.rst:2423 msgid "" ":meth:`poplib.POP3.quit` may now raise protocol errors like all other " "``poplib`` methods. Code that assumes ``quit`` does not raise :exc:`poplib." @@ -3704,57 +3704,57 @@ msgid "" "encountered by a particular application (:issue:`11291`)." msgstr "" -#: ../../whatsnew/3.3.rst:2427 +#: ../../whatsnew/3.3.rst:2428 msgid "" "The ``strict`` argument to :class:`email.parser.Parser`, deprecated since " "Python 2.4, has finally been removed." msgstr "" -#: ../../whatsnew/3.3.rst:2430 +#: ../../whatsnew/3.3.rst:2431 msgid "" "The deprecated method ``unittest.TestCase.assertSameElements`` has been " "removed." msgstr "" -#: ../../whatsnew/3.3.rst:2433 +#: ../../whatsnew/3.3.rst:2434 msgid "The deprecated variable ``time.accept2dyear`` has been removed." msgstr "" -#: ../../whatsnew/3.3.rst:2435 +#: ../../whatsnew/3.3.rst:2436 msgid "" "The deprecated ``Context._clamp`` attribute has been removed from the :mod:" "`decimal` module. It was previously replaced by the public attribute :attr:" "`~decimal.Context.clamp`. (See :issue:`8540`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2439 +#: ../../whatsnew/3.3.rst:2440 msgid "" "The undocumented internal helper class ``SSLFakeFile`` has been removed " "from :mod:`smtplib`, since its functionality has long been provided directly " "by :meth:`socket.socket.makefile`." msgstr "" -#: ../../whatsnew/3.3.rst:2443 +#: ../../whatsnew/3.3.rst:2444 msgid "" "Passing a negative value to :func:`time.sleep` on Windows now raises an " "error instead of sleeping forever. It has always raised an error on posix." msgstr "" -#: ../../whatsnew/3.3.rst:2446 +#: ../../whatsnew/3.3.rst:2447 msgid "" "The ``ast.__version__`` constant has been removed. If you need to make " "decisions affected by the AST version, use :attr:`sys.version_info` to make " "the decision." msgstr "" -#: ../../whatsnew/3.3.rst:2450 +#: ../../whatsnew/3.3.rst:2451 msgid "" "Code that used to work around the fact that the :mod:`threading` module used " "factory functions by subclassing the private classes will need to change to " "subclass the now-public classes." msgstr "" -#: ../../whatsnew/3.3.rst:2454 +#: ../../whatsnew/3.3.rst:2455 msgid "" "The undocumented debugging machinery in the threading module has been " "removed, simplifying the code. This should have no effect on production " @@ -3762,24 +3762,24 @@ msgid "" "interacting with it (:issue:`13550`)." msgstr "" -#: ../../whatsnew/3.3.rst:2461 +#: ../../whatsnew/3.3.rst:2462 msgid "Porting C code" msgstr "" -#: ../../whatsnew/3.3.rst:2463 +#: ../../whatsnew/3.3.rst:2464 msgid "" "In the course of changes to the buffer API the undocumented :c:member:" "`~Py_buffer.smalltable` member of the :c:type:`Py_buffer` structure has been " "removed and the layout of the :c:type:`PyMemoryViewObject` has changed." msgstr "" -#: ../../whatsnew/3.3.rst:2468 +#: ../../whatsnew/3.3.rst:2469 msgid "" "All extensions relying on the relevant parts in ``memoryobject.h`` or " "``object.h`` must be rebuilt." msgstr "" -#: ../../whatsnew/3.3.rst:2471 +#: ../../whatsnew/3.3.rst:2472 msgid "" "Due to :ref:`PEP 393 `, the :c:type:`Py_UNICODE` type and all " "functions using this type are deprecated (but will stay available for at " @@ -3789,7 +3789,7 @@ msgid "" "doc:`Unicode API <../c-api/unicode>`." msgstr "" -#: ../../whatsnew/3.3.rst:2478 +#: ../../whatsnew/3.3.rst:2479 msgid "" "However, if you only have been using high-level functions such as :c:func:" "`PyUnicode_Concat()`, :c:func:`PyUnicode_Join` or :c:func:" @@ -3797,11 +3797,11 @@ msgid "" "new unicode representations." msgstr "" -#: ../../whatsnew/3.3.rst:2483 +#: ../../whatsnew/3.3.rst:2484 msgid ":c:func:`PyImport_GetMagicNumber` now returns ``-1`` upon failure." msgstr "" -#: ../../whatsnew/3.3.rst:2485 +#: ../../whatsnew/3.3.rst:2486 msgid "" "As a negative value for the *level* argument to :func:`__import__` is no " "longer valid, the same now holds for :c:func:`PyImport_ImportModuleLevel`. " @@ -3809,11 +3809,11 @@ msgid "" "`PyImport_ImportModuleEx` is now ``0`` instead of ``-1``." msgstr "" -#: ../../whatsnew/3.3.rst:2492 +#: ../../whatsnew/3.3.rst:2493 msgid "Building C extensions" msgstr "" -#: ../../whatsnew/3.3.rst:2494 +#: ../../whatsnew/3.3.rst:2495 msgid "" "The range of possible file names for C extensions has been narrowed. Very " "rarely used spellings have been suppressed: under POSIX, files named " @@ -3823,32 +3823,32 @@ msgid "" "remove the ``module`` string from the file names)." msgstr "" -#: ../../whatsnew/3.3.rst:2502 +#: ../../whatsnew/3.3.rst:2503 msgid "(implemented in :issue:`14040`.)" msgstr "" -#: ../../whatsnew/3.3.rst:2506 +#: ../../whatsnew/3.3.rst:2507 msgid "Command Line Switch Changes" msgstr "" -#: ../../whatsnew/3.3.rst:2508 +#: ../../whatsnew/3.3.rst:2509 msgid "" "The -Q command-line flag and related artifacts have been removed. Code " "checking sys.flags.division_warning will need updating." msgstr "" -#: ../../whatsnew/3.3.rst:2511 +#: ../../whatsnew/3.3.rst:2512 msgid "(:issue:`10998`, contributed by Éric Araujo.)" msgstr "" -#: ../../whatsnew/3.3.rst:2513 +#: ../../whatsnew/3.3.rst:2514 msgid "" "When :program:`python` is started with :option:`-S`, ``import site`` will no " "longer add site-specific paths to the module search paths. In previous " "versions, it did." msgstr "" -#: ../../whatsnew/3.3.rst:2517 +#: ../../whatsnew/3.3.rst:2518 msgid "" "(:issue:`11591`, contributed by Carl Meyer with editions by Éric Araujo.)" msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a767afbf0a..3e102c5b26 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -376,7 +376,7 @@ msgstr "" msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" -"ref:`distutils-index`." +"ref:`setuptools-index`." msgstr "" #: ../../whatsnew/3.4.rst:255 @@ -1331,8 +1331,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:994 msgid "" -"The :func:`~importlib.reload` function has been moved from :mod:`imp` to :" -"mod:`importlib` as part of the :mod:`imp` module deprecation. (Contributed " +"The :func:`~importlib.reload` function has been moved from :mod:`!imp` to :" +"mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed " "by Berker Peksag in :issue:`18193`.)" msgstr "" @@ -1340,7 +1340,7 @@ msgstr "" msgid "" ":mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` " "attribute providing access to the bytecode version number. This replaces " -"the :func:`~imp.get_magic` function in the deprecated :mod:`imp` module. " +"the :func:`!get_magic` function in the deprecated :mod:`!imp` module. " "(Contributed by Brett Cannon in :issue:`18192`.)" msgstr "" @@ -1348,7 +1348,7 @@ msgstr "" msgid "" "New :mod:`importlib.util` functions :func:`~importlib.util." "cache_from_source` and :func:`~importlib.util.source_from_cache` replace the " -"same-named functions in the deprecated :mod:`imp` module. (Contributed by " +"same-named functions in the deprecated :mod:`!imp` module. (Contributed by " "Brett Cannon in :issue:`18194`.)" msgstr "" @@ -2842,29 +2842,29 @@ msgstr "" #: ../../whatsnew/3.4.rst:2079 msgid "" "As mentioned in :ref:`whatsnew-pep-451`, a number of :mod:`importlib` " -"methods and functions are deprecated: :meth:`importlib.find_loader` is " -"replaced by :func:`importlib.util.find_spec`; :meth:`importlib.machinery." +"methods and functions are deprecated: :meth:`!importlib.find_loader` is " +"replaced by :func:`importlib.util.find_spec`; :meth:`!importlib.machinery." "PathFinder.find_module` is replaced by :meth:`importlib.machinery.PathFinder." -"find_spec`; :meth:`importlib.abc.MetaPathFinder.find_module` is replaced by :" -"meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`importlib.abc." -"PathEntryFinder.find_loader` and :meth:`~importlib.abc.PathEntryFinder." -"find_module` are replaced by :meth:`importlib.abc.PathEntryFinder." -"find_spec`; all of the ``xxxLoader`` ABC ``load_module`` methods (:meth:" -"`importlib.abc.Loader.load_module`, :meth:`importlib.abc.InspectLoader." -"load_module`, :meth:`importlib.abc.FileLoader.load_module`, :meth:`importlib." -"abc.SourceLoader.load_module`) should no longer be implemented, instead " -"loaders should implement an ``exec_module`` method (:meth:`importlib.abc." -"Loader.exec_module`, :meth:`importlib.abc.InspectLoader.exec_module` :meth:" -"`importlib.abc.SourceLoader.exec_module`) and let the import system take " -"care of the rest; and :meth:`importlib.abc.Loader.module_repr`, :meth:" -"`importlib.util.module_for_loader`, :meth:`importlib.util.set_loader`, and :" -"meth:`importlib.util.set_package` are no longer needed because their " -"functions are now handled automatically by the import system." +"find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " +"by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." +"PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" +"`importlib.abc.PathEntryFinder.find_spec`; all of the ``xxxLoader`` ABC " +"``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :meth:`!" +"importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc.FileLoader." +"load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) should no " +"longer be implemented, instead loaders should implement an ``exec_module`` " +"method (:meth:`importlib.abc.Loader.exec_module`, :meth:`importlib.abc." +"InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader.exec_module`) " +"and let the import system take care of the rest; and :meth:`!importlib.abc." +"Loader.module_repr`, :meth:`!importlib.util.module_for_loader`, :meth:`!" +"importlib.util.set_loader`, and :meth:`!importlib.util.set_package` are no " +"longer needed because their functions are now handled automatically by the " +"import system." msgstr "" #: ../../whatsnew/3.4.rst:2104 msgid "" -"The :mod:`imp` module is pending deprecation. To keep compatibility with " +"The :mod:`!imp` module is pending deprecation. To keep compatibility with " "Python 2/3 code bases, the module's removal is currently not scheduled." msgstr "" @@ -3148,7 +3148,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2280 msgid "" -":meth:`importlib.util.module_for_loader` now sets ``__loader__`` and " +":meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and " "``__package__`` unconditionally to properly support reloading. If this is " "not desired then you will need to set these attributes manually. You can " "use :func:`importlib.util.module_to_load` for module management." @@ -3180,7 +3180,7 @@ msgid "" "code then you can see if the module's ``__spec__.location`` is set to " "``'frozen'``, check if the loader is a subclass of :class:`importlib." "machinery.FrozenImporter`, or if Python 2 compatibility is necessary you can " -"use :func:`imp.is_frozen`." +"use :func:`!imp.is_frozen`." msgstr "" #: ../../whatsnew/3.4.rst:2305 @@ -3270,9 +3270,9 @@ msgstr "" msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " -"This particular :exc:`TypeError` was missed when the other :exc:`TypeError`" -"\\ s were converted. (Contributed by Serhiy Storchaka in :issue:`18011`.) " -"Note: this change was also inadvertently applied in Python 3.3.3." +"This particular :exc:`TypeError` was missed when the other :exc:" +"`TypeError`\\ s were converted. (Contributed by Serhiy Storchaka in :issue:" +"`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" #: ../../whatsnew/3.4.rst:2373 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 561fc67356..2f751f805a 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1311,9 +1311,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:1082 msgid "" -"The :mod:`distutils` module now supports ``xz`` compression, and can be " -"enabled by passing ``xztar`` as an argument to ``bdist --format``. " -"(Contributed by Serhiy Storchaka in :issue:`16314`.)" +"The ``distutils`` module now supports ``xz`` compression, and can be enabled " +"by passing ``xztar`` as an argument to ``bdist --format``. (Contributed by " +"Serhiy Storchaka in :issue:`16314`.)" msgstr "" #: ../../whatsnew/3.5.rst:1088 diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 0ce9767055..5775105411 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1236,9 +1236,9 @@ msgstr "distutils" #: ../../whatsnew/3.6.rst:1014 msgid "" -"The ``default_format`` attribute has been removed from :class:`distutils." -"command.sdist.sdist` and the ``formats`` attribute defaults to " -"``['gztar']``. Although not anticipated, any code relying on the presence of " +"The ``default_format`` attribute has been removed from ``distutils.command." +"sdist.sdist`` and the ``formats`` attribute defaults to ``['gztar']``. " +"Although not anticipated, any code relying on the presence of " "``default_format`` may need to be adapted. See :issue:`27819` for more " "details." msgstr "" @@ -2589,10 +2589,10 @@ msgstr "" #: ../../whatsnew/3.6.rst:1988 msgid "" -"The undocumented ``extra_path`` argument to the :class:`~distutils." -"Distribution` constructor is now considered deprecated and will raise a " -"warning if set. Support for this parameter will be removed in a future " -"Python release. See :issue:`27919` for details." +"The undocumented ``extra_path`` argument to the ``distutils.Distribution`` " +"constructor is now considered deprecated and will raise a warning if set. " +"Support for this parameter will be removed in a future Python release. See :" +"issue:`27919` for details." msgstr "" #: ../../whatsnew/3.6.rst:1995 @@ -2852,8 +2852,8 @@ msgstr "" #: ../../whatsnew/3.6.rst:2183 msgid "" -"The :mod:`imp` module now raises a :exc:`DeprecationWarning` instead of :exc:" -"`PendingDeprecationWarning`." +"The :mod:`!imp` module now raises a :exc:`DeprecationWarning` instead of :" +"exc:`PendingDeprecationWarning`." msgstr "" #: ../../whatsnew/3.6.rst:2186 @@ -2945,10 +2945,10 @@ msgstr "" #: ../../whatsnew/3.6.rst:2248 msgid "" -"In :class:`distutils.command.sdist.sdist`, the ``default_format`` attribute " -"has been removed and is no longer honored. Instead, the gzipped tarfile " -"format is the default on all platforms and no platform-specific selection is " -"made. In environments where distributions are built on Windows and zip " +"In ``distutils.command.sdist.sdist``, the ``default_format`` attribute has " +"been removed and is no longer honored. Instead, the gzipped tarfile format " +"is the default on all platforms and no platform-specific selection is made. " +"In environments where distributions are built on Windows and zip " "distributions are required, configure the project with a ``setup.cfg`` file " "containing the following:" msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index e811b6763c..47088adccd 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1740,8 +1740,8 @@ msgstr "" #: ../../whatsnew/3.7.rst:1243 msgid "" -":func:`re.split` now supports splitting on a pattern like ``r'\\b'``, ``'^" -"$'`` or ``(?=-)`` that matches an empty string. (Contributed by Serhiy " +":func:`re.split` now supports splitting on a pattern like ``r'\\b'``, " +"``'^$'`` or ``(?=-)`` that matches an empty string. (Contributed by Serhiy " "Storchaka in :issue:`25054`.)" msgstr "" @@ -2729,7 +2729,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1909 msgid "" -"The :mod:`distutils` ``upload`` command no longer tries to change CR end-of-" +"The ``distutils`` ``upload`` command no longer tries to change CR end-of-" "line characters to CRLF. This fixes a corruption issue with sdists that " "ended with a byte equivalent to CR. (Contributed by Bo Bayles in :issue:" "`32304`.)" @@ -2832,10 +2832,10 @@ msgstr "" #: ../../whatsnew/3.7.rst:2006 msgid "" -"Methods :meth:`MetaPathFinder.find_module() ` (replaced by :meth:`MetaPathFinder.find_spec() `) and :meth:`PathEntryFinder.find_loader() " -"` (replaced by :meth:" +"MetaPathFinder.find_spec>`) and :meth:`PathEntryFinder.find_loader() ` (replaced by :meth:" "`PathEntryFinder.find_spec() `) " "both deprecated in Python 3.4 now emit :exc:`DeprecationWarning`. " "(Contributed by Matthias Bussonnier in :issue:`29576`)" @@ -3078,7 +3078,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2184 msgid "" -"The unused :mod:`distutils` ``install_misc`` command has been removed. " +"The unused ``distutils`` ``install_misc`` command has been removed. " "(Contributed by Eric N. Vander Weele in :issue:`29218`.)" msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 8da146426c..3bd3871c1b 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-17 17:39+0800\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-" @@ -788,7 +788,7 @@ msgstr "" msgid "(Contributed by Yury Selivanov in :issue:`37028`.)" msgstr "" -#: ../../whatsnew/3.8.rst:651 ../../whatsnew/3.8.rst:1967 +#: ../../whatsnew/3.8.rst:651 ../../whatsnew/3.8.rst:1970 msgid "" "The exception :class:`asyncio.CancelledError` now inherits from :class:" "`BaseException` rather than :class:`Exception` and no longer inherits from :" @@ -1300,7 +1300,7 @@ msgid "" "Storchaka in :issue:`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1062 ../../whatsnew/3.8.rst:1962 +#: ../../whatsnew/3.8.rst:1062 ../../whatsnew/3.8.rst:1965 msgid "" ":func:`~os.path.expanduser` on Windows now prefers the :envvar:`USERPROFILE` " "environment variable and does not use :envvar:`HOME`, which is not normally " @@ -1340,14 +1340,17 @@ msgstr "" #: ../../whatsnew/3.8.rst:1089 msgid "" "Added :meth:`pathlib.Path.link_to()` which creates a hard link pointing to a " -"path. (Contributed by Joannah Nanjekye in :issue:`26978`)" +"path. (Contributed by Joannah Nanjekye in :issue:`26978`) Note that " +"``link_to`` was deprecated in 3.10 and removed in 3.12 in favor of a " +"``hardlink_to`` method added in 3.10 which matches the semantics of the " +"existing ``symlink_to`` method." msgstr "" -#: ../../whatsnew/3.8.rst:1095 +#: ../../whatsnew/3.8.rst:1098 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.8.rst:1097 +#: ../../whatsnew/3.8.rst:1100 msgid "" ":mod:`pickle` extensions subclassing the C-optimized :class:`~pickle." "Pickler` can now override the pickling logic of functions and classes by " @@ -1355,22 +1358,22 @@ msgid "" "(Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1104 +#: ../../whatsnew/3.8.rst:1107 msgid "plistlib" msgstr "plistlib" -#: ../../whatsnew/3.8.rst:1106 +#: ../../whatsnew/3.8.rst:1109 msgid "" "Added new :class:`plistlib.UID` and enabled support for reading and writing " "NSKeyedArchiver-encoded binary plists. (Contributed by Jon Janzen in :issue:" "`26707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1112 +#: ../../whatsnew/3.8.rst:1115 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.8.rst:1114 +#: ../../whatsnew/3.8.rst:1117 msgid "" "The :mod:`pprint` module added a *sort_dicts* parameter to several " "functions. By default, those functions continue to sort dictionaries before " @@ -1379,47 +1382,47 @@ msgid "" "for comparison to JSON inputs during debugging." msgstr "" -#: ../../whatsnew/3.8.rst:1120 +#: ../../whatsnew/3.8.rst:1123 msgid "" "In addition, there is a convenience new function, :func:`pprint.pp` that is " "like :func:`pprint.pprint` but with *sort_dicts* defaulting to ``False``::" msgstr "" -#: ../../whatsnew/3.8.rst:1134 +#: ../../whatsnew/3.8.rst:1137 msgid "(Contributed by Rémi Lapeyre in :issue:`30670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1138 +#: ../../whatsnew/3.8.rst:1141 msgid "py_compile" msgstr "py_compile" -#: ../../whatsnew/3.8.rst:1140 +#: ../../whatsnew/3.8.rst:1143 msgid "" ":func:`py_compile.compile` now supports silent mode. (Contributed by Joannah " "Nanjekye in :issue:`22640`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1145 +#: ../../whatsnew/3.8.rst:1148 msgid "shlex" msgstr "shlex" -#: ../../whatsnew/3.8.rst:1147 +#: ../../whatsnew/3.8.rst:1150 msgid "" "The new :func:`shlex.join` function acts as the inverse of :func:`shlex." "split`. (Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1152 +#: ../../whatsnew/3.8.rst:1155 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.8.rst:1154 +#: ../../whatsnew/3.8.rst:1157 msgid "" ":func:`shutil.copytree` now accepts a new ``dirs_exist_ok`` keyword " "argument. (Contributed by Josh Bronson in :issue:`20849`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1157 +#: ../../whatsnew/3.8.rst:1160 msgid "" ":func:`shutil.make_archive` now defaults to the modern pax (POSIX.1-2001) " "format for new archives to improve portability and standards conformance, " @@ -1427,18 +1430,18 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`30661`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1162 +#: ../../whatsnew/3.8.rst:1165 msgid "" ":func:`shutil.rmtree` on Windows now removes directory junctions without " "recursively removing their contents first. (Contributed by Steve Dower in :" "issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1168 +#: ../../whatsnew/3.8.rst:1171 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.8.rst:1170 +#: ../../whatsnew/3.8.rst:1173 msgid "" "Added :meth:`~socket.create_server()` and :meth:`~socket." "has_dualstack_ipv6()` convenience functions to automate the necessary tasks " @@ -1447,66 +1450,66 @@ msgid "" "Rodolà in :issue:`17561`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1175 +#: ../../whatsnew/3.8.rst:1178 msgid "" "The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and :" "func:`socket.if_indextoname()` functions have been implemented on Windows. " "(Contributed by Zackery Spytz in :issue:`37007`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1181 +#: ../../whatsnew/3.8.rst:1184 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.8.rst:1183 +#: ../../whatsnew/3.8.rst:1186 msgid "" "Added :attr:`~ssl.SSLContext.post_handshake_auth` to enable and :meth:`~ssl." "SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake " "authentication. (Contributed by Christian Heimes in :issue:`34670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1190 +#: ../../whatsnew/3.8.rst:1193 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.8.rst:1192 +#: ../../whatsnew/3.8.rst:1195 msgid "" "Added :func:`statistics.fmean` as a faster, floating point variant of :func:" "`statistics.mean()`. (Contributed by Raymond Hettinger and Steven D'Aprano " "in :issue:`35904`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1196 +#: ../../whatsnew/3.8.rst:1199 msgid "" "Added :func:`statistics.geometric_mean()` (Contributed by Raymond Hettinger " "in :issue:`27181`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1199 +#: ../../whatsnew/3.8.rst:1202 msgid "" "Added :func:`statistics.multimode` that returns a list of the most common " "values. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1202 +#: ../../whatsnew/3.8.rst:1205 msgid "" "Added :func:`statistics.quantiles` that divides data or a distribution in to " "equiprobable intervals (e.g. quartiles, deciles, or percentiles). " "(Contributed by Raymond Hettinger in :issue:`36546`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1206 +#: ../../whatsnew/3.8.rst:1209 msgid "" "Added :class:`statistics.NormalDist`, a tool for creating and manipulating " "normal distributions of a random variable. (Contributed by Raymond Hettinger " "in :issue:`36018`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1236 +#: ../../whatsnew/3.8.rst:1239 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.8.rst:1238 +#: ../../whatsnew/3.8.rst:1241 msgid "" "Add new :func:`sys.unraisablehook` function which can be overridden to " "control how \"unraisable exceptions\" are handled. It is called when an " @@ -1515,11 +1518,11 @@ msgid "" "(:func:`gc.collect`). (Contributed by Victor Stinner in :issue:`36829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1247 +#: ../../whatsnew/3.8.rst:1250 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.8.rst:1249 +#: ../../whatsnew/3.8.rst:1252 msgid "" "The :mod:`tarfile` module now defaults to the modern pax (POSIX.1-2001) " "format for new archives, instead of the previous GNU-specific one. This " @@ -1528,11 +1531,11 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`36268`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1257 +#: ../../whatsnew/3.8.rst:1260 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.8.rst:1259 +#: ../../whatsnew/3.8.rst:1262 msgid "" "Add a new :func:`threading.excepthook` function which handles uncaught :meth:" "`threading.Thread.run` exception. It can be overridden to control how " @@ -1540,7 +1543,7 @@ msgid "" "by Victor Stinner in :issue:`1230540`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1264 +#: ../../whatsnew/3.8.rst:1267 msgid "" "Add a new :func:`threading.get_native_id` function and a :data:`~threading." "Thread.native_id` attribute to the :class:`threading.Thread` class. These " @@ -1550,11 +1553,11 @@ msgid "" "by Jake Tesler in :issue:`36084`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1274 +#: ../../whatsnew/3.8.rst:1277 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.8.rst:1276 +#: ../../whatsnew/3.8.rst:1279 msgid "" "The :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token when " "provided with input that does not have a trailing new line. This behavior " @@ -1562,11 +1565,11 @@ msgid "" "Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1283 +#: ../../whatsnew/3.8.rst:1286 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.8.rst:1285 +#: ../../whatsnew/3.8.rst:1288 msgid "" "Added methods :meth:`~tkinter.Spinbox.selection_from`, :meth:`~tkinter." "Spinbox.selection_present`, :meth:`~tkinter.Spinbox.selection_range` and :" @@ -1574,38 +1577,38 @@ msgid "" "(Contributed by Juliette Monsel in :issue:`34829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1292 +#: ../../whatsnew/3.8.rst:1295 msgid "" "Added method :meth:`~tkinter.Canvas.moveto` in the :class:`tkinter.Canvas` " "class. (Contributed by Juliette Monsel in :issue:`23831`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1296 +#: ../../whatsnew/3.8.rst:1299 msgid "" "The :class:`tkinter.PhotoImage` class now has :meth:`~tkinter.PhotoImage." "transparency_get` and :meth:`~tkinter.PhotoImage.transparency_set` methods. " "(Contributed by Zackery Spytz in :issue:`25451`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1303 +#: ../../whatsnew/3.8.rst:1306 msgid "time" msgstr "time" -#: ../../whatsnew/3.8.rst:1305 +#: ../../whatsnew/3.8.rst:1308 msgid "" "Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. (Contributed " "by Joannah Nanjekye in :issue:`35702`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1310 +#: ../../whatsnew/3.8.rst:1313 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.8.rst:1312 +#: ../../whatsnew/3.8.rst:1315 msgid "The :mod:`typing` module incorporates several new features:" msgstr "" -#: ../../whatsnew/3.8.rst:1314 +#: ../../whatsnew/3.8.rst:1317 msgid "" "A dictionary type with per-key types. See :pep:`589` and :class:`typing." "TypedDict`. TypedDict uses only string keys. By default, every key is " @@ -1613,46 +1616,46 @@ msgid "" "optional::" msgstr "" -#: ../../whatsnew/3.8.rst:1324 +#: ../../whatsnew/3.8.rst:1327 msgid "" "Literal types. See :pep:`586` and :class:`typing.Literal`. Literal types " "indicate that a parameter or return value is constrained to one or more " "specific literal values::" msgstr "" -#: ../../whatsnew/3.8.rst:1331 +#: ../../whatsnew/3.8.rst:1334 msgid "" "\"Final\" variables, functions, methods and classes. See :pep:`591`, :class:" "`typing.Final` and :func:`typing.final`. The final qualifier instructs a " "static type checker to restrict subclassing, overriding, or reassignment::" msgstr "" -#: ../../whatsnew/3.8.rst:1338 +#: ../../whatsnew/3.8.rst:1341 msgid "" "Protocol definitions. See :pep:`544`, :class:`typing.Protocol` and :func:" "`typing.runtime_checkable`. Simple ABCs like :class:`typing.SupportsInt` " "are now ``Protocol`` subclasses." msgstr "" -#: ../../whatsnew/3.8.rst:1342 +#: ../../whatsnew/3.8.rst:1345 msgid "New protocol class :class:`typing.SupportsIndex`." msgstr "" -#: ../../whatsnew/3.8.rst:1344 +#: ../../whatsnew/3.8.rst:1347 msgid "New functions :func:`typing.get_origin` and :func:`typing.get_args`." msgstr "" -#: ../../whatsnew/3.8.rst:1348 +#: ../../whatsnew/3.8.rst:1351 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.8.rst:1350 +#: ../../whatsnew/3.8.rst:1353 msgid "" "The :mod:`unicodedata` module has been upgraded to use the `Unicode 12.1.0 " "`_ release." msgstr "" -#: ../../whatsnew/3.8.rst:1353 +#: ../../whatsnew/3.8.rst:1356 msgid "" "New function :func:`~unicodedata.is_normalized` can be used to verify a " "string is in a specific normal form, often much faster than by actually " @@ -1660,11 +1663,11 @@ msgid "" "Greg Price in :issue:`32285` and :issue:`37966`)." msgstr "" -#: ../../whatsnew/3.8.rst:1360 +#: ../../whatsnew/3.8.rst:1363 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.8.rst:1362 +#: ../../whatsnew/3.8.rst:1365 msgid "" "Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version " "of :class:`~unittest.mock.Mock`. Appropriate new assert functions for " @@ -1672,7 +1675,7 @@ msgid "" "`26467`)." msgstr "" -#: ../../whatsnew/3.8.rst:1367 +#: ../../whatsnew/3.8.rst:1370 msgid "" "Added :func:`~unittest.addModuleCleanup()` and :meth:`~unittest.TestCase." "addClassCleanup()` to unittest to support cleanups for :func:`~unittest." @@ -1680,60 +1683,60 @@ msgid "" "Lisa Roach in :issue:`24412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1373 +#: ../../whatsnew/3.8.rst:1376 msgid "" "Several mock assert functions now also print a list of actual calls upon " "failure. (Contributed by Petter Strandmark in :issue:`35047`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1376 +#: ../../whatsnew/3.8.rst:1379 msgid "" ":mod:`unittest` module gained support for coroutines to be used as test " "cases with :class:`unittest.IsolatedAsyncioTestCase`. (Contributed by Andrew " "Svetlov in :issue:`32972`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1380 +#: ../../whatsnew/3.8.rst:1383 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.8.rst:1403 +#: ../../whatsnew/3.8.rst:1406 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.8.rst:1405 +#: ../../whatsnew/3.8.rst:1408 msgid "" ":mod:`venv` now includes an ``Activate.ps1`` script on all platforms for " "activating virtual environments under PowerShell Core 6.1. (Contributed by " "Brett Cannon in :issue:`32718`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1411 +#: ../../whatsnew/3.8.rst:1414 msgid "weakref" msgstr "weakref" -#: ../../whatsnew/3.8.rst:1413 +#: ../../whatsnew/3.8.rst:1416 msgid "" "The proxy objects returned by :func:`weakref.proxy` now support the matrix " "multiplication operators ``@`` and ``@=`` in addition to the other numeric " "operators. (Contributed by Mark Dickinson in :issue:`36669`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1419 +#: ../../whatsnew/3.8.rst:1422 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.8.rst:1421 +#: ../../whatsnew/3.8.rst:1424 msgid "" "As mitigation against DTD and external entity retrieval, the :mod:`xml.dom." "minidom` and :mod:`xml.sax` modules no longer process external entities by " "default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1426 +#: ../../whatsnew/3.8.rst:1429 msgid "" "The ``.find*()`` methods in the :mod:`xml.etree.ElementTree` module support " "wildcard searches like ``{*}tag`` which ignores the namespace and " @@ -1741,14 +1744,14 @@ msgid "" "by Stefan Behnel in :issue:`28238`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1431 +#: ../../whatsnew/3.8.rst:1434 msgid "" "The :mod:`xml.etree.ElementTree` module provides a new function :func:`–xml." "etree.ElementTree.canonicalize()` that implements C14N 2.0. (Contributed by " "Stefan Behnel in :issue:`13611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1435 +#: ../../whatsnew/3.8.rst:1438 msgid "" "The target object of :class:`xml.etree.ElementTree.XMLParser` can receive " "namespace declaration events through the new callback methods ``start_ns()`` " @@ -1758,11 +1761,11 @@ msgid "" "by Stefan Behnel in :issue:`36676` and :issue:`36673`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1445 +#: ../../whatsnew/3.8.rst:1448 msgid "xmlrpc" msgstr "xmlrpc" -#: ../../whatsnew/3.8.rst:1447 +#: ../../whatsnew/3.8.rst:1450 msgid "" ":class:`xmlrpc.client.ServerProxy` now supports an optional *headers* " "keyword argument for a sequence of HTTP headers to be sent with each " @@ -1771,36 +1774,36 @@ msgid "" "Cédric Krier in :issue:`35153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1455 +#: ../../whatsnew/3.8.rst:1458 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.8.rst:1457 +#: ../../whatsnew/3.8.rst:1460 msgid "" "The :mod:`subprocess` module can now use the :func:`os.posix_spawn` function " "in some cases for better performance. Currently, it is only used on macOS " "and Linux (using glibc 2.24 or newer) if all these conditions are met:" msgstr "" -#: ../../whatsnew/3.8.rst:1461 +#: ../../whatsnew/3.8.rst:1464 msgid "*close_fds* is false;" msgstr "" -#: ../../whatsnew/3.8.rst:1462 +#: ../../whatsnew/3.8.rst:1465 msgid "" "*preexec_fn*, *pass_fds*, *cwd* and *start_new_session* parameters are not " "set;" msgstr "" -#: ../../whatsnew/3.8.rst:1464 +#: ../../whatsnew/3.8.rst:1467 msgid "the *executable* path contains a directory." msgstr "" -#: ../../whatsnew/3.8.rst:1466 +#: ../../whatsnew/3.8.rst:1469 msgid "(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1468 +#: ../../whatsnew/3.8.rst:1471 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-" @@ -1816,7 +1819,7 @@ msgid "" "Giampaolo Rodolà in :issue:`33671`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1484 +#: ../../whatsnew/3.8.rst:1487 msgid "" ":func:`shutil.copytree` uses :func:`os.scandir` function and all copy " "functions depending from it use cached :func:`os.stat` values. The speedup " @@ -1826,27 +1829,27 @@ msgid "" "on network filesystems. (Contributed by Giampaolo Rodolà in :issue:`33695`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1491 +#: ../../whatsnew/3.8.rst:1494 msgid "" "The default protocol in the :mod:`pickle` module is now Protocol 4, first " "introduced in Python 3.4. It offers better performance and smaller size " "compared to Protocol 3 available since Python 3.0." msgstr "" -#: ../../whatsnew/3.8.rst:1495 +#: ../../whatsnew/3.8.rst:1498 msgid "" "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 "" -#: ../../whatsnew/3.8.rst:1499 +#: ../../whatsnew/3.8.rst:1502 msgid "" ":class:`uuid.UUID` now uses ``__slots__`` to reduce its memory footprint. " "(Contributed by Wouter Bolsterlee and Tal Einat in :issue:`30977`)" msgstr "" -#: ../../whatsnew/3.8.rst:1502 +#: ../../whatsnew/3.8.rst:1505 msgid "" "Improved performance of :func:`operator.itemgetter` by 33%. Optimized " "argument handling and added a fast path for the common case of a single non-" @@ -1854,7 +1857,7 @@ msgid "" "standard library). (Contributed by Raymond Hettinger in :issue:`35664`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1508 +#: ../../whatsnew/3.8.rst:1511 msgid "" "Sped-up field lookups in :func:`collections.namedtuple`. They are now more " "than two times faster, making them the fastest form of instance variable " @@ -1862,7 +1865,7 @@ msgid "" "Jevnik, Serhiy Storchaka in :issue:`32492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1513 +#: ../../whatsnew/3.8.rst:1516 msgid "" "The :class:`list` constructor does not overallocate the internal item buffer " "if the input iterable has a known length (the input implements ``__len__``). " @@ -1870,7 +1873,7 @@ msgid "" "Hettinger and Pablo Galindo in :issue:`33234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1518 +#: ../../whatsnew/3.8.rst:1521 msgid "" "Doubled the speed of class variable writes. When a non-dunder attribute was " "updated, there was an unnecessary call to update slots. (Contributed by " @@ -1878,7 +1881,7 @@ msgid "" "and Serhiy Storchaka in :issue:`36012`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1523 +#: ../../whatsnew/3.8.rst:1526 msgid "" "Reduced an overhead of converting arguments passed to many builtin functions " "and methods. This sped up calling some simple builtin functions and methods " @@ -1886,18 +1889,18 @@ msgid "" "`35582` and :issue:`36127`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1528 +#: ../../whatsnew/3.8.rst:1531 msgid "" "``LOAD_GLOBAL`` instruction now uses new \"per opcode cache\" mechanism. It " "is about 40% faster now. (Contributed by Yury Selivanov and Inada Naoki in :" "issue:`26219`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1534 +#: ../../whatsnew/3.8.rst:1537 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.8.rst:1536 +#: ../../whatsnew/3.8.rst:1539 msgid "" "Default :data:`sys.abiflags` became an empty string: the ``m`` flag for " "pymalloc became useless (builds with and without pymalloc are ABI " @@ -1905,22 +1908,22 @@ msgid "" "issue:`36707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1540 +#: ../../whatsnew/3.8.rst:1543 msgid "Example of changes:" msgstr "" -#: ../../whatsnew/3.8.rst:1542 +#: ../../whatsnew/3.8.rst:1545 msgid "" "Only ``python3.8`` program is installed, ``python3.8m`` program is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1543 +#: ../../whatsnew/3.8.rst:1546 msgid "" "Only ``python3.8-config`` script is installed, ``python3.8m-config`` script " "is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1545 +#: ../../whatsnew/3.8.rst:1548 msgid "" "The ``m`` flag has been removed from the suffix of dynamic library " "filenames: extension modules in the standard library as well as those " @@ -1929,23 +1932,23 @@ msgid "" "linux-gnu.so`` became ``.cpython-38-x86_64-linux-gnu.so`` in Python 3.8." msgstr "" -#: ../../whatsnew/3.8.rst:1552 +#: ../../whatsnew/3.8.rst:1555 msgid "" "The header files have been reorganized to better separate the different " "kinds of APIs:" msgstr "" -#: ../../whatsnew/3.8.rst:1555 +#: ../../whatsnew/3.8.rst:1558 msgid "``Include/*.h`` should be the portable public stable C API." msgstr "" -#: ../../whatsnew/3.8.rst:1556 +#: ../../whatsnew/3.8.rst:1559 msgid "" "``Include/cpython/*.h`` should be the unstable C API specific to CPython; " "public API, with some private API prefixed by ``_Py`` or ``_PY``." msgstr "" -#: ../../whatsnew/3.8.rst:1558 +#: ../../whatsnew/3.8.rst:1561 msgid "" "``Include/internal/*.h`` is the private internal C API very specific to " "CPython. This API comes with no backward compatibility warranty and should " @@ -1954,42 +1957,42 @@ msgid "" "calling functions. This API is now installed by ``make install``." msgstr "" -#: ../../whatsnew/3.8.rst:1564 +#: ../../whatsnew/3.8.rst:1567 msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" -#: ../../whatsnew/3.8.rst:1567 +#: ../../whatsnew/3.8.rst:1570 msgid "" "Some macros have been converted to static inline functions: parameter types " "and return type are well defined, they don't have issues specific to macros, " "variables have a local scopes. Examples:" msgstr "" -#: ../../whatsnew/3.8.rst:1571 +#: ../../whatsnew/3.8.rst:1574 msgid ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" msgstr ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" -#: ../../whatsnew/3.8.rst:1572 +#: ../../whatsnew/3.8.rst:1575 msgid ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" msgstr ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" -#: ../../whatsnew/3.8.rst:1573 +#: ../../whatsnew/3.8.rst:1576 msgid ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" msgstr ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" -#: ../../whatsnew/3.8.rst:1574 +#: ../../whatsnew/3.8.rst:1577 msgid "" "Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" "`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" msgstr "" -#: ../../whatsnew/3.8.rst:1577 +#: ../../whatsnew/3.8.rst:1580 msgid "(Contributed by Victor Stinner in :issue:`35059`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1579 +#: ../../whatsnew/3.8.rst:1582 msgid "" "The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` functions have " "been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were " @@ -1997,14 +2000,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1584 +#: ../../whatsnew/3.8.rst:1587 msgid "" "The result of :c:func:`PyExceptionClass_Name` is now of type ``const char " "*`` rather of ``char *``. (Contributed by Serhiy Storchaka in :issue:" "`33818`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1588 +#: ../../whatsnew/3.8.rst:1591 msgid "" "The duality of ``Modules/Setup.dist`` and ``Modules/Setup`` has been " "removed. Previously, when updating the CPython source tree, one had to " @@ -2015,7 +2018,7 @@ msgid "" "the file could produce build failures." msgstr "" -#: ../../whatsnew/3.8.rst:1596 +#: ../../whatsnew/3.8.rst:1599 msgid "" "Now the build system always reads from ``Modules/Setup`` inside the source " "tree. People who want to customize that file are encouraged to maintain " @@ -2023,11 +2026,11 @@ msgid "" "for any other change to the source tree." msgstr "" -#: ../../whatsnew/3.8.rst:1601 +#: ../../whatsnew/3.8.rst:1604 msgid "(Contributed by Antoine Pitrou in :issue:`32430`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1603 +#: ../../whatsnew/3.8.rst:1606 msgid "" "Functions that convert Python number to C integer like :c:func:" "`PyLong_AsLong` and argument parsing functions like :c:func:" @@ -2043,7 +2046,7 @@ msgid "" "`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1617 +#: ../../whatsnew/3.8.rst:1620 msgid "" "Heap-allocated type objects will now increase their reference count in :c:" "func:`PyObject_Init` (and its parallel macro ``PyObject_INIT``) instead of " @@ -2052,7 +2055,7 @@ msgid "" "issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1623 +#: ../../whatsnew/3.8.rst:1626 msgid "" "The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to create code " "objects like :c:func:`PyCode_New`, but with an extra *posonlyargcount* " @@ -2060,25 +2063,25 @@ msgid "" "(Contributed by Pablo Galindo in :issue:`37221`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1628 +#: ../../whatsnew/3.8.rst:1631 msgid "" ":c:func:`Py_SetPath` now sets :data:`sys.executable` to the program full " "path (:c:func:`Py_GetProgramFullPath`) rather than to the program name (:c:" "func:`Py_GetProgramName`). (Contributed by Victor Stinner in :issue:`38234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1635 +#: ../../whatsnew/3.8.rst:1638 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.8.rst:1637 +#: ../../whatsnew/3.8.rst:1640 msgid "" "The distutils ``bdist_wininst`` command is now deprecated, use " "``bdist_wheel`` (wheel packages) instead. (Contributed by Victor Stinner in :" "issue:`37481`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1641 +#: ../../whatsnew/3.8.rst:1644 msgid "" "Deprecated methods ``getchildren()`` and ``getiterator()`` in the :mod:`~xml." "etree.ElementTree` module now emit a :exc:`DeprecationWarning` instead of :" @@ -2086,7 +2089,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1647 +#: ../../whatsnew/3.8.rst:1650 msgid "" "Passing an object that is not an instance of :class:`concurrent.futures." "ThreadPoolExecutor` to :meth:`loop.set_default_executor() `. (Contributed by Serhiy Storchaka in :issue:`36492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1748 +#: ../../whatsnew/3.8.rst:1751 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.8.rst:1750 +#: ../../whatsnew/3.8.rst:1753 msgid "The following features and APIs have been removed from Python 3.8:" msgstr "" -#: ../../whatsnew/3.8.rst:1752 +#: ../../whatsnew/3.8.rst:1755 msgid "" "Starting with Python 3.3, importing ABCs from :mod:`collections` was " "deprecated, and importing should be done from :mod:`collections.abc`. Being " @@ -2257,20 +2260,20 @@ msgid "" "delayed to 3.9. (See :issue:`36952`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1757 +#: ../../whatsnew/3.8.rst:1760 msgid "" "The :mod:`macpath` module, deprecated in Python 3.7, has been removed. " "(Contributed by Victor Stinner in :issue:`35471`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1760 ../../whatsnew/3.8.rst:1879 +#: ../../whatsnew/3.8.rst:1763 ../../whatsnew/3.8.rst:1882 msgid "" "The function :func:`platform.popen` has been removed, after having been " "deprecated since Python 3.3: use :func:`os.popen` instead. (Contributed by " "Victor Stinner in :issue:`35345`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1764 +#: ../../whatsnew/3.8.rst:1767 msgid "" "The function :func:`time.clock` has been removed, after having been " "deprecated since Python 3.3: use :func:`time.perf_counter` or :func:`time." @@ -2278,27 +2281,27 @@ msgid "" "behavior. (Contributed by Matthias Bussonnier in :issue:`36895`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1770 +#: ../../whatsnew/3.8.rst:1773 msgid "" "The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv`` to " "help eliminate confusion as to what Python interpreter the ``pyvenv`` script " "is tied to. (Contributed by Brett Cannon in :issue:`25427`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1774 +#: ../../whatsnew/3.8.rst:1777 msgid "" "``parse_qs``, ``parse_qsl``, and ``escape`` are removed from the :mod:`cgi` " "module. They are deprecated in Python 3.2 or older. They should be imported " "from the ``urllib.parse`` and ``html`` modules instead." msgstr "" -#: ../../whatsnew/3.8.rst:1778 +#: ../../whatsnew/3.8.rst:1781 msgid "" "``filemode`` function is removed from the :mod:`tarfile` module. It is not " "documented and deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.8.rst:1781 +#: ../../whatsnew/3.8.rst:1784 msgid "" "The :class:`~xml.etree.ElementTree.XMLParser` constructor no longer accepts " "the *html* argument. It never had an effect and was deprecated in Python " @@ -2306,53 +2309,53 @@ msgid "" "only_parameter>`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1786 +#: ../../whatsnew/3.8.rst:1789 msgid "" "Removed the ``doctype()`` method of :class:`~xml.etree.ElementTree." "XMLParser`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1789 +#: ../../whatsnew/3.8.rst:1792 msgid "" "\"unicode_internal\" codec is removed. (Contributed by Inada Naoki in :issue:" "`36297`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1792 +#: ../../whatsnew/3.8.rst:1795 msgid "" "The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3` module are not " "exposed to the user. (Contributed by Aviv Palivoda in :issue:`30262`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1796 +#: ../../whatsnew/3.8.rst:1799 msgid "" "The ``bufsize`` keyword argument of :func:`fileinput.input` and :func:" "`fileinput.FileInput` which was ignored and deprecated since Python 3.6 has " "been removed. :issue:`36952` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1800 +#: ../../whatsnew/3.8.rst:1803 msgid "" "The functions :func:`sys.set_coroutine_wrapper` and :func:`sys." "get_coroutine_wrapper` deprecated in Python 3.7 have been removed; :issue:" "`36933` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1806 +#: ../../whatsnew/3.8.rst:1809 msgid "Porting to Python 3.8" msgstr "" -#: ../../whatsnew/3.8.rst:1808 +#: ../../whatsnew/3.8.rst:1811 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.8.rst:1813 +#: ../../whatsnew/3.8.rst:1816 msgid "Changes in Python behavior" msgstr "" -#: ../../whatsnew/3.8.rst:1815 +#: ../../whatsnew/3.8.rst:1818 msgid "" "Yield expressions (both ``yield`` and ``yield from`` clauses) are now " "disallowed in comprehensions and generator expressions (aside from the " @@ -2360,7 +2363,7 @@ msgid "" "Serhiy Storchaka in :issue:`10544`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1820 +#: ../../whatsnew/3.8.rst:1823 msgid "" "The compiler now produces a :exc:`SyntaxWarning` when identity checks " "(``is`` and ``is not``) are used with certain types of literals (e.g. " @@ -2370,7 +2373,7 @@ msgid "" "issue:`34850`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1827 +#: ../../whatsnew/3.8.rst:1830 msgid "" "The CPython interpreter can swallow exceptions in some circumstances. In " "Python 3.8 this happens in fewer cases. In particular, exceptions raised " @@ -2378,7 +2381,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`35459`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1832 +#: ../../whatsnew/3.8.rst:1835 msgid "" "Removed ``__str__`` implementations from builtin types :class:`bool`, :class:" "`int`, :class:`float`, :class:`complex` and few classes from the standard " @@ -2388,7 +2391,7 @@ msgid "" "issue:`36793`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1839 +#: ../../whatsnew/3.8.rst:1842 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " @@ -2397,7 +2400,7 @@ msgid "" "`36588`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1845 +#: ../../whatsnew/3.8.rst:1848 msgid "" ":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " @@ -2408,11 +2411,11 @@ msgid "" "`36475`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1855 +#: ../../whatsnew/3.8.rst:1858 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.8.rst:1857 +#: ../../whatsnew/3.8.rst:1860 msgid "" "The :func:`os.getcwdb` function now uses the UTF-8 encoding on Windows, " "rather than the ANSI code page: see :pep:`529` for the rationale. The " @@ -2420,7 +2423,7 @@ msgid "" "in :issue:`37412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1862 +#: ../../whatsnew/3.8.rst:1865 msgid "" ":class:`subprocess.Popen` can now use :func:`os.posix_spawn` in some cases " "for better performance. On Windows Subsystem for Linux and QEMU User " @@ -2430,7 +2433,7 @@ msgid "" "by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1869 +#: ../../whatsnew/3.8.rst:1872 msgid "" "The *preexec_fn* argument of * :class:`subprocess.Popen` is no longer " "compatible with subinterpreters. The use of the parameter in a " @@ -2438,20 +2441,20 @@ msgid "" "issue:`34651`, modified by Christian Heimes in :issue:`37951`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1875 +#: ../../whatsnew/3.8.rst:1878 msgid "" "The :meth:`imap.IMAP4.logout` method no longer silently ignores arbitrary " "exceptions. (Contributed by Victor Stinner in :issue:`36348`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1883 +#: ../../whatsnew/3.8.rst:1886 msgid "" "The :func:`statistics.mode` function no longer raises an exception when " "given multimodal data. Instead, it returns the first mode encountered in " "the input data. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1888 +#: ../../whatsnew/3.8.rst:1891 msgid "" "The :meth:`~tkinter.ttk.Treeview.selection` method of the :class:`tkinter." "ttk.Treeview` class no longer takes arguments. Using it with arguments for " @@ -2460,7 +2463,7 @@ msgid "" "selection. (Contributed by Serhiy Storchaka in :issue:`31508`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1894 +#: ../../whatsnew/3.8.rst:1897 msgid "" "The :meth:`writexml`, :meth:`toxml` and :meth:`toprettyxml` methods of :mod:" "`xml.dom.minidom`, and the :meth:`write` method of :mod:`xml.etree`, now " @@ -2468,14 +2471,14 @@ msgid "" "Rojas and Raymond Hettinger in :issue:`34160`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1899 +#: ../../whatsnew/3.8.rst:1902 msgid "" "A :mod:`dbm.dumb` database opened with flags ``'r'`` is now read-only. :func:" "`dbm.dumb.open` with flags ``'r'`` and ``'w'`` no longer creates a database " "if it does not exist. (Contributed by Serhiy Storchaka in :issue:`32749`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1904 +#: ../../whatsnew/3.8.rst:1907 msgid "" "The ``doctype()`` method defined in a subclass of :class:`~xml.etree." "ElementTree.XMLParser` will no longer be called and will emit a :exc:" @@ -2485,7 +2488,7 @@ msgid "" "in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1911 +#: ../../whatsnew/3.8.rst:1914 msgid "" "A :exc:`RuntimeError` is now raised when the custom metaclass doesn't " "provide the ``__classcell__`` entry in the namespace passed to ``type." @@ -2493,13 +2496,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`23722`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1916 +#: ../../whatsnew/3.8.rst:1919 msgid "" "The :class:`cProfile.Profile` class can now be used as a context manager. " "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1919 +#: ../../whatsnew/3.8.rst:1922 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-" @@ -2507,19 +2510,19 @@ msgid "" "operations` section)." msgstr "" -#: ../../whatsnew/3.8.rst:1924 +#: ../../whatsnew/3.8.rst:1927 msgid "" ":func:`shutil.copyfile` default buffer size on Windows was changed from 16 " "KiB to 1 MiB." msgstr "" -#: ../../whatsnew/3.8.rst:1927 +#: ../../whatsnew/3.8.rst:1930 msgid "" "The ``PyGC_Head`` struct has changed completely. All code that touched the " "struct member should be rewritten. (See :issue:`33597`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1930 +#: ../../whatsnew/3.8.rst:1933 msgid "" "The :c:type:`PyInterpreterState` struct has been moved into the \"internal\" " "header files (specifically Include/internal/pycore_pystate.h). An opaque " @@ -2531,7 +2534,7 @@ msgid "" "functions to the public API). (See :issue:`35886`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1940 +#: ../../whatsnew/3.8.rst:1943 msgid "" "The :meth:`mmap.flush() ` method now returns ``None`` on " "success and raises an exception on error under all platforms. Previously, " @@ -2541,13 +2544,13 @@ msgid "" "(Contributed by Berker Peksag in :issue:`2122`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1947 +#: ../../whatsnew/3.8.rst:1950 msgid "" ":mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external " "entities by default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1951 +#: ../../whatsnew/3.8.rst:1954 msgid "" "Deleting a key from a read-only :mod:`dbm` database (:mod:`dbm.dumb`, :mod:" "`dbm.gnu` or :mod:`dbm.ndbm`) raises :attr:`error` (:exc:`dbm.dumb.error`, :" @@ -2555,7 +2558,7 @@ msgid "" "(Contributed by Xiang Zhang in :issue:`33106`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1956 +#: ../../whatsnew/3.8.rst:1959 msgid "" "Simplified AST for literals. All constants will be represented as :class:" "`ast.Constant` instances. Instantiating old classes ``Num``, ``Str``, " @@ -2563,7 +2566,7 @@ msgid "" "``Constant``. (Contributed by Serhiy Storchaka in :issue:`32892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1972 +#: ../../whatsnew/3.8.rst:1975 msgid "" "The function :func:`asyncio.wait_for` now correctly waits for cancellation " "when using an instance of :class:`asyncio.Task`. Previously, upon reaching " @@ -2571,18 +2574,18 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1977 +#: ../../whatsnew/3.8.rst:1980 msgid "" "The function :func:`asyncio.BaseTransport.get_extra_info` now returns a safe " "to use socket object when 'socket' is passed to the *name* parameter. " "(Contributed by Yury Selivanov in :issue:`37027`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1981 +#: ../../whatsnew/3.8.rst:1984 msgid ":class:`asyncio.BufferedProtocol` has graduated to the stable API." msgstr "" -#: ../../whatsnew/3.8.rst:1985 +#: ../../whatsnew/3.8.rst:1988 msgid "" "DLL dependencies for extension modules and DLLs loaded with :mod:`ctypes` on " "Windows are now resolved more securely. Only the system paths, the directory " @@ -2597,14 +2600,14 @@ msgid "" "verified by the installer). (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1998 +#: ../../whatsnew/3.8.rst:2001 msgid "" "The header files and functions related to pgen have been removed after its " "replacement by a pure Python implementation. (Contributed by Pablo Galindo " "in :issue:`36623`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2002 +#: ../../whatsnew/3.8.rst:2005 msgid "" ":class:`types.CodeType` has a new parameter in the second position of the " "constructor (*posonlyargcount*) to support positional-only arguments defined " @@ -2614,17 +2617,17 @@ msgid "" "code future-proof." msgstr "" -#: ../../whatsnew/3.8.rst:2009 +#: ../../whatsnew/3.8.rst:2012 msgid "" "The parameter ``digestmod`` for :func:`hmac.new` no longer uses the MD5 " "digest by default." msgstr "" -#: ../../whatsnew/3.8.rst:2013 +#: ../../whatsnew/3.8.rst:2016 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.8.rst:2015 +#: ../../whatsnew/3.8.rst:2018 msgid "" "The :c:struct:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " @@ -2632,14 +2635,14 @@ msgid "" "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2021 +#: ../../whatsnew/3.8.rst:2024 msgid "" "The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " "It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2026 +#: ../../whatsnew/3.8.rst:2029 msgid "" "On Unix, C extensions are no longer linked to libpython except on Android " "and Cygwin. When Python is embedded, ``libpython`` must not be loaded with " @@ -2650,7 +2653,7 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2034 +#: ../../whatsnew/3.8.rst:2037 msgid "" "Use of ``#`` variants of formats in parsing or building value (e.g. :c:func:" "`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:" @@ -2659,7 +2662,7 @@ msgid "" "`arg-parsing` for detail. (Contributed by Inada Naoki in :issue:`36381`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2040 +#: ../../whatsnew/3.8.rst:2043 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec`) hold a reference to their type object. Increasing the " @@ -2669,11 +2672,11 @@ msgid "" "through :c:func:`PyType_FromSpec` behave like other classes in managed code." msgstr "" -#: ../../whatsnew/3.8.rst:2048 +#: ../../whatsnew/3.8.rst:2051 msgid ":ref:`Statically allocated types ` are not affected." msgstr "" -#: ../../whatsnew/3.8.rst:2050 +#: ../../whatsnew/3.8.rst:2053 msgid "" "For the vast majority of cases, there should be no side effect. However, " "types that manually increase the reference count after allocating an " @@ -2682,12 +2685,12 @@ msgid "" "instance deallocation." msgstr "" -#: ../../whatsnew/3.8.rst:2056 +#: ../../whatsnew/3.8.rst:2059 msgid "" "To correctly port these types into 3.8, please apply the following changes:" msgstr "" -#: ../../whatsnew/3.8.rst:2059 +#: ../../whatsnew/3.8.rst:2062 msgid "" "Remove :c:macro:`Py_INCREF` on the type object after allocating an instance " "- if any. This may happen after calling :c:func:`PyObject_New`, :c:func:" @@ -2696,32 +2699,32 @@ msgid "" "`PyObject_INIT`." msgstr "" -#: ../../whatsnew/3.8.rst:2066 ../../whatsnew/3.8.rst:2085 -#: ../../whatsnew/3.8.rst:2104 +#: ../../whatsnew/3.8.rst:2069 ../../whatsnew/3.8.rst:2088 +#: ../../whatsnew/3.8.rst:2107 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.8.rst:2082 +#: ../../whatsnew/3.8.rst:2085 msgid "" "Ensure that all custom ``tp_dealloc`` functions of heap-allocated types " "decrease the type's reference count." msgstr "" -#: ../../whatsnew/3.8.rst:2099 +#: ../../whatsnew/3.8.rst:2102 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2101 +#: ../../whatsnew/3.8.rst:2104 msgid "" "The :c:macro:`Py_DEPRECATED()` macro has been implemented for MSVC. The " "macro now must be placed before the symbol name." msgstr "" -#: ../../whatsnew/3.8.rst:2110 +#: ../../whatsnew/3.8.rst:2113 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2112 +#: ../../whatsnew/3.8.rst:2115 msgid "" "The interpreter does not pretend to support binary compatibility of " "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " @@ -2731,17 +2734,17 @@ msgid "" "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../whatsnew/3.8.rst:2119 +#: ../../whatsnew/3.8.rst:2122 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2121 +#: ../../whatsnew/3.8.rst:2124 msgid "" "The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " "accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." msgstr "" -#: ../../whatsnew/3.8.rst:2124 +#: ../../whatsnew/3.8.rst:2127 msgid "" "The :file:`libpython38.a` file to allow MinGW tools to link directly " "against :file:`python38.dll` is no longer included in the regular Windows " @@ -2750,7 +2753,7 @@ msgid "" "package:" msgstr "" -#: ../../whatsnew/3.8.rst:2134 +#: ../../whatsnew/3.8.rst:2137 msgid "" "The location of an installed :file:`pythonXY.dll` will depend on the " "installation options and the version and language of Windows. See :ref:" @@ -2759,15 +2762,15 @@ msgid "" "the :file:`libs` directory under your Python installation." msgstr "" -#: ../../whatsnew/3.8.rst:2140 +#: ../../whatsnew/3.8.rst:2143 msgid "(Contributed by Steve Dower in :issue:`37351`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2144 +#: ../../whatsnew/3.8.rst:2147 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.8.rst:2146 +#: ../../whatsnew/3.8.rst:2149 msgid "" "The interpreter loop has been simplified by moving the logic of unrolling " "the stack of blocks into the compiler. The compiler emits now explicit " @@ -2775,7 +2778,7 @@ msgid "" "code for :keyword:`break`, :keyword:`continue` and :keyword:`return`." msgstr "" -#: ../../whatsnew/3.8.rst:2152 +#: ../../whatsnew/3.8.rst:2155 msgid "" "Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" "`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" @@ -2784,20 +2787,20 @@ msgid "" "`WITH_CLEANUP_START`." msgstr "" -#: ../../whatsnew/3.8.rst:2158 +#: ../../whatsnew/3.8.rst:2161 msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2161 +#: ../../whatsnew/3.8.rst:2164 msgid "" "Added new opcode :opcode:`END_ASYNC_FOR` for handling exceptions raised when " "awaiting a next item in an :keyword:`async for` loop. (Contributed by Serhiy " "Storchaka in :issue:`33041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2165 +#: ../../whatsnew/3.8.rst:2168 msgid "" "The :opcode:`MAP_ADD` now expects the value as the first element in the " "stack and the key as the second element. This change was made so the key is " @@ -2805,22 +2808,22 @@ msgid "" "by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2172 +#: ../../whatsnew/3.8.rst:2175 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.8.rst:2174 +#: ../../whatsnew/3.8.rst:2177 msgid "" "Added a benchmark script for timing various ways to access variables: " "``Tools/scripts/var_access_benchmark.py``. (Contributed by Raymond Hettinger " "in :issue:`35884`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2178 +#: ../../whatsnew/3.8.rst:2181 msgid "Here's a summary of performance improvements since Python 3.3:" msgstr "" -#: ../../whatsnew/3.8.rst:2225 +#: ../../whatsnew/3.8.rst:2228 msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " "\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,7 +36,7 @@ msgstr "" "的重大改變的地方。對於希望在新版本釋出時立即了解版本差異的使用者們來說,這些" "說明被歸類為「必讀」的等級。" -#: ../../whatsnew/index.rst:35 +#: ../../whatsnew/index.rst:36 msgid "" "The \"Changelog\" is an HTML version of the `file built `_ from the contents of the :source:`Misc/NEWS.d` directory " From 6444b0c6d92ff730c6c08b715af5e335b12ba01c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 18:00:20 +0800 Subject: [PATCH 002/105] chore: delete docs that have been removed in 3.12 --- distutils/_setuptools_disclaimer.po | 28 - distutils/apiref.po | 2499 --------------------------- distutils/builtdist.po | 709 -------- distutils/commandref.po | 152 -- distutils/configfile.po | 168 -- distutils/examples.po | 289 ---- distutils/extending.po | 129 -- distutils/index.po | 80 - distutils/introduction.po | 327 ---- distutils/packageindex.po | 39 - distutils/setupscript.po | 1045 ----------- distutils/sourcedist.po | 439 ----- distutils/uploading.po | 33 - library/asynchat.po | 248 --- library/asyncore.po | 380 ---- library/distutils.po | 96 - library/imp.po | 477 ----- library/smtpd.po | 454 ----- 18 files changed, 7592 deletions(-) delete mode 100644 distutils/_setuptools_disclaimer.po delete mode 100644 distutils/apiref.po delete mode 100644 distutils/builtdist.po delete mode 100644 distutils/commandref.po delete mode 100644 distutils/configfile.po delete mode 100644 distutils/examples.po delete mode 100644 distutils/extending.po delete mode 100644 distutils/index.po delete mode 100644 distutils/introduction.po delete mode 100644 distutils/packageindex.po delete mode 100644 distutils/setupscript.po delete mode 100644 distutils/sourcedist.po delete mode 100644 distutils/uploading.po delete mode 100644 library/asynchat.po delete mode 100644 library/asyncore.po delete mode 100644 library/distutils.po delete mode 100644 library/imp.po delete mode 100644 library/smtpd.po diff --git a/distutils/_setuptools_disclaimer.po b/distutils/_setuptools_disclaimer.po deleted file mode 100644 index d5b3aac435..0000000000 --- a/distutils/_setuptools_disclaimer.po +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Matt Wang , 2022 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" -"PO-Revision-Date: 2022-02-11 13:46+0800\n" -"Last-Translator: Matt Wang \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" -"在 https://setuptools.readthedocs.io/en/latest/setuptools.html 上的 " -"setuptools 文件能夠包含所有相關訊息之前,此份舊文件會被單獨保留。" diff --git a/distutils/apiref.po b/distutils/apiref.po deleted file mode 100644 index 1c8e526451..0000000000 --- a/distutils/apiref.po +++ /dev/null @@ -1,2499 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Leon H., 2017 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+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-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/apiref.rst:5 -msgid "API Reference" -msgstr "API 參照" - -#: ../../distutils/apiref.rst:11 -msgid "`New and changed setup.py arguments in setuptools`_" -msgstr "" - -#: ../../distutils/apiref.rst:10 -msgid "" -"The ``setuptools`` project adds new capabilities to the ``setup`` function " -"and other APIs, makes the API consistent across different Python versions, " -"and is hence recommended over using ``distutils`` directly." -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/apiref.rst:19 -msgid ":mod:`distutils.core` --- Core Distutils functionality" -msgstr "" - -#: ../../distutils/apiref.rst:25 -msgid "" -"The :mod:`distutils.core` module is the only module that needs to be " -"installed to use the Distutils. It provides the :func:`setup` (which is " -"called from the setup script). Indirectly provides the :class:`distutils." -"dist.Distribution` and :class:`distutils.cmd.Command` class." -msgstr "" - -#: ../../distutils/apiref.rst:33 -msgid "" -"The basic do-everything function that does most everything you could ever " -"ask for from a Distutils method." -msgstr "" - -#: ../../distutils/apiref.rst:36 -msgid "" -"The setup function takes a large number of arguments. These are laid out in " -"the following table." -msgstr "" - -#: ../../distutils/apiref.rst:42 ../../distutils/apiref.rst:185 -msgid "argument name" -msgstr "" - -#: ../../distutils/apiref.rst:42 ../../distutils/apiref.rst:143 -#: ../../distutils/apiref.rst:185 -msgid "value" -msgstr "" - -#: ../../distutils/apiref.rst:42 ../../distutils/apiref.rst:185 -msgid "type" -msgstr "" - -#: ../../distutils/apiref.rst:44 ../../distutils/apiref.rst:187 -msgid "*name*" -msgstr "*name*" - -#: ../../distutils/apiref.rst:44 -msgid "The name of the package" -msgstr "" - -#: ../../distutils/apiref.rst:44 ../../distutils/apiref.rst:46 -#: ../../distutils/apiref.rst:50 ../../distutils/apiref.rst:53 -#: ../../distutils/apiref.rst:56 ../../distutils/apiref.rst:58 -#: ../../distutils/apiref.rst:61 ../../distutils/apiref.rst:68 -#: ../../distutils/apiref.rst:72 ../../distutils/apiref.rst:75 -#: ../../distutils/apiref.rst:96 ../../distutils/apiref.rst:106 -#: ../../distutils/apiref.rst:187 ../../distutils/apiref.rst:278 -msgid "a string" -msgstr "" - -#: ../../distutils/apiref.rst:46 -msgid "*version*" -msgstr "*version*" - -#: ../../distutils/apiref.rst:46 -msgid "The version number of the package; see :mod:`distutils.version`" -msgstr "" - -#: ../../distutils/apiref.rst:50 -msgid "*description*" -msgstr "*description*" - -#: ../../distutils/apiref.rst:50 -msgid "A single line describing the package" -msgstr "" - -#: ../../distutils/apiref.rst:53 -msgid "*long_description*" -msgstr "*long_description*" - -#: ../../distutils/apiref.rst:53 -msgid "Longer description of the package" -msgstr "" - -#: ../../distutils/apiref.rst:56 -msgid "*author*" -msgstr "*author*" - -#: ../../distutils/apiref.rst:56 -msgid "The name of the package author" -msgstr "" - -#: ../../distutils/apiref.rst:58 -msgid "*author_email*" -msgstr "*author_email*" - -#: ../../distutils/apiref.rst:58 -msgid "The email address of the package author" -msgstr "" - -#: ../../distutils/apiref.rst:61 -msgid "*maintainer*" -msgstr "*maintainer*" - -#: ../../distutils/apiref.rst:61 -msgid "" -"The name of the current maintainer, if different from the author. Note that " -"if the maintainer is provided, distutils will use it as the author in :file:" -"`PKG-INFO`" -msgstr "" - -#: ../../distutils/apiref.rst:68 -msgid "*maintainer_email*" -msgstr "*maintainer_email*" - -#: ../../distutils/apiref.rst:68 -msgid "" -"The email address of the current maintainer, if different from the author" -msgstr "" - -#: ../../distutils/apiref.rst:72 -msgid "*url*" -msgstr "*url*" - -#: ../../distutils/apiref.rst:72 -msgid "A URL for the package (homepage)" -msgstr "" - -#: ../../distutils/apiref.rst:75 -msgid "*download_url*" -msgstr "*download_url*" - -#: ../../distutils/apiref.rst:75 -msgid "A URL to download the package" -msgstr "" - -#: ../../distutils/apiref.rst:77 -msgid "*packages*" -msgstr "*packages*" - -#: ../../distutils/apiref.rst:77 -msgid "A list of Python packages that distutils will manipulate" -msgstr "" - -#: ../../distutils/apiref.rst:77 ../../distutils/apiref.rst:80 -#: ../../distutils/apiref.rst:83 ../../distutils/apiref.rst:100 -#: ../../distutils/apiref.rst:193 ../../distutils/apiref.rst:207 -#: ../../distutils/apiref.rst:223 ../../distutils/apiref.rst:226 -#: ../../distutils/apiref.rst:230 ../../distutils/apiref.rst:234 -#: ../../distutils/apiref.rst:240 ../../distutils/apiref.rst:247 -#: ../../distutils/apiref.rst:258 ../../distutils/apiref.rst:267 -#: ../../distutils/apiref.rst:275 -msgid "a list of strings" -msgstr "" - -#: ../../distutils/apiref.rst:80 -msgid "*py_modules*" -msgstr "*py_modules*" - -#: ../../distutils/apiref.rst:80 -msgid "A list of Python modules that distutils will manipulate" -msgstr "" - -#: ../../distutils/apiref.rst:83 -msgid "*scripts*" -msgstr "*scripts*" - -#: ../../distutils/apiref.rst:83 -msgid "A list of standalone script files to be built and installed" -msgstr "" - -#: ../../distutils/apiref.rst:87 -msgid "*ext_modules*" -msgstr "*ext_modules*" - -#: ../../distutils/apiref.rst:87 -msgid "A list of Python extensions to be built" -msgstr "" - -#: ../../distutils/apiref.rst:87 -msgid "a list of instances of :class:`distutils.core.Extension`" -msgstr "" - -#: ../../distutils/apiref.rst:90 -msgid "*classifiers*" -msgstr "*classifiers*" - -#: ../../distutils/apiref.rst:90 -msgid "A list of categories for the package" -msgstr "" - -#: ../../distutils/apiref.rst:90 -msgid "" -"a list of strings; valid classifiers are listed on `PyPI `_." -msgstr "" - -#: ../../distutils/apiref.rst:93 -msgid "*distclass*" -msgstr "*distclass*" - -#: ../../distutils/apiref.rst:93 -msgid "the :class:`Distribution` class to use" -msgstr "" - -#: ../../distutils/apiref.rst:93 -msgid "a subclass of :class:`distutils.core.Distribution`" -msgstr "" - -#: ../../distutils/apiref.rst:96 -msgid "*script_name*" -msgstr "*script_name*" - -#: ../../distutils/apiref.rst:96 -msgid "The name of the setup.py script - defaults to ``sys.argv[0]``" -msgstr "" - -#: ../../distutils/apiref.rst:100 -msgid "*script_args*" -msgstr "*script_args*" - -#: ../../distutils/apiref.rst:100 -msgid "Arguments to supply to the setup script" -msgstr "" - -#: ../../distutils/apiref.rst:103 -msgid "*options*" -msgstr "*options*" - -#: ../../distutils/apiref.rst:103 -msgid "default options for the setup script" -msgstr "" - -#: ../../distutils/apiref.rst:103 ../../distutils/apiref.rst:113 -#: ../../distutils/apiref.rst:119 -msgid "a dictionary" -msgstr "" - -#: ../../distutils/apiref.rst:106 -msgid "*license*" -msgstr "*license*" - -#: ../../distutils/apiref.rst:106 -msgid "The license for the package" -msgstr "" - -#: ../../distutils/apiref.rst:108 -msgid "*keywords*" -msgstr "*keywords*" - -#: ../../distutils/apiref.rst:108 -msgid "Descriptive meta-data, see :pep:`314`" -msgstr "" - -#: ../../distutils/apiref.rst:108 ../../distutils/apiref.rst:111 -msgid "a list of strings or a comma-separated string" -msgstr "" - -#: ../../distutils/apiref.rst:111 -msgid "*platforms*" -msgstr "*platforms*" - -#: ../../distutils/apiref.rst:113 -msgid "*cmdclass*" -msgstr "*cmdclass*" - -#: ../../distutils/apiref.rst:113 -msgid "A mapping of command names to :class:`Command` subclasses" -msgstr "" - -#: ../../distutils/apiref.rst:116 -msgid "*data_files*" -msgstr "*data_files*" - -#: ../../distutils/apiref.rst:116 -msgid "A list of data files to install" -msgstr "" - -#: ../../distutils/apiref.rst:116 -msgid "a list" -msgstr "" - -#: ../../distutils/apiref.rst:119 -msgid "*package_dir*" -msgstr "*package_dir*" - -#: ../../distutils/apiref.rst:119 -msgid "A mapping of package to directory names" -msgstr "" - -#: ../../distutils/apiref.rst:127 -msgid "" -"Run a setup script in a somewhat controlled environment, and return the :" -"class:`distutils.dist.Distribution` instance that drives things. This is " -"useful if you need to find out the distribution meta-data (passed as " -"keyword args from *script* to :func:`setup`), or the contents of the config " -"files or command-line." -msgstr "" - -#: ../../distutils/apiref.rst:133 -msgid "" -"*script_name* is a file that will be read and run with :func:`exec`. ``sys." -"argv[0]`` will be replaced with *script* for the duration of the call. " -"*script_args* is a list of strings; if supplied, ``sys.argv[1:]`` will be " -"replaced by *script_args* for the duration of the call." -msgstr "" - -#: ../../distutils/apiref.rst:138 -msgid "" -"*stop_after* tells :func:`setup` when to stop processing; possible values:" -msgstr "" - -#: ../../distutils/apiref.rst:143 ../../distutils/apiref.rst:562 -#: ../../distutils/apiref.rst:1606 -msgid "description" -msgstr "描述" - -#: ../../distutils/apiref.rst:145 -msgid "*init*" -msgstr "*init*" - -#: ../../distutils/apiref.rst:145 -msgid "" -"Stop after the :class:`Distribution` instance has been created and " -"populated with the keyword arguments to :func:`setup`" -msgstr "" - -#: ../../distutils/apiref.rst:149 -msgid "*config*" -msgstr "*config*" - -#: ../../distutils/apiref.rst:149 -msgid "" -"Stop after config files have been parsed (and their data stored in the :" -"class:`Distribution` instance)" -msgstr "" - -#: ../../distutils/apiref.rst:153 -msgid "*commandline*" -msgstr "*commandline*" - -#: ../../distutils/apiref.rst:153 -msgid "" -"Stop after the command-line (``sys.argv[1:]`` or *script_args*) have been " -"parsed (and the data stored in the :class:`Distribution` instance.)" -msgstr "" - -#: ../../distutils/apiref.rst:158 -msgid "*run*" -msgstr "*run*" - -#: ../../distutils/apiref.rst:158 -msgid "" -"Stop after all commands have been run (the same as if :func:`setup` had " -"been called in the usual way). This is the default value." -msgstr "" - -#: ../../distutils/apiref.rst:164 -msgid "" -"In addition, the :mod:`distutils.core` module exposed a number of classes " -"that live elsewhere." -msgstr "" - -#: ../../distutils/apiref.rst:167 -msgid ":class:`~distutils.extension.Extension` from :mod:`distutils.extension`" -msgstr "" - -#: ../../distutils/apiref.rst:169 -msgid ":class:`~distutils.cmd.Command` from :mod:`distutils.cmd`" -msgstr "" - -#: ../../distutils/apiref.rst:171 -msgid ":class:`~distutils.dist.Distribution` from :mod:`distutils.dist`" -msgstr "" - -#: ../../distutils/apiref.rst:173 -msgid "" -"A short description of each of these follows, but see the relevant module " -"for the full reference." -msgstr "" - -#: ../../distutils/apiref.rst:179 -msgid "" -"The Extension class describes a single C or C++ extension module in a setup " -"script. It accepts the following keyword arguments in its constructor:" -msgstr "" - -#: ../../distutils/apiref.rst:187 -msgid "" -"the full name of the extension, including any packages --- ie. *not* a " -"filename or pathname, but Python dotted name" -msgstr "" - -#: ../../distutils/apiref.rst:193 -msgid "*sources*" -msgstr "*sources*" - -#: ../../distutils/apiref.rst:193 -msgid "" -"list of source filenames, relative to the distribution root (where the setup " -"script lives), in Unix form (slash-separated) for portability. Source files " -"may be C, C++, SWIG (.i), platform-specific resource files, or whatever else " -"is recognized by the :command:`build_ext` command as source for a Python " -"extension." -msgstr "" - -#: ../../distutils/apiref.rst:207 -msgid "*include_dirs*" -msgstr "*include_dirs*" - -#: ../../distutils/apiref.rst:207 -msgid "" -"list of directories to search for C/C++ header files (in Unix form for " -"portability)" -msgstr "" - -#: ../../distutils/apiref.rst:211 -msgid "*define_macros*" -msgstr "*define_macros*" - -#: ../../distutils/apiref.rst:211 -msgid "" -"list of macros to define; each macro is defined using a 2-tuple ``(name, " -"value)``, where *value* is either the string to define it to or ``None`` to " -"define it without a particular value (equivalent of ``#define FOO`` in " -"source or :option:`!-DFOO` on Unix C compiler command line)" -msgstr "" - -#: ../../distutils/apiref.rst:211 -msgid "a list of tuples" -msgstr "" - -#: ../../distutils/apiref.rst:223 -msgid "*undef_macros*" -msgstr "*undef_macros*" - -#: ../../distutils/apiref.rst:223 -msgid "list of macros to undefine explicitly" -msgstr "" - -#: ../../distutils/apiref.rst:226 -msgid "*library_dirs*" -msgstr "*library_dirs*" - -#: ../../distutils/apiref.rst:226 -msgid "list of directories to search for C/C++ libraries at link time" -msgstr "" - -#: ../../distutils/apiref.rst:230 -msgid "*libraries*" -msgstr "*libraries*" - -#: ../../distutils/apiref.rst:230 -msgid "list of library names (not filenames or paths) to link against" -msgstr "" - -#: ../../distutils/apiref.rst:234 -msgid "*runtime_library_dirs*" -msgstr "*runtime_library_dirs*" - -#: ../../distutils/apiref.rst:234 -msgid "" -"list of directories to search for C/C++ libraries at run time (for shared " -"extensions, this is when the extension is loaded)" -msgstr "" - -#: ../../distutils/apiref.rst:240 -msgid "*extra_objects*" -msgstr "*extra_objects*" - -#: ../../distutils/apiref.rst:240 -msgid "" -"list of extra files to link with (eg. object files not implied by 'sources', " -"static library that must be explicitly specified, binary resource files, " -"etc.)" -msgstr "" - -#: ../../distutils/apiref.rst:247 -msgid "*extra_compile_args*" -msgstr "*extra_compile_args*" - -#: ../../distutils/apiref.rst:247 -msgid "" -"any extra platform- and compiler-specific information to use when compiling " -"the source files in 'sources'. For platforms and compilers where a command " -"line makes sense, this is typically a list of command-line arguments, but " -"for other platforms it could be anything." -msgstr "" - -#: ../../distutils/apiref.rst:258 -msgid "*extra_link_args*" -msgstr "*extra_link_args*" - -#: ../../distutils/apiref.rst:258 -msgid "" -"any extra platform- and compiler-specific information to use when linking " -"object files together to create the extension (or to create a new static " -"Python interpreter). Similar interpretation as for 'extra_compile_args'." -msgstr "" - -#: ../../distutils/apiref.rst:267 -msgid "*export_symbols*" -msgstr "*export_symbols*" - -#: ../../distutils/apiref.rst:267 -msgid "" -"list of symbols to be exported from a shared extension. Not used on all " -"platforms, and not generally necessary for Python extensions, which " -"typically export exactly one symbol: ``init`` + extension_name." -msgstr "" - -#: ../../distutils/apiref.rst:275 -msgid "*depends*" -msgstr "*depends*" - -#: ../../distutils/apiref.rst:275 -msgid "list of files that the extension depends on" -msgstr "" - -#: ../../distutils/apiref.rst:278 -msgid "*language*" -msgstr "*language*" - -#: ../../distutils/apiref.rst:278 -msgid "" -"extension language (i.e. ``'c'``, ``'c++'``, ``'objc'``). Will be detected " -"from the source extensions if not provided." -msgstr "" - -#: ../../distutils/apiref.rst:284 -msgid "*optional*" -msgstr "*optional*" - -#: ../../distutils/apiref.rst:284 -msgid "" -"specifies that a build failure in the extension should not abort the build " -"process, but simply skip the extension." -msgstr "" - -#: ../../distutils/apiref.rst:284 -msgid "a boolean" -msgstr "" - -#: ../../distutils/apiref.rst:292 -msgid "" -"On Unix, C extensions are no longer linked to libpython except on Android " -"and Cygwin." -msgstr "" - -#: ../../distutils/apiref.rst:298 -msgid "" -"A :class:`Distribution` describes how to build, install and package up a " -"Python software package." -msgstr "" - -#: ../../distutils/apiref.rst:301 -msgid "" -"See the :func:`setup` function for a list of keyword arguments accepted by " -"the Distribution constructor. :func:`setup` creates a Distribution instance." -msgstr "" - -#: ../../distutils/apiref.rst:304 -msgid "" -":class:`~distutils.core.Distribution` now warns if ``classifiers``, " -"``keywords`` and ``platforms`` fields are not specified as a list or a " -"string." -msgstr "" - -#: ../../distutils/apiref.rst:311 -msgid "" -"A :class:`Command` class (or rather, an instance of one of its subclasses) " -"implement a single distutils command." -msgstr "" - -#: ../../distutils/apiref.rst:316 -msgid ":mod:`distutils.ccompiler` --- CCompiler base class" -msgstr "" - -#: ../../distutils/apiref.rst:322 -msgid "" -"This module provides the abstract base class for the :class:`CCompiler` " -"classes. A :class:`CCompiler` instance can be used for all the compile and " -"link steps needed to build a single project. Methods are provided to set " -"options for the compiler --- macro definitions, include directories, link " -"path, libraries and the like." -msgstr "" - -#: ../../distutils/apiref.rst:328 -msgid "This module provides the following functions." -msgstr "" - -#: ../../distutils/apiref.rst:333 -msgid "" -"Generate linker options for searching library directories and linking with " -"specific libraries. *libraries* and *library_dirs* are, respectively, lists " -"of library names (not filenames!) and search directories. Returns a list of " -"command-line options suitable for use with some compiler (depending on the " -"two format strings passed in)." -msgstr "" - -#: ../../distutils/apiref.rst:342 -msgid "" -"Generate C pre-processor options (:option:`!-D`, :option:`!-U`, :option:`!-" -"I`) as used by at least two types of compilers: the typical Unix compiler " -"and Visual C++. *macros* is the usual thing, a list of 1- or 2-tuples, where " -"``(name,)`` means undefine (:option:`!-U`) macro *name*, and ``(name, " -"value)`` means define (:option:`!-D`) macro *name* to *value*. " -"*include_dirs* is just a list of directory names to be added to the header " -"file search path (:option:`!-I`). Returns a list of command-line options " -"suitable for either Unix compilers or Visual C++." -msgstr "" - -#: ../../distutils/apiref.rst:354 -msgid "Determine the default compiler to use for the given platform." -msgstr "" - -#: ../../distutils/apiref.rst:356 -msgid "" -"*osname* should be one of the standard Python OS names (i.e. the ones " -"returned by ``os.name``) and *platform* the common value returned by ``sys." -"platform`` for the platform in question." -msgstr "" - -#: ../../distutils/apiref.rst:360 -msgid "" -"The default values are ``os.name`` and ``sys.platform`` in case the " -"parameters are not given." -msgstr "" - -#: ../../distutils/apiref.rst:366 -msgid "" -"Factory function to generate an instance of some CCompiler subclass for the " -"supplied platform/compiler combination. *plat* defaults to ``os.name`` (eg. " -"``'posix'``, ``'nt'``), and *compiler* defaults to the default compiler for " -"that platform. Currently only ``'posix'`` and ``'nt'`` are supported, and " -"the default compilers are \"traditional Unix interface\" (:class:" -"`UnixCCompiler` class) and Visual C++ (:class:`MSVCCompiler` class). Note " -"that it's perfectly possible to ask for a Unix compiler object under " -"Windows, and a Microsoft compiler object under Unix---if you supply a value " -"for *compiler*, *plat* is ignored." -msgstr "" - -#: ../../distutils/apiref.rst:382 -msgid "" -"Print list of available compilers (used by the :option:`!--help-compiler` " -"options to :command:`build`, :command:`build_ext`, :command:`build_clib`)." -msgstr "" - -#: ../../distutils/apiref.rst:388 -msgid "" -"The abstract base class :class:`CCompiler` defines the interface that must " -"be implemented by real compiler classes. The class also has some utility " -"methods used by several compiler classes." -msgstr "" - -#: ../../distutils/apiref.rst:392 -msgid "" -"The basic idea behind a compiler abstraction class is that each instance can " -"be used for all the compile/link steps in building a single project. Thus, " -"attributes common to all of those compile and link steps --- include " -"directories, macros to define, libraries to link against, etc. --- are " -"attributes of the compiler instance. To allow for variability in how " -"individual files are treated, most of those attributes may be varied on a " -"per-compilation or per-link basis." -msgstr "" - -#: ../../distutils/apiref.rst:400 -msgid "" -"The constructor for each subclass creates an instance of the Compiler " -"object. Flags are *verbose* (show verbose output), *dry_run* (don't actually " -"execute the steps) and *force* (rebuild everything, regardless of " -"dependencies). All of these flags default to ``0`` (off). Note that you " -"probably don't want to instantiate :class:`CCompiler` or one of its " -"subclasses directly - use the :func:`distutils.CCompiler.new_compiler` " -"factory function instead." -msgstr "" - -#: ../../distutils/apiref.rst:407 -msgid "" -"The following methods allow you to manually alter compiler options for the " -"instance of the Compiler class." -msgstr "" - -#: ../../distutils/apiref.rst:413 -msgid "" -"Add *dir* to the list of directories that will be searched for header files. " -"The compiler is instructed to search directories in the order in which they " -"are supplied by successive calls to :meth:`add_include_dir`." -msgstr "" - -#: ../../distutils/apiref.rst:420 -msgid "" -"Set the list of directories that will be searched to *dirs* (a list of " -"strings). Overrides any preceding calls to :meth:`add_include_dir`; " -"subsequent calls to :meth:`add_include_dir` add to the list passed to :meth:" -"`set_include_dirs`. This does not affect any list of standard include " -"directories that the compiler may search by default." -msgstr "" - -#: ../../distutils/apiref.rst:429 -msgid "" -"Add *libname* to the list of libraries that will be included in all links " -"driven by this compiler object. Note that *libname* should \\*not\\* be the " -"name of a file containing a library, but the name of the library itself: the " -"actual filename will be inferred by the linker, the compiler, or the " -"compiler class (depending on the platform)." -msgstr "" - -#: ../../distutils/apiref.rst:435 -msgid "" -"The linker will be instructed to link against libraries in the order they " -"were supplied to :meth:`add_library` and/or :meth:`set_libraries`. It is " -"perfectly valid to duplicate library names; the linker will be instructed to " -"link against libraries as many times as they are mentioned." -msgstr "" - -#: ../../distutils/apiref.rst:443 -msgid "" -"Set the list of libraries to be included in all links driven by this " -"compiler object to *libnames* (a list of strings). This does not affect any " -"standard system libraries that the linker may include by default." -msgstr "" - -#: ../../distutils/apiref.rst:450 -msgid "" -"Add *dir* to the list of directories that will be searched for libraries " -"specified to :meth:`add_library` and :meth:`set_libraries`. The linker will " -"be instructed to search for libraries in the order they are supplied to :" -"meth:`add_library_dir` and/or :meth:`set_library_dirs`." -msgstr "" - -#: ../../distutils/apiref.rst:458 -msgid "" -"Set the list of library search directories to *dirs* (a list of strings). " -"This does not affect any standard library search path that the linker may " -"search by default." -msgstr "" - -#: ../../distutils/apiref.rst:465 -msgid "" -"Add *dir* to the list of directories that will be searched for shared " -"libraries at runtime." -msgstr "" - -#: ../../distutils/apiref.rst:471 -msgid "" -"Set the list of directories to search for shared libraries at runtime to " -"*dirs* (a list of strings). This does not affect any standard search path " -"that the runtime linker may search by default." -msgstr "" - -#: ../../distutils/apiref.rst:478 -msgid "" -"Define a preprocessor macro for all compilations driven by this compiler " -"object. The optional parameter *value* should be a string; if it is not " -"supplied, then the macro will be defined without an explicit value and the " -"exact outcome depends on the compiler used." -msgstr "" - -#: ../../distutils/apiref.rst:488 -msgid "" -"Undefine a preprocessor macro for all compilations driven by this compiler " -"object. If the same macro is defined by :meth:`define_macro` and undefined " -"by :meth:`undefine_macro` the last call takes precedence (including multiple " -"redefinitions or undefinitions). If the macro is redefined/undefined on a " -"per-compilation basis (ie. in the call to :meth:`compile`), then that takes " -"precedence." -msgstr "" - -#: ../../distutils/apiref.rst:498 -msgid "" -"Add *object* to the list of object files (or analogues, such as explicitly " -"named library files or the output of \"resource compilers\") to be included " -"in every link driven by this compiler object." -msgstr "" - -#: ../../distutils/apiref.rst:505 -msgid "" -"Set the list of object files (or analogues) to be included in every link to " -"*objects*. This does not affect any standard object files that the linker " -"may include by default (such as system libraries)." -msgstr "" - -#: ../../distutils/apiref.rst:509 -msgid "" -"The following methods implement methods for autodetection of compiler " -"options, providing some functionality similar to GNU :program:`autoconf`." -msgstr "" - -#: ../../distutils/apiref.rst:515 -msgid "" -"Detect the language of a given file, or list of files. Uses the instance " -"attributes :attr:`language_map` (a dictionary), and :attr:`language_order` " -"(a list) to do the job." -msgstr "" - -#: ../../distutils/apiref.rst:522 -msgid "" -"Search the specified list of directories for a static or shared library file " -"*lib* and return the full path to that file. If *debug* is true, look for a " -"debugging version (if that makes sense on the current platform). Return " -"``None`` if *lib* wasn't found in any of the specified directories." -msgstr "" - -#: ../../distutils/apiref.rst:530 -msgid "" -"Return a boolean indicating whether *funcname* is supported on the current " -"platform. The optional arguments can be used to augment the compilation " -"environment by providing additional include files and paths and libraries " -"and paths." -msgstr "" - -#: ../../distutils/apiref.rst:538 -msgid "" -"Return the compiler option to add *dir* to the list of directories searched " -"for libraries." -msgstr "" - -#: ../../distutils/apiref.rst:544 -msgid "" -"Return the compiler option to add *lib* to the list of libraries linked into " -"the shared library or executable." -msgstr "" - -#: ../../distutils/apiref.rst:550 -msgid "" -"Return the compiler option to add *dir* to the list of directories searched " -"for runtime libraries." -msgstr "" - -#: ../../distutils/apiref.rst:556 -msgid "" -"Define the executables (and options for them) that will be run to perform " -"the various stages of compilation. The exact set of executables that may be " -"specified here depends on the compiler class (via the 'executables' class " -"attribute), but most will have:" -msgstr "" - -#: ../../distutils/apiref.rst:562 -msgid "attribute" -msgstr "" - -#: ../../distutils/apiref.rst:564 -msgid "*compiler*" -msgstr "" - -#: ../../distutils/apiref.rst:564 -msgid "the C/C++ compiler" -msgstr "" - -#: ../../distutils/apiref.rst:566 -msgid "*linker_so*" -msgstr "*linker_so*" - -#: ../../distutils/apiref.rst:566 -msgid "linker used to create shared objects and libraries" -msgstr "" - -#: ../../distutils/apiref.rst:569 -msgid "*linker_exe*" -msgstr "*linker_exe*" - -#: ../../distutils/apiref.rst:569 -msgid "linker used to create binary executables" -msgstr "" - -#: ../../distutils/apiref.rst:571 -msgid "*archiver*" -msgstr "*archiver*" - -#: ../../distutils/apiref.rst:571 -msgid "static library creator" -msgstr "" - -#: ../../distutils/apiref.rst:574 -msgid "" -"On platforms with a command-line (Unix, DOS/Windows), each of these is a " -"string that will be split into executable name and (optional) list of " -"arguments. (Splitting the string is done similarly to how Unix shells " -"operate: words are delimited by spaces, but quotes and backslashes can " -"override this. See :func:`distutils.util.split_quoted`.)" -msgstr "" - -#: ../../distutils/apiref.rst:580 -msgid "The following methods invoke stages in the build process." -msgstr "" - -#: ../../distutils/apiref.rst:585 -msgid "" -"Compile one or more source files. Generates object files (e.g. transforms " -"a :file:`.c` file to a :file:`.o` file.)" -msgstr "" - -#: ../../distutils/apiref.rst:588 -msgid "" -"*sources* must be a list of filenames, most likely C/C++ files, but in " -"reality anything that can be handled by a particular compiler and compiler " -"class (eg. :class:`MSVCCompiler` can handle resource files in *sources*). " -"Return a list of object filenames, one per source filename in *sources*. " -"Depending on the implementation, not all source files will necessarily be " -"compiled, but all corresponding object filenames will be returned." -msgstr "" - -#: ../../distutils/apiref.rst:595 -msgid "" -"If *output_dir* is given, object files will be put under it, while retaining " -"their original path component. That is, :file:`foo/bar.c` normally compiles " -"to :file:`foo/bar.o` (for a Unix implementation); if *output_dir* is " -"*build*, then it would compile to :file:`build/foo/bar.o`." -msgstr "" - -#: ../../distutils/apiref.rst:600 -msgid "" -"*macros*, if given, must be a list of macro definitions. A macro definition " -"is either a ``(name, value)`` 2-tuple or a ``(name,)`` 1-tuple. The former " -"defines a macro; if the value is ``None``, the macro is defined without an " -"explicit value. The 1-tuple case undefines a macro. Later definitions/" -"redefinitions/undefinitions take precedence." -msgstr "" - -#: ../../distutils/apiref.rst:606 -msgid "" -"*include_dirs*, if given, must be a list of strings, the directories to add " -"to the default include file search path for this compilation only." -msgstr "" - -#: ../../distutils/apiref.rst:609 -msgid "" -"*debug* is a boolean; if true, the compiler will be instructed to output " -"debug symbols in (or alongside) the object file(s)." -msgstr "" - -#: ../../distutils/apiref.rst:612 -msgid "" -"*extra_preargs* and *extra_postargs* are implementation-dependent. On " -"platforms that have the notion of a command-line (e.g. Unix, DOS/Windows), " -"they are most likely lists of strings: extra command-line arguments to " -"prepend/append to the compiler command line. On other platforms, consult " -"the implementation class documentation. In any event, they are intended as " -"an escape hatch for those occasions when the abstract compiler framework " -"doesn't cut the mustard." -msgstr "" - -#: ../../distutils/apiref.rst:619 -msgid "" -"*depends*, if given, is a list of filenames that all targets depend on. If " -"a source file is older than any file in depends, then the source file will " -"be recompiled. This supports dependency tracking, but only at a coarse " -"granularity." -msgstr "" - -#: ../../distutils/apiref.rst:624 -msgid "Raises :exc:`CompileError` on failure." -msgstr "" - -#: ../../distutils/apiref.rst:629 -msgid "" -"Link a bunch of stuff together to create a static library file. The \"bunch " -"of stuff\" consists of the list of object files supplied as *objects*, the " -"extra object files supplied to :meth:`add_link_object` and/or :meth:" -"`set_link_objects`, the libraries supplied to :meth:`add_library` and/or :" -"meth:`set_libraries`, and the libraries supplied as *libraries* (if any)." -msgstr "" - -#: ../../distutils/apiref.rst:635 -msgid "" -"*output_libname* should be a library name, not a filename; the filename will " -"be inferred from the library name. *output_dir* is the directory where the " -"library file will be put." -msgstr "" - -#: ../../distutils/apiref.rst:641 -msgid "" -"*debug* is a boolean; if true, debugging information will be included in the " -"library (note that on most platforms, it is the compile step where this " -"matters: the *debug* flag is included here just for consistency)." -msgstr "" - -#: ../../distutils/apiref.rst:645 ../../distutils/apiref.rst:687 -msgid "" -"*target_lang* is the target language for which the given objects are being " -"compiled. This allows specific linkage time treatment of certain languages." -msgstr "" - -#: ../../distutils/apiref.rst:648 -msgid "Raises :exc:`LibError` on failure." -msgstr "" - -#: ../../distutils/apiref.rst:653 -msgid "" -"Link a bunch of stuff together to create an executable or shared library " -"file." -msgstr "" - -#: ../../distutils/apiref.rst:655 -msgid "" -"The \"bunch of stuff\" consists of the list of object files supplied as " -"*objects*. *output_filename* should be a filename. If *output_dir* is " -"supplied, *output_filename* is relative to it (i.e. *output_filename* can " -"provide directory components if needed)." -msgstr "" - -#: ../../distutils/apiref.rst:660 -msgid "" -"*libraries* is a list of libraries to link against. These are library " -"names, not filenames, since they're translated into filenames in a platform-" -"specific way (eg. *foo* becomes :file:`libfoo.a` on Unix and :file:`foo.lib` " -"on DOS/Windows). However, they can include a directory component, which " -"means the linker will look in that specific directory rather than searching " -"all the normal locations." -msgstr "" - -#: ../../distutils/apiref.rst:667 -msgid "" -"*library_dirs*, if supplied, should be a list of directories to search for " -"libraries that were specified as bare library names (ie. no directory " -"component). These are on top of the system default and those supplied to :" -"meth:`add_library_dir` and/or :meth:`set_library_dirs`. " -"*runtime_library_dirs* is a list of directories that will be embedded into " -"the shared library and used to search for other shared libraries that " -"\\*it\\* depends on at run-time. (This may only be relevant on Unix.)" -msgstr "" - -#: ../../distutils/apiref.rst:675 -msgid "" -"*export_symbols* is a list of symbols that the shared library will export. " -"(This appears to be relevant only on Windows.)" -msgstr "" - -#: ../../distutils/apiref.rst:678 -msgid "" -"*debug* is as for :meth:`compile` and :meth:`create_static_lib`, with the " -"slight distinction that it actually matters on most platforms (as opposed " -"to :meth:`create_static_lib`, which includes a *debug* flag mostly for " -"form's sake)." -msgstr "" - -#: ../../distutils/apiref.rst:683 -msgid "" -"*extra_preargs* and *extra_postargs* are as for :meth:`compile` (except of " -"course that they supply command-line arguments for the particular linker " -"being used)." -msgstr "" - -#: ../../distutils/apiref.rst:690 -msgid "Raises :exc:`LinkError` on failure." -msgstr "" - -#: ../../distutils/apiref.rst:695 -msgid "" -"Link an executable. *output_progname* is the name of the file executable, " -"while *objects* are a list of object filenames to link in. Other arguments " -"are as for the :meth:`link` method." -msgstr "" - -#: ../../distutils/apiref.rst:702 -msgid "" -"Link a shared library. *output_libname* is the name of the output library, " -"while *objects* is a list of object filenames to link in. Other arguments " -"are as for the :meth:`link` method." -msgstr "" - -#: ../../distutils/apiref.rst:709 -msgid "" -"Link a shared object. *output_filename* is the name of the shared object " -"that will be created, while *objects* is a list of object filenames to link " -"in. Other arguments are as for the :meth:`link` method." -msgstr "" - -#: ../../distutils/apiref.rst:716 -msgid "" -"Preprocess a single C/C++ source file, named in *source*. Output will be " -"written to file named *output_file*, or *stdout* if *output_file* not " -"supplied. *macros* is a list of macro definitions as for :meth:`compile`, " -"which will augment the macros set with :meth:`define_macro` and :meth:" -"`undefine_macro`. *include_dirs* is a list of directory names that will be " -"added to the default list, in the same way as :meth:`add_include_dir`." -msgstr "" - -#: ../../distutils/apiref.rst:723 -msgid "Raises :exc:`PreprocessError` on failure." -msgstr "" - -#: ../../distutils/apiref.rst:725 -msgid "" -"The following utility methods are defined by the :class:`CCompiler` class, " -"for use by the various concrete subclasses." -msgstr "" - -#: ../../distutils/apiref.rst:731 -msgid "" -"Returns the filename of the executable for the given *basename*. Typically " -"for non-Windows platforms this is the same as the basename, while Windows " -"will get a :file:`.exe` added." -msgstr "" - -#: ../../distutils/apiref.rst:738 -msgid "" -"Returns the filename for the given library name on the current platform. On " -"Unix a library with *lib_type* of ``'static'`` will typically be of the " -"form :file:`liblibname.a`, while a *lib_type* of ``'dynamic'`` will be of " -"the form :file:`liblibname.so`." -msgstr "" - -#: ../../distutils/apiref.rst:746 -msgid "" -"Returns the name of the object files for the given source files. " -"*source_filenames* should be a list of filenames." -msgstr "" - -#: ../../distutils/apiref.rst:752 -msgid "" -"Returns the name of a shared object file for the given file name *basename*." -msgstr "" - -#: ../../distutils/apiref.rst:757 -msgid "" -"Invokes :func:`distutils.util.execute`. This method invokes a Python " -"function *func* with the given arguments *args*, after logging and taking " -"into account the *dry_run* flag." -msgstr "" - -#: ../../distutils/apiref.rst:764 -msgid "" -"Invokes :func:`distutils.util.spawn`. This invokes an external process to " -"run the given command." -msgstr "" - -#: ../../distutils/apiref.rst:770 -msgid "" -"Invokes :func:`distutils.dir_util.mkpath`. This creates a directory and any " -"missing ancestor directories." -msgstr "" - -#: ../../distutils/apiref.rst:776 -msgid "Invokes :meth:`distutils.file_util.move_file`. Renames *src* to *dst*." -msgstr "" - -#: ../../distutils/apiref.rst:781 -msgid "Write a message using :func:`distutils.log.debug`." -msgstr "" - -#: ../../distutils/apiref.rst:786 -msgid "Write a warning message *msg* to standard error." -msgstr "" - -#: ../../distutils/apiref.rst:791 -msgid "" -"If the *debug* flag is set on this :class:`CCompiler` instance, print *msg* " -"to standard output, otherwise do nothing." -msgstr "" - -#: ../../distutils/apiref.rst:803 -msgid ":mod:`distutils.unixccompiler` --- Unix C Compiler" -msgstr "" - -#: ../../distutils/apiref.rst:809 -msgid "" -"This module provides the :class:`UnixCCompiler` class, a subclass of :class:" -"`CCompiler` that handles the typical Unix-style command-line C compiler:" -msgstr "" - -#: ../../distutils/apiref.rst:812 -msgid "macros defined with :option:`!-Dname[=value]`" -msgstr "" - -#: ../../distutils/apiref.rst:814 -msgid "macros undefined with :option:`!-Uname`" -msgstr "" - -#: ../../distutils/apiref.rst:816 -msgid "include search directories specified with :option:`!-Idir`" -msgstr "" - -#: ../../distutils/apiref.rst:818 -msgid "libraries specified with :option:`!-llib`" -msgstr "" - -#: ../../distutils/apiref.rst:820 -msgid "library search directories specified with :option:`!-Ldir`" -msgstr "" - -#: ../../distutils/apiref.rst:822 -msgid "" -"compile handled by :program:`cc` (or similar) executable with :option:`!-c` " -"option: compiles :file:`.c` to :file:`.o`" -msgstr "" - -#: ../../distutils/apiref.rst:825 -msgid "" -"link static library handled by :program:`ar` command (possibly with :program:" -"`ranlib`)" -msgstr "" - -#: ../../distutils/apiref.rst:828 -msgid "link shared library handled by :program:`cc` :option:`!-shared`" -msgstr "" - -#: ../../distutils/apiref.rst:832 -msgid ":mod:`distutils.msvccompiler` --- Microsoft Compiler" -msgstr "" - -#: ../../distutils/apiref.rst:839 -msgid "" -"This module provides :class:`MSVCCompiler`, an implementation of the " -"abstract :class:`CCompiler` class for Microsoft Visual Studio. Typically, " -"extension modules need to be compiled with the same compiler that was used " -"to compile Python. For Python 2.3 and earlier, the compiler was Visual " -"Studio 6. For Python 2.4 and 2.5, the compiler is Visual Studio .NET 2003." -msgstr "" - -#: ../../distutils/apiref.rst:845 -msgid "" -":class:`MSVCCompiler` will normally choose the right compiler, linker etc. " -"on its own. To override this choice, the environment variables " -"*DISTUTILS_USE_SDK* and *MSSdk* must be both set. *MSSdk* indicates that the " -"current environment has been setup by the SDK's ``SetEnv.Cmd`` script, or " -"that the environment variables had been registered when the SDK was " -"installed; *DISTUTILS_USE_SDK* indicates that the distutils user has made an " -"explicit choice to override the compiler selection by :class:`MSVCCompiler`." -msgstr "" - -#: ../../distutils/apiref.rst:855 -msgid ":mod:`distutils.bcppcompiler` --- Borland Compiler" -msgstr "" - -#: ../../distutils/apiref.rst:860 -msgid "" -"This module provides :class:`BorlandCCompiler`, a subclass of the abstract :" -"class:`CCompiler` class for the Borland C++ compiler." -msgstr "" - -#: ../../distutils/apiref.rst:865 -msgid ":mod:`distutils.cygwincompiler` --- Cygwin Compiler" -msgstr "" - -#: ../../distutils/apiref.rst:870 -msgid "" -"This module provides the :class:`CygwinCCompiler` class, a subclass of :" -"class:`UnixCCompiler` that handles the Cygwin port of the GNU C compiler to " -"Windows. It also contains the Mingw32CCompiler class which handles the " -"mingw32 port of GCC (same as cygwin in no-cygwin mode)." -msgstr "" - -#: ../../distutils/apiref.rst:877 -msgid ":mod:`distutils.archive_util` --- Archiving utilities" -msgstr "" - -#: ../../distutils/apiref.rst:883 -msgid "" -"This module provides a few functions for creating archive files, such as " -"tarballs or zipfiles." -msgstr "" - -#: ../../distutils/apiref.rst:889 -msgid "" -"Create an archive file (eg. ``zip`` or ``tar``). *base_name* is the name " -"of the file to create, minus any format-specific extension; *format* is the " -"archive format: one of ``zip``, ``tar``, ``gztar``, ``bztar``, ``xztar``, or " -"``ztar``. *root_dir* is a directory that will be the root directory of the " -"archive; ie. we typically ``chdir`` into *root_dir* before creating the " -"archive. *base_dir* is the directory where we start archiving from; ie. " -"*base_dir* will be the common prefix of all files and directories in the " -"archive. *root_dir* and *base_dir* both default to the current directory. " -"Returns the name of the archive file." -msgstr "" - -#: ../../distutils/apiref.rst:899 -msgid "Added support for the ``xztar`` format." -msgstr "" - -#: ../../distutils/apiref.rst:905 -msgid "" -"'Create an (optional compressed) archive as a tar file from all files in and " -"under *base_dir*. *compress* must be ``'gzip'`` (the default), ``'bzip2'``, " -"``'xz'``, ``'compress'``, or ``None``. For the ``'compress'`` method the " -"compression utility named by :program:`compress` must be on the default " -"program search path, so this is probably Unix-specific. The output tar file " -"will be named :file:`base_dir.tar`, possibly plus the appropriate " -"compression extension (``.gz``, ``.bz2``, ``.xz`` or ``.Z``). Return the " -"output filename." -msgstr "" - -#: ../../distutils/apiref.rst:914 -msgid "Added support for the ``xz`` compression." -msgstr "" - -#: ../../distutils/apiref.rst:920 -msgid "" -"Create a zip file from all files in and under *base_dir*. The output zip " -"file will be named *base_name* + :file:`.zip`. Uses either the :mod:" -"`zipfile` Python module (if available) or the InfoZIP :file:`zip` utility " -"(if installed and found on the default search path). If neither tool is " -"available, raises :exc:`DistutilsExecError`. Returns the name of the " -"output zip file." -msgstr "" - -#: ../../distutils/apiref.rst:928 -msgid ":mod:`distutils.dep_util` --- Dependency checking" -msgstr "" - -#: ../../distutils/apiref.rst:934 -msgid "" -"This module provides functions for performing simple, timestamp-based " -"dependency of files and groups of files; also, functions based entirely on " -"such timestamp dependency analysis." -msgstr "" - -#: ../../distutils/apiref.rst:941 -msgid "" -"Return true if *source* exists and is more recently modified than *target*, " -"or if *source* exists and *target* doesn't. Return false if both exist and " -"*target* is the same age or newer than *source*. Raise :exc:" -"`DistutilsFileError` if *source* does not exist." -msgstr "" - -#: ../../distutils/apiref.rst:949 -msgid "" -"Walk two filename lists in parallel, testing if each source is newer than " -"its corresponding target. Return a pair of lists (*sources*, *targets*) " -"where source is newer than target, according to the semantics of :func:" -"`newer`." -msgstr "" - -#: ../../distutils/apiref.rst:958 -msgid "" -"Return true if *target* is out-of-date with respect to any file listed in " -"*sources*. In other words, if *target* exists and is newer than every file " -"in *sources*, return false; otherwise return true. *missing* controls what " -"we do when a source file is missing; the default (``'error'``) is to blow up " -"with an :exc:`OSError` from inside :func:`os.stat`; if it is ``'ignore'``, " -"we silently drop any missing source files; if it is ``'newer'``, any missing " -"source files make us assume that *target* is out-of-date (this is handy in " -"\"dry-run\" mode: it'll make you pretend to carry out commands that wouldn't " -"work because inputs are missing, but that doesn't matter because you're not " -"actually going to run the commands)." -msgstr "" - -#: ../../distutils/apiref.rst:971 -msgid ":mod:`distutils.dir_util` --- Directory tree operations" -msgstr "" - -#: ../../distutils/apiref.rst:977 -msgid "" -"This module provides functions for operating on directories and trees of " -"directories." -msgstr "" - -#: ../../distutils/apiref.rst:983 -msgid "" -"Create a directory and any missing ancestor directories. If the directory " -"already exists (or if *name* is the empty string, which means the current " -"directory, which of course exists), then do nothing. Raise :exc:" -"`DistutilsFileError` if unable to create some directory along the way (eg. " -"some sub-path exists, but is a file rather than a directory). If *verbose* " -"is true, print a one-line summary of each mkdir to stdout. Return the list " -"of directories actually created." -msgstr "" - -#: ../../distutils/apiref.rst:994 -msgid "" -"Create all the empty directories under *base_dir* needed to put *files* " -"there. *base_dir* is just the name of a directory which doesn't necessarily " -"exist yet; *files* is a list of filenames to be interpreted relative to " -"*base_dir*. *base_dir* + the directory portion of every file in *files* will " -"be created if it doesn't already exist. *mode*, *verbose* and *dry_run* " -"flags are as for :func:`mkpath`." -msgstr "" - -#: ../../distutils/apiref.rst:1004 -msgid "" -"Copy an entire directory tree *src* to a new location *dst*. Both *src* and " -"*dst* must be directory names. If *src* is not a directory, raise :exc:" -"`DistutilsFileError`. If *dst* does not exist, it is created with :func:" -"`mkpath`. The end result of the copy is that every file in *src* is copied " -"to *dst*, and directories under *src* are recursively copied to *dst*. " -"Return the list of files that were copied or might have been copied, using " -"their output name. The return value is unaffected by *update* or *dry_run*: " -"it is simply the list of all files under *src*, with the names changed to be " -"under *dst*." -msgstr "" - -#: ../../distutils/apiref.rst:1014 -msgid "" -"*preserve_mode* and *preserve_times* are the same as for :func:`distutils." -"file_util.copy_file`; note that they only apply to regular files, not to " -"directories. If *preserve_symlinks* is true, symlinks will be copied as " -"symlinks (on platforms that support them!); otherwise (the default), the " -"destination of the symlink will be copied. *update* and *verbose* are the " -"same as for :func:`copy_file`." -msgstr "" - -#: ../../distutils/apiref.rst:1022 -msgid "" -"Files in *src* that begin with :file:`.nfs` are skipped (more information on " -"these files is available in answer D2 of the `NFS FAQ page `_)." -msgstr "" - -#: ../../distutils/apiref.rst:1026 -msgid "NFS files are ignored." -msgstr "" - -#: ../../distutils/apiref.rst:1031 -msgid "" -"Recursively remove *directory* and all files and directories underneath it. " -"Any errors are ignored (apart from being reported to ``sys.stdout`` if " -"*verbose* is true)." -msgstr "" - -#: ../../distutils/apiref.rst:1037 -msgid ":mod:`distutils.file_util` --- Single file operations" -msgstr "" - -#: ../../distutils/apiref.rst:1043 -msgid "" -"This module contains some utility functions for operating on individual " -"files." -msgstr "" - -#: ../../distutils/apiref.rst:1048 -msgid "" -"Copy file *src* to *dst*. If *dst* is a directory, then *src* is copied " -"there with the same name; otherwise, it must be a filename. (If the file " -"exists, it will be ruthlessly clobbered.) If *preserve_mode* is true (the " -"default), the file's mode (type and permission bits, or whatever is " -"analogous on the current platform) is copied. If *preserve_times* is true " -"(the default), the last-modified and last-access times are copied as well. " -"If *update* is true, *src* will only be copied if *dst* does not exist, or " -"if *dst* does exist but is older than *src*." -msgstr "" - -#: ../../distutils/apiref.rst:1057 -msgid "" -"*link* allows you to make hard links (using :func:`os.link`) or symbolic " -"links (using :func:`os.symlink`) instead of copying: set it to ``'hard'`` or " -"``'sym'``; if it is ``None`` (the default), files are copied. Don't set " -"*link* on systems that don't support it: :func:`copy_file` doesn't check if " -"hard or symbolic linking is available. It uses :func:`_copy_file_contents` " -"to copy file contents." -msgstr "" - -#: ../../distutils/apiref.rst:1064 -msgid "" -"Return a tuple ``(dest_name, copied)``: *dest_name* is the actual name of " -"the output file, and *copied* is true if the file was copied (or would have " -"been copied, if *dry_run* true)." -msgstr "" - -#: ../../distutils/apiref.rst:1078 -msgid "" -"Move file *src* to *dst*. If *dst* is a directory, the file will be moved " -"into it with the same name; otherwise, *src* is just renamed to *dst*. " -"Returns the new full name of the file." -msgstr "" - -#: ../../distutils/apiref.rst:1084 -msgid "" -"Handles cross-device moves on Unix using :func:`copy_file`. What about " -"other systems?" -msgstr "" - -#: ../../distutils/apiref.rst:1090 -msgid "" -"Create a file called *filename* and write *contents* (a sequence of strings " -"without line terminators) to it." -msgstr "" - -#: ../../distutils/apiref.rst:1095 -msgid ":mod:`distutils.util` --- Miscellaneous other utility functions" -msgstr "" - -#: ../../distutils/apiref.rst:1101 -msgid "" -"This module contains other assorted bits and pieces that don't fit into any " -"other utility module." -msgstr "" - -#: ../../distutils/apiref.rst:1107 -msgid "" -"Return a string that identifies the current platform. This is used mainly " -"to distinguish platform-specific build directories and platform-specific " -"built distributions. Typically includes the OS name and version and the " -"architecture (as supplied by 'os.uname()'), although the exact information " -"included depends on the OS; e.g., on Linux, the kernel version isn't " -"particularly important." -msgstr "" - -#: ../../distutils/apiref.rst:1114 -msgid "Examples of returned values:" -msgstr "" - -#: ../../distutils/apiref.rst:1116 -msgid "``linux-i586``" -msgstr "``linux-i586``" - -#: ../../distutils/apiref.rst:1117 -msgid "``linux-alpha``" -msgstr "``linux-alpha``" - -#: ../../distutils/apiref.rst:1118 -msgid "``solaris-2.6-sun4u``" -msgstr "``solaris-2.6-sun4u``" - -#: ../../distutils/apiref.rst:1120 -msgid "For non-POSIX platforms, currently just returns ``sys.platform``." -msgstr "" - -#: ../../distutils/apiref.rst:1122 -msgid "" -"For macOS systems the OS version reflects the minimal version on which " -"binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` during " -"the build of Python), not the OS version of the current system." -msgstr "" - -#: ../../distutils/apiref.rst:1126 -msgid "" -"For universal binary builds on macOS the architecture value reflects the " -"universal binary status instead of the architecture of the current " -"processor. For 32-bit universal binaries the architecture is ``fat``, for 64-" -"bit universal binaries the architecture is ``fat64``, and for 4-way " -"universal binaries the architecture is ``universal``. Starting from Python " -"2.7 and Python 3.2 the architecture ``fat3`` is used for a 3-way universal " -"build (ppc, i386, x86_64) and ``intel`` is used for a universal build with " -"the i386 and x86_64 architectures" -msgstr "" - -#: ../../distutils/apiref.rst:1135 -msgid "Examples of returned values on macOS:" -msgstr "" - -#: ../../distutils/apiref.rst:1137 -msgid "``macosx-10.3-ppc``" -msgstr "``macosx-10.3-ppc``" - -#: ../../distutils/apiref.rst:1139 -msgid "``macosx-10.3-fat``" -msgstr "``macosx-10.3-fat``" - -#: ../../distutils/apiref.rst:1141 -msgid "``macosx-10.5-universal``" -msgstr "``macosx-10.5-universal``" - -#: ../../distutils/apiref.rst:1143 -msgid "``macosx-10.6-intel``" -msgstr "``macosx-10.6-intel``" - -#: ../../distutils/apiref.rst:1145 -msgid "" -"For AIX, Python 3.9 and later return a string starting with \"aix\", " -"followed by additional fields (separated by ``'-'``) that represent the " -"combined values of AIX Version, Release and Technology Level (first field), " -"Build Date (second field), and bit-size (third field). Python 3.8 and " -"earlier returned only a single additional field with the AIX Version and " -"Release." -msgstr "" - -#: ../../distutils/apiref.rst:1151 -msgid "Examples of returned values on AIX:" -msgstr "" - -#: ../../distutils/apiref.rst:1153 -msgid "" -"``aix-5307-0747-32`` # 32-bit build on AIX ``oslevel -s``: 5300-07-00-0000" -msgstr "" - -#: ../../distutils/apiref.rst:1155 -msgid "" -"``aix-7105-1731-64`` # 64-bit build on AIX ``oslevel -s``: 7100-05-01-1731" -msgstr "" - -#: ../../distutils/apiref.rst:1157 -msgid "``aix-7.2`` # Legacy form reported in Python 3.8 and earlier" -msgstr "" - -#: ../../distutils/apiref.rst:1159 -msgid "" -"The AIX platform string format now also includes the technology level, build " -"date, and ABI bit-size." -msgstr "" - -#: ../../distutils/apiref.rst:1166 -msgid "" -"Return 'pathname' as a name that will work on the native filesystem, i.e. " -"split it on '/' and put it back together again using the current directory " -"separator. Needed because filenames in the setup script are always supplied " -"in Unix style, and have to be converted to the local convention before we " -"can actually use them in the filesystem. Raises :exc:`ValueError` on non-" -"Unix-ish systems if *pathname* either starts or ends with a slash." -msgstr "" - -#: ../../distutils/apiref.rst:1176 -msgid "" -"Return *pathname* with *new_root* prepended. If *pathname* is relative, " -"this is equivalent to ``os.path.join(new_root,pathname)`` Otherwise, it " -"requires making *pathname* relative and then joining the two, which is " -"tricky on DOS/Windows." -msgstr "" - -#: ../../distutils/apiref.rst:1183 -msgid "" -"Ensure that 'os.environ' has all the environment variables we guarantee that " -"users can use in config files, command-line options, etc. Currently this " -"includes:" -msgstr "" - -#: ../../distutils/apiref.rst:1187 -msgid ":envvar:`HOME` - user's home directory (Unix only)" -msgstr "" - -#: ../../distutils/apiref.rst:1188 -msgid "" -":envvar:`PLAT` - description of the current platform, including hardware and " -"OS (see :func:`get_platform`)" -msgstr "" - -#: ../../distutils/apiref.rst:1194 -msgid "" -"Perform shell/Perl-style variable substitution on *s*. Every occurrence of " -"``$`` followed by a name is considered a variable, and variable is " -"substituted by the value found in the *local_vars* dictionary, or in ``os." -"environ`` if it's not in *local_vars*. *os.environ* is first checked/" -"augmented to guarantee that it contains certain values: see :func:" -"`check_environ`. Raise :exc:`ValueError` for any variables not found in " -"either *local_vars* or ``os.environ``." -msgstr "" - -#: ../../distutils/apiref.rst:1201 -msgid "" -"Note that this is not a full-fledged string interpolation function. A valid " -"``$variable`` can consist only of upper and lower case letters, numbers and " -"an underscore. No { } or ( ) style quoting is available." -msgstr "" - -#: ../../distutils/apiref.rst:1208 -msgid "" -"Split a string up according to Unix shell-like rules for quotes and " -"backslashes. In short: words are delimited by spaces, as long as those " -"spaces are not escaped by a backslash, or inside a quoted string. Single and " -"double quotes are equivalent, and the quote characters can be backslash-" -"escaped. The backslash is stripped from any two-character escape sequence, " -"leaving only the escaped character. The quote characters are stripped from " -"any quoted string. Returns a list of words." -msgstr "" - -#: ../../distutils/apiref.rst:1221 -msgid "" -"Perform some action that affects the outside world (for instance, writing to " -"the filesystem). Such actions are special because they are disabled by the " -"*dry_run* flag. This method takes care of all that bureaucracy for you; " -"all you have to do is supply the function to call and an argument tuple for " -"it (to embody the \"external action\" being performed), and an optional " -"message to print." -msgstr "" - -#: ../../distutils/apiref.rst:1230 -msgid "Convert a string representation of truth to true (1) or false (0)." -msgstr "" - -#: ../../distutils/apiref.rst:1232 -msgid "" -"True values are ``y``, ``yes``, ``t``, ``true``, ``on`` and ``1``; false " -"values are ``n``, ``no``, ``f``, ``false``, ``off`` and ``0``. Raises :exc:" -"`ValueError` if *val* is anything else." -msgstr "" - -#: ../../distutils/apiref.rst:1239 -msgid "" -"Byte-compile a collection of Python source files to :file:`.pyc` files in a :" -"file:`__pycache__` subdirectory (see :pep:`3147` and :pep:`488`). *py_files* " -"is a list of files to compile; any files that don't end in :file:`.py` are " -"silently skipped. *optimize* must be one of the following:" -msgstr "" - -#: ../../distutils/apiref.rst:1244 -msgid "``0`` - don't optimize" -msgstr "" - -#: ../../distutils/apiref.rst:1245 -msgid "``1`` - normal optimization (like ``python -O``)" -msgstr "" - -#: ../../distutils/apiref.rst:1246 -msgid "``2`` - extra optimization (like ``python -OO``)" -msgstr "" - -#: ../../distutils/apiref.rst:1248 -msgid "If *force* is true, all files are recompiled regardless of timestamps." -msgstr "" - -#: ../../distutils/apiref.rst:1250 -msgid "" -"The source filename encoded in each :term:`bytecode` file defaults to the " -"filenames listed in *py_files*; you can modify these with *prefix* and " -"*basedir*. *prefix* is a string that will be stripped off of each source " -"filename, and *base_dir* is a directory name that will be prepended (after " -"*prefix* is stripped). You can supply either or both (or neither) of " -"*prefix* and *base_dir*, as you wish." -msgstr "" - -#: ../../distutils/apiref.rst:1257 -msgid "" -"If *dry_run* is true, doesn't actually do anything that would affect the " -"filesystem." -msgstr "" - -#: ../../distutils/apiref.rst:1260 -msgid "" -"Byte-compilation is either done directly in this interpreter process with " -"the standard :mod:`py_compile` module, or indirectly by writing a temporary " -"script and executing it. Normally, you should let :func:`byte_compile` " -"figure out to use direct compilation or not (see the source for details). " -"The *direct* flag is used by the script generated in indirect mode; unless " -"you know what you're doing, leave it set to ``None``." -msgstr "" - -#: ../../distutils/apiref.rst:1267 -msgid "" -"Create ``.pyc`` files with an :func:`import magic tag ` in " -"their name, in a :file:`__pycache__` subdirectory instead of files without " -"tag in the current directory." -msgstr "" - -#: ../../distutils/apiref.rst:1272 -msgid "Create ``.pyc`` files according to :pep:`488`." -msgstr "" - -#: ../../distutils/apiref.rst:1278 -msgid "" -"Return a version of *header* escaped for inclusion in an :rfc:`822` header, " -"by ensuring there are 8 spaces space after each newline. Note that it does " -"no other modification of the string." -msgstr "" - -#: ../../distutils/apiref.rst:1288 -msgid ":mod:`distutils.dist` --- The Distribution class" -msgstr "" - -#: ../../distutils/apiref.rst:1295 -msgid "" -"This module provides the :class:`~distutils.core.Distribution` class, which " -"represents the module distribution being built/installed/distributed." -msgstr "" - -#: ../../distutils/apiref.rst:1300 -msgid ":mod:`distutils.extension` --- The Extension class" -msgstr "" - -#: ../../distutils/apiref.rst:1307 -msgid "" -"This module provides the :class:`Extension` class, used to describe C/C++ " -"extension modules in setup scripts." -msgstr "" - -#: ../../distutils/apiref.rst:1315 -msgid ":mod:`distutils.debug` --- Distutils debug mode" -msgstr "" - -#: ../../distutils/apiref.rst:1321 -msgid "This module provides the DEBUG flag." -msgstr "" - -#: ../../distutils/apiref.rst:1325 -msgid ":mod:`distutils.errors` --- Distutils exceptions" -msgstr "" - -#: ../../distutils/apiref.rst:1331 -msgid "" -"Provides exceptions used by the Distutils modules. Note that Distutils " -"modules may raise standard exceptions; in particular, SystemExit is usually " -"raised for errors that are obviously the end-user's fault (eg. bad command-" -"line arguments)." -msgstr "" - -#: ../../distutils/apiref.rst:1335 -msgid "" -"This module is safe to use in ``from ... import *`` mode; it only exports " -"symbols whose names start with ``Distutils`` and end with ``Error``." -msgstr "" - -#: ../../distutils/apiref.rst:1340 -msgid "" -":mod:`distutils.fancy_getopt` --- Wrapper around the standard getopt module" -msgstr "" - -#: ../../distutils/apiref.rst:1346 -msgid "" -"This module provides a wrapper around the standard :mod:`getopt` module " -"that provides the following additional features:" -msgstr "" - -#: ../../distutils/apiref.rst:1349 -msgid "short and long options are tied together" -msgstr "" - -#: ../../distutils/apiref.rst:1351 -msgid "" -"options have help strings, so :func:`fancy_getopt` could potentially create " -"a complete usage summary" -msgstr "" - -#: ../../distutils/apiref.rst:1354 -msgid "options set attributes of a passed-in object" -msgstr "" - -#: ../../distutils/apiref.rst:1356 -msgid "" -"boolean options can have \"negative aliases\" --- eg. if :option:`!--quiet` " -"is the \"negative alias\" of :option:`!--verbose`, then :option:`!--quiet` " -"on the command line sets *verbose* to false." -msgstr "" - -#: ../../distutils/apiref.rst:1362 -msgid "" -"Wrapper function. *options* is a list of ``(long_option, short_option, " -"help_string)`` 3-tuples as described in the constructor for :class:" -"`FancyGetopt`. *negative_opt* should be a dictionary mapping option names to " -"option names, both the key and value should be in the *options* list. " -"*object* is an object which will be used to store values (see the :meth:" -"`getopt` method of the :class:`FancyGetopt` class). *args* is the argument " -"list. Will use ``sys.argv[1:]`` if you pass ``None`` as *args*." -msgstr "" - -#: ../../distutils/apiref.rst:1373 -msgid "Wraps *text* to less than *width* wide." -msgstr "" - -#: ../../distutils/apiref.rst:1378 -msgid "" -"The option_table is a list of 3-tuples: ``(long_option, short_option, " -"help_string)``" -msgstr "" - -#: ../../distutils/apiref.rst:1381 -msgid "" -"If an option takes an argument, its *long_option* should have ``'='`` " -"appended; *short_option* should just be a single character, no ``':'`` in " -"any case. *short_option* should be ``None`` if a *long_option* doesn't have " -"a corresponding *short_option*. All option tuples must have long options." -msgstr "" - -#: ../../distutils/apiref.rst:1386 -msgid "The :class:`FancyGetopt` class provides the following methods:" -msgstr "" - -#: ../../distutils/apiref.rst:1391 -msgid "Parse command-line options in args. Store as attributes on *object*." -msgstr "" - -#: ../../distutils/apiref.rst:1393 -msgid "" -"If *args* is ``None`` or not supplied, uses ``sys.argv[1:]``. If *object* " -"is ``None`` or not supplied, creates a new :class:`OptionDummy` instance, " -"stores option values there, and returns a tuple ``(args, object)``. If " -"*object* is supplied, it is modified in place and :func:`getopt` just " -"returns *args*; in both cases, the returned *args* is a modified copy of the " -"passed-in *args* list, which is left untouched." -msgstr "" - -#: ../../distutils/apiref.rst:1405 -msgid "" -"Returns the list of ``(option, value)`` tuples processed by the previous run " -"of :meth:`getopt` Raises :exc:`RuntimeError` if :meth:`getopt` hasn't been " -"called yet." -msgstr "" - -#: ../../distutils/apiref.rst:1412 -msgid "" -"Generate help text (a list of strings, one per suggested line of output) " -"from the option table for this :class:`FancyGetopt` object." -msgstr "" - -#: ../../distutils/apiref.rst:1415 -msgid "If supplied, prints the supplied *header* at the top of the help." -msgstr "" - -#: ../../distutils/apiref.rst:1419 -msgid ":mod:`distutils.filelist` --- The FileList class" -msgstr "" - -#: ../../distutils/apiref.rst:1426 -msgid "" -"This module provides the :class:`FileList` class, used for poking about the " -"filesystem and building lists of files." -msgstr "" - -#: ../../distutils/apiref.rst:1431 -msgid ":mod:`distutils.log` --- Simple :pep:`282`-style logging" -msgstr "" - -#: ../../distutils/apiref.rst:1438 -msgid ":mod:`distutils.spawn` --- Spawn a sub-process" -msgstr "" - -#: ../../distutils/apiref.rst:1444 -msgid "" -"This module provides the :func:`spawn` function, a front-end to various " -"platform-specific functions for launching another program in a sub-process. " -"Also provides :func:`find_executable` to search the path for a given " -"executable name." -msgstr "" - -#: ../../distutils/apiref.rst:1451 -msgid ":mod:`distutils.sysconfig` --- System configuration information" -msgstr "" - -#: ../../distutils/apiref.rst:1455 -msgid ":mod:`distutils.sysconfig` has been merged into :mod:`sysconfig`." -msgstr "" - -#: ../../distutils/apiref.rst:1462 -msgid "" -"The :mod:`distutils.sysconfig` module provides access to Python's low-level " -"configuration information. The specific configuration variables available " -"depend heavily on the platform and configuration. The specific variables " -"depend on the build process for the specific version of Python being run; " -"the variables are those found in the :file:`Makefile` and configuration " -"header that are installed with Python on Unix systems. The configuration " -"header is called :file:`pyconfig.h` for Python versions starting with 2.2, " -"and :file:`config.h` for earlier versions of Python." -msgstr "" - -#: ../../distutils/apiref.rst:1471 -msgid "" -"Some additional functions are provided which perform some useful " -"manipulations for other parts of the :mod:`distutils` package." -msgstr "" - -#: ../../distutils/apiref.rst:1477 -msgid "The result of ``os.path.normpath(sys.prefix)``." -msgstr "" - -#: ../../distutils/apiref.rst:1482 -msgid "The result of ``os.path.normpath(sys.exec_prefix)``." -msgstr "" - -#: ../../distutils/apiref.rst:1487 -msgid "" -"Return the value of a single variable. This is equivalent to " -"``get_config_vars().get(name)``." -msgstr "" - -#: ../../distutils/apiref.rst:1493 -msgid "" -"Return a set of variable definitions. If there are no arguments, this " -"returns a dictionary mapping names of configuration variables to values. If " -"arguments are provided, they should be strings, and the return value will be " -"a sequence giving the associated values. If a given name does not have a " -"corresponding value, ``None`` will be included for that variable." -msgstr "" - -#: ../../distutils/apiref.rst:1502 -msgid "" -"Return the full path name of the configuration header. For Unix, this will " -"be the header generated by the :program:`configure` script; for other " -"platforms the header will have been supplied directly by the Python source " -"distribution. The file is a platform-specific text file." -msgstr "" - -#: ../../distutils/apiref.rst:1510 -msgid "" -"Return the full path name of the :file:`Makefile` used to build Python. For " -"Unix, this will be a file generated by the :program:`configure` script; the " -"meaning for other platforms will vary. The file is a platform-specific text " -"file, if it exists. This function is only useful on POSIX platforms." -msgstr "" - -#: ../../distutils/apiref.rst:1515 -msgid "" -"The following functions are deprecated together with this module and they " -"have no direct replacement." -msgstr "" - -#: ../../distutils/apiref.rst:1521 -msgid "" -"Return the directory for either the general or platform-dependent C include " -"files. If *plat_specific* is true, the platform-dependent include directory " -"is returned; if false or omitted, the platform-independent directory is " -"returned. If *prefix* is given, it is used as either the prefix instead of :" -"const:`PREFIX`, or as the exec-prefix instead of :const:`EXEC_PREFIX` if " -"*plat_specific* is true." -msgstr "" - -#: ../../distutils/apiref.rst:1531 -msgid "" -"Return the directory for either the general or platform-dependent library " -"installation. If *plat_specific* is true, the platform-dependent include " -"directory is returned; if false or omitted, the platform-independent " -"directory is returned. If *prefix* is given, it is used as either the " -"prefix instead of :const:`PREFIX`, or as the exec-prefix instead of :const:" -"`EXEC_PREFIX` if *plat_specific* is true. If *standard_lib* is true, the " -"directory for the standard library is returned rather than the directory for " -"the installation of third-party extensions." -msgstr "" - -#: ../../distutils/apiref.rst:1540 -msgid "" -"The following function is only intended for use within the :mod:`distutils` " -"package." -msgstr "" - -#: ../../distutils/apiref.rst:1546 -msgid "" -"Do any platform-specific customization of a :class:`distutils.ccompiler." -"CCompiler` instance." -msgstr "" - -#: ../../distutils/apiref.rst:1549 -msgid "" -"This function is only needed on Unix at this time, but should be called " -"consistently to support forward-compatibility. It inserts the information " -"that varies across Unix flavors and is stored in Python's :file:`Makefile`. " -"This information includes the selected compiler, compiler and linker " -"options, and the extension used by the linker for shared objects." -msgstr "" - -#: ../../distutils/apiref.rst:1555 -msgid "" -"This function is even more special-purpose, and should only be used from " -"Python's own build procedures." -msgstr "" - -#: ../../distutils/apiref.rst:1561 -msgid "" -"Inform the :mod:`distutils.sysconfig` module that it is being used as part " -"of the build process for Python. This changes a lot of relative locations " -"for files, allowing them to be located in the build area rather than in an " -"installed Python." -msgstr "" - -#: ../../distutils/apiref.rst:1568 -msgid ":mod:`distutils.text_file` --- The TextFile class" -msgstr "" - -#: ../../distutils/apiref.rst:1574 -msgid "" -"This module provides the :class:`TextFile` class, which gives an interface " -"to text files that (optionally) takes care of stripping comments, ignoring " -"blank lines, and joining lines with backslashes." -msgstr "" - -#: ../../distutils/apiref.rst:1581 -msgid "" -"This class provides a file-like object that takes care of all the things " -"you commonly want to do when processing a text file that has some line-by-" -"line syntax: strip comments (as long as ``#`` is your comment character), " -"skip blank lines, join adjacent lines by escaping the newline (ie. backslash " -"at end of line), strip leading and/or trailing whitespace. All of these are " -"optional and independently controllable." -msgstr "" - -#: ../../distutils/apiref.rst:1588 -msgid "" -"The class provides a :meth:`warn` method so you can generate warning " -"messages that report physical line number, even if the logical line in " -"question spans multiple physical lines. Also provides :meth:`unreadline` " -"for implementing line-at-a-time lookahead." -msgstr "" - -#: ../../distutils/apiref.rst:1593 -msgid "" -":class:`TextFile` instances are create with either *filename*, *file*, or " -"both. :exc:`RuntimeError` is raised if both are ``None``. *filename* should " -"be a string, and *file* a file object (or something that provides :meth:" -"`readline` and :meth:`close` methods). It is recommended that you supply " -"at least *filename*, so that :class:`TextFile` can include it in warning " -"messages. If *file* is not supplied, :class:`TextFile` creates its own " -"using the :func:`open` built-in function." -msgstr "" - -#: ../../distutils/apiref.rst:1601 -msgid "" -"The options are all boolean, and affect the values returned by :meth:" -"`readline`" -msgstr "" - -#: ../../distutils/apiref.rst:1606 -msgid "option name" -msgstr "" - -#: ../../distutils/apiref.rst:1606 -msgid "default" -msgstr "" - -#: ../../distutils/apiref.rst:1608 -msgid "*strip_comments*" -msgstr "*strip_comments*" - -#: ../../distutils/apiref.rst:1608 -msgid "" -"strip from ``'#'`` to end-of-line, as well as any whitespace leading up to " -"the ``'#'``\\ ---unless it is escaped by a backslash" -msgstr "" - -#: ../../distutils/apiref.rst:1608 ../../distutils/apiref.rst:1617 -#: ../../distutils/apiref.rst:1622 -msgid "true" -msgstr "" - -#: ../../distutils/apiref.rst:1614 -msgid "*lstrip_ws*" -msgstr "*lstrip_ws*" - -#: ../../distutils/apiref.rst:1614 -msgid "strip leading whitespace from each line before returning it" -msgstr "" - -#: ../../distutils/apiref.rst:1614 ../../distutils/apiref.rst:1632 -#: ../../distutils/apiref.rst:1643 -msgid "false" -msgstr "" - -#: ../../distutils/apiref.rst:1617 -msgid "*rstrip_ws*" -msgstr "*rstrip_ws*" - -#: ../../distutils/apiref.rst:1617 -msgid "" -"strip trailing whitespace (including line terminator!) from each line before " -"returning it." -msgstr "" - -#: ../../distutils/apiref.rst:1622 -msgid "*skip_blanks*" -msgstr "*skip_blanks*" - -#: ../../distutils/apiref.rst:1622 -msgid "" -"skip lines that are empty \\*after\\* stripping comments and whitespace. " -"(If both lstrip_ws and rstrip_ws are false, then some lines may consist of " -"solely whitespace: these will \\*not\\* be skipped, even if *skip_blanks* is " -"true.)" -msgstr "" - -#: ../../distutils/apiref.rst:1632 -msgid "*join_lines*" -msgstr "*join_lines*" - -#: ../../distutils/apiref.rst:1632 -msgid "" -"if a backslash is the last non-newline character on a line after stripping " -"comments and whitespace, join the following line to it to form one logical " -"line; if N consecutive lines end with a backslash, then N+1 physical lines " -"will be joined to form one logical line." -msgstr "" - -#: ../../distutils/apiref.rst:1643 -msgid "*collapse_join*" -msgstr "*collapse_join*" - -#: ../../distutils/apiref.rst:1643 -msgid "" -"strip leading whitespace from lines that are joined to their predecessor; " -"only matters if ``(join_lines and not lstrip_ws)``" -msgstr "" - -#: ../../distutils/apiref.rst:1650 -msgid "" -"Note that since *rstrip_ws* can strip the trailing newline, the semantics " -"of :meth:`readline` must differ from those of the built-in file object's :" -"meth:`readline` method! In particular, :meth:`readline` returns ``None`` " -"for end-of-file: an empty string might just be a blank line (or an all-" -"whitespace line), if *rstrip_ws* is true but *skip_blanks* is not." -msgstr "" - -#: ../../distutils/apiref.rst:1659 -msgid "" -"Open a new file *filename*. This overrides any *file* or *filename* " -"constructor arguments." -msgstr "" - -#: ../../distutils/apiref.rst:1665 -msgid "" -"Close the current file and forget everything we know about it (including the " -"filename and the current line number)." -msgstr "" - -#: ../../distutils/apiref.rst:1671 -msgid "" -"Print (to stderr) a warning message tied to the current logical line in the " -"current file. If the current logical line in the file spans multiple " -"physical lines, the warning refers to the whole range, such as ``\"lines " -"3-5\"``. If *line* is supplied, it overrides the current line number; it " -"may be a list or tuple to indicate a range of physical lines, or an integer " -"for a single physical line." -msgstr "" - -#: ../../distutils/apiref.rst:1681 -msgid "" -"Read and return a single logical line from the current file (or from an " -"internal buffer if lines have previously been \"unread\" with :meth:" -"`unreadline`). If the *join_lines* option is true, this may involve " -"reading multiple physical lines concatenated into a single string. Updates " -"the current line number, so calling :meth:`warn` after :meth:`readline` " -"emits a warning about the physical line(s) just read. Returns ``None`` on " -"end-of-file, since the empty string can occur if *rstrip_ws* is true but " -"*strip_blanks* is not." -msgstr "" - -#: ../../distutils/apiref.rst:1692 -msgid "" -"Read and return the list of all logical lines remaining in the current file. " -"This updates the current line number to the last line of the file." -msgstr "" - -#: ../../distutils/apiref.rst:1698 -msgid "" -"Push *line* (a string) onto an internal buffer that will be checked by " -"future :meth:`readline` calls. Handy for implementing a parser with line-at-" -"a-time lookahead. Note that lines that are \"unread\" with :meth:" -"`unreadline` are not subsequently re-cleansed (whitespace stripped, or " -"whatever) when read with :meth:`readline`. If multiple calls are made to :" -"meth:`unreadline` before a call to :meth:`readline`, the lines will be " -"returned most in most recent first order." -msgstr "" - -#: ../../distutils/apiref.rst:1707 -msgid ":mod:`distutils.version` --- Version number classes" -msgstr "" - -#: ../../distutils/apiref.rst:1722 -msgid ":mod:`distutils.cmd` --- Abstract base class for Distutils commands" -msgstr "" - -#: ../../distutils/apiref.rst:1729 -msgid "This module supplies the abstract base class :class:`Command`." -msgstr "" - -#: ../../distutils/apiref.rst:1734 -msgid "" -"Abstract base class for defining command classes, the \"worker bees\" of the " -"Distutils. A useful analogy for command classes is to think of them as " -"subroutines with local variables called *options*. The options are declared " -"in :meth:`initialize_options` and defined (given their final values) in :" -"meth:`finalize_options`, both of which must be defined by every command " -"class. The distinction between the two is necessary because option values " -"might come from the outside world (command line, config file, ...), and any " -"options dependent on other options must be computed after these outside " -"influences have been processed --- hence :meth:`finalize_options`. The body " -"of the subroutine, where it does all its work based on the values of its " -"options, is the :meth:`run` method, which must also be implemented by every " -"command class." -msgstr "" - -#: ../../distutils/apiref.rst:1747 -msgid "" -"The class constructor takes a single argument *dist*, a :class:`~distutils." -"core.Distribution` instance." -msgstr "" - -#: ../../distutils/apiref.rst:1752 -msgid "Creating a new Distutils command" -msgstr "" - -#: ../../distutils/apiref.rst:1754 -msgid "This section outlines the steps to create a new Distutils command." -msgstr "" - -#: ../../distutils/apiref.rst:1756 -msgid "" -"A new command lives in a module in the :mod:`distutils.command` package. " -"There is a sample template in that directory called :file:" -"`command_template`. Copy this file to a new module with the same name as " -"the new command you're implementing. This module should implement a class " -"with the same name as the module (and the command). So, for instance, to " -"create the command ``peel_banana`` (so that users can run ``setup.py " -"peel_banana``), you'd copy :file:`command_template` to :file:`distutils/" -"command/peel_banana.py`, then edit it so that it's implementing the class :" -"class:`peel_banana`, a subclass of :class:`distutils.cmd.Command`." -msgstr "" - -#: ../../distutils/apiref.rst:1766 -msgid "Subclasses of :class:`Command` must define the following methods." -msgstr "" - -#: ../../distutils/apiref.rst:1770 -msgid "" -"Set default values for all the options that this command supports. Note " -"that these defaults may be overridden by other commands, by the setup " -"script, by config files, or by the command-line. Thus, this is not the " -"place to code dependencies between options; generally, :meth:" -"`initialize_options` implementations are just a bunch of ``self.foo = None`` " -"assignments." -msgstr "" - -#: ../../distutils/apiref.rst:1779 -msgid "" -"Set final values for all the options that this command supports. This is " -"always called as late as possible, ie. after any option assignments from " -"the command-line or from other commands have been done. Thus, this is the " -"place to code option dependencies: if *foo* depends on *bar*, then it is " -"safe to set *foo* from *bar* as long as *foo* still has the same value it " -"was assigned in :meth:`initialize_options`." -msgstr "" - -#: ../../distutils/apiref.rst:1789 -msgid "" -"A command's raison d'etre: carry out the action it exists to perform, " -"controlled by the options initialized in :meth:`initialize_options`, " -"customized by other commands, the setup script, the command-line, and config " -"files, and finalized in :meth:`finalize_options`. All terminal output and " -"filesystem interaction should be done by :meth:`run`." -msgstr "" - -#: ../../distutils/apiref.rst:1798 -msgid "" -"*sub_commands* formalizes the notion of a \"family\" of commands, e.g. " -"``install`` as the parent with sub-commands ``install_lib``, " -"``install_headers``, etc. The parent of a family of commands defines " -"*sub_commands* as a class attribute; it's a list of 2-tuples " -"``(command_name, predicate)``, with *command_name* a string and *predicate* " -"a function, a string or ``None``. *predicate* is a method of the parent " -"command that determines whether the corresponding command is applicable in " -"the current situation. (E.g. ``install_headers`` is only applicable if we " -"have any C header files to install.) If *predicate* is ``None``, that " -"command is always applicable." -msgstr "" - -#: ../../distutils/apiref.rst:1809 -msgid "" -"*sub_commands* is usually defined at the *end* of a class, because " -"predicates can be methods of the class, so they must already have been " -"defined. The canonical example is the :command:`install` command." -msgstr "" - -#: ../../distutils/apiref.rst:1815 -msgid ":mod:`distutils.command` --- Individual Distutils commands" -msgstr "" - -#: ../../distutils/apiref.rst:1826 -msgid ":mod:`distutils.command.bdist` --- Build a binary installer" -msgstr "" - -#: ../../distutils/apiref.rst:1836 -msgid "" -":mod:`distutils.command.bdist_packager` --- Abstract base class for packagers" -msgstr "" - -#: ../../distutils/apiref.rst:1846 -msgid ":mod:`distutils.command.bdist_dumb` --- Build a \"dumb\" installer" -msgstr "" - -#: ../../distutils/apiref.rst:1856 -msgid "" -":mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a " -"Redhat RPM and SRPM" -msgstr "" - -#: ../../distutils/apiref.rst:1866 -msgid ":mod:`distutils.command.sdist` --- Build a source distribution" -msgstr "" - -#: ../../distutils/apiref.rst:1876 -msgid ":mod:`distutils.command.build` --- Build all files of a package" -msgstr "" - -#: ../../distutils/apiref.rst:1886 -msgid "" -":mod:`distutils.command.build_clib` --- Build any C libraries in a package" -msgstr "" - -#: ../../distutils/apiref.rst:1896 -msgid "" -":mod:`distutils.command.build_ext` --- Build any extensions in a package" -msgstr "" - -#: ../../distutils/apiref.rst:1906 -msgid "" -":mod:`distutils.command.build_py` --- Build the .py/.pyc files of a package" -msgstr "" - -#: ../../distutils/apiref.rst:1916 -msgid "" -"Alternative implementation of build_py which also runs the 2to3 conversion " -"library on each .py file that is going to be installed. To use this in a " -"setup.py file for a distribution that is designed to run with both Python 2." -"x and 3.x, add::" -msgstr "" - -#: ../../distutils/apiref.rst:1926 -msgid "to your setup.py, and later::" -msgstr "" - -#: ../../distutils/apiref.rst:1930 -msgid "to the invocation of setup()." -msgstr "" - -#: ../../distutils/apiref.rst:1934 -msgid "" -":mod:`distutils.command.build_scripts` --- Build the scripts of a package" -msgstr "" - -#: ../../distutils/apiref.rst:1944 -msgid ":mod:`distutils.command.clean` --- Clean a package build area" -msgstr "" - -#: ../../distutils/apiref.rst:1949 -msgid "" -"This command removes the temporary files created by :command:`build` and its " -"subcommands, like intermediary compiled object files. With the ``--all`` " -"option, the complete build directory will be removed." -msgstr "" - -#: ../../distutils/apiref.rst:1953 -msgid "" -"Extension modules built :ref:`in place ` will " -"not be cleaned, as they are not in the build directory." -msgstr "" - -#: ../../distutils/apiref.rst:1958 -msgid ":mod:`distutils.command.config` --- Perform package configuration" -msgstr "" - -#: ../../distutils/apiref.rst:1968 -msgid ":mod:`distutils.command.install` --- Install a package" -msgstr "" - -#: ../../distutils/apiref.rst:1978 -msgid "" -":mod:`distutils.command.install_data` --- Install data files from a package" -msgstr "" - -#: ../../distutils/apiref.rst:1988 -msgid "" -":mod:`distutils.command.install_headers` --- Install C/C++ header files from " -"a package" -msgstr "" - -#: ../../distutils/apiref.rst:1998 -msgid "" -":mod:`distutils.command.install_lib` --- Install library files from a package" -msgstr "" - -#: ../../distutils/apiref.rst:2008 -msgid "" -":mod:`distutils.command.install_scripts` --- Install script files from a " -"package" -msgstr "" - -#: ../../distutils/apiref.rst:2018 -msgid "" -":mod:`distutils.command.register` --- Register a module with the Python " -"Package Index" -msgstr "" - -#: ../../distutils/apiref.rst:2024 -msgid "" -"The ``register`` command registers the package with the Python Package " -"Index. This is described in more detail in :pep:`301`." -msgstr "" - -#: ../../distutils/apiref.rst:2031 -msgid ":mod:`distutils.command.check` --- Check the meta-data of a package" -msgstr "" - -#: ../../distutils/apiref.rst:2037 -msgid "" -"The ``check`` command performs some tests on the meta-data of a package. For " -"example, it verifies that all required meta-data are provided as the " -"arguments passed to the :func:`setup` function." -msgstr "" diff --git a/distutils/builtdist.po b/distutils/builtdist.po deleted file mode 100644 index 3560b71e0e..0000000000 --- a/distutils/builtdist.po +++ /dev/null @@ -1,709 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+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-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/builtdist.rst:5 -msgid "Creating Built Distributions" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/builtdist.rst:9 -msgid "" -"A \"built distribution\" is what you're probably used to thinking of either " -"as a \"binary package\" or an \"installer\" (depending on your background). " -"It's not necessarily binary, though, because it might contain only Python " -"source code and/or byte-code; and we don't call it a package, because that " -"word is already spoken for in Python. (And \"installer\" is a term specific " -"to the world of mainstream desktop systems.)" -msgstr "" - -#: ../../distutils/builtdist.rst:16 -msgid "" -"A built distribution is how you make life as easy as possible for installers " -"of your module distribution: for users of RPM-based Linux systems, it's a " -"binary RPM; for Windows users, it's an executable installer; for Debian-" -"based Linux users, it's a Debian package; and so forth. Obviously, no one " -"person will be able to create built distributions for every platform under " -"the sun, so the Distutils are designed to enable module developers to " -"concentrate on their specialty---writing code and creating source " -"distributions---while an intermediary species called *packagers* springs up " -"to turn source distributions into built distributions for as many platforms " -"as there are packagers." -msgstr "" - -#: ../../distutils/builtdist.rst:26 -msgid "" -"Of course, the module developer could be their own packager; or the packager " -"could be a volunteer \"out there\" somewhere who has access to a platform " -"which the original developer does not; or it could be software periodically " -"grabbing new source distributions and turning them into built distributions " -"for as many platforms as the software has access to. Regardless of who they " -"are, a packager uses the setup script and the :command:`bdist` command " -"family to generate built distributions." -msgstr "" - -#: ../../distutils/builtdist.rst:34 -msgid "" -"As a simple example, if I run the following command in the Distutils source " -"tree::" -msgstr "" - -#: ../../distutils/builtdist.rst:39 -msgid "" -"then the Distutils builds my module distribution (the Distutils itself in " -"this case), does a \"fake\" installation (also in the :file:`build` " -"directory), and creates the default type of built distribution for my " -"platform. The default format for built distributions is a \"dumb\" tar file " -"on Unix, and a simple executable installer on Windows. (That tar file is " -"considered \"dumb\" because it has to be unpacked in a specific location to " -"work.)" -msgstr "" - -#: ../../distutils/builtdist.rst:46 -msgid "" -"Thus, the above command on a Unix system creates :file:`Distutils-1.0.{plat}." -"tar.gz`; unpacking this tarball from the right place installs the Distutils " -"just as though you had downloaded the source distribution and run ``python " -"setup.py install``. (The \"right place\" is either the root of the " -"filesystem or Python's :file:`{prefix}` directory, depending on the options " -"given to the :command:`bdist_dumb` command; the default is to make dumb " -"distributions relative to :file:`{prefix}`.)" -msgstr "" - -#: ../../distutils/builtdist.rst:54 -msgid "" -"Obviously, for pure Python distributions, this isn't any simpler than just " -"running ``python setup.py install``\\ ---but for non-pure distributions, " -"which include extensions that would need to be compiled, it can mean the " -"difference between someone being able to use your extensions or not. And " -"creating \"smart\" built distributions, such as an RPM package or an " -"executable installer for Windows, is far more convenient for users even if " -"your distribution doesn't include any extensions." -msgstr "" - -#: ../../distutils/builtdist.rst:62 -msgid "" -"The :command:`bdist` command has a :option:`!--formats` option, similar to " -"the :command:`sdist` command, which you can use to select the types of built " -"distribution to generate: for example, ::" -msgstr "" - -#: ../../distutils/builtdist.rst:68 -msgid "" -"would, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\\ " -"---again, this archive would be unpacked from the root directory to install " -"the Distutils." -msgstr "" - -#: ../../distutils/builtdist.rst:72 -msgid "The available formats for built distributions are:" -msgstr "" - -#: ../../distutils/builtdist.rst:75 -msgid "Format" -msgstr "" - -#: ../../distutils/builtdist.rst:75 -msgid "Description" -msgstr "描述" - -#: ../../distutils/builtdist.rst:75 -msgid "Notes" -msgstr "註解" - -#: ../../distutils/builtdist.rst:77 -msgid "``gztar``" -msgstr "``gztar``" - -#: ../../distutils/builtdist.rst:77 -msgid "gzipped tar file (:file:`.tar.gz`)" -msgstr "" - -#: ../../distutils/builtdist.rst:77 -msgid "\\(1)" -msgstr "\\(1)" - -#: ../../distutils/builtdist.rst:80 -msgid "``bztar``" -msgstr "``bztar``" - -#: ../../distutils/builtdist.rst:80 -msgid "bzipped tar file (:file:`.tar.bz2`)" -msgstr "" - -#: ../../distutils/builtdist.rst:83 -msgid "``xztar``" -msgstr "``xztar``" - -#: ../../distutils/builtdist.rst:83 -msgid "xzipped tar file (:file:`.tar.xz`)" -msgstr "" - -#: ../../distutils/builtdist.rst:86 -msgid "``ztar``" -msgstr "``ztar``" - -#: ../../distutils/builtdist.rst:86 -msgid "compressed tar file (:file:`.tar.Z`)" -msgstr "" - -#: ../../distutils/builtdist.rst:86 -msgid "\\(3)" -msgstr "\\(3)" - -#: ../../distutils/builtdist.rst:89 -msgid "``tar``" -msgstr "``tar``" - -#: ../../distutils/builtdist.rst:89 -msgid "tar file (:file:`.tar`)" -msgstr "" - -#: ../../distutils/builtdist.rst:91 -msgid "``zip``" -msgstr "``zip``" - -#: ../../distutils/builtdist.rst:91 -msgid "zip file (:file:`.zip`)" -msgstr "" - -#: ../../distutils/builtdist.rst:91 -msgid "(2),(4)" -msgstr "(2),(4)" - -#: ../../distutils/builtdist.rst:93 -msgid "``rpm``" -msgstr "``rpm``" - -#: ../../distutils/builtdist.rst:93 -msgid "RPM" -msgstr "RPM" - -#: ../../distutils/builtdist.rst:93 -msgid "\\(5)" -msgstr "\\(5)" - -#: ../../distutils/builtdist.rst:95 -msgid "``pkgtool``" -msgstr "``pkgtool``" - -#: ../../distutils/builtdist.rst:95 -msgid "Solaris :program:`pkgtool`" -msgstr "" - -#: ../../distutils/builtdist.rst:97 -msgid "``sdux``" -msgstr "``sdux``" - -#: ../../distutils/builtdist.rst:97 -msgid "HP-UX :program:`swinstall`" -msgstr "HP-UX :program:`swinstall`" - -#: ../../distutils/builtdist.rst:99 -msgid "``msi``" -msgstr "``msi``" - -#: ../../distutils/builtdist.rst:99 -msgid "Microsoft Installer." -msgstr "" - -#: ../../distutils/builtdist.rst:102 -msgid "Added support for the ``xztar`` format." -msgstr "" - -#: ../../distutils/builtdist.rst:106 -msgid "Notes:" -msgstr "註解:" - -#: ../../distutils/builtdist.rst:109 -msgid "default on Unix" -msgstr "" - -#: ../../distutils/builtdist.rst:112 -msgid "default on Windows" -msgstr "" - -#: ../../distutils/builtdist.rst:115 -msgid "requires external :program:`compress` utility." -msgstr "" - -#: ../../distutils/builtdist.rst:118 -msgid "" -"requires either external :program:`zip` utility or :mod:`zipfile` module " -"(part of the standard Python library since Python 1.6)" -msgstr "" - -#: ../../distutils/builtdist.rst:122 -msgid "" -"requires external :program:`rpm` utility, version 3.0.4 or better (use ``rpm " -"--version`` to find out which version you have)" -msgstr "" - -#: ../../distutils/builtdist.rst:125 -msgid "" -"You don't have to use the :command:`bdist` command with the :option:`!--" -"formats` option; you can also use the command that directly implements the " -"format you're interested in. Some of these :command:`bdist` \"sub-commands" -"\" actually generate several similar formats; for instance, the :command:" -"`bdist_dumb` command generates all the \"dumb\" archive formats (``tar``, " -"``gztar``, ``bztar``, ``xztar``, ``ztar``, and ``zip``), and :command:" -"`bdist_rpm` generates both binary and source RPMs. The :command:`bdist` sub-" -"commands, and the formats generated by each, are:" -msgstr "" - -#: ../../distutils/builtdist.rst:135 -msgid "Command" -msgstr "" - -#: ../../distutils/builtdist.rst:135 -msgid "Formats" -msgstr "" - -#: ../../distutils/builtdist.rst:137 -msgid ":command:`bdist_dumb`" -msgstr ":command:`bdist_dumb`" - -#: ../../distutils/builtdist.rst:137 -msgid "tar, gztar, bztar, xztar, ztar, zip" -msgstr "tar, gztar, bztar, xztar, ztar, zip" - -#: ../../distutils/builtdist.rst:139 -msgid ":command:`bdist_rpm`" -msgstr ":command:`bdist_rpm`" - -#: ../../distutils/builtdist.rst:139 -msgid "rpm, srpm" -msgstr "rpm, srpm" - -#: ../../distutils/builtdist.rst:142 -msgid "" -"The following sections give details on the individual :command:`bdist_\\*` " -"commands." -msgstr "" - -#: ../../distutils/builtdist.rst:158 -msgid "Creating RPM packages" -msgstr "" - -#: ../../distutils/builtdist.rst:160 -msgid "" -"The RPM format is used by many popular Linux distributions, including Red " -"Hat, SuSE, and Mandrake. If one of these (or any of the other RPM-based " -"Linux distributions) is your usual environment, creating RPM packages for " -"other users of that same distribution is trivial. Depending on the " -"complexity of your module distribution and differences between Linux " -"distributions, you may also be able to create RPMs that work on different " -"RPM-based distributions." -msgstr "" - -#: ../../distutils/builtdist.rst:167 -msgid "" -"The usual way to create an RPM of your module distribution is to run the :" -"command:`bdist_rpm` command::" -msgstr "" - -#: ../../distutils/builtdist.rst:172 -msgid "or the :command:`bdist` command with the :option:`!--format` option::" -msgstr "" - -#: ../../distutils/builtdist.rst:176 -msgid "" -"The former allows you to specify RPM-specific options; the latter allows " -"you to easily specify multiple formats in one run. If you need to do both, " -"you can explicitly specify multiple :command:`bdist_\\*` commands and their " -"options::" -msgstr "" - -#: ../../distutils/builtdist.rst:182 -msgid "" -"Creating RPM packages is driven by a :file:`.spec` file, much as using the " -"Distutils is driven by the setup script. To make your life easier, the :" -"command:`bdist_rpm` command normally creates a :file:`.spec` file based on " -"the information you supply in the setup script, on the command line, and in " -"any Distutils configuration files. Various options and sections in the :" -"file:`.spec` file are derived from options in the setup script as follows:" -msgstr "" - -#: ../../distutils/builtdist.rst:190 ../../distutils/builtdist.rst:214 -msgid "RPM :file:`.spec` file option or section" -msgstr "" - -#: ../../distutils/builtdist.rst:190 -msgid "Distutils setup script option" -msgstr "" - -#: ../../distutils/builtdist.rst:192 -msgid "Name" -msgstr "" - -#: ../../distutils/builtdist.rst:192 -msgid "``name``" -msgstr "``name``" - -#: ../../distutils/builtdist.rst:194 -msgid "Summary (in preamble)" -msgstr "" - -#: ../../distutils/builtdist.rst:194 -msgid "``description``" -msgstr "``description``" - -#: ../../distutils/builtdist.rst:196 -msgid "Version" -msgstr "" - -#: ../../distutils/builtdist.rst:196 -msgid "``version``" -msgstr "``version``" - -#: ../../distutils/builtdist.rst:198 ../../distutils/builtdist.rst:221 -msgid "Vendor" -msgstr "" - -#: ../../distutils/builtdist.rst:198 -msgid "" -"``author`` and ``author_email``, or --- & ``maintainer`` and " -"``maintainer_email``" -msgstr "" - -#: ../../distutils/builtdist.rst:202 -msgid "Copyright" -msgstr "版權宣告" - -#: ../../distutils/builtdist.rst:202 -msgid "``license``" -msgstr "``license``" - -#: ../../distutils/builtdist.rst:204 -msgid "Url" -msgstr "" - -#: ../../distutils/builtdist.rst:204 -msgid "``url``" -msgstr "``url``" - -#: ../../distutils/builtdist.rst:206 -msgid "%description (section)" -msgstr "" - -#: ../../distutils/builtdist.rst:206 -msgid "``long_description``" -msgstr "``long_description``" - -#: ../../distutils/builtdist.rst:209 -msgid "" -"Additionally, there are many options in :file:`.spec` files that don't have " -"corresponding options in the setup script. Most of these are handled " -"through options to the :command:`bdist_rpm` command as follows:" -msgstr "" - -#: ../../distutils/builtdist.rst:214 -msgid ":command:`bdist_rpm` option" -msgstr "" - -#: ../../distutils/builtdist.rst:214 -msgid "default value" -msgstr "" - -#: ../../distutils/builtdist.rst:217 -msgid "Release" -msgstr "" - -#: ../../distutils/builtdist.rst:217 -msgid "``release``" -msgstr "``release``" - -#: ../../distutils/builtdist.rst:217 -msgid "\"1\"" -msgstr "\"1\"" - -#: ../../distutils/builtdist.rst:219 -msgid "Group" -msgstr "" - -#: ../../distutils/builtdist.rst:219 -msgid "``group``" -msgstr "``group``" - -#: ../../distutils/builtdist.rst:219 -msgid "\"Development/Libraries\"" -msgstr "" - -#: ../../distutils/builtdist.rst:221 -msgid "``vendor``" -msgstr "``vendor``" - -#: ../../distutils/builtdist.rst:221 -msgid "(see above)" -msgstr "" - -#: ../../distutils/builtdist.rst:223 -msgid "Packager" -msgstr "" - -#: ../../distutils/builtdist.rst:223 -msgid "``packager``" -msgstr "``packager``" - -#: ../../distutils/builtdist.rst:223 ../../distutils/builtdist.rst:225 -#: ../../distutils/builtdist.rst:227 ../../distutils/builtdist.rst:229 -#: ../../distutils/builtdist.rst:231 ../../distutils/builtdist.rst:233 -#: ../../distutils/builtdist.rst:235 ../../distutils/builtdist.rst:237 -msgid "(none)" -msgstr "" - -#: ../../distutils/builtdist.rst:225 -msgid "Provides" -msgstr "" - -#: ../../distutils/builtdist.rst:225 -msgid "``provides``" -msgstr "``provides``" - -#: ../../distutils/builtdist.rst:227 -msgid "Requires" -msgstr "" - -#: ../../distutils/builtdist.rst:227 -msgid "``requires``" -msgstr "``requires``" - -#: ../../distutils/builtdist.rst:229 -msgid "Conflicts" -msgstr "" - -#: ../../distutils/builtdist.rst:229 -msgid "``conflicts``" -msgstr "``conflicts``" - -#: ../../distutils/builtdist.rst:231 -msgid "Obsoletes" -msgstr "" - -#: ../../distutils/builtdist.rst:231 -msgid "``obsoletes``" -msgstr "``obsoletes``" - -#: ../../distutils/builtdist.rst:233 -msgid "Distribution" -msgstr "" - -#: ../../distutils/builtdist.rst:233 -msgid "``distribution_name``" -msgstr "``distribution_name``" - -#: ../../distutils/builtdist.rst:235 -msgid "BuildRequires" -msgstr "BuildRequires" - -#: ../../distutils/builtdist.rst:235 -msgid "``build_requires``" -msgstr "``build_requires``" - -#: ../../distutils/builtdist.rst:237 -msgid "Icon" -msgstr "" - -#: ../../distutils/builtdist.rst:237 -msgid "``icon``" -msgstr "``icon``" - -#: ../../distutils/builtdist.rst:240 -msgid "" -"Obviously, supplying even a few of these options on the command-line would " -"be tedious and error-prone, so it's usually best to put them in the setup " -"configuration file, :file:`setup.cfg`\\ ---see section :ref:`setup-config`. " -"If you distribute or package many Python module distributions, you might " -"want to put options that apply to all of them in your personal Distutils " -"configuration file (:file:`~/.pydistutils.cfg`). If you want to temporarily " -"disable this file, you can pass the :option:`!--no-user-cfg` option to :file:" -"`setup.py`." -msgstr "" - -#: ../../distutils/builtdist.rst:248 -msgid "" -"There are three steps to building a binary RPM package, all of which are " -"handled automatically by the Distutils:" -msgstr "" - -#: ../../distutils/builtdist.rst:251 -msgid "" -"create a :file:`.spec` file, which describes the package (analogous to the " -"Distutils setup script; in fact, much of the information in the setup " -"script winds up in the :file:`.spec` file)" -msgstr "" - -#: ../../distutils/builtdist.rst:255 -msgid "create the source RPM" -msgstr "" - -#: ../../distutils/builtdist.rst:257 -msgid "" -"create the \"binary\" RPM (which may or may not contain binary code, " -"depending on whether your module distribution contains Python extensions)" -msgstr "" - -#: ../../distutils/builtdist.rst:260 -msgid "" -"Normally, RPM bundles the last two steps together; when you use the " -"Distutils, all three steps are typically bundled together." -msgstr "" - -#: ../../distutils/builtdist.rst:263 -msgid "" -"If you wish, you can separate these three steps. You can use the :option:" -"`!--spec-only` option to make :command:`bdist_rpm` just create the :file:`." -"spec` file and exit; in this case, the :file:`.spec` file will be written to " -"the \"distribution directory\"---normally :file:`dist/`, but customizable " -"with the :option:`!--dist-dir` option. (Normally, the :file:`.spec` file " -"winds up deep in the \"build tree,\" in a temporary directory created by :" -"command:`bdist_rpm`.)" -msgstr "" - -#: ../../distutils/builtdist.rst:291 -msgid "Cross-compiling on Windows" -msgstr "" - -#: ../../distutils/builtdist.rst:293 -msgid "" -"Starting with Python 2.6, distutils is capable of cross-compiling between " -"Windows platforms. In practice, this means that with the correct tools " -"installed, you can use a 32bit version of Windows to create 64bit extensions " -"and vice-versa." -msgstr "" - -#: ../../distutils/builtdist.rst:298 -msgid "" -"To build for an alternate platform, specify the :option:`!--plat-name` " -"option to the build command. Valid values are currently 'win32', and 'win-" -"amd64'. For example, on a 32bit version of Windows, you could execute::" -msgstr "" - -#: ../../distutils/builtdist.rst:304 -msgid "to build a 64bit version of your extension." -msgstr "" - -#: ../../distutils/builtdist.rst:306 -msgid "" -"would create a 64bit installation executable on your 32bit version of " -"Windows." -msgstr "" - -#: ../../distutils/builtdist.rst:308 -msgid "" -"To cross-compile, you must download the Python source code and cross-compile " -"Python itself for the platform you are targeting - it is not possible from a " -"binary installation of Python (as the .lib etc file for other platforms are " -"not included.) In practice, this means the user of a 32 bit operating " -"system will need to use Visual Studio 2008 to open the :file:`PCbuild/" -"PCbuild.sln` solution in the Python source tree and build the \"x64\" " -"configuration of the 'pythoncore' project before cross-compiling extensions " -"is possible." -msgstr "" - -#: ../../distutils/builtdist.rst:317 -msgid "" -"Note that by default, Visual Studio 2008 does not install 64bit compilers or " -"tools. You may need to reexecute the Visual Studio setup process and select " -"these tools (using Control Panel->[Add/Remove] Programs is a convenient way " -"to check or modify your existing install.)" -msgstr "" - -#: ../../distutils/builtdist.rst:325 -msgid "The Postinstallation script" -msgstr "" - -#: ../../distutils/builtdist.rst:327 -msgid "" -"Starting with Python 2.3, a postinstallation script can be specified with " -"the :option:`!--install-script` option. The basename of the script must be " -"specified, and the script filename must also be listed in the scripts " -"argument to the setup function." -msgstr "" - -#: ../../distutils/builtdist.rst:332 -msgid "" -"This script will be run at installation time on the target system after all " -"the files have been copied, with ``argv[1]`` set to :option:`!-install`, and " -"again at uninstallation time before the files are removed with ``argv[1]`` " -"set to :option:`!-remove`." -msgstr "" - -#: ../../distutils/builtdist.rst:337 -msgid "" -"The installation script runs embedded in the windows installer, every output " -"(``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be " -"displayed in the GUI after the script has finished." -msgstr "" - -#: ../../distutils/builtdist.rst:341 -msgid "" -"Some functions especially useful in this context are available as additional " -"built-in functions in the installation script." -msgstr "" - -#: ../../distutils/builtdist.rst:348 -msgid "" -"These functions should be called when a directory or file is created by the " -"postinstall script at installation time. It will register *path* with the " -"uninstaller, so that it will be removed when the distribution is " -"uninstalled. To be safe, directories are only removed if they are empty." -msgstr "" - -#: ../../distutils/builtdist.rst:356 -msgid "" -"This function can be used to retrieve special folder locations on Windows " -"like the Start Menu or the Desktop. It returns the full path to the folder. " -"*csidl_string* must be one of the following strings::" -msgstr "" - -#: ../../distutils/builtdist.rst:376 -msgid "If the folder cannot be retrieved, :exc:`OSError` is raised." -msgstr "" - -#: ../../distutils/builtdist.rst:378 -msgid "" -"Which folders are available depends on the exact Windows version, and " -"probably also the configuration. For details refer to Microsoft's " -"documentation of the :c:func:`SHGetSpecialFolderPath` function." -msgstr "" - -#: ../../distutils/builtdist.rst:385 -msgid "" -"This function creates a shortcut. *target* is the path to the program to be " -"started by the shortcut. *description* is the description of the shortcut. " -"*filename* is the title of the shortcut that the user will see. *arguments* " -"specifies the command line arguments, if any. *workdir* is the working " -"directory for the program. *iconpath* is the file containing the icon for " -"the shortcut, and *iconindex* is the index of the icon in the file " -"*iconpath*. Again, for details consult the Microsoft documentation for the :" -"class:`IShellLink` interface." -msgstr "" - -#~ msgid ":command:`bdist_msi`" -#~ msgstr ":command:`bdist_msi`" - -#~ msgid "msi" -#~ msgstr "msi" diff --git a/distutils/commandref.po b/distutils/commandref.po deleted file mode 100644 index 22d251c2b2..0000000000 --- a/distutils/commandref.po +++ /dev/null @@ -1,152 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Leon H., 2017 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" -"Last-Translator: Leon H.\n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/commandref.rst:5 -msgid "Command Reference" -msgstr "指令參照" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/commandref.rst:24 -msgid "Installing modules: the :command:`install` command family" -msgstr "" - -#: ../../distutils/commandref.rst:26 -msgid "" -"The install command ensures that the build commands have been run and then " -"runs the subcommands :command:`install_lib`, :command:`install_data` and :" -"command:`install_scripts`." -msgstr "" - -#: ../../distutils/commandref.rst:37 -msgid ":command:`install_data`" -msgstr ":command:`install_data`" - -#: ../../distutils/commandref.rst:39 -msgid "This command installs all data files provided with the distribution." -msgstr "" - -#: ../../distutils/commandref.rst:45 -msgid ":command:`install_scripts`" -msgstr ":command:`install_scripts`" - -#: ../../distutils/commandref.rst:47 -msgid "This command installs all (Python) scripts in the distribution." -msgstr "" - -#: ../../distutils/commandref.rst:56 -msgid "Creating a source distribution: the :command:`sdist` command" -msgstr "" - -#: ../../distutils/commandref.rst:60 -msgid "The manifest template commands are:" -msgstr "" - -#: ../../distutils/commandref.rst:63 -msgid "Command" -msgstr "指令" - -#: ../../distutils/commandref.rst:63 -msgid "Description" -msgstr "描述" - -#: ../../distutils/commandref.rst:65 -msgid ":command:`include pat1 pat2 ...`" -msgstr ":command:`include pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:65 -msgid "include all files matching any of the listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:68 -msgid ":command:`exclude pat1 pat2 ...`" -msgstr ":command:`exclude pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:68 -msgid "exclude all files matching any of the listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:71 -msgid ":command:`recursive-include dir pat1 pat2 ...`" -msgstr ":command:`recursive-include dir pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:71 -msgid "include all files under *dir* matching any of the listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:74 -msgid ":command:`recursive-exclude dir pat1 pat2 ...`" -msgstr ":command:`recursive-exclude dir pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:74 -msgid "exclude all files under *dir* matching any of the listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:77 -msgid ":command:`global-include pat1 pat2 ...`" -msgstr ":command:`global-include pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:77 -msgid "" -"include all files anywhere in the source tree matching --- & any of the " -"listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:80 -msgid ":command:`global-exclude pat1 pat2 ...`" -msgstr ":command:`global-exclude pat1 pat2 ...`" - -#: ../../distutils/commandref.rst:80 -msgid "" -"exclude all files anywhere in the source tree matching --- & any of the " -"listed patterns" -msgstr "" - -#: ../../distutils/commandref.rst:83 -msgid ":command:`prune dir`" -msgstr ":command:`prune dir`" - -#: ../../distutils/commandref.rst:83 -msgid "exclude all files under *dir*" -msgstr "" - -#: ../../distutils/commandref.rst:85 -msgid ":command:`graft dir`" -msgstr ":command:`graft dir`" - -#: ../../distutils/commandref.rst:85 -msgid "include all files under *dir*" -msgstr "" - -#: ../../distutils/commandref.rst:88 -msgid "" -"The patterns here are Unix-style \"glob\" patterns: ``*`` matches any " -"sequence of regular filename characters, ``?`` matches any single regular " -"filename character, and ``[range]`` matches any of the characters in *range* " -"(e.g., ``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of \"regular " -"filename character\" is platform-specific: on Unix it is anything except " -"slash; on Windows anything except backslash or colon." -msgstr "" diff --git a/distutils/configfile.po b/distutils/configfile.po deleted file mode 100644 index e75cb1e364..0000000000 --- a/distutils/configfile.po +++ /dev/null @@ -1,168 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 14:33+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/configfile.rst:5 -msgid "Writing the Setup Configuration File" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/configfile.rst:9 -msgid "" -"Often, it's not possible to write down everything needed to build a " -"distribution *a priori*: you may need to get some information from the user, " -"or from the user's system, in order to proceed. As long as that information " -"is fairly simple---a list of directories to search for C header files or " -"libraries, for example---then providing a configuration file, :file:`setup." -"cfg`, for users to edit is a cheap and easy way to solicit it. " -"Configuration files also let you provide default values for any command " -"option, which the installer can then override either on the command-line or " -"by editing the config file." -msgstr "" - -#: ../../distutils/configfile.rst:18 -msgid "" -"The setup configuration file is a useful middle-ground between the setup " -"script---which, ideally, would be opaque to installers [#]_---and the " -"command-line to the setup script, which is outside of your control and " -"entirely up to the installer. In fact, :file:`setup.cfg` (and any other " -"Distutils configuration files present on the target system) are processed " -"after the contents of the setup script, but before the command-line. This " -"has several useful consequences:" -msgstr "" - -#: ../../distutils/configfile.rst:32 -msgid "" -"installers can override some of what you put in :file:`setup.py` by editing :" -"file:`setup.cfg`" -msgstr "" - -#: ../../distutils/configfile.rst:35 -msgid "" -"you can provide non-standard defaults for options that are not easily set " -"in :file:`setup.py`" -msgstr "" - -#: ../../distutils/configfile.rst:38 -msgid "" -"installers can override anything in :file:`setup.cfg` using the command-line " -"options to :file:`setup.py`" -msgstr "" - -#: ../../distutils/configfile.rst:41 -msgid "The basic syntax of the configuration file is simple:" -msgstr "" - -#: ../../distutils/configfile.rst:49 -msgid "" -"where *command* is one of the Distutils commands (e.g. :command:`build_py`, :" -"command:`install`), and *option* is one of the options that command " -"supports. Any number of options can be supplied for each command, and any " -"number of command sections can be included in the file. Blank lines are " -"ignored, as are comments, which run from a ``'#'`` character until the end " -"of the line. Long option values can be split across multiple lines simply " -"by indenting the continuation lines." -msgstr "" - -#: ../../distutils/configfile.rst:57 -msgid "" -"You can find out the list of options supported by a particular command with " -"the universal :option:`!--help` option, e.g." -msgstr "" - -#: ../../distutils/configfile.rst:75 -msgid "" -"Note that an option spelled :option:`!--foo-bar` on the command-line is " -"spelled ``foo_bar`` in configuration files." -msgstr "" - -#: ../../distutils/configfile.rst:80 -msgid "" -"For example, say you want your extensions to be built \"in-place\"---that " -"is, you have an extension :mod:`pkg.ext`, and you want the compiled " -"extension file (:file:`ext.so` on Unix, say) to be put in the same source " -"directory as your pure Python modules :mod:`pkg.mod1` and :mod:`pkg.mod2`. " -"You can always use the :option:`!--inplace` option on the command-line to " -"ensure this:" -msgstr "" - -#: ../../distutils/configfile.rst:90 -msgid "" -"But this requires that you always specify the :command:`build_ext` command " -"explicitly, and remember to provide :option:`!--inplace`. An easier way is " -"to \"set and forget\" this option, by encoding it in :file:`setup.cfg`, the " -"configuration file for this distribution:" -msgstr "" - -#: ../../distutils/configfile.rst:100 -msgid "" -"This will affect all builds of this module distribution, whether or not you " -"explicitly specify :command:`build_ext`. If you include :file:`setup.cfg` " -"in your source distribution, it will also affect end-user builds---which is " -"probably a bad idea for this option, since always building extensions in-" -"place would break installation of the module distribution. In certain " -"peculiar cases, though, modules are built right in their installation " -"directory, so this is conceivably a useful ability. (Distributing " -"extensions that expect to be built in their installation directory is almost " -"always a bad idea, though.)" -msgstr "" - -#: ../../distutils/configfile.rst:109 -msgid "" -"Another example: certain commands take a lot of options that don't change " -"from run to run; for example, :command:`bdist_rpm` needs to know everything " -"required to generate a \"spec\" file for creating an RPM distribution. Some " -"of this information comes from the setup script, and some is automatically " -"generated by the Distutils (such as the list of files installed). But some " -"of it has to be supplied as options to :command:`bdist_rpm`, which would be " -"very tedious to do on the command-line for every run. Hence, here is a " -"snippet from the Distutils' own :file:`setup.cfg`:" -msgstr "" - -#: ../../distutils/configfile.rst:129 -msgid "" -"Note that the ``doc_files`` option is simply a whitespace-separated string " -"split across multiple lines for readability." -msgstr "" - -#: ../../distutils/configfile.rst:136 -msgid ":ref:`inst-config-syntax` in \"Installing Python Modules\"" -msgstr "" - -#: ../../distutils/configfile.rst:136 -msgid "" -"More information on the configuration files is available in the manual for " -"system administrators." -msgstr "" - -#: ../../distutils/configfile.rst:141 -msgid "Footnotes" -msgstr "註解" - -#: ../../distutils/configfile.rst:142 -msgid "" -"This ideal probably won't be achieved until auto-configuration is fully " -"supported by the Distutils." -msgstr "" diff --git a/distutils/examples.po b/distutils/examples.po deleted file mode 100644 index 7623f002b3..0000000000 --- a/distutils/examples.po +++ /dev/null @@ -1,289 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Leon H., 2017 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 14:09+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/examples.rst:5 -#, fuzzy -msgid "Distutils Examples" -msgstr "範例" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/examples.rst:9 -msgid "" -"This chapter provides a number of basic examples to help get started with " -"distutils. Additional information about using distutils can be found in the " -"Distutils Cookbook." -msgstr "" - -#: ../../distutils/examples.rst:16 -msgid "`Distutils Cookbook `_" -msgstr "`Distutils Cookbook `_" - -#: ../../distutils/examples.rst:17 -msgid "" -"Collection of recipes showing how to achieve more control over distutils." -msgstr "" - -#: ../../distutils/examples.rst:23 -msgid "Pure Python distribution (by module)" -msgstr "" - -#: ../../distutils/examples.rst:25 -msgid "" -"If you're just distributing a couple of modules, especially if they don't " -"live in a particular package, you can specify them individually using the " -"``py_modules`` option in the setup script." -msgstr "" - -#: ../../distutils/examples.rst:29 -msgid "" -"In the simplest case, you'll have two files to worry about: a setup script " -"and the single module you're distributing, :file:`foo.py` in this example::" -msgstr "" - -#: ../../distutils/examples.rst:36 -msgid "" -"(In all diagrams in this section, ** will refer to the distribution " -"root directory.) A minimal setup script to describe this situation would " -"be::" -msgstr "" - -#: ../../distutils/examples.rst:45 -msgid "" -"Note that the name of the distribution is specified independently with the " -"``name`` option, and there's no rule that says it has to be the same as the " -"name of the sole module in the distribution (although that's probably a good " -"convention to follow). However, the distribution name is used to generate " -"filenames, so you should stick to letters, digits, underscores, and hyphens." -msgstr "" - -#: ../../distutils/examples.rst:51 -msgid "" -"Since ``py_modules`` is a list, you can of course specify multiple modules, " -"eg. if you're distributing modules :mod:`foo` and :mod:`bar`, your setup " -"might look like this::" -msgstr "" - -#: ../../distutils/examples.rst:60 -msgid "and the setup script might be ::" -msgstr "" - -#: ../../distutils/examples.rst:68 -msgid "" -"You can put module source files into another directory, but if you have " -"enough modules to do that, it's probably easier to specify modules by " -"package rather than listing them individually." -msgstr "" - -#: ../../distutils/examples.rst:76 -msgid "Pure Python distribution (by package)" -msgstr "" - -#: ../../distutils/examples.rst:78 -msgid "" -"If you have more than a couple of modules to distribute, especially if they " -"are in multiple packages, it's probably easier to specify whole packages " -"rather than individual modules. This works even if your modules are not in " -"a package; you can just tell the Distutils to process modules from the root " -"package, and that works the same as any other package (except that you don't " -"have to have an :file:`__init__.py` file)." -msgstr "" - -#: ../../distutils/examples.rst:85 -msgid "The setup script from the last example could also be written as ::" -msgstr "" - -#: ../../distutils/examples.rst:93 -msgid "(The empty string stands for the root package.)" -msgstr "" - -#: ../../distutils/examples.rst:95 -msgid "" -"If those two files are moved into a subdirectory, but remain in the root " -"package, e.g.::" -msgstr "" - -#: ../../distutils/examples.rst:103 -msgid "" -"then you would still specify the root package, but you have to tell the " -"Distutils where source files in the root package live::" -msgstr "" - -#: ../../distutils/examples.rst:113 -msgid "" -"More typically, though, you will want to distribute multiple modules in the " -"same package (or in sub-packages). For example, if the :mod:`foo` and :mod:" -"`bar` modules belong in package :mod:`foobar`, one way to layout your source " -"tree is ::" -msgstr "" - -#: ../../distutils/examples.rst:125 -msgid "" -"This is in fact the default layout expected by the Distutils, and the one " -"that requires the least work to describe in your setup script::" -msgstr "" - -#: ../../distutils/examples.rst:134 -msgid "" -"If you want to put modules in directories not named for their package, then " -"you need to use the ``package_dir`` option again. For example, if the :file:" -"`src` directory holds modules in the :mod:`foobar` package::" -msgstr "" - -#: ../../distutils/examples.rst:145 -msgid "an appropriate setup script would be ::" -msgstr "" - -#: ../../distutils/examples.rst:154 -msgid "" -"Or, you might put modules from your main package right in the distribution " -"root::" -msgstr "" - -#: ../../distutils/examples.rst:163 -msgid "in which case your setup script would be ::" -msgstr "" - -#: ../../distutils/examples.rst:172 -msgid "(The empty string also stands for the current directory.)" -msgstr "" - -#: ../../distutils/examples.rst:174 -msgid "" -"If you have sub-packages, they must be explicitly listed in ``packages``, " -"but any entries in ``package_dir`` automatically extend to sub-packages. (In " -"other words, the Distutils does *not* scan your source tree, trying to " -"figure out which directories correspond to Python packages by looking for :" -"file:`__init__.py` files.) Thus, if the default layout grows a sub-package::" -msgstr "" - -#: ../../distutils/examples.rst:190 -msgid "then the corresponding setup script would be ::" -msgstr "" - -#: ../../distutils/examples.rst:202 -msgid "Single extension module" -msgstr "" - -#: ../../distutils/examples.rst:204 -msgid "" -"Extension modules are specified using the ``ext_modules`` option. " -"``package_dir`` has no effect on where extension source files are found; it " -"only affects the source for pure Python modules. The simplest case, a " -"single extension module in a single C source file, is::" -msgstr "" - -#: ../../distutils/examples.rst:213 -msgid "" -"If the :mod:`foo` extension belongs in the root package, the setup script " -"for this could be ::" -msgstr "" - -#: ../../distutils/examples.rst:223 -msgid "If the extension actually belongs in a package, say :mod:`foopkg`, then" -msgstr "" - -#: ../../distutils/examples.rst:225 -msgid "" -"With exactly the same source tree layout, this extension can be put in the :" -"mod:`foopkg` package simply by changing the name of the extension::" -msgstr "" - -#: ../../distutils/examples.rst:236 -msgid "Checking a package" -msgstr "" - -#: ../../distutils/examples.rst:238 -msgid "" -"The ``check`` command allows you to verify if your package meta-data meet " -"the minimum requirements to build a distribution." -msgstr "" - -#: ../../distutils/examples.rst:241 -msgid "" -"To run it, just call it using your :file:`setup.py` script. If something is " -"missing, ``check`` will display a warning." -msgstr "" - -#: ../../distutils/examples.rst:244 -msgid "Let's take an example with a simple script::" -msgstr "" - -#: ../../distutils/examples.rst:250 -msgid "Running the ``check`` command will display some warnings:" -msgstr "" - -#: ../../distutils/examples.rst:261 -msgid "" -"If you use the reStructuredText syntax in the ``long_description`` field and " -"`docutils`_ is installed you can check if the syntax is fine with the " -"``check`` command, using the ``restructuredtext`` option." -msgstr "" - -#: ../../distutils/examples.rst:265 -msgid "For example, if the :file:`setup.py` script is changed like this::" -msgstr "" - -#: ../../distutils/examples.rst:280 -msgid "" -"Where the long description is broken, ``check`` will be able to detect it by " -"using the :mod:`docutils` parser:" -msgstr "" - -#: ../../distutils/examples.rst:291 -msgid "Reading the metadata" -msgstr "" - -#: ../../distutils/examples.rst:293 -msgid "" -"The :func:`distutils.core.setup` function provides a command-line interface " -"that allows you to query the metadata fields of a project through the " -"``setup.py`` script of a given project:" -msgstr "" - -#: ../../distutils/examples.rst:302 -msgid "" -"This call reads the ``name`` metadata by running the :func:`distutils.core." -"setup` function. Although, when a source or binary distribution is created " -"with Distutils, the metadata fields are written in a static file called :" -"file:`PKG-INFO`. When a Distutils-based project is installed in Python, the :" -"file:`PKG-INFO` file is copied alongside the modules and packages of the " -"distribution under :file:`NAME-VERSION-pyX.X.egg-info`, where ``NAME`` is " -"the name of the project, ``VERSION`` its version as defined in the Metadata, " -"and ``pyX.X`` the major and minor version of Python like ``2.7`` or ``3.2``." -msgstr "" - -#: ../../distutils/examples.rst:312 -msgid "" -"You can read back this static file, by using the :class:`distutils.dist." -"DistributionMetadata` class and its :func:`read_pkg_file` method::" -msgstr "" - -#: ../../distutils/examples.rst:326 -msgid "" -"Notice that the class can also be instantiated with a metadata file path to " -"loads its values::" -msgstr "" diff --git a/distutils/extending.po b/distutils/extending.po deleted file mode 100644 index 71a814d233..0000000000 --- a/distutils/extending.po +++ /dev/null @@ -1,129 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 14:09+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/extending.rst:5 -msgid "Extending Distutils" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/extending.rst:9 -msgid "" -"Distutils can be extended in various ways. Most extensions take the form of " -"new commands or replacements for existing commands. New commands may be " -"written to support new types of platform-specific packaging, for example, " -"while replacements for existing commands may be made to modify details of " -"how the command operates on a package." -msgstr "" - -#: ../../distutils/extending.rst:15 -msgid "" -"Most extensions of the distutils are made within :file:`setup.py` scripts " -"that want to modify existing commands; many simply add a few file extensions " -"that should be copied into packages in addition to :file:`.py` files as a " -"convenience." -msgstr "" - -#: ../../distutils/extending.rst:20 -msgid "" -"Most distutils command implementations are subclasses of the :class:" -"`distutils.cmd.Command` class. New commands may directly inherit from :" -"class:`Command`, while replacements often derive from :class:`Command` " -"indirectly, directly subclassing the command they are replacing. Commands " -"are required to derive from :class:`Command`." -msgstr "" - -#: ../../distutils/extending.rst:35 -msgid "Integrating new commands" -msgstr "" - -#: ../../distutils/extending.rst:37 -msgid "" -"There are different ways to integrate new command implementations into " -"distutils. The most difficult is to lobby for the inclusion of the new " -"features in distutils itself, and wait for (and require) a version of Python " -"that provides that support. This is really hard for many reasons." -msgstr "" - -#: ../../distutils/extending.rst:42 -msgid "" -"The most common, and possibly the most reasonable for most needs, is to " -"include the new implementations with your :file:`setup.py` script, and cause " -"the :func:`distutils.core.setup` function use them::" -msgstr "" - -#: ../../distutils/extending.rst:57 -msgid "" -"This approach is most valuable if the new implementations must be used to " -"use a particular package, as everyone interested in the package will need to " -"have the new command implementation." -msgstr "" - -#: ../../distutils/extending.rst:61 -msgid "" -"Beginning with Python 2.4, a third option is available, intended to allow " -"new commands to be added which can support existing :file:`setup.py` scripts " -"without requiring modifications to the Python installation. This is " -"expected to allow third-party extensions to provide support for additional " -"packaging systems, but the commands can be used for anything distutils " -"commands can be used for. A new configuration option, ``command_packages`` " -"(command-line option :option:`!--command-packages`), can be used to specify " -"additional packages to be searched for modules implementing commands. Like " -"all distutils options, this can be specified on the command line or in a " -"configuration file. This option can only be set in the ``[global]`` section " -"of a configuration file, or before any commands on the command line. If set " -"in a configuration file, it can be overridden from the command line; setting " -"it to an empty string on the command line causes the default to be used. " -"This should never be set in a configuration file provided with a package." -msgstr "" - -#: ../../distutils/extending.rst:76 -msgid "" -"This new option can be used to add any number of packages to the list of " -"packages searched for command implementations; multiple package names should " -"be separated by commas. When not specified, the search is only performed in " -"the :mod:`distutils.command` package. When :file:`setup.py` is run with the " -"option ``--command-packages distcmds,buildcmds``, however, the packages :mod:" -"`distutils.command`, :mod:`distcmds`, and :mod:`buildcmds` will be searched " -"in that order. New commands are expected to be implemented in modules of " -"the same name as the command by classes sharing the same name. Given the " -"example command line option above, the command :command:`bdist_openpkg` " -"could be implemented by the class :class:`distcmds.bdist_openpkg." -"bdist_openpkg` or :class:`buildcmds.bdist_openpkg.bdist_openpkg`." -msgstr "" - -#: ../../distutils/extending.rst:90 -msgid "Adding new distribution types" -msgstr "" - -#: ../../distutils/extending.rst:92 -msgid "" -"Commands that create distributions (files in the :file:`dist/` directory) " -"need to add ``(command, filename)`` pairs to ``self.distribution." -"dist_files`` so that :command:`upload` can upload it to PyPI. The " -"*filename* in the pair contains no path information, only the name of the " -"file itself. In dry-run mode, pairs should still be added to represent what " -"would have been created." -msgstr "" diff --git a/distutils/index.po b/distutils/index.po deleted file mode 100644 index 9c69088309..0000000000 --- a/distutils/index.po +++ /dev/null @@ -1,80 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Leon H., 2017 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" -"PO-Revision-Date: 2018-05-23 14:09+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/index.rst:5 -msgid "Distributing Python Modules (Legacy version)" -msgstr "發布 Python 模組(舊版)" - -#: ../../distutils/index.rst:0 -msgid "Authors" -msgstr "作者" - -#: ../../distutils/index.rst:7 -msgid "Greg Ward, Anthony Baxter" -msgstr "Greg Ward, Anthony Baxter" - -#: ../../distutils/index.rst:0 -msgid "Email" -msgstr "電子郵件" - -#: ../../distutils/index.rst:8 -msgid "distutils-sig@python.org" -msgstr "distutils-sig@python.org" - -#: ../../distutils/index.rst:12 -msgid ":ref:`distributing-index`" -msgstr ":ref:`distributing-index`" - -#: ../../distutils/index.rst:13 -msgid "The up to date module distribution documentations" -msgstr "" - -#: ../../distutils/index.rst:17 -msgid "" -"The entire ``distutils`` package has been deprecated and will be removed in " -"Python 3.12. This documentation is retained as a reference only, and will be " -"removed with the package. See the :ref:`What's New ` " -"entry for more information." -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/index.rst:26 -msgid "" -"This guide only covers the basic tools for building and distributing " -"extensions that are provided as part of this version of Python. Third party " -"tools offer easier to use and more secure alternatives. Refer to the `quick " -"recommendations section `__ in the Python Packaging User Guide for more information." -msgstr "" - -#: ../../distutils/index.rst:32 -msgid "" -"This document describes the Python Distribution Utilities (\"Distutils\") " -"from the module developer's point of view, describing the underlying " -"capabilities that ``setuptools`` builds on to allow Python developers to " -"make Python modules and extensions readily available to a wider audience." -msgstr "" diff --git a/distutils/introduction.po b/distutils/introduction.po deleted file mode 100644 index 35232bd192..0000000000 --- a/distutils/introduction.po +++ /dev/null @@ -1,327 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" -"PO-Revision-Date: 2018-05-23 14:34+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/introduction.rst:5 -msgid "An Introduction to Distutils" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/introduction.rst:9 -msgid "" -"This document covers using the Distutils to distribute your Python modules, " -"concentrating on the role of developer/distributor: if you're looking for " -"information on installing Python modules, you should refer to the :ref:" -"`install-index` chapter." -msgstr "" - -#: ../../distutils/introduction.rst:18 -msgid "Concepts & Terminology" -msgstr "" - -#: ../../distutils/introduction.rst:20 -msgid "" -"Using the Distutils is quite simple, both for module developers and for " -"users/administrators installing third-party modules. As a developer, your " -"responsibilities (apart from writing solid, well-documented and well-tested " -"code, of course!) are:" -msgstr "" - -#: ../../distutils/introduction.rst:25 -msgid "write a setup script (:file:`setup.py` by convention)" -msgstr "" - -#: ../../distutils/introduction.rst:27 -msgid "(optional) write a setup configuration file" -msgstr "" - -#: ../../distutils/introduction.rst:29 -msgid "create a source distribution" -msgstr "" - -#: ../../distutils/introduction.rst:31 -msgid "(optional) create one or more built (binary) distributions" -msgstr "" - -#: ../../distutils/introduction.rst:33 -msgid "Each of these tasks is covered in this document." -msgstr "" - -#: ../../distutils/introduction.rst:35 -msgid "" -"Not all module developers have access to a multitude of platforms, so it's " -"not always feasible to expect them to create a multitude of built " -"distributions. It is hoped that a class of intermediaries, called " -"*packagers*, will arise to address this need. Packagers will take source " -"distributions released by module developers, build them on one or more " -"platforms, and release the resulting built distributions. Thus, users on " -"the most popular platforms will be able to install most popular Python " -"module distributions in the most natural way for their platform, without " -"having to run a single setup script or compile a line of code." -msgstr "" - -#: ../../distutils/introduction.rst:49 -msgid "A Simple Example" -msgstr "一個簡單範例" - -#: ../../distutils/introduction.rst:51 -msgid "" -"The setup script is usually quite simple, although since it's written in " -"Python, there are no arbitrary limits to what you can do with it, though you " -"should be careful about putting arbitrarily expensive operations in your " -"setup script. Unlike, say, Autoconf-style configure scripts, the setup " -"script may be run multiple times in the course of building and installing " -"your module distribution." -msgstr "" - -#: ../../distutils/introduction.rst:58 -msgid "" -"If all you want to do is distribute a module called :mod:`foo`, contained in " -"a file :file:`foo.py`, then your setup script can be as simple as this::" -msgstr "" - -#: ../../distutils/introduction.rst:67 -msgid "Some observations:" -msgstr "" - -#: ../../distutils/introduction.rst:69 -msgid "" -"most information that you supply to the Distutils is supplied as keyword " -"arguments to the :func:`setup` function" -msgstr "" - -#: ../../distutils/introduction.rst:72 -msgid "" -"those keyword arguments fall into two categories: package metadata (name, " -"version number) and information about what's in the package (a list of pure " -"Python modules, in this case)" -msgstr "" - -#: ../../distutils/introduction.rst:76 -msgid "" -"modules are specified by module name, not filename (the same will hold true " -"for packages and extensions)" -msgstr "" - -#: ../../distutils/introduction.rst:79 -msgid "" -"it's recommended that you supply a little more metadata, in particular your " -"name, email address and a URL for the project (see section :ref:`setup-" -"script` for an example)" -msgstr "" - -#: ../../distutils/introduction.rst:83 -msgid "" -"To create a source distribution for this module, you would create a setup " -"script, :file:`setup.py`, containing the above code, and run this command " -"from a terminal::" -msgstr "" - -#: ../../distutils/introduction.rst:89 -msgid "" -"For Windows, open a command prompt window (:menuselection:`Start --> " -"Accessories`) and change the command to::" -msgstr "" - -#: ../../distutils/introduction.rst:94 -msgid "" -":command:`sdist` will create an archive file (e.g., tarball on Unix, ZIP " -"file on Windows) containing your setup script :file:`setup.py`, and your " -"module :file:`foo.py`. The archive file will be named :file:`foo-1.0.tar.gz` " -"(or :file:`.zip`), and will unpack into a directory :file:`foo-1.0`." -msgstr "" - -#: ../../distutils/introduction.rst:99 -msgid "" -"If an end-user wishes to install your :mod:`foo` module, all they have to do " -"is download :file:`foo-1.0.tar.gz` (or :file:`.zip`), unpack it, and---from " -"the :file:`foo-1.0` directory---run ::" -msgstr "" - -#: ../../distutils/introduction.rst:105 -msgid "" -"which will ultimately copy :file:`foo.py` to the appropriate directory for " -"third-party modules in their Python installation." -msgstr "" - -#: ../../distutils/introduction.rst:108 -msgid "" -"This simple example demonstrates some fundamental concepts of the Distutils. " -"First, both developers and installers have the same basic user interface, i." -"e. the setup script. The difference is which Distutils *commands* they use: " -"the :command:`sdist` command is almost exclusively for module developers, " -"while :command:`install` is more often for installers (although most " -"developers will want to install their own code occasionally)." -msgstr "" - -#: ../../distutils/introduction.rst:115 -msgid "" -"Other useful built distribution formats are RPM, implemented by the :command:" -"`bdist_rpm` command, Solaris :program:`pkgtool` (:command:`bdist_pkgtool`), " -"and HP-UX :program:`swinstall` (:command:`bdist_sdux`). For example, the " -"following command will create an RPM file called :file:`foo-1.0.noarch.rpm`::" -msgstr "" - -#: ../../distutils/introduction.rst:123 -msgid "" -"(The :command:`bdist_rpm` command uses the :command:`rpm` executable, " -"therefore this has to be run on an RPM-based system such as Red Hat Linux, " -"SuSE Linux, or Mandrake Linux.)" -msgstr "" - -#: ../../distutils/introduction.rst:127 -msgid "" -"You can find out what distribution formats are available at any time by " -"running ::" -msgstr "" - -#: ../../distutils/introduction.rst:136 -msgid "General Python terminology" -msgstr "" - -#: ../../distutils/introduction.rst:138 -msgid "" -"If you're reading this document, you probably have a good idea of what " -"modules, extensions, and so forth are. Nevertheless, just to be sure that " -"everyone is operating from a common starting point, we offer the following " -"glossary of common Python terms:" -msgstr "" - -#: ../../distutils/introduction.rst:146 -msgid "module" -msgstr "模組" - -#: ../../distutils/introduction.rst:144 -msgid "" -"the basic unit of code reusability in Python: a block of code imported by " -"some other code. Three types of modules concern us here: pure Python " -"modules, extension modules, and packages." -msgstr "" - -#: ../../distutils/introduction.rst:151 -msgid "pure Python module" -msgstr "" - -#: ../../distutils/introduction.rst:149 -msgid "" -"a module written in Python and contained in a single :file:`.py` file (and " -"possibly associated :file:`.pyc` files). Sometimes referred to as a \"pure " -"module.\"" -msgstr "" - -#: ../../distutils/introduction.rst:159 -msgid "extension module" -msgstr "" - -#: ../../distutils/introduction.rst:154 -msgid "" -"a module written in the low-level language of the Python implementation: C/C+" -"+ for Python, Java for Jython. Typically contained in a single dynamically " -"loadable pre-compiled file, e.g. a shared object (:file:`.so`) file for " -"Python extensions on Unix, a DLL (given the :file:`.pyd` extension) for " -"Python extensions on Windows, or a Java class file for Jython extensions. " -"(Note that currently, the Distutils only handles C/C++ extensions for " -"Python.)" -msgstr "" - -#: ../../distutils/introduction.rst:164 -msgid "package" -msgstr "" - -#: ../../distutils/introduction.rst:162 -msgid "" -"a module that contains other modules; typically contained in a directory in " -"the filesystem and distinguished from other directories by the presence of a " -"file :file:`__init__.py`." -msgstr "" - -#: ../../distutils/introduction.rst:174 -msgid "root package" -msgstr "" - -#: ../../distutils/introduction.rst:167 -msgid "" -"the root of the hierarchy of packages. (This isn't really a package, since " -"it doesn't have an :file:`__init__.py` file. But we have to call it " -"something.) The vast majority of the standard library is in the root " -"package, as are many small, standalone third-party modules that don't belong " -"to a larger module collection. Unlike regular packages, modules in the root " -"package can be found in many directories: in fact, every directory listed in " -"``sys.path`` contributes modules to the root package." -msgstr "" - -#: ../../distutils/introduction.rst:179 -msgid "Distutils-specific terminology" -msgstr "" - -#: ../../distutils/introduction.rst:181 -msgid "" -"The following terms apply more specifically to the domain of distributing " -"Python modules using the Distutils:" -msgstr "" - -#: ../../distutils/introduction.rst:190 -msgid "module distribution" -msgstr "" - -#: ../../distutils/introduction.rst:185 -msgid "" -"a collection of Python modules distributed together as a single downloadable " -"resource and meant to be installed *en masse*. Examples of some well-known " -"module distributions are NumPy, SciPy, Pillow, or mxBase. (This would be " -"called a *package*, except that term is already taken in the Python context: " -"a single module distribution may contain zero, one, or many Python packages.)" -msgstr "" - -#: ../../distutils/introduction.rst:194 -msgid "pure module distribution" -msgstr "" - -#: ../../distutils/introduction.rst:193 -msgid "" -"a module distribution that contains only pure Python modules and packages. " -"Sometimes referred to as a \"pure distribution.\"" -msgstr "" - -#: ../../distutils/introduction.rst:198 -msgid "non-pure module distribution" -msgstr "" - -#: ../../distutils/introduction.rst:197 -msgid "" -"a module distribution that contains at least one extension module. " -"Sometimes referred to as a \"non-pure distribution.\"" -msgstr "" - -#: ../../distutils/introduction.rst:202 -msgid "distribution root" -msgstr "" - -#: ../../distutils/introduction.rst:201 -msgid "" -"the top-level directory of your source tree (or source distribution); the " -"directory where :file:`setup.py` exists. Generally :file:`setup.py` will " -"be run from this directory." -msgstr "" diff --git a/distutils/packageindex.po b/distutils/packageindex.po deleted file mode 100644 index 43739153ea..0000000000 --- a/distutils/packageindex.po +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Matt Wang , 2022 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2022-02-11 13:46+0800\n" -"Last-Translator: Matt Wang \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../../distutils/packageindex.rst:7 -msgid "The Python Package Index (PyPI)" -msgstr "Python 套件索引 (Python Package Index, PyPI)" - -#: ../../distutils/packageindex.rst:9 -msgid "" -"The `Python Package Index (PyPI)`_ stores metadata describing distributions " -"packaged with distutils and other publishing tools, as well the distribution " -"archives themselves." -msgstr "" -"`Python Package Index (PyPI)`_ 儲存了用來描述 distutils 和其他發布工具打包的" -"套件發行版與其歸檔 (archive) 的元資料 (metadata)。" - -#: ../../distutils/packageindex.rst:13 -msgid "" -"References to up to date PyPI documentation can be found at :ref:`publishing-" -"python-packages`." -msgstr "關於最新 PyPI 文件可以在\\ :ref:`publishing-python-packages`\\ 找到。" diff --git a/distutils/setupscript.po b/distutils/setupscript.po deleted file mode 100644 index a664a90bf0..0000000000 --- a/distutils/setupscript.po +++ /dev/null @@ -1,1045 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" -"PO-Revision-Date: 2018-05-23 14:09+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/setupscript.rst:5 -msgid "Writing the Setup Script" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/setupscript.rst:9 -msgid "" -"The setup script is the centre of all activity in building, distributing, " -"and installing modules using the Distutils. The main purpose of the setup " -"script is to describe your module distribution to the Distutils, so that the " -"various commands that operate on your modules do the right thing. As we saw " -"in section :ref:`distutils-simple-example` above, the setup script consists " -"mainly of a call to :func:`setup`, and most information supplied to the " -"Distutils by the module developer is supplied as keyword arguments to :func:" -"`setup`." -msgstr "" - -#: ../../distutils/setupscript.rst:17 -msgid "" -"Here's a slightly more involved example, which we'll follow for the next " -"couple of sections: the Distutils' own setup script. (Keep in mind that " -"although the Distutils are included with Python 1.6 and later, they also " -"have an independent existence so that Python 1.5.2 users can use them to " -"install other module distributions. The Distutils' own setup script, shown " -"here, is used to install the package into Python 1.5.2.) ::" -msgstr "" - -#: ../../distutils/setupscript.rst:37 -msgid "" -"There are only two differences between this and the trivial one-file " -"distribution presented in section :ref:`distutils-simple-example`: more " -"metadata, and the specification of pure Python modules by package, rather " -"than by module. This is important since the Distutils consist of a couple " -"of dozen modules split into (so far) two packages; an explicit list of every " -"module would be tedious to generate and difficult to maintain. For more " -"information on the additional meta-data, see section :ref:`meta-data`." -msgstr "" - -#: ../../distutils/setupscript.rst:45 -msgid "" -"Note that any pathnames (files or directories) supplied in the setup script " -"should be written using the Unix convention, i.e. slash-separated. The " -"Distutils will take care of converting this platform-neutral representation " -"into whatever is appropriate on your current platform before actually using " -"the pathname. This makes your setup script portable across operating " -"systems, which of course is one of the major goals of the Distutils. In " -"this spirit, all pathnames in this document are slash-separated." -msgstr "" - -#: ../../distutils/setupscript.rst:53 -msgid "" -"This, of course, only applies to pathnames given to Distutils functions. If " -"you, for example, use standard Python functions such as :func:`glob.glob` " -"or :func:`os.listdir` to specify files, you should be careful to write " -"portable code instead of hardcoding path separators::" -msgstr "" - -#: ../../distutils/setupscript.rst:65 -msgid "Listing whole packages" -msgstr "" - -#: ../../distutils/setupscript.rst:67 -msgid "" -"The ``packages`` option tells the Distutils to process (build, distribute, " -"install, etc.) all pure Python modules found in each package mentioned in " -"the ``packages`` list. In order to do this, of course, there has to be a " -"correspondence between package names and directories in the filesystem. The " -"default correspondence is the most obvious one, i.e. package :mod:" -"`distutils` is found in the directory :file:`distutils` relative to the " -"distribution root. Thus, when you say ``packages = ['foo']`` in your setup " -"script, you are promising that the Distutils will find a file :file:`foo/" -"__init__.py` (which might be spelled differently on your system, but you get " -"the idea) relative to the directory where your setup script lives. If you " -"break this promise, the Distutils will issue a warning but still process the " -"broken package anyway." -msgstr "" - -#: ../../distutils/setupscript.rst:79 -msgid "" -"If you use a different convention to lay out your source directory, that's " -"no problem: you just have to supply the ``package_dir`` option to tell the " -"Distutils about your convention. For example, say you keep all Python " -"source under :file:`lib`, so that modules in the \"root package\" (i.e., not " -"in any package at all) are in :file:`lib`, modules in the :mod:`foo` package " -"are in :file:`lib/foo`, and so forth. Then you would put ::" -msgstr "" - -#: ../../distutils/setupscript.rst:88 -msgid "" -"in your setup script. The keys to this dictionary are package names, and an " -"empty package name stands for the root package. The values are directory " -"names relative to your distribution root. In this case, when you say " -"``packages = ['foo']``, you are promising that the file :file:`lib/foo/" -"__init__.py` exists." -msgstr "" - -#: ../../distutils/setupscript.rst:93 -msgid "" -"Another possible convention is to put the :mod:`foo` package right in :file:" -"`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would be " -"written in the setup script as ::" -msgstr "" - -#: ../../distutils/setupscript.rst:99 -msgid "" -"A ``package: dir`` entry in the ``package_dir`` dictionary implicitly " -"applies to all packages below *package*, so the :mod:`foo.bar` case is " -"automatically handled here. In this example, having ``packages = ['foo', " -"'foo.bar']`` tells the Distutils to look for :file:`lib/__init__.py` and :" -"file:`lib/bar/__init__.py`. (Keep in mind that although ``package_dir`` " -"applies recursively, you must explicitly list all packages in ``packages``: " -"the Distutils will *not* recursively scan your source tree looking for any " -"directory with an :file:`__init__.py` file.)" -msgstr "" - -#: ../../distutils/setupscript.rst:112 -msgid "Listing individual modules" -msgstr "" - -#: ../../distutils/setupscript.rst:114 -msgid "" -"For a small module distribution, you might prefer to list all modules rather " -"than listing packages---especially the case of a single module that goes in " -"the \"root package\" (i.e., no package at all). This simplest case was " -"shown in section :ref:`distutils-simple-example`; here is a slightly more " -"involved example::" -msgstr "" - -#: ../../distutils/setupscript.rst:121 -msgid "" -"This describes two modules, one of them in the \"root\" package, the other " -"in the :mod:`pkg` package. Again, the default package/directory layout " -"implies that these two modules can be found in :file:`mod1.py` and :file:" -"`pkg/mod2.py`, and that :file:`pkg/__init__.py` exists as well. And again, " -"you can override the package/directory correspondence using the " -"``package_dir`` option." -msgstr "" - -#: ../../distutils/setupscript.rst:131 -msgid "Describing extension modules" -msgstr "" - -#: ../../distutils/setupscript.rst:133 -msgid "" -"Just as writing Python extension modules is a bit more complicated than " -"writing pure Python modules, describing them to the Distutils is a bit more " -"complicated. Unlike pure modules, it's not enough just to list modules or " -"packages and expect the Distutils to go out and find the right files; you " -"have to specify the extension name, source file(s), and any compile/link " -"requirements (include directories, libraries to link with, etc.)." -msgstr "" - -#: ../../distutils/setupscript.rst:142 -msgid "" -"All of this is done through another keyword argument to :func:`setup`, the " -"``ext_modules`` option. ``ext_modules`` is just a list of :class:" -"`~distutils.core.Extension` instances, each of which describes a single " -"extension module. Suppose your distribution includes a single extension, " -"called :mod:`foo` and implemented by :file:`foo.c`. If no additional " -"instructions to the compiler/linker are needed, describing this extension is " -"quite simple::" -msgstr "" - -#: ../../distutils/setupscript.rst:152 -msgid "" -"The :class:`Extension` class can be imported from :mod:`distutils.core` " -"along with :func:`setup`. Thus, the setup script for a module distribution " -"that contains only this one extension and nothing else might be::" -msgstr "" - -#: ../../distutils/setupscript.rst:162 -msgid "" -"The :class:`Extension` class (actually, the underlying extension-building " -"machinery implemented by the :command:`build_ext` command) supports a great " -"deal of flexibility in describing Python extensions, which is explained in " -"the following sections." -msgstr "" - -#: ../../distutils/setupscript.rst:169 -msgid "Extension names and packages" -msgstr "" - -#: ../../distutils/setupscript.rst:171 -msgid "" -"The first argument to the :class:`~distutils.core.Extension` constructor is " -"always the name of the extension, including any package names. For " -"example, ::" -msgstr "" - -#: ../../distutils/setupscript.rst:176 -msgid "describes an extension that lives in the root package, while ::" -msgstr "" - -#: ../../distutils/setupscript.rst:180 -msgid "" -"describes the same extension in the :mod:`pkg` package. The source files " -"and resulting object code are identical in both cases; the only difference " -"is where in the filesystem (and therefore where in Python's namespace " -"hierarchy) the resulting extension lives." -msgstr "" - -#: ../../distutils/setupscript.rst:185 -msgid "" -"If you have a number of extensions all in the same package (or all under the " -"same base package), use the ``ext_package`` keyword argument to :func:" -"`setup`. For example, ::" -msgstr "" - -#: ../../distutils/setupscript.rst:195 -msgid "" -"will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar." -"c` to :mod:`pkg.subpkg.bar`." -msgstr "" - -#: ../../distutils/setupscript.rst:200 -msgid "Extension source files" -msgstr "" - -#: ../../distutils/setupscript.rst:202 -msgid "" -"The second argument to the :class:`~distutils.core.Extension` constructor is " -"a list of source files. Since the Distutils currently only support C, C++, " -"and Objective-C extensions, these are normally C/C++/Objective-C source " -"files. (Be sure to use appropriate extensions to distinguish C++ source " -"files: :file:`.cc` and :file:`.cpp` seem to be recognized by both Unix and " -"Windows compilers.)" -msgstr "" - -#: ../../distutils/setupscript.rst:209 -msgid "" -"However, you can also include SWIG interface (:file:`.i`) files in the list; " -"the :command:`build_ext` command knows how to deal with SWIG extensions: it " -"will run SWIG on the interface file and compile the resulting C/C++ file " -"into your extension." -msgstr "" - -#: ../../distutils/setupscript.rst:216 -msgid "" -"This warning notwithstanding, options to SWIG can be currently passed like " -"this::" -msgstr "" - -#: ../../distutils/setupscript.rst:225 -msgid "Or on the commandline like this::" -msgstr "" - -#: ../../distutils/setupscript.rst:229 -msgid "" -"On some platforms, you can include non-source files that are processed by " -"the compiler and included in your extension. Currently, this just means " -"Windows message text (:file:`.mc`) files and resource definition (:file:`." -"rc`) files for Visual C++. These will be compiled to binary resource (:file:" -"`.res`) files and linked into the executable." -msgstr "" - -#: ../../distutils/setupscript.rst:237 -msgid "Preprocessor options" -msgstr "" - -#: ../../distutils/setupscript.rst:239 -msgid "" -"Three optional arguments to :class:`~distutils.core.Extension` will help if " -"you need to specify include directories to search or preprocessor macros to " -"define/undefine: ``include_dirs``, ``define_macros``, and ``undef_macros``." -msgstr "" - -#: ../../distutils/setupscript.rst:243 -msgid "" -"For example, if your extension requires header files in the :file:`include` " -"directory under your distribution root, use the ``include_dirs`` option::" -msgstr "" - -#: ../../distutils/setupscript.rst:248 -msgid "" -"You can specify absolute directories there; if you know that your extension " -"will only be built on Unix systems with X11R6 installed to :file:`/usr`, you " -"can get away with ::" -msgstr "" - -#: ../../distutils/setupscript.rst:254 -msgid "" -"You should avoid this sort of non-portable usage if you plan to distribute " -"your code: it's probably better to write C code like ::" -msgstr "" - -#: ../../distutils/setupscript.rst:259 -msgid "" -"If you need to include header files from some other Python extension, you " -"can take advantage of the fact that header files are installed in a " -"consistent way by the Distutils :command:`install_headers` command. For " -"example, the Numerical Python header files are installed (on a standard Unix " -"installation) to :file:`/usr/local/include/python1.5/Numerical`. (The exact " -"location will differ according to your platform and Python installation.) " -"Since the Python include directory---\\ :file:`/usr/local/include/python1.5` " -"in this case---is always included in the search path when building Python " -"extensions, the best approach is to write C code like ::" -msgstr "" - -#: ../../distutils/setupscript.rst:271 -msgid "" -"If you must put the :file:`Numerical` include directory right into your " -"header search path, though, you can find that directory using the Distutils :" -"mod:`distutils.sysconfig` module::" -msgstr "" - -#: ../../distutils/setupscript.rst:281 -msgid "" -"Even though this is quite portable---it will work on any Python " -"installation, regardless of platform---it's probably easier to just write " -"your C code in the sensible way." -msgstr "" - -#: ../../distutils/setupscript.rst:285 -msgid "" -"You can define and undefine pre-processor macros with the ``define_macros`` " -"and ``undef_macros`` options. ``define_macros`` takes a list of ``(name, " -"value)`` tuples, where ``name`` is the name of the macro to define (a " -"string) and ``value`` is its value: either a string or ``None``. (Defining " -"a macro ``FOO`` to ``None`` is the equivalent of a bare ``#define FOO`` in " -"your C source: with most compilers, this sets ``FOO`` to the string ``1``.) " -"``undef_macros`` is just a list of macros to undefine." -msgstr "" - -#: ../../distutils/setupscript.rst:293 -msgid "For example::" -msgstr "" -"舉例來說:\n" -"\n" -"::" - -#: ../../distutils/setupscript.rst:300 -msgid "is the equivalent of having this at the top of every C source file::" -msgstr "" - -#: ../../distutils/setupscript.rst:309 -msgid "Library options" -msgstr "" - -#: ../../distutils/setupscript.rst:311 -msgid "" -"You can also specify the libraries to link against when building your " -"extension, and the directories to search for those libraries. The " -"``libraries`` option is a list of libraries to link against, " -"``library_dirs`` is a list of directories to search for libraries at link-" -"time, and ``runtime_library_dirs`` is a list of directories to search for " -"shared (dynamically loaded) libraries at run-time." -msgstr "" - -#: ../../distutils/setupscript.rst:317 -msgid "" -"For example, if you need to link against libraries known to be in the " -"standard library search path on target systems ::" -msgstr "" - -#: ../../distutils/setupscript.rst:323 -msgid "" -"If you need to link with libraries in a non-standard location, you'll have " -"to include the location in ``library_dirs``::" -msgstr "" - -#: ../../distutils/setupscript.rst:330 -msgid "" -"(Again, this sort of non-portable construct should be avoided if you intend " -"to distribute your code.)" -msgstr "" - -#: ../../distutils/setupscript.rst:337 -msgid "Other options" -msgstr "" - -#: ../../distutils/setupscript.rst:339 -msgid "" -"There are still some other options which can be used to handle special cases." -msgstr "" - -#: ../../distutils/setupscript.rst:341 -msgid "" -"The ``optional`` option is a boolean; if it is true, a build failure in the " -"extension will not abort the build process, but instead simply not install " -"the failing extension." -msgstr "" - -#: ../../distutils/setupscript.rst:345 -msgid "" -"The ``extra_objects`` option is a list of object files to be passed to the " -"linker. These files must not have extensions, as the default extension for " -"the compiler is used." -msgstr "" - -#: ../../distutils/setupscript.rst:349 -msgid "" -"``extra_compile_args`` and ``extra_link_args`` can be used to specify " -"additional command line options for the respective compiler and linker " -"command lines." -msgstr "" - -#: ../../distutils/setupscript.rst:353 -msgid "" -"``export_symbols`` is only useful on Windows. It can contain a list of " -"symbols (functions or variables) to be exported. This option is not needed " -"when building compiled extensions: Distutils will automatically add " -"``initmodule`` to the list of exported symbols." -msgstr "" - -#: ../../distutils/setupscript.rst:358 -msgid "" -"The ``depends`` option is a list of files that the extension depends on (for " -"example header files). The build command will call the compiler on the " -"sources to rebuild extension if any on this files has been modified since " -"the previous build." -msgstr "" - -#: ../../distutils/setupscript.rst:364 -msgid "Relationships between Distributions and Packages" -msgstr "" - -#: ../../distutils/setupscript.rst:366 -msgid "A distribution may relate to packages in three specific ways:" -msgstr "" - -#: ../../distutils/setupscript.rst:368 -msgid "It can require packages or modules." -msgstr "" - -#: ../../distutils/setupscript.rst:370 -msgid "It can provide packages or modules." -msgstr "" - -#: ../../distutils/setupscript.rst:372 -msgid "It can obsolete packages or modules." -msgstr "" - -#: ../../distutils/setupscript.rst:374 -msgid "" -"These relationships can be specified using keyword arguments to the :func:" -"`distutils.core.setup` function." -msgstr "" - -#: ../../distutils/setupscript.rst:377 -msgid "" -"Dependencies on other Python modules and packages can be specified by " -"supplying the *requires* keyword argument to :func:`setup`. The value must " -"be a list of strings. Each string specifies a package that is required, and " -"optionally what versions are sufficient." -msgstr "" - -#: ../../distutils/setupscript.rst:382 -msgid "" -"To specify that any version of a module or package is required, the string " -"should consist entirely of the module or package name. Examples include " -"``'mymodule'`` and ``'xml.parsers.expat'``." -msgstr "" - -#: ../../distutils/setupscript.rst:386 -msgid "" -"If specific versions are required, a sequence of qualifiers can be supplied " -"in parentheses. Each qualifier may consist of a comparison operator and a " -"version number. The accepted comparison operators are::" -msgstr "" - -#: ../../distutils/setupscript.rst:393 -msgid "" -"These can be combined by using multiple qualifiers separated by commas (and " -"optional whitespace). In this case, all of the qualifiers must be matched; " -"a logical AND is used to combine the evaluations." -msgstr "" - -#: ../../distutils/setupscript.rst:397 -msgid "Let's look at a bunch of examples:" -msgstr "" - -#: ../../distutils/setupscript.rst:400 -msgid "Requires Expression" -msgstr "" - -#: ../../distutils/setupscript.rst:400 ../../distutils/setupscript.rst:418 -msgid "Explanation" -msgstr "" - -#: ../../distutils/setupscript.rst:402 -msgid "``==1.0``" -msgstr "``==1.0``" - -#: ../../distutils/setupscript.rst:402 -msgid "Only version ``1.0`` is compatible" -msgstr "" - -#: ../../distutils/setupscript.rst:404 -msgid "``>1.0, !=1.5.1, <2.0``" -msgstr "``>1.0, !=1.5.1, <2.0``" - -#: ../../distutils/setupscript.rst:404 -msgid "" -"Any version after ``1.0`` and before ``2.0`` is compatible, except ``1.5.1``" -msgstr "" - -#: ../../distutils/setupscript.rst:408 -msgid "" -"Now that we can specify dependencies, we also need to be able to specify " -"what we provide that other distributions can require. This is done using " -"the *provides* keyword argument to :func:`setup`. The value for this keyword " -"is a list of strings, each of which names a Python module or package, and " -"optionally identifies the version. If the version is not specified, it is " -"assumed to match that of the distribution." -msgstr "" - -#: ../../distutils/setupscript.rst:415 -msgid "Some examples:" -msgstr "" - -#: ../../distutils/setupscript.rst:418 -msgid "Provides Expression" -msgstr "" - -#: ../../distutils/setupscript.rst:420 -msgid "``mypkg``" -msgstr "``mypkg``" - -#: ../../distutils/setupscript.rst:420 -msgid "Provide ``mypkg``, using the distribution version" -msgstr "" - -#: ../../distutils/setupscript.rst:423 -msgid "``mypkg (1.1)``" -msgstr "``mypkg (1.1)``" - -#: ../../distutils/setupscript.rst:423 -msgid "Provide ``mypkg`` version 1.1, regardless of the distribution version" -msgstr "" - -#: ../../distutils/setupscript.rst:427 -msgid "" -"A package can declare that it obsoletes other packages using the *obsoletes* " -"keyword argument. The value for this is similar to that of the *requires* " -"keyword: a list of strings giving module or package specifiers. Each " -"specifier consists of a module or package name optionally followed by one or " -"more version qualifiers. Version qualifiers are given in parentheses after " -"the module or package name." -msgstr "" - -#: ../../distutils/setupscript.rst:434 -msgid "" -"The versions identified by the qualifiers are those that are obsoleted by " -"the distribution being described. If no qualifiers are given, all versions " -"of the named module or package are understood to be obsoleted." -msgstr "" - -#: ../../distutils/setupscript.rst:441 -msgid "Installing Scripts" -msgstr "" - -#: ../../distutils/setupscript.rst:443 -msgid "" -"So far we have been dealing with pure and non-pure Python modules, which are " -"usually not run by themselves but imported by scripts." -msgstr "" - -#: ../../distutils/setupscript.rst:446 -msgid "" -"Scripts are files containing Python source code, intended to be started from " -"the command line. Scripts don't require Distutils to do anything very " -"complicated. The only clever feature is that if the first line of the script " -"starts with ``#!`` and contains the word \"python\", the Distutils will " -"adjust the first line to refer to the current interpreter location. By " -"default, it is replaced with the current interpreter location. The :option:" -"`!--executable` (or :option:`!-e`) option will allow the interpreter path to " -"be explicitly overridden." -msgstr "" - -#: ../../distutils/setupscript.rst:454 -msgid "" -"The ``scripts`` option simply is a list of files to be handled in this way. " -"From the PyXML setup script::" -msgstr "" - -#: ../../distutils/setupscript.rst:461 -msgid "" -"All the scripts will also be added to the ``MANIFEST`` file if no template " -"is provided. See :ref:`manifest`." -msgstr "" - -#: ../../distutils/setupscript.rst:469 -msgid "Installing Package Data" -msgstr "" - -#: ../../distutils/setupscript.rst:471 -msgid "" -"Often, additional files need to be installed into a package. These files " -"are often data that's closely related to the package's implementation, or " -"text files containing documentation that might be of interest to programmers " -"using the package. These files are called :dfn:`package data`." -msgstr "" - -#: ../../distutils/setupscript.rst:476 -msgid "" -"Package data can be added to packages using the ``package_data`` keyword " -"argument to the :func:`setup` function. The value must be a mapping from " -"package name to a list of relative path names that should be copied into the " -"package. The paths are interpreted as relative to the directory containing " -"the package (information from the ``package_dir`` mapping is used if " -"appropriate); that is, the files are expected to be part of the package in " -"the source directories. They may contain glob patterns as well." -msgstr "" - -#: ../../distutils/setupscript.rst:484 -msgid "" -"The path names may contain directory portions; any necessary directories " -"will be created in the installation." -msgstr "" - -#: ../../distutils/setupscript.rst:487 -msgid "" -"For example, if a package should contain a subdirectory with several data " -"files, the files can be arranged like this in the source tree::" -msgstr "" - -#: ../../distutils/setupscript.rst:500 -msgid "The corresponding call to :func:`setup` might be::" -msgstr "" - -#: ../../distutils/setupscript.rst:509 -msgid "" -"All the files that match ``package_data`` will be added to the ``MANIFEST`` " -"file if no template is provided. See :ref:`manifest`." -msgstr "" - -#: ../../distutils/setupscript.rst:517 -msgid "Installing Additional Files" -msgstr "" - -#: ../../distutils/setupscript.rst:519 -msgid "" -"The ``data_files`` option can be used to specify additional files needed by " -"the module distribution: configuration files, message catalogs, data files, " -"anything which doesn't fit in the previous categories." -msgstr "" - -#: ../../distutils/setupscript.rst:523 -msgid "" -"``data_files`` specifies a sequence of (*directory*, *files*) pairs in the " -"following way::" -msgstr "" - -#: ../../distutils/setupscript.rst:531 -msgid "" -"Each (*directory*, *files*) pair in the sequence specifies the installation " -"directory and the files to install there." -msgstr "" - -#: ../../distutils/setupscript.rst:534 -msgid "" -"Each file name in *files* is interpreted relative to the :file:`setup.py` " -"script at the top of the package source distribution. Note that you can " -"specify the directory where the data files will be installed, but you cannot " -"rename the data files themselves." -msgstr "" - -#: ../../distutils/setupscript.rst:539 -msgid "" -"The *directory* should be a relative path. It is interpreted relative to the " -"installation prefix (Python's ``sys.prefix`` for system installations; " -"``site.USER_BASE`` for user installations). Distutils allows *directory* to " -"be an absolute installation path, but this is discouraged since it is " -"incompatible with the wheel packaging format. No directory information from " -"*files* is used to determine the final location of the installed file; only " -"the name of the file is used." -msgstr "" - -#: ../../distutils/setupscript.rst:547 -msgid "" -"You can specify the ``data_files`` options as a simple sequence of files " -"without specifying a target directory, but this is not recommended, and the :" -"command:`install` command will print a warning in this case. To install data " -"files directly in the target directory, an empty string should be given as " -"the directory." -msgstr "" - -#: ../../distutils/setupscript.rst:553 -msgid "" -"All the files that match ``data_files`` will be added to the ``MANIFEST`` " -"file if no template is provided. See :ref:`manifest`." -msgstr "" - -#: ../../distutils/setupscript.rst:561 -msgid "Additional meta-data" -msgstr "" - -#: ../../distutils/setupscript.rst:563 -msgid "" -"The setup script may include additional meta-data beyond the name and " -"version. This information includes:" -msgstr "" - -#: ../../distutils/setupscript.rst:567 -msgid "Meta-Data" -msgstr "" - -#: ../../distutils/setupscript.rst:567 -msgid "Description" -msgstr "描述" - -#: ../../distutils/setupscript.rst:567 -msgid "Value" -msgstr "" - -#: ../../distutils/setupscript.rst:567 -msgid "Notes" -msgstr "註解" - -#: ../../distutils/setupscript.rst:569 -msgid "``name``" -msgstr "``name``" - -#: ../../distutils/setupscript.rst:569 -msgid "name of the package" -msgstr "" - -#: ../../distutils/setupscript.rst:569 ../../distutils/setupscript.rst:571 -#: ../../distutils/setupscript.rst:573 ../../distutils/setupscript.rst:578 -#: ../../distutils/setupscript.rst:585 ../../distutils/setupscript.rst:601 -msgid "short string" -msgstr "" - -#: ../../distutils/setupscript.rst:569 ../../distutils/setupscript.rst:583 -msgid "\\(1)" -msgstr "\\(1)" - -#: ../../distutils/setupscript.rst:571 -msgid "``version``" -msgstr "``version``" - -#: ../../distutils/setupscript.rst:571 -msgid "version of this release" -msgstr "" - -#: ../../distutils/setupscript.rst:571 -msgid "(1)(2)" -msgstr "(1)(2)" - -#: ../../distutils/setupscript.rst:573 -msgid "``author``" -msgstr "``author``" - -#: ../../distutils/setupscript.rst:573 -msgid "package author's name" -msgstr "" - -#: ../../distutils/setupscript.rst:573 ../../distutils/setupscript.rst:575 -#: ../../distutils/setupscript.rst:578 ../../distutils/setupscript.rst:580 -msgid "\\(3)" -msgstr "\\(3)" - -#: ../../distutils/setupscript.rst:575 -msgid "``author_email``" -msgstr "``author_email``" - -#: ../../distutils/setupscript.rst:575 -msgid "email address of the package author" -msgstr "" - -#: ../../distutils/setupscript.rst:575 ../../distutils/setupscript.rst:580 -msgid "email address" -msgstr "" - -#: ../../distutils/setupscript.rst:578 -msgid "``maintainer``" -msgstr "``maintainer``" - -#: ../../distutils/setupscript.rst:578 -msgid "package maintainer's name" -msgstr "" - -#: ../../distutils/setupscript.rst:580 -msgid "``maintainer_email``" -msgstr "``maintainer_email``" - -#: ../../distutils/setupscript.rst:580 -msgid "email address of the package maintainer" -msgstr "" - -#: ../../distutils/setupscript.rst:583 -msgid "``url``" -msgstr "``url``" - -#: ../../distutils/setupscript.rst:583 -msgid "home page for the package" -msgstr "" - -#: ../../distutils/setupscript.rst:583 ../../distutils/setupscript.rst:592 -msgid "URL" -msgstr "URL" - -#: ../../distutils/setupscript.rst:585 -msgid "``description``" -msgstr "``description``" - -#: ../../distutils/setupscript.rst:585 -msgid "short, summary description of the package" -msgstr "" - -#: ../../distutils/setupscript.rst:589 -msgid "``long_description``" -msgstr "``long_description``" - -#: ../../distutils/setupscript.rst:589 -msgid "longer description of the package" -msgstr "" - -#: ../../distutils/setupscript.rst:589 -msgid "long string" -msgstr "" - -#: ../../distutils/setupscript.rst:589 -msgid "\\(4)" -msgstr "\\(4)" - -#: ../../distutils/setupscript.rst:592 -msgid "``download_url``" -msgstr "``download_url``" - -#: ../../distutils/setupscript.rst:592 -msgid "location where the package may be downloaded" -msgstr "" - -#: ../../distutils/setupscript.rst:595 -msgid "``classifiers``" -msgstr "``classifiers``" - -#: ../../distutils/setupscript.rst:595 -msgid "a list of classifiers" -msgstr "" - -#: ../../distutils/setupscript.rst:595 ../../distutils/setupscript.rst:597 -#: ../../distutils/setupscript.rst:599 -msgid "list of strings" -msgstr "" - -#: ../../distutils/setupscript.rst:595 -msgid "(6)(7)" -msgstr "(6)(7)" - -#: ../../distutils/setupscript.rst:597 -msgid "``platforms``" -msgstr "``platforms``" - -#: ../../distutils/setupscript.rst:597 -msgid "a list of platforms" -msgstr "" - -#: ../../distutils/setupscript.rst:597 ../../distutils/setupscript.rst:599 -msgid "(6)(8)" -msgstr "(6)(8)" - -#: ../../distutils/setupscript.rst:599 -msgid "``keywords``" -msgstr "``keywords``" - -#: ../../distutils/setupscript.rst:599 -msgid "a list of keywords" -msgstr "" - -#: ../../distutils/setupscript.rst:601 -msgid "``license``" -msgstr "``license``" - -#: ../../distutils/setupscript.rst:601 -msgid "license for the package" -msgstr "" - -#: ../../distutils/setupscript.rst:601 -msgid "\\(5)" -msgstr "\\(5)" - -#: ../../distutils/setupscript.rst:604 -msgid "Notes:" -msgstr "註解:" - -#: ../../distutils/setupscript.rst:607 -msgid "These fields are required." -msgstr "" - -#: ../../distutils/setupscript.rst:610 -msgid "" -"It is recommended that versions take the form *major.minor[.patch[.sub]]*." -msgstr "" - -#: ../../distutils/setupscript.rst:613 -msgid "" -"Either the author or the maintainer must be identified. If maintainer is " -"provided, distutils lists it as the author in :file:`PKG-INFO`." -msgstr "" - -#: ../../distutils/setupscript.rst:617 -msgid "" -"The ``long_description`` field is used by PyPI when you publish a package, " -"to build its project page." -msgstr "" - -#: ../../distutils/setupscript.rst:621 -msgid "" -"The ``license`` field is a text indicating the license covering the package " -"where the license is not a selection from the \"License\" Trove classifiers. " -"See the ``Classifier`` field. Notice that there's a ``licence`` distribution " -"option which is deprecated but still acts as an alias for ``license``." -msgstr "" - -#: ../../distutils/setupscript.rst:628 -msgid "This field must be a list." -msgstr "" - -#: ../../distutils/setupscript.rst:631 -msgid "" -"The valid classifiers are listed on `PyPI `_." -msgstr "" - -#: ../../distutils/setupscript.rst:635 -msgid "" -"To preserve backward compatibility, this field also accepts a string. If you " -"pass a comma-separated string ``'foo, bar'``, it will be converted to " -"``['foo', 'bar']``, Otherwise, it will be converted to a list of one string." -msgstr "" - -#: ../../distutils/setupscript.rst:641 -msgid "'short string'" -msgstr "" - -#: ../../distutils/setupscript.rst:641 -msgid "A single line of text, not more than 200 characters." -msgstr "" - -#: ../../distutils/setupscript.rst:645 -msgid "'long string'" -msgstr "" - -#: ../../distutils/setupscript.rst:644 -msgid "" -"Multiple lines of plain text in reStructuredText format (see https://" -"docutils.sourceforge.io/)." -msgstr "" - -#: ../../distutils/setupscript.rst:648 -msgid "'list of strings'" -msgstr "" - -#: ../../distutils/setupscript.rst:648 -msgid "See below." -msgstr "" - -#: ../../distutils/setupscript.rst:650 -msgid "" -"Encoding the version information is an art in itself. Python packages " -"generally adhere to the version format *major.minor[.patch][sub]*. The major " -"number is 0 for initial, experimental releases of software. It is " -"incremented for releases that represent major milestones in a package. The " -"minor number is incremented when important new features are added to the " -"package. The patch number increments when bug-fix releases are made. " -"Additional trailing version information is sometimes used to indicate sub-" -"releases. These are \"a1,a2,...,aN\" (for alpha releases, where " -"functionality and API may change), \"b1,b2,...,bN\" (for beta releases, " -"which only fix bugs) and \"pr1,pr2,...,prN\" (for final pre-release release " -"testing). Some examples:" -msgstr "" - -#: ../../distutils/setupscript.rst:662 -msgid "0.1.0" -msgstr "0.1.0" - -#: ../../distutils/setupscript.rst:662 -msgid "the first, experimental release of a package" -msgstr "" - -#: ../../distutils/setupscript.rst:665 -msgid "1.0.1a2" -msgstr "1.0.1a2" - -#: ../../distutils/setupscript.rst:665 -msgid "the second alpha release of the first patch version of 1.0" -msgstr "" - -#: ../../distutils/setupscript.rst:667 -msgid "``classifiers`` must be specified in a list::" -msgstr "" - -#: ../../distutils/setupscript.rst:688 -msgid "" -":class:`~distutils.core.setup` now warns when ``classifiers``, ``keywords`` " -"or ``platforms`` fields are not specified as a list or a string." -msgstr "" - -#: ../../distutils/setupscript.rst:695 -msgid "Debugging the setup script" -msgstr "" - -#: ../../distutils/setupscript.rst:697 -msgid "" -"Sometimes things go wrong, and the setup script doesn't do what the " -"developer wants." -msgstr "" - -#: ../../distutils/setupscript.rst:700 -msgid "" -"Distutils catches any exceptions when running the setup script, and print a " -"simple error message before the script is terminated. The motivation for " -"this behaviour is to not confuse administrators who don't know much about " -"Python and are trying to install a package. If they get a big long " -"traceback from deep inside the guts of Distutils, they may think the package " -"or the Python installation is broken because they don't read all the way " -"down to the bottom and see that it's a permission problem." -msgstr "" - -#: ../../distutils/setupscript.rst:708 -msgid "" -"On the other hand, this doesn't help the developer to find the cause of the " -"failure. For this purpose, the :envvar:`DISTUTILS_DEBUG` environment " -"variable can be set to anything except an empty string, and distutils will " -"now print detailed information about what it is doing, dump the full " -"traceback when an exception occurs, and print the whole command line when an " -"external program (like a C compiler) fails." -msgstr "" diff --git a/distutils/sourcedist.po b/distutils/sourcedist.po deleted file mode 100644 index 2d25cf2305..0000000000 --- a/distutils/sourcedist.po +++ /dev/null @@ -1,439 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" -"PO-Revision-Date: 2018-05-23 14:09+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../distutils/sourcedist.rst:5 -msgid "Creating a Source Distribution" -msgstr "" - -#: ../../distutils/_setuptools_disclaimer.rst:3 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../distutils/sourcedist.rst:9 -msgid "" -"As shown in section :ref:`distutils-simple-example`, you use the :command:" -"`sdist` command to create a source distribution. In the simplest case, ::" -msgstr "" - -#: ../../distutils/sourcedist.rst:14 -msgid "" -"(assuming you haven't specified any :command:`sdist` options in the setup " -"script or config file), :command:`sdist` creates the archive of the default " -"format for the current platform. The default format is a gzip'ed tar file (:" -"file:`.tar.gz`) on Unix, and ZIP file on Windows." -msgstr "" - -#: ../../distutils/sourcedist.rst:19 -msgid "" -"You can specify as many formats as you like using the :option:`!--formats` " -"option, for example::" -msgstr "" - -#: ../../distutils/sourcedist.rst:24 -msgid "to create a gzipped tarball and a zip file. The available formats are:" -msgstr "" - -#: ../../distutils/sourcedist.rst:27 -msgid "Format" -msgstr "" - -#: ../../distutils/sourcedist.rst:27 -msgid "Description" -msgstr "描述" - -#: ../../distutils/sourcedist.rst:27 -msgid "Notes" -msgstr "註解" - -#: ../../distutils/sourcedist.rst:29 -msgid "``zip``" -msgstr "``zip``" - -#: ../../distutils/sourcedist.rst:29 -msgid "zip file (:file:`.zip`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:29 -msgid "(1),(3)" -msgstr "(1),(3)" - -#: ../../distutils/sourcedist.rst:31 -msgid "``gztar``" -msgstr "``gztar``" - -#: ../../distutils/sourcedist.rst:31 -msgid "gzip'ed tar file (:file:`.tar.gz`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:31 -msgid "\\(2)" -msgstr "\\(2)" - -#: ../../distutils/sourcedist.rst:34 -msgid "``bztar``" -msgstr "``bztar``" - -#: ../../distutils/sourcedist.rst:34 -msgid "bzip2'ed tar file (:file:`.tar.bz2`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:34 ../../distutils/sourcedist.rst:37 -#: ../../distutils/sourcedist.rst:43 -msgid "\\(5)" -msgstr "\\(5)" - -#: ../../distutils/sourcedist.rst:37 -msgid "``xztar``" -msgstr "``xztar``" - -#: ../../distutils/sourcedist.rst:37 -msgid "xz'ed tar file (:file:`.tar.xz`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:40 -msgid "``ztar``" -msgstr "``ztar``" - -#: ../../distutils/sourcedist.rst:40 -msgid "compressed tar file (:file:`.tar.Z`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:40 -msgid "(4),(5)" -msgstr "(4),(5)" - -#: ../../distutils/sourcedist.rst:43 -msgid "``tar``" -msgstr "``tar``" - -#: ../../distutils/sourcedist.rst:43 -msgid "tar file (:file:`.tar`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:46 -msgid "Added support for the ``xztar`` format." -msgstr "" - -#: ../../distutils/sourcedist.rst:49 -msgid "Notes:" -msgstr "註解:" - -#: ../../distutils/sourcedist.rst:52 -msgid "default on Windows" -msgstr "" - -#: ../../distutils/sourcedist.rst:55 -msgid "default on Unix" -msgstr "" - -#: ../../distutils/sourcedist.rst:58 -msgid "" -"requires either external :program:`zip` utility or :mod:`zipfile` module " -"(part of the standard Python library since Python 1.6)" -msgstr "" - -#: ../../distutils/sourcedist.rst:62 -msgid "" -"requires the :program:`compress` program. Notice that this format is now " -"pending for deprecation and will be removed in the future versions of Python." -msgstr "" - -#: ../../distutils/sourcedist.rst:65 -msgid "" -"deprecated by `PEP 527 `_; `PyPI `_ only accepts ``.zip`` and ``.tar.gz`` files." -msgstr "" - -#: ../../distutils/sourcedist.rst:68 -msgid "" -"When using any ``tar`` format (``gztar``, ``bztar``, ``xztar``, ``ztar`` or " -"``tar``), under Unix you can specify the ``owner`` and ``group`` names that " -"will be set for each member of the archive." -msgstr "" - -#: ../../distutils/sourcedist.rst:72 -msgid "For example, if you want all files of the archive to be owned by root::" -msgstr "" - -#: ../../distutils/sourcedist.rst:80 -msgid "Specifying the files to distribute" -msgstr "" - -#: ../../distutils/sourcedist.rst:82 -msgid "" -"If you don't supply an explicit list of files (or instructions on how to " -"generate one), the :command:`sdist` command puts a minimal default set into " -"the source distribution:" -msgstr "" - -#: ../../distutils/sourcedist.rst:86 -msgid "" -"all Python source files implied by the ``py_modules`` and ``packages`` " -"options" -msgstr "" - -#: ../../distutils/sourcedist.rst:89 -msgid "" -"all C source files mentioned in the ``ext_modules`` or ``libraries`` options" -msgstr "" - -#: ../../distutils/sourcedist.rst:95 -msgid "" -"scripts identified by the ``scripts`` option See :ref:`distutils-installing-" -"scripts`." -msgstr "" - -#: ../../distutils/sourcedist.rst:98 -msgid "" -"anything that looks like a test script: :file:`test/test\\*.py` (currently, " -"the Distutils don't do anything with test scripts except include them in " -"source distributions, but in the future there will be a standard for testing " -"Python module distributions)" -msgstr "" - -#: ../../distutils/sourcedist.rst:103 -msgid "" -"Any of the standard README files (:file:`README`, :file:`README.txt`, or :" -"file:`README.rst`), :file:`setup.py` (or whatever you called your setup " -"script), and :file:`setup.cfg`." -msgstr "" - -#: ../../distutils/sourcedist.rst:107 -msgid "" -"all files that matches the ``package_data`` metadata. See :ref:`distutils-" -"installing-package-data`." -msgstr "" - -#: ../../distutils/sourcedist.rst:110 -msgid "" -"all files that matches the ``data_files`` metadata. See :ref:`distutils-" -"additional-files`." -msgstr "" - -#: ../../distutils/sourcedist.rst:113 -msgid "" -"Sometimes this is enough, but usually you will want to specify additional " -"files to distribute. The typical way to do this is to write a *manifest " -"template*, called :file:`MANIFEST.in` by default. The manifest template is " -"just a list of instructions for how to generate your manifest file, :file:" -"`MANIFEST`, which is the exact list of files to include in your source " -"distribution. The :command:`sdist` command processes this template and " -"generates a manifest based on its instructions and what it finds in the " -"filesystem." -msgstr "" - -#: ../../distutils/sourcedist.rst:121 -msgid "" -"If you prefer to roll your own manifest file, the format is simple: one " -"filename per line, regular files (or symlinks to them) only. If you do " -"supply your own :file:`MANIFEST`, you must specify everything: the default " -"set of files described above does not apply in this case." -msgstr "" - -#: ../../distutils/sourcedist.rst:126 -msgid "" -"An existing generated :file:`MANIFEST` will be regenerated without :command:" -"`sdist` comparing its modification time to the one of :file:`MANIFEST.in` " -"or :file:`setup.py`." -msgstr "" - -#: ../../distutils/sourcedist.rst:131 -msgid "" -":file:`MANIFEST` files start with a comment indicating they are generated. " -"Files without this comment are not overwritten or removed." -msgstr "" - -#: ../../distutils/sourcedist.rst:135 -msgid "" -":command:`sdist` will read a :file:`MANIFEST` file if no :file:`MANIFEST.in` " -"exists, like it used to do." -msgstr "" - -#: ../../distutils/sourcedist.rst:139 -msgid "" -":file:`README.rst` is now included in the list of distutils standard READMEs." -msgstr "" - -#: ../../distutils/sourcedist.rst:143 -msgid "" -"The manifest template has one command per line, where each command specifies " -"a set of files to include or exclude from the source distribution. For an " -"example, again we turn to the Distutils' own manifest template:" -msgstr "" - -#: ../../distutils/sourcedist.rst:153 -msgid "" -"The meanings should be fairly clear: include all files in the distribution " -"root matching :file:`\\*.txt`, all files anywhere under the :file:`examples` " -"directory matching :file:`\\*.txt` or :file:`\\*.py`, and exclude all " -"directories matching :file:`examples/sample?/build`. All of this is done " -"*after* the standard include set, so you can exclude files from the standard " -"set with explicit instructions in the manifest template. (Or, you can use " -"the :option:`!--no-defaults` option to disable the standard set entirely.) " -"There are several other commands available in the manifest template mini-" -"language; see section :ref:`sdist-cmd`." -msgstr "" - -#: ../../distutils/sourcedist.rst:163 -msgid "" -"The order of commands in the manifest template matters: initially, we have " -"the list of default files as described above, and each command in the " -"template adds to or removes from that list of files. Once we have fully " -"processed the manifest template, we remove files that should not be included " -"in the source distribution:" -msgstr "" - -#: ../../distutils/sourcedist.rst:169 -msgid "all files in the Distutils \"build\" tree (default :file:`build/`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:171 -msgid "" -"all files in directories named :file:`RCS`, :file:`CVS`, :file:`.svn`, :file:" -"`.hg`, :file:`.git`, :file:`.bzr` or :file:`_darcs`" -msgstr "" - -#: ../../distutils/sourcedist.rst:174 -msgid "" -"Now we have our complete list of files, which is written to the manifest for " -"future reference, and then used to build the source distribution archive(s)." -msgstr "" - -#: ../../distutils/sourcedist.rst:177 -msgid "" -"You can disable the default set of included files with the :option:`!--no-" -"defaults` option, and you can disable the standard exclude set with :option:" -"`!--no-prune`." -msgstr "" - -#: ../../distutils/sourcedist.rst:181 -msgid "" -"Following the Distutils' own manifest template, let's trace how the :command:" -"`sdist` command builds the list of files to include in the Distutils source " -"distribution:" -msgstr "" - -#: ../../distutils/sourcedist.rst:185 -msgid "" -"include all Python source files in the :file:`distutils` and :file:" -"`distutils/command` subdirectories (because packages corresponding to those " -"two directories were mentioned in the ``packages`` option in the setup " -"script---see section :ref:`setup-script`)" -msgstr "" - -#: ../../distutils/sourcedist.rst:190 -msgid "" -"include :file:`README.txt`, :file:`setup.py`, and :file:`setup.cfg` " -"(standard files)" -msgstr "" - -#: ../../distutils/sourcedist.rst:193 -msgid "include :file:`test/test\\*.py` (standard files)" -msgstr "" - -#: ../../distutils/sourcedist.rst:195 -msgid "" -"include :file:`\\*.txt` in the distribution root (this will find :file:" -"`README.txt` a second time, but such redundancies are weeded out later)" -msgstr "" - -#: ../../distutils/sourcedist.rst:198 -msgid "" -"include anything matching :file:`\\*.txt` or :file:`\\*.py` in the sub-tree " -"under :file:`examples`," -msgstr "" - -#: ../../distutils/sourcedist.rst:201 -msgid "" -"exclude all files in the sub-trees starting at directories matching :file:" -"`examples/sample?/build`\\ ---this may exclude files included by the " -"previous two steps, so it's important that the ``prune`` command in the " -"manifest template comes after the ``recursive-include`` command" -msgstr "" - -#: ../../distutils/sourcedist.rst:206 -msgid "" -"exclude the entire :file:`build` tree, and any :file:`RCS`, :file:`CVS`, :" -"file:`.svn`, :file:`.hg`, :file:`.git`, :file:`.bzr` and :file:`_darcs` " -"directories" -msgstr "" - -#: ../../distutils/sourcedist.rst:210 -msgid "" -"Just like in the setup script, file and directory names in the manifest " -"template should always be slash-separated; the Distutils will take care of " -"converting them to the standard representation on your platform. That way, " -"the manifest template is portable across operating systems." -msgstr "" - -#: ../../distutils/sourcedist.rst:219 -msgid "Manifest-related options" -msgstr "" - -#: ../../distutils/sourcedist.rst:221 -msgid "" -"The normal course of operations for the :command:`sdist` command is as " -"follows:" -msgstr "" - -#: ../../distutils/sourcedist.rst:223 -msgid "" -"if the manifest file (:file:`MANIFEST` by default) exists and the first line " -"does not have a comment indicating it is generated from :file:`MANIFEST.in`, " -"then it is used as is, unaltered" -msgstr "" - -#: ../../distutils/sourcedist.rst:227 -msgid "" -"if the manifest file doesn't exist or has been previously automatically " -"generated, read :file:`MANIFEST.in` and create the manifest" -msgstr "" - -#: ../../distutils/sourcedist.rst:230 -msgid "" -"if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest " -"with just the default file set" -msgstr "" - -#: ../../distutils/sourcedist.rst:233 -msgid "" -"use the list of files now in :file:`MANIFEST` (either just generated or read " -"in) to create the source distribution archive(s)" -msgstr "" - -#: ../../distutils/sourcedist.rst:236 -msgid "" -"There are a couple of options that modify this behaviour. First, use the :" -"option:`!--no-defaults` and :option:`!--no-prune` to disable the standard " -"\"include\" and \"exclude\" sets." -msgstr "" - -#: ../../distutils/sourcedist.rst:240 -msgid "" -"Second, you might just want to (re)generate the manifest, but not create a " -"source distribution::" -msgstr "" - -#: ../../distutils/sourcedist.rst:245 -msgid ":option:`!-o` is a shortcut for :option:`!--manifest-only`." -msgstr "" diff --git a/distutils/uploading.po b/distutils/uploading.po deleted file mode 100644 index 344bf10191..0000000000 --- a/distutils/uploading.po +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Ching-Lung Chuang, 2015 -# Liang-Bo Wang , 2015 -# Matt Wang , 2022 -# -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2022-02-11 13:46+0800\n" -"Last-Translator: Matt Wang \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../../distutils/uploading.rst:5 -msgid "Uploading Packages to the Package Index" -msgstr "上傳套件至套件索引 (Package Index)" - -#: ../../distutils/uploading.rst:7 -msgid "" -"References to up to date PyPI documentation can be found at :ref:`publishing-" -"python-packages`." -msgstr "關於最新 PyPI 文件可以在\\ :ref:`publishing-python-packages`\\ 找到。" diff --git a/library/asynchat.po b/library/asynchat.po deleted file mode 100644 index 82c9c94611..0000000000 --- a/library/asynchat.po +++ /dev/null @@ -1,248 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" -"PO-Revision-Date: 2022-10-16 04:51+0800\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" - -#: ../../library/asynchat.rst:2 -msgid ":mod:`asynchat` --- Asynchronous socket command/response handler" -msgstr ":mod:`asynchat` --- 非同步 socket 指令/回應處理函式" - -#: ../../library/asynchat.rst:11 -msgid "**Source code:** :source:`Lib/asynchat.py`" -msgstr "**原始碼:**\\ :source:`Lib/asynchat.py`" - -#: ../../library/asynchat.rst:17 -msgid "" -"The :mod:`asynchat` module is deprecated (see :pep:`PEP 594 <594#asynchat>` " -"for details). Please use :mod:`asyncio` instead." -msgstr "" -":mod:`asynchat` 已被棄用(詳情請見:pep:`PEP 594 <594#asynchat>`\\ )。請改" -"用 :mod:`asyncio`\\ 。" - -#: ../../library/asynchat.rst:22 -msgid "" -"This module exists for backwards compatibility only. For new code we " -"recommend using :mod:`asyncio`." -msgstr "" - -#: ../../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 " -"whose elements are terminated by arbitrary strings, or are of variable " -"length. :mod:`asynchat` defines the abstract class :class:`async_chat` that " -"you subclass, providing implementations of the :meth:`collect_incoming_data` " -"and :meth:`found_terminator` methods. It uses the same asynchronous loop as :" -"mod:`asyncore`, and the two types of channel, :class:`asyncore.dispatcher` " -"and :class:`asynchat.async_chat`, can freely be mixed in the channel map. " -"Typically an :class:`asyncore.dispatcher` server channel generates new :" -"class:`asynchat.async_chat` channel objects as it receives incoming " -"connection requests." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: ../../library/asynchat.rst:41 -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 " -"meaningful :meth:`collect_incoming_data` and :meth:`found_terminator` " -"methods. The :class:`asyncore.dispatcher` methods can be used, although not " -"all make sense in a message/response context." -msgstr "" - -#: ../../library/asynchat.rst:48 -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:" -"func:`select` call. Once the polling loop has been started the :class:" -"`async_chat` object's methods are called by the event-processing framework " -"with no action on the part of the programmer." -msgstr "" - -#: ../../library/asynchat.rst:54 -msgid "" -"Two class attributes can be modified, to improve performance, or possibly " -"even to conserve memory." -msgstr "" - -#: ../../library/asynchat.rst:60 -msgid "The asynchronous input buffer size (default ``4096``)." -msgstr "" - -#: ../../library/asynchat.rst:65 -msgid "The asynchronous output buffer size (default ``4096``)." -msgstr "" - -#: ../../library/asynchat.rst:67 -msgid "" -"Unlike :class:`asyncore.dispatcher`, :class:`async_chat` allows you to " -"define a :abbr:`FIFO (first-in, first-out)` queue of *producers*. A producer " -"need have only one method, :meth:`more`, which should return data to be " -"transmitted on the channel. The producer indicates exhaustion (*i.e.* that " -"it contains no more data) by having its :meth:`more` method return the empty " -"bytes object. At this point the :class:`async_chat` object removes the " -"producer from the queue and starts using the next producer, if any. When the " -"producer queue is empty the :meth:`handle_write` method does nothing. You " -"use the channel object's :meth:`set_terminator` method to describe how to " -"recognize the end of, or an important breakpoint in, an incoming " -"transmission from the remote endpoint." -msgstr "" - -#: ../../library/asynchat.rst:80 -msgid "" -"To build a functioning :class:`async_chat` subclass your input methods :" -"meth:`collect_incoming_data` and :meth:`found_terminator` must handle the " -"data that the channel receives asynchronously. The methods are described " -"below." -msgstr "" - -#: ../../library/asynchat.rst:88 -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:94 -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:101 -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:107 -msgid "" -"Called when the incoming data stream matches the termination condition set " -"by :meth:`set_terminator`. The default method, which must be overridden, " -"raises a :exc:`NotImplementedError` exception. The buffered input data " -"should be available via an instance attribute." -msgstr "" - -#: ../../library/asynchat.rst:115 -msgid "Returns the current terminator for the channel." -msgstr "" - -#: ../../library/asynchat.rst:120 -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, " -"although it is possible to use your own producers in more complex schemes to " -"implement encryption and chunking, for example." -msgstr "" - -#: ../../library/asynchat.rst:128 -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 " -"channel will consume this producer's data by calling its :meth:`more` method " -"and send the data to the remote endpoint." -msgstr "" - -#: ../../library/asynchat.rst:136 -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:141 -msgid "term" -msgstr "" - -#: ../../library/asynchat.rst:141 -msgid "Description" -msgstr "描述" - -#: ../../library/asynchat.rst:143 -msgid "*string*" -msgstr "" - -#: ../../library/asynchat.rst:143 -msgid "" -"Will call :meth:`found_terminator` when the string is found in the input " -"stream" -msgstr "" - -#: ../../library/asynchat.rst:146 -msgid "*integer*" -msgstr "" - -#: ../../library/asynchat.rst:146 -msgid "" -"Will call :meth:`found_terminator` when the indicated number of characters " -"have been received" -msgstr "" - -#: ../../library/asynchat.rst:150 -msgid "``None``" -msgstr "``None``" - -#: ../../library/asynchat.rst:150 -msgid "The channel continues to collect data forever" -msgstr "" - -#: ../../library/asynchat.rst:154 -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:161 -msgid "asynchat Example" -msgstr "" - -#: ../../library/asynchat.rst:163 -msgid "" -"The following partial example shows how HTTP requests can be read with :" -"class:`async_chat`. A web server might create an :class:" -"`http_request_handler` object for each incoming client connection. Notice " -"that initially the channel terminator is set to match the blank line at the " -"end of the HTTP headers, and a flag indicates that the headers are being " -"read." -msgstr "" - -#: ../../library/asynchat.rst:170 -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:" -"`` header is used to set a numeric terminator to read the right amount of " -"data from the channel." -msgstr "" - -#: ../../library/asynchat.rst:175 -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 " -"any extraneous data sent by the web client are ignored. ::" -msgstr "" diff --git a/library/asyncore.po b/library/asyncore.po deleted file mode 100644 index a41d0c8ec2..0000000000 --- a/library/asyncore.po +++ /dev/null @@ -1,380 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" -"PO-Revision-Date: 2022-10-16 04:57+0800\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" - -#: ../../library/asyncore.rst:2 -msgid ":mod:`asyncore` --- Asynchronous socket handler" -msgstr ":mod:`asyncore` --- 非同步 socket 處理函式" - -#: ../../library/asyncore.rst:14 -msgid "**Source code:** :source:`Lib/asyncore.py`" -msgstr "**原始碼:**\\ :source:`Lib/asyncore.py`" - -#: ../../library/asyncore.rst:20 -msgid "" -"The :mod:`asyncore` module is deprecated (see :pep:`PEP 594 <594#asyncore>` " -"for details). Please use :mod:`asyncio` instead." -msgstr "" -":mod:`asyncore` 已被棄用(詳情請見:pep:`PEP 594 <594#asyncore>`\\ )。請改" -"用 :mod:`asyncio`\\ 。" - -#: ../../library/asyncore.rst:25 -msgid "" -"This module exists for backwards compatibility only. For new code we " -"recommend using :mod:`asyncio`." -msgstr "" - -#: ../../library/asyncore.rst:28 -msgid "" -"This module provides the basic infrastructure for writing asynchronous " -"socket service clients and servers." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: ../../library/asyncore.rst:33 -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 " -"most popular way to do it, but there is another very different technique, " -"that lets you have nearly all the advantages of multi-threading, without " -"actually using multiple threads. It's really only practical if your " -"program is largely I/O bound. If your program is processor bound, then pre-" -"emptive scheduled threads are probably what you really need. Network " -"servers are rarely processor bound, however." -msgstr "" - -#: ../../library/asyncore.rst:42 -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 " -"communication channels at once; doing other work while your I/O is taking " -"place in the \"background.\" Although this strategy can seem strange and " -"complex, especially at first, it is in many ways easier to understand and " -"control than multi-threaded programming. The :mod:`asyncore` module solves " -"many of the difficult problems for you, making the task of building " -"sophisticated high-performance network servers and clients a snap. For " -"\"conversational\" applications and protocols the companion :mod:`asynchat` " -"module is invaluable." -msgstr "" - -#: ../../library/asyncore.rst:53 -msgid "" -"The basic idea behind both modules is to create one or more network " -"*channels*, instances of class :class:`asyncore.dispatcher` and :class:" -"`asynchat.async_chat`. Creating the channels adds them to a global map, " -"used by the :func:`loop` function if you do not provide it with your own " -"*map*." -msgstr "" - -#: ../../library/asyncore.rst:59 -msgid "" -"Once the initial channel(s) is(are) created, calling the :func:`loop` " -"function activates channel service, which continues until the last channel " -"(including any that have been added to the map during asynchronous service) " -"is closed." -msgstr "" - -#: ../../library/asyncore.rst:66 -msgid "" -"Enter a polling loop that terminates after count passes or all open channels " -"have been closed. All arguments are optional. The *count* parameter " -"defaults to ``None``, resulting in the loop terminating only when all " -"channels have been closed. The *timeout* argument sets the timeout " -"parameter for the appropriate :func:`~select.select` or :func:`~select.poll` " -"call, measured in seconds; the default is 30 seconds. The *use_poll* " -"parameter, if true, indicates that :func:`~select.poll` should be used in " -"preference to :func:`~select.select` (the default is ``False``)." -msgstr "" - -#: ../../library/asyncore.rst:75 -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 " -"omitted, a global map is used. Channels (instances of :class:`asyncore." -"dispatcher`, :class:`asynchat.async_chat` and subclasses thereof) can freely " -"be mixed in the map." -msgstr "" - -#: ../../library/asyncore.rst:84 -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 " -"which are called from the asynchronous loop. Otherwise, it can be treated " -"as a normal non-blocking socket object." -msgstr "" - -#: ../../library/asyncore.rst:89 -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 " -"taken place. For example, if we have asked for a socket to connect to " -"another host, we know that the connection has been made when the socket " -"becomes writable for the first time (at this point you know that you may " -"write to it with the expectation of success). The implied higher-level " -"events are:" -msgstr "" - -#: ../../library/asyncore.rst:98 -msgid "Event" -msgstr "" - -#: ../../library/asyncore.rst:98 -msgid "Description" -msgstr "描述" - -#: ../../library/asyncore.rst:100 -msgid "``handle_connect()``" -msgstr "``handle_connect()``" - -#: ../../library/asyncore.rst:100 -msgid "Implied by the first read or write event" -msgstr "" - -#: ../../library/asyncore.rst:103 -msgid "``handle_close()``" -msgstr "``handle_close()``" - -#: ../../library/asyncore.rst:103 -msgid "Implied by a read event with no data available" -msgstr "" - -#: ../../library/asyncore.rst:106 -msgid "``handle_accepted()``" -msgstr "``handle_accepted()``" - -#: ../../library/asyncore.rst:106 -msgid "Implied by a read event on a listening socket" -msgstr "" - -#: ../../library/asyncore.rst:110 -msgid "" -"During asynchronous processing, each mapped channel's :meth:`readable` and :" -"meth:`writable` methods are used to determine whether the channel's socket " -"should be added to the list of channels :c:func:`select`\\ ed or :c:func:" -"`poll`\\ ed for read and write events." -msgstr "" - -#: ../../library/asyncore.rst:115 -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:121 -msgid "" -"Called when the asynchronous loop detects that a :meth:`read` call on the " -"channel's socket will succeed." -msgstr "" - -#: ../../library/asyncore.rst:127 -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:138 -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:144 -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:151 -msgid "Called when the socket is closed." -msgstr "" - -#: ../../library/asyncore.rst:156 -msgid "" -"Called when an exception is raised and not otherwise handled. The default " -"version prints a condensed traceback." -msgstr "" - -#: ../../library/asyncore.rst:162 -msgid "" -"Called on listening channels (passive openers) when a connection can be " -"established with a new remote endpoint that has issued a :meth:`connect` " -"call for the local endpoint. Deprecated in version 3.2; use :meth:" -"`handle_accepted` instead." -msgstr "" - -#: ../../library/asyncore.rst:172 -msgid "" -"Called on listening channels (passive openers) when a connection has been " -"established with a new remote endpoint that has issued a :meth:`connect` " -"call for the local endpoint. *sock* is a *new* socket object usable to send " -"and receive data on the connection, and *addr* is the address bound to the " -"socket on the other end of the connection." -msgstr "" - -#: ../../library/asyncore.rst:183 -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 " -"occur. The default method simply returns ``True``, indicating that by " -"default, all channels will be interested in read events." -msgstr "" - -#: ../../library/asyncore.rst:191 -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 " -"occur. The default method simply returns ``True``, indicating that by " -"default, all channels will be interested in write events." -msgstr "" - -#: ../../library/asyncore.rst:197 -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:203 -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:207 -msgid "*family* and *type* arguments can be omitted." -msgstr "" - -#: ../../library/asyncore.rst:213 -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:219 -msgid "Send *data* to the remote end-point of the socket." -msgstr "" - -#: ../../library/asyncore.rst:224 -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:228 -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:235 -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:242 -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:" -"`socket` documentation for more information.) To mark the socket as re-" -"usable (setting the :const:`SO_REUSEADDR` option), call the :class:" -"`dispatcher` object's :meth:`set_reuse_addr` method." -msgstr "" - -#: ../../library/asyncore.rst:251 -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, " -"address)`` where *conn* is a *new* socket object usable to send and receive " -"data on the connection, and *address* is the address bound to the socket on " -"the other end of the connection. When ``None`` is returned it means the " -"connection didn't take place, in which case the server should just ignore " -"this event and keep listening for further incoming connections." -msgstr "" - -#: ../../library/asyncore.rst:263 -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:271 -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:277 -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:" -"func:`loop` functions. If provided a file object or anything with a :c:func:" -"`fileno` method, that method will be called and passed to the :class:" -"`file_wrapper` constructor." -msgstr "" - -#: ../../library/asyncore.rst:283 ../../library/asyncore.rst:292 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - -#: ../../library/asyncore.rst:287 -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 " -"of the file_wrapper. This class implements sufficient methods to emulate a " -"socket for use by the :class:`file_dispatcher` class." -msgstr "" - -#: ../../library/asyncore.rst:298 -msgid "asyncore Example basic HTTP client" -msgstr "" - -#: ../../library/asyncore.rst:300 -msgid "" -"Here is a very basic HTTP client that uses the :class:`dispatcher` class to " -"implement its socket handling::" -msgstr "" - -#: ../../library/asyncore.rst:337 -msgid "asyncore Example basic echo server" -msgstr "" - -#: ../../library/asyncore.rst:339 -msgid "" -"Here is a basic echo server that uses the :class:`dispatcher` class to " -"accept connections and dispatches the incoming connections to a handler::" -msgstr "" diff --git a/library/distutils.po b/library/distutils.po deleted file mode 100644 index 04f1bec801..0000000000 --- a/library/distutils.po +++ /dev/null @@ -1,96 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" -"PO-Revision-Date: 2016-11-19 00:29+0000\n" -"Last-Translator: Liang-Bo Wang \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/distutils.rst:2 -msgid ":mod:`distutils` --- Building and installing Python modules" -msgstr "" - -#: ../../library/distutils.rst:12 -msgid "" -":mod:`distutils` is deprecated with removal planned for Python 3.12. See " -"the :ref:`What's New ` entry for more information." -msgstr "" - -#: ../../library/distutils.rst:17 -msgid "" -"The :mod:`distutils` package provides support for building and installing " -"additional modules into a Python installation. The new modules may be " -"either 100%-pure Python, or may be extension modules written in C, or may be " -"collections of Python packages which include modules coded in both Python " -"and C." -msgstr "" - -#: ../../library/distutils.rst:22 -msgid "" -"Most Python users will *not* want to use this module directly, but instead " -"use the cross-version tools maintained by the Python Packaging Authority. In " -"particular, `setuptools `__ is " -"an enhanced alternative to :mod:`distutils` that provides:" -msgstr "" - -#: ../../library/distutils.rst:28 -msgid "support for declaring project dependencies" -msgstr "" - -#: ../../library/distutils.rst:29 -msgid "" -"additional mechanisms for configuring which files to include in source " -"releases (including plugins for integration with version control systems)" -msgstr "" - -#: ../../library/distutils.rst:31 -msgid "" -"the ability to declare project \"entry points\", which can be used as the " -"basis for application plugin systems" -msgstr "" - -#: ../../library/distutils.rst:33 -msgid "" -"the ability to automatically generate Windows command line executables at " -"installation time rather than needing to prebuild them" -msgstr "" - -#: ../../library/distutils.rst:35 -msgid "consistent behaviour across all supported Python versions" -msgstr "" - -#: ../../library/distutils.rst:37 -msgid "" -"The recommended `pip `__ installer runs all ``setup." -"py`` scripts with ``setuptools``, even if the script itself only imports " -"``distutils``. Refer to the `Python Packaging User Guide `_ for more information." -msgstr "" - -#: ../../library/distutils.rst:43 -msgid "" -"For the benefits of packaging tool authors and users seeking a deeper " -"understanding of the details of the current packaging and distribution " -"system, the legacy :mod:`distutils` based user documentation and API " -"reference remain available:" -msgstr "" - -#: ../../library/distutils.rst:48 -msgid ":ref:`install-index`" -msgstr ":ref:`install-index`" - -#: ../../library/distutils.rst:49 -msgid ":ref:`distutils-index`" -msgstr ":ref:`distutils-index`" diff --git a/library/imp.po b/library/imp.po deleted file mode 100644 index c103a24193..0000000000 --- a/library/imp.po +++ /dev/null @@ -1,477 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+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-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/imp.rst:2 -msgid ":mod:`imp` --- Access the :ref:`import ` internals" -msgstr "" - -#: ../../library/imp.rst:8 -msgid "**Source code:** :source:`Lib/imp.py`" -msgstr "**原始碼:**\\ :source:`Lib/imp.py`" - -#: ../../library/imp.rst:12 -msgid "The :mod:`imp` module is deprecated in favor of :mod:`importlib`." -msgstr "" - -#: ../../library/imp.rst:17 -msgid "" -"This module provides an interface to the mechanisms used to implement the :" -"keyword:`import` statement. It defines the following constants and " -"functions:" -msgstr "" - -#: ../../library/imp.rst:25 -msgid "" -"Return the magic string value used to recognize byte-compiled code files (:" -"file:`.pyc` files). (This value may be different for each Python version.)" -msgstr "" - -#: ../../library/imp.rst:28 -msgid "Use :attr:`importlib.util.MAGIC_NUMBER` instead." -msgstr "" - -#: ../../library/imp.rst:34 -msgid "" -"Return a list of 3-element tuples, each describing a particular type of " -"module. Each triple has the form ``(suffix, mode, type)``, where *suffix* is " -"a string to be appended to the module name to form the filename to search " -"for, *mode* is the mode string to pass to the built-in :func:`open` function " -"to open the file (this can be ``'r'`` for text files or ``'rb'`` for binary " -"files), and *type* is the file type, which has one of the values :const:" -"`PY_SOURCE`, :const:`PY_COMPILED`, or :const:`C_EXTENSION`, described below." -msgstr "" - -#: ../../library/imp.rst:43 -msgid "Use the constants defined on :mod:`importlib.machinery` instead." -msgstr "" - -#: ../../library/imp.rst:49 -msgid "" -"Try to find the module *name*. If *path* is omitted or ``None``, the list " -"of directory names given by ``sys.path`` is searched, but first a few " -"special places are searched: the function tries to find a built-in module " -"with the given name (:const:`C_BUILTIN`), then a frozen module (:const:" -"`PY_FROZEN`), and on some systems some other places are looked in as well " -"(on Windows, it looks in the registry which may point to a specific file)." -msgstr "" - -#: ../../library/imp.rst:56 -msgid "" -"Otherwise, *path* must be a list of directory names; each directory is " -"searched for files with any of the suffixes returned by :func:`get_suffixes` " -"above. Invalid names in the list are silently ignored (but all list items " -"must be strings)." -msgstr "" - -#: ../../library/imp.rst:61 -msgid "" -"If search is successful, the return value is a 3-element tuple ``(file, " -"pathname, description)``:" -msgstr "" - -#: ../../library/imp.rst:64 -msgid "" -"*file* is an open :term:`file object` positioned at the beginning, " -"*pathname* is the pathname of the file found, and *description* is a 3-" -"element tuple as contained in the list returned by :func:`get_suffixes` " -"describing the kind of module found." -msgstr "" - -#: ../../library/imp.rst:69 -msgid "" -"If the module is built-in or frozen then *file* and *pathname* are both " -"``None`` and the *description* tuple contains empty strings for its suffix " -"and mode; the module type is indicated as given in parentheses above. If " -"the search is unsuccessful, :exc:`ImportError` is raised. Other exceptions " -"indicate problems with the arguments or environment." -msgstr "" - -#: ../../library/imp.rst:75 -msgid "" -"If the module is a package, *file* is ``None``, *pathname* is the package " -"path and the last item in the *description* tuple is :const:`PKG_DIRECTORY`." -msgstr "" - -#: ../../library/imp.rst:78 -msgid "" -"This function does not handle hierarchical module names (names containing " -"dots). In order to find *P.M*, that is, submodule *M* of package *P*, use :" -"func:`find_module` and :func:`load_module` to find and load package *P*, and " -"then use :func:`find_module` with the *path* argument set to ``P.__path__``. " -"When *P* itself has a dotted name, apply this recipe recursively." -msgstr "" - -#: ../../library/imp.rst:84 -msgid "" -"Use :func:`importlib.util.find_spec` instead unless Python 3.3 compatibility " -"is required, in which case use :func:`importlib.find_loader`. For example " -"usage of the former case, see the :ref:`importlib-examples` section of the :" -"mod:`importlib` documentation." -msgstr "" - -#: ../../library/imp.rst:94 -msgid "" -"Load a module that was previously found by :func:`find_module` (or by an " -"otherwise conducted search yielding compatible results). This function does " -"more than importing the module: if the module was already imported, it will " -"reload the module! The *name* argument indicates the full module name " -"(including the package name, if this is a submodule of a package). The " -"*file* argument is an open file, and *pathname* is the corresponding file " -"name; these can be ``None`` and ``''``, respectively, when the module is a " -"package or not being loaded from a file. The *description* argument is a " -"tuple, as would be returned by :func:`get_suffixes`, describing what kind of " -"module must be loaded." -msgstr "" - -#: ../../library/imp.rst:105 -msgid "" -"If the load is successful, the return value is the module object; otherwise, " -"an exception (usually :exc:`ImportError`) is raised." -msgstr "" - -#: ../../library/imp.rst:108 -msgid "" -"**Important:** the caller is responsible for closing the *file* argument, if " -"it was not ``None``, even when an exception is raised. This is best done " -"using a :keyword:`try` ... :keyword:`finally` statement." -msgstr "" - -#: ../../library/imp.rst:112 -msgid "" -"If previously used in conjunction with :func:`imp.find_module` then consider " -"using :func:`importlib.import_module`, otherwise use the loader returned by " -"the replacement you chose for :func:`imp.find_module`. If you called :func:" -"`imp.load_module` and related functions directly with file path arguments " -"then use a combination of :func:`importlib.util.spec_from_file_location` " -"and :func:`importlib.util.module_from_spec`. See the :ref:`importlib-" -"examples` section of the :mod:`importlib` documentation for details of the " -"various approaches." -msgstr "" - -#: ../../library/imp.rst:126 -msgid "" -"Return a new empty module object called *name*. This object is *not* " -"inserted in ``sys.modules``." -msgstr "" - -#: ../../library/imp.rst:129 -msgid "Use :func:`importlib.util.module_from_spec` instead." -msgstr "" - -#: ../../library/imp.rst:135 -msgid "" -"Reload a previously imported *module*. The argument must be a module " -"object, so it must have been successfully imported before. This is useful " -"if you have edited the module source file using an external editor and want " -"to try out the new version without leaving the Python interpreter. The " -"return value is the module object (the same as the *module* argument)." -msgstr "" - -#: ../../library/imp.rst:141 -msgid "When ``reload(module)`` is executed:" -msgstr "" - -#: ../../library/imp.rst:143 -msgid "" -"Python modules' code is recompiled and the module-level code reexecuted, " -"defining a new set of objects which are bound to names in the module's " -"dictionary. The ``init`` function of extension modules is not called a " -"second time." -msgstr "" - -#: ../../library/imp.rst:148 -msgid "" -"As with all other objects in Python the old objects are only reclaimed after " -"their reference counts drop to zero." -msgstr "" - -#: ../../library/imp.rst:151 -msgid "" -"The names in the module namespace are updated to point to any new or changed " -"objects." -msgstr "" - -#: ../../library/imp.rst:154 -msgid "" -"Other references to the old objects (such as names external to the module) " -"are not rebound to refer to the new objects and must be updated in each " -"namespace where they occur if that is desired." -msgstr "" - -#: ../../library/imp.rst:158 -msgid "There are a number of other caveats:" -msgstr "" - -#: ../../library/imp.rst:160 -msgid "" -"When a module is reloaded, its dictionary (containing the module's global " -"variables) is retained. Redefinitions of names will override the old " -"definitions, so this is generally not a problem. If the new version of a " -"module does not define a name that was defined by the old version, the old " -"definition remains. This feature can be used to the module's advantage if " -"it maintains a global table or cache of objects --- with a :keyword:`try` " -"statement it can test for the table's presence and skip its initialization " -"if desired::" -msgstr "" - -#: ../../library/imp.rst:173 -msgid "" -"It is legal though generally not very useful to reload built-in or " -"dynamically loaded modules, except for :mod:`sys`, :mod:`__main__` and :mod:" -"`builtins`. In many cases, however, extension modules are not designed to be " -"initialized more than once, and may fail in arbitrary ways when reloaded." -msgstr "" - -#: ../../library/imp.rst:178 -msgid "" -"If a module imports objects from another module using :keyword:`from` ... :" -"keyword:`import` ..., calling :func:`reload` for the other module does not " -"redefine the objects imported from it --- one way around this is to re-" -"execute the :keyword:`!from` statement, another is to use :keyword:`!import` " -"and qualified names (*module*.*name*) instead." -msgstr "" - -#: ../../library/imp.rst:184 -msgid "" -"If a module instantiates instances of a class, reloading the module that " -"defines the class does not affect the method definitions of the instances " -"--- they continue to use the old class definition. The same is true for " -"derived classes." -msgstr "" - -#: ../../library/imp.rst:188 -msgid "" -"Relies on both ``__name__`` and ``__loader__`` being defined on the module " -"being reloaded instead of just ``__name__``." -msgstr "" - -#: ../../library/imp.rst:192 -msgid "Use :func:`importlib.reload` instead." -msgstr "" - -#: ../../library/imp.rst:196 -msgid "" -"The following functions are conveniences for handling :pep:`3147` byte-" -"compiled file paths." -msgstr "" - -#: ../../library/imp.rst:203 -msgid "" -"Return the :pep:`3147` path to the byte-compiled file associated with the " -"source *path*. For example, if *path* is ``/foo/bar/baz.py`` the return " -"value would be ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2. " -"The ``cpython-32`` string comes from the current magic tag (see :func:" -"`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then :exc:" -"`NotImplementedError` will be raised). By passing in ``True`` or ``False`` " -"for *debug_override* you can override the system's value for ``__debug__``, " -"leading to optimized bytecode." -msgstr "" - -#: ../../library/imp.rst:212 -msgid "*path* need not exist." -msgstr "" - -#: ../../library/imp.rst:214 -msgid "" -"If :attr:`sys.implementation.cache_tag` is ``None``, then :exc:" -"`NotImplementedError` is raised." -msgstr "" - -#: ../../library/imp.rst:218 -msgid "Use :func:`importlib.util.cache_from_source` instead." -msgstr "" - -#: ../../library/imp.rst:221 -msgid "The *debug_override* parameter no longer creates a ``.pyo`` file." -msgstr "" - -#: ../../library/imp.rst:227 -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." -"cpython-32.pyc`` the returned path would be ``/foo/bar/baz.py``. *path* " -"need not exist, however if it does not conform to :pep:`3147` format, a :exc:" -"`ValueError` is raised. If :attr:`sys.implementation.cache_tag` is not " -"defined, :exc:`NotImplementedError` is raised." -msgstr "" - -#: ../../library/imp.rst:235 -msgid "" -"Raise :exc:`NotImplementedError` when :attr:`sys.implementation.cache_tag` " -"is not defined." -msgstr "" - -#: ../../library/imp.rst:239 -msgid "Use :func:`importlib.util.source_from_cache` instead." -msgstr "" - -#: ../../library/imp.rst:245 -msgid "" -"Return the :pep:`3147` magic tag string matching this version of Python's " -"magic number, as returned by :func:`get_magic`." -msgstr "" - -#: ../../library/imp.rst:248 -msgid "" -"Use :attr:`sys.implementation.cache_tag` directly starting in Python 3.3." -msgstr "" - -#: ../../library/imp.rst:253 -msgid "" -"The following functions help interact with the import system's internal " -"locking mechanism. Locking semantics of imports are an implementation " -"detail which may vary from release to release. However, Python ensures that " -"circular imports work without any deadlocks." -msgstr "" - -#: ../../library/imp.rst:261 -msgid "" -"Return ``True`` if the global import lock is currently held, else ``False``. " -"On platforms without threads, always return ``False``." -msgstr "" - -#: ../../library/imp.rst:264 -msgid "" -"On platforms with threads, a thread executing an import first holds a global " -"import lock, then sets up a per-module lock for the rest of the import. " -"This blocks other threads from importing the same module until the original " -"import completes, preventing other threads from seeing incomplete module " -"objects constructed by the original thread. An exception is made for " -"circular imports, which by construction have to expose an incomplete module " -"object at some point." -msgstr "" - -#: ../../library/imp.rst:272 ../../library/imp.rst:292 -#: ../../library/imp.rst:305 -msgid "" -"The locking scheme has changed to per-module locks for the most part. A " -"global import lock is kept for some critical tasks, such as initializing the " -"per-module locks." -msgstr "" - -#: ../../library/imp.rst:282 -msgid "" -"Acquire the interpreter's global import lock for the current thread. This " -"lock should be used by import hooks to ensure thread-safety when importing " -"modules." -msgstr "" - -#: ../../library/imp.rst:286 -msgid "" -"Once a thread has acquired the import lock, the same thread may acquire it " -"again without blocking; the thread must release it once for each time it has " -"acquired it." -msgstr "" - -#: ../../library/imp.rst:290 -msgid "On platforms without threads, this function does nothing." -msgstr "" - -#: ../../library/imp.rst:302 -msgid "" -"Release the interpreter's global import lock. On platforms without threads, " -"this function does nothing." -msgstr "" - -#: ../../library/imp.rst:313 -msgid "" -"The following constants with integer values, defined in this module, are " -"used to indicate the search result of :func:`find_module`." -msgstr "" - -#: ../../library/imp.rst:319 -msgid "The module was found as a source file." -msgstr "" - -#: ../../library/imp.rst:326 -msgid "The module was found as a compiled code object file." -msgstr "" - -#: ../../library/imp.rst:333 -msgid "The module was found as dynamically loadable shared library." -msgstr "" - -#: ../../library/imp.rst:340 -msgid "The module was found as a package directory." -msgstr "" - -#: ../../library/imp.rst:347 -msgid "The module was found as a built-in module." -msgstr "" - -#: ../../library/imp.rst:354 -msgid "The module was found as a frozen module." -msgstr "" - -#: ../../library/imp.rst:361 -msgid "" -"The :class:`NullImporter` type is a :pep:`302` import hook that handles non-" -"directory path strings by failing to find any modules. Calling this type " -"with an existing directory or empty string raises :exc:`ImportError`. " -"Otherwise, a :class:`NullImporter` instance is returned." -msgstr "" - -#: ../../library/imp.rst:366 -msgid "Instances have only one method:" -msgstr "" - -#: ../../library/imp.rst:370 -msgid "" -"This method always returns ``None``, indicating that the requested module " -"could not be found." -msgstr "" - -#: ../../library/imp.rst:373 -msgid "" -"``None`` is inserted into ``sys.path_importer_cache`` instead of an instance " -"of :class:`NullImporter`." -msgstr "" - -#: ../../library/imp.rst:377 -msgid "Insert ``None`` into ``sys.path_importer_cache`` instead." -msgstr "" - -#: ../../library/imp.rst:384 -msgid "Examples" -msgstr "範例" - -#: ../../library/imp.rst:386 -msgid "" -"The following function emulates what was the standard import statement up to " -"Python 1.4 (no hierarchical module names). (This *implementation* wouldn't " -"work in that version, since :func:`find_module` has been extended and :func:" -"`load_module` has been added in 1.4.) ::" -msgstr "" - -#: ../../library/imp.rst:13 -msgid "statement" -msgstr "statement(陳述式)" - -#: ../../library/imp.rst:13 -msgid "import" -msgstr "import(引入)" - -#: ../../library/imp.rst:23 -msgid "file" -msgstr "file(檔案)" - -#: ../../library/imp.rst:23 -msgid "byte-code" -msgstr "byte-code(位元組碼)" diff --git a/library/smtpd.po b/library/smtpd.po deleted file mode 100644 index 023c24fc82..0000000000 --- a/library/smtpd.po +++ /dev/null @@ -1,454 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" -"PO-Revision-Date: 2022-10-16 06:26+0800\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" - -#: ../../library/smtpd.rst:2 -msgid ":mod:`smtpd` --- SMTP Server" -msgstr ":mod:`smtpd` --- SMTP 伺服器" - -#: ../../library/smtpd.rst:11 -msgid "**Source code:** :source:`Lib/smtpd.py`" -msgstr "**原始碼:**\\ :source:`Lib/smtpd.py`" - -#: ../../library/smtpd.rst:15 -msgid "This module offers several classes to implement SMTP (email) servers." -msgstr "" - -#: ../../library/smtpd.rst:23 -msgid "" -"The :mod:`smtpd` module is deprecated (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` 已被棄用(詳見 :pep:`PEP 594 <594#smtpd>`\\ )。基於 :mod:" -"`asyncio` 且提供了更簡單易用 API 的 `aiosmtpd `_ 套件是個推薦的替代模組 (module)。" - -#: ../../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:28 -msgid "" -"Additionally the SMTPChannel may be extended to implement very specific " -"interaction behaviour with SMTP clients." -msgstr "" - -#: ../../library/smtpd.rst:31 -msgid "" -"The code supports :RFC:`5321`, plus the :rfc:`1870` SIZE and :rfc:`6531` " -"SMTPUTF8 extensions." -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: ../../library/smtpd.rst:37 -msgid "SMTPServer Objects" -msgstr "SMTPServer 物件" - -#: ../../library/smtpd.rst:43 -msgid "" -"Create a new :class:`SMTPServer` object, which binds to local address " -"*localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. Both " -"*localaddr* and *remoteaddr* should be a :ref:`(host, port) ` " -"tuple. The object inherits from :class:`asyncore.dispatcher`, and so will " -"insert itself into :mod:`asyncore`'s event loop on instantiation." -msgstr "" - -#: ../../library/smtpd.rst:49 ../../library/smtpd.rst:159 -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:53 -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:57 -msgid "" -"*enable_SMTPUTF8* determines whether the ``SMTPUTF8`` extension (as defined " -"in :RFC:`6531`) should be enabled. The default is ``False``. When ``True``, " -"``SMTPUTF8`` is accepted as a parameter to the ``MAIL`` command and when " -"present is passed to :meth:`process_message` in the " -"``kwargs['mail_options']`` list. *decode_data* and *enable_SMTPUTF8* cannot " -"be set to ``True`` at the same time." -msgstr "" - -#: ../../library/smtpd.rst:64 -msgid "" -"*decode_data* specifies whether the data portion of the SMTP transaction " -"should be decoded using UTF-8. When *decode_data* is ``False`` (the " -"default), the server advertises the ``8BITMIME`` extension (:rfc:`6152`), " -"accepts the ``BODY=8BITMIME`` parameter to the ``MAIL`` command, and when " -"present passes it to :meth:`process_message` in the " -"``kwargs['mail_options']`` list. *decode_data* and *enable_SMTPUTF8* cannot " -"be set to ``True`` at the same time." -msgstr "" - -#: ../../library/smtpd.rst:74 -msgid "" -"Raise a :exc:`NotImplementedError` exception. Override this in subclasses to " -"do something useful with this message. Whatever was passed in the " -"constructor as *remoteaddr* will be available as the :attr:`_remoteaddr` " -"attribute. *peer* is the remote host's address, *mailfrom* is the envelope " -"originator, *rcpttos* are the envelope recipients and *data* is a string " -"containing the contents of the e-mail (which should be in :rfc:`5321` " -"format)." -msgstr "" - -#: ../../library/smtpd.rst:82 -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:86 -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:93 -msgid "*mail_options*:" -msgstr "" - -#: ../../library/smtpd.rst:91 -msgid "" -"a list of all received parameters to the ``MAIL`` command (the elements are " -"uppercase strings; example: ``['BODY=8BITMIME', 'SMTPUTF8']``)." -msgstr "" - -#: ../../library/smtpd.rst:98 -msgid "*rcpt_options*:" -msgstr "" - -#: ../../library/smtpd.rst:96 -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:100 -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:104 -msgid "" -"Return ``None`` to request a normal ``250 Ok`` response; otherwise return " -"the desired response string in :RFC:`5321` format." -msgstr "" - -#: ../../library/smtpd.rst:109 -msgid "" -"Override this in subclasses to use a custom :class:`SMTPChannel` for " -"managing SMTP clients." -msgstr "" - -#: ../../library/smtpd.rst:112 -msgid "The *map* constructor argument." -msgstr "" - -#: ../../library/smtpd.rst:115 -msgid "*localaddr* and *remoteaddr* may now contain IPv6 addresses." -msgstr "" - -#: ../../library/smtpd.rst:118 -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:123 ../../library/smtpd.rst:181 -msgid "*decode_data* is now ``False`` by default." -msgstr "" - -#: ../../library/smtpd.rst:128 -msgid "DebuggingServer Objects" -msgstr "DebuggingServer 物件" - -#: ../../library/smtpd.rst:133 -msgid "" -"Create a new debugging server. Arguments are as per :class:`SMTPServer`. " -"Messages will be discarded, and printed on stdout." -msgstr "" - -#: ../../library/smtpd.rst:138 -msgid "PureProxy Objects" -msgstr "PureProxy 物件" - -#: ../../library/smtpd.rst:143 -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:149 -msgid "SMTPChannel Objects" -msgstr "SMTPChannel 物件" - -#: ../../library/smtpd.rst:154 -msgid "" -"Create a new :class:`SMTPChannel` object which manages the communication " -"between the server and a single SMTP client." -msgstr "" - -#: ../../library/smtpd.rst:157 -msgid "*conn* and *addr* are as per the instance variables described below." -msgstr "" - -#: ../../library/smtpd.rst:163 -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:168 -msgid "" -"A dictionary can be specified in *map* to avoid using a global socket map." -msgstr "" - -#: ../../library/smtpd.rst:170 -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:175 -msgid "" -"To use a custom SMTPChannel implementation you need to override the :attr:" -"`SMTPServer.channel_class` of your :class:`SMTPServer`." -msgstr "" - -#: ../../library/smtpd.rst:178 -msgid "The *decode_data* and *enable_SMTPUTF8* parameters were added." -msgstr "新增 *decode_data* 與 *enable_SMTPUTF8* 參數。" - -#: ../../library/smtpd.rst:184 -msgid "The :class:`SMTPChannel` has the following instance variables:" -msgstr "" - -#: ../../library/smtpd.rst:188 -msgid "Holds the :class:`SMTPServer` that spawned this channel." -msgstr "" - -#: ../../library/smtpd.rst:192 -msgid "Holds the socket object connecting to the client." -msgstr "" - -#: ../../library/smtpd.rst:196 -msgid "" -"Holds the address of the client, the second value returned by :func:`socket." -"accept `" -msgstr "" - -#: ../../library/smtpd.rst:201 -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:207 -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:213 -msgid "" -"Holds a string containing the greeting sent by the client in its \"HELO\"." -msgstr "" - -#: ../../library/smtpd.rst:217 -msgid "" -"Holds a string containing the address identified in the \"MAIL FROM:\" line " -"from the client." -msgstr "" - -#: ../../library/smtpd.rst:222 -msgid "" -"Holds a list of strings containing the addresses identified in the \"RCPT TO:" -"\" lines from the client." -msgstr "" - -#: ../../library/smtpd.rst:227 -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:232 -msgid "" -"Holds the fully qualified domain name of the server as returned by :func:" -"`socket.getfqdn`." -msgstr "" - -#: ../../library/smtpd.rst:237 -msgid "" -"Holds the name of the client peer as returned by ``conn.getpeername()`` " -"where ``conn`` is :attr:`conn`." -msgstr "" - -#: ../../library/smtpd.rst:240 -msgid "" -"The :class:`SMTPChannel` operates by invoking methods named " -"``smtp_`` upon reception of a command line from the client. Built " -"into the base :class:`SMTPChannel` class are methods for handling the " -"following commands (and responding to them appropriately):" -msgstr "" - -#: ../../library/smtpd.rst:246 -msgid "Command" -msgstr "指令" - -#: ../../library/smtpd.rst:246 -msgid "Action taken" -msgstr "" - -#: ../../library/smtpd.rst:248 -msgid "HELO" -msgstr "HELO" - -#: ../../library/smtpd.rst:248 -msgid "" -"Accepts the greeting from the client and stores it in :attr:" -"`seen_greeting`. Sets server to base command mode." -msgstr "" - -#: ../../library/smtpd.rst:250 -msgid "EHLO" -msgstr "EHLO" - -#: ../../library/smtpd.rst:250 -msgid "" -"Accepts the greeting from the client and stores it in :attr:" -"`seen_greeting`. Sets server to extended command mode." -msgstr "" - -#: ../../library/smtpd.rst:252 -msgid "NOOP" -msgstr "NOOP" - -#: ../../library/smtpd.rst:252 -msgid "Takes no action." -msgstr "" - -#: ../../library/smtpd.rst:253 -msgid "QUIT" -msgstr "QUIT" - -#: ../../library/smtpd.rst:253 -msgid "Closes the connection cleanly." -msgstr "" - -#: ../../library/smtpd.rst:254 -msgid "MAIL" -msgstr "MAIL" - -#: ../../library/smtpd.rst:254 -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:258 -msgid "RCPT" -msgstr "RCPT" - -#: ../../library/smtpd.rst:258 -msgid "" -"Accepts the \"RCPT TO:\" syntax and stores the supplied addresses in the :" -"attr:`rcpttos` list." -msgstr "" - -#: ../../library/smtpd.rst:260 -msgid "RSET" -msgstr "RSET" - -#: ../../library/smtpd.rst:260 -msgid "" -"Resets the :attr:`mailfrom`, :attr:`rcpttos`, and :attr:`received_data`, but " -"not the greeting." -msgstr "" - -#: ../../library/smtpd.rst:262 -msgid "DATA" -msgstr "DATA" - -#: ../../library/smtpd.rst:262 -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:265 -msgid "HELP" -msgstr "HELP" - -#: ../../library/smtpd.rst:265 -msgid "Returns minimal information on command syntax" -msgstr "" - -#: ../../library/smtpd.rst:266 -msgid "VRFY" -msgstr "VRFY" - -#: ../../library/smtpd.rst:266 -msgid "Returns code 252 (the server doesn't know if the address is valid)" -msgstr "" - -#: ../../library/smtpd.rst:267 -msgid "EXPN" -msgstr "EXPN" - -#: ../../library/smtpd.rst:267 -msgid "Reports that the command is not implemented." -msgstr "" - -#~ msgid "MailmanProxy Objects" -#~ msgstr "MailmanProxy 物件" From 403525e8199f9ba91552ec6b51ebeb30083b4c80 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 18:28:19 +0800 Subject: [PATCH 003/105] fix: resolve fuzzy entries in c-api --- c-api/apiabiversion.po | 4 +- c-api/arg.po | 9 --- c-api/bool.po | 36 ++++------ c-api/code.po | 10 +-- c-api/coro.po | 4 +- c-api/file.po | 4 +- c-api/function.po | 3 +- c-api/import.po | 2 +- c-api/index.po | 6 +- c-api/init_config.po | 8 +-- c-api/intro.po | 5 +- c-api/method.po | 17 +++-- c-api/none.po | 2 +- c-api/refcounting.po | 9 +-- c-api/slice.po | 2 +- c-api/stable.po | 48 ++++++------- c-api/structures.po | 111 ++++++++--------------------- c-api/type.po | 9 +-- c-api/typehints.po | 10 +-- c-api/typeobj.po | 14 ++-- c-api/unicode.po | 156 +++-------------------------------------- c-api/utilities.po | 6 +- 22 files changed, 123 insertions(+), 352 deletions(-) diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index 002d2ba684..5e470c80ef 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -186,8 +186,8 @@ msgid "" "the same format as the :c:macro:`PY_VERSION_HEX` macro. This contains the " "Python version used at run time." msgstr "" -"編碼為單個常數整數的 Python 執行環境版本號,格式與 :c:macro:`PY_VERSION_HEX` 巨集相同。" -"這包含在執行環境使用的 Python 版本。" +"編碼為單個常數整數的 Python 執行環境版本號,格式與 :c:macro:`PY_VERSION_HEX` " +"巨集相同。這包含在執行環境使用的 Python 版本。" #: ../../c-api/apiabiversion.rst:73 msgid "All the given macros are defined in :source:`Include/patchlevel.h`." diff --git a/c-api/arg.po b/c-api/arg.po index 93eca4f729..574babaf5c 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -1128,12 +1128,3 @@ msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" - -#~ msgid "``u`` (:class:`str`) [const Py_UNICODE \\*]" -#~ msgstr "``u`` (:class:`str`) [const Py_UNICODE \\*]" - -#~ msgid "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" -#~ msgstr "``u#`` (:class:`str`) [const Py_UNICODE \\*, :c:type:`Py_ssize_t`]" - -#~ msgid "``Z`` (:class:`str` or ``None``) [const Py_UNICODE \\*]" -#~ msgstr "``Z`` (:class:`str` 或 ``None``) [const Py_UNICODE \\*]" diff --git a/c-api/bool.po b/c-api/bool.po index 7df696275f..c7e8a14bec 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -27,16 +27,15 @@ msgid "Boolean Objects" msgstr "Boolean(布林)物件" #: ../../c-api/bool.rst:8 -#, fuzzy msgid "" "Booleans in Python are implemented as a subclass of integers. There are " "only two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the " "normal creation and deletion functions don't apply to booleans. The " "following macros are available, however." msgstr "" -"Python 中的 boolean 是以整數子類別化來實現的。只有 :const:`Py_False` 和 :" -"const:`Py_True` 兩個 boolean。因此一般的建立和刪除函式並不適用於 boolean。但" -"下列巨集 (macro) 是可用的。" +"Python 中的 boolean 是以整數子類別化來實現的。只有 :c:data:`Py_False` 和 :c:" +"data:`Py_True` 兩個 boolean。因此一般的建立和刪除函式並不適用於 boolean。但下" +"列巨集 (macro) 是可用的。" #: ../../c-api/bool.rst:16 msgid "" @@ -46,50 +45,39 @@ msgstr "" "如果 *o* 的型別為 :c:data:`PyBool_Type` 則回傳真值。此函式總是會成功執行。" #: ../../c-api/bool.rst:22 -#, fuzzy msgid "" "The Python ``False`` object. This object has no methods and is `immortal " "`_." msgstr "" -"Python 的 ``False`` 物件。此物件沒有任何方法。在參照 (reference) 計數上必須有" -"著和其他物件一樣的處理方式。" +"Python 的 ``False`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) " +"`_。" #: ../../c-api/bool.rst:25 msgid ":c:data:`Py_False` is immortal." -msgstr "" +msgstr ":c:data:`Py_False` 為不滅的。" #: ../../c-api/bool.rst:31 -#, fuzzy msgid "" "The Python ``True`` object. This object has no methods and is `immortal " "`_." msgstr "" -"Python 的 ``True`` 物件。此物件沒有任何方法。在參照計數上必須有著和其他物件一" -"樣的處理方式。" +"Python 的 ``True`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) " +"`_。" #: ../../c-api/bool.rst:34 msgid ":c:data:`Py_True` is immortal." -msgstr "" +msgstr ":c:data:`Py_True` 為不滅的。" #: ../../c-api/bool.rst:40 -#, fuzzy msgid "Return :c:data:`Py_False` from a function." -msgstr "從函式回傳 :const:`Py_False`\\ ,並適當的增加它的參照計數。" +msgstr "從函式回傳 :c:data:`Py_False`。" #: ../../c-api/bool.rst:45 msgid "Return :c:data:`Py_True` from a function." -msgstr "" +msgstr "從函式回傳 :c:data:`Py_True`。" #: ../../c-api/bool.rst:50 -#, fuzzy msgid "" "Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value " "of *v*." -msgstr "" -"根據 *v* 的實際值來回傳一個 :const:`Py_True` 或者 :const:`Py_False` 的新參" -"照。" - -#~ msgid "" -#~ "Return :const:`Py_True` from a function, properly incrementing its " -#~ "reference count." -#~ msgstr "從函式回傳 :const:`Py_True`\\ ,並適當的增加它的參照計數。" +msgstr "根據 *v* 的實際值來回傳 :c:data:`Py_True` 或者 :c:data:`Py_False`。" diff --git a/c-api/code.po b/c-api/code.po index 6bc8294dfa..6b03ba0467 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -331,20 +331,20 @@ msgstr "code object(程式碼物件)" #: ../../c-api/code.rst:51 msgid "PyCode_New" -msgstr "" +msgstr "PyCode_New" #: ../../c-api/code.rst:64 msgid "PyCode_NewWithPosOnlyArgs" -msgstr "" +msgstr "PyCode_NewWithPosOnlyArgs" #: ../../c-api/code.rst:223 msgid "_PyEval_RequestCodeExtraIndex" -msgstr "" +msgstr "_PyEval_RequestCodeExtraIndex" #: ../../c-api/code.rst:241 msgid "_PyCode_GetExtra" -msgstr "" +msgstr "_PyCode_GetExtra" #: ../../c-api/code.rst:256 msgid "_PyCode_SetExtra" -msgstr "" +msgstr "_PyCode_SetExtra" diff --git a/c-api/coro.po b/c-api/coro.po index 66a6a247c8..406b43b215 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -45,8 +45,8 @@ msgid "" "Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be " "``NULL``. This function always succeeds." msgstr "" -"如果 *ob* 的型別是 :c:type:`PyCoro_Type` 則回傳真值;*ob* 必須不為 ``NULL``" -"\\ 。此函式總是會執行成功。" +"如果 *ob* 的型別是 :c:type:`PyCoro_Type` 則回傳真值;*ob* 必須不為 " +"``NULL``\\ 。此函式總是會執行成功。" #: ../../c-api/coro.rst:32 msgid "" diff --git a/c-api/file.po b/c-api/file.po index 05c140f805..4302c7d804 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -124,8 +124,8 @@ msgid "" "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -"*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的執行環境" -" (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。" +"*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的執行環" +"境 (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。" #: ../../c-api/file.rst:75 msgid "" diff --git a/c-api/function.po b/c-api/function.po index b5179761a8..9e3695e11a 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -126,9 +126,8 @@ msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." msgstr "引發 :exc:`SystemError` 且在失敗時回傳 ``-1``。" #: ../../c-api/function.rst:88 -#, fuzzy msgid "Set the vectorcall field of a given function object *func*." -msgstr "回傳與程式碼物件相關的函式物件 *op*。" +msgstr "為一個給定的函式物件 *func* 設定 vectorcall 欄位。" #: ../../c-api/function.rst:90 msgid "" diff --git a/c-api/import.po b/c-api/import.po index da7fc7d292..749f1a3462 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -220,7 +220,7 @@ msgstr "" #: ../../c-api/import.rst:191 msgid "No longer uses the removed :mod:`!imp` module." -msgstr "" +msgstr "不再使用已被移除的 :mod:`!imp` 模組。" #: ../../c-api/import.rst:197 msgid "" diff --git a/c-api/index.po b/c-api/index.po index 6fbeb61252..cf2ff729ac 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -33,6 +33,6 @@ msgid "" "`extending-index`, which describes the general principles of extension " "writing but does not document the API functions in detail." msgstr "" -"對於想要編寫擴充模組或是嵌入 Python 的 C 和 C++ 程式設計師們,這份手冊記錄" -"了可使用的 API(應用程式介面)。在\\ :ref:`extending-index`\\ 中也有相關的" -"內容,它描述了編寫擴充的一般原則,但並沒有詳細說明 API 函式。" +"對於想要編寫擴充模組或是嵌入 Python 的 C 和 C++ 程式設計師們,這份手冊記錄了" +"可使用的 API(應用程式介面)。在\\ :ref:`extending-index`\\ 中也有相關的內" +"容,它描述了編寫擴充的一般原則,但並沒有詳細說明 API 函式。" diff --git a/c-api/init_config.po b/c-api/init_config.po index 6100d52668..11789ef557 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -1124,11 +1124,12 @@ msgid "" msgstr "" #: ../../c-api/init_config.rst:857 -#, fuzzy msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." -msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" +msgstr "" +"將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變" +"數。" #: ../../c-api/init_config.rst:859 msgid "" @@ -1554,9 +1555,8 @@ msgid "" msgstr "" #: ../../c-api/init_config.rst:1186 -#, fuzzy msgid "Default: ``-1``." -msgstr "預設值:\\ ``1``\\ 。" +msgstr "預設值:``1``。" #: ../../c-api/init_config.rst:1192 msgid "Use :ref:`environment variables `?" diff --git a/c-api/intro.po b/c-api/intro.po index 800bb19eab..46a3ebb54c 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -271,13 +271,12 @@ msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" #: ../../c-api/intro.rst:155 -#, fuzzy msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." msgstr "" -"類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E`\\ (即如果設定了 " -"``Py_IgnoreEnvironmentFlag``\\ )則回傳 ``NULL``。" +"類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " +"(請見 :c:member:`PyConfig.use_environment`)。" #: ../../c-api/intro.rst:160 msgid "Return the maximum value between ``x`` and ``y``." diff --git a/c-api/method.po b/c-api/method.po index c291cd87b2..95c510baa9 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -48,8 +48,8 @@ msgid "" "`PyInstanceMethod_Type`). The parameter must not be ``NULL``. This function " "always succeeds." msgstr "" -"如果 *o* 是一個實例方法物件(型別為 :c:data:`PyInstanceMethod_Type`)則回" -"傳 true。參數必須不為 ``NULL``。此函式總是會成功執行。" +"如果 *o* 是一個實例方法物件(型別為 :c:data:`PyInstanceMethod_Type`)則回傳 " +"true。參數必須不為 ``NULL``。此函式總是會成功執行。" #: ../../c-api/method.rst:30 msgid "" @@ -57,8 +57,8 @@ msgid "" "*func* is the function that will be called when the instance method is " "called." msgstr "" -"回傳一個新的實例方法物件,*func* 為任意可呼叫物件,在實例方法被呼叫時 " -"*func* 函式也會被呼叫。" +"回傳一個新的實例方法物件,*func* 為任意可呼叫物件,在實例方法被呼叫時 *func* " +"函式也會被呼叫。" #: ../../c-api/method.rst:37 msgid "Return the function object associated with the instance method *im*." @@ -97,8 +97,8 @@ msgid "" "Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). " "The parameter must not be ``NULL``. This function always succeeds." msgstr "" -"如果 *o* 是一個方法物件(型別為 :c:data:`PyMethod_Type`)則回傳 true。參數" -"必須不為 ``NULL``。此函式總是會成功執行。" +"如果 *o* 是一個方法物件(型別為 :c:data:`PyMethod_Type`)則回傳 true。參數必" +"須不為 ``NULL``。此函式總是會成功執行。" #: ../../c-api/method.rst:73 msgid "" @@ -106,9 +106,8 @@ msgid "" "the instance the method should be bound. *func* is the function that will be " "called when the method is called. *self* must not be ``NULL``." msgstr "" -"回傳一個新的方法物件,*func* 應為任意可呼叫物件,*self* 為該方法應繫結" -"的實例。在方法被呼叫時,*func* 函式也會被呼叫。*self* 必須不為 " -"``NULL``。" +"回傳一個新的方法物件,*func* 應為任意可呼叫物件,*self* 為該方法應繫結的實" +"例。在方法被呼叫時,*func* 函式也會被呼叫。*self* 必須不為 ``NULL``。" #: ../../c-api/method.rst:80 msgid "Return the function object associated with the method *meth*." diff --git a/c-api/none.po b/c-api/none.po index 307ddcb7d4..8b9c64ffd9 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -39,7 +39,7 @@ msgstr "" #: ../../c-api/none.rst:21 msgid ":c:data:`Py_None` is immortal." -msgstr "" +msgstr ":c:data:`Py_None` 為不滅的 (immortal)。" #: ../../c-api/none.rst:26 msgid "Return :c:data:`Py_None` from a function." diff --git a/c-api/refcounting.po b/c-api/refcounting.po index e4557fcfda..084a397ade 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -25,16 +25,14 @@ msgid "Reference Counting" msgstr "參照計數" #: ../../c-api/refcounting.rst:10 -#, fuzzy msgid "" "The functions and macros in this section are used for managing reference " "counts of Python objects." -msgstr "本節中的巨集用於管理 Python 物件的參照計數。" +msgstr "本節中的函式與巨集用於管理 Python 物件的參照計數。" #: ../../c-api/refcounting.rst:16 -#, fuzzy msgid "Get the reference count of the Python object *o*." -msgstr "增加物件 *o* 的參照計數。" +msgstr "取得物件 *o* 的參照計數。" #: ../../c-api/refcounting.rst:18 msgid "" @@ -50,9 +48,8 @@ msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." msgstr "" #: ../../c-api/refcounting.rst:29 -#, fuzzy msgid "Set the object *o* reference counter to *refcnt*." -msgstr "增加物件 *o* 的參照計數。" +msgstr "設定物件 *o* 的參照計數。" #: ../../c-api/refcounting.rst:36 msgid "Increment the reference count for object *o*." diff --git a/c-api/slice.po b/c-api/slice.po index a21104570f..3aefbb0a95 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -146,4 +146,4 @@ msgstr "" #: ../../c-api/slice.rst:125 msgid ":c:data:`Py_Ellipsis` is immortal." -msgstr "" +msgstr ":c:data:`Py_Ellipsis` 為不滅的 (immortal)。" diff --git a/c-api/stable.po b/c-api/stable.po index 36d158b8b1..e04e3f1dd6 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -24,16 +24,15 @@ msgid "C API Stability" msgstr "C API 穩定性" #: ../../c-api/stable.rst:9 -#, fuzzy msgid "" "Unless documented otherwise, Python's C API is covered by the Backwards " "Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " "(typically by only adding new API). Changing existing API or removing API is " "only done after a deprecation period or to fix serious issues." msgstr "" -"Python 的 C API 被包含在向後相容性策略 :pep:`387` 中。雖然 C API 會隨著每個次" -"要版本(例如從 3.9 到 3.10)而變化,但大多數變化都是與原始碼相容的,通常只是" -"加入新的 API。更改現有 API 或刪除 API 僅在棄用期後或修復嚴重問題時進行。" +"除非有另外記錄於文件,Python 的 C API 被包含在向後相容性策略 :pep:`387` 中。" +"大多數改動都是相容於原始碼的(通常只會增加新的 API)。更改現有 API 或刪除 " +"API 僅在棄用期後或修復嚴重問題時進行。" #: ../../c-api/stable.rst:15 msgid "" @@ -83,7 +82,7 @@ msgstr "" #: ../../c-api/stable.rst:40 msgid "Unstable C API" -msgstr "" +msgstr "不穩定的 C API" #: ../../c-api/stable.rst:44 msgid "" @@ -109,23 +108,20 @@ msgid "Stable Application Binary Interface" msgstr "穩定的應用程式二進位介面" #: ../../c-api/stable.rst:58 -#, fuzzy msgid "" "For simplicity, this document talks about *extensions*, but the Limited API " "and Stable ABI work the same way for all uses of the API – for example, " "embedding Python." msgstr "" -"(為簡單起見,本文件討論\\ *擴充 (extension)*,但受限 API 和穩定 ABI 在所有 " +"為簡單起見,本文件討論\\ *擴充 (extension)*,但受限 API 和穩定 ABI 在所有 " "API 使用方式中都以相同的方式運作 -- 例如在嵌入式 Python (embedding Python) " -"中。)" +"中。" #: ../../c-api/stable.rst:65 -#, fuzzy msgid "Limited C API" -msgstr "受限 API 注意事項" +msgstr "受限 C API" #: ../../c-api/stable.rst:67 -#, fuzzy msgid "" "Python 3.2 introduced the *Limited API*, a subset of Python's C API. " "Extensions that only use the Limited API can be compiled once and work with " @@ -134,7 +130,7 @@ msgid "" msgstr "" "Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。" "僅使用受限 API 的擴充可以只編譯一次就使用於多個版本的 Python。受限 API 的內容" -"\\ :ref:`列在下方 `。" +"\\ :ref:`列在下方 `。" #: ../../c-api/stable.rst:74 msgid "" @@ -175,24 +171,24 @@ msgstr "" #: ../../c-api/stable.rst:94 msgid "Stable ABI" -msgstr "" +msgstr "穩定 ABI" #: ../../c-api/stable.rst:96 msgid "" "To enable this, Python provides a *Stable ABI*: a set of symbols that will " "remain compatible across Python 3.x versions." msgstr "" +"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python " +"3.x 版本之間保持相容的符號。" #: ../../c-api/stable.rst:99 -#, fuzzy msgid "" "The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " "older versions of the Limited API." msgstr "" -"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python " -"3.x 版本之間保持相容的符號。穩定 ABI 被包含在受限 API 中開放的符號,但也包含" -"其他符號 - 例如,支援舊版受限 API 所必需的函式。" +"穩定 ABI 被包含在\\ :ref:`受限 API ` 中開放的符號,但也包含其" +"他符號 - 例如,支援舊版受限 API 所必需的函式。" #: ../../c-api/stable.rst:103 msgid "" @@ -276,16 +272,16 @@ msgid "Limited API Caveats" msgstr "受限 API 注意事項" #: ../../c-api/stable.rst:146 -#, fuzzy msgid "" "Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " "that code conforms to the :ref:`Limited API ` or the :ref:" "`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but " "an API also includes other issues, such as expected semantics." msgstr "" -"請注意,使用 ``Py_LIMITED_API`` 進行編譯\\ *不*\\ 完全保證程式碼符合受限 API " -"或穩定 ABI。``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他問題,例如預期的" -"語義 (semantic)。" +"請注意,使用 ``Py_LIMITED_API`` 進行編譯\\ *不*\\ 完全保證程式碼符合\\ :ref:`" +"受限 API ` 或\\ :ref:`穩定 ABI `。" +"``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他議題,例如預期的語義 " +"(semantic)。" #: ../../c-api/stable.rst:151 msgid "" @@ -345,7 +341,6 @@ msgid "Platform Considerations" msgstr "平台注意事項" #: ../../c-api/stable.rst:181 -#, fuzzy msgid "" "ABI stability depends not only on Python, but also on the compiler used, " "lower-level libraries and compiler options. For the purposes of the :ref:" @@ -353,8 +348,8 @@ msgid "" "depend on the OS type and processor architecture" msgstr "" "ABI 穩定性不僅取決於 Python,還取決於使用的編譯器、低階函式庫和編譯器選項。出" -"於穩定 ABI 的目的,這些細節定義了一個「平台」。它們通常取決於作業系統種類和處" -"理器架構" +"於\\ :ref:`穩定 ABI ` 的目的,這些細節定義了一個「平台」。它們通" +"常取決於作業系統種類和處理器架構" #: ../../c-api/stable.rst:186 msgid "" @@ -372,12 +367,11 @@ msgid "Contents of Limited API" msgstr "受限 API 的內容" #: ../../c-api/stable.rst:199 -#, fuzzy msgid "" "Currently, the :ref:`Limited API ` includes the following " "items:" -msgstr "目前,受限 API 包括以下項目:" +msgstr "目前,:ref:`受限 API ` 包括以下項目:" #: ../../c-api/stable.rst:42 msgid "PyUnstable" -msgstr "" +msgstr "PyUnstable" diff --git a/c-api/structures.po b/c-api/structures.po index 4afd722458..4d19b0270b 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -579,105 +579,95 @@ msgstr "" #: ../../c-api/structures.rst:556 ../../c-api/structures.rst:557 #: ../../c-api/structures.rst:558 msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" #: ../../c-api/structures.rst:549 msgid ":c:expr:`short`" -msgstr "" +msgstr ":c:expr:`short`" #: ../../c-api/structures.rst:550 msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" #: ../../c-api/structures.rst:551 msgid ":c:expr:`long`" -msgstr "" +msgstr ":c:expr:`long`" #: ../../c-api/structures.rst:552 -#, fuzzy msgid ":c:expr:`long long`" -msgstr "long long" +msgstr ":c:expr:`long long`" #: ../../c-api/structures.rst:553 -#, fuzzy msgid ":c:expr:`unsigned char`" -msgstr "unsigned char" +msgstr ":c:expr:`unsigned char`" #: ../../c-api/structures.rst:554 -#, fuzzy msgid ":c:expr:`unsigned int`" -msgstr "unsigned int" +msgstr ":c:expr:`unsigned int`" #: ../../c-api/structures.rst:555 -#, fuzzy msgid ":c:expr:`unsigned short`" -msgstr "unsigned short" +msgstr ":c:expr:`unsigned short`" #: ../../c-api/structures.rst:556 -#, fuzzy msgid ":c:expr:`unsigned long`" -msgstr "unsigned long" +msgstr ":c:expr:`unsigned long`" #: ../../c-api/structures.rst:557 -#, fuzzy msgid ":c:expr:`unsigned long long`" -msgstr "unsigned long long" +msgstr ":c:expr:`unsigned long long`" #: ../../c-api/structures.rst:558 -#, fuzzy msgid ":c:expr:`Py_ssize_t`" -msgstr "Py_ssize_t" +msgstr ":c:expr:`Py_ssize_t`" #: ../../c-api/structures.rst:559 msgid ":c:expr:`float`" -msgstr "" +msgstr ":c:expr:`float`" #: ../../c-api/structures.rst:559 ../../c-api/structures.rst:560 msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" #: ../../c-api/structures.rst:560 msgid ":c:expr:`double`" -msgstr "" +msgstr ":c:expr:`double`" #: ../../c-api/structures.rst:561 msgid ":c:expr:`char` (written as 0 or 1)" -msgstr "" +msgstr ":c:expr:`char` (寫成 0 或 1)" #: ../../c-api/structures.rst:561 msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" #: ../../c-api/structures.rst:563 -#, fuzzy msgid ":c:expr:`const char *` (*)" -msgstr "const char \\*" +msgstr ":c:expr:`const char *` (*)" #: ../../c-api/structures.rst:563 ../../c-api/structures.rst:564 msgid ":py:class:`str` (RO)" -msgstr "" +msgstr ":py:class:`str` (RO)" #: ../../c-api/structures.rst:564 -#, fuzzy msgid ":c:expr:`const char[]` (*)" -msgstr "const char \\*" +msgstr ":c:expr:`const char[]` (*)" #: ../../c-api/structures.rst:565 msgid ":c:expr:`char` (0-127)" -msgstr "" +msgstr ":c:expr:`char` (0-127)" #: ../../c-api/structures.rst:565 msgid ":py:class:`str` (**)" -msgstr "" +msgstr ":py:class:`str` (**)" #: ../../c-api/structures.rst:566 -#, fuzzy msgid ":c:expr:`PyObject *`" -msgstr "PyObject \\*" +msgstr ":c:expr:`PyObject *`" #: ../../c-api/structures.rst:566 msgid ":py:class:`object` (D)" -msgstr "" +msgstr ":py:class:`object` (D)" #: ../../c-api/structures.rst:569 msgid "" @@ -790,19 +780,19 @@ msgstr "staticmethod" #: ../../c-api/structures.rst:505 msgid "READ_RESTRICTED" -msgstr "" +msgstr "READ_RESTRICTED" #: ../../c-api/structures.rst:505 msgid "WRITE_RESTRICTED" -msgstr "" +msgstr "WRITE_RESTRICTED" #: ../../c-api/structures.rst:505 msgid "RESTRICTED" -msgstr "" +msgstr "RESTRICTED" #: ../../c-api/structures.rst:518 msgid "READONLY" -msgstr "" +msgstr "READONLY" #: ../../c-api/structures.rst:581 msgid "T_BYTE" @@ -841,9 +831,8 @@ msgid "T_ULONG" msgstr "T_ULONG" #: ../../c-api/structures.rst:581 -#, fuzzy msgid "T_ULONGULONG" -msgstr "T_ULONGLONG" +msgstr "T_ULONGULONG" #: ../../c-api/structures.rst:581 msgid "T_PYSSIZET" @@ -870,9 +859,8 @@ msgid "T_STRING" msgstr "T_STRING" #: ../../c-api/structures.rst:581 -#, fuzzy msgid "T_STRING_INPLACE" -msgstr "T_STRING" +msgstr "T_STRING_INPLACE" #: ../../c-api/structures.rst:581 msgid "T_OBJECT_EX" @@ -880,43 +868,4 @@ msgstr "T_OBJECT_EX" #: ../../c-api/structures.rst:581 msgid "structmember.h" -msgstr "" - -#~ msgid "C Type" -#~ msgstr "C Type" - -#~ msgid ":attr:`name`" -#~ msgstr ":attr:`name`" - -#~ msgid ":attr:`!type`" -#~ msgstr ":attr:`!type`" - -#~ msgid "int" -#~ msgstr "int" - -#~ msgid ":attr:`offset`" -#~ msgstr ":attr:`offset`" - -#~ msgid ":attr:`flags`" -#~ msgstr ":attr:`flags`" - -#~ msgid ":attr:`doc`" -#~ msgstr ":attr:`doc`" - -#~ msgid "long" -#~ msgstr "long" - -#~ msgid "float" -#~ msgstr "float" - -#~ msgid "double" -#~ msgstr "double" - -#~ msgid "T_OBJECT" -#~ msgstr "T_OBJECT" - -#~ msgid "char" -#~ msgstr "char" - -#~ msgid "void \\*" -#~ msgstr "void \\*" +msgstr "structmember.h" diff --git a/c-api/type.po b/c-api/type.po index 3dd387dfde..18ff9d72a5 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -374,9 +374,8 @@ msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." msgstr "" #: ../../c-api/type.rst:316 -#, fuzzy msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." -msgstr "等價於 ``PyType_FromModuleAndSpec(NULL, spec, bases)``\\ 。" +msgstr "等價於 ``PyType_FromMetaclass(NULL, module, spec, bases)``。" #: ../../c-api/type.rst:322 msgid "" @@ -399,14 +398,12 @@ msgid "" msgstr "" #: ../../c-api/type.rst:338 -#, fuzzy msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." -msgstr "等價於 ``PyType_FromModuleAndSpec(NULL, spec, bases)``\\ 。" +msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, bases)``。" #: ../../c-api/type.rst:355 -#, fuzzy msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." -msgstr "等價於 ``PyType_FromSpecWithBases(spec, NULL)``\\ 。" +msgstr "等價於 ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``。" #: ../../c-api/type.rst:359 msgid "" diff --git a/c-api/typehints.po b/c-api/typehints.po index 9d078af6a5..2a7f76ba83 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -49,11 +49,11 @@ msgid "" msgstr "" "建立一個 :ref:`GenericAlias ` 物件,等同於呼叫 Python " "的 :class:`types.GenericAlias` class。 *origin* 和 *args* 引數分別設定了 " -"``GenericAlias`` 的 ``__origin__`` 與 ``__args__`` 屬性。*origin* 應該要是個 :" -"c:expr:`PyTypeObject*` 且 *args* 可以是個 :c:expr:`PyTupleObject*` 或任意 " -"``PyObject*``。如果傳入的 *args* 不是個 tuple(元組),則會自動建立一個長度" -"為 1 的 tuple 且 ``__args__`` 會被設為 ``(args,)``。只會進行最少的引數檢查," -"所以即便 *origin* 不是個型別,函式也會不會失敗。 ``GenericAlias`` 的 " +"``GenericAlias`` 的 ``__origin__`` 與 ``__args__`` 屬性。*origin* 應該要是" +"個 :c:expr:`PyTypeObject*` 且 *args* 可以是個 :c:expr:`PyTupleObject*` 或任" +"意 ``PyObject*``。如果傳入的 *args* 不是個 tuple(元組),則會自動建立一個長" +"度為 1 的 tuple 且 ``__args__`` 會被設為 ``(args,)``。只會進行最少的引數檢" +"查,所以即便 *origin* 不是個型別,函式也會不會失敗。 ``GenericAlias`` 的 " "``__parameters__`` 屬性會自 ``__args__`` 惰性地建立 (constructed lazily)。當" "失敗時,會引發一個例外並回傳 ``NULL``。" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index a7bad0c437..f09c94df55 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -347,9 +347,8 @@ msgid "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" msgstr "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" #: ../../c-api/typeobj.rst:99 -#, fuzzy msgid "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" -msgstr ":c:member:`~PyTypeObject.tp_weaklistoffset`" +msgstr "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" #: ../../c-api/typeobj.rst:101 msgid ":c:member:`~PyTypeObject.tp_iter`" @@ -458,9 +457,8 @@ msgid "__set__, __delete__" msgstr "__set__, __delete__" #: ../../c-api/typeobj.rst:120 -#, fuzzy msgid "(:c:member:`~PyTypeObject.tp_dictoffset`)" -msgstr ":c:member:`~PyTypeObject.tp_dictoffset`" +msgstr "(:c:member:`~PyTypeObject.tp_dictoffset`)" #: ../../c-api/typeobj.rst:122 msgid ":c:member:`~PyTypeObject.tp_init`" @@ -577,13 +575,12 @@ msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" #: ../../c-api/typeobj.rst:150 -#, fuzzy msgid "[:c:member:`~PyTypeObject.tp_watched`]" -msgstr "[:c:member:`~PyTypeObject.tp_cache`]" +msgstr "[:c:member:`~PyTypeObject.tp_watched`]" #: ../../c-api/typeobj.rst:150 msgid "char" -msgstr "" +msgstr "char" #: ../../c-api/typeobj.rst:155 msgid "" @@ -2028,10 +2025,9 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:1236 -#, fuzzy msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." -msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" +msgstr "" #: ../../c-api/typeobj.rst:1243 msgid "" diff --git a/c-api/unicode.po b/c-api/unicode.po index e2ec742945..7e115e28f3 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -137,9 +137,8 @@ msgid "Return values of the :c:func:`PyUnicode_KIND` macro." msgstr "" #: ../../c-api/unicode.rst:126 -#, fuzzy msgid "``PyUnicode_WCHAR_KIND`` has been removed." -msgstr "``PyUnicode_WCHAR_KIND`` 已棄用。" +msgstr "``PyUnicode_WCHAR_KIND`` 已被移除。" #: ../../c-api/unicode.rst:132 msgid "" @@ -636,12 +635,11 @@ msgstr "" #: ../../c-api/unicode.rst:499 msgid "``p``" -msgstr "" +msgstr "``p``" #: ../../c-api/unicode.rst:500 -#, fuzzy msgid ":c:expr:`const void*`" -msgstr "const void\\*" +msgstr ":c:expr:`const void*`" #: ../../c-api/unicode.rst:501 msgid "" @@ -652,13 +650,12 @@ msgstr "" #: ../../c-api/unicode.rst:506 msgid "``A``" -msgstr "" +msgstr "``A``" #: ../../c-api/unicode.rst:507 ../../c-api/unicode.rst:511 #: ../../c-api/unicode.rst:521 ../../c-api/unicode.rst:525 -#, fuzzy msgid ":c:expr:`PyObject*`" -msgstr "PyObject\\*" +msgstr ":c:expr:`PyObject*`" #: ../../c-api/unicode.rst:508 msgid "The result of calling :func:`ascii`." @@ -666,7 +663,7 @@ msgstr "" #: ../../c-api/unicode.rst:510 msgid "``U``" -msgstr "" +msgstr "``U``" #: ../../c-api/unicode.rst:512 msgid "A Unicode object." @@ -674,7 +671,7 @@ msgstr "一 Unicode 物件。" #: ../../c-api/unicode.rst:514 msgid "``V``" -msgstr "" +msgstr "``V``" #: ../../c-api/unicode.rst:515 msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" @@ -689,7 +686,7 @@ msgstr "" #: ../../c-api/unicode.rst:520 msgid "``S``" -msgstr "" +msgstr "``S``" #: ../../c-api/unicode.rst:522 msgid "The result of calling :c:func:`PyObject_Str`." @@ -697,7 +694,7 @@ msgstr "" #: ../../c-api/unicode.rst:524 msgid "``R``" -msgstr "" +msgstr "``R``" #: ../../c-api/unicode.rst:526 msgid "The result of calling :c:func:`PyObject_Repr`." @@ -1715,138 +1712,3 @@ msgid "" "has been interned, or a new (\"owned\") reference to an earlier interned " "string object with the same value." msgstr "" - -#~ msgid ":attr:`%%`" -#~ msgstr ":attr:`%%`" - -#~ msgid ":attr:`%c`" -#~ msgstr ":attr:`%c`" - -#~ msgid "int" -#~ msgstr "int" - -#~ msgid ":attr:`%d`" -#~ msgstr ":attr:`%d`" - -#~ msgid "Equivalent to ``printf(\"%d\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%d\")``. [1]_" - -#~ msgid ":attr:`%u`" -#~ msgstr ":attr:`%u`" - -#~ msgid "unsigned int" -#~ msgstr "unsigned int" - -#~ msgid "Equivalent to ``printf(\"%u\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%u\")``. [1]_" - -#~ msgid ":attr:`%ld`" -#~ msgstr ":attr:`%ld`" - -#~ msgid "long" -#~ msgstr "long" - -#~ msgid "Equivalent to ``printf(\"%ld\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%ld\")``. [1]_" - -#~ msgid ":attr:`%li`" -#~ msgstr ":attr:`%li`" - -#~ msgid "Equivalent to ``printf(\"%li\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%li\")``. [1]_" - -#~ msgid ":attr:`%lu`" -#~ msgstr ":attr:`%lu`" - -#~ msgid "unsigned long" -#~ msgstr "unsigned long" - -#~ msgid "Equivalent to ``printf(\"%lu\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%lu\")``. [1]_" - -#~ msgid ":attr:`%lld`" -#~ msgstr ":attr:`%lld`" - -#~ msgid "long long" -#~ msgstr "long long" - -#~ msgid "Equivalent to ``printf(\"%lld\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%lld\")``. [1]_" - -#~ msgid ":attr:`%lli`" -#~ msgstr ":attr:`%lli`" - -#~ msgid "Equivalent to ``printf(\"%lli\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%lli\")``. [1]_" - -#~ msgid ":attr:`%llu`" -#~ msgstr ":attr:`%llu`" - -#~ msgid "unsigned long long" -#~ msgstr "unsigned long long" - -#~ msgid "Equivalent to ``printf(\"%llu\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%llu\")``. [1]_" - -#~ msgid ":attr:`%zd`" -#~ msgstr ":attr:`%zd`" - -#~ msgid ":c:type:`\\ Py_ssize_t`" -#~ msgstr ":c:type:`\\ Py_ssize_t`" - -#~ msgid "Equivalent to ``printf(\"%zd\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%zd\")``. [1]_" - -#~ msgid ":attr:`%zi`" -#~ msgstr ":attr:`%zi`" - -#~ msgid "Equivalent to ``printf(\"%zi\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%zi\")``. [1]_" - -#~ msgid ":attr:`%zu`" -#~ msgstr ":attr:`%zu`" - -#~ msgid "size_t" -#~ msgstr "size_t" - -#~ msgid "Equivalent to ``printf(\"%zu\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%zu\")``. [1]_" - -#~ msgid ":attr:`%i`" -#~ msgstr ":attr:`%i`" - -#~ msgid "Equivalent to ``printf(\"%i\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%i\")``. [1]_" - -#~ msgid ":attr:`%x`" -#~ msgstr ":attr:`%x`" - -#~ msgid "Equivalent to ``printf(\"%x\")``. [1]_" -#~ msgstr "等價於 ``printf(\"%x\")``. [1]_" - -#~ msgid ":attr:`%s`" -#~ msgstr ":attr:`%s`" - -#~ msgid "const char\\*" -#~ msgstr "const char\\*" - -#~ msgid ":attr:`%p`" -#~ msgstr ":attr:`%p`" - -#~ msgid ":attr:`%A`" -#~ msgstr ":attr:`%A`" - -#~ msgid ":attr:`%U`" -#~ msgstr ":attr:`%U`" - -#~ msgid ":attr:`%V`" -#~ msgstr ":attr:`%V`" - -#~ msgid "PyObject\\*, const char\\*" -#~ msgstr "PyObject\\*, const char\\*" - -#~ msgid ":attr:`%S`" -#~ msgstr ":attr:`%S`" - -#~ msgid ":attr:`%R`" -#~ msgstr ":attr:`%R`" diff --git a/c-api/utilities.po b/c-api/utilities.po index fa97e63ea5..431b98d7b0 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -33,6 +33,6 @@ msgid "" "C, and parsing function arguments and constructing Python values from C " "values." msgstr "" -"本章中的函式可用來執行各種工具任務,包括幫助 C 程式碼提升跨平臺可攜性 (portable)、在 " -"C 中使用 Python module(模組)、以及剖析函式引數並基於 C 中的值來構建 Python " -"中的值等。" +"本章中的函式可用來執行各種工具任務,包括幫助 C 程式碼提升跨平臺可攜性 " +"(portable)、在 C 中使用 Python module(模組)、以及剖析函式引數並基於 C 中的" +"值來構建 Python 中的值等。" From 2e3815958c4ebf8b6be769336453740488439173 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 20:45:23 +0800 Subject: [PATCH 004/105] fix: resolve fuzzy entries in distributing --- distributing/index.po | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/distributing/index.po b/distributing/index.po index 10483abed9..e9833900e0 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -85,7 +85,6 @@ msgstr "" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用" #: ../../distributing/index.rst:37 -#, fuzzy msgid "" "the `Python Packaging Authority `__ are the group of " "developers and documentation authors responsible for the maintenance and " @@ -96,11 +95,9 @@ msgstr "" "`Python 封裝管理站 (Python Packaging Authority) `__ 是" "一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" "元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 和 `Bitbucket `__ 這兩個平台上維護各種" -"工具、說明文件及問題追蹤系統。" +"pypa>`__ 平台上維護各種工具、說明文件及問題追蹤系統。" #: ../../distributing/index.rst:43 -#, fuzzy msgid "" "``distutils`` is the original build and distribution system first added to " "the Python standard library in 1998. While direct use of ``distutils`` is " @@ -109,13 +106,12 @@ msgid "" "library, but its name lives on in other ways (such as the name of the " "mailing list used to coordinate Python packaging standards development)." msgstr "" -":mod:`distutils` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" -"庫。雖然直接使用 :mod:`distutils` 的方式已經被逐步淘汰,它仍然是現今封裝和發" -"布的基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式" -"存活著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" +"``distutils`` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" +"庫。雖然直接使用 ``distutils`` 的方式已經被逐步淘汰,它仍然是現今封裝和發布的" +"基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" +"著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" #: ../../distributing/index.rst:50 -#, fuzzy msgid "" "`setuptools`_ is a (largely) drop-in replacement for ``distutils`` first " "published in 2004. Its most notable addition over the unmodified " @@ -124,14 +120,13 @@ msgid "" "alternative to ``distutils`` that offers consistent support for more recent " "packaging standards across a wide range of Python versions." msgstr "" -"`setuptools`_ 是 :mod:`distutils` 的一個(主要的)偶然出現的替代品,它於 " -"2004 年首次被發布。相較於未修改的 :mod:`distutils` 工具,它最值得注意的新功" -"能,是能夠宣告對其他套件的依賴性 (dependency)。它目前被推薦為 :mod:" -"`distutils` 的一個替代方案,因其更新較為頻繁,且能在各個廣泛的 Python 版本之" -"間,為較新的封裝標準提供一致性的支援。" +"`setuptools`_ 是 ``distutils`` 的一個(主要的)偶然出現的替代品,它於 2004 年" +"首次被發布。相較於未修改的 ``distutils`` 工具,它最值得注意的新功能,是能夠宣" +"告對其他套件的依賴性 (dependency)。它目前被推薦為 ``distutils`` 的一個替代方" +"案,因其更新較為頻繁,且能在各個廣泛的 Python 版本之間,為較新的封裝標準提供" +"一致性的支援。" #: ../../distributing/index.rst:56 -#, fuzzy msgid "" "`wheel`_ (in this context) is a project that adds the ``bdist_wheel`` " "command to ``distutils``/`setuptools`_. This produces a cross platform " @@ -139,7 +134,7 @@ msgid "" "in :pep:`427`) that allows Python libraries, even those including binary " "extensions, to be installed on a system without needing to be built locally." msgstr "" -"`wheel`_\\ (在此文中)是一個將 ``bdist_wheel`` 指令附加到 :mod:`distutils`/" +"`wheel`_\\ (在此文中)是一個將 ``bdist_wheel`` 指令附加到 ``distutils``/" "`setuptools`_ 的專案。這會產生一個跨平台的二進制封裝格式(稱為「wheels」或" "「wheel 檔案」,並於 :pep:`427` 中被定義),它可讓 Python 函式庫,甚至那些包" "含二進制擴充的函式庫,可以在系統中被安裝,但不需要在本機進行建置。" From c9179c1cf797757f2cf4ef6ad499acb6b953d476 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 21:04:39 +0800 Subject: [PATCH 005/105] fix: resolve fuzzy entries in faq --- faq/design.po | 108 ++++++++++++++++++++------------------------- faq/extending.po | 6 +-- faq/gui.po | 8 ++-- faq/installed.po | 8 ++-- faq/library.po | 7 ++- faq/programming.po | 4 +- faq/windows.po | 14 +++--- 7 files changed, 71 insertions(+), 84 deletions(-) diff --git a/faq/design.po b/faq/design.po index c131170b6d..fbdc9aeb4e 100644 --- a/faq/design.po +++ b/faq/design.po @@ -235,7 +235,6 @@ msgstr "" "綴 ``m_``,所以這種明確性在那些語言也是很好用的。" #: ../../faq/design.rst:127 -#, fuzzy msgid "" "Second, it means that no special syntax is necessary if you want to " "explicitly reference or call the method from a particular class. In C++, if " @@ -249,8 +248,8 @@ msgstr "" "第二,當你想明確地使用或呼叫在某個類別裡的方法的時候,你不需要特殊的語法。在 " "C++ 裡,如果你想用一個在繼承類別時被覆寫的基底類別方法,必須要用 ``::`` 運算" "子 -- 但在 Python 裡,你可以直接寫成 ``baseclass.methodname(self, )``。這在 :meth:`__init__` 方法很好用,特別是在一個繼承的類別要擴充基底" -"類別的方法而要呼叫他時。" +"list>)``。這在 :meth:`~object.__init__` 方法很好用,特別是在一個繼承的類別要" +"擴充基底類別的方法而要呼叫他時。" #: ../../faq/design.rst:136 msgid "" @@ -425,14 +424,14 @@ msgid "How fast are exceptions?" msgstr "例外處理有多快?" #: ../../faq/design.rst:235 -#, fuzzy msgid "" "A :keyword:`try`/:keyword:`except` block is extremely efficient if no " "exceptions are raised. Actually catching an exception is expensive. In " "versions of Python prior to 2.0 it was common to use this idiom::" msgstr "" -"如果沒有例外被丟出,一個 try/except 區塊是非常有效率的。事實上,抓捕例外要付" -"出昂貴的代價。在 Python 2.0 以前,這樣使用是相當常見的:\n" +"如果沒有例外被丟出,一個 :keyword:`try`/:keyword:`except` 區塊是非常有效率" +"的。事實上,抓捕例外要付出昂貴的代價。在 Python 2.0 以前,這樣使用是相當常見" +"的:\n" "\n" "::" @@ -613,16 +612,15 @@ msgstr "" "::" #: ../../faq/design.rst:355 -#, fuzzy msgid "" "Indeed, using CPython's reference counting and destructor scheme, each new " "assignment to ``f`` closes the previous file. With a traditional GC, " "however, those file objects will only get collected (and closed) at varying " "and possibly long intervals." msgstr "" -"實際上,使用 CPython 的參照計次和解構方案 (destructor scheme),每個對\\ " -"*f*\\ 的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 (GC) 的話,這些檔" -"案物件只會在不固定且有可能很長的時間後被收集(並關閉)。" +"實際上,使用 CPython 的參照計次和解構方案 (destructor scheme),每個對 ``f`` " +"的新指派都會關閉前面打開的檔案。然而用傳統的垃圾回收 (GC) 的話,這些檔案物件" +"只會在不固定且有可能很長的時間後被收集(並關閉)。" #: ../../faq/design.rst:360 msgid "" @@ -653,7 +651,6 @@ msgstr "" "大多數是通透的,也並不完全,要讓它跟 Python 相容還是需要做一些修補。)" #: ../../faq/design.rst:378 -#, fuzzy msgid "" "Traditional GC also becomes a problem when Python is embedded into other " "applications. While in a standalone Python it's fine to replace the " @@ -664,10 +661,10 @@ msgid "" "``free()`` properly." msgstr "" "傳統的垃圾收集 (GC) 在 Python 被嵌入其他應用程式時也成了一個問題。在獨立的 " -"Python 程式裡當然可以把標準的 malloc() 和 free() 換成 GC 函式庫提供的其他版" -"本;但一個嵌著 Python 的應用程式可能想用\\ *自己*\\ 的 malloc() 和 free() 替" -"代品,而不是用 Python 的。以現在來說,CPython 和實作 malloc() 和 free() 的程" -"式相處融洽。" +"Python 程式裡當然可以把標準的 ``malloc()`` 和 ``free()`` 換成 GC 函式庫提供的" +"其他版本;但一個嵌著 Python 的應用程式可能想用\\ *自己*\\ 的 malloc() 和 " +"free() 替代品,而不是用 Python 的。以現在來說,CPython 和實作 malloc() 和 " +"free() 的程式相處融洽。" #: ../../faq/design.rst:387 msgid "Why isn't all memory freed when CPython exits?" @@ -700,7 +697,6 @@ msgid "Why are there separate tuple and list data types?" msgstr "為何要把元組 (tuple) 和串列 (list) 分成兩個資料型態?" #: ../../faq/design.rst:403 -#, fuzzy msgid "" "Lists and tuples, while similar in many respects, are generally used in " "fundamentally different ways. Tuples can be thought of as being similar to " @@ -710,12 +706,11 @@ msgid "" "two or three numbers." msgstr "" "串列和元組在很多方面相當相似,但通常用在完全不同的地方。元組可以想成 Pascal " -"的紀錄 (record) 或是 C 的結構 (struct),是一小群相關聯但可能是不同型別的資料" -"集合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個有" -"二或三個值的元組。" +"的 ``record`` 或是 C 的 ``struct``,是一小群相關聯但可能是不同型別的資料集" +"合,以一組為單位進行操作。舉例來說,一個笛卡兒坐標系可以適當地表示成一個有二" +"或三個值的元組。" #: ../../faq/design.rst:410 -#, fuzzy msgid "" "Lists, on the other hand, are more like arrays in other languages. They " "tend to hold a varying number of objects all of which have the same type and " @@ -725,8 +720,9 @@ msgid "" "if you added another file or two to the directory." msgstr "" "另一方面,串列更像是其他語言的陣列 (array)。他可以有不固定個同類別物件,且為" -"逐項操作。舉例來說,``os.listdir('.')`` 回傳當下目錄裡的檔案,以包含字串的串" -"列表示。如果你新增了幾個檔案到這個目錄,一般來說操作結果的函式也會正常運作。" +"逐項操作。舉例來說,:func:`os.listdir('.') ` 回傳當下目錄裡的檔" +"案,以包含字串的串列表示。如果你新增了幾個檔案到這個目錄,一般來說操作結果的" +"函式也會正常運作。" #: ../../faq/design.rst:418 msgid "" @@ -787,7 +783,6 @@ msgstr "" "tree),在搜尋(目前為止最常見的操作)方面有更好的表現,實作上也較為簡單。" #: ../../faq/design.rst:447 -#, fuzzy msgid "" "Dictionaries work by computing a hash code for each key stored in the " "dictionary using the :func:`hash` built-in function. The hash code varies " @@ -800,10 +795,10 @@ msgid "" "notation -- to retrieve a key." msgstr "" "字典利用內建 :func:`hash` 函式,對每個鍵做雜湊計算。雜湊結果依據鍵的值和個別" -"執行緒 (processes) 的種子而有相當大的差距。例如,\"Python\" 的雜湊是 " -"-539294296,而只差一個字的 \"python\" 則是 1142331976。雜湊結果接著被用來計算" -"值在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要常數時間 — " -"用大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" +"執行緒 (processes) 的種子而有相當大的差距。例如,``'Python'`` 的雜湊是 " +"``-539294296``,而只差一個字的 ``'python'`` 則是 ``1142331976``。雜湊結果接著" +"被用來計算值在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要" +"常數時間 — 用大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" #: ../../faq/design.rst:458 msgid "Why must dictionary keys be immutable?" @@ -895,7 +890,6 @@ msgstr "" "所有物件都標記成只能讀取 — 所以再一次,自己參照自己的物件會導致無窮迴圈。" #: ../../faq/design.rst:500 -#, fuzzy msgid "" "There is a trick to get around this if you need to, but use it at your own " "risk: You can wrap a mutable structure inside a class instance which has " @@ -905,9 +899,9 @@ msgid "" "the object is in the dictionary (or other structure). ::" msgstr "" "如果你需要的話,這裡有個小技巧可以幫你,但請自己承擔風險:你可以把一個可變物" -"件包裝進一個有 :meth:`__eq__` 和 :meth:`__hash__` 方法的類別實例。只要這種包" -"裝物件還存在於字典(或其他類似結構)中,你就必須確定在字典(或其他用雜湊為基" -"底的結構)中他們的雜湊值會保持恆定。\n" +"件包裝進一個有 :meth:`~object.__eq__` 和 :meth:`~object.__hash__` 方法的類別" +"實例。只要這種包裝物件還存在於字典(或其他類似結構)中,你就必須確定在字典" +"(或其他用雜湊為基底的結構)中他們的雜湊值會保持恆定。\n" "\n" "::" @@ -934,16 +928,15 @@ msgstr "" "為基底的結構會出現不正常的行為。" #: ../../faq/design.rst:534 -#, fuzzy msgid "" "In the case of :class:`!ListWrapper`, whenever the wrapper object is in a " "dictionary the wrapped list must not change to avoid anomalies. Don't do " "this unless you are prepared to think hard about the requirements and the " "consequences of not meeting them correctly. Consider yourself warned." msgstr "" -"至於 ListWrapper,只要這個包裝過的物件在字典中,裡面的串列就不能改變以避免不" -"正常的事情發生。除非你已經謹慎思考過你的需求和無法滿足條件的後果,不然請不要" -"這麼做。請自行注意。" +"至於 :class:`!ListWrapper`,只要這個包裝過的物件在字典中,裡面的串列就不能改" +"變以避免不正常的事情發生。除非你已經謹慎思考過你的需求和無法滿足條件的後果," +"不然請不要這麼做。請自行注意。" #: ../../faq/design.rst:541 msgid "Why doesn't list.sort() return the sorted list?" @@ -1028,7 +1021,6 @@ msgstr "" "用來建構詳盡徹底的測試套件來測試模組裡的每一行程式碼。" #: ../../faq/design.rst:584 -#, fuzzy msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " @@ -1041,9 +1033,9 @@ msgid "" msgstr "" "就像介面規範一樣,一個適當的測試規則在建造大型又複雜的 Python 應用程式時可以" "幫上忙。事實上,他可能可以有更好的表現,因為介面規範無法測試程式的特定屬性。" -"舉例來說,:meth:`append` 方法應該要在某個內部的串列最後面加上新的元素,而介面" -"規範沒辦法測試你的 :meth:`append` 是不是真的有正確的實作,但這在測試套件裡是" -"件很簡單的事。" +"舉例來說,:meth:`list.append` 方法應該要在某個內部的串列最後面加上新的元素," +"而介面規範沒辦法測試你的 :meth:`list.append` 是不是真的有正確的實作,但這在測" +"試套件裡是件很簡單的事。" #: ../../faq/design.rst:592 msgid "" @@ -1062,7 +1054,6 @@ msgid "Why is there no goto?" msgstr "為何沒有 goto 語法?" #: ../../faq/design.rst:602 -#, fuzzy msgid "" "In the 1970s people realized that unrestricted goto could lead to messy " "\"spaghetti\" code that was hard to understand and revise. In a high-level " @@ -1074,12 +1065,12 @@ msgid "" msgstr "" "在 1970 年代,人們了解到沒有限制的 goto 會導致混亂、難以理解和修改的「義大利" "麵」程式碼 (\"spaghetti\" code)。在高階語言裡,這也是不需要的,因為有方法可以" -"做邏輯分支(以 Python 來說,用 ``if`` 陳述式和 ``or``、``and`` 及 ``if-" -"else`` 運算式)和迴圈(用 ``while`` 和 ``for`` 陳述式,可能會有 ``continue`` " -"和 ``break``)。" +"做邏輯分支(以 Python 來說,用 :keyword:`if` 陳述式和 :keyword:`or`、:" +"keyword:`and` 及 :keyword:`if`/:keyword:`else` 運算式)和迴圈(用 :keyword:" +"`while` 和 :keyword:`for` 陳述式,可能會有 :keyword:`continue` 和 :keyword:" +"`break`)。" #: ../../faq/design.rst:609 -#, fuzzy msgid "" "One can also use exceptions to provide a \"structured goto\" that works even " "across function calls. Many feel that exceptions can conveniently emulate " @@ -1087,17 +1078,17 @@ msgid "" "other languages. For example::" msgstr "" "我們也可以用例外來做「結構化的 goto」,這甚至可以跨函式呼叫。很多人覺得例外可" -"以方便地模擬在 C、Fortran 和其他語言裡各種合理使用的「go」和「goto」。例" +"以方便地模擬在 C、Fortran 和其他語言裡各種合理使用的 ``go`` 和 ``goto``。例" "如:\n" "\n" "::" #: ../../faq/design.rst:625 -#, fuzzy msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " "considered an abuse of ``goto`` anyway. Use sparingly." -msgstr "這依然不能讓你跳進迴圈內,這通常被認為是對 goto 的濫用。請小心使用。" +msgstr "" +"這依然不能讓你跳進迴圈內,這通常被認為是對 ``goto`` 的濫用。請小心使用。" #: ../../faq/design.rst:630 msgid "Why can't raw strings (r-strings) end with a backslash?" @@ -1148,14 +1139,13 @@ msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "為何 Python 沒有屬性賦值的 with 陳述式?" #: ../../faq/design.rst:658 -#, fuzzy msgid "" "Python has a :keyword:`with` statement that wraps the execution of a block, " "calling code on the entrance and exit from the block. Some languages have a " "construct that looks like this::" msgstr "" -"Python 的 with 陳述式包裝了一區塊程式的執行,在進入和離開該區塊時執行程式碼。" -"一些語言會有像如下的結構:\n" +"Python 的 :keyword:`with` 陳述式包裝了一區塊程式的執行,在進入和離開該區塊時" +"執行程式碼。一些語言會有像如下的結構:\n" "\n" "::" @@ -1194,7 +1184,6 @@ msgstr "" "::" #: ../../faq/design.rst:685 -#, fuzzy msgid "" "The snippet assumes that ``a`` must have a member attribute called ``x``. " "However, there is nothing in Python that tells the interpreter this. What " @@ -1202,20 +1191,19 @@ msgid "" "variable named ``x``, will it be used inside the :keyword:`with` block? As " "you see, the dynamic nature of Python makes such choices much harder." msgstr "" -"這段程式碼假設「a」有一個叫做「x」的成員屬性。然後,Python 裡並沒有任何跡象告" -"訴直譯器這件事。在假設「a」是一個整數的話,那會發生什麼事?如果有一個全域變數" -"稱為「x」,那在這個 with 區塊會被使用嗎?如你所見,Python 動態的天性使得這種" -"選擇更加困難。" +"這段程式碼假設 ``a`` 有一個叫做 ``x`` 的成員屬性。然後,Python 裡並沒有任何跡" +"象告訴直譯器這件事。在假設「a」是一個整數的話,那會發生什麼事?如果有一個全域" +"變數稱為 ``x``,那在這個 :keyword:`with` 區塊會被使用嗎?如你所見,Python 動" +"態的天性使得這種選擇更加困難。" #: ../../faq/design.rst:691 -#, fuzzy msgid "" "The primary benefit of :keyword:`with` and similar language features " "(reduction of code volume) can, however, easily be achieved in Python by " "assignment. Instead of::" msgstr "" -"然而,with 陳述式或類似的語言特性(減少程式碼量)的主要好處可以透過賦值來達" -"成。相較於這樣寫:\n" +"然而 :keyword:`with` 陳述式或類似的語言特性(減少程式碼量)的主要好處可以透過" +"賦值來達成。相較於這樣寫:\n" "\n" "::" @@ -1247,7 +1235,6 @@ msgid "Why don't generators support the with statement?" msgstr "為何產生器 (generator) 不支援 with 陳述式?" #: ../../faq/design.rst:717 -#, fuzzy msgid "" "For technical reasons, a generator used directly as a context manager would " "not work correctly. When, as is most common, a generator is used as an " @@ -1257,7 +1244,8 @@ msgid "" msgstr "" "出於技術原因,把產生器直接用作情境 (context) 管理器會無法正常運作。因為通常來" "說,產生器是被當成疊代器 (iterator),到最後完成時不需要被手動關閉。但如果你需" -"要的話,你可以在 with 陳述式裡用「contextlib.closing(generator)」來包裝他。" +"要的話,你可以在 :keyword:`with` 陳述式裡用 :func:`contextlib." +"closing(generator) ` 來包裝他。" #: ../../faq/design.rst:725 msgid "Why are colons required for the if/while/def/class statements?" diff --git a/faq/extending.po b/faq/extending.po index f6c01cfb9a..906fb55984 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -331,9 +331,9 @@ msgid "" "work for C++ objects." msgstr "" "根據你的要求,有多種方法。要手動執行此操作,請先閱讀 :ref:`「擴充和嵌入」說明" -"檔案 `。意識到對於 Python 執行環境 (run-time) 系統,C 和 C++ 之間並沒有太" -"多區別——因此圍繞 C 結構(指標)型別構建新 Python 型別的策略也適用於 C++ 物" -"件。" +"檔案 `。意識到對於 Python 執行環境 (run-time) 系統,C 和 C+" +"+ 之間並沒有太多區別——因此圍繞 C 結構(指標)型別構建新 Python 型別的策略也適" +"用於 C++ 物件。" #: ../../faq/extending.rst:212 msgid "For C++ libraries, see :ref:`c-wrapper-software`." diff --git a/faq/gui.po b/faq/gui.po index d34482a97b..2a64c16c84 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -62,8 +62,8 @@ msgid "" "frameworks can be found on the python wiki." msgstr "" "根據你要使用的平台,還有其他幾種選擇。在 python wiki 上可以找到一份\\ `跨平台" -"的 `_" -"\\ 以及\\ `各平台專屬的 `_\\ 以及\\ `各平台專屬的 `_ GUI 框架清單。" #: ../../faq/gui.rst:36 @@ -89,8 +89,8 @@ msgid "" "point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" "`TK_LIBRARY` environment variables." msgstr "" -"將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) 使用 :envvar:" -"`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" +"將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) " +"使用 :envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" #: ../../faq/gui.rst:49 msgid "" diff --git a/faq/installed.po b/faq/installed.po index c645e6519c..4aa8034d22 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -88,8 +88,8 @@ msgid "" "Apparently some of HP/Compaq's administrative tools are written in Python." msgstr "" "一些安裝 Windows 的機器也被安裝 Python。截至撰寫此文件的當下,我們得知 HP 與 " -"Compaq 出廠的機器都預設安裝 Python。顯然的 HP 與 Compaq 部分的管理工具程式是透" -"過 Python 語言所撰寫。" +"Compaq 出廠的機器都預設安裝 Python。顯然的 HP 與 Compaq 部分的管理工具程式是" +"透過 Python 語言所撰寫。" #: ../../faq/installed.rst:32 msgid "" @@ -133,5 +133,5 @@ msgid "" "would then be required to fix things again." msgstr "" "當作業系統預設安裝 Python,不建議移除它。對你而言某些工具程式是重要不可或缺" -"的,若自行移除它,透過 Python 撰寫的工具程式將無法正常執行。重新安裝整個系統" -",才能再次解決這些問題。" +"的,若自行移除它,透過 Python 撰寫的工具程式將無法正常執行。重新安裝整個系" +"統,才能再次解決這些問題。" diff --git a/faq/library.po b/faq/library.po index 5660463066..df8581f140 100644 --- a/faq/library.po +++ b/faq/library.po @@ -1064,17 +1064,16 @@ msgid "" "popular and feature-rich alternative." msgstr "" ":mod:`asyncio` 模組提供了一個通用的單執行緒並發非同步函式庫,可用於編寫非阻塞" -"網路程式碼。第三方 `Twisted `_ 函式庫是一種流" -"行且功能豐富的替代方案。" +"網路程式碼。第三方 `Twisted `_ 函式庫是一種流行且功能豐" +"富的替代方案。" #: ../../faq/library.rst:788 msgid "Databases" msgstr "資料庫" #: ../../faq/library.rst:791 -#, fuzzy msgid "Are there any interfaces to database packages in Python?" -msgstr "Python 中是否有任何資料庫包的介面?" +msgstr "Python 中是否有任何資料庫套件的介面?" #: ../../faq/library.rst:793 msgid "Yes." diff --git a/faq/programming.po b/faq/programming.po index 776eaea7c8..ea852b8782 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -1798,8 +1798,8 @@ msgid "" "quadratic in the total string length." msgstr "" ":class:`str` 和 :class:`bytes` 物件是不可變的,因此將多個字串連接在一起效率低" -"下,因為每次連接都會建立一個新物件。在一般情況下,總執行環境 (runtime) 成本是總字串長度的" -"二次方。" +"下,因為每次連接都會建立一個新物件。在一般情況下,總執行環境 (runtime) 成本是" +"總字串長度的二次方。" #: ../../faq/programming.rst:1138 #, fuzzy diff --git a/faq/windows.po b/faq/windows.po index 514758fd55..718eb621cf 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -278,8 +278,8 @@ msgid "" msgstr "" "**不要**\\ 直接將 Python 建置到你的 .exe 檔中。在 Windows 上,Python 必須是一" "個 DLL 來處理模組的 import,而那些模組本身也是 DLL。(這是第一個未正式記載的" -"關鍵事實。)請改為連結到 :file:`python{NN}.dll`;它通常被安裝在 ``C:\\Windows" -"\\System`` 中。*NN* 是 Python 版本,例如 \"33\" 就是指 Python 3.3。" +"關鍵事實。)請改為連結到 :file:`python{NN}.dll`;它通常被安裝在 ``C:" +"\\Windows\\System`` 中。*NN* 是 Python 版本,例如 \"33\" 就是指 Python 3.3。" #: ../../faq/windows.rst:176 msgid "" @@ -290,8 +290,8 @@ msgid "" "merely defines symbols for the linker.)" msgstr "" "你可以透過兩種不同的方式連結到 Python。載入時連結 (load-time linking) 表示要" -"連結到 :file:`python{NN}.lib`,而執行環境連結 (run-time linking) 表示要連結到 :" -"file:`python{NN}.dll`。(一般註解::file:`python{NN}.lib` 是 :file:" +"連結到 :file:`python{NN}.lib`,而執行環境連結 (run-time linking) 表示要連結" +"到 :file:`python{NN}.dll`。(一般註解::file:`python{NN}.lib` 是 :file:" "`python{NN}.dll` 相對應的所謂 \"import lib\"。它只會為鏈接器定義符號。)" #: ../../faq/windows.rst:182 @@ -304,9 +304,9 @@ msgid "" "these pointers transparent to any C code that calls routines in Python's C " "API." msgstr "" -"執行環境連結大大簡化了連結選項;所有事情都會發生在執行環境。你的程式碼必須使用 " -"Windows ``LoadLibraryEx()`` 常式 (routine) 來載入 :file:`python{NN}.dll`。該" -"程式碼也必須用 Windows ``GetProcAddress()`` 常式所取得的指標,來使用 :file:" +"執行環境連結大大簡化了連結選項;所有事情都會發生在執行環境。你的程式碼必須使" +"用 Windows ``LoadLibraryEx()`` 常式 (routine) 來載入 :file:`python{NN}.dll`。" +"該程式碼也必須用 Windows ``GetProcAddress()`` 常式所取得的指標,來使用 :file:" "`python{NN}.dll` 中的(即為 Python C API 的)存取常式和資料。對於任何呼叫 " "Python C API 常式的 C 程式碼,巨集可以讓使用這些指標的過程透明化。" From faf1e5ce1739c1602d9ac0215a5cb66faa1af77e Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 17 Jul 2023 21:06:13 +0800 Subject: [PATCH 006/105] fix: resolve fuzzy entries in howto --- howto/clinic.po | 15 +++----- howto/functional.po | 9 ++--- howto/instrumentation.po | 10 +++--- howto/sockets.po | 78 ++++++++++++++++++++-------------------- 4 files changed, 54 insertions(+), 58 deletions(-) diff --git a/howto/clinic.po b/howto/clinic.po index fbeec38dc0..cd1756e00c 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -872,9 +872,8 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:782 -#, fuzzy msgid "``unused``" -msgstr "``unsigned_char``" +msgstr "``unused``" #: ../../howto/clinic.rst:779 msgid "" @@ -1225,18 +1224,16 @@ msgid "``'u'``" msgstr "``'u'``" #: ../../howto/clinic.rst:867 -#, fuzzy msgid "``wchar_t``" -msgstr "``char``" +msgstr "``wchar_t``" #: ../../howto/clinic.rst:865 msgid "``'u#'``" msgstr "``'u#'``" #: ../../howto/clinic.rst:868 -#, fuzzy msgid "``wchar_t(zeroes=True)``" -msgstr "``str(zeroes=True)``" +msgstr "``wchar_t(zeroes=True)``" #: ../../howto/clinic.rst:866 msgid "``'w*'``" @@ -1283,18 +1280,16 @@ msgid "``'Z'``" msgstr "``'Z'``" #: ../../howto/clinic.rst:874 -#, fuzzy msgid "``wchar_t(accept={str, NoneType})``" -msgstr "``str(accept={str, NoneType})``" +msgstr "``wchar_t(accept={str, NoneType})``" #: ../../howto/clinic.rst:872 msgid "``'Z#'``" msgstr "``'Z#'``" #: ../../howto/clinic.rst:875 -#, fuzzy msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" -msgstr "``str(accept={str, NoneType}, zeroes=True)``" +msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" #: ../../howto/clinic.rst:873 msgid "``'z'``" diff --git a/howto/functional.po b/howto/functional.po index 1c932c9fb7..7041c99ae0 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -1330,14 +1330,15 @@ msgstr "" #: ../../howto/functional.rst:1224 msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." -msgstr "https://en.wikipedia.org/wiki/Coroutine: Coroutines 的條目。" +msgstr "https://en.wikipedia.org/wiki/Coroutine: 協程 (coroutines) 的條目。" #: ../../howto/functional.rst:1226 -#, fuzzy msgid "" "https://en.wikipedia.org/wiki/Partial_application: Entry for the concept of " "partial function application." -msgstr "https://en.wikipedia.org/wiki/Currying: currying 概念的條目。" +msgstr "" +"https://en.wikipedia.org/wiki/Partial_application: 偏函式 (partial " +"application) 概念的條目。" #: ../../howto/functional.rst:1228 msgid "" @@ -1382,7 +1383,7 @@ msgstr ":mod:`operator` 模組的說明文件。" #: ../../howto/functional.rst:1254 msgid ":pep:`289`: \"Generator Expressions\"" -msgstr "" +msgstr ":pep:`289`:「產生器運算式 (Generator Expressions)」" #: ../../howto/functional.rst:1256 msgid "" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 2d7e11922d..0cb9592119 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -210,8 +210,8 @@ msgstr "" #: ../../howto/instrumentation.rst:282 msgid "" "The filename, function name, and line number are provided back to the " -"tracing script as positional arguments, which must be accessed using ``" -"$arg1``, ``$arg2``, ``$arg3``:" +"tracing script as positional arguments, which must be accessed using " +"``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" #: ../../howto/instrumentation.rst:286 @@ -289,9 +289,9 @@ msgstr "" #: ../../howto/instrumentation.rst:347 msgid "" -"The higher-level way to use the SystemTap integration is to use a \"tapset" -"\": SystemTap's equivalent of a library, which hides some of the lower-level " -"details of the static markers." +"The higher-level way to use the SystemTap integration is to use a " +"\"tapset\": SystemTap's equivalent of a library, which hides some of the " +"lower-level details of the static markers." msgstr "" #: ../../howto/instrumentation.rst:351 diff --git a/howto/sockets.po b/howto/sockets.po index 89b38480cc..e52de25c53 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -64,13 +64,13 @@ msgid "" "blocking sockets. But I'll start by talking about blocking sockets. You'll " "need to know how they work before dealing with non-blocking sockets." msgstr "" -"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 " -"sockets 使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除" -"非你真的知道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM " -"類型的 socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 " -"socket 是什麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的" -"一些建議。但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解" -"它們的工作原理。" +"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 sockets " +"使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除非你真的知" +"道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM 類型的 " +"socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 socket 是什" +"麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的一些建議。" +"但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解它們的工作" +"原理。" #: ../../howto/sockets.rst:31 msgid "" @@ -82,12 +82,12 @@ msgid "" "sockets exclusively; the web server it's talking to uses both \"server\" " "sockets and \"client\" sockets." msgstr "" -"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這主要" -"取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器端" -" (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" -"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使" -"用「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 " -"「用戶端」socket 來進行通訊。" +"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這" +"主要取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器" +"端 (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" +"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使用" +"「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 「用戶" +"端」socket 來進行通訊。" #: ../../howto/sockets.rst:40 msgid "History" @@ -111,8 +111,8 @@ msgid "" "of sockets with INET makes talking to arbitrary machines around the world " "unbelievably easy (at least compared to other schemes)." msgstr "" -"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路的普" -"及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" +"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路" +"的普及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" "的機器之間的通訊變得非常簡單(至少與其它方案相比是如此)。" #: ../../howto/sockets.rst:54 @@ -136,16 +136,16 @@ msgid "" "used for one exchange (or a small set of sequential exchanges)." msgstr "" "當 ``connect`` 完成時,這個 socket ``s`` 可以用來發送請求來取得頁面的文本。同" -"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常只" -"用來做一次交換(或是一小組連續交換)。" +"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常" +"只用來做一次交換(或是一小組連續交換)。" #: ../../howto/sockets.rst:70 msgid "" "What happens in the web server is a bit more complex. First, the web server " "creates a \"server socket\"::" msgstr "" -"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺服器端 " -"socket」:\n" +"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺" +"服器端 socket」:\n" "\n" "::" @@ -158,10 +158,10 @@ msgid "" "machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any " "address the machine happens to have." msgstr "" -"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外" -"部網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." -"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一" -"台機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" +"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外部" +"網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." +"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一台" +"機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" #: ../../howto/sockets.rst:87 msgid "" @@ -169,8 +169,8 @@ msgid "" "known\" services (HTTP, SNMP etc). If you're playing around, use a nice high " "number (4 digits)." msgstr "" -"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、SNMP" -"等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" +"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、" +"SNMP等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" #: ../../howto/sockets.rst:91 msgid "" @@ -180,8 +180,8 @@ msgid "" "should be plenty." msgstr "" "最後,``listen`` 引數告訴 socket 函式庫 (library),我們希望在佇列 (queue) 中" -"累積達 5 個(正常的最大值)連接請求後再拒絕外部連接。如果其餘的程式碼編寫" -"正確,這應該足夠了。" +"累積達 5 個(正常的最大值)連接請求後再拒絕外部連接。如果其餘的程式碼編寫正" +"確,這應該足夠了。" #: ../../howto/sockets.rst:95 msgid "" @@ -209,15 +209,15 @@ msgid "" "allocated port which will be recycled when the conversation ends." msgstr "" "事實上,有三種方法可以讓這個迴圈運作 - 分配一個執行緒 (thread) 來處理 " -"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將" -"這個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" +"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將這" +"個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" "socket 和任何有效的 ``clientsocket`` 之間進行多工處理。稍後將會更詳細的介紹。" -"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送任何" -"資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 ``clientsocket`` " -"都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機上的「用戶端」socket。" -"一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連接請求。兩個「用戶端」可" -"以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通訊結束的時候被回收並重新" -"利用。" +"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送" +"任何資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 " +"``clientsocket`` 都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機" +"上的「用戶端」socket。一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連接" +"請求。兩個「用戶端」可以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通" +"訊結束的時候被回收並重新利用。" #: ../../howto/sockets.rst:121 msgid "IPC" @@ -378,10 +378,10 @@ msgstr "" #: ../../howto/sockets.rst:262 msgid "" "Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " -"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, \"s" -"\" means *short* and \"l\" means *long*. Where network order is host order, " -"these do nothing, but where the machine is byte-reversed, these swap the " -"bytes around appropriately." +"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " +"\"s\" means *short* and \"l\" means *long*. Where network order is host " +"order, these do nothing, but where the machine is byte-reversed, these swap " +"the bytes around appropriately." msgstr "" #: ../../howto/sockets.rst:268 From 9751a248a1b2d619d10c6a307a810697e8747359 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 01:16:36 +0800 Subject: [PATCH 007/105] fix: resolve fuzzy entries in library --- library/_thread.po | 3 +-- library/asyncio-api-index.po | 18 ++++++++---------- library/asyncio-eventloop.po | 3 +-- library/asyncio-platforms.po | 5 ++--- library/asyncio-task.po | 3 +-- library/bisect.po | 6 +----- library/collections.abc.po | 6 ++---- library/concurrent.futures.po | 8 ++++---- library/ctypes.po | 8 +++----- library/datatypes.po | 8 ++++---- library/difflib.po | 3 +-- library/functions.po | 3 +-- library/gc.po | 3 +-- library/glob.po | 1 - library/html.entities.po | 6 ++---- library/http.po | 26 ++++++++++++-------------- library/itertools.po | 11 ++++------- library/logging.po | 15 +++++---------- library/mmap.po | 10 ++++------ library/multiprocessing.po | 3 +-- library/os.path.po | 3 +-- library/os.po | 30 ++++++++++-------------------- library/pathlib.po | 25 ++++++++++--------------- library/random.po | 18 +++++++----------- library/shutil.po | 3 +-- library/smtplib.po | 1 - library/socket.po | 9 +++------ library/sqlite3.po | 6 ++---- library/ssl.po | 3 +-- library/statistics.po | 7 ++----- library/sys.po | 7 ++----- library/tempfile.po | 6 ++---- library/test.po | 6 ++---- library/turtle.po | 3 +-- library/typing.po | 3 +-- library/unicodedata.po | 6 ++---- library/unittest.po | 16 ++++++---------- library/urllib.error.po | 8 ++++---- library/webbrowser.po | 3 +-- library/zipfile.po | 3 +-- 40 files changed, 117 insertions(+), 198 deletions(-) diff --git a/library/_thread.po b/library/_thread.po index 24ba1f1eab..ceef8f8e50 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -147,11 +147,10 @@ msgid "" msgstr "" #: ../../library/_thread.rst:123 -#, fuzzy msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX, DragonFlyBSD." -msgstr ":ref:`適用 `:Windows, pthreads。" +msgstr ":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、NetBSD、AIX、DragonFlyBSD。" #: ../../library/_thread.rst:130 msgid "" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index a6494f098c..cc73e09067 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -183,27 +183,26 @@ msgid "" ":ref:`Using asyncio.gather() to run things in parallel " "`." msgstr "" -":ref:`使用 asyncio.gather() 平行 (parallel) 執行 `" -"\\ 。" +":ref:`使用 asyncio.gather() 平行 (parallel) 執行 `。" #: ../../library/asyncio-api-index.rst:77 msgid "" ":ref:`Using asyncio.wait_for() to enforce a timeout " "`." msgstr "" -":ref:`使用 asyncio.wait_for() 強制設置超時 `\\ 。" +":ref:`使用 asyncio.wait_for() 強制設置超時 `。" #: ../../library/asyncio-api-index.rst:80 msgid ":ref:`Cancellation `." -msgstr ":ref:`取消任務 `\\ 。" +msgstr ":ref:`取消任務 `。" #: ../../library/asyncio-api-index.rst:82 msgid ":ref:`Using asyncio.sleep() `." -msgstr ":ref:`使用 asyncio.sleep() `\\ 。" +msgstr ":ref:`使用 asyncio.sleep() `。" #: ../../library/asyncio-api-index.rst:84 msgid "See also the main :ref:`Tasks documentation page `." -msgstr "請參閱 :ref:`Tasks 文件頁面 `\\ 。" +msgstr "請參閱 :ref:`Tasks 文件頁面 `。" #: ../../library/asyncio-api-index.rst:88 msgid "Queues" @@ -246,12 +245,11 @@ msgid "" ":ref:`Using asyncio.Queue to distribute workload between several Tasks " "`." msgstr "" -":ref:`使用 asyncio.Queue 為多個 Task 分配工作 `" -"\\ 。" +":ref:`使用 asyncio.Queue 為多個 Task 分配工作 `。" #: ../../library/asyncio-api-index.rst:113 msgid "See also the :ref:`Queues documentation page `." -msgstr "請參閱\\ :ref:`佇列文件頁面 `\\ 。" +msgstr "請參閱\\ :ref:`佇列文件頁面 `。" #: ../../library/asyncio-api-index.rst:117 msgid "Subprocesses" @@ -279,7 +277,7 @@ msgstr "執行一個 shell 命令。" #: ../../library/asyncio-api-index.rst:134 msgid ":ref:`Executing a shell command `." -msgstr ":ref:`執行一個 shell 指令 `\\ 。" +msgstr ":ref:`執行一個 shell 指令 `。" #: ../../library/asyncio-api-index.rst:136 msgid "See also the :ref:`subprocess APIs ` documentation." diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index db76071648..32b9fd3ed4 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -295,9 +295,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:210 -#, fuzzy msgid "Added the *timeout* parameter." -msgstr "加入 *name* 參數。" +msgstr "加入 *timeout* 參數。" #: ../../library/asyncio-eventloop.rst:214 msgid "Scheduling callbacks" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 91920d52cb..51e65bad7b 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -71,15 +71,14 @@ msgid "" "not supported. The :data:`socket.AF_UNIX` socket family is specific to Unix." msgstr "" "不支援 :meth:`loop.create_unix_connection` 和 :meth:`loop.create_unix_server`" -"\\ 。\\ :data:`socket.AF_UNIX` socket 系列常數僅限於 Unix 上使用。" +"。:data:`socket.AF_UNIX` socket 系列常數僅限於 Unix 上使用。" #: ../../library/asyncio-platforms.rst:42 msgid "" ":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are " "not supported." msgstr "" -"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop.remove_signal_handler`" -"\\ 。" +"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop.remove_signal_handler`。" #: ../../library/asyncio-platforms.rst:45 msgid ":class:`SelectorEventLoop` has the following limitations:" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index b02d2a4542..6f15e30cfd 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1036,9 +1036,8 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:1086 -#, fuzzy msgid "Added the *eager_start* parameter." -msgstr "新增 *name* 參數。" +msgstr "新增 *eager_start* 參數。" #: ../../library/asyncio-task.rst:1091 msgid "Return ``True`` if the Task is *done*." diff --git a/library/bisect.po b/library/bisect.po index fc08789062..3a7c6828e5 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -32,7 +32,6 @@ msgid "**Source code:** :source:`Lib/bisect.py`" msgstr "**原始碼:**\\ :source:`Lib/bisect.py`" #: ../../library/bisect.rst:14 -#, fuzzy msgid "" "This module provides support for maintaining a list in sorted order without " "having to sort the list after each insertion. For long lists of items with " @@ -40,10 +39,7 @@ msgid "" "searches or frequent resorting." msgstr "" "這個模組維護一個已經排序過的 list ,當我們每次做完插入後不需要再次排序整個 " -"list 。一個很長的 list 的比較操作很花費時間,為了改進這點,這個模組是其中一個" -"常用的方法。這個模組被命名為 :mod:`bisect` 來自他使用一個基礎的 bisection 演" -"算法實作。模組的原始碼是這個演算法的一個完善的實作(邊界條件已經是正確的" -"了)。" +"list 。一個很長的 list 的比較操作很花費時間,可以透過線性搜索或頻繁地詢問來改善。" #: ../../library/bisect.rst:19 msgid "" diff --git a/library/collections.abc.po b/library/collections.abc.po index e8431a84dd..6916a80ebb 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -407,14 +407,12 @@ msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``\\ 、\\ ``__aiter__``\\ 、\\ ``__anext__``" #: ../../library/collections.abc.rst:180 -#, fuzzy msgid ":class:`Buffer` [1]_" -msgstr ":class:`Iterator` [1]_" +msgstr ":class:`Buffer` [1]_" #: ../../library/collections.abc.rst:180 -#, fuzzy msgid "``__buffer__``" -msgstr "``__iter__``" +msgstr "``__buffer__``" #: ../../library/collections.abc.rst:185 msgid "Footnotes" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 3ca98642bd..96d0398831 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -353,7 +353,6 @@ msgstr "" "或 :class:`Future` 方法將導致死鎖。" #: ../../library/concurrent.futures.rst:244 -#, fuzzy msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -372,9 +371,10 @@ msgstr "" "理器數量。如果 *max_workers* 小於或等於 ``0``,則會引發 :exc:`ValueError`。" "在 Windows 上,*max_workers* 必須小於或等於 ``61``。如果不是,則會引發 :exc:" "`ValueError`。如果 *max_workers* 為 ``None``,則預設選擇最多為 ``61``,即便有" -"更多處理器可用。*mp_context* 可以是 multiprocessing 情境 (context) 或 None。" -"它將用於啟動 worker。如果 *mp_context* 為 ``None`` 或未給定,則使用預設的 " -"multiprocessing 情境。" +"更多處理器可用。*mp_context* 可以是 :mod:`multiprocessing` 情境 (context) 或 " +"``None``。它將用於啟動 worker。如果 *mp_context* 為 ``None`` 或未給定,則使用" +"預設的 :mod:`multiprocessing` 情境。請見 :ref:`multiprocessing-start-" +"methods`。" #: ../../library/concurrent.futures.rst:258 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index 5a8a4bff37..d31368bc58 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -369,14 +369,12 @@ msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" #: ../../library/ctypes.rst:251 -#, fuzzy msgid ":class:`c_time_t`" -msgstr ":class:`c_size_t`" +msgstr ":class:`c_time_t`" #: ../../library/ctypes.rst:251 -#, fuzzy msgid ":c:type:`time_t`" -msgstr ":c:expr:`size_t`" +msgstr ":c:type:`time_t`" #: ../../library/ctypes.rst:253 msgid ":class:`c_float`" @@ -1688,7 +1686,7 @@ msgid "" "argument ``code``." msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." -"seh_exception``。" +"set_exception``。" #: ../../library/ctypes.rst:1686 msgid "" diff --git a/library/datatypes.po b/library/datatypes.po index 61e7343e8d..eaab1664b9 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -39,10 +39,10 @@ msgid "" "`tuple`. The :class:`str` class is used to hold Unicode strings, and the :" "class:`bytes` and :class:`bytearray` classes are used to hold binary data." msgstr "" -"Python 也有提供一些內建資料型別,特別是 :class:`dict`\\ 、\\ :class:`list`" -"\\ 、\\ :class:`set` 與 :class:`frozenset` 和 :class:`tuple`\\ 。\\ :class:" -"`str` 類別是用來儲存 Unicode 字串,\\ :class:`bytes` 與 :class:`bytearray` 類" -"別則是用來儲存二進位制資料。" +"Python 也有提供一些內建資料型別,特別是 :class:`dict`、:class:`list`、:class:" +"`set` 與 :class:`frozenset` 和 :class:`tuple`。:class:`str` 類別是用來儲存 " +"Unicode 字串,:class:`bytes` 與 :class:`bytearray` 類別則是用來儲存二進位制資" +"料。" #: ../../library/datatypes.rst:17 msgid "The following modules are documented in this chapter:" diff --git a/library/difflib.po b/library/difflib.po index 629dda4d93..4ee18be3a6 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -815,10 +815,9 @@ msgid "" msgstr "" #: ../../library/difflib.rst:762 -#, fuzzy msgid "ndiff example" msgstr "" -"舉例來說:\n" +"ndiff 範例:\n" "\n" "::" diff --git a/library/functions.po b/library/functions.po index 21e436efee..50beda7161 100644 --- a/library/functions.po +++ b/library/functions.po @@ -488,7 +488,6 @@ msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" #: ../../library/functions.rst:145 -#, fuzzy msgid "" "Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " "using the standard :ref:`truth testing procedure `. If *x* is false " @@ -501,7 +500,7 @@ msgstr "" "序 `\\ 來轉換。如果 *x* 為假或者被省略,則回傳 ``False``;其他情況回" "傳 ``True``。:class:`bool` class(類別)是 :class:`int` 的 subclass(子類別)" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " -"``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" +"``True`` 兩個實例(參見 :ref:`typebool`)。" #: ../../library/functions.rst:154 ../../library/functions.rst:707 #: ../../library/functions.rst:931 diff --git a/library/gc.po b/library/gc.po index 8eb1ff9977..242d2e7b9a 100644 --- a/library/gc.po +++ b/library/gc.po @@ -365,12 +365,11 @@ msgstr "" "`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" #: ../../library/gc.rst:261 -#, fuzzy msgid "" "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " "end up in :attr:`gc.garbage` anymore." msgstr "" -"根據 :pep:`442`,帶有 :meth:`__del__` method 的物件最終不會在 :attr:`gc." +"根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會在 :attr:`gc." "garbage` 內。" #: ../../library/gc.rst:267 diff --git a/library/glob.po b/library/glob.po index 6872a85521..dda5fff76b 100644 --- a/library/glob.po +++ b/library/glob.po @@ -65,7 +65,6 @@ msgid "The :mod:`pathlib` module offers high-level path objects." msgstr ":mod:`pathlib` 模組提供高階路徑物件。" #: ../../library/glob.rst:45 -#, fuzzy 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 " diff --git a/library/html.entities.po b/library/html.entities.po index 274b4ed24c..5faa406fb2 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -57,14 +57,12 @@ msgid "" msgstr "將 XHTML 1.0 實體定義對映到 ISO Latin-1 中的替換文字的字典。" #: ../../library/html.entities.rst:37 -#, fuzzy msgid "A dictionary that maps HTML4 entity names to the Unicode code points." -msgstr "將 HTML 實體名稱對映到 Unicode 程式點的字典。" +msgstr "將 HTML4 實體名稱對映到 Unicode 程式點的字典。" #: ../../library/html.entities.rst:42 -#, fuzzy msgid "A dictionary that maps Unicode code points to HTML4 entity names." -msgstr "將 Unicode 程式點對映到 HTML 實體名稱的字典。" +msgstr "將 Unicode 程式點對映到 HTML4 實體名稱的字典。" #: ../../library/html.entities.rst:46 msgid "Footnotes" diff --git a/library/http.po b/library/http.po index 6172215b0f..c66ae81224 100644 --- a/library/http.po +++ b/library/http.po @@ -875,9 +875,8 @@ msgstr "" "新增 ``103 EARLY_HINTS``、``418 IM_A_TEAPOT`` 與 ``425 TOO_EARLY`` 狀態碼。" #: ../../library/http.rst:141 -#, fuzzy msgid "HTTP status category" -msgstr "HTTP 狀態碼" +msgstr "HTTP 狀態分類" #: ../../library/http.rst:145 msgid "" @@ -894,50 +893,49 @@ msgstr "" #: ../../library/http.rst:150 msgid "``is_informational``" -msgstr "" +msgstr "``is_informational``" #: ../../library/http.rst:150 msgid "``100 <= status <= 199``" -msgstr "" +msgstr "``100 <= status <= 199``" #: ../../library/http.rst:150 ../../library/http.rst:151 #: ../../library/http.rst:152 ../../library/http.rst:153 #: ../../library/http.rst:154 -#, fuzzy msgid "HTTP/1.1 :rfc:`7231`, Section 6" -msgstr "HTTP/1.1 :rfc:`7231`,6.2.1 節" +msgstr "HTTP/1.1 :rfc:`7231`,6 節" #: ../../library/http.rst:151 msgid "``is_success``" -msgstr "" +msgstr "``is_success``" #: ../../library/http.rst:151 msgid "``200 <= status <= 299``" -msgstr "" +msgstr "``200 <= status <= 299``" #: ../../library/http.rst:152 msgid "``is_redirection``" -msgstr "" +msgstr "``is_redirection``" #: ../../library/http.rst:152 msgid "``300 <= status <= 399``" -msgstr "" +msgstr "``300 <= status <= 399``" #: ../../library/http.rst:153 msgid "``is_client_error``" -msgstr "" +msgstr "``is_client_error``" #: ../../library/http.rst:153 msgid "``400 <= status <= 499``" -msgstr "" +msgstr "``400 <= status <= 499``" #: ../../library/http.rst:154 msgid "``is_server_error``" -msgstr "" +msgstr "``is_server_error``" #: ../../library/http.rst:154 msgid "``500 <= status <= 599``" -msgstr "" +msgstr "``500 <= status <= 599``" #: ../../library/http.rst:169 msgid "" diff --git a/library/itertools.po b/library/itertools.po index 37ae914ae3..4396d28134 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -145,23 +145,20 @@ msgid "``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``" msgstr "``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``" #: ../../library/itertools.rst:55 -#, fuzzy msgid ":func:`batched`" -msgstr ":func:`tee`" +msgstr ":func:`batched`" #: ../../library/itertools.rst:55 msgid "p, n" -msgstr "" +msgstr "p, n" #: ../../library/itertools.rst:55 -#, fuzzy msgid "(p0, p1, ..., p_n-1), ..." -msgstr "p0, p1, ... plast, p0, p1, ..." +msgstr "(p0, p1, ..., p_n-1), ..." #: ../../library/itertools.rst:55 -#, fuzzy msgid "``batched('ABCDEFG', n=3) --> ABC DEF G``" -msgstr "``islice('ABCDEFG', 2, None) --> C D E F G``" +msgstr "``batched('ABCDEFG', n=3) --> ABC DEF G``" #: ../../library/itertools.rst:56 msgid ":func:`chain`" diff --git a/library/logging.po b/library/logging.po index e990978301..15c1c8ef49 100644 --- a/library/logging.po +++ b/library/logging.po @@ -758,17 +758,14 @@ msgid "" msgstr "" #: ../../library/logging.rst:600 -#, fuzzy msgid "The *style* parameter." msgstr "新增 *style* 參數。" #: ../../library/logging.rst:603 -#, fuzzy msgid "The *validate* parameter." -msgstr "新增 *style* 參數。" +msgstr "新增 *validate* 參數。" #: ../../library/logging.rst:606 -#, fuzzy msgid "The *defaults* parameter." msgstr "新增 *defaults* 參數。" @@ -1384,12 +1381,11 @@ msgstr "" #: ../../library/logging.rst:969 msgid "taskName" -msgstr "" +msgstr "taskName" #: ../../library/logging.rst:969 -#, fuzzy msgid "``%(taskName)s``" -msgstr "``%(threadName)s``" +msgstr "``%(taskName)s``" #: ../../library/logging.rst:969 msgid ":class:`asyncio.Task` name (if available)." @@ -1397,12 +1393,11 @@ msgstr "" #: ../../library/logging.rst:972 msgid "*processName* was added." -msgstr "新增 *processName*\\ 。" +msgstr "新增 *processName*。" #: ../../library/logging.rst:975 -#, fuzzy msgid "*taskName* was added." -msgstr "新增 *processName*\\ 。" +msgstr "新增 *taskName*。" #: ../../library/logging.rst:981 msgid "LoggerAdapter Objects" diff --git a/library/mmap.po b/library/mmap.po index 179cd060fe..e878e0e577 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -377,7 +377,7 @@ msgstr "" #: ../../library/mmap.rst:363 msgid "MAP_* Constants" -msgstr "" +msgstr "MAP_* 常數" #: ../../library/mmap.rst:376 msgid "" @@ -388,16 +388,14 @@ msgid "" msgstr "" #: ../../library/mmap.rst:380 -#, fuzzy msgid "Added :data:`MAP_POPULATE` constant." -msgstr "新增 MAP_POPULATE 常數。" +msgstr "新增 :data:`MAP_POPULATE` 常數。" #: ../../library/mmap.rst:383 -#, fuzzy msgid "Added :data:`MAP_STACK` constant." -msgstr "新增 MAP_STACK 常數。" +msgstr "新增 :data:`MAP_STACK` 常數。" #: ../../library/mmap.rst:386 msgid "" "Added :data:`MAP_ALIGNED_SUPER` constant. Added :data:`MAP_CONCEAL` constant." -msgstr "" +msgstr "新增 :data:`MAP_ALIGNED_SUPER` 常數。新增 :data:`MAP_CONCEAL` 常數。" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index fc7a36f63d..c7fc0d09f7 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -1227,9 +1227,8 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1127 -#, fuzzy msgid "See :ref:`multiprocessing-start-methods`." -msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" +msgstr "參閱 :ref:`multiprocessing-start-methods`。" #: ../../library/multiprocessing.rst:1133 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 29ef017d63..3eb9ac075c 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -371,9 +371,8 @@ msgid "" msgstr "" #: ../../library/os.path.rst:320 -#, fuzzy msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Unix、Windows。" +msgstr ":ref:`適用 `:Windows。" #: ../../library/os.path.rst:327 msgid "" diff --git a/library/os.po b/library/os.po index 4bf42a0cc5..94495b80c0 100644 --- a/library/os.po +++ b/library/os.po @@ -636,9 +636,8 @@ msgid "" msgstr "" #: ../../library/os.rst:503 -#, fuzzy msgid ":ref:`Availability `: macOS" -msgstr ":ref:`適用 `:Unix。" +msgstr ":ref:`適用 `:macOS" #: ../../library/os.rst:509 msgid "" @@ -765,14 +764,12 @@ msgid "" msgstr "" #: ../../library/os.rst:639 -#, fuzzy msgid ":ref:`Availability `: Linux >= 3.0 with glibc >= 2.14." -msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" +msgstr ":ref:`適用 `:Linux 3.0 以上且具有 glibc 2.14 以上。" #: ../../library/os.rst:645 -#, fuzzy msgid "The :func:`~os.unshare` function." -msgstr ":func:`fstat` 和 :func:`lstat` 函式。" +msgstr ":func:`~os.unshare` 函式。" #: ../../library/os.rst:649 msgid "" @@ -934,14 +931,12 @@ msgid "" msgstr "" #: ../../library/os.rst:826 -#, fuzzy msgid ":ref:`Availability `: Linux >= 2.6.16." -msgstr ":ref:`適用 `:Linux 4.16 以上。" +msgstr ":ref:`適用 `:Linux 2.6.16 以上。" #: ../../library/os.rst:832 -#, fuzzy msgid "The :func:`~os.setns` function." -msgstr ":func:`fstat` 和 :func:`lstat` 函式。" +msgstr ":func:`~os.setns` 函式。" #: ../../library/os.rst:836 msgid "" @@ -1260,7 +1255,7 @@ msgstr "" #: ../../library/os.rst:1119 ../../library/os.rst:1597 #, fuzzy msgid "Added support for pipes on Windows." -msgstr "新增對 Windows 的支援。" +msgstr "新增對 Windows 上 pipe 的支援。" #: ../../library/os.rst:1124 msgid "" @@ -2425,15 +2420,13 @@ msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" #: ../../library/os.rst:2214 -#, fuzzy msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." -msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" #: ../../library/os.rst:2216 ../../library/os.rst:2240 #: ../../library/os.rst:2260 -#, fuzzy msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" @@ -2463,12 +2456,11 @@ msgid "" msgstr "" #: ../../library/os.rst:2238 -#, fuzzy msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." msgstr "" -"引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" +"引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os.listmounts``。" #: ../../library/os.rst:2247 msgid "Return a list containing the volumes in the system." @@ -2488,11 +2480,10 @@ msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" #: ../../library/os.rst:2258 -#, fuzzy msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." -msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" #: ../../library/os.rst:2267 msgid "" @@ -4559,9 +4550,8 @@ msgid "" msgstr "" #: ../../library/os.rst:4210 -#, fuzzy msgid ":ref:`Availability `: Linux >= 5.10" -msgstr ":ref:`適用 `:Linux 5.3 以上" +msgstr ":ref:`適用 `:Linux 5.10 以上" #: ../../library/os.rst:4216 msgid "" diff --git a/library/pathlib.po b/library/pathlib.po index 42da18f10d..7b2a70be88 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -124,16 +124,15 @@ msgstr "" "::" #: ../../library/pathlib.rst:108 -#, fuzzy msgid "" "Each element of *pathsegments* can be either a string representing a path " "segment, or an object implementing the :class:`os.PathLike` interface where " "the :meth:`~os.PathLike.__fspath__` method returns a string, such as another " "path object::" msgstr "" -"*pathsegments* 中的每個元素可以是以下三種的其中一種:一個表示路徑片段的字串、" -"實作了 :class:`os.PathLike` 介面 (interface) 並回傳字串的物件,或者另一個路徑" -"物件:\n" +"*pathsegments* 中的每個元素可以是以下的其中一種:一個表示路徑片段的字串或實作" +"了 :class:`os.PathLike` 介面 (interface) 且 :meth:`~os.PathLike.__fspath__` " +"方法會回傳字串的物件,像是另一個路徑物件:\n" "\n" "::" @@ -487,9 +486,8 @@ msgstr "" #: ../../library/pathlib.rst:588 ../../library/pathlib.rst:931 #: ../../library/pathlib.rst:1344 -#, fuzzy msgid "The *case_sensitive* parameter was added." -msgstr "新增 *newline* 參數。" +msgstr "新增 *case_sensitive* 參數。" #: ../../library/pathlib.rst:594 msgid "" @@ -1084,19 +1082,18 @@ msgstr "" "`RuntimeError`。" #: ../../library/pathlib.rst:1317 -#, fuzzy msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." -msgstr "*strict* 引數(在 3.6 版本之前的行為是嚴格的)。" +msgstr "新增 *strict* 參數(在 3.6 版本之前的行為是嚴格的)。" #: ../../library/pathlib.rst:1322 -#, fuzzy msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" "`Path.glob` with \"``**/``\" added in front of the *pattern*, where " "*patterns* are the same as for :mod:`fnmatch`::" msgstr "" -"這相當於在給定的相對 *pattern* 前面加上 \"``**/``\" 並呼叫 :func:`Path.glob` " -":\n" +"遞迴地 glob 給定的相對 *pattern*。這相當於在給定的相對 *pattern* 前面加上 " +"\"``**/``\" 並呼叫 :func:`Path.glob`,其中 *patterns* 和 :mod:`fnmatch` 相" +"同:\n" "\n" "::" @@ -1333,14 +1330,12 @@ msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" #: ../../library/pathlib.rst:1495 -#, fuzzy msgid ":func:`os.walk`" -msgstr ":func:`os.link`" +msgstr ":func:`os.walk`" #: ../../library/pathlib.rst:1495 -#, fuzzy msgid ":meth:`Path.walk`" -msgstr ":meth:`Path.readlink`" +msgstr ":meth:`Path.walk`" #: ../../library/pathlib.rst:1496 msgid ":func:`os.path.isdir`" diff --git a/library/random.po b/library/random.po index 0548a889f0..e31aec713a 100644 --- a/library/random.po +++ b/library/random.po @@ -256,14 +256,13 @@ msgstr "" "``int(random()*n)`` 這樣的樣式,這可能會產生稍微不均勻的分佈。" #: ../../library/random.rst:142 -#, fuzzy msgid "" "Automatic conversion of non-integer types is no longer supported. Calls such " "as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` now raise a :exc:" "`TypeError`." msgstr "" -"非整數類型到等效整數的自動轉換已被棄用。目前 ``randrange(10.0)`` 被無損轉換" -"為 ``randrange(10)``。將來,這將會引發 :exc:`TypeError`。" +"已經不再支援非整數類型到等效整數的自動轉換。像是 ``randrange(10.0)`` 和 " +"``randrange(Fraction(10, 1))`` 的呼叫將會引發 :exc:`TypeError`。" #: ../../library/random.rst:149 msgid "" @@ -273,14 +272,13 @@ msgstr "" "回傳一個隨機整數 *N*,使得 ``a <= N <= b``。為 ``randrange(a, b+1)`` 的別名。" #: ../../library/random.rst:154 -#, fuzzy msgid "" "Returns a non-negative Python integer with *k* random bits. This method is " "supplied with the Mersenne Twister generator and some other generators may " "also provide it as an optional part of the API. When available, :meth:" "`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." msgstr "" -"回傳一個具有 *k* 個隨機位元的非負 Python 整數。此方法會隨 MersenneTwister 產" +"回傳一個具有 *k* 個隨機位元的非負 Python 整數。此方法會隨 Mersenne Twister 產" "生器一起提供,一些其他的產生器也可能將其作為 API 的可選部分。如果可用,\\ :" "meth:`getrandbits` 使 :meth:`randrange` 能夠處理任意大的範圍。" @@ -460,9 +458,8 @@ msgid "" msgstr "" #: ../../library/random.rst:262 -#, fuzzy msgid "Discrete distributions" -msgstr "實數分布" +msgstr "離散分布" #: ../../library/random.rst:264 msgid "The following function generates a discrete distribution." @@ -647,14 +644,14 @@ msgid "" msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" #: ../../library/random.rst:413 -#, fuzzy msgid "" "Formerly the *seed* could be any hashable object. Now it is limited to: :" "class:`NoneType`, :class:`int`, :class:`float`, :class:`str`, :class:" "`bytes`, or :class:`bytearray`." msgstr "" -"將來,*seed* 必須是以下類型之一:\\ :class:`NoneType`、\\ :class:`int`、\\ :" -"class:`float`、\\ :class:`str`、\\ :class:`bytes`、\\ :class:`bytearray`。" +"過去 *seed* 可以是任何可雜湊物件,但現在必須是以下類型之一::class:" +"`NoneType`、:class:`int`、:class:`float`、:class:`str`、:class:`bytes`、:" +"class:`bytearray`。" #: ../../library/random.rst:417 msgid "" @@ -675,7 +672,6 @@ msgid "Notes on Reproducibility" msgstr "關於 Reproducibility(復現性)的注意事項" #: ../../library/random.rst:428 -#, fuzzy msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By reusing a seed value, the same sequence " diff --git a/library/shutil.po b/library/shutil.po index d1753885a3..e301d81fec 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -851,9 +851,8 @@ msgid "" msgstr "" #: ../../library/shutil.rst:656 -#, fuzzy msgid "Added support for functions supporting the *root_dir* argument." -msgstr "新增 *xztar* 格式的支援。" +msgstr "" #: ../../library/shutil.rst:662 msgid "Remove the archive format *name* from the list of supported formats." diff --git a/library/smtplib.po b/library/smtplib.po index f9325a440f..8fcff80c21 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -100,7 +100,6 @@ msgid "Support for the :keyword:`with` statement was added." msgstr "" #: ../../library/smtplib.rst:68 -#, fuzzy msgid "*source_address* argument was added." msgstr "新增 source_address 引數。" diff --git a/library/socket.po b/library/socket.po index cdd5b762ce..32080a3577 100644 --- a/library/socket.po +++ b/library/socket.po @@ -724,9 +724,8 @@ msgid "" msgstr "" #: ../../library/socket.rst:519 -#, fuzzy msgid ":ref:`Availability `: FreeBSD >= 14.0." -msgstr ":ref:`適用 `:FreeBSD。" +msgstr ":ref:`適用 `:FreeBSD >= 14.0。" #: ../../library/socket.rst:536 msgid "" @@ -740,9 +739,8 @@ msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" #: ../../library/socket.rst:542 -#, fuzzy msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Unix。" +msgstr ":ref:`適用 `:Linux。" #: ../../library/socket.rst:555 msgid ":ref:`Availability `: Linux >= 2.6.30." @@ -841,9 +839,8 @@ msgid "" msgstr "" #: ../../library/socket.rst:688 -#, fuzzy msgid ":ref:`Availability `: Linux, FreeBSD, macOS." -msgstr ":ref:`適用 `:BSD、macOS。" +msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" #: ../../library/socket.rst:694 msgid "Functions" diff --git a/library/sqlite3.po b/library/sqlite3.po index ae3be07066..19605a7de7 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -376,9 +376,8 @@ msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "``sqlite3.connect/handle`` 稽核事件。" #: ../../library/sqlite3.rst:355 -#, fuzzy msgid "The *autocommit* parameter." -msgstr "*uri* 參數。" +msgstr "*autocommit* 參數。" #: ../../library/sqlite3.rst:360 msgid "" @@ -1107,9 +1106,8 @@ msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" #: ../../library/sqlite3.rst:1104 -#, fuzzy msgid "The *entrypoint* parameter." -msgstr "*uri* 參數。" +msgstr "*entrypoint* 參數。" #: ../../library/sqlite3.rst:1111 msgid "" diff --git a/library/ssl.po b/library/ssl.po index ee63453ce8..acd59996bb 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -1294,9 +1294,8 @@ msgid "" msgstr "" #: ../../library/ssl.rst:1199 -#, fuzzy msgid "See also :attr:`SSLContext.check_hostname`." -msgstr ":attr:`~SSLSocket.server_hostname`" +msgstr "請見 :attr:`SSLContext.check_hostname`。" #: ../../library/ssl.rst:1201 msgid "" diff --git a/library/statistics.po b/library/statistics.po index fb538a9623..4a8f381aa4 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -242,9 +242,8 @@ msgid ":func:`correlation`" msgstr ":func:`correlation`" #: ../../library/statistics.rst:107 -#, fuzzy msgid "Pearson and Spearman's correlation coefficients." -msgstr "兩個變數之間的 Pearson 相關係數 (correlation coefficient)。" +msgstr "Pearson 與 Spearman 相關係數 (correlation coefficient)。" #: ../../library/statistics.rst:108 msgid ":func:`linear_regression`" @@ -903,7 +902,6 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),否則會引發 :exc:`StatisticsError`。" #: ../../library/statistics.rst:653 -#, fuzzy msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " @@ -912,8 +910,7 @@ msgid "" msgstr "" "回傳兩輸入的 `Pearson 相關係數 (Pearson’s correlation coefficient) `_。Pearson 相關係數 " -"*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向,其中 +1 表示強烈正線" -"性相關,-1 表示強烈負線性相關,而 0 表示無線性關係。" +"*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向。" #: ../../library/statistics.rst:659 msgid "" diff --git a/library/sys.po b/library/sys.po index 15b42fde6f..759c971643 100644 --- a/library/sys.po +++ b/library/sys.po @@ -1228,13 +1228,11 @@ msgid "" msgstr "" #: ../../library/sys.rst:830 -#, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" -"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." -"_getframe``。" +"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys._getframemodulename``。" #: ../../library/sys.rst:844 msgid "Get the profiler function as set by :func:`setprofile`." @@ -2296,9 +2294,8 @@ msgstr "" #: ../../library/sys.rst:1604 ../../library/sys.rst:1619 #: ../../library/sys.rst:1627 -#, fuzzy msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Unix。" +msgstr ":ref:`適用 `:Linux。" #: ../../library/sys.rst:1610 msgid ":ref:`perf_profiling`" diff --git a/library/tempfile.po b/library/tempfile.po index 9c597c23a3..98895343da 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -254,9 +254,8 @@ msgid "" msgstr "" #: ../../library/tempfile.rst:142 -#, fuzzy msgid "Added *delete_on_close* parameter." -msgstr "新增 *errors* 參數。" +msgstr "新增 *delete_on_close* 參數。" #: ../../library/tempfile.rst:148 msgid "" @@ -364,9 +363,8 @@ msgid "Added *ignore_cleanup_errors* parameter." msgstr "新增 *ignore_cleanup_errors* 參數。" #: ../../library/tempfile.rst:211 -#, fuzzy msgid "Added the *delete* parameter." -msgstr "新增 *errors* 參數。" +msgstr "新增 *delete* 參數。" #: ../../library/tempfile.rst:217 msgid "" diff --git a/library/test.po b/library/test.po index 6985003524..24a9bf0e68 100644 --- a/library/test.po +++ b/library/test.po @@ -485,18 +485,16 @@ msgid "" msgstr "" #: ../../library/test.rst:423 -#, fuzzy msgid "Example::" msgstr "" -"用法範例:\n" +"範例:\n" "\n" "::" #: ../../library/test.rst:429 ../../library/test.rst:453 -#, fuzzy msgid "Example of error=False usage::" msgstr "" -"用法範例:\n" +"error=False 用法範例:\n" "\n" "::" diff --git a/library/turtle.po b/library/turtle.po index 4e18c0b85c..7b0876294a 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -194,9 +194,8 @@ msgid ":func:`goto` | :func:`setpos` | :func:`setposition`" msgstr ":func:`goto` | :func:`setpos` | :func:`setposition`" #: ../../library/turtle.rst:0 -#, fuzzy msgid ":func:`teleport`" -msgstr ":func:`tilt`" +msgstr ":func:`teleport`" #: ../../library/turtle.rst:0 msgid ":func:`setx`" diff --git a/library/typing.po b/library/typing.po index 06f09f068e..2b3e1dd02c 100644 --- a/library/typing.po +++ b/library/typing.po @@ -275,9 +275,8 @@ msgid ":pep:`698`: Adding an override decorator to typing" msgstr "" #: ../../library/typing.rst:119 -#, fuzzy msgid "*Introducing* the :func:`@override` decorator" -msgstr "*引入* :func:`@dataclass_transform` 裝飾器" +msgstr "*引入* :func:`@override` 裝飾器" #: ../../library/typing.rst:129 msgid "Type aliases" diff --git a/library/unicodedata.po b/library/unicodedata.po index 02e972c55f..227024a10a 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -188,14 +188,12 @@ msgid "Footnotes" msgstr "註解" #: ../../library/unicodedata.rst:178 -#, fuzzy msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" -msgstr "https://www.unicode.org/Public/14.0.0/ucd/NameAliases.txt" +msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" #: ../../library/unicodedata.rst:180 -#, fuzzy msgid "https://www.unicode.org/Public/15.0.0/ucd/NamedSequences.txt" -msgstr "https://www.unicode.org/Public/14.0.0/ucd/NamedSequences.txt" +msgstr "https://www.unicode.org/Public/15.0.0/ucd/NamedSequences.txt" #: ../../library/unicodedata.rst:11 msgid "Unicode" diff --git a/library/unittest.po b/library/unittest.po index 96d1a30188..1f7b2335f3 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -423,16 +423,15 @@ msgstr "增加命令列模式選項 ``-b`` 、 ``-c`` 與 ``-f``\\ 。" #: ../../library/unittest.rst:254 msgid "The command-line option ``--locals``." -msgstr "命令列選項 ``--locals``\\ 。" +msgstr "命令列選項 ``--locals``。" #: ../../library/unittest.rst:257 msgid "The command-line option ``-k``." -msgstr "命令列選項 ``-k``\\ 。" +msgstr "命令列選項 ``-k``。" #: ../../library/unittest.rst:260 -#, fuzzy msgid "The command-line option ``--durations``." -msgstr "命令列選項 ``--locals``\\ 。" +msgstr "命令列選項 ``--durations``。" #: ../../library/unittest.rst:263 msgid "" @@ -2651,9 +2650,8 @@ msgid "" msgstr "" #: ../../library/unittest.rst:2220 -#, fuzzy msgid "Added the *warnings* parameter." -msgstr "新增 ``warnings`` 引數。" +msgstr "新增 *warnings* 參數。" #: ../../library/unittest.rst:2223 msgid "" @@ -2662,14 +2660,12 @@ msgid "" msgstr "" #: ../../library/unittest.rst:2227 -#, fuzzy msgid "Added the *tb_locals* parameter." -msgstr "新增 tb_locals 參數。" +msgstr "新增 *tb_locals* 參數。" #: ../../library/unittest.rst:2230 -#, fuzzy msgid "Added the *durations* parameter." -msgstr "新增 tb_locals 參數。" +msgstr "新增 *durations* 參數。" #: ../../library/unittest.rst:2235 msgid "" diff --git a/library/urllib.error.po b/library/urllib.error.po index 262e027a29..097090d175 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -90,18 +90,18 @@ msgstr "" "server.BaseHTTPRequestHandler.responses` 程式碼 dictionary 中的某個值。" #: ../../library/urllib.error.rst:55 -#, fuzzy msgid "" "This is usually a string explaining the reason for this error. An alias for " "*msg* attribute." -msgstr "這通常是一個解釋本次錯誤原因的字串。" +msgstr "這通常是一個解釋本次錯誤原因的字串。為 *msg* 屬性的別名。" #: ../../library/urllib.error.rst:60 -#, fuzzy msgid "" "The HTTP response headers for the HTTP request that caused the :exc:" "`HTTPError`. An alias for *hdrs* attribute." -msgstr "導致 :exc:`HTTPError` 的特定 HTTP 請求的 HTTP 回應 header。" +msgstr "" +"導致 :exc:`HTTPError` 的特定 HTTP 請求的 HTTP 回應 header。" +"為 *hdrs* 屬性的別名。" #: ../../library/urllib.error.rst:68 msgid "A file-like object where the HTTP error body can be read from." diff --git a/library/webbrowser.po b/library/webbrowser.po index 014f0591bc..4541f6e629 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -194,9 +194,8 @@ msgid "``'epiphany'``" msgstr "``'epiphany'``" #: ../../library/webbrowser.rst:118 -#, fuzzy msgid ":class:`Epiphany('epiphany')`" -msgstr ":class:`Galeon('epiphany')`" +msgstr ":class:`Epiphany('epiphany')`" #: ../../library/webbrowser.rst:120 msgid "``'kfmclient'``" diff --git a/library/zipfile.po b/library/zipfile.po index a880489ce4..bfb41a5272 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -23,9 +23,8 @@ msgid ":mod:`zipfile` --- Work with ZIP archives" msgstr "" #: ../../library/zipfile.rst:10 -#, fuzzy msgid "**Source code:** :source:`Lib/zipfile/`" -msgstr "**原始碼:**\\ :source:`Lib/zipfile.py`" +msgstr "**原始碼:**\\ :source:`Lib/zipfile/`" #: ../../library/zipfile.rst:14 msgid "" From 89b0fe8361bb478489fb2209f380d008f1f387b9 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 02:34:39 +0800 Subject: [PATCH 008/105] fix: resolve fuzzy entries in tutorial --- tutorial/appendix.po | 8 +-- tutorial/classes.po | 8 +-- tutorial/datastructures.po | 8 +-- tutorial/floatingpoint.po | 101 +++++++------------------------------ tutorial/interpreter.po | 6 +-- tutorial/introduction.po | 3 +- tutorial/stdlib.po | 4 +- tutorial/stdlib2.po | 13 ++--- tutorial/venv.po | 4 +- 9 files changed, 42 insertions(+), 113 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index e05151dce8..b25bb10d20 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -89,8 +89,8 @@ msgid "" msgstr "" "(假設直譯器在用戶的 :envvar:`PATH` 上)在腳本的開頭並給檔案一個可執行模式。 " "``#!`` 必須是檔案的前兩個字元。 在某些平台上,第一行必須以 Unix 樣式的換行 " -"(``'\\n'``) 結尾,而不是 Windows (``'\\r\\n'``) 換行。 請注意,井號 " -"``'#'`` 用於在 Python 中開始註解。" +"(``'\\n'``) 結尾,而不是 Windows (``'\\r\\n'``) 換行。 請注意,井號 ``'#'`` " +"用於在 Python 中開始註解。" #: ../../tutorial/appendix.rst:52 msgid "" @@ -193,8 +193,8 @@ msgid "" "`site` module for more details." msgstr "" ":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" -"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :mod:" -"`site` 模組的文件。" +"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :" +"mod:`site` 模組的文件。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" diff --git a/tutorial/classes.po b/tutorial/classes.po index 347741b58a..b2487415b4 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -852,16 +852,16 @@ msgstr "" "::" #: ../../tutorial/classes.rst:584 -#, fuzzy msgid "" "The name :class:`BaseClassName` must be defined in a namespace accessible " "from the scope containing the derived class definition. In place of a base " "class name, other arbitrary expressions are also allowed. This can be " "useful, for example, when the base class is defined in another module::" msgstr "" -"名稱 :class:`BaseClassName` 被定義的作用域必須是包含 derived class 定義的作用" -"域。要代替 base class(基底類別)的名稱,用其他任意的運算式也是被允許的。這會" -"很有用,例如,當一個 base class 是在另一個模組中被定義時:\n" +"名稱 :class:`BaseClassName` 必須被定義於作用域可及的命名空間,且該作用域要包" +"含 derived class 定義。要代替 base class(基底類別)的名稱,用其他任意的運算" +"式也是被允許的。這會很有用,例如,當一個 base class 是在另一個模組中被定義" +"時:\n" "\n" "::" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index a714c72387..c113aae99c 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -532,8 +532,8 @@ msgid "" "Similarly to :ref:`list comprehensions `, set comprehensions " "are also supported::" msgstr "" -"和 :ref:`list comprehensions ` 類似,也有 set " -"comprehensions(集合綜合運算):\n" +"和 :ref:`list comprehensions ` 類似,也有 set comprehensions" +"(集合綜合運算):\n" "\n" "::" @@ -839,8 +839,8 @@ msgid "" "Other languages may return the mutated object, which allows method chaining, " "such as ``d->insert(\"a\")->remove(\"b\")->sort();``." msgstr "" -"其他語言可以回傳變更後的物件,這就允許 method 的串連,例如 ``d->insert(\"a" -"\")->remove(\"b\")->sort();``\\ 。" +"其他語言可以回傳變更後的物件,這就允許 method 的串連,例如 ``d-" +">insert(\"a\")->remove(\"b\")->sort();``\\ 。" #~ msgid "" #~ "Calling ``d.keys()`` will return a :dfn:`dictionary view` object. It " diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 0c6a8ef783..f4cb77185a 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -28,7 +28,6 @@ msgid "Floating Point Arithmetic: Issues and Limitations" msgstr "浮點數運算:問題與限制" #: ../../tutorial/floatingpoint.rst:16 -#, fuzzy msgid "" "Floating-point numbers are represented in computer hardware as base 2 " "(binary) fractions. For example, the **decimal** fraction ``0.625`` has " @@ -38,8 +37,8 @@ msgid "" "fractional notation, and the second in base 2." msgstr "" "在計算機架構中,浮點數 (floating-point number) 是以基數為 2(二進位)的小數表" -"示。例如說,在\\ **十進位**\\ 小數中 ``0.125`` 可被分為 1/10 + 2/100 + " -"5/1000,同樣的道理,\\ **二進位**\\ 小數 ``0.001`` 可被分為 0/2 + 0/4 + 1/8。" +"示。例如說,在\\ **十進位**\\ 小數中 ``0.625`` 可被分為 6/10 + 2/100 + " +"5/1000,同樣的道理,\\ **二進位**\\ 小數 ``0.101`` 可被分為 1/2 + 0/4 + 1/8。" "這兩個小數有相同的數值,而唯一真正的不同在於前者以十進位表示,後者以二進位表" "示。" @@ -105,7 +104,6 @@ msgstr "" "55``,而這樣的表示十分地接近,但不完全等同於 1/10 的真正數值。" #: ../../tutorial/floatingpoint.rst:58 -#, fuzzy msgid "" "Many users are not aware of the approximation because of the way values are " "displayed. Python only prints a decimal approximation to the true decimal " @@ -121,15 +119,12 @@ msgstr "" "::" #: ../../tutorial/floatingpoint.rst:67 -#, fuzzy msgid "" "That is more digits than most people find useful, so Python keeps the number " "of digits manageable by displaying a rounded value instead:" msgstr "" "這比一般人感到有用的位數還多,所以 Python 將位數保持在可以接受的範圍,只顯示" -"捨入後的數值:\n" -"\n" -"::" +"捨入後的數值:" #: ../../tutorial/floatingpoint.rst:75 msgid "" @@ -180,15 +175,12 @@ msgstr "" "都不會顯示。)" #: ../../tutorial/floatingpoint.rst:97 -#, fuzzy msgid "" "For more pleasant output, you may wish to use string formatting to produce a " "limited number of significant digits:" msgstr "" "為求更優雅的輸出,你可能想要使用字串的格式化 (string formatting) 產生限定的有" -"效位數:\n" -"\n" -"::" +"效位數:" #: ../../tutorial/floatingpoint.rst:111 msgid "" @@ -199,36 +191,28 @@ msgstr "" "正機器數值所\\ *展示的值*\\ 。" #: ../../tutorial/floatingpoint.rst:114 -#, fuzzy msgid "" "One illusion may beget another. For example, since 0.1 is not exactly 1/10, " "summing three values of 0.1 may not yield exactly 0.3, either:" msgstr "" "這種幻覺可能會產生下一個幻覺。舉例來說,因為 0.1 不是真正的 1/10,把三個 0.1 " -"的值相加,也不會產生精準的 0.3:\n" -"\n" -"::" +"的值相加,也不會產生精準的 0.3:" #: ../../tutorial/floatingpoint.rst:122 -#, fuzzy msgid "" "Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 " "cannot get any closer to the exact value of 3/10, then pre-rounding with :" "func:`round` function cannot help:" msgstr "" "同時,因為 0.1 不能再更接近精準的 1/10,還有 0.3 不能再更接近精準的 3/10,預" -"先用 :func:`round` 函式捨入並不會有幫助:\n" -"\n" -"::" +"先用 :func:`round` 函式捨入並不會有幫助:" #: ../../tutorial/floatingpoint.rst:131 -#, fuzzy msgid "" "Though the numbers cannot be made closer to their intended exact values, " "the :func:`math.isclose` function can be useful for comparing inexact values:" msgstr "" -"雖然數字不會再更接近他們的精準數值,但 :func:`round` 函式可以對事後的捨入有所" -"幫助,如此一來,不精確的數值就變得可以互相比較:\n" +"雖然數字不會再更接近他們的精準數值,但 :func:`math.isclose` 函式可以用來比較不精確的值:\n" "\n" "::" @@ -314,7 +298,6 @@ msgstr "" "的許多用於數學和統計學運算的其他套件。請參閱 。" #: ../../tutorial/floatingpoint.rst:181 -#, fuzzy msgid "" "Python provides tools that may help on those rare occasions when you really " "*do* want to know the exact value of a float. The :meth:`float." @@ -322,40 +305,28 @@ msgid "" msgstr "" "在罕見情況下,當你\\ *真的*\\ 想知道一個 float 的精準值,Python 提供的工具可" "協助達成。\\ :meth:`float.as_integer_ratio` method 可將一個 float 的值表示為" -"分數:\n" -"\n" -"::" +"分數:" #: ../../tutorial/floatingpoint.rst:192 -#, fuzzy msgid "" "Since the ratio is exact, it can be used to losslessly recreate the original " "value:" msgstr "" -"由於該比率是精準的,它可無損地再現該原始值:\n" -"\n" -"::" +"由於該比率是精準的,它可無損地再現該原始值:" #: ../../tutorial/floatingpoint.rst:200 -#, fuzzy msgid "" "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " "again giving the exact value stored by your computer:" msgstr "" ":meth:`float.hex` method 以十六進位(基數為 16)表示 float,一樣可以給出你的" -"電腦所儲存的精準值:\n" -"\n" -"::" +"電腦所儲存的精準值:" #: ../../tutorial/floatingpoint.rst:208 -#, fuzzy msgid "" "This precise hexadecimal representation can be used to reconstruct the float " "value exactly:" -msgstr "" -"這種精確的十六進位表示法可用於精準地重建 float 值:\n" -"\n" -"::" +msgstr "這種精確的十六進位表示法可用於精準地重建 float 值:" #: ../../tutorial/floatingpoint.rst:216 msgid "" @@ -443,36 +414,26 @@ msgstr "" "::" #: ../../tutorial/floatingpoint.rst:286 -#, fuzzy msgid "" "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " "2**53``), the best value for *N* is 56:" msgstr "" "而前面提到 *J* 有精準的 53 位元(即 ``>= 2**52`` 但 ``< 2**53``),所以 *N* " -"的最佳數值是 56:\n" -"\n" -"::" +"的最佳數值是 56:" #: ../../tutorial/floatingpoint.rst:294 -#, fuzzy msgid "" "That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. " "The best possible value for *J* is then that quotient rounded:" msgstr "" "意即,要使 *J* 正好有 53 位元,則 56 會是 *N* 的唯一值。而 *J* 最有可能的數值" -"就是經過捨入後的該商數:\n" -"\n" -"::" +"就是經過捨入後的該商數:" #: ../../tutorial/floatingpoint.rst:303 -#, fuzzy msgid "" "Since the remainder is more than half of 10, the best approximation is " "obtained by rounding up:" -msgstr "" -"由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:\n" -"\n" -"::" +msgstr "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:" #: ../../tutorial/floatingpoint.rst:313 msgid "" @@ -511,17 +472,12 @@ msgstr "" "::" #: ../../tutorial/floatingpoint.rst:334 -#, fuzzy msgid "" "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " "decimal digits:" -msgstr "" -"如果將該分數乘以 10\\*\\*55,則可以看到該值以 55 個十進位數字顯示:\n" -"\n" -"::" +msgstr "如果將該分數乘以 10\\*\\*55,則可以看到該值以 55 個十進位數字顯示:" #: ../../tutorial/floatingpoint.rst:342 -#, fuzzy msgid "" "meaning that the exact number stored in the computer is equal to the decimal " "value 0.1000000000000000055511151231257827021181583404541015625. Instead of " @@ -530,32 +486,9 @@ msgid "" msgstr "" "這表示儲存在電腦中的精準數值等於十進位值 " "0.1000000000000000055511151231257827021181583404541015625。與其顯示完整的十進" -"位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:\n" -"\n" -"::" +"位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:" #: ../../tutorial/floatingpoint.rst:352 -#, fuzzy msgid "" "The :mod:`fractions` and :mod:`decimal` modules make these calculations easy:" -msgstr "" -":mod:`fractions` 與 :mod:`decimal` 模組能使這些計算變得容易:\n" -"\n" -"::" - -#~ msgid "" -#~ "Floating-point numbers are represented in computer hardware as base 2 " -#~ "(binary) fractions. For example, the decimal fraction ::" -#~ msgstr "" -#~ "在計算機架構中,浮點數 (floating-point number) 是以基數為 2(二進位)的小" -#~ "數表示。例如說,在十進位小數中:\n" -#~ "\n" -#~ "::" - -#~ msgid "" -#~ "has value 1/10 + 2/100 + 5/1000, and in the same way the binary " -#~ "fraction ::" -#~ msgstr "" -#~ "可被分為 1/10 + 2/100 + 5/1000,同樣的道理,二進位小數:\n" -#~ "\n" -#~ "::" +msgstr ":mod:`fractions` 與 :mod:`decimal` 模組能使這些計算變得容易:" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index 8e93a7563d..a2d8f62302 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -29,14 +29,13 @@ msgid "Invoking the Interpreter" msgstr "啟動直譯器" #: ../../tutorial/interpreter.rst:13 -#, fuzzy msgid "" "The Python interpreter is usually installed as :file:`/usr/local/bin/" "python3.12` on those machines where it is available; putting :file:`/usr/" "local/bin` in your Unix shell's search path makes it possible to start it by " "typing the command:" msgstr "" -"Python 直譯器一般安裝在 :file:`/usr/local/bin/python3.11` 路徑下;將 :file:`/" +"Python 直譯器一般安裝在 :file:`/usr/local/bin/python3.12` 路徑下;將 :file:`/" "usr/local/bin` 加入Unix shell 的搜索路徑,輸入以下指令就可以啟動 Python:" #: ../../tutorial/interpreter.rst:21 @@ -51,7 +50,6 @@ msgstr "" "python` 是個很常見的另類存放路徑。)" #: ../../tutorial/interpreter.rst:26 -#, fuzzy msgid "" "On Windows machines where you have installed Python from the :ref:`Microsoft " "Store `, the :file:`python3.12` command will be available. If " @@ -60,7 +58,7 @@ msgid "" "Python." msgstr "" "Windows 系統中,從 :ref:`Microsoft Store ` 安裝 Python 後,就" -"可以使用 :file:`python3.11` 命令了。如果安裝了 :ref:`py.exe launcher " +"可以使用 :file:`python3.12` 命令了。如果安裝了 :ref:`py.exe launcher " "` ,則可以使用 :file:`py` 命令。請參閱附錄:\\ :ref:`setting-" "envvars`\\ ,了解其他啟動 Python 的方式。" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index d3cae4b3ec..87ce3b6b8b 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -337,14 +337,13 @@ msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" #: ../../tutorial/introduction.rst:276 -#, fuzzy msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " "used to obtain individual characters, *slicing* allows you to obtain a " "substring::" msgstr "" "除了索引外,字串亦支援「切片 *slicing*」。索引用來拿到單獨的字元,而切片則可" -"以讓你拿到子字串 (substring):\n" +"以讓你拿到一個子字串 (substring):\n" "\n" "::" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index ee3bc8a42c..860ed5cf6e 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -90,15 +90,13 @@ msgid "Command Line Arguments" msgstr "命令列引數" #: ../../tutorial/stdlib.rst:66 -#, fuzzy msgid "" "Common utility scripts often need to process command line arguments. These " "arguments are stored in the :mod:`sys` module's *argv* attribute as a list. " "For instance, let's take the following :file:`demo.py` file::" msgstr "" "通用工具腳本常需要處理命令列引數。這些引數會以 list(串列)形式存放在 :mod:" -"`sys` 模組的 *argv* 屬性中。例如在命令列執行 ``python demo.py one two " -"three`` 會有以下輸出結果:\n" +"`sys` 模組的 *argv* 屬性中。例如以下 :file:`demo.py` 檔案:\n" "\n" "::" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index c9ac96b816..efb046eb80 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -158,9 +158,10 @@ msgid "" "The :mod:`struct` module provides :func:`~struct.pack` and :func:`~struct." "unpack` functions for working with variable length binary record formats. " "The following example shows how to loop through header information in a ZIP " -"file without using the :mod:`zipfile` module. Pack codes ``\"H\"`` and ``\"I" -"\"`` represent two and four byte unsigned numbers respectively. The ``\"<" -"\"`` indicates that they are standard size and in little-endian byte order::" +"file without using the :mod:`zipfile` module. Pack codes ``\"H\"`` and " +"``\"I\"`` represent two and four byte unsigned numbers respectively. The " +"``\"<\"`` indicates that they are standard size and in little-endian byte " +"order::" msgstr "" ":mod:`struct` 模組提供了 :func:`~struct.pack` 和 :func:`~struct.unpack` 函" "式,用於處理可變動長度的二進制記錄格式。以下範例說明,如何在不使用 :mod:" @@ -255,9 +256,9 @@ msgstr "" "在預設情況,資訊和除錯訊息不會被顯示,其輸出會被發送到標準錯誤 (standard " "error)。其他輸出選項包括,將訊息轉發到電子郵件、資料報 (datagram)、網路插座 " "(socket) 或 HTTP 伺服器。新的過濾器可以根據訊息的優先順序,選擇不同的路由 " -"(routing) 方式:\\ :const:`~logging.DEBUG`\\ ,\\ :const:`~logging.INFO`" -"\\ ,\\ :const:`~logging.WARNING`\\ ,\\ :const:`~logging.ERROR`\\ ,及 :" -"const:`~logging.CRITICAL`\\ 。" +"(routing) 方式:\\ :const:`~logging.DEBUG`\\ ,\\ :const:`~logging." +"INFO`\\ ,\\ :const:`~logging.WARNING`\\ ,\\ :const:`~logging.ERROR`\\ ," +"及 :const:`~logging.CRITICAL`\\ 。" #: ../../tutorial/stdlib2.rst:241 msgid "" diff --git a/tutorial/venv.po b/tutorial/venv.po index 62926459ef..09286464c0 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -183,8 +183,8 @@ msgid "" "by going to it in your web browser." msgstr "" "你可以使用一個叫做 :program:`pip` 的程式來安裝、升級和移除套件。``pip`` 預設" -"會從 `Python Package Index `_ 安裝套件。你可以透過你的網頁瀏覽" -"器瀏覽 Python Package Index。" +"會從 `Python Package Index `_ 安裝套件。你可以透過你的網頁" +"瀏覽器瀏覽 Python Package Index。" #: ../../tutorial/venv.rst:105 msgid "" From 35798a5c9d4bca71f8ece2a4e7029425997a9fbf Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 02:38:43 +0800 Subject: [PATCH 009/105] fix: resolve fuzzy entries in reference --- reference/compound_stmts.po | 15 +++++---------- reference/datamodel.po | 9 +++------ reference/executionmodel.po | 5 ++--- reference/index.po | 8 ++++---- reference/lexical_analysis.po | 3 +-- reference/toplevel_components.po | 2 +- 6 files changed, 16 insertions(+), 26 deletions(-) diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index a2d8f30f3c..701379f396 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -1749,9 +1749,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1613 -#, fuzzy msgid "Type parameter lists" -msgstr "parameter list(參數列表)" +msgstr "" #: ../../reference/compound_stmts.rst:1627 msgid "" @@ -1844,9 +1843,8 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1709 -#, fuzzy msgid "Generic functions" -msgstr "function (函式)" +msgstr "" #: ../../reference/compound_stmts.rst:1711 msgid "Generic functions are declared as follows::" @@ -1854,10 +1852,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:1715 #: ../../reference/compound_stmts.rst:1775 -#, fuzzy msgid "This syntax is equivalent to::" msgstr "" -"大致等價於:\n" +"語法大致等價於:\n" "\n" "::" @@ -1919,10 +1916,9 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1798 -#, fuzzy msgid "This is equivalent to::" msgstr "" -"大致等價於:\n" +"這等價於:\n" "\n" "::" @@ -2448,6 +2444,5 @@ msgid "async with" msgstr "async with" #: ../../reference/compound_stmts.rst:1617 -#, fuzzy msgid "type parameters" -msgstr "parameter(參數)" +msgstr "type parameter(型別參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index 36fbd3753b..0d7f98ad85 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -727,9 +727,8 @@ msgid "A dict containing defaults for keyword-only parameters." msgstr "" #: ../../reference/datamodel.rst:565 ../../reference/datamodel.rst:876 -#, fuzzy msgid ":attr:`__type_params__`" -msgstr ":attr:`__name__`" +msgstr ":attr:`__type_params__`" #: ../../reference/datamodel.rst:565 msgid "" @@ -4022,9 +4021,8 @@ msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" #: ../../reference/datamodel.rst:491 -#, fuzzy msgid "__type_params__ (function attribute)" -msgstr "__name__ (函式屬性)" +msgstr "__type_params__ (函式屬性)" #: ../../reference/datamodel.rst:491 msgid "global" @@ -4159,9 +4157,8 @@ msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" #: ../../reference/datamodel.rst:840 -#, fuzzy msgid "__type_params__ (class attribute)" -msgstr "__name__ (類別屬性)" +msgstr "__type_params__ (類別屬性)" #: ../../reference/datamodel.rst:914 msgid "__dict__ (instance attribute)" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 6262f8927a..a20fd8167d 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -104,12 +104,11 @@ msgstr "" #: ../../reference/executionmodel.rst:73 msgid ":keyword:`import` statements." -msgstr "" +msgstr ":keyword:`import` 陳述式。" #: ../../reference/executionmodel.rst:74 -#, fuzzy msgid ":keyword:`type` statements." -msgstr "import statement(引入陳述式)" +msgstr ":keyword:`type` 陳述式。" #: ../../reference/executionmodel.rst:75 msgid ":ref:`type parameter lists `." diff --git a/reference/index.po b/reference/index.po index ef12a806a7..35e52eea05 100644 --- a/reference/index.po +++ b/reference/index.po @@ -36,8 +36,8 @@ msgid "" "index` describes the interfaces available to C/C++ programmers in detail." msgstr "" "這份參考手冊會描述 Python 語言的語法及「核心語意」。它雖然簡潔,但也盡量保持" -"精確並完整。關於非必要的 (non-essential) 內建物件型別、內建函式及模組的語" -"意,則在 :ref:`library-index` 中說明。關於此語言的非正式介紹,請參閱 :ref:" +"精確並完整。關於非必要的 (non-essential) 內建物件型別、內建函式及模組的語意," +"則在 :ref:`library-index` 中說明。關於此語言的非正式介紹,請參閱 :ref:" "`tutorial-index`\\ 。對於 C 或 C++ 程式設計師,還有另外兩個手冊:\\ :ref:" -"`extending-index`\\ 以高階的視野說明如何編寫 Python 擴充模組,而 :ref:`c-" -"api-index`\\ 則詳細說明 C/C++ 程式設計師可用的介面。" +"`extending-index`\\ 以高階的視野說明如何編寫 Python 擴充模組,而 :ref:`c-api-" +"index`\\ 則詳細說明 C/C++ 程式設計師可用的介面。" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index bc52da5efe..e288b4c1a3 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -1178,9 +1178,8 @@ msgid "Footnotes" msgstr "註解" #: ../../reference/lexical_analysis.rst:1044 -#, fuzzy msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" -msgstr "https://www.unicode.org/Public/11.0.0/ucd/NameAliases.txt" +msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" #: ../../reference/lexical_analysis.rst:8 msgid "lexical analysis" diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index c23a53b006..fbb1403a56 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -146,7 +146,7 @@ msgstr "interpreter(直譯器)" #: ../../reference/toplevel_components.rst:21 msgid "program" -msgstr "program(程式)" +msgstr "program(程式)" #: ../../reference/toplevel_components.rst:23 #: ../../reference/toplevel_components.rst:39 From 7d2e7c443063adf4c5f336e6f36e7818c40d4fbc Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 02:54:51 +0800 Subject: [PATCH 010/105] fix: resolve fuzzy entries in using --- using/cmdline.po | 3 +-- using/index.po | 4 ++-- using/mac.po | 3 +-- using/windows.po | 5 ++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/using/cmdline.po b/using/cmdline.po index a49ecb2b4a..01eb023385 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -807,9 +807,8 @@ msgid "The ``-X int_max_str_digits`` option." msgstr "``-X int_max_str_digits`` 選項。" #: ../../using/cmdline.rst:593 -#, fuzzy msgid "The ``-X perf`` option." -msgstr "``-X oldparser`` 選項。" +msgstr "``-X perf`` 選項。" #: ../../using/cmdline.rst:598 msgid "Options you shouldn't use" diff --git a/using/index.po b/using/index.po index 9d035a7042..8dbcc3d021 100644 --- a/using/index.po +++ b/using/index.po @@ -30,5 +30,5 @@ msgid "" "setup of the Python environment on different platforms, the invocation of " "the interpreter and things that make working with Python easier." msgstr "" -"這部分的說明文件是關於在不同平台上設定 Python 環境的綜合資訊、直譯器的呼" -"叫,以及讓 Python 更容易使用的一些方法。" +"這部分的說明文件是關於在不同平台上設定 Python 環境的綜合資訊、直譯器的呼叫," +"以及讓 Python 更容易使用的一些方法。" diff --git a/using/mac.po b/using/mac.po index e34333f54c..8037179f3f 100644 --- a/using/mac.po +++ b/using/mac.po @@ -289,7 +289,6 @@ msgstr "" "pyobjc/。" #: ../../using/mac.rst:146 -#, fuzzy msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " @@ -297,7 +296,7 @@ msgid "" "installed from https://www.activestate.com; it can also be built from source." msgstr "" "標準的 Python GUI 工具套件是 :mod:`tkinter`\\ ,基於跨平臺的 Tk 工具套件 " -"(https://www.tcl.tk)。Apple 的 OS X 包含了 Aqua 原生版本的 Tk,最新版本可以" +"(https://www.tcl.tk)。Apple 的 macOS 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" #: ../../using/mac.rst:151 diff --git a/using/windows.po b/using/windows.po index be19c9630e..cfb1e93d75 100644 --- a/using/windows.po +++ b/using/windows.po @@ -263,16 +263,15 @@ msgstr "" #: ../../using/windows.rst:139 msgid "/simple" -msgstr "" +msgstr "/simple" #: ../../using/windows.rst:139 msgid "to prevent user customization" msgstr "" #: ../../using/windows.rst:141 -#, fuzzy msgid "/uninstall" -msgstr "SimpleInstall" +msgstr "/uninstall" #: ../../using/windows.rst:141 msgid "to remove Python (without confirmation)" From 68bf0475af871bc625eb21e47b3b5bf4619b7d5c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 02:55:09 +0800 Subject: [PATCH 011/105] fix: resolve fuzzy entries in the rest files --- about.po | 3 +- installing/index.po | 4 +- license.po | 22 ++- whatsnew/3.12.po | 316 ++++++++++++++++++++++---------------------- 4 files changed, 171 insertions(+), 174 deletions(-) diff --git a/about.po b/about.po index 9ad3654a44..9d4388a6eb 100644 --- a/about.po +++ b/about.po @@ -65,7 +65,8 @@ msgid "" "the `Docutils `_ project for creating " "reStructuredText and the Docutils suite;" msgstr "" -"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" +"創造 reStructuredText 和 Docutils 工具組的 `Docutils `_ 專案;" #: ../../about.rst:26 msgid "" diff --git a/installing/index.po b/installing/index.po index d69f13de70..55d5982009 100644 --- a/installing/index.po +++ b/installing/index.po @@ -123,7 +123,6 @@ msgstr "" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" #: ../../installing/index.rst:50 -#, fuzzy msgid "" "the `Python Packaging Authority `__ is the group of " "developers and documentation authors responsible for the maintenance and " @@ -134,8 +133,7 @@ msgstr "" "`Python 封裝管理站 (Python Packaging Authority) `__ 是" "一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" "元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 和 `Bitbucket `__ 這兩個平台上維護各種" -"工具、說明文件及問題追蹤系統。" +"pypa>`__ 平台上維護各種工具、說明文件及問題追蹤系統。" #: ../../installing/index.rst:56 msgid "" diff --git a/license.po b/license.po index 8c9a3468e6..cf3b4d3da6 100644 --- a/license.po +++ b/license.po @@ -303,16 +303,15 @@ msgid "Mersenne Twister" msgstr "Mersenne Twister" #: ../../license.rst:305 -#, fuzzy msgid "" "The :mod:`!_random` C extension underlying the :mod:`random` module includes " "code based on a download from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/" "MT/MT2002/emt19937ar.html. The following are the verbatim comments from the " "original code::" msgstr "" -":mod:`_random` 模組包含了以 http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/" -"MT2002/emt19937ar.html 的下載內容為基礎的程式碼。以下是原始程式碼的完整聲" -"明:\n" +":mod:`random` 模組底下的 :mod:`!_random` C 擴充程式包含了以 http://www.math." +"sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html 的下載內容為基礎的程式" +"碼。以下是原始程式碼的完整聲明:\n" "\n" "::" @@ -336,12 +335,12 @@ msgid "Asynchronous socket services" msgstr "非同步 socket 服務" #: ../../license.rst:390 -#, fuzzy msgid "" "The :mod:`test.support.asynchat` and :mod:`test.support.asyncore` modules " "contain the following notice::" msgstr "" -":mod:`asynchat` 和 :mod:`asyncore` 模組包含以下聲明:\n" +":mod:`test.support.asynchat` 和 :mod:`test.support.asyncore` 模組包含以下聲" +"明:\n" "\n" "::" @@ -485,14 +484,13 @@ msgid "libffi" msgstr "libffi" #: ../../license.rst:824 -#, fuzzy msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " "``--with-system-libffi``::" msgstr "" -"除非在建置 :mod:`_ctypes` 擴充時設定為 ``--with-system-libffi``\\ ,否則該擴" -"充會用一個內含 libffi 原始碼的副本來建置:\n" +"除非在建置 :mod:`_ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" +"system-libffi``\\ ,否則該擴充會用一個內含 libffi 原始碼的副本來建置:\n" "\n" "::" @@ -530,14 +528,14 @@ msgid "libmpdec" msgstr "libmpdec" #: ../../license.rst:926 -#, fuzzy msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " "configured ``--with-system-libmpdec``::" msgstr "" -"除非在建置 :mod:`_decimal` 模組時設定為 ``--with-system-libmpdec``\\ ,否則該" -"模組會用一個內含 libmpdec 函式庫的副本來建置:\n" +"除非在建置 :mod:`decimal` 模組底下 :mod:`!_decimal` C 擴充程式時設定為 ``--" +"with-system-libmpdec``\\ ,否則該模組會用一個內含 libmpdec 函式庫的副本來建" +"置:\n" "\n" "::" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 6fa6961f79..4c021a6ae8 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -19,32 +19,32 @@ msgstr "" #: ../../whatsnew/3.12.rst:4 msgid "What's New In Python 3.12" -msgstr "" +msgstr "Python 3.12 有什麼新功能" #: ../../whatsnew/3.12.rst:0 msgid "Release" -msgstr "" +msgstr "發行版本" #: ../../whatsnew/3.12.rst:6 msgid "|release|" -msgstr "" +msgstr "|release|" #: ../../whatsnew/3.12.rst:0 msgid "Date" -msgstr "" +msgstr "日期" #: ../../whatsnew/3.12.rst:7 msgid "|today|" -msgstr "" +msgstr "|today|" #: ../../whatsnew/3.12.rst:49 msgid "" "This article explains the new features in Python 3.12, compared to 3.11." -msgstr "" +msgstr "此文章解釋了 Python 3.12 和 3.11 相比多了哪些新特性。" #: ../../whatsnew/3.12.rst:51 msgid "For full details, see the :ref:`changelog `." -msgstr "" +msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" #: ../../whatsnew/3.12.rst:55 msgid "" @@ -55,11 +55,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:61 msgid "Summary -- Release highlights" -msgstr "" +msgstr "發布重點摘要" #: ../../whatsnew/3.12.rst:69 msgid "New grammar features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 msgid ":pep:`701`: Syntactic formalization of f-strings" @@ -67,7 +67,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:73 msgid "New typing features:" -msgstr "" +msgstr "新增型別特性:" #: ../../whatsnew/3.12.rst:75 msgid ":pep:`688`: Making the buffer protocol accessible in Python" @@ -75,11 +75,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:77 msgid ":ref:`whatsnew312-pep692`" -msgstr "" +msgstr ":ref:`whatsnew312-pep692`" #: ../../whatsnew/3.12.rst:79 msgid ":ref:`whatsnew312-pep695`" -msgstr "" +msgstr ":ref:`whatsnew312-pep695`" #: ../../whatsnew/3.12.rst:81 msgid ":pep:`698`: Override Decorator for Static Typing" @@ -134,7 +134,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:143 ../../whatsnew/3.12.rst:1600 msgid "New Features" -msgstr "" +msgstr "新增特性" #: ../../whatsnew/3.12.rst:148 msgid "PEP 701: Syntactic formalization of f-strings" @@ -191,7 +191,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:204 msgid "See :pep:`701` for more details." -msgstr "" +msgstr "詳情請見 :pep:`701`。" #: ../../whatsnew/3.12.rst:206 msgid "" @@ -407,7 +407,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:396 msgid "See :pep:`695` for more details." -msgstr "" +msgstr "詳情請見 :pep:`695`。" #: ../../whatsnew/3.12.rst:398 msgid "" @@ -417,7 +417,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:402 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.12.rst:404 msgid "" @@ -554,7 +554,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:496 msgid "array" -msgstr "" +msgstr "array" #: ../../whatsnew/3.12.rst:498 msgid "" @@ -564,7 +564,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:502 msgid "asyncio" -msgstr "" +msgstr "asyncio" #: ../../whatsnew/3.12.rst:504 msgid "" @@ -637,7 +637,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:550 msgid "calendar" -msgstr "" +msgstr "calendar" #: ../../whatsnew/3.12.rst:552 msgid "" @@ -647,7 +647,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:556 msgid "csv" -msgstr "" +msgstr "csv" #: ../../whatsnew/3.12.rst:558 msgid "" @@ -658,7 +658,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:563 msgid "dis" -msgstr "" +msgstr "dis" #: ../../whatsnew/3.12.rst:565 msgid "" @@ -671,7 +671,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:574 msgid "email" -msgstr "" +msgstr "email" #: ../../whatsnew/3.12.rst:576 msgid "" @@ -683,7 +683,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:582 msgid "fractions" -msgstr "" +msgstr "fractions" #: ../../whatsnew/3.12.rst:584 msgid "" @@ -693,7 +693,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:588 msgid "inspect" -msgstr "" +msgstr "inspect" #: ../../whatsnew/3.12.rst:590 msgid "" @@ -719,7 +719,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:604 msgid "itertools" -msgstr "" +msgstr "itertools" #: ../../whatsnew/3.12.rst:606 msgid "" @@ -730,7 +730,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:611 msgid "math" -msgstr "" +msgstr "math" #: ../../whatsnew/3.12.rst:613 msgid "" @@ -747,7 +747,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:621 msgid "os" -msgstr "" +msgstr "os" #: ../../whatsnew/3.12.rst:623 msgid "" @@ -785,7 +785,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:646 msgid "os.path" -msgstr "" +msgstr "os.path" #: ../../whatsnew/3.12.rst:648 msgid "" @@ -801,7 +801,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:655 msgid "pathlib" -msgstr "" +msgstr "pathlib" #: ../../whatsnew/3.12.rst:657 msgid "" @@ -842,7 +842,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:679 msgid "pdb" -msgstr "" +msgstr "pdb" #: ../../whatsnew/3.12.rst:681 msgid "" @@ -853,7 +853,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:687 msgid "random" -msgstr "" +msgstr "random" #: ../../whatsnew/3.12.rst:689 msgid "" @@ -869,7 +869,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:696 msgid "shutil" -msgstr "" +msgstr "shutil" #: ../../whatsnew/3.12.rst:698 msgid "" @@ -911,7 +911,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:726 msgid "sqlite3" -msgstr "" +msgstr "sqlite3" #: ../../whatsnew/3.12.rst:728 msgid "" @@ -943,7 +943,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:749 msgid "statistics" -msgstr "" +msgstr "statistics" #: ../../whatsnew/3.12.rst:751 msgid "" @@ -954,7 +954,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:756 msgid "sys" -msgstr "" +msgstr "sys" #: ../../whatsnew/3.12.rst:758 msgid "" @@ -984,7 +984,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:778 msgid "tempfile" -msgstr "" +msgstr "tempfile" #: ../../whatsnew/3.12.rst:780 msgid "" @@ -1000,7 +1000,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:788 msgid "threading" -msgstr "" +msgstr "threading" #: ../../whatsnew/3.12.rst:790 msgid "" @@ -1012,7 +1012,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:796 msgid "tkinter" -msgstr "" +msgstr "tkinter" #: ../../whatsnew/3.12.rst:798 msgid "" @@ -1026,7 +1026,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:807 msgid "tokenize" -msgstr "" +msgstr "tokenize" #: ../../whatsnew/3.12.rst:809 msgid "" @@ -1038,7 +1038,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:815 msgid "types" -msgstr "" +msgstr "types" #: ../../whatsnew/3.12.rst:817 msgid "" @@ -1049,7 +1049,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:822 msgid "typing" -msgstr "" +msgstr "typing" #: ../../whatsnew/3.12.rst:824 msgid "" @@ -1104,7 +1104,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:876 msgid "unicodedata" -msgstr "" +msgstr "unicodedata" #: ../../whatsnew/3.12.rst:878 msgid "" @@ -1114,7 +1114,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:882 msgid "unittest" -msgstr "" +msgstr "unittest" #: ../../whatsnew/3.12.rst:884 msgid "" @@ -1127,7 +1127,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:903 msgid "uuid" -msgstr "" +msgstr "uuid" #: ../../whatsnew/3.12.rst:905 msgid "" @@ -1380,79 +1380,79 @@ msgstr "" #: ../../whatsnew/3.12.rst:1064 msgid ":mod:`aifc`" -msgstr "" +msgstr ":mod:`aifc`" #: ../../whatsnew/3.12.rst:1065 msgid ":mod:`audioop`" -msgstr "" +msgstr ":mod:`audioop`" #: ../../whatsnew/3.12.rst:1066 msgid ":mod:`cgi`" -msgstr "" +msgstr ":mod:`cgi`" #: ../../whatsnew/3.12.rst:1067 msgid ":mod:`cgitb`" -msgstr "" +msgstr ":mod:`cgitb`" #: ../../whatsnew/3.12.rst:1068 msgid ":mod:`chunk`" -msgstr "" +msgstr ":mod:`chunk`" #: ../../whatsnew/3.12.rst:1069 msgid ":mod:`crypt`" -msgstr "" +msgstr ":mod:`crypt`" #: ../../whatsnew/3.12.rst:1070 msgid ":mod:`imghdr`" -msgstr "" +msgstr ":mod:`imghdr`" #: ../../whatsnew/3.12.rst:1071 msgid ":mod:`mailcap`" -msgstr "" +msgstr ":mod:`mailcap`" #: ../../whatsnew/3.12.rst:1072 msgid ":mod:`msilib`" -msgstr "" +msgstr ":mod:`msilib`" #: ../../whatsnew/3.12.rst:1073 msgid ":mod:`nis`" -msgstr "" +msgstr ":mod:`nis`" #: ../../whatsnew/3.12.rst:1074 msgid ":mod:`nntplib`" -msgstr "" +msgstr ":mod:`nntplib`" #: ../../whatsnew/3.12.rst:1075 msgid ":mod:`ossaudiodev`" -msgstr "" +msgstr ":mod:`ossaudiodev`" #: ../../whatsnew/3.12.rst:1076 msgid ":mod:`pipes`" -msgstr "" +msgstr ":mod:`pipes`" #: ../../whatsnew/3.12.rst:1077 msgid ":mod:`sndhdr`" -msgstr "" +msgstr ":mod:`sndhdr`" #: ../../whatsnew/3.12.rst:1078 msgid ":mod:`spwd`" -msgstr "" +msgstr ":mod:`spwd`" #: ../../whatsnew/3.12.rst:1079 msgid ":mod:`sunau`" -msgstr "" +msgstr ":mod:`sunau`" #: ../../whatsnew/3.12.rst:1080 msgid ":mod:`telnetlib`" -msgstr "" +msgstr ":mod:`telnetlib`" #: ../../whatsnew/3.12.rst:1081 msgid ":mod:`uu`" -msgstr "" +msgstr ":mod:`uu`" #: ../../whatsnew/3.12.rst:1082 msgid ":mod:`xdrlib`" -msgstr "" +msgstr ":mod:`xdrlib`" #: ../../whatsnew/3.12.rst:1084 msgid "APIs:" @@ -1460,35 +1460,35 @@ msgstr "" #: ../../whatsnew/3.12.rst:1086 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -msgstr "" +msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" #: ../../whatsnew/3.12.rst:1087 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" -msgstr "" +msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" #: ../../whatsnew/3.12.rst:1088 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -msgstr "" +msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" #: ../../whatsnew/3.12.rst:1089 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" #: ../../whatsnew/3.12.rst:1090 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" #: ../../whatsnew/3.12.rst:1091 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" -msgstr "" +msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" #: ../../whatsnew/3.12.rst:1092 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -msgstr "" +msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" #: ../../whatsnew/3.12.rst:1093 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -msgstr "" +msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" #: ../../whatsnew/3.12.rst:1094 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" @@ -1506,15 +1506,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:1102 msgid ":class:`!importlib.abc.ResourceReader`" -msgstr "" +msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1103 msgid ":class:`!importlib.abc.Traversable`" -msgstr "" +msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1104 msgid ":class:`!importlib.abc.TraversableResources`" -msgstr "" +msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1106 msgid "Use :mod:`importlib.resources.abc` classes instead:" @@ -1522,11 +1522,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1108 msgid ":class:`importlib.resources.abc.Traversable`" -msgstr "" +msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1109 msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr "" +msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1111 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" @@ -1633,23 +1633,23 @@ msgstr "" #: ../../whatsnew/3.12.rst:1174 msgid ":class:`!ast.Num`" -msgstr "" +msgstr ":class:`!ast.Num`" #: ../../whatsnew/3.12.rst:1175 msgid ":class:`!ast.Str`" -msgstr "" +msgstr ":class:`!ast.Str`" #: ../../whatsnew/3.12.rst:1176 msgid ":class:`!ast.Bytes`" -msgstr "" +msgstr ":class:`!ast.Bytes`" #: ../../whatsnew/3.12.rst:1177 msgid ":class:`!ast.NameConstant`" -msgstr "" +msgstr ":class:`!ast.NameConstant`" #: ../../whatsnew/3.12.rst:1178 msgid ":class:`!ast.Ellipsis`" -msgstr "" +msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1180 msgid "" @@ -1669,7 +1669,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:1189 msgid ":class:`typing.Text` (:gh:`92332`)" -msgstr "" +msgstr ":class:`typing.Text` (:gh:`92332`)" #: ../../whatsnew/3.12.rst:1191 msgid "" @@ -1746,121 +1746,121 @@ msgstr "" #: ../../whatsnew/3.12.rst:1235 msgid "``failUnless``" -msgstr "" +msgstr "``failUnless``" #: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1242 msgid ":meth:`.assertTrue`" -msgstr "" +msgstr ":meth:`.assertTrue`" #: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1236 #: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1238 #: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1240 #: ../../whatsnew/3.12.rst:1241 msgid "3.1" -msgstr "" +msgstr "3.1" #: ../../whatsnew/3.12.rst:1236 msgid "``failIf``" -msgstr "" +msgstr "``failIf``" #: ../../whatsnew/3.12.rst:1236 msgid ":meth:`.assertFalse`" -msgstr "" +msgstr ":meth:`.assertFalse`" #: ../../whatsnew/3.12.rst:1237 msgid "``failUnlessEqual``" -msgstr "" +msgstr "``failUnlessEqual``" #: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1243 msgid ":meth:`.assertEqual`" -msgstr "" +msgstr ":meth:`.assertEqual`" #: ../../whatsnew/3.12.rst:1238 msgid "``failIfEqual``" -msgstr "" +msgstr "``failIfEqual``" #: ../../whatsnew/3.12.rst:1238 ../../whatsnew/3.12.rst:1244 msgid ":meth:`.assertNotEqual`" -msgstr "" +msgstr ":meth:`.assertNotEqual`" #: ../../whatsnew/3.12.rst:1239 msgid "``failUnlessAlmostEqual``" -msgstr "" +msgstr "``failUnlessAlmostEqual``" #: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1245 msgid ":meth:`.assertAlmostEqual`" -msgstr "" +msgstr ":meth:`.assertAlmostEqual`" #: ../../whatsnew/3.12.rst:1240 msgid "``failIfAlmostEqual``" -msgstr "" +msgstr "``failIfAlmostEqual``" #: ../../whatsnew/3.12.rst:1240 ../../whatsnew/3.12.rst:1246 msgid ":meth:`.assertNotAlmostEqual`" -msgstr "" +msgstr ":meth:`.assertNotAlmostEqual`" #: ../../whatsnew/3.12.rst:1241 msgid "``failUnlessRaises``" -msgstr "" +msgstr "``failUnlessRaises``" #: ../../whatsnew/3.12.rst:1241 msgid ":meth:`.assertRaises`" -msgstr "" +msgstr ":meth:`.assertRaises`" #: ../../whatsnew/3.12.rst:1242 msgid "``assert_``" -msgstr "" +msgstr "``assert_``" #: ../../whatsnew/3.12.rst:1242 ../../whatsnew/3.12.rst:1243 #: ../../whatsnew/3.12.rst:1244 ../../whatsnew/3.12.rst:1245 #: ../../whatsnew/3.12.rst:1246 ../../whatsnew/3.12.rst:1247 #: ../../whatsnew/3.12.rst:1248 msgid "3.2" -msgstr "" +msgstr "3.2" #: ../../whatsnew/3.12.rst:1243 msgid "``assertEquals``" -msgstr "" +msgstr "``assertEquals``" #: ../../whatsnew/3.12.rst:1244 msgid "``assertNotEquals``" -msgstr "" +msgstr "``assertNotEquals``" #: ../../whatsnew/3.12.rst:1245 msgid "``assertAlmostEquals``" -msgstr "" +msgstr "``assertAlmostEquals``" #: ../../whatsnew/3.12.rst:1246 msgid "``assertNotAlmostEquals``" -msgstr "" +msgstr "``assertNotAlmostEquals``" #: ../../whatsnew/3.12.rst:1247 msgid "``assertRegexpMatches``" -msgstr "" +msgstr "``assertRegexpMatches``" #: ../../whatsnew/3.12.rst:1247 msgid ":meth:`.assertRegex`" -msgstr "" +msgstr ":meth:`.assertRegex`" #: ../../whatsnew/3.12.rst:1248 msgid "``assertRaisesRegexp``" -msgstr "" +msgstr "``assertRaisesRegexp``" #: ../../whatsnew/3.12.rst:1248 msgid ":meth:`.assertRaisesRegex`" -msgstr "" +msgstr ":meth:`.assertRaisesRegex`" #: ../../whatsnew/3.12.rst:1249 msgid "``assertNotRegexpMatches``" -msgstr "" +msgstr "``assertNotRegexpMatches``" #: ../../whatsnew/3.12.rst:1249 msgid ":meth:`.assertNotRegex`" -msgstr "" +msgstr ":meth:`.assertNotRegex`" #: ../../whatsnew/3.12.rst:1249 msgid "3.5" -msgstr "" +msgstr "3.5" #: ../../whatsnew/3.12.rst:1252 msgid "" @@ -1923,11 +1923,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1280 msgid "``sqlite3.enable_shared_cache()``" -msgstr "" +msgstr "``sqlite3.enable_shared_cache()``" #: ../../whatsnew/3.12.rst:1281 msgid "``sqlite3.OptimizedUnicode``" -msgstr "" +msgstr "``sqlite3.OptimizedUnicode``" #: ../../whatsnew/3.12.rst:1283 msgid "" @@ -2079,15 +2079,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:1380 msgid "imp" -msgstr "" +msgstr "imp" #: ../../whatsnew/3.12.rst:1380 msgid "importlib" -msgstr "" +msgstr "importlib" #: ../../whatsnew/3.12.rst:1382 msgid "``imp.NullImporter``" -msgstr "" +msgstr "``imp.NullImporter``" #: ../../whatsnew/3.12.rst:1382 msgid "Insert ``None`` into ``sys.path_importer_cache``" @@ -2095,31 +2095,31 @@ msgstr "" #: ../../whatsnew/3.12.rst:1383 msgid "``imp.cache_from_source()``" -msgstr "" +msgstr "``imp.cache_from_source()``" #: ../../whatsnew/3.12.rst:1383 msgid ":func:`importlib.util.cache_from_source`" -msgstr "" +msgstr ":func:`importlib.util.cache_from_source`" #: ../../whatsnew/3.12.rst:1384 msgid "``imp.find_module()``" -msgstr "" +msgstr "``imp.find_module()``" #: ../../whatsnew/3.12.rst:1384 msgid ":func:`importlib.util.find_spec`" -msgstr "" +msgstr ":func:`importlib.util.find_spec`" #: ../../whatsnew/3.12.rst:1385 msgid "``imp.get_magic()``" -msgstr "" +msgstr "``imp.get_magic()``" #: ../../whatsnew/3.12.rst:1385 msgid ":attr:`importlib.util.MAGIC_NUMBER`" -msgstr "" +msgstr ":attr:`importlib.util.MAGIC_NUMBER`" #: ../../whatsnew/3.12.rst:1386 msgid "``imp.get_suffixes()``" -msgstr "" +msgstr "``imp.get_suffixes()``" #: ../../whatsnew/3.12.rst:1386 msgid "" @@ -2129,43 +2129,43 @@ msgstr "" #: ../../whatsnew/3.12.rst:1387 msgid "``imp.get_tag()``" -msgstr "" +msgstr "``imp.get_tag()``" #: ../../whatsnew/3.12.rst:1387 msgid ":attr:`sys.implementation.cache_tag `" -msgstr "" +msgstr ":attr:`sys.implementation.cache_tag `" #: ../../whatsnew/3.12.rst:1388 msgid "``imp.load_module()``" -msgstr "" +msgstr "``imp.load_module()``" #: ../../whatsnew/3.12.rst:1388 msgid ":func:`importlib.import_module`" -msgstr "" +msgstr ":func:`importlib.import_module`" #: ../../whatsnew/3.12.rst:1389 msgid "``imp.new_module(name)``" -msgstr "" +msgstr "``imp.new_module(name)``" #: ../../whatsnew/3.12.rst:1389 msgid "``types.ModuleType(name)``" -msgstr "" +msgstr "``types.ModuleType(name)``" #: ../../whatsnew/3.12.rst:1390 msgid "``imp.reload()``" -msgstr "" +msgstr "``imp.reload()``" #: ../../whatsnew/3.12.rst:1390 msgid ":func:`importlib.reload`" -msgstr "" +msgstr ":func:`importlib.reload`" #: ../../whatsnew/3.12.rst:1391 msgid "``imp.source_from_cache()``" -msgstr "" +msgstr "``imp.source_from_cache()``" #: ../../whatsnew/3.12.rst:1391 msgid ":func:`importlib.util.source_from_cache`" -msgstr "" +msgstr ":func:`importlib.util.source_from_cache`" #: ../../whatsnew/3.12.rst:1394 msgid "Replace ``imp.load_source()`` with::" @@ -2181,19 +2181,19 @@ msgstr "" #: ../../whatsnew/3.12.rst:1413 msgid "``imp.init_builtin()``" -msgstr "" +msgstr "``imp.init_builtin()``" #: ../../whatsnew/3.12.rst:1414 msgid "``imp.load_compiled()``" -msgstr "" +msgstr "``imp.load_compiled()``" #: ../../whatsnew/3.12.rst:1415 msgid "``imp.load_dynamic()``" -msgstr "" +msgstr "``imp.load_dynamic()``" #: ../../whatsnew/3.12.rst:1416 msgid "``imp.load_package()``" -msgstr "" +msgstr "``imp.load_package()``" #: ../../whatsnew/3.12.rst:1418 msgid "" @@ -2424,15 +2424,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:1583 msgid "loongarch64-linux-gnusf" -msgstr "" +msgstr "loongarch64-linux-gnusf" #: ../../whatsnew/3.12.rst:1584 msgid "loongarch64-linux-gnuf32" -msgstr "" +msgstr "loongarch64-linux-gnuf32" #: ../../whatsnew/3.12.rst:1585 msgid "loongarch64-linux-gnu" -msgstr "" +msgstr "loongarch64-linux-gnu" #: ../../whatsnew/3.12.rst:1587 msgid "(Contributed by Zhang Na in :gh:`90656`.)" @@ -2553,19 +2553,19 @@ msgstr "" #: ../../whatsnew/3.12.rst:1649 msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr "" +msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" #: ../../whatsnew/3.12.rst:1650 msgid ":c:func:`PyVectorcall_NARGS`" -msgstr "" +msgstr ":c:func:`PyVectorcall_NARGS`" #: ../../whatsnew/3.12.rst:1651 msgid ":c:func:`PyVectorcall_Call`" -msgstr "" +msgstr ":c:func:`PyVectorcall_Call`" #: ../../whatsnew/3.12.rst:1652 msgid ":c:type:`vectorcallfunc`" -msgstr "" +msgstr ":c:type:`vectorcallfunc`" #: ../../whatsnew/3.12.rst:1654 msgid "" @@ -2594,15 +2594,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:1671 msgid ":c:func:`PyObject_Vectorcall`" -msgstr "" +msgstr ":c:func:`PyObject_Vectorcall`" #: ../../whatsnew/3.12.rst:1672 msgid ":c:func:`PyObject_VectorcallMethod`" -msgstr "" +msgstr ":c:func:`PyObject_VectorcallMethod`" #: ../../whatsnew/3.12.rst:1673 msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr "" +msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" #: ../../whatsnew/3.12.rst:1675 msgid "" @@ -2865,15 +2865,15 @@ msgstr "" #: ../../whatsnew/3.12.rst:1829 msgid ":c:func:`PyType_FromSpec`" -msgstr "" +msgstr ":c:func:`PyType_FromSpec`" #: ../../whatsnew/3.12.rst:1830 msgid ":c:func:`PyType_FromSpecWithBases`" -msgstr "" +msgstr ":c:func:`PyType_FromSpecWithBases`" #: ../../whatsnew/3.12.rst:1831 msgid ":c:func:`PyType_FromModuleAndSpec`" -msgstr "" +msgstr ":c:func:`PyType_FromModuleAndSpec`" #: ../../whatsnew/3.12.rst:1833 msgid "" @@ -3172,39 +3172,39 @@ msgstr "" #: ../../whatsnew/3.12.rst:1966 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" -msgstr "" +msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" #: ../../whatsnew/3.12.rst:1967 msgid ":c:func:`!PyUnicode_AS_UNICODE`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AS_UNICODE`" #: ../../whatsnew/3.12.rst:1968 msgid ":c:func:`!PyUnicode_AsUnicode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsUnicode`" #: ../../whatsnew/3.12.rst:1969 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" #: ../../whatsnew/3.12.rst:1970 msgid ":c:func:`!PyUnicode_AS_DATA`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AS_DATA`" #: ../../whatsnew/3.12.rst:1971 msgid ":c:func:`!PyUnicode_FromUnicode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_FromUnicode`" #: ../../whatsnew/3.12.rst:1972 msgid ":c:func:`!PyUnicode_GET_SIZE`" -msgstr "" +msgstr ":c:func:`!PyUnicode_GET_SIZE`" #: ../../whatsnew/3.12.rst:1973 msgid ":c:func:`!PyUnicode_GetSize`" -msgstr "" +msgstr ":c:func:`!PyUnicode_GetSize`" #: ../../whatsnew/3.12.rst:1974 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" -msgstr "" +msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" #: ../../whatsnew/3.12.rst:1976 msgid "" From 2f0bca3b9be433aee2880bcde902fa692778854d Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 03:00:00 +0800 Subject: [PATCH 012/105] chore: change project id globally --- about.po | 2 +- bugs.po | 2 +- c-api/abstract.po | 2 +- c-api/allocation.po | 2 +- c-api/apiabiversion.po | 2 +- c-api/arg.po | 2 +- c-api/bool.po | 2 +- c-api/buffer.po | 2 +- c-api/bytearray.po | 2 +- c-api/bytes.po | 2 +- c-api/call.po | 2 +- c-api/capsule.po | 2 +- c-api/cell.po | 2 +- c-api/code.po | 2 +- c-api/codec.po | 2 +- c-api/complex.po | 2 +- c-api/concrete.po | 2 +- c-api/contextvars.po | 2 +- c-api/conversion.po | 2 +- c-api/coro.po | 2 +- c-api/datetime.po | 2 +- c-api/descriptor.po | 2 +- c-api/dict.po | 2 +- c-api/exceptions.po | 2 +- c-api/file.po | 2 +- c-api/float.po | 2 +- c-api/frame.po | 2 +- c-api/function.po | 2 +- c-api/gcsupport.po | 2 +- c-api/gen.po | 2 +- c-api/import.po | 2 +- c-api/index.po | 2 +- c-api/init.po | 2 +- c-api/init_config.po | 2 +- c-api/intro.po | 2 +- c-api/iter.po | 2 +- c-api/iterator.po | 2 +- c-api/list.po | 2 +- c-api/long.po | 2 +- c-api/mapping.po | 2 +- c-api/marshal.po | 2 +- c-api/memory.po | 2 +- c-api/memoryview.po | 2 +- c-api/method.po | 2 +- c-api/module.po | 2 +- c-api/none.po | 2 +- c-api/number.po | 2 +- c-api/objbuffer.po | 2 +- c-api/object.po | 2 +- c-api/objimpl.po | 2 +- c-api/refcounting.po | 2 +- c-api/reflection.po | 2 +- c-api/sequence.po | 2 +- c-api/set.po | 2 +- c-api/slice.po | 2 +- c-api/stable.po | 2 +- c-api/structures.po | 2 +- c-api/sys.po | 2 +- c-api/tuple.po | 2 +- c-api/type.po | 2 +- c-api/typehints.po | 2 +- c-api/typeobj.po | 2 +- c-api/unicode.po | 2 +- c-api/utilities.po | 2 +- c-api/veryhigh.po | 2 +- c-api/weakref.po | 2 +- contents.po | 2 +- copyright.po | 2 +- distributing/index.po | 2 +- extending/building.po | 2 +- extending/embedding.po | 2 +- extending/extending.po | 2 +- extending/index.po | 2 +- extending/newtypes.po | 2 +- extending/newtypes_tutorial.po | 2 +- extending/windows.po | 2 +- faq/design.po | 2 +- faq/extending.po | 2 +- faq/general.po | 2 +- faq/gui.po | 2 +- faq/index.po | 2 +- faq/installed.po | 2 +- faq/library.po | 2 +- faq/programming.po | 2 +- faq/windows.po | 2 +- glossary.po | 2 +- howto/annotations.po | 2 +- howto/argparse.po | 2 +- howto/clinic.po | 2 +- howto/cporting.po | 2 +- howto/curses.po | 2 +- howto/descriptor.po | 2 +- howto/enum.po | 2 +- howto/functional.po | 2 +- howto/index.po | 2 +- howto/instrumentation.po | 2 +- howto/ipaddress.po | 2 +- howto/isolating-extensions.po | 2 +- howto/logging-cookbook.po | 2 +- howto/logging.po | 2 +- howto/pyporting.po | 2 +- howto/regex.po | 2 +- howto/sockets.po | 2 +- howto/sorting.po | 2 +- howto/unicode.po | 2 +- howto/urllib2.po | 2 +- includes/wasm-notavail.po | 2 +- install/index.po | 2 +- installing/index.po | 2 +- library/2to3.po | 2 +- library/__future__.po | 2 +- library/__main__.po | 2 +- library/_thread.po | 2 +- library/abc.po | 2 +- library/aifc.po | 2 +- library/allos.po | 2 +- library/archiving.po | 2 +- library/argparse.po | 2 +- library/array.po | 2 +- library/ast.po | 2 +- library/asyncio-api-index.po | 2 +- library/asyncio-dev.po | 2 +- library/asyncio-eventloop.po | 2 +- library/asyncio-exceptions.po | 2 +- library/asyncio-extending.po | 2 +- library/asyncio-future.po | 2 +- library/asyncio-llapi-index.po | 2 +- library/asyncio-platforms.po | 2 +- library/asyncio-policy.po | 2 +- library/asyncio-protocol.po | 2 +- library/asyncio-queue.po | 2 +- library/asyncio-runner.po | 2 +- library/asyncio-stream.po | 2 +- library/asyncio-subprocess.po | 2 +- library/asyncio-sync.po | 2 +- library/asyncio-task.po | 2 +- library/asyncio.po | 2 +- library/atexit.po | 2 +- library/audioop.po | 2 +- library/audit_events.po | 2 +- library/base64.po | 2 +- library/bdb.po | 2 +- library/binary.po | 2 +- library/binascii.po | 2 +- library/bisect.po | 2 +- library/builtins.po | 2 +- library/bz2.po | 2 +- library/calendar.po | 2 +- library/cgi.po | 2 +- library/cgitb.po | 2 +- library/chunk.po | 2 +- library/cmath.po | 2 +- library/cmd.po | 2 +- library/code.po | 2 +- library/codecs.po | 2 +- library/codeop.po | 2 +- library/collections.abc.po | 2 +- library/collections.po | 2 +- library/colorsys.po | 2 +- library/compileall.po | 2 +- library/concurrency.po | 2 +- library/concurrent.futures.po | 2 +- library/concurrent.po | 2 +- library/configparser.po | 2 +- library/constants.po | 2 +- library/contextlib.po | 2 +- library/contextvars.po | 2 +- library/copy.po | 2 +- library/copyreg.po | 2 +- library/crypt.po | 2 +- library/crypto.po | 2 +- library/csv.po | 2 +- library/ctypes.po | 2 +- library/curses.ascii.po | 2 +- library/curses.panel.po | 2 +- library/curses.po | 2 +- library/custominterp.po | 2 +- library/dataclasses.po | 2 +- library/datatypes.po | 2 +- library/datetime.po | 2 +- library/dbm.po | 2 +- library/debug.po | 2 +- library/decimal.po | 2 +- library/development.po | 2 +- library/devmode.po | 2 +- library/dialog.po | 2 +- library/difflib.po | 2 +- library/dis.po | 2 +- library/distribution.po | 2 +- library/doctest.po | 2 +- library/email.charset.po | 2 +- library/email.compat32-message.po | 2 +- library/email.contentmanager.po | 2 +- library/email.encoders.po | 2 +- library/email.errors.po | 2 +- library/email.examples.po | 2 +- library/email.generator.po | 2 +- library/email.header.po | 2 +- library/email.headerregistry.po | 2 +- library/email.iterators.po | 2 +- library/email.message.po | 2 +- library/email.mime.po | 2 +- library/email.parser.po | 2 +- library/email.po | 2 +- library/email.policy.po | 2 +- library/email.utils.po | 2 +- library/ensurepip.po | 2 +- library/enum.po | 2 +- library/errno.po | 2 +- library/exceptions.po | 2 +- library/faulthandler.po | 2 +- library/fcntl.po | 2 +- library/filecmp.po | 2 +- library/fileformats.po | 2 +- library/fileinput.po | 2 +- library/filesys.po | 2 +- library/fnmatch.po | 2 +- library/fractions.po | 2 +- library/frameworks.po | 2 +- library/ftplib.po | 2 +- library/functional.po | 2 +- library/functions.po | 2 +- library/functools.po | 2 +- library/gc.po | 2 +- library/getopt.po | 2 +- library/getpass.po | 2 +- library/gettext.po | 2 +- library/glob.po | 2 +- library/graphlib.po | 2 +- library/grp.po | 2 +- library/gzip.po | 2 +- library/hashlib.po | 2 +- library/heapq.po | 2 +- library/hmac.po | 2 +- library/html.entities.po | 2 +- library/html.parser.po | 2 +- library/html.po | 2 +- library/http.client.po | 2 +- library/http.cookiejar.po | 2 +- library/http.cookies.po | 2 +- library/http.po | 2 +- library/http.server.po | 2 +- library/i18n.po | 2 +- library/idle.po | 2 +- library/imaplib.po | 2 +- library/imghdr.po | 2 +- library/importlib.metadata.po | 2 +- library/importlib.po | 2 +- library/importlib.resources.abc.po | 2 +- library/importlib.resources.po | 2 +- library/index.po | 2 +- library/inspect.po | 2 +- library/internet.po | 2 +- library/intro.po | 2 +- library/io.po | 2 +- library/ipaddress.po | 2 +- library/ipc.po | 2 +- library/itertools.po | 2 +- library/json.po | 2 +- library/keyword.po | 2 +- library/language.po | 2 +- library/linecache.po | 2 +- library/locale.po | 2 +- library/logging.config.po | 2 +- library/logging.handlers.po | 2 +- library/logging.po | 2 +- library/lzma.po | 2 +- library/mailbox.po | 2 +- library/mailcap.po | 2 +- library/markup.po | 2 +- library/marshal.po | 2 +- library/math.po | 2 +- library/mimetypes.po | 2 +- library/mm.po | 2 +- library/mmap.po | 2 +- library/modulefinder.po | 2 +- library/modules.po | 2 +- library/msilib.po | 2 +- library/msvcrt.po | 2 +- library/multiprocessing.po | 2 +- library/multiprocessing.shared_memory.po | 2 +- library/netdata.po | 2 +- library/netrc.po | 2 +- library/nis.po | 2 +- library/nntplib.po | 2 +- library/numbers.po | 2 +- library/numeric.po | 2 +- library/operator.po | 2 +- library/optparse.po | 2 +- library/os.path.po | 2 +- library/os.po | 2 +- library/ossaudiodev.po | 2 +- library/pathlib.po | 2 +- library/pdb.po | 2 +- library/persistence.po | 2 +- library/pickle.po | 2 +- library/pickletools.po | 2 +- library/pipes.po | 2 +- library/pkgutil.po | 2 +- library/platform.po | 2 +- library/plistlib.po | 2 +- library/poplib.po | 2 +- library/posix.po | 2 +- library/pprint.po | 2 +- library/profile.po | 2 +- library/pty.po | 2 +- library/pwd.po | 2 +- library/py_compile.po | 2 +- library/pyclbr.po | 2 +- library/pydoc.po | 2 +- library/pyexpat.po | 2 +- library/python.po | 2 +- library/queue.po | 2 +- library/quopri.po | 2 +- library/random.po | 2 +- library/re.po | 2 +- library/readline.po | 2 +- library/reprlib.po | 2 +- library/resource.po | 2 +- library/rlcompleter.po | 2 +- library/runpy.po | 2 +- library/sched.po | 2 +- library/secrets.po | 2 +- library/security_warnings.po | 2 +- library/select.po | 2 +- library/selectors.po | 2 +- library/shelve.po | 2 +- library/shlex.po | 2 +- library/shutil.po | 2 +- library/signal.po | 2 +- library/site.po | 2 +- library/smtplib.po | 2 +- library/sndhdr.po | 2 +- library/socket.po | 2 +- library/socketserver.po | 2 +- library/spwd.po | 2 +- library/sqlite3.po | 2 +- library/ssl.po | 2 +- library/stat.po | 2 +- library/statistics.po | 2 +- library/stdtypes.po | 2 +- library/string.po | 2 +- library/stringprep.po | 2 +- library/struct.po | 2 +- library/subprocess.po | 2 +- library/sunau.po | 2 +- library/superseded.po | 2 +- library/symtable.po | 2 +- library/sys.po | 2 +- library/sys_path_init.po | 2 +- library/sysconfig.po | 2 +- library/syslog.po | 2 +- library/tabnanny.po | 2 +- library/tarfile.po | 2 +- library/telnetlib.po | 2 +- library/tempfile.po | 2 +- library/termios.po | 2 +- library/test.po | 2 +- library/text.po | 2 +- library/textwrap.po | 2 +- library/threading.po | 2 +- library/time.po | 2 +- library/timeit.po | 2 +- library/tk.po | 2 +- library/tkinter.colorchooser.po | 2 +- library/tkinter.dnd.po | 2 +- library/tkinter.font.po | 2 +- library/tkinter.messagebox.po | 2 +- library/tkinter.po | 2 +- library/tkinter.scrolledtext.po | 2 +- library/tkinter.tix.po | 2 +- library/tkinter.ttk.po | 2 +- library/token.po | 2 +- library/tokenize.po | 2 +- library/tomllib.po | 2 +- library/trace.po | 2 +- library/traceback.po | 2 +- library/tracemalloc.po | 2 +- library/tty.po | 2 +- library/turtle.po | 2 +- library/types.po | 2 +- library/typing.po | 2 +- library/unicodedata.po | 2 +- library/unittest.mock-examples.po | 2 +- library/unittest.mock.po | 2 +- library/unittest.po | 2 +- library/unix.po | 2 +- library/urllib.error.po | 2 +- library/urllib.parse.po | 2 +- library/urllib.po | 2 +- library/urllib.request.po | 2 +- library/urllib.robotparser.po | 2 +- library/uu.po | 2 +- library/uuid.po | 2 +- library/venv.po | 2 +- library/warnings.po | 2 +- library/wave.po | 2 +- library/weakref.po | 2 +- library/webbrowser.po | 2 +- library/windows.po | 2 +- library/winreg.po | 2 +- library/winsound.po | 2 +- library/wsgiref.po | 2 +- library/xdrlib.po | 2 +- library/xml.dom.minidom.po | 2 +- library/xml.dom.po | 2 +- library/xml.dom.pulldom.po | 2 +- library/xml.etree.elementtree.po | 2 +- library/xml.po | 2 +- library/xml.sax.handler.po | 2 +- library/xml.sax.po | 2 +- library/xml.sax.reader.po | 2 +- library/xml.sax.utils.po | 2 +- library/xmlrpc.client.po | 2 +- library/xmlrpc.po | 2 +- library/xmlrpc.server.po | 2 +- library/zipapp.po | 2 +- library/zipfile.po | 2 +- library/zipimport.po | 2 +- library/zlib.po | 2 +- library/zoneinfo.po | 2 +- license.po | 2 +- reference/compound_stmts.po | 2 +- reference/datamodel.po | 2 +- reference/executionmodel.po | 2 +- reference/expressions.po | 2 +- reference/grammar.po | 2 +- reference/import.po | 2 +- reference/index.po | 2 +- reference/introduction.po | 2 +- reference/lexical_analysis.po | 2 +- reference/simple_stmts.po | 2 +- reference/toplevel_components.po | 2 +- sphinx.po | 2 +- tutorial/appendix.po | 2 +- tutorial/appetite.po | 2 +- tutorial/classes.po | 2 +- tutorial/controlflow.po | 2 +- tutorial/datastructures.po | 2 +- tutorial/errors.po | 2 +- tutorial/floatingpoint.po | 2 +- tutorial/index.po | 2 +- tutorial/inputoutput.po | 2 +- tutorial/interactive.po | 2 +- tutorial/interpreter.po | 2 +- tutorial/introduction.po | 2 +- tutorial/modules.po | 2 +- tutorial/stdlib.po | 2 +- tutorial/stdlib2.po | 2 +- tutorial/venv.po | 2 +- tutorial/whatnow.po | 2 +- using/cmdline.po | 2 +- using/configure.po | 2 +- using/editors.po | 2 +- using/index.po | 2 +- using/mac.po | 2 +- using/unix.po | 2 +- using/windows.po | 2 +- whatsnew/2.0.po | 2 +- whatsnew/2.1.po | 2 +- whatsnew/2.2.po | 2 +- whatsnew/2.3.po | 2 +- whatsnew/2.4.po | 2 +- whatsnew/2.5.po | 2 +- whatsnew/2.6.po | 2 +- whatsnew/2.7.po | 2 +- whatsnew/3.0.po | 2 +- whatsnew/3.1.po | 2 +- whatsnew/3.10.po | 2 +- whatsnew/3.11.po | 2 +- whatsnew/3.2.po | 2 +- whatsnew/3.3.po | 2 +- whatsnew/3.4.po | 2 +- whatsnew/3.5.po | 2 +- whatsnew/3.6.po | 2 +- whatsnew/3.7.po | 2 +- whatsnew/3.8.po | 2 +- whatsnew/3.9.po | 2 +- whatsnew/changelog.po | 2 +- whatsnew/index.po | 2 +- 480 files changed, 480 insertions(+), 480 deletions(-) diff --git a/about.po b/about.po index 9d4388a6eb..4b90148fd5 100644 --- a/about.po +++ b/about.po @@ -12,7 +12,7 @@ # hsiao yi , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2022-05-12 00:11+0800\n" diff --git a/bugs.po b/bugs.po index a3245d3784..1c81ad8567 100644 --- a/bugs.po +++ b/bugs.po @@ -11,7 +11,7 @@ # Steven Hsu , 2021-2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-27 00:17+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" diff --git a/c-api/abstract.po b/c-api/abstract.po index 287c8de231..e2ef911a82 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-12-09 21:20+0800\n" diff --git a/c-api/allocation.po b/c-api/allocation.po index bd495ced73..c7b9399553 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index 5e470c80ef..1791d5ded2 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-18 00:16+0000\n" "PO-Revision-Date: 2022-01-24 22:34+0800\n" diff --git a/c-api/arg.po b/c-api/arg.po index 574babaf5c..1b53e73a90 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" diff --git a/c-api/bool.po b/c-api/bool.po index c7e8a14bec..8ba775df31 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-12-09 20:47+0800\n" diff --git a/c-api/buffer.po b/c-api/buffer.po index f26e704c32..dffde5dac5 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index f291ccd701..377d1c7c3d 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/bytes.po b/c-api/bytes.po index a6831b0f60..92f4b489b0 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" diff --git a/c-api/call.po b/c-api/call.po index 8b9dc86bd7..299ed4ba40 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" diff --git a/c-api/capsule.po b/c-api/capsule.po index dcb53ea77f..771a696ffb 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" diff --git a/c-api/cell.po b/c-api/cell.po index 9a9614a074..e78cab4a30 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -9,7 +9,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2022-10-16 15:33+0800\n" diff --git a/c-api/code.po b/c-api/code.po index 6b03ba0467..25c4a6f10f 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/codec.po b/c-api/codec.po index 98e0665fb2..8ab97e9fc8 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/complex.po b/c-api/complex.po index 996c39de33..4f283a1141 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/concrete.po b/c-api/concrete.po index 5deff3863d..4db03592ba 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-11-13 20:37+0800\n" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 62d1994bb8..03fefa50b5 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/c-api/conversion.po b/c-api/conversion.po index 8e2798c38d..4644530aad 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -7,7 +7,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-08 00:21+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/c-api/coro.po b/c-api/coro.po index 406b43b215..f28ce0295f 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2021-12-09 21:15+0800\n" diff --git a/c-api/datetime.po b/c-api/datetime.po index 402d667c32..aaf1c117c2 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -8,7 +8,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-15 00:18+0000\n" "PO-Revision-Date: 2023-07-01 04:14+0800\n" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 4ceccbcf32..5e0aefbe0f 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2021-12-09 20:56+0800\n" diff --git a/c-api/dict.po b/c-api/dict.po index 60751f08db..e66d60d831 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index e8927e1dda..af5f44460c 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -6,7 +6,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" diff --git a/c-api/file.po b/c-api/file.po index 4302c7d804..d350067db4 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -7,7 +7,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-04-24 20:38+0800\n" diff --git a/c-api/float.po b/c-api/float.po index 53c8dc7856..26ca33b963 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/c-api/frame.po b/c-api/frame.po index a3847b001a..e9f7f62f6f 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/c-api/function.po b/c-api/function.po index 9e3695e11a..82a3b718aa 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -8,7 +8,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-11-12 15:45+0800\n" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index b0340c8cdd..f80c8177ca 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" diff --git a/c-api/gen.po b/c-api/gen.po index cdf17a01e5..400aa9f691 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2022-10-16 15:33+0800\n" diff --git a/c-api/import.po b/c-api/import.po index 749f1a3462..142a055500 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -6,7 +6,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" diff --git a/c-api/index.po b/c-api/index.po index cf2ff729ac..d1aa91e806 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -8,7 +8,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-07-05 21:11+0800\n" diff --git a/c-api/init.po b/c-api/init.po index ba68de5e17..5580d2c144 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -6,7 +6,7 @@ # Adrian Liaw , 2018 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" diff --git a/c-api/init_config.po b/c-api/init_config.po index 11789ef557..2ed97a20cd 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/c-api/intro.po b/c-api/intro.po index 46a3ebb54c..6aade09464 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -6,7 +6,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" diff --git a/c-api/iter.po b/c-api/iter.po index 6dcb4ca5bd..6cb20cd35f 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -6,7 +6,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-04-03 00:14+0000\n" "PO-Revision-Date: 2023-07-01 03:44+0800\n" diff --git a/c-api/iterator.po b/c-api/iterator.po index 9d42bec5a6..748615e442 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/c-api/list.po b/c-api/list.po index fba408a4e1..b5fb0dd15f 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -6,7 +6,7 @@ # Nkeys Syu , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-03-03 20:35+0800\n" diff --git a/c-api/long.po b/c-api/long.po index 647b941dcc..3fcacd8eaf 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" diff --git a/c-api/mapping.po b/c-api/mapping.po index a1f1fd8cf1..eb5e539d3e 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" diff --git a/c-api/marshal.po b/c-api/marshal.po index a50a1df4d1..5dcf61e774 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-03 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" diff --git a/c-api/memory.po b/c-api/memory.po index 677375a189..66ab7313d4 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -6,7 +6,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 262161504b..0984f7f854 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/method.po b/c-api/method.po index 95c510baa9..3a025153c9 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-01-24 22:22+0800\n" diff --git a/c-api/module.po b/c-api/module.po index 5fab81a82e..c56523e7bb 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" diff --git a/c-api/none.po b/c-api/none.po index 8b9c64ffd9..9f532a2634 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/number.po b/c-api/number.po index a77858a6c8..974e18f1bc 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/objbuffer.po b/c-api/objbuffer.po index ccf7fed887..8b850ef948 100644 --- a/c-api/objbuffer.po +++ b/c-api/objbuffer.po @@ -7,7 +7,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2023-07-01 04:33+0800\n" diff --git a/c-api/object.po b/c-api/object.po index 56c73da748..b0a56f9468 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index e8bf37cb14..7ae527d6fb 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 084a397ade..3135285199 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -6,7 +6,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-01 14:19+0800\n" diff --git a/c-api/reflection.po b/c-api/reflection.po index fb19748a1f..4e79dfcc6d 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/sequence.po b/c-api/sequence.po index 3a0e1451b1..a2e2117a3a 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" diff --git a/c-api/set.po b/c-api/set.po index bd2c3f3855..eecf572d6e 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/slice.po b/c-api/slice.po index 3aefbb0a95..39ab0db837 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/stable.po b/c-api/stable.po index e04e3f1dd6..7f6405b6f6 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" diff --git a/c-api/structures.po b/c-api/structures.po index 4d19b0270b..a097366367 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/sys.po b/c-api/sys.po index 559dca616f..3ae4ed08ad 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -8,7 +8,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" diff --git a/c-api/tuple.po b/c-api/tuple.po index cdf2960082..6078edfe92 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/c-api/type.po b/c-api/type.po index 18ff9d72a5..4a53443559 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/c-api/typehints.po b/c-api/typehints.po index 2a7f76ba83..7a522c1395 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2022-10-16 16:16+0800\n" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index f09c94df55..62ca193f90 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" diff --git a/c-api/unicode.po b/c-api/unicode.po index 7e115e28f3..2f70e80c16 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" diff --git a/c-api/utilities.po b/c-api/utilities.po index 431b98d7b0..71b6b1c0b7 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -8,7 +8,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-01-31 17:38+0800\n" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index f5e19d4699..c8d6b710f8 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" diff --git a/c-api/weakref.po b/c-api/weakref.po index 7567ff6d02..9afb921434 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/contents.po b/contents.po index fed399587e..6a7a4c49cb 100644 --- a/contents.po +++ b/contents.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/copyright.po b/copyright.po index b927148cc0..add619c6e3 100644 --- a/copyright.po +++ b/copyright.po @@ -9,7 +9,7 @@ # meowmeowcat , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-01-10 00:17+0000\n" "PO-Revision-Date: 2021-06-25 20:17+0800\n" diff --git a/distributing/index.po b/distributing/index.po index e9833900e0..2275126ded 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -7,7 +7,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" diff --git a/extending/building.po b/extending/building.po index 35f84eb250..e638c4f94d 100644 --- a/extending/building.po +++ b/extending/building.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" diff --git a/extending/embedding.po b/extending/embedding.po index 4ab7fb15af..7195772150 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" diff --git a/extending/extending.po b/extending/extending.po index fe723f910b..72c4cc5d2d 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" diff --git a/extending/index.po b/extending/index.po index 4b89c55c82..90d2e8c013 100644 --- a/extending/index.po +++ b/extending/index.po @@ -6,7 +6,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-05 00:19+0000\n" "PO-Revision-Date: 2021-07-06 22:18+0800\n" diff --git a/extending/newtypes.po b/extending/newtypes.po index 763762fed1..ae549979a1 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 292f9b70d5..e1b0bc549d 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/extending/windows.po b/extending/windows.po index d91bf2c5d8..5e2c101fb5 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/faq/design.po b/faq/design.po index fbdc9aeb4e..4fd16d64f1 100644 --- a/faq/design.po +++ b/faq/design.po @@ -6,7 +6,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-18 13:10+0800\n" diff --git a/faq/extending.po b/faq/extending.po index 906fb55984..72715f7294 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2023-02-18 13:08+0800\n" diff --git a/faq/general.po b/faq/general.po index ce531a6930..bc8ce39472 100644 --- a/faq/general.po +++ b/faq/general.po @@ -8,7 +8,7 @@ # Steven Hsu , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-19 00:18+0000\n" "PO-Revision-Date: 2023-06-23 16:56+0800\n" diff --git a/faq/gui.po b/faq/gui.po index 2a64c16c84..d22809b8e0 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -7,7 +7,7 @@ # Steven Hsu, 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2022-07-02 17:41+0800\n" diff --git a/faq/index.po b/faq/index.po index 5f4cd8cdf0..2d73109e45 100644 --- a/faq/index.po +++ b/faq/index.po @@ -6,7 +6,7 @@ # Adrian Liaw , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/faq/installed.po b/faq/installed.po index 4aa8034d22..557def12ef 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2021-12-09 21:50+0800\n" diff --git a/faq/library.po b/faq/library.po index df8581f140..13cf2d4551 100644 --- a/faq/library.po +++ b/faq/library.po @@ -7,7 +7,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2023-02-18 13:22+0800\n" diff --git a/faq/programming.po b/faq/programming.po index ea852b8782..c9a99333a9 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -8,7 +8,7 @@ # hsiao yi , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" diff --git a/faq/windows.po b/faq/windows.po index 718eb621cf..7e32a903c7 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-11-08 00:19+0000\n" "PO-Revision-Date: 2022-11-09 17:25+0800\n" diff --git a/glossary.po b/glossary.po index 648315300e..5e6d394234 100644 --- a/glossary.po +++ b/glossary.po @@ -6,7 +6,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-29 00:19+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" diff --git a/howto/annotations.po b/howto/annotations.po index bbaecf047d..95c2191a3a 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-25 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/howto/argparse.po b/howto/argparse.po index 4cf5f8be9d..d426fb254d 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -10,7 +10,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" diff --git a/howto/clinic.po b/howto/clinic.po index cd1756e00c..b9cf7fcdb9 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-19 00:54+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/cporting.po b/howto/cporting.po index f06ae74b49..2735f9fcc3 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/curses.po b/howto/curses.po index 9435ce33f9..780518edee 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-04 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/descriptor.po b/howto/descriptor.po index b02c9adf43..14130dcaee 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-25 00:20+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/enum.po b/howto/enum.po index f70425dcdf..2c8f289c56 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/howto/functional.po b/howto/functional.po index 7041c99ae0..bd60239f56 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/index.po b/howto/index.po index 7655f5e693..04346d9db9 100644 --- a/howto/index.po +++ b/howto/index.po @@ -6,7 +6,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-07-05 12:45+0800\n" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 0cb9592119..df81604478 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index b4cbb87df9..cc565d2e0d 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 4b6128f27b..994589742c 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 87eca2f103..aff058ea1a 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/logging.po b/howto/logging.po index 0de5cf099e..56e0345614 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -6,7 +6,7 @@ # 文俊 高 , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" diff --git a/howto/pyporting.po b/howto/pyporting.po index ebcc063c85..55115aa436 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -6,7 +6,7 @@ # jerrychen , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/howto/regex.po b/howto/regex.po index 9d51ba84f5..4d99613d39 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -7,7 +7,7 @@ # Kai-han Chang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/howto/sockets.po b/howto/sockets.po index e52de25c53..823d89fa8e 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: 2023-07-12 02:22+0800\n" diff --git a/howto/sorting.po b/howto/sorting.po index d72376d868..f7fbea9ba6 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -6,7 +6,7 @@ # Ching-Lung Chuang, 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/howto/unicode.po b/howto/unicode.po index 16b44ab31f..87530aabd5 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/howto/urllib2.po b/howto/urllib2.po index fa1b58ac0a..38983936ff 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -6,7 +6,7 @@ # Phate , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-23 00:16+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" diff --git a/includes/wasm-notavail.po b/includes/wasm-notavail.po index 6118e53641..e08d6b73d8 100644 --- a/includes/wasm-notavail.po +++ b/includes/wasm-notavail.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2022-10-16 07:40+0800\n" diff --git a/install/index.po b/install/index.po index 3658d32d30..f357a5a15b 100644 --- a/install/index.po +++ b/install/index.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/installing/index.po b/installing/index.po index 55d5982009..8ac251689f 100644 --- a/installing/index.po +++ b/installing/index.po @@ -8,7 +8,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:37+0800\n" diff --git a/library/2to3.po b/library/2to3.po index 6da4d344a6..25a7febf58 100644 --- a/library/2to3.po +++ b/library/2to3.po @@ -6,7 +6,7 @@ # jerrychen , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" diff --git a/library/__future__.po b/library/__future__.po index 429c8d6099..bcca6e9a8f 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2016-01-31 07:12+0000\n" diff --git a/library/__main__.po b/library/__main__.po index 374c60b159..c0dbfd168c 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/_thread.po b/library/_thread.po index ceef8f8e50..7ef4909d31 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/abc.po b/library/abc.po index 2c7f0ab247..d6810e2883 100644 --- a/library/abc.po +++ b/library/abc.po @@ -7,7 +7,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-15 00:17+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" diff --git a/library/aifc.po b/library/aifc.po index 511d58d9f0..96e5d62e0f 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 01:57+0800\n" diff --git a/library/allos.po b/library/allos.po index 3f0cc93499..cad1734fed 100644 --- a/library/allos.po +++ b/library/allos.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-15 17:54+0800\n" diff --git a/library/archiving.po b/library/archiving.po index 401e0c2f4d..d54de5aacc 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2023-02-18 14:22+0800\n" diff --git a/library/argparse.po b/library/argparse.po index 94a84572d7..4206e160ba 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" diff --git a/library/array.po b/library/array.po index d4ee8fb05d..f4df9a08c4 100644 --- a/library/array.po +++ b/library/array.po @@ -9,7 +9,7 @@ # Benson Chen , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" diff --git a/library/ast.po b/library/ast.po index 8a7240fb58..3d3224d116 100644 --- a/library/ast.po +++ b/library/ast.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index cc73e09067..2bbc23dab8 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2022-01-27 21:25+0800\n" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 59ec6569f7..974fc0041d 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2023-02-18 14:17+0800\n" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 32b9fd3ed4..c704ceed7b 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index c432a4901b..fecf2b0148 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-06 00:19+0000\n" "PO-Revision-Date: 2022-01-31 21:41+0800\n" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index b9a9a7083a..f54974b6b3 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index dd63502bec..f0d21b09fb 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-03 00:22+0000\n" "PO-Revision-Date: 2022-01-25 01:29+0800\n" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 41796dce91..7e8bd669a4 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: 2022-02-09 11:27+0800\n" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 51e65bad7b..af6269e8ce 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2022-01-17 11:37+0800\n" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index a8a4efe3ad..d3fd1d476e 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 8beea6fac6..971caf4c1e 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 67e077f2bb..f179622621 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-19 00:13+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 94addb4fa3..639f5fea43 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index bb115ff9cf..a256bb058c 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 741ac3d74d..ae024f1c76 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index 791ed4d23a..b38a5d8d26 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2022-02-09 19:27+0800\n" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 6f15e30cfd..16372ee81e 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/asyncio.po b/library/asyncio.po index fa4a29927c..3a4f1a92e2 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -6,7 +6,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" diff --git a/library/atexit.po b/library/atexit.po index c51b28b1b6..7f36e28b2b 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-01-31 07:13+0000\n" diff --git a/library/audioop.po b/library/audioop.po index 649b2a48ff..032fa9a3ea 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:00+0800\n" diff --git a/library/audit_events.po b/library/audit_events.po index 021a7904a2..d4385e78c7 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2021-12-06 21:50+0800\n" diff --git a/library/base64.po b/library/base64.po index 4373ce6611..3f854957d5 100644 --- a/library/base64.po +++ b/library/base64.po @@ -6,7 +6,7 @@ # Inndy, 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/bdb.po b/library/bdb.po index 896c11629a..db4457dfd1 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/binary.po b/library/binary.po index 0269882095..96486cf5f1 100644 --- a/library/binary.po +++ b/library/binary.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/binascii.po b/library/binascii.po index fb43286db6..2a454d8619 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" diff --git a/library/bisect.po b/library/bisect.po index 3a7c6828e5..df4faccd7f 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -9,7 +9,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-22 15:12+0800\n" diff --git a/library/builtins.po b/library/builtins.po index 721fd75c79..81cb61ca5e 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-15 20:55+0800\n" diff --git a/library/bz2.po b/library/bz2.po index 9920291a02..d3be07db75 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/calendar.po b/library/calendar.po index a47b51dade..59c41e1239 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/cgi.po b/library/cgi.po index 775e27e6eb..1f17c68dfa 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:01+0800\n" diff --git a/library/cgitb.po b/library/cgitb.po index 68b69e2151..a176be020e 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:02+0800\n" diff --git a/library/chunk.po b/library/chunk.po index 5d3734bf9e..2ed762c85b 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:03+0800\n" diff --git a/library/cmath.po b/library/cmath.po index a923b447dd..f85f0d8f4d 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/cmd.po b/library/cmd.po index baf518e35c..ab4c4ba372 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/code.po b/library/code.po index 58ecff55f9..c41efdc20b 100644 --- a/library/code.po +++ b/library/code.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/codecs.po b/library/codecs.po index cda84b34c1..80c52869c2 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" diff --git a/library/codeop.po b/library/codeop.po index 8c5ab9c9a2..9d99ee838b 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-03-31 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:28+0000\n" diff --git a/library/collections.abc.po b/library/collections.abc.po index 6916a80ebb..9c36761182 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" diff --git a/library/collections.po b/library/collections.po index da1341b093..78ac6d2647 100644 --- a/library/collections.po +++ b/library/collections.po @@ -8,7 +8,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" diff --git a/library/colorsys.po b/library/colorsys.po index f49efbe5e8..80023c1488 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2022-02-15 20:58+0800\n" diff --git a/library/compileall.po b/library/compileall.po index ac1d0cf2fe..d5c5d2582a 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" diff --git a/library/concurrency.po b/library/concurrency.po index 0d8c66fb92..51f96db2f4 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -6,7 +6,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: 2021-11-23 13:36+0800\n" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 96d0398831..90ba3a62ab 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" diff --git a/library/concurrent.po b/library/concurrent.po index ff6eaac7ac..213315cba6 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -6,7 +6,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/configparser.po b/library/configparser.po index 2b2327006d..e7185179f7 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" diff --git a/library/constants.po b/library/constants.po index 6e258e7c90..c8e5e0da01 100644 --- a/library/constants.po +++ b/library/constants.po @@ -7,7 +7,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" diff --git a/library/contextlib.po b/library/contextlib.po index c4a170b3f8..d304c5e28c 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" diff --git a/library/contextvars.po b/library/contextvars.po index bb1fd8ba3d..d3ec497566 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-21 00:15+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/library/copy.po b/library/copy.po index 513ca49d62..aaf0f8253d 100644 --- a/library/copy.po +++ b/library/copy.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-01-20 18:49+0800\n" diff --git a/library/copyreg.po b/library/copyreg.po index e474ceabe3..8ffdcc46f5 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" diff --git a/library/crypt.po b/library/crypt.po index 8871578e57..cf2b2a88d2 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-13 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/crypto.po b/library/crypto.po index 1724c1549b..49bdcb623a 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-02-15 18:06+0800\n" diff --git a/library/csv.po b/library/csv.po index d1f8db2843..bbd0f10de3 100644 --- a/library/csv.po +++ b/library/csv.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/ctypes.po b/library/ctypes.po index d31368bc58..def1539dfd 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 950f345fa3..ea44ad281a 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/curses.panel.po b/library/curses.panel.po index 15d1c66075..01d8f23987 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/curses.po b/library/curses.po index 910efc9ac2..3bb2803ad8 100644 --- a/library/curses.po +++ b/library/curses.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/custominterp.po b/library/custominterp.po index 51fa8d39ca..12ffed29b0 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/dataclasses.po b/library/dataclasses.po index c719cb5248..adf66b1e07 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" diff --git a/library/datatypes.po b/library/datatypes.po index eaab1664b9..03aca0edd2 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -4,7 +4,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2022-02-11 12:12+0800\n" diff --git a/library/datetime.po b/library/datetime.po index c26acf9c84..ae13bec8e3 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/dbm.po b/library/dbm.po index 0fc207a9e6..2903f03dd3 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -6,7 +6,7 @@ # jerrychen , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" diff --git a/library/debug.po b/library/debug.po index 6f922806fe..df784f61d1 100644 --- a/library/debug.po +++ b/library/debug.po @@ -6,7 +6,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-12-08 00:47+0800\n" diff --git a/library/decimal.po b/library/decimal.po index cd0718f0c6..44de644176 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" diff --git a/library/development.po b/library/development.po index c914ef2ae4..b993383ee9 100644 --- a/library/development.po +++ b/library/development.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/library/devmode.po b/library/devmode.po index 3112fb3a6b..f0348677ba 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/dialog.po b/library/dialog.po index 31b9fb2743..637be8f95c 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/difflib.po b/library/difflib.po index 4ee18be3a6..2af26c0865 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" diff --git a/library/dis.po b/library/dis.po index 6277450d6e..a032f7294f 100644 --- a/library/dis.po +++ b/library/dis.po @@ -6,7 +6,7 @@ # splasky Chang , 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" diff --git a/library/distribution.po b/library/distribution.po index b0572442e6..290a362914 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" diff --git a/library/doctest.po b/library/doctest.po index 006c4b0d5e..60db19b76a 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" diff --git a/library/email.charset.po b/library/email.charset.po index a5110fa22a..129293d5bb 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 666659df4a..9af25c9797 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 2f0725202c..b460146d0b 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" diff --git a/library/email.encoders.po b/library/email.encoders.po index 9bd709acdb..a50a9a08cc 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.errors.po b/library/email.errors.po index 50137db4d9..65fd76a9da 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.examples.po b/library/email.examples.po index 89291e5ee8..6c2f23cbb8 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/library/email.generator.po b/library/email.generator.po index a3452900a2..c42213c070 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-02 00:25+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.header.po b/library/email.header.po index b4c7d55729..835449f5be 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 57ed52af01..543287e4df 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.iterators.po b/library/email.iterators.po index f1c409b9b6..0abb7d3e22 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2016-11-19 00:30+0000\n" diff --git a/library/email.message.po b/library/email.message.po index 25a9ab8981..0358d305cc 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" diff --git a/library/email.mime.po b/library/email.mime.po index 527ac023ab..0488d915f8 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-01-15 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:00+0000\n" diff --git a/library/email.parser.po b/library/email.parser.po index 396b5ca2b9..dd5e9f4957 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/email.po b/library/email.po index 39e854f2cf..584ae34cfc 100644 --- a/library/email.po +++ b/library/email.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/email.policy.po b/library/email.policy.po index 452fa54120..b70332a7cb 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/email.utils.po b/library/email.utils.po index 2918eb0d80..9a4477fbd0 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/ensurepip.po b/library/ensurepip.po index b5efeb0ddf..7bb297f5c4 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/enum.po b/library/enum.po index c9a1dcacc0..e045611996 100644 --- a/library/enum.po +++ b/library/enum.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/errno.po b/library/errno.po index 8cf3b06e9b..31b37592c1 100644 --- a/library/errno.po +++ b/library/errno.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/exceptions.po b/library/exceptions.po index ba9bec1d90..97ba6b680b 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-06 16:53+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/faulthandler.po b/library/faulthandler.po index fe9904c62b..4d1eeeb54b 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-05 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/fcntl.po b/library/fcntl.po index 1e75839965..ceb8def68d 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" diff --git a/library/filecmp.po b/library/filecmp.po index 6383c53b44..1bafdd047c 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/fileformats.po b/library/fileformats.po index 00aa1b6aa9..567de48562 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/library/fileinput.po b/library/fileinput.po index 31496d1c14..f0d0ce2e16 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" diff --git a/library/filesys.po b/library/filesys.po index 6d50e17b50..d72a5b8f66 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -7,7 +7,7 @@ # Allen Wu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2021-11-22 20:13+0800\n" diff --git a/library/fnmatch.po b/library/fnmatch.po index cfaac15206..2dc1136128 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" diff --git a/library/fractions.po b/library/fractions.po index 081eb55de5..0c6547260d 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-01-31 07:18+0000\n" diff --git a/library/frameworks.po b/library/frameworks.po index 2550281dc6..477b78ad21 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/library/ftplib.po b/library/ftplib.po index 7a0f98e809..e2b5ae2e73 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" diff --git a/library/functional.po b/library/functional.po index 537726bb2d..9c3ef0e55d 100644 --- a/library/functional.po +++ b/library/functional.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/library/functions.po b/library/functions.po index 50beda7161..7f2d0316c4 100644 --- a/library/functions.po +++ b/library/functions.po @@ -7,7 +7,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-09 00:21+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" diff --git a/library/functools.po b/library/functools.po index 34a683985e..83a9ae983a 100644 --- a/library/functools.po +++ b/library/functools.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" diff --git a/library/gc.po b/library/gc.po index 242d2e7b9a..9686a08b20 100644 --- a/library/gc.po +++ b/library/gc.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" diff --git a/library/getopt.po b/library/getopt.po index f6dd3f2934..24213c350c 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2016-01-31 07:19+0000\n" diff --git a/library/getpass.po b/library/getpass.po index 1acfcd01b2..0071e94f7d 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" diff --git a/library/gettext.po b/library/gettext.po index bde210fbae..87ff788d99 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" diff --git a/library/glob.po b/library/glob.po index dda5fff76b..aa2694f2d0 100644 --- a/library/glob.po +++ b/library/glob.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-24 01:21+0800\n" diff --git a/library/graphlib.po b/library/graphlib.po index da81e0b06a..6684be3507 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -6,7 +6,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-15 00:17+0000\n" "PO-Revision-Date: 2023-01-04 16:35+0800\n" diff --git a/library/grp.po b/library/grp.po index ffed750cbc..2946fffafe 100644 --- a/library/grp.po +++ b/library/grp.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" diff --git a/library/gzip.po b/library/gzip.po index d70a3c98a7..f9a8fa3e00 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" diff --git a/library/hashlib.po b/library/hashlib.po index fe8046db21..a9c43d8919 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" diff --git a/library/heapq.po b/library/heapq.po index 14402cfdfc..b7753731ea 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -7,7 +7,7 @@ # 周 忠毅 , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-19 17:24+0800\n" "PO-Revision-Date: 2023-07-01 18:20+0800\n" diff --git a/library/hmac.po b/library/hmac.po index fe820f2db4..7a9c1f27af 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -7,7 +7,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" "PO-Revision-Date: 2022-03-30 00:16+0800\n" diff --git a/library/html.entities.po b/library/html.entities.po index 5faa406fb2..16e4cf52a6 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:38+0800\n" diff --git a/library/html.parser.po b/library/html.parser.po index ae523259bc..6b2e17cfe4 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-18 00:10+0000\n" "PO-Revision-Date: 2023-05-04 22:54+0800\n" diff --git a/library/html.po b/library/html.po index de6bda829c..361d1c2069 100644 --- a/library/html.po +++ b/library/html.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-19 17:24+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/http.client.po b/library/http.client.po index b4967150dc..4824089cc6 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 2f88ea9ea1..022fe9d2ee 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" diff --git a/library/http.cookies.po b/library/http.cookies.po index 1c3adeb334..bce3a699b1 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" diff --git a/library/http.po b/library/http.po index c66ae81224..e9408ea228 100644 --- a/library/http.po +++ b/library/http.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" diff --git a/library/http.server.po b/library/http.server.po index 4a313cd99e..006943c8ba 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" diff --git a/library/i18n.po b/library/i18n.po index 86d22b424c..2c13431f30 100644 --- a/library/i18n.po +++ b/library/i18n.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\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" diff --git a/library/idle.po b/library/idle.po index 8dbaa5659f..2686b61b6a 100644 --- a/library/idle.po +++ b/library/idle.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" diff --git a/library/imaplib.po b/library/imaplib.po index d3ee1d4425..2c06a0a901 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" diff --git a/library/imghdr.po b/library/imghdr.po index 80b1b8ded5..ba14438d14 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-05-22 02:06+0800\n" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 8c6c8be0e3..8c311c0c79 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/importlib.po b/library/importlib.po index aa14f698a5..ba9020799b 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 60a590ab0c..887ad7dcb9 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 3cab3729b6..0ea74a8221 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/index.po b/library/index.po index 359ad0f479..483e6ba1ad 100644 --- a/library/index.po +++ b/library/index.po @@ -9,7 +9,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-11-10 00:19+0000\n" "PO-Revision-Date: 2021-07-04 22:55+0800\n" diff --git a/library/inspect.po b/library/inspect.po index e8239b56c7..3a1d2173e9 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" diff --git a/library/internet.po b/library/internet.po index c3fad0d882..cb9d7e3f9b 100644 --- a/library/internet.po +++ b/library/internet.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/intro.po b/library/intro.po index 27ed2e4445..a90a3416b5 100644 --- a/library/intro.po +++ b/library/intro.po @@ -9,7 +9,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2021-10-26 17:01+0800\n" diff --git a/library/io.po b/library/io.po index 44b4cd6031..6f0fba9984 100644 --- a/library/io.po +++ b/library/io.po @@ -4,7 +4,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-07-17 17:38+0800\n" diff --git a/library/ipaddress.po b/library/ipaddress.po index f1ae07024b..5579254068 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-12 19:07+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" diff --git a/library/ipc.po b/library/ipc.po index e2372b49ff..f024e94b8e 100644 --- a/library/ipc.po +++ b/library/ipc.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-09-20 15:25+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/itertools.po b/library/itertools.po index 4396d28134..91e47042bf 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" diff --git a/library/json.po b/library/json.po index d25aeb93d4..c883f53a92 100644 --- a/library/json.po +++ b/library/json.po @@ -6,7 +6,7 @@ # Asoul Yang , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" diff --git a/library/keyword.po b/library/keyword.po index 32c4da97a0..1a65b53643 100644 --- a/library/keyword.po +++ b/library/keyword.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-19 00:09+0000\n" "PO-Revision-Date: 2022-01-18 14:55+0800\n" diff --git a/library/language.po b/library/language.po index b691b7c1a1..91a152d608 100644 --- a/library/language.po +++ b/library/language.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/linecache.po b/library/linecache.po index dd61b200bd..c637efefa4 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/locale.po b/library/locale.po index 7ebeda6b14..0afee18ed9 100644 --- a/library/locale.po +++ b/library/locale.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/logging.config.po b/library/logging.config.po index cf82178a69..5c32192cc9 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index e783e1d915..ad5fc3e568 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/logging.po b/library/logging.po index 15c1c8ef49..56e808bc5e 100644 --- a/library/logging.po +++ b/library/logging.po @@ -6,7 +6,7 @@ # Andy Dai , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/lzma.po b/library/lzma.po index a2e0a64ac0..d860157624 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/mailbox.po b/library/mailbox.po index 2efc914822..a9f92f7cc2 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/mailcap.po b/library/mailcap.po index 8170608734..55574c3210 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/markup.po b/library/markup.po index ea9cea76b3..63aaa070ba 100644 --- a/library/markup.po +++ b/library/markup.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/marshal.po b/library/marshal.po index 3c78f4aad0..e9c552c60d 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-04-24 21:28+0800\n" diff --git a/library/math.po b/library/math.po index 69a14116af..fb3969ca2c 100644 --- a/library/math.po +++ b/library/math.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" diff --git a/library/mimetypes.po b/library/mimetypes.po index a5211787a3..673af8a89d 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" diff --git a/library/mm.po b/library/mm.po index e2c636f172..e3d6db2942 100644 --- a/library/mm.po +++ b/library/mm.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-01-18 14:54+0800\n" diff --git a/library/mmap.po b/library/mmap.po index e878e0e577..9350ce99a5 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/modulefinder.po b/library/modulefinder.po index 8defa57637..fa6a134272 100644 --- a/library/modulefinder.po +++ b/library/modulefinder.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/modules.po b/library/modules.po index 90c3aee7e0..f1928e20b0 100644 --- a/library/modules.po +++ b/library/modules.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/library/msilib.po b/library/msilib.po index 6f0515eb3f..d441ba059f 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/msvcrt.po b/library/msvcrt.po index a457a905a1..6c0112468c 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index c7fc0d09f7..23b73504cb 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 25f86ed2c5..2b3107a5b8 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/netdata.po b/library/netdata.po index b78c5e9fa6..8f8a8899d5 100644 --- a/library/netdata.po +++ b/library/netdata.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2023-01-23 23:33+0800\n" diff --git a/library/netrc.po b/library/netrc.po index 9c63fe0d4d..bc1a526daa 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/nis.po b/library/nis.po index 1cd0a75d6d..91391ed1ce 100644 --- a/library/nis.po +++ b/library/nis.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" diff --git a/library/nntplib.po b/library/nntplib.po index 0e42f395d3..97c6d8e357 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" diff --git a/library/numbers.po b/library/numbers.po index 7ebdf792ca..c776e0b454 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -7,7 +7,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-16 04:24+0800\n" "PO-Revision-Date: 2022-11-16 04:57+0800\n" diff --git a/library/numeric.po b/library/numeric.po index 04e252428c..85a8f226d0 100644 --- a/library/numeric.po +++ b/library/numeric.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/library/operator.po b/library/operator.po index 5d825605c9..58a3a3506a 100644 --- a/library/operator.po +++ b/library/operator.po @@ -7,7 +7,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-22 00:16+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" diff --git a/library/optparse.po b/library/optparse.po index 1a68598e2e..8cc4650e80 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" diff --git a/library/os.path.po b/library/os.path.po index 3eb9ac075c..bf37ceefeb 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" diff --git a/library/os.po b/library/os.po index 94495b80c0..ed4cde5b00 100644 --- a/library/os.po +++ b/library/os.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po index 2ea1c044e9..9b7bddb82e 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2022-05-22 02:10+0800\n" diff --git a/library/pathlib.po b/library/pathlib.po index 7b2a70be88..96f16f5065 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-11 01:08+0800\n" diff --git a/library/pdb.po b/library/pdb.po index f671c5733c..33107bff82 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" diff --git a/library/persistence.po b/library/persistence.po index 342711c9fc..172322d5a4 100644 --- a/library/persistence.po +++ b/library/persistence.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/pickle.po b/library/pickle.po index 686702a3c6..dfb9a4f3f5 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" diff --git a/library/pickletools.po b/library/pickletools.po index 990fef4ac3..a767c0487e 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" diff --git a/library/pipes.po b/library/pipes.po index 966c3bd3bb..db608b386d 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2022-05-22 02:11+0800\n" diff --git a/library/pkgutil.po b/library/pkgutil.po index daf96b4ee6..35246df175 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" diff --git a/library/platform.po b/library/platform.po index e451341669..66906e9a9f 100644 --- a/library/platform.po +++ b/library/platform.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" diff --git a/library/plistlib.po b/library/plistlib.po index f3ad2aca33..d6f49591a5 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" diff --git a/library/poplib.po b/library/poplib.po index 1059435461..715710a7de 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" diff --git a/library/posix.po b/library/posix.po index a4587fed19..7f86596528 100644 --- a/library/posix.po +++ b/library/posix.po @@ -5,7 +5,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" diff --git a/library/pprint.po b/library/pprint.po index 48282c8e41..68b748ec5b 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" diff --git a/library/profile.po b/library/profile.po index 6b6f7b0970..07d71efeb7 100644 --- a/library/profile.po +++ b/library/profile.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" diff --git a/library/pty.po b/library/pty.po index b85c8e444d..fc73817328 100644 --- a/library/pty.po +++ b/library/pty.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" diff --git a/library/pwd.po b/library/pwd.po index eb5579987b..1ac2d5f4cc 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" diff --git a/library/py_compile.po b/library/py_compile.po index 6f1ebf45cd..9d9d843043 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" diff --git a/library/pyclbr.po b/library/pyclbr.po index a3226c9dcf..b2f92883df 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/library/pydoc.po b/library/pydoc.po index 55fa57b91d..d02128e2a7 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/pyexpat.po b/library/pyexpat.po index 68621b8be2..f3a0514505 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" diff --git a/library/python.po b/library/python.po index 105047523a..0530ffa7ab 100644 --- a/library/python.po +++ b/library/python.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/queue.po b/library/queue.po index d0cfe00f62..a729993bfd 100644 --- a/library/queue.po +++ b/library/queue.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-23 00:17+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" diff --git a/library/quopri.po b/library/quopri.po index a3e5fcedd5..a70df37e66 100644 --- a/library/quopri.po +++ b/library/quopri.po @@ -4,7 +4,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-07-01 14:59+0800\n" diff --git a/library/random.po b/library/random.po index e31aec713a..d61258b9d7 100644 --- a/library/random.po +++ b/library/random.po @@ -6,7 +6,7 @@ # Allen Wu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" diff --git a/library/re.po b/library/re.po index 7ca0bb7b97..e577102032 100644 --- a/library/re.po +++ b/library/re.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-05-20 13:44+0800\n" diff --git a/library/readline.po b/library/readline.po index 09a4d5046f..07ee828e04 100644 --- a/library/readline.po +++ b/library/readline.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/reprlib.po b/library/reprlib.po index e6657bafdc..aacdbff87f 100644 --- a/library/reprlib.po +++ b/library/reprlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/resource.po b/library/resource.po index a09e4835d8..33d3fbd3b1 100644 --- a/library/resource.po +++ b/library/resource.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/rlcompleter.po b/library/rlcompleter.po index fd65ae4b4f..b41f0a6bce 100644 --- a/library/rlcompleter.po +++ b/library/rlcompleter.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/runpy.po b/library/runpy.po index c88a46c82e..43339e044b 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" diff --git a/library/sched.po b/library/sched.po index 1c6847c5ce..d8c0582ccb 100644 --- a/library/sched.po +++ b/library/sched.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/secrets.po b/library/secrets.po index 4e01c359b3..bfbd0de256 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -6,7 +6,7 @@ # bonzo , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-11-27 00:19+0000\n" "PO-Revision-Date: 2022-11-30 13:42+0800\n" diff --git a/library/security_warnings.po b/library/security_warnings.po index 05076b84e7..a706bc13ae 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/select.po b/library/select.po index 7a0e345319..79302136d3 100644 --- a/library/select.po +++ b/library/select.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/selectors.po b/library/selectors.po index c8cb992f52..e3096b3df8 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/shelve.po b/library/shelve.po index 578f0d038c..c89f78d767 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/shlex.po b/library/shlex.po index 3ada498053..c231b26be3 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" diff --git a/library/shutil.po b/library/shutil.po index e301d81fec..7d9d2a7dcb 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/signal.po b/library/signal.po index 24d1942c18..be7aa7e009 100644 --- a/library/signal.po +++ b/library/signal.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-04-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/site.po b/library/site.po index c5e586d0fc..37bb58f89f 100644 --- a/library/site.po +++ b/library/site.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/smtplib.po b/library/smtplib.po index 8fcff80c21..80d8fcea19 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/sndhdr.po b/library/sndhdr.po index 95b99ea7dd..5bcb12ae95 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-06-11 15:40+0800\n" diff --git a/library/socket.po b/library/socket.po index 32080a3577..eaacda1a31 100644 --- a/library/socket.po +++ b/library/socket.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/socketserver.po b/library/socketserver.po index b831e1929f..839a184072 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/spwd.po b/library/spwd.po index 2f0d265fd8..7d481ba339 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2022-05-22 02:14+0800\n" diff --git a/library/sqlite3.po b/library/sqlite3.po index 19605a7de7..bb167120b2 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-19 00:54+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/ssl.po b/library/ssl.po index acd59996bb..2f978b200b 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" diff --git a/library/stat.po b/library/stat.po index c86ac54041..22592abc57 100644 --- a/library/stat.po +++ b/library/stat.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" diff --git a/library/statistics.po b/library/statistics.po index 4a8f381aa4..4dd6969c9a 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -6,7 +6,7 @@ # KentHsu , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2023-07-17 18:00+0800\n" diff --git a/library/stdtypes.po b/library/stdtypes.po index 0302308745..bbf06b1866 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -8,7 +8,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-23 16:50+0800\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" diff --git a/library/string.po b/library/string.po index 183c30e0d9..e90d211cfe 100644 --- a/library/string.po +++ b/library/string.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" diff --git a/library/stringprep.po b/library/stringprep.po index cc2d51f686..5114ad1eb7 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" diff --git a/library/struct.po b/library/struct.po index a620b168a3..6b5723362f 100644 --- a/library/struct.po +++ b/library/struct.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" diff --git a/library/subprocess.po b/library/subprocess.po index a332b25463..53c1babf03 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" diff --git a/library/sunau.po b/library/sunau.po index 47a0a831ea..1a70de77e5 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -6,7 +6,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" diff --git a/library/superseded.po b/library/superseded.po index c1d76df82c..81bdaff9d0 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-15 20:45+0800\n" diff --git a/library/symtable.po b/library/symtable.po index 6f7ee89852..7a0f028965 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/sys.po b/library/sys.po index 759c971643..ed432cdea5 100644 --- a/library/sys.po +++ b/library/sys.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" diff --git a/library/sys_path_init.po b/library/sys_path_init.po index ef4f0cc47e..d71020ccda 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/sysconfig.po b/library/sysconfig.po index 5fbd96a8b2..41c53f130d 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/syslog.po b/library/syslog.po index 8c1e4a56f5..2791fb254d 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/tabnanny.po b/library/tabnanny.po index 32d796a3de..c12ffb8a73 100644 --- a/library/tabnanny.po +++ b/library/tabnanny.po @@ -7,7 +7,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-11-17 21:19+0800\n" diff --git a/library/tarfile.po b/library/tarfile.po index 0324ebeb22..ca63d3d5f3 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/telnetlib.po b/library/telnetlib.po index ae947b6f35..e8471c9f5a 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:15+0800\n" diff --git a/library/tempfile.po b/library/tempfile.po index 98895343da..024733ad45 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -7,7 +7,7 @@ # Matt Wang , 2021-2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" diff --git a/library/termios.po b/library/termios.po index f70f5ddfd8..481411f60f 100644 --- a/library/termios.po +++ b/library/termios.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/test.po b/library/test.po index 24a9bf0e68..11dc75c124 100644 --- a/library/test.po +++ b/library/test.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/text.po b/library/text.po index dbae57a407..3a51a505f5 100644 --- a/library/text.po +++ b/library/text.po @@ -7,7 +7,7 @@ # Jordan Su , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-10-17 22:18+0800\n" diff --git a/library/textwrap.po b/library/textwrap.po index 8db110a383..440dca0c47 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" diff --git a/library/threading.po b/library/threading.po index fc1f5efc0b..272daaae9a 100644 --- a/library/threading.po +++ b/library/threading.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/time.po b/library/time.po index 196d6dbbb3..001fe0f4e4 100644 --- a/library/time.po +++ b/library/time.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" diff --git a/library/timeit.po b/library/timeit.po index ed1b437a87..d813034cd4 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" diff --git a/library/tk.po b/library/tk.po index d49dafe375..184e8e98a4 100644 --- a/library/tk.po +++ b/library/tk.po @@ -6,7 +6,7 @@ # Matt Wang , 2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2023-06-24 17:09+0800\n" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index 88ceebe5ef..039c10a363 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 767923d919..bd8734903f 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 286d4ee56b..5c7ef10a73 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 36946463a5..e773cefb23 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/library/tkinter.po b/library/tkinter.po index cb1b20b514..14653776cd 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index ec56c559b6..aa717d0acb 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" diff --git a/library/tkinter.tix.po b/library/tkinter.tix.po index 07cd5f547b..bea609cd02 100644 --- a/library/tkinter.tix.po +++ b/library/tkinter.tix.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-10-01 14:35+0800\n" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 7fd2f41802..0a9f25275f 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/token.po b/library/token.po index 11985c4d6f..7fda9b8d6d 100644 --- a/library/token.po +++ b/library/token.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/tokenize.po b/library/tokenize.po index 431c129a23..d8b04edc57 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/tomllib.po b/library/tomllib.po index 26a2469ee7..ba3ffc2c57 100644 --- a/library/tomllib.po +++ b/library/tomllib.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2022-11-18 01:56+0800\n" diff --git a/library/trace.po b/library/trace.po index 37d3de3ba0..f9a54b0c64 100644 --- a/library/trace.po +++ b/library/trace.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/traceback.po b/library/traceback.po index fc9931a2fe..eda90a6d58 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 4871780fa7..ad37bf377d 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-18 00:10+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/tty.po b/library/tty.po index 80cf99694c..1a933d2ef3 100644 --- a/library/tty.po +++ b/library/tty.po @@ -7,7 +7,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" diff --git a/library/turtle.po b/library/turtle.po index 7b0876294a..7a026c328b 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -6,7 +6,7 @@ # Renyuan Lyu , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" diff --git a/library/types.po b/library/types.po index c3c7b079c2..c5476075e6 100644 --- a/library/types.po +++ b/library/types.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" diff --git a/library/typing.po b/library/typing.po index 2b3e1dd02c..5d4181011d 100644 --- a/library/typing.po +++ b/library/typing.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-27 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" diff --git a/library/unicodedata.po b/library/unicodedata.po index 227024a10a..fdca63aa8a 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index e2915a76e2..926c4d8e5e 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index f480a65cd1..c847263e26 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" diff --git a/library/unittest.po b/library/unittest.po index 1f7b2335f3..d5217d9c62 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -8,7 +8,7 @@ # Jason , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" diff --git a/library/unix.po b/library/unix.po index b6e6ca357a..b9fe32495a 100644 --- a/library/unix.po +++ b/library/unix.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-15 18:42+0800\n" diff --git a/library/urllib.error.po b/library/urllib.error.po index 097090d175..bdc06e8e47 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index df342a0b66..0471ef6215 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-06 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" diff --git a/library/urllib.po b/library/urllib.po index 78db07e179..e06f92755c 100644 --- a/library/urllib.po +++ b/library/urllib.po @@ -8,7 +8,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-01-31 18:04+0800\n" diff --git a/library/urllib.request.po b/library/urllib.request.po index d77aee3f2a..f56cb246a9 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -6,7 +6,7 @@ # Adrian Liaw , 2018 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-10 00:15+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" diff --git a/library/urllib.robotparser.po b/library/urllib.robotparser.po index c5002893ec..a86d5ccc60 100644 --- a/library/urllib.robotparser.po +++ b/library/urllib.robotparser.po @@ -7,7 +7,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-01-27 13:40+0800\n" diff --git a/library/uu.po b/library/uu.po index b0ca86dd63..78a9562010 100644 --- a/library/uu.po +++ b/library/uu.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-05-22 02:22+0800\n" diff --git a/library/uuid.po b/library/uuid.po index c06c6d05d5..468dc3043d 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/venv.po b/library/venv.po index d23f89ac5e..7fc6344d40 100644 --- a/library/venv.po +++ b/library/venv.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" diff --git a/library/warnings.po b/library/warnings.po index 22c4030933..e0776df6ea 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/wave.po b/library/wave.po index 28a7e207c1..f47300af03 100644 --- a/library/wave.po +++ b/library/wave.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/weakref.po b/library/weakref.po index e49c2cabcb..dcb2927e50 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-22 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/webbrowser.po b/library/webbrowser.po index 4541f6e629..46a75a1dfe 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/library/windows.po b/library/windows.po index 00c5b89e2c..4b7ffa47a2 100644 --- a/library/windows.po +++ b/library/windows.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-15 18:37+0800\n" diff --git a/library/winreg.po b/library/winreg.po index ea7c5dbae4..a993996228 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/winsound.po b/library/winsound.po index 409667ca91..fe6ef8d133 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/wsgiref.po b/library/wsgiref.po index ef144233d5..f0af46c1b2 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" diff --git a/library/xdrlib.po b/library/xdrlib.po index 8270c1c462..43f81acec7 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2016-01-31 07:33+0000\n" diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index 9d75cc0204..34a5caadbc 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-31 08:13+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" diff --git a/library/xml.dom.po b/library/xml.dom.po index 5ba98617ca..f6a4f67364 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-16 00:09+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index ac23b039a4..818fcc93e9 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 76d2b746c6..fbdf345c98 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xml.po b/library/xml.po index aacf25c687..74d112e540 100644 --- a/library/xml.po +++ b/library/xml.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 78e1ea8ecf..981c4990de 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-21 17:35+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" diff --git a/library/xml.sax.po b/library/xml.sax.po index 17f4fbf451..f8b23a51d2 100644 --- a/library/xml.sax.po +++ b/library/xml.sax.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index bce8adbe36..33d977be06 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 66cd30312f..a7df885514 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 30228022f7..e024f76feb 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/xmlrpc.po b/library/xmlrpc.po index c149f55751..e300ed1e96 100644 --- a/library/xmlrpc.po +++ b/library/xmlrpc.po @@ -5,7 +5,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2022-02-16 01:58+0800\n" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 4dd933f02e..de5a15e51f 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-13 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/zipapp.po b/library/zipapp.po index 98ba7517a7..8d2d45893f 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/zipfile.po b/library/zipfile.po index bfb41a5272..5837948100 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" diff --git a/library/zipimport.po b/library/zipimport.po index 9e1b04e390..69cf62e1ff 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/library/zlib.po b/library/zlib.po index d121a85c16..9d64c36c81 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-12-28 20:58+0800\n" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 427b63ace7..b35b8b78e5 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/license.po b/license.po index cf3b4d3da6..1cb146b32e 100644 --- a/license.po +++ b/license.po @@ -7,7 +7,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 701379f396..cff2aabb19 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/datamodel.po b/reference/datamodel.po index 0d7f98ad85..6ed88a3876 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index a20fd8167d..00cb05841b 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/expressions.po b/reference/expressions.po index 0da0aafa72..92c00d3ef6 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-03 07:57+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/grammar.po b/reference/grammar.po index 27321f015f..3e6c02ac10 100644 --- a/reference/grammar.po +++ b/reference/grammar.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-11-08 00:19+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/reference/import.po b/reference/import.po index a1884e2a73..20cc4973c8 100644 --- a/reference/import.po +++ b/reference/import.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/index.po b/reference/index.po index 35e52eea05..e91b5668fb 100644 --- a/reference/index.po +++ b/reference/index.po @@ -6,7 +6,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-07-06 22:07+0800\n" diff --git a/reference/introduction.po b/reference/introduction.po index 773ad48479..332705e041 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index e288b4c1a3..0ca8185c5b 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 8629a41451..06e241c345 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-03 07:57+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index fbb1403a56..83d92d67a5 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -7,7 +7,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-12-01 01:37+0800\n" diff --git a/sphinx.po b/sphinx.po index 977ba74e88..38d024e3ee 100644 --- a/sphinx.po +++ b/sphinx.po @@ -7,7 +7,7 @@ # Steven Hsu , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index b25bb10d20..7ee36c62e6 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -6,7 +6,7 @@ # Leon H., 2017 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 8c38d44947..89f22f2dc8 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2021-10-03 17:39+0800\n" diff --git a/tutorial/classes.po b/tutorial/classes.po index b2487415b4..5bc1b1749f 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -7,7 +7,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 7d28031c5c..41275b3e85 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -9,7 +9,7 @@ # Steven Hsu , 2021-2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-18 00:46+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index c113aae99c..193e22cf10 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -12,7 +12,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-11-02 00:20+0000\n" "PO-Revision-Date: 2022-11-12 15:11+0800\n" diff --git a/tutorial/errors.po b/tutorial/errors.po index 819a972bf7..6b9aa8b3f9 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -8,7 +8,7 @@ # Matt Wang , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-06 16:53+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index f4cb77185a..b9f25ddaf9 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -9,7 +9,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-22 14:43+0800\n" diff --git a/tutorial/index.po b/tutorial/index.po index fb0ec84d3f..ef40d056f7 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -8,7 +8,7 @@ # woodrow-shen , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" "PO-Revision-Date: 2018-06-17 11:39+0000\n" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index e4f2eba305..e3081e1fab 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -7,7 +7,7 @@ # Steven Hsu , 2021-2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-10-05 10:26+0800\n" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 494dae997c..2f9a5e9f43 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -6,7 +6,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-06-28 20:45+0800\n" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index a2d8f62302..ba971521ee 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -6,7 +6,7 @@ # Liang-Bo Wang , 2015-2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2021-05-18 16:28+0800\n" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 87ce3b6b8b..8edf83b47d 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -8,7 +8,7 @@ # Steven Hsu , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" diff --git a/tutorial/modules.po b/tutorial/modules.po index 43c91cc669..76876ade7d 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -9,7 +9,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 860ed5cf6e..3b58a82c21 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -12,7 +12,7 @@ # Phil Lin , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-01-31 18:14+0800\n" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index efb046eb80..9b45cbb0a1 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -8,7 +8,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-23 00:17+0000\n" "PO-Revision-Date: 2021-06-19 14:24+0800\n" diff --git a/tutorial/venv.po b/tutorial/venv.po index 09286464c0..56e7eb3ec9 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-02-04 00:16+0000\n" "PO-Revision-Date: 2022-10-16 05:35+0800\n" diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 74588983da..98a92305f5 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -7,7 +7,7 @@ # meowmeowcat , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2022-10-16 05:37+0800\n" diff --git a/using/cmdline.po b/using/cmdline.po index 01eb023385..93c7ea1621 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/using/configure.po b/using/configure.po index 1d619d5fc3..f3d411598c 100644 --- a/using/configure.po +++ b/using/configure.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/using/editors.po b/using/editors.po index 47ddd4a2e7..81a486b644 100644 --- a/using/editors.po +++ b/using/editors.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/using/index.po b/using/index.po index 8dbcc3d021..85a426479f 100644 --- a/using/index.po +++ b/using/index.po @@ -6,7 +6,7 @@ # Steven Hsu , 2021 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2021-07-06 22:21+0800\n" diff --git a/using/mac.po b/using/mac.po index 8037179f3f..636fdd92ee 100644 --- a/using/mac.po +++ b/using/mac.po @@ -8,7 +8,7 @@ # Matt Wang , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" diff --git a/using/unix.po b/using/unix.po index 2078fa374b..e52c5fd184 100644 --- a/using/unix.po +++ b/using/unix.po @@ -5,7 +5,7 @@ # Matt Wang , 2022-2023 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" diff --git a/using/windows.po b/using/windows.po index cfb1e93d75..e1a214f851 100644 --- a/using/windows.po +++ b/using/windows.po @@ -7,7 +7,7 @@ # Liang-Bo Wang , 2015 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 76c848a335..2e56ee4081 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 0b9ec369b3..3a5ecdb659 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 300e6eb540..30a564b02f 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index c36d78a5a6..f1c4771d15 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index f1914c91fd..24df76b1b2 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index b16af0e384..280d2215b6 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 728f0662e4..13c0bdb9c6 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 67026e0d7e..544d6d6604 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 1a3a24ffea..0fbf8703ca 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 5bc68ac996..c5163c63e0 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index bfad96a182..3a1ebe876f 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 94ed447578..4c78387594 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index a2346bf4c7..2c1fe8586e 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 26214522d4..53235d6191 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 3e102c5b26..5806982517 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -5,7 +5,7 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 2f751f805a..5718070f14 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -7,7 +7,7 @@ # Noah Chen , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 5775105411..43056d52d7 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 47088adccd..b864b988b1 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the Python package. msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 3bd3871c1b..016912ff1d 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 6ed2d37f51..9368151b06 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -6,7 +6,7 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/whatsnew/changelog.po b/whatsnew/changelog.po index 28e659ce6a..1cefe27320 100644 --- a/whatsnew/changelog.po +++ b/whatsnew/changelog.po @@ -8,7 +8,7 @@ # Noah Chen , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-26 18:54+0800\n" "PO-Revision-Date: 2018-05-23 16:21+0000\n" diff --git a/whatsnew/index.po b/whatsnew/index.po index 1b364ad9c5..62bc2ed6bb 100644 --- a/whatsnew/index.po +++ b/whatsnew/index.po @@ -8,7 +8,7 @@ # Steven Hsu , 2022 msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" "PO-Revision-Date: 2022-07-07 11:37+0800\n" From 68704c6a5d91b432ef658d42f27fd26281a7ec10 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 19 Jul 2023 03:02:34 +0800 Subject: [PATCH 013/105] chore: change python version in readme and github action yml --- .github/workflows/deploy-gh-page.yml | 2 +- .../{py311-sync-cpython.yml => py312-sync-cpython.yml} | 8 ++++---- README.rst | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) rename .github/workflows/{py311-sync-cpython.yml => py312-sync-cpython.yml} (94%) diff --git a/.github/workflows/deploy-gh-page.yml b/.github/workflows/deploy-gh-page.yml index b514d228f0..8b55d18b84 100644 --- a/.github/workflows/deploy-gh-page.yml +++ b/.github/workflows/deploy-gh-page.yml @@ -3,7 +3,7 @@ name: deploy-gh-page on: push: branches: - - "3.11" + - "3.12" jobs: cd: diff --git a/.github/workflows/py311-sync-cpython.yml b/.github/workflows/py312-sync-cpython.yml similarity index 94% rename from .github/workflows/py311-sync-cpython.yml rename to .github/workflows/py312-sync-cpython.yml index 8d236d56dd..36e3771018 100644 --- a/.github/workflows/py311-sync-cpython.yml +++ b/.github/workflows/py312-sync-cpython.yml @@ -1,9 +1,9 @@ -name: python-3.11-sync-with-cpython +name: python-3.12-sync-with-cpython on: push: branches: - - "3.11" + - "3.12" schedule: - cron: "0 0 * * *" @@ -11,8 +11,8 @@ jobs: sync: runs-on: ubuntu-latest env: - VERSION: "3.11" - BRANCH: "cron/sync/3.11" + VERSION: "3.12" + BRANCH: "cron/sync/3.12" steps: - uses: actions/checkout@v2 with: diff --git a/README.rst b/README.rst index 7e56b0e5af..5725a94190 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ Python 官方說明文件臺灣繁體中文翻譯計畫 :target: https://discord.gg/44XheGXhWH :alt: Join Chat on Discord -這是 Python 3.11 官方說明文件的臺灣繁體中文(zh_TW)翻譯。 +這是 Python 3.12 官方說明文件的臺灣繁體中文(zh_TW)翻譯。 翻譯之前,請務必詳讀並同意\ `授權與 License`_。參與方式請參考\ `參與翻譯`_。 @@ -122,11 +122,11 @@ the PSF for inclusion in the documentation. 接著在 terminal 裡按照以下步驟: -1. 基於最新版本的 ``upstream/3.11`` 開啟一個 branch,現在假設我們想要翻譯 Glossary \ +1. 基於最新版本的 ``upstream/3.12`` 開啟一個 branch,現在假設我們想要翻譯 Glossary \ 所以把這個 branch 叫做 ``glossary`` :: git fetch upstream - git checkout -b glossary upstream/3.11 + git checkout -b glossary upstream/3.12 2. 接著就可以開始翻譯(翻譯時可參考 `翻譯守則`_),你可以手動開啟 Poedit 應用程式再選檔案或用以下指令請 Poedit 將檔案\ 打開,翻譯不同檔案時將 glossary 換成別的檔名) :: @@ -135,7 +135,7 @@ the PSF for inclusion in the documentation. 3. 存檔以後,執行以下列指令編譯輸出文件,以確保你的修改沒有 rST 的語法錯誤或警告 :: - VERSION=3.11 make all + VERSION=3.12 make all 如果你還沒有執行 `維護、預覽`_ 的 clone CPython 的動作,此指令會自動幫你 clone CPython,\ 並且會使用 Sphinx 幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning \ @@ -178,7 +178,7 @@ the PSF for inclusion in the documentation. - 從 upstream(我們的主要 GitHub repo)做 fetch 的動作 - 對 origin(你的 fork)做 push -- 永遠不對 ``3.11`` branch 進行修改,請保持讓這個 branch 唯讀,可以避免\ +- 永遠不對 ``3.12`` branch 進行修改,請保持讓這個 branch 唯讀,可以避免\ 掉很多問題。 要翻譯哪些東西 From 6353df4aeaf1860963dd1148c974472a3ec3905f Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 03:06:55 +0800 Subject: [PATCH 014/105] sync with cpython a423ddbd (#487) Co-authored-by: github-actions[bot] --- howto/clinic.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/howto/clinic.po b/howto/clinic.po index b9cf7fcdb9..c7bf25756a 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-19 00:54+0800\n" +"POT-Creation-Date: 2023-07-18 19:04+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-" @@ -871,7 +871,7 @@ msgid "" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:782 +#: ../../howto/clinic.rst:779 msgid "``unused``" msgstr "``unused``" @@ -1223,7 +1223,7 @@ msgstr "``unicode``" msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:864 msgid "``wchar_t``" msgstr "``wchar_t``" @@ -1231,7 +1231,7 @@ msgstr "``wchar_t``" msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:865 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" @@ -1279,7 +1279,7 @@ msgstr "``Py_buffer``" msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:871 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" @@ -1287,7 +1287,7 @@ msgstr "``wchar_t(accept={str, NoneType})``" msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:872 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" From 6ab9311bdc0a0689c0d8367114d374fbac58420c Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:46:10 +0800 Subject: [PATCH 015/105] Adds more translations of `library/io` (#483) * Adds more translations of library/io * Adds more translations of library/io * Small fixes * Small Fixes * Small Fixes --- library/io.po | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/library/io.po b/library/io.po index 6f0fba9984..e75d35ee1e 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2023-07-17 17:38+0800\n" +"PO-Revision-Date: 2023-07-18 21:30+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/io.rst:2 msgid ":mod:`io` --- Core tools for working with streams" -msgstr "" +msgstr ":mod:`io` — 處理資料串流的核心工具" #: ../../library/io.rst:15 msgid "**Source code:** :source:`Lib/io.py`" @@ -56,12 +56,18 @@ msgid "" "stream will raise a :exc:`TypeError`. So will giving a :class:`bytes` " "object to the ``write()`` method of a text stream." msgstr "" +"所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" +"`str` 物件給二進位資料串流的 ``write()`` 方法將會引發 :exc:`TypeError`。同樣" +"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發同" +"樣的錯誤。" #: ../../library/io.rst:45 msgid "" "Operations that used to raise :exc:`IOError` now raise :exc:`OSError`, " "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" +"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :" +"exc:`IOError` 現在是 :exc:`OSError` 的別名。" #: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122 msgid "Text I/O" @@ -80,17 +86,23 @@ msgid "" "The easiest way to create a text stream is with :meth:`open()`, optionally " "specifying an encoding::" msgstr "" +"建立文字資料串流最簡單的方法是使用 :meth:`open()`,可選擇性地指定編碼:\n" +"\n" +"::" #: ../../library/io.rst:63 msgid "" "In-memory text streams are also available as :class:`StringIO` objects::" msgstr "" +"記憶體內的文字資料串流也可以使用 :class:`StringIO` 物件建立:\n" +"\n" +"::" #: ../../library/io.rst:67 msgid "" "The text stream API is described in detail in the documentation of :class:" "`TextIOBase`." -msgstr "" +msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" #: ../../library/io.rst:72 ../../library/io.rst:1110 msgid "Binary I/O" @@ -110,11 +122,18 @@ msgid "" "The easiest way to create a binary stream is with :meth:`open()` with " "``'b'`` in the mode string::" msgstr "" +"建立二進位資料串流最簡單的方法是使用 :meth:`open()`,並在 mode 字串中加入 " +"``'b'``:\n" +"\n" +"::" #: ../../library/io.rst:85 msgid "" "In-memory binary streams are also available as :class:`BytesIO` objects::" msgstr "" +"記憶體內的二進位資料串流也可以透過 :class:`BytesIO` 物件來建立:\n" +"\n" +"::" #: ../../library/io.rst:89 msgid "" @@ -214,6 +233,9 @@ msgid "" "`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :exc:" "`EncodingWarning` when the default encoding is used." msgstr "" +"要找出哪些地方使用到預設的地區編碼,你可以啟用 ``-X warn_default_encoding`` " +"命令列選項,或者設定環境變數 :envvar:`PYTHONWARNDEFAULTENCODING`。當使用到預" +"設編碼時,會引發 :exc:`EncodingWarning`。" #: ../../library/io.rst:153 msgid "" @@ -226,7 +248,7 @@ msgstr "" #: ../../library/io.rst:162 msgid "High-level Module Interface" -msgstr "" +msgstr "高階模組介面" #: ../../library/io.rst:166 msgid "" @@ -237,7 +259,7 @@ msgstr "" #: ../../library/io.rst:173 msgid "This is an alias for the builtin :func:`open` function." -msgstr "" +msgstr "這是內建函式 :func:`open` 的別名。" #: ../../library/io.rst:175 msgid "" @@ -259,10 +281,12 @@ msgid "" "Opens the provided file with mode ``'rb'``. This function should be used " "when the intent is to treat the contents as executable code." msgstr "" +"以 ``'rb'`` 模式開啟提供的檔案。此函式應用於意圖將內容視為可執行的程式碼的情" +"況下。" #: ../../library/io.rst:187 msgid "``path`` should be a :class:`str` and an absolute path." -msgstr "" +msgstr "``path`` 應該要屬於 :class:`str` 類別,且是個絕對路徑。" #: ../../library/io.rst:189 msgid "" From b70d162f21646e9e0c79d9616dccfd6831676e7e Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:30:51 +0800 Subject: [PATCH 016/105] Adds translations of `library/statistics` (#495) * Adds translations of library/statistics --- library/statistics.po | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/statistics.po b/library/statistics.po index 4dd6969c9a..1c802fe1ad 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" -"PO-Revision-Date: 2023-07-17 18:00+0800\n" +"PO-Revision-Date: 2023-07-21 00:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -927,6 +927,8 @@ msgid "" "continuous data that doesn't meet the linear proportion requirement for " "Pearson's correlation coefficient." msgstr "" +"Spearman 相關係數適用於順序型資料,或者不符合 Pearson 相關係數要求的線性比例" +"關係的連續型 (continuous) 資料。" #: ../../library/statistics.rst:669 msgid "" @@ -941,10 +943,12 @@ msgid "" "Example with `Kepler's laws of planetary motion `_:" msgstr "" +"以 `Kepler 行星運動定律 `_\\ 為例:" #: ../../library/statistics.rst:699 msgid "Added support for Spearman's rank correlation coefficient." -msgstr "" +msgstr "新增了對 Spearman 等級相關係數的支援。" #: ../../library/statistics.rst:704 msgid "" From 1e7e0fca7e611a83a38fae9bc6d0cac54e9baf98 Mon Sep 17 00:00:00 2001 From: Jackson <56949000+jacksonchen1998@users.noreply.github.com> Date: Sat, 22 Jul 2023 19:07:23 +0800 Subject: [PATCH 017/105] [UPDATE] Translate `library/os.path` (#492) * [UPDATE] Translate `library/os.path` --- library/os.path.po | 146 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 133 insertions(+), 13 deletions(-) diff --git a/library/os.path.po b/library/os.path.po index bf37ceefeb..29ba4e2410 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-07-13 14:06+0800\n" +"PO-Revision-Date: 2023-07-21 12:35+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -49,8 +49,8 @@ msgid "" "explicitly when an application desires shell-like path expansion. (See also " "the :mod:`glob` module.)" msgstr "" -"與 Unix shell 不同,Python 不會\\ *自動*\\ 進行路徑展開(path expansions)。" -"當應用程式需要進行類似 shell 的路徑展開時,可以明確地呼叫 :func:`expanduser` " +"與 Unix shell 不同,Python 不會\\ *自動*\\ 進行路徑展開 (path expansions)。當" +"應用程式需要進行類似 shell 的路徑展開時,可以明確地呼叫 :func:`expanduser` " "和 :func:`expandvars` 等函式。(另請參閱 :mod:`glob` 模組。)" #: ../../library/os.path.rst:26 @@ -146,7 +146,7 @@ msgid "" "empty. Unlike :func:`commonprefix`, this returns a valid path." msgstr "" "回傳序列 *paths* 中每個路徑名的最長共同子路徑。如果 *paths* 同時包含絕對路徑" -"和相對路徑、*paths* 位於不同的磁碟機或 *paths* 為空,則引發 :exc:" +"和相對路徑、*paths* 位於不同的驅動機或 *paths* 為空,則引發 :exc:" "`ValueError`。與 :func:`commonprefix` 不同,此函式回傳的是有效路徑。" #: ../../library/os.path.rst:88 ../../library/os.path.rst:415 @@ -250,7 +250,7 @@ msgid "" "If the expansion fails or if the path does not begin with a tilde, the path " "is returned unchanged." msgstr "" -"如果展開失敗或路徑不以波浪符號(tilde)開頭,則回傳原始路徑,不做任何變更。" +"如果展開失敗或路徑不以波浪符號 (tilde) 開頭,則回傳原始路徑,不做任何變更。" #: ../../library/os.path.rst:180 msgid "No longer uses :envvar:`HOME` on Windows." @@ -263,12 +263,16 @@ msgid "" "variable *name*. Malformed variable names and references to non-existing " "variables are left unchanged." msgstr "" +"回傳已展開環境變數的引數。形如 ``$name`` 或 ``${name}`` 的子字串會被替換為環" +"境變數 *name* 的值。無效的變數名稱和對不存在變數的引用保持不變。" #: ../../library/os.path.rst:194 msgid "" "On Windows, ``%name%`` expansions are supported in addition to ``$name`` and " "``${name}``." msgstr "" +"在 Windows 上,除了支援 ``$name`` 和 ``${name}`` 形式的展開外,還支援 ``%name" +"%`` 形式的展開。" #: ../../library/os.path.rst:203 msgid "" @@ -277,6 +281,8 @@ msgid "" "`time` module). Raise :exc:`OSError` if the file does not exist or is " "inaccessible." msgstr "" +"回傳 *path* 的最後存取時間。回傳值是一個浮點數,表示自紀元(參見 :mod:`time` " +"模組)以來的秒數。如果檔案不存在或無法存取,則引發 :exc:`OSError`。" #: ../../library/os.path.rst:210 msgid "" @@ -285,6 +291,8 @@ msgid "" "the :mod:`time` module). Raise :exc:`OSError` if the file does not exist or " "is inaccessible." msgstr "" +"回傳 *path* 的最後修改時間。回傳值是一個浮點數,表示自紀元(參見 :mod:`time` " +"模組)以來的秒數。如果檔案不存在或無法存取,則引發 :exc:`OSError`。" #: ../../library/os.path.rst:220 msgid "" @@ -294,12 +302,18 @@ msgid "" "since the epoch (see the :mod:`time` module). Raise :exc:`OSError` if the " "file does not exist or is inaccessible." msgstr "" +"回傳系統的 ctime。在某些系統(如 Unix)上,這是最後一次元數據 (metadata) 更改" +"的時間,在其他系統(如 Windows)上則是 *path* 的建立時間。回傳值是一個浮點" +"數,表示自紀元(參見 :mod:`time` 模組)以來的秒數。如果檔案不存在或無法存" +"取),則引發 :exc:`OSError`。" #: ../../library/os.path.rst:232 msgid "" "Return the size, in bytes, of *path*. Raise :exc:`OSError` if the file does " "not exist or is inaccessible." msgstr "" +"回傳 *path* 的大小(以位元組為單位)。如果檔案不存在或無法存取,則引發 :exc:" +"`OSError`。" #: ../../library/os.path.rst:241 msgid "" @@ -307,6 +321,8 @@ msgid "" "begins with a slash, on Windows that it begins with a (back)slash after " "chopping off a potential drive letter." msgstr "" +"如果 *path* 是絕對路徑名,則回傳 ``True``。在 Unix 上,這表示它以斜線開頭;" +"在 Windows 上,表示在去除可能的驅動機字母後,以(反)斜線開頭。" #: ../../library/os.path.rst:251 msgid "" @@ -314,6 +330,9 @@ msgid "" "follows symbolic links, so both :func:`islink` and :func:`isfile` can be " "true for the same path." msgstr "" +"如果 *path* 是一個\\ :func:`已存在的 `\\ 常規檔案,則回傳 ``True``。" +"這將跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:" +"`isfile` 的結果為真。" #: ../../library/os.path.rst:261 msgid "" @@ -321,6 +340,9 @@ msgid "" "follows symbolic links, so both :func:`islink` and :func:`isdir` can be true " "for the same path." msgstr "" +"如果 *path* 是一個\\ :func:`已存在的 `\\ 目錄,則回傳 ``True``。這將" +"跟隨符號連結,因此同一個路徑可以同時回傳 :func:`islink` 和 :func:`isfile` 的" +"結果為真。" #: ../../library/os.path.rst:271 msgid "" @@ -328,6 +350,8 @@ msgid "" "entry that is a junction. Always return ``False`` if junctions are not " "supported on the current platform." msgstr "" +"如果 *path* 是指向\\ :func:`已存在的 `\\ 目錄條目且為聯接點 " +"(junction),則回傳 ``True``。如果目前平台不支援聯接點,則始終返回 ``False``。" #: ../../library/os.path.rst:280 msgid "" @@ -335,6 +359,8 @@ msgid "" "entry that is a symbolic link. Always ``False`` if symbolic links are not " "supported by the Python runtime." msgstr "" +"如果 *path* 是指向\\ :func:`已存在的 `\\ 目錄項目且為符號連結,則回" +"傳 ``True``。如果 Python 執行時不支援符號連結,則始終回傳 ``False``。" #: ../../library/os.path.rst:290 msgid "" @@ -348,10 +374,17 @@ msgid "" "UNC are always mount points, and for any other path ``GetVolumePathName`` is " "called to see if it is different from the input path." msgstr "" +"如果路徑名 *path* 是一個掛載點 (:dfn:`mount point`),則回傳 ``True``:即在檔" +"案系統中掛載了不同的檔案系統。在 POSIX 系統上,該函式檢查 *path* 的父目錄 :" +"file:`{path}/..` 是否位於不同的設備上,或者 :file:`{path}/..` 和 *path* 是否" +"指向同一設備上的相同 i-node --- 這應該能夠檢測出所有 Unix 和 POSIX 變體的掛載" +"點。但無法可靠地檢測出相同檔案系統上的綁定掛載點 (bind mount)。在 Windows " +"上,以驅動機字母開頭的根目錄和 UNC 共享路徑始終是掛載點,對於任何其他路徑,會" +"呼叫 ``GetVolumePathName`` 函式來檢查它是否與輸入路徑不同。" #: ../../library/os.path.rst:300 msgid "Support for detecting non-root mount points on Windows." -msgstr "" +msgstr "支援在 Windows 上檢測非根目錄的掛載點。" #: ../../library/os.path.rst:309 msgid "" @@ -361,6 +394,9 @@ msgid "" "temporary build directories, package caches, and other IO-intensive " "operations." msgstr "" +"如果路徑名 *path* 位於 Windows Dev 驅動機上,則回傳 ``True``。Dev 驅動機針對" +"開發人員場景進行了優化,提供更快的讀寫檔案性能。建議將其用於原始程式碼、臨時" +"建置目錄、封包快取和其他 I/O 密集型操作。" #: ../../library/os.path.rst:315 msgid "" @@ -369,6 +405,9 @@ msgid "" "Dev Drives. See `the Windows documentation `_ for information on enabling and creating Dev Drives." msgstr "" +"可能會對無效的路徑引發錯誤,例如,沒有可識別的驅動機的路徑,但在不支援 Dev 磁" +"碟機的平台上返回 ``False``。請參閱 `Windows 文件 `_\\ 以了解有關啟用和建立 Dev 驅動機的資訊。" #: ../../library/os.path.rst:320 msgid ":ref:`Availability `: Windows." @@ -384,6 +423,10 @@ msgid "" "requires both a drive and a root), then all previous segments are ignored " "and joining continues from the absolute path segment." msgstr "" +"聰明地連接一個或多個路徑段。回傳值是 *path* 和 *\\*paths* 的所有成員的串聯," +"每個非空部分後面都有一個目錄分隔符號,除了最後一個部分。換句話說,如果最後一" +"個部分為空或以分隔符號結尾,結果只會以分隔符號結尾。如果一個段是絕對路徑(在 " +"Windows 上需要驅動機和根),則忽略所有之前的段,並從絕對路徑段繼續連接。" #: ../../library/os.path.rst:335 msgid "" @@ -394,10 +437,15 @@ msgid "" "join(\"c:\", \"foo\")`` represents a path relative to the current directory " "on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\\\foo`." msgstr "" +"在 Windows 上,當遇到根路徑段(例如,``r'\\foo'``)時,驅動機不會被重置。如果" +"一個段位於不同的驅動機上,或者是絕對路徑,則將忽略所有之前的段並重置驅動機。" +"請注意,由於每個驅動機都有當前目錄,``os.path.join(\"c:\", \"foo\")`` 表示相" +"對於驅動機 :file:`C:` 的當前目錄的路徑(即 :file:`c:foo`),而不是 :file:`c:" +"\\\\foo`。" #: ../../library/os.path.rst:342 msgid "Accepts a :term:`path-like object` for *path* and *paths*." -msgstr "" +msgstr "*path* 和 *paths* 接受 :term:`path-like object` 作為參數。" #: ../../library/os.path.rst:348 msgid "" @@ -405,6 +453,8 @@ msgid "" "pathname to lowercase, and also convert forward slashes to backward slashes. " "On other operating systems, return the path unchanged." msgstr "" +"將路徑名的大小寫規範化。在 Windows 上,將路徑名中的所有字元轉換為小寫,並將正" +"斜線轉換為反斜線。在其他作業系統上,回傳原始路徑。" #: ../../library/os.path.rst:358 msgid "" @@ -414,6 +464,10 @@ msgid "" "that contains symbolic links. On Windows, it converts forward slashes to " "backward slashes. To normalize case, use :func:`normcase`." msgstr "" +"通過合併多餘的分隔符號和上層引用來標準化路徑名,使得 ``A//B``、``A/B/``、" +"``A/./B`` 和 ``A/foo/../B`` 都變成 ``A/B``。這種字串操作可能會改變包含符號連" +"結的路徑的含義。在 Windows 上,它將正斜線轉換為反斜線。要標準化大小寫,請使" +"用 :func:`normcase`。" #: ../../library/os.path.rst:365 msgid "" @@ -424,6 +478,11 @@ msgid "" "interpreted in an implementation-defined manner, although more than two " "leading characters shall be treated as a single character." msgstr "" +"在 POSIX 系統中,根據 `IEEE Std 1003.1 2013 版; 4.13 Pathname Resolution " +"`_ 標準,如果一個路徑名恰好以兩個斜線開頭,則在前導字元後的第" +"一個部分可能會以由實作品自行定義的方式解釋,雖然多於兩個前導字元應該被視為單" +"個字元。" #: ../../library/os.path.rst:378 msgid "" @@ -431,6 +490,8 @@ msgid "" "symbolic links encountered in the path (if they are supported by the " "operating system)." msgstr "" +"回傳指定檔案名稱的規範路徑,消除路徑中遇到的所有符號連結(如果作業系統支" +"援)。" #: ../../library/os.path.rst:382 msgid "" @@ -439,6 +500,9 @@ msgid "" "resolved as far as possible and any remainder is appended without checking " "whether it exists." msgstr "" +"如果路徑不存在或遇到符號連結迴圈,且 *strict* 為 ``True``,則引發 :exc:" +"`OSError`。如果 *strict* 為 ``False``,則將路徑盡可能解析,並將任何剩餘部分附" +"加在後面,而不檢查其是否存在。" #: ../../library/os.path.rst:388 msgid "" @@ -446,16 +510,18 @@ msgid "" "canonical, which differs slightly between Windows and UNIX with respect to " "how links and subsequent path components interact." msgstr "" +"此函式模擬作業系統使路徑成為規範的過程,Windows 和 UNIX 之間在鏈接和後續路徑" +"部份交互方式方面略有不同。" #: ../../library/os.path.rst:392 msgid "" "Operating system APIs make paths canonical as needed, so it's not normally " "necessary to call this function." -msgstr "" +msgstr "作業系統的 API 會根據需要自動使路徑正則,因此通常不需要呼叫此函式。" #: ../../library/os.path.rst:398 msgid "Symbolic links and junctions are now resolved on Windows." -msgstr "" +msgstr "在 Windows 上,現在會解析符號連結和連接點。" #: ../../library/os.path.rst:401 msgid "The *strict* parameter was added." @@ -469,10 +535,13 @@ msgid "" "*start*. On Windows, :exc:`ValueError` is raised when *path* and *start* " "are on different drives." msgstr "" +"從當前目錄或可選的 *start* 目錄回傳到 *path* 的相對檔案路徑。這是一個路徑計" +"算:不會訪問檔案系統來確認 *path* 或 *start* 的存在或屬性。在 Windows 上,當 " +"*path* 和 *start* 在不同的驅動機上時,會引發 :exc:`ValueError`。" #: ../../library/os.path.rst:413 msgid "*start* defaults to :attr:`os.curdir`." -msgstr "" +msgstr "*start* 的預設值為 :attr:`os.curdir`。" #: ../../library/os.path.rst:423 msgid "" @@ -480,6 +549,9 @@ msgid "" "directory. This is determined by the device number and i-node number and " "raises an exception if an :func:`os.stat` call on either pathname fails." msgstr "" +"如果兩個路徑名引數指向同一個檔案或目錄,則回傳 ``True``。這是通過設備編號和 " +"i-node 編號來確定的,如果對任一路徑名的 :func:`os.stat` 呼叫失敗,則會引發異" +"常。" #: ../../library/os.path.rst:429 ../../library/os.path.rst:445 #: ../../library/os.path.rst:461 @@ -488,13 +560,13 @@ msgstr "新增對 Windows 的支援。" #: ../../library/os.path.rst:432 msgid "Windows now uses the same implementation as all other platforms." -msgstr "" +msgstr "現在在 Windows 上使用與其他所有平台相同的實作方式。" #: ../../library/os.path.rst:441 msgid "" "Return ``True`` if the file descriptors *fp1* and *fp2* refer to the same " "file." -msgstr "" +msgstr "如果文件描述符 *fp1* 和 *fp2* 指向同一個檔案,則回傳 ``True``。" #: ../../library/os.path.rst:454 msgid "" @@ -503,6 +575,9 @@ msgid "" "lstat`, or :func:`os.stat`. This function implements the underlying " "comparison used by :func:`samefile` and :func:`sameopenfile`." msgstr "" +"如果 stat 值組 *stat1* 和 *stat2* 指向同一個檔案,則回傳 ``True``。這些結構可" +"能由 :func:`os.fstat`、:func:`os.lstat` 或 :func:`os.stat` 回傳。此函式使用 :" +"func:`samefile` 和 :func:`sameopenfile` 實現了底層比較。" #: ../../library/os.path.rst:470 msgid "" @@ -516,6 +591,13 @@ msgid "" "*path* (but the strings may differ). Also see the functions :func:`dirname` " "and :func:`basename`." msgstr "" +"將路徑名 *path* 拆分為 ``(head, tail)`` 一對,其中 *tail* 是最後一個路徑名部" +"份,*head* 是在它之前的所有部分。*tail* 部分不會包含斜線;如果 *path* 以斜線" +"結尾,則 *tail* 將為空。如果 *path* 中沒有斜線,則 *head* 將為空。如果 " +"*path* 為空,則 *head* 和 *tail* 都為空。除非 *head* 是根目錄(僅有一個或多個" +"斜線),否則從 *head* 中刪除尾部的斜線。在所有情況下,``join(head, tail)`` 回" +"傳指向與 *path* 相同位置的路徑(但字串可能不同)。還可以參考函式 :func:" +"`dirname` 和 :func:`basename`。" #: ../../library/os.path.rst:486 msgid "" @@ -524,22 +606,31 @@ msgid "" "specifications, *drive* will always be the empty string. In all cases, " "``drive + tail`` will be the same as *path*." msgstr "" +"將路徑名 *path* 拆分為 ``(drive, tail)`` 一對,其中 *drive* 是掛載點或空字" +"串。在不使用驅動機規範的系統上,*drive* 將始終為空字串。在所有情況下," +"``drive + tail`` 將與 *path* 相同。" #: ../../library/os.path.rst:491 msgid "" "On Windows, splits a pathname into drive/UNC sharepoint and relative path." -msgstr "" +msgstr "在 Windows 上,將路徑名拆分為驅動機或 UNC 共享點以及相對路徑。" #: ../../library/os.path.rst:493 msgid "" "If the path contains a drive letter, drive will contain everything up to and " "including the colon::" msgstr "" +"如果路徑包含驅動機字母,則 *drive* 將包含從頭到冒號(包括冒號)的所有內容:\n" +"\n" +"::" #: ../../library/os.path.rst:499 msgid "" "If the path contains a UNC path, drive will contain the host name and share::" msgstr "" +"如果路徑包含 UNC 路徑,則驅動機將包含主機名和共享名:\n" +"\n" +"::" #: ../../library/os.path.rst:511 msgid "" @@ -549,6 +640,10 @@ msgid "" "may be the empty string. In all cases, ``drive + root + tail`` will be the " "same as *path*." msgstr "" +"將路徑名 *path* 拆分為一個 3 項值組 ``(drive, root, tail)``,其中 *drive* 是" +"設備名稱或掛載點,*root* 是驅動機後的分隔符字串,*tail* 是在根後的所有內容。" +"這些項目中的任何一個都可能是空字串。在所有情況下,``drive + root + tail`` 將" +"與 *path* 相同。" #: ../../library/os.path.rst:517 msgid "" @@ -558,6 +653,13 @@ msgid "" "Pathname Resolution `_.) For example::" msgstr "" +"在 POSIX 系統上,*drive* 始終為空。*root* 可能為空(如果 *path* 是相對路" +"徑),一個斜線(如果 *path* 是絕對路徑),或者兩個斜線(根據 `IEEE Std " +"1003.1-2017; 4.13 Pathname Resolution `_ 的實作定義)。例" +"如:\n" +"\n" +"::" #: ../../library/os.path.rst:530 msgid "" @@ -565,6 +667,10 @@ msgid "" "device name. The *root* may be empty, a forward slash, or a backward slash. " "For example::" msgstr "" +"在 Windows 上,*drive* 可能為空、驅動機名稱、UNC 共享或設備名稱。*root* 可能" +"為空,斜線或反斜線。例如:\n" +"\n" +"::" #: ../../library/os.path.rst:544 msgid "" @@ -572,28 +678,42 @@ msgid "" "ext == path``, and the extension, *ext*, is empty or begins with a period " "and contains at most one period." msgstr "" +"將路徑名 *path* 拆分為一對 ``(root, ext)``,使得 ``root + ext == path``,且副" +"檔名 *ext* 為空或以點開頭且最多包含一個點 (period)。" #: ../../library/os.path.rst:548 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "" +"如果路徑不包含副檔名,則 *ext* 將為 ``''``:\n" +"\n" +"::" #: ../../library/os.path.rst:553 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" msgstr "" +"如果路徑包含副檔名,則 *ext* 將設置為該副檔名,包括前導的點。請注意,前面的點" +"將被忽略:\n" +"\n" +"::" #: ../../library/os.path.rst:561 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "" +"路徑的最後一個部份的前導點被認為是根的一部分:\n" +"\n" +"::" #: ../../library/os.path.rst:575 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." msgstr "" +"如果可以使用任意的 Unicode 字串作為檔案名(在檔案系統所施加的限制範圍內),則" +"回傳 ``True``。" #: ../../library/os.path.rst:10 msgid "path" From e1a007540743f6894dc551df15311bf6e7075d02 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Sat, 22 Jul 2023 21:41:20 +0800 Subject: [PATCH 018/105] Adds translations of library/statistics. (#497) --- library/statistics.po | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/statistics.po b/library/statistics.po index 1c802fe1ad..c305f55fe0 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-03 00:17+0000\n" -"PO-Revision-Date: 2023-07-21 00:06+0800\n" +"PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -920,6 +920,11 @@ msgid "" "equal values receive the same rank. The resulting coefficient measures the " "strength of a monotonic relationship." msgstr "" +"如果 *method* 為 \"ranked\",則計算兩輸入的 ``Spearman 等級相關係數 " +"(Spearman’s rank correlation coefficient) ``。資料將被取代為等級。平手的情況" +"則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " +"relationship) 的強度。" #: ../../library/statistics.rst:665 msgid "" From 734318ebe39936d34ef4ec2e22d90bd74b1553ac Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 24 Jul 2023 09:46:53 +0800 Subject: [PATCH 019/105] Fixes a fuzzy of c-api/dict.po (#498) --- c-api/dict.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/c-api/dict.po b/c-api/dict.po index e66d60d831..f6b39b92e0 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -54,9 +54,8 @@ msgstr "" "會執行成功。" #: ../../c-api/dict.rst:36 -#, fuzzy msgid "Return a new empty dictionary, or ``NULL`` on failure." -msgstr "回傳一個新的空字典,或在失敗時回傳 *NULL*\\ 。" +msgstr "回傳一個新的空字典,或在失敗時回傳 ``NULL``。" #: ../../c-api/dict.rst:41 msgid "" From 020422748027bbc004803452a246913c98eeaf53 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 24 Jul 2023 09:47:31 +0800 Subject: [PATCH 020/105] Fixes a fuzzy on library/os (#499) --- library/os.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/os.po b/library/os.po index ed4cde5b00..6290d0e4f1 100644 --- a/library/os.po +++ b/library/os.po @@ -1253,9 +1253,8 @@ msgid "On Windows, this function is limited to pipes." msgstr "" #: ../../library/os.rst:1119 ../../library/os.rst:1597 -#, fuzzy msgid "Added support for pipes on Windows." -msgstr "新增對 Windows 上 pipe 的支援。" +msgstr "新增對 Windows 上的 pipe 支援。" #: ../../library/os.rst:1124 msgid "" From e31ddd1139ccee39114c95452797e661397fb9e5 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:18:49 +0800 Subject: [PATCH 021/105] =?UTF-8?q?docs(howto/sockets.po):=20=E7=BF=BB?= =?UTF-8?q?=E8=AD=AF=20`IPC`=20=E8=88=87=20`Using=20a=20Socket`=20?= =?UTF-8?q?=E5=8D=80=E5=A1=8A=20(#493)=20(#502)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(howto/sockets.po): 翻譯 `IPC` 與 `Using a Socket` 區塊 gh-466 Original PR #493. Cherry-pick from 3.11 to 3.12 Co-authored-by: Jay <74105438+weijay0804@users.noreply.github.com> --- howto/sockets.po | 142 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 99 insertions(+), 43 deletions(-) diff --git a/howto/sockets.po b/howto/sockets.po index 823d89fa8e..4f17400d73 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -5,10 +5,10 @@ # Translators: msgid "" msgstr "" -"Project-Id-Version: Python 3.12\n" +"Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-10 00:16+0000\n" -"PO-Revision-Date: 2023-07-12 02:22+0800\n" +"PO-Revision-Date: 2023-07-19 20:17+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -64,13 +64,13 @@ msgid "" "blocking sockets. But I'll start by talking about blocking sockets. You'll " "need to know how they work before dealing with non-blocking sockets." msgstr "" -"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 sockets " -"使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除非你真的知" -"道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM 類型的 " -"socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 socket 是什" -"麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的一些建議。" -"但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解它們的工作" -"原理。" +"我只會討論關於 INET(例如:IPv4)的 sockets,但它們涵蓋了幾乎 99% 的 " +"sockets 使用場景。而我也將僅討論關於 STREAM(比如:TCP)類型的 sockets - 除" +"非你真的知道你在做什麼(在這種情況下,這份指南可能不適合你),使用 STREAM " +"類型的 socket 會獲得比其他 sockets 類型更好的表現和性能。我將會嘗試解釋 " +"socket 是什麼,以及如何使用阻塞 (blocking) 和非阻塞 (non-blocking) sockets 的" +"一些建議。但首先我會先談論阻塞 sockets。在處理非阻塞 sockets 之前,你需要了解" +"它們的工作原理。" #: ../../howto/sockets.rst:31 msgid "" @@ -82,12 +82,12 @@ msgid "" "sockets exclusively; the web server it's talking to uses both \"server\" " "sockets and \"client\" sockets." msgstr "" -"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這" -"主要取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器" -"端 (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" -"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使用" -"「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 「用戶" -"端」socket 來進行通訊。" +"要理解這些東西的困難點之一在於 \"scoket\" 可以代表多種具有些微差異的東西,這主要" +"取決於上下文。所以首先,讓我們先區分「用戶端 (client)」socket 和「伺服器端" +" (server)」socket 的差別,「用戶端」socket 表示通訊的一端,「伺服器端」" +"socket 更像是一個電話總機接線員。用戶端應用程式(例如:你的瀏覽器)只能使" +"用「用戶端」socket; 它所連接的網路伺服器則同時使用「伺服器端」socket 和 " +"「用戶端」socket 來進行通訊。" #: ../../howto/sockets.rst:40 msgid "History" @@ -111,8 +111,8 @@ msgid "" "of sockets with INET makes talking to arbitrary machines around the world " "unbelievably easy (at least compared to other schemes)." msgstr "" -"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路" -"的普及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" +"Sockets 作為 Unix 的 BSD 分支的一部分在 Berkeley 被發明出來。它們隨著網際網路的普" +"及而迅速蔓延開來。這是有很好的理由 — sockets 和 INET 的結合讓世界各地任何" "的機器之間的通訊變得非常簡單(至少與其它方案相比是如此)。" #: ../../howto/sockets.rst:54 @@ -136,16 +136,16 @@ msgid "" "used for one exchange (or a small set of sequential exchanges)." msgstr "" "當 ``connect`` 完成時,這個 socket ``s`` 可以用來發送請求來取得頁面的文本。同" -"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常" -"只用來做一次交換(或是一小組連續交換)。" +"一個 socket 也會讀取回傳值,然後再被銷毀。是的,會被銷毀。用戶端 socket 通常只" +"用來做一次交換(或是一小組連續交換)。" #: ../../howto/sockets.rst:70 msgid "" "What happens in the web server is a bit more complex. First, the web server " "creates a \"server socket\"::" msgstr "" -"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺" -"服器端 socket」:\n" +"網路伺服器 (web server) 的運作就稍微複雜一點。首先,網路伺服器會建立一個「伺服器端 " +"socket」:\n" "\n" "::" @@ -158,10 +158,10 @@ msgid "" "machine. ``s.bind(('', 80))`` specifies that the socket is reachable by any " "address the machine happens to have." msgstr "" -"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外部" -"網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." -"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一台" -"機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" +"有幾件事需要注意:我們使用了 ``socket.gethostname()``,這樣 socket 才能對外" +"部網路可見。如果我們使用了 ``s.bind(('localhost', 80))`` 或 ``s." +"bind(('127.0.0.1', 80))``,我們會得到一個「伺服器端」socket,但是只能在同一" +"台機器內可見。``s.bind(('', 80))`` 指定 socket 可以透過機器的任何地址存取。" #: ../../howto/sockets.rst:87 msgid "" @@ -169,8 +169,8 @@ msgid "" "known\" services (HTTP, SNMP etc). If you're playing around, use a nice high " "number (4 digits)." msgstr "" -"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、" -"SNMP等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" +"第二個要注意的是:數字小的連接埠 (port) 通常保留給「廣為人知的」服務(HTTP、SNMP" +"等)。如果你只是想執行程式,可以使用一個數字較大的連接埠(4 位數字)。" #: ../../howto/sockets.rst:91 msgid "" @@ -180,8 +180,8 @@ msgid "" "should be plenty." msgstr "" "最後,``listen`` 引數告訴 socket 函式庫 (library),我們希望在佇列 (queue) 中" -"累積達 5 個(正常的最大值)連接請求後再拒絕外部連接。如果其餘的程式碼編寫正" -"確,這應該足夠了。" +"累積達 5 個(正常的最大值)連線請求後再拒絕外部連線。如果其餘的程式碼編寫" +"正確,這應該足夠了。" #: ../../howto/sockets.rst:95 msgid "" @@ -209,15 +209,15 @@ msgid "" "allocated port which will be recycled when the conversation ends." msgstr "" "事實上,有三種方法可以讓這個迴圈運作 - 分配一個執行緒 (thread) 來處理 " -"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將這" -"個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" +"``clientsocket`` 、建立一個新行程 (process) 來處理 ``clientsocket``,或者將" +"這個程式重新改寫成使用非阻塞 socket,並使用 ``select`` 在我們的「伺服器端」" "socket 和任何有效的 ``clientsocket`` 之間進行多工處理。稍後將會更詳細的介紹。" -"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送" -"任何資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 " -"``clientsocket`` 都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機" -"上的「用戶端」socket。一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連接" -"請求。兩個「用戶端」可以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通" -"訊結束的時候被回收並重新利用。" +"現在最重要的是理解:這就是「伺服器端」socket 做的\\ *所有* \\事情。它不會發送任何" +"資料、也不接收任何資料,它只會建立「伺服器端」socket。每個 ``clientsocket`` " +"都是為了回應某些\\ *其他* \\ ``connect()`` 到我們綁定的主機上的「用戶端」socket。" +"一但 ``clientsocket`` 建立完成,就會繼續監聽更多的連線請求。兩個「用戶端」可" +"以隨意的通訊 - 它們使用的是一些動態分配的連接埠,會在通訊結束的時候被回收並重新" +"利用。" #: ../../howto/sockets.rst:121 msgid "IPC" @@ -231,16 +231,20 @@ msgid "" "a shortcut around a couple of layers of network code and be quite a bit " "faster." msgstr "" +"如果你需要在一台機器上的兩個行程間進行快速的行程間通訊 (IPC),你應該考慮使用" +"管道 (pipes) 或共享記憶體 (shared memory)。如果你確定要使用 AF_INET sockets," +"請將「伺服器端」socket 綁定到 ``'localhost'``。在大多數平台上,這樣將會繞過幾個" +"網路程式碼層,並且速度會更快一些。" #: ../../howto/sockets.rst:129 msgid "" "The :mod:`multiprocessing` integrates cross-platform IPC into a higher-level " "API." -msgstr "" +msgstr ":mod:`multiprocessing` 將跨平台的行程間通訊整合到更高層的 API 中。" #: ../../howto/sockets.rst:134 msgid "Using a Socket" -msgstr "" +msgstr "使用一個 Socket" #: ../../howto/sockets.rst:136 msgid "" @@ -252,6 +256,10 @@ msgid "" "in a request, or perhaps a signon. But that's a design decision - it's not a " "rule of sockets." msgstr "" +"首先需要注意,網頁瀏覽器的「用戶端」socket 和網路伺服器的「用戶端」socket 是" +"非常類似的。也就是說,這是一個「點對點 (peer to peer)」的通訊方式,或者也可以說\\ *作為設計" +"者,你必須決定通訊的規則*。通常情況下,``connect`` 的 socket 會通過發送一個" +"請求或者信號來開始一次通訊。但這屬於設計決策,而不是 socket 的規則。" #: ../../howto/sockets.rst:143 msgid "" @@ -264,6 +272,12 @@ msgid "" "reply. Without a ``flush`` in there, you may wait forever for the reply, " "because the request may still be in your output buffer." msgstr "" +"現在有兩組可供通訊使用的動詞。你可以使用 ``send`` 和 ``recv``,或者可以將用戶" +"端 socket 轉換成類似檔案的形式,並使用 ``read`` 和 ``write``。後者是 Java 中" +"呈現 socket 的方式。我不打算在這裡討論它,只是提醒你需要在 socket 上使用 " +"``flush``。這些是緩衝的「檔案」,一個常見的錯誤是使用 ``write`` 寫入某些內" +"容,然後直接 ``read`` 回覆。如果不使用 ``flush``,你可能會一直等待這個回覆," +"因為請求可能還在你的輸出緩衝中。" #: ../../howto/sockets.rst:152 msgid "" @@ -275,6 +289,11 @@ msgid "" "you how many bytes they handled. It is *your* responsibility to call them " "again until your message has been completely dealt with." msgstr "" +"現在我們來到 sockets 的主要障礙 - ``send`` 和 ``recv`` 操作的是網路緩衝區。他" +"們不一定會處理你提供給它們的所有位元組(或者是你期望它處理的位元組),因為它" +"們主要的重點是處理網路緩衝區。一般來說,它們會在關聯的網路衝區已滿 " +"(``send``) 或已清空 (``recv``) 時回傳,然後告訴你它們處理了多少位元組。*你" +"* \\的責任是一直呼叫它們直到你所有的訊息處理完成。" #: ../../howto/sockets.rst:160 msgid "" @@ -283,6 +302,9 @@ msgid "" "data on this connection. Ever. You may be able to send data successfully; " "I'll talk more about this later." msgstr "" +"當 ``recv`` 回傳「零位元組 (0 bytes)」時,就表示另一端已經關閉(或著正在關" +"閉)連線。你再也不能從這個連線上取得任何資料了。你可能還是可以成功發送資料;" +"我稍後會對此進行更詳細的解釋。" #: ../../howto/sockets.rst:165 msgid "" @@ -290,6 +312,9 @@ msgid "" "request, then reads a reply. That's it. The socket is discarded. This means " "that a client can detect the end of the reply by receiving 0 bytes." msgstr "" +"像 HTTP 這樣的協議只使用一個 socket 進行一次傳輸,用戶端發送一個請求,然後讀" +"取一個回覆。就這樣,然後這個 socket 就會被銷毀。這表示者用戶端可以通過接收「零" +"位元組」來檢測回覆的結束。" #: ../../howto/sockets.rst:169 msgid "" @@ -304,12 +329,23 @@ msgid "" "they are* (much better), *or end by shutting down the connection*. The " "choice is entirely yours, (but some ways are righter than others)." msgstr "" +"但是如果你打算在之後的傳輸中重新利用 socket 的話,你需要明白\\ *socket 中是不" +"存在* \\ :abbr:`EOT (傳輸結束)`。重申一次:如果一個 socket 的 ``send`` 或 " +"``recv`` 處理了「零位元組」後回傳,表示連線已經斷開。如果連線\\ *沒有* \\斷" +"開,你可能會永遠處於等待 ``recv`` 的狀態,因為(就目前來說)socket *不會* " +"\\告訴你沒有更多資料可以讀取了。現在,如果你稍微思考一下,你就會意識到 " +"socket 的一個基本事實:*訊息要麼是一個固定的長度(不好的做法),要麼是可以被" +"分隔的(普通的做法),要麼是指定其長度(更好地做法),要麼通過關閉連線來結" +"束。*\\ 完全由你來決定要使用哪種方式(但有些方法比其他方法來的更好)。" #: ../../howto/sockets.rst:180 msgid "" "Assuming you don't want to end the connection, the simplest solution is a " "fixed length message::" msgstr "" +"假設你不想結束連線,最簡單的方式就是使用固定長度的訊息:\n" +"\n" +"::" #: ../../howto/sockets.rst:217 msgid "" @@ -319,6 +355,10 @@ msgid "" "gets more complex. (And in C, it's not much worse, except you can't use " "``strlen`` if the message has embedded ``\\0``\\ s.)" msgstr "" +"發送部分的程式碼幾乎可用於任何訊息的傳送方式 - 在 Python 中你發送一個字串,可" +"以用 ``len()`` 來確認他的長度(即使字串包含了 ``\\0`` 字元)。在這裡,主要是" +"接收的程式碼變得更複雜一些。(在 C 語言中,情況沒有變得更糟,只是如果訊息中包" +"含了 ``\\0`` 字元,你就不能使用 ``strlen`` 函式。)" #: ../../howto/sockets.rst:223 msgid "" @@ -330,6 +370,11 @@ msgid "" "chunk size, (4096 or 8192 is frequently a good match for network buffer " "sizes), and scanning what you've received for a delimiter." msgstr "" +"最簡單的改進方法是將訊息的第一個字元表示訊息的類型,並根據訊息的類型來決定訊" +"息的長度。現在你需要使用兩次 ``recv`` - 第一次用於接收(至少)第一個字元來得" +"知長度,第二次用於在迴圈中接收剩下的訊息。如果你決定使用分隔符號的方式,你將會" +"以某個任意的區塊大小進行接收(4096 或 8192 通常是網路緩衝區大小的良好選擇)," +"並在收到的內容中掃描分隔符號。" #: ../../howto/sockets.rst:231 msgid "" @@ -339,6 +384,9 @@ msgid "" "of a following message. You'll need to put that aside and hold onto it, " "until it's needed." msgstr "" +"需要注意的一個複雜情況是,如果你的通訊協議允許連續發送多個訊息(沒有任何回" +"應),並且你傳遞給 ``recv`` 函式一個任意的區塊大小,最後有可能讀取到下一" +"條訊息的開頭。你需要將其放在一旁並保留下來,直到需要使用的時候。" #: ../../howto/sockets.rst:237 msgid "" @@ -351,6 +399,12 @@ msgid "" "not always manage to get rid of everything in one pass. And despite having " "read this, you will eventually get bit by it!" msgstr "" +"使用長度作為訊息的前綴(例如,使用 5 個數字字元表示)會變得更複雜,因為(信不" +"信由你)你可能無法在一次 ``recv`` 中獲得所有 5 個字元。在一般使用下,可能不會" +"有這個狀況,但在高負載的網路下,除非使用兩個 ``recv`` (第一個用於確定長度," +"第二個用於取得訊息的資料部分),否則你的程式碼很快就會出現錯誤。這令人非常頭" +"痛。同樣的情況也會讓你發現 ``send`` 並不總能在一次傳輸中完全清除所有內容。儘" +"管已經閱讀了這篇文章,但最終還是無法解決!" #: ../../howto/sockets.rst:246 msgid "" @@ -358,6 +412,8 @@ msgid "" "competitive position), these enhancements are left as an exercise for the " "reader. Lets move on to cleaning up." msgstr "" +"為了節省篇幅、培養你的技能(並保持我的競爭優勢),這些改進方法留給讀者自行練" +"習。現在讓我們開始進行清理工作。" #: ../../howto/sockets.rst:252 msgid "Binary Data" @@ -378,10 +434,10 @@ msgstr "" #: ../../howto/sockets.rst:262 msgid "" "Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " -"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " -"\"s\" means *short* and \"l\" means *long*. Where network order is host " -"order, these do nothing, but where the machine is byte-reversed, these swap " -"the bytes around appropriately." +"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, \"s" +"\" means *short* and \"l\" means *long*. Where network order is host order, " +"these do nothing, but where the machine is byte-reversed, these swap the " +"bytes around appropriately." msgstr "" #: ../../howto/sockets.rst:268 From ec21d8a906a5a06105bba6c6d59b295894b878d3 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:36:00 +0800 Subject: [PATCH 022/105] Sync with CPython 3.12 (#490) * sync with cpython 0c106a91 * sync with cpython c16cf9b6 * sync with cpython c1fd76e1 * sync with cpython 807afdac * sync with cpython d0176ed9 * sync with cpython 76fd98a6 * sync with cpython beb5e4fb * sync with cpython d87d67b9 * sync with cpython 84c5676e * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/arg.po | 8 +- c-api/buffer.po | 8 +- c-api/call.po | 32 +- c-api/complex.po | 6 +- c-api/exceptions.po | 26 +- c-api/file.po | 10 +- c-api/float.po | 14 +- c-api/gcsupport.po | 110 +- c-api/import.po | 8 +- c-api/init.po | 49 +- c-api/iterator.po | 10 +- c-api/long.po | 18 +- c-api/mapping.po | 17 +- c-api/memory.po | 31 +- c-api/method.po | 8 +- c-api/module.po | 8 +- c-api/object.po | 34 +- c-api/refcounting.po | 20 +- c-api/sequence.po | 8 +- c-api/slice.po | 4 +- c-api/stable.po | 6 +- c-api/structures.po | 328 ++--- c-api/sys.po | 12 +- c-api/type.po | 27 +- c-api/typeobj.po | 765 +++++------ c-api/unicode.po | 90 +- c-api/veryhigh.po | 12 +- extending/extending.po | 21 +- extending/newtypes_tutorial.po | 12 +- howto/argparse.po | 59 +- howto/clinic.po | 961 +++++++------- howto/functional.po | 6 +- howto/instrumentation.po | 12 +- howto/isolating-extensions.po | 29 +- howto/regex.po | 308 ++--- howto/sorting.po | 8 +- howto/unicode.po | 16 +- install/index.po | 6 +- library/__main__.po | 6 +- library/_thread.po | 28 +- library/array.po | 10 +- library/asyncio-dev.po | 10 +- library/asyncio-eventloop.po | 122 +- library/asyncio-platforms.po | 12 +- library/asyncio-subprocess.po | 6 +- library/codeop.po | 18 +- library/compileall.po | 6 +- library/constants.po | 25 +- library/ctypes.po | 27 +- library/curses.po | 794 ++++++------ library/devmode.po | 4 +- library/dis.po | 8 +- library/email.utils.po | 81 +- library/exceptions.po | 42 +- library/fcntl.po | 10 +- library/filecmp.po | 4 +- library/ftplib.po | 14 +- library/functions.po | 6 +- library/gc.po | 8 +- library/gettext.po | 88 +- library/gzip.po | 4 +- library/http.client.po | 4 +- library/imaplib.po | 6 +- library/importlib.po | 20 +- library/importlib.resources.abc.po | 4 +- library/io.po | 10 +- library/json.po | 8 +- library/logging.handlers.po | 114 +- library/mailbox.po | 8 +- library/multiprocessing.po | 4 +- library/optparse.po | 10 +- library/os.path.po | 8 +- library/os.po | 186 +-- library/platform.po | 6 +- library/poplib.po | 6 +- library/re.po | 505 ++++---- library/select.po | 53 +- library/shelve.po | 16 +- library/shutil.po | 197 +-- library/signal.po | 9 +- library/smtplib.po | 6 +- library/socket.po | 4 +- library/sqlite3.po | 14 +- library/ssl.po | 12 +- library/struct.po | 14 +- library/subprocess.po | 6 +- library/sys.po | 723 +++++------ library/tarfile.po | 14 +- library/tempfile.po | 12 +- library/test.po | 6 +- library/tkinter.po | 4 +- library/tkinter.ttk.po | 4 +- library/turtle.po | 1083 +++++++++------- library/unittest.mock.po | 4 +- library/unittest.po | 6 +- library/urllib.request.po | 10 +- library/venv.po | 14 +- library/xml.po | 4 +- reference/compound_stmts.po | 6 +- reference/datamodel.po | 6 +- reference/lexical_analysis.po | 304 ++--- tutorial/controlflow.po | 342 ++--- tutorial/errors.po | 10 +- tutorial/introduction.po | 11 +- tutorial/modules.po | 36 +- using/cmdline.po | 10 +- using/configure.po | 6 +- using/windows.po | 4 +- whatsnew/2.2.po | 8 +- whatsnew/2.3.po | 12 +- whatsnew/2.4.po | 4 +- whatsnew/2.5.po | 8 +- whatsnew/2.6.po | 19 +- whatsnew/2.7.po | 10 +- whatsnew/3.1.po | 6 +- whatsnew/3.10.po | 274 ++-- whatsnew/3.11.po | 113 +- whatsnew/3.12.po | 1880 ++++++++++++++-------------- whatsnew/3.2.po | 40 +- whatsnew/3.3.po | 54 +- whatsnew/3.4.po | 49 +- whatsnew/3.5.po | 25 +- whatsnew/3.6.po | 22 +- whatsnew/3.7.po | 16 +- whatsnew/3.8.po | 10 +- whatsnew/3.9.po | 35 +- 126 files changed, 5552 insertions(+), 5322 deletions(-) diff --git a/c-api/arg.po b/c-api/arg.po index 1b53e73a90..0e89cafb71 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -662,7 +662,7 @@ msgstr "" #: ../../c-api/arg.rst:345 msgid "" "It is possible to pass \"long\" integers (integers whose value exceeds the " -"platform's :const:`LONG_MAX`) however no proper range checking is done --- " +"platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " "the most significant bits are silently truncated when the receiving field is " "too small to receive the value (actually, the semantics are inherited from " "downcasts in C --- your mileage may vary)." @@ -807,7 +807,7 @@ msgstr "" msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " -"retrieve their parameters should be declared as :const:`METH_VARARGS` in " +"retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in " "function or method tables. The tuple containing the actual parameters " "should be passed as *args*; it must actually be a tuple. The length of the " "tuple must be at least *min* and no more than *max*; *min* and *max* may be " @@ -943,7 +943,7 @@ msgstr "``u`` (:class:`str`) [const wchar_t \\*]" #: ../../c-api/arg.rst:550 msgid "" -"Convert a null-terminated :c:expr:`wchar_t` buffer of Unicode (UTF-16 or " +"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" diff --git a/c-api/buffer.po b/c-api/buffer.po index dffde5dac5..01df994fde 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -321,7 +321,7 @@ msgstr "" #: ../../c-api/buffer.rst:228 msgid "" -"All :c:data:`Py_buffer` fields are unambiguously defined by the request type." +"All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" #: ../../c-api/buffer.rst:232 @@ -606,8 +606,8 @@ msgstr "" #: ../../c-api/buffer.rst:467 msgid "" -"Return the implied :c:data:`~Py_buffer.itemsize` from :c:data:`~Py_buffer." -"format`. On error, raise an exception and return -1." +"Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" +"`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" #: ../../c-api/buffer.rst:475 diff --git a/c-api/call.po b/c-api/call.po index 299ed4ba40..d125073afb 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -111,11 +111,11 @@ msgstr "" #: ../../c-api/call.rst:62 msgid "" -"The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " +"The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. (This " "internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it " "behave differently than the vectorcall function.) In earlier Python " -"versions, vectorcall should only be used with :const:`immutable " +"versions, vectorcall should only be used with :c:macro:`immutable " "` or static types." msgstr "" @@ -132,13 +132,13 @@ msgstr "" #: ../../c-api/call.rst:74 msgid "" -"Classes can implement the vectorcall protocol by enabling the :const:" +"Classes can implement the vectorcall protocol by enabling the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting :c:member:`~PyTypeObject." "tp_vectorcall_offset` to the offset inside the object structure where a " "*vectorcallfunc* appears. This is a pointer to a function with the following " "signature:" msgstr "" -"類別可以透過啟用 :const:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標並將 :c:member:" +"類別可以透過啟用 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標並將 :c:member:" "`~PyTypeObject.tp_vectorcall_offset` 設定為物件結構中有出現 *vectorcallfunc* " "的 offset 來實作 vectorcall 協定。這是一個指向具有以下簽章之函式的指標:" @@ -163,10 +163,10 @@ msgstr "*nargsf* 是位置引數的數量加上可能會有的" #: ../../c-api/call.rst:87 msgid "" -":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" -":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" "置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" #: ../../c-api/call.rst:94 @@ -205,12 +205,12 @@ msgstr "" #: ../../c-api/call.rst:106 msgid "" "Whenever they can do so cheaply (without additional allocation), callers are " -"encouraged to use :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " +"encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " "allow callables such as bound methods to make their onward calls (which " "include a prepended *self* argument) very efficiently." msgstr "" "當可以以幾乎無代價的方式(無需佔據額外的記憶體)來達成,那麼會推薦呼叫者使" -"用 :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結方" +"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結方" "法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 *self* " "引數)。" @@ -315,11 +315,11 @@ msgstr "" msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " -"It does not check the :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " +"It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " "not fall back to ``tp_call``." msgstr "" "這是一個專門函式,其目的是被放入 :c:member:`~PyTypeObject.tp_call` 擴充槽或是" -"用於 ``tp_call`` 的實作。它不會檢查 :const:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" +"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" "並且它不會退回 (fall back) 使用 ``tp_call``。" #: ../../c-api/call.rst:186 @@ -654,8 +654,8 @@ msgid "" "method is given as a Python string *name*. The object whose method is called " "is *args[0]*, and the *args* array starting at *args[1]* represents the " "arguments of the call. There must be at least one positional argument. " -"*nargsf* is the number of positional arguments including *args[0]*, plus :" -"const:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " +"*nargsf* is the number of positional arguments including *args[0]*, plus :c:" +"macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " "temporarily be changed. Keyword arguments can be passed just like in :c:func:" "`PyObject_Vectorcall`." msgstr "" @@ -663,15 +663,15 @@ msgstr "" "*name* 的格式給定。被呼叫 method 的物件為 *args[0]*,而 *args* 陣列從 " "*args[1]* 開始的部分則代表呼叫的引數。必須傳入至少一個位置引數。*nargsf* 為包" "括 *args[0]* 在內的位置引數的數量,如果 ``args[0]`` 的值可能被臨時改變則要再" -"加上 :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" +"加上 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" "`PyObject_Vectorcall` 中一樣被傳入。" #: ../../c-api/call.rst:399 msgid "" -"If the object has the :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " +"If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -"如果物件具有 :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " +"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " "向量作為引數來呼叫 unbound method(未繫結方法)物件。" #: ../../c-api/call.rst:410 diff --git a/c-api/complex.po b/c-api/complex.po index 4f283a1141..1a4140e607 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 15:31+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -82,7 +82,7 @@ msgstr "" #: ../../c-api/complex.rst:66 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" -"c:data:`EDOM`." +"c:macro:`EDOM`." msgstr "" #: ../../c-api/complex.rst:72 @@ -94,7 +94,7 @@ msgstr "" #: ../../c-api/complex.rst:75 msgid "" "If *num* is null and *exp* is not a positive real number, this method " -"returns zero and sets :c:data:`errno` to :c:data:`EDOM`." +"returns zero and sets :c:data:`errno` to :c:macro:`EDOM`." msgstr "" #: ../../c-api/complex.rst:80 diff --git a/c-api/exceptions.po b/c-api/exceptions.po index af5f44460c..443fd46d9f 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -202,8 +202,8 @@ msgid "" "function has returned an error and set the C variable :c:data:`errno`. It " "constructs a tuple object whose first item is the integer :c:data:`errno` " "value and whose second item is the corresponding error message (gotten from :" -"c:func:`strerror`), and then calls ``PyErr_SetObject(type, object)``. On " -"Unix, when the :c:data:`errno` value is :const:`EINTR`, indicating an " +"c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " +"Unix, when the :c:data:`errno` value is :c:macro:`EINTR`, indicating an " "interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " "that set the error indicator, leaves it set to that. The function always " "returns ``NULL``, so a wrapper function around a system call can write " @@ -649,14 +649,14 @@ msgstr "" #: ../../c-api/exceptions.rst:634 msgid "" -"The default Python signal handler for :const:`SIGINT` raises the :exc:" +"The default Python signal handler for :c:macro:`SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" #: ../../c-api/exceptions.rst:645 msgid "" -"Simulate the effect of a :const:`SIGINT` signal arriving. This is equivalent " -"to ``PyErr_SetInterruptEx(SIGINT)``." +"Simulate the effect of a :c:macro:`SIGINT` signal arriving. This is " +"equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" #: ../../c-api/exceptions.rst:649 ../../c-api/exceptions.rst:676 @@ -682,8 +682,8 @@ msgstr "" #: ../../c-api/exceptions.rst:668 msgid "" -"If the given signal isn't handled by Python (it was set to :data:`signal." -"SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored." +"If the given signal isn't handled by Python (it was set to :py:const:`signal." +"SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" #: ../../c-api/exceptions.rst:671 @@ -776,7 +776,7 @@ msgstr "" #: ../../c-api/exceptions.rst:757 msgid "" -"Return the cause (either an exception instance, or :const:`None`, set by " +"Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" @@ -785,7 +785,7 @@ msgstr "" msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " -"exception instance or :const:`None`. This steals a reference to *cause*." +"exception instance or ``None``. This steals a reference to *cause*." msgstr "" #: ../../c-api/exceptions.rst:768 @@ -894,9 +894,9 @@ msgstr "" #: ../../c-api/exceptions.rst:877 msgid "" -"If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " -"overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" -"exc:`MemoryError` and returns a nonzero value." +"If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " +"stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " +"sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" #: ../../c-api/exceptions.rst:881 diff --git a/c-api/file.po b/c-api/file.po index d350067db4..9637c1d229 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-04-24 20:38+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -162,11 +162,11 @@ msgstr "" #: ../../c-api/file.rst:95 msgid "" "Write object *obj* to file object *p*. The only supported flag for *flags* " -"is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written " -"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; " -"the appropriate exception will be set." +"is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is " +"written instead of the :func:`repr`. Return ``0`` on success or ``-1`` on " +"failure; the appropriate exception will be set." msgstr "" -"將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :const:" +"將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :c:macro:" "`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在" "成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。" diff --git a/c-api/float.po b/c-api/float.po index 26ca33b963..17030a1fec 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 15:31+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -138,9 +138,9 @@ msgid "" "The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:" "`int` argument, non-zero if you want the bytes string in little-endian " "format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you " -"want big-endian format (exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN` " -"constant can be used to use the native endian: it is equal to ``1`` on big " -"endian processor, or ``0`` on little endian processor." +"want big-endian format (exponent first, at *p*). The :c:macro:" +"`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal " +"to ``1`` on big endian processor, or ``0`` on little endian processor." msgstr "" #: ../../c-api/float.rst:116 @@ -182,9 +182,9 @@ msgid "" "The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an :c:" "expr:`int` argument, non-zero if the bytes string is in little-endian format " "(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-" -"endian (exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN` constant can be " -"used to use the native endian: it is equal to ``1`` on big endian processor, " -"or ``0`` on little endian processor." +"endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can " +"be used to use the native endian: it is equal to ``1`` on big endian " +"processor, or ``0`` on little endian processor." msgstr "" #: ../../c-api/float.rst:147 diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index f80c8177ca..13e0eb53de 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,60 +35,64 @@ msgstr "" #: ../../c-api/gcsupport.rst:15 msgid "" "To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of " -"the type object must include the :const:`Py_TPFLAGS_HAVE_GC` and provide an " -"implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " +"the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide " +"an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " "instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` " "implementation must also be provided." msgstr "" #: ../../c-api/gcsupport.rst:24 +msgid ":c:macro:`Py_TPFLAGS_HAVE_GC`" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_GC`" + +#: ../../c-api/gcsupport.rst:22 msgid "" "Objects with a type with this flag set must conform with the rules " "documented here. For convenience these objects will be referred to as " "container objects." msgstr "" -#: ../../c-api/gcsupport.rst:28 +#: ../../c-api/gcsupport.rst:26 msgid "Constructors for container types must conform to two rules:" msgstr "" -#: ../../c-api/gcsupport.rst:30 +#: ../../c-api/gcsupport.rst:28 msgid "" "The memory for the object must be allocated using :c:func:`PyObject_GC_New` " "or :c:func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:33 +#: ../../c-api/gcsupport.rst:31 msgid "" "Once all the fields which may contain references to other containers are " "initialized, it must call :c:func:`PyObject_GC_Track`." msgstr "" -#: ../../c-api/gcsupport.rst:36 +#: ../../c-api/gcsupport.rst:34 msgid "" "Similarly, the deallocator for the object must conform to a similar pair of " "rules:" msgstr "" -#: ../../c-api/gcsupport.rst:39 +#: ../../c-api/gcsupport.rst:37 msgid "" "Before fields which refer to other containers are invalidated, :c:func:" "`PyObject_GC_UnTrack` must be called." msgstr "" -#: ../../c-api/gcsupport.rst:42 +#: ../../c-api/gcsupport.rst:40 msgid "" "The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." msgstr "" -#: ../../c-api/gcsupport.rst:45 +#: ../../c-api/gcsupport.rst:43 msgid "" "If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" "c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " "subclass or subclasses." msgstr "" -#: ../../c-api/gcsupport.rst:49 +#: ../../c-api/gcsupport.rst:47 msgid "" "When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call " "it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the " @@ -96,22 +100,22 @@ msgid "" "tp_flags`, :c:member:`~PyTypeObject.tp_traverse` and :c:member:" "`~PyTypeObject.tp_clear` fields if the type inherits from a class that " "implements the garbage collector protocol and the child class does *not* " -"include the :const:`Py_TPFLAGS_HAVE_GC` flag." +"include the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../c-api/gcsupport.rst:59 +#: ../../c-api/gcsupport.rst:57 msgid "" -"Analogous to :c:func:`PyObject_New` but for container objects with the :" -"const:`Py_TPFLAGS_HAVE_GC` flag set." +"Analogous to :c:func:`PyObject_New` but for container objects with the :c:" +"macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:64 +#: ../../c-api/gcsupport.rst:62 msgid "" -"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" -"const:`Py_TPFLAGS_HAVE_GC` flag set." +"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :c:" +"macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" -#: ../../c-api/gcsupport.rst:69 +#: ../../c-api/gcsupport.rst:67 msgid "" "Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size* bytes at " "the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " @@ -119,13 +123,13 @@ msgid "" "object header `." msgstr "" -#: ../../c-api/gcsupport.rst:75 +#: ../../c-api/gcsupport.rst:73 msgid "" "The extra data will be deallocated with the object, but otherwise it is not " "managed by Python." msgstr "" -#: ../../c-api/gcsupport.rst:79 +#: ../../c-api/gcsupport.rst:77 msgid "" "The function is marked as unstable because the final mechanism for reserving " "extra data after an instance is not yet decided. For allocating a variable " @@ -133,14 +137,14 @@ msgid "" "`~PyTypeObject.tp_itemsize` instead." msgstr "" -#: ../../c-api/gcsupport.rst:90 +#: ../../c-api/gcsupport.rst:88 msgid "" "Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" -#: ../../c-api/gcsupport.rst:96 +#: ../../c-api/gcsupport.rst:94 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -149,45 +153,45 @@ msgid "" "usually near the end of the constructor." msgstr "" -#: ../../c-api/gcsupport.rst:105 +#: ../../c-api/gcsupport.rst:103 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:108 +#: ../../c-api/gcsupport.rst:106 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:113 +#: ../../c-api/gcsupport.rst:111 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:116 +#: ../../c-api/gcsupport.rst:114 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:123 +#: ../../c-api/gcsupport.rst:121 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:126 +#: ../../c-api/gcsupport.rst:124 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:133 +#: ../../c-api/gcsupport.rst:131 msgid "" "Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" "func:`PyObject_GC_NewVar`." msgstr "" -#: ../../c-api/gcsupport.rst:139 +#: ../../c-api/gcsupport.rst:137 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -197,19 +201,19 @@ msgid "" "handler become invalid." msgstr "" -#: ../../c-api/gcsupport.rst:148 +#: ../../c-api/gcsupport.rst:146 msgid "" "The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" -#: ../../c-api/gcsupport.rst:151 +#: ../../c-api/gcsupport.rst:149 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" msgstr "" -#: ../../c-api/gcsupport.rst:156 +#: ../../c-api/gcsupport.rst:154 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -219,13 +223,13 @@ msgid "" "users will need to write their own visitor functions." msgstr "" -#: ../../c-api/gcsupport.rst:163 +#: ../../c-api/gcsupport.rst:161 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" msgstr "" -#: ../../c-api/gcsupport.rst:168 +#: ../../c-api/gcsupport.rst:166 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -235,7 +239,7 @@ msgid "" "returned immediately." msgstr "" -#: ../../c-api/gcsupport.rst:175 +#: ../../c-api/gcsupport.rst:173 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -243,20 +247,20 @@ msgid "" "exactly *visit* and *arg*:" msgstr "" -#: ../../c-api/gcsupport.rst:182 +#: ../../c-api/gcsupport.rst:180 msgid "" "If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " "*arg*. If *visit* returns a non-zero value, then return it. Using this " "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" -#: ../../c-api/gcsupport.rst:195 +#: ../../c-api/gcsupport.rst:193 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." msgstr "" -#: ../../c-api/gcsupport.rst:201 +#: ../../c-api/gcsupport.rst:199 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -266,23 +270,23 @@ msgid "" "in a reference cycle." msgstr "" -#: ../../c-api/gcsupport.rst:210 +#: ../../c-api/gcsupport.rst:208 msgid "Controlling the Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:212 +#: ../../c-api/gcsupport.rst:210 msgid "" "The C-API provides the following functions for controlling garbage " "collection runs." msgstr "" -#: ../../c-api/gcsupport.rst:217 +#: ../../c-api/gcsupport.rst:215 msgid "" "Perform a full garbage collection, if the garbage collector is enabled. " "(Note that :func:`gc.collect` runs it unconditionally.)" msgstr "" -#: ../../c-api/gcsupport.rst:220 +#: ../../c-api/gcsupport.rst:218 msgid "" "Returns the number of collected + unreachable objects which cannot be " "collected. If the garbage collector is disabled or already collecting, " @@ -290,54 +294,54 @@ msgid "" "data:`sys.unraisablehook`. This function does not raise exceptions." msgstr "" -#: ../../c-api/gcsupport.rst:230 +#: ../../c-api/gcsupport.rst:228 msgid "" "Enable the garbage collector: similar to :func:`gc.enable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:238 +#: ../../c-api/gcsupport.rst:236 msgid "" "Disable the garbage collector: similar to :func:`gc.disable`. Returns the " "previous state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:246 +#: ../../c-api/gcsupport.rst:244 msgid "" "Query the state of the garbage collector: similar to :func:`gc.isenabled`. " "Returns the current state, 0 for disabled and 1 for enabled." msgstr "" -#: ../../c-api/gcsupport.rst:253 +#: ../../c-api/gcsupport.rst:251 msgid "Querying Garbage Collector State" msgstr "" -#: ../../c-api/gcsupport.rst:255 +#: ../../c-api/gcsupport.rst:253 msgid "" "The C-API provides the following interface for querying information about " "the garbage collector." msgstr "" -#: ../../c-api/gcsupport.rst:260 +#: ../../c-api/gcsupport.rst:258 msgid "" "Run supplied *callback* on all live GC-capable objects. *arg* is passed " "through to all invocations of *callback*." msgstr "" -#: ../../c-api/gcsupport.rst:264 +#: ../../c-api/gcsupport.rst:262 msgid "" "If new objects are (de)allocated by the callback it is undefined if they " "will be visited." msgstr "" -#: ../../c-api/gcsupport.rst:267 +#: ../../c-api/gcsupport.rst:265 msgid "" "Garbage collection is disabled during operation. Explicitly running a " "collection in the callback may lead to undefined behaviour e.g. visiting the " "same objects multiple times or not at all." msgstr "" -#: ../../c-api/gcsupport.rst:275 +#: ../../c-api/gcsupport.rst:273 msgid "" "Type of the visitor function to be passed to :c:func:" "`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " diff --git a/c-api/import.po b/c-api/import.po index 142a055500..51c28be036 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -135,10 +135,10 @@ msgid "" "object read from a Python bytecode file or obtained from the built-in " "function :func:`compile`, load the module. Return a new reference to the " "module object, or ``NULL`` with an exception set if an error occurred. " -"*name* is removed from :attr:`sys.modules` in error cases, even if *name* " -"was already in :attr:`sys.modules` on entry to :c:func:" +"*name* is removed from :data:`sys.modules` in error cases, even if *name* " +"was already in :data:`sys.modules` on entry to :c:func:" "`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :" -"attr:`sys.modules` is dangerous, as imports of such modules have no way to " +"data:`sys.modules` is dangerous, as imports of such modules have no way to " "know that the module object is an unknown (and probably damaged with respect " "to the module author's intents) state." msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 5580d2c144..df7fd57324 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1585,8 +1585,8 @@ msgid "" "This function does not steal any references to *exc*. To prevent naive " "misuse, you must write your own C extension to call this. Must be called " "with the GIL held. Returns the number of thread states modified; this is " -"normally one, but will be zero if the thread id isn't found. If *exc* is :" -"const:`NULL`, the pending exception (if any) for the thread is cleared. This " +"normally one, but will be zero if the thread id isn't found. If *exc* is " +"``NULL``, the pending exception (if any) for the thread is cleared. This " "raises no exceptions." msgstr "" @@ -1897,10 +1897,11 @@ msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " "the registration function as *obj*, *frame* is the frame object to which the " -"event pertains, *what* is one of the constants :const:`PyTrace_CALL`, :const:" -"`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:" -"`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :const:`PyTrace_C_RETURN`, " -"or :const:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" +"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" +"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" +"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" +"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " +"value of *what*:" msgstr "" #: ../../c-api/init.rst:1684 @@ -1912,7 +1913,8 @@ msgid "Meaning of *arg*" msgstr "" #: ../../c-api/init.rst:1686 -msgid ":const:`PyTrace_CALL`" +#, fuzzy +msgid ":c:data:`PyTrace_CALL`" msgstr ":const:`PyTrace_CALL`" #: ../../c-api/init.rst:1686 ../../c-api/init.rst:1691 @@ -1921,7 +1923,8 @@ msgid "Always :c:data:`Py_None`." msgstr "" #: ../../c-api/init.rst:1688 -msgid ":const:`PyTrace_EXCEPTION`" +#, fuzzy +msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":const:`PyTrace_EXCEPTION`" #: ../../c-api/init.rst:1688 @@ -1929,11 +1932,13 @@ msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" #: ../../c-api/init.rst:1691 -msgid ":const:`PyTrace_LINE`" +#, fuzzy +msgid ":c:data:`PyTrace_LINE`" msgstr ":const:`PyTrace_LINE`" #: ../../c-api/init.rst:1693 -msgid ":const:`PyTrace_RETURN`" +#, fuzzy +msgid ":c:data:`PyTrace_RETURN`" msgstr ":const:`PyTrace_RETURN`" #: ../../c-api/init.rst:1693 @@ -1942,7 +1947,8 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1696 -msgid ":const:`PyTrace_C_CALL`" +#, fuzzy +msgid ":c:data:`PyTrace_C_CALL`" msgstr ":const:`PyTrace_C_CALL`" #: ../../c-api/init.rst:1696 ../../c-api/init.rst:1698 @@ -1951,15 +1957,18 @@ msgid "Function object being called." msgstr "" #: ../../c-api/init.rst:1698 -msgid ":const:`PyTrace_C_EXCEPTION`" +#, fuzzy +msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":const:`PyTrace_C_EXCEPTION`" #: ../../c-api/init.rst:1700 -msgid ":const:`PyTrace_C_RETURN`" +#, fuzzy +msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":const:`PyTrace_C_RETURN`" #: ../../c-api/init.rst:1702 -msgid ":const:`PyTrace_OPCODE`" +#, fuzzy +msgid ":c:data:`PyTrace_OPCODE`" msgstr ":const:`PyTrace_OPCODE`" #: ../../c-api/init.rst:1707 @@ -2029,8 +2038,8 @@ msgid "" "function as its first parameter, and may be any Python object, or ``NULL``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " -"it. The profile function is called for all monitored events except :const:" -"`PyTrace_LINE` :const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`." +"it. The profile function is called for all monitored events except :c:data:" +"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" #: ../../c-api/init.rst:1773 @@ -2061,9 +2070,9 @@ msgid "" "`PyEval_SetProfile`, except the tracing function does receive line-number " "events and per-opcode events, but does not receive any event related to C " "function objects being called. Any trace function registered using :c:func:" -"`PyEval_SetTrace` will not receive :const:`PyTrace_C_CALL`, :const:" -"`PyTrace_C_EXCEPTION` or :const:`PyTrace_C_RETURN` as a value for the *what* " -"parameter." +"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" +"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " +"*what* parameter." msgstr "" #: ../../c-api/init.rst:1799 diff --git a/c-api/iterator.po b/c-api/iterator.po index 748615e442..805a6ed7bb 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -26,10 +26,10 @@ msgstr "疊代器(Iterator)物件" #: ../../c-api/iterator.rst:8 msgid "" "Python provides two general-purpose iterator objects. The first, a sequence " -"iterator, works with an arbitrary sequence supporting the :meth:" -"`__getitem__` method. The second works with a callable object and a " -"sentinel value, calling the callable for each item in the sequence, and " -"ending the iteration when the sentinel value is returned." +"iterator, works with an arbitrary sequence supporting the :meth:`~object." +"__getitem__` method. The second works with a callable object and a sentinel " +"value, calling the callable for each item in the sequence, and ending the " +"iteration when the sentinel value is returned." msgstr "" #: ../../c-api/iterator.rst:17 diff --git a/c-api/long.po b/c-api/long.po index 3fcacd8eaf..61e8cfc2db 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -169,10 +169,10 @@ msgstr "" #: ../../c-api/long.rst:145 msgid "" -"If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" -"`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " -"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " -"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:" +"macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" #: ../../c-api/long.rst:164 ../../c-api/long.rst:182 @@ -190,10 +190,10 @@ msgstr "" #: ../../c-api/long.rst:186 msgid "" -"If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" -"`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " -"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " -"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:" +"macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" #: ../../c-api/long.rst:208 diff --git a/c-api/mapping.po b/c-api/mapping.po index eb5e539d3e..cdfeb15ebe 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -32,8 +32,8 @@ msgstr "" msgid "" "Return ``1`` if the object provides the mapping protocol or supports " "slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes " -"with a :meth:`__getitem__` method, since in general it is impossible to " -"determine what type of keys the class supports. This function always " +"with a :meth:`~object.__getitem__` method, since in general it is impossible " +"to determine what type of keys the class supports. This function always " "succeeds." msgstr "" @@ -80,16 +80,17 @@ msgstr "" #: ../../c-api/mapping.rst:63 msgid "" -"Note that exceptions which occur while calling the :meth:`__getitem__` " -"method will get suppressed. To get error reporting use :c:func:" +"Note that exceptions which occur while calling the :meth:`~object." +"__getitem__` method will get suppressed. To get error reporting use :c:func:" "`PyObject_GetItem()` instead." msgstr "" #: ../../c-api/mapping.rst:74 msgid "" -"Note that exceptions which occur while calling the :meth:`__getitem__` " -"method and creating a temporary string object will get suppressed. To get " -"error reporting use :c:func:`PyMapping_GetItemString()` instead." +"Note that exceptions which occur while calling the :meth:`~object." +"__getitem__` method and creating a temporary string object will get " +"suppressed. To get error reporting use :c:func:`PyMapping_GetItemString()` " +"instead." msgstr "" #: ../../c-api/mapping.rst:81 diff --git a/c-api/memory.po b/c-api/memory.po index 66ab7313d4..7688c51e7a 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -684,7 +684,7 @@ msgstr "" #: ../../c-api/memory.rst:473 msgid "" -"For the :c:data:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" +"For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" "safe: the :term:`GIL ` is not held when the " "allocator is called." msgstr "" @@ -785,8 +785,9 @@ msgstr "" #: ../../c-api/memory.rst:538 msgid "" "Check that the :term:`GIL ` is held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../c-api/memory.rst:543 @@ -826,15 +827,15 @@ msgid "API identifier (ASCII character):" msgstr "" #: ../../c-api/memory.rst:560 -msgid "``'r'`` for :c:data:`PYMEM_DOMAIN_RAW`." +msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" #: ../../c-api/memory.rst:561 -msgid "``'m'`` for :c:data:`PYMEM_DOMAIN_MEM`." +msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" #: ../../c-api/memory.rst:562 -msgid "``'o'`` for :c:data:`PYMEM_DOMAIN_OBJ`." +msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" #: ../../c-api/memory.rst:565 @@ -881,11 +882,11 @@ msgstr "" #: ../../c-api/memory.rst:583 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" -"like function. Big-endian ``size_t``. If \"bad memory\" is detected later, " -"the serial number gives an excellent way to set a breakpoint on the next " -"run, to capture the instant at which this block was passed out. The static " -"function bumpserialno() in obmalloc.c is the only place the serial number is " -"incremented, and exists so you can set such a breakpoint easily." +"like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " +"later, the serial number gives an excellent way to set a breakpoint on the " +"next run, to capture the instant at which this block was passed out. The " +"static function bumpserialno() in obmalloc.c is the only place the serial " +"number is incremented, and exists so you can set such a breakpoint easily." msgstr "" #: ../../c-api/memory.rst:590 @@ -906,8 +907,8 @@ msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" "`tracemalloc` to get the traceback where a memory block was allocated. The " -"debug hooks now also check if the GIL is held when functions of :c:data:" -"`PYMEM_DOMAIN_OBJ` and :c:data:`PYMEM_DOMAIN_MEM` domains are called." +"debug hooks now also check if the GIL is held when functions of :c:macro:" +"`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" #: ../../c-api/memory.rst:607 @@ -934,7 +935,7 @@ msgstr "" #: ../../c-api/memory.rst:624 msgid "" "*pymalloc* is the :ref:`default allocator ` of " -"the :c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:data:" +"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" diff --git a/c-api/method.po b/c-api/method.po index 3a025153c9..749218e03a 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-01-24 22:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,11 +26,11 @@ msgstr "實例方法物件 (Instance Method Objects)" #: ../../c-api/method.rst:10 msgid "" -"An instance method is a wrapper for a :c:data:`PyCFunction` and the new way " -"to bind a :c:data:`PyCFunction` to a class object. It replaces the former " +"An instance method is a wrapper for a :c:type:`PyCFunction` and the new way " +"to bind a :c:type:`PyCFunction` to a class object. It replaces the former " "call ``PyMethod_New(func, NULL, class)``." msgstr "" -"實例方法是 :c:data:`PyCFunction` 的包裝器 (wrapper),也是將 :c:data:" +"實例方法是 :c:type:`PyCFunction` 的包裝器 (wrapper),也是將 :c:type:" "`PyCFunction` 繫結 (bind) 到類別物件的一種新方式。它替代了原先對 " "``PyMethod_New(func, NULL, class)`` 的呼叫。" diff --git a/c-api/module.po b/c-api/module.po index c56523e7bb..751c9c7f8c 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -148,7 +148,7 @@ msgid "" msgstr "" #: ../../c-api/module.rst:148 -msgid "Always initialize this member to :const:`PyModuleDef_HEAD_INIT`." +msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "" #: ../../c-api/module.rst:152 @@ -269,7 +269,7 @@ msgstr "" #: ../../c-api/module.rst:257 msgid "" "Create a new module object, given the definition in *def*. This behaves " -"like :c:func:`PyModule_Create2` with *module_api_version* set to :const:" +"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" "`PYTHON_API_VERSION`." msgstr "" @@ -446,7 +446,7 @@ msgstr "" msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " -"*module_api_version* set to :const:`PYTHON_API_VERSION`." +"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" #: ../../c-api/module.rst:399 diff --git a/c-api/object.po b/c-api/object.po index b0a56f9468..1e23b76317 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -39,7 +39,7 @@ msgstr "" msgid "" "Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " "argument is used to enable certain printing options. The only option " -"currently supported is :const:`Py_PRINT_RAW`; if given, the :func:`str` of " +"currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of " "the object is written instead of the :func:`repr`." msgstr "" @@ -168,29 +168,29 @@ msgstr "" #: ../../c-api/object.rst:164 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" -"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " -"``==``, ``!=``, ``>``, or ``>=`` respectively. This is the equivalent of the " -"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " -"to *opid*. Returns the value of the comparison on success, or ``NULL`` on " -"failure." +"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" +"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " +"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the " +"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " +"operator corresponding to *opid*. Returns the value of the comparison on " +"success, or ``NULL`` on failure." msgstr "" #: ../../c-api/object.rst:174 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" -"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " -"``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error, " -"``0`` if the result is false, ``1`` otherwise. This is the equivalent of the " -"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " -"to *opid*." +"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" +"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " +"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` " +"on error, ``0`` if the result is false, ``1`` otherwise. This is the " +"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " +"operator corresponding to *opid*." msgstr "" #: ../../c-api/object.rst:183 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " -"will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." +"will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" #: ../../c-api/object.rst:188 @@ -454,14 +454,14 @@ msgstr "" #: ../../c-api/object.rst:433 msgid "" -"Get a pointer to per-item data for a class with :const:" +"Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" #: ../../c-api/object.rst:436 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " -"raised if *o* does not have :const:`Py_TPFLAGS_ITEMS_AT_END` set." +"raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" #: ../../c-api/object.rst:197 ../../c-api/object.rst:209 diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 3135285199..7f9b3153dd 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-07-01 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -164,16 +164,16 @@ msgstr "" #: ../../c-api/refcounting.rst:103 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." -"g. when a class instance with a :meth:`__del__` method is deallocated). " -"While exceptions in such code are not propagated, the executed code has free " -"access to all Python global variables. This means that any object that is " -"reachable from a global variable should be in a consistent state before :c:" -"func:`Py_DECREF` is invoked. For example, code to delete an object from a " -"list should copy a reference to the deleted object in a temporary variable, " -"update the list data structure, and then call :c:func:`Py_DECREF` for the " -"temporary variable." +"g. when a class instance with a :meth:`~object.__del__` method is " +"deallocated). While exceptions in such code are not propagated, the " +"executed code has free access to all Python global variables. This means " +"that any object that is reachable from a global variable should be in a " +"consistent state before :c:func:`Py_DECREF` is invoked. For example, code " +"to delete an object from a list should copy a reference to the deleted " +"object in a temporary variable, update the list data structure, and then " +"call :c:func:`Py_DECREF` for the temporary variable." msgstr "" -"釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`__del__` 方" +"釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`~object.__del__` 方" "法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但​​執行的程式碼可以自" "由存取所有 Python 全域變數。這意味著在調用 :c:func:`Py_DECREF` 之前,可從全域" "變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程式碼應將已刪" diff --git a/c-api/sequence.po b/c-api/sequence.po index a2e2117a3a..5ef95263f1 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -26,9 +26,9 @@ msgstr "" msgid "" "Return ``1`` if the object provides the sequence protocol, and ``0`` " "otherwise. Note that it returns ``1`` for Python classes with a :meth:" -"`__getitem__` method, unless they are :class:`dict` subclasses, since in " -"general it is impossible to determine what type of keys the class supports. " -"This function always succeeds." +"`~object.__getitem__` method, unless they are :class:`dict` subclasses, " +"since in general it is impossible to determine what type of keys the class " +"supports. This function always succeeds." msgstr "" #: ../../c-api/sequence.rst:23 diff --git a/c-api/slice.po b/c-api/slice.po index 39ab0db837..952d8af806 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -54,7 +54,7 @@ msgstr "" #: ../../c-api/slice.rst:36 msgid "" "Returns ``0`` on success and ``-1`` on error with no exception set (unless " -"one of the indices was not :const:`None` and failed to be converted to an " +"one of the indices was not ``None`` and failed to be converted to an " "integer, in which case ``-1`` is returned with an exception set)." msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po index 7f6405b6f6..59f5a6d71c 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -141,13 +141,13 @@ msgstr "" #: ../../c-api/stable.rst:77 msgid "" -"Define ``Py_LIMITED_API`` to the value of :c:data:`PY_VERSION_HEX` " +"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " "corresponding to the lowest Python version your extension supports. The " "extension will work without recompilation with all Python 3 releases from " "the specified one onward, and can use Limited API introduced up to that " "version." msgstr "" -"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:data:" +"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:macro:" "`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 Python 3 版" "本一起使用,並且可以使用過去版本有引入的受限 API。" diff --git a/c-api/structures.po b/c-api/structures.po index a097366367..df5d611176 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -189,26 +189,28 @@ msgstr "" #: ../../c-api/structures.rst:181 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_VARARGS | METH_KEYWORDS`. The function signature is::" +"signature :ref:`METH_VARARGS | METH_KEYWORDS `. " +"The function signature is::" msgstr "" #: ../../c-api/structures.rst:192 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_FASTCALL`. The function signature is::" +"signature :c:macro:`METH_FASTCALL`. The function signature is::" msgstr "" #: ../../c-api/structures.rst:202 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_FASTCALL | METH_KEYWORDS`. The function signature is::" +"signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::" msgstr "" #: ../../c-api/structures.rst:213 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :const:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`. The function " -"signature is::" +"signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" msgstr "" #: ../../c-api/structures.rst:228 @@ -266,6 +268,19 @@ msgstr "" #: ../../c-api/structures.rst:272 msgid "" +"Can only be used in certain combinations with other flags: :ref:" +"`METH_VARARGS | METH_KEYWORDS `, :ref:" +"`METH_FASTCALL | METH_KEYWORDS ` and :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." +msgstr "" + +#: ../../c-api/structures.rst:286 +msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:281 +msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " "*kwargs* is a dictionary of all the keyword arguments or possibly ``NULL`` " @@ -273,7 +288,7 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:281 +#: ../../c-api/structures.rst:290 msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " @@ -282,61 +297,76 @@ msgid "" "the array)." msgstr "" -#: ../../c-api/structures.rst:291 +#: ../../c-api/structures.rst:300 msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." msgstr "" -#: ../../c-api/structures.rst:296 +#: ../../c-api/structures.rst:317 +msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:306 +msgid "" +"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " +"with methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword " +"arguments are passed the same way as in the :ref:`vectorcall protocol " +"`: there is an additional fourth :c:expr:`PyObject*` parameter " +"which is a tuple representing the names of the keyword arguments (which are " +"guaranteed to be strings) or possibly ``NULL`` if there are no keywords. " +"The values of the keyword arguments are stored in the *args* array, after " +"the positional arguments." +msgstr "" + +#: ../../c-api/structures.rst:321 msgid "" -"Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " -"methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " -"are passed the same way as in the :ref:`vectorcall protocol `: " -"there is an additional fourth :c:expr:`PyObject*` parameter which is a tuple " -"representing the names of the keyword arguments (which are guaranteed to be " -"strings) or possibly ``NULL`` if there are no keywords. The values of the " -"keyword arguments are stored in the *args* array, after the positional " -"arguments." +"Can only be used in the combination with other flags: :ref:`METH_METHOD | " +"METH_FASTCALL | METH_KEYWORDS `." msgstr "" -#: ../../c-api/structures.rst:311 +#: ../../c-api/structures.rst:338 +msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" +msgstr "" + +#: ../../c-api/structures.rst:328 msgid "" -"Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " -"class*, that is, the class that contains the method in question. The " -"defining class might be a superclass of ``Py_TYPE(self)``." +"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " +"contains the method in question. The defining class might be a superclass of " +"``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:315 +#: ../../c-api/structures.rst:333 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:324 +#: ../../c-api/structures.rst:342 msgid "" "Methods without parameters don't need to check whether arguments are given " -"if they are listed with the :const:`METH_NOARGS` flag. They need to be of " +"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of " "type :c:type:`PyCFunction`. The first parameter is typically named *self* " "and will hold a reference to the module or object instance. In all cases " "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:330 +#: ../../c-api/structures.rst:348 msgid "" "The function must have 2 parameters. Since the second parameter is unused, :" "c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" -#: ../../c-api/structures.rst:336 +#: ../../c-api/structures.rst:354 msgid "" -"Methods with a single object argument can be listed with the :const:`METH_O` " -"flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " -"argument. They have the type :c:type:`PyCFunction`, with the *self* " -"parameter, and a :c:expr:`PyObject*` parameter representing the single " -"argument." +"Methods with a single object argument can be listed with the :c:macro:" +"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " +"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " +"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " +"single argument." msgstr "" -#: ../../c-api/structures.rst:342 +#: ../../c-api/structures.rst:360 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -344,27 +374,27 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:352 +#: ../../c-api/structures.rst:370 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:362 +#: ../../c-api/structures.rst:380 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:366 +#: ../../c-api/structures.rst:384 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:372 +#: ../../c-api/structures.rst:390 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " @@ -377,48 +407,48 @@ msgid "" "calls." msgstr "" -#: ../../c-api/structures.rst:384 +#: ../../c-api/structures.rst:402 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:388 +#: ../../c-api/structures.rst:406 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. Its fields are, in order:" msgstr "" -#: ../../c-api/structures.rst:393 +#: ../../c-api/structures.rst:411 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:396 +#: ../../c-api/structures.rst:414 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:400 +#: ../../c-api/structures.rst:418 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:404 +#: ../../c-api/structures.rst:422 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:409 +#: ../../c-api/structures.rst:427 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:413 +#: ../../c-api/structures.rst:431 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:417 +#: ../../c-api/structures.rst:435 msgid "" "By default (when :c:member:`flags` is ``0``), members allow both read and " "write access. Use the :c:macro:`Py_READONLY` flag for read-only access. " @@ -427,7 +457,7 @@ msgid "" "be deleted." msgstr "" -#: ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:444 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -436,112 +466,112 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:456 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:458 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " "``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " -"extensions are strongly encouraged to use :const:`Py_TPFLAGS_MANAGED_DICT` " -"and :const:`Py_TPFLAGS_MANAGED_WEAKREF` instead." +"extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:448 +#: ../../c-api/structures.rst:466 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:453 +#: ../../c-api/structures.rst:471 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:459 +#: ../../c-api/structures.rst:477 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:482 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:470 +#: ../../c-api/structures.rst:488 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:476 +#: ../../c-api/structures.rst:494 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:478 +#: ../../c-api/structures.rst:496 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:482 +#: ../../c-api/structures.rst:500 msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:486 +#: ../../c-api/structures.rst:504 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:491 +#: ../../c-api/structures.rst:509 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:495 +#: ../../c-api/structures.rst:513 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " "negative :c:member:`~PyTypeDef.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:500 +#: ../../c-api/structures.rst:518 msgid "" "This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:512 +#: ../../c-api/structures.rst:530 msgid "" -"The :const:`!RESTRICTED`, :const:`!READ_RESTRICTED` and :const:`!" +"The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " -"deprecated. :const:`!READ_RESTRICTED` and :const:`!RESTRICTED` are " -"equivalent to :const:`Py_AUDIT_READ`; :const:`!WRITE_RESTRICTED` does " +"deprecated. :c:macro:`!READ_RESTRICTED` and :c:macro:`!RESTRICTED` are " +"equivalent to :c:macro:`Py_AUDIT_READ`; :c:macro:`!WRITE_RESTRICTED` does " "nothing." msgstr "" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:541 msgid "" -"The :const:`!READONLY` macro was renamed to :const:`Py_READONLY`. The :const:" -"`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new names " -"are now always available. Previously, these required ``#include " +"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" +"macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " +"names are now always available. Previously, these required ``#include " "\"structmember.h\"``. The header is still available and it provides the old " "names." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:550 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:534 +#: ../../c-api/structures.rst:552 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -550,147 +580,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:542 +#: ../../c-api/structures.rst:560 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:546 +#: ../../c-api/structures.rst:564 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:546 +#: ../../c-api/structures.rst:564 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:546 +#: ../../c-api/structures.rst:564 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:548 +#: ../../c-api/structures.rst:566 msgid ":c:expr:`char`" msgstr "" -#: ../../c-api/structures.rst:548 ../../c-api/structures.rst:549 -#: ../../c-api/structures.rst:550 ../../c-api/structures.rst:551 -#: ../../c-api/structures.rst:552 ../../c-api/structures.rst:553 -#: ../../c-api/structures.rst:554 ../../c-api/structures.rst:555 -#: ../../c-api/structures.rst:556 ../../c-api/structures.rst:557 -#: ../../c-api/structures.rst:558 +#: ../../c-api/structures.rst:566 ../../c-api/structures.rst:567 +#: ../../c-api/structures.rst:568 ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:570 ../../c-api/structures.rst:571 +#: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:576 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:549 +#: ../../c-api/structures.rst:567 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:550 +#: ../../c-api/structures.rst:568 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:551 +#: ../../c-api/structures.rst:569 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:552 +#: ../../c-api/structures.rst:570 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:553 +#: ../../c-api/structures.rst:571 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:554 +#: ../../c-api/structures.rst:572 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:555 +#: ../../c-api/structures.rst:573 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:556 +#: ../../c-api/structures.rst:574 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:557 +#: ../../c-api/structures.rst:575 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:558 +#: ../../c-api/structures.rst:576 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:559 +#: ../../c-api/structures.rst:577 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:559 ../../c-api/structures.rst:560 +#: ../../c-api/structures.rst:577 ../../c-api/structures.rst:578 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:560 +#: ../../c-api/structures.rst:578 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:561 +#: ../../c-api/structures.rst:579 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:561 +#: ../../c-api/structures.rst:579 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:563 +#: ../../c-api/structures.rst:581 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:563 ../../c-api/structures.rst:564 +#: ../../c-api/structures.rst:581 ../../c-api/structures.rst:582 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:564 +#: ../../c-api/structures.rst:582 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:565 +#: ../../c-api/structures.rst:583 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:565 +#: ../../c-api/structures.rst:583 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:584 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:584 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:587 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:592 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:594 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:596 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:604 +#: ../../c-api/structures.rst:622 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -698,174 +728,174 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:612 +#: ../../c-api/structures.rst:630 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:618 +#: ../../c-api/structures.rst:636 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:621 +#: ../../c-api/structures.rst:639 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:625 +#: ../../c-api/structures.rst:643 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:630 +#: ../../c-api/structures.rst:648 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:634 +#: ../../c-api/structures.rst:652 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:638 +#: ../../c-api/structures.rst:656 msgid "" "Optional C function to set or delete the attribute, if omitted the attribute " "is readonly." msgstr "" -#: ../../c-api/structures.rst:642 +#: ../../c-api/structures.rst:660 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:646 +#: ../../c-api/structures.rst:664 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:648 +#: ../../c-api/structures.rst:666 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:653 +#: ../../c-api/structures.rst:671 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:656 +#: ../../c-api/structures.rst:674 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:661 +#: ../../c-api/structures.rst:679 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" -#: ../../c-api/structures.rst:350 ../../c-api/structures.rst:360 +#: ../../c-api/structures.rst:368 ../../c-api/structures.rst:378 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/structures.rst:350 +#: ../../c-api/structures.rst:368 msgid "classmethod" msgstr "classmethod" -#: ../../c-api/structures.rst:360 +#: ../../c-api/structures.rst:378 msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:523 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:523 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:523 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:536 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:599 msgid "structmember.h" msgstr "structmember.h" diff --git a/c-api/sys.po b/c-api/sys.po index 3ae4ed08ad..32c959133e 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -118,16 +118,16 @@ msgstr "" #: ../../c-api/sys.rst:99 msgid "" "Return true when the interpreter runs out of stack space. This is a " -"reliable check, but is only available when :const:`USE_STACKCHECK` is " +"reliable check, but is only available when :c:macro:`USE_STACKCHECK` is " "defined (currently on certain versions of Windows using the Microsoft Visual " -"C++ compiler). :const:`USE_STACKCHECK` will be defined automatically; you " +"C++ compiler). :c:macro:`USE_STACKCHECK` will be defined automatically; you " "should never change the definition in your own code." msgstr "" #: ../../c-api/sys.rst:108 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " -"around either :c:func:`sigaction` or :c:func:`signal`. Do not call those " +"around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " "functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:" "expr:`void (\\*)(int)`." msgstr "" @@ -135,8 +135,8 @@ msgstr "" #: ../../c-api/sys.rst:116 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " -"handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:" -"`signal`. Do not call those functions directly! :c:type:" +"handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" +"func:`!signal`. Do not call those functions directly! :c:type:" "`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" diff --git a/c-api/type.po b/c-api/type.po index 4a53443559..0c874d569d 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -149,7 +149,7 @@ msgstr "" #: ../../c-api/type.rst:134 msgid "" "Return true if the type object includes support for the cycle detector; this " -"tests the type flag :const:`Py_TPFLAGS_HAVE_GC`." +"tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" #: ../../c-api/type.rst:140 @@ -188,11 +188,12 @@ msgstr "" #: ../../c-api/type.rst:167 msgid "" "If some of the base classes implements the GC protocol and the provided type " -"does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " +"does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " "protocol will be automatically implemented from its parents. On the " -"contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` " -"in its flags then it **must** implement the GC protocol itself by at least " -"implementing the :c:member:`~PyTypeObject.tp_traverse` handle." +"contrary, if the type being created does include :c:macro:" +"`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol " +"itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` " +"handle." msgstr "" #: ../../c-api/type.rst:177 @@ -245,8 +246,8 @@ msgid "" "not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " "intended class, and subclasses are not necessarily defined in the same " "module as their superclass. See :c:type:`PyCMethod` to get the class that " -"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when " -"``PyCMethod`` cannot be used." +"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:" +"type:`!PyCMethod` cannot be used." msgstr "" #: ../../c-api/type.rst:225 @@ -304,8 +305,8 @@ msgstr "" #: ../../c-api/type.rst:270 msgid "" -"Create and return a :ref:`heap type ` from the *spec* (see :" -"const:`Py_TPFLAGS_HEAPTYPE`)." +"Create and return a :ref:`heap type ` from the *spec* (see :c:" +"macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" #: ../../c-api/type.rst:273 @@ -477,7 +478,7 @@ msgid "" msgstr "" #: ../../c-api/type.rst:423 -msgid "With the :const:`Py_TPFLAGS_ITEMS_AT_END` flag." +msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." msgstr "" #: ../../c-api/type.rst:427 @@ -562,13 +563,13 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" #: ../../c-api/type.rst:473 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (use :const:" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` instead)" msgstr "" #: ../../c-api/type.rst:475 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (use :const:" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_DICT` instead)" msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 62ca193f90..3afafa2283 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -1192,28 +1192,28 @@ msgstr "" #: ../../c-api/typeobj.rst:916 ../../c-api/typeobj.rst:936 #: ../../c-api/typeobj.rst:957 ../../c-api/typeobj.rst:983 #: ../../c-api/typeobj.rst:1002 ../../c-api/typeobj.rst:1018 -#: ../../c-api/typeobj.rst:1054 ../../c-api/typeobj.rst:1065 -#: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1085 -#: ../../c-api/typeobj.rst:1099 ../../c-api/typeobj.rst:1117 -#: ../../c-api/typeobj.rst:1140 ../../c-api/typeobj.rst:1155 -#: ../../c-api/typeobj.rst:1168 ../../c-api/typeobj.rst:1190 -#: ../../c-api/typeobj.rst:1234 ../../c-api/typeobj.rst:1255 -#: ../../c-api/typeobj.rst:1274 ../../c-api/typeobj.rst:1304 -#: ../../c-api/typeobj.rst:1326 ../../c-api/typeobj.rst:1352 -#: ../../c-api/typeobj.rst:1420 ../../c-api/typeobj.rst:1487 -#: ../../c-api/typeobj.rst:1546 ../../c-api/typeobj.rst:1582 -#: ../../c-api/typeobj.rst:1607 ../../c-api/typeobj.rst:1630 -#: ../../c-api/typeobj.rst:1643 ../../c-api/typeobj.rst:1658 -#: ../../c-api/typeobj.rst:1672 ../../c-api/typeobj.rst:1702 -#: ../../c-api/typeobj.rst:1734 ../../c-api/typeobj.rst:1760 -#: ../../c-api/typeobj.rst:1778 ../../c-api/typeobj.rst:1807 -#: ../../c-api/typeobj.rst:1851 ../../c-api/typeobj.rst:1868 -#: ../../c-api/typeobj.rst:1909 ../../c-api/typeobj.rst:1931 -#: ../../c-api/typeobj.rst:1963 ../../c-api/typeobj.rst:1991 -#: ../../c-api/typeobj.rst:2004 ../../c-api/typeobj.rst:2014 -#: ../../c-api/typeobj.rst:2031 ../../c-api/typeobj.rst:2048 -#: ../../c-api/typeobj.rst:2062 ../../c-api/typeobj.rst:2108 -#: ../../c-api/typeobj.rst:2131 +#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1067 +#: ../../c-api/typeobj.rst:1077 ../../c-api/typeobj.rst:1087 +#: ../../c-api/typeobj.rst:1101 ../../c-api/typeobj.rst:1119 +#: ../../c-api/typeobj.rst:1142 ../../c-api/typeobj.rst:1157 +#: ../../c-api/typeobj.rst:1170 ../../c-api/typeobj.rst:1192 +#: ../../c-api/typeobj.rst:1236 ../../c-api/typeobj.rst:1257 +#: ../../c-api/typeobj.rst:1276 ../../c-api/typeobj.rst:1306 +#: ../../c-api/typeobj.rst:1328 ../../c-api/typeobj.rst:1354 +#: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1489 +#: ../../c-api/typeobj.rst:1548 ../../c-api/typeobj.rst:1584 +#: ../../c-api/typeobj.rst:1609 ../../c-api/typeobj.rst:1632 +#: ../../c-api/typeobj.rst:1645 ../../c-api/typeobj.rst:1660 +#: ../../c-api/typeobj.rst:1674 ../../c-api/typeobj.rst:1704 +#: ../../c-api/typeobj.rst:1736 ../../c-api/typeobj.rst:1762 +#: ../../c-api/typeobj.rst:1780 ../../c-api/typeobj.rst:1809 +#: ../../c-api/typeobj.rst:1853 ../../c-api/typeobj.rst:1870 +#: ../../c-api/typeobj.rst:1911 ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1965 ../../c-api/typeobj.rst:1993 +#: ../../c-api/typeobj.rst:2006 ../../c-api/typeobj.rst:2016 +#: ../../c-api/typeobj.rst:2033 ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2064 ../../c-api/typeobj.rst:2110 +#: ../../c-api/typeobj.rst:2133 msgid "**Inheritance:**" msgstr "" @@ -1244,10 +1244,10 @@ msgstr "" #: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:709 #: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:918 -#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1609 -#: ../../c-api/typeobj.rst:1632 ../../c-api/typeobj.rst:1762 -#: ../../c-api/typeobj.rst:1780 ../../c-api/typeobj.rst:1853 -#: ../../c-api/typeobj.rst:1965 ../../c-api/typeobj.rst:2110 +#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1634 ../../c-api/typeobj.rst:1764 +#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1855 +#: ../../c-api/typeobj.rst:1967 ../../c-api/typeobj.rst:2112 msgid "This field is inherited by subtypes." msgstr "" @@ -1426,25 +1426,25 @@ msgid "" "all memory buffers owned by the instance (using the freeing function " "corresponding to the allocation function used to allocate the buffer), and " "call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is " -"not subtypable (doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), " -"it is permissible to call the object deallocator directly instead of via :c:" -"member:`~PyTypeObject.tp_free`. The object deallocator should be the one " -"used to allocate the instance; this is normally :c:func:`PyObject_Del` if " -"the instance was allocated using :c:func:`PyObject_New` or :c:func:" +"not subtypable (doesn't have the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit " +"set), it is permissible to call the object deallocator directly instead of " +"via :c:member:`~PyTypeObject.tp_free`. The object deallocator should be the " +"one used to allocate the instance; this is normally :c:func:`PyObject_Del` " +"if the instance was allocated using :c:func:`PyObject_New` or :c:func:" "`PyObject_VarNew`, or :c:func:`PyObject_GC_Del` if the instance was " "allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/typeobj.rst:680 msgid "" -"If the type supports garbage collection (has the :const:`Py_TPFLAGS_HAVE_GC` " -"flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack` " -"before clearing any member fields." +"If the type supports garbage collection (has the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should call :c:func:" +"`PyObject_GC_UnTrack` before clearing any member fields." msgstr "" #: ../../c-api/typeobj.rst:692 msgid "" -"Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " +"Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should decrement the reference count for its type object after " "calling the type deallocator. In order to avoid dangling pointers, the " "recommended way to achieve this is:" @@ -1459,7 +1459,7 @@ msgstr "" #: ../../c-api/typeobj.rst:719 msgid "" -"This field is only used if the flag :const:`Py_TPFLAGS_HAVE_VECTORCALL` is " +"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" @@ -1467,7 +1467,7 @@ msgstr "" #: ../../c-api/typeobj.rst:723 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " -"behaves as if :const:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " +"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" @@ -1491,13 +1491,13 @@ msgid "" "` to implement the vectorcall protocol. When a user sets :attr:" "`~type.__call__` in Python code, only *tp_call* is updated, likely making it " "inconsistent with the vectorcall function. Since 3.12, setting ``__call__`` " -"will disable vectorcall optimization by clearing the :const:" +"will disable vectorcall optimization by clearing the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" #: ../../c-api/typeobj.rst:750 msgid "" -"This field is always inherited. However, the :const:" +"This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " "then the subclass won't use :ref:`vectorcall `, except when :c:" "func:`PyVectorcall_Call` is explicitly called." @@ -1592,12 +1592,12 @@ msgstr "" #: ../../c-api/typeobj.rst:828 ../../c-api/typeobj.rst:940 #: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:991 -#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1555 -#: ../../c-api/typeobj.rst:1589 ../../c-api/typeobj.rst:1706 -#: ../../c-api/typeobj.rst:1739 ../../c-api/typeobj.rst:1814 -#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1873 -#: ../../c-api/typeobj.rst:1915 ../../c-api/typeobj.rst:1936 -#: ../../c-api/typeobj.rst:1967 +#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1557 +#: ../../c-api/typeobj.rst:1591 ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1741 ../../c-api/typeobj.rst:1816 +#: ../../c-api/typeobj.rst:1857 ../../c-api/typeobj.rst:1875 +#: ../../c-api/typeobj.rst:1917 ../../c-api/typeobj.rst:1938 +#: ../../c-api/typeobj.rst:1969 msgid "**Default:**" msgstr "**預設:**" @@ -1682,7 +1682,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1548 +#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1550 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" @@ -1814,9 +1814,9 @@ msgid "" "this flag bit. The flag bits that pertain to extension structures are " "strictly inherited if the extension structure is inherited, i.e. the base " "type's value of the flag bit is copied into the subtype together with a " -"pointer to the extension structure. The :const:`Py_TPFLAGS_HAVE_GC` flag " +"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag " "bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` " -"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :const:" +"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:" "`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in " "the subtype exist and have ``NULL`` values. .. XXX are most flag bits " @@ -1833,7 +1833,7 @@ msgstr "" msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1039 +#: ../../c-api/typeobj.rst:1041 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1842,7 +1842,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1046 +#: ../../c-api/typeobj.rst:1048 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1853,32 +1853,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1067 -#: ../../c-api/typeobj.rst:1077 ../../c-api/typeobj.rst:1087 -#: ../../c-api/typeobj.rst:1119 +#: ../../c-api/typeobj.rst:1058 ../../c-api/typeobj.rst:1069 +#: ../../c-api/typeobj.rst:1079 ../../c-api/typeobj.rst:1089 +#: ../../c-api/typeobj.rst:1121 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1061 +#: ../../c-api/typeobj.rst:1063 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1072 +#: ../../c-api/typeobj.rst:1074 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1082 +#: ../../c-api/typeobj.rst:1084 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1092 +#: ../../c-api/typeobj.rst:1094 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " @@ -1888,114 +1888,114 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1101 ../../c-api/typeobj.rst:1422 -#: ../../c-api/typeobj.rst:1489 +#: ../../c-api/typeobj.rst:1103 ../../c-api/typeobj.rst:1424 +#: ../../c-api/typeobj.rst:1491 msgid "" -"Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" +"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1103 +#: ../../c-api/typeobj.rst:1105 msgid "" -"The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" -"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" +"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" +"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :attr:" "`tp_traverse` and :attr:`tp_clear` fields in the subtype exist and have " "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1113 +#: ../../c-api/typeobj.rst:1115 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " -"includes the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." +"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1124 +#: ../../c-api/typeobj.rst:1126 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1126 +#: ../../c-api/typeobj.rst:1128 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1130 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1131 +#: ../../c-api/typeobj.rst:1133 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1134 +#: ../../c-api/typeobj.rst:1136 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1142 +#: ../../c-api/typeobj.rst:1144 msgid "" -"This flag is never inherited by types without the :const:" +"This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1148 +#: ../../c-api/typeobj.rst:1150 msgid "" "This bit indicates that instances of the class have a ``__dict__`` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" -#: ../../c-api/typeobj.rst:1151 -msgid "If this flag is set, :const:`Py_TPFLAGS_HAVE_GC` should also be set." +#: ../../c-api/typeobj.rst:1153 +msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" -#: ../../c-api/typeobj.rst:1157 +#: ../../c-api/typeobj.rst:1159 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1163 +#: ../../c-api/typeobj.rst:1165 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: ../../c-api/typeobj.rst:1170 +#: ../../c-api/typeobj.rst:1172 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1176 +#: ../../c-api/typeobj.rst:1178 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyObject.tp_itemsize`." msgstr "" -#: ../../c-api/typeobj.rst:1179 +#: ../../c-api/typeobj.rst:1181 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of :c:expr:`Py_TYPE(obj)-" ">tp_basicsize` (which may be different in each subclass)." msgstr "" -#: ../../c-api/typeobj.rst:1184 +#: ../../c-api/typeobj.rst:1186 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: ../../c-api/typeobj.rst:1192 +#: ../../c-api/typeobj.rst:1194 msgid "This flag is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1206 +#: ../../c-api/typeobj.rst:1208 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2005,90 +2005,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1217 +#: ../../c-api/typeobj.rst:1219 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1222 +#: ../../c-api/typeobj.rst:1224 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1230 +#: ../../c-api/typeobj.rst:1232 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1236 +#: ../../c-api/typeobj.rst:1238 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1243 +#: ../../c-api/typeobj.rst:1245 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: ../../c-api/typeobj.rst:1246 +#: ../../c-api/typeobj.rst:1248 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1250 +#: ../../c-api/typeobj.rst:1252 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1254 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1257 +#: ../../c-api/typeobj.rst:1259 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1263 +#: ../../c-api/typeobj.rst:1265 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1267 +#: ../../c-api/typeobj.rst:1269 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1270 +#: ../../c-api/typeobj.rst:1272 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1276 +#: ../../c-api/typeobj.rst:1278 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1283 +#: ../../c-api/typeobj.rst:1285 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1294 +#: ../../c-api/typeobj.rst:1296 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2096,23 +2096,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1301 ../../c-api/typeobj.rst:1323 +#: ../../c-api/typeobj.rst:1303 ../../c-api/typeobj.rst:1325 msgid "" -":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " -"exclusive; it is an error to enable both flags simultaneously." +":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " +"mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1306 +#: ../../c-api/typeobj.rst:1308 msgid "" -"This flag is inherited by types that do not already set :const:" +"This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1309 ../../c-api/typeobj.rst:1331 +#: ../../c-api/typeobj.rst:1311 ../../c-api/typeobj.rst:1333 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1316 +#: ../../c-api/typeobj.rst:1318 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2120,49 +2120,49 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1328 +#: ../../c-api/typeobj.rst:1330 msgid "" -"This flag is inherited by types that do not already set :const:" +"This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1338 +#: ../../c-api/typeobj.rst:1340 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: ../../c-api/typeobj.rst:1342 +#: ../../c-api/typeobj.rst:1344 msgid "" "This flag is present in header files, but is an internal feature and should " "not be used. It will be removed in a future version of CPython" msgstr "" -#: ../../c-api/typeobj.rst:1348 +#: ../../c-api/typeobj.rst:1350 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1354 +#: ../../c-api/typeobj.rst:1356 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1359 +#: ../../c-api/typeobj.rst:1361 msgid "" "An optional pointer to a traversal function for the garbage collector. This " -"is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1364 ../../c-api/typeobj.rst:1484 +#: ../../c-api/typeobj.rst:1366 ../../c-api/typeobj.rst:1486 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1367 +#: ../../c-api/typeobj.rst:1369 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2172,7 +2172,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1382 +#: ../../c-api/typeobj.rst:1384 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2180,14 +2180,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1386 +#: ../../c-api/typeobj.rst:1388 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1391 +#: ../../c-api/typeobj.rst:1393 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2216,29 +2216,29 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1415 +#: ../../c-api/typeobj.rst:1417 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1424 +#: ../../c-api/typeobj.rst:1426 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" +"tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" "member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1432 +#: ../../c-api/typeobj.rst:1434 msgid "" "An optional pointer to a clear function for the garbage collector. This is " -"only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " -"is::" +"only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1437 +#: ../../c-api/typeobj.rst:1439 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2253,7 +2253,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1447 +#: ../../c-api/typeobj.rst:1449 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2261,7 +2261,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1461 +#: ../../c-api/typeobj.rst:1463 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be decremented " @@ -2276,7 +2276,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1472 +#: ../../c-api/typeobj.rst:1474 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2284,7 +2284,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1478 +#: ../../c-api/typeobj.rst:1480 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2294,26 +2294,26 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1493 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" -"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " +"tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" +"c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1499 +#: ../../c-api/typeobj.rst:1501 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1503 +#: ../../c-api/typeobj.rst:1505 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1506 +#: ../../c-api/typeobj.rst:1508 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2321,74 +2321,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1511 +#: ../../c-api/typeobj.rst:1513 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1515 +#: ../../c-api/typeobj.rst:1517 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1515 +#: ../../c-api/typeobj.rst:1517 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1517 -msgid ":const:`Py_LT`" -msgstr ":const:`Py_LT`" +#: ../../c-api/typeobj.rst:1519 +msgid ":c:macro:`Py_LT`" +msgstr ":c:macro:`Py_LT`" -#: ../../c-api/typeobj.rst:1517 +#: ../../c-api/typeobj.rst:1519 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1519 -msgid ":const:`Py_LE`" -msgstr ":const:`Py_LE`" +#: ../../c-api/typeobj.rst:1521 +msgid ":c:macro:`Py_LE`" +msgstr ":c:macro:`Py_LE`" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1521 -msgid ":const:`Py_EQ`" -msgstr ":const:`Py_EQ`" +#: ../../c-api/typeobj.rst:1523 +msgid ":c:macro:`Py_EQ`" +msgstr ":c:macro:`Py_EQ`" -#: ../../c-api/typeobj.rst:1521 +#: ../../c-api/typeobj.rst:1523 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1523 -msgid ":const:`Py_NE`" -msgstr ":const:`Py_NE`" +#: ../../c-api/typeobj.rst:1525 +msgid ":c:macro:`Py_NE`" +msgstr ":c:macro:`Py_NE`" -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1525 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1525 -msgid ":const:`Py_GT`" -msgstr ":const:`Py_GT`" +#: ../../c-api/typeobj.rst:1527 +msgid ":c:macro:`Py_GT`" +msgstr ":c:macro:`Py_GT`" -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1527 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1527 -msgid ":const:`Py_GE`" -msgstr ":const:`Py_GE`" +#: ../../c-api/typeobj.rst:1529 +msgid ":c:macro:`Py_GE`" +msgstr ":c:macro:`Py_GE`" -#: ../../c-api/typeobj.rst:1527 +#: ../../c-api/typeobj.rst:1529 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1530 +#: ../../c-api/typeobj.rst:1532 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1534 +#: ../../c-api/typeobj.rst:1536 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2396,15 +2396,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1542 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1542 +#: ../../c-api/typeobj.rst:1544 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1550 +#: ../../c-api/typeobj.rst:1552 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2412,7 +2412,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1557 +#: ../../c-api/typeobj.rst:1559 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2420,13 +2420,13 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1566 +#: ../../c-api/typeobj.rst:1568 msgid "" -"While this field is still supported, :const:`Py_TPFLAGS_MANAGED_WEAKREF` " +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1569 +#: ../../c-api/typeobj.rst:1571 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2436,19 +2436,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1576 +#: ../../c-api/typeobj.rst:1578 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1579 +#: ../../c-api/typeobj.rst:1581 msgid "" -"It is an error to set both the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit and :" -"c:member:`~PyTypeObject.tp_weaklist`." +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " +"and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/typeobj.rst:1584 +#: ../../c-api/typeobj.rst:1586 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2457,32 +2457,32 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1591 +#: ../../c-api/typeobj.rst:1593 msgid "" -"If the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" +"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." "tp_weaklistoffset` will be set to a negative value, to indicate that it is " "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1599 +#: ../../c-api/typeobj.rst:1601 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1605 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1614 +#: ../../c-api/typeobj.rst:1616 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1619 +#: ../../c-api/typeobj.rst:1621 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2490,74 +2490,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1624 +#: ../../c-api/typeobj.rst:1626 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1628 +#: ../../c-api/typeobj.rst:1630 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1637 +#: ../../c-api/typeobj.rst:1639 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1640 +#: ../../c-api/typeobj.rst:1642 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1645 +#: ../../c-api/typeobj.rst:1647 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1651 +#: ../../c-api/typeobj.rst:1653 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1655 +#: ../../c-api/typeobj.rst:1657 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1660 +#: ../../c-api/typeobj.rst:1662 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1668 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1669 +#: ../../c-api/typeobj.rst:1671 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1674 +#: ../../c-api/typeobj.rst:1676 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1680 +#: ../../c-api/typeobj.rst:1682 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2565,7 +2565,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1688 +#: ../../c-api/typeobj.rst:1690 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2573,7 +2573,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1693 +#: ../../c-api/typeobj.rst:1695 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2581,27 +2581,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1699 +#: ../../c-api/typeobj.rst:1701 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1704 +#: ../../c-api/typeobj.rst:1706 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1710 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1714 +#: ../../c-api/typeobj.rst:1716 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1716 +#: ../../c-api/typeobj.rst:1718 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2612,64 +2612,64 @@ msgid "" "read-only." msgstr "" -#: ../../c-api/typeobj.rst:1724 +#: ../../c-api/typeobj.rst:1726 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retreive the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1732 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1736 +#: ../../c-api/typeobj.rst:1738 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1741 +#: ../../c-api/typeobj.rst:1743 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1746 +#: ../../c-api/typeobj.rst:1748 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1752 +#: ../../c-api/typeobj.rst:1754 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1754 ../../c-api/typeobj.rst:1770 -#: ../../c-api/typeobj.rst:1834 ../../c-api/typeobj.rst:1864 -#: ../../c-api/typeobj.rst:1888 +#: ../../c-api/typeobj.rst:1756 ../../c-api/typeobj.rst:1772 +#: ../../c-api/typeobj.rst:1836 ../../c-api/typeobj.rst:1866 +#: ../../c-api/typeobj.rst:1890 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1767 +#: ../../c-api/typeobj.rst:1769 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1774 +#: ../../c-api/typeobj.rst:1776 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1785 +#: ../../c-api/typeobj.rst:1787 msgid "" -"While this field is still supported, :const:`Py_TPFLAGS_MANAGED_DICT` should " -"be used instead, if at all possible." +"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1788 +#: ../../c-api/typeobj.rst:1790 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2677,19 +2677,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1795 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1796 +#: ../../c-api/typeobj.rst:1798 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1800 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2698,38 +2698,38 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1804 +#: ../../c-api/typeobj.rst:1806 msgid "" -"It is an error to set both the :const:`Py_TPFLAGS_MANAGED_WEAKREF` bit and :" -"c:member:`~PyTypeObject.tp_dictoffset`." +"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " +"and :c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1809 +#: ../../c-api/typeobj.rst:1811 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " -"at the previous offset. To properly support inheritance, use :const:" +"at the previous offset. To properly support inheritance, use :c:macro:" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1816 +#: ../../c-api/typeobj.rst:1818 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1819 +#: ../../c-api/typeobj.rst:1821 msgid "" -"If the :const:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1827 +#: ../../c-api/typeobj.rst:1829 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1829 +#: ../../c-api/typeobj.rst:1831 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2737,14 +2737,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1838 +#: ../../c-api/typeobj.rst:1840 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1844 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2756,43 +2756,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1849 +#: ../../c-api/typeobj.rst:1851 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1857 +#: ../../c-api/typeobj.rst:1859 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1862 +#: ../../c-api/typeobj.rst:1864 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1870 +#: ../../c-api/typeobj.rst:1872 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1875 +#: ../../c-api/typeobj.rst:1877 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1881 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1886 +#: ../../c-api/typeobj.rst:1888 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1892 +#: ../../c-api/typeobj.rst:1894 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2801,7 +2801,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1898 +#: ../../c-api/typeobj.rst:1900 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2813,20 +2813,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1906 +#: ../../c-api/typeobj.rst:1908 msgid "" -"Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " -"instances of the type in Python." +"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " +"creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1911 +#: ../../c-api/typeobj.rst:1913 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1917 +#: ../../c-api/typeobj.rst:1919 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2834,43 +2834,43 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1925 +#: ../../c-api/typeobj.rst:1927 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1931 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1935 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1938 +#: ../../c-api/typeobj.rst:1940 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" -"func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " -"flag bit." +"func:`PyType_GenericAlloc` and the value of the :c:macro:" +"`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1944 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1947 +#: ../../c-api/typeobj.rst:1949 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1949 +#: ../../c-api/typeobj.rst:1951 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " -"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :const:" +"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically " "and dynamically allocated instances, and the statically allocated instances " "are not collectible. Such types should define this function; it should " @@ -2878,89 +2878,89 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1959 +#: ../../c-api/typeobj.rst:1961 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1969 +#: ../../c-api/typeobj.rst:1971 msgid "" -"This slot has no default. If this field is ``NULL``, :const:" +"This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1975 +#: ../../c-api/typeobj.rst:1977 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1977 ../../c-api/typeobj.rst:2001 +#: ../../c-api/typeobj.rst:1979 ../../c-api/typeobj.rst:2003 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1980 +#: ../../c-api/typeobj.rst:1982 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1987 +#: ../../c-api/typeobj.rst:1989 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1993 ../../c-api/typeobj.rst:2016 -#: ../../c-api/typeobj.rst:2033 ../../c-api/typeobj.rst:2050 -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:1995 ../../c-api/typeobj.rst:2018 +#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:2066 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1998 +#: ../../c-api/typeobj.rst:2000 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:2006 +#: ../../c-api/typeobj.rst:2008 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2012 +#: ../../c-api/typeobj.rst:2014 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2021 +#: ../../c-api/typeobj.rst:2023 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2023 +#: ../../c-api/typeobj.rst:2025 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2028 +#: ../../c-api/typeobj.rst:2030 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2038 +#: ../../c-api/typeobj.rst:2040 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2043 +#: ../../c-api/typeobj.rst:2045 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -2968,21 +2968,21 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2055 +#: ../../c-api/typeobj.rst:2057 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:2060 +#: ../../c-api/typeobj.rst:2062 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2069 +#: ../../c-api/typeobj.rst:2071 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2073 +#: ../../c-api/typeobj.rst:2075 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2992,14 +2992,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2080 +#: ../../c-api/typeobj.rst:2082 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2097 +#: ../../c-api/typeobj.rst:2099 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -3012,18 +3012,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2116 +#: ../../c-api/typeobj.rst:2118 msgid "" -"Before version 3.8 it was necessary to set the :const:" +"Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2120 +#: ../../c-api/typeobj.rst:2122 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2125 +#: ../../c-api/typeobj.rst:2127 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -3031,95 +3031,95 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2133 +#: ../../c-api/typeobj.rst:2135 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2135 +#: ../../c-api/typeobj.rst:2137 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2140 +#: ../../c-api/typeobj.rst:2142 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2148 +#: ../../c-api/typeobj.rst:2150 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2150 +#: ../../c-api/typeobj.rst:2152 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2154 +#: ../../c-api/typeobj.rst:2156 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2156 +#: ../../c-api/typeobj.rst:2158 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2158 +#: ../../c-api/typeobj.rst:2160 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2160 +#: ../../c-api/typeobj.rst:2162 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2164 +#: ../../c-api/typeobj.rst:2166 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2172 +#: ../../c-api/typeobj.rst:2174 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2174 +#: ../../c-api/typeobj.rst:2176 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " -"created by Python's ``class`` statement. Heap types have the :const:" +"created by Python's ``class`` statement. Heap types have the :c:macro:" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2179 +#: ../../c-api/typeobj.rst:2181 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2187 +#: ../../c-api/typeobj.rst:2189 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2194 +#: ../../c-api/typeobj.rst:2196 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2200 ../../c-api/typeobj.rst:2524 +#: ../../c-api/typeobj.rst:2202 ../../c-api/typeobj.rst:2526 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2247 +#: ../../c-api/typeobj.rst:2249 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3129,30 +3129,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2256 +#: ../../c-api/typeobj.rst:2258 msgid "" -"The :c:data:`nb_reserved` field should always be ``NULL``. It was " -"previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." +"The :c:member:`~PyNumberMethods.nb_reserved` field should always be " +"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " +"Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2301 +#: ../../c-api/typeobj.rst:2303 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2308 +#: ../../c-api/typeobj.rst:2310 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2313 +#: ../../c-api/typeobj.rst:2315 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2319 +#: ../../c-api/typeobj.rst:2321 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3160,7 +3161,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2327 +#: ../../c-api/typeobj.rst:2329 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3170,17 +3171,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2338 +#: ../../c-api/typeobj.rst:2340 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2345 +#: ../../c-api/typeobj.rst:2347 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2350 +#: ../../c-api/typeobj.rst:2352 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3188,21 +3189,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2357 +#: ../../c-api/typeobj.rst:2359 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2363 +#: ../../c-api/typeobj.rst:2365 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2369 +#: ../../c-api/typeobj.rst:2371 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3211,7 +3212,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2375 +#: ../../c-api/typeobj.rst:2377 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -3219,7 +3220,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2382 +#: ../../c-api/typeobj.rst:2384 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3228,14 +3229,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2391 +#: ../../c-api/typeobj.rst:2393 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2398 +#: ../../c-api/typeobj.rst:2400 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3245,7 +3246,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2407 +#: ../../c-api/typeobj.rst:2409 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3255,72 +3256,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2418 +#: ../../c-api/typeobj.rst:2420 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2426 +#: ../../c-api/typeobj.rst:2428 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2432 ../../c-api/typeobj.rst:2481 -#: ../../c-api/typeobj.rst:2535 ../../c-api/typeobj.rst:2546 -#: ../../c-api/typeobj.rst:2558 ../../c-api/typeobj.rst:2567 +#: ../../c-api/typeobj.rst:2434 ../../c-api/typeobj.rst:2483 +#: ../../c-api/typeobj.rst:2537 ../../c-api/typeobj.rst:2548 +#: ../../c-api/typeobj.rst:2560 ../../c-api/typeobj.rst:2569 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2436 +#: ../../c-api/typeobj.rst:2438 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2440 +#: ../../c-api/typeobj.rst:2442 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2443 +#: ../../c-api/typeobj.rst:2445 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2445 +#: ../../c-api/typeobj.rst:2447 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2447 +#: ../../c-api/typeobj.rst:2449 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2451 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2451 +#: ../../c-api/typeobj.rst:2453 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2454 +#: ../../c-api/typeobj.rst:2456 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2457 +#: ../../c-api/typeobj.rst:2459 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2461 +#: ../../c-api/typeobj.rst:2463 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3328,7 +3329,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2466 +#: ../../c-api/typeobj.rst:2468 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3337,19 +3338,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2473 +#: ../../c-api/typeobj.rst:2475 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2476 +#: ../../c-api/typeobj.rst:2478 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2485 +#: ../../c-api/typeobj.rst:2487 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3357,15 +3358,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2490 +#: ../../c-api/typeobj.rst:2492 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2492 +#: ../../c-api/typeobj.rst:2494 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2496 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3373,68 +3374,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2500 +#: ../../c-api/typeobj.rst:2502 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2505 +#: ../../c-api/typeobj.rst:2507 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2513 +#: ../../c-api/typeobj.rst:2515 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2521 +#: ../../c-api/typeobj.rst:2523 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2539 +#: ../../c-api/typeobj.rst:2541 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2542 +#: ../../c-api/typeobj.rst:2544 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2550 +#: ../../c-api/typeobj.rst:2552 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2553 +#: ../../c-api/typeobj.rst:2555 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2562 +#: ../../c-api/typeobj.rst:2564 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2571 +#: ../../c-api/typeobj.rst:2573 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2580 +#: ../../c-api/typeobj.rst:2582 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2584 +#: ../../c-api/typeobj.rst:2586 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3448,80 +3449,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2594 +#: ../../c-api/typeobj.rst:2596 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2601 +#: ../../c-api/typeobj.rst:2603 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2605 +#: ../../c-api/typeobj.rst:2607 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2609 +#: ../../c-api/typeobj.rst:2611 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2613 +#: ../../c-api/typeobj.rst:2615 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2617 ../../c-api/typeobj.rst:2626 +#: ../../c-api/typeobj.rst:2619 ../../c-api/typeobj.rst:2628 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2621 ../../c-api/typeobj.rst:2632 +#: ../../c-api/typeobj.rst:2623 ../../c-api/typeobj.rst:2634 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2628 +#: ../../c-api/typeobj.rst:2630 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2635 +#: ../../c-api/typeobj.rst:2637 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2639 +#: ../../c-api/typeobj.rst:2641 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2643 +#: ../../c-api/typeobj.rst:2645 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2647 +#: ../../c-api/typeobj.rst:2649 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2651 +#: ../../c-api/typeobj.rst:2653 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2655 +#: ../../c-api/typeobj.rst:2657 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2659 +#: ../../c-api/typeobj.rst:2661 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2673 +#: ../../c-api/typeobj.rst:2675 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2689 +#: ../../c-api/typeobj.rst:2691 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2691 +#: ../../c-api/typeobj.rst:2693 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3529,33 +3530,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2696 +#: ../../c-api/typeobj.rst:2698 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2713 +#: ../../c-api/typeobj.rst:2715 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2757 +#: ../../c-api/typeobj.rst:2759 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2782 +#: ../../c-api/typeobj.rst:2784 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " -"instances (e.g. uses a separate factory func) using :c:data:" +"instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2801 +#: ../../c-api/typeobj.rst:2803 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2812 +#: ../../c-api/typeobj.rst:2814 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/c-api/unicode.po b/c-api/unicode.po index 2f70e80c16..ad1c353b75 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -22,7 +22,7 @@ msgstr "" #: ../../c-api/unicode.rst:6 msgid "Unicode Objects and Codecs" -msgstr "Unicode物件與編碼" +msgstr "Unicode 物件與編解碼器" #: ../../c-api/unicode.rst:12 msgid "Unicode Objects" @@ -68,7 +68,7 @@ msgstr "" #: ../../c-api/unicode.rst:47 msgid "" -"This is a typedef of :c:expr:`wchar_t`, which is a 16-bit type or 32-bit " +"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform." msgstr "" @@ -458,7 +458,7 @@ msgstr "" #: ../../c-api/unicode.rst:428 msgid "``0``" -msgstr "" +msgstr "``0``" #: ../../c-api/unicode.rst:428 msgid "The conversion will be zero padded for numeric values." @@ -466,7 +466,7 @@ msgstr "" #: ../../c-api/unicode.rst:430 msgid "``-``" -msgstr "" +msgstr "``-``" #: ../../c-api/unicode.rst:430 msgid "" @@ -491,43 +491,43 @@ msgstr "" #: ../../c-api/unicode.rst:443 msgid "``l``" -msgstr "" +msgstr "``l``" #: ../../c-api/unicode.rst:443 msgid ":c:expr:`long` or :c:expr:`unsigned long`" -msgstr "" +msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`" #: ../../c-api/unicode.rst:445 msgid "``ll``" -msgstr "" +msgstr "``ll``" #: ../../c-api/unicode.rst:445 msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`" #: ../../c-api/unicode.rst:447 msgid "``j``" -msgstr "" +msgstr "``j``" #: ../../c-api/unicode.rst:447 -msgid ":c:expr:`intmax_t` or :c:expr:`uintmax_t`" -msgstr "" +msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" +msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`" #: ../../c-api/unicode.rst:449 msgid "``z``" -msgstr "" +msgstr "``z``" #: ../../c-api/unicode.rst:449 -msgid ":c:expr:`size_t` or :c:expr:`ssize_t`" -msgstr "" +msgid ":c:type:`size_t` or :c:type:`ssize_t`" +msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`" #: ../../c-api/unicode.rst:451 msgid "``t``" -msgstr "" +msgstr "``t``" #: ../../c-api/unicode.rst:451 -msgid ":c:expr:`ptrdiff_t`" -msgstr "" +msgid ":c:type:`ptrdiff_t`" +msgstr ":c:type:`ptrdiff_t`" #: ../../c-api/unicode.rst:454 msgid "" @@ -553,7 +553,7 @@ msgstr "" #: ../../c-api/unicode.rst:467 msgid "``%``" -msgstr "" +msgstr "``%``" #: ../../c-api/unicode.rst:468 msgid "*n/a*" @@ -565,7 +565,7 @@ msgstr "" #: ../../c-api/unicode.rst:471 msgid "``d``, ``i``" -msgstr "" +msgstr "``d``, ``i``" #: ../../c-api/unicode.rst:472 ../../c-api/unicode.rst:476 #: ../../c-api/unicode.rst:480 ../../c-api/unicode.rst:484 @@ -579,7 +579,7 @@ msgstr "" #: ../../c-api/unicode.rst:475 msgid "``u``" -msgstr "" +msgstr "``u``" #: ../../c-api/unicode.rst:477 msgid "The decimal representation of an unsigned C integer." @@ -587,7 +587,7 @@ msgstr "" #: ../../c-api/unicode.rst:479 msgid "``o``" -msgstr "" +msgstr "``o``" #: ../../c-api/unicode.rst:481 msgid "The octal representation of an unsigned C integer." @@ -595,7 +595,7 @@ msgstr "" #: ../../c-api/unicode.rst:483 msgid "``x``" -msgstr "" +msgstr "``x``" #: ../../c-api/unicode.rst:485 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." @@ -603,7 +603,7 @@ msgstr "" #: ../../c-api/unicode.rst:487 msgid "``X``" -msgstr "" +msgstr "``X``" #: ../../c-api/unicode.rst:489 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." @@ -611,11 +611,11 @@ msgstr "" #: ../../c-api/unicode.rst:491 msgid "``c``" -msgstr "" +msgstr "``c``" #: ../../c-api/unicode.rst:492 msgid ":c:expr:`int`" -msgstr "" +msgstr ":c:expr:`int`" #: ../../c-api/unicode.rst:493 msgid "A single character." @@ -623,7 +623,7 @@ msgstr "" #: ../../c-api/unicode.rst:495 msgid "``s``" -msgstr "" +msgstr "``s``" #: ../../c-api/unicode.rst:496 msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" @@ -703,7 +703,7 @@ msgstr "" #: ../../c-api/unicode.rst:529 msgid "" "The width formatter unit is number of characters rather than bytes. The " -"precision formatter unit is number of bytes or :c:expr:`wchar_t` items (if " +"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " "the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " "``PyObject*`` argument is ``NULL``), and a number of characters for " "``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the " @@ -1029,21 +1029,21 @@ msgid "wchar_t Support" msgstr "" #: ../../c-api/unicode.rst:849 -msgid ":c:expr:`wchar_t` support for platforms which support it:" +msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" #: ../../c-api/unicode.rst:853 msgid "" -"Create a Unicode object from the :c:expr:`wchar_t` buffer *w* of the given " +"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " "*size*. Passing ``-1`` as the *size* indicates that the function must itself " "compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" #: ../../c-api/unicode.rst:861 msgid "" -"Copy the Unicode object contents into the :c:expr:`wchar_t` buffer *w*. At " -"most *size* :c:expr:`wchar_t` characters are copied (excluding a possibly " -"trailing null termination character). Return the number of :c:expr:" +"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " +"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " +"trailing null termination character). Return the number of :c:type:" "`wchar_t` characters copied or ``-1`` in case of an error. Note that the " "resulting :c:expr:`wchar_t*` string may or may not be null-terminated. It " "is the responsibility of the caller to make sure that the :c:expr:`wchar_t*` " @@ -1057,7 +1057,7 @@ msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " "number of wide characters (excluding the trailing null termination " -"character) into *\\*size*. Note that the resulting :c:expr:`wchar_t` string " +"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " "when used with most C functions. If *size* is ``NULL`` and the :c:expr:" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." @@ -1142,7 +1142,7 @@ msgstr "" #: ../../c-api/unicode.rst:946 msgid "UTF-8 Codecs" -msgstr "" +msgstr "UTF-8 編解碼器" #: ../../c-api/unicode.rst:948 msgid "These are the UTF-8 codec APIs:" @@ -1207,7 +1207,7 @@ msgstr "" #: ../../c-api/unicode.rst:1009 msgid "UTF-32 Codecs" -msgstr "" +msgstr "UTF-32 編解碼器" #: ../../c-api/unicode.rst:1011 msgid "These are the UTF-32 codec APIs:" @@ -1266,7 +1266,7 @@ msgstr "" #: ../../c-api/unicode.rst:1059 msgid "UTF-16 Codecs" -msgstr "" +msgstr "UTF-16 編解碼器" #: ../../c-api/unicode.rst:1061 msgid "These are the UTF-16 codec APIs:" @@ -1313,7 +1313,7 @@ msgstr "" #: ../../c-api/unicode.rst:1110 msgid "UTF-7 Codecs" -msgstr "" +msgstr "UTF-7 編解碼器" #: ../../c-api/unicode.rst:1112 msgid "These are the UTF-7 codec APIs:" @@ -1377,7 +1377,7 @@ msgstr "" #: ../../c-api/unicode.rst:1171 msgid "Latin-1 Codecs" -msgstr "" +msgstr "Latin-1 編解碼器" #: ../../c-api/unicode.rst:1173 msgid "" @@ -1400,7 +1400,7 @@ msgstr "" #: ../../c-api/unicode.rst:1191 msgid "ASCII Codecs" -msgstr "" +msgstr "ASCII 編解碼器" #: ../../c-api/unicode.rst:1193 msgid "" @@ -1538,7 +1538,7 @@ msgstr "" 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." +"c:macro:`CP_ACP` code page to get the MBCS encoder." msgstr "" #: ../../c-api/unicode.rst:1308 @@ -1661,17 +1661,17 @@ msgid "``NULL`` in case an exception was raised" msgstr "" #: ../../c-api/unicode.rst:1421 -msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" +msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" #: ../../c-api/unicode.rst:1422 -msgid ":const:`Py_NotImplemented` in case the type combination is unknown" +msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" #: ../../c-api/unicode.rst:1424 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`." +"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" +"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" #: ../../c-api/unicode.rst:1430 diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index c8d6b710f8..a2b365a7f3 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -32,15 +32,15 @@ msgstr "" #: ../../c-api/veryhigh.rst:14 msgid "" "Several of these functions accept a start symbol from the grammar as a " -"parameter. The available start symbols are :const:`Py_eval_input`, :const:" -"`Py_file_input`, and :const:`Py_single_input`. These are described " +"parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:" +"`Py_file_input`, and :c:data:`Py_single_input`. These are described " "following the functions which accept them as parameters." msgstr "" #: ../../c-api/veryhigh.rst:19 msgid "" "Note also that several of these functions take :c:expr:`FILE*` parameters. " -"One particular issue which needs to be handled carefully is that the :c:expr:" +"One particular issue which needs to be handled carefully is that the :c:type:" "`FILE` structure for different C libraries can be different and " "incompatible. Under Windows (at least), it is possible for dynamically " "linked extensions to actually use different libraries, so care should be " @@ -293,8 +293,8 @@ msgstr "" msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " -"constrain the code which can be compiled and should be :const:" -"`Py_eval_input`, :const:`Py_file_input`, or :const:`Py_single_input`. The " +"constrain the code which can be compiled and should be :c:data:" +"`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " "filename specified by *filename* is used to construct the code object and " "may appear in tracebacks or :exc:`SyntaxError` exception messages. This " "returns ``NULL`` if the code cannot be parsed or compiled." diff --git a/extending/extending.po b/extending/extending.po index 72c4cc5d2d..cd754900a3 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -296,11 +296,11 @@ msgstr "" #: ../../extending/extending.rst:238 msgid "" -"Note also that the :c:data:`SpamError` variable retains a reference to the " +"Note also that the :c:data:`!SpamError` variable retains a reference to the " "newly created exception class; this is intentional! Since the exception " "could be removed from the module by external code, an owned reference to the " -"class is needed to ensure that it will not be discarded, causing :c:data:" -"`SpamError` to become a dangling pointer. Should it become a dangling " +"class is needed to ensure that it will not be discarded, causing :c:data:`!" +"SpamError` to become a dangling pointer. Should it become a dangling " "pointer, C code which raises the exception could cause a core dump or other " "unintended side effects." msgstr "" @@ -332,9 +332,9 @@ msgid "" "It returns ``NULL`` (the error indicator for functions returning object " "pointers) if an error is detected in the argument list, relying on the " "exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of " -"the argument has been copied to the local variable :c:data:`command`. This " +"the argument has been copied to the local variable :c:data:`!command`. This " "is a pointer assignment and you are not supposed to modify the string to " -"which it points (so in Standard C, the variable :c:data:`command` should " +"which it points (so in Standard C, the variable :c:data:`!command` should " "properly be declared as ``const char *command``)." msgstr "" @@ -346,8 +346,9 @@ msgstr "" #: ../../extending/extending.rst:292 msgid "" -"Our :func:`spam.system` function must return the value of :c:data:`sts` as a " -"Python object. This is done using the function :c:func:`PyLong_FromLong`. ::" +"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " +"a Python object. This is done using the function :c:func:" +"`PyLong_FromLong`. ::" msgstr "" #: ../../extending/extending.rst:297 @@ -399,7 +400,7 @@ msgstr "" #: ../../extending/extending.rst:338 msgid "" -"The :const:`METH_KEYWORDS` bit may be set in the third field if keyword " +"The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " "arguments should be passed to the function. In this case, the C function " "should accept a third ``PyObject *`` parameter which will be a dictionary of " "keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " @@ -547,7 +548,7 @@ msgstr "" #: ../../extending/extending.rst:529 msgid "" -"This function must be registered with the interpreter using the :const:" +"This function must be registered with the interpreter using the :c:macro:" "`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" "c:func:`PyArg_ParseTuple` function and its arguments are documented in " "section :ref:`parsetuple`." diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index e1b0bc549d..b1cbf67407 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -184,7 +184,7 @@ msgid "" msgstr "" #: ../../extending/newtypes_tutorial.rst:154 -msgid "We set the class flags to :const:`Py_TPFLAGS_DEFAULT`. ::" +msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:158 @@ -516,8 +516,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:501 msgid "" -"(note that we used the :const:`METH_NOARGS` flag to indicate that the method " -"is expecting no arguments other than *self*)" +"(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " +"method is expecting no arguments other than *self*)" msgstr "" #: ../../extending/newtypes_tutorial.rst:504 @@ -529,7 +529,7 @@ msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " "about the type of the object being created or used, so all we need to do is " -"to add the :const:`Py_TPFLAGS_BASETYPE` to our class flag definition::" +"to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" #: ../../extending/newtypes_tutorial.rst:515 @@ -726,7 +726,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:777 msgid "" -"Finally, we add the :const:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" +"Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" #: ../../extending/newtypes_tutorial.rst:781 diff --git a/howto/argparse.po b/howto/argparse.po index d426fb254d..4cb051ef70 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-01-31 17:33+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -570,10 +570,65 @@ msgid "" msgstr "" #: ../../howto/argparse.rst:792 +msgid "How to translate the argparse output" +msgstr "" + +#: ../../howto/argparse.rst:794 +msgid "" +"The output of the :mod:`argparse` module such as its help text and error " +"messages are all made translatable using the :mod:`gettext` module. This " +"allows applications to easily localize messages produced by :mod:`argparse`. " +"See also :ref:`i18n-howto`." +msgstr "" + +#: ../../howto/argparse.rst:799 +msgid "For instance, in this :mod:`argparse` output:" +msgstr "" + +#: ../../howto/argparse.rst:817 +msgid "" +"The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " +"this help message and exit`` are all translatable." +msgstr "" + +#: ../../howto/argparse.rst:820 +msgid "" +"In order to translate these strings, they must first be extracted into a ``." +"po`` file. For example, using `Babel `__, run this " +"command:" +msgstr "" + +#: ../../howto/argparse.rst:828 +msgid "" +"This command will extract all translatable strings from the :mod:`argparse` " +"module and output them into a file named ``messages.po``. This command " +"assumes that your Python installation is in ``/usr/lib``." +msgstr "" + +#: ../../howto/argparse.rst:832 +msgid "" +"You can find out the location of the :mod:`argparse` module on your system " +"using this script::" +msgstr "" + +#: ../../howto/argparse.rst:838 +msgid "" +"Once the messages in the ``.po`` file are translated and the translations " +"are installed using :mod:`gettext`, :mod:`argparse` will be able to display " +"the translated messages." +msgstr "" + +#: ../../howto/argparse.rst:842 +msgid "" +"To translate your own strings in the :mod:`argparse` output, use :mod:" +"`gettext`." +msgstr "" + +#: ../../howto/argparse.rst:845 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:794 +#: ../../howto/argparse.rst:847 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/clinic.po b/howto/clinic.po index c7bf25756a..bd5548c581 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-18 19:04+0000\n" +"POT-Creation-Date: 2023-07-21 09:32+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-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/clinic.rst:-1 +#: ../../howto/clinic.rst:7 msgid "Abstract" msgstr "摘要" @@ -38,27 +38,46 @@ msgstr "摘要" msgid "" "Argument Clinic is a preprocessor for CPython C files. Its purpose is to " "automate all the boilerplate involved with writing argument parsing code for " -"\"builtins\". This document shows you how to convert your first C function " -"to work with Argument Clinic, and then introduces some advanced topics on " -"Argument Clinic usage." +"\"builtins\", module level functions, and class methods. This document is " +"divided in three major sections:" +msgstr "" + +#: ../../howto/clinic.rst:20 +msgid "" +":ref:`clinic-background` talks about the basic concepts and goals of " +"Argument Clinic." +msgstr "" + +#: ../../howto/clinic.rst:22 +msgid "" +":ref:`clinic-tutorial` guides you through all the steps required to adapt an " +"existing C function to Argument Clinic." +msgstr "" + +#: ../../howto/clinic.rst:24 +msgid ":ref:`clinic-howtos` details how to handle specific tasks." msgstr "" -#: ../../howto/clinic.rst:21 +#: ../../howto/clinic.rst:29 msgid "" -"Currently Argument Clinic is considered internal-only for CPython. Its use " -"is not supported for files outside CPython, and no guarantees are made " -"regarding backwards compatibility for future versions. In other words: if " -"you maintain an external C extension for CPython, you're welcome to " -"experiment with Argument Clinic in your own code. But the version of " -"Argument Clinic that ships with the next version of CPython *could* be " -"totally incompatible and break all your code." +"Argument Clinic is considered internal-only for CPython. Its use is not " +"supported for files outside CPython, and no guarantees are made regarding " +"backwards compatibility for future versions. In other words: if you " +"maintain an external C extension for CPython, you're welcome to experiment " +"with Argument Clinic in your own code. But the version of Argument Clinic " +"that ships with the next version of CPython *could* be totally incompatible " +"and break all your code." msgstr "" -#: ../../howto/clinic.rst:32 +#: ../../howto/clinic.rst:42 +msgid "Background" +msgstr "" + +#: ../../howto/clinic.rst:46 msgid "The goals of Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:34 +#: ../../howto/clinic.rst:48 msgid "" "Argument Clinic's primary goal is to take over responsibility for all " "argument parsing code inside CPython. This means that, when you convert a " @@ -69,7 +88,7 @@ msgid "" "*kwargs``) magically converted into the C variables and types you need." msgstr "" -#: ../../howto/clinic.rst:44 +#: ../../howto/clinic.rst:58 msgid "" "In order for Argument Clinic to accomplish its primary goal, it must be easy " "to use. Currently, working with CPython's argument parsing library is a " @@ -77,7 +96,7 @@ msgid "" "places. When you use Argument Clinic, you don't have to repeat yourself." msgstr "" -#: ../../howto/clinic.rst:50 +#: ../../howto/clinic.rst:64 msgid "" "Obviously, no one would want to use Argument Clinic unless it's solving " "their problem—and without creating new problems of its own. So it's " @@ -89,14 +108,14 @@ msgid "" "parsing library. That would make for the fastest argument parsing possible!)" msgstr "" -#: ../../howto/clinic.rst:62 +#: ../../howto/clinic.rst:76 msgid "" "Additionally, Argument Clinic must be flexible enough to work with any " "approach to argument parsing. Python has some functions with some very " "strange parsing behaviors; Argument Clinic's goal is to support all of them." msgstr "" -#: ../../howto/clinic.rst:67 +#: ../../howto/clinic.rst:81 msgid "" "Finally, the original motivation for Argument Clinic was to provide " "introspection \"signatures\" for CPython builtins. It used to be, the " @@ -104,7 +123,7 @@ msgid "" "builtin. With Argument Clinic, that's a thing of the past!" msgstr "" -#: ../../howto/clinic.rst:73 +#: ../../howto/clinic.rst:87 msgid "" "One idea you should keep in mind, as you work with Argument Clinic: the more " "information you give it, the better job it'll be able to do. Argument Clinic " @@ -113,36 +132,36 @@ msgid "" "things with all the information you give it." msgstr "" -#: ../../howto/clinic.rst:83 +#: ../../howto/clinic.rst:97 msgid "Basic concepts and usage" msgstr "" -#: ../../howto/clinic.rst:85 +#: ../../howto/clinic.rst:99 msgid "" "Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." "py``. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:92 +#: ../../howto/clinic.rst:106 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:99 +#: ../../howto/clinic.rst:113 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:106 +#: ../../howto/clinic.rst:120 msgid "" "Everything in between these two lines is input for Argument Clinic. All of " "these lines, including the beginning and ending comment lines, are " "collectively called an Argument Clinic \"block\"." msgstr "" -#: ../../howto/clinic.rst:110 +#: ../../howto/clinic.rst:124 msgid "" "When Argument Clinic parses one of these blocks, it generates output. This " "output is rewritten into the C file immediately after the block, followed by " @@ -150,7 +169,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:123 +#: ../../howto/clinic.rst:137 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old output and write out the new output with a fresh " @@ -158,7 +177,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:127 +#: ../../howto/clinic.rst:141 msgid "" "You should never modify the output portion of an Argument Clinic block. " "Instead, change the input until it produces the output you want. (That's " @@ -167,38 +186,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:132 +#: ../../howto/clinic.rst:146 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:134 +#: ../../howto/clinic.rst:148 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:135 +#: ../../howto/clinic.rst:149 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:136 +#: ../../howto/clinic.rst:150 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:151 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:152 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:139 +#: ../../howto/clinic.rst:153 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -206,11 +225,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:146 -msgid "Converting your first function" +#: ../../howto/clinic.rst:162 +msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:148 +#: ../../howto/clinic.rst:164 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -221,30 +240,30 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:157 +#: ../../howto/clinic.rst:173 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:159 +#: ../../howto/clinic.rst:175 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:162 +#: ../../howto/clinic.rst:178 msgid "" "Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " "Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." msgstr "" -#: ../../howto/clinic.rst:167 +#: ../../howto/clinic.rst:183 msgid "" "If the call to the ``PyArg_Parse`` function uses any of the following format " "units:" msgstr "" -#: ../../howto/clinic.rst:179 +#: ../../howto/clinic.rst:195 msgid "" "or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " "a different function. Argument Clinic *does* support all of these " @@ -252,7 +271,7 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:184 +#: ../../howto/clinic.rst:200 msgid "" "Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " @@ -262,11 +281,11 @@ msgid "" "polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:191 +#: ../../howto/clinic.rst:207 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:196 +#: ../../howto/clinic.rst:212 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -274,7 +293,7 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:202 +#: ../../howto/clinic.rst:218 msgid "" "If the old docstring had a first line that looked like a function signature, " "throw that line away. (The docstring doesn't need it anymore—when you use " @@ -282,14 +301,14 @@ msgid "" "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:208 ../../howto/clinic.rst:229 -#: ../../howto/clinic.rst:253 ../../howto/clinic.rst:311 -#: ../../howto/clinic.rst:351 ../../howto/clinic.rst:378 -#: ../../howto/clinic.rst:484 ../../howto/clinic.rst:536 +#: ../../howto/clinic.rst:224 ../../howto/clinic.rst:245 +#: ../../howto/clinic.rst:269 ../../howto/clinic.rst:327 +#: ../../howto/clinic.rst:367 ../../howto/clinic.rst:394 +#: ../../howto/clinic.rst:500 ../../howto/clinic.rst:552 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:214 +#: ../../howto/clinic.rst:230 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain. So let's make sure it has one. The \"summary\" line should be a " @@ -297,13 +316,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:219 +#: ../../howto/clinic.rst:235 msgid "" "(Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step.)" msgstr "" -#: ../../howto/clinic.rst:222 +#: ../../howto/clinic.rst:238 msgid "" "Above the docstring, enter the name of the function, followed by a blank " "line. This should be the Python name of the function, and should be the " @@ -312,7 +331,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:237 +#: ../../howto/clinic.rst:253 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -322,47 +341,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:245 +#: ../../howto/clinic.rst:261 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:249 +#: ../../howto/clinic.rst:265 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " "class, and a pointer to the :c:type:`PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:269 +#: ../../howto/clinic.rst:285 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " "name and the docstring." msgstr "" -#: ../../howto/clinic.rst:273 +#: ../../howto/clinic.rst:289 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:279 +#: ../../howto/clinic.rst:295 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:286 +#: ../../howto/clinic.rst:302 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "please see :ref:`the section below on default values ` for " "more information." msgstr "" -#: ../../howto/clinic.rst:290 +#: ../../howto/clinic.rst:306 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:292 +#: ../../howto/clinic.rst:308 msgid "" "What's a \"converter\"? It establishes both the type of the variable used " "in C, and the method to convert the Python value into a C value at runtime. " @@ -371,7 +390,7 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:299 +#: ../../howto/clinic.rst:315 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the " "``PyArg_Parse()`` format argument and specify *that* as its converter, as a " @@ -381,58 +400,58 @@ msgid "" "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:308 +#: ../../howto/clinic.rst:324 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:326 +#: ../../howto/clinic.rst:342 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:331 +#: ../../howto/clinic.rst:347 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:336 +#: ../../howto/clinic.rst:352 msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:339 +#: ../../howto/clinic.rst:355 msgid "" "If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" "c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" "only." msgstr "" -#: ../../howto/clinic.rst:343 +#: ../../howto/clinic.rst:359 msgid "" "To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " "a line by itself after the last parameter, indented the same as the " "parameter lines." msgstr "" -#: ../../howto/clinic.rst:347 +#: ../../howto/clinic.rst:363 msgid "" "Currently this is all-or-nothing; either all parameters are positional-only, " "or none of them are. (In the future Argument Clinic may relax this " "restriction.)" msgstr "" -#: ../../howto/clinic.rst:367 +#: ../../howto/clinic.rst:383 msgid "" "It's helpful to write a per-parameter docstring for each parameter. But per-" "parameter docstrings are optional; you can skip this step if you prefer." msgstr "" -#: ../../howto/clinic.rst:371 +#: ../../howto/clinic.rst:387 msgid "" "Here's how to add a per-parameter docstring. The first line of the per-" "parameter docstring must be indented further than the parameter definition. " @@ -442,34 +461,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:395 +#: ../../howto/clinic.rst:411 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a ``.c.h`` file has " "been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:414 +#: ../../howto/clinic.rst:430 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:418 +#: ../../howto/clinic.rst:434 msgid "" "For readability, most of the glue code has been generated to a ``.c.h`` " "file. You'll need to include that in your original ``.c`` file, typically " "right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:424 +#: ../../howto/clinic.rst:440 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:427 +#: ../../howto/clinic.rst:443 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -477,21 +496,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:433 +#: ../../howto/clinic.rst:449 msgid "" "Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" "`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:438 +#: ../../howto/clinic.rst:454 msgid "" "(Argument Clinic always generates its format strings with a ``:`` followed " "by the name of the function. If the existing code's format string ends with " "``;``, to provide usage help, this change is harmless—don't worry about it.)" msgstr "" -#: ../../howto/clinic.rst:443 +#: ../../howto/clinic.rst:459 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -499,27 +518,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:448 +#: ../../howto/clinic.rst:464 msgid "" "Fourth, inside the output portion of the block you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:455 +#: ../../howto/clinic.rst:471 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:458 +#: ../../howto/clinic.rst:474 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:463 +#: ../../howto/clinic.rst:479 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -530,20 +549,20 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:471 +#: ../../howto/clinic.rst:487 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:480 +#: ../../howto/clinic.rst:496 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening (and closing) curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:525 +#: ../../howto/clinic.rst:541 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " "function? Find the existing :c:type:`PyMethodDef` structure for this " @@ -553,85 +572,51 @@ msgid "" "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:532 +#: ../../howto/clinic.rst:548 msgid "" "Note that the body of the macro contains a trailing comma. So when you " "replace the existing static :c:type:`PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:545 +#: ../../howto/clinic.rst:561 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:549 +#: ../../howto/clinic.rst:565 msgid "" "If it does, you'll have to run ``Tools/scripts/generate_global_objects.py`` " "to regenerate the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:553 +#: ../../howto/clinic.rst:569 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:557 +#: ../../howto/clinic.rst:573 msgid "" "Well, except for one difference: ``inspect.signature()`` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:560 +#: ../../howto/clinic.rst:576 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:564 +#: ../../howto/clinic.rst:582 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:568 -msgid "How to use symbolic default values" -msgstr "" - -#: ../../howto/clinic.rst:570 -msgid "" -"The default value you provide for a parameter can't be any arbitrary " -"expression. Currently the following are explicitly supported:" -msgstr "" - -#: ../../howto/clinic.rst:573 -msgid "Numeric constants (integer and float)" -msgstr "" - -#: ../../howto/clinic.rst:574 -msgid "String constants" -msgstr "" - -#: ../../howto/clinic.rst:575 -msgid "``True``, ``False``, and ``None``" -msgstr "" - -#: ../../howto/clinic.rst:576 -msgid "" -"Simple symbolic constants like ``sys.maxsize``, which must start with the " -"name of the module" -msgstr "" - -#: ../../howto/clinic.rst:579 -msgid "" -"(In the future, this may need to get even more elaborate, to allow full " -"expressions like ``CONSTANT - 1``.)" -msgstr "" - -#: ../../howto/clinic.rst:584 +#: ../../howto/clinic.rst:586 msgid "How to to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:586 +#: ../../howto/clinic.rst:588 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -643,19 +628,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:594 +#: ../../howto/clinic.rst:596 msgid "" "For example, if we wanted to rename the C function names generated for " "``pickle.Pickler.dump``, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:602 +#: ../../howto/clinic.rst:604 msgid "" "The base function would now be named ``pickler_dumper()``, and the impl " "function would now be named ``pickler_dumper_impl()``." msgstr "" -#: ../../howto/clinic.rst:606 +#: ../../howto/clinic.rst:608 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -663,21 +648,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:620 +#: ../../howto/clinic.rst:622 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be ``file``, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:623 +#: ../../howto/clinic.rst:625 msgid "You can use this to rename the ``self`` parameter too!" msgstr "" -#: ../../howto/clinic.rst:627 +#: ../../howto/clinic.rst:629 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:629 +#: ../../howto/clinic.rst:631 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -686,17 +671,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:635 +#: ../../howto/clinic.rst:637 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:640 +#: ../../howto/clinic.rst:642 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:642 +#: ../../howto/clinic.rst:644 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -707,7 +692,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:649 +#: ../../howto/clinic.rst:651 msgid "" "While functions using this approach can often be converted to use :c:func:" "`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -721,7 +706,7 @@ msgid "" "pass in ``x`` you may not pass in ``y`` either.)" msgstr "" -#: ../../howto/clinic.rst:661 +#: ../../howto/clinic.rst:663 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -731,7 +716,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:669 +#: ../../howto/clinic.rst:671 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -742,7 +727,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:678 +#: ../../howto/clinic.rst:680 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -751,11 +736,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:707 +#: ../../howto/clinic.rst:709 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:709 +#: ../../howto/clinic.rst:711 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -768,34 +753,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:720 +#: ../../howto/clinic.rst:722 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:723 +#: ../../howto/clinic.rst:725 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:726 +#: ../../howto/clinic.rst:728 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:728 +#: ../../howto/clinic.rst:730 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:733 +#: ../../howto/clinic.rst:735 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:735 +#: ../../howto/clinic.rst:737 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -804,38 +789,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:742 +#: ../../howto/clinic.rst:744 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:746 +#: ../../howto/clinic.rst:748 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:747 +#: ../../howto/clinic.rst:749 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:750 +#: ../../howto/clinic.rst:752 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:754 +#: ../../howto/clinic.rst:756 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:757 +#: ../../howto/clinic.rst:759 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -843,17 +828,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:763 +#: ../../howto/clinic.rst:765 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:771 ../../howto/clinic.rst:1335 +#: ../../howto/clinic.rst:773 ../../howto/clinic.rst:1353 msgid "``c_default``" msgstr "``c_default``" -#: ../../howto/clinic.rst:767 +#: ../../howto/clinic.rst:769 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -861,36 +846,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:776 +#: ../../howto/clinic.rst:778 msgid "``annotation``" msgstr "``annotation``" -#: ../../howto/clinic.rst:774 +#: ../../howto/clinic.rst:776 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:781 msgid "``unused``" msgstr "``unused``" -#: ../../howto/clinic.rst:779 +#: ../../howto/clinic.rst:781 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:781 +#: ../../howto/clinic.rst:783 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:790 +#: ../../howto/clinic.rst:792 msgid "``accept``" msgstr "``accept``" -#: ../../howto/clinic.rst:785 +#: ../../howto/clinic.rst:787 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -898,68 +883,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:790 +#: ../../howto/clinic.rst:792 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:795 +#: ../../howto/clinic.rst:797 msgid "``bitwise``" msgstr "``bitwise``" -#: ../../howto/clinic.rst:793 +#: ../../howto/clinic.rst:795 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:800 ../../howto/clinic.rst:1349 +#: ../../howto/clinic.rst:802 ../../howto/clinic.rst:1367 msgid "``converter``" msgstr "``converter``" -#: ../../howto/clinic.rst:798 +#: ../../howto/clinic.rst:800 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:805 +#: ../../howto/clinic.rst:807 msgid "``encoding``" msgstr "``encoding``" -#: ../../howto/clinic.rst:803 +#: ../../howto/clinic.rst:805 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:809 +#: ../../howto/clinic.rst:811 msgid "``subclass_of``" msgstr "``subclass_of``" -#: ../../howto/clinic.rst:808 +#: ../../howto/clinic.rst:810 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:814 ../../howto/clinic.rst:1321 +#: ../../howto/clinic.rst:816 ../../howto/clinic.rst:1339 msgid "``type``" msgstr "``type``" -#: ../../howto/clinic.rst:812 +#: ../../howto/clinic.rst:814 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:820 +#: ../../howto/clinic.rst:822 msgid "``zeroes``" msgstr "``zeroes``" -#: ../../howto/clinic.rst:817 +#: ../../howto/clinic.rst:819 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -967,7 +952,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:822 +#: ../../howto/clinic.rst:824 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific ``PyArg_ParseTuple`` *format " @@ -978,350 +963,350 @@ msgid "" "least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:830 +#: ../../howto/clinic.rst:832 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:837 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:835 +#: ../../howto/clinic.rst:837 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:838 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:838 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:878 +#: ../../howto/clinic.rst:880 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:891 +#: ../../howto/clinic.rst:893 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1330,7 +1315,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:897 +#: ../../howto/clinic.rst:899 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1338,11 +1323,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:904 +#: ../../howto/clinic.rst:906 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:906 +#: ../../howto/clinic.rst:908 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1350,17 +1335,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:913 +#: ../../howto/clinic.rst:915 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:917 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:920 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1371,7 +1356,7 @@ msgid "" "units that start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:926 +#: ../../howto/clinic.rst:928 msgid "" "When using ``subclass_of``, you may also want to use the other custom " "argument for ``object()``: ``type``, which lets you set the type actually " @@ -1380,7 +1365,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:932 +#: ../../howto/clinic.rst:934 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a " @@ -1393,31 +1378,31 @@ msgid "" "strings for parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:947 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:949 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:956 +#: ../../howto/clinic.rst:958 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:964 +#: ../../howto/clinic.rst:966 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:969 -msgid "How to use the ``NULL`` default value" +#: ../../howto/clinic.rst:971 +msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:971 +#: ../../howto/clinic.rst:973 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1427,11 +1412,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:980 -msgid "How to use expressions as default values" +#: ../../howto/clinic.rst:982 +msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:982 +#: ../../howto/clinic.rst:984 +msgid "" +"The default value you provide for a parameter can't be any arbitrary " +"expression. Currently the following are explicitly supported:" +msgstr "" + +#: ../../howto/clinic.rst:987 +msgid "Numeric constants (integer and float)" +msgstr "" + +#: ../../howto/clinic.rst:988 +msgid "String constants" +msgstr "" + +#: ../../howto/clinic.rst:989 +msgid "``True``, ``False``, and ``None``" +msgstr "" + +#: ../../howto/clinic.rst:990 +msgid "" +"Simple symbolic constants like ``sys.maxsize``, which must start with the " +"name of the module" +msgstr "" + +#: ../../howto/clinic.rst:993 +msgid "" +"(In the future, this may need to get even more elaborate, to allow full " +"expressions like ``CONSTANT - 1``.)" +msgstr "" + +#: ../../howto/clinic.rst:998 +msgid "Expressions as default values" +msgstr "" + +#: ../../howto/clinic.rst:1000 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1439,11 +1458,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:987 +#: ../../howto/clinic.rst:1005 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:993 +#: ../../howto/clinic.rst:1011 msgid "" "``sys.maxsize`` can have different values on different platforms. Therefore " "Argument Clinic can't simply evaluate that expression locally and hard-code " @@ -1451,14 +1470,14 @@ msgid "" "at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:998 +#: ../../howto/clinic.rst:1016 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " "module has an attribute called \"``max_widgets``\", you may simply use it:" msgstr "" -#: ../../howto/clinic.rst:1006 +#: ../../howto/clinic.rst:1024 msgid "" "If the symbol isn't found in the current module, it fails over to looking in " "``sys.modules``. That's how it can find ``sys.maxsize`` for example. " @@ -1467,7 +1486,7 @@ msgid "" "Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1011 +#: ../../howto/clinic.rst:1029 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1475,7 +1494,7 @@ msgid "" "expression in C, using the ``c_default`` parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1020 +#: ../../howto/clinic.rst:1038 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1483,38 +1502,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1025 +#: ../../howto/clinic.rst:1043 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1029 +#: ../../howto/clinic.rst:1047 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1030 +#: ../../howto/clinic.rst:1048 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1031 +#: ../../howto/clinic.rst:1049 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1032 +#: ../../howto/clinic.rst:1050 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1033 +#: ../../howto/clinic.rst:1051 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1037 +#: ../../howto/clinic.rst:1055 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1039 +#: ../../howto/clinic.rst:1057 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1524,38 +1543,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1047 +#: ../../howto/clinic.rst:1065 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1069 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1055 +#: ../../howto/clinic.rst:1073 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1068 +#: ../../howto/clinic.rst:1086 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1072 +#: ../../howto/clinic.rst:1090 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1075 +#: ../../howto/clinic.rst:1093 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1568,127 +1587,127 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1084 +#: ../../howto/clinic.rst:1102 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1098 +#: ../../howto/clinic.rst:1116 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1101 +#: ../../howto/clinic.rst:1119 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1107 +#: ../../howto/clinic.rst:1125 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1127 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1113 +#: ../../howto/clinic.rst:1131 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1115 +#: ../../howto/clinic.rst:1133 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1117 +#: ../../howto/clinic.rst:1135 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1119 +#: ../../howto/clinic.rst:1137 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1121 +#: ../../howto/clinic.rst:1139 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1123 +#: ../../howto/clinic.rst:1141 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1126 +#: ../../howto/clinic.rst:1144 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1128 +#: ../../howto/clinic.rst:1146 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1149 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1157 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1143 +#: ../../howto/clinic.rst:1161 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1164 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1169 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1153 +#: ../../howto/clinic.rst:1171 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1175 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1164 +#: ../../howto/clinic.rst:1182 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1168 +#: ../../howto/clinic.rst:1186 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1179 +#: ../../howto/clinic.rst:1197 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1181 +#: ../../howto/clinic.rst:1199 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1699,13 +1718,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1190 +#: ../../howto/clinic.rst:1208 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1193 +#: ../../howto/clinic.rst:1211 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1713,18 +1732,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1209 +#: ../../howto/clinic.rst:1227 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1231 +#: ../../howto/clinic.rst:1249 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1233 +#: ../../howto/clinic.rst:1251 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1734,25 +1753,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1239 +#: ../../howto/clinic.rst:1257 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1269 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1261 +#: ../../howto/clinic.rst:1279 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1267 +#: ../../howto/clinic.rst:1285 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1760,13 +1779,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1272 +#: ../../howto/clinic.rst:1290 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1275 +#: ../../howto/clinic.rst:1293 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1775,15 +1794,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1290 +#: ../../howto/clinic.rst:1308 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1294 +#: ../../howto/clinic.rst:1312 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1296 +#: ../../howto/clinic.rst:1314 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1792,7 +1811,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1302 +#: ../../howto/clinic.rst:1320 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1801,7 +1820,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1326 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1810,50 +1829,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1315 +#: ../../howto/clinic.rst:1333 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1319 +#: ../../howto/clinic.rst:1337 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1325 +#: ../../howto/clinic.rst:1343 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1324 +#: ../../howto/clinic.rst:1342 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1330 +#: ../../howto/clinic.rst:1348 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1328 +#: ../../howto/clinic.rst:1346 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1333 +#: ../../howto/clinic.rst:1351 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1364 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1338 +#: ../../howto/clinic.rst:1356 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1864,37 +1883,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1349 +#: ../../howto/clinic.rst:1367 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1354 +#: ../../howto/clinic.rst:1372 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1352 +#: ../../howto/clinic.rst:1370 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1360 +#: ../../howto/clinic.rst:1378 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1357 +#: ../../howto/clinic.rst:1375 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1362 +#: ../../howto/clinic.rst:1380 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1373 +#: ../../howto/clinic.rst:1391 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1903,25 +1922,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1379 +#: ../../howto/clinic.rst:1397 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1386 +#: ../../howto/clinic.rst:1404 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1388 +#: ../../howto/clinic.rst:1406 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1392 +#: ../../howto/clinic.rst:1410 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1930,59 +1949,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1401 +#: ../../howto/clinic.rst:1419 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1403 +#: ../../howto/clinic.rst:1421 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1415 +#: ../../howto/clinic.rst:1433 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1418 +#: ../../howto/clinic.rst:1436 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1423 +#: ../../howto/clinic.rst:1441 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1425 +#: ../../howto/clinic.rst:1443 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1446 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1432 +#: ../../howto/clinic.rst:1450 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1434 +#: ../../howto/clinic.rst:1452 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1436 +#: ../../howto/clinic.rst:1454 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1438 +#: ../../howto/clinic.rst:1456 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1991,11 +2010,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1446 +#: ../../howto/clinic.rst:1464 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1448 +#: ../../howto/clinic.rst:1466 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2004,7 +2023,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1454 +#: ../../howto/clinic.rst:1472 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2016,15 +2035,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1463 +#: ../../howto/clinic.rst:1481 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1490 +#: ../../howto/clinic.rst:1508 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1466 +#: ../../howto/clinic.rst:1484 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2032,7 +2051,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1481 +#: ../../howto/clinic.rst:1499 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2045,45 +2064,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1524 +#: ../../howto/clinic.rst:1542 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1493 +#: ../../howto/clinic.rst:1511 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1573 -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1516 ../../howto/clinic.rst:1591 +#: ../../howto/clinic.rst:1669 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1497 +#: ../../howto/clinic.rst:1515 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1504 ../../howto/clinic.rst:1600 -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1522 ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1672 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1501 +#: ../../howto/clinic.rst:1519 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1515 ../../howto/clinic.rst:1586 -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1698 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1507 +#: ../../howto/clinic.rst:1525 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2092,65 +2111,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1514 +#: ../../howto/clinic.rst:1532 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1520 ../../howto/clinic.rst:1613 -#: ../../howto/clinic.rst:1684 +#: ../../howto/clinic.rst:1538 ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1702 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1518 +#: ../../howto/clinic.rst:1536 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1524 ../../howto/clinic.rst:1647 +#: ../../howto/clinic.rst:1542 ../../howto/clinic.rst:1665 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1523 +#: ../../howto/clinic.rst:1541 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1526 +#: ../../howto/clinic.rst:1544 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1528 +#: ../../howto/clinic.rst:1546 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1534 +#: ../../howto/clinic.rst:1552 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1538 +#: ../../howto/clinic.rst:1556 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1545 +#: ../../howto/clinic.rst:1563 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1549 +#: ../../howto/clinic.rst:1567 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1558 +#: ../../howto/clinic.rst:1576 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2159,25 +2178,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1565 +#: ../../howto/clinic.rst:1583 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1569 +#: ../../howto/clinic.rst:1587 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1572 +#: ../../howto/clinic.rst:1590 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1576 +#: ../../howto/clinic.rst:1594 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2185,17 +2204,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1582 +#: ../../howto/clinic.rst:1600 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1586 +#: ../../howto/clinic.rst:1604 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1589 +#: ../../howto/clinic.rst:1607 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2205,14 +2224,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1598 +#: ../../howto/clinic.rst:1616 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1603 +#: ../../howto/clinic.rst:1621 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2221,18 +2240,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1628 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1624 +#: ../../howto/clinic.rst:1642 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1616 +#: ../../howto/clinic.rst:1634 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2242,137 +2261,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1623 +#: ../../howto/clinic.rst:1641 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1626 +#: ../../howto/clinic.rst:1644 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1632 +#: ../../howto/clinic.rst:1650 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1634 +#: ../../howto/clinic.rst:1652 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1654 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1642 +#: ../../howto/clinic.rst:1660 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1662 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1647 +#: ../../howto/clinic.rst:1665 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1650 +#: ../../howto/clinic.rst:1668 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1672 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1657 +#: ../../howto/clinic.rst:1675 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1678 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1680 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1683 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1684 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1667 +#: ../../howto/clinic.rst:1685 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1668 +#: ../../howto/clinic.rst:1686 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1687 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1670 +#: ../../howto/clinic.rst:1688 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1690 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1690 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1676 +#: ../../howto/clinic.rst:1694 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1693 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1678 +#: ../../howto/clinic.rst:1696 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1683 +#: ../../howto/clinic.rst:1701 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1704 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1692 +#: ../../howto/clinic.rst:1710 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1696 +#: ../../howto/clinic.rst:1714 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1721 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2380,35 +2399,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1725 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1728 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1728 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1713 +#: ../../howto/clinic.rst:1731 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1713 +#: ../../howto/clinic.rst:1731 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1715 +#: ../../howto/clinic.rst:1733 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1722 +#: ../../howto/clinic.rst:1740 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2417,36 +2436,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1729 +#: ../../howto/clinic.rst:1747 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1749 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1742 +#: ../../howto/clinic.rst:1760 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1751 +#: ../../howto/clinic.rst:1769 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1765 +#: ../../howto/clinic.rst:1783 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1772 +#: ../../howto/clinic.rst:1790 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2454,27 +2473,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1795 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1780 +#: ../../howto/clinic.rst:1798 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1788 +#: ../../howto/clinic.rst:1806 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1792 +#: ../../howto/clinic.rst:1810 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2482,24 +2501,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1796 +#: ../../howto/clinic.rst:1814 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1804 +#: ../../howto/clinic.rst:1822 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1810 +#: ../../howto/clinic.rst:1828 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1812 +#: ../../howto/clinic.rst:1830 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2507,7 +2526,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1817 +#: ../../howto/clinic.rst:1835 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/howto/functional.po b/howto/functional.po index bd60239f56..12ddb77d69 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -1110,8 +1110,8 @@ msgstr "" msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." "add) `. It performs the same calculation, but instead " -"of returning only the final result, :func:`accumulate` returns an iterator " -"that also yields each partial result::" +"of returning only the final result, :func:`~itertools.accumulate` returns an " +"iterator that also yields each partial result::" msgstr "" #: ../../howto/functional.rst:1086 diff --git a/howto/instrumentation.po b/howto/instrumentation.po index df81604478..d5e62b6a96 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -232,13 +232,13 @@ msgstr "" #: ../../howto/instrumentation.rst:295 msgid "" -"This marker is the converse of :c:func:`function__entry`, and indicates that " -"execution of a Python function has ended (either via ``return``, or via an " -"exception). It is only triggered for pure-Python (bytecode) functions." +"This marker is the converse of :c:func:`!function__entry`, and indicates " +"that execution of a Python function has ended (either via ``return``, or via " +"an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" #: ../../howto/instrumentation.rst:299 -msgid "The arguments are the same as for :c:func:`function__entry`" +msgid "The arguments are the same as for :c:func:`!function__entry`" msgstr "" #: ../../howto/instrumentation.rst:303 @@ -249,7 +249,7 @@ msgid "" msgstr "" #: ../../howto/instrumentation.rst:307 -msgid "The arguments are the same as for :c:func:`function__entry`." +msgid "The arguments are the same as for :c:func:`!function__entry`." msgstr "" #: ../../howto/instrumentation.rst:311 diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 994589742c..7988568fb5 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -381,14 +381,14 @@ msgstr "" #: ../../howto/isolating-extensions.rst:300 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" -"data:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." +"macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" #: ../../howto/isolating-extensions.rst:302 msgid "" "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " "become possible to instantiate them from Python code. You can prevent this " -"with the :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." +"with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" #: ../../howto/isolating-extensions.rst:308 @@ -433,7 +433,7 @@ msgid "" msgstr "" #: ../../howto/isolating-extensions.rst:336 -msgid "Have the :c:data:`Py_TPFLAGS_HAVE_GC` flag." +msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" #: ../../howto/isolating-extensions.rst:337 @@ -444,7 +444,7 @@ msgstr "" #: ../../howto/isolating-extensions.rst:340 msgid "" -"Please refer to the :ref:`the documentation ` of :c:data:" +"Please refer to the :ref:`the documentation ` of :c:macro:" "`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for " "additional considerations." msgstr "" @@ -521,9 +521,10 @@ msgstr "" #: ../../howto/isolating-extensions.rst:413 msgid "" -"For a method to get its \"defining class\", it must use the :data:" -"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS` :c:type:`calling convention " -"` and the corresponding :c:type:`PyCMethod` signature::" +"For a method to get its \"defining class\", it must use the :ref:" +"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the " +"corresponding :c:type:`PyCMethod` signature::" msgstr "" #: ../../howto/isolating-extensions.rst:425 @@ -562,17 +563,17 @@ msgstr "" #: ../../howto/isolating-extensions.rst:486 msgid "" -"``PyType_GetModuleByDef`` works by searching the :term:`method resolution " -"order` (i.e. all superclasses) for the first superclass that has a " -"corresponding module." +":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " +"resolution order` (i.e. all superclasses) for the first superclass that has " +"a corresponding module." msgstr "" #: ../../howto/isolating-extensions.rst:492 msgid "" "In very exotic cases (inheritance chains spanning multiple modules created " -"from the same definition), ``PyType_GetModuleByDef`` might not return the " -"module of the true defining class. However, it will always return a module " -"with the same definition, ensuring a compatible C memory layout." +"from the same definition), :c:func:`!PyType_GetModuleByDef` might not return " +"the module of the true defining class. However, it will always return a " +"module with the same definition, ensuring a compatible C memory layout." msgstr "" #: ../../howto/isolating-extensions.rst:500 diff --git a/howto/regex.po b/howto/regex.po index 4d99613d39..e9df685f6d 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -634,12 +634,12 @@ msgid "" msgstr "" #: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1060 +#: ../../howto/regex.rst:1062 msgid "Method/Attribute" msgstr "" #: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1060 +#: ../../howto/regex.rst:1062 msgid "Purpose" msgstr "" @@ -832,7 +832,7 @@ msgstr "" msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:521 +#: ../../howto/regex.rst:523 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -844,72 +844,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:529 +#: ../../howto/regex.rst:531 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:533 +#: ../../howto/regex.rst:535 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:533 +#: ../../howto/regex.rst:535 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:537 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:537 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:541 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:539 +#: ../../howto/regex.rst:541 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:542 +#: ../../howto/regex.rst:544 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:542 +#: ../../howto/regex.rst:544 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:546 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:546 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:548 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:548 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:549 +#: ../../howto/regex.rst:551 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:549 +#: ../../howto/regex.rst:551 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:558 +#: ../../howto/regex.rst:560 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -925,13 +925,13 @@ msgid "" "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:576 +#: ../../howto/regex.rst:578 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:579 +#: ../../howto/regex.rst:581 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -950,13 +950,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:601 +#: ../../howto/regex.rst:603 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:604 +#: ../../howto/regex.rst:606 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -967,20 +967,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:617 +#: ../../howto/regex.rst:619 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:625 +#: ../../howto/regex.rst:627 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:634 +#: ../../howto/regex.rst:636 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -992,45 +992,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:643 +#: ../../howto/regex.rst:645 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:656 +#: ../../howto/regex.rst:658 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:662 +#: ../../howto/regex.rst:664 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:668 +#: ../../howto/regex.rst:670 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:670 +#: ../../howto/regex.rst:672 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:678 +#: ../../howto/regex.rst:680 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:680 +#: ../../howto/regex.rst:682 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:683 +#: ../../howto/regex.rst:685 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1042,11 +1042,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:699 +#: ../../howto/regex.rst:701 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:692 +#: ../../howto/regex.rst:694 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1056,17 +1056,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:698 +#: ../../howto/regex.rst:700 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:714 +#: ../../howto/regex.rst:716 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:702 +#: ../../howto/regex.rst:704 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1074,37 +1074,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:706 +#: ../../howto/regex.rst:708 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:714 +#: ../../howto/regex.rst:716 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:728 +#: ../../howto/regex.rst:730 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:717 +#: ../../howto/regex.rst:719 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:727 +#: ../../howto/regex.rst:729 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:734 +#: ../../howto/regex.rst:736 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:731 +#: ../../howto/regex.rst:733 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1113,19 +1113,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:737 +#: ../../howto/regex.rst:739 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:737 +#: ../../howto/regex.rst:739 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:772 +#: ../../howto/regex.rst:774 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:740 +#: ../../howto/regex.rst:742 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1133,13 +1133,13 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:745 +#: ../../howto/regex.rst:747 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:756 +#: ../../howto/regex.rst:758 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " @@ -1150,28 +1150,28 @@ msgid "" "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:770 +#: ../../howto/regex.rst:772 msgid "" "Second, inside a character class, where there's no use for this assertion, " "``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:777 +#: ../../howto/regex.rst:779 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:775 +#: ../../howto/regex.rst:777 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:780 +#: ../../howto/regex.rst:782 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:782 +#: ../../howto/regex.rst:784 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1180,14 +1180,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:795 +#: ../../howto/regex.rst:797 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:799 +#: ../../howto/regex.rst:801 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1197,7 +1197,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:810 +#: ../../howto/regex.rst:812 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1209,27 +1209,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:826 +#: ../../howto/regex.rst:828 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:839 +#: ../../howto/regex.rst:841 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:845 +#: ../../howto/regex.rst:847 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:851 +#: ../../howto/regex.rst:853 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1240,11 +1240,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:859 +#: ../../howto/regex.rst:861 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:865 +#: ../../howto/regex.rst:867 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1252,11 +1252,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:871 +#: ../../howto/regex.rst:873 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:873 +#: ../../howto/regex.rst:875 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1265,7 +1265,7 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:879 +#: ../../howto/regex.rst:881 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1276,7 +1276,7 @@ msgid "" "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:886 +#: ../../howto/regex.rst:888 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1287,20 +1287,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:894 +#: ../../howto/regex.rst:896 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:899 +#: ../../howto/regex.rst:901 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:902 +#: ../../howto/regex.rst:904 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1308,7 +1308,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:914 +#: ../../howto/regex.rst:916 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1321,13 +1321,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:923 +#: ../../howto/regex.rst:925 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:926 +#: ../../howto/regex.rst:928 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1339,26 +1339,26 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:941 +#: ../../howto/regex.rst:943 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:948 +#: ../../howto/regex.rst:950 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:959 +#: ../../howto/regex.rst:961 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:962 +#: ../../howto/regex.rst:964 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -1369,22 +1369,22 @@ msgid "" "P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:975 +#: ../../howto/regex.rst:977 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:977 +#: ../../howto/regex.rst:979 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:985 +#: ../../howto/regex.rst:987 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:981 +#: ../../howto/regex.rst:983 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1393,18 +1393,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:990 +#: ../../howto/regex.rst:992 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:988 +#: ../../howto/regex.rst:990 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:994 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1412,15 +1412,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:997 +#: ../../howto/regex.rst:999 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:999 +#: ../../howto/regex.rst:1001 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:1003 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1430,24 +1430,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1008 +#: ../../howto/regex.rst:1010 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1011 +#: ../../howto/regex.rst:1013 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1015 +#: ../../howto/regex.rst:1017 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1017 +#: ../../howto/regex.rst:1019 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1458,18 +1458,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1025 +#: ../../howto/regex.rst:1027 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1027 +#: ../../howto/regex.rst:1029 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1031 +#: ../../howto/regex.rst:1033 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1477,11 +1477,11 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1036 +#: ../../howto/regex.rst:1038 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1038 +#: ../../howto/regex.rst:1040 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if " @@ -1491,61 +1491,61 @@ msgid "" "the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1045 +#: ../../howto/regex.rst:1047 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1049 +#: ../../howto/regex.rst:1051 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1053 +#: ../../howto/regex.rst:1055 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1055 +#: ../../howto/regex.rst:1057 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:1064 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:1064 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1065 +#: ../../howto/regex.rst:1067 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1065 +#: ../../howto/regex.rst:1067 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1068 +#: ../../howto/regex.rst:1070 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1068 +#: ../../howto/regex.rst:1070 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1075 +#: ../../howto/regex.rst:1077 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1077 +#: ../../howto/regex.rst:1079 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1555,7 +1555,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1088 +#: ../../howto/regex.rst:1090 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1563,7 +1563,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1093 +#: ../../howto/regex.rst:1095 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1572,7 +1572,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1105 +#: ../../howto/regex.rst:1107 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1580,17 +1580,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1117 +#: ../../howto/regex.rst:1119 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1129 +#: ../../howto/regex.rst:1131 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1131 +#: ../../howto/regex.rst:1133 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1598,40 +1598,40 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1138 +#: ../../howto/regex.rst:1140 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1142 +#: ../../howto/regex.rst:1144 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1146 +#: ../../howto/regex.rst:1148 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1155 +#: ../../howto/regex.rst:1157 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1164 +#: ../../howto/regex.rst:1166 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1171 +#: ../../howto/regex.rst:1173 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " @@ -1642,13 +1642,13 @@ msgid "" "string." msgstr "" -#: ../../howto/regex.rst:1178 +#: ../../howto/regex.rst:1180 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1185 +#: ../../howto/regex.rst:1187 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1660,7 +1660,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1202 +#: ../../howto/regex.rst:1204 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1669,13 +1669,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1208 +#: ../../howto/regex.rst:1210 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1220 +#: ../../howto/regex.rst:1222 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1685,11 +1685,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1228 +#: ../../howto/regex.rst:1230 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1230 +#: ../../howto/regex.rst:1232 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1697,11 +1697,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1236 +#: ../../howto/regex.rst:1238 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1238 +#: ../../howto/regex.rst:1240 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1713,7 +1713,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1246 +#: ../../howto/regex.rst:1248 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1726,7 +1726,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1255 +#: ../../howto/regex.rst:1257 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1735,17 +1735,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1261 +#: ../../howto/regex.rst:1263 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1266 +#: ../../howto/regex.rst:1268 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1268 +#: ../../howto/regex.rst:1270 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1755,13 +1755,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1279 +#: ../../howto/regex.rst:1281 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1287 +#: ../../howto/regex.rst:1289 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1773,18 +1773,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1296 +#: ../../howto/regex.rst:1298 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1302 +#: ../../howto/regex.rst:1304 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1304 +#: ../../howto/regex.rst:1306 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1793,7 +1793,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1318 +#: ../../howto/regex.rst:1320 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1803,7 +1803,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1325 +#: ../../howto/regex.rst:1327 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1812,7 +1812,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1334 +#: ../../howto/regex.rst:1336 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1822,11 +1822,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1342 +#: ../../howto/regex.rst:1344 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1344 +#: ../../howto/regex.rst:1346 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1834,14 +1834,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1349 +#: ../../howto/regex.rst:1351 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1353 +#: ../../howto/regex.rst:1355 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1852,15 +1852,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1370 +#: ../../howto/regex.rst:1372 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1376 +#: ../../howto/regex.rst:1378 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1378 +#: ../../howto/regex.rst:1380 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1868,7 +1868,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1383 +#: ../../howto/regex.rst:1385 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/howto/sorting.po b/howto/sorting.po index f7fbea9ba6..d5f50b1ced 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -307,13 +307,13 @@ msgstr "" msgid "" "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:" +"`~object.__lt__` method:" msgstr "" #: ../../howto/sorting.rst:284 msgid "" -"However, note that ``<`` can fall back to using :meth:`__gt__` if :meth:" -"`__lt__` is not implemented (see :func:`object.__lt__`)." +"However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" +"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`)." msgstr "" #: ../../howto/sorting.rst:287 diff --git a/howto/unicode.po b/howto/unicode.po index 87530aabd5..eca6919292 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -501,9 +501,9 @@ msgid "" "A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." "normalize` function that converts strings to one of several normal forms, " "where letters followed by a combining character are replaced with single " -"characters. :func:`normalize` can be used to perform string comparisons " -"that won't falsely report inequality if two strings use combining characters " -"differently:" +"characters. :func:`~unicodedata.normalize` can be used to perform string " +"comparisons that won't falsely report inequality if two strings use " +"combining characters differently:" msgstr "" #: ../../howto/unicode.rst:448 @@ -523,10 +523,10 @@ msgstr "" #: ../../howto/unicode.rst:477 msgid "" -"This will print ``True``. (Why is :func:`NFD` invoked twice? Because there " -"are a few characters that make :meth:`casefold` return a non-normalized " -"string, so the result needs to be normalized again. See section 3.13 of the " -"Unicode Standard for a discussion and an example.)" +"This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " +"there are a few characters that make :meth:`~str.casefold` return a non-" +"normalized string, so the result needs to be normalized again. See section " +"3.13 of the Unicode Standard for a discussion and an example.)" msgstr "" #: ../../howto/unicode.rst:484 diff --git a/install/index.po b/install/index.po index f357a5a15b..ee720a6ebc 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -432,9 +432,9 @@ msgstr "" #: ../../install/index.rst:316 msgid "" -"Files will be installed into subdirectories of :data:`site.USER_BASE` " +"Files will be installed into subdirectories of :const:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known as :data:" +"modules and extension modules in the same location (also known as :const:" "`site.USER_SITE`). Here are the values for UNIX, including macOS:" msgstr "" diff --git a/library/__main__.po b/library/__main__.po index c0dbfd168c..c369e52fc2 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -336,12 +336,12 @@ msgstr "" #: ../../library/__main__.rst:339 msgid "" -"Python inserts an empty ``__main__`` module in :attr:`sys.modules` at " +"Python inserts an empty ``__main__`` module in :data:`sys.modules` at " "interpreter startup, and populates it by running top-level code. In our " "example this is the ``start`` module which runs line by line and imports " "``namely``. In turn, ``namely`` imports ``__main__`` (which is really " "``start``). That's an import cycle! Fortunately, since the partially " -"populated ``__main__`` module is present in :attr:`sys.modules`, Python " +"populated ``__main__`` module is present in :data:`sys.modules`, Python " "passes that to ``namely``. See :ref:`Special considerations for __main__ " "` in the import system's reference for details on how " "this works." diff --git a/library/_thread.po b/library/_thread.po index 7ef4909d31..133c25edfd 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -97,13 +97,13 @@ msgstr "" #: ../../library/_thread.rst:72 msgid "" "If given, *signum* is the number of the signal to simulate. If *signum* is " -"not given, :data:`signal.SIGINT` is simulated." +"not given, :const:`signal.SIGINT` is simulated." msgstr "" #: ../../library/_thread.rst:75 msgid "" -"If the given signal isn't handled by Python (it was set to :data:`signal." -"SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing." +"If the given signal isn't handled by Python (it was set to :const:`signal." +"SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." msgstr "" #: ../../library/_thread.rst:79 @@ -150,7 +150,9 @@ msgstr "" msgid "" ":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " "NetBSD, AIX, DragonFlyBSD." -msgstr ":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、NetBSD、AIX、DragonFlyBSD。" +msgstr "" +":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、NetBSD、" +"AIX、DragonFlyBSD。" #: ../../library/_thread.rst:130 msgid "" @@ -181,9 +183,9 @@ msgstr "" #: ../../library/_thread.rst:152 msgid "" -"The maximum value allowed for the *timeout* parameter of :meth:`Lock." -"acquire`. Specifying a timeout greater than this value will raise an :exc:" -"`OverflowError`." +"The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " +"`. Specifying a timeout greater than this value will " +"raise an :exc:`OverflowError`." msgstr "" #: ../../library/_thread.rst:159 @@ -265,19 +267,19 @@ msgstr "" #: ../../library/_thread.rst:220 msgid "" -"It is not possible to interrupt the :meth:`acquire` method on a lock --- " -"the :exc:`KeyboardInterrupt` exception will happen after the lock has been " -"acquired." +"It is not possible to interrupt the :meth:`~threading.Lock.acquire` method " +"on a lock --- the :exc:`KeyboardInterrupt` exception will happen after the " +"lock has been acquired." msgstr "" -#: ../../library/_thread.rst:223 +#: ../../library/_thread.rst:224 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" "`try` ... :keyword:`finally` clauses or executing object destructors." msgstr "" -#: ../../library/_thread.rst:228 +#: ../../library/_thread.rst:229 msgid "" "When the main thread exits, it does not do any of its usual cleanup (except " "that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " diff --git a/library/array.po b/library/array.po index f4df9a08c4..d4376b7284 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -211,13 +211,13 @@ msgstr "根據平台的不同,它有可能是 16 位元或者 32 位元。" #: ../../library/array.rst:53 msgid "" -"``array('u')`` now uses ``wchar_t`` as C type instead of deprecated " +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " "``Py_UNICODE``. This change doesn't affect its behavior because " -"``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3." +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" -"目前 ``array('u')`` 使用 ``wchar_t`` 取代已棄用的 ``Py_UNICODE`` 作為 C " +"目前 ``array('u')`` 使用 :c:type:`wchar_t` 取代已棄用的 ``Py_UNICODE`` 作為 C " "type。這個異動並沒有影響到它的作用,因爲自從 Python 3.3 開始 ``Py_UNICODE`` " -"即為 ``wchar_t`` 的別名。" +"即為 :c:type:`wchar_t` 的別名。" #: ../../library/array.rst:61 msgid "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 974fc0041d..27f0911772 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-02-18 14:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,11 +76,11 @@ msgstr "除了啟用除錯模式外,還要考慮:" #: ../../library/asyncio-dev.rst:36 msgid "" "setting the log level of the :ref:`asyncio logger ` to :py:" -"data:`logging.DEBUG`, for example the following snippet of code can be run " +"const:`logging.DEBUG`, for example the following snippet of code can be run " "at startup of the application::" msgstr "" "將 :ref:`asyncio logger(日誌記錄器) `\\ 的日誌級别設置為 :" -"py:data:`logging.DEBUG`,例如下面的程式片段可以在應用程式啟動時運行:\n" +"py:const:`logging.DEBUG`,例如下面的程式片段可以在應用程式啟動時運行:\n" "\n" "::" @@ -260,10 +260,10 @@ msgstr "" #: ../../library/asyncio-dev.rst:145 msgid "" -"The default log level is :py:data:`logging.INFO`, which can be easily " +"The default log level is :py:const:`logging.INFO`, which can be easily " "adjusted::" msgstr "" -"日誌級別被預設為 :py:data:`logging.INFO`,它可以很容易地被調整:\n" +"日誌級別被預設為 :py:const:`logging.INFO`,它可以很容易地被調整:\n" "\n" "::" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index c704ceed7b..05d60d7dee 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,7 +259,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:176 #: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1639 +#: ../../library/asyncio-eventloop.rst:1642 msgid "Example::" msgstr "" "範例:\n" @@ -530,13 +530,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:406 msgid "" -"The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" +"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" #: ../../library/asyncio-eventloop.rst:410 -msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." +msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:412 @@ -701,7 +701,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:512 msgid "" -"The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " +"The socket option :py:const:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" @@ -755,13 +755,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:555 msgid "" -"The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" -"`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " +"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" +"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" #: ../../library/asyncio-eventloop.rst:559 -msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." +msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:561 @@ -804,7 +804,7 @@ msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :py:data:`~socket.SO_REUSEPORT` constant is not defined then " +"Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not defined then " "this capability is unsupported." msgstr "" @@ -836,7 +836,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:608 msgid "" -"The *reuse_address* parameter is no longer supported, as using :py:data:" +"The *reuse_address* parameter is no longer supported, as using :py:const:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" @@ -851,7 +851,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:617 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " +"similar functionality. With *reuse_port*, :py:const:`~sockets.SO_REUSEPORT` " "is used instead, which specifically prevents processes with differing UIDs " "from assigning sockets to the same socket address." msgstr "" @@ -872,8 +872,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:637 msgid "" -"The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" -"py:data:`~socket.SOCK_STREAM`." +"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" +"py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:642 @@ -907,7 +907,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:674 msgid "" -"Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " +"Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" @@ -954,9 +954,9 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:702 msgid "" -"*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." +"*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " -"will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." +"will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" #: ../../library/asyncio-eventloop.rst:707 @@ -1023,9 +1023,11 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:758 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " +"option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 " +":py:const:`~socket.TCP_NODELAY` socket 選項。" #: ../../library/asyncio-eventloop.rst:768 msgid "" @@ -1036,7 +1038,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:779 msgid "" -"Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." +"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" @@ -1976,39 +1978,45 @@ msgstr "" msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1598 +#: ../../library/asyncio-eventloop.rst:1596 +msgid "" +"This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " +"3.10.3 and 3.11." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1601 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1604 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1604 +#: ../../library/asyncio-eventloop.rst:1607 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1609 +#: ../../library/asyncio-eventloop.rst:1612 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1615 +#: ../../library/asyncio-eventloop.rst:1618 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1617 +#: ../../library/asyncio-eventloop.rst:1620 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1623 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2017,98 +2025,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1631 +#: ../../library/asyncio-eventloop.rst:1634 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1660 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1663 +#: ../../library/asyncio-eventloop.rst:1666 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1667 +#: ../../library/asyncio-eventloop.rst:1670 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1670 +#: ../../library/asyncio-eventloop.rst:1673 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1680 +#: ../../library/asyncio-eventloop.rst:1683 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1682 +#: ../../library/asyncio-eventloop.rst:1685 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1688 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1691 +#: ../../library/asyncio-eventloop.rst:1694 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1696 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1708 +#: ../../library/asyncio-eventloop.rst:1711 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1713 +#: ../../library/asyncio-eventloop.rst:1716 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1715 +#: ../../library/asyncio-eventloop.rst:1718 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1719 +#: ../../library/asyncio-eventloop.rst:1722 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1725 +#: ../../library/asyncio-eventloop.rst:1728 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1727 +#: ../../library/asyncio-eventloop.rst:1730 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1733 +#: ../../library/asyncio-eventloop.rst:1736 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1735 +#: ../../library/asyncio-eventloop.rst:1738 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2116,70 +2124,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1745 +#: ../../library/asyncio-eventloop.rst:1748 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1747 +#: ../../library/asyncio-eventloop.rst:1750 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1771 +#: ../../library/asyncio-eventloop.rst:1774 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1778 +#: ../../library/asyncio-eventloop.rst:1781 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1780 +#: ../../library/asyncio-eventloop.rst:1783 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1808 +#: ../../library/asyncio-eventloop.rst:1811 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1815 +#: ../../library/asyncio-eventloop.rst:1818 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1817 +#: ../../library/asyncio-eventloop.rst:1820 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1855 +#: ../../library/asyncio-eventloop.rst:1858 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1859 +#: ../../library/asyncio-eventloop.rst:1862 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1867 +#: ../../library/asyncio-eventloop.rst:1870 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1869 +#: ../../library/asyncio-eventloop.rst:1872 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1871 +#: ../../library/asyncio-eventloop.rst:1874 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index af6269e8ce..c650699e29 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-01-17 11:37+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,17 +68,19 @@ msgstr "Windows 上的所有事件迴圈都不支援以下 method(方法): #: ../../library/asyncio-platforms.rst:38 msgid "" ":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are " -"not supported. The :data:`socket.AF_UNIX` socket family is specific to Unix." +"not supported. The :const:`socket.AF_UNIX` socket family is specific to Unix." msgstr "" -"不支援 :meth:`loop.create_unix_connection` 和 :meth:`loop.create_unix_server`" -"。:data:`socket.AF_UNIX` socket 系列常數僅限於 Unix 上使用。" +"不支援 :meth:`loop.create_unix_connection` 和 :meth:`loop." +"create_unix_server`。:const:`socket.AF_UNIX` socket 系列常數僅限於 Unix 上使" +"用。" #: ../../library/asyncio-platforms.rst:42 msgid "" ":meth:`loop.add_signal_handler` and :meth:`loop.remove_signal_handler` are " "not supported." msgstr "" -"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop.remove_signal_handler`。" +"不支援 :meth:`loop.add_signal_handler` 和 :meth:`loop." +"remove_signal_handler`。" #: ../../library/asyncio-platforms.rst:45 msgid ":class:`SelectorEventLoop` has the following limitations:" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index ae024f1c76..fc8767f5fe 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -71,7 +71,7 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:87 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " -"wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :attr:" +"wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :const:" "`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." msgstr "" @@ -308,7 +308,7 @@ msgstr "" #: ../../library/asyncio-subprocess.rst:252 msgid "" -"On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " +"On POSIX systems this method sends :py:const:`signal.SIGTERM` to the child " "process." msgstr "" diff --git a/library/codeop.po b/library/codeop.po index 9d99ee838b..18e67059b8 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-31 00:16+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:28+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -96,18 +96,18 @@ msgstr "" #: ../../library/codeop.rst:61 msgid "" -"Instances of this class have :meth:`__call__` methods identical in signature " -"to the built-in function :func:`compile`, but with the difference that if " -"the instance compiles program text containing a :mod:`__future__` statement, " -"the instance 'remembers' and compiles all subsequent program texts with the " -"statement in force." +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to the built-in function :func:`compile`, but with the difference " +"that if the instance compiles program text containing a :mod:`__future__` " +"statement, the instance 'remembers' and compiles all subsequent program " +"texts with the statement in force." msgstr "" #: ../../library/codeop.rst:70 msgid "" -"Instances of this class have :meth:`__call__` methods identical in signature " -"to :func:`compile_command`; the difference is that if the instance compiles " -"program text containing a :mod:`__future__` statement, the instance " +"Instances of this class have :meth:`~object.__call__` methods identical in " +"signature to :func:`compile_command`; the difference is that if the instance " +"compiles program text containing a :mod:`__future__` statement, the instance " "'remembers' and compiles all subsequent program texts with the statement in " "force." msgstr "" diff --git a/library/compileall.po b/library/compileall.po index d5c5d2582a..de1910b149 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -190,9 +190,9 @@ msgstr "" #: ../../library/compileall.rst:144 msgid "" -"Similarly, the :func:`compile` function respects the :attr:`sys." +"Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " -"if :func:`compile` is run with the same :attr:`sys.pycache_prefix` (if any) " +"if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) " "that will be used at runtime." msgstr "" diff --git a/library/constants.po b/library/constants.po index c8e5e0da01..96a30cff11 100644 --- a/library/constants.po +++ b/library/constants.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,26 +50,27 @@ msgid "" "An object frequently used to represent the absence of a value, as when " "default arguments are not passed to a function. Assignments to ``None`` are " "illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of " -"the :data:`NoneType` type." +"the :data:`~types.NoneType` type." msgstr "" "型別 ``NoneType`` 的唯一值。``None`` 經常被使用來表達缺少值,例如未傳送預設的" "引數至函式時,相對應參數即會被賦予 ``None``。對於 ``None`` 的賦值是不合法的," -"並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`NoneType` 的唯一實例。" +"並且會拋出 :exc:`SyntaxError`。``None`` 是型別 :data:`~types.NoneType` 的唯一實例。" #: ../../library/constants.rst:30 msgid "" "A special value which should be returned by the binary special methods (e." -"g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`, etc.) " -"to indicate that the operation is not implemented with respect to the other " -"type; may be returned by the in-place binary special methods (e.g. :meth:" -"`__imul__`, :meth:`__iand__`, etc.) for the same purpose. It should not be " -"evaluated in a boolean context. ``NotImplemented`` is the sole instance of " -"the :data:`types.NotImplementedType` type." +"g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" +"meth:`~object.__rsub__`, etc.) to indicate that the operation is not " +"implemented with respect to the other type; may be returned by the in-place " +"binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object." +"__iand__`, etc.) for the same purpose. It should not be evaluated in a " +"boolean context. ``NotImplemented`` is the sole instance of the :data:`types." +"NotImplementedType` type." msgstr "" -"會被二元特殊方法 (binary special methods)(如::meth:`__eq__`、:meth:" -"`__lt__`、:meth:`__add__`,:meth:`__rsub__` 等)所回傳的特殊值,代表著該運算" +"會被二元特殊方法 (binary special methods)(如::meth:`~object.__eq__`、:meth:" +"`~object.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` 等)所回傳的特殊值,代表著該運算" "沒有針對其他型別的實作。同理也可以被原地二元特殊方法 (in-place binary " -"special methods) (如::meth:`__imul__`、:meth:`__iand__` 等)回傳。它不應該" +"special methods) (如::meth:`~object.__imul__`、:meth:`~object.__iand__` 等)回傳。它不應該" "被作為 boolean(布林)來解讀。``NotImplemented`` 是型別 :data:`types." "NotImplementedType` 的唯一實例。" diff --git a/library/ctypes.po b/library/ctypes.po index def1539dfd..db3176d87a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,8 +259,8 @@ msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" #: ../../library/ctypes.rst:223 -msgid ":c:expr:`wchar_t`" -msgstr ":c:expr:`wchar_t`" +msgid ":c:type:`wchar_t`" +msgstr ":c:type:`wchar_t`" #: ../../library/ctypes.rst:223 msgid "1-character string" @@ -357,16 +357,16 @@ msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" #: ../../library/ctypes.rst:246 -msgid ":c:expr:`size_t`" -msgstr ":c:expr:`size_t`" +msgid ":c:type:`size_t`" +msgstr ":c:type:`size_t`" #: ../../library/ctypes.rst:248 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" #: ../../library/ctypes.rst:248 -msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" -msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" +msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" +msgstr ":c:type:`ssize_t` 或 :c:expr:`Py_ssize_t`" #: ../../library/ctypes.rst:251 msgid ":class:`c_time_t`" @@ -478,7 +478,7 @@ msgstr "" msgid "" "The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " "function (which is still available as an alias). To create a mutable memory " -"block containing unicode characters of the C type :c:expr:`wchar_t`, use " +"block containing unicode characters of the C type :c:type:`wchar_t`, use " "the :func:`create_unicode_buffer` function." msgstr "" @@ -595,9 +595,9 @@ msgstr "" #: ../../library/ctypes.rst:481 msgid "" -"The C prototype of ``time()`` is ``time_t time(time_t *)``. Because " -"``time_t`` might be of a different type than the default return type " -"``int``, you should specify the ``restype``::" +"The C prototype of ``time()`` is ``time_t time(time_t *)``. Because :c:type:" +"`time_t` might be of a different type than the default return type ``int``, " +"you should specify the ``restype``::" msgstr "" #: ../../library/ctypes.rst:487 @@ -2527,7 +2527,7 @@ msgstr "" #: ../../library/ctypes.rst:2410 msgid "" -"Represents the C :c:expr:`wchar_t` datatype, and interprets the value as a " +"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 "" @@ -2768,3 +2768,6 @@ msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." msgstr "" + +#~ msgid ":c:expr:`size_t`" +#~ msgstr ":c:expr:`size_t`" diff --git a/library/curses.po b/library/curses.po index 3bb2803ad8..e3453377ee 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-23 00:04+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-" @@ -263,7 +263,7 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:213 ../../library/curses.rst:1754 +#: ../../library/curses.rst:213 ../../library/curses.rst:1772 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." @@ -711,25 +711,25 @@ msgstr "" #: ../../library/curses.rst:644 msgid "" -"Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " -"screen resize." +"Update the :const:`LINES` and :const:`COLS` module variables. Useful for " +"detecting manual screen resize." msgstr "" -#: ../../library/curses.rst:651 +#: ../../library/curses.rst:652 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:655 +#: ../../library/curses.rst:656 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:662 +#: ../../library/curses.rst:663 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:668 +#: ../../library/curses.rst:669 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -739,7 +739,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:678 +#: ../../library/curses.rst:679 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -748,7 +748,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: ../../library/curses.rst:687 +#: ../../library/curses.rst:688 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -762,50 +762,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:701 +#: ../../library/curses.rst:702 msgid "Window Objects" msgstr "" -#: ../../library/curses.rst:703 +#: ../../library/curses.rst:704 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:710 +#: ../../library/curses.rst:711 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:716 +#: ../../library/curses.rst:717 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:724 +#: ../../library/curses.rst:725 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:732 +#: ../../library/curses.rst:733 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:737 +#: ../../library/curses.rst:738 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:741 +#: ../../library/curses.rst:742 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -815,44 +815,44 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:751 +#: ../../library/curses.rst:752 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:757 +#: ../../library/curses.rst:758 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:763 +#: ../../library/curses.rst:764 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:769 +#: ../../library/curses.rst:770 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:773 +#: ../../library/curses.rst:774 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:776 +#: ../../library/curses.rst:777 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:782 +#: ../../library/curses.rst:783 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -863,128 +863,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:792 +#: ../../library/curses.rst:793 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:798 +#: ../../library/curses.rst:799 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:803 +#: ../../library/curses.rst:804 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:803 +#: ../../library/curses.rst:804 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:803 +#: ../../library/curses.rst:804 msgid "Default value" msgstr "" -#: ../../library/curses.rst:805 +#: ../../library/curses.rst:806 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:805 +#: ../../library/curses.rst:806 msgid "Left side" msgstr "" -#: ../../library/curses.rst:805 ../../library/curses.rst:807 +#: ../../library/curses.rst:806 ../../library/curses.rst:808 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:807 +#: ../../library/curses.rst:808 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:807 +#: ../../library/curses.rst:808 msgid "Right side" msgstr "" -#: ../../library/curses.rst:809 +#: ../../library/curses.rst:810 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:809 +#: ../../library/curses.rst:810 msgid "Top" msgstr "" -#: ../../library/curses.rst:809 ../../library/curses.rst:811 +#: ../../library/curses.rst:810 ../../library/curses.rst:812 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:811 +#: ../../library/curses.rst:812 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:811 +#: ../../library/curses.rst:812 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:814 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:814 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:814 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:816 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:816 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:815 +#: ../../library/curses.rst:816 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:818 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:818 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:817 +#: ../../library/curses.rst:818 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:820 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:820 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:820 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:825 +#: ../../library/curses.rst:826 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:834 +#: ../../library/curses.rst:835 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -994,45 +994,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:844 +#: ../../library/curses.rst:845 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:850 +#: ../../library/curses.rst:851 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:856 +#: ../../library/curses.rst:857 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:862 +#: ../../library/curses.rst:863 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:867 +#: ../../library/curses.rst:868 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:873 +#: ../../library/curses.rst:874 msgid "Delete any character at ``(y, x)``." msgstr "" -#: ../../library/curses.rst:878 +#: ../../library/curses.rst:879 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:884 +#: ../../library/curses.rst:885 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1040,13 +1040,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:892 +#: ../../library/curses.rst:893 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:898 +#: ../../library/curses.rst:899 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1054,11 +1054,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:903 +#: ../../library/curses.rst:904 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:909 +#: ../../library/curses.rst:910 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1066,19 +1066,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:919 +#: ../../library/curses.rst:920 msgid "Clear the window." msgstr "" -#: ../../library/curses.rst:924 +#: ../../library/curses.rst:925 msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." msgstr "" -#: ../../library/curses.rst:929 +#: ../../library/curses.rst:930 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: ../../library/curses.rst:934 +#: ../../library/curses.rst:935 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1086,14 +1086,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:942 +#: ../../library/curses.rst:943 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:951 +#: ../../library/curses.rst:952 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1101,35 +1101,35 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:959 +#: ../../library/curses.rst:960 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: ../../library/curses.rst:964 +#: ../../library/curses.rst:965 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:974 +#: ../../library/curses.rst:975 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: ../../library/curses.rst:979 +#: ../../library/curses.rst:980 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:986 +#: ../../library/curses.rst:987 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: ../../library/curses.rst:992 +#: ../../library/curses.rst:993 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1137,13 +1137,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1000 +#: ../../library/curses.rst:1001 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: ../../library/curses.rst:1006 +#: ../../library/curses.rst:1007 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1151,19 +1151,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1014 +#: ../../library/curses.rst:1015 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1021 +#: ../../library/curses.rst:1022 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: ../../library/curses.rst:1027 +#: ../../library/curses.rst:1028 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1172,13 +1172,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1036 +#: ../../library/curses.rst:1037 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1043 +#: ../../library/curses.rst:1044 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1188,7 +1188,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1053 +#: ../../library/curses.rst:1054 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1197,7 +1197,7 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1062 +#: ../../library/curses.rst:1063 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1205,76 +1205,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: ../../library/curses.rst:1070 +#: ../../library/curses.rst:1071 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1077 +#: ../../library/curses.rst:1078 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1083 +#: ../../library/curses.rst:1084 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1090 +#: ../../library/curses.rst:1091 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: ../../library/curses.rst:1094 +#: ../../library/curses.rst:1095 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1099 +#: ../../library/curses.rst:1100 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1104 +#: ../../library/curses.rst:1105 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1111 +#: ../../library/curses.rst:1112 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1116 +#: ../../library/curses.rst:1117 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: ../../library/curses.rst:1121 +#: ../../library/curses.rst:1122 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1123 +#: ../../library/curses.rst:1124 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1129 +#: ../../library/curses.rst:1130 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1136 +#: ../../library/curses.rst:1137 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1282,7 +1282,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1141 +#: ../../library/curses.rst:1142 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1290,7 +1290,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1149 +#: ../../library/curses.rst:1150 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1298,7 +1298,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1154 +#: ../../library/curses.rst:1155 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1306,31 +1306,31 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1162 +#: ../../library/curses.rst:1163 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1168 +#: ../../library/curses.rst:1169 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1174 +#: ../../library/curses.rst:1175 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1180 +#: ../../library/curses.rst:1181 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1183 +#: ../../library/curses.rst:1184 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1345,7 +1345,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: ../../library/curses.rst:1197 +#: ../../library/curses.rst:1198 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1353,11 +1353,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1205 +#: ../../library/curses.rst:1206 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: ../../library/curses.rst:1210 +#: ../../library/curses.rst:1211 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1367,54 +1367,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1220 +#: ../../library/curses.rst:1221 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1226 +#: ../../library/curses.rst:1227 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1232 +#: ../../library/curses.rst:1233 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1238 ../../library/curses.rst:1245 +#: ../../library/curses.rst:1239 ../../library/curses.rst:1246 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: ../../library/curses.rst:1248 +#: ../../library/curses.rst:1249 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1254 +#: ../../library/curses.rst:1255 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1261 +#: ../../library/curses.rst:1262 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1267 +#: ../../library/curses.rst:1268 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1273 +#: ../../library/curses.rst:1274 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1424,7 +1424,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1283 +#: ../../library/curses.rst:1284 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1432,49 +1432,49 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1290 +#: ../../library/curses.rst:1291 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1296 +#: ../../library/curses.rst:1297 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1303 +#: ../../library/curses.rst:1304 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: ../../library/curses.rst:1308 +#: ../../library/curses.rst:1309 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1310 +#: ../../library/curses.rst:1311 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: ../../library/curses.rst:1315 +#: ../../library/curses.rst:1316 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1321 +#: ../../library/curses.rst:1322 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1328 +#: ../../library/curses.rst:1329 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1333 +#: ../../library/curses.rst:1334 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1482,518 +1482,536 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1338 +#: ../../library/curses.rst:1339 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1344 -msgid "The maximum number of colors the terminal can support." +#: ../../library/curses.rst:1345 +msgid "" +"The maximum number of colors the terminal can support. It is defined only " +"after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1348 -msgid "The maximum number of color pairs the terminal can support." +#: ../../library/curses.rst:1350 +msgid "" +"The maximum number of color pairs the terminal can support. It is defined " +"only after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1355 +msgid "" +"The width of the screen, i.e., the number of columns. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +#: ../../library/curses.rst:1362 +msgid "" +"The height of the screen, i.e., the number of lines. It is defined only " +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." +msgstr "" + +#: ../../library/curses.rst:1368 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1372 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1354 ../../library/curses.rst:1399 -#: ../../library/curses.rst:1643 ../../library/curses.rst:1735 +#: ../../library/curses.rst:1372 ../../library/curses.rst:1417 +#: ../../library/curses.rst:1661 ../../library/curses.rst:1753 msgid "Meaning" msgstr "" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1374 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1358 +#: ../../library/curses.rst:1376 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1360 +#: ../../library/curses.rst:1378 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1380 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1382 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1366 +#: ../../library/curses.rst:1384 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1368 +#: ../../library/curses.rst:1386 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1370 +#: ../../library/curses.rst:1388 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1372 +#: ../../library/curses.rst:1390 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1393 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1395 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1379 +#: ../../library/curses.rst:1397 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1381 +#: ../../library/curses.rst:1399 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1383 +#: ../../library/curses.rst:1401 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1385 +#: ../../library/curses.rst:1403 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1387 +#: ../../library/curses.rst:1405 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1389 +#: ../../library/curses.rst:1407 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1392 +#: ../../library/curses.rst:1410 msgid "``A_ITALIC`` was added." msgstr "" -#: ../../library/curses.rst:1395 +#: ../../library/curses.rst:1413 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1399 +#: ../../library/curses.rst:1417 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1401 +#: ../../library/curses.rst:1419 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1404 +#: ../../library/curses.rst:1422 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1425 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1411 +#: ../../library/curses.rst:1429 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1417 +#: ../../library/curses.rst:1435 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1417 +#: ../../library/curses.rst:1435 msgid "Key" msgstr "" -#: ../../library/curses.rst:1419 +#: ../../library/curses.rst:1437 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1421 +#: ../../library/curses.rst:1439 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1423 +#: ../../library/curses.rst:1441 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1425 +#: ../../library/curses.rst:1443 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1427 +#: ../../library/curses.rst:1445 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1429 +#: ../../library/curses.rst:1447 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1431 +#: ../../library/curses.rst:1449 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1433 +#: ../../library/curses.rst:1451 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1453 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1438 +#: ../../library/curses.rst:1456 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1440 +#: ../../library/curses.rst:1458 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1442 +#: ../../library/curses.rst:1460 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1444 +#: ../../library/curses.rst:1462 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1446 +#: ../../library/curses.rst:1464 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1448 +#: ../../library/curses.rst:1466 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1450 +#: ../../library/curses.rst:1468 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1452 +#: ../../library/curses.rst:1470 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1454 +#: ../../library/curses.rst:1472 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1456 +#: ../../library/curses.rst:1474 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1458 +#: ../../library/curses.rst:1476 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1460 +#: ../../library/curses.rst:1478 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1462 +#: ../../library/curses.rst:1480 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1464 +#: ../../library/curses.rst:1482 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1466 +#: ../../library/curses.rst:1484 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1468 +#: ../../library/curses.rst:1486 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1470 +#: ../../library/curses.rst:1488 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1472 +#: ../../library/curses.rst:1490 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1474 +#: ../../library/curses.rst:1492 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1476 +#: ../../library/curses.rst:1494 msgid "Print" msgstr "" -#: ../../library/curses.rst:1478 +#: ../../library/curses.rst:1496 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1480 +#: ../../library/curses.rst:1498 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1482 +#: ../../library/curses.rst:1500 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1484 +#: ../../library/curses.rst:1502 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1486 +#: ../../library/curses.rst:1504 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1488 +#: ../../library/curses.rst:1506 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1490 +#: ../../library/curses.rst:1508 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1492 +#: ../../library/curses.rst:1510 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1494 +#: ../../library/curses.rst:1512 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1496 +#: ../../library/curses.rst:1514 msgid "Close" msgstr "" -#: ../../library/curses.rst:1498 +#: ../../library/curses.rst:1516 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1500 +#: ../../library/curses.rst:1518 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1502 +#: ../../library/curses.rst:1520 msgid "Create" msgstr "" -#: ../../library/curses.rst:1504 +#: ../../library/curses.rst:1522 msgid "End" msgstr "" -#: ../../library/curses.rst:1506 +#: ../../library/curses.rst:1524 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1508 +#: ../../library/curses.rst:1526 msgid "Find" msgstr "" -#: ../../library/curses.rst:1510 +#: ../../library/curses.rst:1528 msgid "Help" msgstr "" -#: ../../library/curses.rst:1512 +#: ../../library/curses.rst:1530 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1514 +#: ../../library/curses.rst:1532 msgid "Message" msgstr "" -#: ../../library/curses.rst:1516 +#: ../../library/curses.rst:1534 msgid "Move" msgstr "" -#: ../../library/curses.rst:1518 +#: ../../library/curses.rst:1536 msgid "Next" msgstr "" -#: ../../library/curses.rst:1520 +#: ../../library/curses.rst:1538 msgid "Open" msgstr "" -#: ../../library/curses.rst:1522 +#: ../../library/curses.rst:1540 msgid "Options" msgstr "" -#: ../../library/curses.rst:1524 +#: ../../library/curses.rst:1542 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1526 +#: ../../library/curses.rst:1544 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1528 +#: ../../library/curses.rst:1546 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1530 +#: ../../library/curses.rst:1548 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1532 +#: ../../library/curses.rst:1550 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1534 +#: ../../library/curses.rst:1552 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1536 +#: ../../library/curses.rst:1554 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1538 +#: ../../library/curses.rst:1556 msgid "Save" msgstr "" -#: ../../library/curses.rst:1540 +#: ../../library/curses.rst:1558 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1542 +#: ../../library/curses.rst:1560 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1544 +#: ../../library/curses.rst:1562 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1546 +#: ../../library/curses.rst:1564 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1548 +#: ../../library/curses.rst:1566 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1550 +#: ../../library/curses.rst:1568 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1552 +#: ../../library/curses.rst:1570 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1554 +#: ../../library/curses.rst:1572 msgid "Select" msgstr "" -#: ../../library/curses.rst:1556 +#: ../../library/curses.rst:1574 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1558 +#: ../../library/curses.rst:1576 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1560 +#: ../../library/curses.rst:1578 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1562 +#: ../../library/curses.rst:1580 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1564 +#: ../../library/curses.rst:1582 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1566 +#: ../../library/curses.rst:1584 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1568 +#: ../../library/curses.rst:1586 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1570 +#: ../../library/curses.rst:1588 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1572 +#: ../../library/curses.rst:1590 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1574 +#: ../../library/curses.rst:1592 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1576 +#: ../../library/curses.rst:1594 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1578 +#: ../../library/curses.rst:1596 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1580 +#: ../../library/curses.rst:1598 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1582 +#: ../../library/curses.rst:1600 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1584 +#: ../../library/curses.rst:1602 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1586 +#: ../../library/curses.rst:1604 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1588 +#: ../../library/curses.rst:1606 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1590 +#: ../../library/curses.rst:1608 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1592 +#: ../../library/curses.rst:1610 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1594 +#: ../../library/curses.rst:1612 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1596 +#: ../../library/curses.rst:1614 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1598 +#: ../../library/curses.rst:1616 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1600 +#: ../../library/curses.rst:1618 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1602 +#: ../../library/curses.rst:1620 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1604 +#: ../../library/curses.rst:1622 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1606 +#: ../../library/curses.rst:1624 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1627 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2005,64 +2023,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1618 +#: ../../library/curses.rst:1636 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1618 ../../library/curses.rst:1761 -#: ../../library/curses.rst:1885 +#: ../../library/curses.rst:1636 ../../library/curses.rst:1779 +#: ../../library/curses.rst:1903 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1620 +#: ../../library/curses.rst:1638 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1620 +#: ../../library/curses.rst:1638 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1622 +#: ../../library/curses.rst:1640 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1622 +#: ../../library/curses.rst:1640 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1624 +#: ../../library/curses.rst:1642 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1624 +#: ../../library/curses.rst:1642 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1626 +#: ../../library/curses.rst:1644 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1626 +#: ../../library/curses.rst:1644 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1628 +#: ../../library/curses.rst:1646 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1628 +#: ../../library/curses.rst:1646 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1630 +#: ../../library/curses.rst:1648 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1630 +#: ../../library/curses.rst:1648 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1651 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2070,268 +2088,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1640 +#: ../../library/curses.rst:1658 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1661 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1645 +#: ../../library/curses.rst:1663 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1647 +#: ../../library/curses.rst:1665 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1649 +#: ../../library/curses.rst:1667 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1651 +#: ../../library/curses.rst:1669 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1653 +#: ../../library/curses.rst:1671 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1655 +#: ../../library/curses.rst:1673 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1657 +#: ../../library/curses.rst:1675 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1659 +#: ../../library/curses.rst:1677 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1661 +#: ../../library/curses.rst:1679 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1681 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1683 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1685 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1687 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1689 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1691 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1675 +#: ../../library/curses.rst:1693 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1677 +#: ../../library/curses.rst:1695 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1679 +#: ../../library/curses.rst:1697 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1681 +#: ../../library/curses.rst:1699 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1683 +#: ../../library/curses.rst:1701 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1685 +#: ../../library/curses.rst:1703 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1687 +#: ../../library/curses.rst:1705 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1689 +#: ../../library/curses.rst:1707 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1691 +#: ../../library/curses.rst:1709 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1693 +#: ../../library/curses.rst:1711 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1695 +#: ../../library/curses.rst:1713 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1697 +#: ../../library/curses.rst:1715 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1699 +#: ../../library/curses.rst:1717 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1701 +#: ../../library/curses.rst:1719 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1703 +#: ../../library/curses.rst:1721 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1705 +#: ../../library/curses.rst:1723 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1707 +#: ../../library/curses.rst:1725 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1709 +#: ../../library/curses.rst:1727 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1711 +#: ../../library/curses.rst:1729 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1713 +#: ../../library/curses.rst:1731 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1715 +#: ../../library/curses.rst:1733 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1717 +#: ../../library/curses.rst:1735 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1719 +#: ../../library/curses.rst:1737 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1721 +#: ../../library/curses.rst:1739 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1723 +#: ../../library/curses.rst:1741 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1725 +#: ../../library/curses.rst:1743 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1727 +#: ../../library/curses.rst:1745 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1729 +#: ../../library/curses.rst:1747 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1750 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1735 +#: ../../library/curses.rst:1753 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1737 +#: ../../library/curses.rst:1755 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1739 +#: ../../library/curses.rst:1757 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1741 +#: ../../library/curses.rst:1759 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1743 +#: ../../library/curses.rst:1761 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1745 +#: ../../library/curses.rst:1763 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1747 +#: ../../library/curses.rst:1765 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1749 ../../library/curses.rst:1751 +#: ../../library/curses.rst:1767 ../../library/curses.rst:1769 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1758 +#: ../../library/curses.rst:1776 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1779 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1763 +#: ../../library/curses.rst:1781 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1765 +#: ../../library/curses.rst:1783 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1767 +#: ../../library/curses.rst:1785 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1769 +#: ../../library/curses.rst:1787 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1771 +#: ../../library/curses.rst:1789 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1773 +#: ../../library/curses.rst:1791 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1775 +#: ../../library/curses.rst:1793 msgid "White" msgstr "白" -#: ../../library/curses.rst:1777 +#: ../../library/curses.rst:1795 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1782 +#: ../../library/curses.rst:1800 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1790 +#: ../../library/curses.rst:1808 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2341,11 +2359,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1796 +#: ../../library/curses.rst:1814 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1801 +#: ../../library/curses.rst:1819 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2357,15 +2375,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1832 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1834 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1821 +#: ../../library/curses.rst:1839 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2374,11 +2392,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1845 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1832 +#: ../../library/curses.rst:1850 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2389,167 +2407,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1843 +#: ../../library/curses.rst:1861 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1847 ../../library/curses.rst:1885 +#: ../../library/curses.rst:1865 ../../library/curses.rst:1903 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1847 +#: ../../library/curses.rst:1865 msgid "Action" msgstr "" -#: ../../library/curses.rst:1849 +#: ../../library/curses.rst:1867 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1849 +#: ../../library/curses.rst:1867 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1851 ../../library/curses.rst:1887 +#: ../../library/curses.rst:1869 ../../library/curses.rst:1905 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1851 +#: ../../library/curses.rst:1869 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1872 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1854 +#: ../../library/curses.rst:1872 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1856 +#: ../../library/curses.rst:1874 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1856 +#: ../../library/curses.rst:1874 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1859 ../../library/curses.rst:1889 +#: ../../library/curses.rst:1877 ../../library/curses.rst:1907 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1877 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1880 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1862 +#: ../../library/curses.rst:1880 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1882 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1882 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1866 +#: ../../library/curses.rst:1884 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1866 +#: ../../library/curses.rst:1884 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1887 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1887 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1890 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1890 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1874 ../../library/curses.rst:1893 +#: ../../library/curses.rst:1892 ../../library/curses.rst:1911 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1874 +#: ../../library/curses.rst:1892 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1876 +#: ../../library/curses.rst:1894 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1876 +#: ../../library/curses.rst:1894 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1878 ../../library/curses.rst:1891 +#: ../../library/curses.rst:1896 ../../library/curses.rst:1909 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1878 +#: ../../library/curses.rst:1896 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1881 +#: ../../library/curses.rst:1899 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1887 +#: ../../library/curses.rst:1905 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1889 +#: ../../library/curses.rst:1907 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1891 +#: ../../library/curses.rst:1909 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1893 +#: ../../library/curses.rst:1911 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1895 +#: ../../library/curses.rst:1913 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1895 +#: ../../library/curses.rst:1913 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1916 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1904 +#: ../../library/curses.rst:1922 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1910 +#: ../../library/curses.rst:1928 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/devmode.po b/library/devmode.po index f0348677ba..afd4426b90 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -177,7 +177,7 @@ msgstr "" #: ../../library/devmode.rst:84 msgid "" -"Set the :attr:`~sys.flags.dev_mode` attribute of :attr:`sys.flags` to " +"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" diff --git a/library/dis.po b/library/dis.po index a032f7294f..73254c868c 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -776,8 +776,8 @@ msgstr "" #: ../../library/dis.rst:820 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " -"more technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :" -"c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " +"more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " +"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" @@ -785,7 +785,7 @@ msgstr "" msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " -"more technically: if it has the :const:`Py_TPFLAGS_SEQUENCE` flag set in " +"more technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in " "its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" diff --git a/library/email.utils.po b/library/email.utils.po index 9a4477fbd0..74b695635d 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-21 09:32+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-" @@ -90,14 +90,7 @@ msgid "" "unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned." msgstr "" -#: ../../library/email.utils.rst:68 -msgid "" -"For security reasons, addresses that were ambiguous and could parse into " -"multiple different addresses now cause ``('', '')`` to be returned instead " -"of only one of the *potential* addresses." -msgstr "" - -#: ../../library/email.utils.rst:76 +#: ../../library/email.utils.rst:71 msgid "" "The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " "``(realname, email_address)`` and returns the string value suitable for a :" @@ -105,7 +98,7 @@ msgid "" "is false, then the second element is returned unmodified." msgstr "" -#: ../../library/email.utils.rst:81 +#: ../../library/email.utils.rst:76 msgid "" "Optional *charset* is the character set that will be used in the :rfc:`2047` " "encoding of the ``realname`` if the ``realname`` contains non-ASCII " @@ -113,49 +106,19 @@ msgid "" "Charset`. Defaults to ``utf-8``." msgstr "" -#: ../../library/email.utils.rst:86 +#: ../../library/email.utils.rst:81 msgid "Added the *charset* option." msgstr "新增 *charset* 選項。" -#: ../../library/email.utils.rst:92 +#: ../../library/email.utils.rst:87 msgid "" "This method returns a list of 2-tuples of the form returned by " "``parseaddr()``. *fieldvalues* is a sequence of header field values as might " "be returned by :meth:`Message.get_all `. " -"Here's a simple example that gets all the recipients of a message:" -msgstr "" - -#: ../../library/email.utils.rst:97 -msgid "from email.utils import getaddresses" -msgstr "" - -#: ../../library/email.utils.rst:99 -msgid "" -"tos = msg.get_all('to', []) ccs = msg.get_all('cc', []) resent_tos = msg." -"get_all('resent-to', []) resent_ccs = msg.get_all('resent-cc', []) " -"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" -msgstr "" - -#: ../../library/email.utils.rst:105 -msgid "" -"When parsing fails for a single fieldvalue, a 2-tuple of ``('', '')`` is " -"returned in its place. Other errors in parsing the list of addresses such " -"as a fieldvalue seemingly parsing into multiple addresses may result in a " -"list containing a single empty 2-tuple ``[('', '')]`` being returned rather " -"than returning potentially invalid output." -msgstr "" - -#: ../../library/email.utils.rst:112 -msgid "Example malformed input parsing:" -msgstr "" - -#: ../../library/email.utils.rst:120 -msgid "" -"The 2-tuple of ``('', '')`` in the returned values when parsing fails were " -"added as to address a security issue." +"Here's a simple example that gets all the recipients of a message::" msgstr "" -#: ../../library/email.utils.rst:127 +#: ../../library/email.utils.rst:103 msgid "" "Attempts to parse a date according to the rules in :rfc:`2822`. however, " "some mailers don't follow that format as specified, so :func:`parsedate` " @@ -166,7 +129,7 @@ msgid "" "returned. Note that indexes 6, 7, and 8 of the result tuple are not usable." msgstr "" -#: ../../library/email.utils.rst:138 +#: ../../library/email.utils.rst:114 msgid "" "Performs the same function as :func:`parsedate`, but returns either ``None`` " "or a 10-tuple; the first 9 elements make up a tuple that can be passed " @@ -177,7 +140,7 @@ msgid "" "the result tuple are not usable." msgstr "" -#: ../../library/email.utils.rst:148 +#: ../../library/email.utils.rst:124 msgid "" "The inverse of :func:`format_datetime`. Performs the same function as :func:" "`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise " @@ -191,25 +154,25 @@ msgid "" "corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." msgstr "" -#: ../../library/email.utils.rst:164 +#: ../../library/email.utils.rst:140 msgid "" "Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp " "(seconds since the Epoch). If the timezone item in the tuple is ``None``, " "assume local time." msgstr "" -#: ../../library/email.utils.rst:171 +#: ../../library/email.utils.rst:147 msgid "Returns a date string as per :rfc:`2822`, e.g.::" msgstr "" -#: ../../library/email.utils.rst:175 +#: ../../library/email.utils.rst:151 msgid "" "Optional *timeval* if given is a floating point time value as accepted by :" "func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " "used." msgstr "" -#: ../../library/email.utils.rst:179 +#: ../../library/email.utils.rst:155 msgid "" "Optional *localtime* is a flag that when ``True``, interprets *timeval*, and " "returns a date relative to the local timezone instead of UTC, properly " @@ -217,7 +180,7 @@ msgid "" "UTC is used." msgstr "" -#: ../../library/email.utils.rst:184 +#: ../../library/email.utils.rst:160 msgid "" "Optional *usegmt* is a flag that when ``True``, outputs a date string with " "the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. " @@ -225,7 +188,7 @@ msgid "" "*localtime* is ``False``. The default is ``False``." msgstr "" -#: ../../library/email.utils.rst:192 +#: ../../library/email.utils.rst:168 msgid "" "Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is " "a naive datetime, it is assumed to be \"UTC with no information about the " @@ -237,11 +200,11 @@ msgid "" "date headers." msgstr "" -#: ../../library/email.utils.rst:206 +#: ../../library/email.utils.rst:182 msgid "Decode the string *s* according to :rfc:`2231`." msgstr "" -#: ../../library/email.utils.rst:211 +#: ../../library/email.utils.rst:187 msgid "" "Encode the string *s* according to :rfc:`2231`. Optional *charset* and " "*language*, if given is the character set name and language name to use. If " @@ -250,7 +213,7 @@ msgid "" "*language*." msgstr "" -#: ../../library/email.utils.rst:219 +#: ../../library/email.utils.rst:195 msgid "" "When a header parameter is encoded in :rfc:`2231` format, :meth:`Message." "get_param ` may return a 3-tuple containing " @@ -262,23 +225,23 @@ msgid "" "defaults to ``'us-ascii'``." msgstr "" -#: ../../library/email.utils.rst:228 +#: ../../library/email.utils.rst:204 msgid "" "For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is " "not a tuple, it should be a string and it is returned unquoted." msgstr "" -#: ../../library/email.utils.rst:234 +#: ../../library/email.utils.rst:210 msgid "" "Decode parameters list according to :rfc:`2231`. *params* is a sequence of " "2-tuples containing elements of the form ``(content-type, string-value)``." msgstr "" -#: ../../library/email.utils.rst:239 +#: ../../library/email.utils.rst:215 msgid "Footnotes" msgstr "註解" -#: ../../library/email.utils.rst:240 +#: ../../library/email.utils.rst:216 msgid "" "Note that the sign of the timezone offset is the opposite of the sign of the " "``time.timezone`` variable for the same timezone; the latter variable " diff --git a/library/exceptions.po b/library/exceptions.po index 97ba6b680b..ffbb21c128 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-06 16:53+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -762,9 +762,9 @@ msgstr "" #: ../../library/exceptions.rst:660 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" -"blocking operation. Corresponds to :c:data:`errno` :py:data:`~errno." -"EAGAIN`, :py:data:`~errno.EALREADY`, :py:data:`~errno.EWOULDBLOCK` and :py:" -"data:`~errno.EINPROGRESS`." +"blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." +"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" +"const:`~errno.EINPROGRESS`." msgstr "" #: ../../library/exceptions.rst:665 @@ -783,7 +783,7 @@ msgstr "" #: ../../library/exceptions.rst:676 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" -"`errno` :py:data:`~errno.ECHILD`." +"`errno` :py:const:`~errno.ECHILD`." msgstr "" #: ../../library/exceptions.rst:681 @@ -800,46 +800,46 @@ msgstr "" msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " -"has been shutdown for writing. Corresponds to :c:data:`errno` :py:data:" -"`~errno.EPIPE` and :py:data:`~errno.ESHUTDOWN`." +"has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" +"`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" #: ../../library/exceptions.rst:695 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"aborted by the peer. Corresponds to :c:data:`errno` :py:data:`~errno." +"aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" #: ../../library/exceptions.rst:701 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"refused by the peer. Corresponds to :c:data:`errno` :py:data:`~errno." +"refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" #: ../../library/exceptions.rst:707 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " -"the peer. Corresponds to :c:data:`errno` :py:data:`~errno.ECONNRESET`." +"the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" #: ../../library/exceptions.rst:713 msgid "" "Raised when trying to create a file or directory which already exists. " -"Corresponds to :c:data:`errno` :py:data:`~errno.EEXIST`." +"Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" #: ../../library/exceptions.rst:718 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " -"to :c:data:`errno` :py:data:`~errno.ENOENT`." +"to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" #: ../../library/exceptions.rst:723 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " -"to :c:data:`errno` :py:data:`~errno.EINTR`." +"to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" #: ../../library/exceptions.rst:726 @@ -852,7 +852,7 @@ msgstr "" #: ../../library/exceptions.rst:733 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " -"directory. Corresponds to :c:data:`errno` :py:data:`~errno.EISDIR`." +"directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" #: ../../library/exceptions.rst:739 @@ -860,32 +860,34 @@ msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " "be raised if an operation attempts to open or traverse a non-directory file " -"as if it were a directory. Corresponds to :c:data:`errno` :py:data:`~errno." +"as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." "ENOTDIR`." msgstr "" #: ../../library/exceptions.rst:747 msgid "" "Raised when trying to run an operation without the adequate access rights - " -"for example filesystem permissions. Corresponds to :c:data:`errno` :py:data:" -"`~errno.EACCES`, :py:data:`~errno.EPERM`, and :py:data:`~errno.ENOTCAPABLE`." +"for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" +"`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno." +"ENOTCAPABLE`." msgstr "" #: ../../library/exceptions.rst:752 msgid "" -"WASI's :py:data:`~errno.ENOTCAPABLE` is now mapped to :exc:`PermissionError`." +"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" +"`PermissionError`." msgstr "" #: ../../library/exceptions.rst:758 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" -"py:data:`~errno.ESRCH`." +"py:const:`~errno.ESRCH`." msgstr "" #: ../../library/exceptions.rst:763 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" -"c:data:`errno` :py:data:`~errno.ETIMEDOUT`." +"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" #: ../../library/exceptions.rst:766 diff --git a/library/fcntl.po b/library/fcntl.po index ceb8def68d..2265fdcd2c 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -259,16 +259,16 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:175 -msgid ":const:`0` -- relative to the start of the file (:data:`os.SEEK_SET`)" +msgid ":const:`0` -- relative to the start of the file (:const:`os.SEEK_SET`)" msgstr "" #: ../../library/fcntl.rst:176 msgid "" -":const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)" +":const:`1` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" msgstr "" #: ../../library/fcntl.rst:177 -msgid ":const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)" +msgid ":const:`2` -- relative to the end of the file (:const:`os.SEEK_END`)" msgstr "" #: ../../library/fcntl.rst:179 @@ -304,7 +304,7 @@ msgstr ":mod:`os` 模組" #: ../../library/fcntl.rst:204 msgid "" -"If the locking flags :data:`~os.O_SHLOCK` and :data:`~os.O_EXLOCK` are " +"If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " "provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" diff --git a/library/filecmp.po b/library/filecmp.po index 1bafdd047c..3c06eb4bb2 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -112,7 +112,7 @@ msgstr "" #: ../../library/filecmp.rst:75 msgid "" "Construct a new directory comparison object, to compare the directories *a* " -"and *b*. *ignore* is a list of names to ignore, and defaults to :attr:" +"and *b*. *ignore* is a list of names to ignore, and defaults to :const:" "`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " "to ``[os.curdir, os.pardir]``." msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index e2b5ae2e73..17e9b01527 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -129,10 +129,10 @@ msgstr "" #: ../../library/ftplib.rst:105 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" "該類別現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " -"Indication* 進行主機名 (hostname) 檢查(參見 :data:`ssl.HAS_SNI`)。" +"Indication* 進行主機名 (hostname) 檢查(參見 :const:`ssl.HAS_SNI`)。" #: ../../library/ftplib.rst:116 msgid "The deprecated *keyfile* and *certfile* parameters have been removed." @@ -551,8 +551,8 @@ msgid "" msgstr ":class:`FTP_TLS` 類別繼承自 :class:`FTP`,並另外定義了這些的物件:" #: ../../library/ftplib.rst:434 -msgid "The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`)." -msgstr "要使用的 SSL 版本(預設為 :attr:`ssl.PROTOCOL_SSLv23`)。" +msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." +msgstr "要使用的 SSL 版本(預設為 :data:`ssl.PROTOCOL_SSLv23`)。" #: ../../library/ftplib.rst:438 msgid "" @@ -564,10 +564,10 @@ msgstr "" #: ../../library/ftplib.rst:441 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" "該方法現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " -"Indication* 進行主機名檢查(參見 :data:`ssl.HAS_SNI`)。" +"Indication* 進行主機名檢查(參見 :const:`ssl.HAS_SNI`)。" #: ../../library/ftplib.rst:448 msgid "" diff --git a/library/functions.po b/library/functions.po index 7f2d0316c4..855f6a80f4 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-09 00:21+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2107,8 +2107,8 @@ msgstr "" 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 " -"size\" and falling back on :attr:`io.DEFAULT_BUFFER_SIZE`. On many systems, " -"the buffer will typically be 4096 or 8192 bytes long." +"size\" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many " +"systems, the buffer will typically be 4096 or 8192 bytes long." msgstr "" #: ../../library/functions.rst:1237 diff --git a/library/gc.po b/library/gc.po index 9686a08b20..94e621c177 100644 --- a/library/gc.po +++ b/library/gc.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -367,10 +367,10 @@ msgstr "" #: ../../library/gc.rst:261 msgid "" "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " -"end up in :attr:`gc.garbage` anymore." +"end up in :data:`gc.garbage` anymore." msgstr "" -"根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會在 :attr:`gc." -"garbage` 內。" +"根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會在 :data:" +"`gc.garbage` 內。" #: ../../library/gc.rst:267 msgid "" diff --git a/library/gettext.po b/library/gettext.po index 87ff788d99..1b56ff954e 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -493,11 +493,11 @@ msgid "" "is not currently supported." msgstr "" -#: ../../library/gettext.rst:416 +#: ../../library/gettext.rst:417 msgid "Internationalizing your programs and modules" msgstr "" -#: ../../library/gettext.rst:418 +#: ../../library/gettext.rst:419 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -506,26 +506,26 @@ msgid "" "Python programs, you need to take the following steps:" msgstr "" -#: ../../library/gettext.rst:424 +#: ../../library/gettext.rst:425 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" -#: ../../library/gettext.rst:426 +#: ../../library/gettext.rst:427 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" -#: ../../library/gettext.rst:428 +#: ../../library/gettext.rst:429 msgid "create language-specific translations of the message catalogs" msgstr "" -#: ../../library/gettext.rst:430 +#: ../../library/gettext.rst:431 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" -#: ../../library/gettext.rst:432 +#: ../../library/gettext.rst:433 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " @@ -533,14 +533,14 @@ msgid "" "For example::" msgstr "" -#: ../../library/gettext.rst:441 +#: ../../library/gettext.rst:442 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " "not." msgstr "" -#: ../../library/gettext.rst:444 +#: ../../library/gettext.rst:445 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " @@ -553,7 +553,7 @@ msgid "" "utils>`__." msgstr "" -#: ../../library/gettext.rst:454 +#: ../../library/gettext.rst:455 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -566,7 +566,7 @@ msgid "" "GNU :program:`gettext` package to internationalize your Python applications.)" msgstr "" -#: ../../library/gettext.rst:466 +#: ../../library/gettext.rst:467 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -574,7 +574,7 @@ msgid "" "placeholder for the translated versions of these strings." msgstr "" -#: ../../library/gettext.rst:472 +#: ../../library/gettext.rst:473 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -585,25 +585,25 @@ msgid "" "processing at run-time." msgstr "" -#: ../../library/gettext.rst:481 +#: ../../library/gettext.rst:482 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" -#: ../../library/gettext.rst:487 +#: ../../library/gettext.rst:488 msgid "Localizing your module" msgstr "" -#: ../../library/gettext.rst:489 +#: ../../library/gettext.rst:490 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" "`gettext` API but instead the class-based API." msgstr "" -#: ../../library/gettext.rst:493 +#: ../../library/gettext.rst:494 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -611,11 +611,11 @@ msgid "" "your module::" msgstr "" -#: ../../library/gettext.rst:504 +#: ../../library/gettext.rst:505 msgid "Localizing your application" msgstr "" -#: ../../library/gettext.rst:506 +#: ../../library/gettext.rst:507 msgid "" "If you are localizing your application, you can install the :func:`_` " "function globally into the built-in namespace, usually in the main driver " @@ -623,52 +623,52 @@ msgid "" "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" -#: ../../library/gettext.rst:511 +#: ../../library/gettext.rst:512 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" msgstr "" -#: ../../library/gettext.rst:517 +#: ../../library/gettext.rst:518 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -#: ../../library/gettext.rst:525 +#: ../../library/gettext.rst:526 msgid "Changing languages on the fly" msgstr "" -#: ../../library/gettext.rst:527 +#: ../../library/gettext.rst:528 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " "explicitly, like so::" msgstr "" -#: ../../library/gettext.rst:548 +#: ../../library/gettext.rst:549 msgid "Deferred translations" msgstr "" -#: ../../library/gettext.rst:550 +#: ../../library/gettext.rst:551 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " "actual translation until later. A classic example is::" msgstr "" -#: ../../library/gettext.rst:563 +#: ../../library/gettext.rst:564 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " "printed." msgstr "" -#: ../../library/gettext.rst:567 +#: ../../library/gettext.rst:568 msgid "Here is one way you can handle this situation::" msgstr "" -#: ../../library/gettext.rst:583 +#: ../../library/gettext.rst:584 msgid "" "This works because the dummy definition of :func:`_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " @@ -677,18 +677,18 @@ msgid "" "in the local namespace." msgstr "" -#: ../../library/gettext.rst:589 +#: ../../library/gettext.rst:590 msgid "" "Note that the second use of :func:`_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" -#: ../../library/gettext.rst:593 +#: ../../library/gettext.rst:594 msgid "Another way to handle this is with the following example::" msgstr "" -#: ../../library/gettext.rst:607 +#: ../../library/gettext.rst:608 msgid "" "In this case, you are marking translatable strings with the function :func:" "`N_`, which won't conflict with any definition of :func:`_`. However, you " @@ -700,54 +700,54 @@ msgid "" "`MarkThisStringForTranslation`." msgstr "" -#: ../../library/gettext.rst:618 +#: ../../library/gettext.rst:619 msgid "Acknowledgements" msgstr "致謝" -#: ../../library/gettext.rst:620 +#: ../../library/gettext.rst:621 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " "module:" msgstr "" -#: ../../library/gettext.rst:623 +#: ../../library/gettext.rst:624 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:625 +#: ../../library/gettext.rst:626 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:627 +#: ../../library/gettext.rst:628 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:629 +#: ../../library/gettext.rst:630 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:631 +#: ../../library/gettext.rst:632 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:633 +#: ../../library/gettext.rst:634 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:635 +#: ../../library/gettext.rst:636 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:637 +#: ../../library/gettext.rst:638 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:640 +#: ../../library/gettext.rst:641 msgid "Footnotes" msgstr "註解" -#: ../../library/gettext.rst:641 +#: ../../library/gettext.rst:642 msgid "" "The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -758,7 +758,7 @@ msgid "" "your application." msgstr "" -#: ../../library/gettext.rst:649 +#: ../../library/gettext.rst:650 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" diff --git a/library/gzip.po b/library/gzip.po index f9a8fa3e00..80a6709760 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -358,7 +358,7 @@ msgid "Command line options" msgstr "" #: ../../library/gzip.rst:271 -msgid "If *file* is not specified, read from :attr:`sys.stdin`." +msgid "If *file* is not specified, read from :data:`sys.stdin`." msgstr "" #: ../../library/gzip.rst:275 diff --git a/library/http.client.po b/library/http.client.po index 4824089cc6..145e6f5ac7 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,7 +112,7 @@ msgstr "新增 *source_address*\\ 、\\ *context* 與 *check_hostname*\\ 。" #: ../../library/http.client.rst:84 msgid "" -"This class now supports HTTPS virtual hosts if possible (that is, if :data:" +"This class now supports HTTPS virtual hosts if possible (that is, if :const:" "`ssl.HAS_SNI` is true)." msgstr "" diff --git a/library/imaplib.po b/library/imaplib.po index 2c06a0a901..c4cd78ee53 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -133,7 +133,7 @@ msgstr "新增 *ssl_context* 參數。" #: ../../library/imaplib.rst:106 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:114 @@ -563,7 +563,7 @@ msgstr "" #: ../../library/imaplib.rst:503 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/imaplib.rst:511 diff --git a/library/importlib.po b/library/importlib.po index ba9020799b..0d8ed9706a 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -531,7 +531,7 @@ msgstr ":attr:`__path__`" msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The import system passes this attribute " -"to ``__import__()`` and to finders in the same way as :attr:`sys.path` but " +"to ``__import__()`` and to finders in the same way as :data:`sys.path` but " "just for the package. It is not set on non-package modules so it can be used " "as an indicator that the module is a package." msgstr "" @@ -817,7 +817,7 @@ msgstr "" #: ../../library/importlib.rst:611 msgid "" -"When writing to the path fails because the path is read-only (:attr:`errno." +"When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" @@ -1050,7 +1050,7 @@ msgstr "" #: ../../library/importlib.rst:846 msgid "" -"A class method which returns a closure for use on :attr:`sys.path_hooks`. An " +"A class method which returns a closure for use on :data:`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 "" @@ -1391,10 +1391,10 @@ msgstr "" #: ../../library/importlib.rst:1186 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " -"specified **package** name. If the module is in :attr:`sys.modules`, then " +"specified **package** name. If the module is in :data:`sys.modules`, then " "``sys.modules[name].__spec__`` is returned (unless the spec would be " "``None`` or is not set, in which case :exc:`ValueError` is raised). " -"Otherwise a search using :attr:`sys.meta_path` is done. ``None`` is returned " +"Otherwise a search using :data:`sys.meta_path` is done. ``None`` is returned " "if no spec is found." msgstr "" @@ -1473,7 +1473,7 @@ msgid "" "is required. For those same reasons, the loader's :meth:`~importlib.abc." "Loader.create_module` method must return ``None`` or a type for which its " "``__class__`` attribute can be mutated along with not using :term:`slots " -"<__slots__>`. Finally, modules which substitute the object placed into :attr:" +"<__slots__>`. Finally, modules which substitute the object placed into :data:" "`sys.modules` will not work as there is no way to properly replace the " "module references throughout the interpreter safely; :exc:`ValueError` is " "raised if such a substitution is detected." @@ -1557,9 +1557,9 @@ msgid "" "`importer`. This means managing both the :term:`finder` and :term:`loader` " "side of things. For finders there are two flavours to choose from depending " "on your needs: a :term:`meta path finder` or a :term:`path entry finder`. " -"The former is what you would put on :attr:`sys.meta_path` while the latter " -"is what you create using a :term:`path entry hook` on :attr:`sys.path_hooks` " -"which works with :attr:`sys.path` entries to potentially create a finder. " +"The former is what you would put on :data:`sys.meta_path` while the latter " +"is what you create using a :term:`path entry hook` on :data:`sys.path_hooks` " +"which works with :data:`sys.path` entries to potentially create a finder. " "This example will show you how to register your own importers so that import " "will use them (for creating an importer for yourself, read the documentation " "for the appropriate classes defined within this package)::" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 887ad7dcb9..46767be528 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -163,7 +163,7 @@ msgstr "" #: ../../library/importlib.resources.abc.rst:132 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" -"attr:`io.TextIOWrapper`." +"class:`io.TextIOWrapper`." msgstr "" #: ../../library/importlib.resources.abc.rst:137 diff --git a/library/io.po b/library/io.po index e75d35ee1e..be5adcfaa4 100644 --- a/library/io.po +++ b/library/io.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2023-07-18 21:30+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"PO-Revision-Date: 2023-07-17 17:38+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -655,9 +655,9 @@ msgstr "" #: ../../library/io.rst:424 msgid "" -"Some operating systems could support additional values, like :data:`os." -"SEEK_HOLE` or :data:`os.SEEK_DATA`. The valid values for a file could depend " -"on it being open in text or binary mode." +"Some operating systems could support additional values, like :const:`os." +"SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " +"depend on it being open in text or binary mode." msgstr "" #: ../../library/io.rst:431 diff --git a/library/json.po b/library/json.po index c883f53a92..9871a67314 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -773,7 +773,7 @@ msgstr "" #: ../../library/json.rst:685 msgid "" "If the optional ``infile`` and ``outfile`` arguments are not specified, :" -"attr:`sys.stdin` and :attr:`sys.stdout` will be used respectively:" +"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" msgstr "" #: ../../library/json.rst:697 @@ -791,13 +791,13 @@ msgid "The JSON file to be validated or pretty-printed:" msgstr "" #: ../../library/json.rst:724 -msgid "If *infile* is not specified, read from :attr:`sys.stdin`." +msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "" #: ../../library/json.rst:728 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " -"to :attr:`sys.stdout`." +"to :data:`sys.stdout`." msgstr "" #: ../../library/json.rst:733 diff --git a/library/logging.handlers.po b/library/logging.handlers.po index ad5fc3e568..4849fe343f 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-23 00:04+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-" @@ -1308,17 +1308,18 @@ msgstr "" #: ../../library/logging.handlers.rst:920 msgid "" -"You can override this to implement custom flushing behavior. This version " -"just zaps the buffer to empty." +"For a :class:`BufferingHandler` instance, flushing means that it sets the " +"buffer to an empty list. This method can be overwritten to implement more " +"useful flushing behavior." msgstr "" -#: ../../library/logging.handlers.rst:926 +#: ../../library/logging.handlers.rst:927 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:932 +#: ../../library/logging.handlers.rst:933 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1330,41 +1331,42 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:941 +#: ../../library/logging.handlers.rst:942 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:947 +#: ../../library/logging.handlers.rst:948 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:953 +#: ../../library/logging.handlers.rst:954 msgid "" -"For a :class:`MemoryHandler`, flushing means just sending the buffered " -"records to the target, if there is one. The buffer is also cleared when this " -"happens. Override if you want different behavior." +"For a :class:`MemoryHandler` instance, flushing means just sending the " +"buffered records to the target, if there is one. The buffer is also cleared " +"when buffered records are sent to the target. Override if you want different " +"behavior." msgstr "" -#: ../../library/logging.handlers.rst:960 +#: ../../library/logging.handlers.rst:961 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:965 +#: ../../library/logging.handlers.rst:966 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:971 +#: ../../library/logging.handlers.rst:972 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:973 +#: ../../library/logging.handlers.rst:974 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:980 +#: ../../library/logging.handlers.rst:981 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1378,11 +1380,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:991 +#: ../../library/logging.handlers.rst:992 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:996 +#: ../../library/logging.handlers.rst:997 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1391,14 +1393,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:1004 +#: ../../library/logging.handlers.rst:1005 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:1008 +#: ../../library/logging.handlers.rst:1009 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1408,18 +1410,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:1021 +#: ../../library/logging.handlers.rst:1022 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1025 +#: ../../library/logging.handlers.rst:1026 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1029 +#: ../../library/logging.handlers.rst:1030 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1429,7 +1431,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1038 +#: ../../library/logging.handlers.rst:1039 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1439,30 +1441,30 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1045 -#: ../../library/logging.handlers.rst:1134 +#: ../../library/logging.handlers.rst:1046 +#: ../../library/logging.handlers.rst:1135 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1050 +#: ../../library/logging.handlers.rst:1051 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." "handleError` method is called to handle the error. This can result in the " -"record silently being dropped (if :attr:`logging.raiseExceptions` is " -"``False``) or a message printed to ``sys.stderr`` (if :attr:`logging." +"record silently being dropped (if :data:`logging.raiseExceptions` is " +"``False``) or a message printed to ``sys.stderr`` (if :data:`logging." "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1059 +#: ../../library/logging.handlers.rst:1060 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1062 +#: ../../library/logging.handlers.rst:1063 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1472,14 +1474,14 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1070 +#: ../../library/logging.handlers.rst:1071 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1074 +#: ../../library/logging.handlers.rst:1075 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " @@ -1495,25 +1497,25 @@ msgid "" "libraries that you use.)" msgstr "" -#: ../../library/logging.handlers.rst:1090 +#: ../../library/logging.handlers.rst:1091 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1096 +#: ../../library/logging.handlers.rst:1097 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1105 +#: ../../library/logging.handlers.rst:1106 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1109 +#: ../../library/logging.handlers.rst:1110 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1524,7 +1526,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1117 +#: ../../library/logging.handlers.rst:1118 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1534,7 +1536,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1126 +#: ../../library/logging.handlers.rst:1127 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1545,7 +1547,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1137 +#: ../../library/logging.handlers.rst:1138 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1553,82 +1555,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1142 +#: ../../library/logging.handlers.rst:1143 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1147 +#: ../../library/logging.handlers.rst:1148 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1149 +#: ../../library/logging.handlers.rst:1150 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1155 +#: ../../library/logging.handlers.rst:1156 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1157 +#: ../../library/logging.handlers.rst:1158 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1163 +#: ../../library/logging.handlers.rst:1164 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1165 +#: ../../library/logging.handlers.rst:1166 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1171 +#: ../../library/logging.handlers.rst:1172 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1173 +#: ../../library/logging.handlers.rst:1174 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1178 +#: ../../library/logging.handlers.rst:1179 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1180 +#: ../../library/logging.handlers.rst:1181 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1186 +#: ../../library/logging.handlers.rst:1187 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1197 +#: ../../library/logging.handlers.rst:1198 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1197 +#: ../../library/logging.handlers.rst:1198 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1199 +#: ../../library/logging.handlers.rst:1200 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1200 +#: ../../library/logging.handlers.rst:1201 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/mailbox.po b/library/mailbox.po index a9f92f7cc2..a8a1eb86e8 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -540,7 +540,7 @@ msgstr "" #: ../../library/mailbox.rst:739 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" -"func:`flock` and :c:func:`lockf` system calls." +"func:`!flock` and :c:func:`!lockf` system calls." msgstr "" #: ../../library/mailbox.rst:486 @@ -665,8 +665,8 @@ msgstr "" #: ../../library/mailbox.rst:590 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" -"func:`flock` and :c:func:`lockf` system calls. For MH mailboxes, locking the " -"mailbox means locking the :file:`.mh_sequences` file and, only for the " +"func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking " +"the mailbox means locking the :file:`.mh_sequences` file and, only for the " "duration of any operations that affect them, locking individual message " "files." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 23b73504cb..9bdd32f856 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -2950,7 +2950,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2710 msgid "" -"When first created the logger has level :data:`logging.NOTSET` and no " +"When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" diff --git a/library/optparse.po b/library/optparse.po index 8cc4650e80..6fb9346cbf 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -922,7 +922,7 @@ msgid "" "help option. When :mod:`optparse` prints the usage string, it expands " "``%prog`` to ``os.path.basename(sys.argv[0])`` (or to ``prog`` if you passed " "that keyword argument). To suppress a usage message, pass the special " -"value :data:`optparse.SUPPRESS_USAGE`." +"value :const:`optparse.SUPPRESS_USAGE`." msgstr "" #: ../../library/optparse.rst:822 @@ -1299,7 +1299,7 @@ msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " "help text is supplied, the option will be listed without help text. To hide " -"this option, use the special value :data:`optparse.SUPPRESS_HELP`." +"this option, use the special value :const:`optparse.SUPPRESS_HELP`." msgstr "" #: ../../library/optparse.rst:1087 @@ -1508,7 +1508,7 @@ msgstr "" msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " -"value :data:`optparse.SUPPRESS_HELP`." +"value :const:`optparse.SUPPRESS_HELP`." msgstr "" #: ../../library/optparse.rst:1255 @@ -1845,7 +1845,7 @@ msgstr "" msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " -"usage string; use :data:`optparse.SUPPRESS_USAGE` to suppress a usage " +"usage string; use :const:`optparse.SUPPRESS_USAGE` to suppress a usage " "message." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index 29ba4e2410..4b7fbe0c1d 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-07-21 12:35+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -540,8 +540,8 @@ msgstr "" "*path* 和 *start* 在不同的驅動機上時,會引發 :exc:`ValueError`。" #: ../../library/os.path.rst:413 -msgid "*start* defaults to :attr:`os.curdir`." -msgstr "*start* 的預設值為 :attr:`os.curdir`。" +msgid "*start* defaults to :data:`os.curdir`." +msgstr "*start* 的預設值為 :data:`os.curdir`。" #: ../../library/os.path.rst:423 msgid "" diff --git a/library/os.po b/library/os.po index 6290d0e4f1..20374949cb 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,7 +99,7 @@ msgstr "" #: ../../library/os.rst:63 msgid "" -":attr:`sys.platform` has a finer granularity. :func:`os.uname` gives system-" +":data:`sys.platform` has a finer granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" @@ -397,7 +397,7 @@ msgstr "" #: ../../library/os.rst:236 msgid "" -":data:`environb` is only available if :data:`supports_bytes_environ` is " +":data:`environb` is only available if :const:`supports_bytes_environ` is " "``True``." msgstr "" @@ -496,7 +496,7 @@ msgstr "" #: ../../library/os.rst:334 msgid "" -":func:`getenvb` is only available if :data:`supports_bytes_environ` is " +":func:`getenvb` is only available if :const:`supports_bytes_environ` is " "``True``." msgstr "" @@ -816,13 +816,13 @@ msgstr "" #: ../../library/os.rst:717 msgid "" -"Call the system call :c:func:`getsid`. See the Unix manual for the " +"Call the system call :c:func:`!getsid`. See the Unix manual for the " "semantics." msgstr "" #: ../../library/os.rst:724 msgid "" -"Call the system call :c:func:`setsid`. See the Unix manual for the " +"Call the system call :c:func:`!setsid`. See the Unix manual for the " "semantics." msgstr "" @@ -833,7 +833,7 @@ msgstr "" #: ../../library/os.rst:741 msgid "" "Return the error message corresponding to the error code in *code*. On " -"platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " +"platforms where :c:func:`!strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" @@ -1020,7 +1020,7 @@ msgstr "" msgid "" "In Linux kernel older than 5.3, the files pointed by *src* and *dst* must " "reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" -"attr:`~OSError.errno` set to :data:`errno.EXDEV`." +"attr:`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:928 @@ -1305,8 +1305,8 @@ msgstr "" #: ../../library/os.rst:1182 msgid "" -"Some operating systems could support additional values, like :data:`os." -"SEEK_HOLE` or :data:`os.SEEK_DATA`." +"Some operating systems could support additional values, like :const:`os." +"SEEK_HOLE` or :const:`os.SEEK_DATA`." msgstr "" #: ../../library/os.rst:1189 @@ -1554,7 +1554,7 @@ msgstr "" #: ../../library/os.rst:1423 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." +"If no bytes were read, it will return ``-1`` and set errno to :const:`errno." "EAGAIN`." msgstr "" @@ -1748,7 +1748,7 @@ msgid "" "*offset_dst*. The offset associated to the file descriptor that refers to a " "pipe must be ``None``. The files pointed by *src* and *dst* must reside in " "the same filesystem, otherwise an :exc:`OSError` is raised with :attr:" -"`~OSError.errno` set to :data:`errno.EXDEV`." +"`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:1632 @@ -2090,52 +2090,52 @@ msgid "" msgstr "" #: ../../library/os.rst:1963 -msgid ":data:`stat.UF_NODUMP`" -msgstr ":data:`stat.UF_NODUMP`" +msgid ":const:`stat.UF_NODUMP`" +msgstr ":const:`stat.UF_NODUMP`" #: ../../library/os.rst:1964 -msgid ":data:`stat.UF_IMMUTABLE`" -msgstr ":data:`stat.UF_IMMUTABLE`" +msgid ":const:`stat.UF_IMMUTABLE`" +msgstr ":const:`stat.UF_IMMUTABLE`" #: ../../library/os.rst:1965 -msgid ":data:`stat.UF_APPEND`" -msgstr ":data:`stat.UF_APPEND`" +msgid ":const:`stat.UF_APPEND`" +msgstr ":const:`stat.UF_APPEND`" #: ../../library/os.rst:1966 -msgid ":data:`stat.UF_OPAQUE`" -msgstr ":data:`stat.UF_OPAQUE`" +msgid ":const:`stat.UF_OPAQUE`" +msgstr ":const:`stat.UF_OPAQUE`" #: ../../library/os.rst:1967 -msgid ":data:`stat.UF_NOUNLINK`" -msgstr ":data:`stat.UF_NOUNLINK`" +msgid ":const:`stat.UF_NOUNLINK`" +msgstr ":const:`stat.UF_NOUNLINK`" #: ../../library/os.rst:1968 -msgid ":data:`stat.UF_COMPRESSED`" -msgstr ":data:`stat.UF_COMPRESSED`" +msgid ":const:`stat.UF_COMPRESSED`" +msgstr ":const:`stat.UF_COMPRESSED`" #: ../../library/os.rst:1969 -msgid ":data:`stat.UF_HIDDEN`" -msgstr ":data:`stat.UF_HIDDEN`" +msgid ":const:`stat.UF_HIDDEN`" +msgstr ":const:`stat.UF_HIDDEN`" #: ../../library/os.rst:1970 -msgid ":data:`stat.SF_ARCHIVED`" -msgstr ":data:`stat.SF_ARCHIVED`" +msgid ":const:`stat.SF_ARCHIVED`" +msgstr ":const:`stat.SF_ARCHIVED`" #: ../../library/os.rst:1971 -msgid ":data:`stat.SF_IMMUTABLE`" -msgstr ":data:`stat.SF_IMMUTABLE`" +msgid ":const:`stat.SF_IMMUTABLE`" +msgstr ":const:`stat.SF_IMMUTABLE`" #: ../../library/os.rst:1972 -msgid ":data:`stat.SF_APPEND`" -msgstr ":data:`stat.SF_APPEND`" +msgid ":const:`stat.SF_APPEND`" +msgstr ":const:`stat.SF_APPEND`" #: ../../library/os.rst:1973 -msgid ":data:`stat.SF_NOUNLINK`" -msgstr ":data:`stat.SF_NOUNLINK`" +msgid ":const:`stat.SF_NOUNLINK`" +msgstr ":const:`stat.SF_NOUNLINK`" #: ../../library/os.rst:1974 -msgid ":data:`stat.SF_SNAPSHOT`" -msgstr ":data:`stat.SF_SNAPSHOT`" +msgid ":const:`stat.SF_SNAPSHOT`" +msgstr ":const:`stat.SF_SNAPSHOT`" #: ../../library/os.rst:1976 msgid "" @@ -2162,80 +2162,80 @@ msgid "" msgstr "" #: ../../library/os.rst:1995 -msgid ":data:`stat.S_ISUID`" -msgstr ":data:`stat.S_ISUID`" +msgid ":const:`stat.S_ISUID`" +msgstr ":const:`stat.S_ISUID`" #: ../../library/os.rst:1996 -msgid ":data:`stat.S_ISGID`" -msgstr ":data:`stat.S_ISGID`" +msgid ":const:`stat.S_ISGID`" +msgstr ":const:`stat.S_ISGID`" #: ../../library/os.rst:1997 -msgid ":data:`stat.S_ENFMT`" -msgstr ":data:`stat.S_ENFMT`" +msgid ":const:`stat.S_ENFMT`" +msgstr ":const:`stat.S_ENFMT`" #: ../../library/os.rst:1998 -msgid ":data:`stat.S_ISVTX`" -msgstr ":data:`stat.S_ISVTX`" +msgid ":const:`stat.S_ISVTX`" +msgstr ":const:`stat.S_ISVTX`" #: ../../library/os.rst:1999 -msgid ":data:`stat.S_IREAD`" -msgstr ":data:`stat.S_IREAD`" +msgid ":const:`stat.S_IREAD`" +msgstr ":const:`stat.S_IREAD`" #: ../../library/os.rst:2000 -msgid ":data:`stat.S_IWRITE`" -msgstr ":data:`stat.S_IWRITE`" +msgid ":const:`stat.S_IWRITE`" +msgstr ":const:`stat.S_IWRITE`" #: ../../library/os.rst:2001 -msgid ":data:`stat.S_IEXEC`" -msgstr ":data:`stat.S_IEXEC`" +msgid ":const:`stat.S_IEXEC`" +msgstr ":const:`stat.S_IEXEC`" #: ../../library/os.rst:2002 -msgid ":data:`stat.S_IRWXU`" -msgstr ":data:`stat.S_IRWXU`" +msgid ":const:`stat.S_IRWXU`" +msgstr ":const:`stat.S_IRWXU`" #: ../../library/os.rst:2003 -msgid ":data:`stat.S_IRUSR`" -msgstr ":data:`stat.S_IRUSR`" +msgid ":const:`stat.S_IRUSR`" +msgstr ":const:`stat.S_IRUSR`" #: ../../library/os.rst:2004 -msgid ":data:`stat.S_IWUSR`" -msgstr ":data:`stat.S_IWUSR`" +msgid ":const:`stat.S_IWUSR`" +msgstr ":const:`stat.S_IWUSR`" #: ../../library/os.rst:2005 -msgid ":data:`stat.S_IXUSR`" -msgstr ":data:`stat.S_IXUSR`" +msgid ":const:`stat.S_IXUSR`" +msgstr ":const:`stat.S_IXUSR`" #: ../../library/os.rst:2006 -msgid ":data:`stat.S_IRWXG`" -msgstr ":data:`stat.S_IRWXG`" +msgid ":const:`stat.S_IRWXG`" +msgstr ":const:`stat.S_IRWXG`" #: ../../library/os.rst:2007 -msgid ":data:`stat.S_IRGRP`" -msgstr ":data:`stat.S_IRGRP`" +msgid ":const:`stat.S_IRGRP`" +msgstr ":const:`stat.S_IRGRP`" #: ../../library/os.rst:2008 -msgid ":data:`stat.S_IWGRP`" -msgstr ":data:`stat.S_IWGRP`" +msgid ":const:`stat.S_IWGRP`" +msgstr ":const:`stat.S_IWGRP`" #: ../../library/os.rst:2009 -msgid ":data:`stat.S_IXGRP`" -msgstr ":data:`stat.S_IXGRP`" +msgid ":const:`stat.S_IXGRP`" +msgstr ":const:`stat.S_IXGRP`" #: ../../library/os.rst:2010 -msgid ":data:`stat.S_IRWXO`" -msgstr ":data:`stat.S_IRWXO`" +msgid ":const:`stat.S_IRWXO`" +msgstr ":const:`stat.S_IRWXO`" #: ../../library/os.rst:2011 -msgid ":data:`stat.S_IROTH`" -msgstr ":data:`stat.S_IROTH`" +msgid ":const:`stat.S_IROTH`" +msgstr ":const:`stat.S_IROTH`" #: ../../library/os.rst:2012 -msgid ":data:`stat.S_IWOTH`" -msgstr ":data:`stat.S_IWOTH`" +msgid ":const:`stat.S_IWOTH`" +msgstr ":const:`stat.S_IWOTH`" #: ../../library/os.rst:2013 -msgid ":data:`stat.S_IXOTH`" -msgstr ":data:`stat.S_IXOTH`" +msgid ":const:`stat.S_IXOTH`" +msgstr ":const:`stat.S_IXOTH`" #: ../../library/os.rst:2015 ../../library/os.rst:2043 #: ../../library/os.rst:3422 @@ -2459,7 +2459,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." msgstr "" -"引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os.listmounts``。" +"引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." +"listmounts``。" #: ../../library/os.rst:2247 msgid "Return a list containing the volumes in the system." @@ -4484,12 +4485,13 @@ msgstr "" #: ../../library/os.rst:4154 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 " -"which share a common console window, e.g., some subprocesses. Any other " -"value for *sig* will cause the process to be unconditionally killed by the " -"TerminateProcess API, and the exit code will be set to *sig*. The Windows " -"version of :func:`kill` additionally takes process handles to be killed." +"Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." +"CTRL_BREAK_EVENT` signals are special signals which can only be sent to " +"console processes which share a common console window, e.g., some " +"subprocesses. Any other value for *sig* will cause the process to be " +"unconditionally killed by the TerminateProcess API, and the exit code will " +"be set to *sig*. The Windows version of :func:`kill` additionally takes " +"process handles to be killed." msgstr "" #: ../../library/os.rst:4162 @@ -4545,7 +4547,7 @@ msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " "attempt to wait on the file descriptor using :manpage:`waitid(2)` will " -"immediately return the error :data:`~errno.EAGAIN` rather than blocking." +"immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" #: ../../library/os.rst:4210 @@ -4681,7 +4683,7 @@ msgid "" "value specified. If the value specified is 0, the child's process group ID " "will be made the same as its process ID. If the value of *setpgroup* is not " "set, the child will inherit the parent's process group ID. This argument " -"corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." +"corresponds to the C library :c:macro:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" #: ../../library/os.rst:4313 @@ -4692,13 +4694,13 @@ msgid "" "the parent. In either case, if the set-user-ID and set-group-ID permission " "bits are enabled on the executable file, their effect will override the " "setting of the effective UID and GID. This argument corresponds to the C " -"library :c:data:`POSIX_SPAWN_RESETIDS` flag." +"library :c:macro:`POSIX_SPAWN_RESETIDS` flag." msgstr "" #: ../../library/os.rst:4321 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:" +"``posix_spawn``. *setsid* requires :c:macro:`POSIX_SPAWN_SETSID` or :c:macro:" "`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` is " "raised." msgstr "" @@ -4707,14 +4709,14 @@ msgstr "" 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 " -"parent's signal mask. This argument corresponds to the C library :c:data:" +"parent's signal mask. This argument corresponds to the C library :c:macro:" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" #: ../../library/os.rst:4331 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " -"specified. This argument corresponds to the C library :c:data:" +"specified. This argument corresponds to the C library :c:macro:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" @@ -4724,7 +4726,7 @@ msgid "" "policy and an instance of :class:`sched_param` with the scheduler " "parameters. A value of ``None`` in the place of the scheduler policy " "indicates that is not being provided. This argument is a combination of the " -"C library :c:data:`POSIX_SPAWN_SETSCHEDPARAM` and :c:data:" +"C library :c:macro:`POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" @@ -5135,7 +5137,7 @@ msgstr "" #: ../../library/os.rst:4652 msgid "" "The return value is an object representing the data contained in the :c:type:" -"`!siginfo_t` structure with the following attributes:" +"`siginfo_t` structure with the following attributes:" msgstr "" #: ../../library/os.rst:4655 @@ -5147,7 +5149,7 @@ msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" #: ../../library/os.rst:4657 -msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" +msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" #: ../../library/os.rst:4658 @@ -5395,7 +5397,7 @@ msgstr "" #: ../../library/os.rst:4894 msgid "" -"Return ``True`` if a stopped child has been resumed by delivery of :data:" +"Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" @@ -5763,7 +5765,7 @@ msgstr "" #: ../../library/os.rst:5266 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:" +"following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" diff --git a/library/platform.po b/library/platform.po index 66906e9a9f..f1585c829f 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,9 +86,9 @@ msgstr "" #: ../../library/platform.rst:48 msgid "" "To get at the \"64-bitness\" of the current interpreter, it is more reliable " -"to query the :attr:`sys.maxsize` attribute::" +"to query the :data:`sys.maxsize` attribute::" msgstr "" -"要獲取當前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :attr:`sys." +"要獲取當前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :data:`sys." "maxsize` 屬性:\n" "\n" "::" diff --git a/library/poplib.po b/library/poplib.po index 715710a7de..845e4604cc 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -124,7 +124,7 @@ msgstr "" #: ../../library/poplib.rst:77 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/poplib.rst:86 @@ -301,7 +301,7 @@ msgstr "" #: ../../library/poplib.rst:241 msgid "" "This method supports hostname checking via :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/poplib.rst:248 diff --git a/library/re.po b/library/re.po index e577102032..e7d4eef380 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-05-20 13:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,7 +147,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1532 +#: ../../library/re.rst:104 ../../library/re.rst:1545 msgid "``.``" msgstr "``.``" @@ -702,7 +702,7 @@ msgid "" "*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:504 +#: ../../library/re.rst:506 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -710,11 +710,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:519 +#: ../../library/re.rst:521 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:512 +#: ../../library/re.rst:514 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -726,19 +726,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:524 +#: ../../library/re.rst:526 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:524 +#: ../../library/re.rst:526 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:540 +#: ../../library/re.rst:542 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:529 +#: ../../library/re.rst:531 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -748,7 +748,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:536 +#: ../../library/re.rst:538 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -757,11 +757,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:551 +#: ../../library/re.rst:553 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:545 +#: ../../library/re.rst:547 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -772,15 +772,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:563 +#: ../../library/re.rst:565 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:560 ../../library/re.rst:580 ../../library/re.rst:599 +#: ../../library/re.rst:562 ../../library/re.rst:582 ../../library/re.rst:601 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:557 +#: ../../library/re.rst:559 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -788,30 +788,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:563 ../../library/re.rst:584 ../../library/re.rst:605 +#: ../../library/re.rst:565 ../../library/re.rst:586 ../../library/re.rst:607 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:563 +#: ../../library/re.rst:565 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:570 +#: ../../library/re.rst:572 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:568 +#: ../../library/re.rst:570 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:584 +#: ../../library/re.rst:586 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:576 +#: ../../library/re.rst:578 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -819,35 +819,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:583 +#: ../../library/re.rst:585 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:591 +#: ../../library/re.rst:593 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:589 +#: ../../library/re.rst:591 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:605 +#: ../../library/re.rst:607 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:597 +#: ../../library/re.rst:599 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:602 +#: ../../library/re.rst:604 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -855,11 +855,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:614 +#: ../../library/re.rst:616 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:610 +#: ../../library/re.rst:612 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -867,34 +867,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:619 +#: ../../library/re.rst:621 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:619 +#: ../../library/re.rst:621 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:635 +#: ../../library/re.rst:637 msgid "" -"Most of the standard escapes supported by Python string literals are also " -"accepted by the regular expression parser::" +"Most of the :ref:`escape sequences ` supported by Python " +"string literals are also accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:642 +#: ../../library/re.rst:644 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:645 +#: ../../library/re.rst:647 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:649 +#: ../../library/re.rst:651 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -902,26 +902,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:654 +#: ../../library/re.rst:656 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:657 +#: ../../library/re.rst:659 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:660 +#: ../../library/re.rst:662 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:668 +#: ../../library/re.rst:670 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:670 +#: ../../library/re.rst:672 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -929,26 +929,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:677 +#: ../../library/re.rst:679 msgid "Flags" msgstr "" -#: ../../library/re.rst:679 +#: ../../library/re.rst:681 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:686 +#: ../../library/re.rst:688 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:688 +#: ../../library/re.rst:690 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:693 +#: ../../library/re.rst:695 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -956,7 +956,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:698 +#: ../../library/re.rst:700 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -964,13 +964,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:707 +#: ../../library/re.rst:709 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:714 +#: ../../library/re.rst:716 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -980,7 +980,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:721 +#: ../../library/re.rst:723 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -991,7 +991,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:732 +#: ../../library/re.rst:734 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -1002,20 +1002,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:741 +#: ../../library/re.rst:743 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:745 +#: ../../library/re.rst:747 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:754 +#: ../../library/re.rst:756 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1026,7 +1026,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:764 +#: ../../library/re.rst:766 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1034,7 +1034,7 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:777 +#: ../../library/re.rst:779 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " @@ -1043,6 +1043,21 @@ msgstr "" #: ../../library/re.rst:787 msgid "" +"In Python 2, this flag made :ref:`special sequences ` " +"include Unicode characters in matches. Since Python 3, Unicode characters " +"are matched by default." +msgstr "" + +#: ../../library/re.rst:791 +msgid "See :const:`A` for restricting matching on ASCII characters instead." +msgstr "" + +#: ../../library/re.rst:793 +msgid "This flag is only kept for backward compatibility." +msgstr "" + +#: ../../library/re.rst:800 +msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " "pattern and add comments. Whitespace within the pattern is ignored, except " @@ -1054,53 +1069,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:797 +#: ../../library/re.rst:810 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:805 +#: ../../library/re.rst:818 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:809 +#: ../../library/re.rst:822 msgid "Functions" msgstr "" -#: ../../library/re.rst:813 +#: ../../library/re.rst:826 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:818 +#: ../../library/re.rst:831 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:822 +#: ../../library/re.rst:835 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:827 +#: ../../library/re.rst:840 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:831 +#: ../../library/re.rst:844 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:837 +#: ../../library/re.rst:850 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1108,7 +1123,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:845 +#: ../../library/re.rst:858 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1117,7 +1132,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:854 +#: ../../library/re.rst:867 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1145,7 +1160,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:878 +#: ../../library/re.rst:891 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1154,42 +1169,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:893 +#: ../../library/re.rst:906 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:900 +#: ../../library/re.rst:913 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:903 +#: ../../library/re.rst:916 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:913 ../../library/re.rst:1004 ../../library/re.rst:1033 +#: ../../library/re.rst:926 ../../library/re.rst:1017 ../../library/re.rst:1046 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:916 +#: ../../library/re.rst:929 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:922 +#: ../../library/re.rst:935 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:926 +#: ../../library/re.rst:939 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1199,11 +1214,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:938 ../../library/re.rst:949 +#: ../../library/re.rst:951 ../../library/re.rst:962 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:944 +#: ../../library/re.rst:957 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1211,7 +1226,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:955 +#: ../../library/re.rst:968 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1225,18 +1240,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:971 +#: ../../library/re.rst:984 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:997 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:986 +#: ../../library/re.rst:999 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1245,7 +1260,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:994 +#: ../../library/re.rst:1007 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1258,60 +1273,60 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1007 ../../library/re.rst:1036 -#: ../../library/re.rst:1270 +#: ../../library/re.rst:1020 ../../library/re.rst:1049 +#: ../../library/re.rst:1283 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1010 +#: ../../library/re.rst:1023 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1014 +#: ../../library/re.rst:1027 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1018 +#: ../../library/re.rst:1031 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1022 +#: ../../library/re.rst:1035 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:1030 +#: ../../library/re.rst:1043 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1042 +#: ../../library/re.rst:1055 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1057 +#: ../../library/re.rst:1070 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1065 +#: ../../library/re.rst:1078 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1068 +#: ../../library/re.rst:1081 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1319,15 +1334,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1077 +#: ../../library/re.rst:1090 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1081 +#: ../../library/re.rst:1094 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1085 +#: ../../library/re.rst:1098 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1336,41 +1351,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1093 +#: ../../library/re.rst:1106 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1097 +#: ../../library/re.rst:1110 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1101 +#: ../../library/re.rst:1114 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1105 +#: ../../library/re.rst:1118 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1109 +#: ../../library/re.rst:1122 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1111 +#: ../../library/re.rst:1124 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1117 +#: ../../library/re.rst:1130 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1119 +#: ../../library/re.rst:1132 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1137 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1379,7 +1394,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1130 +#: ../../library/re.rst:1143 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1388,7 +1403,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1136 +#: ../../library/re.rst:1149 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1398,7 +1413,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1151 +#: ../../library/re.rst:1164 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1406,19 +1421,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1156 ../../library/re.rst:1174 +#: ../../library/re.rst:1169 ../../library/re.rst:1187 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1164 +#: ../../library/re.rst:1177 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1170 +#: ../../library/re.rst:1183 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1426,76 +1441,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1188 +#: ../../library/re.rst:1201 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1193 +#: ../../library/re.rst:1206 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1200 +#: ../../library/re.rst:1213 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1207 +#: ../../library/re.rst:1220 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1212 +#: ../../library/re.rst:1225 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1217 +#: ../../library/re.rst:1230 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1224 +#: ../../library/re.rst:1237 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1229 +#: ../../library/re.rst:1242 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1236 +#: ../../library/re.rst:1249 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1239 +#: ../../library/re.rst:1252 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1247 +#: ../../library/re.rst:1260 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1249 +#: ../../library/re.rst:1262 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1258 +#: ../../library/re.rst:1271 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1263 +#: ../../library/re.rst:1276 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1504,7 +1519,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1275 +#: ../../library/re.rst:1288 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1519,7 +1534,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1297 +#: ../../library/re.rst:1310 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1527,57 +1542,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1302 +#: ../../library/re.rst:1315 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1310 +#: ../../library/re.rst:1323 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1317 +#: ../../library/re.rst:1330 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1326 +#: ../../library/re.rst:1339 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1337 +#: ../../library/re.rst:1350 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1350 +#: ../../library/re.rst:1363 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1354 ../../library/re.rst:1579 +#: ../../library/re.rst:1367 ../../library/re.rst:1592 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1360 +#: ../../library/re.rst:1373 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1373 +#: ../../library/re.rst:1386 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1385 +#: ../../library/re.rst:1398 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1586,7 +1601,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1393 +#: ../../library/re.rst:1406 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1594,32 +1609,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1398 +#: ../../library/re.rst:1411 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1408 +#: ../../library/re.rst:1421 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1415 +#: ../../library/re.rst:1428 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1422 +#: ../../library/re.rst:1435 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1442 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1628,43 +1643,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1438 +#: ../../library/re.rst:1451 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1444 +#: ../../library/re.rst:1457 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1450 +#: ../../library/re.rst:1463 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1453 +#: ../../library/re.rst:1466 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1461 +#: ../../library/re.rst:1474 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1465 +#: ../../library/re.rst:1478 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1467 +#: ../../library/re.rst:1480 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1475 +#: ../../library/re.rst:1488 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1672,154 +1687,154 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1480 +#: ../../library/re.rst:1493 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1490 +#: ../../library/re.rst:1503 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1500 +#: ../../library/re.rst:1513 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1519 +#: ../../library/re.rst:1532 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1536 msgid "" -"Python does not currently have an equivalent to :c:func:`scanf`. Regular " +"Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" -"func:`scanf` format strings. The table below offers some more-or-less " -"equivalent mappings between :c:func:`scanf` format tokens and regular " +"func:`!scanf` format strings. The table below offers some more-or-less " +"equivalent mappings between :c:func:`!scanf` format tokens and regular " "expressions." msgstr "" -#: ../../library/re.rst:1530 -msgid ":c:func:`scanf` Token" +#: ../../library/re.rst:1543 +msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1530 +#: ../../library/re.rst:1543 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1545 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1547 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1547 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1549 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1549 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1551 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1538 +#: ../../library/re.rst:1551 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1553 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1540 +#: ../../library/re.rst:1553 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1555 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1542 +#: ../../library/re.rst:1555 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1557 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1557 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1559 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1546 +#: ../../library/re.rst:1559 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1561 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1561 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1551 +#: ../../library/re.rst:1564 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1555 -msgid "you would use a :c:func:`scanf` format like ::" +#: ../../library/re.rst:1568 +msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1559 +#: ../../library/re.rst:1572 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1580 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1571 +#: ../../library/re.rst:1584 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1573 +#: ../../library/re.rst:1586 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1574 +#: ../../library/re.rst:1587 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1576 +#: ../../library/re.rst:1589 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1588 +#: ../../library/re.rst:1601 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1609 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1827,11 +1842,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1606 +#: ../../library/re.rst:1619 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1608 +#: ../../library/re.rst:1621 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1839,37 +1854,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1613 +#: ../../library/re.rst:1626 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1639 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1639 +#: ../../library/re.rst:1652 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1652 +#: ../../library/re.rst:1665 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1667 +#: ../../library/re.rst:1680 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1669 +#: ../../library/re.rst:1682 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1877,11 +1892,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1687 +#: ../../library/re.rst:1700 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1689 +#: ../../library/re.rst:1702 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1889,11 +1904,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1700 +#: ../../library/re.rst:1713 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1702 +#: ../../library/re.rst:1715 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1902,11 +1917,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1716 +#: ../../library/re.rst:1729 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1718 +#: ../../library/re.rst:1731 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1914,7 +1929,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1728 +#: ../../library/re.rst:1741 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1922,29 +1937,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1740 +#: ../../library/re.rst:1753 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1742 +#: ../../library/re.rst:1755 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1746 +#: ../../library/re.rst:1759 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1802 +#: ../../library/re.rst:1815 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1825 +#: ../../library/re.rst:1838 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -1964,12 +1979,12 @@ msgstr ". (點)" #: ../../library/re.rst:309 ../../library/re.rst:319 ../../library/re.rst:345 #: ../../library/re.rst:394 ../../library/re.rst:426 ../../library/re.rst:432 #: ../../library/re.rst:437 ../../library/re.rst:444 ../../library/re.rst:451 -#: ../../library/re.rst:478 ../../library/re.rst:488 ../../library/re.rst:509 -#: ../../library/re.rst:521 ../../library/re.rst:526 ../../library/re.rst:542 -#: ../../library/re.rst:553 ../../library/re.rst:565 ../../library/re.rst:572 -#: ../../library/re.rst:586 ../../library/re.rst:593 ../../library/re.rst:607 -#: ../../library/re.rst:616 ../../library/re.rst:621 ../../library/re.rst:785 -#: ../../library/re.rst:992 +#: ../../library/re.rst:478 ../../library/re.rst:488 ../../library/re.rst:511 +#: ../../library/re.rst:523 ../../library/re.rst:528 ../../library/re.rst:544 +#: ../../library/re.rst:555 ../../library/re.rst:567 ../../library/re.rst:574 +#: ../../library/re.rst:588 ../../library/re.rst:595 ../../library/re.rst:609 +#: ../../library/re.rst:618 ../../library/re.rst:623 ../../library/re.rst:798 +#: ../../library/re.rst:1005 msgid "in regular expressions" msgstr "於正規表示式中" @@ -2021,7 +2036,7 @@ msgstr "?+" msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:509 +#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:511 msgid "\\ (backslash)" msgstr "\\ (反斜線)" @@ -2081,98 +2096,98 @@ msgstr "(?\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -24,13 +24,13 @@ msgstr "" #: ../../library/select.rst:9 msgid "" -"This module provides access to the :c:func:`select` and :c:func:`poll` " -"functions available in most operating systems, :c:func:`devpoll` available " -"on Solaris and derivatives, :c:func:`epoll` available on Linux 2.5+ and :c:" -"func:`kqueue` available on most BSD. Note that on Windows, it only works for " -"sockets; on other operating systems, it also works for other file types (in " -"particular, on Unix, it works on pipes). It cannot be used on regular files " -"to determine whether a file has grown since it was last read." +"This module provides access to the :c:func:`!select` and :c:func:`!poll` " +"functions available in most operating systems, :c:func:`!devpoll` available " +"on Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and :c:" +"func:`!kqueue` available on most BSD. Note that on Windows, it only works " +"for sockets; on other operating systems, it also works for other file types " +"(in particular, on Unix, it works on pipes). It cannot be used on regular " +"files to determine whether a file has grown since it was last read." msgstr "" #: ../../library/select.rst:20 @@ -73,10 +73,10 @@ msgstr "" #: ../../library/select.rst:44 msgid "" -":c:func:`devpoll` objects are linked to the number of file descriptors " +":c:func:`!devpoll` objects are linked to the number of file descriptors " "allowed at the time of instantiation. If your program reduces this value, :c:" -"func:`devpoll` will fail. If your program increases this value, :c:func:" -"`devpoll` may return an incomplete list of active file descriptors." +"func:`!devpoll` will fail. If your program increases this value, :c:func:`!" +"devpoll` may return an incomplete list of active file descriptors." msgstr "" #: ../../library/select.rst:50 ../../library/select.rst:79 @@ -98,7 +98,7 @@ msgstr "" msgid "" "*sizehint* informs epoll about the expected number of events to be " "registered. It must be positive, or ``-1`` to use the default. It is only " -"used on older systems where :c:func:`epoll_create1` is not available; " +"used on older systems where :c:func:`!epoll_create1` is not available; " "otherwise it has no effect (though its value is still checked)." msgstr "" @@ -160,7 +160,7 @@ msgstr "" #: ../../library/select.rst:120 msgid "" -"This is a straightforward interface to the Unix :c:func:`select` system " +"This is a straightforward interface to the Unix :c:func:`!select` system " "call. The first three arguments are iterables of 'waitable objects': either " "integers representing file descriptors or objects with a parameterless " "method named :meth:`~io.IOBase.fileno` returning such an integer:" @@ -210,8 +210,9 @@ msgstr "" #: ../../library/select.rst:156 msgid "" "File objects on Windows are not acceptable, but sockets are. On Windows, " -"the underlying :c:func:`select` function is provided by the WinSock library, " -"and does not handle file descriptors that don't originate from WinSock." +"the underlying :c:func:`!select` function is provided by the WinSock " +"library, and does not handle file descriptors that don't originate from " +"WinSock." msgstr "" #: ../../library/select.rst:161 ../../library/select.rst:267 @@ -227,7 +228,7 @@ msgstr "" msgid "" "The minimum number of bytes which can be written without blocking to a pipe " "when the pipe has been reported as ready for writing by :func:`~select." -"select`, :func:`poll` or another interface in this module. This doesn't " +"select`, :func:`!poll` or another interface in this module. This doesn't " "apply to other kind of file-like objects such as sockets." msgstr "" @@ -245,14 +246,14 @@ msgstr "" #: ../../library/select.rst:187 msgid "" -"Solaris and derivatives have ``/dev/poll``. While :c:func:`select` is " -"O(highest file descriptor) and :c:func:`poll` is O(number of file " +"Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is " +"O(highest file descriptor) and :c:func:`!poll` is O(number of file " "descriptors), ``/dev/poll`` is O(active file descriptors)." msgstr "" #: ../../library/select.rst:191 msgid "" -"``/dev/poll`` behaviour is very close to the standard :c:func:`poll` object." +"``/dev/poll`` behaviour is very close to the standard :c:func:`!poll` object." msgstr "" #: ../../library/select.rst:197 @@ -279,7 +280,7 @@ msgstr "" #: ../../library/select.rst:224 msgid "" "*eventmask* is an optional bitmask describing the type of events you want to " -"check for. The constants are the same that with :c:func:`poll` object. The " +"check for. The constants are the same that with :c:func:`!poll` object. The " "default value is a combination of the constants :const:`POLLIN`, :const:" "`POLLPRI`, and :const:`POLLOUT`." msgstr "" @@ -288,7 +289,7 @@ msgstr "" msgid "" "Registering a file descriptor that's already registered is not an error, but " "the result is undefined. The appropriate action is to unregister or modify " -"it first. This is an important difference compared with :c:func:`poll`." +"it first. This is an important difference compared with :c:func:`!poll`." msgstr "" #: ../../library/select.rst:239 @@ -515,13 +516,13 @@ msgstr "" #: ../../library/select.rst:379 msgid "" -"The :c:func:`poll` system call, supported on most Unix systems, provides " +"The :c:func:`!poll` system call, supported on most Unix systems, provides " "better scalability for network servers that service many, many clients at " -"the same time. :c:func:`poll` scales better because the system call only " -"requires listing the file descriptors of interest, while :c:func:`select` " +"the same time. :c:func:`!poll` scales better because the system call only " +"requires listing the file descriptors of interest, while :c:func:`!select` " "builds a bitmap, turns on bits for the fds of interest, and then afterward " -"the whole bitmap has to be linearly scanned again. :c:func:`select` is " -"O(highest file descriptor), while :c:func:`poll` is O(number of file " +"the whole bitmap has to be linearly scanned again. :c:func:`!select` is " +"O(highest file descriptor), while :c:func:`!poll` is O(number of file " "descriptors)." msgstr "" diff --git a/library/shelve.po b/library/shelve.po index c89f78d767..b669a8f6f7 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,9 +48,9 @@ msgstr "" #: ../../library/shelve.rst:28 msgid "" -"By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used to " -"serialize values. The version of the pickle protocol can be specified with " -"the *protocol* parameter." +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter." msgstr "" #: ../../library/shelve.rst:32 @@ -70,7 +70,7 @@ msgstr "" #: ../../library/shelve.rst:44 ../../library/shelve.rst:145 msgid "" -":data:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." +":const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." msgstr "" #: ../../library/shelve.rst:48 @@ -157,9 +157,9 @@ msgstr "" #: ../../library/shelve.rst:122 msgid "" -"By default, pickles created with :data:`pickle.DEFAULT_PROTOCOL` are used to " -"serialize values. The version of the pickle protocol can be specified with " -"the *protocol* parameter. See the :mod:`pickle` documentation for a " +"By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " +"to serialize values. The version of the pickle protocol can be specified " +"with the *protocol* parameter. See the :mod:`pickle` documentation for a " "discussion of the pickle protocols." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index 7d9d2a7dcb..c59c68a04e 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-23 00:04+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-" @@ -517,28 +517,35 @@ msgid "" msgstr "" #: ../../library/shutil.rst:404 +msgid "" +"On Unix filesystems, *path* must point to a path within a **mounted** " +"filesystem partition. On those platforms, CPython doesn't attempt to " +"retrieve disk usage information from non-mounted filesystems." +msgstr "" + +#: ../../library/shutil.rst:410 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:407 +#: ../../library/shutil.rst:413 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/shutil.rst:411 +#: ../../library/shutil.rst:417 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: ../../library/shutil.rst:413 +#: ../../library/shutil.rst:419 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:416 +#: ../../library/shutil.rst:422 msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: ../../library/shutil.rst:418 +#: ../../library/shutil.rst:424 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -546,29 +553,29 @@ msgstr "" "引發一個附帶引數 ``path``、``user``、``group`` 的\\ :ref:`稽核事件 " "` ``shutil.chown``。" -#: ../../library/shutil.rst:420 +#: ../../library/shutil.rst:426 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/shutil.rst:427 +#: ../../library/shutil.rst:433 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:430 +#: ../../library/shutil.rst:436 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and executable." msgstr "" -#: ../../library/shutil.rst:433 +#: ../../library/shutil.rst:439 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`." +"returning either the \"PATH\" value or a fallback of :data:`os.defpath`." msgstr "" -#: ../../library/shutil.rst:436 +#: ../../library/shutil.rst:442 msgid "" "On Windows, the current directory is prepended to the *path* if *mode* does " "not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " @@ -578,7 +585,7 @@ msgid "" "environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" -#: ../../library/shutil.rst:443 +#: ../../library/shutil.rst:449 msgid "" "Also on Windows, the ``PATHEXT`` variable is used to resolve commands that " "may not already include an extension. For example, if you call ``shutil." @@ -587,19 +594,19 @@ msgid "" "on Windows::" msgstr "" -#: ../../library/shutil.rst:452 +#: ../../library/shutil.rst:458 msgid "" "This is also applied when *cmd* is a path that contains a directory " "component::" msgstr "" -#: ../../library/shutil.rst:460 +#: ../../library/shutil.rst:466 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:464 +#: ../../library/shutil.rst:470 msgid "" "On Windows, the current directory is no longer prepended to the search path " "if *mode* includes ``os.X_OK`` and WinAPI " @@ -610,18 +617,18 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:475 +#: ../../library/shutil.rst:481 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:482 +#: ../../library/shutil.rst:488 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:484 +#: ../../library/shutil.rst:490 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -631,51 +638,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:492 +#: ../../library/shutil.rst:498 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:494 +#: ../../library/shutil.rst:500 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:496 +#: ../../library/shutil.rst:502 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:500 +#: ../../library/shutil.rst:506 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:509 +#: ../../library/shutil.rst:515 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:511 +#: ../../library/shutil.rst:517 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:523 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:520 +#: ../../library/shutil.rst:526 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:535 +#: ../../library/shutil.rst:541 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:543 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 onexc callback to clear " @@ -683,25 +690,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:555 +#: ../../library/shutil.rst:561 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:559 +#: ../../library/shutil.rst:565 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:563 +#: ../../library/shutil.rst:569 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:568 +#: ../../library/shutil.rst:574 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:570 +#: ../../library/shutil.rst:576 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 " @@ -710,14 +717,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:576 +#: ../../library/shutil.rst:582 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:580 +#: ../../library/shutil.rst:586 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. " @@ -725,33 +732,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:592 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:588 +#: ../../library/shutil.rst:594 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:591 +#: ../../library/shutil.rst:597 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:600 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:603 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:599 +#: ../../library/shutil.rst:605 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -759,7 +766,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:609 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -767,60 +774,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:615 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:613 +#: ../../library/shutil.rst:619 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:619 +#: ../../library/shutil.rst:625 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:622 ../../library/shutil.rst:733 +#: ../../library/shutil.rst:628 ../../library/shutil.rst:739 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:624 +#: ../../library/shutil.rst:630 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:631 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:626 ../../library/shutil.rst:738 +#: ../../library/shutil.rst:632 ../../library/shutil.rst:744 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:627 ../../library/shutil.rst:739 +#: ../../library/shutil.rst:633 ../../library/shutil.rst:745 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:628 ../../library/shutil.rst:740 +#: ../../library/shutil.rst:634 ../../library/shutil.rst:746 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:630 +#: ../../library/shutil.rst:636 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:636 +#: ../../library/shutil.rst:642 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:638 +#: ../../library/shutil.rst:644 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 " @@ -829,7 +836,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:644 +#: ../../library/shutil.rst:650 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -838,37 +845,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:650 +#: ../../library/shutil.rst:656 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:653 +#: ../../library/shutil.rst:659 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:662 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:662 +#: ../../library/shutil.rst:668 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:667 +#: ../../library/shutil.rst:673 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:669 +#: ../../library/shutil.rst:675 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:672 +#: ../../library/shutil.rst:678 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -877,7 +884,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:685 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -887,7 +894,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:687 +#: ../../library/shutil.rst:693 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -895,7 +902,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:691 +#: ../../library/shutil.rst:697 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -903,138 +910,138 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:696 +#: ../../library/shutil.rst:702 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:699 +#: ../../library/shutil.rst:705 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:704 +#: ../../library/shutil.rst:710 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:708 +#: ../../library/shutil.rst:714 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:711 +#: ../../library/shutil.rst:717 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:712 +#: ../../library/shutil.rst:718 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:713 +#: ../../library/shutil.rst:719 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:715 +#: ../../library/shutil.rst:721 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:718 +#: ../../library/shutil.rst:724 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:730 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:729 +#: ../../library/shutil.rst:735 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:735 +#: ../../library/shutil.rst:741 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:737 +#: ../../library/shutil.rst:743 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:742 +#: ../../library/shutil.rst:748 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:749 +#: ../../library/shutil.rst:755 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:751 +#: ../../library/shutil.rst:757 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:761 +#: ../../library/shutil.rst:767 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:779 +#: ../../library/shutil.rst:785 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:781 +#: ../../library/shutil.rst:787 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:795 +#: ../../library/shutil.rst:801 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:809 +#: ../../library/shutil.rst:815 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:819 +#: ../../library/shutil.rst:825 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:823 +#: ../../library/shutil.rst:829 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:825 +#: ../../library/shutil.rst:831 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:829 +#: ../../library/shutil.rst:835 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:833 +#: ../../library/shutil.rst:839 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 " @@ -1043,17 +1050,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:839 +#: ../../library/shutil.rst:845 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:841 +#: ../../library/shutil.rst:847 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:846 +#: ../../library/shutil.rst:852 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/signal.po b/library/signal.po index be7aa7e009..186dbd0336 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -498,7 +498,8 @@ msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." msgstr "" -"引發一個附帶引數 ``thread_id``、``signalnum`` 的\\ :ref:`稽核事件 ` ``signal.pthread_kill``。" +"引發一個附帶引數 ``thread_id``、``signalnum`` 的\\ :ref:`稽核事件 " +"` ``signal.pthread_kill``。" #: ../../library/signal.rst:437 msgid "See the man page :manpage:`pthread_kill(3)` for further information." @@ -666,8 +667,8 @@ msgstr "更多資訊請見 :manpage:`siginterrupt(3)` 手冊頁。" #: ../../library/signal.rst:563 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " -"restart behaviour to interruptible by implicitly calling :c:func:" -"`siginterrupt` with a true *flag* value for the given signal." +"restart behaviour to interruptible by implicitly calling :c:func:`!" +"siginterrupt` with a true *flag* value for the given signal." msgstr "" #: ../../library/signal.rst:570 diff --git a/library/smtplib.po b/library/smtplib.po index 80d8fcea19..90f0ed257d 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -139,7 +139,7 @@ msgstr "新增 source_address 引數。" #: ../../library/smtplib.rst:98 msgid "" "The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." msgstr "" #: ../../library/smtplib.rst:103 @@ -543,7 +543,7 @@ msgstr "" #: ../../library/smtplib.rst:418 msgid "" "The method now supports hostname check with :attr:`SSLContext." -"check_hostname` and *Server Name Indicator* (see :data:`~ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indicator* (see :const:`~ssl.HAS_SNI`)." msgstr "" #: ../../library/smtplib.rst:423 diff --git a/library/socket.po b/library/socket.po index eaacda1a31..7bc624ab87 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -2354,7 +2354,7 @@ msgstr "" #: ../../library/socket.rst:2254 msgid "" -"There is a :mod:`socket` flag to set, in order to prevent this, :data:" +"There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index bb167120b2..d2781b6b84 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-19 00:54+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -299,8 +299,8 @@ msgid "" "isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " "more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or " "``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. " -"Has no effect unless :attr:`Connection.autocommit` is set to :data:`~sqlite3." -"LEGACY_TRANSACTION_CONTROL` (the default)." +"Has no effect unless :attr:`Connection.autocommit` is set to :const:" +"`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" #: ../../library/sqlite3.rst:305 @@ -337,7 +337,7 @@ msgstr "" msgid "" "Control :pep:`249` transaction handling behaviour. See :attr:`Connection." "autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " -"information. *autocommit* currently defaults to :data:`~sqlite3." +"information. *autocommit* currently defaults to :const:`~sqlite3." "LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a " "future Python release." msgstr "" @@ -1710,9 +1710,9 @@ msgstr "" #: ../../library/sqlite3.rst:1823 msgid "" "Set the current access position of the blob to *offset*. The *origin* " -"argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " -"values for *origin* are :data:`os.SEEK_CUR` (seek relative to the current " -"position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." +"argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " +"values for *origin* are :const:`os.SEEK_CUR` (seek relative to the current " +"position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" #: ../../library/sqlite3.rst:1831 diff --git a/library/ssl.po b/library/ssl.po index 2f978b200b..7cc942f17c 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-23 00:04+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-" @@ -165,7 +165,7 @@ msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " "high encryption cipher suites without RC4 and without unauthenticated cipher " -"suites. Passing :data:`~Purpose.SERVER_AUTH` as *purpose* sets :data:" +"suites. Passing :const:`~Purpose.SERVER_AUTH` as *purpose* sets :data:" "`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA " "certificates (when at least one of *cafile*, *capath* or *cadata* is given) " "or uses :meth:`SSLContext.load_default_certs` to load default CA " @@ -1680,9 +1680,9 @@ msgstr "" #: ../../library/ssl.rst:1486 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " -"default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are " +"default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " "flagged and trusted for TLS web server authentication (client side " -"sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client " +"sockets). :const:`Purpose.CLIENT_AUTH` loads CA certificates for client " "certificate verification on the server side." msgstr "" @@ -1945,7 +1945,7 @@ msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " "socket is tied to the context, its settings and certificates. *sock* must be " -"a :data:`~socket.SOCK_STREAM` socket; other socket types are unsupported." +"a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" #: ../../library/ssl.rst:1735 @@ -2852,7 +2852,7 @@ msgstr "" #: ../../library/ssl.rst:2595 msgid "" -"The SSL context created above will only allow TLSv1.2 and later (if " +"The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" "`PROTOCOL_TLS_CLIENT` implies certificate validation and hostname checks by " "default. You have to load certificates into the context." diff --git a/library/struct.po b/library/struct.po index 6b5723362f..3ca23ad674 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -492,8 +492,8 @@ msgid "``n``" msgstr "``n``" #: ../../library/struct.rst:234 -msgid ":c:expr:`ssize_t`" -msgstr ":c:expr:`ssize_t`" +msgid ":c:type:`ssize_t`" +msgstr ":c:type:`ssize_t`" #: ../../library/struct.rst:234 ../../library/struct.rst:236 msgid "\\(3)" @@ -504,8 +504,8 @@ msgid "``N``" msgstr "``N``" #: ../../library/struct.rst:236 -msgid ":c:expr:`size_t`" -msgstr ":c:expr:`size_t`" +msgid ":c:type:`size_t`" +msgstr ":c:type:`size_t`" #: ../../library/struct.rst:238 msgid "``e``" @@ -555,7 +555,7 @@ msgstr "" #: ../../library/struct.rst:244 msgid "\\(9)" -msgstr "" +msgstr "\\(9)" #: ../../library/struct.rst:246 msgid "``p``" @@ -563,7 +563,7 @@ msgstr "``p``" #: ../../library/struct.rst:246 msgid "\\(8)" -msgstr "" +msgstr "\\(8)" #: ../../library/struct.rst:248 msgid "``P``" diff --git a/library/subprocess.po b/library/subprocess.po index 53c1babf03..30fab2a5d1 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1790,7 +1790,7 @@ msgstr "" #: ../../library/subprocess.rst:1611 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " -"prevent ``vfork()`` from being used by Python, you can set the :attr:" +"prevent ``vfork()`` from being used by Python, you can set the :const:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" @@ -1798,7 +1798,7 @@ msgstr "" msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" -"attr:`subprocess._USE_POSIX_SPAWN` attribute if you need to prevent use of " +"const:`subprocess._USE_POSIX_SPAWN` attribute if you need to prevent use of " "that." msgstr "" diff --git a/library/sys.po b/library/sys.po index ed432cdea5..77368be496 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-23 00:04+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -224,8 +224,8 @@ msgid "" msgstr "" #: ../../library/sys.rst:169 -msgid "See also the :attr:`sys.stdlib_module_names` list." -msgstr "另請參閱 :attr:`sys.stdlib_module_names` 清單。" +msgid "See also the :data:`sys.stdlib_module_names` list." +msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。" #: ../../library/sys.rst:174 msgid "" @@ -368,8 +368,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:906 -#: ../../library/sys.rst:1643 ../../library/sys.rst:1876 +#: ../../library/sys.rst:282 ../../library/sys.rst:910 +#: ../../library/sys.rst:1647 ../../library/sys.rst:1880 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -414,13 +414,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:339 ../../library/sys.rst:1053 -#: ../../library/sys.rst:1759 +#: ../../library/sys.rst:339 ../../library/sys.rst:1057 +#: ../../library/sys.rst:1763 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:339 ../../library/sys.rst:1053 -#: ../../library/sys.rst:1759 +#: ../../library/sys.rst:339 ../../library/sys.rst:1057 +#: ../../library/sys.rst:1763 msgid "Explanation" msgstr "解釋" @@ -657,8 +657,8 @@ msgid "" "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 ../../library/sys.rst:576 -#: ../../library/sys.rst:952 +#: ../../library/sys.rst:519 ../../library/sys.rst:580 +#: ../../library/sys.rst:956 msgid "attribute" msgstr "屬性" @@ -800,38 +800,52 @@ msgid "" "limitation `)" msgstr "" -#: ../../library/sys.rst:540 +#: ../../library/sys.rst:538 +msgid ":const:`warn_default_encoding`" +msgstr ":const:`warn_default_encoding`" + +#: ../../library/sys.rst:538 +msgid ":option:`-X warn_default_encoding <-X>`" +msgstr ":option:`-X warn_default_encoding <-X>`" + +#: ../../library/sys.rst:541 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:543 +#: ../../library/sys.rst:544 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:546 +#: ../../library/sys.rst:547 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:549 +#: ../../library/sys.rst:550 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:552 +#: ../../library/sys.rst:553 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:557 +#: ../../library/sys.rst:558 +msgid "" +"Added ``warn_default_encoding`` attribute for :option:`-X` " +"``warn_default_encoding`` flag." +msgstr "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` ``warn_default_encoding`` 旗標。" + +#: ../../library/sys.rst:561 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:560 +#: ../../library/sys.rst:564 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:566 +#: ../../library/sys.rst:570 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -841,163 +855,163 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:580 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:576 ../../library/sys.rst:952 +#: ../../library/sys.rst:580 ../../library/sys.rst:956 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:582 msgid "``epsilon``" msgstr "``epsilon``" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:582 msgid "``DBL_EPSILON``" msgstr "``DBL_EPSILON``" -#: ../../library/sys.rst:578 +#: ../../library/sys.rst:582 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float" msgstr "" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:585 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" -#: ../../library/sys.rst:583 +#: ../../library/sys.rst:587 msgid "``dig``" msgstr "``dig``" -#: ../../library/sys.rst:583 +#: ../../library/sys.rst:587 msgid "``DBL_DIG``" msgstr "``DBL_DIG``" -#: ../../library/sys.rst:583 +#: ../../library/sys.rst:587 msgid "" "maximum number of decimal digits that can be faithfully represented in a " "float; see below" msgstr "" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:590 msgid "``mant_dig``" msgstr "``mant_dig``" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:590 msgid "``DBL_MANT_DIG``" msgstr "``DBL_MANT_DIG``" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:590 msgid "" "float precision: the number of base-``radix`` digits in the significand of a " "float" msgstr "" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:593 msgid "``max``" msgstr "``max``" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:593 msgid "``DBL_MAX``" msgstr "``DBL_MAX``" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:593 msgid "maximum representable positive finite float" msgstr "" -#: ../../library/sys.rst:591 +#: ../../library/sys.rst:595 msgid "``max_exp``" msgstr "``max_exp``" -#: ../../library/sys.rst:591 +#: ../../library/sys.rst:595 msgid "``DBL_MAX_EXP``" msgstr "``DBL_MAX_EXP``" -#: ../../library/sys.rst:591 +#: ../../library/sys.rst:595 msgid "" "maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float" msgstr "" -#: ../../library/sys.rst:594 +#: ../../library/sys.rst:598 msgid "``max_10_exp``" msgstr "``max_10_exp``" -#: ../../library/sys.rst:594 +#: ../../library/sys.rst:598 msgid "``DBL_MAX_10_EXP``" msgstr "``DBL_MAX_10_EXP``" -#: ../../library/sys.rst:594 +#: ../../library/sys.rst:598 msgid "" "maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats" msgstr "" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:601 msgid "``min``" msgstr "``min``" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:601 msgid "``DBL_MIN``" msgstr "``DBL_MIN``" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:601 msgid "minimum representable positive *normalized* float" msgstr "" -#: ../../library/sys.rst:599 +#: ../../library/sys.rst:603 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:607 msgid "``min_exp``" msgstr "``min_exp``" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:607 msgid "``DBL_MIN_EXP``" msgstr "``DBL_MIN_EXP``" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:607 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:610 msgid "``min_10_exp``" msgstr "``min_10_exp``" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:610 msgid "``DBL_MIN_10_EXP``" msgstr "``DBL_MIN_10_EXP``" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:610 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "``radix``" msgstr "``radix``" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "``FLT_RADIX``" msgstr "``FLT_RADIX``" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "radix of exponent representation" msgstr "" -#: ../../library/sys.rst:611 +#: ../../library/sys.rst:615 msgid "``rounds``" msgstr "``rounds``" -#: ../../library/sys.rst:611 +#: ../../library/sys.rst:615 msgid "``FLT_ROUNDS``" msgstr "``FLT_ROUNDS``" -#: ../../library/sys.rst:611 +#: ../../library/sys.rst:615 msgid "" "integer representing the rounding mode for floating-point arithmetic. This " "reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " @@ -1005,13 +1019,13 @@ msgid "" "toward positive infinity, ``3`` toward negative infinity" msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "" "All other values for ``FLT_ROUNDS`` characterize implementation-defined " "rounding behavior." msgstr "" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:629 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -1019,13 +1033,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:638 +#: ../../library/sys.rst:642 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:647 +#: ../../library/sys.rst:651 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1035,7 +1049,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:660 +#: ../../library/sys.rst:664 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1045,42 +1059,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:667 +#: ../../library/sys.rst:671 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:675 +#: ../../library/sys.rst:679 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:682 +#: ../../library/sys.rst:686 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:684 +#: ../../library/sys.rst:688 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:691 +#: ../../library/sys.rst:695 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:697 +#: ../../library/sys.rst:701 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " -"module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." +"module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:702 ../../library/sys.rst:1373 +#: ../../library/sys.rst:706 ../../library/sys.rst:1377 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:707 +#: ../../library/sys.rst:711 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:740 +#: ../../library/sys.rst:744 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1135,20 +1149,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:758 +#: ../../library/sys.rst:762 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:769 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:772 +#: ../../library/sys.rst:776 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1156,46 +1170,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:780 +#: ../../library/sys.rst:784 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:785 +#: ../../library/sys.rst:789 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:788 +#: ../../library/sys.rst:792 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:791 +#: ../../library/sys.rst:795 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:795 +#: ../../library/sys.rst:799 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:801 +#: ../../library/sys.rst:805 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:809 +#: ../../library/sys.rst:813 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1204,7 +1218,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:814 +#: ../../library/sys.rst:818 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1212,13 +1226,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:818 ../../library/sys.rst:834 +#: ../../library/sys.rst:822 ../../library/sys.rst:838 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:824 +#: ../../library/sys.rst:828 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1227,22 +1241,23 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:830 +#: ../../library/sys.rst:834 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" -"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys._getframemodulename``。" +"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." +"_getframemodulename``。" -#: ../../library/sys.rst:844 +#: ../../library/sys.rst:848 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:853 +#: ../../library/sys.rst:857 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:861 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1250,7 +1265,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:865 +#: ../../library/sys.rst:869 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1262,54 +1277,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:876 +#: ../../library/sys.rst:880 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:878 +#: ../../library/sys.rst:882 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:881 +#: ../../library/sys.rst:885 msgid "Constant" msgstr "" -#: ../../library/sys.rst:881 +#: ../../library/sys.rst:885 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:883 +#: ../../library/sys.rst:887 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:883 +#: ../../library/sys.rst:887 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:889 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:889 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:888 +#: ../../library/sys.rst:892 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:888 +#: ../../library/sys.rst:892 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:896 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:900 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1317,24 +1332,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:902 +#: ../../library/sys.rst:906 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:908 +#: ../../library/sys.rst:912 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:916 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:918 +#: ../../library/sys.rst:922 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1344,103 +1359,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:929 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:929 ../../library/sys.rst:1575 +#: ../../library/sys.rst:933 ../../library/sys.rst:1579 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:939 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:941 ../../library/sys.rst:1596 +#: ../../library/sys.rst:945 ../../library/sys.rst:1600 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:956 +#: ../../library/sys.rst:960 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:956 +#: ../../library/sys.rst:960 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:962 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:962 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:964 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:964 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:966 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:966 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:965 +#: ../../library/sys.rst:969 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:965 +#: ../../library/sys.rst:969 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:972 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:972 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:974 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:974 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:976 +#: ../../library/sys.rst:980 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:982 +#: ../../library/sys.rst:986 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1448,7 +1463,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:993 +#: ../../library/sys.rst:997 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1456,25 +1471,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:998 +#: ../../library/sys.rst:1002 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1003 +#: ../../library/sys.rst:1007 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1007 +#: ../../library/sys.rst:1011 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1011 +#: ../../library/sys.rst:1015 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1486,13 +1501,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1021 +#: ../../library/sys.rst:1025 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1024 +#: ../../library/sys.rst:1028 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1501,7 +1516,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1031 +#: ../../library/sys.rst:1035 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1511,61 +1526,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1042 +#: ../../library/sys.rst:1046 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1051 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1059 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1059 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1063 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1063 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1062 +#: ../../library/sys.rst:1066 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1062 +#: ../../library/sys.rst:1066 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1070 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1070 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1074 +#: ../../library/sys.rst:1078 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1080 +#: ../../library/sys.rst:1084 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1086 +#: ../../library/sys.rst:1090 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1582,13 +1597,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1088 +#: ../../library/sys.rst:1092 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1097 +#: ../../library/sys.rst:1101 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1600,19 +1615,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1105 +#: ../../library/sys.rst:1109 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1111 +#: ../../library/sys.rst:1115 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1118 +#: ../../library/sys.rst:1122 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1623,34 +1638,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1132 +#: ../../library/sys.rst:1136 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1138 +#: ../../library/sys.rst:1142 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1145 +#: ../../library/sys.rst:1149 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1152 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1156 +#: ../../library/sys.rst:1160 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1663,27 +1678,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1169 +#: ../../library/sys.rst:1173 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1169 +#: ../../library/sys.rst:1173 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1177 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1172 +#: ../../library/sys.rst:1176 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1182 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1691,7 +1706,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1186 +#: ../../library/sys.rst:1190 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1703,78 +1718,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1202 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1201 +#: ../../library/sys.rst:1205 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1210 +#: ../../library/sys.rst:1214 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1214 +#: ../../library/sys.rst:1218 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1222 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1220 +#: ../../library/sys.rst:1224 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1222 +#: ../../library/sys.rst:1226 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1225 +#: ../../library/sys.rst:1229 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1228 +#: ../../library/sys.rst:1232 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1234 +#: ../../library/sys.rst:1238 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1239 +#: ../../library/sys.rst:1243 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1243 ../../library/sys.rst:1254 +#: ../../library/sys.rst:1247 ../../library/sys.rst:1258 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1252 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1782,13 +1797,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1263 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1262 +#: ../../library/sys.rst:1266 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1797,141 +1812,141 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1275 +#: ../../library/sys.rst:1279 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1278 +#: ../../library/sys.rst:1282 msgid "System" msgstr "" -#: ../../library/sys.rst:1278 +#: ../../library/sys.rst:1282 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1284 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1284 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1281 +#: ../../library/sys.rst:1285 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1281 +#: ../../library/sys.rst:1285 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1287 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1287 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1288 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1288 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1289 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1289 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1290 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1290 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1293 msgid "" -"On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " "Python versions include the version number, it is recommended to always use " "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1295 +#: ../../library/sys.rst:1299 msgid "" -"On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " "Python versions include the version number, it is recommended to always use " "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1303 +#: ../../library/sys.rst:1307 msgid "" -":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" +":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1306 +#: ../../library/sys.rst:1310 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1316 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1315 +#: ../../library/sys.rst:1319 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1323 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1321 +#: ../../library/sys.rst:1325 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1324 +#: ../../library/sys.rst:1328 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1326 +#: ../../library/sys.rst:1330 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1334 +#: ../../library/sys.rst:1338 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1940,14 +1955,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1340 +#: ../../library/sys.rst:1344 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1957,7 +1972,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1365 +#: ../../library/sys.rst:1369 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1965,17 +1980,17 @@ msgid "" "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " "values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :" -"data:`os.RTLD_LAZY`)." +"const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1377 +#: ../../library/sys.rst:1381 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1393 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1990,7 +2005,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1404 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1998,71 +2013,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1405 +#: ../../library/sys.rst:1409 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1407 ../../library/sys.rst:1488 +#: ../../library/sys.rst:1411 ../../library/sys.rst:1492 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1411 ../../library/sys.rst:1493 +#: ../../library/sys.rst:1415 ../../library/sys.rst:1497 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1414 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1416 ../../library/sys.rst:1508 +#: ../../library/sys.rst:1420 ../../library/sys.rst:1512 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1418 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1420 +#: ../../library/sys.rst:1424 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1419 +#: ../../library/sys.rst:1423 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1425 +#: ../../library/sys.rst:1429 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1426 +#: ../../library/sys.rst:1430 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1430 +#: ../../library/sys.rst:1434 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1438 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2070,19 +2085,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1443 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1442 +#: ../../library/sys.rst:1446 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1449 +#: ../../library/sys.rst:1453 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2093,7 +2108,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1470 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2102,7 +2117,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1471 +#: ../../library/sys.rst:1475 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2110,7 +2125,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1480 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2118,31 +2133,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1481 +#: ../../library/sys.rst:1485 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1489 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1491 +#: ../../library/sys.rst:1495 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1502 +#: ../../library/sys.rst:1506 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1496 +#: ../../library/sys.rst:1500 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2152,7 +2167,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1505 +#: ../../library/sys.rst:1509 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2160,22 +2175,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1517 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1511 +#: ../../library/sys.rst:1515 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1521 +#: ../../library/sys.rst:1525 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1516 +#: ../../library/sys.rst:1520 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2184,13 +2199,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1527 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1526 +#: ../../library/sys.rst:1530 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2204,17 +2219,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1537 +#: ../../library/sys.rst:1541 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1543 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1547 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2222,13 +2237,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1554 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1559 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2237,7 +2252,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1565 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2245,7 +2260,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1563 +#: ../../library/sys.rst:1567 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2253,20 +2268,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1569 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1568 +#: ../../library/sys.rst:1572 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1580 +#: ../../library/sys.rst:1584 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2275,105 +2290,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1591 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1595 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1605 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1604 ../../library/sys.rst:1619 -#: ../../library/sys.rst:1627 +#: ../../library/sys.rst:1608 ../../library/sys.rst:1623 +#: ../../library/sys.rst:1631 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1610 +#: ../../library/sys.rst:1614 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1615 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1615 +#: ../../library/sys.rst:1619 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1621 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1629 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1633 +#: ../../library/sys.rst:1637 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1641 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1640 +#: ../../library/sys.rst:1644 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1645 +#: ../../library/sys.rst:1649 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1652 +#: ../../library/sys.rst:1656 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1655 +#: ../../library/sys.rst:1659 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1657 +#: ../../library/sys.rst:1661 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1659 +#: ../../library/sys.rst:1663 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1665 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1669 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1672 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2384,14 +2399,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1677 +#: ../../library/sys.rst:1681 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1682 +#: ../../library/sys.rst:1686 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2400,7 +2415,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1693 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2409,19 +2424,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1699 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1705 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1709 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2429,7 +2444,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1715 +#: ../../library/sys.rst:1719 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2437,7 +2452,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1720 +#: ../../library/sys.rst:1724 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2445,7 +2460,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1726 +#: ../../library/sys.rst:1730 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2453,12 +2468,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1734 +#: ../../library/sys.rst:1738 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1736 +#: ../../library/sys.rst:1740 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2466,7 +2481,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1745 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2474,72 +2489,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1746 -msgid "See also the :attr:`sys.builtin_module_names` list." +#: ../../library/sys.rst:1750 +msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1753 +#: ../../library/sys.rst:1757 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1761 +#: ../../library/sys.rst:1765 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1761 +#: ../../library/sys.rst:1765 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:1767 msgid "``'nt'``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1764 +#: ../../library/sys.rst:1768 msgid "``'pthread'``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1769 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1767 +#: ../../library/sys.rst:1771 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1773 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1773 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1775 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1772 +#: ../../library/sys.rst:1776 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1774 +#: ../../library/sys.rst:1778 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1780 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1780 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1785 +#: ../../library/sys.rst:1789 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2548,72 +2563,72 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1793 +#: ../../library/sys.rst:1797 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1795 +#: ../../library/sys.rst:1799 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1803 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1801 +#: ../../library/sys.rst:1805 msgid "*exc_type*: Exception type." msgstr "*exc_type*: 例外型別。" -#: ../../library/sys.rst:1802 +#: ../../library/sys.rst:1806 msgid "*exc_value*: Exception value, can be ``None``." msgstr "*exc_value*: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1803 +#: ../../library/sys.rst:1807 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "*exc_traceback*: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1804 +#: ../../library/sys.rst:1808 msgid "*err_msg*: Error message, can be ``None``." msgstr "*err_msg*: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1805 +#: ../../library/sys.rst:1809 msgid "*object*: Object causing the exception, can be ``None``." msgstr "*object*: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1807 +#: ../../library/sys.rst:1811 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1811 +#: ../../library/sys.rst:1815 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1814 +#: ../../library/sys.rst:1818 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1818 +#: ../../library/sys.rst:1822 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1822 +#: ../../library/sys.rst:1826 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "關於處理未捕捉得例外,另請參閱 :func:`excepthook`。" -#: ../../library/sys.rst:1824 +#: ../../library/sys.rst:1828 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2622,7 +2637,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1826 +#: ../../library/sys.rst:1830 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2630,7 +2645,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1835 +#: ../../library/sys.rst:1839 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2639,13 +2654,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1844 +#: ../../library/sys.rst:1848 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1854 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2656,18 +2671,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1862 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1863 +#: ../../library/sys.rst:1867 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1870 +#: ../../library/sys.rst:1874 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2676,25 +2691,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1881 +#: ../../library/sys.rst:1885 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1901 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1905 +#: ../../library/sys.rst:1909 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1910 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2715,50 +2730,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:840 ../../library/sys.rst:1385 +#: ../../library/sys.rst:844 ../../library/sys.rst:1389 msgid "profile function" msgstr "" -#: ../../library/sys.rst:840 ../../library/sys.rst:1385 +#: ../../library/sys.rst:844 ../../library/sys.rst:1389 msgid "profiler" msgstr "" -#: ../../library/sys.rst:849 ../../library/sys.rst:1462 +#: ../../library/sys.rst:853 ../../library/sys.rst:1466 msgid "trace function" msgstr "" -#: ../../library/sys.rst:849 ../../library/sys.rst:1462 +#: ../../library/sys.rst:853 ../../library/sys.rst:1466 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1208 +#: ../../library/sys.rst:1212 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1208 +#: ../../library/sys.rst:1212 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1208 +#: ../../library/sys.rst:1212 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "..." msgstr "..." diff --git a/library/tarfile.po b/library/tarfile.po index ca63d3d5f3..b355c6558f 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1218,7 +1218,7 @@ msgid "Implements the ``'tar'`` filter." msgstr "" #: ../../library/tarfile.rst:936 -msgid "Strip leading slashes (``/`` and :attr:`os.sep`) from filenames." +msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" #: ../../library/tarfile.rst:937 @@ -1238,7 +1238,7 @@ msgstr "" #: ../../library/tarfile.rst:944 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" -"attr:`~stat.S_IWGRP`|:attr:`~stat.S_IWOTH`)." +"const:`~stat.S_IWGRP`|:const:`~stat.S_IWOTH`)." msgstr "" #: ../../library/tarfile.rst:947 ../../library/tarfile.rst:980 @@ -1280,14 +1280,14 @@ msgstr "" #: ../../library/tarfile.rst:969 msgid "" -"Set the owner read and write permissions (:attr:`~stat.S_IRUSR`|:attr:`~stat." -"S_IWUSR`)." +"Set the owner read and write permissions (:const:`~stat.S_IRUSR`|:const:" +"`~stat.S_IWUSR`)." msgstr "" #: ../../library/tarfile.rst:971 msgid "" -"Remove the group & other executable permission (:attr:`~stat.S_IXGRP`|:attr:" -"`~stat.S_IXOTH`) if the owner doesn’t have it (:attr:`~stat.S_IXUSR`)." +"Remove the group & other executable permission (:const:`~stat.S_IXGRP`|:" +"const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" #: ../../library/tarfile.rst:975 diff --git a/library/tempfile.po b/library/tempfile.po index 024733ad45..1ab417eb37 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,10 +121,10 @@ msgstr "" #: ../../library/tempfile.rst:62 msgid "" -"The :py:data:`os.O_TMPFILE` flag is used if it is available and works (Linux-" -"specific, requires Linux kernel 3.11 or later)." +"The :py:const:`os.O_TMPFILE` flag is used if it is available and works " +"(Linux-specific, requires Linux kernel 3.11 or later)." msgstr "" -"如果可用且可運作,則使用 :py:data:`os.O_TMPFILE` 旗標(僅限於 Linux,需要 " +"如果可用且可運作,則使用 :py:const:`os.O_TMPFILE` 旗標(僅限於 Linux,需要 " "3.11 版本以上的核心)。" #: ../../library/tempfile.rst:65 @@ -144,8 +144,8 @@ msgstr "" "`。" #: ../../library/tempfile.rst:72 -msgid "The :py:data:`os.O_TMPFILE` flag is now used if available." -msgstr "如果可用,自此開始使用 :py:data:`os.O_TMPFILE` 旗標。" +msgid "The :py:const:`os.O_TMPFILE` flag is now used if available." +msgstr "如果可用,自此開始使用 :py:const:`os.O_TMPFILE` 旗標。" #: ../../library/tempfile.rst:74 ../../library/tempfile.rst:139 #: ../../library/tempfile.rst:167 diff --git a/library/test.po b/library/test.po index 11dc75c124..a645b8a761 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -529,7 +529,7 @@ msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." msgstr "" #: ../../library/test.rst:475 -msgid "Return :data:`_testcapi.WITH_PYMALLOC`." +msgid "Return :const:`_testcapi.WITH_PYMALLOC`." msgstr "" #: ../../library/test.rst:480 @@ -1064,7 +1064,7 @@ msgstr "" #: ../../library/test.rst:1042 msgid "" -"On UNIX, :func:`resource.setrlimit` is used to set :attr:`resource." +"On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" diff --git a/library/tkinter.po b/library/tkinter.po index 14653776cd..8e14e38bc9 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -329,7 +329,7 @@ msgid "" "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`." +"variable or, if that isn't defined, then :data:`os.curdir`." msgstr "" #: ../../library/tkinter.rst:170 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 0a9f25275f..2e0a1f367a 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-21 00:03+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-" @@ -144,7 +144,7 @@ msgid "Standard Options" msgstr "" #: ../../library/tkinter.ttk.rst:105 -msgid "All the :mod:`ttk` Widgets accepts the following options:" +msgid "All the :mod:`ttk` Widgets accept the following options:" msgstr "" #: ../../library/tkinter.ttk.rst:110 ../../library/tkinter.ttk.rst:145 diff --git a/library/turtle.po b/library/turtle.po index 7a026c328b..3b21472329 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -34,44 +34,192 @@ msgstr "介紹" #: ../../library/turtle.rst:22 #, fuzzy msgid "" -"Turtle graphics is a popular way for introducing programming to kids. It " -"was part of the original Logo programming language developed by Wally " -"Feurzeig, Seymour Papert and Cynthia Solomon in 1967." +"Turtle graphics is an implementation of `the popular geometric drawing tools " +"introduced in Logo `_, " +"developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967." msgstr "" "龜圖學是介紹程式設計給孩子們的常用方法,這是由 Wally Feurzeig 和 Seymour " "Papert 於 1966 年開發的原始 Logo 程式語言的一部分。" -#: ../../library/turtle.rst:26 +#: ../../library/turtle.rst:29 msgid "" -"Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " -"``import turtle``, give it the command ``turtle.forward(15)``, and it moves " -"(on-screen!) 15 pixels in the direction it is facing, drawing a line as it " -"moves. Give it the command ``turtle.right(25)``, and it rotates in-place 25 " -"degrees clockwise." +"Turtle can draw intricate shapes using programs that repeat simple moves." +msgstr "龜可以使用重複簡單動作之程式來畫出複雜的形狀。" + +#: ../../library/turtle.rst:35 +msgid "" +"In Python, turtle graphics provides a representation of a physical " +"\"turtle\" (a little robot with a pen) that draws on a sheet of paper on the " +"floor." msgstr "" -"想像一下,一隻機器龜在 x-y 平面上從 (0, 0) 出發。在 ``import turtle`` 之後," -"給它命令 ``turtle.forward(15)`` ,然後它就會移動 (在螢幕上!) 15 個單位像素," -"方向是朝著其正面對的方向。給它命令 ``turtle.right(25)`` ,它就會在原地順時針" -"旋轉 25 度。" -#: ../../library/turtle.rst:33 +#: ../../library/turtle.rst:38 msgid "" -"Turtle can draw intricate shapes using programs that repeat simple moves." -msgstr "龜可以使用重複簡單動作之程式來畫出複雜的形狀。" +"It's an effective and well-proven way for learners to encounter programming " +"concepts and interaction with software, as it provides instant, visible " +"feedback. It also provides convenient access to graphical output in general." +msgstr "" + +#: ../../library/turtle.rst:43 +msgid "" +"Turtle drawing was originally created as an educational tool, to be used by " +"teachers in the classroom. For the programmer who needs to produce some " +"graphical output it can be a way to do that without the overhead of " +"introducing more complex or external libraries into their work." +msgstr "" + +#: ../../library/turtle.rst:50 +msgid "Tutorial" +msgstr "" + +#: ../../library/turtle.rst:52 +msgid "" +"New users should start here. In this tutorial we'll explore some of the " +"basics of turtle drawing." +msgstr "" + +#: ../../library/turtle.rst:57 +msgid "Starting a turtle environment" +msgstr "" + +#: ../../library/turtle.rst:59 +msgid "In a Python shell, import all the objects of the ``turtle`` module::" +msgstr "" + +#: ../../library/turtle.rst:63 +msgid "" +"If you run into a ``No module named '_tkinter'`` error, you'll have to " +"install the :mod:`Tk interface package ` on your system." +msgstr "" + +#: ../../library/turtle.rst:68 +msgid "Basic drawing" +msgstr "" + +#: ../../library/turtle.rst:70 +msgid "Send the turtle forward 100 steps::" +msgstr "" + +#: ../../library/turtle.rst:74 +msgid "" +"You should see (most likely, in a new window on your display) a line drawn " +"by the turtle, heading East. Change the direction of the turtle, so that it " +"turns 120 degrees left (anti-clockwise)::" +msgstr "" + +#: ../../library/turtle.rst:80 +msgid "Let's continue by drawing a triangle::" +msgstr "" + +#: ../../library/turtle.rst:86 +msgid "" +"Notice how the turtle, represented by an arrow, points in different " +"directions as you steer it." +msgstr "" + +#: ../../library/turtle.rst:89 +msgid "" +"Experiment with those commands, and also with ``backward()`` and ``right()``." +msgstr "" + +#: ../../library/turtle.rst:94 ../../library/turtle.rst:283 +#: ../../library/turtle.rst:953 +msgid "Pen control" +msgstr "" + +#: ../../library/turtle.rst:96 +msgid "" +"Try changing the color - for example, ``color('blue')`` - and width of the " +"line - for example, ``width(3)`` - and then drawing again." +msgstr "" + +#: ../../library/turtle.rst:99 +msgid "" +"You can also move the turtle around without drawing, by lifting up the pen: " +"``up()`` before moving. To start drawing again, use ``down()``." +msgstr "" + +#: ../../library/turtle.rst:104 +msgid "The turtle's position" +msgstr "" + +#: ../../library/turtle.rst:106 +msgid "" +"Send your turtle back to its starting-point (useful if it has disappeared " +"off-screen)::" +msgstr "" + +#: ../../library/turtle.rst:111 +msgid "" +"The home position is at the center of the turtle's screen. If you ever need " +"to know them, get the turtle's x-y co-ordinates with::" +msgstr "" + +#: ../../library/turtle.rst:116 +msgid "Home is at ``(0, 0)``." +msgstr "" + +#: ../../library/turtle.rst:118 +msgid "" +"And after a while, it will probably help to clear the window so we can start " +"anew::" +msgstr "" + +#: ../../library/turtle.rst:125 +msgid "Making algorithmic patterns" +msgstr "" + +#: ../../library/turtle.rst:127 +msgid "Using loops, it's possible to build up geometric patterns::" +msgstr "" + +#: ../../library/turtle.rst:136 +msgid "\\ - which of course, are limited only by the imagination!" +msgstr "" + +#: ../../library/turtle.rst:138 +msgid "" +"Let's draw the star shape at the top of this page. We want red lines, filled " +"in with yellow::" +msgstr "" -#: ../../library/turtle.rst:41 +#: ../../library/turtle.rst:144 msgid "" -"By combining together these and similar commands, intricate shapes and " -"pictures can easily be drawn." -msgstr "藉由結合這些類似的命令,複雜的形狀和圖形可以輕易被畫出來。" +"Just as ``up()`` and ``down()`` determine whether lines will be drawn, " +"filling can be turned on and off::" +msgstr "" + +#: ../../library/turtle.rst:149 +msgid "Next we'll create a loop::" +msgstr "" + +#: ../../library/turtle.rst:157 +msgid "" +"``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " +"position." +msgstr "" + +#: ../../library/turtle.rst:160 +msgid "Finally, complete the filling::" +msgstr "" + +#: ../../library/turtle.rst:164 +msgid "" +"(Note that filling only actually takes place when you give the " +"``end_fill()`` command.)" +msgstr "" + +#: ../../library/turtle.rst:169 +msgid "Explanation" +msgstr "" -#: ../../library/turtle.rst:44 +#: ../../library/turtle.rst:171 msgid "" "The :mod:`turtle` module is an extended reimplementation of the same-named " "module from the Python standard distribution up to version Python 2.5." msgstr "" -#: ../../library/turtle.rst:47 +#: ../../library/turtle.rst:174 msgid "" "It tries to keep the merits of the old turtle module and to be (nearly) 100% " "compatible with it. This means in the first place to enable the learning " @@ -79,7 +227,7 @@ msgid "" "using the module from within IDLE run with the ``-n`` switch." msgstr "" -#: ../../library/turtle.rst:52 +#: ../../library/turtle.rst:179 msgid "" "The turtle module provides turtle graphics primitives, in both object-" "oriented and procedure-oriented ways. Because it uses :mod:`tkinter` for " @@ -87,11 +235,11 @@ msgid "" "support." msgstr "" -#: ../../library/turtle.rst:56 +#: ../../library/turtle.rst:183 msgid "The object-oriented interface uses essentially two+two classes:" msgstr "" -#: ../../library/turtle.rst:58 +#: ../../library/turtle.rst:185 msgid "" "The :class:`TurtleScreen` class defines graphics windows as a playground for " "the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a :" @@ -99,7 +247,7 @@ msgid "" "used as part of some application." msgstr "" -#: ../../library/turtle.rst:63 +#: ../../library/turtle.rst:190 msgid "" "The function :func:`Screen` returns a singleton object of a :class:" "`TurtleScreen` subclass. This function should be used when :mod:`turtle` is " @@ -107,13 +255,13 @@ msgid "" "inheriting from its class is not possible." msgstr "" -#: ../../library/turtle.rst:68 +#: ../../library/turtle.rst:195 msgid "" "All methods of TurtleScreen/Screen also exist as functions, i.e. as part of " "the procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:71 +#: ../../library/turtle.rst:198 msgid "" ":class:`RawTurtle` (alias: :class:`RawPen`) defines Turtle objects which " "draw on a :class:`TurtleScreen`. Its constructor needs a Canvas, " @@ -121,20 +269,20 @@ msgid "" "where to draw." msgstr "" -#: ../../library/turtle.rst:75 +#: ../../library/turtle.rst:202 msgid "" "Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:" "`Pen`), which draws on \"the\" :class:`Screen` instance which is " "automatically created, if not already present." msgstr "" -#: ../../library/turtle.rst:79 +#: ../../library/turtle.rst:206 msgid "" "All methods of RawTurtle/Turtle also exist as functions, i.e. part of the " "procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:82 +#: ../../library/turtle.rst:209 msgid "" "The procedural interface provides functions which are derived from the " "methods of the classes :class:`Screen` and :class:`Turtle`. They have the " @@ -144,32 +292,32 @@ msgid "" "functions derived from a Turtle method is called." msgstr "" -#: ../../library/turtle.rst:89 +#: ../../library/turtle.rst:216 msgid "" "To use multiple turtles on a screen one has to use the object-oriented " "interface." msgstr "" -#: ../../library/turtle.rst:92 +#: ../../library/turtle.rst:219 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:98 -msgid "Overview of available Turtle and Screen methods" +#: ../../library/turtle.rst:225 +msgid "Turtle graphics reference" msgstr "" -#: ../../library/turtle.rst:101 +#: ../../library/turtle.rst:228 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:133 ../../library/turtle.rst:243 +#: ../../library/turtle.rst:260 ../../library/turtle.rst:370 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:121 +#: ../../library/turtle.rst:248 msgid "Move and draw" msgstr "" @@ -213,7 +361,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2498 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2625 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -221,7 +369,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2603 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -241,7 +389,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:129 ../../library/turtle.rst:675 +#: ../../library/turtle.rst:256 ../../library/turtle.rst:802 msgid "Tell Turtle's state" msgstr "" @@ -269,7 +417,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:133 +#: ../../library/turtle.rst:260 msgid "Setting and measurement" msgstr "" @@ -281,11 +429,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:156 ../../library/turtle.rst:826 -msgid "Pen control" -msgstr "" - -#: ../../library/turtle.rst:141 ../../library/turtle.rst:829 +#: ../../library/turtle.rst:268 ../../library/turtle.rst:956 msgid "Drawing state" msgstr "" @@ -309,7 +453,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:146 ../../library/turtle.rst:921 +#: ../../library/turtle.rst:273 ../../library/turtle.rst:1048 msgid "Color control" msgstr "" @@ -325,7 +469,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:151 ../../library/turtle.rst:1053 +#: ../../library/turtle.rst:278 ../../library/turtle.rst:1180 msgid "Filling" msgstr "" @@ -341,7 +485,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:156 ../../library/turtle.rst:1100 +#: ../../library/turtle.rst:283 ../../library/turtle.rst:1227 msgid "More drawing control" msgstr "" @@ -357,11 +501,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:173 ../../library/turtle.rst:1146 +#: ../../library/turtle.rst:300 ../../library/turtle.rst:1273 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:162 ../../library/turtle.rst:1149 +#: ../../library/turtle.rst:289 ../../library/turtle.rst:1276 msgid "Visibility" msgstr "" @@ -377,7 +521,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:173 ../../library/turtle.rst:1188 +#: ../../library/turtle.rst:300 ../../library/turtle.rst:1315 msgid "Appearance" msgstr "" @@ -417,11 +561,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:178 ../../library/turtle.rst:1393 +#: ../../library/turtle.rst:305 ../../library/turtle.rst:1520 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2597 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -429,11 +573,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2580 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:189 ../../library/turtle.rst:1467 +#: ../../library/turtle.rst:316 ../../library/turtle.rst:1594 msgid "Special Turtle methods" msgstr "" @@ -449,7 +593,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2492 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2619 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -469,11 +613,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:192 +#: ../../library/turtle.rst:319 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:200 ../../library/turtle.rst:1621 +#: ../../library/turtle.rst:327 ../../library/turtle.rst:1748 msgid "Window control" msgstr "" @@ -501,7 +645,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:205 ../../library/turtle.rst:1744 +#: ../../library/turtle.rst:332 ../../library/turtle.rst:1871 msgid "Animation control" msgstr "" @@ -517,7 +661,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:213 ../../library/turtle.rst:1797 +#: ../../library/turtle.rst:340 ../../library/turtle.rst:1924 msgid "Using screen events" msgstr "" @@ -545,7 +689,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:223 ../../library/turtle.rst:1942 +#: ../../library/turtle.rst:350 ../../library/turtle.rst:2069 msgid "Settings and special methods" msgstr "" @@ -581,7 +725,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:227 ../../library/turtle.rst:1906 +#: ../../library/turtle.rst:354 ../../library/turtle.rst:2033 msgid "Input methods" msgstr "" @@ -593,7 +737,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:234 +#: ../../library/turtle.rst:361 msgid "Methods specific to Screen" msgstr "" @@ -613,11 +757,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:237 +#: ../../library/turtle.rst:364 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:239 +#: ../../library/turtle.rst:366 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -627,70 +771,70 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:248 ../../library/turtle.rst:293 -#: ../../library/turtle.rst:318 ../../library/turtle.rst:416 -#: ../../library/turtle.rst:439 ../../library/turtle.rst:462 +#: ../../library/turtle.rst:375 ../../library/turtle.rst:420 +#: ../../library/turtle.rst:445 ../../library/turtle.rst:543 +#: ../../library/turtle.rst:566 ../../library/turtle.rst:589 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:250 +#: ../../library/turtle.rst:377 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:270 ../../library/turtle.rst:512 -#: ../../library/turtle.rst:779 ../../library/turtle.rst:1287 -#: ../../library/turtle.rst:1306 +#: ../../library/turtle.rst:397 ../../library/turtle.rst:639 +#: ../../library/turtle.rst:906 ../../library/turtle.rst:1414 +#: ../../library/turtle.rst:1433 msgid "a number" msgstr "" -#: ../../library/turtle.rst:272 +#: ../../library/turtle.rst:399 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:295 +#: ../../library/turtle.rst:422 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:320 +#: ../../library/turtle.rst:447 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:344 +#: ../../library/turtle.rst:471 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:345 ../../library/turtle.rst:378 -#: ../../library/turtle.rst:379 +#: ../../library/turtle.rst:472 ../../library/turtle.rst:505 +#: ../../library/turtle.rst:506 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:347 +#: ../../library/turtle.rst:474 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:350 +#: ../../library/turtle.rst:477 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:380 +#: ../../library/turtle.rst:507 msgid "a boolean" msgstr "" -#: ../../library/turtle.rst:382 +#: ../../library/turtle.rst:509 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -700,77 +844,77 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: ../../library/turtle.rst:418 +#: ../../library/turtle.rst:545 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:441 +#: ../../library/turtle.rst:568 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:464 +#: ../../library/turtle.rst:591 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:468 +#: ../../library/turtle.rst:595 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:468 +#: ../../library/turtle.rst:595 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:470 +#: ../../library/turtle.rst:597 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:470 +#: ../../library/turtle.rst:597 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:471 +#: ../../library/turtle.rst:598 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:471 +#: ../../library/turtle.rst:598 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:472 +#: ../../library/turtle.rst:599 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:472 +#: ../../library/turtle.rst:599 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:473 +#: ../../library/turtle.rst:600 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:473 +#: ../../library/turtle.rst:600 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:486 +#: ../../library/turtle.rst:613 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:513 +#: ../../library/turtle.rst:640 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:514 ../../library/turtle.rst:607 +#: ../../library/turtle.rst:641 ../../library/turtle.rst:734 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:516 +#: ../../library/turtle.rst:643 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -781,117 +925,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:524 +#: ../../library/turtle.rst:651 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:550 +#: ../../library/turtle.rst:677 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:551 +#: ../../library/turtle.rst:678 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:553 +#: ../../library/turtle.rst:680 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:571 +#: ../../library/turtle.rst:698 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:585 +#: ../../library/turtle.rst:712 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:588 +#: ../../library/turtle.rst:715 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:609 +#: ../../library/turtle.rst:736 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:625 +#: ../../library/turtle.rst:752 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:640 +#: ../../library/turtle.rst:767 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:642 +#: ../../library/turtle.rst:769 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:645 +#: ../../library/turtle.rst:772 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:648 +#: ../../library/turtle.rst:775 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:649 +#: ../../library/turtle.rst:776 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:650 +#: ../../library/turtle.rst:777 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:651 +#: ../../library/turtle.rst:778 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:652 +#: ../../library/turtle.rst:779 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:654 +#: ../../library/turtle.rst:781 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:657 +#: ../../library/turtle.rst:784 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:680 +#: ../../library/turtle.rst:807 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:691 ../../library/turtle.rst:754 +#: ../../library/turtle.rst:818 ../../library/turtle.rst:881 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:692 ../../library/turtle.rst:755 +#: ../../library/turtle.rst:819 ../../library/turtle.rst:882 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:694 +#: ../../library/turtle.rst:821 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -899,116 +1043,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:708 +#: ../../library/turtle.rst:835 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:724 +#: ../../library/turtle.rst:851 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:740 +#: ../../library/turtle.rst:867 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:757 +#: ../../library/turtle.rst:884 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:775 +#: ../../library/turtle.rst:902 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:781 +#: ../../library/turtle.rst:908 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:804 +#: ../../library/turtle.rst:931 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:835 +#: ../../library/turtle.rst:962 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:842 +#: ../../library/turtle.rst:969 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:848 +#: ../../library/turtle.rst:975 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:850 +#: ../../library/turtle.rst:977 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:864 +#: ../../library/turtle.rst:991 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:865 +#: ../../library/turtle.rst:992 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:867 +#: ../../library/turtle.rst:994 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:870 +#: ../../library/turtle.rst:997 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:871 +#: ../../library/turtle.rst:998 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:872 +#: ../../library/turtle.rst:999 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:873 +#: ../../library/turtle.rst:1000 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:874 +#: ../../library/turtle.rst:1001 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:875 +#: ../../library/turtle.rst:1002 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:876 +#: ../../library/turtle.rst:1003 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:877 +#: ../../library/turtle.rst:1004 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:878 +#: ../../library/turtle.rst:1005 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:879 +#: ../../library/turtle.rst:1006 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:881 +#: ../../library/turtle.rst:1008 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1016,182 +1160,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:907 +#: ../../library/turtle.rst:1034 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:925 +#: ../../library/turtle.rst:1052 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:927 ../../library/turtle.rst:976 +#: ../../library/turtle.rst:1054 ../../library/turtle.rst:1103 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:932 +#: ../../library/turtle.rst:1059 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:930 +#: ../../library/turtle.rst:1057 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:936 +#: ../../library/turtle.rst:1063 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:935 +#: ../../library/turtle.rst:1062 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:941 +#: ../../library/turtle.rst:1068 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:939 +#: ../../library/turtle.rst:1066 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:945 +#: ../../library/turtle.rst:1072 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:944 +#: ../../library/turtle.rst:1071 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:947 +#: ../../library/turtle.rst:1074 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:974 +#: ../../library/turtle.rst:1101 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:981 +#: ../../library/turtle.rst:1108 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:979 +#: ../../library/turtle.rst:1106 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:985 +#: ../../library/turtle.rst:1112 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:984 +#: ../../library/turtle.rst:1111 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:990 +#: ../../library/turtle.rst:1117 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:988 +#: ../../library/turtle.rst:1115 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:994 +#: ../../library/turtle.rst:1121 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:993 +#: ../../library/turtle.rst:1120 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:996 +#: ../../library/turtle.rst:1123 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:1017 +#: ../../library/turtle.rst:1144 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:1019 +#: ../../library/turtle.rst:1146 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:1025 +#: ../../library/turtle.rst:1152 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:1023 +#: ../../library/turtle.rst:1150 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:1029 +#: ../../library/turtle.rst:1156 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:1028 +#: ../../library/turtle.rst:1155 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1033 +#: ../../library/turtle.rst:1160 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1032 +#: ../../library/turtle.rst:1159 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1035 +#: ../../library/turtle.rst:1162 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1049 +#: ../../library/turtle.rst:1176 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1063 +#: ../../library/turtle.rst:1190 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1078 +#: ../../library/turtle.rst:1205 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1083 +#: ../../library/turtle.rst:1210 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1085 +#: ../../library/turtle.rst:1212 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1199,36 +1343,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1104 +#: ../../library/turtle.rst:1231 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1125 +#: ../../library/turtle.rst:1252 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1131 +#: ../../library/turtle.rst:1258 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1132 +#: ../../library/turtle.rst:1259 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1133 +#: ../../library/turtle.rst:1260 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1134 +#: ../../library/turtle.rst:1261 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1136 +#: ../../library/turtle.rst:1263 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1236,26 +1380,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1154 +#: ../../library/turtle.rst:1281 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1167 +#: ../../library/turtle.rst:1294 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1177 +#: ../../library/turtle.rst:1304 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1192 +#: ../../library/turtle.rst:1319 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1194 +#: ../../library/turtle.rst:1321 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1265,45 +1409,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1212 +#: ../../library/turtle.rst:1339 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1214 +#: ../../library/turtle.rst:1341 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1218 +#: ../../library/turtle.rst:1345 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1219 +#: ../../library/turtle.rst:1346 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1222 +#: ../../library/turtle.rst:1349 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1224 +#: ../../library/turtle.rst:1351 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1239 ../../library/turtle.rst:1240 -#: ../../library/turtle.rst:1241 +#: ../../library/turtle.rst:1366 ../../library/turtle.rst:1367 +#: ../../library/turtle.rst:1368 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1243 +#: ../../library/turtle.rst:1370 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1313,12 +1457,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1266 ../../library/turtle.rst:1925 -#: ../../library/turtle.rst:1926 ../../library/turtle.rst:1927 +#: ../../library/turtle.rst:1393 ../../library/turtle.rst:2052 +#: ../../library/turtle.rst:2053 ../../library/turtle.rst:2054 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1268 +#: ../../library/turtle.rst:1395 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1327,26 +1471,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1289 +#: ../../library/turtle.rst:1416 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1308 +#: ../../library/turtle.rst:1435 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1328 ../../library/turtle.rst:1351 -#: ../../library/turtle.rst:1352 ../../library/turtle.rst:1353 -#: ../../library/turtle.rst:1354 +#: ../../library/turtle.rst:1455 ../../library/turtle.rst:1478 +#: ../../library/turtle.rst:1479 ../../library/turtle.rst:1480 +#: ../../library/turtle.rst:1481 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1330 +#: ../../library/turtle.rst:1457 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1356,11 +1500,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1356 +#: ../../library/turtle.rst:1483 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1358 +#: ../../library/turtle.rst:1485 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1370,101 +1514,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1380 +#: ../../library/turtle.rst:1507 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1398 ../../library/turtle.rst:1420 -#: ../../library/turtle.rst:1445 ../../library/turtle.rst:1849 +#: ../../library/turtle.rst:1525 ../../library/turtle.rst:1547 +#: ../../library/turtle.rst:1572 ../../library/turtle.rst:1976 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1400 ../../library/turtle.rst:1422 -#: ../../library/turtle.rst:1447 ../../library/turtle.rst:1851 +#: ../../library/turtle.rst:1527 ../../library/turtle.rst:1549 +#: ../../library/turtle.rst:1574 ../../library/turtle.rst:1978 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1401 ../../library/turtle.rst:1423 -#: ../../library/turtle.rst:1448 ../../library/turtle.rst:1852 +#: ../../library/turtle.rst:1528 ../../library/turtle.rst:1550 +#: ../../library/turtle.rst:1575 ../../library/turtle.rst:1979 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1404 +#: ../../library/turtle.rst:1531 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1426 +#: ../../library/turtle.rst:1553 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1451 +#: ../../library/turtle.rst:1578 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1454 +#: ../../library/turtle.rst:1581 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1462 +#: ../../library/turtle.rst:1589 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1471 +#: ../../library/turtle.rst:1598 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1477 +#: ../../library/turtle.rst:1604 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1483 +#: ../../library/turtle.rst:1610 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1502 +#: ../../library/turtle.rst:1629 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1515 +#: ../../library/turtle.rst:1642 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1529 +#: ../../library/turtle.rst:1656 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1543 +#: ../../library/turtle.rst:1670 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1545 +#: ../../library/turtle.rst:1672 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1472,71 +1616,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1558 +#: ../../library/turtle.rst:1685 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1571 +#: ../../library/turtle.rst:1698 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1573 +#: ../../library/turtle.rst:1700 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1577 +#: ../../library/turtle.rst:1704 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1705 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1581 +#: ../../library/turtle.rst:1708 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1592 +#: ../../library/turtle.rst:1719 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1603 +#: ../../library/turtle.rst:1730 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1609 +#: ../../library/turtle.rst:1736 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1611 +#: ../../library/turtle.rst:1738 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1625 +#: ../../library/turtle.rst:1752 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1629 +#: ../../library/turtle.rst:1756 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1644 +#: ../../library/turtle.rst:1771 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1646 +#: ../../library/turtle.rst:1773 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1544,44 +1688,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1662 +#: ../../library/turtle.rst:1789 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1669 +#: ../../library/turtle.rst:1796 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1678 +#: ../../library/turtle.rst:1805 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1812 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1690 +#: ../../library/turtle.rst:1817 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1691 +#: ../../library/turtle.rst:1818 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1692 +#: ../../library/turtle.rst:1819 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1694 +#: ../../library/turtle.rst:1821 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1590,59 +1734,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1706 +#: ../../library/turtle.rst:1833 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1711 +#: ../../library/turtle.rst:1838 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1712 +#: ../../library/turtle.rst:1839 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1713 +#: ../../library/turtle.rst:1840 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1714 +#: ../../library/turtle.rst:1841 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1716 +#: ../../library/turtle.rst:1843 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1720 +#: ../../library/turtle.rst:1847 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1748 +#: ../../library/turtle.rst:1875 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1750 +#: ../../library/turtle.rst:1877 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1754 +#: ../../library/turtle.rst:1881 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1768 ../../library/turtle.rst:1769 +#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1771 +#: ../../library/turtle.rst:1898 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1651,75 +1795,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1791 +#: ../../library/turtle.rst:1918 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1793 +#: ../../library/turtle.rst:1920 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1801 +#: ../../library/turtle.rst:1928 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1808 ../../library/turtle.rst:1828 +#: ../../library/turtle.rst:1935 ../../library/turtle.rst:1955 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1809 ../../library/turtle.rst:1829 +#: ../../library/turtle.rst:1936 ../../library/turtle.rst:1956 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1811 +#: ../../library/turtle.rst:1938 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1831 +#: ../../library/turtle.rst:1958 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1855 +#: ../../library/turtle.rst:1982 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1858 +#: ../../library/turtle.rst:1985 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:1869 +#: ../../library/turtle.rst:1996 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:1876 +#: ../../library/turtle.rst:2003 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:1877 +#: ../../library/turtle.rst:2004 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:1879 +#: ../../library/turtle.rst:2006 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:1897 +#: ../../library/turtle.rst:2024 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1727,12 +1871,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:1910 ../../library/turtle.rst:1911 -#: ../../library/turtle.rst:1923 ../../library/turtle.rst:1924 +#: ../../library/turtle.rst:2037 ../../library/turtle.rst:2038 +#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2051 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:1913 +#: ../../library/turtle.rst:2040 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1740,7 +1884,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:1929 +#: ../../library/turtle.rst:2056 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1751,17 +1895,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:1946 +#: ../../library/turtle.rst:2073 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:1948 +#: ../../library/turtle.rst:2075 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:1951 +#: ../../library/turtle.rst:2078 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1769,121 +1913,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:1957 +#: ../../library/turtle.rst:2084 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:1957 +#: ../../library/turtle.rst:2084 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:1957 +#: ../../library/turtle.rst:2084 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:1959 +#: ../../library/turtle.rst:2086 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:1959 +#: ../../library/turtle.rst:2086 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:1959 +#: ../../library/turtle.rst:2086 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:1960 +#: ../../library/turtle.rst:2087 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:1960 +#: ../../library/turtle.rst:2087 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:1960 +#: ../../library/turtle.rst:2087 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:1973 +#: ../../library/turtle.rst:2100 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:1975 +#: ../../library/turtle.rst:2102 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:1996 +#: ../../library/turtle.rst:2123 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:2009 +#: ../../library/turtle.rst:2136 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:2021 +#: ../../library/turtle.rst:2148 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:2023 +#: ../../library/turtle.rst:2150 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2029 +#: ../../library/turtle.rst:2156 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2032 +#: ../../library/turtle.rst:2159 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2040 +#: ../../library/turtle.rst:2167 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2043 +#: ../../library/turtle.rst:2170 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2049 +#: ../../library/turtle.rst:2176 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2060 +#: ../../library/turtle.rst:2187 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2068 +#: ../../library/turtle.rst:2195 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2077 +#: ../../library/turtle.rst:2204 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2081 +#: ../../library/turtle.rst:2208 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2213 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2089 +#: ../../library/turtle.rst:2216 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -1892,246 +2036,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2098 +#: ../../library/turtle.rst:2225 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2102 +#: ../../library/turtle.rst:2229 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2104 +#: ../../library/turtle.rst:2231 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2106 +#: ../../library/turtle.rst:2233 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2109 +#: ../../library/turtle.rst:2236 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2124 +#: ../../library/turtle.rst:2251 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2127 +#: ../../library/turtle.rst:2254 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2136 +#: ../../library/turtle.rst:2263 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2142 +#: ../../library/turtle.rst:2269 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2145 +#: ../../library/turtle.rst:2272 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2151 +#: ../../library/turtle.rst:2278 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2157 +#: ../../library/turtle.rst:2284 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2159 +#: ../../library/turtle.rst:2286 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2164 +#: ../../library/turtle.rst:2291 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2169 +#: ../../library/turtle.rst:2296 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2172 +#: ../../library/turtle.rst:2299 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2177 +#: ../../library/turtle.rst:2304 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2179 +#: ../../library/turtle.rst:2306 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2184 +#: ../../library/turtle.rst:2311 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2184 +#: ../../library/turtle.rst:2311 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2186 +#: ../../library/turtle.rst:2313 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2186 +#: ../../library/turtle.rst:2313 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2187 +#: ../../library/turtle.rst:2314 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2187 +#: ../../library/turtle.rst:2314 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2188 +#: ../../library/turtle.rst:2315 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2188 +#: ../../library/turtle.rst:2315 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2194 +#: ../../library/turtle.rst:2321 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2195 +#: ../../library/turtle.rst:2322 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2196 +#: ../../library/turtle.rst:2323 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2198 +#: ../../library/turtle.rst:2325 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2208 +#: ../../library/turtle.rst:2335 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2213 +#: ../../library/turtle.rst:2340 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2217 +#: ../../library/turtle.rst:2344 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2219 +#: ../../library/turtle.rst:2346 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2220 +#: ../../library/turtle.rst:2347 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2221 +#: ../../library/turtle.rst:2348 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2222 +#: ../../library/turtle.rst:2349 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2223 +#: ../../library/turtle.rst:2350 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2224 +#: ../../library/turtle.rst:2351 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2228 +#: ../../library/turtle.rst:2355 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2231 +#: ../../library/turtle.rst:2358 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2233 +#: ../../library/turtle.rst:2360 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2237 +#: ../../library/turtle.rst:2364 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2240 +#: ../../library/turtle.rst:2367 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2271 +#: ../../library/turtle.rst:2398 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2305 +#: ../../library/turtle.rst:2432 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2310 +#: ../../library/turtle.rst:2437 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2312 +#: ../../library/turtle.rst:2439 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2318 +#: ../../library/turtle.rst:2445 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2320 +#: ../../library/turtle.rst:2447 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2140,37 +2284,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2326 +#: ../../library/turtle.rst:2453 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2330 +#: ../../library/turtle.rst:2457 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2333 +#: ../../library/turtle.rst:2460 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2339 +#: ../../library/turtle.rst:2466 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2341 +#: ../../library/turtle.rst:2468 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2344 +#: ../../library/turtle.rst:2471 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2179,54 +2323,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2476 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2374 +#: ../../library/turtle.rst:2501 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2376 +#: ../../library/turtle.rst:2503 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2378 +#: ../../library/turtle.rst:2505 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2380 +#: ../../library/turtle.rst:2507 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2382 +#: ../../library/turtle.rst:2509 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2385 +#: ../../library/turtle.rst:2512 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2387 +#: ../../library/turtle.rst:2514 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2390 +#: ../../library/turtle.rst:2517 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2234,301 +2378,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2394 +#: ../../library/turtle.rst:2521 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2525 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2402 +#: ../../library/turtle.rst:2529 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2408 +#: ../../library/turtle.rst:2535 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2540 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2545 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2422 +#: ../../library/turtle.rst:2549 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2424 +#: ../../library/turtle.rst:2551 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2426 +#: ../../library/turtle.rst:2553 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2429 +#: ../../library/turtle.rst:2556 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2432 +#: ../../library/turtle.rst:2559 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2566 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2566 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2566 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2568 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2568 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2441 +#: ../../library/turtle.rst:2568 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2571 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2571 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2444 +#: ../../library/turtle.rst:2571 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2577 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2577 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2450 +#: ../../library/turtle.rst:2577 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:2580 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:2580 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2455 +#: ../../library/turtle.rst:2582 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2455 +#: ../../library/turtle.rst:2582 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2455 +#: ../../library/turtle.rst:2582 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2584 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2584 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2584 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2459 +#: ../../library/turtle.rst:2586 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2459 +#: ../../library/turtle.rst:2586 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2459 +#: ../../library/turtle.rst:2586 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2462 +#: ../../library/turtle.rst:2589 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2462 +#: ../../library/turtle.rst:2589 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2462 +#: ../../library/turtle.rst:2589 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2593 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2593 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2593 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2597 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2470 +#: ../../library/turtle.rst:2597 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2473 +#: ../../library/turtle.rst:2600 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2473 +#: ../../library/turtle.rst:2600 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2473 +#: ../../library/turtle.rst:2600 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2603 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2603 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2479 +#: ../../library/turtle.rst:2606 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2479 +#: ../../library/turtle.rst:2606 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2479 +#: ../../library/turtle.rst:2606 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2482 +#: ../../library/turtle.rst:2609 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2482 +#: ../../library/turtle.rst:2609 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2482 +#: ../../library/turtle.rst:2609 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2485 +#: ../../library/turtle.rst:2612 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2485 +#: ../../library/turtle.rst:2612 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2485 +#: ../../library/turtle.rst:2612 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2489 +#: ../../library/turtle.rst:2616 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2489 +#: ../../library/turtle.rst:2616 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2489 +#: ../../library/turtle.rst:2616 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2492 +#: ../../library/turtle.rst:2619 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2492 +#: ../../library/turtle.rst:2619 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2495 +#: ../../library/turtle.rst:2622 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2495 +#: ../../library/turtle.rst:2622 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2495 +#: ../../library/turtle.rst:2622 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2498 +#: ../../library/turtle.rst:2625 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2498 +#: ../../library/turtle.rst:2625 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2501 +#: ../../library/turtle.rst:2628 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2505 +#: ../../library/turtle.rst:2632 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2507 +#: ../../library/turtle.rst:2634 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2539,14 +2683,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2515 +#: ../../library/turtle.rst:2642 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2520 +#: ../../library/turtle.rst:2647 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2554,11 +2698,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2526 +#: ../../library/turtle.rst:2653 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2528 +#: ../../library/turtle.rst:2655 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2567,29 +2711,46 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2535 +#: ../../library/turtle.rst:2662 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2539 +#: ../../library/turtle.rst:2666 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2543 +#: ../../library/turtle.rst:2670 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2547 +#: ../../library/turtle.rst:2674 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." msgstr "" + +#~ msgid "" +#~ "Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " +#~ "``import turtle``, give it the command ``turtle.forward(15)``, and it " +#~ "moves (on-screen!) 15 pixels in the direction it is facing, drawing a " +#~ "line as it moves. Give it the command ``turtle.right(25)``, and it " +#~ "rotates in-place 25 degrees clockwise." +#~ msgstr "" +#~ "想像一下,一隻機器龜在 x-y 平面上從 (0, 0) 出發。在 ``import turtle`` 之" +#~ "後,給它命令 ``turtle.forward(15)`` ,然後它就會移動 (在螢幕上!) 15 個單" +#~ "位像素,方向是朝著其正面對的方向。給它命令 ``turtle.right(25)`` ,它就會在" +#~ "原地順時針旋轉 25 度。" + +#~ msgid "" +#~ "By combining together these and similar commands, intricate shapes and " +#~ "pictures can easily be drawn." +#~ msgstr "藉由結合這些類似的命令,複雜的形狀和圖形可以輕易被畫出來。" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index c847263e26..7a74c0c444 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -2085,7 +2085,7 @@ msgstr "" msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " -"of :data:`mock.FILTER_DIR`." +"of :const:`mock.FILTER_DIR`." msgstr "" #: ../../library/unittest.mock.rst:2445 diff --git a/library/unittest.po b/library/unittest.po index d5217d9c62..f01c6aabbf 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1415,8 +1415,8 @@ msgstr "" #: ../../library/unittest.rst:1135 ../../library/unittest.rst:1176 msgid "" "If given, *level* should be either a numeric logging level or its string " -"equivalent (for example either ``\"ERROR\"`` or :attr:`logging.ERROR`). The " -"default is :attr:`logging.INFO`." +"equivalent (for example either ``\"ERROR\"`` or :const:`logging.ERROR`). " +"The default is :const:`logging.INFO`." msgstr "" #: ../../library/unittest.rst:1139 diff --git a/library/urllib.request.po b/library/urllib.request.po index f56cb246a9..1fe64855ad 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-10 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -65,7 +65,9 @@ msgstr ":mod:`urllib.request` module 定義下列函式:" msgid "" "Open *url*, which can be either a string containing a valid, properly " "encoded URL, or a :class:`Request` object." -msgstr "打開 *url*,其值可以是一個包含有效且適當編碼 URL 的字串或是一個 :class:`Request` 物件。" +msgstr "" +"打開 *url*,其值可以是一個包含有效且適當編碼 URL 的字串或是一個 :class:" +"`Request` 物件。" #: ../../library/urllib.request.rst:34 msgid "" @@ -217,10 +219,10 @@ msgstr "新增 *cafile* 與 *capath*。" #: ../../library/urllib.request.rst:100 msgid "" -"HTTPS virtual hosts are now supported if possible (that is, if :data:`ssl." +"HTTPS virtual hosts are now supported if possible (that is, if :const:`ssl." "HAS_SNI` is true)." msgstr "" -"HTTPS 虛擬主機 (virtual hosts) 現已支援,只要 :data:`ssl.HAS_SNI` 的值為 " +"HTTPS 虛擬主機 (virtual hosts) 現已支援,只要 :const:`ssl.HAS_SNI` 的值為 " "true。" #: ../../library/urllib.request.rst:104 diff --git a/library/venv.po b/library/venv.po index 7fc6344d40..8fab2532c7 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,7 +232,7 @@ msgstr "" msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`python` will " +"directory to your :envvar:`PATH`, so that running :program:`python` will " "invoke the environment's Python interpreter and you can run installed " "scripts without having to use their full path. The invocation of the " "activation script is platform-specific (:samp:`{}` must be replaced by " @@ -326,11 +326,11 @@ msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, i.e. :" "samp:`#!/{}/bin/python`. This means that the script will run " -"with that interpreter regardless of the value of :envvar:`!PATH`. On " -"Windows, \"shebang\" line processing is supported if you have the :ref:" -"`launcher` installed. Thus, double-clicking an installed script in a Windows " -"Explorer window should run it with the correct interpreter without the " -"environment needing to be activated or on the :envvar:`!PATH`." +"with that interpreter regardless of the value of :envvar:`PATH`. On Windows, " +"\"shebang\" line processing is supported if you have the :ref:`launcher` " +"installed. Thus, double-clicking an installed script in a Windows Explorer " +"window should run it with the correct interpreter without the environment " +"needing to be activated or on the :envvar:`PATH`." msgstr "" #: ../../library/venv.rst:108 diff --git a/library/xml.po b/library/xml.po index 74d112e540..d0e4a72d2d 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -177,7 +177,7 @@ msgstr "" msgid "" "Expat 2.4.1 and newer is not vulnerable to the \"billion laughs\" and " "\"quadratic blowup\" vulnerabilities. Items still listed as vulnerable due " -"to potential reliance on system-provided libraries. Check :data:`pyexpat." +"to potential reliance on system-provided libraries. Check :const:`pyexpat." "EXPAT_VERSION`." msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index cff2aabb19..ceedd48bd8 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1971,7 +1971,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1843 msgid "" -"a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" +"a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" #: ../../reference/compound_stmts.rst:1844 @@ -2020,7 +2020,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1862 msgid "" -"a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" +"a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" #: ../../reference/compound_stmts.rst:1865 diff --git a/reference/datamodel.po b/reference/datamodel.po index 6ed88a3876..2b6ac3d721 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -2971,8 +2971,8 @@ msgstr "" #: ../../reference/datamodel.rst:2502 msgid "" -"In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " -"length is larger than :attr:`!sys.maxsize` some features (such as :func:" +"In CPython, the length is required to be at most :data:`sys.maxsize`. If the " +"length is larger than :data:`!sys.maxsize` some features (such as :func:" "`len`) may raise :exc:`OverflowError`. To prevent raising :exc:`!" "OverflowError` by truth value testing, an object must define a :meth:" "`__bool__` method." diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 0ca8185c5b..53cd3fc8a7 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -605,242 +605,246 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:552 +#: ../../reference/lexical_analysis.rst:554 +msgid "Escape sequences" +msgstr "跳脫序列" + +#: ../../reference/lexical_analysis.rst:556 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:557 -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:594 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:557 -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:594 msgid "Meaning" msgstr "" -#: ../../reference/lexical_analysis.rst:557 -#: ../../reference/lexical_analysis.rst:590 +#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:594 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:563 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:563 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:563 msgid "\\(1)" msgstr "\\(1)" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:565 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:561 +#: ../../reference/lexical_analysis.rst:565 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:567 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:567 msgid "Single quote (``'``)" msgstr "" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:569 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:569 msgid "Double quote (``\"``)" msgstr "" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:571 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:567 +#: ../../reference/lexical_analysis.rst:571 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:573 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:573 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:575 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:577 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:577 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:579 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:579 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:581 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:581 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:583 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:579 +#: ../../reference/lexical_analysis.rst:583 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:585 msgid "``\\ooo``" msgstr "``\\ooo``" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:585 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:581 +#: ../../reference/lexical_analysis.rst:585 msgid "(2,4)" msgstr "(2,4)" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "``\\xhh``" msgstr "``\\xhh``" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:588 msgid "(3,4)" msgstr "(3,4)" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:591 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:592 +#: ../../reference/lexical_analysis.rst:596 msgid "``\\N{name}``" msgstr "``\\N{name}``" -#: ../../reference/lexical_analysis.rst:592 +#: ../../reference/lexical_analysis.rst:596 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:592 +#: ../../reference/lexical_analysis.rst:596 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:595 +#: ../../reference/lexical_analysis.rst:599 msgid "``\\uxxxx``" msgstr "``\\uxxxx``" -#: ../../reference/lexical_analysis.rst:595 +#: ../../reference/lexical_analysis.rst:599 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:595 +#: ../../reference/lexical_analysis.rst:599 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:598 +#: ../../reference/lexical_analysis.rst:602 msgid "``\\Uxxxxxxxx``" msgstr "``\\Uxxxxxxxx``" -#: ../../reference/lexical_analysis.rst:598 +#: ../../reference/lexical_analysis.rst:602 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:598 +#: ../../reference/lexical_analysis.rst:602 msgid "\\(7)" msgstr "\\(7)" -#: ../../reference/lexical_analysis.rst:602 +#: ../../reference/lexical_analysis.rst:606 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:605 +#: ../../reference/lexical_analysis.rst:609 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:611 +#: ../../reference/lexical_analysis.rst:615 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:616 +#: ../../reference/lexical_analysis.rst:620 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:622 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:622 +#: ../../reference/lexical_analysis.rst:626 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`SyntaxWarning`. In a future Python version they will be eventually a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:628 +#: ../../reference/lexical_analysis.rst:632 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:631 +#: ../../reference/lexical_analysis.rst:635 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:636 +#: ../../reference/lexical_analysis.rst:640 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:640 +#: ../../reference/lexical_analysis.rst:644 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:643 +#: ../../reference/lexical_analysis.rst:647 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:649 +#: ../../reference/lexical_analysis.rst:653 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 " @@ -850,17 +854,17 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:656 +#: ../../reference/lexical_analysis.rst:660 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:659 +#: ../../reference/lexical_analysis.rst:663 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will be eventually a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:663 +#: ../../reference/lexical_analysis.rst:667 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 " @@ -873,11 +877,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:676 +#: ../../reference/lexical_analysis.rst:680 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:678 +#: ../../reference/lexical_analysis.rst:682 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -887,7 +891,7 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:689 +#: ../../reference/lexical_analysis.rst:693 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -897,11 +901,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:714 msgid "Formatted string literals" msgstr "" -#: ../../reference/lexical_analysis.rst:714 +#: ../../reference/lexical_analysis.rst:718 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 " @@ -910,14 +914,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:720 +#: ../../reference/lexical_analysis.rst:724 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:734 +#: ../../reference/lexical_analysis.rst:738 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -930,7 +934,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:744 +#: ../../reference/lexical_analysis.rst:748 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -944,20 +948,20 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:761 +#: ../../reference/lexical_analysis.rst:765 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:766 +#: ../../reference/lexical_analysis.rst:770 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:770 +#: ../../reference/lexical_analysis.rst:774 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -968,18 +972,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:778 +#: ../../reference/lexical_analysis.rst:782 msgid "The equal sign ``'='``." msgstr "" -#: ../../reference/lexical_analysis.rst:781 +#: ../../reference/lexical_analysis.rst:785 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:785 +#: ../../reference/lexical_analysis.rst:789 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 " @@ -988,7 +992,7 @@ msgid "" "whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:791 +#: ../../reference/lexical_analysis.rst:795 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -997,117 +1001,117 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:797 +#: ../../reference/lexical_analysis.rst:801 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:800 +#: ../../reference/lexical_analysis.rst:804 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:832 +#: ../../reference/lexical_analysis.rst:836 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:839 +#: ../../reference/lexical_analysis.rst:843 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:843 +#: ../../reference/lexical_analysis.rst:847 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:853 +#: ../../reference/lexical_analysis.rst:857 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:857 +#: ../../reference/lexical_analysis.rst:861 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:868 +#: ../../reference/lexical_analysis.rst:872 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:875 +#: ../../reference/lexical_analysis.rst:879 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:881 +#: ../../reference/lexical_analysis.rst:885 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:885 +#: ../../reference/lexical_analysis.rst:889 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:899 +#: ../../reference/lexical_analysis.rst:903 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:901 +#: ../../reference/lexical_analysis.rst:905 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:915 +#: ../../reference/lexical_analysis.rst:919 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:918 +#: ../../reference/lexical_analysis.rst:922 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:922 +#: ../../reference/lexical_analysis.rst:926 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:926 +#: ../../reference/lexical_analysis.rst:930 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:932 -#: ../../reference/lexical_analysis.rst:964 +#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:968 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:943 +#: ../../reference/lexical_analysis.rst:947 msgid "Floating point literals" msgstr "" -#: ../../reference/lexical_analysis.rst:945 +#: ../../reference/lexical_analysis.rst:949 msgid "" "Floating point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:955 +#: ../../reference/lexical_analysis.rst:959 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 " @@ -1116,19 +1120,19 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:960 +#: ../../reference/lexical_analysis.rst:964 msgid "Some examples of floating point literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:973 +#: ../../reference/lexical_analysis.rst:977 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:975 +#: ../../reference/lexical_analysis.rst:979 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:980 +#: ../../reference/lexical_analysis.rst:984 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 " @@ -1137,23 +1141,23 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:992 +#: ../../reference/lexical_analysis.rst:996 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:996 +#: ../../reference/lexical_analysis.rst:1000 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:1009 +#: ../../reference/lexical_analysis.rst:1013 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1013 +#: ../../reference/lexical_analysis.rst:1017 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:1022 +#: ../../reference/lexical_analysis.rst:1026 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 " @@ -1161,23 +1165,23 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:1027 +#: ../../reference/lexical_analysis.rst:1031 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:1034 +#: ../../reference/lexical_analysis.rst:1038 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:1043 +#: ../../reference/lexical_analysis.rst:1047 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1044 +#: ../../reference/lexical_analysis.rst:1048 msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" @@ -1397,7 +1401,7 @@ msgid "f'" msgstr "f'" #: ../../reference/lexical_analysis.rst:522 -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" @@ -1469,138 +1473,138 @@ msgstr "\\u" msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:647 +#: ../../reference/lexical_analysis.rst:651 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:700 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:877 -#: ../../reference/lexical_analysis.rst:890 +#: ../../reference/lexical_analysis.rst:881 +#: ../../reference/lexical_analysis.rst:894 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "floating point literal" msgstr "floating point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:877 +#: ../../reference/lexical_analysis.rst:881 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:890 +#: ../../reference/lexical_analysis.rst:894 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:890 +#: ../../reference/lexical_analysis.rst:894 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:890 +#: ../../reference/lexical_analysis.rst:894 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:890 -#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:894 +#: ../../reference/lexical_analysis.rst:940 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:890 -#: ../../reference/lexical_analysis.rst:936 -#: ../../reference/lexical_analysis.rst:968 +#: ../../reference/lexical_analysis.rst:894 +#: ../../reference/lexical_analysis.rst:940 +#: ../../reference/lexical_analysis.rst:972 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:940 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:936 +#: ../../reference/lexical_analysis.rst:940 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:968 +#: ../../reference/lexical_analysis.rst:972 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:994 +#: ../../reference/lexical_analysis.rst:998 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1011 +#: ../../reference/lexical_analysis.rst:1015 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 41275b3e85..17d4264089 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-18 00:46+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,11 +29,10 @@ msgstr "深入了解流程控制" #: ../../tutorial/controlflow.rst:7 msgid "" -"Besides the :keyword:`while` statement just introduced, Python uses the " -"usual flow control statements known from other languages, with some twists." +"As well as the :keyword:`while` statement just introduced, Python uses a few " +"more that we will encounter in this chapter." msgstr "" -"除了剛才介紹的 :keyword:`while`,Python 擁有在其他程式語言中常用的流程控制語" -"法,並有一些不一樣的改變。" +"除了剛才介紹的 :keyword:`while`,這章節還會介紹一些 Python 的陳述式語法。" #: ../../tutorial/controlflow.rst:14 msgid ":keyword:`!if` Statements" @@ -197,28 +196,45 @@ msgstr "" #: ../../tutorial/controlflow.rst:166 msgid "" -"The :keyword:`break` statement, like in C, breaks out of the innermost " -"enclosing :keyword:`for` or :keyword:`while` loop." +"The :keyword:`break` statement breaks out of the innermost enclosing :" +"keyword:`for` or :keyword:`while` loop." msgstr "" -":keyword:`break` 陳述式,如同 C 語言,終止包含它的最內部 :keyword:`for` 或 :" +":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :" "keyword:`while` 迴圈。" #: ../../tutorial/controlflow.rst:169 msgid "" -"Loop statements may have an :keyword:`!else` clause; it is executed when the " -"loop terminates through exhaustion of the iterable (with :keyword:`for`) or " -"when the condition becomes false (with :keyword:`while`), but not when the " -"loop is terminated by a :keyword:`break` statement. This is exemplified by " -"the following loop, which searches for prime numbers::" +"A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " +"clause." +msgstr "" +":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` " +"子句" + +#: ../../tutorial/controlflow.rst:171 +msgid "" +"In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " +"loop reaches its final iteration." +msgstr "" + +#: ../../tutorial/controlflow.rst:174 +msgid "" +"In a :keyword:`while` loop, it's executed after the loop's condition becomes " +"false." +msgstr "" + +#: ../../tutorial/controlflow.rst:176 +msgid "" +"In either kind of loop, the :keyword:`!else` clause is **not** executed if " +"the loop was terminated by a :keyword:`break`." +msgstr "" + +#: ../../tutorial/controlflow.rst:179 +msgid "" +"This is exemplified in the following :keyword:`!for` loop, which searches " +"for prime numbers::" msgstr "" -"迴圈陳述式可以帶有一個 :keyword:`!else` 子句。當迴圈用盡所有的 iterable " -"(在 :keyword:`for` 中)或條件為假(在 :keyword:`while` 中)時,這個子句會被" -"執行;但迴圈被 :keyword:`break` 陳述式終止時則不會執行。底下尋找質數的迴圈即" -"示範了這個行為:\n" -"\n" -"::" -#: ../../tutorial/controlflow.rst:193 +#: ../../tutorial/controlflow.rst:200 msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " "to the :keyword:`for` loop, **not** the :keyword:`if` statement.)" @@ -226,7 +242,7 @@ msgstr "" "(沒錯,這是正確的程式碼。請看仔細:``else`` 子句屬於 :keyword:`for` 迴圈,**" "並非** :keyword:`if` 陳述式。)" -#: ../../tutorial/controlflow.rst:196 +#: ../../tutorial/controlflow.rst:203 msgid "" "When used with a loop, the ``else`` clause has more in common with the " "``else`` clause of a :keyword:`try` statement than it does with that of :" @@ -241,7 +257,7 @@ msgstr "" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" "\\ :ref:`tut-handling`\\ 。" -#: ../../tutorial/controlflow.rst:203 +#: ../../tutorial/controlflow.rst:210 msgid "" "The :keyword:`continue` statement, also borrowed from C, continues with the " "next iteration of the loop::" @@ -250,11 +266,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:224 +#: ../../tutorial/controlflow.rst:231 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:226 +#: ../../tutorial/controlflow.rst:233 msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" @@ -264,14 +280,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:233 +#: ../../tutorial/controlflow.rst:240 msgid "This is commonly used for creating minimal classes::" msgstr "" "這經常用於建立簡單的 class(類別):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:239 +#: ../../tutorial/controlflow.rst:246 msgid "" "Another place :keyword:`pass` can be used is as a place-holder for a " "function or conditional body when you are working on new code, allowing you " @@ -283,11 +299,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:251 +#: ../../tutorial/controlflow.rst:258 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 陳述式" -#: ../../tutorial/controlflow.rst:253 +#: ../../tutorial/controlflow.rst:260 msgid "" "A :keyword:`match` statement takes an expression and compares its value to " "successive patterns given as one or more case blocks. This is superficially " @@ -303,7 +319,7 @@ msgstr "" "言中的模式匹配 (pattern matching) 更為相近。只有第一個匹配成功的模式會被執" "行,而它也可以將成分(序列元素或物件屬性)從值中提取到變數中。" -#: ../../tutorial/controlflow.rst:261 +#: ../../tutorial/controlflow.rst:268 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" @@ -312,7 +328,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:274 +#: ../../tutorial/controlflow.rst:281 msgid "" "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " "never fails to match. If no case matches, none of the branches is executed." @@ -320,7 +336,7 @@ msgstr "" "請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角" "色,且永遠不會匹配失敗。如果沒有 case 匹配成功,則不會執行任何的分支。" -#: ../../tutorial/controlflow.rst:277 +#: ../../tutorial/controlflow.rst:284 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" @@ -328,7 +344,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:282 +#: ../../tutorial/controlflow.rst:289 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" @@ -337,7 +353,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:298 +#: ../../tutorial/controlflow.rst:305 msgid "" "Study that one carefully! The first pattern has two literals, and can be " "thought of as an extension of the literal pattern shown above. But the next " @@ -351,7 +367,7 @@ msgstr "" "(bind)*\\ 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在" "概念上類似於拆解賦值 ``(x, y) = point``。" -#: ../../tutorial/controlflow.rst:305 +#: ../../tutorial/controlflow.rst:312 msgid "" "If you are using classes to structure your data you can use the class name " "followed by an argument list resembling a constructor, but with the ability " @@ -362,7 +378,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:327 +#: ../../tutorial/controlflow.rst:334 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -378,7 +394,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:338 +#: ../../tutorial/controlflow.rst:345 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " @@ -394,7 +410,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:345 +#: ../../tutorial/controlflow.rst:352 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" @@ -404,7 +420,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:366 +#: ../../tutorial/controlflow.rst:373 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -416,11 +432,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:376 +#: ../../tutorial/controlflow.rst:383 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:378 +#: ../../tutorial/controlflow.rst:385 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -429,7 +445,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:382 +#: ../../tutorial/controlflow.rst:389 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -441,7 +457,7 @@ msgstr "" "是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" "的其餘項。" -#: ../../tutorial/controlflow.rst:387 +#: ../../tutorial/controlflow.rst:394 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -453,14 +469,14 @@ msgstr "" "模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" "援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:392 +#: ../../tutorial/controlflow.rst:399 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" "使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:396 +#: ../../tutorial/controlflow.rst:403 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -468,7 +484,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:399 +#: ../../tutorial/controlflow.rst:406 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -476,7 +492,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:402 +#: ../../tutorial/controlflow.rst:409 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -486,18 +502,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:421 +#: ../../tutorial/controlflow.rst:428 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:427 +#: ../../tutorial/controlflow.rst:434 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:429 +#: ../../tutorial/controlflow.rst:436 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -506,7 +522,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:449 +#: ../../tutorial/controlflow.rst:456 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -516,7 +532,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:454 +#: ../../tutorial/controlflow.rst:461 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -532,7 +548,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:468 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -553,7 +569,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:472 +#: ../../tutorial/controlflow.rst:479 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -568,7 +584,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:479 +#: ../../tutorial/controlflow.rst:486 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -581,7 +597,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:490 +#: ../../tutorial/controlflow.rst:497 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -598,7 +614,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:501 +#: ../../tutorial/controlflow.rst:508 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -607,11 +623,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:517 +#: ../../tutorial/controlflow.rst:524 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:519 +#: ../../tutorial/controlflow.rst:526 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -621,7 +637,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:523 +#: ../../tutorial/controlflow.rst:530 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -643,22 +659,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:538 +#: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:540 +#: ../../tutorial/controlflow.rst:547 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:547 +#: ../../tutorial/controlflow.rst:554 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:549 +#: ../../tutorial/controlflow.rst:556 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -669,22 +685,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:565 +#: ../../tutorial/controlflow.rst:572 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:567 +#: ../../tutorial/controlflow.rst:574 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:569 +#: ../../tutorial/controlflow.rst:576 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:571 +#: ../../tutorial/controlflow.rst:578 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -692,14 +708,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:574 +#: ../../tutorial/controlflow.rst:581 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:577 +#: ../../tutorial/controlflow.rst:584 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -708,11 +724,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:588 +#: ../../tutorial/controlflow.rst:595 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:590 +#: ../../tutorial/controlflow.rst:597 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -725,24 +741,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:603 +#: ../../tutorial/controlflow.rst:610 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:609 +#: ../../tutorial/controlflow.rst:616 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:622 +#: ../../tutorial/controlflow.rst:629 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:624 +#: ../../tutorial/controlflow.rst:631 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -753,7 +769,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:633 +#: ../../tutorial/controlflow.rst:640 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -764,14 +780,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:644 +#: ../../tutorial/controlflow.rst:651 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:651 +#: ../../tutorial/controlflow.rst:658 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -789,7 +805,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:667 +#: ../../tutorial/controlflow.rst:674 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -807,31 +823,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:684 +#: ../../tutorial/controlflow.rst:691 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:692 +#: ../../tutorial/controlflow.rst:699 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:705 +#: ../../tutorial/controlflow.rst:712 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:709 +#: ../../tutorial/controlflow.rst:716 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:711 +#: ../../tutorial/controlflow.rst:718 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -843,11 +859,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:717 +#: ../../tutorial/controlflow.rst:724 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:728 +#: ../../tutorial/controlflow.rst:735 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -858,22 +874,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:735 +#: ../../tutorial/controlflow.rst:742 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:737 +#: ../../tutorial/controlflow.rst:744 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:742 +#: ../../tutorial/controlflow.rst:749 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:744 +#: ../../tutorial/controlflow.rst:751 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -888,17 +904,17 @@ msgstr "" "``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" "式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:752 +#: ../../tutorial/controlflow.rst:759 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:756 +#: ../../tutorial/controlflow.rst:763 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:758 +#: ../../tutorial/controlflow.rst:765 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -907,11 +923,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:764 +#: ../../tutorial/controlflow.rst:771 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:766 +#: ../../tutorial/controlflow.rst:773 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -920,7 +936,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:782 +#: ../../tutorial/controlflow.rst:789 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -931,7 +947,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:792 +#: ../../tutorial/controlflow.rst:799 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -940,7 +956,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:803 +#: ../../tutorial/controlflow.rst:810 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -949,7 +965,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:814 +#: ../../tutorial/controlflow.rst:821 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -958,7 +974,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:834 +#: ../../tutorial/controlflow.rst:841 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -969,7 +985,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:839 +#: ../../tutorial/controlflow.rst:846 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -979,7 +995,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:848 +#: ../../tutorial/controlflow.rst:855 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -990,17 +1006,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:856 +#: ../../tutorial/controlflow.rst:863 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:861 +#: ../../tutorial/controlflow.rst:868 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:863 +#: ../../tutorial/controlflow.rst:870 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -1009,11 +1025,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:867 +#: ../../tutorial/controlflow.rst:874 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:869 +#: ../../tutorial/controlflow.rst:876 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1025,7 +1041,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:874 +#: ../../tutorial/controlflow.rst:881 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1034,7 +1050,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:877 +#: ../../tutorial/controlflow.rst:884 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1042,11 +1058,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:883 +#: ../../tutorial/controlflow.rst:890 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:888 +#: ../../tutorial/controlflow.rst:895 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1059,7 +1075,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:897 +#: ../../tutorial/controlflow.rst:904 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1073,11 +1089,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:914 +#: ../../tutorial/controlflow.rst:921 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:916 +#: ../../tutorial/controlflow.rst:923 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1093,7 +1109,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:932 +#: ../../tutorial/controlflow.rst:939 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -1102,11 +1118,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:948 +#: ../../tutorial/controlflow.rst:955 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:950 +#: ../../tutorial/controlflow.rst:957 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -1123,7 +1139,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:967 +#: ../../tutorial/controlflow.rst:974 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1133,17 +1149,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:979 +#: ../../tutorial/controlflow.rst:986 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:986 +#: ../../tutorial/controlflow.rst:993 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:989 +#: ../../tutorial/controlflow.rst:996 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -1155,7 +1171,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:995 +#: ../../tutorial/controlflow.rst:1002 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -1165,7 +1181,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:1000 +#: ../../tutorial/controlflow.rst:1007 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -1187,18 +1203,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1012 +#: ../../tutorial/controlflow.rst:1019 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:1030 +#: ../../tutorial/controlflow.rst:1037 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1038 +#: ../../tutorial/controlflow.rst:1045 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -1207,7 +1223,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1042 +#: ../../tutorial/controlflow.rst:1049 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1227,11 +1243,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:1064 +#: ../../tutorial/controlflow.rst:1071 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1069 +#: ../../tutorial/controlflow.rst:1076 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1244,7 +1260,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1075 +#: ../../tutorial/controlflow.rst:1082 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1254,11 +1270,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1080 +#: ../../tutorial/controlflow.rst:1087 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1082 +#: ../../tutorial/controlflow.rst:1089 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1267,11 +1283,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1086 +#: ../../tutorial/controlflow.rst:1093 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1088 +#: ../../tutorial/controlflow.rst:1095 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1279,21 +1295,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1091 +#: ../../tutorial/controlflow.rst:1098 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1094 +#: ../../tutorial/controlflow.rst:1101 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1096 +#: ../../tutorial/controlflow.rst:1103 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1098 +#: ../../tutorial/controlflow.rst:1105 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1301,7 +1317,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:1101 +#: ../../tutorial/controlflow.rst:1108 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1313,7 +1329,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1106 +#: ../../tutorial/controlflow.rst:1113 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1322,7 +1338,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1117 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1331,11 +1347,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1116 +#: ../../tutorial/controlflow.rst:1123 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1117 +#: ../../tutorial/controlflow.rst:1124 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1353,54 +1369,68 @@ msgstr "statement(陳述式)" msgid "for" msgstr "for" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 msgid "documentation strings" msgstr "ddocumentation strings(說明字串)" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 msgid "docstrings" msgstr "docstrings(說明字串)" -#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 +#: ../../tutorial/controlflow.rst:451 ../../tutorial/controlflow.rst:988 msgid "strings, documentation" msgstr "strings(字串), documentation(說明文件)" -#: ../../tutorial/controlflow.rst:885 +#: ../../tutorial/controlflow.rst:892 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../tutorial/controlflow.rst:885 ../../tutorial/controlflow.rst:929 +#: ../../tutorial/controlflow.rst:892 ../../tutorial/controlflow.rst:936 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../tutorial/controlflow.rst:929 +#: ../../tutorial/controlflow.rst:936 msgid "**" msgstr "**" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid "function" msgstr "function(函式)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid "annotations" msgstr "annotations(註釋)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid "->" msgstr "->" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../tutorial/controlflow.rst:1033 +#: ../../tutorial/controlflow.rst:1040 msgid ": (colon)" msgstr ": (冒號)" -#: ../../tutorial/controlflow.rst:1067 +#: ../../tutorial/controlflow.rst:1074 msgid "coding" msgstr "coding(程式編寫)" -#: ../../tutorial/controlflow.rst:1067 +#: ../../tutorial/controlflow.rst:1074 msgid "style" msgstr "style(風格)" + +#~ msgid "" +#~ "Loop statements may have an :keyword:`!else` clause; it is executed when " +#~ "the loop terminates through exhaustion of the iterable (with :keyword:" +#~ "`for`) or when the condition becomes false (with :keyword:`while`), but " +#~ "not when the loop is terminated by a :keyword:`break` statement. This is " +#~ "exemplified by the following loop, which searches for prime numbers::" +#~ msgstr "" +#~ "迴圈陳述式可以帶有一個 :keyword:`!else` 子句。當迴圈用盡所有的 iterable " +#~ "(在 :keyword:`for` 中)或條件為假(在 :keyword:`while` 中)時,這個子句會" +#~ "被執行;但迴圈被 :keyword:`break` 陳述式終止時則不會執行。底下尋找質數的迴" +#~ "圈即示範了這個行為:\n" +#~ "\n" +#~ "::" diff --git a/tutorial/errors.po b/tutorial/errors.po index 6b9aa8b3f9..03f2b2aea4 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-06 16:53+0000\n" +"POT-Creation-Date: 2023-07-22 13:42+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -647,7 +647,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:564 +#: ../../tutorial/errors.rst:573 msgid "" "Note that the exceptions nested in an exception group must be instances, not " "types. This is because in practice the exceptions would typically be ones " @@ -659,11 +659,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:584 +#: ../../tutorial/errors.rst:593 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:586 +#: ../../tutorial/errors.rst:595 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -681,7 +681,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:607 +#: ../../tutorial/errors.rst:616 msgid "" "For example, when collecting exceptions into an exception group, we may want " "to add context information for the individual errors. In the following each " diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 8edf83b47d..9c7facf927 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -94,13 +94,12 @@ msgstr "數字 (Number)" msgid "" "The interpreter acts as a simple calculator: you can type an expression at " "it and it will write the value. Expression syntax is straightforward: the " -"operators ``+``, ``-``, ``*`` and ``/`` work just like in most other " -"languages (for example, Pascal or C); parentheses (``()``) can be used for " -"grouping. For example::" +"operators ``+``, ``-``, ``*`` and ``/`` can be used to perform arithmetic; " +"parentheses (``()``) can be used for grouping. For example::" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" -"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 的行為如" -"同大多數的程式語言(例如:Pascal 或 C);括號 ``()`` 可以用來分群。例如:\n" +"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以" +"用來執行運算;括號 ``()`` 可以用來分群。例如:\n" "\n" "::" diff --git a/tutorial/modules.po b/tutorial/modules.po index 76876ade7d..14e3459cad 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -701,6 +701,16 @@ msgstr "" #: ../../tutorial/modules.rst:515 msgid "" +"Be aware that submodules might become shadowed by locally defined names. For " +"example, if you added a ``reverse`` function to the :file:`sound/effects/" +"__init__.py` file, the ``from sound.effects import *`` would only import the " +"two submodules ``echo`` and ``surround``, but *not* the ``reverse`` " +"submodule, because it is shadowed by the locally defined ``reverse`` " +"function::" +msgstr "" + +#: ../../tutorial/modules.rst:531 +msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " "does *not* import all submodules from the package :mod:`sound.effects` into " "the current namespace; it only ensures that the package :mod:`sound.effects` " @@ -720,7 +730,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:528 +#: ../../tutorial/modules.rst:544 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` " @@ -731,7 +741,7 @@ msgstr "" "`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" -#: ../../tutorial/modules.rst:533 +#: ../../tutorial/modules.rst:549 msgid "" "Although certain modules are designed to export only names that follow " "certain patterns when you use ``import *``, it is still considered bad " @@ -740,7 +750,7 @@ msgstr "" "雖然,有些特定模組的設計,讓你使用 ``import *`` 時,該模組只會輸出遵循特定樣" "式的名稱,但在正式環境 (production) 的程式碼中這仍然被視為是不良習慣。" -#: ../../tutorial/modules.rst:537 +#: ../../tutorial/modules.rst:553 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " @@ -750,11 +760,11 @@ msgstr "" "記住,使用 ``from package import specific_submodule`` 不會有任何問題!實際" "上,這是推薦用法,除非 import 的模組需要用到的子模組和其他套件的子模組同名。" -#: ../../tutorial/modules.rst:546 +#: ../../tutorial/modules.rst:562 msgid "Intra-package References" msgstr "套件內引用" -#: ../../tutorial/modules.rst:548 +#: ../../tutorial/modules.rst:564 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 " @@ -767,7 +777,7 @@ msgstr "" "filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" "以用 ``from sound.effects import echo``\\ 。" -#: ../../tutorial/modules.rst:554 +#: ../../tutorial/modules.rst:570 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 " @@ -780,7 +790,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:563 +#: ../../tutorial/modules.rst:579 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 " @@ -791,11 +801,11 @@ msgstr "" "``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" "必須永遠使用絕對 import。" -#: ../../tutorial/modules.rst:569 +#: ../../tutorial/modules.rst:585 msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" -#: ../../tutorial/modules.rst:571 +#: ../../tutorial/modules.rst:587 msgid "" "Packages support one more special attribute, :attr:`__path__`. This is " "initialized to be a list containing the name of the directory holding the " @@ -808,17 +818,17 @@ msgstr "" "執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" "尋。" -#: ../../tutorial/modules.rst:577 +#: ../../tutorial/modules.rst:593 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:582 +#: ../../tutorial/modules.rst:598 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:583 +#: ../../tutorial/modules.rst:599 msgid "" "In fact function definitions are also 'statements' that are 'executed'; the " "execution of a module-level function definition adds the function name to " diff --git a/using/cmdline.po b/using/cmdline.po index 93c7ea1621..fe3c4326c9 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1127,15 +1127,15 @@ msgstr "" #: ../../using/cmdline.rst:899 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " -"domains (:c:data:`PYMEM_DOMAIN_RAW`, :c:data:`PYMEM_DOMAIN_MEM`, :c:data:" +"domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" #: ../../using/cmdline.rst:902 msgid "" -"``pymalloc``: use the :ref:`pymalloc allocator ` for :c:data:" -"`PYMEM_DOMAIN_MEM` and :c:data:`PYMEM_DOMAIN_OBJ` domains and use the :c:" -"func:`malloc` function for the :c:data:`PYMEM_DOMAIN_RAW` domain." +"``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" +"`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" +"func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" #: ../../using/cmdline.rst:906 diff --git a/using/configure.po b/using/configure.po index f3d411598c..27c4a13987 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -158,7 +158,7 @@ msgstr "" #: ../../using/configure.rst:100 msgid "" -"Select the default time zone search path for :data:`zoneinfo.TZPATH`. See " +"Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" @@ -180,7 +180,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:115 -msgid "See :data:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." +msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" #: ../../using/configure.rst:121 diff --git a/using/windows.po b/using/windows.po index e1a214f851..a0ab02d8eb 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1974,7 +1974,7 @@ msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " "finder is enabled on Windows in 3.6.0 and earlier, but may need to be " -"explicitly added to :attr:`sys.meta_path` in the future." +"explicitly added to :data:`sys.meta_path` in the future." msgstr "" #: ../../using/windows.rst:1207 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 30a564b02f..f96663c5b7 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1315,11 +1315,11 @@ msgstr "" #: ../../whatsnew/2.2.rst:1108 msgid "" -"Two new flags :const:`METH_NOARGS` and :const:`METH_O` are available in " +"Two new flags :c:macro:`METH_NOARGS` and :c:macro:`METH_O` are available in " "method definition tables to simplify implementation of methods with no " "arguments or a single untyped argument. Calling such methods is more " -"efficient than calling a corresponding method that uses :const:" -"`METH_VARARGS`. Also, the old :const:`METH_OLDARGS` style of writing C " +"efficient than calling a corresponding method that uses :c:macro:" +"`METH_VARARGS`. Also, the old :c:macro:`METH_OLDARGS` style of writing C " "methods is now officially deprecated." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index f1c4771d15..e0ace5f079 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1639,7 +1639,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1477 msgid "" -"The value of the C :const:`PYTHON_API_VERSION` macro is now exposed at the " +"The value of the C :c:macro:`PYTHON_API_VERSION` macro is now exposed at the " "Python level as ``sys.api_version``. The current exception can be cleared " "by calling the new :func:`sys.exc_clear` function." msgstr "" @@ -2085,11 +2085,11 @@ msgstr "" msgid "" "The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it " "should be changed. For Python 2.2 and later, the method definition table " -"can specify the :const:`METH_NOARGS` flag, signalling that there are no " +"can specify the :c:macro:`METH_NOARGS` flag, signalling that there are no " "arguments, and the argument checking can then be removed. If compatibility " "with pre-2.2 versions of Python is important, the code could use " "``PyArg_ParseTuple(args, \"\")`` instead, but this will be slower than " -"using :const:`METH_NOARGS`." +"using :c:macro:`METH_NOARGS`." msgstr "" #: ../../whatsnew/2.3.rst:1907 @@ -2117,8 +2117,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1920 msgid "" "It's now possible to define class and static methods for a C extension type " -"by setting either the :const:`METH_CLASS` or :const:`METH_STATIC` flags in a " -"method's :c:type:`PyMethodDef` structure." +"by setting either the :c:macro:`METH_CLASS` or :c:macro:`METH_STATIC` flags " +"in a method's :c:type:`PyMethodDef` structure." msgstr "" #: ../../whatsnew/2.3.rst:1924 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 24df76b1b2..64d2ceea80 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1682,7 +1682,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1479 msgid "" -"A new method flag, :const:`METH_COEXISTS`, allows a function defined in " +"A new method flag, :c:macro:`METH_COEXISTS`, allows a function defined in " "slots to co-exist with a :c:type:`PyCFunction` having the same name. This " "can halve the access time for a method such as :meth:`set.__contains__`. " "(Contributed by Raymond Hettinger.)" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 280d2215b6..6c31bbe5f3 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1692,9 +1692,9 @@ msgstr "" #: ../../whatsnew/2.5.rst:1451 msgid "" -"Constants named :attr:`os.SEEK_SET`, :attr:`os.SEEK_CUR`, and :attr:`os." +"Constants named :const:`os.SEEK_SET`, :const:`os.SEEK_CUR`, and :const:`os." "SEEK_END` have been added; these are the parameters to the :func:`os.lseek` " -"function. Two new constants for locking are :attr:`os.O_SHLOCK` and :attr:" +"function. Two new constants for locking are :const:`os.O_SHLOCK` and :const:" "`os.O_EXLOCK`." msgstr "" @@ -1912,7 +1912,7 @@ msgstr "" msgid "" "The :mod:`unicodedata` module has been updated to use version 4.1.0 of the " "Unicode character database. Version 3.2.0 is required by some " -"specifications, so it's still available as :attr:`unicodedata.ucd_3_2_0`." +"specifications, so it's still available as :data:`unicodedata.ucd_3_2_0`." msgstr "" #: ../../whatsnew/2.5.rst:1607 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 13c0bdb9c6..a241c7b6a9 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -1269,17 +1269,17 @@ msgid "" msgstr "" #: ../../whatsnew/2.6.rst:1141 -msgid ":const:`PyBUF_WRITABLE` indicates that the memory must be writable." +msgid ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." msgstr "" #: ../../whatsnew/2.6.rst:1143 msgid "" -":const:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." +":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." msgstr "" #: ../../whatsnew/2.6.rst:1145 msgid "" -":const:`PyBUF_C_CONTIGUOUS` and :const:`PyBUF_F_CONTIGUOUS` requests a C-" +":c:macro:`PyBUF_C_CONTIGUOUS` and :c:macro:`PyBUF_F_CONTIGUOUS` requests a C-" "contiguous (last dimension varies the fastest) or Fortran-contiguous (first " "dimension varies the fastest) array layout." msgstr "" @@ -2550,8 +2550,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:2291 msgid "" -"The :mod:`select` module now has wrapper functions for the Linux :c:func:" -"`epoll` and BSD :c:func:`kqueue` system calls. :meth:`modify` method was " +"The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" +"epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " "added to the existing :class:`poll` objects; ``pollobj.modify(fd, " "eventmask)`` takes a file descriptor or file object and an event mask, " "modifying the recorded event mask for that file. (Contributed by Christian " @@ -2597,8 +2597,8 @@ msgid "" "Event loops will use this by opening a pipe to create two descriptors, one " "for reading and one for writing. The writable descriptor will be passed to :" "func:`set_wakeup_fd`, and the readable descriptor will be added to the list " -"of descriptors monitored by the event loop via :c:func:`select` or :c:func:" -"`poll`. On receiving a signal, a byte will be written and the main event " +"of descriptors monitored by the event loop via :c:func:`!select` or :c:func:" +"`!poll`. On receiving a signal, a byte will be written and the main event " "loop will be woken up, avoiding the need to poll." msgstr "" @@ -3328,7 +3328,8 @@ msgstr "" msgid "" "Python now must be compiled with C89 compilers (after 19 years!). This " "means that the Python source tree has dropped its own implementations of :c:" -"func:`memmove` and :c:func:`strerror`, which are in the C89 standard library." +"func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " +"library." msgstr "" #: ../../whatsnew/2.6.rst:2988 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 544d6d6604..6f410de620 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -436,7 +436,7 @@ msgstr "" msgid "" "This means Python now supports three different modules for parsing command-" "line arguments: :mod:`getopt`, :mod:`optparse`, and :mod:`argparse`. The :" -"mod:`getopt` module closely resembles the C library's :c:func:`getopt` " +"mod:`getopt` module closely resembles the C library's :c:func:`!getopt` " "function, so it remains useful if you're writing a Python prototype that " "will eventually be rewritten in C. :mod:`optparse` becomes redundant, but " "there are no plans to remove it because there are many scripts still using " @@ -1739,8 +1739,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:1558 msgid "" "The version of OpenSSL being used is now available as the module attributes :" -"data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl.OPENSSL_VERSION_INFO` (a 5-" -"tuple), and :data:`ssl.OPENSSL_VERSION_NUMBER` (an integer). (Added by " +"const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl.OPENSSL_VERSION_INFO` (a " +"5-tuple), and :const:`ssl.OPENSSL_VERSION_NUMBER` (an integer). (Added by " "Antoine Pitrou; :issue:`8321`.)" msgstr "" @@ -2614,7 +2614,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2232 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " -"type, Python will no longer let you try to delete or set a :const:" +"type, Python will no longer let you try to delete or set a :c:macro:" "`T_STRING_INPLACE` attribute." msgstr "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index c5163c63e0..74bd83bd96 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-26 00:21+0000\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -438,7 +438,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.1.rst:373 -msgid "The :attr:`sys.version_info` tuple is now a named tuple::" +msgid "The :data:`sys.version_info` tuple is now a named tuple::" msgstr "" #: ../../whatsnew/3.1.rst:378 @@ -613,7 +613,7 @@ msgstr "" msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " -"new :attr:`sys.int_info` that provides information about the internal " +"new :data:`sys.int_info` that provides information about the internal " "format, giving the number of bits per digit and the size in bytes of the C " "type used to store each digit::" msgstr "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 3a1ebe876f..2fa09db3b8 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1134,8 +1134,8 @@ msgid "New Modules" msgstr "新模組" #: ../../whatsnew/3.10.rst:890 -msgid "None yet." -msgstr "還沒有出現。" +msgid "None." +msgstr "無。" #: ../../whatsnew/3.10.rst:894 msgid "Improved Modules" @@ -1795,13 +1795,13 @@ msgstr "" #: ../../whatsnew/3.10.rst:1256 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`.)" +"Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :" +"issue:`43106`.)" msgstr "" -"為 macOS 新增 :data:`~os.O_EVTONLY`、:data:`~os.O_FSYNC`、:data:`~os." -"O_SYMLINK` 和 :data:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:`43106` " -"中貢獻。)" +"為 macOS 新增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os." +"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:" +"`43106` 中貢獻。)" #: ../../whatsnew/3.10.rst:1261 msgid "os.path" @@ -1928,13 +1928,13 @@ msgstr "shelve" #: ../../whatsnew/3.10.rst:1322 msgid "" -"The :mod:`shelve` module now uses :data:`pickle.DEFAULT_PROTOCOL` by default " -"instead of :mod:`pickle` protocol ``3`` when creating shelves. (Contributed " -"by Zackery Spytz in :issue:`34204`.)" +"The :mod:`shelve` module now uses :const:`pickle.DEFAULT_PROTOCOL` by " +"default instead of :mod:`pickle` protocol ``3`` when creating shelves. " +"(Contributed by Zackery Spytz in :issue:`34204`.)" msgstr "" -"現在,:mod:`shelve` 模組在建立 shelve 時預設使用 :data:`pickle." -"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz 在 :" -"issue:`34204` 中貢獻。)" +"現在,:mod:`shelve` 模組在建立 shelve 時預設使用 :const:`pickle." +"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz " +"在 :issue:`34204` 中貢獻。)" #: ../../whatsnew/3.10.rst:1327 msgid "statistics" @@ -1997,14 +1997,14 @@ msgstr "" #: ../../whatsnew/3.10.rst:1358 msgid "" "The ssl module has preliminary support for OpenSSL 3.0.0 and new option :" -"data:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian Heimes in :" +"const:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian Heimes in :" "issue:`38820`, :issue:`43794`, :issue:`43788`, :issue:`43791`, :issue:" "`43799`, :issue:`43920`, :issue:`43789`, and :issue:`43811`.)" msgstr "" -"ssl 模組初步支援 OpenSSL 3.0.0 和新選項 :data:`~ssl." -"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:issue:" -"`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:`43920`、:" -"issue:`43789` 和 :issue:`43811` 貢獻。)" +"ssl 模組初步支援 OpenSSL 3.0.0 和新選項 :const:`~ssl." +"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:" +"issue:`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:" +"`43920`、:issue:`43789` 和 :issue:`43811` 貢獻。)" #: ../../whatsnew/3.10.rst:1364 msgid "" @@ -2064,10 +2064,10 @@ msgstr "" #: ../../whatsnew/3.10.rst:1390 msgid "" -"A new verify flag :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " +"A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" msgstr "" -"新增驗證旗標 :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" +"新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" "`40849` 中貢獻。)" #: ../../whatsnew/3.10.rst:1394 @@ -2112,12 +2112,12 @@ msgstr "_thread" #: ../../whatsnew/3.10.rst:1415 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " -"simulate (the default is still :data:`signal.SIGINT`). (Contributed by " +"simulate (the default is still :const:`signal.SIGINT`). (Contributed by " "Antoine Pitrou in :issue:`43356`.)" msgstr "" -":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設值仍" -"然是 :data:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" -"獻。)" +":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設" +"值仍然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1420 msgid "threading" @@ -2493,6 +2493,7 @@ msgstr "" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" #: ../../whatsnew/3.10.rst:1608 +#, fuzzy msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2508,6 +2509,16 @@ msgid "" "appropriate to help identify code which needs updating during this " "transition." msgstr "" +"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語" +"義。具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" +"`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." +"find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" +"`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." +"module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." +"parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " +"``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" +"`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :" +"exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" #: ../../whatsnew/3.10.rst:1625 msgid "" @@ -2567,6 +2578,12 @@ msgid "" "respectively. You can use :func:`importlib.util.spec_from_loader` to help in " "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" +"引入系統使用 :meth:`!importlib.abc.MetaPathFinder.find_module` 和 :!meth:" +"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:" +"`ImportWarning`,因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :" +"meth:`importlib.abc.PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :" +"func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :" +"issue:`42134` 中貢獻。)" #: ../../whatsnew/3.10.rst:1657 msgid "" @@ -2576,6 +2593,10 @@ msgid "" "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :issue:" "`43672`.)" msgstr "" +"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸" +"發 :exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder." +"find_spec` 是首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫" +"助移植。(由 Brett Cannon 在 :issue:`43672` 中貢獻。)" #: ../../whatsnew/3.10.rst:1663 msgid "" @@ -2591,6 +2612,17 @@ msgid "" "removal in Python 3.12 (previously they were documented as deprecated in " "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" +":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" +"`!importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." +"machinery.FrozenImporter.find_module`、:meth:`!importlib.machinery." +"WindowsRegistryFinder.find_module`、:meth:`!importlib.machinery.PathFinder." +"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:" +"`!importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." +"FileFinder.find_module` ) 和 :meth:`!importlib.abc.PathEntryFinder." +"find_loader` (:meth:`!importlib.machinery.FileFinder.find_loader` ) 現在引" +"發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " +"Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1678 msgid "" @@ -2600,6 +2632,10 @@ msgid "" "should inherit from one of these two classes as appropriate instead. " "(Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" +":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :" +"meth:`!find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :" +"class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需" +"求來選擇其一以繼承。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1685 msgid "" @@ -2611,6 +2647,12 @@ msgid "" "exc:`DeprecationWarning` in previous versions of Python). (Contributed by " "Brett Cannon in :issue:`43720`.)" msgstr "" +"棄用 :mod:`!imp`、:func:`!importlib.find_loader`、:func:`!importlib.util." +"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:" +"`!importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :" +"class:`!pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本" +"(它們開始在過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 " +"Brett Cannon 在 :issue:`43720` 中貢獻。)" #: ../../whatsnew/3.10.rst:1695 msgid "" @@ -2619,6 +2661,10 @@ msgid "" "Removal of the use of ``module_repr()`` is scheduled for Python 3.12. " "(Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" +"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:`!module_repr`" +" 作為模組的 ``__repr__()`` 方法。計劃" +"在 Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :" +"issue:`42137` 中貢獻。)" #: ../../whatsnew/3.10.rst:1701 msgid "" @@ -2627,6 +2673,10 @@ msgid "" "module_repr` are deprecated and slated for removal in Python 3.12. " "(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" +":meth:`!importlib.abc.Loader.module_repr`、:meth:`!importlib.machinery." +"FrozenLoader.module_repr` 和 :meth:`!importlib.machinery.BuiltinLoader." +"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :" +"issue:`42136` 中貢獻。)" #: ../../whatsnew/3.10.rst:1707 msgid "" @@ -2737,15 +2787,15 @@ msgstr "" msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." -"PROTOCOL_TLSv1_1`, :data:`~ssl.PROTOCOL_TLSv1_2`, and :data:`~ssl." -"PROTOCOL_TLS` are deprecated in favor of :data:`~ssl.PROTOCOL_TLS_CLIENT` " -"and :data:`~ssl.PROTOCOL_TLS_SERVER`" +"PROTOCOL_TLSv1_1`, :data:`~ssl.PROTOCOL_TLSv1_2`, and :const:`~ssl." +"PROTOCOL_TLS` are deprecated in favor of :const:`~ssl.PROTOCOL_TLS_CLIENT` " +"and :const:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" ":data:`~ssl.PROTOCOL_SSLv2`、:data:`~ssl.PROTOCOL_SSLv3`、:data:`~ssl." "PROTOCOL_SSLv23`、:data:`~ssl.PROTOCOL_TLSv1`、:data:`~ssl." -"PROTOCOL_TLSv1_1`、:data:`~ssl.PROTOCOL_TLSv1_2` 和 :data:`~ssl." -"PROTOCOL_TLS` 已棄用,取而代之的是 :data:`~ssl.PROTOCOL_TLS_CLIENT` 和 :data:" -"`~ssl.PROTOCOL_TLS_SERVER`" +"PROTOCOL_TLSv1_1`、:data:`~ssl.PROTOCOL_TLSv1_2` 和 :const:`~ssl." +"PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` 和 :" +"const:`~ssl.PROTOCOL_TLS_SERVER`" #: ../../whatsnew/3.10.rst:1763 msgid "" @@ -3467,21 +3517,21 @@ msgstr "" #: ../../whatsnew/3.10.rst:2127 msgid "" -"Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " +"Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" msgstr "" -"新增 :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實例。" -"(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" +"新增 :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實" +"例。(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" #: ../../whatsnew/3.10.rst:2131 msgid "" -"Add a new :c:data:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " +"Add a new :c:macro:`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 "" -"新增 :c:data:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無法" -"設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 43908 號中貢" -"獻。)" +"新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無" +"法設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:`43908` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:2138 msgid "" @@ -3591,16 +3641,16 @@ msgstr "" #: ../../whatsnew/3.10.rst:2190 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 " -"type object is mutable or not; check if :c:data:`Py_TPFLAGS_IMMUTABLETYPE` " +"Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " +"type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " +"type object is mutable or not; check if :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` " "is set instead. (Contributed by Victor Stinner and Erlend E. Aasland in :" "issue:`43908`.)" msgstr "" -"使用 :c:data:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要依" -"賴 :c:data:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否設定" -"了 :c:data:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " -"Aasland 在 :issue:`35134` 中貢獻。)" +"使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要" +"依賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否" +"設定了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend " +"E. Aasland 在 :issue:`35134` 中貢獻。)" #: ../../whatsnew/3.10.rst:2196 msgid "" @@ -3900,135 +3950,3 @@ msgid "" msgstr "" "為了 Python 最佳化,已刪除 ``PyThreadState.use_tracing`` 成員。(由 Mark " "Shannon 在 :issue:`43760` 中貢獻。)" - -#~ msgid "" -#~ "Starting in this release, there will be a concerted effort to begin " -#~ "cleaning up old import semantics that were kept for Python 2.7 " -#~ "compatibility. Specifically, :meth:`~importlib.abc.PathEntryFinder." -#~ "find_loader`/:meth:`~importlib.abc.Finder.find_module` (superseded by :" -#~ "meth:`~importlib.abc.Finder.find_spec`), :meth:`~importlib.abc.Loader." -#~ "load_module` (superseded by :meth:`~importlib.abc.Loader.exec_module`), :" -#~ "meth:`~importlib.abc.Loader.module_repr` (which the import system takes " -#~ "care of for you), the ``__package__`` attribute (superseded by ``__spec__." -#~ "parent``), the ``__loader__`` attribute (superseded by ``__spec__." -#~ "loader``), and the ``__cached__`` attribute (superseded by ``__spec__." -#~ "cached``) will slowly be removed (as well as other classes and methods " -#~ "in :mod:`importlib`). :exc:`ImportWarning` and/or :exc:" -#~ "`DeprecationWarning` will be raised as appropriate to help identify code " -#~ "which needs updating during this transition." -#~ msgstr "" -#~ "從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語" -#~ "義。具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" -#~ "`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." -#~ "find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" -#~ "`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." -#~ "module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." -#~ "parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " -#~ "``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" -#~ "`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :" -#~ "exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" - -#~ msgid "" -#~ "The use of :meth:`importlib.abc.MetaPathFinder.find_module` and :meth:" -#~ "`importlib.abc.PathEntryFinder.find_module` by the import system now " -#~ "trigger an :exc:`ImportWarning` as :meth:`importlib.abc.MetaPathFinder." -#~ "find_spec` and :meth:`importlib.abc.PathEntryFinder.find_spec` are " -#~ "preferred, respectively. You can use :func:`importlib.util." -#~ "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :" -#~ "issue:`42134`.)" -#~ msgstr "" -#~ "引入系統使用 :meth:`importlib.abc.MetaPathFinder.find_module` 和 :meth:" -#~ "`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:" -#~ "`ImportWarning` 作為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :" -#~ "meth:`importlib.abc.PathEntryFinder.find_spec` 分別是首選。你可以使用 :" -#~ "func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :" -#~ "issue:`42134` 中貢獻。)" - -#~ msgid "" -#~ "The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the " -#~ "import system now triggers an :exc:`ImportWarning` as :meth:`importlib." -#~ "abc.PathEntryFinder.find_spec` is preferred. You can use :func:`importlib." -#~ "util.spec_from_loader` to help in porting. (Contributed by Brett Cannon " -#~ "in :issue:`43672`.)" -#~ msgstr "" -#~ "引入系統使用 :meth:`importlib.abc.PathEntryFinder.find_loader` 現在會觸" -#~ "發 :exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder." -#~ "find_spec` 是首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫" -#~ "助移植。(由 Brett Cannon 在 :issue:`43672` 中貢獻。)" - -#~ msgid "" -#~ "The various implementations of :meth:`importlib.abc.MetaPathFinder." -#~ "find_module` ( :meth:`importlib.machinery.BuiltinImporter.find_module`, :" -#~ "meth:`importlib.machinery.FrozenImporter.find_module`, :meth:`importlib." -#~ "machinery.WindowsRegistryFinder.find_module`, :meth:`importlib.machinery." -#~ "PathFinder.find_module`, :meth:`importlib.abc.MetaPathFinder." -#~ "find_module` ), :meth:`importlib.abc.PathEntryFinder.find_module` ( :meth:" -#~ "`importlib.machinery.FileFinder.find_module` ), and :meth:`importlib.abc." -#~ "PathEntryFinder.find_loader` ( :meth:`importlib.machinery.FileFinder." -#~ "find_loader` ) now raise :exc:`DeprecationWarning` and are slated for " -#~ "removal in Python 3.12 (previously they were documented as deprecated in " -#~ "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" -#~ msgstr "" -#~ ":meth:`importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" -#~ "`importlib.machinery.BuiltinImporter.find_module`、:meth:`importlib." -#~ "machinery.FrozenImporter.find_module`、:meth:`importlib.machinery." -#~ "WindowsRegistryFinder.find_module`、:meth:`importlib.machinery.PathFinder." -#~ "find_module`、:meth:`importlib.abc.MetaPathFinder.find_module` )、:meth:" -#~ "`importlib.abc.PathEntryFinder.find_module` (:meth:`importlib.machinery." -#~ "FileFinder.find_module` ) 和 :meth:`importlib.abc.PathEntryFinder." -#~ "find_loader` (:meth:`importlib.machinery.FileFinder.find_loader` ) 現在引" -#~ "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " -#~ "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢" -#~ "獻。)" - -#~ msgid "" -#~ ":class:`importlib.abc.Finder` is deprecated (including its sole method, :" -#~ "meth:`~importlib.abc.Finder.find_module`). Both :class:`importlib.abc." -#~ "MetaPathFinder` and :class:`importlib.abc.PathEntryFinder` no longer " -#~ "inherit from the class. Users should inherit from one of these two " -#~ "classes as appropriate instead. (Contributed by Brett Cannon in :issue:" -#~ "`42135`.)" -#~ msgstr "" -#~ ":class:`importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`~importlib." -#~ "abc.Finder.find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :" -#~ "class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需" -#~ "求來選擇其一以繼承。 (由 Brett Cannon 在 :issue:`42135` 中貢獻。)" - -#~ msgid "" -#~ "The deprecations of :mod:`imp`, :func:`importlib.find_loader`, :func:" -#~ "`importlib.util.set_package_wrapper`, :func:`importlib.util." -#~ "set_loader_wrapper`, :func:`importlib.util.module_for_loader`, :class:" -#~ "`pkgutil.ImpImporter`, and :class:`pkgutil.ImpLoader` have all been " -#~ "updated to list Python 3.12 as the slated version of removal (they began " -#~ "raising :exc:`DeprecationWarning` in previous versions of Python). " -#~ "(Contributed by Brett Cannon in :issue:`43720`.)" -#~ msgstr "" -#~ "棄用 :mod:`imp`、:func:`importlib.find_loader`、:func:`importlib.util." -#~ "set_package_wrapper`、:func:`importlib.util.set_loader_wrapper`、:func:" -#~ "`importlib.util.module_for_loader`、:class:`pkgutil.ImpImporter` 和 :" -#~ "class:`pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本" -#~ "(它們開始在過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 " -#~ "Brett Cannon 在 :issue:`43720` 中貢獻。)" - -#~ 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 " -#~ "``__repr__()`` method. Removal of the use of ``module_repr()`` is " -#~ "scheduled for Python 3.12. (Contributed by Brett Cannon in :issue:" -#~ "`42137`.)" -#~ msgstr "" -#~ "引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:" -#~ "`~importlib.abc.Loader.module_repr` 作為模組的 ``__repr__()`` 方法。計劃" -#~ "在 Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :" -#~ "issue:`42137` 中貢獻。)" - -#~ msgid "" -#~ ":meth:`importlib.abc.Loader.module_repr`, :meth:`importlib.machinery." -#~ "FrozenLoader.module_repr`, and :meth:`importlib.machinery.BuiltinLoader." -#~ "module_repr` are deprecated and slated for removal in Python 3.12. " -#~ "(Contributed by Brett Cannon in :issue:`42136`.)" -#~ msgstr "" -#~ ":meth:`importlib.abc.Loader.module_repr`、:meth:`importlib.machinery." -#~ "FrozenLoader.module_repr` 和 :meth:`importlib.machinery.BuiltinLoader." -#~ "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :" -#~ "issue:`42136` 中貢獻。)" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 4c78387594..4b7eda8345 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -924,10 +924,10 @@ msgstr "datetime" #: ../../whatsnew/3.11.rst:643 msgid "" -"Add :attr:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." +"Add :const:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" msgstr "" -"新增 :attr:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" +"新增 :const:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" "(由 Kabir Kwatra 於 :gh:`91973` 所貢獻。)" #: ../../whatsnew/3.11.rst:646 @@ -1025,12 +1025,12 @@ msgid "" "Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" "`~object.__repr__` and :meth:`~object.__str__` to show values as members of " "their module rather than the enum class. For example, ``'re.ASCII'`` for " -"the :data:`~re.ASCII` member of :class:`re.RegexFlag` rather than " +"the :const:`~re.ASCII` member of :class:`re.RegexFlag` rather than " "``'RegexFlag.ASCII'``." msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " "和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" -"`re.RegexFlag` 的 :data:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." "ASCII'``。" #: ../../whatsnew/3.11.rst:696 @@ -1617,14 +1617,14 @@ msgstr "threading" msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " -"the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the timeout, rather " -"than using the system clock (:data:`time.CLOCK_REALTIME`), to not be " +"the monotonic clock (:const:`time.CLOCK_MONOTONIC`) for the timeout, rather " +"than using the system clock (:const:`time.CLOCK_REALTIME`), to not be " "affected by system clock changes. (Contributed by Victor Stinner in :issue:" "`41710`.)" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" "本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" -"data:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:data:" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:const:" "`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" "issue:`41710` 中貢獻。)" @@ -3241,13 +3241,13 @@ msgstr "" #: ../../whatsnew/3.11.rst:1814 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " -"corresponding :data:`!re.TEMPLATE` and :data:`!re.T` flags are deprecated, " +"corresponding :const:`!re.TEMPLATE` and :const:`!re.T` flags are deprecated, " "as they were undocumented and lacked an obvious purpose. They will be " "removed in Python 3.13. (Contributed by Serhiy Storchaka and Miro Hrončok " "in :gh:`92728`.)" msgstr "" -"在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :data:`!re.TEMPLATE` " -"和 :data:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它們" +"在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " +"和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它們" "將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" "`92728` 中貢獻。)" @@ -4243,12 +4243,12 @@ msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2230 msgid "" -"Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " +"Added the :c:func:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " "available directly (via :c:type:`PyCMethod`). (Contributed by Petr Viktorin " "in :issue:`46613`.)" msgstr "" -"新增 :c:data:`PyType_GetModuleByDef` 函式,它將被用於取得定義一個方法的模組," +"新增 :c:func:`PyType_GetModuleByDef` 函式,它將被用於取得定義一個方法的模組," "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" @@ -4430,23 +4430,23 @@ msgstr "" #: ../../whatsnew/3.11.rst:2349 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " -"with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" -"c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" +"with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " +"(:c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" "issue:`44263`.)" msgstr "" -"如果一個型別是以 :const:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " +"如果一個型別是以 :c:macro:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " "(traverse function) (:c:member:`PyTypeObject.tp_traverse`),那 :c:func:" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" #: ../../whatsnew/3.11.rst:2354 msgid "" -"Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " +"Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" "ref:`static types `. (Contributed by Erlend E. Aasland in :" "issue:`43908`)" msgstr "" -"帶有 :const:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:`590` " +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:`590` " "向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" @@ -5151,80 +5151,3 @@ msgid "" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" - -#~ msgid "Release" -#~ msgstr "發行版本" - -#~ msgid "|release|" -#~ msgstr "|release|" - -#~ msgid "Date" -#~ msgstr "日期" - -#~ msgid "|today|" -#~ msgstr "|today|" - -#~ msgid "The :mod:`imp` module" -#~ msgstr ":mod:`imp` 模組" - -#~ msgid ":func:`importlib.find_loader`" -#~ msgstr ":func:`importlib.find_loader`" - -#~ msgid ":meth:`importlib.abc.Loader.module_repr`" -#~ msgstr ":meth:`importlib.abc.Loader.module_repr`" - -#~ msgid ":meth:`importlib.abc.MetaPathFinder.find_module`" -#~ msgstr ":meth:`importlib.abc.MetaPathFinder.find_module`" - -#~ msgid ":meth:`importlib.abc.PathEntryFinder.find_loader`" -#~ msgstr ":meth:`importlib.abc.PathEntryFinder.find_loader`" - -#~ msgid ":meth:`importlib.abc.PathEntryFinder.find_module`" -#~ msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" - -#~ msgid ":meth:`importlib.machinery.PathFinder.find_module`" -#~ msgstr ":meth:`importlib.machinery.PathFinder.find_module`" - -#~ msgid ":func:`importlib.util.module_for_loader`" -#~ msgstr ":func:`importlib.util.module_for_loader`" - -#~ msgid ":class:`pkgutil.ImpImporter`" -#~ msgstr ":class:`pkgutil.ImpImporter`" - -#~ msgid ":class:`pkgutil.ImpLoader`" -#~ msgstr ":class:`pkgutil.ImpLoader`" - -#~ msgid "" -#~ "Freelists for object structs can now be disabled. A new :program:" -#~ "`configure` option :option:`!--without-freelists` can be used to disable " -#~ "all freelists except empty tuple singleton. (Contributed by Christian " -#~ "Heimes in :issue:`45522`.)" -#~ msgstr "" -#~ "物件結構的空閒列表現在可被禁用。一個新的 :program:`configure` 選項 :" -#~ "option:`!—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。" -#~ "(由 Christian Heimes 在 :issue:`45522` 中貢獻。)" - -#~ msgid "These are not part of the :ref:`limited API `." -#~ msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" - -#~ msgid "Notable Changes in 3.11.4" -#~ msgstr "3.11.4 中值得注意的變更" - -#~ msgid "tarfile" -#~ msgstr "tarfile" - -#~ msgid "" -#~ "The extraction methods in :mod:`tarfile`, and :func:`shutil." -#~ "unpack_archive`, have a new a *filter* argument that allows limiting tar " -#~ "features than may be surprising or dangerous, such as creating files " -#~ "outside the destination directory. See :ref:`tarfile-extraction-filter` " -#~ "for details. In Python 3.12, use without the *filter* argument will show " -#~ "a :exc:`DeprecationWarning`. In Python 3.14, the default will switch to " -#~ "``'data'``. (Contributed by Petr Viktorin in :pep:`706`.)" -#~ msgstr "" -#~ ":mod:`tarfile` 和 :func:`shutil.unpack_archive` 中的提取方法有一個新的 " -#~ "*filter* 引數,它僅允許有限的 tar 功能、停用一些危險的功能,例如在目標目錄" -#~ "之外建立檔案。詳細資訊請參閱 :ref:`tarfile-extraction-filter`。在 Python " -#~ "3.12 中,不帶 *filter* 引數使用將顯示 :exc:`DeprecationWarning`。在 " -#~ "Python 3.14 中會將預設切換為 ``'data'``。(由 Petr Viktorin 在 :pep:`706` " -#~ "中貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 4c021a6ae8..733d5754b4 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -94,21 +94,24 @@ msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" #: ../../whatsnew/3.12.rst:87 -msgid ":pep:`632`: Remove the ``distutils`` package" +msgid "" +":pep:`632`: Remove the ``distutils`` package. See `the migration guide " +"`_ for advice on its " +"replacement." msgstr "" -#: ../../whatsnew/3.12.rst:90 +#: ../../whatsnew/3.12.rst:92 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:92 +#: ../../whatsnew/3.12.rst:94 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:101 +#: ../../whatsnew/3.12.rst:103 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -117,14 +120,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:122 +#: ../../whatsnew/3.12.rst:124 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:132 +#: ../../whatsnew/3.12.rst:134 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -132,15 +135,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:143 ../../whatsnew/3.12.rst:1600 +#: ../../whatsnew/3.12.rst:145 ../../whatsnew/3.12.rst:1594 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:148 +#: ../../whatsnew/3.12.rst:150 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:150 +#: ../../whatsnew/3.12.rst:152 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -149,7 +152,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:155 +#: ../../whatsnew/3.12.rst:157 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -157,7 +160,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:164 +#: ../../whatsnew/3.12.rst:166 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -165,13 +168,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:172 +#: ../../whatsnew/3.12.rst:174 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:178 +#: ../../whatsnew/3.12.rst:180 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -180,7 +183,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:191 +#: ../../whatsnew/3.12.rst:193 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -189,11 +192,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:204 +#: ../../whatsnew/3.12.rst:206 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:206 +#: ../../whatsnew/3.12.rst:208 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -202,7 +205,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:219 +#: ../../whatsnew/3.12.rst:221 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -210,25 +213,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:231 +#: ../../whatsnew/3.12.rst:233 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:238 +#: ../../whatsnew/3.12.rst:240 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:240 +#: ../../whatsnew/3.12.rst:242 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:244 +#: ../../whatsnew/3.12.rst:246 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -236,24 +239,24 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:249 +#: ../../whatsnew/3.12.rst:251 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:251 +#: ../../whatsnew/3.12.rst:253 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:253 +#: ../../whatsnew/3.12.rst:255 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:256 +#: ../../whatsnew/3.12.rst:258 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -263,22 +266,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:263 +#: ../../whatsnew/3.12.rst:265 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:266 +#: ../../whatsnew/3.12.rst:268 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:268 +#: ../../whatsnew/3.12.rst:270 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:272 +#: ../../whatsnew/3.12.rst:274 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -286,46 +289,46 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:279 +#: ../../whatsnew/3.12.rst:281 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:283 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:287 +#: ../../whatsnew/3.12.rst:289 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:291 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:293 +#: ../../whatsnew/3.12.rst:295 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:304 +#: ../../whatsnew/3.12.rst:306 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:306 +#: ../../whatsnew/3.12.rst:308 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "" -#: ../../whatsnew/3.12.rst:309 +#: ../../whatsnew/3.12.rst:311 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:311 +#: ../../whatsnew/3.12.rst:313 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -334,51 +337,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:317 +#: ../../whatsnew/3.12.rst:319 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:335 +#: ../../whatsnew/3.12.rst:337 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "" -#: ../../whatsnew/3.12.rst:340 +#: ../../whatsnew/3.12.rst:342 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:344 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:346 +#: ../../whatsnew/3.12.rst:348 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:359 +#: ../../whatsnew/3.12.rst:361 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:365 +#: ../../whatsnew/3.12.rst:367 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:369 +#: ../../whatsnew/3.12.rst:371 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:378 +#: ../../whatsnew/3.12.rst:380 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -386,7 +389,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:383 +#: ../../whatsnew/3.12.rst:385 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -396,7 +399,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:390 +#: ../../whatsnew/3.12.rst:392 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -405,21 +408,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:396 +#: ../../whatsnew/3.12.rst:398 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:398 +#: ../../whatsnew/3.12.rst:400 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:402 +#: ../../whatsnew/3.12.rst:404 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:404 +#: ../../whatsnew/3.12.rst:406 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -430,7 +433,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:414 +#: ../../whatsnew/3.12.rst:416 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -440,32 +443,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:422 +#: ../../whatsnew/3.12.rst:424 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:426 +#: ../../whatsnew/3.12.rst:428 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:429 +#: ../../whatsnew/3.12.rst:431 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:432 +#: ../../whatsnew/3.12.rst:434 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:436 +#: ../../whatsnew/3.12.rst:438 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -475,7 +478,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:443 +#: ../../whatsnew/3.12.rst:445 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -486,7 +489,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:452 +#: ../../whatsnew/3.12.rst:454 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -494,14 +497,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:458 +#: ../../whatsnew/3.12.rst:460 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:464 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -511,28 +514,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:469 +#: ../../whatsnew/3.12.rst:471 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 +#: ../../whatsnew/3.12.rst:474 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:476 +#: ../../whatsnew/3.12.rst:478 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:480 +#: ../../whatsnew/3.12.rst:482 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -540,33 +543,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:487 +#: ../../whatsnew/3.12.rst:489 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:489 -msgid "None yet." +#: ../../whatsnew/3.12.rst:491 +msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:493 +#: ../../whatsnew/3.12.rst:495 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:496 +#: ../../whatsnew/3.12.rst:498 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:500 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:502 +#: ../../whatsnew/3.12.rst:504 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:504 +#: ../../whatsnew/3.12.rst:506 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -574,7 +577,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:509 +#: ../../whatsnew/3.12.rst:511 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -582,7 +585,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:514 +#: ../../whatsnew/3.12.rst:516 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -590,7 +593,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:519 +#: ../../whatsnew/3.12.rst:521 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -602,7 +605,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:528 +#: ../../whatsnew/3.12.rst:530 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -610,57 +613,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:536 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:540 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:541 +#: ../../whatsnew/3.12.rst:543 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:547 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:550 +#: ../../whatsnew/3.12.rst:552 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:552 +#: ../../whatsnew/3.12.rst:554 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:556 +#: ../../whatsnew/3.12.rst:558 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:558 +#: ../../whatsnew/3.12.rst:560 msgid "" -"Add :data:`~csv.QUOTE_NOTNULL` and :data:`~csv.QUOTE_STRINGS` flags to " +"Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:563 +#: ../../whatsnew/3.12.rst:565 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:565 +#: ../../whatsnew/3.12.rst:567 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -669,47 +672,35 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:574 -msgid "email" -msgstr "email" - #: ../../whatsnew/3.12.rst:576 -msgid "" -":func:`email.utils.getaddresses` and :func:`email.utils.parseaddr` now " -"return ``('', '')`` 2-tuples in more situations where invalid email " -"addresses are encountered instead of potentially inaccurate values. " -"(Contributed by Thomas Dwyer for :gh:`102988` to ameliorate CVE-2023-27043.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:582 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:584 +#: ../../whatsnew/3.12.rst:578 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:582 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:590 +#: ../../whatsnew/3.12.rst:584 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:594 +#: ../../whatsnew/3.12.rst:588 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:598 +#: ../../whatsnew/3.12.rst:592 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -717,60 +708,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:604 +#: ../../whatsnew/3.12.rst:598 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:606 +#: ../../whatsnew/3.12.rst:600 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:611 +#: ../../whatsnew/3.12.rst:605 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:613 +#: ../../whatsnew/3.12.rst:607 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:610 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:621 +#: ../../whatsnew/3.12.rst:615 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:623 +#: ../../whatsnew/3.12.rst:617 msgid "" -"Add :data:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" +"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:627 +#: ../../whatsnew/3.12.rst:621 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:631 +#: ../../whatsnew/3.12.rst:625 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:635 +#: ../../whatsnew/3.12.rst:629 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -783,27 +774,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:646 +#: ../../whatsnew/3.12.rst:640 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:648 +#: ../../whatsnew/3.12.rst:642 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:645 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:655 +#: ../../whatsnew/3.12.rst:649 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:657 +#: ../../whatsnew/3.12.rst:651 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -811,14 +802,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:662 +#: ../../whatsnew/3.12.rst:656 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:666 +#: ../../whatsnew/3.12.rst:660 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -826,13 +817,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:671 +#: ../../whatsnew/3.12.rst:665 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:668 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -840,38 +831,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:673 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:681 +#: ../../whatsnew/3.12.rst:675 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:687 +#: ../../whatsnew/3.12.rst:681 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:689 +#: ../../whatsnew/3.12.rst:683 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:692 +#: ../../whatsnew/3.12.rst:686 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:696 +#: ../../whatsnew/3.12.rst:690 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:698 +#: ../../whatsnew/3.12.rst:692 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -879,7 +870,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:698 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -887,14 +878,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:710 +#: ../../whatsnew/3.12.rst:704 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:715 +#: ../../whatsnew/3.12.rst:709 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -902,24 +893,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:714 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:720 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:728 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:731 +#: ../../whatsnew/3.12.rst:725 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -927,36 +918,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:732 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:737 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:749 +#: ../../whatsnew/3.12.rst:743 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:751 +#: ../../whatsnew/3.12.rst:745 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:756 +#: ../../whatsnew/3.12.rst:750 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:758 +#: ../../whatsnew/3.12.rst:752 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -966,7 +957,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 +#: ../../whatsnew/3.12.rst:761 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -975,34 +966,34 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:773 ../../whatsnew/3.12.rst:1510 +#: ../../whatsnew/3.12.rst:767 ../../whatsnew/3.12.rst:1504 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:778 +#: ../../whatsnew/3.12.rst:772 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:780 +#: ../../whatsnew/3.12.rst:774 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:782 +#: ../../whatsnew/3.12.rst:776 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:788 +#: ../../whatsnew/3.12.rst:782 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:790 +#: ../../whatsnew/3.12.rst:784 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1010,11 +1001,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:796 +#: ../../whatsnew/3.12.rst:790 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:798 +#: ../../whatsnew/3.12.rst:792 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1024,11 +1015,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:807 +#: ../../whatsnew/3.12.rst:801 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:809 +#: ../../whatsnew/3.12.rst:803 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1036,22 +1027,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:815 +#: ../../whatsnew/3.12.rst:809 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:817 +#: ../../whatsnew/3.12.rst:811 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:822 +#: ../../whatsnew/3.12.rst:816 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:818 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1064,7 +1055,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:835 +#: ../../whatsnew/3.12.rst:829 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1072,13 +1063,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:851 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:860 +#: ../../whatsnew/3.12.rst:854 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1089,71 +1080,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:862 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:872 +#: ../../whatsnew/3.12.rst:866 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:870 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:872 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:882 +#: ../../whatsnew/3.12.rst:876 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:884 +#: ../../whatsnew/3.12.rst:878 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:900 +#: ../../whatsnew/3.12.rst:894 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "" -#: ../../whatsnew/3.12.rst:903 +#: ../../whatsnew/3.12.rst:897 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:905 +#: ../../whatsnew/3.12.rst:899 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:910 +#: ../../whatsnew/3.12.rst:904 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.12.rst:912 +#: ../../whatsnew/3.12.rst:906 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:916 +#: ../../whatsnew/3.12.rst:910 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:920 +#: ../../whatsnew/3.12.rst:914 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1161,13 +1152,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:925 +#: ../../whatsnew/3.12.rst:919 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:928 +#: ../../whatsnew/3.12.rst:922 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1175,18 +1166,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:927 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:933 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:941 +#: ../../whatsnew/3.12.rst:935 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1194,20 +1185,20 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:946 +#: ../../whatsnew/3.12.rst:940 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:949 +#: ../../whatsnew/3.12.rst:943 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:952 +#: ../../whatsnew/3.12.rst:946 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1216,136 +1207,150 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:952 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:962 +#: ../../whatsnew/3.12.rst:956 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:964 +#: ../../whatsnew/3.12.rst:958 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:969 +#: ../../whatsnew/3.12.rst:963 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:976 ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:970 ../../whatsnew/3.12.rst:1869 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.12.rst:978 +#: ../../whatsnew/3.12.rst:972 +msgid "" +":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " +"event loop policy now emits a :exc:`DeprecationWarning` if there is no " +"current event loop set and it decides to create one. (Contributed by Serhiy " +"Storchaka and Guido van Rossum in :gh:`100160`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:977 msgid "" -":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" -"`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" +"`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" #: ../../whatsnew/3.12.rst:981 msgid "" -"The :mod:`sqlite3` :ref:`default adapters and converters ` are now deprecated. Instead, use the :ref:`sqlite3-adapter-" -"converter-recipes` and tailor them to your needs. (Contributed by Erlend E. " -"Aasland in :gh:`90016`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." +"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " +"will be removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." +"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " +"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:987 +#: ../../whatsnew/3.12.rst:989 msgid "" -"In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " -"when :ref:`named placeholders ` are used together with " -"parameters supplied as a :term:`sequence` instead of as a :class:`dict`. " -"Starting from Python 3.14, using named placeholders with parameters supplied " -"as a sequence will raise a :exc:`~sqlite3.ProgrammingError`. (Contributed by " -"Erlend E. Aasland in :gh:`101698`.)" +":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." +"lstat` on Windows are deprecated. In a future release, they will contain the " +"last metadata change time, consistent with other platforms. For now, they " +"still contain the creation time, which is also available in the new " +"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:994 +#: ../../whatsnew/3.12.rst:995 msgid "" -"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" -"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " -"removed in a future version of Python. Use the single-arg versions of these " -"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " +"as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " +"Katriel in :gh:`102828`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1010 +msgid ":mod:`sqlite3`:" msgstr "" #: ../../whatsnew/3.12.rst:999 msgid "" -":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " -"differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " -"(Contributed by Brett Cannon in :gh:`65961`.)" +":ref:`default adapters and converters ` are now " +"deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " +"tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1004 +#: ../../whatsnew/3.12.rst:1005 msgid "" -"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " -"now emits a :exc:`DeprecationWarning` if there is no current event loop set " -"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " -"Rossum in :gh:`100160`.)" +"In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " +"when :ref:`named placeholders ` are used together with " +"parameters supplied as a :term:`sequence` instead of as a :class:`dict`. " +"Starting from Python 3.14, using named placeholders with parameters supplied " +"as a sequence will raise a :exc:`~sqlite3.ProgrammingError`. (Contributed by " +"Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 +#: ../../whatsnew/3.12.rst:1012 msgid "" -"The :mod:`xml.etree.ElementTree` module now emits :exc:`DeprecationWarning` " -"when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " -"Before, the Python implementation emitted :exc:`FutureWarning`, and the C " -"implementation emitted nothing." +":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." +"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " +"(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1014 +#: ../../whatsnew/3.12.rst:1016 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +":mod:`tarfile`: Extracting tar archives without specifying *filter* is " +"deprecated until Python 3.14, when ``'data'`` filter will become the " +"default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1020 msgid "" -"The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " -"Windows are deprecated. In a future release, they will contain the last " -"metadata change time, consistent with other platforms. For now, they still " -"contain the creation time, which is also available in the new " -"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" +":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " +"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" +"gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1025 +#: ../../whatsnew/3.12.rst:1023 msgid "" -"The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." -"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " -"(Contributed by Irit Katriel in :gh:`102778`.)" +":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " +"when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " +"Before, the Python implementation emitted :exc:`FutureWarning`, and the C " +"implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1029 +#: ../../whatsnew/3.12.rst:1028 msgid "" -"The *onerror* argument of :func:`shutil.rmtree` is deprecated as will be " -"removed in Python 3.14. Use *onexc* instead. (Contributed by Irit Katriel " -"in :gh:`102828`.)" +"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" +"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " +"removed in a future version of Python. Use the single-arg versions of these " +"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1032 +#: ../../whatsnew/3.12.rst:1033 msgid "" -"Extracting tar archives without specifying *filter* is deprecated until " -"Python 3.14, when ``'data'`` filter will become the default. See :ref:" -"`tarfile-extraction-filter` for details." +":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " +"differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " +"(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1036 +#: ../../whatsnew/3.12.rst:1038 msgid "" -"``calendar.January`` and ``calendar.February`` constants are deprecated and " -"replaced by :data:`calendar.Month.JANUARY` and :data:`calendar.Month." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1040 +#: ../../whatsnew/3.12.rst:1043 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1354,249 +1359,294 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1046 -msgid "" -":class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` and :meth:" -"`~datetime.datetime.utcfromtimestamp` are deprecated and will be removed in " -"a future version. Instead, use timezone-aware objects to represent datetimes " -"in UTC: respectively, call :meth:`~datetime.datetime.now` and :meth:" -"`~datetime.datetime.fromtimestamp` with the *tz* parameter set to :attr:" -"`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1050 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1052 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1055 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1064 +#: ../../whatsnew/3.12.rst:1057 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1065 +#: ../../whatsnew/3.12.rst:1058 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1059 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1060 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1068 +#: ../../whatsnew/3.12.rst:1061 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1062 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1070 +#: ../../whatsnew/3.12.rst:1063 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1071 +#: ../../whatsnew/3.12.rst:1064 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1065 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1073 +#: ../../whatsnew/3.12.rst:1066 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1067 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1075 +#: ../../whatsnew/3.12.rst:1068 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1076 +#: ../../whatsnew/3.12.rst:1069 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1070 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1078 +#: ../../whatsnew/3.12.rst:1071 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1079 +#: ../../whatsnew/3.12.rst:1072 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1073 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1081 +#: ../../whatsnew/3.12.rst:1074 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1075 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1084 +#: ../../whatsnew/3.12.rst:1077 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1079 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1080 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1088 +#: ../../whatsnew/3.12.rst:1081 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1089 +#: ../../whatsnew/3.12.rst:1082 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1083 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1091 +#: ../../whatsnew/3.12.rst:1084 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1092 +#: ../../whatsnew/3.12.rst:1085 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1086 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1094 +#: ../../whatsnew/3.12.rst:1087 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1097 +#: ../../whatsnew/3.12.rst:1090 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1092 +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1097 msgid "" -"Deprecated the following :mod:`importlib.abc` classes, scheduled for removal " -"in Python 3.14:" +":mod:`ast`: The following :mod:`ast` features have been deprecated in " +"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " +"emitted at runtime when they are accessed or used, and will be removed in " +"Python 3.14:" msgstr "" +#: ../../whatsnew/3.12.rst:1101 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + #: ../../whatsnew/3.12.rst:1102 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../whatsnew/3.12.rst:1103 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../whatsnew/3.12.rst:1104 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../whatsnew/3.12.rst:1105 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../whatsnew/3.12.rst:1107 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1110 +msgid "" +":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1115 +msgid "" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1118 +msgid "" +":mod:`importlib.abc`: Deprecated the following classes, scheduled for " +"removal in Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1121 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1122 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1123 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1106 +#: ../../whatsnew/3.12.rst:1125 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1127 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1109 +#: ../../whatsnew/3.12.rst:1128 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1130 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1132 msgid "" -"Deprecated :class:`collections.abc.ByteString`. Prefer :class:`Sequence` or :" -"class:`collections.abc.Buffer`. For use in typing, prefer a union, like " -"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " -"Shantanu Jain in :gh:`91896`.)" +":mod:`itertools`: The module had undocumented, inefficient, historically " +"buggy, and inconsistent support for copy, deepcopy, and pickle operations. " +"This will be removed in 3.14 for a significant reduction in code volume and " +"maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1138 msgid "" -":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" -"`DeprecationWarning` to be emitted when it is used." +":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " +"change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " +"where ``'fork'`` is currently the default (:gh:`84559`). Adding a runtime " +"warning about this was deemed too disruptive as the majority of code is not " +"expected to care. Use the :func:`~multiprocessing.get_context` or :func:" +"`~multiprocessing.set_start_method` APIs to explicitly specify when your " +"code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1146 msgid "" -"Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API." +":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " +"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " +"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1151 msgid "" -"Deprecated the *isdst* parameter in :func:`email.utils.localtime`. " -"(Contributed by Alan Williams in :gh:`72346`.)" +":mod:`pty`: The module has two undocumented ``master_open()`` and " +"``slave_open()`` functions that have been deprecated since Python 2 but only " +"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1155 msgid "" -"``__package__`` and ``__cached__`` will cease to be set or taken into " -"consideration by the import system (:gh:`97879`)." +":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " +"in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1158 msgid "" -"Testing the truth value of an :class:`xml.etree.ElementTree.Element` is " -"deprecated and will raise an exception in Python 3.14." +":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " +"causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1161 msgid "" -"The default :mod:`multiprocessing` start method will change to a safer one " -"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " -"currently the default (:gh:`84559`). Adding a runtime warning about this was " -"deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." -"set_start_method` APIs to explicitly specify when your code *requires* " -"``'fork'``. See :ref:`multiprocessing-start-methods`." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." +"etree.ElementTree.Element` is deprecated and will raise an exception in " +"Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1164 msgid "" -":mod:`pty` has two undocumented ``master_open()`` and ``slave_open()`` " -"functions that have been deprecated since Python 2 but only gained a proper :" -"exc:`DeprecationWarning` in 3.12. Remove them in 3.14." +"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " +"bases using the C API." msgstr "" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1167 msgid "" -":mod:`itertools` had undocumented, inefficient, historically buggy, and " -"inconsistent support for copy, deepcopy, and pickle operations. This will be " -"removed in 3.14 for a significant reduction in code volume and maintenance " -"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +"``__package__`` and ``__cached__`` will cease to be set or taken into " +"consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1170 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1604,74 +1654,21 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 -msgid "" -"The *onerror* argument of :func:`shutil.rmtree` is deprecated in 3.12, and " -"will be removed in 3.14." +#: ../../whatsnew/3.12.rst:1177 +msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1160 -msgid "" -"The *type*, *choices*, and *metavar* parameters of :class:`!argparse." -"BooleanOptionalAction` are deprecated and will be removed in 3.14. " -"(Contributed by Nikita Sobolev in :gh:`92248`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1165 -msgid "" -":func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` now raise :exc:" -"`DeprecationWarning`; use :func:`importlib.util.find_spec` instead. " -"(Contributed by Nikita Sobolev in :gh:`97850`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1170 -msgid "" -"The following :mod:`ast` features have been deprecated in documentation " -"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " -"runtime when they are accessed or used, and will be removed in Python 3.14:" -msgstr "" - -#: ../../whatsnew/3.12.rst:1174 -msgid ":class:`!ast.Num`" -msgstr ":class:`!ast.Num`" - -#: ../../whatsnew/3.12.rst:1175 -msgid ":class:`!ast.Str`" -msgstr ":class:`!ast.Str`" - -#: ../../whatsnew/3.12.rst:1176 -msgid ":class:`!ast.Bytes`" -msgstr ":class:`!ast.Bytes`" - -#: ../../whatsnew/3.12.rst:1177 -msgid ":class:`!ast.NameConstant`" -msgstr ":class:`!ast.NameConstant`" - -#: ../../whatsnew/3.12.rst:1178 -msgid ":class:`!ast.Ellipsis`" -msgstr ":class:`!ast.Ellipsis`" - -#: ../../whatsnew/3.12.rst:1180 -msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1184 -msgid "Pending Removal in Future Versions" -msgstr "" - -#: ../../whatsnew/3.12.rst:1186 +#: ../../whatsnew/3.12.rst:1179 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1189 +#: ../../whatsnew/3.12.rst:1182 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1191 +#: ../../whatsnew/3.12.rst:1184 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1683,34 +1680,65 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1195 ../../whatsnew/3.12.rst:1951 msgid "Removed" msgstr "" -#: ../../whatsnew/3.12.rst:1204 +#: ../../whatsnew/3.12.rst:1197 msgid "" -"Remove the ``distutils`` package. It was deprecated in Python 3.10 by :pep:" -"`632` \"Deprecate distutils module\". For projects still using ``distutils`` " -"and cannot be updated to something else, the ``setuptools`` project can be " -"installed: it still provides ``distutils``. (Contributed by Victor Stinner " -"in :gh:`92584`.)" +"``asynchat`` and ``asyncore``: These two modules have been removed according " +"to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" +"mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1203 +msgid "" +":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " +"back in 3.2 have been removed per :gh:`89336`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1206 +msgid "" +":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " +"argument. Use the ``source`` attribute and argument instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:1208 +msgid "" +":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " +"shorter :class:`~configparser.ConfigParser` name instead." msgstr "" #: ../../whatsnew/3.12.rst:1210 msgid "" -"Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " -"installing setuptools in environments created by :mod:`venv`." +":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" +"meth:`~configparser.ConfigParser.read_file` instead." msgstr "" #: ../../whatsnew/3.12.rst:1213 msgid "" +"``distutils``: Remove the ``distutils`` package. It was deprecated in Python " +"3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " +"``distutils`` and cannot be updated to something else, the ``setuptools`` " +"project can be installed: it still provides ``distutils``. (Contributed by " +"Victor Stinner in :gh:`92584`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1219 +msgid "" +":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " +"and stop installing setuptools in environments created by :mod:`venv`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1222 +msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " "still be used with ``pip install``, since pip will provide ``setuptools`` in " "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1228 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1720,222 +1748,250 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1226 +#: ../../whatsnew/3.12.rst:1235 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1228 -msgid "Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1237 +msgid "" +":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " +"*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1230 -msgid "A number of :class:`~unittest.TestCase` method aliases:" +#: ../../whatsnew/3.12.rst:1241 +msgid "" +":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " +"deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " +"instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " +"extension if it was not present. (Contributed by Victor Stinner in :gh:" +"`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1233 -msgid "Deprecated alias" +#: ../../whatsnew/3.12.rst:1247 +msgid "" +":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." +"pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " +"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " +"of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " +"Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1233 -msgid "Method Name" +#: ../../whatsnew/3.12.rst:1253 +msgid "" +":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " +"have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1233 -msgid "Deprecated in" +#: ../../whatsnew/3.12.rst:1256 +msgid "" +"References to, and support for :meth:`!module_repr()` has been removed. " +"(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1235 -msgid "``failUnless``" -msgstr "``failUnless``" - -#: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1242 -msgid ":meth:`.assertTrue`" -msgstr ":meth:`.assertTrue`" +#: ../../whatsnew/3.12.rst:1259 +msgid "" +"``importlib.util.set_package`` has been removed. (Contributed by Brett " +"Cannon in :gh:`65961`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1235 ../../whatsnew/3.12.rst:1236 -#: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1238 -#: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1240 -#: ../../whatsnew/3.12.rst:1241 -msgid "3.1" -msgstr "3.1" +#: ../../whatsnew/3.12.rst:1262 +msgid "" +"Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " +"(Contributed by Barry Warsaw in :gh:`98040`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1236 -msgid "``failIf``" -msgstr "``failIf``" +#: ../../whatsnew/3.12.rst:1265 +msgid "" +"``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " +"have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1236 -msgid ":meth:`.assertFalse`" -msgstr ":meth:`.assertFalse`" +#: ../../whatsnew/3.12.rst:1268 +msgid "" +"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" +"gh:`98040`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1237 -msgid "``failUnlessEqual``" -msgstr "``failUnlessEqual``" +#: ../../whatsnew/3.12.rst:1271 +msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" +msgstr "" -#: ../../whatsnew/3.12.rst:1237 ../../whatsnew/3.12.rst:1243 -msgid ":meth:`.assertEqual`" -msgstr ":meth:`.assertEqual`" +#: ../../whatsnew/3.12.rst:1274 +msgid "imp" +msgstr "imp" -#: ../../whatsnew/3.12.rst:1238 -msgid "``failIfEqual``" -msgstr "``failIfEqual``" +#: ../../whatsnew/3.12.rst:1274 +msgid "importlib" +msgstr "importlib" -#: ../../whatsnew/3.12.rst:1238 ../../whatsnew/3.12.rst:1244 -msgid ":meth:`.assertNotEqual`" -msgstr ":meth:`.assertNotEqual`" +#: ../../whatsnew/3.12.rst:1276 +msgid "``imp.NullImporter``" +msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1239 -msgid "``failUnlessAlmostEqual``" -msgstr "``failUnlessAlmostEqual``" +#: ../../whatsnew/3.12.rst:1276 +msgid "Insert ``None`` into ``sys.path_importer_cache``" +msgstr "" -#: ../../whatsnew/3.12.rst:1239 ../../whatsnew/3.12.rst:1245 -msgid ":meth:`.assertAlmostEqual`" -msgstr ":meth:`.assertAlmostEqual`" +#: ../../whatsnew/3.12.rst:1277 +msgid "``imp.cache_from_source()``" +msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1240 -msgid "``failIfAlmostEqual``" -msgstr "``failIfAlmostEqual``" +#: ../../whatsnew/3.12.rst:1277 +msgid ":func:`importlib.util.cache_from_source`" +msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1240 ../../whatsnew/3.12.rst:1246 -msgid ":meth:`.assertNotAlmostEqual`" -msgstr ":meth:`.assertNotAlmostEqual`" +#: ../../whatsnew/3.12.rst:1278 +msgid "``imp.find_module()``" +msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1241 -msgid "``failUnlessRaises``" -msgstr "``failUnlessRaises``" +#: ../../whatsnew/3.12.rst:1278 +msgid ":func:`importlib.util.find_spec`" +msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1241 -msgid ":meth:`.assertRaises`" -msgstr ":meth:`.assertRaises`" +#: ../../whatsnew/3.12.rst:1279 +msgid "``imp.get_magic()``" +msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1242 -msgid "``assert_``" -msgstr "``assert_``" +#: ../../whatsnew/3.12.rst:1279 +msgid ":attr:`importlib.util.MAGIC_NUMBER`" +msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1242 ../../whatsnew/3.12.rst:1243 -#: ../../whatsnew/3.12.rst:1244 ../../whatsnew/3.12.rst:1245 -#: ../../whatsnew/3.12.rst:1246 ../../whatsnew/3.12.rst:1247 -#: ../../whatsnew/3.12.rst:1248 -msgid "3.2" -msgstr "3.2" +#: ../../whatsnew/3.12.rst:1280 +msgid "``imp.get_suffixes()``" +msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1243 -msgid "``assertEquals``" -msgstr "``assertEquals``" +#: ../../whatsnew/3.12.rst:1280 +msgid "" +":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." +"EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" +msgstr "" -#: ../../whatsnew/3.12.rst:1244 -msgid "``assertNotEquals``" -msgstr "``assertNotEquals``" +#: ../../whatsnew/3.12.rst:1281 +msgid "``imp.get_tag()``" +msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1245 -msgid "``assertAlmostEquals``" -msgstr "``assertAlmostEquals``" +#: ../../whatsnew/3.12.rst:1281 +msgid ":attr:`sys.implementation.cache_tag `" +msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1246 -msgid "``assertNotAlmostEquals``" -msgstr "``assertNotAlmostEquals``" +#: ../../whatsnew/3.12.rst:1282 +msgid "``imp.load_module()``" +msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1247 -msgid "``assertRegexpMatches``" -msgstr "``assertRegexpMatches``" +#: ../../whatsnew/3.12.rst:1282 +msgid ":func:`importlib.import_module`" +msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1247 -msgid ":meth:`.assertRegex`" -msgstr ":meth:`.assertRegex`" +#: ../../whatsnew/3.12.rst:1283 +msgid "``imp.new_module(name)``" +msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1248 -msgid "``assertRaisesRegexp``" -msgstr "``assertRaisesRegexp``" +#: ../../whatsnew/3.12.rst:1283 +msgid "``types.ModuleType(name)``" +msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1248 -msgid ":meth:`.assertRaisesRegex`" -msgstr ":meth:`.assertRaisesRegex`" +#: ../../whatsnew/3.12.rst:1284 +msgid "``imp.reload()``" +msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1249 -msgid "``assertNotRegexpMatches``" -msgstr "``assertNotRegexpMatches``" +#: ../../whatsnew/3.12.rst:1284 +msgid ":func:`importlib.reload`" +msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1249 -msgid ":meth:`.assertNotRegex`" -msgstr ":meth:`.assertNotRegex`" +#: ../../whatsnew/3.12.rst:1285 +msgid "``imp.source_from_cache()``" +msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1249 -msgid "3.5" -msgstr "3.5" +#: ../../whatsnew/3.12.rst:1285 +msgid ":func:`importlib.util.source_from_cache`" +msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1252 -msgid "" -"You can use https://github.com/isidentical/teyit to automatically modernise " -"your unit tests." +#: ../../whatsnew/3.12.rst:1288 +msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1255 -msgid "" -"Undocumented and broken :class:`~unittest.TestCase` method " -"``assertDictContainsSubset`` (deprecated in Python 3.2)." +#: ../../whatsnew/3.12.rst:1303 +msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1258 -msgid "" -"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " -"since Python 3.2)." +#: ../../whatsnew/3.12.rst:1305 +msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1262 -msgid "" -"An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " -"(deprecated in Python 3.2)." -msgstr "" +#: ../../whatsnew/3.12.rst:1307 +msgid "``imp.init_builtin()``" +msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1265 -msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" +#: ../../whatsnew/3.12.rst:1308 +msgid "``imp.load_compiled()``" +msgstr "``imp.load_compiled()``" + +#: ../../whatsnew/3.12.rst:1309 +msgid "``imp.load_dynamic()``" +msgstr "``imp.load_dynamic()``" + +#: ../../whatsnew/3.12.rst:1310 +msgid "``imp.load_package()``" +msgstr "``imp.load_package()``" + +#: ../../whatsnew/3.12.rst:1312 +msgid "" +"``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " +"locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1314 msgid "" -"Several names deprecated in the :mod:`configparser` way back in 3.2 have " -"been removed per :gh:`89336`:" +"``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " +"``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " +"``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1270 +#: ../../whatsnew/3.12.rst:1318 msgid "" -":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " -"argument. Use the ``source`` attribute and argument instead." +":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " +"in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." +"open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." +"open` is also a static method. (Contributed by Victor Stinner in :gh:" +"`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1272 +#: ../../whatsnew/3.12.rst:1324 msgid "" -":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " -"shorter :class:`~configparser.ConfigParser` name instead." +":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " +"Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " +"Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1328 msgid "" -":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" -"meth:`~configparser.ConfigParser.read_file` instead." +"``smtpd``: The module has been removed according to the schedule in :pep:" +"`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " +"module or any other :mod:`asyncio`-based server instead. (Contributed by " +"Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1336 msgid "" -"The following undocumented :mod:`sqlite3` features, deprecated in Python " -"3.10, are now removed:" +":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " +"deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1339 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1340 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1342 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1286 +#: ../../whatsnew/3.12.rst:1345 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -1943,50 +1999,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1291 +#: ../../whatsnew/3.12.rst:1350 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1293 -msgid "" -"``smtpd`` has been removed according to the schedule in :pep:`594`, having " -"been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI module or any " -"other :mod:`asyncio`-based server instead. (Contributed by Oleg Iarygin in :" -"gh:`93243`.)" +#: ../../whatsnew/3.12.rst:1352 +msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1301 -msgid "" -"``asynchat`` and ``asyncore`` have been removed according to the schedule " -"in :pep:`594`, having been deprecated in Python 3.6. Use :mod:`asyncio` " -"instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1307 -msgid "" -"Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python " -"3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`) " -"function is a built-in function. Since Python 3.10, :func:`!_pyio.open` is " -"also a static method. (Contributed by Victor Stinner in :gh:`94169`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1313 +#: ../../whatsnew/3.12.rst:1354 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 -msgid "" -":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " -"deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " -"instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " -"extension if it was not present. (Contributed by Victor Stinner in :gh:" -"`94196`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1358 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -1994,39 +2022,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1329 -msgid "" -"Remove the :func:`!locale.format` function, deprecated in Python 3.7: use :" -"func:`locale.format_string` instead. (Contributed by Victor Stinner in :gh:" -"`94226`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1333 -msgid "" -":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." -"pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " -"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " -"of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " -"Stinner in :gh:`94199`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1339 -msgid "" -":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " -"method of the pure Python implementation, deprecated in Python 3.10, use " -"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." -"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " -"(Contributed by Victor Stinner in :gh:`94383`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1345 -msgid "" -":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " -"deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" -"`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1364 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2037,185 +2033,205 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1359 -msgid "" -"Many previously deprecated cleanups in :mod:`importlib` have now been " -"completed:" +#: ../../whatsnew/3.12.rst:1373 +msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 -msgid "" -"References to, and support for :meth:`!module_repr()` has been removed. " -"(Contributed by Barry Warsaw in :gh:`97850`.)" +#: ../../whatsnew/3.12.rst:1375 +msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1365 -msgid "" -"``importlib.util.set_package`` has been removed. (Contributed by Brett " -"Cannon in :gh:`65961`.)" +#: ../../whatsnew/3.12.rst:1378 +msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1368 -msgid "" -"Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " -"(Contributed by Barry Warsaw in :gh:`98040`.)" +#: ../../whatsnew/3.12.rst:1378 +msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1371 -msgid "" -"``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " -"have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" +#: ../../whatsnew/3.12.rst:1378 +msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1374 -msgid "" -"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" -"gh:`98040`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1380 +msgid "``failUnless``" +msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1377 -msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" -msgstr "" +#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1387 +msgid ":meth:`.assertTrue`" +msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1380 -msgid "imp" -msgstr "imp" +#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1386 +msgid "3.1" +msgstr "3.1" -#: ../../whatsnew/3.12.rst:1380 -msgid "importlib" -msgstr "importlib" +#: ../../whatsnew/3.12.rst:1381 +msgid "``failIf``" +msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1382 -msgid "``imp.NullImporter``" -msgstr "``imp.NullImporter``" +#: ../../whatsnew/3.12.rst:1381 +msgid ":meth:`.assertFalse`" +msgstr ":meth:`.assertFalse`" #: ../../whatsnew/3.12.rst:1382 -msgid "Insert ``None`` into ``sys.path_importer_cache``" -msgstr "" +msgid "``failUnlessEqual``" +msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1383 -msgid "``imp.cache_from_source()``" -msgstr "``imp.cache_from_source()``" +#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1388 +msgid ":meth:`.assertEqual`" +msgstr ":meth:`.assertEqual`" #: ../../whatsnew/3.12.rst:1383 -msgid ":func:`importlib.util.cache_from_source`" -msgstr ":func:`importlib.util.cache_from_source`" +msgid "``failIfEqual``" +msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1384 -msgid "``imp.find_module()``" -msgstr "``imp.find_module()``" +#: ../../whatsnew/3.12.rst:1383 ../../whatsnew/3.12.rst:1389 +msgid ":meth:`.assertNotEqual`" +msgstr ":meth:`.assertNotEqual`" #: ../../whatsnew/3.12.rst:1384 -msgid ":func:`importlib.util.find_spec`" -msgstr ":func:`importlib.util.find_spec`" +msgid "``failUnlessAlmostEqual``" +msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1385 -msgid "``imp.get_magic()``" -msgstr "``imp.get_magic()``" +#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1390 +msgid ":meth:`.assertAlmostEqual`" +msgstr ":meth:`.assertAlmostEqual`" #: ../../whatsnew/3.12.rst:1385 -msgid ":attr:`importlib.util.MAGIC_NUMBER`" -msgstr ":attr:`importlib.util.MAGIC_NUMBER`" +msgid "``failIfAlmostEqual``" +msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1386 -msgid "``imp.get_suffixes()``" -msgstr "``imp.get_suffixes()``" +#: ../../whatsnew/3.12.rst:1385 ../../whatsnew/3.12.rst:1391 +msgid ":meth:`.assertNotAlmostEqual`" +msgstr ":meth:`.assertNotAlmostEqual`" #: ../../whatsnew/3.12.rst:1386 -msgid "" -":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." -"EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" -msgstr "" +msgid "``failUnlessRaises``" +msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1387 -msgid "``imp.get_tag()``" -msgstr "``imp.get_tag()``" +#: ../../whatsnew/3.12.rst:1386 +msgid ":meth:`.assertRaises`" +msgstr ":meth:`.assertRaises`" #: ../../whatsnew/3.12.rst:1387 -msgid ":attr:`sys.implementation.cache_tag `" -msgstr ":attr:`sys.implementation.cache_tag `" +msgid "``assert_``" +msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1388 -msgid "``imp.load_module()``" -msgstr "``imp.load_module()``" +#: ../../whatsnew/3.12.rst:1387 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1389 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1391 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1393 +msgid "3.2" +msgstr "3.2" #: ../../whatsnew/3.12.rst:1388 -msgid ":func:`importlib.import_module`" -msgstr ":func:`importlib.import_module`" - -#: ../../whatsnew/3.12.rst:1389 -msgid "``imp.new_module(name)``" -msgstr "``imp.new_module(name)``" +msgid "``assertEquals``" +msgstr "``assertEquals``" #: ../../whatsnew/3.12.rst:1389 -msgid "``types.ModuleType(name)``" -msgstr "``types.ModuleType(name)``" - -#: ../../whatsnew/3.12.rst:1390 -msgid "``imp.reload()``" -msgstr "``imp.reload()``" +msgid "``assertNotEquals``" +msgstr "``assertNotEquals``" #: ../../whatsnew/3.12.rst:1390 -msgid ":func:`importlib.reload`" -msgstr ":func:`importlib.reload`" +msgid "``assertAlmostEquals``" +msgstr "``assertAlmostEquals``" #: ../../whatsnew/3.12.rst:1391 -msgid "``imp.source_from_cache()``" -msgstr "``imp.source_from_cache()``" +msgid "``assertNotAlmostEquals``" +msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1391 -msgid ":func:`importlib.util.source_from_cache`" -msgstr ":func:`importlib.util.source_from_cache`" +#: ../../whatsnew/3.12.rst:1392 +msgid "``assertRegexpMatches``" +msgstr "``assertRegexpMatches``" + +#: ../../whatsnew/3.12.rst:1392 +msgid ":meth:`.assertRegex`" +msgstr ":meth:`.assertRegex`" + +#: ../../whatsnew/3.12.rst:1393 +msgid "``assertRaisesRegexp``" +msgstr "``assertRaisesRegexp``" + +#: ../../whatsnew/3.12.rst:1393 +msgid ":meth:`.assertRaisesRegex`" +msgstr ":meth:`.assertRaisesRegex`" #: ../../whatsnew/3.12.rst:1394 -msgid "Replace ``imp.load_source()`` with::" +msgid "``assertNotRegexpMatches``" +msgstr "``assertNotRegexpMatches``" + +#: ../../whatsnew/3.12.rst:1394 +msgid ":meth:`.assertNotRegex`" +msgstr ":meth:`.assertNotRegex`" + +#: ../../whatsnew/3.12.rst:1394 +msgid "3.5" +msgstr "3.5" + +#: ../../whatsnew/3.12.rst:1397 +msgid "" +"You can use https://github.com/isidentical/teyit to automatically modernise " +"your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1409 -msgid "Removed :mod:`!imp` functions and attributes with no replacements:" +#: ../../whatsnew/3.12.rst:1400 +msgid "" +"Undocumented and broken :class:`~unittest.TestCase` method " +"``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1411 -msgid "undocumented functions:" +#: ../../whatsnew/3.12.rst:1403 +msgid "" +"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " +"since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1413 -msgid "``imp.init_builtin()``" -msgstr "``imp.init_builtin()``" +#: ../../whatsnew/3.12.rst:1407 +msgid "" +"An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " +"(deprecated in Python 3.2)." +msgstr "" -#: ../../whatsnew/3.12.rst:1414 -msgid "``imp.load_compiled()``" -msgstr "``imp.load_compiled()``" +#: ../../whatsnew/3.12.rst:1410 +msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1415 -msgid "``imp.load_dynamic()``" -msgstr "``imp.load_dynamic()``" +#: ../../whatsnew/3.12.rst:1412 +msgid "" +":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" +"`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " +"Skipstone, Iceape, Firebird, and Firefox versions 35 and below (:gh:" +"`102871`)." +msgstr "" #: ../../whatsnew/3.12.rst:1416 -msgid "``imp.load_package()``" -msgstr "``imp.load_package()``" - -#: ../../whatsnew/3.12.rst:1418 msgid "" -"``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " -"locking scheme has changed in Python 3.3 to per-module locks." +":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " +"method of the pure Python implementation, deprecated in Python 3.10, use " +"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." +"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " +"(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1422 msgid "" -"``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " -"``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " -"``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." +":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " +"deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" +"`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1427 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1432 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2225,34 +2241,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1437 -msgid "" -":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " -"*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:1441 -msgid "" -"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " -"browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " -"Firebird, and Firefox versions 35 and below (:gh:`102871`)." -msgstr "" - -#: ../../whatsnew/3.12.rst:1449 ../../whatsnew/3.12.rst:1753 +#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1747 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1445 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1449 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1451 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2261,19 +2264,19 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1458 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " "Now, it raises a :exc:`TypeError`. Also, the exception raised for non-" -"integral values such as ``randrange(10.5)`` or ``randrange('10')`` has been " +"integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " "changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs " "where ``randrange(1e25)`` would silently select from a larger range than " "``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1466 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2283,21 +2286,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1472 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1476 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1481 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2305,7 +2308,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1486 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2317,7 +2320,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1495 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2329,14 +2332,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1508 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1513 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2348,45 +2351,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:1524 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1536 msgid "" "Additionally, there may be some minor behavioral changes as a consecuence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1539 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1542 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1545 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1554 +#: ../../whatsnew/3.12.rst:1548 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1558 +#: ../../whatsnew/3.12.rst:1552 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1554 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2395,21 +2398,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1566 +#: ../../whatsnew/3.12.rst:1560 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1565 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1569 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2418,41 +2421,41 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1575 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1577 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1578 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1579 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1581 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1583 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1585 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1591 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1597 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2460,84 +2463,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1603 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1605 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1606 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1608 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1610 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1611 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1612 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1614 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1623 +#: ../../whatsnew/3.12.rst:1617 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1625 +#: ../../whatsnew/3.12.rst:1619 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1622 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1624 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1626 msgid "" -":const:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added to " -"allow safely extending certain variable-sized types, including :c:var:" +":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " +"to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1635 +#: ../../whatsnew/3.12.rst:1629 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1632 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1640 +#: ../../whatsnew/3.12.rst:1634 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2545,73 +2548,73 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1639 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1649 -msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" +#: ../../whatsnew/3.12.rst:1643 +msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" +msgstr "" -#: ../../whatsnew/3.12.rst:1650 +#: ../../whatsnew/3.12.rst:1644 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1645 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1652 +#: ../../whatsnew/3.12.rst:1646 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1654 +#: ../../whatsnew/3.12.rst:1648 msgid "" -"The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " +"The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " "makes vectorcall safe to use with mutable types (i.e. heap types without the " -"immutable flag, :const:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " +"immutable flag, :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " "not override :c:member:`~PyTypeObject.tp_call` now inherit the " "``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1656 msgid "" -"The :const:`Py_TPFLAGS_MANAGED_DICT` and :const:`Py_TPFLAGS_MANAGED_WEAKREF` " -"flags have been added. This allows extensions classes to support object " -"``__dict__`` and weakrefs with less bookkeeping, using less memory and with " -"faster access." +"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " +"classes to support object ``__dict__`` and weakrefs with less bookkeeping, " +"using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1661 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1671 +#: ../../whatsnew/3.12.rst:1665 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1666 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1673 -msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" +#: ../../whatsnew/3.12.rst:1667 +msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" +msgstr "" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1669 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1673 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2619,14 +2622,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1683 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2635,28 +2638,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1689 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1693 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1698 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1702 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2666,14 +2669,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1710 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1714 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2681,91 +2684,91 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:1719 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1723 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1726 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1727 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1728 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1735 +#: ../../whatsnew/3.12.rst:1729 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1730 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1731 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1732 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:1733 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1740 +#: ../../whatsnew/3.12.rst:1734 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1737 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1736 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1745 +#: ../../whatsnew/3.12.rst:1739 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1741 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1749 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1758 +#: ../../whatsnew/3.12.rst:1752 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1762 +#: ../../whatsnew/3.12.rst:1756 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2774,7 +2777,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1769 +#: ../../whatsnew/3.12.rst:1763 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2782,21 +2785,22 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1774 +#: ../../whatsnew/3.12.rst:1768 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1772 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " -"hexadecimals, ``intmax_t``, ``ptrdiff_t``, ``wchar_t`` C strings, variable " -"width and precision) in :c:func:`PyUnicode_FromFormat` and :c:func:" -"`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:`98836`.)" +"hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " +"strings, variable width and precision) in :c:func:`PyUnicode_FromFormat` " +"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:" +"`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1778 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2805,27 +2809,27 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1784 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1794 +#: ../../whatsnew/3.12.rst:1788 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " -"should use :const:`Py_TPFLAGS_MANAGED_DICT` and :const:" +"should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " "``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " "``tp_weaklistoffset`` is still supported, but does not fully support " "multiple inheritance (:gh:`95589`), and performance may be worse. Classes " -"declaring :const:`Py_TPFLAGS_MANAGED_DICT` should call :c:func:`!" +"declaring :c:macro:`Py_TPFLAGS_MANAGED_DICT` should call :c:func:`!" "_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict` to " "traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1800 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2833,7 +2837,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1805 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2841,7 +2845,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1816 +#: ../../whatsnew/3.12.rst:1810 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2849,7 +2853,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1821 +#: ../../whatsnew/3.12.rst:1815 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2857,25 +2861,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1826 +#: ../../whatsnew/3.12.rst:1820 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1829 +#: ../../whatsnew/3.12.rst:1823 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1830 +#: ../../whatsnew/3.12.rst:1824 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1831 +#: ../../whatsnew/3.12.rst:1825 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1833 +#: ../../whatsnew/3.12.rst:1827 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2883,14 +2887,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:1832 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1836 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2899,37 +2903,38 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1849 +#: ../../whatsnew/3.12.rst:1843 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:1845 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1853 +#: ../../whatsnew/3.12.rst:1847 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " -"``tp_new`` to ``NULL`` using the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` " -"flag. This makes it acceptable for ``PyType_From*`` functions." +"``tp_new`` to ``NULL`` using the :c:macro:" +"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " +"``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1858 +#: ../../whatsnew/3.12.rst:1852 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1862 +#: ../../whatsnew/3.12.rst:1856 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1865 +#: ../../whatsnew/3.12.rst:1859 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -2937,289 +2942,298 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1870 +#: ../../whatsnew/3.12.rst:1864 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1871 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1873 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1874 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1875 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:1876 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1877 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1878 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1885 +#: ../../whatsnew/3.12.rst:1879 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:1880 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1887 +#: ../../whatsnew/3.12.rst:1881 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1882 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1883 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1890 +#: ../../whatsnew/3.12.rst:1884 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1885 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:1886 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1888 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1895 +#: ../../whatsnew/3.12.rst:1889 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1890 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1897 +#: ../../whatsnew/3.12.rst:1891 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1892 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1893 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1894 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1902 +#: ../../whatsnew/3.12.rst:1896 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1906 +#: ../../whatsnew/3.12.rst:1900 msgid "" -"Creating immutable types (:const:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " +"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1903 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1912 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1915 +#: ../../whatsnew/3.12.rst:1909 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:1911 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:1913 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1922 +#: ../../whatsnew/3.12.rst:1916 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:1924 +#: ../../whatsnew/3.12.rst:1918 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:1925 +#: ../../whatsnew/3.12.rst:1919 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:1926 +#: ../../whatsnew/3.12.rst:1920 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1921 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1923 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1926 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:1937 +#: ../../whatsnew/3.12.rst:1931 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1934 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:1939 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1942 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1945 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1953 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1958 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1960 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1961 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1962 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1963 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1964 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1965 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1966 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1967 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:1968 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1970 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1979 +#: ../../whatsnew/3.12.rst:1973 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1976 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" + +#~ msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" +#~ msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" + +#~ msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" +#~ msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" + +#~ msgid "email" +#~ msgstr "email" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 2c1fe8586e..bf152464dd 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -425,7 +425,7 @@ msgid "" "strings even though the underlying platform may have a different " "convention. To bridge this gap, the :mod:`wsgiref` module has a new " "function, :func:`wsgiref.handlers.read_environ` for transcoding CGI " -"variables from :attr:`os.environ` into native strings and returning a new " +"variables from :data:`os.environ` into native strings and returning a new " "dictionary." msgstr "" @@ -482,7 +482,7 @@ msgstr "" msgid "" "The interpreter can now be started with a quiet option, ``-q``, to prevent " "the copyright and version information from being displayed in the " -"interactive mode. The option can be introspected using the :attr:`sys." +"interactive mode. The option can be introspected using the :data:`sys." "flags` attribute:" msgstr "" @@ -551,7 +551,7 @@ msgstr "(請見 :issue:`4617`\\ 。)" msgid "" "The internal :c:type:`structsequence` tool now creates subclasses of tuple. " "This means that C structures like those returned by :func:`os.stat`, :func:" -"`time.gmtime`, and :attr:`sys.version_info` now work like a :term:`named " +"`time.gmtime`, and :data:`sys.version_info` now work like a :term:`named " "tuple` and now work with functions and methods that expect a tuple as an " "argument. This is a big step forward in making the C structures as flexible " "as their pure Python counterparts:" @@ -587,8 +587,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:600 msgid "" "A :exc:`ResourceWarning` is issued at interpreter shutdown if the :data:`gc." -"garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is set, all " -"uncollectable objects are printed. This is meant to make the programmer " +"garbage` list isn't empty, and if :const:`gc.DEBUG_UNCOLLECTABLE` is set, " +"all uncollectable objects are printed. This is meant to make the programmer " "aware that their code contains object finalization issues." msgstr "" @@ -614,7 +614,7 @@ msgid "" "of an effort to make more objects fully implement the :class:`collections." "Sequence` :term:`abstract base class`. As a result, the language will have " "a more uniform API. In addition, :class:`range` objects now support slicing " -"and negative indices, even with values larger than :attr:`sys.maxsize`. " +"and negative indices, even with values larger than :data:`sys.maxsize`. " "This makes *range* more interoperable with lists::" msgstr "" @@ -1097,7 +1097,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1009 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 " +"been governed by :data:`time.accept2dyear`. The default is ``True`` which " "means that for a two-digit year, the century is guessed according to the " "POSIX rules governing the ``%y`` strptime format." msgstr "" @@ -1105,14 +1105,14 @@ msgstr "" #: ../../whatsnew/3.2.rst:1014 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" -"`DeprecationWarning`. Instead, it is recommended that :attr:`time." +"`DeprecationWarning`. Instead, it is recommended that :data:`time." "accept2dyear` be set to ``False`` so that large date ranges can be used " "without guesswork::" msgstr "" #: ../../whatsnew/3.2.rst:1033 msgid "" -"Several functions now have significantly expanded date ranges. When :attr:" +"Several functions now have significantly expanded date ranges. When :data:" "`time.accept2dyear` is false, the :func:`time.asctime` function will accept " "any year that fits in a C int, while the :func:`time.mktime` and :func:`time." "strftime` functions will accept the full range supported by the " @@ -1263,10 +1263,10 @@ msgstr "" msgid "" "If no configuration is set-up before a logging event occurs, there is now a " "default configuration using a :class:`~logging.StreamHandler` directed to :" -"attr:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an " +"data:`sys.stderr` for events of ``WARNING`` level or higher. Formerly, an " "event occurring before a configuration was set-up would either raise an " -"exception or silently drop the event depending on the value of :attr:" -"`logging.raiseExceptions`. The new default handler is stored in :attr:" +"exception or silently drop the event depending on the value of :data:" +"`logging.raiseExceptions`. The new default handler is stored in :data:" "`logging.lastResort`." msgstr "" @@ -1384,7 +1384,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1302 msgid "" -"Some of the hashing details are exposed through a new attribute, :attr:`sys." +"Some of the hashing details are exposed through a new attribute, :data:`sys." "hash_info`, which describes the bit width of the hash value, the prime " "modulus, the hash values for *infinity* and *nan*, and the multiplier used " "for the imaginary part of a number:" @@ -1492,7 +1492,7 @@ msgstr "select" #: ../../whatsnew/3.2.rst:1390 msgid "" -"The :mod:`select` module now exposes a new, constant attribute, :attr:" +"The :mod:`select` module now exposes a new, constant attribute, :const:" "`~select.PIPE_BUF`, which gives the minimum number of bytes which are " "guaranteed not to block when :func:`select.select` says a pipe is ready for " "writing." @@ -1617,7 +1617,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1531 msgid "" "Some operating systems allow direct access to encoded bytes in the " -"environment. If so, the :attr:`os.supports_bytes_environ` constant will be " +"environment. If so, the :const:`os.supports_bytes_environ` constant will be " "true." msgstr "" @@ -1795,8 +1795,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:1668 msgid "" "The version of OpenSSL being used is now accessible using the module " -"attributes :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl." -"OPENSSL_VERSION_INFO` (a 5-tuple), and :data:`ssl.OPENSSL_VERSION_NUMBER` " +"attributes :const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl." +"OPENSSL_VERSION_INFO` (a 5-tuple), and :const:`ssl.OPENSSL_VERSION_NUMBER` " "(an integer)." msgstr "" @@ -2528,7 +2528,7 @@ msgstr "turtledemo" 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 " -"with lively displays. Being on :attr:`sys.path`, it can now be run directly " +"with lively displays. Being on :data:`sys.path`, it can now be run directly " "from the command-line:" msgstr "" @@ -2951,7 +2951,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2568 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` " +"interpreter to set :data:`sys.argv` without also modifying :data:`sys.path` " "(:issue:`5753`)." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 53235d6191..0d5d3b7c0f 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -801,7 +801,7 @@ msgstr "" msgid "" "A new attribute on the :mod:`sys` module exposes details specific to the " "implementation of the currently running interpreter. The initial set of " -"attributes on :attr:`sys.implementation` are ``name``, ``version``, " +"attributes on :data:`sys.implementation` are ``name``, ``version``, " "``hexversion``, and ``cache_tag``." msgstr "" @@ -904,7 +904,7 @@ msgstr "" msgid "" "In terms of finders, :class:`importlib.machinery.FileFinder` exposes the " "mechanism used to search for source and bytecode files of a module. " -"Previously this class was an implicit member of :attr:`sys.path_hooks`." +"Previously this class was an implicit member of :data:`sys.path_hooks`." msgstr "" #: ../../whatsnew/3.3.rst:724 @@ -928,7 +928,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:737 msgid "" "The :func:`importlib.invalidate_caches` function will now call the method " -"with the same name on all finders cached in :attr:`sys.path_importer_cache` " +"with the same name on all finders cached in :data:`sys.path_importer_cache` " "to help clean up any stored state as necessary." msgstr "" @@ -945,8 +945,8 @@ msgstr "" #: ../../whatsnew/3.3.rst:747 msgid "" "Beyond the expanse of what :mod:`importlib` now exposes, there are other " -"visible changes to import. The biggest is that :attr:`sys.meta_path` and :" -"attr:`sys.path_hooks` now store all of the meta path finders and path entry " +"visible changes to import. The biggest is that :data:`sys.meta_path` and :" +"data:`sys.path_hooks` now store all of the meta path finders and path entry " "hooks used by import. Previously the finders were implicit and hidden " "within the C code of import instead of being directly exposed. This means " "that one can now easily remove or change the order of the various finders to " @@ -972,9 +972,9 @@ msgstr "" #: ../../whatsnew/3.3.rst:764 msgid "" -"``None`` is now inserted into :attr:`sys.path_importer_cache` when no finder " -"can be found on :attr:`sys.path_hooks`. Since :class:`!imp.NullImporter` is " -"not directly exposed on :attr:`sys.path_hooks` it could no longer be relied " +"``None`` is now inserted into :data:`sys.path_importer_cache` when no finder " +"can be found on :data:`sys.path_hooks`. Since :class:`!imp.NullImporter` is " +"not directly exposed on :data:`sys.path_hooks` it could no longer be relied " "upon to always be available to use as a value representing no finder found." msgstr "" @@ -1107,7 +1107,7 @@ msgstr "" msgid "" ":func:`open` gets a new *opener* parameter: the underlying file descriptor " "for the file object is then obtained by calling *opener* with (*file*, " -"*flags*). It can be used to use custom flags like :data:`os.O_CLOEXEC` for " +"*flags*). It can be used to use custom flags like :const:`os.O_CLOEXEC` for " "example. The ``'x'`` mode was added: open for exclusive creation, failing if " "the file already exists." msgstr "" @@ -1600,7 +1600,7 @@ msgstr "" msgid "" "If Python is compiled without threads, the C version automatically disables " "the expensive thread local context machinery. In this case, the variable :" -"data:`~decimal.HAVE_THREADS` is set to ``False``." +"const:`~decimal.HAVE_THREADS` is set to ``False``." msgstr "" #: ../../whatsnew/3.3.rst:1135 @@ -2217,7 +2217,7 @@ msgstr "os" #: ../../whatsnew/3.3.rst:1578 msgid "" "The :mod:`os` module has a new :func:`~os.pipe2` function that makes it " -"possible to create a pipe with :data:`~os.O_CLOEXEC` or :data:`~os." +"possible to create a pipe with :const:`~os.O_CLOEXEC` or :const:`~os." "O_NONBLOCK` flags set atomically. This is especially useful to avoid race " "conditions in multi-threaded programs." msgstr "" @@ -2425,10 +2425,10 @@ msgstr "" #: ../../whatsnew/3.3.rst:1694 msgid "" -"New constants :data:`~os.RTLD_LAZY`, :data:`~os.RTLD_NOW`, :data:`~os." -"RTLD_GLOBAL`, :data:`~os.RTLD_LOCAL`, :data:`~os.RTLD_NODELETE`, :data:`~os." -"RTLD_NOLOAD`, and :data:`~os.RTLD_DEEPBIND` are available on platforms that " -"support them. These are for use with the :func:`sys.setdlopenflags` " +"New constants :const:`~os.RTLD_LAZY`, :const:`~os.RTLD_NOW`, :const:`~os." +"RTLD_GLOBAL`, :const:`~os.RTLD_LOCAL`, :const:`~os.RTLD_NODELETE`, :const:" +"`~os.RTLD_NOLOAD`, and :const:`~os.RTLD_DEEPBIND` are available on platforms " +"that support them. These are for use with the :func:`sys.setdlopenflags` " "function, and supersede the similar constants defined in :mod:`ctypes` and :" "mod:`DLFCN`. (Contributed by Victor Stinner in :issue:`13226`.)" msgstr "" @@ -2852,7 +2852,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1953 msgid "" "You can query the SSL compression algorithm used by an SSL socket, thanks to " -"its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :attr:" +"its new :meth:`~ssl.SSLSocket.compression` method. The new attribute :const:" "`~ssl.OP_NO_COMPRESSION` can be used to disable compression. (Contributed by " "Antoine Pitrou in :issue:`13634`.)" msgstr "" @@ -2879,7 +2879,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1969 msgid "" -"New attribute :attr:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting SSLv3 " +"New attribute :const:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting SSLv3 " "server sockets to use the server's cipher ordering preference rather than " "the client's (:issue:`13635`)." msgstr "" @@ -2905,9 +2905,9 @@ msgstr "struct" #: ../../whatsnew/3.3.rst:1987 msgid "" -"The :mod:`struct` module now supports ``ssize_t`` and ``size_t`` via the new " -"codes ``n`` and ``N``, respectively. (Contributed by Antoine Pitrou in :" -"issue:`3163`.)" +"The :mod:`struct` module now supports :c:type:`ssize_t` and :c:type:`size_t` " +"via the new codes ``n`` and ``N``, respectively. (Contributed by Antoine " +"Pitrou in :issue:`3163`.)" msgstr "" #: ../../whatsnew/3.3.rst:1993 @@ -2922,7 +2922,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1998 msgid "" -"A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a " +"A new constant :const:`~subprocess.DEVNULL` allows suppressing output in a " "platform-independent fashion. (Contributed by Ross Lagerwall in :issue:" "`5870`.)" msgstr "" @@ -3139,7 +3139,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2144 msgid "" -"New attribute :attr:`zlib.ZLIB_RUNTIME_VERSION` reports the version string " +"New attribute :const:`zlib.ZLIB_RUNTIME_VERSION` reports the version string " "of the underlying ``zlib`` library that is loaded at runtime. (Contributed " "by Torsten Landschoff in :issue:`12306`.)" msgstr "" @@ -3638,19 +3638,19 @@ msgstr "" #: ../../whatsnew/3.3.rst:2381 msgid "" -"Because :attr:`sys.meta_path` and :attr:`sys.path_hooks` now have finders on " +"Because :data:`sys.meta_path` and :data:`sys.path_hooks` now have finders on " "them by default, you will most likely want to use :meth:`list.insert` " "instead of :meth:`list.append` to add to those lists." msgstr "" #: ../../whatsnew/3.3.rst:2385 msgid "" -"Because ``None`` is now inserted into :attr:`sys.path_importer_cache`, if " +"Because ``None`` is now inserted into :data:`sys.path_importer_cache`, if " "you are clearing out entries in the dictionary of paths that do not have a " "finder, you will need to remove keys paired with values of ``None`` **and** :" "class:`!imp.NullImporter` to be backwards-compatible. This will lead to " "extra overhead on older versions of Python that re-insert ``None`` into :" -"attr:`sys.path_importer_cache` where it represents the use of implicit " +"data:`sys.path_importer_cache` where it represents the use of implicit " "finders, but semantically it should not change anything." msgstr "" @@ -3743,7 +3743,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2447 msgid "" "The ``ast.__version__`` constant has been removed. If you need to make " -"decisions affected by the AST version, use :attr:`sys.version_info` to make " +"decisions affected by the AST version, use :data:`sys.version_info` to make " "the decision." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 5806982517..0d3eefaa6b 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1031,7 +1031,7 @@ msgstr "doctest" #: ../../whatsnew/3.4.rst:778 msgid "" -"A new :ref:`option flag `, :data:`~doctest.FAIL_FAST`, " +"A new :ref:`option flag `, :const:`~doctest.FAIL_FAST`, " "halts test running as soon as the first failure is detected. (Contributed " "by R. David Murray and Daniel Urban in :issue:`16522`.)" msgstr "" @@ -1120,7 +1120,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:844 msgid "" -"New module attribute :data:`~filecmp.DEFAULT_IGNORES` provides the list of " +"New module attribute :const:`~filecmp.DEFAULT_IGNORES` provides the list of " "directories that are used as the default value for the *ignore* parameter of " "the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky in :" "issue:`15442`.)" @@ -1609,11 +1609,12 @@ msgstr "" #: ../../whatsnew/3.4.rst:1191 msgid "" -":func:`os.open` supports two new flags on platforms that provide them, :data:" -"`~os.O_PATH` (un-opened file descriptor), and :data:`~os.O_TMPFILE` (unnamed " -"temporary file; as of 3.4.0 release available only on Linux systems with a " -"kernel version of 3.11 or newer that have uapi headers). (Contributed by " -"Christian Heimes in :issue:`18673` and Benjamin Peterson, respectively.)" +":func:`os.open` supports two new flags on platforms that provide them, :" +"const:`~os.O_PATH` (un-opened file descriptor), and :const:`~os.O_TMPFILE` " +"(unnamed temporary file; as of 3.4.0 release available only on Linux systems " +"with a kernel version of 3.11 or newer that have uapi headers). " +"(Contributed by Christian Heimes in :issue:`18673` and Benjamin Peterson, " +"respectively.)" msgstr "" #: ../../whatsnew/3.4.rst:1199 @@ -1673,9 +1674,9 @@ msgid "" "stdlib serialization protocols, with new :func:`~plistlib.load`, :func:" "`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps` " "functions. (The older API is now deprecated.) In addition to the already " -"supported XML plist format (:data:`~plistlib.FMT_XML`), it also now supports " -"the binary plist format (:data:`~plistlib.FMT_BINARY`). (Contributed by " -"Ronald Oussoren and others in :issue:`14455`.)" +"supported XML plist format (:const:`~plistlib.FMT_XML`), it also now " +"supports the binary plist format (:const:`~plistlib.FMT_BINARY`). " +"(Contributed by Ronald Oussoren and others in :issue:`14455`.)" msgstr "" #: ../../whatsnew/3.4.rst:1247 @@ -1793,16 +1794,16 @@ msgstr "" #: ../../whatsnew/3.4.rst:1325 msgid "" "On Linux kernel version 2.6.36 or later, there are also some new Linux " -"specific constants: :attr:`~resource.RLIMIT_MSGQUEUE`, :attr:`~resource." -"RLIMIT_NICE`, :attr:`~resource.RLIMIT_RTPRIO`, :attr:`~resource." -"RLIMIT_RTTIME`, and :attr:`~resource.RLIMIT_SIGPENDING`. (Contributed by " +"specific constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource." +"RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`, :const:`~resource." +"RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by " "Christian Heimes in :issue:`19324`.)" msgstr "" #: ../../whatsnew/3.4.rst:1331 msgid "" "On FreeBSD version 9 and later, there some new FreeBSD specific constants: :" -"attr:`~resource.RLIMIT_SBSIZE`, :attr:`~resource.RLIMIT_SWAP`, and :attr:" +"const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" "`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" msgstr "" @@ -1880,7 +1881,7 @@ msgstr "socket" #: ../../whatsnew/3.4.rst:1391 msgid "" -"The socket module now supports the :data:`~socket.CAN_BCM` protocol on " +"The socket module now supports the :const:`~socket.CAN_BCM` protocol on " "platforms that support it. (Contributed by Brian Thorne in :issue:`15359`.)" msgstr "" @@ -1899,7 +1900,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.4.rst:1402 -msgid "The :data:`~socket.AF_LINK` constant is now available on BSD and OSX." +msgid "The :const:`~socket.AF_LINK` constant is now available on BSD and OSX." msgstr "" #: ../../whatsnew/3.4.rst:1404 @@ -1978,10 +1979,10 @@ msgid "" "If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new " "attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control " "the certificate verification process by setting it to some combination of " -"the new constants :data:`~ssl.VERIFY_DEFAULT`, :data:`~ssl." -"VERIFY_CRL_CHECK_LEAF`, :data:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :data:`~ssl." -"VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by default. " -"(Contributed by Christien Heimes in :issue:`8813`.)" +"the new constants :const:`~ssl.VERIFY_DEFAULT`, :const:`~ssl." +"VERIFY_CRL_CHECK_LEAF`, :const:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :const:" +"`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by " +"default. (Contributed by Christien Heimes in :issue:`8813`.)" msgstr "" #: ../../whatsnew/3.4.rst:1468 @@ -2033,8 +2034,8 @@ msgstr "" #: ../../whatsnew/3.4.rst:1502 msgid "" "The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`, :" -"attr:`~stat.S_IFPORT`, and :attr:`~stat.S_IFWHT`. (Contributed by Christian " -"Hiemes in :issue:`11016`.)" +"const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " +"Christian Hiemes in :issue:`11016`.)" msgstr "" #: ../../whatsnew/3.4.rst:1508 @@ -2505,7 +2506,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1852 msgid "" -"The PEP adds additional fields to the :attr:`sys.hash_info` named tuple to " +"The PEP adds additional fields to the :data:`sys.hash_info` named tuple to " "describe the hash algorithm in use by the currently executing binary. " "Otherwise, the PEP does not alter any existing CPython APIs." msgstr "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 5718070f14..a079ea1c87 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -531,7 +531,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:481 msgid "" -"An :py:data:`errno.EINTR` error code is returned whenever a system call, " +"An :py:const:`errno.EINTR` error code is returned whenever a system call, " "that is waiting for I/O, is interrupted by a signal. Previously, Python " "would raise :exc:`InterruptedError` in such cases. This meant that, when " "writing a Python application, the developer had two choices:" @@ -598,7 +598,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:529 msgid "" -"special cases: :func:`os.close` and :func:`os.dup2` now ignore :py:data:" +"special cases: :func:`os.close` and :func:`os.dup2` now ignore :py:const:" "`~errno.EINTR` errors; the syscall is not retried (see the PEP for the " "rationale);" msgstr "" @@ -1261,10 +1261,9 @@ msgstr "curses" #: ../../whatsnew/3.5.rst:1048 msgid "" -"The new :func:`~curses.update_lines_cols` function updates the :envvar:" -"`LINES` and :envvar:`COLS` environment variables. This is useful for " -"detecting manual screen resizing. (Contributed by Arnon Yaari in :issue:" -"`4254`.)" +"The new :func:`~curses.update_lines_cols` function updates the :data:`LINES` " +"and :data:`COLS` module variables. This is useful for detecting manual " +"screen resizing. (Contributed by Arnon Yaari in :issue:`4254`.)" msgstr "" #: ../../whatsnew/3.5.rst:1054 @@ -1822,7 +1821,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1500 msgid "" "New :func:`~os.get_blocking` and :func:`~os.set_blocking` functions allow " -"getting and setting a file descriptor's blocking mode (:data:`~os." +"getting and setting a file descriptor's blocking mode (:const:`~os." "O_NONBLOCK`.) (Contributed by Victor Stinner in :issue:`22054`.)" msgstr "" @@ -2196,8 +2195,8 @@ msgstr "" msgid "" "The new :meth:`SSLSocket.selected_alpn_protocol() ` returns the protocol that was selected during the " -"TLS handshake. The :data:`~ssl.HAS_ALPN` flag indicates whether ALPN support " -"is present." +"TLS handshake. The :const:`~ssl.HAS_ALPN` flag indicates whether ALPN " +"support is present." msgstr "" #: ../../whatsnew/3.5.rst:1790 @@ -2791,8 +2790,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2194 msgid "" "A new :c:func:`PyErr_FormatV` function similar to :c:func:`PyErr_Format`, " -"but accepts a ``va_list`` argument. (Contributed by Antoine Pitrou in :issue:" -"`18711`.)" +"but accepts a :c:type:`va_list` argument. (Contributed by Antoine Pitrou in :" +"issue:`18711`.)" msgstr "" #: ../../whatsnew/3.5.rst:2198 @@ -3224,7 +3223,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2479 msgid "" -"The :mod:`socket` module now exports the :data:`~socket.CAN_RAW_FD_FRAMES` " +"The :mod:`socket` module now exports the :const:`~socket.CAN_RAW_FD_FRAMES` " "constant on linux 3.6 and greater." msgstr "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 43056d52d7..343925f93d 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -754,8 +754,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:652 msgid "" "Check that the :term:`GIL ` is held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../whatsnew/3.6.rst:656 @@ -1767,7 +1768,7 @@ msgstr "site" #: ../../whatsnew/3.6.rst:1391 msgid "" -"When specifying paths to add to :attr:`sys.path` in a ``.pth`` file, you may " +"When specifying paths to add to :data:`sys.path` in a ``.pth`` file, you may " "now specify file paths on top of directories (e.g. zip files). (Contributed " "by Wolfgang Langner in :issue:`26587`)." msgstr "" @@ -1788,7 +1789,7 @@ msgstr "socket" #: ../../whatsnew/3.6.rst:1406 msgid "" -"The :func:`~socket.socket.ioctl` function now supports the :data:`~socket." +"The :func:`~socket.socket.ioctl` function now supports the :const:`~socket." "SIO_LOOPBACK_FAST_PATH` control code. (Contributed by Daniel Stokes in :" "issue:`26536`.)" msgstr "" @@ -1809,7 +1810,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1418 msgid "" -"The socket module now supports the address family :data:`~socket.AF_ALG` to " +"The socket module now supports the address family :const:`~socket.AF_ALG` to " "interface with Linux Kernel crypto API. ``ALG_*``, ``SOL_ALG`` and :meth:" "`~socket.socket.sendmsg_afalg` were added. (Contributed by Christian Heimes " "in :issue:`27744` with support from Victor Stinner.)" @@ -2355,7 +2356,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1824 msgid "" -"Allocator functions of the :c:func:`PyMem_Malloc` domain (:c:data:" +"Allocator functions of the :c:func:`PyMem_Malloc` domain (:c:macro:" "`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc memory allocator ` " "instead of :c:func:`malloc` function of the C library. The pymalloc " "allocator is optimized for objects smaller or equal to 512 bytes with a " @@ -2438,8 +2439,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:1876 msgid "" "The :term:`GIL ` must now be held when allocator " -"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" -"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called." +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " +"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " +"called." msgstr "" #: ../../whatsnew/3.6.rst:1880 @@ -2618,7 +2620,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2012 msgid "" "The :class:`importlib.machinery.WindowsRegistryFinder` class is now " -"deprecated. As of 3.6.0, it is still added to :attr:`sys.meta_path` by " +"deprecated. As of 3.6.0, it is still added to :data:`sys.meta_path` by " "default (on Windows), but this may change in future releases." msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index b864b988b1..27c812d576 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1801,15 +1801,15 @@ msgstr "" #: ../../whatsnew/3.7.rst:1283 msgid "" -"The :mod:`socket` module now exposes the :data:`socket.TCP_CONGESTION` " -"(Linux 2.6.13), :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and :data:" +"The :mod:`socket` module now exposes the :const:`socket.TCP_CONGESTION` " +"(Linux 2.6.13), :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37), and :const:" "`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constants. (Contributed by Omar " "Sandoval in :issue:`26273` and Nathaniel J. Smith in :issue:`29728`.)" msgstr "" #: ../../whatsnew/3.7.rst:1289 msgid "" -"Support for :data:`socket.AF_VSOCK` sockets has been added to allow " +"Support for :const:`socket.AF_VSOCK` sockets has been added to allow " "communication between virtual machines and their hosts. (Contributed by " "Cathy Avery in :issue:`27584`.)" msgstr "" @@ -1962,7 +1962,7 @@ msgstr "subprocess" msgid "" "The :func:`subprocess.run` function accepts the new *capture_output* keyword " "argument. When true, stdout and stderr will be captured. This is equivalent " -"to passing :data:`subprocess.PIPE` as *stdout* and *stderr* arguments. " +"to passing :const:`subprocess.PIPE` as *stdout* and *stderr* arguments. " "(Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" @@ -2034,20 +2034,20 @@ msgstr "" #: ../../whatsnew/3.7.rst:1456 msgid "" -":data:`time.CLOCK_BOOTTIME` (Linux): Identical to :data:`time." +":const:`time.CLOCK_BOOTTIME` (Linux): Identical to :const:`time." "CLOCK_MONOTONIC`, except it also includes any time that the system is " "suspended." msgstr "" #: ../../whatsnew/3.7.rst:1459 msgid "" -":data:`time.CLOCK_PROF` (FreeBSD, NetBSD and OpenBSD): High-resolution per-" +":const:`time.CLOCK_PROF` (FreeBSD, NetBSD and OpenBSD): High-resolution per-" "process CPU timer." msgstr "" #: ../../whatsnew/3.7.rst:1461 msgid "" -":data:`time.CLOCK_UPTIME` (FreeBSD, OpenBSD): Time whose absolute value is " +":const:`time.CLOCK_UPTIME` (FreeBSD, OpenBSD): Time whose absolute value is " "the time the system has been running and not suspended, providing accurate " "uptime measurement." msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 016912ff1d..aedd30d9c2 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-22 00:04+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-" @@ -1596,8 +1596,8 @@ msgstr "time" #: ../../whatsnew/3.8.rst:1308 msgid "" -"Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. (Contributed " -"by Joannah Nanjekye in :issue:`35702`.)" +"Added new clock :const:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. " +"(Contributed by Joannah Nanjekye in :issue:`35702`.)" msgstr "" #: ../../whatsnew/3.8.rst:1313 @@ -2393,7 +2393,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1842 msgid "" -"On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " +"On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " "Python versions include the version number, so it is recommended to always " "use ``sys.platform.startswith('aix')``. (Contributed by M. Felt in :issue:" @@ -2730,7 +2730,7 @@ msgid "" "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " "exported by a third-party extension module is supposed to have all the slots " "expected in the current Python version, including :c:member:`~PyTypeObject." -"tp_finalize` (:const:`Py_TPFLAGS_HAVE_FINALIZE` is not checked anymore " +"tp_finalize` (:c:macro:`Py_TPFLAGS_HAVE_FINALIZE` is not checked anymore " "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 9368151b06..5a561bed6e 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-24 00:03+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-" @@ -599,8 +599,9 @@ msgstr "fcntl" #: ../../whatsnew/3.9.rst:430 msgid "" -"Added constants :data:`~fcntl.F_OFD_GETLK`, :data:`~fcntl.F_OFD_SETLK` and :" -"data:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:`38602`.)" +"Added constants :const:`~fcntl.F_OFD_GETLK`, :const:`~fcntl.F_OFD_SETLK` " +"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:" +"`38602`.)" msgstr "" #: ../../whatsnew/3.9.rst:435 @@ -868,13 +869,13 @@ msgstr "os" #: ../../whatsnew/3.9.rst:596 msgid "" -"Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for :attr:" +"Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for :attr:" "`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" msgstr "" #: ../../whatsnew/3.9.rst:599 msgid "" -"Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :data:" +"Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :const:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" @@ -994,14 +995,14 @@ msgstr "socket" #: ../../whatsnew/3.9.rst:672 msgid "" -"The :mod:`socket` module now exports the :data:`~socket." +"The :mod:`socket` module now exports the :const:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" #: ../../whatsnew/3.9.rst:676 msgid "" -"The socket module now supports the :data:`~socket.CAN_J1939` protocol on " +"The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" @@ -1030,7 +1031,7 @@ msgstr "sys" #: ../../whatsnew/3.9.rst:695 msgid "" -"Added a new :attr:`sys.platlibdir` attribute: name of the platform-specific " +"Added a new :data:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " "paths of installed extension modules. It is equal to ``\"lib\"`` on most " "platforms. On Fedora and SuSE, it is equal to ``\"lib64\"`` on 64-bit " @@ -1040,7 +1041,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:701 msgid "" -"Previously, :attr:`sys.stderr` was block-buffered when non-interactive. Now " +"Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" @@ -1568,7 +1569,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1086 msgid "" -"The :meth:`select.epoll.unregister` method no longer ignores the :data:" +"The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" @@ -1619,10 +1620,10 @@ msgstr "" #: ../../whatsnew/3.9.rst:1118 msgid "" -"``array('u')`` now uses ``wchar_t`` as C type instead of ``Py_UNICODE``. " -"This change doesn't affect to its behavior because ``Py_UNICODE`` is alias " -"of ``wchar_t`` since Python 3.3. (Contributed by Inada Naoki in :issue:" -"`34538`.)" +"``array('u')`` now uses :c:type:`wchar_t` as C type instead of " +"``Py_UNICODE``. This change doesn't affect to its behavior because " +"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3. (Contributed " +"by Inada Naoki in :issue:`34538`.)" msgstr "" #: ../../whatsnew/3.9.rst:1123 @@ -1751,8 +1752,8 @@ msgstr "" #: ../../whatsnew/3.9.rst:1228 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " -"platform-specific library directory, stored in the new :attr:`sys." -"platlibdir` attribute. See :attr:`sys.platlibdir` attribute for more " +"platform-specific library directory, stored in the new :data:`sys." +"platlibdir` attribute. See :data:`sys.platlibdir` attribute for more " "information. (Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis " "and Victor Stinner in :issue:`1294959`.)" msgstr "" @@ -1817,7 +1818,7 @@ msgstr "" msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " -"to retrieve the module and its state; and :c:data:`PyCMethod` and :c:data:" +"to retrieve the module and its state; and :c:type:`PyCMethod` and :c:macro:" "`METH_METHOD` to allow a method to access the class it was defined in. " "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr "" From 9d1175cd1cec9d6ea15716790e6d033efde594d9 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 25 Jul 2023 14:15:57 +0800 Subject: [PATCH 023/105] Translate `c-api/codec.po` (#503) * feat: translate `c-api/codec.po` * fix: update based on review comment --- c-api/codec.po | 72 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/c-api/codec.po b/c-api/codec.po index 8ab97e9fc8..126e008ecf 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-26 16:47+0000\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2023-07-24 17:51+0000\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -20,17 +20,19 @@ msgstr "" #: ../../c-api/codec.rst:4 msgid "Codec registry and support functions" -msgstr "" +msgstr "編解碼器註冊表和支援函式" #: ../../c-api/codec.rst:8 msgid "Register a new codec search function." -msgstr "" +msgstr "註冊一個新的編解碼器搜索函式。" #: ../../c-api/codec.rst:10 msgid "" "As side effect, this tries to load the :mod:`encodings` package, if not yet " "done, to make sure that it is always first in the list of search functions." msgstr "" +"作為副作用 (side effect),這會嘗試載入 :mod:`encodings`\\ (如果尚未完成)," +"以確保它始終位於搜索函式列表中的第一個。" #: ../../c-api/codec.rst:15 msgid "" @@ -38,16 +40,20 @@ msgid "" "search function is not registered, do nothing. Return 0 on success. Raise an " "exception and return -1 on error." msgstr "" +"取消註冊編解碼器搜索函式並清除註冊表 (registry) 的快取。如果搜索函式並未被註" +"冊,則不執行任何操作。成功回傳 0,發生錯誤時會引發例外並回傳 -1。" #: ../../c-api/codec.rst:23 msgid "" "Return ``1`` or ``0`` depending on whether there is a registered codec for " "the given *encoding*. This function always succeeds." msgstr "" +"回傳 ``1`` 或 ``0``,具體取決於是否有給定 *encoding* 的已註冊編解碼器。這個函" +"式總會成功。" #: ../../c-api/codec.rst:28 msgid "Generic codec based encoding API." -msgstr "" +msgstr "基於泛用編解碼器的編碼 API。" #: ../../c-api/codec.rst:30 msgid "" @@ -56,10 +62,13 @@ msgid "" "may be ``NULL`` to use the default method defined for the codec. Raises a :" "exc:`LookupError` if no encoder can be found." msgstr "" +"*object* 被傳遞給以給定 *encoding* 所查找到的編碼器函式,並使用以 *errors* 定" +"義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如" +"果找不到編碼器,則引發 :exc:`LookupError`。" #: ../../c-api/codec.rst:37 msgid "Generic codec based decoding API." -msgstr "" +msgstr "基於泛用編解碼器的解碼 API。" #: ../../c-api/codec.rst:39 msgid "" @@ -68,10 +77,13 @@ msgid "" "may be ``NULL`` to use the default method defined for the codec. Raises a :" "exc:`LookupError` if no encoder can be found." msgstr "" +"*object* 被傳遞給以給定 *encoding* 所查找到的解碼器函式,並使用以 *errors* 定" +"義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如" +"果找不到編碼器,則引發 :exc:`LookupError`。" #: ../../c-api/codec.rst:46 msgid "Codec lookup API" -msgstr "" +msgstr "編解碼器查找 API" #: ../../c-api/codec.rst:48 msgid "" @@ -80,40 +92,43 @@ msgid "" "mechanism effectively case-insensitive. If no codec is found, a :exc:" "`KeyError` is set and ``NULL`` returned." msgstr "" +"在以下函式中,查找的 *encoding* 字串的所有字元將轉換為小寫,這使得透過此機制" +"查找的編碼可以不區分大小寫而更有效率。如果未找到編解碼器,則會設定 :exc:" +"`KeyError` 並回傳 ``NULL``。" #: ../../c-api/codec.rst:55 msgid "Get an encoder function for the given *encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的編碼器函式。" #: ../../c-api/codec.rst:59 msgid "Get a decoder function for the given *encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的解碼器函式。" #: ../../c-api/codec.rst:63 msgid "" "Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的 :class:`~codecs.IncrementalEncoder` 物件。" #: ../../c-api/codec.rst:67 msgid "" "Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的 :class:`~codecs.IncrementalDecoder` 物件。" #: ../../c-api/codec.rst:71 msgid "" "Get a :class:`~codecs.StreamReader` factory function for the given " "*encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的 :class:`~codecs.StreamReader` 工廠函式。" #: ../../c-api/codec.rst:75 msgid "" "Get a :class:`~codecs.StreamWriter` factory function for the given " "*encoding*." -msgstr "" +msgstr "取得給定 *encoding* 的 :class:`~codecs.StreamWriter` 工廠函式。" #: ../../c-api/codec.rst:79 msgid "Registry API for Unicode encoding error handlers" -msgstr "" +msgstr "用於 Unicode 編碼錯誤處理程式的註冊 API" #: ../../c-api/codec.rst:83 msgid "" @@ -122,6 +137,9 @@ msgid "" "unencodable characters/undecodable bytes and *name* is specified as the " "error parameter in the call to the encode/decode function." msgstr "" +"在給定的 *name* 下註冊錯誤處理回呼 (callback) 函式 *error*。當編解碼器遇到無" +"法編碼的字元/無法解碼的位元組並且 *name* 被指定為呼叫編碼/解碼函式時的錯誤參" +"數時,將呼叫此回呼函式。" #: ../../c-api/codec.rst:88 msgid "" @@ -135,10 +153,16 @@ msgid "" "integer giving the offset in the original string at which encoding/decoding " "should be resumed." msgstr "" +"回呼取得單個引數,即 :exc:`UnicodeEncodeError`、:exc:`UnicodeDecodeError` " +"或 :exc:`UnicodeTranslateError` 的實例,其中包含關於有問題的字元或位元組序列" +"及其在原始字串中偏移量的資訊(有關取得此資訊的函式,請參閱 :ref:" +"`unicodeexceptions`)。回呼必須引發給定的例外,或者回傳一個包含有問題序列的替" +"換的二元組 (two-item tuple),以及一個代表原始字串中應該被恢復的編碼/解碼偏移" +"量的整數。" #: ../../c-api/codec.rst:98 msgid "Return ``0`` on success, ``-1`` on error." -msgstr "" +msgstr "成功時回傳 ``0``,錯誤時回傳 ``-1``。" #: ../../c-api/codec.rst:102 msgid "" @@ -146,29 +170,31 @@ msgid "" "special case ``NULL`` can be passed, in which case the error handling " "callback for \"strict\" will be returned." msgstr "" +"查找 *name* 下已註冊的錯誤處理回呼函式。作為一種特殊情況,可以傳遞 ``NULL``," +"在這種情況下,將回傳 \"strict\" 的錯誤處理回呼。" #: ../../c-api/codec.rst:108 msgid "Raise *exc* as an exception." -msgstr "" +msgstr "引發 *exc* 作為例外。" #: ../../c-api/codec.rst:112 msgid "Ignore the unicode error, skipping the faulty input." -msgstr "" +msgstr "忽略 unicode 錯誤,跳過錯誤的輸入。" #: ../../c-api/codec.rst:116 msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``." -msgstr "" +msgstr "將 unicode 編碼錯誤替換為 ``?`` 或 ``U+FFFD``。" #: ../../c-api/codec.rst:120 msgid "Replace the unicode encode error with XML character references." -msgstr "" +msgstr "將 unicode 編碼錯誤替換為 XML 字元參照。" #: ../../c-api/codec.rst:124 msgid "" "Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` " "and ``\\U``)." -msgstr "" +msgstr "將 unicode 編碼錯誤替換為反斜線跳脫(``\\x``、``\\u`` 和 ``\\U``)。" #: ../../c-api/codec.rst:129 msgid "Replace the unicode encode error with ``\\N{...}`` escapes." -msgstr "" +msgstr "將 unicode 編碼錯誤替換為 ``\\N{...}`` 跳脫。" From 84eb0d5ef6ab1d144bf6fbd80e9d18921bcd9f7d Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Wed, 26 Jul 2023 11:53:49 +0800 Subject: [PATCH 024/105] Sync with CPython 3.12 (#504) * sync with cpython 5fd028b6 * sync with cpython 3d15c8b8 * fix fuzzy entries and incorrect syntax --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- howto/clinic.po | 1180 +++++++++++----------- library/multiprocessing.shared_memory.po | 48 +- library/statistics.po | 4 +- library/turtle.po | 1057 ++++++++++--------- sphinx.po | 18 +- tutorial/introduction.po | 58 +- 6 files changed, 1258 insertions(+), 1107 deletions(-) diff --git a/howto/clinic.po b/howto/clinic.po index bd5548c581..eb225b5e6e 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-21 09:32+0000\n" +"POT-Creation-Date: 2023-07-25 00:04+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-" @@ -138,30 +138,30 @@ msgstr "" #: ../../howto/clinic.rst:99 msgid "" -"Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." -"py``. If you run that script, specifying a C file as an argument:" +"Argument Clinic ships with CPython; you'll find it in :source:`Tools/clinic/" +"clinic.py`. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:106 +#: ../../howto/clinic.rst:107 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:113 +#: ../../howto/clinic.rst:114 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:120 +#: ../../howto/clinic.rst:121 msgid "" "Everything in between these two lines is input for Argument Clinic. All of " "these lines, including the beginning and ending comment lines, are " "collectively called an Argument Clinic \"block\"." msgstr "" -#: ../../howto/clinic.rst:124 +#: ../../howto/clinic.rst:125 msgid "" "When Argument Clinic parses one of these blocks, it generates output. This " "output is rewritten into the C file immediately after the block, followed by " @@ -169,7 +169,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:138 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old output and write out the new output with a fresh " @@ -177,7 +177,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:141 +#: ../../howto/clinic.rst:142 msgid "" "You should never modify the output portion of an Argument Clinic block. " "Instead, change the input until it produces the output you want. (That's " @@ -186,38 +186,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:146 +#: ../../howto/clinic.rst:147 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:148 +#: ../../howto/clinic.rst:149 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:149 +#: ../../howto/clinic.rst:150 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:150 +#: ../../howto/clinic.rst:151 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:151 +#: ../../howto/clinic.rst:152 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:152 +#: ../../howto/clinic.rst:153 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:153 +#: ../../howto/clinic.rst:154 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -225,11 +225,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:162 +#: ../../howto/clinic.rst:163 msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:164 +#: ../../howto/clinic.rst:165 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -240,30 +240,31 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:173 +#: ../../howto/clinic.rst:174 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:175 +#: ../../howto/clinic.rst:176 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:178 +#: ../../howto/clinic.rst:179 msgid "" "Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." +"Argument Clinic yet. For my example I'm using :py:meth:`_pickle.Pickler.dump " +"`." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:185 msgid "" -"If the call to the ``PyArg_Parse`` function uses any of the following format " -"units:" +"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " +"following format units:" msgstr "" -#: ../../howto/clinic.rst:195 +#: ../../howto/clinic.rst:197 msgid "" "or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " "a different function. Argument Clinic *does* support all of these " @@ -271,21 +272,21 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:200 +#: ../../howto/clinic.rst:202 msgid "" -"Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" -"func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " -"same argument, or if the function uses something besides PyArg_Parse " -"functions to parse its arguments, it probably isn't suitable for conversion " -"to Argument Clinic. Argument Clinic doesn't support generic functions or " -"polymorphic parameters." +"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" +"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " +"the same argument, or if the function uses something besides :c:func:`!" +"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " +"for conversion to Argument Clinic. Argument Clinic doesn't support generic " +"functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:207 +#: ../../howto/clinic.rst:209 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:212 +#: ../../howto/clinic.rst:214 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -293,22 +294,22 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:218 +#: ../../howto/clinic.rst:220 msgid "" "If the old docstring had a first line that looked like a function signature, " -"throw that line away. (The docstring doesn't need it anymore—when you use " -"``help()`` on your builtin in the future, the first line will be built " +"throw that line away. (The docstring doesn't need it anymore—when you use :" +"py:func:`help` on your builtin in the future, the first line will be built " "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:224 ../../howto/clinic.rst:245 -#: ../../howto/clinic.rst:269 ../../howto/clinic.rst:327 -#: ../../howto/clinic.rst:367 ../../howto/clinic.rst:394 -#: ../../howto/clinic.rst:500 ../../howto/clinic.rst:552 +#: ../../howto/clinic.rst:226 ../../howto/clinic.rst:247 +#: ../../howto/clinic.rst:271 ../../howto/clinic.rst:329 +#: ../../howto/clinic.rst:369 ../../howto/clinic.rst:396 +#: ../../howto/clinic.rst:502 ../../howto/clinic.rst:554 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:230 +#: ../../howto/clinic.rst:232 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain. So let's make sure it has one. The \"summary\" line should be a " @@ -316,13 +317,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:235 +#: ../../howto/clinic.rst:237 msgid "" "(Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step.)" msgstr "" -#: ../../howto/clinic.rst:238 +#: ../../howto/clinic.rst:240 msgid "" "Above the docstring, enter the name of the function, followed by a blank " "line. This should be the Python name of the function, and should be the " @@ -331,7 +332,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:253 +#: ../../howto/clinic.rst:255 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -341,47 +342,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:261 +#: ../../howto/clinic.rst:263 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:265 +#: ../../howto/clinic.rst:267 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`PyTypeObject` for this class." +"class, and a pointer to the :c:type:`!PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:285 +#: ../../howto/clinic.rst:287 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " "name and the docstring." msgstr "" -#: ../../howto/clinic.rst:289 +#: ../../howto/clinic.rst:291 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:295 +#: ../../howto/clinic.rst:297 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:302 +#: ../../howto/clinic.rst:304 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "please see :ref:`the section below on default values ` for " "more information." msgstr "" -#: ../../howto/clinic.rst:306 +#: ../../howto/clinic.rst:308 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:308 +#: ../../howto/clinic.rst:310 msgid "" "What's a \"converter\"? It establishes both the type of the variable used " "in C, and the method to convert the Python value into a C value at runtime. " @@ -390,68 +391,69 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:315 +#: ../../howto/clinic.rst:317 msgid "" -"For each parameter, copy the \"format unit\" for that parameter from the " -"``PyArg_Parse()`` format argument and specify *that* as its converter, as a " +"For each parameter, copy the \"format unit\" for that parameter from the :c:" +"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " "quoted string. (\"format unit\" is the formal name for the one-to-three " -"character substring of the ``format`` parameter that tells the argument " +"character substring of the *format* parameter that tells the argument " "parsing function what the type of the variable is and how to convert it. " "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:324 +#: ../../howto/clinic.rst:326 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:342 +#: ../../howto/clinic.rst:344 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:347 +#: ../../howto/clinic.rst:349 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:352 -msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" +#: ../../howto/clinic.rst:354 +msgid "" +"(:py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:355 +#: ../../howto/clinic.rst:357 msgid "" "If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" "c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" "only." msgstr "" -#: ../../howto/clinic.rst:359 +#: ../../howto/clinic.rst:361 msgid "" "To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " "a line by itself after the last parameter, indented the same as the " "parameter lines." msgstr "" -#: ../../howto/clinic.rst:363 +#: ../../howto/clinic.rst:365 msgid "" "Currently this is all-or-nothing; either all parameters are positional-only, " "or none of them are. (In the future Argument Clinic may relax this " "restriction.)" msgstr "" -#: ../../howto/clinic.rst:383 +#: ../../howto/clinic.rst:385 msgid "" "It's helpful to write a per-parameter docstring for each parameter. But per-" "parameter docstrings are optional; you can skip this step if you prefer." msgstr "" -#: ../../howto/clinic.rst:387 +#: ../../howto/clinic.rst:389 msgid "" "Here's how to add a per-parameter docstring. The first line of the per-" "parameter docstring must be indented further than the parameter definition. " @@ -461,34 +463,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:411 +#: ../../howto/clinic.rst:413 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " -"luck everything worked---your block now has output, and a ``.c.h`` file has " -"been generated! Reopen the file in your text editor to see::" +"luck everything worked---your block now has output, and a :file:`.c.h` file " +"has been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:430 +#: ../../howto/clinic.rst:432 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:434 +#: ../../howto/clinic.rst:436 msgid "" -"For readability, most of the glue code has been generated to a ``.c.h`` " -"file. You'll need to include that in your original ``.c`` file, typically " -"right after the clinic module block::" +"For readability, most of the glue code has been generated to a :file:`.c.h` " +"file. You'll need to include that in your original :file:`.c` file, " +"typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:440 +#: ../../howto/clinic.rst:442 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:443 +#: ../../howto/clinic.rst:445 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -496,21 +498,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:449 +#: ../../howto/clinic.rst:451 msgid "" -"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" -"`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" +"Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" +"func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:454 +#: ../../howto/clinic.rst:456 msgid "" "(Argument Clinic always generates its format strings with a ``:`` followed " "by the name of the function. If the existing code's format string ends with " "``;``, to provide usage help, this change is harmless—don't worry about it.)" msgstr "" -#: ../../howto/clinic.rst:459 +#: ../../howto/clinic.rst:461 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -518,27 +520,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:464 +#: ../../howto/clinic.rst:466 msgid "" "Fourth, inside the output portion of the block you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:471 +#: ../../howto/clinic.rst:473 msgid "" "This static structure should be *exactly* the same as the existing static :c:" -"type:`PyMethodDef` structure for this builtin." +"type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:474 +#: ../../howto/clinic.rst:476 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:479 +#: ../../howto/clinic.rst:481 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -549,74 +551,74 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:487 +#: ../../howto/clinic.rst:489 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:496 +#: ../../howto/clinic.rst:498 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening (and closing) curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:541 +#: ../../howto/clinic.rst:543 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`PyMethodDef` structure for this " +"function? Find the existing :c:type:`!PyMethodDef` structure for this " "function and replace it with a reference to the macro. (If the builtin is " "at module scope, this will probably be very near the end of the file; if the " "builtin is a class method, this will probably be below but relatively near " "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:548 +#: ../../howto/clinic.rst:550 msgid "" "Note that the body of the macro contains a trailing comma. So when you " -"replace the existing static :c:type:`PyMethodDef` structure with the macro, " +"replace the existing static :c:type:`!PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:561 +#: ../../howto/clinic.rst:563 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:565 +#: ../../howto/clinic.rst:567 msgid "" -"If it does, you'll have to run ``Tools/scripts/generate_global_objects.py`` " -"to regenerate the list of precompiled identifiers at this point." +"If it does, you'll have to run ``make regen-global-objects`` to regenerate " +"the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:569 +#: ../../howto/clinic.rst:571 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:573 +#: ../../howto/clinic.rst:575 msgid "" -"Well, except for one difference: ``inspect.signature()`` run on your " +"Well, except for one difference: :py:func:`inspect.signature` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:576 +#: ../../howto/clinic.rst:578 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:582 +#: ../../howto/clinic.rst:584 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:586 -msgid "How to to rename C functions and variables generated by Argument Clinic" +#: ../../howto/clinic.rst:588 +msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:588 +#: ../../howto/clinic.rst:590 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -628,19 +630,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:596 +#: ../../howto/clinic.rst:598 msgid "" -"For example, if we wanted to rename the C function names generated for " -"``pickle.Pickler.dump``, it'd look like this::" +"For example, if we wanted to rename the C function names generated for :py:" +"meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:604 +#: ../../howto/clinic.rst:606 msgid "" -"The base function would now be named ``pickler_dumper()``, and the impl " -"function would now be named ``pickler_dumper_impl()``." +"The base function would now be named :c:func:`!pickler_dumper`, and the impl " +"function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:608 +#: ../../howto/clinic.rst:610 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -648,40 +650,40 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:622 +#: ../../howto/clinic.rst:624 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " -"would be ``file``, but the C variable would be named ``file_obj``." +"would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:625 -msgid "You can use this to rename the ``self`` parameter too!" +#: ../../howto/clinic.rst:627 +msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:629 +#: ../../howto/clinic.rst:631 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:631 +#: ../../howto/clinic.rst:633 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the ``type`` argument to cast the type as " +"an ``object``. You may specify the *type* argument to cast the type as " "appropriate. All arguments should be marked positional-only (add a ``/`` on " "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:637 +#: ../../howto/clinic.rst:639 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:642 +#: ../../howto/clinic.rst:644 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:646 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -692,21 +694,21 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:651 +#: ../../howto/clinic.rst:653 msgid "" -"While functions using this approach can often be converted to use :c:func:" -"`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " +"While functions using this approach can often be converted to use :c:func:`!" +"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " "not always possible. Some of these legacy functions have behaviors :c:func:" -"`PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function ``range()``, which has an optional argument " -"on the *left* side of its required argument! Another example is ``curses." -"window.addch()``, which has a group of two arguments that must always be " -"specified together. (The arguments are called ``x`` and ``y``; if you call " -"the function passing in ``x``, you must also pass in ``y``—and if you don't " -"pass in ``x`` you may not pass in ``y`` either.)" +"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " +"example is the builtin function :py:func:`range`, which has an optional " +"argument on the *left* side of its required argument! Another example is :py:" +"meth:`curses.window.addch`, which has a group of two arguments that must " +"always be specified together. (The arguments are called *x* and *y*; if you " +"call the function passing in *x*, you must also pass in *y* — and if you " +"don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:663 +#: ../../howto/clinic.rst:665 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -716,7 +718,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:671 +#: ../../howto/clinic.rst:673 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -727,20 +729,20 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:680 +#: ../../howto/clinic.rst:682 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how ``curses.window.addch`` uses " -"optional groups to make the first two parameters and the last parameter " +"these parameters. As an example, here's how :py:meth:`curses.window.addch` " +"uses optional groups to make the first two parameters and the last parameter " "optional::" msgstr "" -#: ../../howto/clinic.rst:709 +#: ../../howto/clinic.rst:711 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:711 +#: ../../howto/clinic.rst:713 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -753,34 +755,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:722 +#: ../../howto/clinic.rst:724 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:725 +#: ../../howto/clinic.rst:727 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:728 +#: ../../howto/clinic.rst:730 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:730 +#: ../../howto/clinic.rst:732 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:735 +#: ../../howto/clinic.rst:737 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:737 +#: ../../howto/clinic.rst:739 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -789,38 +791,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:744 +#: ../../howto/clinic.rst:746 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:748 +#: ../../howto/clinic.rst:750 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:751 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:752 +#: ../../howto/clinic.rst:754 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:756 +#: ../../howto/clinic.rst:758 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:759 +#: ../../howto/clinic.rst:761 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -828,17 +830,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:765 +#: ../../howto/clinic.rst:767 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:773 ../../howto/clinic.rst:1353 -msgid "``c_default``" -msgstr "``c_default``" +#: ../../howto/clinic.rst:775 +msgid "*c_default*" +msgstr "*c_default*" -#: ../../howto/clinic.rst:769 +#: ../../howto/clinic.rst:771 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -846,36 +848,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:778 -msgid "``annotation``" -msgstr "``annotation``" +#: ../../howto/clinic.rst:780 +msgid "*annotation*" +msgstr "*annotation*" -#: ../../howto/clinic.rst:776 +#: ../../howto/clinic.rst:778 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:781 -msgid "``unused``" -msgstr "``unused``" +#: ../../howto/clinic.rst:783 +msgid "*unused*" +msgstr "*unused*" -#: ../../howto/clinic.rst:781 +#: ../../howto/clinic.rst:783 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:783 +#: ../../howto/clinic.rst:785 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:792 -msgid "``accept``" -msgstr "``accept``" +#: ../../howto/clinic.rst:794 +msgid "*accept*" +msgstr "*accept*" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:789 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -883,68 +885,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:792 +#: ../../howto/clinic.rst:794 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:797 -msgid "``bitwise``" -msgstr "``bitwise``" +#: ../../howto/clinic.rst:799 +msgid "*bitwise*" +msgstr "*bitwise*" -#: ../../howto/clinic.rst:795 +#: ../../howto/clinic.rst:797 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:802 ../../howto/clinic.rst:1367 -msgid "``converter``" -msgstr "``converter``" +#: ../../howto/clinic.rst:804 +msgid "*converter*" +msgstr "*converter*" -#: ../../howto/clinic.rst:800 +#: ../../howto/clinic.rst:802 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:807 -msgid "``encoding``" -msgstr "``encoding``" +#: ../../howto/clinic.rst:809 +msgid "*encoding*" +msgstr "*encoding*" -#: ../../howto/clinic.rst:805 +#: ../../howto/clinic.rst:807 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:811 -msgid "``subclass_of``" -msgstr "``subclass_of``" +#: ../../howto/clinic.rst:813 +msgid "*subclass_of*" +msgstr "*subclass_of*" -#: ../../howto/clinic.rst:810 +#: ../../howto/clinic.rst:812 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:816 ../../howto/clinic.rst:1339 -msgid "``type``" -msgstr "``type``" +#: ../../howto/clinic.rst:818 +msgid "*type*" +msgstr "" -#: ../../howto/clinic.rst:814 +#: ../../howto/clinic.rst:816 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:822 -msgid "``zeroes``" -msgstr "``zeroes``" +#: ../../howto/clinic.rst:824 +msgid "*zeroes*" +msgstr "*zeroes*" -#: ../../howto/clinic.rst:819 +#: ../../howto/clinic.rst:821 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -952,361 +954,361 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:826 msgid "" "Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific ``PyArg_ParseTuple`` *format " -"units*, with specific behavior. For example, currently you cannot call " -"``unsigned_short`` without also specifying ``bitwise=True``. Although it's " -"perfectly reasonable to think this would work, these semantics don't map to " -"any existing format unit. So Argument Clinic doesn't support it. (Or, at " -"least, not yet.)" +"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " +"*format units*, with specific behavior. For example, currently you cannot " +"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " +"it's perfectly reasonable to think this would work, these semantics don't " +"map to any existing format unit. So Argument Clinic doesn't support it. " +"(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:834 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:878 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:878 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:879 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:879 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:880 +#: ../../howto/clinic.rst:882 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:895 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1315,7 +1317,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:899 +#: ../../howto/clinic.rst:901 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1323,11 +1325,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:906 +#: ../../howto/clinic.rst:908 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:908 +#: ../../howto/clinic.rst:910 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1335,74 +1337,74 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:917 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:919 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:922 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " "converters\" don't support arguments. That's why we skipped them for your " "first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either ``converter`` (for " -"``O&``), ``subclass_of`` (for ``O!``), or ``encoding`` (for all the format " -"units that start with ``e``)." +"argument to the converter; this argument is either *converter* (for ``O&``), " +"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " +"start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:930 msgid "" -"When using ``subclass_of``, you may also want to use the other custom " -"argument for ``object()``: ``type``, which lets you set the type actually " -"used for the parameter. For example, if you want to ensure that the object " -"is a subclass of ``PyUnicode_Type``, you probably want to use the converter " +"When using *subclass_of*, you may also want to use the other custom argument " +"for ``object()``: *type*, which lets you set the type actually used for the " +"parameter. For example, if you want to ensure that the object is a subclass " +"of :c:var:`PyUnicode_Type`, you probably want to use the converter " "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:936 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a " -"``PyArg_Parse`` call by hand, you could theoretically decide at runtime what " -"encoding string to pass in to :c:func:`PyArg_ParseTuple`. But now this " -"string must be hard-coded at Argument-Clinic-preprocessing-time. This " -"limitation is deliberate; it made supporting this format unit much easier, " -"and may allow for future optimizations. This restriction doesn't seem " -"unreasonable; CPython itself always passes in static hard-coded encoding " -"strings for parameters whose format units start with ``e``." +"flexibility for the format units starting with ``e``. When writing a :c:" +"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " +"what encoding string to pass to that call. But now this string must be " +"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " +"deliberate; it made supporting this format unit much easier, and may allow " +"for future optimizations. This restriction doesn't seem unreasonable; " +"CPython itself always passes in static hard-coded encoding strings for " +"parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:949 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:951 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:958 +#: ../../howto/clinic.rst:960 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:966 +#: ../../howto/clinic.rst:968 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:971 +#: ../../howto/clinic.rst:973 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:973 +#: ../../howto/clinic.rst:975 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1412,45 +1414,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:982 +#: ../../howto/clinic.rst:984 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:984 +#: ../../howto/clinic.rst:986 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:987 +#: ../../howto/clinic.rst:989 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:988 +#: ../../howto/clinic.rst:990 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:989 +#: ../../howto/clinic.rst:991 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:990 +#: ../../howto/clinic.rst:992 msgid "" -"Simple symbolic constants like ``sys.maxsize``, which must start with the " -"name of the module" +"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " +"the name of the module" msgstr "" -#: ../../howto/clinic.rst:993 +#: ../../howto/clinic.rst:995 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:998 +#: ../../howto/clinic.rst:1000 msgid "Expressions as default values" msgstr "" -#: ../../howto/clinic.rst:1000 +#: ../../howto/clinic.rst:1002 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1458,43 +1460,44 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:1005 +#: ../../howto/clinic.rst:1007 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:1011 +#: ../../howto/clinic.rst:1013 msgid "" -"``sys.maxsize`` can have different values on different platforms. Therefore " -"Argument Clinic can't simply evaluate that expression locally and hard-code " -"it in C. So it stores the default in such a way that it will get evaluated " -"at runtime, when the user asks for the function's signature." +":py:data:`sys.maxsize` can have different values on different platforms. " +"Therefore Argument Clinic can't simply evaluate that expression locally and " +"hard-code it in C. So it stores the default in such a way that it will get " +"evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:1016 +#: ../../howto/clinic.rst:1018 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " -"module has an attribute called \"``max_widgets``\", you may simply use it:" +"module has an attribute called :py:attr:`!max_widgets`, you may simply use " +"it:" msgstr "" -#: ../../howto/clinic.rst:1024 +#: ../../howto/clinic.rst:1026 msgid "" -"If the symbol isn't found in the current module, it fails over to looking in " -"``sys.modules``. That's how it can find ``sys.maxsize`` for example. " -"(Since you don't know in advance what modules the user will load into their " -"interpreter, it's best to restrict yourself to modules that are preloaded by " -"Python itself.)" +"If the symbol isn't found in the current module, it fails over to looking " +"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " +"for example. (Since you don't know in advance what modules the user will " +"load into their interpreter, it's best to restrict yourself to modules that " +"are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1029 +#: ../../howto/clinic.rst:1031 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " "explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the ``c_default`` parameter to the converter:" +"expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1038 +#: ../../howto/clinic.rst:1040 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1502,38 +1505,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1043 +#: ../../howto/clinic.rst:1045 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1047 +#: ../../howto/clinic.rst:1049 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1048 +#: ../../howto/clinic.rst:1050 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1049 +#: ../../howto/clinic.rst:1051 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1050 +#: ../../howto/clinic.rst:1052 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1053 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1055 +#: ../../howto/clinic.rst:1057 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1059 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1543,38 +1546,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1065 +#: ../../howto/clinic.rst:1067 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1069 +#: ../../howto/clinic.rst:1071 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1075 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1086 +#: ../../howto/clinic.rst:1088 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1090 +#: ../../howto/clinic.rst:1092 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1093 +#: ../../howto/clinic.rst:1095 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1582,168 +1585,168 @@ msgid "" "integer return converter, all integers are valid. How can Argument Clinic " "detect an error? Its solution: each return converter implicitly looks for a " "special value that indicates an error. If you return that value, and an " -"error has been set (``PyErr_Occurred()`` returns a true value), then the " +"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " "generated code will propagate the error. Otherwise it will encode the value " "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1102 +#: ../../howto/clinic.rst:1104 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1116 +#: ../../howto/clinic.rst:1118 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1119 +#: ../../howto/clinic.rst:1121 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1127 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1127 +#: ../../howto/clinic.rst:1129 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1133 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1135 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1135 +#: ../../howto/clinic.rst:1137 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1139 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1141 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1141 +#: ../../howto/clinic.rst:1143 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1144 +#: ../../howto/clinic.rst:1146 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1148 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1149 +#: ../../howto/clinic.rst:1151 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1159 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1161 +#: ../../howto/clinic.rst:1163 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1164 +#: ../../howto/clinic.rst:1166 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1169 +#: ../../howto/clinic.rst:1171 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1171 +#: ../../howto/clinic.rst:1173 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1175 +#: ../../howto/clinic.rst:1177 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1182 +#: ../../howto/clinic.rst:1184 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1186 +#: ../../howto/clinic.rst:1188 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1197 +#: ../../howto/clinic.rst:1199 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1199 +#: ../../howto/clinic.rst:1201 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " "the \"pointer to an instance\" you specified when you declared the type. " "However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own ``self`` parameter as the first parameter in a " -"block, and ensure that its converter is an instance of ``self_converter`` or " -"a subclass thereof." +"yourself. Just add your own *self* parameter as the first parameter in a " +"block, and ensure that its converter is an instance of :class:`!" +"self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1208 +#: ../../howto/clinic.rst:1210 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1211 +#: ../../howto/clinic.rst:1213 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " "use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the ``type`` parameter::" +"want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1227 +#: ../../howto/clinic.rst:1229 msgid "" "On the other hand, if you have a lot of functions that will use the same " -"type for ``self``, it's best to create your own converter, subclassing " -"``self_converter`` but overwriting the ``type`` member::" +"type for ``self``, it's best to create your own converter, subclassing :" +"class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1249 +#: ../../howto/clinic.rst:1251 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1253 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1753,65 +1756,66 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1257 +#: ../../howto/clinic.rst:1259 msgid "" -"Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " -"to the clinic input::" +"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " +"added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1269 +#: ../../howto/clinic.rst:1271 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1279 +#: ../../howto/clinic.rst:1281 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1285 +#: ../../howto/clinic.rst:1287 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " "The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the ``__text_signature__``." +"appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1290 +#: ../../howto/clinic.rst:1292 msgid "" -"The ``defining_class`` converter is not compatible with ``__init__`` and " -"``__new__`` methods, which cannot use the ``METH_METHOD`` convention." +"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " +"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " +"convention." msgstr "" -#: ../../howto/clinic.rst:1293 +#: ../../howto/clinic.rst:1296 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" "`PyType_GetModuleByDef` to look up the module and then :c:func:" "`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in ``Modules/_threadmodule.c``::" +"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1311 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1312 +#: ../../howto/clinic.rst:1315 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1314 +#: ../../howto/clinic.rst:1317 msgid "" "As we hinted at in the previous section... you can write your own " -"converters! A converter is simply a Python class that inherits from " -"``CConverter``. The main purpose of a custom converter is if you have a " +"converters! A converter is simply a Python class that inherits from :py:" +"class:`!CConverter`. The main purpose of a custom converter is if you have a " "parameter using the ``O&`` format unit—parsing this parameter means calling " "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1320 +#: ../../howto/clinic.rst:1323 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1820,59 +1824,47 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1326 +#: ../../howto/clinic.rst:1329 msgid "" -"You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " -"``converter_init()`` function. ``converter_init()`` always accepts a " -"``self`` parameter; after that, all additional parameters *must* be keyword-" -"only. Any arguments passed in to the converter in Argument Clinic will be " -"passed along to your ``converter_init()``." +"You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " +"write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " +"always accepts a *self* parameter; after that, all additional parameters " +"*must* be keyword-only. Any arguments passed in to the converter in " +"Argument Clinic will be passed along to your :py:meth:`!converter_init`." msgstr "" -#: ../../howto/clinic.rst:1333 +#: ../../howto/clinic.rst:1336 msgid "" -"There are some additional members of ``CConverter`` you may wish to specify " -"in your subclass. Here's the current list:" +"There are some additional members of :py:class:`!CConverter` you may wish to " +"specify in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1337 +#: ../../howto/clinic.rst:1345 msgid "" -"The C type to use for this variable. ``type`` should be a Python string " -"specifying the type, e.g. ``int``. If this is a pointer type, the type " +"The C type to use for this variable. :attr:`!type` should be a Python string " +"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1343 -msgid "``default``" -msgstr "``default``" - -#: ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:1352 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1348 -msgid "``py_default``" -msgstr "``py_default``" - -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1357 msgid "" -"``default`` as it should appear in Python code, as a string. Or ``None`` if " -"there is no default." +":attr:`!default` as it should appear in Python code, as a string. Or " +"``None`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1363 msgid "" -"``default`` as it should appear in C code, as a string. Or ``None`` if there " -"is no default." +":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " +"there is no default." msgstr "" -#: ../../howto/clinic.rst:1364 -msgid "``c_ignored_default``" -msgstr "``c_ignored_default``" - -#: ../../howto/clinic.rst:1356 +#: ../../howto/clinic.rst:1369 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1883,37 +1875,29 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1367 +#: ../../howto/clinic.rst:1381 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1372 -msgid "``impl_by_reference``" -msgstr "``impl_by_reference``" - -#: ../../howto/clinic.rst:1370 +#: ../../howto/clinic.rst:1385 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1378 -msgid "``parse_by_reference``" -msgstr "``parse_by_reference``" - -#: ../../howto/clinic.rst:1375 +#: ../../howto/clinic.rst:1391 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1380 +#: ../../howto/clinic.rst:1396 msgid "" -"Here's the simplest example of a custom converter, from ``Modules/zlibmodule." -"c``::" +"Here's the simplest example of a custom converter, from :source:`Modules/" +"zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1391 +#: ../../howto/clinic.rst:1407 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1922,86 +1906,88 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1413 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string ``CConverter``." +"in the CPython source tree; grep the C files for the string :py:class:`!" +"CConverter`." msgstr "" -#: ../../howto/clinic.rst:1404 +#: ../../howto/clinic.rst:1420 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1406 +#: ../../howto/clinic.rst:1422 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1410 +#: ../../howto/clinic.rst:1426 msgid "" -"Return converters must subclass ``CReturnConverter``. There are no examples " -"yet of custom return converters, because they are not widely used yet. If " -"you wish to write your own return converter, please read ``Tools/clinic/" -"clinic.py``, specifically the implementation of ``CReturnConverter`` and all " -"its subclasses." +"Return converters must subclass :py:class:`!CReturnConverter`. There are no " +"examples yet of custom return converters, because they are not widely used " +"yet. If you wish to write your own return converter, please read :source:" +"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" +"CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1419 +#: ../../howto/clinic.rst:1435 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1421 +#: ../../howto/clinic.rst:1437 msgid "" -"To convert a function using ``METH_O``, make sure the function's single " -"argument is using the ``object`` converter, and mark the arguments as " +"To convert a function using :c:macro:`METH_O`, make sure the function's " +"single argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1433 +#: ../../howto/clinic.rst:1449 msgid "" -"To convert a function using ``METH_NOARGS``, just don't specify any " +"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1436 +#: ../../howto/clinic.rst:1452 msgid "" -"You can still use a self converter, a return converter, and specify a " -"``type`` argument to the object converter for ``METH_O``." +"You can still use a self converter, a return converter, and specify a *type* " +"argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1441 +#: ../../howto/clinic.rst:1457 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1443 +#: ../../howto/clinic.rst:1459 msgid "" -"You can convert ``tp_new`` and ``tp_init`` functions. Just name them " -"``__new__`` or ``__init__`` as appropriate. Notes:" +"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" +"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " +"``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1446 +#: ../../howto/clinic.rst:1463 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1450 -msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." +#: ../../howto/clinic.rst:1467 +msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1452 +#: ../../howto/clinic.rst:1469 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1454 +#: ../../howto/clinic.rst:1471 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1456 +#: ../../howto/clinic.rst:1473 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -2010,11 +1996,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1464 +#: ../../howto/clinic.rst:1481 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1466 +#: ../../howto/clinic.rst:1483 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2023,7 +2009,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1472 +#: ../../howto/clinic.rst:1489 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2035,23 +2021,23 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1481 +#: ../../howto/clinic.rst:1498 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1525 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1484 +#: ../../howto/clinic.rst:1501 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " -"the ``#define`` for the ``PyMethodDef`` structure is a field, called " +"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " "``methoddef_define``. Clinic has seven different fields it can output per " "function definition:" msgstr "" -#: ../../howto/clinic.rst:1499 +#: ../../howto/clinic.rst:1516 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2064,112 +2050,112 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1542 +#: ../../howto/clinic.rst:1559 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1511 +#: ../../howto/clinic.rst:1528 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1516 ../../howto/clinic.rst:1591 -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1608 +#: ../../howto/clinic.rst:1686 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1515 +#: ../../howto/clinic.rst:1532 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1522 ../../howto/clinic.rst:1618 -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1539 ../../howto/clinic.rst:1635 +#: ../../howto/clinic.rst:1689 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1519 +#: ../../howto/clinic.rst:1536 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1604 -#: ../../howto/clinic.rst:1698 +#: ../../howto/clinic.rst:1550 ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1715 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1525 +#: ../../howto/clinic.rst:1542 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " "``basename`` and ``extension`` were assigned the output from ``os.path." "splitext()`` run on the current file. (Example: the ``file`` destination " -"for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" +"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1549 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1538 ../../howto/clinic.rst:1631 -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1555 ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1719 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1536 +#: ../../howto/clinic.rst:1553 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1542 ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1559 ../../howto/clinic.rst:1682 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1541 +#: ../../howto/clinic.rst:1558 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1544 +#: ../../howto/clinic.rst:1561 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1546 +#: ../../howto/clinic.rst:1563 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1552 +#: ../../howto/clinic.rst:1569 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1556 +#: ../../howto/clinic.rst:1573 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1580 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1567 +#: ../../howto/clinic.rst:1584 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1576 +#: ../../howto/clinic.rst:1593 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2178,25 +2164,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1600 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1587 +#: ../../howto/clinic.rst:1604 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1590 +#: ../../howto/clinic.rst:1607 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1594 +#: ../../howto/clinic.rst:1611 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2204,17 +2190,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1617 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1621 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1624 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2224,14 +2210,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1616 +#: ../../howto/clinic.rst:1633 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1638 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2240,18 +2226,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1645 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1642 +#: ../../howto/clinic.rst:1659 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1634 +#: ../../howto/clinic.rst:1651 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2261,137 +2247,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1658 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1661 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1650 +#: ../../howto/clinic.rst:1667 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1652 +#: ../../howto/clinic.rst:1669 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1671 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1677 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1679 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1682 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1668 +#: ../../howto/clinic.rst:1685 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1689 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1692 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1678 +#: ../../howto/clinic.rst:1695 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1697 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1683 +#: ../../howto/clinic.rst:1700 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1684 +#: ../../howto/clinic.rst:1701 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1685 +#: ../../howto/clinic.rst:1702 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1703 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1704 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1688 +#: ../../howto/clinic.rst:1705 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1707 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1707 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1694 +#: ../../howto/clinic.rst:1711 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1693 +#: ../../howto/clinic.rst:1710 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1696 +#: ../../howto/clinic.rst:1713 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1701 +#: ../../howto/clinic.rst:1718 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1721 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1727 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1714 +#: ../../howto/clinic.rst:1731 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1721 +#: ../../howto/clinic.rst:1738 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2399,35 +2385,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1725 +#: ../../howto/clinic.rst:1742 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1728 +#: ../../howto/clinic.rst:1745 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1728 +#: ../../howto/clinic.rst:1745 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1748 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1748 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1733 +#: ../../howto/clinic.rst:1750 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1757 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2436,36 +2422,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1747 +#: ../../howto/clinic.rst:1764 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1749 +#: ../../howto/clinic.rst:1766 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1760 +#: ../../howto/clinic.rst:1777 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1769 +#: ../../howto/clinic.rst:1786 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1783 +#: ../../howto/clinic.rst:1800 msgid "" -"Then, remove those three lines from the ``PyMethodDef`` structure, replacing " -"them with the macro Argument Clinic generated:" +"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " +"replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1790 +#: ../../howto/clinic.rst:1807 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2473,27 +2459,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1795 +#: ../../howto/clinic.rst:1812 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1798 +#: ../../howto/clinic.rst:1815 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1806 +#: ../../howto/clinic.rst:1823 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1810 +#: ../../howto/clinic.rst:1827 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2501,24 +2487,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1814 +#: ../../howto/clinic.rst:1831 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1822 +#: ../../howto/clinic.rst:1839 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " -"it above the ``PyMethodDef`` structure where that macro is used." +"it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1828 +#: ../../howto/clinic.rst:1845 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1847 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2526,11 +2512,29 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1835 +#: ../../howto/clinic.rst:1852 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" msgstr "" +#~ msgid "``type``" +#~ msgstr "``type``" + +#~ msgid "``default``" +#~ msgstr "``default``" + +#~ msgid "``py_default``" +#~ msgstr "``py_default``" + +#~ msgid "``c_ignored_default``" +#~ msgstr "``c_ignored_default``" + +#~ msgid "``impl_by_reference``" +#~ msgstr "``impl_by_reference``" + +#~ msgid "``parse_by_reference``" +#~ msgstr "``parse_by_reference``" + #~ msgid "Py_buffer" #~ msgstr "Py_buffer" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 2b3107a5b8..da0cb02aac 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+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-" @@ -212,22 +212,22 @@ msgstr "" msgid "" "Provides a mutable list-like object where all values stored within are " "stored in a shared memory block. This constrains storable values to only " -"the ``int``, ``float``, ``bool``, ``str`` (less than 10M bytes each), " -"``bytes`` (less than 10M bytes each), and ``None`` built-in data types. It " -"also notably differs from the built-in ``list`` type in that these lists can " -"not change their overall length (i.e. no append, insert, etc.) and do not " -"support the dynamic creation of new :class:`ShareableList` instances via " -"slicing." +"the ``int`` (signed 64-bit), ``float``, ``bool``, ``str`` (less than 10M " +"bytes each when encoded as utf-8), ``bytes`` (less than 10M bytes each), and " +"``None`` built-in data types. It also notably differs from the built-in " +"``list`` type in that these lists can not change their overall length (i.e. " +"no append, insert, etc.) and do not support the dynamic creation of new :" +"class:`ShareableList` instances via slicing." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:269 +#: ../../library/multiprocessing.shared_memory.rst:270 msgid "" "*sequence* is used in populating a new ``ShareableList`` full of values. Set " "to ``None`` to instead attach to an already existing ``ShareableList`` by " "its unique shared memory name." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:273 +#: ../../library/multiprocessing.shared_memory.rst:274 msgid "" "*name* is the unique name for the requested shared memory, as described in " "the definition for :class:`SharedMemory`. When attaching to an existing " @@ -235,40 +235,56 @@ msgid "" "leaving ``sequence`` set to ``None``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:280 +#: ../../library/multiprocessing.shared_memory.rst:281 +msgid "" +"A known issue exists for :class:`bytes` and :class:`str` values. If they end " +"with ``\\x00`` nul bytes or characters, those may be *silently stripped* " +"when fetching them by index from the :class:`ShareableList`. This ``." +"rstrip(b'\\x00')`` behavior is considered a bug and may go away in the " +"future. See :gh:`106939`." +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:287 +msgid "" +"For applications where rstripping of trailing nulls is a problem, work " +"around it by always unconditionally appending an extra non-0 byte to the end " +"of such values when storing and unconditionally removing it when fetching:" +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:310 msgid "Returns the number of occurrences of ``value``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:284 +#: ../../library/multiprocessing.shared_memory.rst:314 msgid "" "Returns first index position of ``value``. Raises :exc:`ValueError` if " "``value`` is not present." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:289 +#: ../../library/multiprocessing.shared_memory.rst:319 msgid "" "Read-only attribute containing the :mod:`struct` packing format used by all " "currently stored values." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:294 +#: ../../library/multiprocessing.shared_memory.rst:324 msgid "The :class:`SharedMemory` instance where the values are stored." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:297 +#: ../../library/multiprocessing.shared_memory.rst:327 msgid "" "The following example demonstrates basic use of a :class:`ShareableList` " "instance:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:330 +#: ../../library/multiprocessing.shared_memory.rst:360 msgid "" "The following example depicts how one, two, or many processes may access the " "same :class:`ShareableList` by supplying the name of the shared memory block " "behind it:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:345 +#: ../../library/multiprocessing.shared_memory.rst:375 msgid "" "The following examples demonstrates that ``ShareableList`` (and underlying " "``SharedMemory``) objects can be pickled and unpickled if needed. Note, that " diff --git a/library/statistics.po b/library/statistics.po index c305f55fe0..6f8f10c91f 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -920,9 +920,9 @@ msgid "" "equal values receive the same rank. The resulting coefficient measures the " "strength of a monotonic relationship." msgstr "" -"如果 *method* 為 \"ranked\",則計算兩輸入的 ``Spearman 等級相關係數 " +"如果 *method* 為 \"ranked\",則計算兩輸入的 `Spearman 等級相關係數 " "(Spearman’s rank correlation coefficient) ``。資料將被取代為等級。平手的情況" +"Spearman%27s_rank_correlation_coefficient>`_。資料將被取代為等級。平手的情況" "則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " "relationship) 的強度。" diff --git a/library/turtle.po b/library/turtle.po index 3b21472329..6d7d9d2c35 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,158 +68,283 @@ msgid "" "introducing more complex or external libraries into their work." msgstr "" -#: ../../library/turtle.rst:50 +#: ../../library/turtle.rst:52 msgid "Tutorial" msgstr "" -#: ../../library/turtle.rst:52 +#: ../../library/turtle.rst:54 msgid "" "New users should start here. In this tutorial we'll explore some of the " "basics of turtle drawing." msgstr "" -#: ../../library/turtle.rst:57 +#: ../../library/turtle.rst:59 msgid "Starting a turtle environment" msgstr "" -#: ../../library/turtle.rst:59 +#: ../../library/turtle.rst:61 msgid "In a Python shell, import all the objects of the ``turtle`` module::" msgstr "" -#: ../../library/turtle.rst:63 +#: ../../library/turtle.rst:65 msgid "" "If you run into a ``No module named '_tkinter'`` error, you'll have to " "install the :mod:`Tk interface package ` on your system." msgstr "" -#: ../../library/turtle.rst:68 +#: ../../library/turtle.rst:70 msgid "Basic drawing" msgstr "" -#: ../../library/turtle.rst:70 +#: ../../library/turtle.rst:72 msgid "Send the turtle forward 100 steps::" msgstr "" -#: ../../library/turtle.rst:74 +#: ../../library/turtle.rst:76 msgid "" "You should see (most likely, in a new window on your display) a line drawn " "by the turtle, heading East. Change the direction of the turtle, so that it " "turns 120 degrees left (anti-clockwise)::" msgstr "" -#: ../../library/turtle.rst:80 +#: ../../library/turtle.rst:82 msgid "Let's continue by drawing a triangle::" msgstr "" -#: ../../library/turtle.rst:86 +#: ../../library/turtle.rst:88 msgid "" "Notice how the turtle, represented by an arrow, points in different " "directions as you steer it." msgstr "" -#: ../../library/turtle.rst:89 +#: ../../library/turtle.rst:91 msgid "" "Experiment with those commands, and also with ``backward()`` and ``right()``." msgstr "" -#: ../../library/turtle.rst:94 ../../library/turtle.rst:283 -#: ../../library/turtle.rst:953 +#: ../../library/turtle.rst:96 ../../library/turtle.rst:397 +#: ../../library/turtle.rst:1067 msgid "Pen control" msgstr "" -#: ../../library/turtle.rst:96 +#: ../../library/turtle.rst:98 msgid "" "Try changing the color - for example, ``color('blue')`` - and width of the " "line - for example, ``width(3)`` - and then drawing again." msgstr "" -#: ../../library/turtle.rst:99 +#: ../../library/turtle.rst:101 msgid "" "You can also move the turtle around without drawing, by lifting up the pen: " "``up()`` before moving. To start drawing again, use ``down()``." msgstr "" -#: ../../library/turtle.rst:104 +#: ../../library/turtle.rst:106 msgid "The turtle's position" msgstr "" -#: ../../library/turtle.rst:106 +#: ../../library/turtle.rst:108 msgid "" "Send your turtle back to its starting-point (useful if it has disappeared " "off-screen)::" msgstr "" -#: ../../library/turtle.rst:111 +#: ../../library/turtle.rst:113 msgid "" "The home position is at the center of the turtle's screen. If you ever need " "to know them, get the turtle's x-y co-ordinates with::" msgstr "" -#: ../../library/turtle.rst:116 +#: ../../library/turtle.rst:118 msgid "Home is at ``(0, 0)``." msgstr "" -#: ../../library/turtle.rst:118 +#: ../../library/turtle.rst:120 msgid "" "And after a while, it will probably help to clear the window so we can start " "anew::" msgstr "" -#: ../../library/turtle.rst:125 +#: ../../library/turtle.rst:127 msgid "Making algorithmic patterns" msgstr "" -#: ../../library/turtle.rst:127 +#: ../../library/turtle.rst:129 msgid "Using loops, it's possible to build up geometric patterns::" msgstr "" -#: ../../library/turtle.rst:136 +#: ../../library/turtle.rst:138 msgid "\\ - which of course, are limited only by the imagination!" msgstr "" -#: ../../library/turtle.rst:138 +#: ../../library/turtle.rst:140 msgid "" "Let's draw the star shape at the top of this page. We want red lines, filled " "in with yellow::" msgstr "" -#: ../../library/turtle.rst:144 +#: ../../library/turtle.rst:146 msgid "" "Just as ``up()`` and ``down()`` determine whether lines will be drawn, " "filling can be turned on and off::" msgstr "" -#: ../../library/turtle.rst:149 +#: ../../library/turtle.rst:151 msgid "Next we'll create a loop::" msgstr "" -#: ../../library/turtle.rst:157 +#: ../../library/turtle.rst:159 msgid "" "``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " "position." msgstr "" -#: ../../library/turtle.rst:160 +#: ../../library/turtle.rst:162 msgid "Finally, complete the filling::" msgstr "" -#: ../../library/turtle.rst:164 +#: ../../library/turtle.rst:166 msgid "" "(Note that filling only actually takes place when you give the " "``end_fill()`` command.)" msgstr "" -#: ../../library/turtle.rst:169 +#: ../../library/turtle.rst:173 +msgid "How to..." +msgstr "" + +#: ../../library/turtle.rst:175 +msgid "This section covers some typical turtle use-cases and approaches." +msgstr "" + +#: ../../library/turtle.rst:179 +msgid "Get started as quickly as possible" +msgstr "" + +#: ../../library/turtle.rst:181 +msgid "" +"One of the joys of turtle graphics is the immediate, visual feedback that's " +"available from simple commands - it's an excellent way to introduce children " +"to programming ideas, with a minimum of overhead (not just children, of " +"course)." +msgstr "" + +#: ../../library/turtle.rst:186 +msgid "" +"The turtle module makes this possible by exposing all its basic " +"functionality as functions, available with ``from turtle import *``. The :" +"ref:`turtle graphics tutorial ` covers this approach." +msgstr "" + +#: ../../library/turtle.rst:190 +msgid "" +"It's worth noting that many of the turtle commands also have even more terse " +"equivalents, such as ``fd()`` for :func:`forward`. These are especially " +"useful when working with learners for whom typing is not a skill." +msgstr "" + +#: ../../library/turtle.rst:196 +msgid "" +"You'll need to have the :mod:`Tk interface package ` installed on " +"your system for turtle graphics to work. Be warned that this is not always " +"straightforward, so check this in advance if you're planning to use turtle " +"graphics with a learner." +msgstr "" + +#: ../../library/turtle.rst:203 +msgid "Use the ``turtle`` module namespace" +msgstr "" + +#: ../../library/turtle.rst:205 +msgid "" +"Using ``from turtle import *`` is convenient - but be warned that it imports " +"a rather large collection of objects, and if you're doing anything but " +"turtle graphics you run the risk of a name conflict (this becomes even more " +"an issue if you're using turtle graphics in a script where other modules " +"might be imported)." +msgstr "" + +#: ../../library/turtle.rst:211 +msgid "" +"The solution is to use ``import turtle`` - ``fd()`` becomes ``turtle.fd()``, " +"``width()`` becomes ``turtle.width()`` and so on. (If typing \"turtle\" over " +"and over again becomes tedious, use for example ``import turtle as t`` " +"instead.)" +msgstr "" + +#: ../../library/turtle.rst:218 +msgid "Use turtle graphics in a script" +msgstr "" + +#: ../../library/turtle.rst:220 +msgid "" +"It's recommended to use the ``turtle`` module namespace as described " +"immediately above, for example::" +msgstr "" + +#: ../../library/turtle.rst:232 +msgid "" +"Another step is also required though - as soon as the script ends, Python " +"will also close the turtle's window. Add::" +msgstr "" + +#: ../../library/turtle.rst:237 +msgid "" +"to the end of the script. The script will now wait to be dismissed and will " +"not exit until it is terminated, for example by closing the turtle graphics " +"window." +msgstr "" + +#: ../../library/turtle.rst:243 +msgid "Use object-oriented turtle graphics" +msgstr "" + +#: ../../library/turtle.rst:245 +msgid "" +":ref:`Explanation of the object-oriented interface `" +msgstr "" + +#: ../../library/turtle.rst:247 +msgid "" +"Other than for very basic introductory purposes, or for trying things out as " +"quickly as possible, it's more usual and much more powerful to use the " +"object-oriented approach to turtle graphics. For example, this allows " +"multiple turtles on screen at once." +msgstr "" + +#: ../../library/turtle.rst:252 +msgid "" +"In this approach, the various turtle commands are methods of objects (mostly " +"of ``Turtle`` objects). You *can* use the object-oriented approach in the " +"shell, but it would be more typical in a Python script." +msgstr "" + +#: ../../library/turtle.rst:256 +msgid "The example above then becomes::" +msgstr "" + +#: ../../library/turtle.rst:270 +msgid "" +"Note the last line. ``t.screen`` is an instance of the :class:`Screen` that " +"a Turtle instance exists on; it's created automatically along with the " +"turtle." +msgstr "" + +#: ../../library/turtle.rst:274 +msgid "The turtle's screen can be customised, for example::" +msgstr "" + +#: ../../library/turtle.rst:283 msgid "Explanation" msgstr "" -#: ../../library/turtle.rst:171 +#: ../../library/turtle.rst:285 msgid "" "The :mod:`turtle` module is an extended reimplementation of the same-named " "module from the Python standard distribution up to version Python 2.5." msgstr "" -#: ../../library/turtle.rst:174 +#: ../../library/turtle.rst:288 msgid "" "It tries to keep the merits of the old turtle module and to be (nearly) 100% " "compatible with it. This means in the first place to enable the learning " @@ -227,7 +352,7 @@ msgid "" "using the module from within IDLE run with the ``-n`` switch." msgstr "" -#: ../../library/turtle.rst:179 +#: ../../library/turtle.rst:293 msgid "" "The turtle module provides turtle graphics primitives, in both object-" "oriented and procedure-oriented ways. Because it uses :mod:`tkinter` for " @@ -235,11 +360,11 @@ msgid "" "support." msgstr "" -#: ../../library/turtle.rst:183 +#: ../../library/turtle.rst:297 msgid "The object-oriented interface uses essentially two+two classes:" msgstr "" -#: ../../library/turtle.rst:185 +#: ../../library/turtle.rst:299 msgid "" "The :class:`TurtleScreen` class defines graphics windows as a playground for " "the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a :" @@ -247,7 +372,7 @@ msgid "" "used as part of some application." msgstr "" -#: ../../library/turtle.rst:190 +#: ../../library/turtle.rst:304 msgid "" "The function :func:`Screen` returns a singleton object of a :class:" "`TurtleScreen` subclass. This function should be used when :mod:`turtle` is " @@ -255,13 +380,13 @@ msgid "" "inheriting from its class is not possible." msgstr "" -#: ../../library/turtle.rst:195 +#: ../../library/turtle.rst:309 msgid "" "All methods of TurtleScreen/Screen also exist as functions, i.e. as part of " "the procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:198 +#: ../../library/turtle.rst:312 msgid "" ":class:`RawTurtle` (alias: :class:`RawPen`) defines Turtle objects which " "draw on a :class:`TurtleScreen`. Its constructor needs a Canvas, " @@ -269,20 +394,20 @@ msgid "" "where to draw." msgstr "" -#: ../../library/turtle.rst:202 +#: ../../library/turtle.rst:316 msgid "" "Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:" "`Pen`), which draws on \"the\" :class:`Screen` instance which is " "automatically created, if not already present." msgstr "" -#: ../../library/turtle.rst:206 +#: ../../library/turtle.rst:320 msgid "" "All methods of RawTurtle/Turtle also exist as functions, i.e. part of the " "procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:209 +#: ../../library/turtle.rst:323 msgid "" "The procedural interface provides functions which are derived from the " "methods of the classes :class:`Screen` and :class:`Turtle`. They have the " @@ -292,32 +417,32 @@ msgid "" "functions derived from a Turtle method is called." msgstr "" -#: ../../library/turtle.rst:216 +#: ../../library/turtle.rst:330 msgid "" "To use multiple turtles on a screen one has to use the object-oriented " "interface." msgstr "" -#: ../../library/turtle.rst:219 +#: ../../library/turtle.rst:333 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:225 +#: ../../library/turtle.rst:339 msgid "Turtle graphics reference" msgstr "" -#: ../../library/turtle.rst:228 +#: ../../library/turtle.rst:342 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:260 ../../library/turtle.rst:370 +#: ../../library/turtle.rst:374 ../../library/turtle.rst:484 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:248 +#: ../../library/turtle.rst:362 msgid "Move and draw" msgstr "" @@ -361,7 +486,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2739 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -369,7 +494,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2717 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -389,7 +514,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:256 ../../library/turtle.rst:802 +#: ../../library/turtle.rst:370 ../../library/turtle.rst:916 msgid "Tell Turtle's state" msgstr "" @@ -417,7 +542,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:260 +#: ../../library/turtle.rst:374 msgid "Setting and measurement" msgstr "" @@ -429,7 +554,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:268 ../../library/turtle.rst:956 +#: ../../library/turtle.rst:382 ../../library/turtle.rst:1070 msgid "Drawing state" msgstr "" @@ -453,7 +578,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:273 ../../library/turtle.rst:1048 +#: ../../library/turtle.rst:387 ../../library/turtle.rst:1162 msgid "Color control" msgstr "" @@ -469,7 +594,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:278 ../../library/turtle.rst:1180 +#: ../../library/turtle.rst:392 ../../library/turtle.rst:1294 msgid "Filling" msgstr "" @@ -485,7 +610,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:283 ../../library/turtle.rst:1227 +#: ../../library/turtle.rst:397 ../../library/turtle.rst:1341 msgid "More drawing control" msgstr "" @@ -501,11 +626,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:300 ../../library/turtle.rst:1273 +#: ../../library/turtle.rst:414 ../../library/turtle.rst:1387 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:289 ../../library/turtle.rst:1276 +#: ../../library/turtle.rst:403 ../../library/turtle.rst:1390 msgid "Visibility" msgstr "" @@ -521,7 +646,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:300 ../../library/turtle.rst:1315 +#: ../../library/turtle.rst:414 ../../library/turtle.rst:1429 msgid "Appearance" msgstr "" @@ -561,11 +686,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:305 ../../library/turtle.rst:1520 +#: ../../library/turtle.rst:419 ../../library/turtle.rst:1634 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2711 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -573,11 +698,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2694 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:316 ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:430 ../../library/turtle.rst:1708 msgid "Special Turtle methods" msgstr "" @@ -593,7 +718,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2733 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -613,11 +738,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:319 +#: ../../library/turtle.rst:433 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:327 ../../library/turtle.rst:1748 +#: ../../library/turtle.rst:441 ../../library/turtle.rst:1862 msgid "Window control" msgstr "" @@ -645,7 +770,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:332 ../../library/turtle.rst:1871 +#: ../../library/turtle.rst:446 ../../library/turtle.rst:1985 msgid "Animation control" msgstr "" @@ -661,7 +786,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:340 ../../library/turtle.rst:1924 +#: ../../library/turtle.rst:454 ../../library/turtle.rst:2038 msgid "Using screen events" msgstr "" @@ -689,7 +814,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:350 ../../library/turtle.rst:2069 +#: ../../library/turtle.rst:464 ../../library/turtle.rst:2183 msgid "Settings and special methods" msgstr "" @@ -725,7 +850,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:354 ../../library/turtle.rst:2033 +#: ../../library/turtle.rst:468 ../../library/turtle.rst:2147 msgid "Input methods" msgstr "" @@ -737,7 +862,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:361 +#: ../../library/turtle.rst:475 msgid "Methods specific to Screen" msgstr "" @@ -757,11 +882,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:364 +#: ../../library/turtle.rst:478 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:366 +#: ../../library/turtle.rst:480 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -771,70 +896,70 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:375 ../../library/turtle.rst:420 -#: ../../library/turtle.rst:445 ../../library/turtle.rst:543 -#: ../../library/turtle.rst:566 ../../library/turtle.rst:589 +#: ../../library/turtle.rst:489 ../../library/turtle.rst:534 +#: ../../library/turtle.rst:559 ../../library/turtle.rst:657 +#: ../../library/turtle.rst:680 ../../library/turtle.rst:703 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:377 +#: ../../library/turtle.rst:491 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:397 ../../library/turtle.rst:639 -#: ../../library/turtle.rst:906 ../../library/turtle.rst:1414 -#: ../../library/turtle.rst:1433 +#: ../../library/turtle.rst:511 ../../library/turtle.rst:753 +#: ../../library/turtle.rst:1020 ../../library/turtle.rst:1528 +#: ../../library/turtle.rst:1547 msgid "a number" msgstr "" -#: ../../library/turtle.rst:399 +#: ../../library/turtle.rst:513 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:422 +#: ../../library/turtle.rst:536 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:447 +#: ../../library/turtle.rst:561 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:471 +#: ../../library/turtle.rst:585 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:472 ../../library/turtle.rst:505 -#: ../../library/turtle.rst:506 +#: ../../library/turtle.rst:586 ../../library/turtle.rst:619 +#: ../../library/turtle.rst:620 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:474 +#: ../../library/turtle.rst:588 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:477 +#: ../../library/turtle.rst:591 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:507 +#: ../../library/turtle.rst:621 msgid "a boolean" msgstr "" -#: ../../library/turtle.rst:509 +#: ../../library/turtle.rst:623 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -844,77 +969,77 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: ../../library/turtle.rst:545 +#: ../../library/turtle.rst:659 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:568 +#: ../../library/turtle.rst:682 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:591 +#: ../../library/turtle.rst:705 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:595 +#: ../../library/turtle.rst:709 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:595 +#: ../../library/turtle.rst:709 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:597 +#: ../../library/turtle.rst:711 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:597 +#: ../../library/turtle.rst:711 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:598 +#: ../../library/turtle.rst:712 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:598 +#: ../../library/turtle.rst:712 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:599 +#: ../../library/turtle.rst:713 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:599 +#: ../../library/turtle.rst:713 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:600 +#: ../../library/turtle.rst:714 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:600 +#: ../../library/turtle.rst:714 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:613 +#: ../../library/turtle.rst:727 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:640 +#: ../../library/turtle.rst:754 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:641 ../../library/turtle.rst:734 +#: ../../library/turtle.rst:755 ../../library/turtle.rst:848 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:643 +#: ../../library/turtle.rst:757 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -925,117 +1050,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:651 +#: ../../library/turtle.rst:765 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:677 +#: ../../library/turtle.rst:791 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:678 +#: ../../library/turtle.rst:792 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:680 +#: ../../library/turtle.rst:794 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:698 +#: ../../library/turtle.rst:812 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:712 +#: ../../library/turtle.rst:826 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:715 +#: ../../library/turtle.rst:829 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:736 +#: ../../library/turtle.rst:850 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:752 +#: ../../library/turtle.rst:866 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:767 +#: ../../library/turtle.rst:881 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:769 +#: ../../library/turtle.rst:883 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:772 +#: ../../library/turtle.rst:886 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:775 +#: ../../library/turtle.rst:889 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:776 +#: ../../library/turtle.rst:890 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:777 +#: ../../library/turtle.rst:891 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:778 +#: ../../library/turtle.rst:892 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:779 +#: ../../library/turtle.rst:893 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:781 +#: ../../library/turtle.rst:895 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:784 +#: ../../library/turtle.rst:898 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:807 +#: ../../library/turtle.rst:921 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:818 ../../library/turtle.rst:881 +#: ../../library/turtle.rst:932 ../../library/turtle.rst:995 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:819 ../../library/turtle.rst:882 +#: ../../library/turtle.rst:933 ../../library/turtle.rst:996 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:821 +#: ../../library/turtle.rst:935 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -1043,116 +1168,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:835 +#: ../../library/turtle.rst:949 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:851 +#: ../../library/turtle.rst:965 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:867 +#: ../../library/turtle.rst:981 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:884 +#: ../../library/turtle.rst:998 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:902 +#: ../../library/turtle.rst:1016 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:908 +#: ../../library/turtle.rst:1022 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:931 +#: ../../library/turtle.rst:1045 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:962 +#: ../../library/turtle.rst:1076 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:969 +#: ../../library/turtle.rst:1083 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:975 +#: ../../library/turtle.rst:1089 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:977 +#: ../../library/turtle.rst:1091 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:991 +#: ../../library/turtle.rst:1105 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:992 +#: ../../library/turtle.rst:1106 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:994 +#: ../../library/turtle.rst:1108 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:997 +#: ../../library/turtle.rst:1111 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:998 +#: ../../library/turtle.rst:1112 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:999 +#: ../../library/turtle.rst:1113 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1000 +#: ../../library/turtle.rst:1114 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1001 +#: ../../library/turtle.rst:1115 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:1002 +#: ../../library/turtle.rst:1116 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:1003 +#: ../../library/turtle.rst:1117 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1004 +#: ../../library/turtle.rst:1118 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:1005 +#: ../../library/turtle.rst:1119 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:1006 +#: ../../library/turtle.rst:1120 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:1008 +#: ../../library/turtle.rst:1122 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1160,182 +1285,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:1034 +#: ../../library/turtle.rst:1148 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:1052 +#: ../../library/turtle.rst:1166 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:1054 ../../library/turtle.rst:1103 +#: ../../library/turtle.rst:1168 ../../library/turtle.rst:1217 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:1059 +#: ../../library/turtle.rst:1173 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:1057 +#: ../../library/turtle.rst:1171 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:1063 +#: ../../library/turtle.rst:1177 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:1062 +#: ../../library/turtle.rst:1176 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1068 +#: ../../library/turtle.rst:1182 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:1066 +#: ../../library/turtle.rst:1180 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1072 +#: ../../library/turtle.rst:1186 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:1071 +#: ../../library/turtle.rst:1185 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1074 +#: ../../library/turtle.rst:1188 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:1101 +#: ../../library/turtle.rst:1215 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:1108 +#: ../../library/turtle.rst:1222 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:1106 +#: ../../library/turtle.rst:1220 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:1112 +#: ../../library/turtle.rst:1226 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:1111 +#: ../../library/turtle.rst:1225 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1117 +#: ../../library/turtle.rst:1231 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:1229 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1121 +#: ../../library/turtle.rst:1235 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:1120 +#: ../../library/turtle.rst:1234 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1123 +#: ../../library/turtle.rst:1237 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:1144 +#: ../../library/turtle.rst:1258 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:1146 +#: ../../library/turtle.rst:1260 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:1152 +#: ../../library/turtle.rst:1266 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:1150 +#: ../../library/turtle.rst:1264 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:1156 +#: ../../library/turtle.rst:1270 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:1155 +#: ../../library/turtle.rst:1269 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1160 +#: ../../library/turtle.rst:1274 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1159 +#: ../../library/turtle.rst:1273 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1162 +#: ../../library/turtle.rst:1276 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1176 +#: ../../library/turtle.rst:1290 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1190 +#: ../../library/turtle.rst:1304 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1205 +#: ../../library/turtle.rst:1319 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1210 +#: ../../library/turtle.rst:1324 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1212 +#: ../../library/turtle.rst:1326 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1343,36 +1468,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1231 +#: ../../library/turtle.rst:1345 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1252 +#: ../../library/turtle.rst:1366 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1258 +#: ../../library/turtle.rst:1372 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1259 +#: ../../library/turtle.rst:1373 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1260 +#: ../../library/turtle.rst:1374 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1261 +#: ../../library/turtle.rst:1375 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1263 +#: ../../library/turtle.rst:1377 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1380,26 +1505,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1281 +#: ../../library/turtle.rst:1395 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1294 +#: ../../library/turtle.rst:1408 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1304 +#: ../../library/turtle.rst:1418 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1319 +#: ../../library/turtle.rst:1433 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1321 +#: ../../library/turtle.rst:1435 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1409,45 +1534,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1339 +#: ../../library/turtle.rst:1453 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1341 +#: ../../library/turtle.rst:1455 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1345 +#: ../../library/turtle.rst:1459 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1346 +#: ../../library/turtle.rst:1460 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1349 +#: ../../library/turtle.rst:1463 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1351 +#: ../../library/turtle.rst:1465 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1366 ../../library/turtle.rst:1367 -#: ../../library/turtle.rst:1368 +#: ../../library/turtle.rst:1480 ../../library/turtle.rst:1481 +#: ../../library/turtle.rst:1482 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1370 +#: ../../library/turtle.rst:1484 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1457,12 +1582,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1393 ../../library/turtle.rst:2052 -#: ../../library/turtle.rst:2053 ../../library/turtle.rst:2054 +#: ../../library/turtle.rst:1507 ../../library/turtle.rst:2166 +#: ../../library/turtle.rst:2167 ../../library/turtle.rst:2168 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1509 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1471,26 +1596,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1416 +#: ../../library/turtle.rst:1530 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1435 +#: ../../library/turtle.rst:1549 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1455 ../../library/turtle.rst:1478 -#: ../../library/turtle.rst:1479 ../../library/turtle.rst:1480 -#: ../../library/turtle.rst:1481 +#: ../../library/turtle.rst:1569 ../../library/turtle.rst:1592 +#: ../../library/turtle.rst:1593 ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:1595 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1457 +#: ../../library/turtle.rst:1571 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1500,11 +1625,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1483 +#: ../../library/turtle.rst:1597 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1485 +#: ../../library/turtle.rst:1599 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1514,101 +1639,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1507 +#: ../../library/turtle.rst:1621 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1525 ../../library/turtle.rst:1547 -#: ../../library/turtle.rst:1572 ../../library/turtle.rst:1976 +#: ../../library/turtle.rst:1639 ../../library/turtle.rst:1661 +#: ../../library/turtle.rst:1686 ../../library/turtle.rst:2090 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1527 ../../library/turtle.rst:1549 -#: ../../library/turtle.rst:1574 ../../library/turtle.rst:1978 +#: ../../library/turtle.rst:1641 ../../library/turtle.rst:1663 +#: ../../library/turtle.rst:1688 ../../library/turtle.rst:2092 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1528 ../../library/turtle.rst:1550 -#: ../../library/turtle.rst:1575 ../../library/turtle.rst:1979 +#: ../../library/turtle.rst:1642 ../../library/turtle.rst:1664 +#: ../../library/turtle.rst:1689 ../../library/turtle.rst:2093 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1531 +#: ../../library/turtle.rst:1645 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1553 +#: ../../library/turtle.rst:1667 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1692 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1581 +#: ../../library/turtle.rst:1695 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1589 +#: ../../library/turtle.rst:1703 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1712 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1604 +#: ../../library/turtle.rst:1718 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1610 +#: ../../library/turtle.rst:1724 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1629 +#: ../../library/turtle.rst:1743 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1642 +#: ../../library/turtle.rst:1756 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1656 +#: ../../library/turtle.rst:1770 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1670 +#: ../../library/turtle.rst:1784 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1672 +#: ../../library/turtle.rst:1786 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1616,71 +1741,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1799 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1698 +#: ../../library/turtle.rst:1812 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1700 +#: ../../library/turtle.rst:1814 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1704 +#: ../../library/turtle.rst:1818 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1705 +#: ../../library/turtle.rst:1819 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1708 +#: ../../library/turtle.rst:1822 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1833 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1730 +#: ../../library/turtle.rst:1844 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1736 +#: ../../library/turtle.rst:1850 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1852 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1752 +#: ../../library/turtle.rst:1866 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1756 +#: ../../library/turtle.rst:1870 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1771 +#: ../../library/turtle.rst:1885 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1773 +#: ../../library/turtle.rst:1887 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1688,44 +1813,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1789 +#: ../../library/turtle.rst:1903 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1796 +#: ../../library/turtle.rst:1910 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1805 +#: ../../library/turtle.rst:1919 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1812 +#: ../../library/turtle.rst:1926 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1817 +#: ../../library/turtle.rst:1931 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1932 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1819 +#: ../../library/turtle.rst:1933 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1935 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1734,59 +1859,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1833 +#: ../../library/turtle.rst:1947 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:1952 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1839 +#: ../../library/turtle.rst:1953 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1840 +#: ../../library/turtle.rst:1954 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1841 +#: ../../library/turtle.rst:1955 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1843 +#: ../../library/turtle.rst:1957 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1847 +#: ../../library/turtle.rst:1961 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1875 +#: ../../library/turtle.rst:1989 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1877 +#: ../../library/turtle.rst:1991 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1881 +#: ../../library/turtle.rst:1995 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 +#: ../../library/turtle.rst:2009 ../../library/turtle.rst:2010 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:2012 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1795,75 +1920,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1918 +#: ../../library/turtle.rst:2032 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1920 +#: ../../library/turtle.rst:2034 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:2042 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1935 ../../library/turtle.rst:1955 +#: ../../library/turtle.rst:2049 ../../library/turtle.rst:2069 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1936 ../../library/turtle.rst:1956 +#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2070 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1938 +#: ../../library/turtle.rst:2052 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1958 +#: ../../library/turtle.rst:2072 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1982 +#: ../../library/turtle.rst:2096 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1985 +#: ../../library/turtle.rst:2099 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:1996 +#: ../../library/turtle.rst:2110 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:2003 +#: ../../library/turtle.rst:2117 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:2004 +#: ../../library/turtle.rst:2118 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:2006 +#: ../../library/turtle.rst:2120 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:2024 +#: ../../library/turtle.rst:2138 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1871,12 +1996,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:2037 ../../library/turtle.rst:2038 -#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2051 +#: ../../library/turtle.rst:2151 ../../library/turtle.rst:2152 +#: ../../library/turtle.rst:2164 ../../library/turtle.rst:2165 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:2040 +#: ../../library/turtle.rst:2154 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1884,7 +2009,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:2056 +#: ../../library/turtle.rst:2170 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1895,17 +2020,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:2073 +#: ../../library/turtle.rst:2187 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:2075 +#: ../../library/turtle.rst:2189 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:2078 +#: ../../library/turtle.rst:2192 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1913,121 +2038,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:2100 +#: ../../library/turtle.rst:2214 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:2102 +#: ../../library/turtle.rst:2216 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:2123 +#: ../../library/turtle.rst:2237 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:2136 +#: ../../library/turtle.rst:2250 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:2148 +#: ../../library/turtle.rst:2262 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:2150 +#: ../../library/turtle.rst:2264 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2270 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2159 +#: ../../library/turtle.rst:2273 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2281 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2170 +#: ../../library/turtle.rst:2284 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2176 +#: ../../library/turtle.rst:2290 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2187 +#: ../../library/turtle.rst:2301 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2195 +#: ../../library/turtle.rst:2309 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2204 +#: ../../library/turtle.rst:2318 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2208 +#: ../../library/turtle.rst:2322 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2213 +#: ../../library/turtle.rst:2327 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2216 +#: ../../library/turtle.rst:2330 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -2036,246 +2161,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2225 +#: ../../library/turtle.rst:2339 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2229 +#: ../../library/turtle.rst:2343 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2231 +#: ../../library/turtle.rst:2345 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2233 +#: ../../library/turtle.rst:2347 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2236 +#: ../../library/turtle.rst:2350 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2251 +#: ../../library/turtle.rst:2365 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2254 +#: ../../library/turtle.rst:2368 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2263 +#: ../../library/turtle.rst:2377 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2269 +#: ../../library/turtle.rst:2383 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2272 +#: ../../library/turtle.rst:2386 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2278 +#: ../../library/turtle.rst:2392 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2284 +#: ../../library/turtle.rst:2398 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2286 +#: ../../library/turtle.rst:2400 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2291 +#: ../../library/turtle.rst:2405 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2296 +#: ../../library/turtle.rst:2410 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2299 +#: ../../library/turtle.rst:2413 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2304 +#: ../../library/turtle.rst:2418 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2306 +#: ../../library/turtle.rst:2420 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2311 +#: ../../library/turtle.rst:2425 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2311 +#: ../../library/turtle.rst:2425 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2427 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2427 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2314 +#: ../../library/turtle.rst:2428 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2314 +#: ../../library/turtle.rst:2428 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2315 +#: ../../library/turtle.rst:2429 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2315 +#: ../../library/turtle.rst:2429 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2321 +#: ../../library/turtle.rst:2435 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2322 +#: ../../library/turtle.rst:2436 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2323 +#: ../../library/turtle.rst:2437 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2325 +#: ../../library/turtle.rst:2439 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2335 +#: ../../library/turtle.rst:2449 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2340 +#: ../../library/turtle.rst:2454 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2344 +#: ../../library/turtle.rst:2458 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2346 +#: ../../library/turtle.rst:2460 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2461 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2348 +#: ../../library/turtle.rst:2462 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2463 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2350 +#: ../../library/turtle.rst:2464 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2351 +#: ../../library/turtle.rst:2465 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2355 +#: ../../library/turtle.rst:2469 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2358 +#: ../../library/turtle.rst:2472 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2360 +#: ../../library/turtle.rst:2474 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2364 +#: ../../library/turtle.rst:2478 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2367 +#: ../../library/turtle.rst:2481 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2512 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2432 +#: ../../library/turtle.rst:2546 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2437 +#: ../../library/turtle.rst:2551 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2553 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2559 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2561 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2284,37 +2409,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:2567 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2571 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2574 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2580 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2468 +#: ../../library/turtle.rst:2582 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2471 +#: ../../library/turtle.rst:2585 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2323,54 +2448,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2590 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2501 +#: ../../library/turtle.rst:2615 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2503 +#: ../../library/turtle.rst:2617 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2505 +#: ../../library/turtle.rst:2619 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2507 +#: ../../library/turtle.rst:2621 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2509 +#: ../../library/turtle.rst:2623 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2626 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2514 +#: ../../library/turtle.rst:2628 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2517 +#: ../../library/turtle.rst:2631 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2378,301 +2503,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2521 +#: ../../library/turtle.rst:2635 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2525 +#: ../../library/turtle.rst:2639 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2529 +#: ../../library/turtle.rst:2643 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2535 +#: ../../library/turtle.rst:2649 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2540 +#: ../../library/turtle.rst:2654 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2545 +#: ../../library/turtle.rst:2659 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2549 +#: ../../library/turtle.rst:2663 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2551 +#: ../../library/turtle.rst:2665 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2553 +#: ../../library/turtle.rst:2667 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2556 +#: ../../library/turtle.rst:2670 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2559 +#: ../../library/turtle.rst:2673 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:2694 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:2694 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:2711 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:2711 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:2717 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:2717 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:2733 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:2733 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:2739 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:2739 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2628 +#: ../../library/turtle.rst:2742 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2632 +#: ../../library/turtle.rst:2746 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2634 +#: ../../library/turtle.rst:2748 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2683,14 +2808,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2642 +#: ../../library/turtle.rst:2756 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2647 +#: ../../library/turtle.rst:2761 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2698,11 +2823,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2653 +#: ../../library/turtle.rst:2767 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2655 +#: ../../library/turtle.rst:2769 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2711,28 +2836,28 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2662 +#: ../../library/turtle.rst:2776 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2666 +#: ../../library/turtle.rst:2780 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2670 +#: ../../library/turtle.rst:2784 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2674 +#: ../../library/turtle.rst:2788 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/sphinx.po b/sphinx.po index 38d024e3ee..443deb3bf7 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -295,23 +295,23 @@ msgstr "Python 開發者指南" #: ../../tools/templates/layout.html:6 msgid "" "This document is for an old version of Python that is no longer supported.\n" -" You should upgrade, and read the " -msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你應該升級,並閱讀 " +" You should upgrade, and read the" +msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你應該升級,並閱讀" #: ../../tools/templates/layout.html:8 -msgid " Python documentation for the current stable release" -msgstr " 當前穩定發行的 Python 版本說明文件" +msgid "Python documentation for the current stable release" +msgstr "當前穩定發行的 Python 版本說明文件" #: ../../tools/templates/layout.html:14 msgid "" "This is a deploy preview created from a pull request.\n" -" For authoritative documentation, see the " +" For authoritative documentation, see" msgstr "" "這是從 pull request(拉取請求)" " 上建立的部署預覽。\n" -" 文件請見 " +" 文件請見" #: ../../tools/templates/layout.html:16 -msgid " the current stable release" -msgstr " 當前的穩定發行版" +msgid "the current stable release" +msgstr "當前的穩定發行版" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 9c7facf927..ee580ee041 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-25 00:04+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,8 +98,8 @@ msgid "" "parentheses (``()``) can be used for grouping. For example::" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" -"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以" -"用來執行運算;括號 ``()`` 可以用來分群。例如:\n" +"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以用來" +"執行運算;括號 ``()`` 可以用來分群。例如:\n" "\n" "::" @@ -197,38 +197,41 @@ msgstr "" "指定虛數的部份(即 ``3+5j``)。" #: ../../tutorial/introduction.rst:142 -msgid "Strings" -msgstr "字串 (String)" +msgid "Text" +msgstr "文字" #: ../../tutorial/introduction.rst:144 msgid "" -"Besides numbers, Python can also manipulate strings, which can be expressed " -"in several ways. They can be enclosed in single quotes (``'...'``) or " -"double quotes (``\"...\"``) with the same result [#]_. ``\\`` can be used " -"to escape quotes::" +"Python can manipulate text (represented by type :class:`str`, so-called " +"\"strings\") as well as numbers. This includes characters \"``!``\", words " +"\"``rabbit``\", names \"``Paris``\", sentences \"``Got your back.``\", etc. " +"\"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double " +"quotes (``\"...\"``) with the same result [#]_." msgstr "" -"除了數字之外,Python 也可以操作字串,而表達字串有數種方式。它們可以用包含在單" -"引號 (``'...'``) 或雙引號 (``\"...\"``) 之中,兩者會得到相同的結果\\ " -"[#]_\\ 。使用 ``\\`` 跳脫出現於字串中的引號:\n" +"Python 可以操作文本(由 :class:`str` 型別表示,即所謂的「字串 (strings)」)和" +"數字。這包括字元 \"``!``\"、單詞 \"``rabbit``\"、名稱 \"``Paris``\"、句子 " +"\"``Got your back.``\" 等等。\"``Yay! :)``\"。它們可以用單引號 (``'...'``) 或" +"雙引號 (``\"...\"``) 括起來,會具有相同的結果 [#]_。" + +#: ../../tutorial/introduction.rst:157 +msgid "" +"To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. " +"Alternatively, we can use the other type of quotation marks::" +msgstr "" +"要引用引文,我們需要在其前面加上 ``\\`` 來「跳脫」它。或者我們也可以使用其他" +"種類的引號:\n" "\n" "::" -#: ../../tutorial/introduction.rst:162 +#: ../../tutorial/introduction.rst:171 msgid "" -"In the interactive interpreter, the output string is enclosed in quotes and " -"special characters are escaped with backslashes. While this might sometimes " -"look different from the input (the enclosing quotes could change), the two " -"strings are equivalent. The string is enclosed in double quotes if the " -"string contains a single quote and no double quotes, otherwise it is " -"enclosed in single quotes. The :func:`print` function produces a more " -"readable output, by omitting the enclosing quotes and by printing escaped " -"and special characters::" +"In the Python shell, the string definition and output string can look " +"different. The :func:`print` function produces a more readable output, by " +"omitting the enclosing quotes and by printing escaped and special " +"characters::" msgstr "" -"在互動式的直譯器中,輸出的字串會被引號包圍且特殊符號會使用反斜線 (``\\``) 跳" -"脫。雖然這有時會讓它看起來跟輸入的字串不相同(包圍用的引號可能會改變),輸入" -"和輸出兩字串實為相同。一般來說,字串包含單引號而沒有雙引號時,會使用雙引號包" -"圍字串。函式 :func:`print` 會產生更易讀的輸出,它會去除掉包圍的引號,並且直接" -"印出被跳脫的字元和特殊字元:\n" +"在 Python shell 中,字串定義和輸出字串可能看起來不同。:func:`print` 函式透過" +"省略引號並印出跳脫字元和特殊字元來生成更具可讀性的輸出:\n" "\n" "::" @@ -249,6 +252,9 @@ msgid "" "odd number of ``\\`` characters; see :ref:`the FAQ entry ` for more information and workarounds." msgstr "" +"原始字串有一個微妙的地方:原始字串可能不會以奇數個 ``\\`` 字元結尾;請參閱" +"\\ :ref:`常見問答集 `\\ 來了解更多資訊" +"和解決方法。" #: ../../tutorial/introduction.rst:197 msgid "" From 9c5e305a057f1852413d1c83f5b75055908aee9f Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Sat, 29 Jul 2023 10:35:08 +0000 Subject: [PATCH 025/105] Sync with CPython 3.12 (#508) * sync with cpython 6bbcd792 * sync with cpython abaf89d9 * resolve fuzzy entries * sync with cpython 80aebd54 * resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/allocation.po | 67 +- c-api/apiabiversion.po | 6 +- c-api/arg.po | 4 +- c-api/buffer.po | 4 +- c-api/bytes.po | 50 +- c-api/capsule.po | 8 +- c-api/code.po | 10 +- c-api/codec.po | 6 +- c-api/complex.po | 6 +- c-api/conversion.po | 6 +- c-api/exceptions.po | 24 +- c-api/gcsupport.po | 22 +- c-api/import.po | 42 +- c-api/init.po | 687 +++++++++++------- c-api/init_config.po | 823 ++++++++++----------- c-api/intro.po | 6 +- c-api/memory.po | 190 ++--- c-api/module.po | 22 +- c-api/none.po | 6 +- c-api/object.po | 10 +- c-api/set.po | 21 +- c-api/structures.po | 306 ++++---- c-api/sys.po | 12 +- c-api/tuple.po | 108 +-- c-api/type.po | 8 +- c-api/typehints.po | 6 +- c-api/typeobj.po | 702 +++++++++--------- c-api/unicode.po | 20 +- c-api/veryhigh.po | 10 +- c-api/weakref.po | 4 +- extending/embedding.po | 8 +- extending/extending.po | 57 +- extending/newtypes.po | 35 +- extending/newtypes_tutorial.po | 156 ++-- howto/clinic.po | 1215 +++++++++++++++++--------------- howto/descriptor.po | 12 +- howto/isolating-extensions.po | 9 +- install/index.po | 6 +- library/fcntl.po | 9 +- library/fractions.po | 6 +- library/importlib.po | 190 +++-- library/logging.handlers.po | 22 +- library/os.po | 48 +- library/signal.po | 4 +- library/ssl.po | 4 +- library/subprocess.po | 22 +- library/sys.po | 20 +- library/turtle.po | 990 +++++++++++++------------- whatsnew/2.3.po | 8 +- whatsnew/2.4.po | 6 +- whatsnew/2.5.po | 28 +- whatsnew/2.6.po | 4 +- whatsnew/2.7.po | 6 +- whatsnew/3.1.po | 72 +- whatsnew/3.10.po | 2 +- whatsnew/3.2.po | 120 ++-- whatsnew/3.3.po | 106 +-- whatsnew/3.4.po | 25 +- whatsnew/3.5.po | 51 +- whatsnew/3.6.po | 2 +- whatsnew/3.7.po | 14 +- whatsnew/3.8.po | 84 ++- whatsnew/3.9.po | 22 +- 63 files changed, 3427 insertions(+), 3132 deletions(-) diff --git a/c-api/allocation.po b/c-api/allocation.po index c7b9399553..53b2905968 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,48 +49,49 @@ msgstr "" #: ../../c-api/allocation.rst:32 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " -"Python type object *type*. Fields not defined by the Python object header " -"are not initialized; the object's reference count will be one. The size of " -"the memory allocation is determined from the :c:member:`~PyTypeObject." -"tp_basicsize` field of the type object." +"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " +"Python object header are not initialized; the object's reference count will " +"be one. The size of the memory allocation is determined from the :c:member:" +"`~PyTypeObject.tp_basicsize` field of the type object." msgstr "" -"使用 C 結構型別 *TYPE* 和 Python 型別物件 *type* 分配一個新的 Python 物件。未" -"在該 Python 物件標頭 (header) 中定義的欄位不會被初始化;物件的參照計數將為" -"一。記憶體分配大小由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位" -"來指定。" +"使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配" +"一個新的 Python 物件。未在該 Python 物件標頭 (header) 中定義的欄位不會被初始" +"化;物件的參照計數將為一。記憶體分配大小由 type 物件的 :c:member:" +"`~PyTypeObject.tp_basicsize` 欄位來指定。" -#: ../../c-api/allocation.rst:41 +#: ../../c-api/allocation.rst:42 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " -"Python type object *type*. Fields not defined by the Python object header " -"are not initialized. The allocated memory allows for the *TYPE* structure " -"plus *size* fields of the size given by the :c:member:`~PyTypeObject." -"tp_itemsize` field of *type*. This is useful for implementing objects like " -"tuples, which are able to determine their size at construction time. " -"Embedding the array of fields into the same allocation decreases the number " -"of allocations, improving the memory management efficiency." +"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " +"Python object header are not initialized. The allocated memory allows for " +"the *TYPE* structure plus *size* (``Py_ssize_t``) fields of the size given " +"by the :c:member:`~PyTypeObject.tp_itemsize` field of *typeobj*. This is " +"useful for implementing objects like tuples, which are able to determine " +"their size at construction time. Embedding the array of fields into the " +"same allocation decreases the number of allocations, improving the memory " +"management efficiency." msgstr "" -"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *type* 分配一個新的 Python 物" -"件。未在該 Python 物件標頭中定義的欄位不會被初始化。記憶體空間預留了 *TYPE* " -"結構大小再加上 *type* 物件中 :c:member:`~PyTypeObject.tp_itemsize` 欄位提供" -"的 *size* 欄位的值。這對於實現如 tuple 這種能夠在建立期間決定自己大小的物件是" -"很實用的。將欄位的陣列嵌入到相同的記憶體分配中可以減少記憶體分配的次數,這提" -"高了記憶體管理的效率。" +"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *typeobj* (``PyTypeObject*``) " +"分配一個新的 Python 物件。未在該 Python 物件標頭中定義的欄位不會被初始化。記" +"憶體空間預留了 *TYPE* 結構大小再加上 *typeobj* 物件中 :c:member:" +"`~PyTypeObject.tp_itemsize` 欄位提供的 *size* (``Py_ssize_t``) 欄位的值。這對" +"於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌" +"入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。" -#: ../../c-api/allocation.rst:53 +#: ../../c-api/allocation.rst:56 msgid "" -"Releases memory allocated to an object using :c:func:`PyObject_New` or :c:" -"func:`PyObject_NewVar`. This is normally called from the :c:member:" +"Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:" +"macro:`PyObject_NewVar`. This is normally called from the :c:member:" "`~PyTypeObject.tp_dealloc` handler specified in the object's type. The " "fields of the object should not be accessed after this call as the memory is " "no longer a valid Python object." msgstr "" -"釋放由 :c:func:`PyObject_New` 或者 :c:func:`PyObject_NewVar` 分配給物件的記憶" -"體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` handler " -"中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的記憶體已" -"不再是一個有效的 Python 物件。" +"釋放由 :c:macro:`PyObject_New` 或者 :c:macro:`PyObject_NewVar` 分配給物件的記" +"憶體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` " +"handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的" +"記憶體已不再是一個有效的 Python 物件。" -#: ../../c-api/allocation.rst:62 +#: ../../c-api/allocation.rst:65 msgid "" "Object which is visible in Python as ``None``. This should only be accessed " "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " @@ -99,10 +100,10 @@ msgstr "" "這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" "取,該巨集的拿到指向該物件的指標。" -#: ../../c-api/allocation.rst:69 +#: ../../c-api/allocation.rst:72 msgid ":c:func:`PyModule_Create`" msgstr ":c:func:`PyModule_Create`" -#: ../../c-api/allocation.rst:70 +#: ../../c-api/allocation.rst:73 msgid "To allocate and create extension modules." msgstr "分配記憶體和建立擴充模組。" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index 1791d5ded2..066e019e9c 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-18 00:16+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2022-01-24 22:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -177,8 +177,8 @@ msgid "Use this for numeric comparisons, e.g. ``#if PY_VERSION_HEX >= ...``." msgstr "使用它進行數值比較,例如 ``#if PY_VERSION_HEX >= ...``。" #: ../../c-api/apiabiversion.rst:63 -msgid "This version is also available via the symbol :data:`Py_Version`." -msgstr "該版本也可透過符號 :data:`Py_Version` 獲得。" +msgid "This version is also available via the symbol :c:var:`Py_Version`." +msgstr "該版本也可透過符號 :c:var:`Py_Version` 獲得。" #: ../../c-api/apiabiversion.rst:67 msgid "" diff --git a/c-api/arg.po b/c-api/arg.po index 0e89cafb71..3b28780c5b 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -824,7 +824,7 @@ msgstr "" #: ../../c-api/arg.rst:471 msgid "" "This is an example of the use of this function, taken from the sources for " -"the :mod:`_weakref` helper module for weak references::" +"the :mod:`!_weakref` helper module for weak references::" msgstr "" #: ../../c-api/arg.rst:487 diff --git a/c-api/buffer.po b/c-api/buffer.po index 01df994fde..6ce805e8d0 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,7 +70,7 @@ msgstr "" msgid "" "An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase." "write` method of file objects: any object that can export a series of bytes " -"through the buffer interface can be written to a file. While :meth:`write` " +"through the buffer interface can be written to a file. While :meth:`!write` " "only needs read-only access to the internal contents of the object passed to " "it, other methods such as :meth:`~io.BufferedIOBase.readinto` need write " "access to the contents of their argument. The buffer interface allows " diff --git a/c-api/bytes.po b/c-api/bytes.po index 92f4b489b0..ae0d5ed2b7 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -87,8 +87,8 @@ msgid "Comment" msgstr "" #: ../../c-api/bytes.rst:67 -msgid ":attr:`%%`" -msgstr ":attr:`%%`" +msgid "``%%``" +msgstr "``%%``" #: ../../c-api/bytes.rst:67 msgid "*n/a*" @@ -99,8 +99,8 @@ msgid "The literal % character." msgstr "" #: ../../c-api/bytes.rst:69 -msgid ":attr:`%c`" -msgstr ":attr:`%c`" +msgid "``%c``" +msgstr "``%c``" #: ../../c-api/bytes.rst:69 ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:90 #: ../../c-api/bytes.rst:93 @@ -112,16 +112,16 @@ msgid "A single byte, represented as a C int." msgstr "" #: ../../c-api/bytes.rst:72 -msgid ":attr:`%d`" -msgstr ":attr:`%d`" +msgid "``%d``" +msgstr "``%d``" #: ../../c-api/bytes.rst:72 msgid "Equivalent to ``printf(\"%d\")``. [1]_" msgstr "等價於 ``printf(\"%d\")``. [1]_" #: ../../c-api/bytes.rst:75 -msgid ":attr:`%u`" -msgstr ":attr:`%u`" +msgid "``%u``" +msgstr "``%u``" #: ../../c-api/bytes.rst:75 msgid "unsigned int" @@ -132,8 +132,8 @@ msgid "Equivalent to ``printf(\"%u\")``. [1]_" msgstr "等價於 ``printf(\"%u\")``. [1]_" #: ../../c-api/bytes.rst:78 -msgid ":attr:`%ld`" -msgstr ":attr:`%ld`" +msgid "``%ld``" +msgstr "``%ld``" #: ../../c-api/bytes.rst:78 msgid "long" @@ -144,8 +144,8 @@ msgid "Equivalent to ``printf(\"%ld\")``. [1]_" msgstr "等價於 ``printf(\"%ld\")``. [1]_" #: ../../c-api/bytes.rst:81 -msgid ":attr:`%lu`" -msgstr ":attr:`%lu`" +msgid "``%lu``" +msgstr "``%lu``" #: ../../c-api/bytes.rst:81 msgid "unsigned long" @@ -156,8 +156,8 @@ msgid "Equivalent to ``printf(\"%lu\")``. [1]_" msgstr "等價於 ``printf(\"%lu\")``. [1]_" #: ../../c-api/bytes.rst:84 -msgid ":attr:`%zd`" -msgstr ":attr:`%zd`" +msgid "``%zd``" +msgstr "``%zd``" #: ../../c-api/bytes.rst:84 msgid ":c:type:`\\ Py_ssize_t`" @@ -168,8 +168,8 @@ msgid "Equivalent to ``printf(\"%zd\")``. [1]_" msgstr "等價於 ``printf(\"%zd\")``. [1]_" #: ../../c-api/bytes.rst:87 -msgid ":attr:`%zu`" -msgstr ":attr:`%zu`" +msgid "``%zu``" +msgstr "``%zu``" #: ../../c-api/bytes.rst:87 msgid "size_t" @@ -180,24 +180,24 @@ msgid "Equivalent to ``printf(\"%zu\")``. [1]_" msgstr "等價於 ``printf(\"%zu\")``. [1]_" #: ../../c-api/bytes.rst:90 -msgid ":attr:`%i`" -msgstr ":attr:`%i`" +msgid "``%i``" +msgstr "``%i``" #: ../../c-api/bytes.rst:90 msgid "Equivalent to ``printf(\"%i\")``. [1]_" msgstr "等價於 ``printf(\"%i\")``. [1]_" #: ../../c-api/bytes.rst:93 -msgid ":attr:`%x`" -msgstr ":attr:`%x`" +msgid "``%x``" +msgstr "``%x``" #: ../../c-api/bytes.rst:93 msgid "Equivalent to ``printf(\"%x\")``. [1]_" msgstr "等價於 ``printf(\"%x\")``. [1]_" #: ../../c-api/bytes.rst:96 -msgid ":attr:`%s`" -msgstr ":attr:`%s`" +msgid "``%s``" +msgstr "``%s``" #: ../../c-api/bytes.rst:96 msgid "const char\\*" @@ -208,8 +208,8 @@ msgid "A null-terminated C character array." msgstr "" #: ../../c-api/bytes.rst:99 -msgid ":attr:`%p`" -msgstr ":attr:`%p`" +msgid "``%p``" +msgstr "``%p``" #: ../../c-api/bytes.rst:99 msgid "const void\\*" diff --git a/c-api/capsule.po b/c-api/capsule.po index 771a696ffb..395dca4c92 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -93,7 +93,7 @@ msgstr "" msgid "" "The *name* parameter must compare exactly to the name stored in the capsule. " "If the name stored in the capsule is ``NULL``, the *name* passed in must " -"also be ``NULL``. Python uses the C function :c:func:`strcmp` to compare " +"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare " "capsule names." msgstr "" @@ -166,8 +166,8 @@ msgstr "" #: ../../c-api/capsule.rst:123 msgid "" "In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls " -"to any of the accessors (any function starting with :c:func:`PyCapsule_Get`) " -"are guaranteed to succeed." +"to any of the accessors (any function starting with ``PyCapsule_Get``) are " +"guaranteed to succeed." msgstr "" #: ../../c-api/capsule.rst:127 diff --git a/c-api/code.po b/c-api/code.po index 25c4a6f10f..beed548be4 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -60,7 +60,7 @@ msgstr "" #: ../../c-api/code.rst:41 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" -"`PyCode_New` directly can bind you to a precise Python version." +"`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" #: ../../c-api/code.rst:44 @@ -82,9 +82,9 @@ msgstr "" #: ../../c-api/code.rst:61 msgid "" -"Similar to :c:func:`PyCode_New`, but with an extra \"posonlyargcount\" for " -"positional-only arguments. The same caveats that apply to ``PyCode_New`` " -"also apply to this function." +"Similar to :c:func:`PyUnstable_Code_New`, but with an extra " +"\"posonlyargcount\" for positional-only arguments. The same caveats that " +"apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" #: ../../c-api/code.rst:66 diff --git a/c-api/codec.po b/c-api/codec.po index 126e008ecf..68de1f7702 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2023-07-24 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,10 +28,10 @@ msgstr "註冊一個新的編解碼器搜索函式。" #: ../../c-api/codec.rst:10 msgid "" -"As side effect, this tries to load the :mod:`encodings` package, if not yet " +"As side effect, this tries to load the :mod:`!encodings` package, if not yet " "done, to make sure that it is always first in the list of search functions." msgstr "" -"作為副作用 (side effect),這會嘗試載入 :mod:`encodings`\\ (如果尚未完成)," +"作為副作用 (side effect),這會嘗試載入 :mod:`!encodings`\\ (如果尚未完成)," "以確保它始終位於搜索函式列表中的第一個。" #: ../../c-api/codec.rst:15 diff --git a/c-api/complex.po b/c-api/complex.po index 1a4140e607..647379d243 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -82,7 +82,7 @@ msgstr "" #: ../../c-api/complex.rst:66 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" -"c:macro:`EDOM`." +"c:macro:`!EDOM`." msgstr "" #: ../../c-api/complex.rst:72 @@ -94,7 +94,7 @@ msgstr "" #: ../../c-api/complex.rst:75 msgid "" "If *num* is null and *exp* is not a positive real number, this method " -"returns zero and sets :c:data:`errno` to :c:macro:`EDOM`." +"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." msgstr "" #: ../../c-api/complex.rst:80 diff --git a/c-api/conversion.po b/c-api/conversion.po index 4644530aad..e5d28293e8 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-08 00:21+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -189,11 +189,11 @@ msgstr "" #: ../../c-api/conversion.rst:121 msgid "" "Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`strcmp` except that it ignores the case." +"identically to :c:func:`!strcmp` except that it ignores the case." msgstr "" #: ../../c-api/conversion.rst:127 msgid "" "Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`strncmp` except that it ignores the case." +"identically to :c:func:`!strncmp` except that it ignores the case." msgstr "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 443fd46d9f..c539882ea8 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -118,7 +118,7 @@ msgid "" "This utility function prints a warning message to ``sys.stderr`` when an " "exception has been set but it is impossible for the interpreter to actually " "raise the exception. It is used, for example, when an exception occurs in " -"an :meth:`__del__` method." +"an :meth:`~object.__del__` method." msgstr "" #: ../../c-api/exceptions.rst:88 @@ -203,7 +203,7 @@ msgid "" "constructs a tuple object whose first item is the integer :c:data:`errno` " "value and whose second item is the corresponding error message (gotten from :" "c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " -"Unix, when the :c:data:`errno` value is :c:macro:`EINTR`, indicating an " +"Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an " "interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " "that set the error indicator, leaves it set to that. The function always " "returns ``NULL``, so a wrapper function around a system call can write " @@ -215,7 +215,7 @@ msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " "*type* as a third parameter. In the case of :exc:`OSError` exception, this " -"is used to define the :attr:`filename` attribute of the exception instance." +"is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" #: ../../c-api/exceptions.rst:186 @@ -235,12 +235,12 @@ msgstr "" #: ../../c-api/exceptions.rst:202 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " -"*ierr* of ``0``, the error code returned by a call to :c:func:`GetLastError` " -"is used instead. It calls the Win32 function :c:func:`FormatMessage` to " -"retrieve the Windows description of error code given by *ierr* or :c:func:" -"`GetLastError`, then it constructs a tuple object whose first item is the " -"*ierr* value and whose second item is the corresponding error message " -"(gotten from :c:func:`FormatMessage`), and then calls " +"*ierr* of ``0``, the error code returned by a call to :c:func:`!" +"GetLastError` is used instead. It calls the Win32 function :c:func:`!" +"FormatMessage` to retrieve the Windows description of error code given by " +"*ierr* or :c:func:`!GetLastError`, then it constructs a tuple object whose " +"first item is the *ierr* value and whose second item is the corresponding " +"error message (gotten from :c:func:`!FormatMessage`), and then calls " "``PyErr_SetObject(PyExc_WindowsError, object)``. This function always " "returns ``NULL``." msgstr "" @@ -649,13 +649,13 @@ msgstr "" #: ../../c-api/exceptions.rst:634 msgid "" -"The default Python signal handler for :c:macro:`SIGINT` raises the :exc:" +"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" #: ../../c-api/exceptions.rst:645 msgid "" -"Simulate the effect of a :c:macro:`SIGINT` signal arriving. This is " +"Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 13e0eb53de..6e8d0434fb 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:31+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,8 +58,8 @@ msgstr "" #: ../../c-api/gcsupport.rst:28 msgid "" -"The memory for the object must be allocated using :c:func:`PyObject_GC_New` " -"or :c:func:`PyObject_GC_NewVar`." +"The memory for the object must be allocated using :c:macro:`PyObject_GC_New` " +"or :c:macro:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/gcsupport.rst:31 @@ -105,19 +105,19 @@ msgstr "" #: ../../c-api/gcsupport.rst:57 msgid "" -"Analogous to :c:func:`PyObject_New` but for container objects with the :c:" +"Analogous to :c:macro:`PyObject_New` but for container objects with the :c:" "macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" #: ../../c-api/gcsupport.rst:62 msgid "" -"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :c:" -"macro:`Py_TPFLAGS_HAVE_GC` flag set." +"Analogous to :c:macro:`PyObject_NewVar` but for container objects with the :" +"c:macro:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" #: ../../c-api/gcsupport.rst:67 msgid "" -"Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size* bytes at " +"Analogous to :c:macro:`PyObject_GC_New` but allocates *extra_size* bytes at " "the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " "The allocated memory is initialized to zeros, except for the :c:type:`Python " "object header `." @@ -139,7 +139,7 @@ msgstr "" #: ../../c-api/gcsupport.rst:88 msgid "" -"Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " +"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " "resized object or ``NULL`` on failure. *op* must not be tracked by the " "collector yet." msgstr "" @@ -187,8 +187,8 @@ msgstr "" #: ../../c-api/gcsupport.rst:131 msgid "" -"Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" -"func:`PyObject_GC_NewVar`." +"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :" +"c:macro:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/gcsupport.rst:137 @@ -203,7 +203,7 @@ msgstr "" #: ../../c-api/gcsupport.rst:146 msgid "" -"The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " +"The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" diff --git a/c-api/import.po b/c-api/import.po index 51c28be036..357ddf9c79 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -147,14 +147,14 @@ msgstr "" msgid "" "The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set " "already, with the appropriate values. The spec's loader will be set to the " -"module's ``__loader__`` (if set) and to an instance of :class:" -"`SourceFileLoader` otherwise." +"module's ``__loader__`` (if set) and to an instance of :class:`~importlib." +"machinery.SourceFileLoader` otherwise." msgstr "" #: ../../c-api/import.rst:140 msgid "" -"The module's :attr:`__file__` attribute will be set to the code object's :c:" -"member:`co_filename`. If applicable, :attr:`__cached__` will also be set." +"The module's :attr:`__file__` attribute will be set to the code object's :" +"attr:`!co_filename`. If applicable, :attr:`__cached__` will also be set." msgstr "" #: ../../c-api/import.rst:144 @@ -255,7 +255,7 @@ msgstr "" #: ../../c-api/import.rst:228 msgid "" -"Return a finder object for a :data:`sys.path`/:attr:`pkg.__path__` item " +"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item " "*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " "dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook " "is found that can handle the path item. Return ``None`` if no hook could; " @@ -318,26 +318,28 @@ msgstr "" #: ../../c-api/import.rst:297 msgid "" -"Structure describing a single entry in the list of built-in modules. Each " -"of these structures gives the name and initialization function for a module " -"built into the interpreter. The name is an ASCII encoded string. Programs " -"which embed Python may use an array of these structures in conjunction with :" -"c:func:`PyImport_ExtendInittab` to provide additional built-in modules. The " -"structure is defined in :file:`Include/import.h` as::" +"Structure describing a single entry in the list of built-in modules. " +"Programs which embed Python may use an array of these structures in " +"conjunction with :c:func:`PyImport_ExtendInittab` to provide additional " +"built-in modules. The structure consists of two members:" msgstr "" -#: ../../c-api/import.rst:312 +#: ../../c-api/import.rst:305 +msgid "The module name, as an ASCII encoded string." +msgstr "" + +#: ../../c-api/import.rst:314 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " -"array must end with a sentinel entry which contains ``NULL`` for the :attr:" -"`name` field; failure to provide the sentinel value can result in a memory " -"fault. Returns ``0`` on success or ``-1`` if insufficient memory could be " -"allocated to extend the internal table. In the event of failure, no modules " -"are added to the internal table. This must be called before :c:func:" -"`Py_Initialize`." +"array must end with a sentinel entry which contains ``NULL`` for the :c:" +"member:`~_inittab.name` field; failure to provide the sentinel value can " +"result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient " +"memory could be allocated to extend the internal table. In the event of " +"failure, no modules are added to the internal table. This must be called " +"before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/import.rst:319 +#: ../../c-api/import.rst:321 msgid "" "If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " "or :c:func:`PyImport_ExtendInittab` must be called before each Python " diff --git a/c-api/init.po b/c-api/init.po index df7fd57324..ea7e11da21 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,8 +58,8 @@ msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" #: ../../c-api/init.rst:28 -msgid ":c:func:`PyInitFrozenExtensions`" -msgstr ":c:func:`PyInitFrozenExtensions`" +msgid ":c:func:`!PyInitFrozenExtensions`" +msgstr ":c:func:`!PyInitFrozenExtensions`" #: ../../c-api/init.rst:29 msgid ":c:func:`PyMem_SetAllocator`" @@ -296,7 +296,7 @@ msgstr "" #: ../../c-api/init.rst:160 msgid "" -"Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" +"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" @@ -391,8 +391,8 @@ msgstr "" #: ../../c-api/init.rst:232 msgid "" -"If the flag is non-zero, use :class:`io.FileIO` instead of :class:" -"`WindowsConsoleIO` for :mod:`sys` standard streams." +"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" #: ../../c-api/init.rst:235 @@ -585,16 +585,16 @@ msgstr "" #: ../../c-api/init.rst:403 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " -"done in random order; this may cause destructors (:meth:`__del__` methods) " -"to fail when they depend on other objects (even functions) or modules. " -"Dynamically loaded extension modules loaded by Python are not unloaded. " -"Small amounts of memory allocated by the Python interpreter may not be freed " -"(if you find a leak, please report it). Memory tied up in circular " -"references between objects is not freed. Some memory allocated by extension " -"modules may not be freed. Some extensions may not work properly if their " -"initialization routine is called more than once; this can happen if an " -"application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` more " -"than once." +"done in random order; this may cause destructors (:meth:`~object.__del__` " +"methods) to fail when they depend on other objects (even functions) or " +"modules. Dynamically loaded extension modules loaded by Python are not " +"unloaded. Small amounts of memory allocated by the Python interpreter may " +"not be freed (if you find a leak, please report it). Memory tied up in " +"circular references between objects is not freed. Some memory allocated by " +"extension modules may not be freed. Some extensions may not work properly " +"if their initialization routine is called more than once; this can happen if " +"an application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` " +"more than once." msgstr "" #: ../../c-api/init.rst:414 @@ -680,11 +680,10 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:487 ../../c-api/init.rst:638 ../../c-api/init.rst:753 -#: ../../c-api/init.rst:789 ../../c-api/init.rst:815 +#: ../../c-api/init.rst:487 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" -"`wchar_*` string." +"`wchar_t *` string." msgstr "" #: ../../c-api/init.rst:497 @@ -814,6 +813,13 @@ msgid "" "required after calling :c:func:`Py_Initialize`." msgstr "" +#: ../../c-api/init.rst:638 ../../c-api/init.rst:753 ../../c-api/init.rst:789 +#: ../../c-api/init.rst:815 +msgid "" +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" +"`wchar_*` string." +msgstr "" + #: ../../c-api/init.rst:641 msgid "" "The path argument is copied internally, so the caller may free it after the " @@ -1141,7 +1147,7 @@ msgid "" "them afterwards. In addition, it resets any :ref:`lock-objects` in the " "child. When extending or embedding Python, there is no way to inform Python " "of additional (non-Python) locks that need to be acquired before or reset " -"after a fork. OS facilities such as :c:func:`pthread_atfork` would need to " +"after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " "be used to accomplish the same thing. Additionally, when extending or " "embedding Python, calling :c:func:`fork` directly rather than through :func:" "`os.fork` (and returning to or calling into Python) may result in a deadlock " @@ -1192,46 +1198,49 @@ msgstr "" #: ../../c-api/init.rst:1025 msgid "" "This data structure represents the state of a single thread. The only " -"public data member is :attr:`interp` (:c:expr:`PyInterpreterState *`), which " -"points to this thread's interpreter state." +"public data member is:" +msgstr "" + +#: ../../c-api/init.rst:1030 +msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:1041 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1040 +#: ../../c-api/init.rst:1043 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1042 +#: ../../c-api/init.rst:1045 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1045 +#: ../../c-api/init.rst:1048 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1049 +#: ../../c-api/init.rst:1052 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1059 +#: ../../c-api/init.rst:1062 msgid "" "Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. " "This function can be called without holding the GIL, and therefore can be " "used to avoid calls to the locking API when running single-threaded." msgstr "" -#: ../../c-api/init.rst:1063 +#: ../../c-api/init.rst:1066 msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" -#: ../../c-api/init.rst:1071 +#: ../../c-api/init.rst:1074 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1239,7 +1248,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1079 +#: ../../c-api/init.rst:1082 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1247,37 +1256,37 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1085 ../../c-api/init.rst:1131 -#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1451 +#: ../../c-api/init.rst:1088 ../../c-api/init.rst:1134 +#: ../../c-api/init.rst:1416 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " -"use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " +"use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " "interpreter is in process of being finalized before calling this function to " "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1093 +#: ../../c-api/init.rst:1096 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1100 +#: ../../c-api/init.rst:1103 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1105 +#: ../../c-api/init.rst:1108 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1110 +#: ../../c-api/init.rst:1113 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1290,7 +1299,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1120 +#: ../../c-api/init.rst:1123 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1300,13 +1309,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1127 +#: ../../c-api/init.rst:1130 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1139 +#: ../../c-api/init.rst:1142 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1314,13 +1323,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1144 +#: ../../c-api/init.rst:1147 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1150 +#: ../../c-api/init.rst:1153 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1328,7 +1337,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1158 +#: ../../c-api/init.rst:1161 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1339,13 +1348,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1170 +#: ../../c-api/init.rst:1173 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1176 +#: ../../c-api/init.rst:1179 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1353,7 +1362,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1184 +#: ../../c-api/init.rst:1187 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1361,40 +1370,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1192 +#: ../../c-api/init.rst:1195 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1198 +#: ../../c-api/init.rst:1201 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1204 +#: ../../c-api/init.rst:1207 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1209 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1208 +#: ../../c-api/init.rst:1211 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1214 +#: ../../c-api/init.rst:1217 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1218 +#: ../../c-api/init.rst:1221 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1402,13 +1411,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1223 +#: ../../c-api/init.rst:1226 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1226 +#: ../../c-api/init.rst:1229 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1416,40 +1425,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1231 +#: ../../c-api/init.rst:1234 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1238 +#: ../../c-api/init.rst:1241 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1245 +#: ../../c-api/init.rst:1248 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1248 +#: ../../c-api/init.rst:1251 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1255 +#: ../../c-api/init.rst:1258 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:1265 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " @@ -1457,119 +1466,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1270 +#: ../../c-api/init.rst:1273 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1275 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1275 +#: ../../c-api/init.rst:1278 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`\\ 。" -#: ../../c-api/init.rst:1277 ../../c-api/init.rst:1286 -#: ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1280 ../../c-api/init.rst:1289 +#: ../../c-api/init.rst:1298 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1284 +#: ../../c-api/init.rst:1287 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1293 +#: ../../c-api/init.rst:1296 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1302 +#: ../../c-api/init.rst:1305 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1304 +#: ../../c-api/init.rst:1307 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1311 +#: ../../c-api/init.rst:1314 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1314 +#: ../../c-api/init.rst:1317 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1322 +#: ../../c-api/init.rst:1325 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1324 +#: ../../c-api/init.rst:1327 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1327 ../../c-api/init.rst:1337 +#: ../../c-api/init.rst:1330 ../../c-api/init.rst:1340 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1334 +#: ../../c-api/init.rst:1337 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1344 +#: ../../c-api/init.rst:1347 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1348 +#: ../../c-api/init.rst:1351 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1355 +#: ../../c-api/init.rst:1358 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1357 +#: ../../c-api/init.rst:1360 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1360 +#: ../../c-api/init.rst:1363 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1363 +#: ../../c-api/init.rst:1366 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1368 +#: ../../c-api/init.rst:1371 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1370 ../../c-api/init.rst:1378 +#: ../../c-api/init.rst:1373 ../../c-api/init.rst:1381 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1376 +#: ../../c-api/init.rst:1379 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1385 +#: ../../c-api/init.rst:1388 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1578,7 +1587,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1397 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1590,33 +1599,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1402 +#: ../../c-api/init.rst:1405 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1408 +#: ../../c-api/init.rst:1411 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1419 ../../c-api/init.rst:1457 +#: ../../c-api/init.rst:1422 ../../c-api/init.rst:1460 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1424 +#: ../../c-api/init.rst:1427 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1430 +#: ../../c-api/init.rst:1433 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1625,41 +1634,50 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1436 +#: ../../c-api/init.rst:1439 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1442 +#: ../../c-api/init.rst:1445 msgid "" "Acquire the global interpreter lock. The lock must have been created " "earlier. If this thread already has the lock, a deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1445 +#: ../../c-api/init.rst:1448 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." msgstr "" -#: ../../c-api/init.rst:1465 +#: ../../c-api/init.rst:1454 +msgid "" +"Calling this function from a thread when the runtime is finalizing will " +"terminate the thread, even if the thread was not created by Python. You can " +"use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " +"interpreter is in process of being finalized before calling this function to " +"avoid unwanted termination." +msgstr "" + +#: ../../c-api/init.rst:1468 msgid "" "Release the global interpreter lock. The lock must have been created " "earlier." msgstr "" -#: ../../c-api/init.rst:1467 +#: ../../c-api/init.rst:1470 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." msgstr "" -#: ../../c-api/init.rst:1476 +#: ../../c-api/init.rst:1479 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1478 +#: ../../c-api/init.rst:1481 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1667,7 +1685,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1483 +#: ../../c-api/init.rst:1486 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1678,14 +1696,114 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1490 +#: ../../c-api/init.rst:1493 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1499 +msgid "" +"Structure containing most parameters to configure a sub-interpreter. Its " +"values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " +"modified by the runtime." +msgstr "" + +#: ../../c-api/init.rst:1505 +msgid "Structure fields:" +msgstr "" + +#: ../../c-api/init.rst:1509 +msgid "" +"If this is ``0`` then the sub-interpreter will use its own \"object\" " +"allocator state. Otherwise it will use (share) the main interpreter's." +msgstr "" + +#: ../../c-api/init.rst:1513 +msgid "" +"If this is ``0`` then :c:member:`~PyInterpreterConfig." +"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " +"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:" +"`PyInterpreterConfig_OWN_GIL`." +msgstr "" + +#: ../../c-api/init.rst:1521 +msgid "" +"If this is ``0`` then the runtime will not support forking the process in " +"any thread where the sub-interpreter is currently active. Otherwise fork is " +"unrestricted." +msgstr "" + +#: ../../c-api/init.rst:1525 +msgid "" +"Note that the :mod:`subprocess` module still works when fork is disallowed." +msgstr "" + +#: ../../c-api/init.rst:1530 +msgid "" +"If this is ``0`` then the runtime will not support replacing the current " +"process via exec (e.g. :func:`os.execv`) in any thread where the sub-" +"interpreter is currently active. Otherwise exec is unrestricted." +msgstr "" + +#: ../../c-api/init.rst:1535 +msgid "" +"Note that the :mod:`subprocess` module still works when exec is disallowed." +msgstr "" + +#: ../../c-api/init.rst:1540 +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create threads. Otherwise threads are allowed." +msgstr "" + +#: ../../c-api/init.rst:1546 +msgid "" +"If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " +"create daemon threads. Otherwise daemon threads are allowed (as long as :c:" +"member:`~PyInterpreterConfig.allow_threads` is non-zero)." +msgstr "" + +#: ../../c-api/init.rst:1553 +msgid "" +"If this is ``0`` then all extension modules may be imported, including " +"legacy (single-phase init) modules, in any thread where the sub-interpreter " +"is currently active. Otherwise only multi-phase init extension modules (see :" +"pep:`489`) may be imported." +msgstr "" + +#: ../../c-api/init.rst:1559 +msgid "" +"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." +"use_main_obmalloc` is ``0``." +msgstr "" + +#: ../../c-api/init.rst:1564 +msgid "" +"This determines the operation of the GIL for the sub-interpreter. It may be " +"one of the following:" +msgstr "" + +#: ../../c-api/init.rst:1571 +msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." +msgstr "" + +#: ../../c-api/init.rst:1575 +msgid "Use (share) the main interpreter's GIL." +msgstr "" + +#: ../../c-api/init.rst:1579 +msgid "Use the sub-interpreter's own GIL." +msgstr "" + +#: ../../c-api/init.rst:1581 +msgid "" +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" +"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +msgstr "" + +#: ../../c-api/init.rst:1595 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1698,25 +1816,54 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1514 +#: ../../c-api/init.rst:1605 +msgid "" +"The given *config* controls the options with which the interpreter is " +"initialized." +msgstr "" + +#: ../../c-api/init.rst:1608 +msgid "" +"Upon success, *tstate_p* will be set to the first thread state created in " +"the new sub-interpreter. This thread state is made in the current thread " +"state. Note that no actual thread is created; see the discussion of thread " +"states below. If creation of the new interpreter is unsuccessful, " +"*tstate_p* is set to ``NULL``; no exception is set since the exception state " +"is stored in the current thread state and there may not be a current thread " +"state." +msgstr "" + +#: ../../c-api/init.rst:1617 msgid "" -"The return value points to the first thread state created in the new sub-" -"interpreter. This thread state is made in the current thread state. Note " -"that no actual thread is created; see the discussion of thread states " -"below. If creation of the new interpreter is unsuccessful, ``NULL`` is " -"returned; no exception is set since the exception state is stored in the " -"current thread state and there may not be a current thread state. (Like all " -"other Python/C API functions, the global interpreter lock must be held " -"before calling this function and is still held when it returns; however, " -"unlike most other Python/C API functions, there needn't be a current thread " -"state on entry.)" +"Like all other Python/C API functions, the global interpreter lock must be " +"held before calling this function and is still held when it returns. " +"Likewise a current thread state must be set on entry. On success, the " +"returned thread state will be set as current. If the sub-interpreter is " +"created with its own GIL then the GIL of the calling interpreter will be " +"released. When the function returns, the new interpreter's GIL will be held " +"by the current thread and the previously interpreter's GIL will remain " +"released here." msgstr "" -#: ../../c-api/init.rst:1529 +#: ../../c-api/init.rst:1628 +msgid "" +"Sub-interpreters are most effective when isolated from each other, with " +"certain functionality restricted::" +msgstr "" + +#: ../../c-api/init.rst:1642 +msgid "" +"Note that the config is used only briefly and does not get modified. During " +"initialization the config's values are converted into various :c:type:" +"`PyInterpreterState` values. A read-only copy of the config may be stored " +"internally on the :c:type:`PyInterpreterState`." +msgstr "" + +#: ../../c-api/init.rst:1651 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1653 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1724,7 +1871,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1537 +#: ../../c-api/init.rst:1659 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1736,7 +1883,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1548 +#: ../../c-api/init.rst:1670 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1746,23 +1893,84 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1562 +#: ../../c-api/init.rst:1690 +msgid "" +"Create a new sub-interpreter. This is essentially just a wrapper around :c:" +"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " +"behavior. The result is an unisolated sub-interpreter that shares the main " +"interpreter's GIL, allows fork/exec, allows daemon threads, and allows " +"single-phase init modules." +msgstr "" + +#: ../../c-api/init.rst:1702 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " "thread states below. When the call returns, the current thread state is " "``NULL``. All thread states associated with this interpreter are " -"destroyed. (The global interpreter lock must be held before calling this " -"function and is still held when it returns.) :c:func:`Py_FinalizeEx` will " -"destroy all sub-interpreters that haven't been explicitly destroyed at that " -"point." +"destroyed. The global interpreter lock used by the target interpreter must " +"be held before calling this function. No GIL is held when it returns." +msgstr "" + +#: ../../c-api/init.rst:1710 +msgid "" +":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " +"explicitly destroyed at that point." +msgstr "" + +#: ../../c-api/init.rst:1715 +msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1717 +msgid "" +"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " +"that is completely isolated from other interpreters, including having its " +"own GIL. The most important benefit of this isolation is that such an " +"interpreter can execute Python code without being blocked by other " +"interpreters or blocking any others. Thus a single Python process can truly " +"take advantage of multiple CPU cores when running Python code. The " +"isolation also encourages a different approach to concurrency than that of " +"just using threads. (See :pep:`554`.)" +msgstr "" + +#: ../../c-api/init.rst:1727 +msgid "" +"Using an isolated interpreter requires vigilance in preserving that " +"isolation. That especially means not sharing any objects or mutable state " +"without guarantees about thread-safety. Even objects that are otherwise " +"immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of " +"the refcount. One simple but less-efficient approach around this is to use " +"a global lock around all use of some state (or object). Alternately, " +"effectively immutable objects (like integers or strings) can be made safe in " +"spite of their refcounts by making them \"immortal\". In fact, this has been " +"done for the builtin singletons, small integers, and a number of other " +"builtin objects." +msgstr "" + +#: ../../c-api/init.rst:1738 +msgid "" +"If you preserve isolation then you will have access to proper multi-core " +"computing without the complications that come with free-threading. Failure " +"to preserve isolation will expose you to the full consequences of free-" +"threading, including races and hard-to-debug crashes." +msgstr "" + +#: ../../c-api/init.rst:1743 +msgid "" +"Aside from that, one of the main challenges of using multiple isolated " +"interpreters is how to communicate between them safely (not break isolation) " +"and efficiently. The runtime and stdlib do not provide any standard " +"approach to this yet. A future stdlib module would help mitigate the effort " +"of preserving isolation and expose effective tools for communicating (and " +"sharing) data between interpreters." +msgstr "" + +#: ../../c-api/init.rst:1754 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1574 +#: ../../c-api/init.rst:1756 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1775,7 +1983,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1584 +#: ../../c-api/init.rst:1766 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1784,7 +1992,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1590 +#: ../../c-api/init.rst:1772 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -1796,25 +2004,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1601 +#: ../../c-api/init.rst:1783 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1603 +#: ../../c-api/init.rst:1785 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1794 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1616 +#: ../../c-api/init.rst:1798 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -1822,17 +2030,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1621 +#: ../../c-api/init.rst:1803 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1622 +#: ../../c-api/init.rst:1804 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1807 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -1840,20 +2048,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1630 +#: ../../c-api/init.rst:1812 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1633 +#: ../../c-api/init.rst:1815 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1638 +#: ../../c-api/init.rst:1820 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -1863,7 +2071,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1645 +#: ../../c-api/init.rst:1827 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -1871,18 +2079,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1656 +#: ../../c-api/init.rst:1838 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1843 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1847 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -1892,7 +2100,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1675 +#: ../../c-api/init.rst:1857 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -1904,74 +2112,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1684 +#: ../../c-api/init.rst:1866 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1684 +#: ../../c-api/init.rst:1866 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1686 -#, fuzzy +#: ../../c-api/init.rst:1868 msgid ":c:data:`PyTrace_CALL`" -msgstr ":const:`PyTrace_CALL`" +msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1686 ../../c-api/init.rst:1691 -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1868 ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1884 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1688 -#, fuzzy +#: ../../c-api/init.rst:1870 msgid ":c:data:`PyTrace_EXCEPTION`" -msgstr ":const:`PyTrace_EXCEPTION`" +msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1688 +#: ../../c-api/init.rst:1870 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1691 -#, fuzzy +#: ../../c-api/init.rst:1873 msgid ":c:data:`PyTrace_LINE`" -msgstr ":const:`PyTrace_LINE`" +msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1693 -#, fuzzy +#: ../../c-api/init.rst:1875 msgid ":c:data:`PyTrace_RETURN`" -msgstr ":const:`PyTrace_RETURN`" +msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1693 +#: ../../c-api/init.rst:1875 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1696 -#, fuzzy +#: ../../c-api/init.rst:1878 msgid ":c:data:`PyTrace_C_CALL`" -msgstr ":const:`PyTrace_C_CALL`" +msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1696 ../../c-api/init.rst:1698 -#: ../../c-api/init.rst:1700 +#: ../../c-api/init.rst:1878 ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1882 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1698 -#, fuzzy +#: ../../c-api/init.rst:1880 msgid ":c:data:`PyTrace_C_EXCEPTION`" -msgstr ":const:`PyTrace_C_EXCEPTION`" +msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1700 -#, fuzzy +#: ../../c-api/init.rst:1882 msgid ":c:data:`PyTrace_C_RETURN`" -msgstr ":const:`PyTrace_C_RETURN`" +msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1702 -#, fuzzy +#: ../../c-api/init.rst:1884 msgid ":c:data:`PyTrace_OPCODE`" -msgstr ":const:`PyTrace_OPCODE`" +msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1707 +#: ../../c-api/init.rst:1889 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -1980,7 +2180,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1716 +#: ../../c-api/init.rst:1898 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -1992,7 +2192,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1909 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2000,31 +2200,31 @@ msgid "" "*0* on that frame." msgstr "" -#: ../../c-api/init.rst:1734 +#: ../../c-api/init.rst:1916 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1740 +#: ../../c-api/init.rst:1922 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1746 +#: ../../c-api/init.rst:1928 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1752 +#: ../../c-api/init.rst:1934 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1758 +#: ../../c-api/init.rst:1940 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2032,7 +2232,7 @@ msgid "" "attr:`f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1948 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2042,29 +2242,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1773 +#: ../../c-api/init.rst:1955 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1775 ../../c-api/init.rst:1782 -#: ../../c-api/init.rst:1801 ../../c-api/init.rst:1808 +#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1964 +#: ../../c-api/init.rst:1983 ../../c-api/init.rst:1990 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1779 +#: ../../c-api/init.rst:1961 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1784 +#: ../../c-api/init.rst:1966 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1792 +#: ../../c-api/init.rst:1974 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2075,65 +2275,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1799 +#: ../../c-api/init.rst:1981 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1987 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1810 +#: ../../c-api/init.rst:1992 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:1819 +#: ../../c-api/init.rst:2001 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:1824 +#: ../../c-api/init.rst:2006 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:1829 +#: ../../c-api/init.rst:2011 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:1834 +#: ../../c-api/init.rst:2016 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:1839 +#: ../../c-api/init.rst:2021 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:1845 +#: ../../c-api/init.rst:2027 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:1851 +#: ../../c-api/init.rst:2033 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:2040 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:1862 +#: ../../c-api/init.rst:2044 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2143,19 +2343,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:2051 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:1872 +#: ../../c-api/init.rst:2054 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:1876 +#: ../../c-api/init.rst:2058 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2163,22 +2363,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:2066 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:1886 +#: ../../c-api/init.rst:2068 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:1892 +#: ../../c-api/init.rst:2074 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:1897 +#: ../../c-api/init.rst:2079 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2186,52 +2386,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:1902 +#: ../../c-api/init.rst:2084 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:1908 +#: ../../c-api/init.rst:2090 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:1913 +#: ../../c-api/init.rst:2095 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:2097 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:1922 +#: ../../c-api/init.rst:2104 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:1929 +#: ../../c-api/init.rst:2111 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:2117 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:1940 +#: ../../c-api/init.rst:2122 msgid "Methods" -msgstr "" +msgstr "方法" -#: ../../c-api/init.rst:1942 +#: ../../c-api/init.rst:2124 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2239,13 +2439,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:1950 +#: ../../c-api/init.rst:2132 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:1956 +#: ../../c-api/init.rst:2138 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2254,7 +2454,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:2147 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2263,31 +2463,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:2156 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:1981 +#: ../../c-api/init.rst:2163 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:1989 +#: ../../c-api/init.rst:2171 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:1991 +#: ../../c-api/init.rst:2173 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:1996 +#: ../../c-api/init.rst:2178 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2296,7 +2496,7 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2183 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." @@ -2319,19 +2519,20 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 -#: ../../c-api/init.rst:1054 ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1587 +#: ../../c-api/init.rst:1682 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "sys" msgstr "sys" @@ -2351,11 +2552,11 @@ msgstr "PySys_SetArgv()" msgid "PySys_SetArgvEx()" msgstr "PySys_SetArgvEx()" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1525 ../../c-api/init.rst:1560 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1525 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1647 msgid "Py_Initialize()" msgstr "Py_Initialize()" @@ -2435,42 +2636,42 @@ msgstr "Py_BEGIN_ALLOW_THREADS" msgid "Py_END_ALLOW_THREADS" msgstr "Py_END_ALLOW_THREADS" -#: ../../c-api/init.rst:904 ../../c-api/init.rst:1032 +#: ../../c-api/init.rst:904 ../../c-api/init.rst:1035 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:904 ../../c-api/init.rst:1032 +#: ../../c-api/init.rst:904 ../../c-api/init.rst:1035 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:1032 +#: ../../c-api/init.rst:1035 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:1032 +#: ../../c-api/init.rst:1035 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:1054 +#: ../../c-api/init.rst:1057 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1555 +#: ../../c-api/init.rst:1677 msgid "close() (in module os)" msgstr "close()(sys 模組中)" -#: ../../c-api/init.rst:1610 +#: ../../c-api/init.rst:1792 msgid "Py_AddPendingCall()" msgstr "Py_AddPendingCall()" diff --git a/c-api/init_config.po b/c-api/init_config.po index 2ed97a20cd..3515990b20 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -113,7 +113,7 @@ msgid "*index* must be greater than or equal to ``0``." msgstr "" #: ../../c-api/init_config.rst:104 ../../c-api/init_config.rst:124 -#: ../../c-api/init_config.rst:225 ../../c-api/init_config.rst:530 +#: ../../c-api/init_config.rst:231 ../../c-api/init_config.rst:540 msgid "Structure fields:" msgstr "" @@ -150,246 +150,246 @@ msgstr "錯誤訊息。" msgid "Name of the function which created an error, can be ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:138 +#: ../../c-api/init_config.rst:140 msgid "Functions to create a status:" msgstr "" -#: ../../c-api/init_config.rst:142 +#: ../../c-api/init_config.rst:144 msgid "Success." msgstr "" -#: ../../c-api/init_config.rst:146 +#: ../../c-api/init_config.rst:148 msgid "Initialization error with a message." msgstr "" -#: ../../c-api/init_config.rst:148 +#: ../../c-api/init_config.rst:150 msgid "*err_msg* must not be ``NULL``." msgstr "*err_msg* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:152 +#: ../../c-api/init_config.rst:154 msgid "Memory allocation failure (out of memory)." msgstr "" -#: ../../c-api/init_config.rst:156 +#: ../../c-api/init_config.rst:158 msgid "Exit Python with the specified exit code." msgstr "" -#: ../../c-api/init_config.rst:158 +#: ../../c-api/init_config.rst:160 msgid "Functions to handle a status:" msgstr "" -#: ../../c-api/init_config.rst:162 +#: ../../c-api/init_config.rst:164 msgid "" "Is the status an error or an exit? If true, the exception must be handled; " "by calling :c:func:`Py_ExitStatusException` for example." msgstr "" -#: ../../c-api/init_config.rst:167 +#: ../../c-api/init_config.rst:169 msgid "Is the result an error?" msgstr "" -#: ../../c-api/init_config.rst:171 +#: ../../c-api/init_config.rst:173 msgid "Is the result an exit?" msgstr "" -#: ../../c-api/init_config.rst:175 +#: ../../c-api/init_config.rst:177 msgid "" "Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " "exit with a non-zero exit code if *status* is an error. Must only be called " "if ``PyStatus_Exception(status)`` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:180 +#: ../../c-api/init_config.rst:182 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:183 +#: ../../c-api/init_config.rst:185 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/init_config.rst:207 +#: ../../c-api/init_config.rst:209 msgid "PyPreConfig" msgstr "PyPreConfig" -#: ../../c-api/init_config.rst:211 +#: ../../c-api/init_config.rst:213 msgid "Structure used to preinitialize Python." msgstr "" -#: ../../c-api/init_config.rst:213 +#: ../../c-api/init_config.rst:217 msgid "Function to initialize a preconfiguration:" msgstr "" -#: ../../c-api/init_config.rst:217 +#: ../../c-api/init_config.rst:221 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:222 +#: ../../c-api/init_config.rst:226 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:229 +#: ../../c-api/init_config.rst:235 msgid "Name of the Python memory allocators:" msgstr "" -#: ../../c-api/init_config.rst:231 +#: ../../c-api/init_config.rst:237 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" -#: ../../c-api/init_config.rst:233 +#: ../../c-api/init_config.rst:239 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" -#: ../../c-api/init_config.rst:235 +#: ../../c-api/init_config.rst:241 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:238 +#: ../../c-api/init_config.rst:244 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "" -#: ../../c-api/init_config.rst:239 +#: ../../c-api/init_config.rst:245 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:241 +#: ../../c-api/init_config.rst:247 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" -#: ../../c-api/init_config.rst:243 +#: ../../c-api/init_config.rst:249 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:247 +#: ../../c-api/init_config.rst:253 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:251 +#: ../../c-api/init_config.rst:257 msgid "See :ref:`Memory Management `." msgstr "請見\\ :ref:`記憶體管理 `\\ 。" -#: ../../c-api/init_config.rst:253 +#: ../../c-api/init_config.rst:259 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "預設:\\ ``PYMEM_ALLOCATOR_NOT_SET``\\ 。" -#: ../../c-api/init_config.rst:257 +#: ../../c-api/init_config.rst:263 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" -#: ../../c-api/init_config.rst:259 +#: ../../c-api/init_config.rst:265 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" -#: ../../c-api/init_config.rst:262 ../../c-api/init_config.rst:273 +#: ../../c-api/init_config.rst:268 ../../c-api/init_config.rst:279 msgid "See the :term:`locale encoding`." msgstr "請見 :term:`locale encoding`\\ 。" -#: ../../c-api/init_config.rst:264 ../../c-api/init_config.rst:319 -#: ../../c-api/init_config.rst:670 +#: ../../c-api/init_config.rst:270 ../../c-api/init_config.rst:325 +#: ../../c-api/init_config.rst:680 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:268 +#: ../../c-api/init_config.rst:274 msgid "If equals to ``2``, coerce the C locale." msgstr "" -#: ../../c-api/init_config.rst:270 +#: ../../c-api/init_config.rst:276 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" -#: ../../c-api/init_config.rst:275 ../../c-api/init_config.rst:281 +#: ../../c-api/init_config.rst:281 ../../c-api/init_config.rst:287 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:279 +#: ../../c-api/init_config.rst:285 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: ../../c-api/init_config.rst:285 +#: ../../c-api/init_config.rst:291 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -#: ../../c-api/init_config.rst:288 ../../c-api/init_config.rst:679 -#: ../../c-api/init_config.rst:721 ../../c-api/init_config.rst:1174 +#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:689 +#: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:1184 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:292 +#: ../../c-api/init_config.rst:298 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:866 +#: ../../c-api/init_config.rst:300 ../../c-api/init_config.rst:876 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:298 +#: ../../c-api/init_config.rst:304 msgid "If non-zero:" msgstr "如果不為 0:" -#: ../../c-api/init_config.rst:300 +#: ../../c-api/init_config.rst:306 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "將 :c:member:`PyPreConfig.utf8_mode` 設為 ``0``\\ 、" -#: ../../c-api/init_config.rst:301 +#: ../../c-api/init_config.rst:307 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "將 :c:member:`PyConfig.filesystem_encoding` 設為 ``\"mbcs\"``\\ 、" -#: ../../c-api/init_config.rst:302 +#: ../../c-api/init_config.rst:308 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "將 :c:member:`PyConfig.filesystem_errors` 設為 ``\"replace\"``\\ 。" -#: ../../c-api/init_config.rst:304 +#: ../../c-api/init_config.rst:310 msgid "" "Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:880 +#: ../../c-api/init_config.rst:313 ../../c-api/init_config.rst:890 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" -#: ../../c-api/init_config.rst:310 ../../c-api/init_config.rst:618 -#: ../../c-api/init_config.rst:625 ../../c-api/init_config.rst:692 -#: ../../c-api/init_config.rst:801 ../../c-api/init_config.rst:815 -#: ../../c-api/init_config.rst:829 ../../c-api/init_config.rst:883 -#: ../../c-api/init_config.rst:897 ../../c-api/init_config.rst:957 -#: ../../c-api/init_config.rst:1009 ../../c-api/init_config.rst:1069 -#: ../../c-api/init_config.rst:1109 ../../c-api/init_config.rst:1138 -#: ../../c-api/init_config.rst:1225 +#: ../../c-api/init_config.rst:316 ../../c-api/init_config.rst:628 +#: ../../c-api/init_config.rst:635 ../../c-api/init_config.rst:702 +#: ../../c-api/init_config.rst:811 ../../c-api/init_config.rst:825 +#: ../../c-api/init_config.rst:839 ../../c-api/init_config.rst:893 +#: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:967 +#: ../../c-api/init_config.rst:1019 ../../c-api/init_config.rst:1079 +#: ../../c-api/init_config.rst:1119 ../../c-api/init_config.rst:1148 +#: ../../c-api/init_config.rst:1235 msgid "Default: ``0``." msgstr "預設:\\ ``0``。" -#: ../../c-api/init_config.rst:314 +#: ../../c-api/init_config.rst:320 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" "`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " @@ -397,95 +397,95 @@ msgid "" "Arguments `." msgstr "" -#: ../../c-api/init_config.rst:323 +#: ../../c-api/init_config.rst:329 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:1199 +#: ../../c-api/init_config.rst:332 ../../c-api/init_config.rst:1209 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:330 +#: ../../c-api/init_config.rst:336 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:332 +#: ../../c-api/init_config.rst:338 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" -#: ../../c-api/init_config.rst:335 +#: ../../c-api/init_config.rst:341 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" -#: ../../c-api/init_config.rst:337 +#: ../../c-api/init_config.rst:343 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:343 +#: ../../c-api/init_config.rst:349 msgid "Preinitialize Python with PyPreConfig" msgstr "" -#: ../../c-api/init_config.rst:345 +#: ../../c-api/init_config.rst:351 msgid "The preinitialization of Python:" msgstr "" -#: ../../c-api/init_config.rst:347 +#: ../../c-api/init_config.rst:353 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" -#: ../../c-api/init_config.rst:348 +#: ../../c-api/init_config.rst:354 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" -#: ../../c-api/init_config.rst:349 +#: ../../c-api/init_config.rst:355 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" -#: ../../c-api/init_config.rst:352 +#: ../../c-api/init_config.rst:358 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -#: ../../c-api/init_config.rst:355 +#: ../../c-api/init_config.rst:361 msgid "Functions to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:359 ../../c-api/init_config.rst:365 -#: ../../c-api/init_config.rst:374 +#: ../../c-api/init_config.rst:365 ../../c-api/init_config.rst:371 +#: ../../c-api/init_config.rst:380 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: ../../c-api/init_config.rst:361 ../../c-api/init_config.rst:370 -#: ../../c-api/init_config.rst:379 +#: ../../c-api/init_config.rst:367 ../../c-api/init_config.rst:376 +#: ../../c-api/init_config.rst:385 msgid "*preconfig* must not be ``NULL``." msgstr "*preconfig* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:367 +#: ../../c-api/init_config.rst:373 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:376 +#: ../../c-api/init_config.rst:382 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:381 ../../c-api/init_config.rst:1287 +#: ../../c-api/init_config.rst:387 ../../c-api/init_config.rst:1297 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -#: ../../c-api/init_config.rst:384 +#: ../../c-api/init_config.rst:390 msgid "" "For :ref:`Python Configuration ` (:c:func:" "`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " @@ -495,7 +495,7 @@ msgid "" "`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:391 +#: ../../c-api/init_config.rst:397 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " @@ -503,7 +503,7 @@ msgid "" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: ../../c-api/init_config.rst:396 +#: ../../c-api/init_config.rst:402 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " @@ -511,90 +511,90 @@ msgid "" "not be called before the Python preinitialization." msgstr "" -#: ../../c-api/init_config.rst:401 +#: ../../c-api/init_config.rst:407 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" -#: ../../c-api/init_config.rst:423 +#: ../../c-api/init_config.rst:429 msgid "PyConfig" msgstr "PyConfig" -#: ../../c-api/init_config.rst:427 +#: ../../c-api/init_config.rst:433 msgid "Structure containing most parameters to configure Python." msgstr "" -#: ../../c-api/init_config.rst:429 +#: ../../c-api/init_config.rst:435 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" -#: ../../c-api/init_config.rst:432 +#: ../../c-api/init_config.rst:440 msgid "Structure methods:" msgstr "" -#: ../../c-api/init_config.rst:436 +#: ../../c-api/init_config.rst:444 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:441 +#: ../../c-api/init_config.rst:449 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:446 +#: ../../c-api/init_config.rst:454 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:448 ../../c-api/init_config.rst:455 -#: ../../c-api/init_config.rst:462 ../../c-api/init_config.rst:470 -#: ../../c-api/init_config.rst:476 ../../c-api/init_config.rst:493 +#: ../../c-api/init_config.rst:456 ../../c-api/init_config.rst:463 +#: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:478 +#: ../../c-api/init_config.rst:484 ../../c-api/init_config.rst:501 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" -#: ../../c-api/init_config.rst:452 +#: ../../c-api/init_config.rst:460 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:459 +#: ../../c-api/init_config.rst:467 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" -#: ../../c-api/init_config.rst:466 +#: ../../c-api/init_config.rst:474 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using :c:func:" "`Py_DecodeLocale`." msgstr "" -#: ../../c-api/init_config.rst:474 +#: ../../c-api/init_config.rst:482 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: ../../c-api/init_config.rst:480 +#: ../../c-api/init_config.rst:488 msgid "Read all Python configuration." msgstr "" -#: ../../c-api/init_config.rst:482 +#: ../../c-api/init_config.rst:490 msgid "Fields which are already initialized are left unchanged." msgstr "" -#: ../../c-api/init_config.rst:484 +#: ../../c-api/init_config.rst:492 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: ../../c-api/init_config.rst:487 ../../c-api/init_config.rst:986 +#: ../../c-api/init_config.rst:495 ../../c-api/init_config.rst:996 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -603,25 +603,25 @@ msgid "" "as Python options." msgstr "" -#: ../../c-api/init_config.rst:495 +#: ../../c-api/init_config.rst:503 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" "`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " "arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" -#: ../../c-api/init_config.rst:501 +#: ../../c-api/init_config.rst:509 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " "under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" -#: ../../c-api/init_config.rst:509 +#: ../../c-api/init_config.rst:517 msgid "Release configuration memory." msgstr "" -#: ../../c-api/init_config.rst:511 +#: ../../c-api/init_config.rst:519 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" @@ -630,436 +630,436 @@ msgid "" "before calling a :c:type:`PyConfig` method:" msgstr "" -#: ../../c-api/init_config.rst:517 +#: ../../c-api/init_config.rst:525 msgid ":c:member:`PyConfig.dev_mode`" msgstr ":c:member:`PyConfig.dev_mode`" -#: ../../c-api/init_config.rst:518 +#: ../../c-api/init_config.rst:526 msgid ":c:member:`PyConfig.isolated`" msgstr ":c:member:`PyConfig.isolated`" -#: ../../c-api/init_config.rst:519 +#: ../../c-api/init_config.rst:527 msgid ":c:member:`PyConfig.parse_argv`" msgstr ":c:member:`PyConfig.parse_argv`" -#: ../../c-api/init_config.rst:520 +#: ../../c-api/init_config.rst:528 msgid ":c:member:`PyConfig.use_environment`" msgstr ":c:member:`PyConfig.use_environment`" -#: ../../c-api/init_config.rst:522 +#: ../../c-api/init_config.rst:530 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " "preinitialization configuration depends on command line arguments (if :c:" -"member:`parse_argv` is non-zero)." +"member:`~PyConfig.parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:527 +#: ../../c-api/init_config.rst:535 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" -#: ../../c-api/init_config.rst:534 +#: ../../c-api/init_config.rst:544 msgid "Command line arguments: :data:`sys.argv`." msgstr "" -#: ../../c-api/init_config.rst:536 +#: ../../c-api/init_config.rst:546 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." "argv` the same way the regular Python parses Python command line arguments " "and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:541 +#: ../../c-api/init_config.rst:551 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" -#: ../../c-api/init_config.rst:544 ../../c-api/init_config.rst:571 -#: ../../c-api/init_config.rst:583 ../../c-api/init_config.rst:591 -#: ../../c-api/init_config.rst:699 ../../c-api/init_config.rst:708 -#: ../../c-api/init_config.rst:790 ../../c-api/init_config.rst:927 -#: ../../c-api/init_config.rst:1028 ../../c-api/init_config.rst:1046 -#: ../../c-api/init_config.rst:1060 ../../c-api/init_config.rst:1077 -#: ../../c-api/init_config.rst:1090 ../../c-api/init_config.rst:1098 +#: ../../c-api/init_config.rst:554 ../../c-api/init_config.rst:581 +#: ../../c-api/init_config.rst:593 ../../c-api/init_config.rst:601 +#: ../../c-api/init_config.rst:709 ../../c-api/init_config.rst:718 +#: ../../c-api/init_config.rst:800 ../../c-api/init_config.rst:937 +#: ../../c-api/init_config.rst:1038 ../../c-api/init_config.rst:1056 +#: ../../c-api/init_config.rst:1070 ../../c-api/init_config.rst:1087 +#: ../../c-api/init_config.rst:1100 ../../c-api/init_config.rst:1108 msgid "Default: ``NULL``." msgstr "預設值:\\ ``NULL``\\ 。" -#: ../../c-api/init_config.rst:546 +#: ../../c-api/init_config.rst:556 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:550 +#: ../../c-api/init_config.rst:560 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" -#: ../../c-api/init_config.rst:553 +#: ../../c-api/init_config.rst:563 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" -#: ../../c-api/init_config.rst:555 +#: ../../c-api/init_config.rst:565 msgid "" "If running a script (``python script.py``), prepend the script's directory. " "If it's a symbolic link, resolve symbolic links." msgstr "" -#: ../../c-api/init_config.rst:557 +#: ../../c-api/init_config.rst:567 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" -#: ../../c-api/init_config.rst:560 +#: ../../c-api/init_config.rst:570 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:563 +#: ../../c-api/init_config.rst:573 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:569 +#: ../../c-api/init_config.rst:579 msgid ":data:`sys.base_exec_prefix`." msgstr ":data:`sys.base_exec_prefix`\\ 。" -#: ../../c-api/init_config.rst:573 ../../c-api/init_config.rst:585 -#: ../../c-api/init_config.rst:593 ../../c-api/init_config.rst:701 -#: ../../c-api/init_config.rst:710 ../../c-api/init_config.rst:944 -#: ../../c-api/init_config.rst:1030 +#: ../../c-api/init_config.rst:583 ../../c-api/init_config.rst:595 +#: ../../c-api/init_config.rst:603 ../../c-api/init_config.rst:711 +#: ../../c-api/init_config.rst:720 ../../c-api/init_config.rst:954 +#: ../../c-api/init_config.rst:1040 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" -#: ../../c-api/init_config.rst:577 +#: ../../c-api/init_config.rst:587 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" -#: ../../c-api/init_config.rst:579 +#: ../../c-api/init_config.rst:589 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" -#: ../../c-api/init_config.rst:581 +#: ../../c-api/init_config.rst:591 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:589 +#: ../../c-api/init_config.rst:599 msgid ":data:`sys.base_prefix`." msgstr ":data:`sys.base_prefix`\\ 。" -#: ../../c-api/init_config.rst:597 +#: ../../c-api/init_config.rst:607 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:600 +#: ../../c-api/init_config.rst:610 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:603 +#: ../../c-api/init_config.rst:613 msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:605 ../../c-api/init_config.rst:638 -#: ../../c-api/init_config.rst:1126 ../../c-api/init_config.rst:1257 +#: ../../c-api/init_config.rst:615 ../../c-api/init_config.rst:648 +#: ../../c-api/init_config.rst:1136 ../../c-api/init_config.rst:1267 msgid "Default: ``1``." msgstr "預設值:\\ ``1``\\ 。" -#: ../../c-api/init_config.rst:609 +#: ../../c-api/init_config.rst:619 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" "`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" -#: ../../c-api/init_config.rst:613 +#: ../../c-api/init_config.rst:623 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" -#: ../../c-api/init_config.rst:616 +#: ../../c-api/init_config.rst:626 msgid "Incremented by the :option:`-b` command line option." msgstr "" -#: ../../c-api/init_config.rst:622 +#: ../../c-api/init_config.rst:632 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." "TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " "details." msgstr "" -#: ../../c-api/init_config.rst:631 +#: ../../c-api/init_config.rst:641 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" -#: ../../c-api/init_config.rst:635 +#: ../../c-api/init_config.rst:645 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:644 +#: ../../c-api/init_config.rst:654 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the :" "option:`--check-hash-based-pycs` command line option." msgstr "" -#: ../../c-api/init_config.rst:647 +#: ../../c-api/init_config.rst:657 msgid "Valid values:" msgstr "" -#: ../../c-api/init_config.rst:649 +#: ../../c-api/init_config.rst:659 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" -#: ../../c-api/init_config.rst:651 +#: ../../c-api/init_config.rst:661 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" -#: ../../c-api/init_config.rst:652 +#: ../../c-api/init_config.rst:662 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" -#: ../../c-api/init_config.rst:655 +#: ../../c-api/init_config.rst:665 msgid "Default: ``L\"default\"``." msgstr "預設:\\ ``L\"default\"``。" -#: ../../c-api/init_config.rst:657 +#: ../../c-api/init_config.rst:667 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" -#: ../../c-api/init_config.rst:661 +#: ../../c-api/init_config.rst:671 msgid "If non-zero, configure C standard streams:" msgstr "" -#: ../../c-api/init_config.rst:663 +#: ../../c-api/init_config.rst:673 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:665 +#: ../../c-api/init_config.rst:675 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" -#: ../../c-api/init_config.rst:667 +#: ../../c-api/init_config.rst:677 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " "stdin and stdout (only stdout on Windows)." msgstr "" -#: ../../c-api/init_config.rst:674 +#: ../../c-api/init_config.rst:684 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: ../../c-api/init_config.rst:676 +#: ../../c-api/init_config.rst:686 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:683 +#: ../../c-api/init_config.rst:693 msgid "Dump Python references?" msgstr "" -#: ../../c-api/init_config.rst:685 +#: ../../c-api/init_config.rst:695 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: ../../c-api/init_config.rst:687 +#: ../../c-api/init_config.rst:697 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:689 +#: ../../c-api/init_config.rst:699 msgid "" "Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: see " "the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" -#: ../../c-api/init_config.rst:696 +#: ../../c-api/init_config.rst:706 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" -#: ../../c-api/init_config.rst:705 +#: ../../c-api/init_config.rst:715 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" -#: ../../c-api/init_config.rst:714 +#: ../../c-api/init_config.rst:724 msgid "Enable faulthandler?" msgstr "" -#: ../../c-api/init_config.rst:716 +#: ../../c-api/init_config.rst:726 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" -#: ../../c-api/init_config.rst:718 +#: ../../c-api/init_config.rst:728 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" -#: ../../c-api/init_config.rst:725 +#: ../../c-api/init_config.rst:735 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" -#: ../../c-api/init_config.rst:728 +#: ../../c-api/init_config.rst:738 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:730 +#: ../../c-api/init_config.rst:740 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" "`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" "zero." msgstr "" -#: ../../c-api/init_config.rst:734 +#: ../../c-api/init_config.rst:744 msgid "Default encoding on other platforms:" msgstr "" -#: ../../c-api/init_config.rst:736 +#: ../../c-api/init_config.rst:746 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:737 +#: ../../c-api/init_config.rst:747 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " "encoding (usually Latin1)." msgstr "" -#: ../../c-api/init_config.rst:740 +#: ../../c-api/init_config.rst:750 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: ../../c-api/init_config.rst:741 +#: ../../c-api/init_config.rst:751 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: ../../c-api/init_config.rst:744 +#: ../../c-api/init_config.rst:754 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: ../../c-api/init_config.rst:747 +#: ../../c-api/init_config.rst:757 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" -#: ../../c-api/init_config.rst:751 +#: ../../c-api/init_config.rst:761 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:754 +#: ../../c-api/init_config.rst:764 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: ../../c-api/init_config.rst:758 +#: ../../c-api/init_config.rst:768 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:760 +#: ../../c-api/init_config.rst:770 msgid "Supported error handlers:" msgstr "" -#: ../../c-api/init_config.rst:762 +#: ../../c-api/init_config.rst:772 msgid "``\"strict\"``" msgstr "``\"strict\"``" -#: ../../c-api/init_config.rst:763 +#: ../../c-api/init_config.rst:773 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" -#: ../../c-api/init_config.rst:764 +#: ../../c-api/init_config.rst:774 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" -#: ../../c-api/init_config.rst:766 +#: ../../c-api/init_config.rst:776 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" -#: ../../c-api/init_config.rst:771 +#: ../../c-api/init_config.rst:781 msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:773 +#: ../../c-api/init_config.rst:783 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:776 +#: ../../c-api/init_config.rst:786 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:778 +#: ../../c-api/init_config.rst:788 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:783 +#: ../../c-api/init_config.rst:793 msgid "Python home directory." msgstr "" -#: ../../c-api/init_config.rst:785 +#: ../../c-api/init_config.rst:795 msgid "" "If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not " "``NULL``." msgstr "" -#: ../../c-api/init_config.rst:788 +#: ../../c-api/init_config.rst:798 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:792 ../../c-api/init_config.rst:909 -#: ../../c-api/init_config.rst:929 ../../c-api/init_config.rst:1018 -#: ../../c-api/init_config.rst:1048 +#: ../../c-api/init_config.rst:802 ../../c-api/init_config.rst:919 +#: ../../c-api/init_config.rst:939 ../../c-api/init_config.rst:1028 +#: ../../c-api/init_config.rst:1058 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: ../../c-api/init_config.rst:796 +#: ../../c-api/init_config.rst:806 msgid "If non-zero, profile import time." msgstr "" -#: ../../c-api/init_config.rst:798 +#: ../../c-api/init_config.rst:808 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:805 +#: ../../c-api/init_config.rst:815 msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: ../../c-api/init_config.rst:807 +#: ../../c-api/init_config.rst:817 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " @@ -1067,30 +1067,30 @@ msgid "" "a terminal." msgstr "" -#: ../../c-api/init_config.rst:812 +#: ../../c-api/init_config.rst:822 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: ../../c-api/init_config.rst:819 +#: ../../c-api/init_config.rst:829 msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:821 ../../c-api/init_config.rst:992 -#: ../../c-api/init_config.rst:1016 ../../c-api/init_config.rst:1209 +#: ../../c-api/init_config.rst:831 ../../c-api/init_config.rst:1002 +#: ../../c-api/init_config.rst:1026 ../../c-api/init_config.rst:1219 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:825 +#: ../../c-api/init_config.rst:835 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" -#: ../../c-api/init_config.rst:827 +#: ../../c-api/init_config.rst:837 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: ../../c-api/init_config.rst:833 +#: ../../c-api/init_config.rst:843 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " @@ -1100,30 +1100,30 @@ msgid "" "str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" -#: ../../c-api/init_config.rst:841 +#: ../../c-api/init_config.rst:851 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:844 +#: ../../c-api/init_config.rst:854 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:851 +#: ../../c-api/init_config.rst:861 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:853 +#: ../../c-api/init_config.rst:863 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" -#: ../../c-api/init_config.rst:857 +#: ../../c-api/init_config.rst:867 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." @@ -1131,76 +1131,77 @@ msgstr "" "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變" "數。" -#: ../../c-api/init_config.rst:859 +#: ../../c-api/init_config.rst:869 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:861 +#: ../../c-api/init_config.rst:871 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:864 +#: ../../c-api/init_config.rst:874 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: ../../c-api/init_config.rst:868 +#: ../../c-api/init_config.rst:878 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:873 +#: ../../c-api/init_config.rst:883 msgid "" -"If non-zero, use :class:`io.FileIO` instead of :class:`io.WindowsConsoleIO` " -"for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`." +"If non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." +"stderr`." msgstr "" -#: ../../c-api/init_config.rst:877 +#: ../../c-api/init_config.rst:887 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:885 +#: ../../c-api/init_config.rst:895 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:889 +#: ../../c-api/init_config.rst:899 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:892 +#: ../../c-api/init_config.rst:902 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:894 +#: ../../c-api/init_config.rst:904 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:901 +#: ../../c-api/init_config.rst:911 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:903 +#: ../../c-api/init_config.rst:913 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:905 +#: ../../c-api/init_config.rst:915 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:923 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -1208,21 +1209,21 @@ msgid "" "and virtual environments." msgstr "" -#: ../../c-api/init_config.rst:922 +#: ../../c-api/init_config.rst:932 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" -"data:`os.path.pathsep`)." +"data:`os.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:925 +#: ../../c-api/init_config.rst:935 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:934 +#: ../../c-api/init_config.rst:944 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:936 +#: ../../c-api/init_config.rst:946 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -1230,41 +1231,41 @@ msgid "" "to ``1``." msgstr "" -#: ../../c-api/init_config.rst:941 +#: ../../c-api/init_config.rst:951 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:948 +#: ../../c-api/init_config.rst:958 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:950 +#: ../../c-api/init_config.rst:960 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:951 +#: ../../c-api/init_config.rst:961 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:952 +#: ../../c-api/init_config.rst:962 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:954 +#: ../../c-api/init_config.rst:964 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:961 +#: ../../c-api/init_config.rst:971 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:964 +#: ../../c-api/init_config.rst:974 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1273,388 +1274,388 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:971 +#: ../../c-api/init_config.rst:981 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:974 ../../c-api/init_config.rst:1244 -#: ../../c-api/init_config.rst:1263 +#: ../../c-api/init_config.rst:984 ../../c-api/init_config.rst:1254 +#: ../../c-api/init_config.rst:1273 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:980 +#: ../../c-api/init_config.rst:990 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:982 +#: ../../c-api/init_config.rst:992 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:994 +#: ../../c-api/init_config.rst:1004 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1000 +#: ../../c-api/init_config.rst:1010 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:1003 +#: ../../c-api/init_config.rst:1013 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1006 +#: ../../c-api/init_config.rst:1016 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1013 +#: ../../c-api/init_config.rst:1023 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: ../../c-api/init_config.rst:1020 +#: ../../c-api/init_config.rst:1030 msgid "Now also applies on Windows." msgstr "" -#: ../../c-api/init_config.rst:1025 +#: ../../c-api/init_config.rst:1035 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:1034 +#: ../../c-api/init_config.rst:1044 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1037 +#: ../../c-api/init_config.rst:1047 msgid "If :func:`Py_SetProgramName` has been called, use its argument." msgstr "" -#: ../../c-api/init_config.rst:1038 +#: ../../c-api/init_config.rst:1048 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1039 +#: ../../c-api/init_config.rst:1049 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1041 +#: ../../c-api/init_config.rst:1051 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:1043 +#: ../../c-api/init_config.rst:1053 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:1052 +#: ../../c-api/init_config.rst:1062 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1055 +#: ../../c-api/init_config.rst:1065 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1058 +#: ../../c-api/init_config.rst:1068 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1064 +#: ../../c-api/init_config.rst:1074 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1067 +#: ../../c-api/init_config.rst:1077 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:1073 +#: ../../c-api/init_config.rst:1083 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:1075 ../../c-api/init_config.rst:1096 +#: ../../c-api/init_config.rst:1085 ../../c-api/init_config.rst:1106 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1081 +#: ../../c-api/init_config.rst:1091 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: ../../c-api/init_config.rst:1085 +#: ../../c-api/init_config.rst:1095 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: ../../c-api/init_config.rst:1088 +#: ../../c-api/init_config.rst:1098 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。" -#: ../../c-api/init_config.rst:1094 +#: ../../c-api/init_config.rst:1104 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1102 +#: ../../c-api/init_config.rst:1112 msgid "Show total reference count at exit?" msgstr "" -#: ../../c-api/init_config.rst:1104 +#: ../../c-api/init_config.rst:1114 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1106 +#: ../../c-api/init_config.rst:1116 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1113 +#: ../../c-api/init_config.rst:1123 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1115 +#: ../../c-api/init_config.rst:1125 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1118 +#: ../../c-api/init_config.rst:1128 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1121 +#: ../../c-api/init_config.rst:1131 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1123 +#: ../../c-api/init_config.rst:1133 msgid "" -":data:`sys.flags.no_site` is set to the inverted value of :c:member:" -"`~PyConfig.site_import`." +":data:`sys.flags.no_site ` is set to the inverted value of :c:" +"member:`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1130 +#: ../../c-api/init_config.rst:1140 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1133 +#: ../../c-api/init_config.rst:1143 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1136 +#: ../../c-api/init_config.rst:1146 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1143 +#: ../../c-api/init_config.rst:1153 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1147 +#: ../../c-api/init_config.rst:1157 msgid "" "If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " "and *errors* arguments if they are not ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:1150 +#: ../../c-api/init_config.rst:1160 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1153 +#: ../../c-api/init_config.rst:1163 msgid "Default encoding:" msgstr "" -#: ../../c-api/init_config.rst:1155 +#: ../../c-api/init_config.rst:1165 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1156 +#: ../../c-api/init_config.rst:1166 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: ../../c-api/init_config.rst:1158 +#: ../../c-api/init_config.rst:1168 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1160 +#: ../../c-api/init_config.rst:1170 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: ../../c-api/init_config.rst:1161 +#: ../../c-api/init_config.rst:1171 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1163 +#: ../../c-api/init_config.rst:1173 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1167 +#: ../../c-api/init_config.rst:1177 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1169 +#: ../../c-api/init_config.rst:1179 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1171 +#: ../../c-api/init_config.rst:1181 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1178 +#: ../../c-api/init_config.rst:1188 msgid "Enable compatibility mode with the perf profiler?" msgstr "" -#: ../../c-api/init_config.rst:1180 +#: ../../c-api/init_config.rst:1190 msgid "" "If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " "more information." msgstr "" -#: ../../c-api/init_config.rst:1183 +#: ../../c-api/init_config.rst:1193 msgid "" "Set by :option:`-X perf <-X>` command line option and by the :envvar:" "`PYTHONPERFSUPPORT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1186 +#: ../../c-api/init_config.rst:1196 msgid "Default: ``-1``." msgstr "預設值:``1``。" -#: ../../c-api/init_config.rst:1192 +#: ../../c-api/init_config.rst:1202 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1194 +#: ../../c-api/init_config.rst:1204 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1197 +#: ../../c-api/init_config.rst:1207 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1203 +#: ../../c-api/init_config.rst:1213 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1205 +#: ../../c-api/init_config.rst:1215 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1207 +#: ../../c-api/init_config.rst:1217 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1213 +#: ../../c-api/init_config.rst:1223 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1217 +#: ../../c-api/init_config.rst:1227 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1221 +#: ../../c-api/init_config.rst:1231 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1223 +#: ../../c-api/init_config.rst:1233 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1229 +#: ../../c-api/init_config.rst:1239 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1232 +#: ../../c-api/init_config.rst:1242 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1237 +#: ../../c-api/init_config.rst:1247 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1240 +#: ../../c-api/init_config.rst:1250 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1248 +#: ../../c-api/init_config.rst:1258 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1251 +#: ../../c-api/init_config.rst:1261 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1254 +#: ../../c-api/init_config.rst:1264 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1261 +#: ../../c-api/init_config.rst:1271 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1265 +#: ../../c-api/init_config.rst:1275 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1662,29 +1663,29 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1270 +#: ../../c-api/init_config.rst:1280 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1275 +#: ../../c-api/init_config.rst:1285 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1279 +#: ../../c-api/init_config.rst:1289 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1281 +#: ../../c-api/init_config.rst:1291 msgid "Function to initialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1295 msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:1290 +#: ../../c-api/init_config.rst:1300 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1693,17 +1694,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1297 +#: ../../c-api/init_config.rst:1307 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1300 +#: ../../c-api/init_config.rst:1310 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1328 +#: ../../c-api/init_config.rst:1338 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1712,18 +1713,18 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1391 +#: ../../c-api/init_config.rst:1401 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1393 +#: ../../c-api/init_config.rst:1403 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1398 +#: ../../c-api/init_config.rst:1408 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1731,115 +1732,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1403 +#: ../../c-api/init_config.rst:1413 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1411 +#: ../../c-api/init_config.rst:1421 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1423 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1417 +#: ../../c-api/init_config.rst:1427 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1420 +#: ../../c-api/init_config.rst:1430 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1429 +#: ../../c-api/init_config.rst:1439 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1431 +#: ../../c-api/init_config.rst:1441 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1433 +#: ../../c-api/init_config.rst:1443 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1435 +#: ../../c-api/init_config.rst:1445 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1436 +#: ../../c-api/init_config.rst:1446 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1437 +#: ../../c-api/init_config.rst:1447 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1438 +#: ../../c-api/init_config.rst:1448 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1439 +#: ../../c-api/init_config.rst:1449 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1440 +#: ../../c-api/init_config.rst:1450 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1451 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1443 +#: ../../c-api/init_config.rst:1453 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1444 +#: ../../c-api/init_config.rst:1454 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1448 +#: ../../c-api/init_config.rst:1458 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1450 +#: ../../c-api/init_config.rst:1460 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1451 +#: ../../c-api/init_config.rst:1461 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1452 +#: ../../c-api/init_config.rst:1462 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1453 +#: ../../c-api/init_config.rst:1463 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1454 +#: ../../c-api/init_config.rst:1464 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1455 +#: ../../c-api/init_config.rst:1465 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -1847,11 +1848,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1457 +#: ../../c-api/init_config.rst:1467 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1459 +#: ../../c-api/init_config.rst:1469 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1860,7 +1861,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1465 +#: ../../c-api/init_config.rst:1475 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1870,52 +1871,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1472 +#: ../../c-api/init_config.rst:1482 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1475 +#: ../../c-api/init_config.rst:1485 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1479 +#: ../../c-api/init_config.rst:1489 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1481 +#: ../../c-api/init_config.rst:1491 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1484 +#: ../../c-api/init_config.rst:1494 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1486 +#: ../../c-api/init_config.rst:1496 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1488 +#: ../../c-api/init_config.rst:1498 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1490 +#: ../../c-api/init_config.rst:1500 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1492 +#: ../../c-api/init_config.rst:1502 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -1924,170 +1925,170 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1498 +#: ../../c-api/init_config.rst:1508 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1500 +#: ../../c-api/init_config.rst:1510 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1501 +#: ../../c-api/init_config.rst:1511 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1512 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1504 +#: ../../c-api/init_config.rst:1514 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1506 +#: ../../c-api/init_config.rst:1516 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1507 +#: ../../c-api/init_config.rst:1517 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1518 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1519 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1521 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1526 msgid "Py_RunMain()" msgstr "Py_RunMain()" -#: ../../c-api/init_config.rst:1520 +#: ../../c-api/init_config.rst:1530 msgid "" "Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" "member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." "run_module`) specified on the command line or in the configuration." msgstr "" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1535 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:1527 +#: ../../c-api/init_config.rst:1537 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1540 msgid "" "See :ref:`Python Configuration ` for an example of " "customized Python always running in isolated mode using :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1536 +#: ../../c-api/init_config.rst:1546 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1540 +#: ../../c-api/init_config.rst:1550 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1542 +#: ../../c-api/init_config.rst:1552 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1546 +#: ../../c-api/init_config.rst:1556 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1548 +#: ../../c-api/init_config.rst:1558 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1551 +#: ../../c-api/init_config.rst:1561 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1553 +#: ../../c-api/init_config.rst:1563 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1554 +#: ../../c-api/init_config.rst:1564 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1555 +#: ../../c-api/init_config.rst:1565 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:1566 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1559 +#: ../../c-api/init_config.rst:1569 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1561 +#: ../../c-api/init_config.rst:1571 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1562 +#: ../../c-api/init_config.rst:1572 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1563 +#: ../../c-api/init_config.rst:1573 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1564 +#: ../../c-api/init_config.rst:1574 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1566 +#: ../../c-api/init_config.rst:1576 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1567 +#: ../../c-api/init_config.rst:1577 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1568 +#: ../../c-api/init_config.rst:1578 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1570 +#: ../../c-api/init_config.rst:1580 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1572 +#: ../../c-api/init_config.rst:1582 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1587 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1579 +#: ../../c-api/init_config.rst:1589 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2096,14 +2097,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1585 +#: ../../c-api/init_config.rst:1595 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1589 +#: ../../c-api/init_config.rst:1599 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2111,7 +2112,7 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1594 +#: ../../c-api/init_config.rst:1604 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" diff --git a/c-api/intro.po b/c-api/intro.po index 6aade09464..3434e5e689 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -847,12 +847,12 @@ msgstr "" #: ../../c-api/intro.rst:618 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 " +"the :c:func:`!sum_sequence` example above. It so happens that this example " "doesn't need to clean up any owned references when it detects an error. The " "following example function shows some error cleanup. First, to remind you " "why you like Python, we show the equivalent Python code::" msgstr "" -"上面的 :c:func:`sum_sequence` 範例展示了一個檢測例外並將其繼續傳遞的例子。碰" +"上面的 :c:func:`!sum_sequence` 範例展示了一個檢測例外並將其繼續傳遞的例子。碰" "巧這個例子在檢測到錯誤時不需要清理任何擁有的參照。以下範例函式展示了一些錯誤" "清理。首先,為了提醒你為什麼喜歡 Python,我們展示了等效的 Python 程式碼:\n" "\n" diff --git a/c-api/memory.po b/c-api/memory.po index 7688c51e7a..70ab0af2cf 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -178,8 +178,8 @@ msgstr "" msgid "" "The :ref:`default raw memory allocator ` uses the " "following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " -"and :c:func:`free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when requesting " -"zero bytes." +"and :c:func:`!free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when " +"requesting zero bytes." msgstr "" #: ../../c-api/memory.rst:146 ../../c-api/memory.rst:217 @@ -557,19 +557,19 @@ msgid "" "following fields:" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:649 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:649 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:651 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:651 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 msgid "user context passed as first argument" msgstr "" @@ -607,7 +607,7 @@ msgstr "" #: ../../c-api/memory.rst:425 msgid "" -"The :c:type:`PyMemAllocator` structure was renamed to :c:type:" +"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" "`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" @@ -615,98 +615,98 @@ msgstr "" msgid "Enum used to identify an allocator domain. Domains:" msgstr "" -#: ../../c-api/memory.rst:436 ../../c-api/memory.rst:445 -#: ../../c-api/memory.rst:454 +#: ../../c-api/memory.rst:438 ../../c-api/memory.rst:447 +#: ../../c-api/memory.rst:456 msgid "Functions:" msgstr "函式:" -#: ../../c-api/memory.rst:438 +#: ../../c-api/memory.rst:440 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/memory.rst:439 +#: ../../c-api/memory.rst:441 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/memory.rst:440 +#: ../../c-api/memory.rst:442 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/memory.rst:441 +#: ../../c-api/memory.rst:443 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/memory.rst:447 +#: ../../c-api/memory.rst:449 msgid ":c:func:`PyMem_Malloc`," msgstr ":c:func:`PyMem_Malloc`," -#: ../../c-api/memory.rst:448 +#: ../../c-api/memory.rst:450 msgid ":c:func:`PyMem_Realloc`" msgstr ":c:func:`PyMem_Realloc`" -#: ../../c-api/memory.rst:449 +#: ../../c-api/memory.rst:451 msgid ":c:func:`PyMem_Calloc`" msgstr ":c:func:`PyMem_Calloc`" -#: ../../c-api/memory.rst:450 +#: ../../c-api/memory.rst:452 msgid ":c:func:`PyMem_Free`" msgstr ":c:func:`PyMem_Free`" -#: ../../c-api/memory.rst:456 +#: ../../c-api/memory.rst:458 msgid ":c:func:`PyObject_Malloc`" msgstr ":c:func:`PyObject_Malloc`" -#: ../../c-api/memory.rst:457 +#: ../../c-api/memory.rst:459 msgid ":c:func:`PyObject_Realloc`" msgstr ":c:func:`PyObject_Realloc`" -#: ../../c-api/memory.rst:458 +#: ../../c-api/memory.rst:460 msgid ":c:func:`PyObject_Calloc`" msgstr ":c:func:`PyObject_Calloc`" -#: ../../c-api/memory.rst:459 +#: ../../c-api/memory.rst:461 msgid ":c:func:`PyObject_Free`" msgstr ":c:func:`PyObject_Free`" -#: ../../c-api/memory.rst:463 +#: ../../c-api/memory.rst:465 msgid "Get the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:468 +#: ../../c-api/memory.rst:470 msgid "Set the memory block allocator of the specified domain." msgstr "" -#: ../../c-api/memory.rst:470 +#: ../../c-api/memory.rst:472 msgid "" "The new allocator must return a distinct non-``NULL`` pointer when " "requesting zero bytes." msgstr "" -#: ../../c-api/memory.rst:473 +#: ../../c-api/memory.rst:475 msgid "" "For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" "safe: the :term:`GIL ` is not held when the " "allocator is called." msgstr "" -#: ../../c-api/memory.rst:477 +#: ../../c-api/memory.rst:479 msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " "debug hooks on top on the new allocator." msgstr "" -#: ../../c-api/memory.rst:481 +#: ../../c-api/memory.rst:483 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: ../../c-api/memory.rst:486 +#: ../../c-api/memory.rst:488 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: ../../c-api/memory.rst:488 +#: ../../c-api/memory.rst:490 msgid "" "It can be called after :c:func:`Py_PreInitialize` and before :c:func:" "`Py_InitializeFromConfig` to install a custom memory allocator. There are no " @@ -716,7 +716,7 @@ msgid "" "domains>` for more information." msgstr "" -#: ../../c-api/memory.rst:496 +#: ../../c-api/memory.rst:498 msgid "" "If called after Python has finish initializing (after :c:func:" "`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " @@ -724,17 +724,17 @@ msgid "" "arbitrary one is **not supported**." msgstr "" -#: ../../c-api/memory.rst:505 +#: ../../c-api/memory.rst:507 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:512 +#: ../../c-api/memory.rst:514 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: ../../c-api/memory.rst:514 +#: ../../c-api/memory.rst:516 msgid "" "When :ref:`Python is built in debug mode `, the :c:func:" "`PyMem_SetupDebugHooks` function is called at the :ref:`Python " @@ -742,19 +742,19 @@ msgid "" "allocators to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:519 +#: ../../c-api/memory.rst:521 msgid "" "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " "hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" -#: ../../c-api/memory.rst:522 +#: ../../c-api/memory.rst:524 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " "after calling :c:func:`PyMem_SetAllocator`." msgstr "" -#: ../../c-api/memory.rst:525 +#: ../../c-api/memory.rst:527 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -764,25 +764,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: ../../c-api/memory.rst:532 +#: ../../c-api/memory.rst:534 msgid "Runtime checks:" msgstr "" -#: ../../c-api/memory.rst:534 +#: ../../c-api/memory.rst:536 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:536 +#: ../../c-api/memory.rst:538 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: ../../c-api/memory.rst:537 +#: ../../c-api/memory.rst:539 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: ../../c-api/memory.rst:538 +#: ../../c-api/memory.rst:540 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -790,7 +790,7 @@ msgid "" "called." msgstr "" -#: ../../c-api/memory.rst:543 +#: ../../c-api/memory.rst:545 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -798,7 +798,7 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:548 +#: ../../c-api/memory.rst:550 msgid "" "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " "block of *N* bytes requested. The memory layout is like so, where p " @@ -808,49 +808,49 @@ msgid "" "from a Python slice):" msgstr "" -#: ../../c-api/memory.rst:555 +#: ../../c-api/memory.rst:557 msgid "``p[-2*S:-S]``" msgstr "``p[-2*S:-S]``" -#: ../../c-api/memory.rst:555 +#: ../../c-api/memory.rst:557 msgid "" "Number of bytes originally asked for. This is a size_t, big-endian (easier " "to read in a memory dump)." msgstr "" -#: ../../c-api/memory.rst:562 +#: ../../c-api/memory.rst:564 msgid "``p[-S]``" msgstr "``p[-S]``" -#: ../../c-api/memory.rst:558 +#: ../../c-api/memory.rst:560 msgid "API identifier (ASCII character):" msgstr "" -#: ../../c-api/memory.rst:560 +#: ../../c-api/memory.rst:562 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: ../../c-api/memory.rst:561 +#: ../../c-api/memory.rst:563 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: ../../c-api/memory.rst:562 +#: ../../c-api/memory.rst:564 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: ../../c-api/memory.rst:565 +#: ../../c-api/memory.rst:567 msgid "``p[-S+1:0]``" msgstr "``p[-S+1:0]``" -#: ../../c-api/memory.rst:565 +#: ../../c-api/memory.rst:567 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: ../../c-api/memory.rst:574 +#: ../../c-api/memory.rst:576 msgid "``p[0:N]``" msgstr "``p[0:N]``" -#: ../../c-api/memory.rst:568 +#: ../../c-api/memory.rst:570 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -861,25 +861,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: ../../c-api/memory.rst:577 +#: ../../c-api/memory.rst:579 msgid "``p[N:N+S]``" msgstr "``p[N:N+S]``" -#: ../../c-api/memory.rst:577 +#: ../../c-api/memory.rst:579 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: ../../c-api/memory.rst:588 +#: ../../c-api/memory.rst:590 msgid "``p[N+S:N+2*S]``" msgstr "``p[N+S:N+2*S]``" -#: ../../c-api/memory.rst:580 +#: ../../c-api/memory.rst:582 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: ../../c-api/memory.rst:583 +#: ../../c-api/memory.rst:585 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" "like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " @@ -889,7 +889,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: ../../c-api/memory.rst:590 +#: ../../c-api/memory.rst:592 msgid "" "A realloc-like or free-like function first checks that the " "PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " @@ -902,7 +902,7 @@ msgid "" "getting used)." msgstr "" -#: ../../c-api/memory.rst:599 +#: ../../c-api/memory.rst:601 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" @@ -911,7 +911,7 @@ msgid "" "`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: ../../c-api/memory.rst:607 +#: ../../c-api/memory.rst:609 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -919,11 +919,11 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:617 +#: ../../c-api/memory.rst:619 msgid "The pymalloc allocator" msgstr "" -#: ../../c-api/memory.rst:619 +#: ../../c-api/memory.rst:621 msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " @@ -932,114 +932,114 @@ msgid "" "512 bytes." msgstr "" -#: ../../c-api/memory.rst:624 +#: ../../c-api/memory.rst:626 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:628 +#: ../../c-api/memory.rst:630 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:630 -msgid ":c:func:`VirtualAlloc` and :c:func:`VirtualFree` on Windows," +#: ../../c-api/memory.rst:632 +msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:631 -msgid ":c:func:`mmap` and :c:func:`munmap` if available," +#: ../../c-api/memory.rst:633 +msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:634 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:634 +#: ../../c-api/memory.rst:636 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:641 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:645 +#: ../../c-api/memory.rst:647 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:655 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:655 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:657 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:657 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:660 +#: ../../c-api/memory.rst:662 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:664 +#: ../../c-api/memory.rst:666 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:668 +#: ../../c-api/memory.rst:670 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:674 +#: ../../c-api/memory.rst:676 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:678 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:679 +#: ../../c-api/memory.rst:681 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:683 +#: ../../c-api/memory.rst:685 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:686 +#: ../../c-api/memory.rst:688 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:692 +#: ../../c-api/memory.rst:694 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:696 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:707 +#: ../../c-api/memory.rst:709 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:719 +#: ../../c-api/memory.rst:721 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1049,14 +1049,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:734 +#: ../../c-api/memory.rst:736 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " -"Python heap, objects in Python are allocated and released with :c:func:" -"`PyObject_New`, :c:func:`PyObject_NewVar` and :c:func:`PyObject_Del`." +"Python heap, objects in Python are allocated and released with :c:macro:" +"`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:738 +#: ../../c-api/memory.rst:740 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/module.po b/c-api/module.po index 751c9c7f8c..bfca4455de 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -117,7 +117,7 @@ msgstr "" #: ../../c-api/module.rst:121 msgid "" -":c:func:`PyModule_GetFilename` raises :c:type:`UnicodeEncodeError` on " +":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" @@ -171,8 +171,8 @@ msgstr "" #: ../../c-api/module.rst:165 msgid "" "This memory area is allocated based on *m_size* on module creation, and " -"freed when the module object is deallocated, after the :c:member:`m_free` " -"function has been called, if present." +"freed when the module object is deallocated, after the :c:member:" +"`~PyModuleDef.m_free` function has been called, if present." msgstr "" #: ../../c-api/module.rst:169 @@ -224,9 +224,9 @@ msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " "before the module is executed (:c:data:`Py_mod_exec` function). More " -"precisely, this function is not called if :c:member:`m_size` is greater than " -"0 and the module state (as returned by :c:func:`PyModule_GetState`) is " -"``NULL``." +"precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is " +"greater than 0 and the module state (as returned by :c:func:" +"`PyModule_GetState`) is ``NULL``." msgstr "" #: ../../c-api/module.rst:209 ../../c-api/module.rst:230 @@ -303,8 +303,8 @@ msgid "" "initialization\". Extension modules created this way behave more like Python " "modules: the initialization is split between the *creation phase*, when the " "module object is created, and the *execution phase*, when it is populated. " -"The distinction is similar to the :py:meth:`__new__` and :py:meth:`__init__` " -"methods of classes." +"The distinction is similar to the :py:meth:`!__new__` and :py:meth:`!" +"__init__` methods of classes." msgstr "" #: ../../c-api/module.rst:288 @@ -316,8 +316,8 @@ msgid "" "modules created from the same definition should be independent: changes to " "one should not affect the others. This means that all state should be " "specific to the module object (using e.g. using :c:func:" -"`PyModule_GetState`), or its contents (such as the module's :attr:`__dict__` " -"or individual classes created with :c:func:`PyType_FromSpec`)." +"`PyModule_GetState`), or its contents (such as the module's :attr:`~object." +"__dict__` or individual classes created with :c:func:`PyType_FromSpec`)." msgstr "" #: ../../c-api/module.rst:298 diff --git a/c-api/none.po b/c-api/none.po index 9f532a2634..a4dc2654ef 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -27,8 +27,8 @@ msgstr "``None`` 物件" msgid "" "Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in " "the Python/C API. Since ``None`` is a singleton, testing for object " -"identity (using ``==`` in C) is sufficient. There is no :c:func:" -"`PyNone_Check` function for the same reason." +"identity (using ``==`` in C) is sufficient. There is no :c:func:`!" +"PyNone_Check` function for the same reason." msgstr "" #: ../../c-api/none.rst:18 diff --git a/c-api/object.po b/c-api/object.po index 1e23b76317..9c7f786d81 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -271,7 +271,7 @@ msgstr "" msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " -"a :attr:`__bases__` attribute (which must be a tuple of base classes)." +"a :attr:`~class.__bases__` attribute (which must be a tuple of base classes)." msgstr "" #: ../../c-api/object.rst:264 @@ -290,14 +290,14 @@ msgstr "" #: ../../c-api/object.rst:275 msgid "" "An instance *inst* can override what is considered its class by having a :" -"attr:`__class__` attribute." +"attr:`~instance.__class__` attribute." msgstr "" #: ../../c-api/object.rst:278 msgid "" "An object *cls* can override if it is considered a class, and what its base " -"classes are, by having a :attr:`__bases__` attribute (which must be a tuple " -"of base classes)." +"classes are, by having a :attr:`~class.__bases__` attribute (which must be a " +"tuple of base classes)." msgstr "" #: ../../c-api/object.rst:287 diff --git a/c-api/set.po b/c-api/set.po index eecf572d6e..b347ab2d3b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -128,8 +128,8 @@ msgstr "" #: ../../c-api/set.rst:112 msgid "" "Return the length of a :class:`set` or :class:`frozenset` object. Equivalent " -"to ``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a :" -"class:`set`, :class:`frozenset`, or an instance of a subtype." +"to ``len(anyset)``. Raises a :exc:`SystemError` if *anyset* is not a :class:" +"`set`, :class:`frozenset`, or an instance of a subtype." msgstr "" #: ../../c-api/set.rst:119 @@ -139,11 +139,11 @@ msgstr "" #: ../../c-api/set.rst:124 msgid "" "Return ``1`` if found, ``0`` if not found, and ``-1`` if an error is " -"encountered. Unlike the Python :meth:`__contains__` method, this function " -"does not automatically convert unhashable sets into temporary frozensets. " -"Raise a :exc:`TypeError` if the *key* is unhashable. Raise :exc:" -"`PyExc_SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, " -"or an instance of a subtype." +"encountered. Unlike the Python :meth:`~object.__contains__` method, this " +"function does not automatically convert unhashable sets into temporary " +"frozensets. Raise a :exc:`TypeError` if the *key* is unhashable. Raise :exc:" +"`SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, or an " +"instance of a subtype." msgstr "" #: ../../c-api/set.rst:133 @@ -169,9 +169,8 @@ msgid "" "``-1`` if an error is encountered. Does not raise :exc:`KeyError` for " "missing keys. Raise a :exc:`TypeError` if the *key* is unhashable. Unlike " "the Python :meth:`~set.discard` method, this function does not automatically " -"convert unhashable sets into temporary frozensets. Raise :exc:" -"`PyExc_SystemError` if *set* is not an instance of :class:`set` or its " -"subtype." +"convert unhashable sets into temporary frozensets. Raise :exc:`SystemError` " +"if *set* is not an instance of :class:`set` or its subtype." msgstr "" #: ../../c-api/set.rst:158 diff --git a/c-api/structures.po b/c-api/structures.po index df5d611176..5eb3082c9e 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -58,11 +58,11 @@ msgstr "" #: ../../c-api/structures.rst:38 msgid "" -"This is an extension of :c:type:`PyObject` that adds the :attr:`ob_size` " -"field. This is only used for objects that have some notion of *length*. " -"This type does not often appear in the Python/C API. Access to the members " -"must be done by using the macros :c:macro:`Py_REFCNT`, :c:macro:`Py_TYPE`, " -"and :c:macro:`Py_SIZE`." +"This is an extension of :c:type:`PyObject` that adds the :c:member:" +"`~PyVarObject.ob_size` field. This is only used for objects that have some " +"notion of *length*. This type does not often appear in the Python/C API. " +"Access to the members must be done by using the macros :c:macro:" +"`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`." msgstr "" #: ../../c-api/structures.rst:47 @@ -164,8 +164,8 @@ msgstr "" #: ../../c-api/structures.rst:154 msgid "" "This is a macro which expands to initialization values for a new :c:type:" -"`PyVarObject` type, including the :attr:`ob_size` field. This macro expands " -"to::" +"`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. " +"This macro expands to::" msgstr "" #: ../../c-api/structures.rst:163 @@ -220,43 +220,43 @@ msgid "" msgstr "" #: ../../c-api/structures.rst:233 -msgid "name of the method" +msgid "Name of the method." msgstr "" #: ../../c-api/structures.rst:237 -msgid "pointer to the C implementation" +msgid "Pointer to the C implementation." msgstr "" #: ../../c-api/structures.rst:241 -msgid "flags bits indicating how the call should be constructed" +msgid "Flags bits indicating how the call should be constructed." msgstr "" #: ../../c-api/structures.rst:245 -msgid "points to the contents of the docstring" +msgid "Points to the contents of the docstring." msgstr "" #: ../../c-api/structures.rst:247 msgid "" -"The :c:member:`ml_meth` is a C function pointer. The functions may be of " -"different types, but they always return :c:expr:`PyObject*`. If the " -"function is not of the :c:type:`PyCFunction`, the compiler will require a " -"cast in the method table. Even though :c:type:`PyCFunction` defines the " +"The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions " +"may be of different types, but they always return :c:expr:`PyObject*`. If " +"the function is not of the :c:type:`PyCFunction`, the compiler will require " +"a cast in the method table. Even though :c:type:`PyCFunction` defines the " "first parameter as :c:expr:`PyObject*`, it is common that the method " "implementation uses the specific C type of the *self* object." msgstr "" -#: ../../c-api/structures.rst:254 +#: ../../c-api/structures.rst:255 msgid "" -"The :c:member:`ml_flags` field is a bitfield which can include the following " -"flags. The individual flags indicate either a calling convention or a " -"binding convention." +"The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include " +"the following flags. The individual flags indicate either a calling " +"convention or a binding convention." msgstr "" -#: ../../c-api/structures.rst:258 +#: ../../c-api/structures.rst:260 msgid "There are these calling conventions:" msgstr "" -#: ../../c-api/structures.rst:262 +#: ../../c-api/structures.rst:264 msgid "" "This is the typical calling convention, where the methods have the type :c:" "type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " @@ -266,7 +266,7 @@ msgid "" "func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" -#: ../../c-api/structures.rst:272 +#: ../../c-api/structures.rst:274 msgid "" "Can only be used in certain combinations with other flags: :ref:" "`METH_VARARGS | METH_KEYWORDS `, :ref:" @@ -275,11 +275,11 @@ msgid "" "METH_KEYWORDS>`." msgstr "" -#: ../../c-api/structures.rst:286 +#: ../../c-api/structures.rst:288 msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" msgstr "" -#: ../../c-api/structures.rst:281 +#: ../../c-api/structures.rst:283 msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " @@ -288,7 +288,7 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:290 +#: ../../c-api/structures.rst:292 msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " @@ -297,15 +297,15 @@ msgid "" "the array)." msgstr "" -#: ../../c-api/structures.rst:300 +#: ../../c-api/structures.rst:302 msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." msgstr "" -#: ../../c-api/structures.rst:317 +#: ../../c-api/structures.rst:319 msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" msgstr "" -#: ../../c-api/structures.rst:306 +#: ../../c-api/structures.rst:308 msgid "" "Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " "with methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword " @@ -317,17 +317,17 @@ msgid "" "the positional arguments." msgstr "" -#: ../../c-api/structures.rst:321 +#: ../../c-api/structures.rst:323 msgid "" "Can only be used in the combination with other flags: :ref:`METH_METHOD | " "METH_FASTCALL | METH_KEYWORDS `." msgstr "" -#: ../../c-api/structures.rst:338 +#: ../../c-api/structures.rst:340 msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" msgstr "" -#: ../../c-api/structures.rst:328 +#: ../../c-api/structures.rst:330 msgid "" "Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " @@ -335,14 +335,14 @@ msgid "" "``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:333 +#: ../../c-api/structures.rst:335 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:342 +#: ../../c-api/structures.rst:344 msgid "" "Methods without parameters don't need to check whether arguments are given " "if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of " @@ -351,13 +351,13 @@ msgid "" "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:348 +#: ../../c-api/structures.rst:350 msgid "" "The function must have 2 parameters. Since the second parameter is unused, :" "c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" -#: ../../c-api/structures.rst:354 +#: ../../c-api/structures.rst:356 msgid "" "Methods with a single object argument can be listed with the :c:macro:" "`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " @@ -366,7 +366,7 @@ msgid "" "single argument." msgstr "" -#: ../../c-api/structures.rst:360 +#: ../../c-api/structures.rst:362 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -374,90 +374,90 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:370 +#: ../../c-api/structures.rst:372 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:380 +#: ../../c-api/structures.rst:382 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:384 +#: ../../c-api/structures.rst:386 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:390 +#: ../../c-api/structures.rst:392 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " "wrappers are loaded before the method table, the existence of a " "*sq_contains* slot, for example, would generate a wrapped method named :meth:" -"`__contains__` and preclude the loading of a corresponding PyCFunction with " -"the same name. With the flag defined, the PyCFunction will be loaded in " -"place of the wrapper object and will co-exist with the slot. This is " -"helpful because calls to PyCFunctions are optimized more than wrapper object " -"calls." +"`~object.__contains__` and preclude the loading of a corresponding " +"PyCFunction with the same name. With the flag defined, the PyCFunction will " +"be loaded in place of the wrapper object and will co-exist with the slot. " +"This is helpful because calls to PyCFunctions are optimized more than " +"wrapper object calls." msgstr "" -#: ../../c-api/structures.rst:402 +#: ../../c-api/structures.rst:404 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:406 +#: ../../c-api/structures.rst:408 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. Its fields are, in order:" msgstr "" -#: ../../c-api/structures.rst:411 +#: ../../c-api/structures.rst:413 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:414 +#: ../../c-api/structures.rst:416 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:418 +#: ../../c-api/structures.rst:420 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:422 +#: ../../c-api/structures.rst:424 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:427 +#: ../../c-api/structures.rst:429 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:431 +#: ../../c-api/structures.rst:433 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:435 +#: ../../c-api/structures.rst:437 msgid "" -"By default (when :c:member:`flags` is ``0``), members allow both read and " -"write access. Use the :c:macro:`Py_READONLY` flag for read-only access. " -"Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:`Py_READONLY`. " -"Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:`T_OBJECT`) members can " -"be deleted." +"By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " +"both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" +"only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:" +"`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:" +"`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:444 +#: ../../c-api/structures.rst:446 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -466,11 +466,11 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:456 +#: ../../c-api/structures.rst:458 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:458 +#: ../../c-api/structures.rst:460 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " @@ -479,77 +479,77 @@ msgid "" "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:466 +#: ../../c-api/structures.rst:468 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:471 +#: ../../c-api/structures.rst:473 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:477 +#: ../../c-api/structures.rst:479 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:482 +#: ../../c-api/structures.rst:484 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:488 +#: ../../c-api/structures.rst:490 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:494 +#: ../../c-api/structures.rst:496 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:496 +#: ../../c-api/structures.rst:498 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:500 +#: ../../c-api/structures.rst:502 msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:504 +#: ../../c-api/structures.rst:506 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:509 +#: ../../c-api/structures.rst:511 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:513 +#: ../../c-api/structures.rst:515 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " -"negative :c:member:`~PyTypeDef.basicsize`. It is mandatory in that case." +"negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:520 msgid "" "This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:530 +#: ../../c-api/structures.rst:532 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -558,7 +558,7 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:541 +#: ../../c-api/structures.rst:543 msgid "" "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" "macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " @@ -567,11 +567,11 @@ msgid "" "names." msgstr "" -#: ../../c-api/structures.rst:550 +#: ../../c-api/structures.rst:552 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:552 +#: ../../c-api/structures.rst:554 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -580,147 +580,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:560 +#: ../../c-api/structures.rst:562 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:564 +#: ../../c-api/structures.rst:566 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:564 +#: ../../c-api/structures.rst:566 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:564 +#: ../../c-api/structures.rst:566 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:568 msgid ":c:expr:`char`" msgstr "" -#: ../../c-api/structures.rst:566 ../../c-api/structures.rst:567 #: ../../c-api/structures.rst:568 ../../c-api/structures.rst:569 #: ../../c-api/structures.rst:570 ../../c-api/structures.rst:571 #: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 #: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:576 ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:578 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:567 +#: ../../c-api/structures.rst:569 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:568 +#: ../../c-api/structures.rst:570 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:571 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:572 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:571 +#: ../../c-api/structures.rst:573 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:574 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:575 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:576 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:577 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:578 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:579 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:577 ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:579 ../../c-api/structures.rst:580 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:580 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:581 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:581 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:583 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:581 ../../c-api/structures.rst:582 +#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:582 +#: ../../c-api/structures.rst:584 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:585 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:585 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:586 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:586 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:587 +#: ../../c-api/structures.rst:589 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:592 +#: ../../c-api/structures.rst:594 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:594 +#: ../../c-api/structures.rst:596 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:596 +#: ../../c-api/structures.rst:598 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:622 +#: ../../c-api/structures.rst:624 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -728,174 +728,174 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:630 +#: ../../c-api/structures.rst:632 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:636 +#: ../../c-api/structures.rst:638 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:639 +#: ../../c-api/structures.rst:641 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:643 +#: ../../c-api/structures.rst:645 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:648 +#: ../../c-api/structures.rst:650 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:652 +#: ../../c-api/structures.rst:654 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:656 +#: ../../c-api/structures.rst:658 msgid "" "Optional C function to set or delete the attribute, if omitted the attribute " "is readonly." msgstr "" -#: ../../c-api/structures.rst:660 +#: ../../c-api/structures.rst:662 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:664 +#: ../../c-api/structures.rst:666 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:668 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:671 +#: ../../c-api/structures.rst:673 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:674 +#: ../../c-api/structures.rst:676 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:679 +#: ../../c-api/structures.rst:681 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" -#: ../../c-api/structures.rst:368 ../../c-api/structures.rst:378 +#: ../../c-api/structures.rst:370 ../../c-api/structures.rst:380 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/structures.rst:368 +#: ../../c-api/structures.rst:370 msgid "classmethod" msgstr "classmethod" -#: ../../c-api/structures.rst:378 +#: ../../c-api/structures.rst:380 msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:525 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:525 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:525 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:536 +#: ../../c-api/structures.rst:538 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:599 +#: ../../c-api/structures.rst:601 msgid "structmember.h" msgstr "structmember.h" diff --git a/c-api/sys.po b/c-api/sys.po index 32c959133e..c047265062 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -210,8 +210,8 @@ msgstr "" #: ../../c-api/sys.rst:168 msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:member:`PyConfig." -"legacy_windows_fs_encoding` is zero;" +"The function now uses the UTF-8 encoding on Windows if :c:member:" +"`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" #: ../../c-api/sys.rst:175 @@ -249,8 +249,8 @@ msgstr "" #: ../../c-api/sys.rst:210 msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:member:`PyConfig." -"legacy_windows_fs_encoding` is zero." +"The function now uses the UTF-8 encoding on Windows if :c:member:" +"`PyPreConfig.legacy_windows_fs_encoding` is zero." msgstr "" #: ../../c-api/sys.rst:218 @@ -484,7 +484,7 @@ msgid "" "This function should only be invoked when a condition is detected that would " "make it dangerous to continue using the Python interpreter; e.g., when the " "object administration appears to be corrupted. On Unix, the standard C " -"library function :c:func:`abort` is called which will attempt to produce a :" +"library function :c:func:`!abort` is called which will attempt to produce a :" "file:`core` file." msgstr "" diff --git a/c-api/tuple.po b/c-api/tuple.po index 6078edfe92..9e7803170e 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-28 00:03+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-" @@ -21,7 +21,7 @@ msgstr "" #: ../../c-api/tuple.rst:6 msgid "Tuple Objects" -msgstr "元組(Tuple)物件" +msgstr "Tuple(元組)物件" #: ../../c-api/tuple.rst:13 msgid "This subtype of :c:type:`PyObject` represents a Python tuple object." @@ -126,11 +126,11 @@ msgid "" "`SystemError`." msgstr "" -#: ../../c-api/tuple.rst:115 +#: ../../c-api/tuple.rst:117 msgid "Struct Sequence Objects" msgstr "" -#: ../../c-api/tuple.rst:117 +#: ../../c-api/tuple.rst:119 msgid "" "Struct sequence objects are the C equivalent of :func:`~collections." "namedtuple` objects, i.e. a sequence whose items can also be accessed " @@ -138,138 +138,98 @@ msgid "" "specific struct sequence type." msgstr "" -#: ../../c-api/tuple.rst:124 +#: ../../c-api/tuple.rst:126 msgid "" "Create a new struct sequence type from the data in *desc*, described below. " "Instances of the resulting type can be created with :c:func:" "`PyStructSequence_New`." msgstr "" -#: ../../c-api/tuple.rst:130 +#: ../../c-api/tuple.rst:132 msgid "Initializes a struct sequence type *type* from *desc* in place." msgstr "" -#: ../../c-api/tuple.rst:135 +#: ../../c-api/tuple.rst:137 msgid "" "The same as ``PyStructSequence_InitType``, but returns ``0`` on success and " "``-1`` on failure." msgstr "" -#: ../../c-api/tuple.rst:143 +#: ../../c-api/tuple.rst:145 msgid "Contains the meta information of a struct sequence type to create." msgstr "" -#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 -msgid "Field" -msgstr "" - -#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 -msgid "C Type" -msgstr "C Type" - -#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 -msgid "Meaning" -msgstr "" - -#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:171 -msgid "``name``" -msgstr "``name``" - -#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:150 -#: ../../c-api/tuple.rst:171 ../../c-api/tuple.rst:176 -msgid "``const char *``" -msgstr "``const char *``" - -#: ../../c-api/tuple.rst:148 -msgid "name of the struct sequence type" -msgstr "" - -#: ../../c-api/tuple.rst:150 ../../c-api/tuple.rst:176 -msgid "``doc``" -msgstr "``doc``" - -#: ../../c-api/tuple.rst:150 -msgid "pointer to docstring for the type or ``NULL`` to omit" +#: ../../c-api/tuple.rst:149 +msgid "Name of the struct sequence type." msgstr "" #: ../../c-api/tuple.rst:153 -msgid "``fields``" -msgstr "``fields``" - -#: ../../c-api/tuple.rst:153 -msgid "``PyStructSequence_Field *``" -msgstr "``PyStructSequence_Field *``" - -#: ../../c-api/tuple.rst:153 -msgid "pointer to ``NULL``-terminated array with field names of the new type" +msgid "Pointer to docstring for the type or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:156 -msgid "``n_in_sequence``" -msgstr "``n_in_sequence``" - -#: ../../c-api/tuple.rst:156 -msgid "``int``" -msgstr "``int``" +#: ../../c-api/tuple.rst:157 +msgid "Pointer to ``NULL``-terminated array with field names of the new type." +msgstr "" -#: ../../c-api/tuple.rst:156 -msgid "number of fields visible to the Python side (if used as tuple)" +#: ../../c-api/tuple.rst:161 +msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" -#: ../../c-api/tuple.rst:163 +#: ../../c-api/tuple.rst:166 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " -"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :attr:" -"`fields` array of the :c:type:`PyStructSequence_Desc` determines which field " -"of the struct sequence is described." +"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" +"member:`~PyStructSequence_Desc.fields` array of the :c:type:" +"`PyStructSequence_Desc` determines which field of the struct sequence is " +"described." msgstr "" -#: ../../c-api/tuple.rst:171 +#: ../../c-api/tuple.rst:174 msgid "" -"name for the field or ``NULL`` to end the list of named fields, set to :c:" -"data:`PyStructSequence_UnnamedField` to leave unnamed" +"Name for the field or ``NULL`` to end the list of named fields, set to :c:" +"data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" -#: ../../c-api/tuple.rst:176 -msgid "field docstring or ``NULL`` to omit" +#: ../../c-api/tuple.rst:179 +msgid "Field docstring or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:182 +#: ../../c-api/tuple.rst:184 msgid "Special value for a field name to leave it unnamed." msgstr "" -#: ../../c-api/tuple.rst:184 +#: ../../c-api/tuple.rst:186 msgid "The type was changed from ``char *``." msgstr "" -#: ../../c-api/tuple.rst:190 +#: ../../c-api/tuple.rst:192 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." msgstr "" -#: ../../c-api/tuple.rst:196 +#: ../../c-api/tuple.rst:198 msgid "" "Return the object at position *pos* in the struct sequence pointed to by " "*p*. No bounds checking is performed." msgstr "" -#: ../../c-api/tuple.rst:202 +#: ../../c-api/tuple.rst:204 msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:207 +#: ../../c-api/tuple.rst:209 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " "new instances." msgstr "" -#: ../../c-api/tuple.rst:213 ../../c-api/tuple.rst:223 +#: ../../c-api/tuple.rst:215 ../../c-api/tuple.rst:225 msgid "This function \"steals\" a reference to *o*." msgstr "" -#: ../../c-api/tuple.rst:218 +#: ../../c-api/tuple.rst:220 msgid "" "Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static " "inlined function." diff --git a/c-api/type.po b/c-api/type.po index 0c874d569d..a9f1005b76 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -118,8 +118,8 @@ msgid "" "Mark *type* as watched. The callback granted *watcher_id* by :c:func:" "`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " "reports a change to *type*. (The callback may be called only once for a " -"series of consecutive modifications to *type*, if :c:func:`PyType_Lookup` is " -"not called on *type* between the modifications; this is an implementation " +"series of consecutive modifications to *type*, if :c:func:`!_PyType_Lookup` " +"is not called on *type* between the modifications; this is an implementation " "detail and subject to change.)" msgstr "" @@ -582,7 +582,7 @@ msgstr "" #: ../../c-api/type.rst:480 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " -"some platforms. To avoid issues, use the *bases* argument of :py:func:" +"some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" diff --git a/c-api/typehints.po b/c-api/typehints.po index 7a522c1395..5c064a160f 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2022-10-16 16:16+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,8 +65,8 @@ msgstr "" "::" #: ../../c-api/typehints.rst:38 -msgid "The data model method :meth:`__class_getitem__`." -msgstr "資料模型方法 :meth:`__class_getitem__`。" +msgid "The data model method :meth:`~object.__class_getitem__`." +msgstr "資料模型方法 :meth:`~object.__class_getitem__`。" #: ../../c-api/typehints.rst:44 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 3afafa2283..5bca8b7244 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -607,11 +607,11 @@ msgid "Columns:" msgstr "" #: ../../c-api/typeobj.rst:166 -msgid "**\"O\"**: set on :c:type:`PyBaseObject_Type`" +msgid "**\"O\"**: set on :c:data:`PyBaseObject_Type`" msgstr "" #: ../../c-api/typeobj.rst:168 -msgid "**\"T\"**: set on :c:type:`PyType_Type`" +msgid "**\"T\"**: set on :c:data:`PyType_Type`" msgstr "" #: ../../c-api/typeobj.rst:170 @@ -1165,20 +1165,21 @@ msgstr "" #: ../../c-api/typeobj.rst:487 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" -"attr:`ob_size` field is used for dynamic types (created by :func:`type_new`, " -"usually called from a class statement). Note that :c:data:`PyType_Type` (the " -"metatype) initializes :c:member:`~PyTypeObject.tp_itemsize`, which means " -"that its instances (i.e. type objects) *must* have the :attr:`ob_size` field." +"c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by :" +"c:func:`!type_new`, usually called from a class statement). Note that :c:" +"data:`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject." +"tp_itemsize`, which means that its instances (i.e. type objects) *must* have " +"the :c:member:`~PyVarObject.ob_size` field." msgstr "" #: ../../c-api/typeobj.rst:496 msgid "" "This is the type object's reference count, initialized to ``1`` by the " "``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " -"objects `, the type's instances (objects whose :attr:`ob_type` " -"points back to the type) do *not* count as references. But for :ref:" -"`dynamically allocated type objects `, the instances *do* count " -"as references." +"objects `, the type's instances (objects whose :c:member:" +"`~PyObject.ob_type` points back to the type) do *not* count as references. " +"But for :ref:`dynamically allocated type objects `, the " +"instances *do* count as references." msgstr "" #: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526 @@ -1201,19 +1202,19 @@ msgstr "" #: ../../c-api/typeobj.rst:1276 ../../c-api/typeobj.rst:1306 #: ../../c-api/typeobj.rst:1328 ../../c-api/typeobj.rst:1354 #: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1489 -#: ../../c-api/typeobj.rst:1548 ../../c-api/typeobj.rst:1584 -#: ../../c-api/typeobj.rst:1609 ../../c-api/typeobj.rst:1632 -#: ../../c-api/typeobj.rst:1645 ../../c-api/typeobj.rst:1660 -#: ../../c-api/typeobj.rst:1674 ../../c-api/typeobj.rst:1704 -#: ../../c-api/typeobj.rst:1736 ../../c-api/typeobj.rst:1762 -#: ../../c-api/typeobj.rst:1780 ../../c-api/typeobj.rst:1809 -#: ../../c-api/typeobj.rst:1853 ../../c-api/typeobj.rst:1870 -#: ../../c-api/typeobj.rst:1911 ../../c-api/typeobj.rst:1933 -#: ../../c-api/typeobj.rst:1965 ../../c-api/typeobj.rst:1993 -#: ../../c-api/typeobj.rst:2006 ../../c-api/typeobj.rst:2016 -#: ../../c-api/typeobj.rst:2033 ../../c-api/typeobj.rst:2050 -#: ../../c-api/typeobj.rst:2064 ../../c-api/typeobj.rst:2110 -#: ../../c-api/typeobj.rst:2133 +#: ../../c-api/typeobj.rst:1550 ../../c-api/typeobj.rst:1586 +#: ../../c-api/typeobj.rst:1611 ../../c-api/typeobj.rst:1634 +#: ../../c-api/typeobj.rst:1647 ../../c-api/typeobj.rst:1662 +#: ../../c-api/typeobj.rst:1676 ../../c-api/typeobj.rst:1706 +#: ../../c-api/typeobj.rst:1738 ../../c-api/typeobj.rst:1764 +#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1811 +#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1872 +#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1935 +#: ../../c-api/typeobj.rst:1967 ../../c-api/typeobj.rst:1995 +#: ../../c-api/typeobj.rst:2008 ../../c-api/typeobj.rst:2018 +#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2052 +#: ../../c-api/typeobj.rst:2066 ../../c-api/typeobj.rst:2112 +#: ../../c-api/typeobj.rst:2135 msgid "**Inheritance:**" msgstr "" @@ -1237,17 +1238,17 @@ msgstr "" #: ../../c-api/typeobj.rst:521 msgid "" "This should be done before any instances of the type are created. :c:func:" -"`PyType_Ready` checks if :attr:`ob_type` is ``NULL``, and if so, initializes " -"it to the :attr:`ob_type` field of the base class. :c:func:`PyType_Ready` " -"will not change this field if it is non-zero." +"`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, and if " +"so, initializes it to the :c:member:`~PyObject.ob_type` field of the base " +"class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" #: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:709 #: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:918 -#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1611 -#: ../../c-api/typeobj.rst:1634 ../../c-api/typeobj.rst:1764 -#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1855 -#: ../../c-api/typeobj.rst:1967 ../../c-api/typeobj.rst:2112 +#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1613 +#: ../../c-api/typeobj.rst:1636 ../../c-api/typeobj.rst:1766 +#: ../../c-api/typeobj.rst:1784 ../../c-api/typeobj.rst:1857 +#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:2114 msgid "This field is inherited by subtypes." msgstr "" @@ -1297,8 +1298,8 @@ msgstr "" msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " -"\"Default\" section. (Note that many fields set on :c:type:" -"`PyBaseObject_Type` and :c:type:`PyType_Type` effectively act as defaults.)" +"\"Default\" section. (Note that many fields set on :c:data:" +"`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)" msgstr "" #: ../../c-api/typeobj.rst:577 @@ -1308,8 +1309,8 @@ msgid "" "module name, followed by a dot, followed by the type name; for built-in " "types, it should be just the type name. If the module is a submodule of a " "package, the full package name is part of the full module name. For " -"example, a type named :class:`T` defined in module :mod:`M` in subpackage :" -"mod:`Q` in package :mod:`P` should have the :c:member:`~PyTypeObject." +"example, a type named :class:`!T` defined in module :mod:`!M` in subpackage :" +"mod:`!Q` in package :mod:`!P` should have the :c:member:`~PyTypeObject." "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" @@ -1361,28 +1362,30 @@ msgstr "" #: ../../c-api/typeobj.rst:621 msgid "" -"For a type with variable-length instances, the instances must have an :attr:" -"`ob_size` field, and the instance size is :c:member:`~PyTypeObject." -"tp_basicsize` plus N times :c:member:`~PyTypeObject.tp_itemsize`, where N is " -"the \"length\" of the object. The value of N is typically stored in the " -"instance's :attr:`ob_size` field. There are exceptions: for example, ints " -"use a negative :attr:`ob_size` to indicate a negative number, and N is " -"``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in " -"the instance layout doesn't mean that the instance structure is variable-" -"length (for example, the structure for the list type has fixed-length " -"instances, yet those instances have a meaningful :attr:`ob_size` field)." +"For a type with variable-length instances, the instances must have an :c:" +"member:`~PyVarObject.ob_size` field, and the instance size is :c:member:" +"`~PyTypeObject.tp_basicsize` plus N times :c:member:`~PyTypeObject." +"tp_itemsize`, where N is the \"length\" of the object. The value of N is " +"typically stored in the instance's :c:member:`~PyVarObject.ob_size` field. " +"There are exceptions: for example, ints use a negative :c:member:" +"`~PyVarObject.ob_size` to indicate a negative number, and N is " +"``abs(ob_size)`` there. Also, the presence of an :c:member:`~PyVarObject." +"ob_size` field in the instance layout doesn't mean that the instance " +"structure is variable-length (for example, the structure for the list type " +"has fixed-length instances, yet those instances have a meaningful :c:member:" +"`~PyVarObject.ob_size` field)." msgstr "" #: ../../c-api/typeobj.rst:632 msgid "" "The basic size includes the fields in the instance declared by the macro :c:" "macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to " -"declare the instance struct) and this in turn includes the :attr:`_ob_prev` " -"and :attr:`_ob_next` fields if they are present. This means that the only " -"correct way to get an initializer for the :c:member:`~PyTypeObject." -"tp_basicsize` is to use the ``sizeof`` operator on the struct used to " -"declare the instance layout. The basic size does not include the GC header " -"size." +"declare the instance struct) and this in turn includes the :c:member:" +"`~PyObject._ob_prev` and :c:member:`~PyObject._ob_next` fields if they are " +"present. This means that the only correct way to get an initializer for " +"the :c:member:`~PyTypeObject.tp_basicsize` is to use the ``sizeof`` operator " +"on the struct used to declare the instance layout. The basic size does not " +"include the GC header size." msgstr "" #: ../../c-api/typeobj.rst:640 @@ -1430,9 +1433,9 @@ msgid "" "set), it is permissible to call the object deallocator directly instead of " "via :c:member:`~PyTypeObject.tp_free`. The object deallocator should be the " "one used to allocate the instance; this is normally :c:func:`PyObject_Del` " -"if the instance was allocated using :c:func:`PyObject_New` or :c:func:" -"`PyObject_VarNew`, or :c:func:`PyObject_GC_Del` if the instance was " -"allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." +"if the instance was allocated using :c:macro:`PyObject_New` or :c:macro:" +"`PyObject_NewVar`, or :c:func:`PyObject_GC_Del` if the instance was " +"allocated using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`." msgstr "" #: ../../c-api/typeobj.rst:680 @@ -1489,9 +1492,9 @@ msgstr "" msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" -"`~type.__call__` in Python code, only *tp_call* is updated, likely making it " -"inconsistent with the vectorcall function. Since 3.12, setting ``__call__`` " -"will disable vectorcall optimization by clearing the :c:macro:" +"`~object.__call__` in Python code, only *tp_call* is updated, likely making " +"it inconsistent with the vectorcall function. Since 3.12, setting " +"``__call__`` will disable vectorcall optimization by clearing the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" @@ -1516,8 +1519,12 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:767 ../../c-api/typeobj.rst:959 -msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" +msgid "" +"Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." +"tp_getattro`" msgstr "" +"群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject." +"tp_getattro`" #: ../../c-api/typeobj.rst:769 msgid "" @@ -1542,8 +1549,12 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:784 ../../c-api/typeobj.rst:985 -msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" +msgid "" +"Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." +"tp_setattro`" msgstr "" +"群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject." +"tp_setattro`" #: ../../c-api/typeobj.rst:786 msgid "" @@ -1592,12 +1603,12 @@ msgstr "" #: ../../c-api/typeobj.rst:828 ../../c-api/typeobj.rst:940 #: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:991 -#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1557 -#: ../../c-api/typeobj.rst:1591 ../../c-api/typeobj.rst:1708 -#: ../../c-api/typeobj.rst:1741 ../../c-api/typeobj.rst:1816 -#: ../../c-api/typeobj.rst:1857 ../../c-api/typeobj.rst:1875 -#: ../../c-api/typeobj.rst:1917 ../../c-api/typeobj.rst:1938 -#: ../../c-api/typeobj.rst:1969 +#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1559 +#: ../../c-api/typeobj.rst:1593 ../../c-api/typeobj.rst:1710 +#: ../../c-api/typeobj.rst:1743 ../../c-api/typeobj.rst:1818 +#: ../../c-api/typeobj.rst:1859 ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1919 ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1971 msgid "**Default:**" msgstr "**預設:**" @@ -1666,9 +1677,10 @@ msgstr "" #: ../../c-api/typeobj.rst:886 msgid "" -"When this field is not set (*and* :attr:`tp_richcompare` is not set), an " -"attempt to take the hash of the object raises :exc:`TypeError`. This is the " -"same as setting it to :c:func:`PyObject_HashNotImplemented`." +"When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " +"is not set), an attempt to take the hash of the object raises :exc:" +"`TypeError`. This is the same as setting it to :c:func:" +"`PyObject_HashNotImplemented`." msgstr "" #: ../../c-api/typeobj.rst:890 @@ -1682,9 +1694,13 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1550 -msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" +#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1552 +msgid "" +"Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." +"tp_richcompare`" msgstr "" +"群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject." +"tp_richcompare`" #: ../../c-api/typeobj.rst:902 msgid "" @@ -1754,7 +1770,7 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:967 -msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" #: ../../c-api/typeobj.rst:974 @@ -1779,7 +1795,7 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:993 -msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" #: ../../c-api/typeobj.rst:998 @@ -1825,7 +1841,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1034 msgid "" -":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " +":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" @@ -1846,11 +1862,11 @@ msgstr "" msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " -"case, the :attr:`ob_type` field of its instances is considered a reference " -"to the type, and the type object is INCREF'ed when a new instance is " -"created, and DECREF'ed when an instance is destroyed (this does not apply to " -"instances of subtypes; only the type referenced by the instance's ob_type " -"gets INCREF'ed or DECREF'ed)." +"case, the :c:member:`~PyObject.ob_type` field of its instances is considered " +"a reference to the type, and the type object is INCREF'ed when a new " +"instance is created, and DECREF'ed when an instance is destroyed (this does " +"not apply to instances of subtypes; only the type referenced by the " +"instance's ob_type gets INCREF'ed or DECREF'ed)." msgstr "" #: ../../c-api/typeobj.rst:1058 ../../c-api/typeobj.rst:1069 @@ -1881,8 +1897,8 @@ msgstr "" #: ../../c-api/typeobj.rst:1094 msgid "" "This bit is set when the object supports garbage collection. If this bit is " -"set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " -"using :c:func:`PyObject_GC_Del`. More information in section :ref:" +"set, instances must be created using :c:macro:`PyObject_GC_New` and " +"destroyed using :c:func:`PyObject_GC_Del`. More information in section :ref:" "`supporting-cycle-detection`. This bit also implies that the GC-related " "fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject." "tp_clear` are present in the type object." @@ -1891,16 +1907,18 @@ msgstr "" #: ../../c-api/typeobj.rst:1103 ../../c-api/typeobj.rst:1424 #: ../../c-api/typeobj.rst:1491 msgid "" -"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" +"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." +"tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" #: ../../c-api/typeobj.rst:1105 msgid "" -"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" -"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :c:macro:" -"`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :attr:" -"`tp_traverse` and :attr:`tp_clear` fields in the subtype exist and have " -"``NULL`` values." +"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" +"member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " +"fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the " +"subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:" +"`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` " +"values." msgstr "" #: ../../c-api/typeobj.rst:1115 @@ -1975,14 +1993,14 @@ msgstr "" #: ../../c-api/typeobj.rst:1178 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" -"`~PyObject.tp_itemsize`." +"`~PyTypeObject.tp_itemsize`." msgstr "" #: ../../c-api/typeobj.rst:1181 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " -"the end of the instance's memory area, at an offset of :c:expr:`Py_TYPE(obj)-" -">tp_basicsize` (which may be different in each subclass)." +"the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" +">tp_basicsize`` (which may be different in each subclass)." msgstr "" #: ../../c-api/typeobj.rst:1186 @@ -2168,8 +2186,8 @@ msgid "" "collector to detect reference cycles. A typical implementation of a :c:" "member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` " "on each of the instance's members that are Python objects that the instance " -"owns. For example, this is function :c:func:`local_traverse` from the :mod:" -"`_thread` extension module::" +"owns. For example, this is function :c:func:`!local_traverse` from the :mod:" +"`!_thread` extension module::" msgstr "" #: ../../c-api/typeobj.rst:1384 @@ -2327,68 +2345,44 @@ msgid "" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1517 +#: ../../c-api/typeobj.rst:1519 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1517 +#: ../../c-api/typeobj.rst:1519 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1519 -msgid ":c:macro:`Py_LT`" -msgstr ":c:macro:`Py_LT`" - -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1521 -msgid ":c:macro:`Py_LE`" -msgstr ":c:macro:`Py_LE`" - -#: ../../c-api/typeobj.rst:1521 +#: ../../c-api/typeobj.rst:1523 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1523 -msgid ":c:macro:`Py_EQ`" -msgstr ":c:macro:`Py_EQ`" - -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1525 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1525 -msgid ":c:macro:`Py_NE`" -msgstr ":c:macro:`Py_NE`" - -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1527 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1527 -msgid ":c:macro:`Py_GT`" -msgstr ":c:macro:`Py_GT`" - -#: ../../c-api/typeobj.rst:1527 +#: ../../c-api/typeobj.rst:1529 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1529 -msgid ":c:macro:`Py_GE`" -msgstr ":c:macro:`Py_GE`" - -#: ../../c-api/typeobj.rst:1529 +#: ../../c-api/typeobj.rst:1531 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1532 +#: ../../c-api/typeobj.rst:1534 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1538 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2396,15 +2390,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1542 +#: ../../c-api/typeobj.rst:1544 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1544 +#: ../../c-api/typeobj.rst:1546 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1552 +#: ../../c-api/typeobj.rst:1554 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2412,21 +2406,22 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1559 +#: ../../c-api/typeobj.rst:1561 msgid "" -":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " -"implementation, which may be inherited. However, if only :attr:`tp_hash` is " -"defined, not even the inherited function is used and instances of the type " -"will not be able to participate in any comparisons." +":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." +"tp_richcompare` implementation, which may be inherited. However, if only :c:" +"member:`~PyTypeObject.tp_hash` is defined, not even the inherited function " +"is used and instances of the type will not be able to participate in any " +"comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1568 +#: ../../c-api/typeobj.rst:1570 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1571 +#: ../../c-api/typeobj.rst:1573 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2436,19 +2431,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1578 +#: ../../c-api/typeobj.rst:1580 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1581 +#: ../../c-api/typeobj.rst:1583 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/typeobj.rst:1586 +#: ../../c-api/typeobj.rst:1588 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2457,7 +2452,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1593 +#: ../../c-api/typeobj.rst:1595 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." @@ -2465,24 +2460,24 @@ msgid "" "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1601 +#: ../../c-api/typeobj.rst:1603 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1605 +#: ../../c-api/typeobj.rst:1607 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1616 +#: ../../c-api/typeobj.rst:1618 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1621 +#: ../../c-api/typeobj.rst:1623 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2490,74 +2485,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1626 +#: ../../c-api/typeobj.rst:1628 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1630 +#: ../../c-api/typeobj.rst:1632 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1639 +#: ../../c-api/typeobj.rst:1641 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1642 +#: ../../c-api/typeobj.rst:1644 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1647 +#: ../../c-api/typeobj.rst:1649 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1653 +#: ../../c-api/typeobj.rst:1655 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1657 +#: ../../c-api/typeobj.rst:1659 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1662 +#: ../../c-api/typeobj.rst:1664 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1668 +#: ../../c-api/typeobj.rst:1670 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1671 +#: ../../c-api/typeobj.rst:1673 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1676 +#: ../../c-api/typeobj.rst:1678 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1682 +#: ../../c-api/typeobj.rst:1684 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2565,7 +2560,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1690 +#: ../../c-api/typeobj.rst:1692 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2573,7 +2568,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1695 +#: ../../c-api/typeobj.rst:1697 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2581,95 +2576,95 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1701 +#: ../../c-api/typeobj.rst:1703 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1706 +#: ../../c-api/typeobj.rst:1708 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1710 +#: ../../c-api/typeobj.rst:1712 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1716 +#: ../../c-api/typeobj.rst:1718 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1720 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " "attributes for the type. Once :c:func:`PyType_Ready` has initialized the " "type, extra attributes for the type may be added to this dictionary only if " -"they don't correspond to overloaded operations (like :meth:`__add__`). Once " -"initialization for the type has finished, this field should be treated as " -"read-only." +"they don't correspond to overloaded operations (like :meth:`~object." +"__add__`). Once initialization for the type has finished, this field should " +"be treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:1726 +#: ../../c-api/typeobj.rst:1728 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retreive the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1732 +#: ../../c-api/typeobj.rst:1734 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1738 +#: ../../c-api/typeobj.rst:1740 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1743 +#: ../../c-api/typeobj.rst:1745 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1748 +#: ../../c-api/typeobj.rst:1750 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1754 +#: ../../c-api/typeobj.rst:1756 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1756 ../../c-api/typeobj.rst:1772 -#: ../../c-api/typeobj.rst:1836 ../../c-api/typeobj.rst:1866 -#: ../../c-api/typeobj.rst:1890 +#: ../../c-api/typeobj.rst:1758 ../../c-api/typeobj.rst:1774 +#: ../../c-api/typeobj.rst:1838 ../../c-api/typeobj.rst:1868 +#: ../../c-api/typeobj.rst:1892 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1769 +#: ../../c-api/typeobj.rst:1771 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1776 +#: ../../c-api/typeobj.rst:1778 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1789 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1790 +#: ../../c-api/typeobj.rst:1792 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2677,19 +2672,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1795 +#: ../../c-api/typeobj.rst:1797 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1800 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1802 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2698,13 +2693,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1808 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1811 +#: ../../c-api/typeobj.rst:1813 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -2712,39 +2707,40 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1818 +#: ../../c-api/typeobj.rst:1820 msgid "" "This slot has no default. For :ref:`static types `, if the " -"field is ``NULL`` then no :attr:`__dict__` gets created for instances." +"field is ``NULL`` then no :attr:`~object.__dict__` gets created for " +"instances." msgstr "" -#: ../../c-api/typeobj.rst:1821 +#: ../../c-api/typeobj.rst:1823 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1829 +#: ../../c-api/typeobj.rst:1831 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1831 +#: ../../c-api/typeobj.rst:1833 msgid "" -"This function corresponds to the :meth:`__init__` method of classes. Like :" -"meth:`__init__`, it is possible to create an instance without calling :meth:" -"`__init__`, and it is possible to reinitialize an instance by calling its :" -"meth:`__init__` method again." +"This function corresponds to the :meth:`~object.__init__` method of " +"classes. Like :meth:`!__init__`, it is possible to create an instance " +"without calling :meth:`!__init__`, and it is possible to reinitialize an " +"instance by calling its :meth:`!__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1840 +#: ../../c-api/typeobj.rst:1842 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" -"`__init__`." +"`~object.__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1844 +#: ../../c-api/typeobj.rst:1846 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2756,43 +2752,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1851 +#: ../../c-api/typeobj.rst:1853 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1859 +#: ../../c-api/typeobj.rst:1861 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1864 +#: ../../c-api/typeobj.rst:1866 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1872 +#: ../../c-api/typeobj.rst:1874 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1879 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1881 +#: ../../c-api/typeobj.rst:1883 msgid "" -"For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" +"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1888 +#: ../../c-api/typeobj.rst:1890 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1894 +#: ../../c-api/typeobj.rst:1896 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2801,7 +2797,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1900 +#: ../../c-api/typeobj.rst:1902 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2813,20 +2809,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1908 +#: ../../c-api/typeobj.rst:1910 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1913 +#: ../../c-api/typeobj.rst:1915 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1919 +#: ../../c-api/typeobj.rst:1921 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2834,39 +2830,40 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1927 +#: ../../c-api/typeobj.rst:1929 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1931 +#: ../../c-api/typeobj.rst:1933 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1935 +#: ../../c-api/typeobj.rst:1937 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1940 +#: ../../c-api/typeobj.rst:1942 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1944 -msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." +#: ../../c-api/typeobj.rst:1946 +msgid "" +"For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/typeobj.rst:1949 +#: ../../c-api/typeobj.rst:1951 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1951 +#: ../../c-api/typeobj.rst:1953 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2878,89 +2875,89 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1961 +#: ../../c-api/typeobj.rst:1963 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1971 +#: ../../c-api/typeobj.rst:1973 msgid "" "This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1977 +#: ../../c-api/typeobj.rst:1979 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1979 ../../c-api/typeobj.rst:2003 +#: ../../c-api/typeobj.rst:1981 ../../c-api/typeobj.rst:2005 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1982 +#: ../../c-api/typeobj.rst:1984 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1989 +#: ../../c-api/typeobj.rst:1991 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1995 ../../c-api/typeobj.rst:2018 -#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2052 -#: ../../c-api/typeobj.rst:2066 +#: ../../c-api/typeobj.rst:1997 ../../c-api/typeobj.rst:2020 +#: ../../c-api/typeobj.rst:2037 ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2068 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:2000 +#: ../../c-api/typeobj.rst:2002 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:2008 +#: ../../c-api/typeobj.rst:2010 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2014 +#: ../../c-api/typeobj.rst:2016 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2023 +#: ../../c-api/typeobj.rst:2025 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2025 +#: ../../c-api/typeobj.rst:2027 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2030 +#: ../../c-api/typeobj.rst:2032 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2040 +#: ../../c-api/typeobj.rst:2042 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2045 +#: ../../c-api/typeobj.rst:2047 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -2968,21 +2965,21 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2057 +#: ../../c-api/typeobj.rst:2059 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:2062 +#: ../../c-api/typeobj.rst:2064 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2071 +#: ../../c-api/typeobj.rst:2073 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2075 +#: ../../c-api/typeobj.rst:2077 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2992,14 +2989,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2082 +#: ../../c-api/typeobj.rst:2084 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2099 +#: ../../c-api/typeobj.rst:2101 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -3012,84 +3009,84 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2118 +#: ../../c-api/typeobj.rst:2120 msgid "" "Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2122 +#: ../../c-api/typeobj.rst:2124 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2127 +#: ../../c-api/typeobj.rst:2129 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " "If ``tp_vectorcall`` is ``NULL``, the default call implementation using :" -"attr:`__new__` and :attr:`__init__` is used." +"meth:`~object.__new__` and :meth:`~object.__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2135 +#: ../../c-api/typeobj.rst:2137 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2137 +#: ../../c-api/typeobj.rst:2139 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2142 +#: ../../c-api/typeobj.rst:2144 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2150 +#: ../../c-api/typeobj.rst:2152 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2152 +#: ../../c-api/typeobj.rst:2154 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2156 +#: ../../c-api/typeobj.rst:2158 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2158 +#: ../../c-api/typeobj.rst:2160 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2160 +#: ../../c-api/typeobj.rst:2162 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2162 +#: ../../c-api/typeobj.rst:2164 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2166 +#: ../../c-api/typeobj.rst:2168 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2174 +#: ../../c-api/typeobj.rst:2176 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2176 +#: ../../c-api/typeobj.rst:2178 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3097,29 +3094,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2181 +#: ../../c-api/typeobj.rst:2183 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2189 +#: ../../c-api/typeobj.rst:2191 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2196 +#: ../../c-api/typeobj.rst:2198 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2202 ../../c-api/typeobj.rst:2526 +#: ../../c-api/typeobj.rst:2204 ../../c-api/typeobj.rst:2528 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2249 +#: ../../c-api/typeobj.rst:2251 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3129,31 +3126,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2258 +#: ../../c-api/typeobj.rst:2260 msgid "" "The :c:member:`~PyNumberMethods.nb_reserved` field should always be " "``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " "Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2303 +#: ../../c-api/typeobj.rst:2305 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2310 +#: ../../c-api/typeobj.rst:2312 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2315 +#: ../../c-api/typeobj.rst:2317 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2321 +#: ../../c-api/typeobj.rst:2323 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3161,27 +3158,27 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2329 +#: ../../c-api/typeobj.rst:2331 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" -"`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" -"`PyObject_DelSlice`. It has the same signature as :c:func:`!" +"`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" +"`PySequence_DelSlice`. It has the same signature as :c:func:`!" "PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete an item. " "If this slot is ``NULL``, the object does not support item assignment and " "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2340 +#: ../../c-api/typeobj.rst:2342 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2347 +#: ../../c-api/typeobj.rst:2349 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2352 +#: ../../c-api/typeobj.rst:2354 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3189,21 +3186,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2359 +#: ../../c-api/typeobj.rst:2361 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2367 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2371 +#: ../../c-api/typeobj.rst:2373 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3212,15 +3209,16 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2377 +#: ../../c-api/typeobj.rst:2379 msgid "" -"Negative indexes are handled as follows: if the :attr:`sq_length` slot is " -"filled, it is called and the sequence length is used to compute a positive " -"index which is passed to :attr:`sq_item`. If :attr:`sq_length` is ``NULL``, " -"the index is passed as is to the function." +"Negative indexes are handled as follows: if the :c:member:" +"`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " +"length is used to compute a positive index which is passed to :c:member:" +"`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``, the " +"index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2384 +#: ../../c-api/typeobj.rst:2386 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3229,14 +3227,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2393 +#: ../../c-api/typeobj.rst:2395 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2400 +#: ../../c-api/typeobj.rst:2402 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3246,7 +3244,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2409 +#: ../../c-api/typeobj.rst:2411 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3256,72 +3254,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2420 +#: ../../c-api/typeobj.rst:2422 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2428 +#: ../../c-api/typeobj.rst:2430 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2434 ../../c-api/typeobj.rst:2483 -#: ../../c-api/typeobj.rst:2537 ../../c-api/typeobj.rst:2548 -#: ../../c-api/typeobj.rst:2560 ../../c-api/typeobj.rst:2569 +#: ../../c-api/typeobj.rst:2436 ../../c-api/typeobj.rst:2485 +#: ../../c-api/typeobj.rst:2539 ../../c-api/typeobj.rst:2550 +#: ../../c-api/typeobj.rst:2562 ../../c-api/typeobj.rst:2572 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2438 +#: ../../c-api/typeobj.rst:2440 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2442 +#: ../../c-api/typeobj.rst:2444 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2445 +#: ../../c-api/typeobj.rst:2447 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2447 +#: ../../c-api/typeobj.rst:2449 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2451 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2451 +#: ../../c-api/typeobj.rst:2453 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2455 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2456 +#: ../../c-api/typeobj.rst:2458 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2459 +#: ../../c-api/typeobj.rst:2461 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2463 +#: ../../c-api/typeobj.rst:2465 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3329,7 +3327,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2468 +#: ../../c-api/typeobj.rst:2470 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3338,19 +3336,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2475 +#: ../../c-api/typeobj.rst:2477 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2478 +#: ../../c-api/typeobj.rst:2480 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2487 +#: ../../c-api/typeobj.rst:2489 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3358,15 +3356,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2492 +#: ../../c-api/typeobj.rst:2494 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2496 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2496 +#: ../../c-api/typeobj.rst:2498 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3374,155 +3372,155 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2502 +#: ../../c-api/typeobj.rst:2504 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2507 +#: ../../c-api/typeobj.rst:2509 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2515 +#: ../../c-api/typeobj.rst:2517 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2523 +#: ../../c-api/typeobj.rst:2525 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2541 +#: ../../c-api/typeobj.rst:2543 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2544 +#: ../../c-api/typeobj.rst:2546 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2554 msgid "" -"Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " -"for details." +"Must return an :term:`asynchronous iterator` object. See :meth:`~object." +"__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2555 +#: ../../c-api/typeobj.rst:2557 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2564 +#: ../../c-api/typeobj.rst:2566 msgid "" -"Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " -"This slot may be set to ``NULL``." +"Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " +"details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2573 +#: ../../c-api/typeobj.rst:2576 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2582 +#: ../../c-api/typeobj.rst:2585 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2586 +#: ../../c-api/typeobj.rst:2589 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " "length for the instance, suitably aligned, and initialized to zeros, but " -"with :attr:`ob_refcnt` set to ``1`` and :attr:`ob_type` set to the type " -"argument. If the type's :c:member:`~PyTypeObject.tp_itemsize` is non-zero, " -"the object's :attr:`ob_size` field should be initialized to *nitems* and the " -"length of the allocated memory block should be ``tp_basicsize + " -"nitems*tp_itemsize``, rounded up to a multiple of ``sizeof(void*)``; " -"otherwise, *nitems* is not used and the length of the block should be :c:" -"member:`~PyTypeObject.tp_basicsize`." +"with :c:member:`~PyObject.ob_refcnt` set to ``1`` and :c:member:`~PyObject." +"ob_type` set to the type argument. If the type's :c:member:`~PyTypeObject." +"tp_itemsize` is non-zero, the object's :c:member:`~PyVarObject.ob_size` " +"field should be initialized to *nitems* and the length of the allocated " +"memory block should be ``tp_basicsize + nitems*tp_itemsize``, rounded up to " +"a multiple of ``sizeof(void*)``; otherwise, *nitems* is not used and the " +"length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2596 +#: ../../c-api/typeobj.rst:2599 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2603 +#: ../../c-api/typeobj.rst:2606 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2607 +#: ../../c-api/typeobj.rst:2610 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2611 +#: ../../c-api/typeobj.rst:2614 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2615 +#: ../../c-api/typeobj.rst:2618 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2619 ../../c-api/typeobj.rst:2628 +#: ../../c-api/typeobj.rst:2622 ../../c-api/typeobj.rst:2631 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2623 ../../c-api/typeobj.rst:2634 +#: ../../c-api/typeobj.rst:2626 ../../c-api/typeobj.rst:2637 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2630 +#: ../../c-api/typeobj.rst:2633 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2637 +#: ../../c-api/typeobj.rst:2640 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2641 +#: ../../c-api/typeobj.rst:2644 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2645 +#: ../../c-api/typeobj.rst:2648 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2649 +#: ../../c-api/typeobj.rst:2652 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2653 +#: ../../c-api/typeobj.rst:2656 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2657 +#: ../../c-api/typeobj.rst:2660 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2661 +#: ../../c-api/typeobj.rst:2664 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2675 +#: ../../c-api/typeobj.rst:2678 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2691 +#: ../../c-api/typeobj.rst:2694 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2693 +#: ../../c-api/typeobj.rst:2696 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3530,33 +3528,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2698 +#: ../../c-api/typeobj.rst:2701 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2715 +#: ../../c-api/typeobj.rst:2718 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2759 +#: ../../c-api/typeobj.rst:2762 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2784 +#: ../../c-api/typeobj.rst:2787 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2803 +#: ../../c-api/typeobj.rst:2806 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2814 +#: ../../c-api/typeobj.rst:2817 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/c-api/unicode.po b/c-api/unicode.po index ad1c353b75..7739b467b3 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -796,8 +796,8 @@ msgstr "" #: ../../c-api/unicode.rst:610 msgid "" "Copy characters from one Unicode object into another. This function " -"performs character conversion when necessary and falls back to :c:func:" -"`memcpy` if possible. Returns ``-1`` and sets an exception on error, " +"performs character conversion when necessary and falls back to :c:func:`!" +"memcpy` if possible. Returns ``-1`` and sets an exception on error, " "otherwise returns the number of copied characters." msgstr "" @@ -906,7 +906,7 @@ msgstr "" #: ../../c-api/unicode.rst:723 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " -"length using :c:func:`strlen`." +"length using :c:func:`!strlen`." msgstr "" #: ../../c-api/unicode.rst:731 @@ -1065,7 +1065,7 @@ msgstr "" #: ../../c-api/unicode.rst:882 msgid "" -"Returns a buffer allocated by :c:func:`PyMem_New` (use :c:func:`PyMem_Free` " +"Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " "to free it) on success. On error, returns ``NULL`` and *\\*size* is " "undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" @@ -1429,10 +1429,10 @@ msgstr "" 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 " -"codecs included in the :mod:`encodings` package). The codec uses mappings to " -"encode and decode characters. The mapping objects provided must support " -"the :meth:`__getitem__` mapping interface; dictionaries and sequences work " -"well." +"codecs included in the :mod:`!encodings` package). The codec uses mappings " +"to encode and decode characters. The mapping objects provided must support " +"the :meth:`~object.__getitem__` mapping interface; dictionaries and " +"sequences work well." msgstr "" #: ../../c-api/unicode.rst:1219 @@ -1490,7 +1490,7 @@ msgstr "" #: ../../c-api/unicode.rst:1260 msgid "" -"Mapping tables need only provide the :meth:`__getitem__` interface; " +"Mapping tables need only provide the :meth:`~object.__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 "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index a2b365a7f3..2179083511 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-28 00:03+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-" @@ -389,9 +389,9 @@ msgstr "" #: ../../c-api/veryhigh.rst:356 msgid "" -"Whenever ``PyCompilerFlags *flags`` is ``NULL``, :attr:`cf_flags` is treated " -"as equal to ``0``, and any modification due to ``from __future__ import`` is " -"discarded." +"Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." +"cf_flags` is treated as equal to ``0``, and any modification due to ``from " +"__future__ import`` is discarded." msgstr "" #: ../../c-api/veryhigh.rst:362 @@ -407,7 +407,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:369 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " -"flag is set in *cf_flags*." +"flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" #: ../../c-api/veryhigh.rst:372 diff --git a/c-api/weakref.po b/c-api/weakref.po index 9afb921434..9b51f1de97 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-26 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -73,7 +73,7 @@ msgstr "" #: ../../c-api/weakref.rst:56 msgid "" "Return the referenced object from a weak reference, *ref*. If the referent " -"is no longer live, returns :const:`Py_None`." +"is no longer live, returns ``Py_None``." msgstr "" #: ../../c-api/weakref.rst:61 diff --git a/extending/embedding.po b/extending/embedding.po index 7195772150..eada804fa8 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,9 +253,9 @@ msgstr "" #: ../../extending/embedding.rst:252 msgid "" -"These two lines initialize the ``numargs`` variable, and make the :func:`emb." -"numargs` function accessible to the embedded Python interpreter. With these " -"extensions, the Python script can do things like" +"These two lines initialize the ``numargs`` variable, and make the :func:`!" +"emb.numargs` function accessible to the embedded Python interpreter. With " +"these extensions, the Python script can do things like" msgstr "" #: ../../extending/embedding.rst:261 diff --git a/extending/extending.po b/extending/extending.po index cd754900a3..958e723db0 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, " "you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` " "to mean that a file couldn't be opened (that should probably be :c:data:" -"`PyExc_IOError`). If something's wrong with the argument list, the :c:func:" +"`PyExc_OSError`). If something's wrong with the argument list, the :c:func:" "`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If " "you have an argument whose value must be in a particular range or must " "satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." @@ -282,13 +282,13 @@ msgstr "" #: ../../extending/extending.rst:209 msgid "" -"and initialize it in your module's initialization function (:c:func:" -"`PyInit_spam`) with an exception object::" +"and initialize it in your module's initialization function (:c:func:`!" +"PyInit_spam`) with an exception object::" msgstr "" #: ../../extending/extending.rst:233 msgid "" -"Note that the Python name for the exception object is :exc:`spam.error`. " +"Note that the Python name for the exception object is :exc:`!spam.error`. " "The :c:func:`PyErr_NewException` function may create a class with the base " "class being :exc:`Exception` (unless another class is passed in instead of " "``NULL``), described in :ref:`bltin-exceptions`." @@ -313,8 +313,8 @@ msgstr "" #: ../../extending/extending.rst:248 msgid "" -"The :exc:`spam.error` exception can be raised in your extension module using " -"a call to :c:func:`PyErr_SetString` as shown below::" +"The :exc:`!spam.error` exception can be raised in your extension module " +"using a call to :c:func:`PyErr_SetString` as shown below::" msgstr "" #: ../../extending/extending.rst:271 @@ -378,8 +378,8 @@ msgstr "" #: ../../extending/extending.rst:318 msgid "" -"I promised to show how :c:func:`spam_system` is called from Python programs. " -"First, we need to list its name and address in a \"method table\"::" +"I promised to show how :c:func:`!spam_system` is called from Python " +"programs. First, we need to list its name and address in a \"method table\"::" msgstr "" #: ../../extending/extending.rst:329 @@ -416,7 +416,7 @@ msgstr "" msgid "" "This structure, in turn, must be passed to the interpreter in the module's " "initialization function. The initialization function must be named :c:func:" -"`PyInit_name`, where *name* is the name of the module, and should be the " +"`!PyInit_name`, where *name* is the name of the module, and should be the " "only non-\\ ``static`` item defined in the module file::" msgstr "" @@ -429,8 +429,8 @@ msgstr "" #: ../../extending/extending.rst:370 msgid "" -"When the Python program imports module :mod:`spam` for the first time, :c:" -"func:`PyInit_spam` is called. (See below for comments about embedding " +"When the Python program imports module :mod:`!spam` for the first time, :c:" +"func:`!PyInit_spam` is called. (See below for comments about embedding " "Python.) It calls :c:func:`PyModule_Create`, which returns a module object, " "and inserts built-in function objects into the newly created module based " "upon the table (an array of :c:type:`PyMethodDef` structures) found in the " @@ -443,7 +443,7 @@ msgstr "" #: ../../extending/extending.rst:381 msgid "" -"When embedding Python, the :c:func:`PyInit_spam` function is not called " +"When embedding Python, the :c:func:`!PyInit_spam` function is not called " "automatically unless there's an entry in the :c:data:`PyImport_Inittab` " "table. To add the module to the initialization table, use :c:func:" "`PyImport_AppendInittab`, optionally followed by an import of the module::" @@ -987,16 +987,16 @@ msgid "" "references to all its items, so when item 1 is replaced, it has to dispose " "of the original item 1. Now let's suppose the original item 1 was an " "instance of a user-defined class, and let's further suppose that the class " -"defined a :meth:`__del__` method. If this class instance has a reference " -"count of 1, disposing of it will call its :meth:`__del__` method." +"defined a :meth:`!__del__` method. If this class instance has a reference " +"count of 1, disposing of it will call its :meth:`!__del__` method." msgstr "" #: ../../extending/extending.rst:1036 msgid "" -"Since it is written in Python, the :meth:`__del__` method can execute " +"Since it is written in Python, the :meth:`!__del__` method can execute " "arbitrary Python code. Could it perhaps do something to invalidate the " -"reference to ``item`` in :c:func:`bug`? You bet! Assuming that the list " -"passed into :c:func:`bug` is accessible to the :meth:`__del__` method, it " +"reference to ``item`` in :c:func:`!bug`? You bet! Assuming that the list " +"passed into :c:func:`!bug` is accessible to the :meth:`!__del__` method, it " "could execute a statement to the effect of ``del list[0]``, and assuming " "this was the last reference to that object, it would free the memory " "associated with it, thereby invalidating ``item``." @@ -1012,7 +1012,7 @@ msgstr "" msgid "" "This is a true story. An older version of Python contained variants of this " "bug and someone spent a considerable amount of time in a C debugger to " -"figure out why his :meth:`__del__` methods would fail..." +"figure out why his :meth:`!__del__` methods would fail..." msgstr "" #: ../../extending/extending.rst:1062 @@ -1197,22 +1197,23 @@ msgstr "" #: ../../extending/extending.rst:1211 msgid "" -"The exporting module is a modification of the :mod:`spam` module from " -"section :ref:`extending-simpleexample`. The function :func:`spam.system` " +"The exporting module is a modification of the :mod:`!spam` module from " +"section :ref:`extending-simpleexample`. The function :func:`!spam.system` " "does not call the C library function :c:func:`system` directly, but a " -"function :c:func:`PySpam_System`, which would of course do something more " +"function :c:func:`!PySpam_System`, which would of course do something more " "complicated in reality (such as adding \"spam\" to every command). This " -"function :c:func:`PySpam_System` is also exported to other extension modules." +"function :c:func:`!PySpam_System` is also exported to other extension " +"modules." msgstr "" #: ../../extending/extending.rst:1218 msgid "" -"The function :c:func:`PySpam_System` is a plain C function, declared " +"The function :c:func:`!PySpam_System` is a plain C function, declared " "``static`` like everything else::" msgstr "" #: ../../extending/extending.rst:1227 -msgid "The function :c:func:`spam_system` is modified in a trivial way::" +msgid "The function :c:func:`!spam_system` is modified in a trivial way::" msgstr "" #: ../../extending/extending.rst:1241 @@ -1234,7 +1235,7 @@ msgstr "" #: ../../extending/extending.rst:1280 msgid "" "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " -"would disappear when :func:`PyInit_spam` terminates!" +"would disappear when :c:func:`!PyInit_spam` terminates!" msgstr "" #: ../../extending/extending.rst:1283 @@ -1246,8 +1247,8 @@ msgstr "" #: ../../extending/extending.rst:1334 msgid "" "All that a client module must do in order to have access to the function :c:" -"func:`PySpam_System` is to call the function (or rather macro) :c:func:" -"`import_spam` in its initialization function::" +"func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" +"import_spam` in its initialization function::" msgstr "" #: ../../extending/extending.rst:1352 diff --git a/extending/newtypes.po b/extending/newtypes.po index ae549979a1..d352b52139 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -270,8 +270,8 @@ msgstr "" msgid "" "One entry should be defined for each method provided by the type; no entries " "are needed for methods inherited from a base type. One additional entry is " -"needed at the end; it is a sentinel that marks the end of the array. The :" -"attr:`ml_name` field of the sentinel must be ``NULL``." +"needed at the end; it is a sentinel that marks the end of the array. The :c:" +"member:`~PyMethodDef.ml_name` field of the sentinel must be ``NULL``." msgstr "" #: ../../extending/newtypes.rst:275 @@ -286,11 +286,12 @@ msgstr "" msgid "" "For each entry in the table, a :term:`descriptor` will be constructed and " "added to the type which will be able to extract a value from the instance " -"structure. The :attr:`type` field should contain a type code like :c:macro:" -"`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be used to determine " -"how to convert Python values to and from C values. The :attr:`flags` field " -"is used to store flags which control how the attribute can be accessed: you " -"can set it to :c:macro:`Py_READONLY` to prevent Python code from setting it." +"structure. The :c:member:`~PyMemberDef.type` field should contain a type " +"code like :c:macro:`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be " +"used to determine how to convert Python values to and from C values. The :c:" +"member:`~PyMemberDef.flags` field is used to store flags which control how " +"the attribute can be accessed: you can set it to :c:macro:`Py_READONLY` to " +"prevent Python code from setting it." msgstr "" #: ../../extending/newtypes.rst:295 @@ -306,7 +307,7 @@ msgstr "" #: ../../extending/newtypes.rst:301 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " -"with a :attr:`name` value of ``NULL`` is required." +"with a :c:member:`~PyMethodDef.name` value of ``NULL`` is required." msgstr "" #: ../../extending/newtypes.rst:315 @@ -328,7 +329,7 @@ msgstr "" msgid "" "The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " "requires an attribute look-up. It is called in the same situations where " -"the :meth:`__getattr__` method of a class would be called." +"the :meth:`~object.__getattr__` method of a class would be called." msgstr "" #: ../../extending/newtypes.rst:329 @@ -341,11 +342,11 @@ msgstr "" #: ../../extending/newtypes.rst:345 msgid "" "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" -"`__setattr__` or :meth:`__delattr__` method of a class instance would be " -"called. When an attribute should be deleted, the third parameter will be " -"``NULL``. Here is an example that simply raises an exception; if this were " -"really all you wanted, the :c:member:`~PyTypeObject.tp_setattr` handler " -"should be set to ``NULL``. ::" +"`~object.__setattr__` or :meth:`~object.__delattr__` method of a class " +"instance would be called. When an attribute should be deleted, the third " +"parameter will be ``NULL``. Here is an example that simply raises an " +"exception; if this were really all you wanted, the :c:member:`~PyTypeObject." +"tp_setattr` handler should be set to ``NULL``. ::" msgstr "" #: ../../extending/newtypes.rst:359 @@ -356,7 +357,7 @@ msgstr "" msgid "" "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " "comparisons are needed. It is analogous to the :ref:`rich comparison " -"methods `, like :meth:`__lt__`, and also called by :c:func:" +"methods `, like :meth:`!__lt__`, and also called by :c:func:" "`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." msgstr "" @@ -470,7 +471,7 @@ msgid "" "take exactly one parameter, the instance for which they are being called, " "and return a new reference. In the case of an error, they should set an " "exception and return ``NULL``. :c:member:`~PyTypeObject.tp_iter` " -"corresponds to the Python :meth:`__iter__` method, while :c:member:" +"corresponds to the Python :meth:`~object.__iter__` method, while :c:member:" "`~PyTypeObject.tp_iternext` corresponds to the Python :meth:`~iterator." "__next__` method." msgstr "" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index b1cbf67407..b28bcd6288 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -53,8 +53,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:38 msgid "" "This sort of thing can only be explained by example, so here's a minimal, " -"but complete, module that defines a new type named :class:`Custom` inside a " -"C extension module :mod:`custom`:" +"but complete, module that defines a new type named :class:`!Custom` inside a " +"C extension module :mod:`!custom`:" msgstr "" #: ../../extending/newtypes_tutorial.rst:43 @@ -73,20 +73,20 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:53 msgid "" -"What a :class:`Custom` **object** contains: this is the ``CustomObject`` " -"struct, which is allocated once for each :class:`Custom` instance." +"What a :class:`!Custom` **object** contains: this is the ``CustomObject`` " +"struct, which is allocated once for each :class:`!Custom` instance." msgstr "" #: ../../extending/newtypes_tutorial.rst:55 msgid "" -"How the :class:`Custom` **type** behaves: this is the ``CustomType`` struct, " -"which defines a set of flags and function pointers that the interpreter " -"inspects when specific operations are requested." +"How the :class:`!Custom` **type** behaves: this is the ``CustomType`` " +"struct, which defines a set of flags and function pointers that the " +"interpreter inspects when specific operations are requested." msgstr "" #: ../../extending/newtypes_tutorial.rst:58 msgid "" -"How to initialize the :mod:`custom` module: this is the ``PyInit_custom`` " +"How to initialize the :mod:`!custom` module: this is the ``PyInit_custom`` " "function and the associated ``custommodule`` struct." msgstr "" @@ -156,16 +156,16 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:129 msgid "" "Note that the name is a dotted name that includes both the module name and " -"the name of the type within the module. The module in this case is :mod:" -"`custom` and the type is :class:`Custom`, so we set the type name to :class:" -"`custom.Custom`. Using the real dotted import path is important to make your " -"type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" +"the name of the type within the module. The module in this case is :mod:`!" +"custom` and the type is :class:`!Custom`, so we set the type name to :class:" +"`!custom.Custom`. Using the real dotted import path is important to make " +"your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:138 msgid "" "This is so that Python knows how much memory to allocate when creating new :" -"class:`Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only " +"class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only " "used for variable-sized objects and should otherwise be zero." msgstr "" @@ -175,9 +175,9 @@ msgid "" "same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have " "problems with multiple inheritance. A Python subclass of your type will " "have to list your type first in its :attr:`~class.__bases__`, or else it " -"will not be able to call your type's :meth:`__new__` method without getting " -"an error. You can avoid this problem by ensuring that your type has a " -"larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " +"will not be able to call your type's :meth:`~object.__new__` method without " +"getting an error. You can avoid this problem by ensuring that your type has " +"a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " "does. Most of the time, this will be true anyway, because either your base " "type will be :class:`object`, or else you will be adding data members to " "your base type, and therefore increasing its size." @@ -202,29 +202,29 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:166 msgid "" "To enable object creation, we have to provide a :c:member:`~PyTypeObject." -"tp_new` handler. This is the equivalent of the Python method :meth:" -"`__new__`, but has to be specified explicitly. In this case, we can just " -"use the default implementation provided by the API function :c:func:" +"tp_new` handler. This is the equivalent of the Python method :meth:`~object." +"__new__`, but has to be specified explicitly. In this case, we can just use " +"the default implementation provided by the API function :c:func:" "`PyType_GenericNew`. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:173 msgid "" "Everything else in the file should be familiar, except for some code in :c:" -"func:`PyInit_custom`::" +"func:`!PyInit_custom`::" msgstr "" #: ../../extending/newtypes_tutorial.rst:179 msgid "" -"This initializes the :class:`Custom` type, filling in a number of members to " -"the appropriate default values, including :attr:`ob_type` that we initially " -"set to ``NULL``. ::" +"This initializes the :class:`!Custom` type, filling in a number of members " +"to the appropriate default values, including :c:member:`~PyObject.ob_type` " +"that we initially set to ``NULL``. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:190 msgid "" "This adds the type to the module dictionary. This allows us to create :" -"class:`Custom` instances by calling the :class:`Custom` class:" +"class:`!Custom` instances by calling the :class:`!Custom` class:" msgstr "" #: ../../extending/newtypes_tutorial.rst:198 @@ -256,7 +256,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:223 msgid "" -"While this documentation showcases the standard :mod:`distutils` module for " +"While this documentation showcases the standard :mod:`!distutils` module for " "building C extensions, it is recommended in real-world use cases to use the " "newer and better-maintained ``setuptools`` library. Documentation on how to " "do this is out of scope for this document and can be found in the `Python " @@ -271,8 +271,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:233 msgid "" "Let's extend the basic example to add some data and methods. Let's also " -"make the type usable as a base class. We'll create a new module, :mod:" -"`custom2` that adds these capabilities:" +"make the type usable as a base class. We'll create a new module, :mod:`!" +"custom2` that adds these capabilities:" msgstr "" #: ../../extending/newtypes_tutorial.rst:240 @@ -281,7 +281,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:242 msgid "" -"The :class:`Custom` type now has three data attributes in its C struct, " +"The :class:`!Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " "strings containing first and last names. The *number* attribute is a C " "integer." @@ -308,8 +308,8 @@ msgid "" "``NULL`` (which might happen here if ``tp_new`` failed midway). It then " "calls the :c:member:`~PyTypeObject.tp_free` member of the object's type " "(computed by ``Py_TYPE(self)``) to free the object's memory. Note that the " -"object's type might not be :class:`CustomType`, because the object may be an " -"instance of a subclass." +"object's type might not be :class:`!CustomType`, because the object may be " +"an instance of a subclass." msgstr "" #: ../../extending/newtypes_tutorial.rst:279 @@ -335,11 +335,11 @@ msgstr "" msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" -"`__new__` method. It is not required to define a ``tp_new`` member, and " -"indeed many extension types will simply reuse :c:func:`PyType_GenericNew` as " -"done in the first version of the ``Custom`` type above. In this case, we " -"use the ``tp_new`` handler to initialize the ``first`` and ``last`` " -"attributes to non-``NULL`` default values." +"`~object.__new__` method. It is not required to define a ``tp_new`` member, " +"and indeed many extension types will simply reuse :c:func:" +"`PyType_GenericNew` as done in the first version of the :class:`!Custom` " +"type above. In this case, we use the ``tp_new`` handler to initialize the " +"``first`` and ``last`` attributes to non-``NULL`` default values." msgstr "" #: ../../extending/newtypes_tutorial.rst:321 @@ -381,8 +381,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:347 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " -"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:" -"`__new__`), you must *not* try to determine what method to call using method " +"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." +"__new__`), you must *not* try to determine what method to call using method " "resolution order at runtime. Always statically determine what type you are " "going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or " "via ``type->tp_base->tp_new``. If you do not do this, Python subclasses of " @@ -404,17 +404,17 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:390 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" -"`__init__` method. It is used to initialize an object after it's created. " -"Initializers always accept positional and keyword arguments, and they should " -"return either ``0`` on success or ``-1`` on error." +"`~object.__init__` method. It is used to initialize an object after it's " +"created. Initializers always accept positional and keyword arguments, and " +"they should return either ``0`` on success or ``-1`` on error." msgstr "" #: ../../extending/newtypes_tutorial.rst:395 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " -"call :meth:`__init__` on unpickled instances). It can also be called " -"multiple times. Anyone can call the :meth:`__init__` method on our " +"call :meth:`~object.__init__` on unpickled instances). It can also be " +"called multiple times. Anyone can call the :meth:`!__init__` method on our " "objects. For this reason, we have to be extra careful when assigning the " "new attribute values. We might be tempted, for example to assign the " "``first`` member like this::" @@ -485,14 +485,14 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:456 msgid "" -"We define a single method, :meth:`Custom.name()`, that outputs the objects " +"We define a single method, :meth:`!Custom.name()`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" #: ../../extending/newtypes_tutorial.rst:473 msgid "" -"The method is implemented as a C function that takes a :class:`Custom` (or :" -"class:`Custom` subclass) instance as the first argument. Methods always " +"The method is implemented as a C function that takes a :class:`!Custom` (or :" +"class:`!Custom` subclass) instance as the first argument. Methods always " "take an instance as the first argument. Methods often take positional and " "keyword arguments as well, but in this case we don't take any and don't need " "to accept a positional argument tuple or keyword argument dictionary. This " @@ -501,8 +501,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:485 msgid "" -"Note that we have to check for the possibility that our :attr:`first` and :" -"attr:`last` members are ``NULL``. This is because they can be deleted, in " +"Note that we have to check for the possibility that our :attr:`!first` and :" +"attr:`!last` members are ``NULL``. This is because they can be deleted, in " "which case they are set to ``NULL``. It would be better to prevent deletion " "of these attributes and to restrict the attribute values to be strings. " "We'll see how to do that in the next section." @@ -534,7 +534,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:515 msgid "" -"We rename :c:func:`PyInit_custom` to :c:func:`PyInit_custom2`, update the " +"We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" @@ -549,23 +549,23 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:534 msgid "" -"In this section, we'll provide finer control over how the :attr:`first` and :" -"attr:`last` attributes are set in the :class:`Custom` example. In the " -"previous version of our module, the instance variables :attr:`first` and :" -"attr:`last` could be set to non-string values or even deleted. We want to " +"In this section, we'll provide finer control over how the :attr:`!first` " +"and :attr:`!last` attributes are set in the :class:`!Custom` example. In the " +"previous version of our module, the instance variables :attr:`!first` and :" +"attr:`!last` could be set to non-string values or even deleted. We want to " "make sure that these attributes always contain strings." msgstr "" #: ../../extending/newtypes_tutorial.rst:543 msgid "" -"To provide greater control, over the :attr:`first` and :attr:`last` " +"To provide greater control, over the :attr:`!first` and :attr:`!last` " "attributes, we'll use custom getter and setter functions. Here are the " -"functions for getting and setting the :attr:`first` attribute::" +"functions for getting and setting the :attr:`!first` attribute::" msgstr "" #: ../../extending/newtypes_tutorial.rst:574 msgid "" -"The getter function is passed a :class:`Custom` object and a \"closure\", " +"The getter function is passed a :class:`!Custom` object and a \"closure\", " "which is a void pointer. In this case, the closure is ignored. (The " "closure supports an advanced usage in which definition data is passed to the " "getter and setter. This could, for example, be used to allow a single set of " @@ -575,10 +575,10 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:580 msgid "" -"The setter function is passed the :class:`Custom` object, the new value, and " -"the closure. The new value may be ``NULL``, in which case the attribute is " -"being deleted. In our setter, we raise an error if the attribute is deleted " -"or if its new value is not a string." +"The setter function is passed the :class:`!Custom` object, the new value, " +"and the closure. The new value may be ``NULL``, in which case the attribute " +"is being deleted. In our setter, we raise an error if the attribute is " +"deleted or if its new value is not a string." msgstr "" #: ../../extending/newtypes_tutorial.rst:585 @@ -644,19 +644,19 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:669 msgid "" -"In the second version of the :class:`Custom` example, we allowed any kind of " -"object to be stored in the :attr:`first` or :attr:`last` attributes [#]_. " -"Besides, in the second and third versions, we allowed subclassing :class:" -"`Custom`, and subclasses may add arbitrary attributes. For any of those two " -"reasons, :class:`Custom` objects can participate in cycles:" +"In the second version of the :class:`!Custom` example, we allowed any kind " +"of object to be stored in the :attr:`!first` or :attr:`!last` attributes " +"[#]_. Besides, in the second and third versions, we allowed subclassing :" +"class:`!Custom`, and subclasses may add arbitrary attributes. For any of " +"those two reasons, :class:`!Custom` objects can participate in cycles:" msgstr "" #: ../../extending/newtypes_tutorial.rst:683 msgid "" -"To allow a :class:`Custom` instance participating in a reference cycle to be " -"properly detected and collected by the cyclic GC, our :class:`Custom` type " -"needs to fill two additional slots and to enable a flag that enables these " -"slots:" +"To allow a :class:`!Custom` instance participating in a reference cycle to " +"be properly detected and collected by the cyclic GC, our :class:`!Custom` " +"type needs to fill two additional slots and to enable a flag that enables " +"these slots:" msgstr "" #: ../../extending/newtypes_tutorial.rst:690 @@ -668,8 +668,8 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:710 msgid "" "For each subobject that can participate in cycles, we need to call the :c:" -"func:`visit` function, which is passed to the traversal method. The :c:func:" -"`visit` function takes as arguments the subobject and the extra argument " +"func:`!visit` function, which is passed to the traversal method. The :c:func:" +"`!visit` function takes as arguments the subobject and the extra argument " "*arg* passed to the traversal method. It returns an integer value that must " "be returned if it is non-zero." msgstr "" @@ -751,15 +751,15 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:794 msgid "" -"In this example we will create a :class:`SubList` type that inherits from " +"In this example we will create a :class:`!SubList` type that inherits from " "the built-in :class:`list` type. The new type will be completely compatible " -"with regular lists, but will have an additional :meth:`increment` method " +"with regular lists, but will have an additional :meth:`!increment` method " "that increases an internal counter:" msgstr "" #: ../../extending/newtypes_tutorial.rst:814 msgid "" -"As you can see, the source code closely resembles the :class:`Custom` " +"As you can see, the source code closely resembles the :class:`!Custom` " "examples in previous sections. We will break down the main differences " "between them. ::" msgstr "" @@ -773,15 +773,15 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:826 msgid "" -"When a Python object is a :class:`SubList` instance, its ``PyObject *`` " +"When a Python object is a :class:`!SubList` instance, its ``PyObject *`` " "pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " "*``::" msgstr "" #: ../../extending/newtypes_tutorial.rst:838 msgid "" -"We see above how to call through to the :attr:`__init__` method of the base " -"type." +"We see above how to call through to the :meth:`~object.__init__` method of " +"the base type." msgstr "" #: ../../extending/newtypes_tutorial.rst:841 @@ -814,7 +814,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:881 msgid "" "After that, calling :c:func:`PyType_Ready` and adding the type object to the " -"module is the same as with the basic :class:`Custom` examples." +"module is the same as with the basic :class:`!Custom` examples." msgstr "" #: ../../extending/newtypes_tutorial.rst:886 diff --git a/howto/clinic.po b/howto/clinic.po index eb225b5e6e..e873f731db 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-25 00:04+0000\n" +"POT-Creation-Date: 2023-07-28 00:03+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-" @@ -30,35 +30,45 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" +#: ../../howto/clinic.rst:11 +msgid "**Source code:** :source:`Tools/clinic/clinic.py`." +msgstr "**原始碼:** :source:`Tools/clinic/clinic.py`。" + #: ../../howto/clinic.rst:7 msgid "Abstract" msgstr "摘要" -#: ../../howto/clinic.rst:14 +#: ../../howto/clinic.rst:15 msgid "" "Argument Clinic is a preprocessor for CPython C files. Its purpose is to " "automate all the boilerplate involved with writing argument parsing code for " "\"builtins\", module level functions, and class methods. This document is " -"divided in three major sections:" +"divided in four major sections:" msgstr "" -#: ../../howto/clinic.rst:20 +#: ../../howto/clinic.rst:21 msgid "" ":ref:`clinic-background` talks about the basic concepts and goals of " "Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:22 +#: ../../howto/clinic.rst:23 +msgid "" +":ref:`clinic-reference` describes the command-line interface and Argument " +"Clinic terminology." +msgstr "" + +#: ../../howto/clinic.rst:25 msgid "" ":ref:`clinic-tutorial` guides you through all the steps required to adapt an " "existing C function to Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:24 +#: ../../howto/clinic.rst:27 msgid ":ref:`clinic-howtos` details how to handle specific tasks." msgstr "" -#: ../../howto/clinic.rst:29 +#: ../../howto/clinic.rst:32 msgid "" "Argument Clinic is considered internal-only for CPython. Its use is not " "supported for files outside CPython, and no guarantees are made regarding " @@ -69,15 +79,15 @@ msgid "" "and break all your code." msgstr "" -#: ../../howto/clinic.rst:42 +#: ../../howto/clinic.rst:45 msgid "Background" msgstr "" -#: ../../howto/clinic.rst:46 +#: ../../howto/clinic.rst:49 msgid "The goals of Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:48 +#: ../../howto/clinic.rst:51 msgid "" "Argument Clinic's primary goal is to take over responsibility for all " "argument parsing code inside CPython. This means that, when you convert a " @@ -88,7 +98,7 @@ msgid "" "*kwargs``) magically converted into the C variables and types you need." msgstr "" -#: ../../howto/clinic.rst:58 +#: ../../howto/clinic.rst:61 msgid "" "In order for Argument Clinic to accomplish its primary goal, it must be easy " "to use. Currently, working with CPython's argument parsing library is a " @@ -96,7 +106,7 @@ msgid "" "places. When you use Argument Clinic, you don't have to repeat yourself." msgstr "" -#: ../../howto/clinic.rst:64 +#: ../../howto/clinic.rst:67 msgid "" "Obviously, no one would want to use Argument Clinic unless it's solving " "their problem—and without creating new problems of its own. So it's " @@ -108,14 +118,14 @@ msgid "" "parsing library. That would make for the fastest argument parsing possible!)" msgstr "" -#: ../../howto/clinic.rst:76 +#: ../../howto/clinic.rst:79 msgid "" "Additionally, Argument Clinic must be flexible enough to work with any " "approach to argument parsing. Python has some functions with some very " "strange parsing behaviors; Argument Clinic's goal is to support all of them." msgstr "" -#: ../../howto/clinic.rst:81 +#: ../../howto/clinic.rst:84 msgid "" "Finally, the original motivation for Argument Clinic was to provide " "introspection \"signatures\" for CPython builtins. It used to be, the " @@ -123,7 +133,7 @@ msgid "" "builtin. With Argument Clinic, that's a thing of the past!" msgstr "" -#: ../../howto/clinic.rst:87 +#: ../../howto/clinic.rst:90 msgid "" "One idea you should keep in mind, as you work with Argument Clinic: the more " "information you give it, the better job it'll be able to do. Argument Clinic " @@ -132,147 +142,221 @@ msgid "" "things with all the information you give it." msgstr "" -#: ../../howto/clinic.rst:97 -msgid "Basic concepts and usage" +#: ../../howto/clinic.rst:100 +msgid "Basic concepts" msgstr "" -#: ../../howto/clinic.rst:99 +#: ../../howto/clinic.rst:102 msgid "" -"Argument Clinic ships with CPython; you'll find it in :source:`Tools/clinic/" -"clinic.py`. If you run that script, specifying a C file as an argument:" +"When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " +"via ``make clinic``, it will scan over the input files looking for :term:" +"`start lines `:" msgstr "" -#: ../../howto/clinic.rst:107 +#: ../../howto/clinic.rst:110 +msgid "When it finds one, it reads everything up to the :term:`end line`:" +msgstr "" + +#: ../../howto/clinic.rst:116 msgid "" -"Argument Clinic will scan over the file looking for lines that look exactly " -"like this:" +"Everything in between these two lines is Argument Clinic :term:`input`. When " +"Argument Clinic parses input, it generates :term:`output`. The output is " +"rewritten into the C file immediately after the input, followed by a :term:" +"`checksum line`. All of these lines, including the :term:`start line` and :" +"term:`checksum line`, are collectively called an Argument Clinic :term:" +"`block`:" msgstr "" -#: ../../howto/clinic.rst:114 +#: ../../howto/clinic.rst:131 msgid "" -"When it finds one, it reads everything up to a line that looks exactly like " -"this:" +"If you run Argument Clinic on the same file a second time, Argument Clinic " +"will discard the old :term:`output` and write out the new output with a " +"fresh :term:`checksum line`. If the :term:`input` hasn't changed, the output " +"won't change either." msgstr "" -#: ../../howto/clinic.rst:121 +#: ../../howto/clinic.rst:138 msgid "" -"Everything in between these two lines is input for Argument Clinic. All of " -"these lines, including the beginning and ending comment lines, are " -"collectively called an Argument Clinic \"block\"." +"You should never modify the output of an Argument Clinic block, as any " +"change will be lost in future Argument Clinic runs; Argument Clinic will " +"detect an output checksum mismatch and regenerate the correct output. If you " +"are not happy with the generated output, you should instead change the input " +"until it produces the output you want." msgstr "" -#: ../../howto/clinic.rst:125 +#: ../../howto/clinic.rst:149 +msgid "Reference" +msgstr "" + +#: ../../howto/clinic.rst:155 +msgid "Terminology" +msgstr "" + +#: ../../howto/clinic.rst:158 +msgid "start line" +msgstr "" + +#: ../../howto/clinic.rst:160 msgid "" -"When Argument Clinic parses one of these blocks, it generates output. This " -"output is rewritten into the C file immediately after the block, followed by " -"a comment containing a checksum. The Argument Clinic block now looks like " -"this:" +"The line ``/*[clinic input]``. This line marks the beginning of Argument " +"Clinic input. Note that the *start line* opens a C block comment." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:163 +msgid "end line" +msgstr "" + +#: ../../howto/clinic.rst:165 msgid "" -"If you run Argument Clinic on the same file a second time, Argument Clinic " -"will discard the old output and write out the new output with a fresh " -"checksum line. However, if the input hasn't changed, the output won't " -"change either." +"The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " +"of Argument Clinic :term:`input`, but at the same time marks the _start_ of " +"Argument Clinic :term:`output`, thus the text *\"clinic start start " +"generated code\"* Note that the *end line* closes the C block comment opened " +"by the *start line*." msgstr "" -#: ../../howto/clinic.rst:142 +#: ../../howto/clinic.rst:171 +msgid "checksum" +msgstr "" + +#: ../../howto/clinic.rst:173 msgid "" -"You should never modify the output portion of an Argument Clinic block. " -"Instead, change the input until it produces the output you want. (That's " -"the purpose of the checksum—to detect if someone changed the output, as " -"these edits would be lost the next time Argument Clinic writes out fresh " -"output.)" +"A hash to distinguish unique :term:`inputs ` and :term:`outputs " +"`." +msgstr "" + +#: ../../howto/clinic.rst:175 +msgid "checksum line" msgstr "" -#: ../../howto/clinic.rst:147 +#: ../../howto/clinic.rst:177 msgid "" -"For the sake of clarity, here's the terminology we'll use with Argument " -"Clinic:" +"A line that looks like ``/*[clinic end generated code: ...]*/``. The three " +"dots will be replaced by a :term:`checksum` generated from the :term:" +"`input`, and a :term:`checksum` generated from the :term:`output`. The " +"checksum line marks the end of Argument Clinic generated code, and is used " +"by Argument Clinic to determine if it needs to regenerate output." msgstr "" -#: ../../howto/clinic.rst:149 +#: ../../howto/clinic.rst:183 +msgid "input" +msgstr "" + +#: ../../howto/clinic.rst:185 msgid "" -"The first line of the comment (``/*[clinic input]``) is the *start line*." +"The text between the :term:`start line` and the :term:`end line`. Note that " +"the start and end lines open and close a C block comment; the *input* is " +"thus a part of that same C block comment." +msgstr "" + +#: ../../howto/clinic.rst:188 +msgid "output" +msgstr "" + +#: ../../howto/clinic.rst:190 +msgid "The text between the :term:`end line` and the :term:`checksum line`." msgstr "" -#: ../../howto/clinic.rst:150 +#: ../../howto/clinic.rst:191 +msgid "block" +msgstr "" + +#: ../../howto/clinic.rst:193 msgid "" -"The last line of the initial comment (``[clinic start generated code]*/``) " -"is the *end line*." +"All text from the :term:`start line` to the :term:`checksum line` " +"inclusively." msgstr "" -#: ../../howto/clinic.rst:151 +#: ../../howto/clinic.rst:199 +msgid "Command-line interface" +msgstr "" + +#: ../../howto/clinic.rst:201 msgid "" -"The last line (``/*[clinic end generated code: checksum=...]*/``) is the " -"*checksum line*." +"The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " +"to process a single source file, like this:" msgstr "" -#: ../../howto/clinic.rst:152 -msgid "In between the start line and the end line is the *input*." +#: ../../howto/clinic.rst:208 +msgid "The CLI supports the following options:" msgstr "" -#: ../../howto/clinic.rst:153 -msgid "In between the end line and the checksum line is the *output*." +#: ../../howto/clinic.rst:215 +msgid "Print CLI usage." msgstr "" -#: ../../howto/clinic.rst:154 -msgid "" -"All the text collectively, from the start line to the checksum line " -"inclusively, is the *block*. (A block that hasn't been successfully " -"processed by Argument Clinic yet doesn't have output or a checksum line, but " -"it's still considered a block.)" +#: ../../howto/clinic.rst:219 +msgid "Force output regeneration." msgstr "" -#: ../../howto/clinic.rst:163 +#: ../../howto/clinic.rst:223 +msgid "Redirect file output to OUTPUT" +msgstr "" + +#: ../../howto/clinic.rst:227 +msgid "Enable verbose mode." +msgstr "" + +#: ../../howto/clinic.rst:231 +msgid "Print a list of all supported converters and return converters." +msgstr "" + +#: ../../howto/clinic.rst:235 +msgid "Walk :option:`--srcdir` to run over all relevant files." +msgstr "" + +#: ../../howto/clinic.rst:239 +msgid "The directory tree to walk in :option:`--make` mode." +msgstr "" + +#: ../../howto/clinic.rst:243 +msgid "The list of files to process." +msgstr "" + +#: ../../howto/clinic.rst:249 msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:165 +#: ../../howto/clinic.rst:251 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " "to follow to convert a function to work with Argument Clinic. Note that for " "code you plan to check in to CPython, you really should take the conversion " -"farther, using some of the advanced concepts you'll see later on in the " -"document (like \"return converters\" and \"self converters\"). But we'll " -"keep it simple for this walkthrough so you can learn." -msgstr "" - -#: ../../howto/clinic.rst:174 -msgid "Let's dive in!" +"farther, using some of the :ref:`advanced concepts ` you'll " +"see later on in the document, like :ref:`clinic-howto-return-converters` " +"and :ref:`clinic-howto-self-converter`. But we'll keep it simple for this " +"walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:176 +#: ../../howto/clinic.rst:262 msgid "" -"Make sure you're working with a freshly updated checkout of the CPython " -"trunk." +"First, make sure you're working with a freshly updated checkout of the " +"CPython trunk." msgstr "" -#: ../../howto/clinic.rst:179 +#: ../../howto/clinic.rst:265 msgid "" -"Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" -"func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For my example I'm using :py:meth:`_pickle.Pickler.dump " -"`." +"Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" +"c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " +"Argument Clinic yet. For this tutorial, we'll be using :py:meth:`_pickle." +"Pickler.dump `." msgstr "" -#: ../../howto/clinic.rst:185 +#: ../../howto/clinic.rst:271 msgid "" "If the call to the :c:func:`!PyArg_Parse*` function uses any of the " -"following format units:" +"following format units...:" msgstr "" -#: ../../howto/clinic.rst:197 +#: ../../howto/clinic.rst:283 msgid "" -"or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " -"a different function. Argument Clinic *does* support all of these " -"scenarios. But these are advanced topics—let's do something simpler for " -"your first function." +"... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " +"choose a different function. (See :ref:`clinic-howto-advanced-converters` " +"for those scenarios.)" msgstr "" -#: ../../howto/clinic.rst:202 +#: ../../howto/clinic.rst:287 msgid "" "Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" "c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " @@ -282,215 +366,218 @@ msgid "" "functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:209 -msgid "Add the following boilerplate above the function, creating our block::" +#: ../../howto/clinic.rst:294 +msgid "" +"Next, add the following boilerplate above the function, creating our input " +"block::" msgstr "" -#: ../../howto/clinic.rst:214 +#: ../../howto/clinic.rst:300 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " "should have just the text, based at the left margin, with no line wider than " -"80 characters. (Argument Clinic will preserve indents inside the docstring.)" +"80 characters. Argument Clinic will preserve indents inside the docstring." msgstr "" -#: ../../howto/clinic.rst:220 +#: ../../howto/clinic.rst:306 msgid "" "If the old docstring had a first line that looked like a function signature, " -"throw that line away. (The docstring doesn't need it anymore—when you use :" -"py:func:`help` on your builtin in the future, the first line will be built " -"automatically based on the function's signature.)" +"throw that line away; The docstring doesn't need it anymore --- when you " +"use :py:func:`help` on your builtin in the future, the first line will be " +"built automatically based on the function's signature." msgstr "" -#: ../../howto/clinic.rst:226 ../../howto/clinic.rst:247 -#: ../../howto/clinic.rst:271 ../../howto/clinic.rst:329 -#: ../../howto/clinic.rst:369 ../../howto/clinic.rst:396 -#: ../../howto/clinic.rst:502 ../../howto/clinic.rst:554 -msgid "Sample::" +#: ../../howto/clinic.rst:311 +msgid "Example docstring summary line::" msgstr "" -#: ../../howto/clinic.rst:232 +#: ../../howto/clinic.rst:317 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " -"complain. So let's make sure it has one. The \"summary\" line should be a " +"complain, so let's make sure it has one. The \"summary\" line should be a " "paragraph consisting of a single 80-column line at the beginning of the " -"docstring." +"docstring. (See :pep:`257` regarding docstring conventions.)" +msgstr "" + +#: ../../howto/clinic.rst:323 +msgid "" +"Our example docstring consists solely of a summary line, so the sample code " +"doesn't have to change for this step." msgstr "" -#: ../../howto/clinic.rst:237 +#: ../../howto/clinic.rst:326 msgid "" -"(Our example docstring consists solely of a summary line, so the sample code " -"doesn't have to change for this step.)" +"Now, above the docstring, enter the name of the function, followed by a " +"blank line. This should be the Python name of the function, and should be " +"the full dotted path to the function --- it should start with the name of " +"the module, include any sub-modules, and if the function is a method on a " +"class it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:240 +#: ../../howto/clinic.rst:333 msgid "" -"Above the docstring, enter the name of the function, followed by a blank " -"line. This should be the Python name of the function, and should be the " -"full dotted path to the function—it should start with the name of the " -"module, include any sub-modules, and if the function is a method on a class " -"it should include the class name too." +"In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " +"class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" +"_pickle.Pickler.dump`::" msgstr "" -#: ../../howto/clinic.rst:255 +#: ../../howto/clinic.rst:343 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " "Argument Clinic hygiene prefers declaring these in a separate block " "somewhere near the top of the C file, in the same way that include files and " -"statics go at the top. (In our sample code we'll just show the two blocks " -"next to each other.)" +"statics go at the top. In our sample code we'll just show the two blocks " +"next to each other." msgstr "" -#: ../../howto/clinic.rst:263 +#: ../../howto/clinic.rst:351 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:267 +#: ../../howto/clinic.rst:355 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`!PyTypeObject` for this class." +"class, and a pointer to the :c:type:`!PyTypeObject` for this class::" msgstr "" -#: ../../howto/clinic.rst:287 +#: ../../howto/clinic.rst:370 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " -"name and the docstring." -msgstr "" - -#: ../../howto/clinic.rst:291 -msgid "The general form of these parameter lines is as follows:" +"name and the docstring. The general form of these parameter lines is as " +"follows:" msgstr "" -#: ../../howto/clinic.rst:297 +#: ../../howto/clinic.rst:379 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:304 +#: ../../howto/clinic.rst:386 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " -"please see :ref:`the section below on default values ` for " -"more information." +"see :ref:`clinic-howto-default-values` for more information." msgstr "" -#: ../../howto/clinic.rst:308 -msgid "Add a blank line below the parameters." +#: ../../howto/clinic.rst:389 +msgid "Next, add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:310 +#: ../../howto/clinic.rst:391 msgid "" -"What's a \"converter\"? It establishes both the type of the variable used " -"in C, and the method to convert the Python value into a C value at runtime. " -"For now you're going to use what's called a \"legacy converter\"—a " +"What's a \"converter\"? It establishes both the type of the variable used in " +"C, and the method to convert the Python value into a C value at runtime. For " +"now you're going to use what's called a \"legacy converter\" --- a " "convenience syntax intended to make porting old code into Argument Clinic " "easier." msgstr "" -#: ../../howto/clinic.rst:317 +#: ../../howto/clinic.rst:398 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the :c:" "func:`PyArg_Parse` format argument and specify *that* as its converter, as a " -"quoted string. (\"format unit\" is the formal name for the one-to-three " +"quoted string. The \"format unit\" is the formal name for the one-to-three " "character substring of the *format* parameter that tells the argument " -"parsing function what the type of the variable is and how to convert it. " -"For more on format units please see :ref:`arg-parsing`.)" +"parsing function what the type of the variable is and how to convert it. For " +"more on format units please see :ref:`arg-parsing`." msgstr "" -#: ../../howto/clinic.rst:326 +#: ../../howto/clinic.rst:407 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:344 +#: ../../howto/clinic.rst:410 ../../howto/clinic.rst:445 +#: ../../howto/clinic.rst:473 ../../howto/clinic.rst:579 +#: ../../howto/clinic.rst:632 +msgid "Sample::" +msgstr "" + +#: ../../howto/clinic.rst:425 msgid "" "If your function has ``|`` in the format string, meaning some parameters " -"have default values, you can ignore it. Argument Clinic infers which " +"have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:349 +#: ../../howto/clinic.rst:430 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:354 -msgid "" -"(:py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged.)" -msgstr "" - -#: ../../howto/clinic.rst:357 +#: ../../howto/clinic.rst:435 msgid "" -"If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" -"c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" -"only." +":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." msgstr "" -#: ../../howto/clinic.rst:361 +#: ../../howto/clinic.rst:437 msgid "" -"To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " -"a line by itself after the last parameter, indented the same as the " -"parameter lines." +"Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " +"opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " +"are positional-only." msgstr "" -#: ../../howto/clinic.rst:365 +#: ../../howto/clinic.rst:441 msgid "" -"Currently this is all-or-nothing; either all parameters are positional-only, " -"or none of them are. (In the future Argument Clinic may relax this " -"restriction.)" +"To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " +"line by itself after the last positional-only parameter, indented the same " +"as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:385 +#: ../../howto/clinic.rst:461 msgid "" -"It's helpful to write a per-parameter docstring for each parameter. But per-" -"parameter docstrings are optional; you can skip this step if you prefer." +"It can be helpful to write a per-parameter docstring for each parameter. " +"Since per-parameter docstrings are optional, you can skip this step if you " +"prefer." msgstr "" -#: ../../howto/clinic.rst:389 +#: ../../howto/clinic.rst:465 msgid "" -"Here's how to add a per-parameter docstring. The first line of the per-" -"parameter docstring must be indented further than the parameter definition. " -"The left margin of this first line establishes the left margin for the whole " -"per-parameter docstring; all the text you write will be outdented by this " -"amount. You can write as much text as you like, across multiple lines if " -"you wish." +"Nevertheless, here's how to add a per-parameter docstring. The first line of " +"the per-parameter docstring must be indented further than the parameter " +"definition. The left margin of this first line establishes the left margin " +"for the whole per-parameter docstring; all the text you write will be " +"outdented by this amount. You can write as much text as you like, across " +"multiple lines if you wish." msgstr "" -#: ../../howto/clinic.rst:413 +#: ../../howto/clinic.rst:490 msgid "" -"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " +"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a :file:`.c.h` file " -"has been generated! Reopen the file in your text editor to see::" +"has been generated! Reload the file in your text editor to see the generated " +"code::" msgstr "" -#: ../../howto/clinic.rst:432 +#: ../../howto/clinic.rst:509 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " -"found an error in your input. Keep fixing your errors and retrying until " +"found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:436 +#: ../../howto/clinic.rst:514 msgid "" "For readability, most of the glue code has been generated to a :file:`.c.h` " "file. You'll need to include that in your original :file:`.c` file, " "typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:442 +#: ../../howto/clinic.rst:520 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:445 +#: ../../howto/clinic.rst:523 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -498,49 +585,49 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:451 +#: ../../howto/clinic.rst:529 msgid "" "Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" "func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:456 +#: ../../howto/clinic.rst:534 msgid "" -"(Argument Clinic always generates its format strings with a ``:`` followed " -"by the name of the function. If the existing code's format string ends with " -"``;``, to provide usage help, this change is harmless—don't worry about it.)" +"Argument Clinic always generates its format strings with a ``:`` followed by " +"the name of the function. If the existing code's format string ends with ``;" +"``, to provide usage help, this change is harmless --- don't worry about it." msgstr "" -#: ../../howto/clinic.rst:461 +#: ../../howto/clinic.rst:539 msgid "" -"Third, for parameters whose format units require two arguments (like a " -"length variable, or an encoding string, or a pointer to a conversion " -"function), ensure that the second argument is *exactly* the same between the " -"two invocations." +"Third, for parameters whose format units require two arguments, like a " +"length variable, an encoding string, or a pointer to a conversion function, " +"ensure that the second argument is *exactly* the same between the two " +"invocations." msgstr "" -#: ../../howto/clinic.rst:466 +#: ../../howto/clinic.rst:544 msgid "" -"Fourth, inside the output portion of the block you'll find a preprocessor " +"Fourth, inside the output portion of the block, you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:473 +#: ../../howto/clinic.rst:551 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:476 +#: ../../howto/clinic.rst:554 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:481 +#: ../../howto/clinic.rst:558 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -551,74 +638,70 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:489 +#: ../../howto/clinic.rst:566 msgid "" -"Let's reiterate, just because it's kind of weird. Your code should now look " +"Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:498 +#: ../../howto/clinic.rst:575 msgid "" "Argument Clinic generated the checksum line and the function prototype just " -"above it. You should write the opening (and closing) curly braces for the " +"above it. You should write the opening and closing curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:543 +#: ../../howto/clinic.rst:621 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`!PyMethodDef` structure for this " -"function and replace it with a reference to the macro. (If the builtin is " -"at module scope, this will probably be very near the end of the file; if the " +"function? Find the existing :c:type:`!PyMethodDef` structure for this " +"function and replace it with a reference to the macro. If the builtin is at " +"module scope, this will probably be very near the end of the file; if the " "builtin is a class method, this will probably be below but relatively near " -"to the implementation.)" +"to the implementation." msgstr "" -#: ../../howto/clinic.rst:550 +#: ../../howto/clinic.rst:628 msgid "" -"Note that the body of the macro contains a trailing comma. So when you " -"replace the existing static :c:type:`!PyMethodDef` structure with the macro, " -"*don't* add a comma to the end." +"Note that the body of the macro contains a trailing comma; when you replace " +"the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " +"add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:563 +#: ../../howto/clinic.rst:640 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:567 +#: ../../howto/clinic.rst:644 msgid "" "If it does, you'll have to run ``make regen-global-objects`` to regenerate " "the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:571 +#: ../../howto/clinic.rst:647 msgid "" -"Compile, then run the relevant portions of the regression-test suite. This " -"change should not introduce any new compile-time warnings or errors, and " -"there should be no externally visible change to Python's behavior." +"Finally, compile, then run the relevant portions of the regression-test " +"suite. This change should not introduce any new compile-time warnings or " +"errors, and there should be no externally visible change to Python's " +"behavior, except for one difference: :py:func:`inspect.signature` run on " +"your function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:575 -msgid "" -"Well, except for one difference: :py:func:`inspect.signature` run on your " -"function should now provide a valid signature!" -msgstr "" - -#: ../../howto/clinic.rst:578 +#: ../../howto/clinic.rst:653 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:584 +#: ../../howto/clinic.rst:659 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:588 +#: ../../howto/clinic.rst:663 msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:590 +#: ../../howto/clinic.rst:665 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -630,19 +713,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:598 +#: ../../howto/clinic.rst:673 msgid "" "For example, if we wanted to rename the C function names generated for :py:" "meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:606 +#: ../../howto/clinic.rst:681 msgid "" "The base function would now be named :c:func:`!pickler_dumper`, and the impl " "function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:610 +#: ../../howto/clinic.rst:685 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -650,21 +733,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:624 +#: ../../howto/clinic.rst:699 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:627 +#: ../../howto/clinic.rst:702 msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:631 +#: ../../howto/clinic.rst:706 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:633 +#: ../../howto/clinic.rst:708 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -673,17 +756,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:639 +#: ../../howto/clinic.rst:714 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:719 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:646 +#: ../../howto/clinic.rst:721 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -694,7 +777,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:728 msgid "" "While functions using this approach can often be converted to use :c:func:`!" "PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -708,7 +791,7 @@ msgid "" "don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:665 +#: ../../howto/clinic.rst:740 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -718,7 +801,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:673 +#: ../../howto/clinic.rst:748 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -729,7 +812,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:682 +#: ../../howto/clinic.rst:757 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -738,11 +821,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:711 +#: ../../howto/clinic.rst:786 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:713 +#: ../../howto/clinic.rst:788 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -755,34 +838,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:724 +#: ../../howto/clinic.rst:799 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:727 +#: ../../howto/clinic.rst:802 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:730 +#: ../../howto/clinic.rst:805 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:732 +#: ../../howto/clinic.rst:807 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:737 +#: ../../howto/clinic.rst:812 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:739 +#: ../../howto/clinic.rst:814 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -791,38 +874,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:746 +#: ../../howto/clinic.rst:821 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:750 +#: ../../howto/clinic.rst:825 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:751 +#: ../../howto/clinic.rst:826 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:754 +#: ../../howto/clinic.rst:829 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:758 +#: ../../howto/clinic.rst:833 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:761 +#: ../../howto/clinic.rst:836 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -830,17 +913,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:767 +#: ../../howto/clinic.rst:842 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:775 +#: ../../howto/clinic.rst:850 msgid "*c_default*" msgstr "*c_default*" -#: ../../howto/clinic.rst:771 +#: ../../howto/clinic.rst:846 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -848,36 +931,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:780 +#: ../../howto/clinic.rst:855 msgid "*annotation*" msgstr "*annotation*" -#: ../../howto/clinic.rst:778 +#: ../../howto/clinic.rst:853 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:783 +#: ../../howto/clinic.rst:858 msgid "*unused*" msgstr "*unused*" -#: ../../howto/clinic.rst:783 +#: ../../howto/clinic.rst:858 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:785 +#: ../../howto/clinic.rst:860 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:794 +#: ../../howto/clinic.rst:869 msgid "*accept*" msgstr "*accept*" -#: ../../howto/clinic.rst:789 +#: ../../howto/clinic.rst:864 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -885,68 +968,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:794 +#: ../../howto/clinic.rst:869 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:799 +#: ../../howto/clinic.rst:874 msgid "*bitwise*" msgstr "*bitwise*" -#: ../../howto/clinic.rst:797 +#: ../../howto/clinic.rst:872 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:804 +#: ../../howto/clinic.rst:879 msgid "*converter*" msgstr "*converter*" -#: ../../howto/clinic.rst:802 +#: ../../howto/clinic.rst:877 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:809 +#: ../../howto/clinic.rst:884 msgid "*encoding*" msgstr "*encoding*" -#: ../../howto/clinic.rst:807 +#: ../../howto/clinic.rst:882 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:813 +#: ../../howto/clinic.rst:888 msgid "*subclass_of*" msgstr "*subclass_of*" -#: ../../howto/clinic.rst:812 +#: ../../howto/clinic.rst:887 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:818 +#: ../../howto/clinic.rst:893 msgid "*type*" msgstr "" -#: ../../howto/clinic.rst:816 +#: ../../howto/clinic.rst:891 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:899 msgid "*zeroes*" msgstr "*zeroes*" -#: ../../howto/clinic.rst:821 +#: ../../howto/clinic.rst:896 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -954,7 +1037,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:901 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " @@ -965,350 +1048,350 @@ msgid "" "(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:834 +#: ../../howto/clinic.rst:909 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:914 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:914 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:915 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:915 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:916 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:916 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:917 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:917 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:918 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:918 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:919 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:919 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:920 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:920 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:921 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:921 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:922 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:922 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:923 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:923 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:924 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:924 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:925 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:925 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:926 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:926 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:927 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:927 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:928 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:928 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:929 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:929 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:930 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:930 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:931 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:931 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:932 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:932 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:933 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:933 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:934 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:934 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:935 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:935 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:936 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:936 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:937 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:937 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:938 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:938 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:939 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:939 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:940 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:940 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:941 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:941 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:942 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:942 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:943 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:943 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:944 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:944 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:945 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:945 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:946 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:946 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:947 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:947 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:948 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:948 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:949 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:949 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:950 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:950 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:951 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:951 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:952 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:952 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:878 +#: ../../howto/clinic.rst:953 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:878 +#: ../../howto/clinic.rst:953 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:879 +#: ../../howto/clinic.rst:954 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:879 +#: ../../howto/clinic.rst:954 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:882 +#: ../../howto/clinic.rst:957 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:895 +#: ../../howto/clinic.rst:970 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1317,7 +1400,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:901 +#: ../../howto/clinic.rst:976 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1325,11 +1408,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:908 +#: ../../howto/clinic.rst:983 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:910 +#: ../../howto/clinic.rst:985 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1337,17 +1420,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:994 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:919 +#: ../../howto/clinic.rst:996 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:922 +#: ../../howto/clinic.rst:999 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1358,7 +1441,7 @@ msgid "" "start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:930 +#: ../../howto/clinic.rst:1007 msgid "" "When using *subclass_of*, you may also want to use the other custom argument " "for ``object()``: *type*, which lets you set the type actually used for the " @@ -1367,7 +1450,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:1013 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a :c:" @@ -1380,31 +1463,31 @@ msgid "" "parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:1027 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:951 +#: ../../howto/clinic.rst:1029 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:960 +#: ../../howto/clinic.rst:1038 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:968 +#: ../../howto/clinic.rst:1046 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:973 +#: ../../howto/clinic.rst:1051 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:975 +#: ../../howto/clinic.rst:1053 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1414,45 +1497,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:984 +#: ../../howto/clinic.rst:1062 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:986 +#: ../../howto/clinic.rst:1064 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:989 +#: ../../howto/clinic.rst:1067 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:990 +#: ../../howto/clinic.rst:1068 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:991 +#: ../../howto/clinic.rst:1069 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:992 +#: ../../howto/clinic.rst:1070 msgid "" "Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " "the name of the module" msgstr "" -#: ../../howto/clinic.rst:995 +#: ../../howto/clinic.rst:1073 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:1000 +#: ../../howto/clinic.rst:1078 msgid "Expressions as default values" msgstr "" -#: ../../howto/clinic.rst:1002 +#: ../../howto/clinic.rst:1080 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1460,11 +1543,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:1007 +#: ../../howto/clinic.rst:1085 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:1013 +#: ../../howto/clinic.rst:1091 msgid "" ":py:data:`sys.maxsize` can have different values on different platforms. " "Therefore Argument Clinic can't simply evaluate that expression locally and " @@ -1472,7 +1555,7 @@ msgid "" "evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:1018 +#: ../../howto/clinic.rst:1096 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " @@ -1480,7 +1563,7 @@ msgid "" "it:" msgstr "" -#: ../../howto/clinic.rst:1026 +#: ../../howto/clinic.rst:1104 msgid "" "If the symbol isn't found in the current module, it fails over to looking " "in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " @@ -1489,7 +1572,7 @@ msgid "" "are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1031 +#: ../../howto/clinic.rst:1109 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1497,7 +1580,7 @@ msgid "" "expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1040 +#: ../../howto/clinic.rst:1118 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1505,38 +1588,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1045 +#: ../../howto/clinic.rst:1123 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1049 +#: ../../howto/clinic.rst:1127 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1050 +#: ../../howto/clinic.rst:1128 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1129 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1052 +#: ../../howto/clinic.rst:1130 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1053 +#: ../../howto/clinic.rst:1131 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1137 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1059 +#: ../../howto/clinic.rst:1139 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1546,38 +1629,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1067 +#: ../../howto/clinic.rst:1147 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1071 +#: ../../howto/clinic.rst:1151 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1075 +#: ../../howto/clinic.rst:1155 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1088 +#: ../../howto/clinic.rst:1168 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1092 +#: ../../howto/clinic.rst:1172 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1095 +#: ../../howto/clinic.rst:1175 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1590,127 +1673,127 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1104 +#: ../../howto/clinic.rst:1184 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1118 +#: ../../howto/clinic.rst:1198 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1121 +#: ../../howto/clinic.rst:1201 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1127 +#: ../../howto/clinic.rst:1207 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1129 +#: ../../howto/clinic.rst:1209 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1213 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1135 +#: ../../howto/clinic.rst:1215 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1217 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1219 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1141 +#: ../../howto/clinic.rst:1221 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1143 +#: ../../howto/clinic.rst:1223 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1226 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1148 +#: ../../howto/clinic.rst:1228 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1231 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1159 +#: ../../howto/clinic.rst:1239 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1163 +#: ../../howto/clinic.rst:1243 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1166 +#: ../../howto/clinic.rst:1246 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1171 +#: ../../howto/clinic.rst:1251 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1173 +#: ../../howto/clinic.rst:1253 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1177 +#: ../../howto/clinic.rst:1257 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1184 +#: ../../howto/clinic.rst:1264 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1188 +#: ../../howto/clinic.rst:1268 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1199 +#: ../../howto/clinic.rst:1281 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1201 +#: ../../howto/clinic.rst:1283 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1721,13 +1804,13 @@ msgid "" "self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1210 +#: ../../howto/clinic.rst:1292 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1213 +#: ../../howto/clinic.rst:1295 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1735,18 +1818,18 @@ msgid "" "want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1229 +#: ../../howto/clinic.rst:1311 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing :" "class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1333 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1253 +#: ../../howto/clinic.rst:1335 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1756,25 +1839,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1259 +#: ../../howto/clinic.rst:1341 msgid "" "Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " "added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1271 +#: ../../howto/clinic.rst:1353 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1281 +#: ../../howto/clinic.rst:1363 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1287 +#: ../../howto/clinic.rst:1369 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1782,14 +1865,14 @@ msgid "" "appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1292 +#: ../../howto/clinic.rst:1374 msgid "" "The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " "and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " "convention." msgstr "" -#: ../../howto/clinic.rst:1296 +#: ../../howto/clinic.rst:1378 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1798,15 +1881,15 @@ msgid "" "``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1311 +#: ../../howto/clinic.rst:1393 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1315 +#: ../../howto/clinic.rst:1397 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1317 +#: ../../howto/clinic.rst:1399 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from :py:" @@ -1815,7 +1898,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1323 +#: ../../howto/clinic.rst:1405 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1824,7 +1907,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1329 +#: ../../howto/clinic.rst:1411 msgid "" "You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " "write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " @@ -1833,38 +1916,38 @@ msgid "" "Argument Clinic will be passed along to your :py:meth:`!converter_init`." msgstr "" -#: ../../howto/clinic.rst:1336 +#: ../../howto/clinic.rst:1418 msgid "" "There are some additional members of :py:class:`!CConverter` you may wish to " "specify in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1345 +#: ../../howto/clinic.rst:1427 msgid "" "The C type to use for this variable. :attr:`!type` should be a Python string " "specifying the type, e.g. ``'int'``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1352 +#: ../../howto/clinic.rst:1434 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1357 +#: ../../howto/clinic.rst:1439 msgid "" ":attr:`!default` as it should appear in Python code, as a string. Or " "``None`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1363 +#: ../../howto/clinic.rst:1445 msgid "" ":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1369 +#: ../../howto/clinic.rst:1451 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1875,29 +1958,29 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1381 +#: ../../howto/clinic.rst:1463 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1385 +#: ../../howto/clinic.rst:1467 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1391 +#: ../../howto/clinic.rst:1473 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1396 +#: ../../howto/clinic.rst:1478 msgid "" "Here's the simplest example of a custom converter, from :source:`Modules/" "zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1407 +#: ../../howto/clinic.rst:1489 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1906,7 +1989,7 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1413 +#: ../../howto/clinic.rst:1495 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " @@ -1914,18 +1997,18 @@ msgid "" "CConverter`." msgstr "" -#: ../../howto/clinic.rst:1420 +#: ../../howto/clinic.rst:1502 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1504 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1426 +#: ../../howto/clinic.rst:1508 msgid "" "Return converters must subclass :py:class:`!CReturnConverter`. There are no " "examples yet of custom return converters, because they are not widely used " @@ -1934,60 +2017,60 @@ msgid "" "CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1435 +#: ../../howto/clinic.rst:1517 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1437 +#: ../../howto/clinic.rst:1519 msgid "" "To convert a function using :c:macro:`METH_O`, make sure the function's " "single argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1449 +#: ../../howto/clinic.rst:1531 msgid "" "To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1452 +#: ../../howto/clinic.rst:1534 msgid "" "You can still use a self converter, a return converter, and specify a *type* " "argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1457 +#: ../../howto/clinic.rst:1539 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1459 +#: ../../howto/clinic.rst:1541 msgid "" "You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" "`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " "``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1463 +#: ../../howto/clinic.rst:1545 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1467 +#: ../../howto/clinic.rst:1549 msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1469 +#: ../../howto/clinic.rst:1551 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1471 +#: ../../howto/clinic.rst:1553 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1473 +#: ../../howto/clinic.rst:1555 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1996,11 +2079,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1481 +#: ../../howto/clinic.rst:1563 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1483 +#: ../../howto/clinic.rst:1565 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2009,7 +2092,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1489 +#: ../../howto/clinic.rst:1571 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2021,15 +2104,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1498 +#: ../../howto/clinic.rst:1580 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1525 +#: ../../howto/clinic.rst:1607 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1501 +#: ../../howto/clinic.rst:1583 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " @@ -2037,7 +2120,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1516 +#: ../../howto/clinic.rst:1598 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2050,45 +2133,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1559 +#: ../../howto/clinic.rst:1641 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1528 +#: ../../howto/clinic.rst:1610 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1608 -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1615 ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1768 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1614 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1539 ../../howto/clinic.rst:1635 -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1621 ../../howto/clinic.rst:1717 +#: ../../howto/clinic.rst:1771 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1536 +#: ../../howto/clinic.rst:1618 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1550 ../../howto/clinic.rst:1621 -#: ../../howto/clinic.rst:1715 +#: ../../howto/clinic.rst:1632 ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1797 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1542 +#: ../../howto/clinic.rst:1624 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2097,65 +2180,65 @@ msgid "" "for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1549 +#: ../../howto/clinic.rst:1631 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1555 ../../howto/clinic.rst:1648 -#: ../../howto/clinic.rst:1719 +#: ../../howto/clinic.rst:1637 ../../howto/clinic.rst:1730 +#: ../../howto/clinic.rst:1801 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1553 +#: ../../howto/clinic.rst:1635 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1559 ../../howto/clinic.rst:1682 +#: ../../howto/clinic.rst:1641 ../../howto/clinic.rst:1764 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1558 +#: ../../howto/clinic.rst:1640 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1561 +#: ../../howto/clinic.rst:1643 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1645 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1569 +#: ../../howto/clinic.rst:1651 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1573 +#: ../../howto/clinic.rst:1655 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1662 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1584 +#: ../../howto/clinic.rst:1666 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1593 +#: ../../howto/clinic.rst:1675 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2164,25 +2247,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1682 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1686 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1689 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1611 +#: ../../howto/clinic.rst:1693 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2190,17 +2273,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1617 +#: ../../howto/clinic.rst:1699 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1703 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1624 +#: ../../howto/clinic.rst:1706 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2210,14 +2293,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1633 +#: ../../howto/clinic.rst:1715 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1638 +#: ../../howto/clinic.rst:1720 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2226,18 +2309,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1645 +#: ../../howto/clinic.rst:1727 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1741 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1733 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2247,137 +2330,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1658 +#: ../../howto/clinic.rst:1740 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1743 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1667 +#: ../../howto/clinic.rst:1749 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1751 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1671 +#: ../../howto/clinic.rst:1753 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1677 +#: ../../howto/clinic.rst:1759 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1679 +#: ../../howto/clinic.rst:1761 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1682 +#: ../../howto/clinic.rst:1764 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1685 +#: ../../howto/clinic.rst:1767 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1771 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1692 +#: ../../howto/clinic.rst:1774 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1695 +#: ../../howto/clinic.rst:1777 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1697 +#: ../../howto/clinic.rst:1779 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1700 +#: ../../howto/clinic.rst:1782 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1701 +#: ../../howto/clinic.rst:1783 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1784 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1785 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1786 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1705 +#: ../../howto/clinic.rst:1787 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1789 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1707 +#: ../../howto/clinic.rst:1789 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1711 +#: ../../howto/clinic.rst:1793 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1792 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1713 +#: ../../howto/clinic.rst:1795 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1718 +#: ../../howto/clinic.rst:1800 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1721 +#: ../../howto/clinic.rst:1803 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1727 +#: ../../howto/clinic.rst:1809 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1813 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1738 +#: ../../howto/clinic.rst:1820 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2385,35 +2468,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1742 +#: ../../howto/clinic.rst:1824 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1745 +#: ../../howto/clinic.rst:1827 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1745 +#: ../../howto/clinic.rst:1827 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1748 +#: ../../howto/clinic.rst:1830 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1748 +#: ../../howto/clinic.rst:1830 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1750 +#: ../../howto/clinic.rst:1832 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1757 +#: ../../howto/clinic.rst:1839 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2422,36 +2505,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1764 +#: ../../howto/clinic.rst:1846 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1848 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1859 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1786 +#: ../../howto/clinic.rst:1868 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1800 +#: ../../howto/clinic.rst:1882 msgid "" "Then, remove those three lines from the :c:type:`PyMethodDef` structure, " "replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1807 +#: ../../howto/clinic.rst:1889 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2459,27 +2542,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1812 +#: ../../howto/clinic.rst:1894 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1815 +#: ../../howto/clinic.rst:1897 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1823 +#: ../../howto/clinic.rst:1905 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1827 +#: ../../howto/clinic.rst:1909 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2487,24 +2570,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1831 +#: ../../howto/clinic.rst:1913 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1839 +#: ../../howto/clinic.rst:1921 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1845 +#: ../../howto/clinic.rst:1927 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1847 +#: ../../howto/clinic.rst:1929 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2512,7 +2595,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1852 +#: ../../howto/clinic.rst:1934 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/howto/descriptor.po b/howto/descriptor.po index 14130dcaee..4b624d303c 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-25 00:20+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -551,8 +551,8 @@ msgstr "" #: ../../howto/descriptor.rst:782 msgid "" -"The full C implementation can be found in :c:func:`type_getattro()` and :c:" -"func:`_PyType_Lookup()` in :source:`Objects/typeobject.c`." +"The full C implementation can be found in :c:func:`!type_getattro` and :c:" +"func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." msgstr "" #: ../../howto/descriptor.rst:787 @@ -575,7 +575,7 @@ msgstr "" #: ../../howto/descriptor.rst:797 msgid "" -"The full C implementation can be found in :c:func:`super_getattro()` in :" +"The full C implementation can be found in :c:func:`!super_getattro` in :" "source:`Objects/typeobject.c`. A pure Python equivalent can be found in " "`Guido's Tutorial `_." @@ -643,8 +643,8 @@ msgstr "" #: ../../howto/descriptor.rst:839 msgid "" -"The implementation details are in :c:func:`type_new()` and :c:func:" -"`set_names()` in :source:`Objects/typeobject.c`." +"The implementation details are in :c:func:`!type_new` and :c:func:`!" +"set_names` in :source:`Objects/typeobject.c`." msgstr "" #: ../../howto/descriptor.rst:842 diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 7988568fb5..d422a77854 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-27 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -549,9 +549,10 @@ msgstr "" msgid "" "Slot methods—the fast C equivalents for special methods, such as :c:member:" "`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or :c:member:" -"`~PyType.tp_new` for initialization—have a very simple API that doesn't " -"allow passing in the defining class, unlike with :c:type:`PyCMethod`. The " -"same goes for getters and setters defined with :c:type:`PyGetSetDef`." +"`~PyTypeObject.tp_new` for initialization—have a very simple API that " +"doesn't allow passing in the defining class, unlike with :c:type:" +"`PyCMethod`. The same goes for getters and setters defined with :c:type:" +"`PyGetSetDef`." msgstr "" #: ../../howto/isolating-extensions.rst:475 diff --git a/install/index.po b/install/index.po index ee720a6ebc..7495a79c10 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -551,8 +551,8 @@ msgstr "" #: ../../install/index.rst:375 msgid "" "To make Python find the distributions installed with this scheme, you may " -"have to :ref:`modify Python's search path ` or edit :mod:" -"`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit :" +"have to :ref:`modify Python's search path ` or edit :mod:`!" +"sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit :" "data:`sys.path`." msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po index 2265fdcd2c..5638093bd0 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -259,16 +259,15 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:175 -msgid ":const:`0` -- relative to the start of the file (:const:`os.SEEK_SET`)" +msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" msgstr "" #: ../../library/fcntl.rst:176 -msgid "" -":const:`1` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" +msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" msgstr "" #: ../../library/fcntl.rst:177 -msgid ":const:`2` -- relative to the end of the file (:const:`os.SEEK_END`)" +msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" msgstr "" #: ../../library/fcntl.rst:179 diff --git a/library/fractions.po b/library/fractions.po index 0c6547260d..ba6fd3084a 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -41,8 +41,8 @@ msgstr "" msgid "" "The first version requires that *numerator* and *denominator* are instances " "of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " -"with value ``numerator/denominator``. If *denominator* is :const:`0`, it " -"raises a :exc:`ZeroDivisionError`. The second version requires that " +"with value ``numerator/denominator``. If *denominator* is ``0``, it raises " +"a :exc:`ZeroDivisionError`. The second version requires that " "*other_fraction* is an instance of :class:`numbers.Rational` and returns a :" "class:`Fraction` instance with the same value. The next two versions accept " "either a :class:`float` or a :class:`decimal.Decimal` instance, and return " diff --git a/library/importlib.po b/library/importlib.po index 0d8ed9706a..9ebc47b3d0 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/importlib.rst:2 msgid ":mod:`!importlib` --- The implementation of :keyword:`!import`" -msgstr "" +msgstr ":mod:`!importlib` --- :keyword:`!import` 的實作" #: ../../library/importlib.rst:12 msgid "**Source code:** :source:`Lib/importlib/__init__.py`" @@ -670,15 +670,15 @@ msgstr "" #: ../../library/importlib.rst:488 msgid "Implementation of :meth:`Loader.exec_module`." -msgstr "" +msgstr ":meth:`Loader.exec_module` 的實作。" #: ../../library/importlib.rst:494 msgid "Implementation of :meth:`Loader.load_module`." -msgstr "" +msgstr ":meth:`Loader.load_module` 的實作。" #: ../../library/importlib.rst:496 msgid "use :meth:`exec_module` instead." -msgstr "" +msgstr "請改用 :meth:`exec_module`。" #: ../../library/importlib.rst:502 msgid "" @@ -728,7 +728,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:982 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:989 msgid "Returns :attr:`path`." msgstr "" @@ -1145,46 +1145,57 @@ msgid "" "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:948 +#: ../../library/importlib.rst:944 +msgid "" +"Note that, by default, importing an extension module will fail in " +"subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " +"even if it would otherwise import successfully." +msgstr "" + +#: ../../library/importlib.rst:950 +msgid "Multi-phase init is now required for use in subinterpreters." +msgstr "" + +#: ../../library/importlib.rst:955 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:952 +#: ../../library/importlib.rst:959 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:956 +#: ../../library/importlib.rst:963 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:970 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:969 +#: ../../library/importlib.rst:976 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:974 +#: ../../library/importlib.rst:981 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:978 +#: ../../library/importlib.rst:985 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:989 +#: ../../library/importlib.rst:996 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1007 +#: ../../library/importlib.rst:1014 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1197,31 +1208,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1021 +#: ../../library/importlib.rst:1028 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1023 +#: ../../library/importlib.rst:1030 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1035 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1037 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1042 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:1044 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1230,11 +1241,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1045 +#: ../../library/importlib.rst:1052 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1047 +#: ../../library/importlib.rst:1054 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1244,66 +1255,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1056 +#: ../../library/importlib.rst:1063 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1062 +#: ../../library/importlib.rst:1069 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1064 +#: ../../library/importlib.rst:1071 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1070 +#: ../../library/importlib.rst:1077 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1072 +#: ../../library/importlib.rst:1079 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1086 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1086 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1084 +#: ../../library/importlib.rst:1091 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1090 +#: ../../library/importlib.rst:1097 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1094 +#: ../../library/importlib.rst:1101 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1099 +#: ../../library/importlib.rst:1106 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:1106 +#: ../../library/importlib.rst:1113 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 " @@ -1313,7 +1324,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1120 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1326,7 +1337,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1123 +#: ../../library/importlib.rst:1130 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 " @@ -1335,18 +1346,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1131 +#: ../../library/importlib.rst:1138 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1135 ../../library/importlib.rst:1151 -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1142 ../../library/importlib.rst:1158 +#: ../../library/importlib.rst:1247 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1141 +#: ../../library/importlib.rst:1148 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." @@ -1356,25 +1367,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1156 +#: ../../library/importlib.rst:1163 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:1164 +#: ../../library/importlib.rst:1171 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1166 +#: ../../library/importlib.rst:1173 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:1171 +#: ../../library/importlib.rst:1178 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:" @@ -1382,13 +1393,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1179 +#: ../../library/importlib.rst:1186 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1193 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1398,30 +1409,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1200 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1196 +#: ../../library/importlib.rst:1203 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1200 +#: ../../library/importlib.rst:1207 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:1207 +#: ../../library/importlib.rst:1214 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1210 +#: ../../library/importlib.rst:1217 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1429,14 +1440,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1215 +#: ../../library/importlib.rst:1222 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:1223 +#: ../../library/importlib.rst:1230 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 " @@ -1445,7 +1456,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1233 +#: ../../library/importlib.rst:1240 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 " @@ -1453,20 +1464,49 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1245 +#: ../../library/importlib.rst:1252 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:1253 +#: ../../library/importlib.rst:1260 +msgid "" +"A context manager that can temporarily skip the compatibility check for " +"extension modules. By default the check is enabled and will fail when a " +"single-phase init module is imported in a subinterpreter. It will also fail " +"for a multi-phase init module that doesn't explicitly support a per-" +"interpreter GIL, when imported in an interpreter with its own GIL." +msgstr "" + +#: ../../library/importlib.rst:1267 +msgid "" +"Note that this function is meant to accommodate an unusual case; one which " +"is likely to eventually go away. There's is a pretty good chance this is " +"not what you were looking for." +msgstr "" + +#: ../../library/importlib.rst:1271 +msgid "" +"You can get the same effect as this function by implementing the basic " +"interface of multi-phase init (:pep:`489`) and lying about support for " +"mulitple interpreters (or per-interpreter GIL)." +msgstr "" + +#: ../../library/importlib.rst:1276 +msgid "" +"Using this function to disable the check can lead to unexpected behavior and " +"even crashes. It should only be used during extension module development." +msgstr "" + +#: ../../library/importlib.rst:1284 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1256 +#: ../../library/importlib.rst:1287 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 " @@ -1479,7 +1519,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1298 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 " @@ -1488,70 +1528,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1275 +#: ../../library/importlib.rst:1306 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:1282 +#: ../../library/importlib.rst:1313 msgid "" "A class 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:1295 +#: ../../library/importlib.rst:1326 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:1329 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1300 +#: ../../library/importlib.rst:1331 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1309 +#: ../../library/importlib.rst:1340 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1311 +#: ../../library/importlib.rst:1342 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:1314 +#: ../../library/importlib.rst:1345 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1337 +#: ../../library/importlib.rst:1368 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1339 +#: ../../library/importlib.rst:1370 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1356 +#: ../../library/importlib.rst:1387 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1358 +#: ../../library/importlib.rst:1389 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1380 +#: ../../library/importlib.rst:1411 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1382 +#: ../../library/importlib.rst:1413 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1565,11 +1605,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1414 +#: ../../library/importlib.rst:1445 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1416 +#: ../../library/importlib.rst:1447 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/logging.handlers.po b/library/logging.handlers.po index 4849fe343f..417245ed9d 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-23 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -137,12 +137,12 @@ msgstr "" #: ../../library/logging.handlers.rst:98 msgid "" "Returns a new instance of the :class:`FileHandler` class. The specified file " -"is opened and used as the stream for logging. If *mode* is not specified, :" -"const:`'a'` is used. If *encoding* is not ``None``, it is used to open the " -"file with that encoding. If *delay* is true, then file opening is deferred " -"until the first call to :meth:`emit`. By default, the file grows " -"indefinitely. If *errors* is specified, it's used to determine how encoding " -"errors are handled." +"is opened and used as the stream for logging. If *mode* is not specified, " +"``'a'`` is used. If *encoding* is not ``None``, it is used to open the file " +"with that encoding. If *delay* is true, then file opening is deferred until " +"the first call to :meth:`emit`. By default, the file grows indefinitely. If " +"*errors* is specified, it's used to determine how encoding errors are " +"handled." msgstr "" #: ../../library/logging.handlers.rst:105 @@ -242,10 +242,10 @@ msgstr "" msgid "" "Returns a new instance of the :class:`WatchedFileHandler` class. The " "specified file is opened and used as the stream for logging. If *mode* is " -"not specified, :const:`'a'` is used. If *encoding* is not ``None``, it is " -"used to open the file with that encoding. If *delay* is true, then file " -"opening is deferred until the first call to :meth:`emit`. By default, the " -"file grows indefinitely. If *errors* is provided, it determines how encoding " +"not specified, ``'a'`` is used. If *encoding* is not ``None``, it is used " +"to open the file with that encoding. If *delay* is true, then file opening " +"is deferred until the first call to :meth:`emit`. By default, the file " +"grows indefinitely. If *errors* is provided, it determines how encoding " "errors are handled." msgstr "" diff --git a/library/os.po b/library/os.po index 20374949cb..624383d5bb 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -478,10 +478,10 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1317 #: ../../library/os.rst:1588 ../../library/os.rst:1756 -#: ../../library/os.rst:2153 ../../library/os.rst:2489 -#: ../../library/os.rst:3332 ../../library/os.rst:3369 -#: ../../library/os.rst:3985 ../../library/os.rst:4483 -#: ../../library/os.rst:4494 ../../library/os.rst:4611 +#: ../../library/os.rst:2489 ../../library/os.rst:3332 +#: ../../library/os.rst:3369 ../../library/os.rst:3985 +#: ../../library/os.rst:4483 ../../library/os.rst:4494 +#: ../../library/os.rst:4611 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -563,16 +563,16 @@ msgstr "" #: ../../library/os.rst:402 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " -"platforms. If the Python interpreter was built with a deployment target of :" -"const:`10.5` or earlier, :func:`getgroups` returns the list of effective " -"group ids associated with the current user process; this list is limited to " -"a system-defined number of entries, typically 16, and may be modified by " -"calls to :func:`setgroups` if suitably privileged. If built with a " -"deployment target greater than :const:`10.5`, :func:`getgroups` returns the " -"current group access list for the user associated with the effective user id " -"of the process; the group access list may change over the lifetime of the " -"process, it is not affected by calls to :func:`setgroups`, and its length is " -"not limited to 16. The deployment target value, :const:" +"platforms. If the Python interpreter was built with a deployment target of " +"``10.5`` or earlier, :func:`getgroups` returns the list of effective group " +"ids associated with the current user process; this list is limited to a " +"system-defined number of entries, typically 16, and may be modified by calls " +"to :func:`setgroups` if suitably privileged. If built with a deployment " +"target greater than ``10.5``, :func:`getgroups` returns the current group " +"access list for the user associated with the effective user id of the " +"process; the group access list may change over the lifetime of the process, " +"it is not affected by calls to :func:`setgroups`, and its length is not " +"limited to 16. The deployment target value, :const:" "`MACOSX_DEPLOYMENT_TARGET`, can be obtained with :func:`sysconfig." "get_config_var`." msgstr "" @@ -2341,6 +2341,10 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" +#: ../../library/os.rst:2153 +msgid ":ref:`Availability `: Unix, Windows, not Emscripten." +msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" + #: ../../library/os.rst:2155 msgid "Added Windows support." msgstr "新支援 Windows。" @@ -2642,13 +2646,13 @@ msgstr "" #: ../../library/os.rst:2422 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`)." +"`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" #: ../../library/os.rst:2428 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`)." +"`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" #: ../../library/os.rst:2434 @@ -3242,7 +3246,7 @@ msgstr "" #: ../../library/os.rst:2939 msgid "" -"Object whose attributes correspond roughly to the members of the :c:type:" +"Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" @@ -3463,7 +3467,7 @@ msgstr "" #: ../../library/os.rst:3119 msgid "" "The standard module :mod:`stat` defines functions and constants that are " -"useful for extracting information from a :c:type:`stat` structure. (On " +"useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" @@ -3471,7 +3475,7 @@ msgstr "" 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 " -"portable) members of the :c:type:`stat` structure, in the order :attr:" +"portable) members of the :c:struct:`stat` structure, in the order :attr:" "`st_mode`, :attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`, :attr:" "`st_uid`, :attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`, :attr:" "`st_mtime`, :attr:`st_ctime`. More items may be added at the end by some " @@ -3535,8 +3539,8 @@ msgstr "" 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 " -"correspond to the members of the :c:type:`statvfs` structure, namely: :attr:" -"`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`, :attr:" +"correspond to the members of the :c:struct:`statvfs` structure, namely: :" +"attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`, :attr:" "`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`, :attr:" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" diff --git a/library/signal.po b/library/signal.po index 186dbd0336..cf457f2349 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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,7 +771,7 @@ msgstr "" #: ../../library/signal.rst:658 msgid "" "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " -"specifying a timeout. If *timeout* is specified as :const:`0`, a poll is " +"specifying a timeout. If *timeout* is specified as ``0``, a poll is " "performed. Returns :const:`None` if a timeout occurs." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 7cc942f17c..428b3e00d5 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-23 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -350,7 +350,7 @@ msgstr "" msgid "" "Mix the given *bytes* into the SSL pseudo-random number generator. The " "parameter *entropy* (a float) is a lower bound on the entropy contained in " -"string (so you can always use :const:`0.0`). See :rfc:`1750` for more " +"string (so you can always use ``0.0``). See :rfc:`1750` for more " "information on sources of entropy." msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index 30fab2a5d1..7f62188dbe 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -542,13 +542,13 @@ msgstr "" #: ../../library/subprocess.rst:468 msgid "" -":const:`0` means unbuffered (read and write are one system call and can " -"return short)" +"``0`` means unbuffered (read and write are one system call and can return " +"short)" msgstr "" #: ../../library/subprocess.rst:470 msgid "" -":const:`1` means line buffered (only usable if ``text=True`` or " +"``1`` means line buffered (only usable if ``text=True`` or " "``universal_newlines=True``)" msgstr "" @@ -566,9 +566,9 @@ msgstr "" 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 " -"3.3.1 it incorrectly defaulted to :const:`0` which was unbuffered and " -"allowed short reads. This was unintentional and did not match the behavior " -"of Python 2 as most code expected." +"3.3.1 it incorrectly defaulted to ``0`` which was unbuffered and allowed " +"short reads. This was unintentional and did not match the behavior of " +"Python 2 as most code expected." msgstr "" #: ../../library/subprocess.rst:484 @@ -638,10 +638,10 @@ msgstr "" #: ../../library/subprocess.rst:544 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. " -"Otherwise when *close_fds* is false, file descriptors obey their inheritable " -"flag as described in :ref:`fd_inheritance`." +"If *close_fds* is true, all file descriptors except ``0``, ``1`` and ``2`` " +"will be closed before the child process is executed. Otherwise when " +"*close_fds* is false, file descriptors obey their inheritable flag as " +"described in :ref:`fd_inheritance`." msgstr "" #: ../../library/subprocess.rst:549 diff --git a/library/sys.po b/library/sys.po index 77368be496..7f8d4f11b0 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-23 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -835,7 +835,9 @@ msgstr "" msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." -msgstr "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` ``warn_default_encoding`` 旗標。" +msgstr "" +"新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " +"``warn_default_encoding`` 旗標。" #: ../../library/sys.rst:561 msgid "Added the ``safe_path`` attribute for :option:`-P` option." @@ -1278,7 +1280,7 @@ msgid "" msgstr "" #: ../../library/sys.rst:880 -msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." +msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" #: ../../library/sys.rst:882 @@ -1294,24 +1296,24 @@ msgid "Meaning" msgstr "" #: ../../library/sys.rst:887 -msgid ":const:`1 (VER_NT_WORKSTATION)`" -msgstr ":const:`1 (VER_NT_WORKSTATION)`" +msgid "``1`` (VER_NT_WORKSTATION)" +msgstr "``1`` (VER_NT_WORKSTATION)" #: ../../library/sys.rst:887 msgid "The system is a workstation." msgstr "" #: ../../library/sys.rst:889 -msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" +msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" +msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" #: ../../library/sys.rst:889 msgid "The system is a domain controller." msgstr "" #: ../../library/sys.rst:892 -msgid ":const:`3 (VER_NT_SERVER)`" -msgstr ":const:`3 (VER_NT_SERVER)`" +msgid "``3`` (VER_NT_SERVER)" +msgstr "``3`` (VER_NT_SERVER)" #: ../../library/sys.rst:892 msgid "The system is a server, but not a domain controller." diff --git a/library/turtle.po b/library/turtle.po index 6d7d9d2c35..6cba6b1450 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2023-07-28 00:03+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-" @@ -122,8 +122,8 @@ msgid "" "Experiment with those commands, and also with ``backward()`` and ``right()``." msgstr "" -#: ../../library/turtle.rst:96 ../../library/turtle.rst:397 -#: ../../library/turtle.rst:1067 +#: ../../library/turtle.rst:96 ../../library/turtle.rst:346 +#: ../../library/turtle.rst:1016 msgid "Pen control" msgstr "" @@ -334,115 +334,26 @@ msgstr "" msgid "The turtle's screen can be customised, for example::" msgstr "" -#: ../../library/turtle.rst:283 -msgid "Explanation" +#: ../../library/turtle.rst:281 +msgid "Turtle graphics reference" msgstr "" #: ../../library/turtle.rst:285 msgid "" -"The :mod:`turtle` module is an extended reimplementation of the same-named " -"module from the Python standard distribution up to version Python 2.5." -msgstr "" - -#: ../../library/turtle.rst:288 -msgid "" -"It tries to keep the merits of the old turtle module and to be (nearly) 100% " -"compatible with it. This means in the first place to enable the learning " -"programmer to use all the commands, classes and methods interactively when " -"using the module from within IDLE run with the ``-n`` switch." -msgstr "" - -#: ../../library/turtle.rst:293 -msgid "" -"The turtle module provides turtle graphics primitives, in both object-" -"oriented and procedure-oriented ways. Because it uses :mod:`tkinter` for " -"the underlying graphics, it needs a version of Python installed with Tk " -"support." -msgstr "" - -#: ../../library/turtle.rst:297 -msgid "The object-oriented interface uses essentially two+two classes:" -msgstr "" - -#: ../../library/turtle.rst:299 -msgid "" -"The :class:`TurtleScreen` class defines graphics windows as a playground for " -"the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a :" -"class:`ScrolledCanvas` as argument. It should be used when :mod:`turtle` is " -"used as part of some application." -msgstr "" - -#: ../../library/turtle.rst:304 -msgid "" -"The function :func:`Screen` returns a singleton object of a :class:" -"`TurtleScreen` subclass. This function should be used when :mod:`turtle` is " -"used as a standalone tool for doing graphics. As a singleton object, " -"inheriting from its class is not possible." -msgstr "" - -#: ../../library/turtle.rst:309 -msgid "" -"All methods of TurtleScreen/Screen also exist as functions, i.e. as part of " -"the procedure-oriented interface." -msgstr "" - -#: ../../library/turtle.rst:312 -msgid "" -":class:`RawTurtle` (alias: :class:`RawPen`) defines Turtle objects which " -"draw on a :class:`TurtleScreen`. Its constructor needs a Canvas, " -"ScrolledCanvas or TurtleScreen as argument, so the RawTurtle objects know " -"where to draw." -msgstr "" - -#: ../../library/turtle.rst:316 -msgid "" -"Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:" -"`Pen`), which draws on \"the\" :class:`Screen` instance which is " -"automatically created, if not already present." -msgstr "" - -#: ../../library/turtle.rst:320 -msgid "" -"All methods of RawTurtle/Turtle also exist as functions, i.e. part of the " -"procedure-oriented interface." -msgstr "" - -#: ../../library/turtle.rst:323 -msgid "" -"The procedural interface provides functions which are derived from the " -"methods of the classes :class:`Screen` and :class:`Turtle`. They have the " -"same names as the corresponding methods. A screen object is automatically " -"created whenever a function derived from a Screen method is called. An " -"(unnamed) turtle object is automatically created whenever any of the " -"functions derived from a Turtle method is called." -msgstr "" - -#: ../../library/turtle.rst:330 -msgid "" -"To use multiple turtles on a screen one has to use the object-oriented " -"interface." -msgstr "" - -#: ../../library/turtle.rst:333 -msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:339 -msgid "Turtle graphics reference" -msgstr "" - -#: ../../library/turtle.rst:342 +#: ../../library/turtle.rst:291 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:374 ../../library/turtle.rst:484 +#: ../../library/turtle.rst:323 ../../library/turtle.rst:433 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:362 +#: ../../library/turtle.rst:311 msgid "Move and draw" msgstr "" @@ -486,7 +397,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2739 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2723 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -494,7 +405,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2717 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2701 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -514,7 +425,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:370 ../../library/turtle.rst:916 +#: ../../library/turtle.rst:319 ../../library/turtle.rst:865 msgid "Tell Turtle's state" msgstr "" @@ -542,7 +453,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:374 +#: ../../library/turtle.rst:323 msgid "Setting and measurement" msgstr "" @@ -554,7 +465,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:382 ../../library/turtle.rst:1070 +#: ../../library/turtle.rst:331 ../../library/turtle.rst:1019 msgid "Drawing state" msgstr "" @@ -578,7 +489,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:387 ../../library/turtle.rst:1162 +#: ../../library/turtle.rst:336 ../../library/turtle.rst:1111 msgid "Color control" msgstr "" @@ -594,7 +505,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:392 ../../library/turtle.rst:1294 +#: ../../library/turtle.rst:341 ../../library/turtle.rst:1243 msgid "Filling" msgstr "" @@ -610,7 +521,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:397 ../../library/turtle.rst:1341 +#: ../../library/turtle.rst:346 ../../library/turtle.rst:1290 msgid "More drawing control" msgstr "" @@ -626,11 +537,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:414 ../../library/turtle.rst:1387 +#: ../../library/turtle.rst:363 ../../library/turtle.rst:1336 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:403 ../../library/turtle.rst:1390 +#: ../../library/turtle.rst:352 ../../library/turtle.rst:1339 msgid "Visibility" msgstr "" @@ -646,7 +557,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:414 ../../library/turtle.rst:1429 +#: ../../library/turtle.rst:363 ../../library/turtle.rst:1378 msgid "Appearance" msgstr "" @@ -686,11 +597,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:419 ../../library/turtle.rst:1634 +#: ../../library/turtle.rst:368 ../../library/turtle.rst:1583 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2711 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2695 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -698,11 +609,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2694 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2678 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:430 ../../library/turtle.rst:1708 +#: ../../library/turtle.rst:379 ../../library/turtle.rst:1657 msgid "Special Turtle methods" msgstr "" @@ -718,7 +629,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2733 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2717 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -738,11 +649,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:433 +#: ../../library/turtle.rst:382 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:441 ../../library/turtle.rst:1862 +#: ../../library/turtle.rst:390 ../../library/turtle.rst:1811 msgid "Window control" msgstr "" @@ -770,7 +681,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:446 ../../library/turtle.rst:1985 +#: ../../library/turtle.rst:395 ../../library/turtle.rst:1934 msgid "Animation control" msgstr "" @@ -786,7 +697,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:454 ../../library/turtle.rst:2038 +#: ../../library/turtle.rst:403 ../../library/turtle.rst:1987 msgid "Using screen events" msgstr "" @@ -814,7 +725,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:464 ../../library/turtle.rst:2183 +#: ../../library/turtle.rst:413 ../../library/turtle.rst:2132 msgid "Settings and special methods" msgstr "" @@ -850,7 +761,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:468 ../../library/turtle.rst:2147 +#: ../../library/turtle.rst:417 ../../library/turtle.rst:2096 msgid "Input methods" msgstr "" @@ -862,7 +773,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:475 +#: ../../library/turtle.rst:424 msgid "Methods specific to Screen" msgstr "" @@ -882,11 +793,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:478 +#: ../../library/turtle.rst:427 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:480 +#: ../../library/turtle.rst:429 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -896,70 +807,70 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:489 ../../library/turtle.rst:534 -#: ../../library/turtle.rst:559 ../../library/turtle.rst:657 -#: ../../library/turtle.rst:680 ../../library/turtle.rst:703 +#: ../../library/turtle.rst:438 ../../library/turtle.rst:483 +#: ../../library/turtle.rst:508 ../../library/turtle.rst:606 +#: ../../library/turtle.rst:629 ../../library/turtle.rst:652 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:491 +#: ../../library/turtle.rst:440 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:511 ../../library/turtle.rst:753 -#: ../../library/turtle.rst:1020 ../../library/turtle.rst:1528 -#: ../../library/turtle.rst:1547 +#: ../../library/turtle.rst:460 ../../library/turtle.rst:702 +#: ../../library/turtle.rst:969 ../../library/turtle.rst:1477 +#: ../../library/turtle.rst:1496 msgid "a number" msgstr "" -#: ../../library/turtle.rst:513 +#: ../../library/turtle.rst:462 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:536 +#: ../../library/turtle.rst:485 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:561 +#: ../../library/turtle.rst:510 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:585 +#: ../../library/turtle.rst:534 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:586 ../../library/turtle.rst:619 -#: ../../library/turtle.rst:620 +#: ../../library/turtle.rst:535 ../../library/turtle.rst:568 +#: ../../library/turtle.rst:569 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:588 +#: ../../library/turtle.rst:537 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:591 +#: ../../library/turtle.rst:540 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:621 +#: ../../library/turtle.rst:570 msgid "a boolean" msgstr "" -#: ../../library/turtle.rst:623 +#: ../../library/turtle.rst:572 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -969,77 +880,77 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: ../../library/turtle.rst:659 +#: ../../library/turtle.rst:608 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:682 +#: ../../library/turtle.rst:631 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:705 +#: ../../library/turtle.rst:654 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:709 +#: ../../library/turtle.rst:658 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:709 +#: ../../library/turtle.rst:658 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:711 +#: ../../library/turtle.rst:660 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:711 +#: ../../library/turtle.rst:660 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:712 +#: ../../library/turtle.rst:661 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:712 +#: ../../library/turtle.rst:661 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:713 +#: ../../library/turtle.rst:662 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:713 +#: ../../library/turtle.rst:662 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:714 +#: ../../library/turtle.rst:663 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:714 +#: ../../library/turtle.rst:663 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:727 +#: ../../library/turtle.rst:676 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:754 +#: ../../library/turtle.rst:703 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:755 ../../library/turtle.rst:848 +#: ../../library/turtle.rst:704 ../../library/turtle.rst:797 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:757 +#: ../../library/turtle.rst:706 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -1050,117 +961,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:765 +#: ../../library/turtle.rst:714 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:791 +#: ../../library/turtle.rst:740 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:792 +#: ../../library/turtle.rst:741 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:794 +#: ../../library/turtle.rst:743 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:812 +#: ../../library/turtle.rst:761 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:826 +#: ../../library/turtle.rst:775 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:829 +#: ../../library/turtle.rst:778 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:850 +#: ../../library/turtle.rst:799 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:866 +#: ../../library/turtle.rst:815 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:881 +#: ../../library/turtle.rst:830 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:883 +#: ../../library/turtle.rst:832 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:886 +#: ../../library/turtle.rst:835 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:889 +#: ../../library/turtle.rst:838 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:890 +#: ../../library/turtle.rst:839 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:891 +#: ../../library/turtle.rst:840 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:892 +#: ../../library/turtle.rst:841 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:893 +#: ../../library/turtle.rst:842 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:895 +#: ../../library/turtle.rst:844 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:898 +#: ../../library/turtle.rst:847 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:921 +#: ../../library/turtle.rst:870 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:932 ../../library/turtle.rst:995 +#: ../../library/turtle.rst:881 ../../library/turtle.rst:944 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:933 ../../library/turtle.rst:996 +#: ../../library/turtle.rst:882 ../../library/turtle.rst:945 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:935 +#: ../../library/turtle.rst:884 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -1168,116 +1079,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:949 +#: ../../library/turtle.rst:898 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:965 +#: ../../library/turtle.rst:914 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:981 +#: ../../library/turtle.rst:930 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:998 +#: ../../library/turtle.rst:947 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:1016 +#: ../../library/turtle.rst:965 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:1022 +#: ../../library/turtle.rst:971 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:1045 +#: ../../library/turtle.rst:994 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:1076 +#: ../../library/turtle.rst:1025 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:1083 +#: ../../library/turtle.rst:1032 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:1089 +#: ../../library/turtle.rst:1038 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:1091 +#: ../../library/turtle.rst:1040 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:1105 +#: ../../library/turtle.rst:1054 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:1106 +#: ../../library/turtle.rst:1055 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:1108 +#: ../../library/turtle.rst:1057 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:1111 +#: ../../library/turtle.rst:1060 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:1112 +#: ../../library/turtle.rst:1061 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:1113 +#: ../../library/turtle.rst:1062 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1114 +#: ../../library/turtle.rst:1063 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:1064 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:1116 +#: ../../library/turtle.rst:1065 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:1117 +#: ../../library/turtle.rst:1066 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1118 +#: ../../library/turtle.rst:1067 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:1119 +#: ../../library/turtle.rst:1068 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:1120 +#: ../../library/turtle.rst:1069 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:1122 +#: ../../library/turtle.rst:1071 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1285,182 +1196,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:1148 +#: ../../library/turtle.rst:1097 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:1166 +#: ../../library/turtle.rst:1115 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:1168 ../../library/turtle.rst:1217 +#: ../../library/turtle.rst:1117 ../../library/turtle.rst:1166 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:1173 +#: ../../library/turtle.rst:1122 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:1171 +#: ../../library/turtle.rst:1120 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:1177 +#: ../../library/turtle.rst:1126 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:1176 +#: ../../library/turtle.rst:1125 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1182 +#: ../../library/turtle.rst:1131 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:1180 +#: ../../library/turtle.rst:1129 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1186 +#: ../../library/turtle.rst:1135 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:1185 +#: ../../library/turtle.rst:1134 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1188 +#: ../../library/turtle.rst:1137 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:1215 +#: ../../library/turtle.rst:1164 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:1222 +#: ../../library/turtle.rst:1171 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:1220 +#: ../../library/turtle.rst:1169 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:1226 +#: ../../library/turtle.rst:1175 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:1225 +#: ../../library/turtle.rst:1174 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1231 +#: ../../library/turtle.rst:1180 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:1229 +#: ../../library/turtle.rst:1178 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1235 +#: ../../library/turtle.rst:1184 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:1234 +#: ../../library/turtle.rst:1183 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1237 +#: ../../library/turtle.rst:1186 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:1258 +#: ../../library/turtle.rst:1207 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:1260 +#: ../../library/turtle.rst:1209 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:1266 +#: ../../library/turtle.rst:1215 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:1264 +#: ../../library/turtle.rst:1213 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:1270 +#: ../../library/turtle.rst:1219 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:1269 +#: ../../library/turtle.rst:1218 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1274 +#: ../../library/turtle.rst:1223 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1273 +#: ../../library/turtle.rst:1222 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1276 +#: ../../library/turtle.rst:1225 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1290 +#: ../../library/turtle.rst:1239 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1304 +#: ../../library/turtle.rst:1253 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1319 +#: ../../library/turtle.rst:1268 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1324 +#: ../../library/turtle.rst:1273 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1326 +#: ../../library/turtle.rst:1275 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1468,36 +1379,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1345 +#: ../../library/turtle.rst:1294 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1366 +#: ../../library/turtle.rst:1315 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1372 +#: ../../library/turtle.rst:1321 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1373 +#: ../../library/turtle.rst:1322 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1374 +#: ../../library/turtle.rst:1323 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1375 +#: ../../library/turtle.rst:1324 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1377 +#: ../../library/turtle.rst:1326 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1505,26 +1416,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1344 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1408 +#: ../../library/turtle.rst:1357 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1418 +#: ../../library/turtle.rst:1367 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1433 +#: ../../library/turtle.rst:1382 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1435 +#: ../../library/turtle.rst:1384 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1534,45 +1445,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1453 +#: ../../library/turtle.rst:1402 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1455 +#: ../../library/turtle.rst:1404 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1459 +#: ../../library/turtle.rst:1408 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1460 +#: ../../library/turtle.rst:1409 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1463 +#: ../../library/turtle.rst:1412 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1465 +#: ../../library/turtle.rst:1414 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1480 ../../library/turtle.rst:1481 -#: ../../library/turtle.rst:1482 +#: ../../library/turtle.rst:1429 ../../library/turtle.rst:1430 +#: ../../library/turtle.rst:1431 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1484 +#: ../../library/turtle.rst:1433 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1582,12 +1493,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1507 ../../library/turtle.rst:2166 -#: ../../library/turtle.rst:2167 ../../library/turtle.rst:2168 +#: ../../library/turtle.rst:1456 ../../library/turtle.rst:2115 +#: ../../library/turtle.rst:2116 ../../library/turtle.rst:2117 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1509 +#: ../../library/turtle.rst:1458 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1596,26 +1507,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1530 +#: ../../library/turtle.rst:1479 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1549 +#: ../../library/turtle.rst:1498 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1569 ../../library/turtle.rst:1592 -#: ../../library/turtle.rst:1593 ../../library/turtle.rst:1594 -#: ../../library/turtle.rst:1595 +#: ../../library/turtle.rst:1518 ../../library/turtle.rst:1541 +#: ../../library/turtle.rst:1542 ../../library/turtle.rst:1543 +#: ../../library/turtle.rst:1544 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1571 +#: ../../library/turtle.rst:1520 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1625,11 +1536,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1597 +#: ../../library/turtle.rst:1546 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1599 +#: ../../library/turtle.rst:1548 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1639,101 +1550,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1621 +#: ../../library/turtle.rst:1570 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1639 ../../library/turtle.rst:1661 -#: ../../library/turtle.rst:1686 ../../library/turtle.rst:2090 +#: ../../library/turtle.rst:1588 ../../library/turtle.rst:1610 +#: ../../library/turtle.rst:1635 ../../library/turtle.rst:2039 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1641 ../../library/turtle.rst:1663 -#: ../../library/turtle.rst:1688 ../../library/turtle.rst:2092 +#: ../../library/turtle.rst:1590 ../../library/turtle.rst:1612 +#: ../../library/turtle.rst:1637 ../../library/turtle.rst:2041 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1642 ../../library/turtle.rst:1664 -#: ../../library/turtle.rst:1689 ../../library/turtle.rst:2093 +#: ../../library/turtle.rst:1591 ../../library/turtle.rst:1613 +#: ../../library/turtle.rst:1638 ../../library/turtle.rst:2042 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1645 +#: ../../library/turtle.rst:1594 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1667 +#: ../../library/turtle.rst:1616 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1692 +#: ../../library/turtle.rst:1641 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1695 +#: ../../library/turtle.rst:1644 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1703 +#: ../../library/turtle.rst:1652 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1712 +#: ../../library/turtle.rst:1661 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1718 +#: ../../library/turtle.rst:1667 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1724 +#: ../../library/turtle.rst:1673 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1743 +#: ../../library/turtle.rst:1692 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1756 +#: ../../library/turtle.rst:1705 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1770 +#: ../../library/turtle.rst:1719 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1784 +#: ../../library/turtle.rst:1733 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1786 +#: ../../library/turtle.rst:1735 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1741,71 +1652,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1799 +#: ../../library/turtle.rst:1748 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1812 +#: ../../library/turtle.rst:1761 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1814 +#: ../../library/turtle.rst:1763 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1767 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1819 +#: ../../library/turtle.rst:1768 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1822 +#: ../../library/turtle.rst:1771 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1833 +#: ../../library/turtle.rst:1782 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1844 +#: ../../library/turtle.rst:1793 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1850 +#: ../../library/turtle.rst:1799 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1852 +#: ../../library/turtle.rst:1801 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1866 +#: ../../library/turtle.rst:1815 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1870 +#: ../../library/turtle.rst:1819 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1885 +#: ../../library/turtle.rst:1834 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1887 +#: ../../library/turtle.rst:1836 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1813,44 +1724,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1903 +#: ../../library/turtle.rst:1852 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1910 +#: ../../library/turtle.rst:1859 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1919 +#: ../../library/turtle.rst:1868 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1926 +#: ../../library/turtle.rst:1875 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1931 +#: ../../library/turtle.rst:1880 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1932 +#: ../../library/turtle.rst:1881 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1933 +#: ../../library/turtle.rst:1882 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1935 +#: ../../library/turtle.rst:1884 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1859,59 +1770,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1947 +#: ../../library/turtle.rst:1896 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1952 +#: ../../library/turtle.rst:1901 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1953 +#: ../../library/turtle.rst:1902 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1954 +#: ../../library/turtle.rst:1903 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1955 +#: ../../library/turtle.rst:1904 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1957 +#: ../../library/turtle.rst:1906 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1961 +#: ../../library/turtle.rst:1910 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1989 +#: ../../library/turtle.rst:1938 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1991 +#: ../../library/turtle.rst:1940 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1995 +#: ../../library/turtle.rst:1944 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:2009 ../../library/turtle.rst:2010 +#: ../../library/turtle.rst:1958 ../../library/turtle.rst:1959 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:2012 +#: ../../library/turtle.rst:1961 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1920,75 +1831,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:2032 +#: ../../library/turtle.rst:1981 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:2034 +#: ../../library/turtle.rst:1983 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:2042 +#: ../../library/turtle.rst:1991 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:2049 ../../library/turtle.rst:2069 +#: ../../library/turtle.rst:1998 ../../library/turtle.rst:2018 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2070 +#: ../../library/turtle.rst:1999 ../../library/turtle.rst:2019 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:2052 +#: ../../library/turtle.rst:2001 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:2072 +#: ../../library/turtle.rst:2021 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:2096 +#: ../../library/turtle.rst:2045 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:2099 +#: ../../library/turtle.rst:2048 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:2110 +#: ../../library/turtle.rst:2059 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:2117 +#: ../../library/turtle.rst:2066 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:2118 +#: ../../library/turtle.rst:2067 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:2120 +#: ../../library/turtle.rst:2069 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:2138 +#: ../../library/turtle.rst:2087 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1996,12 +1907,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:2151 ../../library/turtle.rst:2152 -#: ../../library/turtle.rst:2164 ../../library/turtle.rst:2165 +#: ../../library/turtle.rst:2100 ../../library/turtle.rst:2101 +#: ../../library/turtle.rst:2113 ../../library/turtle.rst:2114 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:2154 +#: ../../library/turtle.rst:2103 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -2009,7 +1920,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:2170 +#: ../../library/turtle.rst:2119 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -2020,17 +1931,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:2187 +#: ../../library/turtle.rst:2136 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:2189 +#: ../../library/turtle.rst:2138 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:2192 +#: ../../library/turtle.rst:2141 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -2038,121 +1949,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:2198 +#: ../../library/turtle.rst:2147 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:2198 +#: ../../library/turtle.rst:2147 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:2198 +#: ../../library/turtle.rst:2147 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2149 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2149 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:2200 +#: ../../library/turtle.rst:2149 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:2201 +#: ../../library/turtle.rst:2150 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:2201 +#: ../../library/turtle.rst:2150 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:2201 +#: ../../library/turtle.rst:2150 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:2214 +#: ../../library/turtle.rst:2163 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:2216 +#: ../../library/turtle.rst:2165 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:2237 +#: ../../library/turtle.rst:2186 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:2250 +#: ../../library/turtle.rst:2199 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:2262 +#: ../../library/turtle.rst:2211 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:2264 +#: ../../library/turtle.rst:2213 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2270 +#: ../../library/turtle.rst:2219 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2273 +#: ../../library/turtle.rst:2222 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2281 +#: ../../library/turtle.rst:2230 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2284 +#: ../../library/turtle.rst:2233 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2290 +#: ../../library/turtle.rst:2239 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2301 +#: ../../library/turtle.rst:2250 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2309 +#: ../../library/turtle.rst:2258 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2318 +#: ../../library/turtle.rst:2267 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2322 +#: ../../library/turtle.rst:2271 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2327 +#: ../../library/turtle.rst:2276 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2330 +#: ../../library/turtle.rst:2279 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -2161,246 +2072,295 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2339 +#: ../../library/turtle.rst:2288 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2343 +#: ../../library/turtle.rst:2292 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2345 +#: ../../library/turtle.rst:2294 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2296 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2350 +#: ../../library/turtle.rst:2299 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2365 +#: ../../library/turtle.rst:2314 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2368 +#: ../../library/turtle.rst:2317 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2377 +#: ../../library/turtle.rst:2326 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2383 +#: ../../library/turtle.rst:2332 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2386 +#: ../../library/turtle.rst:2335 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2392 +#: ../../library/turtle.rst:2341 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2347 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2400 +#: ../../library/turtle.rst:2349 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2405 +#: ../../library/turtle.rst:2354 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2410 +#: ../../library/turtle.rst:2359 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2413 +#: ../../library/turtle.rst:2362 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2418 +#: ../../library/turtle.rst:2367 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2420 +#: ../../library/turtle.rst:2369 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2425 +#: ../../library/turtle.rst:2374 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2425 +#: ../../library/turtle.rst:2374 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2376 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2427 +#: ../../library/turtle.rst:2376 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2377 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2428 +#: ../../library/turtle.rst:2377 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2429 +#: ../../library/turtle.rst:2378 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2429 +#: ../../library/turtle.rst:2378 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2435 +#: ../../library/turtle.rst:2384 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2436 +#: ../../library/turtle.rst:2385 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2437 +#: ../../library/turtle.rst:2386 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2388 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2449 +#: ../../library/turtle.rst:2398 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2403 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2458 +#: ../../library/turtle.rst:2407 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2409 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2461 +#: ../../library/turtle.rst:2410 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2462 +#: ../../library/turtle.rst:2411 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2463 +#: ../../library/turtle.rst:2412 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2464 +#: ../../library/turtle.rst:2413 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2465 +#: ../../library/turtle.rst:2414 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2469 +#: ../../library/turtle.rst:2420 +msgid "Explanation" +msgstr "" + +#: ../../library/turtle.rst:2422 +msgid "" +"A turtle object draws on a screen object, and there a number of key classes " +"in the turtle object-oriented interface that can be used to create them and " +"relate them to each other." +msgstr "" + +#: ../../library/turtle.rst:2426 +msgid "" +"A :class:`Turtle` instance will automatically create a :class:`Screen` " +"instance if one is not already present." +msgstr "" + +#: ../../library/turtle.rst:2429 +msgid "" +"``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " +"automatically create a drawing surface - a *canvas* will need to be provided " +"or created for it. The *canvas* can be a :class:`tkinter.Canvas`, :class:" +"`ScrolledCanvas` or :class:`TurtleScreen`." +msgstr "" + +#: ../../library/turtle.rst:2435 +msgid "" +":class:`TurtleScreen` is the basic drawing surface for a turtle. :class:" +"`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " +"additional methods ` for managing its appearance (including " +"size and title) and behaviour. ``TurtleScreen``'s constructor needs a :class:" +"`tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." +msgstr "" + +#: ../../library/turtle.rst:2442 +msgid "" +"The functional interface for turtle graphics uses the various methods of " +"``Turtle`` and ``TurtleScreen``/``Screen``. Behind the scenes, a screen " +"object is automatically created whenever a function derived from a " +"``Screen`` method is called. Similarly, a turtle object is automatically " +"created whenever any of the functions derived from a Turtle method is called." +msgstr "" + +#: ../../library/turtle.rst:2448 +msgid "" +"To use multiple turtles on a screen, the object-oriented interface must be " +"used." +msgstr "" + +#: ../../library/turtle.rst:2453 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2472 +#: ../../library/turtle.rst:2456 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2474 +#: ../../library/turtle.rst:2458 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2478 +#: ../../library/turtle.rst:2462 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2481 +#: ../../library/turtle.rst:2465 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2496 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2546 +#: ../../library/turtle.rst:2530 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2551 +#: ../../library/turtle.rst:2535 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2553 +#: ../../library/turtle.rst:2537 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2559 +#: ../../library/turtle.rst:2543 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2561 +#: ../../library/turtle.rst:2545 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2409,37 +2369,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2567 +#: ../../library/turtle.rst:2551 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2555 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2574 +#: ../../library/turtle.rst:2558 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:2564 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2566 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2585 +#: ../../library/turtle.rst:2569 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2448,54 +2408,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2590 +#: ../../library/turtle.rst:2574 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2615 +#: ../../library/turtle.rst:2599 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2617 +#: ../../library/turtle.rst:2601 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:2603 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2621 +#: ../../library/turtle.rst:2605 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2623 +#: ../../library/turtle.rst:2607 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2626 +#: ../../library/turtle.rst:2610 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2628 +#: ../../library/turtle.rst:2612 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2631 +#: ../../library/turtle.rst:2615 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2503,301 +2463,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2635 +#: ../../library/turtle.rst:2619 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2639 +#: ../../library/turtle.rst:2623 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2643 +#: ../../library/turtle.rst:2627 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2649 +#: ../../library/turtle.rst:2633 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2654 +#: ../../library/turtle.rst:2638 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2659 +#: ../../library/turtle.rst:2643 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2663 +#: ../../library/turtle.rst:2647 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2665 +#: ../../library/turtle.rst:2649 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2667 +#: ../../library/turtle.rst:2651 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2670 +#: ../../library/turtle.rst:2654 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2673 +#: ../../library/turtle.rst:2657 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2680 +#: ../../library/turtle.rst:2664 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2680 +#: ../../library/turtle.rst:2664 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2680 +#: ../../library/turtle.rst:2664 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2682 +#: ../../library/turtle.rst:2666 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2682 +#: ../../library/turtle.rst:2666 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2682 +#: ../../library/turtle.rst:2666 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2685 +#: ../../library/turtle.rst:2669 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2685 +#: ../../library/turtle.rst:2669 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2685 +#: ../../library/turtle.rst:2669 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2691 +#: ../../library/turtle.rst:2675 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2691 +#: ../../library/turtle.rst:2675 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2691 +#: ../../library/turtle.rst:2675 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2694 +#: ../../library/turtle.rst:2678 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2694 +#: ../../library/turtle.rst:2678 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2696 +#: ../../library/turtle.rst:2680 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2696 +#: ../../library/turtle.rst:2680 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2696 +#: ../../library/turtle.rst:2680 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2698 +#: ../../library/turtle.rst:2682 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2698 +#: ../../library/turtle.rst:2682 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2698 +#: ../../library/turtle.rst:2682 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2700 +#: ../../library/turtle.rst:2684 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2700 +#: ../../library/turtle.rst:2684 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2700 +#: ../../library/turtle.rst:2684 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2703 +#: ../../library/turtle.rst:2687 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2703 +#: ../../library/turtle.rst:2687 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2703 +#: ../../library/turtle.rst:2687 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2707 +#: ../../library/turtle.rst:2691 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2707 +#: ../../library/turtle.rst:2691 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2707 +#: ../../library/turtle.rst:2691 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2711 +#: ../../library/turtle.rst:2695 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2711 +#: ../../library/turtle.rst:2695 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2714 +#: ../../library/turtle.rst:2698 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2714 +#: ../../library/turtle.rst:2698 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2714 +#: ../../library/turtle.rst:2698 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2717 +#: ../../library/turtle.rst:2701 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2717 +#: ../../library/turtle.rst:2701 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2720 +#: ../../library/turtle.rst:2704 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2720 +#: ../../library/turtle.rst:2704 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2720 +#: ../../library/turtle.rst:2704 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2723 +#: ../../library/turtle.rst:2707 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2723 +#: ../../library/turtle.rst:2707 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2723 +#: ../../library/turtle.rst:2707 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2726 +#: ../../library/turtle.rst:2710 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2726 +#: ../../library/turtle.rst:2710 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2726 +#: ../../library/turtle.rst:2710 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2730 +#: ../../library/turtle.rst:2714 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2730 +#: ../../library/turtle.rst:2714 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2730 +#: ../../library/turtle.rst:2714 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2733 +#: ../../library/turtle.rst:2717 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2733 +#: ../../library/turtle.rst:2717 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2736 +#: ../../library/turtle.rst:2720 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2736 +#: ../../library/turtle.rst:2720 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2736 +#: ../../library/turtle.rst:2720 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2739 +#: ../../library/turtle.rst:2723 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2739 +#: ../../library/turtle.rst:2723 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2742 +#: ../../library/turtle.rst:2726 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2746 +#: ../../library/turtle.rst:2730 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2748 +#: ../../library/turtle.rst:2732 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2808,14 +2768,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2756 +#: ../../library/turtle.rst:2740 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2761 +#: ../../library/turtle.rst:2745 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2823,11 +2783,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2767 +#: ../../library/turtle.rst:2751 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2769 +#: ../../library/turtle.rst:2753 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2836,28 +2796,28 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2776 +#: ../../library/turtle.rst:2760 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2780 +#: ../../library/turtle.rst:2764 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2784 +#: ../../library/turtle.rst:2768 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2788 +#: ../../library/turtle.rst:2772 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index e0ace5f079..685e9a2976 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -987,7 +987,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:966 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/2.3.rst:968 msgid "" @@ -2008,8 +2008,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1849 msgid "" -"To allocate and free Python objects, use the \"object\" family :c:func:" -"`PyObject_New`, :c:func:`PyObject_NewVar`, and :c:func:`PyObject_Del`." +"To allocate and free Python objects, use the \"object\" family :c:macro:" +"`PyObject_New`, :c:macro:`PyObject_NewVar`, and :c:func:`PyObject_Del`." msgstr "" #: ../../whatsnew/2.3.rst:1852 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 64d2ceea80..2dbfd429e4 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-27 00:03+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-" @@ -859,7 +859,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:774 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/2.4.rst:776 msgid "" @@ -1703,7 +1703,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1494 msgid "" -"The :c:type:`tracebackobject` type has been renamed to :c:type:" +"The :c:type:`!tracebackobject` type has been renamed to :c:type:" "`PyTracebackObject`." msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 6c31bbe5f3..17d26a33fd 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -1105,10 +1105,10 @@ msgstr "" #: ../../whatsnew/2.5.rst:957 msgid "" -"A corresponding :attr:`nb_index` slot was added to the C-level :c:type:" -"`PyNumberMethods` structure to let C extensions implement this protocol. " -"``PyNumber_Index(obj)`` can be used in extension code to call the :meth:" -"`__index__` function and retrieve its result." +"A corresponding :c:member:`~PyNumberMethods.nb_index` slot was added to the " +"C-level :c:type:`PyNumberMethods` structure to let C extensions implement " +"this protocol. ``PyNumber_Index(obj)`` can be used in extension code to call " +"the :meth:`__index__` function and retrieve its result." msgstr "" #: ../../whatsnew/2.5.rst:965 @@ -1121,7 +1121,7 @@ msgstr "由 Travis Oliphant 撰寫 PEP 與實作。" #: ../../whatsnew/2.5.rst:974 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/2.5.rst:976 msgid "" @@ -1178,7 +1178,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1026 msgid "(Implemented by Georg Brandl following a suggestion by Tom Lynn.)" -msgstr "" +msgstr "(由 Georg Brandl 實作、後有 Tom Lynn 提出建議。)" #: ../../whatsnew/2.5.rst:1030 msgid "" @@ -1250,7 +1250,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1091 msgid "(Implemented by Marc-André Lemburg.)" -msgstr "" +msgstr "(由 Marc-André Lemburg 實作。)" #: ../../whatsnew/2.5.rst:1093 msgid "" @@ -1273,7 +1273,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1108 msgid "(Implemented by Brett Cannon.)" -msgstr "" +msgstr "(由 Brett Cannon 實作。)" #: ../../whatsnew/2.5.rst:1116 msgid "Interactive Interpreter Changes" @@ -2559,11 +2559,11 @@ msgstr "" msgid "" "Previously these different families all reduced to the platform's :c:func:" "`malloc` and :c:func:`free` functions. This meant it didn't matter if you " -"got things wrong and allocated memory with the :c:func:`PyMem` function but " -"freed it with the :c:func:`PyObject` function. With 2.5's changes to " -"obmalloc, these families now do different things and mismatches will " -"probably result in a segfault. You should carefully test your C extension " -"modules with Python 2.5." +"got things wrong and allocated memory with the ``PyMem`` function but freed " +"it with the ``PyObject`` function. With 2.5's changes to obmalloc, these " +"families now do different things and mismatches will probably result in a " +"segfault. You should carefully test your C extension modules with Python " +"2.5." msgstr "" #: ../../whatsnew/2.5.rst:2159 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index a241c7b6a9..dde7069360 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -1612,7 +1612,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1485 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/2.6.rst:1487 msgid "Some smaller changes made to the core Python language are:" @@ -2832,7 +2832,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2513 msgid "(Contributed by Brett Cannon.)" -msgstr "" +msgstr "(由 Brett Cannon 貢獻。)" #: ../../whatsnew/2.6.rst:2515 msgid "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 6f410de620..e5008d3cd9 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -675,7 +675,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:672 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/2.7.rst:674 msgid "Some smaller changes made to the core Python language are:" @@ -781,7 +781,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:782 msgid "(Implemented by Mark Dickinson; :issue:`3166`.)" -msgstr "" +msgstr "(由 Mark Dickinson 實作;:issue:`3166`。)" #: ../../whatsnew/2.7.rst:784 msgid "" @@ -2160,7 +2160,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1893 msgid "(Implemented by Antoine Pitrou; :issue:`4444`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 實作;:issue:`4444`。)" #: ../../whatsnew/2.7.rst:1897 msgid "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 74bd83bd96..eb995e6eb8 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -119,7 +119,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:117 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.1.rst:119 msgid "Some smaller changes made to the core Python language are:" @@ -145,6 +145,8 @@ msgid "" "(Contributed by Fredrik Johansson, Victor Stinner, Raymond Hettinger, and " "Mark Dickinson; :issue:`3439`.)" msgstr "" +"(由 Fredrik Johansson、Victor Stinner、Raymond Hettinger 和 Mark Dickinson " +"貢獻;:issue:`3439`。)" #: ../../whatsnew/3.1.rst:144 msgid "" @@ -159,7 +161,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:153 msgid "(Contributed by Eric Smith; :issue:`5237`.)" -msgstr "" +msgstr "(由 Eric Smith 貢獻;:issue:`5237`。)" #: ../../whatsnew/3.1.rst:155 msgid "" @@ -173,7 +175,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:162 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" -msgstr "" +msgstr "(由 Georg Brandl 貢獻;:issue:`5675`。)" #: ../../whatsnew/3.1.rst:164 msgid "" @@ -192,6 +194,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " +"`_。)" #: ../../whatsnew/3.1.rst:178 msgid "" @@ -201,7 +205,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:184 msgid "(Contributed by Mark Dickinson; :issue:`4707`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`4707`。)" #: ../../whatsnew/3.1.rst:186 msgid "" @@ -258,7 +262,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:222 msgid "(Contributed by Eric Smith and Mark Dickinson; :issue:`1580`)" -msgstr "" +msgstr "(由 Eric Smith 和 Mark Dickinson 貢獻;:issue:`1580`)" #: ../../whatsnew/3.1.rst:225 msgid "New, Improved, and Deprecated Modules" @@ -272,7 +276,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:233 msgid "(Contributed by Raymond Hettinger; :issue:`1696199`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻;:issue:`1696199`。)" #: ../../whatsnew/3.1.rst:235 msgid "" @@ -283,7 +287,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:239 msgid "(Contributed by Guilherme Polo; :issue:`2983`.)" -msgstr "" +msgstr "(由 Guilherme Polo 貢獻;:issue:`2983`。)" #: ../../whatsnew/3.1.rst:241 msgid "" @@ -293,7 +297,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:248 msgid "(Contributed by Antoine Pitrou.)" -msgstr "" +msgstr "(由 Antoine Pitrou 貢獻。)" #: ../../whatsnew/3.1.rst:250 msgid "" @@ -311,7 +315,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:261 msgid "(Contributed by Raymond Hettinger and Mark Dickinson.)" -msgstr "" +msgstr "(由 Raymond Hettinger 和 Mark Dickinso 貢獻。)" #: ../../whatsnew/3.1.rst:263 msgid "" @@ -326,7 +330,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:282 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻。)" #: ../../whatsnew/3.1.rst:284 msgid "" @@ -339,7 +343,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:301 msgid "(Contributed by Raymond Hettinger; :issue:`1818`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻;:issue:`1818`。)" #: ../../whatsnew/3.1.rst:303 msgid "" @@ -349,7 +353,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:306 msgid "(Contributed by Gregory Smith.)" -msgstr "" +msgstr "(由 Gregory Smith 貢獻。)" #: ../../whatsnew/3.1.rst:308 msgid "" @@ -361,7 +365,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:316 msgid "(Contributed by Vinay Sajip; :issue:`4384`)." -msgstr "" +msgstr "(由 Vinay Sajip 貢獻;:issue:`4384`)。" #: ../../whatsnew/3.1.rst:318 msgid "" @@ -372,7 +376,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:322 msgid "(Contributed by Andi Vajda; :issue:`4195`.)" -msgstr "" +msgstr "(由 Andi Vajda 貢獻;:issue:`4195`。)" #: ../../whatsnew/3.1.rst:324 msgid "" @@ -382,7 +386,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:327 msgid "(Contributed by Alexander Belopolsky; :issue:`4201`.)" -msgstr "" +msgstr "(由 Alexander Belopolsky 貢獻;:issue:`4201`。)" #: ../../whatsnew/3.1.rst:329 msgid ":class:`functools.partial` objects can now be pickled." @@ -402,7 +406,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:337 msgid "(Contributed by David Laban; :issue:`4739`.)" -msgstr "" +msgstr "(由 David Laban 貢獻;:issue:`4739`。)" #: ../../whatsnew/3.1.rst:339 msgid "" @@ -429,7 +433,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:368 msgid "(Contributed by Benjamin Peterson and Antoine Pitrou.)" -msgstr "" +msgstr "(由 Benjamin Peterson 和 Antoine Pitrou 貢獻。)" #: ../../whatsnew/3.1.rst:370 msgid "" @@ -443,7 +447,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:378 msgid "(Contributed by Ross Light; :issue:`4285`.)" -msgstr "" +msgstr "(由 Ross Light 貢獻;:issue:`4285`。)" #: ../../whatsnew/3.1.rst:380 msgid "The :mod:`nntplib` and :mod:`imaplib` modules now support IPv6." @@ -451,7 +455,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:382 msgid "(Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.)" -msgstr "" +msgstr "(由 Derek Morr 貢獻;:issue:`1655` 和 :issue:`1664`。)" #: ../../whatsnew/3.1.rst:384 msgid "" @@ -478,7 +482,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:406 msgid "" "(Contributed by Alexandre Vassalotti and Antoine Pitrou, :issue:`6137`.)" -msgstr "" +msgstr "(由 Alexandre Vassalotti 和 Antoine Pitrou 貢獻,:issue:`6137`。)" #: ../../whatsnew/3.1.rst:408 msgid "" @@ -491,11 +495,11 @@ msgstr "" #: ../../whatsnew/3.1.rst:414 msgid "(Contributed by Brett Cannon.)" -msgstr "" +msgstr "(由 Brett Cannon 貢獻。)" #: ../../whatsnew/3.1.rst:417 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.1.rst:419 msgid "Major performance enhancements have been added:" @@ -512,7 +516,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:428 msgid "(Contributed by Amaury Forgeot d'Arc and Antoine Pitrou.)" -msgstr "" +msgstr "(由 Amaury Forgeot d'Arc 和 Antoine Pitrou 貢獻。)" #: ../../whatsnew/3.1.rst:430 msgid "" @@ -524,7 +528,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:435 msgid "(Contributed by Antoine Pitrou, :issue:`4688`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 貢獻,:issue:`4688`。)" #: ../../whatsnew/3.1.rst:437 msgid "" @@ -538,7 +542,7 @@ msgstr "" msgid "" "(Contributed by Antoine Pitrou along with a number of other participants, :" "issue:`4753`)." -msgstr "" +msgstr "(由 Antoine Pitrou 和其他一些參與者共同貢獻,:issue:`4753`)。" #: ../../whatsnew/3.1.rst:446 msgid "" @@ -548,7 +552,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:449 msgid "" "(Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 和 Amaury Forgeot d'Arc 貢獻,:issue:`4868`。)" #: ../../whatsnew/3.1.rst:451 msgid "" @@ -564,6 +568,8 @@ msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" msgstr "" +"(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 Py3." +"1;:issue:`4136`。)" #: ../../whatsnew/3.1.rst:460 msgid "" @@ -573,7 +579,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:463 msgid "(Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.)" -msgstr "" +msgstr "(由 Jake McGuire 和 Antoine Pitrou 貢獻;:issue:`5084`。)" #: ../../whatsnew/3.1.rst:466 msgid "IDLE" @@ -587,7 +593,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:471 msgid "(Contributed by Roger D. Serwy; :issue:`5150`.)" -msgstr "" +msgstr "(由 Roger D. Serwy 貢獻;:issue:`5150`。)" #: ../../whatsnew/3.1.rst:474 msgid "Build and C API Changes" @@ -620,7 +626,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:497 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" #: ../../whatsnew/3.1.rst:499 msgid "" @@ -630,7 +636,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:502 msgid "(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)" -msgstr "" +msgstr "(由 Mark Dickinson 和 Lisandro Dalcrin 貢獻;:issue:`5175`。)" #: ../../whatsnew/3.1.rst:504 msgid "" @@ -639,7 +645,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:506 msgid "(Contributed by Mark Dickinson; :issue:`4910`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`4910`。)" #: ../../whatsnew/3.1.rst:508 msgid "" @@ -650,7 +656,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:511 msgid "(Contributed by Mark Dickinson; :issue:`5914`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`5914`。)" #: ../../whatsnew/3.1.rst:513 msgid "" @@ -663,7 +669,7 @@ msgstr "" #: ../../whatsnew/3.1.rst:519 msgid "(Contributed by Larry Hastings; :issue:`5630`.)" -msgstr "" +msgstr "(由 Larry Hastings 貢獻;:issue:`5630`。)" #: ../../whatsnew/3.1.rst:522 msgid "Porting to Python 3.1" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 2fa09db3b8..84c95a3415 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -948,7 +948,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:806 msgid "Other Language Changes" -msgstr "其他語言變化" +msgstr "其他語言更動" #: ../../whatsnew/3.10.rst:808 msgid "" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index bf152464dd..904feb82e4 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-27 00:03+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-" @@ -439,7 +439,7 @@ msgstr "由 Phillip Eby 撰寫 PEP。" #: ../../whatsnew/3.2.rst:436 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.2.rst:438 msgid "Some smaller changes made to the core Python language are:" @@ -488,7 +488,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:498 msgid "(Contributed by Marcin Wojdyr in :issue:`1772833`)." -msgstr "" +msgstr "(由 Marcin Wojdyr 在 :issue:`1772833` 中貢獻)。" #: ../../whatsnew/3.2.rst:500 msgid "" @@ -549,12 +549,12 @@ msgstr "(請見 :issue:`4617`\\ 。)" #: ../../whatsnew/3.2.rst:569 msgid "" -"The internal :c:type:`structsequence` tool now creates subclasses of tuple. " -"This means that C structures like those returned by :func:`os.stat`, :func:" -"`time.gmtime`, and :data:`sys.version_info` now work like a :term:`named " -"tuple` and now work with functions and methods that expect a tuple as an " -"argument. This is a big step forward in making the C structures as flexible " -"as their pure Python counterparts:" +":ref:`Struct sequence types ` are now subclasses of " +"tuple. This means that C structures like those returned by :func:`os.stat`, :" +"func:`time.gmtime`, and :data:`sys.version_info` now work like a :term:" +"`named tuple` and now work with functions and methods that expect a tuple as " +"an argument. This is a big step forward in making the C structures as " +"flexible as their pure Python counterparts:" msgstr "" #: ../../whatsnew/3.2.rst:582 @@ -623,6 +623,8 @@ msgid "" "(Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky " "in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)" msgstr "" +"(由 Daniel Stutzbach 在 :issue:`9213`、Alexander Belopolsky 在 " +":issue:`2690`、Nick Coghlan 在 :issue:`10889` 中貢獻。)" #: ../../whatsnew/3.2.rst:640 msgid "" @@ -832,7 +834,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:753 msgid "(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)" -msgstr "" +msgstr "(由 Florent Xicluna 和 Fredrik Lundh 貢獻,:issue:`6472`。)" #: ../../whatsnew/3.2.rst:756 msgid "functools" @@ -916,7 +918,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:917 ../../whatsnew/3.2.rst:1787 #: ../../whatsnew/3.2.rst:1831 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻。)" #: ../../whatsnew/3.2.rst:828 msgid "" @@ -951,7 +953,7 @@ msgstr "" msgid "" "(Contributed by Raymond Hettinger and incorporating design suggestions from " "Mark Dickinson.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻,並結合了 Mark Dickinson 的設計建議。)" #: ../../whatsnew/3.2.rst:861 msgid "collections" @@ -1068,6 +1070,8 @@ msgid "" "(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin " "in :issue:`8777`.)" msgstr "" +"(在 :issue:`8777` 中由 Kristján Valur Jónsson 貢獻、Jeffrey Yasskin 進行 " +"API 審查。)" #: ../../whatsnew/3.2.rst:987 msgid "datetime and time" @@ -1125,6 +1129,9 @@ msgid "" "`1289118`, :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :" "issue:`8013`, and :issue:`10827`.)" msgstr "" +"(由 Alexander Belopolsky 和 Victor Stinner 在 :issue:`1289118`" +"、:issue:`5094`、:issue:`6641`、:issue:`2706`、:issue:`1777412`、:issue:`8013` " +"和 :issue:`10827` 中貢獻。)" #: ../../whatsnew/3.2.rst:1046 msgid "math" @@ -1168,7 +1175,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1094 msgid "(Contributed by Mark Dickinson.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻。)" #: ../../whatsnew/3.2.rst:1097 msgid "abc" @@ -1205,7 +1212,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1145 msgid "(Contributed by Antoine Pitrou in :issue:`5506`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`5506` 中貢獻。)" #: ../../whatsnew/3.2.rst:1148 msgid "reprlib" @@ -1229,7 +1236,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1171 msgid "(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 在 :issue:`9826` 和 :issue:`9840` 中貢獻。)" #: ../../whatsnew/3.2.rst:1174 msgid "logging" @@ -1369,7 +1376,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1290 msgid "(Contributed by Michael Foord in :issue:`9110`.)" -msgstr "" +msgstr "(由 Michael Foord 在 :issue:`9110` 中貢獻。)" #: ../../whatsnew/3.2.rst:1293 msgid "decimal and fractions" @@ -1433,7 +1440,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1342 msgid "(Contributed by Mark Dickinson and Raymond Hettinger.)" -msgstr "" +msgstr "(由 Mark Dickinson 和 Raymond Hettinger 貢獻。)" #: ../../whatsnew/3.2.rst:1345 msgid "ftp" @@ -1457,6 +1464,8 @@ msgid "" "(Contributed by Tarek Ziadé and Giampaolo Rodolà in :issue:`4972`, and by " "Georg Brandl in :issue:`8046` and :issue:`1286`.)" msgstr "" +"(由 Tarek Ziadé 和 Giampaolo Rodolà 在 :issue:`4972` 中貢獻,由 Georg " +"Brandl 在 :issue:`8046` 和 :issue:`1286` 中貢獻。)" #: ../../whatsnew/3.2.rst:1372 msgid "" @@ -1468,7 +1477,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1376 msgid "(Contributed by Giampaolo Rodolà; :issue:`8806`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 貢獻;:issue:`8806`。)" #: ../../whatsnew/3.2.rst:1379 msgid "popen" @@ -1485,6 +1494,7 @@ msgid "" "(Contributed by Antoine Pitrou and Brian Curtin in :issue:`7461` and :issue:" "`10554`.)" msgstr "" +"(由 Antoine Pitrou 和 Brian Curtin 在 :issue:`7461` 和 :issue:`10554` 中貢獻。)" #: ../../whatsnew/3.2.rst:1388 msgid "select" @@ -1528,6 +1538,9 @@ msgid "" "Aides and Brian Curtin in :issue:`9962`, :issue:`1675951`, :issue:`7471` " "and :issue:`2846`.)" msgstr "" +"(由 Anand B. Pillai 在 :issue:`3488` 中貢獻;由 Antoine Pitrou、Nir Aides " +"和 Brian Curtin 在 :issue:`9962`、:issue:`1675951`、:issue:`7471` 和 :issue: " +"`2846` 中貢獻。)" #: ../../whatsnew/3.2.rst:1430 msgid "" @@ -1600,7 +1613,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1516 msgid "(Implemented by Benjamin Peterson and Georg Brandl.)" -msgstr "" +msgstr "(由 Benjamin Peterson 和 Georg Brandl 實作。)" #: ../../whatsnew/3.2.rst:1519 msgid "os" @@ -1630,7 +1643,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1539 msgid "(Contributed by Victor Stinner.)" -msgstr "" +msgstr "(由 Victor Stinner 貢獻。)" #: ../../whatsnew/3.2.rst:1542 msgid "shutil" @@ -1655,7 +1668,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1553 ../../whatsnew/3.2.rst:1591 msgid "(Contributed by Tarek Ziadé.)" -msgstr "" +msgstr "(由 Tarek Ziadé 貢獻。)" #: ../../whatsnew/3.2.rst:1555 msgid "" @@ -1701,7 +1714,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1606 msgid "(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)" -msgstr "" +msgstr "(由 R. David Murray 和 Shashwat Anand 貢獻;:issue:`8845`。)" #: ../../whatsnew/3.2.rst:1609 msgid "html" @@ -1805,6 +1818,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:" "`8322`, :issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)" msgstr "" +"(由 Antoine Pitrou 在 :issue:`8850`、:issue:`1589`、:issue:`8322`、:issue:`5" +"639`、:issue:`4870`、:issue:`8484` 和 :issue:`8321` 中貢獻。)" #: ../../whatsnew/3.2.rst:1677 msgid "nntp" @@ -1829,7 +1844,7 @@ msgstr "" msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`9360` 中和 Andrew Vant 在 :issue:`1926` 中貢獻。)" #: ../../whatsnew/3.2.rst:1691 msgid "certificates" @@ -1859,7 +1874,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1706 msgid "(Contributed by Lorenzo M. Catucci and Antoine Pitrou, :issue:`4471`.)" -msgstr "" +msgstr "(由 Lorenzo M. Catucci 和 Antoine Pitrou 於 :issue:`4471` 貢獻。)" #: ../../whatsnew/3.2.rst:1709 msgid "http.client" @@ -1936,7 +1951,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1758 ../../whatsnew/3.2.rst:1767 #: ../../whatsnew/3.2.rst:1923 msgid "(Contributed by Michael Foord.)" -msgstr "" +msgstr "(由 Michael Foord 貢獻。)" #: ../../whatsnew/3.2.rst:1760 msgid "" @@ -1953,7 +1968,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1777 msgid "(Contributed by Antoine Pitrou, :issue:`9754`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 於 :issue:`9754` 貢獻。)" #: ../../whatsnew/3.2.rst:1779 msgid "" @@ -1992,7 +2007,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1806 msgid "(Contributed by Raymond Hettinger and implemented by Ezio Melotti.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻,由 Ezio Melotti 實作。)" #: ../../whatsnew/3.2.rst:1808 msgid "" @@ -2056,7 +2071,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1824 msgid "(Contributed by Ezio Melotti; :issue:`9424`.)" -msgstr "" +msgstr "(由 Ezio Melotti 貢獻;:issue:`9424`。)" #: ../../whatsnew/3.2.rst:1826 msgid "" @@ -2084,7 +2099,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1845 msgid "(Contributed by Raymond Hettinger; :issue:`9025`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻;:issue:`9025`。)" #: ../../whatsnew/3.2.rst:1848 msgid "poplib" @@ -2100,7 +2115,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1855 msgid "(Contributed by Giampaolo Rodolà; :issue:`8807`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 貢獻;:issue:`8807`。)" #: ../../whatsnew/3.2.rst:1858 msgid "asyncore" @@ -2118,7 +2133,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1867 msgid "(Contributed by Giampaolo Rodolà; :issue:`6706`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 貢獻;:issue:`6706`。)" #: ../../whatsnew/3.2.rst:1870 msgid "tempfile" @@ -2133,7 +2148,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1879 msgid "(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)" -msgstr "" +msgstr "(由 Neil Schedulenauer 和 Nick Coghlan 貢獻;:issue:`5178`。)" #: ../../whatsnew/3.2.rst:1882 msgid "inspect" @@ -2148,7 +2163,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1903 msgid "(Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)" -msgstr "" +msgstr "(由 Rodolfo Eckhardt 和 Nick Coghlan 於 :issue:`10220` 貢獻。)" #: ../../whatsnew/3.2.rst:1905 msgid "" @@ -2171,7 +2186,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1936 msgid "(Contributed by Ron Adam; :issue:`2001`.)" -msgstr "" +msgstr "(由 Ron Adam 貢獻;:issue:`2001`。)" #: ../../whatsnew/3.2.rst:1939 msgid "dis" @@ -2201,7 +2216,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:1994 msgid "(Contributed by Nick Coghlan in :issue:`9147`.)" -msgstr "" +msgstr "(由 Nick Coghlan 在 :issue:`9147` 中貢獻。)" #: ../../whatsnew/3.2.rst:1997 msgid "dbm" @@ -2262,7 +2277,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2044 msgid "(Contributed by Tarek Ziadé in :issue:`6693`.)" -msgstr "" +msgstr "(由 Tarek Ziadé 在 :issue:`6693` 中貢獻。)" #: ../../whatsnew/3.2.rst:2047 msgid "sysconfig" @@ -2369,7 +2384,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2129 msgid "(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)" -msgstr "" +msgstr "(由 Georg Brandl、Antonio Cuni 和 Ilya Sandler 貢獻。)" #: ../../whatsnew/3.2.rst:2132 msgid "configparser" @@ -2563,7 +2578,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2332 msgid "(Contributed by Antoine Pitrou.)" -msgstr "" +msgstr "(由 Antoine Pitrou 貢獻。)" #: ../../whatsnew/3.2.rst:2334 msgid "" @@ -2625,6 +2640,8 @@ msgid "" "(Contributed by Alexandre Vassalotti, Antoine Pitrou and the Unladen Swallow " "team in :issue:`9410` and :issue:`3873`.)" msgstr "" +"(由 Alexandre Vassalotti、Antoine Pitrou 和 Unladen Swallow 團隊在 :issue:`9410` " +"和 :issue:`3873` 中貢獻。)" #: ../../whatsnew/3.2.rst:2373 msgid "" @@ -2653,6 +2670,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" +"(由 Antoine Pitrou 在 :issue:`7451` 中貢獻、由 Raymond Hettinger 和 Antoine Pitrou " +"在 :issue:`10314` 中貢獻。)" #: ../../whatsnew/3.2.rst:2390 msgid "" @@ -2663,7 +2682,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2394 msgid "(Contributed by Antoine Pitrou; :issue:`3001`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 貢獻;:issue:`3001`。)" #: ../../whatsnew/3.2.rst:2396 msgid "" @@ -2813,7 +2832,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2488 msgid "(Contributed by Alexander Belopolsky in :issue:`9528`.)" -msgstr "" +msgstr "(由 Alexander Belopolsky 在 :issue:`9528` 中貢獻。)" #: ../../whatsnew/3.2.rst:2490 msgid "" @@ -2824,7 +2843,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2494 msgid "(Contributed by Georg Brandl in :issue:`7962`.)" -msgstr "" +msgstr "(由 Georg Brandl 在 :issue:`7962` 中貢獻。)" #: ../../whatsnew/3.2.rst:2498 msgid "IDLE" @@ -2838,7 +2857,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2503 msgid "(Contributed by Raymond Hettinger; :issue:`5150`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 貢獻;:issue:`5150`。)" #: ../../whatsnew/3.2.rst:2505 msgid "IDLE on Mac OS X now works with both Carbon AquaTk and Cocoa AquaTk." @@ -2847,7 +2866,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2507 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" -msgstr "" +msgstr "(由 Kevin Walzer、Ned Deily 和 Ronald Oussoren 貢獻;:issue:`6075`。)" #: ../../whatsnew/3.2.rst:2510 msgid "Code Repository" @@ -2913,7 +2932,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2547 msgid "(Contributed by Antoine Pitrou; :issue:`9203`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 貢獻;:issue:`9203`。)" #: ../../whatsnew/3.2.rst:2549 msgid "" @@ -2923,7 +2942,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2552 msgid "(Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)" -msgstr "" +msgstr "(由 Amaury Forgeot D'Arc 貢獻;:issue:`9210`。)" #: ../../whatsnew/3.2.rst:2554 msgid "" @@ -2940,6 +2959,7 @@ msgid "" "(Suggested by Raymond Hettinger and implemented by Benjamin Peterson; :issue:" "`9778`.)" msgstr "" +"(由 Raymond Hettinger 建議並由 Benjamin Peterson 實作;:issue:`9778`。)" #: ../../whatsnew/3.2.rst:2564 msgid "" @@ -3142,7 +3162,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2682 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" -msgstr "" +msgstr "(由 Georg Brandl 貢獻;:issue:`5675`。)" #: ../../whatsnew/3.2.rst:2684 msgid "" @@ -3158,6 +3178,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " +"`_。)" #: ../../whatsnew/3.2.rst:2698 msgid "" @@ -3211,7 +3233,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2727 msgid "(Contributed by Antoine Pitrou, :issue:`10711`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 於 :issue:`10711` 貢獻。)" #: ../../whatsnew/3.2.rst:2729 msgid "" @@ -3221,7 +3243,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2732 msgid "(Contributed by Antoine Pitrou, :issue:`10272`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 於 :issue:`10272` 貢獻。)" #: ../../whatsnew/3.2.rst:2734 msgid "" @@ -3240,7 +3262,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2742 msgid "(Contributed by Giampaolo Rodola in :issue:`6706`.)" -msgstr "" +msgstr "(由 Giampaolo Rodola 在 :issue:`6706` 中貢獻。)" #: ../../whatsnew/3.2.rst:2744 msgid "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 0d5d3b7c0f..f99076c0d2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -290,7 +290,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:199 msgid "(Contributed by Stefan Krah in :issue:`10181`.)" -msgstr "" +msgstr "(由 Stefan Krah 在 :issue:`10181` 中貢獻。)" #: ../../whatsnew/3.3.rst:203 msgid ":pep:`3118` - Revising the Buffer Protocol" @@ -987,11 +987,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:773 msgid "(Implementation by Brett Cannon)" -msgstr "" +msgstr "(由 Brett Cannon 實作)" #: ../../whatsnew/3.3.rst:777 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.3.rst:779 msgid "Some smaller changes made to the core Python language are:" @@ -1006,7 +1006,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:785 msgid "(Contributed by Ezio Melotti in :issue:`12753`.)" -msgstr "" +msgstr "(由 Ezio Melotti 在 :issue:`12753` 中貢獻。)" #: ../../whatsnew/3.3.rst:787 msgid "Unicode database updated to UCD version 6.1.0" @@ -1028,7 +1028,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:797 msgid "(Contributed by Petri Lehtinen in :issue:`12170`.)" -msgstr "" +msgstr "(由 Petri Lehtinen 在 :issue:`12170` 中貢獻。)" #: ../../whatsnew/3.3.rst:799 msgid "" @@ -1052,7 +1052,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:810 msgid "(Contributed by Antoine Pitrou in :issue:`13748`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`13748` 中貢獻。)" #: ../../whatsnew/3.3.rst:812 msgid "" @@ -1062,7 +1062,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:815 msgid "(Contributed by Filip Gruszczyński in :issue:`13521`.)" -msgstr "" +msgstr "(由 Filip Gruszczyński 在 :issue:`13521` 中貢獻。)" #: ../../whatsnew/3.3.rst:817 msgid "" @@ -1072,7 +1072,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:820 msgid "(Contributed by Benjamin Peterson.)" -msgstr "" +msgstr "(由 Benjamin Peterson 貢獻。)" #: ../../whatsnew/3.3.rst:824 msgid "A Finer-Grained Import Lock" @@ -1097,7 +1097,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:837 msgid "(Contributed by Antoine Pitrou in :issue:`9260`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`9260` 中貢獻。)" #: ../../whatsnew/3.3.rst:841 msgid "Builtin functions and types" @@ -1175,7 +1175,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:897 msgid "(Contributed by Google and Peter Moody in :pep:`3144`.)" -msgstr "" +msgstr "(由 Google 和 Peter Moody 在 :pep:`3144` 中貢獻。)" #: ../../whatsnew/3.3.rst:900 msgid "lzma" @@ -1190,7 +1190,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:906 msgid "(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`.)" -msgstr "" +msgstr "(由 Nadeem Vawda 和 Per Øyvind Karlsen 在 :issue:`6715` 中貢獻。)" #: ../../whatsnew/3.3.rst:910 msgid "Improved Modules" @@ -1228,7 +1228,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:927 msgid "(Contributed by Darren Dale in :issue:`11610`.)" -msgstr "" +msgstr "(由 Darren Dale 在 :issue:`11610` 中貢獻。)" #: ../../whatsnew/3.3.rst:929 msgid "" @@ -1248,7 +1248,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:939 msgid "(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`.)" -msgstr "" +msgstr "(由 Oren Tirosh 和 Hirokazu Yamamoto 在 :issue:`1172711` 中貢獻。)" #: ../../whatsnew/3.3.rst:943 msgid "base64" @@ -1297,7 +1297,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:970 msgid "(Contributed by Nadeem Vawda in :issue:`5863`.)" -msgstr "" +msgstr "(由 Nadeem Vawda 在 :issue:`5863` 中貢獻。)" #: ../../whatsnew/3.3.rst:972 msgid "" @@ -1309,7 +1309,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:977 msgid "(Contributed by Nir Aides in :issue:`1625`.)" -msgstr "" +msgstr "(由 Nir Aides 在 :issue:`1625` 中貢獻。)" #: ../../whatsnew/3.3.rst:979 msgid "" @@ -1464,7 +1464,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1074 msgid "(Contributed by Iñigo Serna in :issue:`6755`.)" -msgstr "" +msgstr "(由 Iñigo Serna 在 :issue:`6755` 中貢獻。)" #: ../../whatsnew/3.3.rst:1077 msgid "datetime" @@ -1622,12 +1622,12 @@ msgid ":const:`MAX_PREC`" msgstr ":const:`MAX_PREC`" #: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 -msgid ":const:`425000000`" -msgstr ":const:`425000000`" +msgid "``425000000``" +msgstr "``425000000``" #: ../../whatsnew/3.3.rst:1141 ../../whatsnew/3.3.rst:1143 -msgid ":const:`999999999999999999`" -msgstr ":const:`999999999999999999`" +msgid "``999999999999999999``" +msgstr "``999999999999999999``" #: ../../whatsnew/3.3.rst:1143 msgid ":const:`MAX_EMAX`" @@ -1638,19 +1638,19 @@ msgid ":const:`MIN_EMIN`" msgstr ":const:`MIN_EMIN`" #: ../../whatsnew/3.3.rst:1145 -msgid ":const:`-425000000`" -msgstr ":const:`-425000000`" +msgid "``-425000000``" +msgstr "``-425000000``" #: ../../whatsnew/3.3.rst:1145 -msgid ":const:`-999999999999999999`" -msgstr ":const:`-999999999999999999`" +msgid "``-999999999999999999``" +msgstr "``-999999999999999999``" #: ../../whatsnew/3.3.rst:1148 msgid "" "In the context templates (:class:`~decimal.DefaultContext`, :class:`~decimal." "BasicContext` and :class:`~decimal.ExtendedContext`) the magnitude of :attr:" -"`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to :" -"const:`999999`." +"`~decimal.Context.Emax` and :attr:`~decimal.Context.Emin` has changed to " +"``999999``." msgstr "" #: ../../whatsnew/3.3.rst:1153 @@ -2044,7 +2044,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1456 msgid "(Contributed by Sijin Joseph in :issue:`8808`.)" -msgstr "" +msgstr "(由 Sijin Joseph 在 :issue:`8808` 中貢獻。)" #: ../../whatsnew/3.3.rst:1460 msgid "inspect" @@ -2060,7 +2060,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1467 msgid "(Contributed by Meador Inge and Nick Coghlan in :issue:`13062`.)" -msgstr "" +msgstr "(由 Meador Inge 與 Nick Coghlan 在 :issue:`13062` 中貢獻。)" #: ../../whatsnew/3.3.rst:1469 msgid "" @@ -2072,7 +2072,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1474 msgid "(Contributed by Meador Inge in :issue:`15153`.)" -msgstr "" +msgstr "(由 Meador Inge 於 :issue:`15153` 中貢獻。)" #: ../../whatsnew/3.3.rst:1477 msgid "io" @@ -2087,7 +2087,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1483 msgid "(Contributed by David Townshend in :issue:`12760`.)" -msgstr "" +msgstr "(由 David Townshend 於 :issue:`12760` 中貢獻。)" #: ../../whatsnew/3.3.rst:1485 msgid "" @@ -2140,7 +2140,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1518 msgid "(Written by Mark Dickinson in :issue:`11888`.)" -msgstr "" +msgstr "(由 Mark Dickinson 於 :issue:`11888` 中撰寫)" #: ../../whatsnew/3.3.rst:1522 msgid "mmap" @@ -2208,7 +2208,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1572 msgid "(Contributed by Giampaolo Rodolà in :issue:`9795`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 於 :issue:`9795` 中貢獻。)" #: ../../whatsnew/3.3.rst:1576 msgid "os" @@ -2237,6 +2237,7 @@ msgstr "" msgid "" "(Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)" msgstr "" +"(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" #: ../../whatsnew/3.3.rst:1593 msgid "" @@ -2295,7 +2296,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1630 msgid "(Patch submitted by Giampaolo Rodolà in :issue:`10784`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 於 :issue:`10784` 提交補丁。)" #: ../../whatsnew/3.3.rst:1632 msgid "" @@ -2452,7 +2453,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1713 msgid "(Contributed by Georg Brandl in :issue:`14210`)" -msgstr "" +msgstr "(由 Georg Brandl 在 :issue:`14210` 中貢獻)" #: ../../whatsnew/3.3.rst:1717 msgid "pickle" @@ -2466,7 +2467,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1723 msgid "(Contributed by Richard Oudkerk in :issue:`14166`.)" -msgstr "" +msgstr "(由 Richard Oudkerk 在 :issue:`14166` 中貢獻。)" #: ../../whatsnew/3.3.rst:1727 msgid "pydoc" @@ -2490,7 +2491,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1739 msgid "(Contributed by Serhiy Storchaka in :issue:`3665`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`3665` 中貢獻。)" #: ../../whatsnew/3.3.rst:1743 msgid "sched" @@ -2738,7 +2739,7 @@ msgstr ":func:`~socket.socket.recvmsg_into`" msgid "" "(Contributed by David Watson in :issue:`6560`, based on an earlier patch by " "Heiko Wundram)" -msgstr "" +msgstr "(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" #: ../../whatsnew/3.3.rst:1888 msgid "" @@ -2751,7 +2752,7 @@ msgstr "" msgid "" "(Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:" "`10141`.)" -msgstr "" +msgstr "(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" #: ../../whatsnew/3.3.rst:1894 msgid "" @@ -2818,7 +2819,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1934 msgid "(Contributed by Victor Stinner in :issue:`12049`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`12049` 中貢獻。)" #: ../../whatsnew/3.3.rst:1936 msgid "" @@ -2897,7 +2898,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1981 msgid "(Contributed by Giampaolo Rodolà in :issue:`14807`.)" -msgstr "" +msgstr "(由 Giampaolo Rodolà 在 :issue:`14807` 中貢獻。)" #: ../../whatsnew/3.3.rst:1985 msgid "struct" @@ -3186,6 +3187,8 @@ msgid "" "(Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:" "`15026`.)" msgstr "" +"(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` " +"貢獻。)" #: ../../whatsnew/3.3.rst:2170 msgid "Build and C API Changes" @@ -3237,11 +3240,11 @@ msgstr ":c:func:`PyUnicode_ReadChar`, :c:func:`PyUnicode_WriteChar`" #: ../../whatsnew/3.3.rst:2189 msgid "Low-level API:" -msgstr "" +msgstr "低階 API:" #: ../../whatsnew/3.3.rst:2191 msgid ":c:type:`Py_UCS1`, :c:type:`Py_UCS2`, :c:type:`Py_UCS4` types" -msgstr "" +msgstr ":c:type:`Py_UCS1`、:c:type:`Py_UCS2`、:c:type:`Py_UCS4` 型別" #: ../../whatsnew/3.3.rst:2192 msgid ":c:type:`PyASCIIObject` and :c:type:`PyCompactUnicodeObject` structures" @@ -3269,13 +3272,10 @@ msgstr "" #: ../../whatsnew/3.3.rst:2198 msgid "" -":c:macro:`PyUnicode_KIND` with :c:type:`PyUnicode_Kind` enum: :c:data:" +":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:" "`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" "`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" msgstr "" -":c:macro:`PyUnicode_KIND` with :c:type:`PyUnicode_Kind` enum: :c:data:" -"`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" -"`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" #: ../../whatsnew/3.3.rst:2201 msgid "" @@ -3528,11 +3528,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:2317 msgid "" ":c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" -msgstr "" +msgstr ":c:func:`PyUnicode_EncodeLatin1`:使用 :c:func:`PyUnicode_AsLatin1String`" #: ../../whatsnew/3.3.rst:2318 msgid ":c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" -msgstr "" +msgstr ":c:func:`PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" #: ../../whatsnew/3.3.rst:2319 msgid ":c:func:`PyUnicode_EncodeCharmap`" @@ -3553,6 +3553,8 @@ msgid "" ":c:func:`PyUnicode_EncodeDecimal`, :c:func:" "`PyUnicode_TransformDecimalToASCII`" msgstr "" +":c:func:`PyUnicode_EncodeDecimal`、:c:func:" +"`PyUnicode_TransformDecimalToASCII`" #: ../../whatsnew/3.3.rst:2328 msgid "Deprecated features" @@ -3825,7 +3827,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2503 msgid "(implemented in :issue:`14040`.)" -msgstr "" +msgstr "(於 :issue:`14040` 中實作。)" #: ../../whatsnew/3.3.rst:2507 msgid "Command Line Switch Changes" @@ -3839,7 +3841,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2512 msgid "(:issue:`10998`, contributed by Éric Araujo.)" -msgstr "" +msgstr "(由 Éric Araujo 於 :issue:`10998` 中實作。)" #: ../../whatsnew/3.3.rst:2514 msgid "" @@ -3851,7 +3853,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2518 msgid "" "(:issue:`11591`, contributed by Carl Meyer with editions by Éric Araujo.)" -msgstr "" +msgstr "(:issue:`11591`,由 Carl Meyer 貢獻並由 Éric Araujo 修訂。)" #: ../../whatsnew/3.3.rst:396 msgid "yield" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 0d3eefaa6b..c4446f704f 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -495,6 +495,7 @@ msgid "" "(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" "`17828` and :issue:`19619`.)" msgstr "" +"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:`19619` 中貢獻。)" #: ../../whatsnew/3.4.rst:381 msgid "PEP 451: A ModuleSpec Type for the Import System" @@ -522,7 +523,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:401 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.4.rst:403 msgid "Some smaller changes made to the core Python language are:" @@ -1017,6 +1018,8 @@ msgid "" "(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" "`11816` and Claudiu Popa in :issue:`17916`.)" msgstr "" +"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 Claudiu " +"Popa 在 :issue:`17916` 中貢獻。)" #: ../../whatsnew/3.4.rst:770 msgid "" @@ -1297,7 +1300,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:971 msgid "idlelib and IDLE" -msgstr "" +msgstr "idlelib 與 IDLE" #: ../../whatsnew/3.4.rst:973 msgid "" @@ -2447,7 +2450,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1798 msgid "CPython Implementation Changes" -msgstr "" +msgstr "CPython 實作變更" #: ../../whatsnew/3.4.rst:1804 msgid "PEP 445: Customization of CPython Memory Allocators" @@ -2743,7 +2746,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2012 msgid "Significant Optimizations" -msgstr "" +msgstr "顯著最佳化" #: ../../whatsnew/3.4.rst:2014 msgid "" @@ -2935,7 +2938,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2146 msgid "Deprecated Features" -msgstr "" +msgstr "已棄用功能" #: ../../whatsnew/3.4.rst:2148 msgid "" @@ -2965,7 +2968,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2166 msgid "OS/2 (:issue:`16135`)." -msgstr "" +msgstr "OS/2 (:issue:`16135`)。" #: ../../whatsnew/3.4.rst:2167 msgid "Windows 2000 (changeset e52df05b496a)." @@ -2978,11 +2981,11 @@ msgstr "" #: ../../whatsnew/3.4.rst:2169 msgid "VMS (:issue:`16136`)." -msgstr "" +msgstr "VMS (:issue:`16136`)。" #: ../../whatsnew/3.4.rst:2173 msgid "API and Feature Removals" -msgstr "" +msgstr "API 與功能的移除" #: ../../whatsnew/3.4.rst:2175 msgid "" @@ -3065,7 +3068,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2224 msgid "Code Cleanups" -msgstr "" +msgstr "程式碼的清除" #: ../../whatsnew/3.4.rst:2226 msgid "" @@ -3128,7 +3131,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2267 msgid "Changes in the Python API" -msgstr "" +msgstr "Python API 的變更" #: ../../whatsnew/3.4.rst:2269 msgid "" @@ -3501,7 +3504,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2519 msgid "Changed in 3.4.3" -msgstr "" +msgstr "3.4.3 中的變更" #: ../../whatsnew/3.4.rst:2524 msgid "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index a079ea1c87..a1af180a8a 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-27 00:03+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-" @@ -788,7 +788,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:701 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.5.rst:703 msgid "Some smaller changes made to the core Python language are:" @@ -1115,7 +1115,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:928 msgid "(Contributed by Berker Peksag in :issue:`24064`.)" -msgstr "" +msgstr "(由 Berker Peksag 在 :issue:`24064` 中貢獻。)" #: ../../whatsnew/3.5.rst:930 msgid "" @@ -1227,7 +1227,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1016 msgid "(Contributed by Łukasz Langa in :issue:`18159`.)" -msgstr "" +msgstr "(由 Łukasz Langa 在 :issue:`18159` 中貢獻。)" #: ../../whatsnew/3.5.rst:1020 msgid "contextlib" @@ -1243,7 +1243,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1035 msgid "(Contributed by Berker Peksag in :issue:`22389`.)" -msgstr "" +msgstr "(由 Berker Peksag 在 :issue:`22389` 中貢獻。)" #: ../../whatsnew/3.5.rst:1039 msgid "csv" @@ -1376,7 +1376,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1134 msgid "(Contributed by Ethan Furman in :issue:`21706`.)" -msgstr "" +msgstr "(由 Ethan Furman 在 :issue:`21706` 中貢獻。)" #: ../../whatsnew/3.5.rst:1138 msgid "faulthandler" @@ -1437,7 +1437,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1189 msgid "(Contributed by Raymond Hettinger in :issue:`13742`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 在 :issue:`13742` 中貢獻。)" #: ../../whatsnew/3.5.rst:1193 msgid "http" @@ -1466,7 +1466,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1219 msgid "(Contributed by Martin Panter in :issue:`3566`.)" -msgstr "" +msgstr "(由 Martin Panter 在 :issue:`3566` 中貢獻。)" #: ../../whatsnew/3.5.rst:1223 msgid "idlelib and IDLE" @@ -1571,7 +1571,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1299 msgid "(Contributed by Yury Selivanov in :issue:`24190`.)" -msgstr "" +msgstr "(由 Yury Selivanov 在 :issue:`24190` 中貢獻。)" #: ../../whatsnew/3.5.rst:1301 msgid "" @@ -1631,7 +1631,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1348 msgid "(Contributed by Peter Moody and Antoine Pitrou in :issue:`16531`.)" -msgstr "" +msgstr "(由 Peter Moody 和 Antoine Pitrou 在 :issue:`16531` 中貢獻。)" #: ../../whatsnew/3.5.rst:1350 msgid "" @@ -1642,7 +1642,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1362 msgid "(Contributed by Leon Weber in :issue:`20480`.)" -msgstr "" +msgstr "(由 Leon Weber 在 :issue:`20480` 中貢獻。)" #: ../../whatsnew/3.5.rst:1366 msgid "json" @@ -1689,7 +1689,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1404 msgid "(Contributed by Cédric Krier in :issue:`13918`.)" -msgstr "" +msgstr "(由 Cédric Krier 在 :issue:`13918` 中貢獻。)" #: ../../whatsnew/3.5.rst:1408 msgid "logging" @@ -1705,7 +1705,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1423 msgid "(Contributed by Yury Selivanov in :issue:`20537`.)" -msgstr "" +msgstr "(由 Yury Selivanov 在 :issue:`20537` 中貢獻。)" #: ../../whatsnew/3.5.rst:1425 msgid "" @@ -1840,7 +1840,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1518 msgid "(Contributed by Rafik Draoui and Serhiy Storchaka in :issue:`10395`.)" -msgstr "" +msgstr "(由 Rafik Draoui 和 Serhiy Storchaka 在 :issue:`10395` 中貢獻。)" #: ../../whatsnew/3.5.rst:1522 msgid "pathlib" @@ -1855,7 +1855,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1534 msgid "(Contributed by Vajrasky Kok and Antoine Pitrou in :issue:`19775`.)" -msgstr "" +msgstr "(由 Vajrasky Kok 和 Antoine Pitrou 在 :issue:`19775` 中貢獻。)" #: ../../whatsnew/3.5.rst:1536 msgid "" @@ -1895,7 +1895,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1563 msgid "(Contributed by Christopher Welborn in :issue:`20218`.)" -msgstr "" +msgstr "(由 Christopher Welborn 在 :issue:`20218` 中貢獻。)" #: ../../whatsnew/3.5.rst:1567 msgid "pickle" @@ -1932,7 +1932,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1596 msgid "(Contributed by Serhiy Storchaka in :issue:`9179`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`9179` 中貢獻。)" #: ../../whatsnew/3.5.rst:1598 msgid "" @@ -1957,7 +1957,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1619 msgid "(Contributed by Serhiy Storchaka in :issue:`22578`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`22578` 中貢獻。)" #: ../../whatsnew/3.5.rst:1623 msgid "readline" @@ -2144,7 +2144,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1753 msgid "(Contributed by Geert Jansen in :issue:`21965`.)" -msgstr "" +msgstr "(由 Geert Jansen 在 :issue:`21965` 中貢獻。)" #: ../../whatsnew/3.5.rst:1755 msgid "" @@ -2175,7 +2175,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1773 msgid "(Contributed by Benjamin Peterson in :issue:`20188`.)" -msgstr "" +msgstr "(由 Benjamin Peterson 在 :issue:`20188` 中貢獻。)" #: ../../whatsnew/3.5.rst:1775 msgid "" @@ -2762,7 +2762,7 @@ msgstr ":c:func:`PyObject_Calloc`." #: ../../whatsnew/3.5.rst:2181 msgid "(Contributed by Victor Stinner in :issue:`21233`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`21233` 中貢獻。)" #: ../../whatsnew/3.5.rst:2183 msgid "New encoding/decoding helper functions:" @@ -2778,7 +2778,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2188 msgid "(Contributed by Victor Stinner in :issue:`18395`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`18395` 中貢獻。)" #: ../../whatsnew/3.5.rst:2190 msgid "" @@ -3311,8 +3311,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:2534 msgid "" "As part of the :pep:`492` implementation, the ``tp_reserved`` slot of :c:" -"type:`PyTypeObject` was replaced with a :c:member:`tp_as_async` slot. Refer " -"to :ref:`coro-objects` for new types, structures and functions." +"type:`PyTypeObject` was replaced with a :c:member:`~PyTypeObject." +"tp_as_async` slot. Refer to :ref:`coro-objects` for new types, structures " +"and functions." msgstr "" #: ../../whatsnew/3.5.rst:2541 @@ -3346,7 +3347,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2558 ../../whatsnew/3.5.rst:2571 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`23404` 中貢獻。)" #: ../../whatsnew/3.5.rst:2564 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 343925f93d..47fd83b3b1 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -840,7 +840,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:738 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.6.rst:740 msgid "Some smaller changes made to the core Python language are:" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 27c812d576..237fc0e345 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-27 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -693,7 +693,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:495 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.7.rst:497 msgid "" @@ -989,7 +989,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:723 msgid "(Contributed by Yury Selivanov in :issue:`32662`.)" -msgstr "" +msgstr "(由 Yury Selivanov 在 :issue:`32662` 中貢獻。)" #: ../../whatsnew/3.7.rst:725 msgid "" @@ -2251,6 +2251,8 @@ msgid "" "(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:" "`32043`, and :issue:`32230`.)" msgstr "" +"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:" +"`32043` 和 :issue:`32230` 中貢獻。)" #: ../../whatsnew/3.7.rst:1597 msgid "" @@ -2370,9 +2372,9 @@ msgstr "" #: ../../whatsnew/3.7.rst:1677 msgid "" -"The fields :c:member:`name` and :c:member:`doc` of structures :c:type:" +"The fields :c:member:`!name` and :c:member:`!doc` of structures :c:type:" "`PyMemberDef`, :c:type:`PyGetSetDef`, :c:type:`PyStructSequence_Field`, :c:" -"type:`PyStructSequence_Desc`, and :c:type:`wrapperbase` are now of type " +"type:`PyStructSequence_Desc`, and :c:struct:`wrapperbase` are now of type " "``const char *`` rather of ``char *``. (Contributed by Serhiy Storchaka in :" "issue:`28761`.)" msgstr "" @@ -3322,7 +3324,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2362 msgid "(Contributed by Serhiy Storchaka in :issue:`25054` and :issue:`32308`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`25054` 和 :issue:`32308` 中貢獻。)" #: ../../whatsnew/3.7.rst:2364 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index aedd30d9c2..56b4ba2e38 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -95,7 +95,7 @@ msgstr "完整敘述請見 :pep:`572`\\ 。" #: ../../whatsnew/3.8.rst:116 msgid "(Contributed by Emily Morehouse in :issue:`35224`.)" -msgstr "" +msgstr "(由 Emily Morehouse 在 :issue:`35224` 中貢獻。)" #: ../../whatsnew/3.8.rst:120 msgid "Positional-only parameters" @@ -167,7 +167,7 @@ msgstr "完整敘述請見 :pep:`570`\\ 。" #: ../../whatsnew/3.8.rst:187 msgid "(Contributed by Pablo Galindo in :issue:`36540`.)" -msgstr "" +msgstr "(由 Pablo Galindo 在 :issue:`36540` 中貢獻。)" #: ../../whatsnew/3.8.rst:193 msgid "Parallel filesystem cache for compiled bytecode files" @@ -189,7 +189,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:205 msgid "(Contributed by Carl Meyer in :issue:`33499`.)" -msgstr "" +msgstr "(由 Carl Meyer 在 :issue:`33499` 中貢獻。)" #: ../../whatsnew/3.8.rst:209 msgid "Debug build uses the same ABI as release build" @@ -281,7 +281,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:280 msgid "(Contributed by Eric V. Smith and Larry Hastings in :issue:`36817`.)" -msgstr "" +msgstr "(由 Eric V. Smith 和 Larry Hastings 在 :issue:`36817` 中貢獻。)" #: ../../whatsnew/3.8.rst:284 msgid "PEP 578: Python Runtime Audit Hooks" @@ -460,7 +460,7 @@ msgstr "完整敘述請見 :pep:`587`\\ 。" #: ../../whatsnew/3.8.rst:348 msgid "(Contributed by Victor Stinner in :issue:`36763`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`36763` 中貢獻。)" #: ../../whatsnew/3.8.rst:352 msgid "PEP 590: Vectorcall: a fast calling protocol for CPython" @@ -488,6 +488,7 @@ msgid "" "(Contributed by Jeroen Demeyer, Mark Shannon and Petr Viktorin in :issue:" "`36974`.)" msgstr "" +"(由 Jeroen Demeyer、Mark Shannon 和 Petr Viktorin 在 :issue:`36974` 中貢獻。)" #: ../../whatsnew/3.8.rst:369 msgid "Pickle protocol 5 with out-of-band data buffers" @@ -514,11 +515,11 @@ msgstr "完整敘述請見 :pep:`574`\\ 。" #: ../../whatsnew/3.8.rst:382 msgid "(Contributed by Antoine Pitrou in :issue:`36785`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`36785` 中貢獻。)" #: ../../whatsnew/3.8.rst:386 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.8.rst:388 msgid "" @@ -554,7 +555,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:414 msgid "" "(Contributed by Jonathan Eunice and Serhiy Storchaka in :issue:`30688`.)" -msgstr "" +msgstr "(由 Jonathan Eunice 和 Serhiy Storchaka 在 :issue:`30688` 中貢獻。)" #: ../../whatsnew/3.8.rst:416 msgid "" @@ -580,7 +581,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:437 msgid "(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.)" -msgstr "" +msgstr "(由 David Cuthbert 和 Jordan Chapman 在 :issue:`32117` 中貢獻。)" #: ../../whatsnew/3.8.rst:439 msgid "" @@ -628,7 +629,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:479 msgid "(Contributed by Victor Stinner in :issue:`37032`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`37032` 中貢獻。)" #: ../../whatsnew/3.8.rst:481 msgid "" @@ -651,7 +652,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:505 msgid "(Contributed by Mark Dickinson in :issue:`36027`.)" -msgstr "" +msgstr "(由 Mark Dickinson 在 :issue:`36027` 中貢獻。)" #: ../../whatsnew/3.8.rst:507 msgid "" @@ -668,7 +669,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:532 msgid "(Contributed by Jörn Heissler in :issue:`35224`.)" -msgstr "" +msgstr "(由 Jörn Heissler 在 :issue:`35224` 中貢獻。)" #: ../../whatsnew/3.8.rst:534 msgid "" @@ -694,7 +695,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:564 msgid "(Contributed by Barry Warsaw and Jason R. Coombs in :issue:`34632`.)" -msgstr "" +msgstr "(由 Barry Warsaw 和 Jason R. Coombs 在 :issue:`34632` 中貢獻。)" #: ../../whatsnew/3.8.rst:568 msgid "Improved Modules" @@ -719,7 +720,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:580 msgid "(Contributed by Ivan Levkivskyi in :issue:`33416`.)" -msgstr "" +msgstr "(由 Ivan Levkivskyi 在 :issue:`33416` 中貢獻。)" #: ../../whatsnew/3.8.rst:582 msgid "The :func:`ast.parse` function has some new flags:" @@ -746,7 +747,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:594 msgid "(Contributed by Guido van Rossum in :issue:`35766`.)" -msgstr "" +msgstr "(由 Guido van Rossum 在 :issue:`35766` 中貢獻。)" #: ../../whatsnew/3.8.rst:598 msgid "asyncio" @@ -774,7 +775,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:632 msgid "(Contributed by Yury Selivanov in :issue:`32314`.)" -msgstr "" +msgstr "(由 Yury Selivanov 在 :issue:`32314` 中貢獻。)" #: ../../whatsnew/3.8.rst:634 msgid "" @@ -786,7 +787,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:649 msgid "(Contributed by Yury Selivanov in :issue:`37028`.)" -msgstr "" +msgstr "(由 Yury Selivanov 在 :issue:`37028` 中貢獻。)" #: ../../whatsnew/3.8.rst:651 ../../whatsnew/3.8.rst:1970 msgid "" @@ -883,7 +884,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:722 msgid "(Contributed by Scott Sanderson in :issue:`29235`.)" -msgstr "" +msgstr "(由 Scott Sanderson 在 :issue:`29235` 中貢獻。)" #: ../../whatsnew/3.8.rst:726 msgid "csv" @@ -948,7 +949,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:777 msgid "(Contributed by Raymond Hettinger in :issue:`36772`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 在 :issue:`36772` 中貢獻。)" #: ../../whatsnew/3.8.rst:779 msgid "" @@ -958,7 +959,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:793 msgid "(Contributed by Carl Meyer in :issue:`21145`)" -msgstr "" +msgstr "(由 Carl Meyer 在 :issue:`21145` 中貢獻)" #: ../../whatsnew/3.8.rst:796 msgid "" @@ -969,7 +970,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:818 msgid "(Contributed by Ethan Smith in :issue:`32380`)" -msgstr "" +msgstr "(由 Ethan Smith 在 :issue:`32380` 中貢獻)" #: ../../whatsnew/3.8.rst:821 msgid "gc" @@ -1091,7 +1092,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:904 msgid "(Contributed by Raymond Hettinger in :issue:`36326`.)" -msgstr "" +msgstr "(由 Raymond Hettinger 在 :issue:`36326` 中貢獻。)" #: ../../whatsnew/3.8.rst:908 msgid "io" @@ -1117,7 +1118,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:926 msgid "(Contributed by Lisa Roach in :issue:`34659`.)" -msgstr "" +msgstr "(由 Lisa Roach 在 :issue:`34659` 中貢獻。)" #: ../../whatsnew/3.8.rst:930 msgid "json.tool" @@ -1181,7 +1182,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:973 msgid "(Contributed by Pablo Galindo in :issue:`35606`.)" -msgstr "" +msgstr "(由 Pablo Galindo 在 :issue:`35606` 中貢獻。)" #: ../../whatsnew/3.8.rst:975 msgid "" @@ -1194,6 +1195,8 @@ msgid "" "(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond " "Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.)" msgstr "" +"(由 Yash Aggarwal、Keller Fuchs、Serhiy Storchaka 和 Raymond Hettinger 在 " +":issue:`37128`、:issue:`37178` 和 :issue:`35431` 中貢獻。)" #: ../../whatsnew/3.8.rst:985 msgid "" @@ -1205,7 +1208,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:997 msgid "(Contributed by Mark Dickinson in :issue:`36887`.)" -msgstr "" +msgstr "(由 Mark Dickinson 在 :issue:`36887` 中貢獻。)" #: ../../whatsnew/3.8.rst:999 msgid "" @@ -1283,7 +1286,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1048 ../../whatsnew/3.8.rst:1073 msgid "(Contributed by Steve Dower in :issue:`37834`.)" -msgstr "" +msgstr "(由 Steve Dower 在 :issue:`37834` 中貢獻。)" #: ../../whatsnew/3.8.rst:1052 msgid "os.path" @@ -1390,7 +1393,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1137 msgid "(Contributed by Rémi Lapeyre in :issue:`30670`.)" -msgstr "" +msgstr "(由 Rémi Lapeyre 在 :issue:`30670` 中貢獻。)" #: ../../whatsnew/3.8.rst:1141 msgid "py_compile" @@ -1801,7 +1804,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1469 msgid "(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" -msgstr "" +msgstr "(由 Joannah Nanjekye 和 Victor Stinner 在 :issue:`35537` 中貢獻。)" #: ../../whatsnew/3.8.rst:1471 msgid "" @@ -1962,6 +1965,8 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" +"(由 Victor Stinner 在 :issue:`35134` 和 :issue:`35081` 中貢獻,該工作由 Eric Snow 在 Python " +"3.7 中發起。)" #: ../../whatsnew/3.8.rst:1570 msgid "" @@ -1990,7 +1995,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1580 msgid "(Contributed by Victor Stinner in :issue:`35059`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`35059` 中貢獻。)" #: ../../whatsnew/3.8.rst:1582 msgid "" @@ -2028,7 +2033,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1604 msgid "(Contributed by Antoine Pitrou in :issue:`32430`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`32430` 中貢獻。)" #: ../../whatsnew/3.8.rst:1606 msgid "" @@ -2406,9 +2411,8 @@ msgid "" "terminate the current thread if called while the interpreter is finalizing, " "making them consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`. If this behavior is " -"not desired, guard the call by checking :c:func:`_Py_IsFinalizing` or :c:" -"func:`sys.is_finalizing`. (Contributed by Joannah Nanjekye in :issue:" -"`36475`.)" +"not desired, guard the call by checking :c:func:`_Py_IsFinalizing` or :func:" +"`sys.is_finalizing`. (Contributed by Joannah Nanjekye in :issue:`36475`.)" msgstr "" #: ../../whatsnew/3.8.rst:1858 @@ -2693,7 +2697,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2062 msgid "" "Remove :c:macro:`Py_INCREF` on the type object after allocating an instance " -"- if any. This may happen after calling :c:func:`PyObject_New`, :c:func:" +"- if any. This may happen after calling :c:macro:`PyObject_New`, :c:macro:" "`PyObject_NewVar`, :c:func:`PyObject_GC_New`, :c:func:`PyObject_GC_NewVar`, " "or any other custom allocator that uses :c:func:`PyObject_Init` or :c:func:" "`PyObject_INIT`." @@ -2712,7 +2716,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2102 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" -msgstr "" +msgstr "(由 Eddie Elizondo 在 :issue:`35810` 中貢獻。)" #: ../../whatsnew/3.8.rst:2104 msgid "" @@ -2722,7 +2726,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2113 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" -msgstr "" +msgstr "(由 Zackery Spytz 在 :issue:`33407` 中貢獻。)" #: ../../whatsnew/3.8.rst:2115 msgid "" @@ -2736,7 +2740,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2122 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" -msgstr "" +msgstr "(由 Antoine Pitrou 在 :issue:`32388` 中貢獻。)" #: ../../whatsnew/3.8.rst:2124 msgid "" @@ -2764,7 +2768,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:2143 msgid "(Contributed by Steve Dower in :issue:`37351`.)" -msgstr "" +msgstr "(由 Steve Dower 在 :issue:`37351` 中貢獻。)" #: ../../whatsnew/3.8.rst:2147 msgid "CPython bytecode changes" @@ -2792,6 +2796,8 @@ msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" +"(由 Mark Shannon、Antoine Pitrou 和 Serhiy Storchaka 在 :issue:`17611` " +"中貢獻。)" #: ../../whatsnew/3.8.rst:2164 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 5a561bed6e..2dd9c0da9f 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 00:03+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-" @@ -304,7 +304,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:217 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.9.rst:219 msgid "" @@ -1127,7 +1127,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:757 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`32856` 中貢獻。)" #: ../../whatsnew/3.9.rst:759 msgid "" @@ -1304,7 +1304,7 @@ msgstr ":func:`~binascii.rlecode_hqx`\\ 、\\ :func:`~binascii.rledecode_hqx`" #: ../../whatsnew/3.9.rst:911 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :issue:`39353` 中貢獻。)" #: ../../whatsnew/3.9.rst:913 msgid "" @@ -1743,7 +1743,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1222 msgid "(Contributed by Mark Shannon in :issue:`39156`.)" -msgstr "" +msgstr "(由 Mark Shannon 在 :issue:`39156` 中貢獻。)" #: ../../whatsnew/3.9.rst:1226 msgid "Build Changes" @@ -1875,7 +1875,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1314 ../../whatsnew/3.9.rst:1448 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 38644 和 39542 中貢獻。)" #: ../../whatsnew/3.9.rst:1316 msgid "" @@ -1993,10 +1993,10 @@ msgstr "" #: ../../whatsnew/3.9.rst:1391 msgid "" -"The :c:func:`PyObject_NEW` macro becomes an alias to the :c:func:" +"The :c:func:`PyObject_NEW` macro becomes an alias to the :c:macro:" "`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an " -"alias to the :c:func:`PyObject_NewVar` macro. They no longer access directly " -"the :c:member:`PyTypeObject.tp_basicsize` member." +"alias to the :c:macro:`PyObject_NewVar` macro. They no longer access " +"directly the :c:member:`PyTypeObject.tp_basicsize` member." msgstr "" #: ../../whatsnew/3.9.rst:1396 @@ -2243,7 +2243,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1519 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" -msgstr "" +msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" #: ../../whatsnew/3.9.rst:1522 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" @@ -2263,7 +2263,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1533 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" -msgstr "" +msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻。)" #: ../../whatsnew/3.9.rst:1536 msgid "Notable changes in Python 3.9.2" From c51ea894f64a53b4b898f14e29e645688f646090 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Sat, 29 Jul 2023 19:18:39 +0800 Subject: [PATCH 026/105] Sync with CPython 3.12 (#509) * sync with cpython d514e143 * resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/bool.po | 22 ++- faq/extending.po | 12 +- howto/curses.po | 4 +- install/index.po | 8 +- library/asyncio-extending.po | 4 +- library/asyncio-future.po | 6 +- library/bz2.po | 98 ++++++------ library/code.po | 16 +- library/concurrent.po | 6 +- library/curses.po | 236 ++++++++++++++--------------- library/email.charset.po | 6 +- library/email.encoders.po | 6 +- library/email.generator.po | 6 +- library/email.message.po | 26 ++-- library/email.parser.po | 9 +- library/filecmp.po | 8 +- library/fileinput.po | 4 +- library/graphlib.po | 26 ++-- library/gzip.po | 12 +- library/hashlib.po | 14 +- library/importlib.resources.abc.po | 11 +- library/json.po | 14 +- library/logging.po | 26 +--- library/lzma.po | 192 +++++++++++------------ library/msvcrt.po | 13 +- library/netrc.po | 33 ++-- library/operator.po | 16 +- library/poplib.po | 4 +- library/pprint.po | 8 +- library/pty.po | 6 +- library/sched.po | 8 +- library/selectors.po | 14 +- library/shutil.po | 10 +- library/stat.po | 10 +- library/sysconfig.po | 4 +- library/textwrap.po | 6 +- library/urllib.error.po | 16 +- library/winreg.po | 13 +- library/winsound.po | 10 +- library/xml.po | 10 +- library/xml.sax.handler.po | 8 +- library/xml.sax.utils.po | 6 +- library/xmlrpc.po | 10 +- reference/datamodel.po | 14 +- reference/expressions.po | 6 +- reference/lexical_analysis.po | 10 +- tutorial/errors.po | 12 +- tutorial/interactive.po | 14 +- whatsnew/2.0.po | 15 +- whatsnew/2.1.po | 33 ++-- whatsnew/3.0.po | 22 +-- 51 files changed, 548 insertions(+), 555 deletions(-) diff --git a/c-api/bool.po b/c-api/bool.po index 8ba775df31..d90772c4a7 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2021-12-09 20:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,12 +39,18 @@ msgstr "" #: ../../c-api/bool.rst:16 msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python boolean type; " +"it is the same object as :class:`bool` in the Python layer." +msgstr "" + +#: ../../c-api/bool.rst:22 +msgid "" "Return true if *o* is of type :c:data:`PyBool_Type`. This function always " "succeeds." msgstr "" "如果 *o* 的型別為 :c:data:`PyBool_Type` 則回傳真值。此函式總是會成功執行。" -#: ../../c-api/bool.rst:22 +#: ../../c-api/bool.rst:28 msgid "" "The Python ``False`` object. This object has no methods and is `immortal " "`_." @@ -52,11 +58,11 @@ msgstr "" "Python 的 ``False`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) " "`_。" -#: ../../c-api/bool.rst:25 +#: ../../c-api/bool.rst:31 msgid ":c:data:`Py_False` is immortal." msgstr ":c:data:`Py_False` 為不滅的。" -#: ../../c-api/bool.rst:31 +#: ../../c-api/bool.rst:37 msgid "" "The Python ``True`` object. This object has no methods and is `immortal " "`_." @@ -64,19 +70,19 @@ msgstr "" "Python 的 ``True`` 物件。此物件沒有任何方法且為\\ `不滅的 (immortal) " "`_。" -#: ../../c-api/bool.rst:34 +#: ../../c-api/bool.rst:40 msgid ":c:data:`Py_True` is immortal." msgstr ":c:data:`Py_True` 為不滅的。" -#: ../../c-api/bool.rst:40 +#: ../../c-api/bool.rst:46 msgid "Return :c:data:`Py_False` from a function." msgstr "從函式回傳 :c:data:`Py_False`。" -#: ../../c-api/bool.rst:45 +#: ../../c-api/bool.rst:51 msgid "Return :c:data:`Py_True` from a function." msgstr "從函式回傳 :c:data:`Py_True`。" -#: ../../c-api/bool.rst:50 +#: ../../c-api/bool.rst:56 msgid "" "Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value " "of *v*." diff --git a/faq/extending.po b/faq/extending.po index 72715f7294..7cc1529f18 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2023-02-18 13:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -146,24 +146,24 @@ msgstr "如何從 Python 物件中提取 C 值?" msgid "" "That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " "returns its length and :c:func:`PyTuple_GetItem` returns the item at a " -"specified index. Lists have similar functions, :c:func:`PyListSize` and :c:" +"specified index. Lists have similar functions, :c:func:`PyList_Size` and :c:" "func:`PyList_GetItem`." msgstr "" "這取決於物件的型別。如果它是一個元組,:c:func:`PyTuple_Size` 回傳它的長度,:" "c:func:`PyTuple_GetItem` 回傳指定索引的項目。列表具有類似的函式:c:func:" -"`PyListSize` 和 :c:func:`PyList_GetItem`。" +"`PyList_Size` 和 :c:func:`PyList_GetItem`。" #: ../../faq/extending.rst:87 #, fuzzy msgid "" "For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:" "`PyBytes_AsStringAndSize` provides a pointer to its value and its length. " -"Note that Python bytes objects may contain null bytes so C's :c:func:" -"`strlen` should not be used." +"Note that Python bytes objects may contain null bytes so C's :c:func:`!" +"strlen` should not be used." msgstr "" "對於位元組,:c:func:`PyBytes_Size` 回傳它的長度,:c:func:" "`PyBytes_AsStringAndSize` 提供指向它的值和長度的指標。請注意,Python 位元組物" -"件可能包含空位元組,因此不應使用 C 的 :c:func:`strlen`。" +"件可能包含空位元組,因此不應使用 C 的 :c:func:`!strlen`。" #: ../../faq/extending.rst:92 msgid "" diff --git a/howto/curses.po b/howto/curses.po index 780518edee..35aa97a92e 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-04 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -696,7 +696,7 @@ msgid "" "consult the manual pages for your curses implementation, whether it's " "ncurses or a proprietary Unix vendor's. The manual pages will document any " "quirks, and provide complete lists of all the functions, attributes, and :" -"const:`ACS_\\*` characters available to you." +"ref:`ACS_\\* ` characters available to you." msgstr "" #: ../../howto/curses.rst:533 diff --git a/install/index.po b/install/index.po index 7495a79c10..5f0af56ea9 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -1078,9 +1078,9 @@ msgstr "" #: ../../install/index.rst:780 msgid "" "On Unix, if the :envvar:`HOME` environment variable is not defined, the " -"user's home directory will be determined with the :func:`getpwuid` function " -"from the standard :mod:`pwd` module. This is done by the :func:`os.path." -"expanduser` function used by Distutils." +"user's home directory will be determined with the :func:`~pwd.getpwuid` " +"function from the standard :mod:`pwd` module. This is done by the :func:`os." +"path.expanduser` function used by Distutils." msgstr "" #: ../../install/index.rst:786 diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index f54974b6b3..e5d3e612c2 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,7 +114,7 @@ msgstr "" #: ../../library/asyncio-extending.rst:71 msgid "" "A third party task implementation should call the following functions to " -"keep a task visible by :func:`asyncio.get_tasks` and :func:`asyncio." +"keep a task visible by :func:`asyncio.all_tasks` and :func:`asyncio." "current_task`:" msgstr "" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index f0d21b09fb..38c2d3aef9 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2022-01-25 01:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -407,7 +407,7 @@ msgstr "" #: ../../library/asyncio-future.rst:278 msgid "" ":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :" -"func:`concurrent.futures.cancel` does not." +"meth:`concurrent.futures.Future.cancel` does not." msgstr "" ":meth:`asyncio.Future.cancel` 接受一個可選的 ``msg`` 引數,但 :func:" -"`concurrent.futures.cancel` 無此引數。" +"`concurrent.futures.Future.cancel` 無此引數。" diff --git a/library/bz2.po b/library/bz2.po index d3be07db75..e031a1d32b 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -99,11 +99,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:124 +#: ../../library/bz2.rst:59 ../../library/bz2.rst:125 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:131 +#: ../../library/bz2.rst:62 ../../library/bz2.rst:132 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -148,22 +148,22 @@ msgstr "" #: ../../library/bz2.rst:89 msgid "" ":class:`BZ2File` provides all of the members specified by the :class:`io." -"BufferedIOBase`, except for :meth:`detach` and :meth:`truncate`. Iteration " -"and the :keyword:`with` statement are supported." +"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." +"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" -#: ../../library/bz2.rst:93 +#: ../../library/bz2.rst:94 msgid ":class:`BZ2File` also provides the following method:" msgstr "" -#: ../../library/bz2.rst:97 +#: ../../library/bz2.rst:98 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned (unless at EOF). The exact number of bytes returned " "is unspecified." msgstr "" -#: ../../library/bz2.rst:101 +#: ../../library/bz2.rst:102 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`BZ2File`, it may change the position of the underlying file object (e.g. if " @@ -171,99 +171,99 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/bz2.rst:109 +#: ../../library/bz2.rst:110 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: ../../library/bz2.rst:112 +#: ../../library/bz2.rst:113 msgid "" "The :meth:`fileno`, :meth:`readable`, :meth:`seekable`, :meth:`writable`, :" "meth:`read1` and :meth:`readinto` methods were added." msgstr "" -#: ../../library/bz2.rst:116 +#: ../../library/bz2.rst:117 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: ../../library/bz2.rst:120 +#: ../../library/bz2.rst:121 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: ../../library/bz2.rst:127 +#: ../../library/bz2.rst:128 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:134 +#: ../../library/bz2.rst:135 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:139 +#: ../../library/bz2.rst:140 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:141 +#: ../../library/bz2.rst:142 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:148 +#: ../../library/bz2.rst:149 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:152 +#: ../../library/bz2.rst:153 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:156 ../../library/bz2.rst:244 +#: ../../library/bz2.rst:157 ../../library/bz2.rst:245 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:161 +#: ../../library/bz2.rst:162 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:164 +#: ../../library/bz2.rst:165 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:170 +#: ../../library/bz2.rst:171 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:173 +#: ../../library/bz2.rst:174 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:178 +#: ../../library/bz2.rst:179 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:183 +#: ../../library/bz2.rst:184 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -271,7 +271,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:190 +#: ../../library/bz2.rst:191 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -279,7 +279,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:196 +#: ../../library/bz2.rst:197 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -288,99 +288,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:203 +#: ../../library/bz2.rst:204 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:208 +#: ../../library/bz2.rst:209 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:212 +#: ../../library/bz2.rst:213 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:217 +#: ../../library/bz2.rst:218 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:224 +#: ../../library/bz2.rst:225 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:226 +#: ../../library/bz2.rst:227 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:231 +#: ../../library/bz2.rst:232 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:238 +#: ../../library/bz2.rst:239 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:242 +#: ../../library/bz2.rst:243 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:247 +#: ../../library/bz2.rst:248 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:252 +#: ../../library/bz2.rst:253 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:254 +#: ../../library/bz2.rst:255 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:257 +#: ../../library/bz2.rst:258 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:259 +#: ../../library/bz2.rst:260 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:265 +#: ../../library/bz2.rst:266 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:267 +#: ../../library/bz2.rst:268 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:269 +#: ../../library/bz2.rst:270 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:287 +#: ../../library/bz2.rst:288 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:305 +#: ../../library/bz2.rst:306 msgid "" -"The example above uses a very \"nonrandom\" stream of data (a stream of ``b" -"\"z\"`` chunks). Random data tends to compress poorly, while ordered, " +"The example above uses a very \"nonrandom\" stream of data (a stream of " +"``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:309 +#: ../../library/bz2.rst:310 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/code.po b/library/code.po index c41efdc20b..a6f31b3d9a 100644 --- a/library/code.po +++ b/library/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -215,13 +215,13 @@ msgstr "" msgid "" "Push a line of source text to the interpreter. The line should not have a " "trailing newline; it may have internal newlines. The line is appended to a " -"buffer and the interpreter's :meth:`runsource` method is called with the " -"concatenated contents of the buffer as source. If this indicates that the " -"command was executed or invalid, the buffer is reset; otherwise, the command " -"is incomplete, and the buffer is left as it was after the line was " -"appended. The return value is ``True`` if more input is required, ``False`` " -"if the line was dealt with in some way (this is the same as :meth:" -"`runsource`)." +"buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` " +"method is called with the concatenated contents of the buffer as source. If " +"this indicates that the command was executed or invalid, the buffer is " +"reset; otherwise, the command is incomplete, and the buffer is left as it " +"was after the line was appended. The return value is ``True`` if more input " +"is required, ``False`` if the line was dealt with in some way (this is the " +"same as :meth:`!runsource`)." msgstr "" #: ../../library/code.rst:176 diff --git a/library/concurrent.po b/library/concurrent.po index 213315cba6..bfa5989eb2 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,8 +20,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.rst:2 -msgid "The :mod:`concurrent` package" -msgstr ":mod:`concurrent` 套件" +msgid "The :mod:`!concurrent` package" +msgstr ":mod:`!concurrent` 套件" #: ../../library/concurrent.rst:4 msgid "Currently, there is only one module in this package:" diff --git a/library/curses.po b/library/curses.po index e3453377ee..20df87361f 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-23 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -263,7 +263,7 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:213 ../../library/curses.rst:1772 +#: ../../library/curses.rst:213 ../../library/curses.rst:1774 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." @@ -1523,7 +1523,7 @@ msgid "Attribute" msgstr "" #: ../../library/curses.rst:1372 ../../library/curses.rst:1417 -#: ../../library/curses.rst:1661 ../../library/curses.rst:1753 +#: ../../library/curses.rst:1663 ../../library/curses.rst:1755 msgid "Meaning" msgstr "" @@ -2027,8 +2027,8 @@ msgstr "" msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1636 ../../library/curses.rst:1779 -#: ../../library/curses.rst:1903 +#: ../../library/curses.rst:1636 ../../library/curses.rst:1781 +#: ../../library/curses.rst:1905 msgid "Constant" msgstr "" @@ -2080,7 +2080,7 @@ msgstr ":kbd:`Page Down`" msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1651 +#: ../../library/curses.rst:1653 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2088,268 +2088,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1658 +#: ../../library/curses.rst:1660 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1661 +#: ../../library/curses.rst:1663 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1665 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1667 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1669 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1671 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1673 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1675 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1675 +#: ../../library/curses.rst:1677 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1677 +#: ../../library/curses.rst:1679 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1679 +#: ../../library/curses.rst:1681 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1681 +#: ../../library/curses.rst:1683 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1683 +#: ../../library/curses.rst:1685 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1685 +#: ../../library/curses.rst:1687 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1687 +#: ../../library/curses.rst:1689 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1689 +#: ../../library/curses.rst:1691 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1691 +#: ../../library/curses.rst:1693 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1693 +#: ../../library/curses.rst:1695 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1695 +#: ../../library/curses.rst:1697 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1697 +#: ../../library/curses.rst:1699 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1699 +#: ../../library/curses.rst:1701 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1701 +#: ../../library/curses.rst:1703 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1703 +#: ../../library/curses.rst:1705 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1705 +#: ../../library/curses.rst:1707 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1707 +#: ../../library/curses.rst:1709 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1709 +#: ../../library/curses.rst:1711 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1711 +#: ../../library/curses.rst:1713 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1713 +#: ../../library/curses.rst:1715 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1715 +#: ../../library/curses.rst:1717 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1717 +#: ../../library/curses.rst:1719 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1719 +#: ../../library/curses.rst:1721 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1721 +#: ../../library/curses.rst:1723 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1723 +#: ../../library/curses.rst:1725 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1725 +#: ../../library/curses.rst:1727 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1727 +#: ../../library/curses.rst:1729 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1729 +#: ../../library/curses.rst:1731 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1731 +#: ../../library/curses.rst:1733 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1733 +#: ../../library/curses.rst:1735 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1735 +#: ../../library/curses.rst:1737 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1737 +#: ../../library/curses.rst:1739 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1739 +#: ../../library/curses.rst:1741 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1741 +#: ../../library/curses.rst:1743 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1743 +#: ../../library/curses.rst:1745 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1745 +#: ../../library/curses.rst:1747 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1747 +#: ../../library/curses.rst:1749 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1752 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1753 +#: ../../library/curses.rst:1755 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1755 +#: ../../library/curses.rst:1757 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1757 +#: ../../library/curses.rst:1759 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1759 +#: ../../library/curses.rst:1761 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1761 +#: ../../library/curses.rst:1763 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1763 +#: ../../library/curses.rst:1765 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1765 +#: ../../library/curses.rst:1767 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1767 ../../library/curses.rst:1769 +#: ../../library/curses.rst:1769 ../../library/curses.rst:1771 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1776 +#: ../../library/curses.rst:1778 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1779 +#: ../../library/curses.rst:1781 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1781 +#: ../../library/curses.rst:1783 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1783 +#: ../../library/curses.rst:1785 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1785 +#: ../../library/curses.rst:1787 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1787 +#: ../../library/curses.rst:1789 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1789 +#: ../../library/curses.rst:1791 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1791 +#: ../../library/curses.rst:1793 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1793 +#: ../../library/curses.rst:1795 msgid "White" msgstr "白" -#: ../../library/curses.rst:1795 +#: ../../library/curses.rst:1797 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1800 +#: ../../library/curses.rst:1802 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1808 +#: ../../library/curses.rst:1810 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2359,11 +2359,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1816 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: ../../library/curses.rst:1819 +#: ../../library/curses.rst:1821 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2375,15 +2375,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1832 +#: ../../library/curses.rst:1834 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1834 +#: ../../library/curses.rst:1836 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1839 +#: ../../library/curses.rst:1841 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2392,11 +2392,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1845 +#: ../../library/curses.rst:1847 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1850 +#: ../../library/curses.rst:1852 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2407,167 +2407,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1861 +#: ../../library/curses.rst:1863 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1865 ../../library/curses.rst:1903 +#: ../../library/curses.rst:1867 ../../library/curses.rst:1905 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1865 +#: ../../library/curses.rst:1867 msgid "Action" msgstr "" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1869 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1867 +#: ../../library/curses.rst:1869 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1869 ../../library/curses.rst:1905 +#: ../../library/curses.rst:1871 ../../library/curses.rst:1907 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1869 +#: ../../library/curses.rst:1871 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1874 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1874 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1874 +#: ../../library/curses.rst:1876 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1874 +#: ../../library/curses.rst:1876 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1877 ../../library/curses.rst:1907 +#: ../../library/curses.rst:1879 ../../library/curses.rst:1909 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1877 +#: ../../library/curses.rst:1879 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1880 +#: ../../library/curses.rst:1882 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1880 +#: ../../library/curses.rst:1882 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1882 +#: ../../library/curses.rst:1884 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1882 +#: ../../library/curses.rst:1884 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1884 +#: ../../library/curses.rst:1886 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1884 +#: ../../library/curses.rst:1886 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1887 +#: ../../library/curses.rst:1889 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1887 +#: ../../library/curses.rst:1889 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1892 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1892 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1892 ../../library/curses.rst:1911 +#: ../../library/curses.rst:1894 ../../library/curses.rst:1913 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1894 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1896 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1896 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1896 ../../library/curses.rst:1909 +#: ../../library/curses.rst:1898 ../../library/curses.rst:1911 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1898 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1899 +#: ../../library/curses.rst:1901 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1905 +#: ../../library/curses.rst:1907 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1909 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1911 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1911 +#: ../../library/curses.rst:1913 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1915 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1915 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1916 +#: ../../library/curses.rst:1918 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1922 +#: ../../library/curses.rst:1924 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1928 +#: ../../library/curses.rst:1930 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/email.charset.po b/library/email.charset.po index 129293d5bb..bd49436a4e 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -206,8 +206,8 @@ msgstr "" #: ../../library/email.charset.rst:152 msgid "" -"Returns *input_charset* as a string coerced to lower case. :meth:`__repr__` " -"is an alias for :meth:`__str__`." +"Returns *input_charset* as a string coerced to lower case. :meth:`!__repr__` " +"is an alias for :meth:`!__str__`." msgstr "" #: ../../library/email.charset.rst:158 diff --git a/library/email.encoders.po b/library/email.encoders.po index a50a9a08cc..f779f67dfc 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,8 +58,8 @@ msgstr "" #: ../../library/email.encoders.rst:27 msgid "" "The :mod:`email` package provides some convenient encoders in its :mod:" -"`encoders` module. These encoders are actually used by the :class:`~email." -"mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class " +"`~email.encoders` module. These encoders are actually used by the :class:" +"`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class " "constructors to provide default encodings. All encoder functions take " "exactly one argument, the message object to encode. They usually extract " "the payload, encode it, and reset the payload to this newly encoded value. " diff --git a/library/email.generator.po b/library/email.generator.po index c42213c070..9d22bbbf86 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-02 00:25+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -320,8 +320,8 @@ msgstr "註解" #: ../../library/email.generator.rst:276 msgid "" "This statement assumes that you use the appropriate setting for " -"``unixfrom``, and that there are no :mod:`policy` settings calling for " -"automatic adjustments (for example, :attr:`~email.policy.Policy." +"``unixfrom``, and that there are no :mod:`email.policy` settings calling for " +"automatic adjustments (for example, :attr:`~email.policy.EmailPolicy." "refold_source` must be ``none``, which is *not* the default). It is also " "not 100% true, since if the message does not conform to the RFC standards " "occasionally information about the exact original text is lost during " diff --git a/library/email.message.po b/library/email.message.po index 0358d305cc..9003644575 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -100,9 +100,9 @@ msgid "" "defaults to ``False``. For backward compatibility with the base :class:" "`~email.message.Message` class *maxheaderlen* is accepted, but defaults to " "``None``, which means that by default the line length is controlled by the :" -"attr:`~email.policy.EmailPolicy.max_line_length` of the policy. The " -"*policy* argument may be used to override the default policy obtained from " -"the message instance. This can be used to control some of the formatting " +"attr:`~email.policy.Policy.max_line_length` of the policy. The *policy* " +"argument may be used to override the default policy obtained from the " +"message instance. This can be used to control some of the formatting " "produced by the method, since the specified *policy* will be passed to the :" "class:`~email.generator.Generator`." msgstr "" @@ -267,11 +267,11 @@ msgstr "" #: ../../library/email.message.rst:216 msgid "" -"If the :mod:`policy` defines certain headers to be unique (as the standard " -"policies do), this method may raise a :exc:`ValueError` when an attempt is " -"made to assign a value to such a header when one already exists. This " -"behavior is intentional for consistency's sake, but do not depend on it as " -"we may choose to make such assignments do an automatic deletion of the " +"If the :mod:`policy ` defines certain headers to be unique (as " +"the standard policies do), this method may raise a :exc:`ValueError` when an " +"attempt is made to assign a value to such a header when one already exists. " +"This behavior is intentional for consistency's sake, but do not depend on it " +"as we may choose to make such assignments do an automatic deletion of the " "existing header in the future." msgstr "" @@ -451,8 +451,8 @@ msgstr "" #: ../../library/email.message.rst:380 msgid "" "Note that existing parameter values of headers may be accessed through the :" -"attr:`~email.headerregistry.BaseHeader.params` attribute of the header value " -"(for example, ``msg['Content-Type'].params['charset']``)." +"attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of the " +"header value (for example, ``msg['Content-Type'].params['charset']``)." msgstr "" #: ../../library/email.message.rst:384 @@ -753,8 +753,8 @@ msgstr "" #: ../../library/email.message.rst:694 msgid "" -"Remove the payload and all of the :exc:`Content-` headers, leaving all other " -"headers intact and in their original order." +"Remove the payload and all of the :mailheader:`!Content-` headers, leaving " +"all other headers intact and in their original order." msgstr "" #: ../../library/email.message.rst:698 diff --git a/library/email.parser.po b/library/email.parser.po index dd5e9f4957..650d9e6f41 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -69,9 +69,10 @@ msgid "" "Note that the parser can be extended in limited ways, and of course you can " "implement your own parser completely from scratch. All of the logic that " "connects the :mod:`email` package's bundled parser and the :class:`~email." -"message.EmailMessage` class is embodied in the :mod:`policy` class, so a " -"custom parser can create message object trees any way it finds necessary by " -"implementing custom versions of the appropriate :mod:`policy` methods." +"message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` " +"class, so a custom parser can create message object trees any way it finds " +"necessary by implementing custom versions of the appropriate :class:`!" +"Policy` methods." msgstr "" #: ../../library/email.parser.rst:49 diff --git a/library/filecmp.po b/library/filecmp.po index 3c06eb4bb2..28798a01b1 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -151,9 +151,9 @@ msgstr "" #: ../../library/filecmp.rst:103 msgid "" -"Note that via :meth:`__getattr__` hooks, all attributes are computed lazily, " -"so there is no speed penalty if only those attributes which are lightweight " -"to compute are used." +"Note that via :meth:`~object.__getattr__` hooks, all attributes are computed " +"lazily, so there is no speed penalty if only those attributes which are " +"lightweight to compute are used." msgstr "" #: ../../library/filecmp.rst:110 diff --git a/library/fileinput.po b/library/fileinput.po index f0d0ce2e16..48a409e037 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -231,7 +231,7 @@ msgstr "" #: ../../library/fileinput.rst:179 msgid "" -"The ``'rU'`` and ``'U'`` modes and the :meth:`__getitem__` method have been " +"The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been " "removed." msgstr "" diff --git a/library/graphlib.po b/library/graphlib.po index 6684be3507..e18c1ab706 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2023-01-04 16:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgid "" "Provides functionality to topologically sort a graph of :term:`hashable` " "nodes." msgstr "" -"提供對包含\\ :term:`可雜湊 (hashable) ` 節點之圖 (graph) 進行拓撲排序 (topologically " -"sort) 的功能。" +"提供對包含\\ :term:`可雜湊 (hashable) ` 節點之圖 (graph) 進行拓撲排" +"序 (topologically sort) 的功能。" #: ../../library/graphlib.rst:22 msgid "" @@ -120,8 +120,8 @@ msgid "" "Add a new node and its predecessors to the graph. Both the *node* and all " "elements in *predecessors* must be :term:`hashable`." msgstr "" -"向圖中新增新節點及其前驅節點。*node* 和 *predecessors* 中的所有元素都必須是\\ :term:`可雜湊 `\\ " -"的。" +"向圖中新增新節點及其前驅節點。*node* 和 *predecessors* 中的所有元素都必須是" +"\\ :term:`可雜湊 `\\ 的。" #: ../../library/graphlib.rst:90 msgid "" @@ -178,10 +178,10 @@ msgstr "" #: ../../library/graphlib.rst:118 msgid "" -"The :meth:`~TopologicalSorter.__bool__` method of this class defers to this " -"function, so instead of::" +"The :meth:`~object.__bool__` method of this class defers to this function, " +"so instead of::" msgstr "" -"此類別的 :meth:`~TopologicalSorter.__bool__` 方法遵循此函式,因此以下做法:\n" +"此類別的 :meth:`~object.__bool__` 方法遵循此函式,因此以下做法:\n" "\n" "::" @@ -285,18 +285,18 @@ msgid "" "undefined choice among them will be reported and included in the exception." msgstr "" ":exc:`ValueError` 的子類別,如果作用的圖中存在循環則由 :meth:" -"`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義的其中一個" -"並包含在例外中。" +"`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義的其中一" +"個並包含在例外中。" #: ../../library/graphlib.rst:207 msgid "" "The detected cycle can be accessed via the second element in the :attr:" -"`~CycleError.args` attribute of the exception instance and consists in a " +"`~BaseException.args` attribute of the exception instance and consists in a " "list of nodes, such that each node is, in the graph, an immediate " "predecessor of the next node in the list. In the reported list, the first " "and the last node will be the same, to make it clear that it is cyclic." msgstr "" -"檢測到的循環可以通過例外實例的 :attr:`~CycleError.args` 屬性中第二個元素來存" -"取,其為一個節點列表,每個節點在圖中都是列表中下一個節點的直接前驅節點" +"檢測到的循環可以通過例外實例的 :attr:`~BaseException.args` 屬性中第二個元素來" +"存取,其為一個節點列表,每個節點在圖中都是列表中下一個節點的直接前驅節點" "(immediate predecessor,即父節點)。在報告列表中,第一個和最後一個節點將會是" "相同的,用以明確表示它是循環的。" diff --git a/library/gzip.po b/library/gzip.po index 80a6709760..21cfdbb063 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -119,9 +119,9 @@ msgstr "" #: ../../library/gzip.rst:72 msgid "" "Constructor for the :class:`GzipFile` class, which simulates most of the " -"methods of a :term:`file object`, with the exception of the :meth:`truncate` " -"method. At least one of *fileobj* and *filename* must be given a non-" -"trivial value." +"methods of a :term:`file object`, with the exception of the :meth:`~io." +"IOBase.truncate` method. At least one of *fileobj* and *filename* must be " +"given a non-trivial value." msgstr "" #: ../../library/gzip.rst:77 @@ -186,8 +186,8 @@ msgstr "" #: ../../library/gzip.rst:114 msgid "" ":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " -"including iteration and the :keyword:`with` statement. Only the :meth:" -"`truncate` method isn't implemented." +"including iteration and the :keyword:`with` statement. Only the :meth:`~io." +"IOBase.truncate` method isn't implemented." msgstr "" #: ../../library/gzip.rst:118 diff --git a/library/hashlib.po b/library/hashlib.po index a9c43d8919..abe15bdefd 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -264,9 +264,9 @@ msgstr "" #: ../../library/hashlib.rst:247 msgid "" -"Return the digest of the data passed to the :meth:`update` method so far. " -"This is a bytes object of size *length* which may contain bytes in the whole " -"range from 0 to 255." +"Return the digest of the data passed to the :meth:`~hash.update` method so " +"far. This is a bytes object of size *length* which may contain bytes in the " +"whole range from 0 to 255." msgstr "" #: ../../library/hashlib.rst:254 @@ -615,9 +615,9 @@ msgstr "" msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" -"`blake2s`), then update it with the data by calling :meth:`update` on the " -"object, and, finally, get the digest out of the object by calling :meth:" -"`digest` (or :meth:`hexdigest` for hex-encoded string)." +"`blake2s`), then update it with the data by calling :meth:`~hash.update` on " +"the object, and, finally, get the digest out of the object by calling :meth:" +"`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" #: ../../library/hashlib.rst:521 diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 46767be528..c600f6586d 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -177,11 +177,10 @@ msgstr "" #: ../../library/importlib.resources.abc.rst:146 msgid "" "An abstract base class for resource readers capable of serving the :meth:" -"`importlib.resources.files` interface. Subclasses :class:`importlib." -"resources.abc.ResourceReader` and provides concrete implementations of the :" -"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " -"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " -"also supplies ResourceReader." +"`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " +"and provides concrete implementations of the :class:`!ResourceReader`'s " +"abstract methods. Therefore, any loader supplying :class:`!" +"TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" #: ../../library/importlib.resources.abc.rst:153 diff --git a/library/json.po b/library/json.po index 9871a67314..bca98e8f85 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -186,8 +186,8 @@ msgstr "" #: ../../library/json.rst:194 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." +"meth:`~JSONEncoder.default` method to serialize additional types), specify " +"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used." msgstr "" #: ../../library/json.rst:198 ../../library/json.rst:277 @@ -493,9 +493,9 @@ msgstr "" #: ../../library/json.rst:424 msgid "" "To extend this to recognize other objects, subclass and implement a :meth:" -"`default` method with another method that returns a serializable object for " -"``o`` if possible, otherwise it should call the superclass implementation " -"(to raise :exc:`TypeError`)." +"`~JSONEncoder.default` method with another method that returns a " +"serializable object for ``o`` if possible, otherwise it should call the " +"superclass implementation (to raise :exc:`TypeError`)." msgstr "" #: ../../library/json.rst:429 @@ -538,7 +538,7 @@ msgstr "" #: ../../library/json.rst:485 msgid "" "For example, to support arbitrary iterators, you could implement :meth:" -"`default` like this::" +"`~JSONEncoder.default` like this::" msgstr "" #: ../../library/json.rst:501 diff --git a/library/logging.po b/library/logging.po index 56e808bc5e..8f4ec3c021 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -512,50 +512,26 @@ msgstr "" msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:403 -msgid "``CRITICAL``" -msgstr "``CRITICAL``" - #: ../../library/logging.rst:403 msgid "50" msgstr "50" -#: ../../library/logging.rst:405 -msgid "``ERROR``" -msgstr "``ERROR``" - #: ../../library/logging.rst:405 msgid "40" msgstr "40" -#: ../../library/logging.rst:407 -msgid "``WARNING``" -msgstr "``WARNING``" - #: ../../library/logging.rst:407 msgid "30" msgstr "30" -#: ../../library/logging.rst:409 -msgid "``INFO``" -msgstr "``INFO``" - #: ../../library/logging.rst:409 msgid "20" msgstr "20" -#: ../../library/logging.rst:411 -msgid "``DEBUG``" -msgstr "``DEBUG``" - #: ../../library/logging.rst:411 msgid "10" msgstr "10" -#: ../../library/logging.rst:413 -msgid "``NOTSET``" -msgstr "``NOTSET``" - #: ../../library/logging.rst:413 msgid "0" msgstr "0" diff --git a/library/lzma.po b/library/lzma.po index d860157624..aecb819a41 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -68,10 +68,10 @@ msgstr "" #: ../../library/lzma.rst:46 msgid "" -"The *mode* argument can be any of ``\"r\"``, ``\"rb\"``, ``\"w\"``, ``\"wb" -"\"``, ``\"x\"``, ``\"xb\"``, ``\"a\"`` or ``\"ab\"`` for binary mode, or ``" -"\"rt\"``, ``\"wt\"``, ``\"xt\"``, or ``\"at\"`` for text mode. The default " -"is ``\"rb\"``." +"The *mode* argument can be any of ``\"r\"``, ``\"rb\"``, ``\"w\"``, " +"``\"wb\"``, ``\"x\"``, ``\"xb\"``, ``\"a\"`` or ``\"ab\"`` for binary mode, " +"or ``\"rt\"``, ``\"wt\"``, ``\"xt\"``, or ``\"at\"`` for text mode. The " +"default is ``\"rb\"``." msgstr "" #: ../../library/lzma.rst:50 ../../library/lzma.rst:95 @@ -105,7 +105,7 @@ msgstr "" msgid "Added support for the ``\"x\"``, ``\"xb\"`` and ``\"xt\"`` modes." msgstr "" -#: ../../library/lzma.rst:68 ../../library/lzma.rst:126 +#: ../../library/lzma.rst:68 ../../library/lzma.rst:127 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -127,8 +127,8 @@ msgstr "" msgid "" "The *mode* argument can be either ``\"r\"`` for reading (default), ``\"w\"`` " "for overwriting, ``\"x\"`` for exclusive creation, or ``\"a\"`` for " -"appending. These can equivalently be given as ``\"rb\"``, ``\"wb\"``, ``\"xb" -"\"`` and ``\"ab\"`` respectively." +"appending. These can equivalently be given as ``\"rb\"``, ``\"wb\"``, " +"``\"xb\"`` and ``\"ab\"`` respectively." msgstr "" #: ../../library/lzma.rst:88 @@ -147,22 +147,22 @@ msgstr "" #: ../../library/lzma.rst:102 msgid "" ":class:`LZMAFile` supports all the members specified by :class:`io." -"BufferedIOBase`, except for :meth:`detach` and :meth:`truncate`. Iteration " -"and the :keyword:`with` statement are supported." +"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." +"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." msgstr "" -#: ../../library/lzma.rst:106 +#: ../../library/lzma.rst:107 msgid "The following method is also provided:" msgstr "" -#: ../../library/lzma.rst:110 +#: ../../library/lzma.rst:111 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned, unless EOF has been reached. The exact number of " "bytes returned is unspecified (the *size* argument is ignored)." msgstr "" -#: ../../library/lzma.rst:114 +#: ../../library/lzma.rst:115 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`LZMAFile`, it may change the position of the underlying file object (e.g. " @@ -170,60 +170,60 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/lzma.rst:119 +#: ../../library/lzma.rst:120 msgid "Added support for the ``\"x\"`` and ``\"xb\"`` modes." msgstr "" -#: ../../library/lzma.rst:122 +#: ../../library/lzma.rst:123 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/lzma.rst:131 +#: ../../library/lzma.rst:132 msgid "Compressing and decompressing data in memory" msgstr "" -#: ../../library/lzma.rst:135 +#: ../../library/lzma.rst:136 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "" -#: ../../library/lzma.rst:137 +#: ../../library/lzma.rst:138 msgid "" "For a more convenient way of compressing a single chunk of data, see :func:" "`compress`." msgstr "" -#: ../../library/lzma.rst:140 +#: ../../library/lzma.rst:141 msgid "" "The *format* argument specifies what container format should be used. " "Possible values are:" msgstr "" -#: ../../library/lzma.rst:144 +#: ../../library/lzma.rst:145 msgid ":const:`FORMAT_XZ`: The ``.xz`` container format." msgstr "" -#: ../../library/lzma.rst:144 +#: ../../library/lzma.rst:145 msgid "This is the default format." msgstr "" -#: ../../library/lzma.rst:148 +#: ../../library/lzma.rst:149 msgid ":const:`FORMAT_ALONE`: The legacy ``.lzma`` container format." msgstr "" -#: ../../library/lzma.rst:147 +#: ../../library/lzma.rst:148 msgid "" "This format is more limited than ``.xz`` -- it does not support integrity " "checks or multiple filters." msgstr "" -#: ../../library/lzma.rst:154 +#: ../../library/lzma.rst:155 msgid ":const:`FORMAT_RAW`: A raw data stream, not using any container format." msgstr "" -#: ../../library/lzma.rst:151 +#: ../../library/lzma.rst:152 msgid "" "This format specifier does not support integrity checks, and requires that " "you always specify a custom filter chain (for both compression and " @@ -231,46 +231,46 @@ msgid "" "decompressed using :const:`FORMAT_AUTO` (see :class:`LZMADecompressor`)." msgstr "" -#: ../../library/lzma.rst:156 +#: ../../library/lzma.rst:157 msgid "" "The *check* argument specifies the type of integrity check to include in the " "compressed data. This check is used when decompressing, to ensure that the " "data has not been corrupted. Possible values are:" msgstr "" -#: ../../library/lzma.rst:160 +#: ../../library/lzma.rst:161 msgid "" ":const:`CHECK_NONE`: No integrity check. This is the default (and the only " "acceptable value) for :const:`FORMAT_ALONE` and :const:`FORMAT_RAW`." msgstr "" -#: ../../library/lzma.rst:164 +#: ../../library/lzma.rst:165 msgid ":const:`CHECK_CRC32`: 32-bit Cyclic Redundancy Check." msgstr "" -#: ../../library/lzma.rst:166 +#: ../../library/lzma.rst:167 msgid "" ":const:`CHECK_CRC64`: 64-bit Cyclic Redundancy Check. This is the default " "for :const:`FORMAT_XZ`." msgstr "" -#: ../../library/lzma.rst:169 +#: ../../library/lzma.rst:170 msgid ":const:`CHECK_SHA256`: 256-bit Secure Hash Algorithm." msgstr "" -#: ../../library/lzma.rst:171 +#: ../../library/lzma.rst:172 msgid "" "If the specified check is not supported, an :class:`LZMAError` is raised." msgstr "" -#: ../../library/lzma.rst:173 +#: ../../library/lzma.rst:174 msgid "" "The compression settings can be specified either as a preset compression " "level (with the *preset* argument), or in detail as a custom filter chain " "(with the *filters* argument)." msgstr "" -#: ../../library/lzma.rst:177 +#: ../../library/lzma.rst:178 msgid "" "The *preset* argument (if provided) should be an integer between ``0`` and " "``9`` (inclusive), optionally OR-ed with the constant :const:" @@ -279,7 +279,7 @@ msgid "" "presets produce smaller output, but make the compression process slower." msgstr "" -#: ../../library/lzma.rst:186 +#: ../../library/lzma.rst:187 msgid "" "In addition to being more CPU-intensive, compression with higher presets " "also requires much more memory (and produces output that needs more memory " @@ -288,13 +288,13 @@ msgid "" "generally best to stick with the default preset." msgstr "" -#: ../../library/lzma.rst:192 +#: ../../library/lzma.rst:193 msgid "" "The *filters* argument (if provided) should be a filter chain specifier. " "See :ref:`filter-chain-specs` for details." msgstr "" -#: ../../library/lzma.rst:197 +#: ../../library/lzma.rst:198 msgid "" "Compress *data* (a :class:`bytes` object), returning a :class:`bytes` object " "containing compressed data for at least part of the input. Some of *data* " @@ -303,29 +303,29 @@ msgid "" "any previous calls to :meth:`compress`." msgstr "" -#: ../../library/lzma.rst:205 +#: ../../library/lzma.rst:206 msgid "" "Finish the compression process, returning a :class:`bytes` object containing " "any data stored in the compressor's internal buffers." msgstr "" -#: ../../library/lzma.rst:208 +#: ../../library/lzma.rst:209 msgid "The compressor cannot be used after this method has been called." msgstr "" -#: ../../library/lzma.rst:213 +#: ../../library/lzma.rst:214 msgid "" "Create a decompressor object, which can be used to decompress data " "incrementally." msgstr "" -#: ../../library/lzma.rst:216 +#: ../../library/lzma.rst:217 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see :func:`decompress`." msgstr "" -#: ../../library/lzma.rst:219 +#: ../../library/lzma.rst:220 msgid "" "The *format* argument specifies the container format that should be used. " "The default is :const:`FORMAT_AUTO`, which can decompress both ``.xz`` and " @@ -333,7 +333,7 @@ msgid "" "`FORMAT_ALONE`, and :const:`FORMAT_RAW`." msgstr "" -#: ../../library/lzma.rst:224 +#: ../../library/lzma.rst:225 msgid "" "The *memlimit* argument specifies a limit (in bytes) on the amount of memory " "that the decompressor can use. When this argument is used, decompression " @@ -341,7 +341,7 @@ msgid "" "input within the given memory limit." msgstr "" -#: ../../library/lzma.rst:229 +#: ../../library/lzma.rst:230 msgid "" "The *filters* argument specifies the filter chain that was used to create " "the stream being decompressed. This argument is required if *format* is :" @@ -349,7 +349,7 @@ msgid "" "`filter-chain-specs` for more information about filter chains." msgstr "" -#: ../../library/lzma.rst:235 +#: ../../library/lzma.rst:236 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`LZMAFile`. To " @@ -357,7 +357,7 @@ msgid "" "create a new decompressor for each stream." msgstr "" -#: ../../library/lzma.rst:242 +#: ../../library/lzma.rst:243 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -365,7 +365,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/lzma.rst:248 +#: ../../library/lzma.rst:249 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -374,100 +374,100 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/lzma.rst:255 +#: ../../library/lzma.rst:256 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/lzma.rst:260 +#: ../../library/lzma.rst:261 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/lzma.rst:264 +#: ../../library/lzma.rst:265 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/lzma.rst:269 +#: ../../library/lzma.rst:270 msgid "" "The ID of the integrity check used by the input stream. This may be :const:" "`CHECK_UNKNOWN` until enough of the input has been decoded to determine what " "integrity check it uses." msgstr "" -#: ../../library/lzma.rst:275 +#: ../../library/lzma.rst:276 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/lzma.rst:279 +#: ../../library/lzma.rst:280 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/lzma.rst:281 +#: ../../library/lzma.rst:282 msgid "Before the end of the stream is reached, this will be ``b\"\"``." msgstr "" -#: ../../library/lzma.rst:285 +#: ../../library/lzma.rst:286 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/lzma.rst:292 +#: ../../library/lzma.rst:293 msgid "" "Compress *data* (a :class:`bytes` object), returning the compressed data as " "a :class:`bytes` object." msgstr "" -#: ../../library/lzma.rst:295 +#: ../../library/lzma.rst:296 msgid "" "See :class:`LZMACompressor` above for a description of the *format*, " "*check*, *preset* and *filters* arguments." msgstr "" -#: ../../library/lzma.rst:301 +#: ../../library/lzma.rst:302 msgid "" "Decompress *data* (a :class:`bytes` object), returning the uncompressed data " "as a :class:`bytes` object." msgstr "" -#: ../../library/lzma.rst:304 +#: ../../library/lzma.rst:305 msgid "" "If *data* is the concatenation of multiple distinct compressed streams, " "decompress all of these streams, and return the concatenation of the results." msgstr "" -#: ../../library/lzma.rst:307 +#: ../../library/lzma.rst:308 msgid "" "See :class:`LZMADecompressor` above for a description of the *format*, " "*memlimit* and *filters* arguments." msgstr "" -#: ../../library/lzma.rst:312 +#: ../../library/lzma.rst:313 msgid "Miscellaneous" msgstr "" -#: ../../library/lzma.rst:316 +#: ../../library/lzma.rst:317 msgid "" "Return ``True`` if the given integrity check is supported on this system." msgstr "" -#: ../../library/lzma.rst:318 +#: ../../library/lzma.rst:319 msgid "" ":const:`CHECK_NONE` and :const:`CHECK_CRC32` are always supported. :const:" "`CHECK_CRC64` and :const:`CHECK_SHA256` may be unavailable if you are using " "a version of :program:`liblzma` that was compiled with a limited feature set." msgstr "" -#: ../../library/lzma.rst:327 +#: ../../library/lzma.rst:328 msgid "Specifying custom filter chains" msgstr "" -#: ../../library/lzma.rst:329 +#: ../../library/lzma.rst:330 msgid "" "A filter chain specifier is a sequence of dictionaries, where each " "dictionary contains the ID and options for a single filter. Each dictionary " @@ -475,118 +475,118 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: ../../library/lzma.rst:336 +#: ../../library/lzma.rst:337 msgid "Compression filters:" msgstr "" -#: ../../library/lzma.rst:335 +#: ../../library/lzma.rst:336 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: ../../library/lzma.rst:336 +#: ../../library/lzma.rst:337 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" msgstr "" -#: ../../library/lzma.rst:339 +#: ../../library/lzma.rst:340 msgid "Delta filter:" msgstr "" -#: ../../library/lzma.rst:339 +#: ../../library/lzma.rst:340 msgid ":const:`FILTER_DELTA`" msgstr ":const:`FILTER_DELTA`" -#: ../../library/lzma.rst:347 +#: ../../library/lzma.rst:348 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: ../../library/lzma.rst:342 +#: ../../library/lzma.rst:343 msgid ":const:`FILTER_X86`" msgstr ":const:`FILTER_X86`" -#: ../../library/lzma.rst:343 +#: ../../library/lzma.rst:344 msgid ":const:`FILTER_IA64`" msgstr ":const:`FILTER_IA64`" -#: ../../library/lzma.rst:344 +#: ../../library/lzma.rst:345 msgid ":const:`FILTER_ARM`" msgstr ":const:`FILTER_ARM`" -#: ../../library/lzma.rst:345 +#: ../../library/lzma.rst:346 msgid ":const:`FILTER_ARMTHUMB`" msgstr ":const:`FILTER_ARMTHUMB`" -#: ../../library/lzma.rst:346 +#: ../../library/lzma.rst:347 msgid ":const:`FILTER_POWERPC`" msgstr ":const:`FILTER_POWERPC`" -#: ../../library/lzma.rst:347 +#: ../../library/lzma.rst:348 msgid ":const:`FILTER_SPARC`" msgstr ":const:`FILTER_SPARC`" -#: ../../library/lzma.rst:349 +#: ../../library/lzma.rst:350 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: ../../library/lzma.rst:353 +#: ../../library/lzma.rst:354 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: ../../library/lzma.rst:356 +#: ../../library/lzma.rst:357 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: ../../library/lzma.rst:358 +#: ../../library/lzma.rst:359 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: ../../library/lzma.rst:360 +#: ../../library/lzma.rst:361 msgid "``lc``: Number of literal context bits." msgstr "" -#: ../../library/lzma.rst:361 +#: ../../library/lzma.rst:362 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: ../../library/lzma.rst:363 +#: ../../library/lzma.rst:364 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: ../../library/lzma.rst:364 +#: ../../library/lzma.rst:365 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: ../../library/lzma.rst:365 +#: ../../library/lzma.rst:366 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: ../../library/lzma.rst:367 +#: ../../library/lzma.rst:368 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: ../../library/lzma.rst:369 +#: ../../library/lzma.rst:370 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: ../../library/lzma.rst:372 +#: ../../library/lzma.rst:373 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -595,7 +595,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/lzma.rst:377 +#: ../../library/lzma.rst:378 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -605,30 +605,30 @@ msgid "" "data. The default is 0." msgstr "" -#: ../../library/lzma.rst:385 +#: ../../library/lzma.rst:386 msgid "Examples" msgstr "範例" -#: ../../library/lzma.rst:387 +#: ../../library/lzma.rst:388 msgid "Reading in a compressed file::" msgstr "" -#: ../../library/lzma.rst:393 +#: ../../library/lzma.rst:394 msgid "Creating a compressed file::" msgstr "" -#: ../../library/lzma.rst:400 +#: ../../library/lzma.rst:401 msgid "Compressing data in memory::" msgstr "" -#: ../../library/lzma.rst:406 +#: ../../library/lzma.rst:407 msgid "Incremental compression::" msgstr "" -#: ../../library/lzma.rst:417 +#: ../../library/lzma.rst:418 msgid "Writing compressed data to an already-open file::" msgstr "" -#: ../../library/lzma.rst:426 +#: ../../library/lzma.rst:427 msgid "Creating a compressed file using a custom filter chain::" msgstr "" diff --git a/library/msvcrt.po b/library/msvcrt.po index 6c0112468c..570c0ff35c 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -59,7 +59,7 @@ msgid "" "Lock part of a file based on file descriptor *fd* from the C runtime. " "Raises :exc:`OSError` on failure. The locked region of the file extends " "from the current file position for *nbytes* bytes, and may continue beyond " -"the end of the file. *mode* must be one of the :const:`LK_\\*` constants " +"the end of the file. *mode* must be one of the :const:`!LK_\\*` constants " "listed below. Multiple regions in a file may be locked at the same time, but " "may not overlap. Adjacent regions are not merged; they must be unlocked " "individually." @@ -70,7 +70,8 @@ msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." msgstr "" -"引發一個附帶引數 ``fd``、``mode``、``nbytes`` 的\\ :ref:`稽核事件 ` ``msvcrt.locking``。" +"引發一個附帶引數 ``fd``、``mode``、``nbytes`` 的\\ :ref:`稽核事件 " +"` ``msvcrt.locking``。" #: ../../library/msvcrt.rst:51 msgid "" @@ -109,7 +110,8 @@ msgid "" "Raises an :ref:`auditing event ` ``msvcrt.open_osfhandle`` with " "arguments ``handle``, ``flags``." msgstr "" -"引發一個附帶引數 ``arguments``、``handle``、``flags`` 的\\ :ref:`稽核事件 ` ``msvcrt.open_osfhandle``。" +"引發一個附帶引數 ``arguments``、``handle``、``flags`` 的\\ :ref:`稽核事件 " +"` ``msvcrt.open_osfhandle``。" #: ../../library/msvcrt.rst:87 msgid "" @@ -122,7 +124,8 @@ msgid "" "Raises an :ref:`auditing event ` ``msvcrt.get_osfhandle`` with " "argument ``fd``." msgstr "" -"引發一個附帶引數 ``fd`` 的\\ :ref:`稽核事件 ` ``msvcrt.get_osfhandle``。" +"引發一個附帶引數 ``fd`` 的\\ :ref:`稽核事件 ` ``msvcrt." +"get_osfhandle``。" #: ../../library/msvcrt.rst:96 msgid "Console I/O" diff --git a/library/netrc.po b/library/netrc.po index bc1a526daa..ca13ec8085 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,23 +90,32 @@ msgstr "" msgid "" "Exception raised by the :class:`~netrc.netrc` class when syntactical errors " "are encountered in source text. Instances of this exception provide three " -"interesting attributes: :attr:`msg` is a textual explanation of the error, :" -"attr:`filename` is the name of the source file, and :attr:`lineno` gives the " -"line number on which the error was found." +"interesting attributes:" msgstr "" "當原始文本中遇到語法錯誤時,:class:`~netrc.netrc` 類別會引發例外。此例外的實" -"例提供了三個有趣的屬性::attr:`msg` 是該錯誤的文字解釋、:attr:`filename` 是原" -"始檔案的名稱、:attr:`lineno` 給出發現錯誤的列號。" +"例提供了三個有趣的屬性:" + +#: ../../library/netrc.rst:58 +msgid "Textual explanation of the error." +msgstr "錯誤的文字解釋。" #: ../../library/netrc.rst:62 +msgid "The name of the source file." +msgstr "原始檔案的名稱。" + +#: ../../library/netrc.rst:66 +msgid "The line number on which the error was found." +msgstr "發現錯誤的列號。" + +#: ../../library/netrc.rst:72 msgid "netrc Objects" msgstr "netrc 物件" -#: ../../library/netrc.rst:64 +#: ../../library/netrc.rst:74 msgid "A :class:`~netrc.netrc` instance has the following methods:" msgstr ":class:`~netrc.netrc` 實例具有以下方法:" -#: ../../library/netrc.rst:69 +#: ../../library/netrc.rst:79 msgid "" "Return a 3-tuple ``(login, account, password)`` of authenticators for " "*host*. If the netrc file did not contain an entry for the given host, " @@ -117,7 +126,7 @@ msgstr "" "netrc 檔案不包含給定主機的條目,則回傳與 'default' 條目關聯的 tuple。如果並無" "匹配主機且預設條目也不可用則回傳 ``None``。" -#: ../../library/netrc.rst:77 +#: ../../library/netrc.rst:87 msgid "" "Dump the class data as a string in the format of a netrc file. (This " "discards comments and may reorder the entries.)" @@ -125,11 +134,11 @@ msgstr "" "將類別資料傾印 (dump) 為 netrc 檔案格式的字串。(這會將註解移除,並可能會對條" "目重新排序。)" -#: ../../library/netrc.rst:80 +#: ../../library/netrc.rst:90 msgid "Instances of :class:`~netrc.netrc` have public instance variables:" msgstr ":class:`~netrc.netrc` 的實例具有公開實例變數:" -#: ../../library/netrc.rst:85 +#: ../../library/netrc.rst:95 msgid "" "Dictionary mapping host names to ``(login, account, password)`` tuples. The " "'default' entry, if any, is represented as a pseudo-host by that name." @@ -137,6 +146,6 @@ msgstr "" "將主機名稱對映到 ``(login, account, password)`` tuple 的字典。'default' 條目" "(如存在)表示為該名稱對應到的偽主機 (pseudo-host)。" -#: ../../library/netrc.rst:91 +#: ../../library/netrc.rst:101 msgid "Dictionary mapping macro names to string lists." msgstr "巨集 (macro) 名稱與字串 list(串列)的對映字典。" diff --git a/library/operator.po b/library/operator.po index 58a3a3506a..ed45990e29 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-22 00:16+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,14 +83,14 @@ msgstr "" #: ../../library/operator.rst:61 msgid "" -"Return the outcome of :keyword:`not` *obj*. (Note that there is no :meth:" -"`__not__` method for object instances; only the interpreter core defines " -"this operation. The result is affected by the :meth:`__bool__` and :meth:" -"`__len__` methods.)" +"Return the outcome of :keyword:`not` *obj*. (Note that there is no :meth:`!" +"__not__` method for object instances; only the interpreter core defines this " +"operation. The result is affected by the :meth:`~object.__bool__` and :meth:" +"`~object.__len__` methods.)" msgstr "" -"回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`__not__` " -"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`__bool__` 和 :meth:" -"`__len__` method 影響。)" +"回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` " +"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` 和 " +":meth:`~object.__len__` method 影響。)" #: ../../library/operator.rst:69 msgid "" diff --git a/library/poplib.po b/library/poplib.po index 845e4604cc..eccf559fde 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -207,7 +207,7 @@ msgstr "" #: ../../library/poplib.rst:150 msgid "" "Send password, response includes message count and mailbox size. Note: the " -"mailbox on the server is locked until :meth:`~poplib.quit` is called." +"mailbox on the server is locked until :meth:`~POP3.quit` is called." msgstr "" #: ../../library/poplib.rst:156 diff --git a/library/pprint.po b/library/pprint.po index 68b748ec5b..6919c67e24 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,9 +69,9 @@ msgstr "" #: ../../library/pprint.rst:47 msgid "" "*stream* (default ``sys.stdout``) is a :term:`file-like object` to which the " -"output will be written by calling its :meth:`write` method. If both *stream* " -"and ``sys.stdout`` are ``None``, then :meth:`~PrettyPrinter.pprint` silently " -"returns." +"output will be written by calling its :meth:`!write` method. If both " +"*stream* and ``sys.stdout`` are ``None``, then :meth:`~PrettyPrinter.pprint` " +"silently returns." msgstr "" #: ../../library/pprint.rst:52 diff --git a/library/pty.po b/library/pty.po index fc73817328..cbce70b540 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -110,8 +110,8 @@ msgstr "" #: ../../library/pty.rst:74 msgid "" -":func:`waitstatus_to_exitcode` can be used to convert the exit status into " -"an exit code." +":func:`os.waitstatus_to_exitcode` can be used to convert the exit status " +"into an exit code." msgstr "" #: ../../library/pty.rst:77 diff --git a/library/sched.po b/library/sched.po index d8c0582ccb..a7a911510c 100644 --- a/library/sched.po +++ b/library/sched.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,9 +116,9 @@ msgstr "" #: ../../library/sched.rst:118 msgid "" -"Run all scheduled events. This method will wait (using the :func:" -"`delayfunc` function passed to the constructor) for the next event, then " -"execute it and so on until there are no more scheduled events." +"Run all scheduled events. This method will wait (using the *delayfunc* " +"function passed to the constructor) for the next event, then execute it and " +"so on until there are no more scheduled events." msgstr "" #: ../../library/sched.rst:122 diff --git a/library/selectors.po b/library/selectors.po index e3096b3df8..e94ab6b435 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -104,18 +104,10 @@ msgstr "" msgid "Meaning" msgstr "" -#: ../../library/selectors.rst:63 -msgid ":const:`EVENT_READ`" -msgstr ":const:`EVENT_READ`" - #: ../../library/selectors.rst:63 msgid "Available for read" msgstr "" -#: ../../library/selectors.rst:65 -msgid ":const:`EVENT_WRITE`" -msgstr ":const:`EVENT_WRITE`" - #: ../../library/selectors.rst:65 msgid "Available for write" msgstr "" @@ -200,8 +192,8 @@ msgstr "" #: ../../library/selectors.rst:135 msgid "" -"This is equivalent to :meth:`BaseSelector.unregister(fileobj)` followed by :" -"meth:`BaseSelector.register(fileobj, events, data)`, except that it can be " +"This is equivalent to ``BaseSelector.unregister(fileobj)`` followed by " +"``BaseSelector.register(fileobj, events, data)``, except that it can be " "implemented more efficiently." msgstr "" diff --git a/library/shutil.po b/library/shutil.po index c59c68a04e..83786bf0f4 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-23 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -481,10 +481,10 @@ 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." "rename` cannot be used. If the source is a directory, :func:`copytree` is " -"called, passing it the :func:`copy_function`. The default *copy_function* " -"is :func:`copy2`. Using :func:`~shutil.copy` as the *copy_function* allows " -"the move to succeed when it is not possible to also copy the metadata, at " -"the expense of not copying any of the metadata." +"called, passing it the *copy_function*. The default *copy_function* is :func:" +"`copy2`. Using :func:`~shutil.copy` as the *copy_function* allows the move " +"to succeed when it is not possible to also copy the metadata, at the expense " +"of not copying any of the metadata." msgstr "" #: ../../library/shutil.rst:377 diff --git a/library/stat.po b/library/stat.po index 22592abc57..eba0de1a5e 100644 --- a/library/stat.po +++ b/library/stat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-24 00:11+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,8 +30,8 @@ msgstr "**原始碼:**\\ :source:`Lib/stat.py`" msgid "" "The :mod:`stat` module defines constants and functions for interpreting the " "results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they " -"exist). For complete details about the :c:func:`stat`, :c:func:`fstat` and :" -"c:func:`lstat` calls, consult the documentation for your system." +"exist). For complete details about the :c:func:`stat`, :c:func:`!fstat` " +"and :c:func:`!lstat` calls, consult the documentation for your system." msgstr "" #: ../../library/stat.rst:19 @@ -100,12 +100,12 @@ msgstr "" #: ../../library/stat.rst:91 msgid "" "Return the portion of the file's mode that describes the file type (used by " -"the :func:`S_IS\\*` functions above)." +"the :func:`!S_IS\\*` functions above)." msgstr "" #: ../../library/stat.rst:94 msgid "" -"Normally, you would use the :func:`os.path.is\\*` functions for testing the " +"Normally, you would use the :func:`!os.path.is\\*` functions for testing the " "type of a file; the functions here are useful when you are doing multiple " "tests of the same file and wish to avoid the overhead of the :c:func:`stat` " "system call for each test. These are also useful when checking for " diff --git a/library/sysconfig.po b/library/sysconfig.po index 41c53f130d..7dc03abf28 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -102,7 +102,7 @@ msgstr "" #: ../../library/sysconfig.rst:72 msgid "" -"Every new component that is installed using :mod:`distutils` or a Distutils-" +"Every new component that is installed using :mod:`!distutils` or a Distutils-" "based system will follow the same scheme to copy its file in the right " "places." msgstr "" diff --git a/library/textwrap.po b/library/textwrap.po index 440dca0c47..30be1a125a 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -75,7 +75,7 @@ msgid "" "First the whitespace in *text* is collapsed (all whitespace is replaced by " "single spaces). If the result fits in the *width*, it is returned. " "Otherwise, enough words are dropped from the end so that the remaining words " -"plus the :attr:`placeholder` fit within :attr:`width`::" +"plus the :attr:`.placeholder` fit within :attr:`.width`::" msgstr "" #: ../../library/textwrap.rst:72 @@ -189,7 +189,7 @@ msgstr "" #: ../../library/textwrap.rst:175 msgid "" "(default: ``True``) If true, then all tab characters in *text* will be " -"expanded to spaces using the :meth:`expandtabs` method of *text*." +"expanded to spaces using the :meth:`~str.expandtabs` method of *text*." msgstr "" #: ../../library/textwrap.rst:181 diff --git a/library/urllib.error.po b/library/urllib.error.po index bdc06e8e47..5f9fa4e6df 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -100,8 +100,8 @@ msgid "" "The HTTP response headers for the HTTP request that caused the :exc:" "`HTTPError`. An alias for *hdrs* attribute." msgstr "" -"導致 :exc:`HTTPError` 的特定 HTTP 請求的 HTTP 回應 header。" -"為 *hdrs* 屬性的別名。" +"導致 :exc:`HTTPError` 的特定 HTTP 請求的 HTTP 回應 header。為 *hdrs* 屬性的別" +"名。" #: ../../library/urllib.error.rst:68 msgid "A file-like object where the HTTP error body can be read from." @@ -111,9 +111,11 @@ msgstr "" msgid "" "This exception is raised when the :func:`~urllib.request.urlretrieve` " "function detects that the amount of the downloaded data is less than the " -"expected amount (given by the *Content-Length* header). The :attr:`content` " -"attribute stores the downloaded (and supposedly truncated) data." +"expected amount (given by the *Content-Length* header)." msgstr "" "此例外會在 :func:`~urllib.request.urlretrieve` 函式檢查到已下載的資料量小於期" -"待的資料量(由 *Content-Length* header 給定)時被引發。:attr:`content` 屬性中" -"將存放已下載(可能已被截斷)的資料。" +"待的資料量(由 *Content-Length* header 給定)時被引發。" + +#: ../../library/urllib.error.rst:79 +msgid "The downloaded (and supposedly truncated) data." +msgstr "已下載(可能已被截斷)的資料。" diff --git a/library/winreg.po b/library/winreg.po index a993996228..986f102f99 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -372,8 +372,8 @@ msgstr "" #: ../../library/winreg.rst:290 msgid "" -"A call to :func:`LoadKey` fails if the calling process does not have the :" -"const:`SE_RESTORE_PRIVILEGE` privilege. Note that privileges are different " +"A call to :func:`LoadKey` fails if the calling process does not have the :c:" +"data:`!SE_RESTORE_PRIVILEGE` privilege. Note that privileges are different " "from permissions -- see the `RegLoadKey documentation `__ for more details." msgstr "" @@ -527,7 +527,7 @@ msgstr "" msgid "" "If *key* represents a key on a remote computer, the path described by " "*file_name* is relative to the remote computer. The caller of this method " -"must possess the :const:`SeBackupPrivilege` security privilege. Note that " +"must possess the **SeBackupPrivilege** security privilege. Note that " "privileges are different than permissions -- see the `Conflicts Between User " "Rights and Permissions documentation `__ for more details." @@ -691,7 +691,7 @@ msgstr "常數" #: ../../library/winreg.rst:539 msgid "" -"The following constants are defined for use in many :mod:`_winreg` functions." +"The following constants are defined for use in many :mod:`winreg` functions." msgstr "" #: ../../library/winreg.rst:544 @@ -920,7 +920,8 @@ msgid "" msgstr "" #: ../../library/winreg.rst:748 -msgid "Handle objects provide semantics for :meth:`__bool__` -- thus ::" +msgid "" +"Handle objects provide semantics for :meth:`~object.__bool__` -- thus ::" msgstr "" #: ../../library/winreg.rst:753 diff --git a/library/winsound.po b/library/winsound.po index fe6ef8d133..c21f0b3bc6 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,9 +40,9 @@ msgstr "" #: ../../library/winsound.rst:27 msgid "" -"Call the underlying :c:func:`PlaySound` function from the Platform API. The " -"*sound* parameter may be a filename, a system sound alias, audio data as a :" -"term:`bytes-like object`, or ``None``. Its interpretation depends on the " +"Call the underlying :c:func:`!PlaySound` function from the Platform API. " +"The *sound* parameter may be a filename, a system sound alias, audio data as " +"a :term:`bytes-like object`, or ``None``. Its interpretation depends on the " "value of *flags*, which can be a bitwise ORed combination of the constants " "described below. If the *sound* parameter is ``None``, any currently playing " "waveform sound is stopped. If the system indicates an error, :exc:" @@ -51,7 +51,7 @@ msgstr "" #: ../../library/winsound.rst:38 msgid "" -"Call the underlying :c:func:`MessageBeep` function from the Platform API. " +"Call the underlying :c:func:`!MessageBeep` function from the Platform API. " "This plays a sound as specified in the registry. The *type* argument " "specifies which sound to play; possible values are ``-1``, " "``MB_ICONASTERISK``, ``MB_ICONEXCLAMATION``, ``MB_ICONHAND``, " diff --git a/library/xml.po b/library/xml.po index d0e4a72d2d..4313c020b9 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -184,7 +184,7 @@ msgstr "" #: ../../library/xml.rst:77 msgid "" ":mod:`xml.etree.ElementTree` doesn't expand external entities and raises a :" -"exc:`ParserError` when an entity occurs." +"exc:`~xml.etree.ElementTree.ParseError` when an entity occurs." msgstr "" #: ../../library/xml.rst:79 @@ -194,7 +194,7 @@ msgid "" msgstr "" #: ../../library/xml.rst:81 -msgid ":mod:`xmlrpclib` doesn't expand external entities and omits them." +msgid ":mod:`xmlrpc.client` doesn't expand external entities and omits them." msgstr "" #: ../../library/xml.rst:82 @@ -258,8 +258,8 @@ msgid "" msgstr "" #: ../../library/xml.rst:123 -msgid "The :mod:`defusedxml` Package" -msgstr ":mod:`defusedxml` 套件" +msgid "The :mod:`!defusedxml` Package" +msgstr ":mod:`!defusedxml` 套件" #: ../../library/xml.rst:125 msgid "" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 981c4990de..fdf66edef8 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -529,9 +529,9 @@ msgid "" "your :class:`~xml.sax.xmlreader.XMLReader`, the parser will call the methods " "in your object to report all warnings and errors. There are three levels of " "errors available: warnings, (possibly) recoverable errors, and unrecoverable " -"errors. All methods take a :exc:`SAXParseException` as the only parameter. " -"Errors and warnings may be converted to an exception by raising the passed-" -"in exception object." +"errors. All methods take a :exc:`~xml.sax.SAXParseException` as the only " +"parameter. Errors and warnings may be converted to an exception by raising " +"the passed-in exception object." msgstr "" #: ../../library/xml.sax.handler.rst:403 diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index a7df885514..8e0656a690 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -115,6 +115,6 @@ msgid "" "fully resolved :class:`~xml.sax.xmlreader.InputSource` object ready for " "reading. The input source can be given as a string, a file-like object, or " "an :class:`~xml.sax.xmlreader.InputSource` object; parsers will use this " -"function to implement the polymorphic *source* argument to their :meth:" -"`parse` method." +"function to implement the polymorphic *source* argument to their :meth:`~xml." +"sax.xmlreader.XMLReader.parse` method." msgstr "" diff --git a/library/xmlrpc.po b/library/xmlrpc.po index e300ed1e96..e744806400 100644 --- a/library/xmlrpc.po +++ b/library/xmlrpc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2022-02-16 01:58+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,8 +20,8 @@ msgstr "" "X-Generator: Poedit 3.0.1\n" #: ../../library/xmlrpc.rst:2 -msgid ":mod:`xmlrpc` --- XMLRPC server and client modules" -msgstr ":mod:`xmlrpc` --- XMLRPC 服務端與客戶端模組" +msgid ":mod:`!xmlrpc` --- XMLRPC server and client modules" +msgstr ":mod:`!xmlrpc` --- XMLRPC 伺服器與用戶模組" #: ../../library/xmlrpc.rst:4 msgid "" @@ -30,7 +30,7 @@ msgid "" "server (the server is named by a URI) and get back structured data." msgstr "" "XML-RPC 是一種遠端程序呼叫 (Remote Procedure Call) 方法,它使用通過 HTTP 傳輸" -"(transport)的 XML 來做傳遞。有了它,客戶端可以在遠端伺服器上呼叫帶有參數的" +"(transport)的 XML 來做傳遞。有了它,用戶端可以在遠端伺服器上呼叫帶有參數的" "方法(伺服器以 URI 命名)並獲取結構化的資料。" #: ../../library/xmlrpc.rst:8 @@ -38,7 +38,7 @@ msgid "" "``xmlrpc`` is a package that collects server and client modules implementing " "XML-RPC. The modules are:" msgstr "" -"``xmlrpc`` 是一個集合了 XML-RPC 伺服器與客戶端模組實作的套件。這些模組是:" +"``xmlrpc`` 是一個集合了 XML-RPC 伺服器與用戶端模組實作的套件。這些模組是:" #: ../../library/xmlrpc.rst:11 msgid ":mod:`xmlrpc.client`" diff --git a/reference/datamodel.po b/reference/datamodel.po index 2b6ac3d721..fea062ec1b 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -1907,9 +1907,9 @@ msgstr "" msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " -"defined, :meth:`__len__` is called, if it is defined, and the object is " -"considered true if its result is nonzero. If a class defines neither :meth:" -"`__len__` nor :meth:`__bool__`, all its instances are considered true." +"defined, :meth:`~object.__len__` is called, if it is defined, and the object " +"is considered true if its result is nonzero. If a class defines neither :" +"meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" #: ../../reference/datamodel.rst:1606 @@ -2965,8 +2965,8 @@ msgstr "" msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " -"define a :meth:`__bool__` method and whose :meth:`__len__` method returns " -"zero is considered to be false in a Boolean context." +"define a :meth:`~object.__bool__` method and whose :meth:`!__len__` method " +"returns zero is considered to be false in a Boolean context." msgstr "" #: ../../reference/datamodel.rst:2502 @@ -2975,7 +2975,7 @@ msgid "" "length is larger than :data:`!sys.maxsize` some features (such as :func:" "`len`) may raise :exc:`OverflowError`. To prevent raising :exc:`!" "OverflowError` by truth value testing, an object must define a :meth:" -"`__bool__` method." +"`~object.__bool__` method." msgstr "" #: ../../reference/datamodel.rst:2511 diff --git a/reference/expressions.po b/reference/expressions.po index 92c00d3ef6..287b606b1e 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-03 07:57+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -1829,8 +1829,8 @@ msgid "" "``False``, ``None``, numeric zero of all types, and empty strings and " "containers (including strings, tuples, lists, dictionaries, sets and " "frozensets). All other values are interpreted as true. User-defined " -"objects can customize their truth value by providing a :meth:`__bool__` " -"method." +"objects can customize their truth value by providing a :meth:`~object." +"__bool__` method." msgstr "" #: ../../reference/expressions.rst:1724 diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 53cd3fc8a7..a58e3375df 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -986,10 +986,10 @@ msgstr "" #: ../../reference/lexical_analysis.rst:789 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 " -"conversion result. An empty string is passed when the format specifier is " -"omitted. The formatted result is then included in the final value of the " -"whole string." +"specifier is passed to the :meth:`~object.__format__` method of the " +"expression or conversion result. An empty string is passed when the format " +"specifier is omitted. The formatted result is then included in the final " +"value of the whole string." msgstr "" #: ../../reference/lexical_analysis.rst:795 diff --git a/tutorial/errors.po b/tutorial/errors.po index 03f2b2aea4..9d343be225 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 13:42+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -239,21 +239,21 @@ msgid "" "The *except clause* may specify a variable after the exception name. The " "variable is bound to the exception instance which typically has an ``args`` " "attribute that stores the arguments. For convenience, builtin exception " -"types define :meth:`__str__` to print all the arguments without explicitly " -"accessing ``.args``. ::" +"types define :meth:`~object.__str__` to print all the arguments without " +"explicitly accessing ``.args``. ::" msgstr "" "*except 子句*\\ 可以在例外名稱後面指定一個變數。這個變數被綁定到一個例外實例 " "(instance),其引數通常儲存在 ``args`` 屬性中。為了方便,內建例外型別定義了 :" -"meth:`__str__` 以印出所有引數而不需顯式地取用 ``.args``\\ :\n" +"meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``\\ :\n" "\n" "::" #: ../../tutorial/errors.rst:177 msgid "" -"The exception's :meth:`__str__` output is printed as the last part " +"The exception's :meth:`~object.__str__` output is printed as the last part " "('detail') of the message for unhandled exceptions." msgstr "" -"例外的 :meth:`__str__` 輸出會被印在未處理例外訊息的最後一部分(「細節」)。" +"例外的 :meth:`~object.__str__` 輸出會被印在未處理例外訊息的最後一部分(「細節」)。" #: ../../tutorial/errors.rst:180 msgid "" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index 2f9a5e9f43..7725c15ae5 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: 2021-06-28 20:45+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,8 +50,8 @@ msgid "" "expressions such as ``string.a``, it will evaluate the expression up to the " "final ``'.'`` and then suggest completions from the attributes of the " "resulting object. Note that this may execute application-defined code if an " -"object with a :meth:`__getattr__` method is part of the expression. The " -"default configuration also saves your history into a file named :file:`." +"object with a :meth:`~object.__getattr__` method is part of the expression. " +"The default configuration also saves your history into a file named :file:`." "python_history` in your user directory. The history will be available again " "during the next interactive interpreter session." msgstr "" @@ -60,10 +60,10 @@ msgstr "" "看 Python 的陳述式名稱、當前區域變數名稱和可用模組名稱。對於像是 ``string." "a`` 的點分隔運算式 (dotted expression),它會對最後一個 ``'.'`` 之前的運算式求" "值,然後根據求值結果物件的屬性,給予自動完成的建議。請注意,如果一個物件有 :" -"meth:`__getattr__` method(方法),同時又是該運算式的一部份,這樣可能會執行應" -"用程式自定義的程式碼。預設設定也會把你的指令歷史記錄儲存在你的使用者資料夾" -"內,一個名為 :file:`.python_history` 的檔案中。在下一次啟動互動式直譯器時,這" -"些歷史記錄依然可以被使用。" +"meth:`~object.__getattr__` method(方法),同時又是該運算式的一部份,這樣可能" +"會執行應用程式自定義的程式碼。預設設定也會把你的指令歷史記錄儲存在你的使用者" +"資料夾內,一個名為 :file:`.python_history` 的檔案中。在下一次啟動互動式直譯器" +"時,這些歷史記錄依然可以被使用。" #: ../../tutorial/interactive.rst:36 msgid "Alternatives to the Interactive Interpreter" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 2e56ee4081..32d093ef5d 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -820,7 +820,7 @@ msgstr "" msgid "" "The earlier versions of these methods were more forgiving because they used " "an old function in Python's C interface to parse their arguments; 2.0 " -"modernizes them to use :func:`PyArg_ParseTuple`, the current argument " +"modernizes them to use :c:func:`PyArg_ParseTuple`, the current argument " "parsing function, which provides more helpful error messages and treats " "multi-argument calls as errors. If you absolutely must use 2.0 but can't " "fix your code, you can edit :file:`Objects/listobject.c` and define the " @@ -953,7 +953,7 @@ msgstr "" msgid "" "Vladimir Marangozov's long-awaited malloc restructuring was completed, to " "make it easy to have the Python interpreter use a custom allocator instead " -"of C's standard :func:`malloc`. For documentation, read the comments in :" +"of C's standard :c:func:`malloc`. For documentation, read the comments in :" "file:`Include/pymem.h` and :file:`Include/objimpl.h`. For the lengthy " "discussions during which the interface was hammered out, see the web " "archives of the 'patches' and 'python-dev' lists at python.org." @@ -996,8 +996,8 @@ msgstr "" #: ../../whatsnew/2.0.rst:796 msgid "" "Three new convenience functions intended for adding constants to a module's " -"dictionary at module initialization time were added: :func:" -"`PyModule_AddObject`, :func:`PyModule_AddIntConstant`, and :func:" +"dictionary at module initialization time were added: :c:func:" +"`PyModule_AddObject`, :c:func:`PyModule_AddIntConstant`, and :c:func:" "`PyModule_AddStringConstant`. Each of these functions takes a module " "object, a null-terminated C string containing the name to be added, and a " "third argument for the value to be assigned to the name. This third " @@ -1006,8 +1006,9 @@ msgstr "" #: ../../whatsnew/2.0.rst:804 msgid "" -"A wrapper API was added for Unix-style signal handlers. :func:`PyOS_getsig` " -"gets a signal handler and :func:`PyOS_setsig` will set a new handler." +"A wrapper API was added for Unix-style signal handlers. :c:func:" +"`PyOS_getsig` gets a signal handler and :c:func:`PyOS_setsig` will set a new " +"handler." msgstr "" #: ../../whatsnew/2.0.rst:811 diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 3a5ecdb659..545181edf7 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -877,10 +877,10 @@ msgstr "" #: ../../whatsnew/2.1.rst:694 msgid "" "A specialized object allocator is now optionally available, that should be " -"faster than the system :func:`malloc` and have less memory overhead. The " -"allocator uses C's :func:`malloc` function to get large pools of memory, and " -"then fulfills smaller memory requests from these pools. It can be enabled " -"by providing the :option:`!--with-pymalloc` option to the :program:" +"faster than the system :c:func:`malloc` and have less memory overhead. The " +"allocator uses C's :c:func:`!malloc` function to get large pools of memory, " +"and then fulfills smaller memory requests from these pools. It can be " +"enabled by providing the :option:`!--with-pymalloc` option to the :program:" "`configure` script; see :file:`Objects/obmalloc.c` for the implementation " "details." msgstr "" @@ -890,15 +890,16 @@ msgid "" "Authors of C extension modules should test their code with the object " "allocator enabled, because some incorrect code may break, causing core dumps " "at runtime. There are a bunch of memory allocation functions in Python's C " -"API that have previously been just aliases for the C library's :func:" -"`malloc` and :func:`free`, meaning that if you accidentally called " +"API that have previously been just aliases for the C library's :c:func:" +"`malloc` and :c:func:`free`, meaning that if you accidentally called " "mismatched functions, the error wouldn't be noticeable. When the object " -"allocator is enabled, these functions aren't aliases of :func:`malloc` and :" -"func:`free` any more, and calling the wrong function to free memory will get " -"you a core dump. For example, if memory was allocated using :func:" -"`PyMem_New`, it has to be freed using :func:`PyMem_Del`, not :func:`free`. " -"A few modules included with Python fell afoul of this and had to be fixed; " -"doubtless there are more third-party modules that will have the same problem." +"allocator is enabled, these functions aren't aliases of :c:func:`!malloc` " +"and :c:func:`!free` any more, and calling the wrong function to free memory " +"will get you a core dump. For example, if memory was allocated using :c:" +"macro:`PyMem_New`, it has to be freed using :c:func:`PyMem_Del`, not :c:func:" +"`!free`. A few modules included with Python fell afoul of this and had to " +"be fixed; doubtless there are more third-party modules that will have the " +"same problem." msgstr "" #: ../../whatsnew/2.1.rst:714 @@ -911,8 +912,8 @@ msgid "" "complain about its lack of speed, and because it's often been used as a " "naïve benchmark. The :meth:`readline` method of file objects has therefore " "been rewritten to be much faster. The exact amount of the speedup will vary " -"from platform to platform depending on how slow the C library's :func:`getc` " -"was, but is around 66%, and potentially much faster on some particular " +"from platform to platform depending on how slow the C library's :c:func:`!" +"getc` was, but is around 66%, and potentially much faster on some particular " "operating systems. Tim Peters did much of the benchmarking and coding for " "this change, motivated by a discussion in comp.lang.python." msgstr "" @@ -981,7 +982,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:772 msgid "" -"C extensions which import other modules have been changed to use :func:" +"C extensions which import other modules have been changed to use :c:func:" "`PyImport_ImportModule`, which means that they will use any import hooks " "that have been installed. This is also encouraged for third-party " "extensions that need to import some other module from C code." diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 0fbf8703ca..fe738984c0 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-07-29 10:36+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-" @@ -206,7 +206,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:207 msgid "Integers" -msgstr "" +msgstr "整數" #: ../../whatsnew/3.0.rst:209 msgid "" @@ -493,7 +493,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:406 msgid "Changed Syntax" -msgstr "" +msgstr "語法變更" #: ../../whatsnew/3.0.rst:408 msgid "" @@ -554,7 +554,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:450 msgid "Removed Syntax" -msgstr "" +msgstr "已被移除的語法" #: ../../whatsnew/3.0.rst:452 msgid "" @@ -712,7 +712,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:551 msgid "Library Changes" -msgstr "" +msgstr "函式庫變更" #: ../../whatsnew/3.0.rst:553 msgid "" @@ -844,6 +844,8 @@ msgid "" ":mod:`dbm` (:mod:`anydbm`, :mod:`dbhash`, :mod:`dbm`, :mod:`dumbdbm`, :mod:" "`gdbm`, :mod:`whichdb`)." msgstr "" +":mod:`dbm` (:mod:`anydbm`、:mod:`dbhash`、:mod:`dbm`、:mod:`dumbdbm`、:mod:" +"`gdbm`、:mod:`whichdb`)。" #: ../../whatsnew/3.0.rst:609 msgid ":mod:`html` (:mod:`HTMLParser`, :mod:`htmlentitydefs`)." @@ -883,7 +885,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:629 msgid "Killed :mod:`sets`. Use the built-in :func:`set` class." -msgstr "" +msgstr "移除 :mod:`sets`。請使用內建的 :func:`set` 類別。" #: ../../whatsnew/3.0.rst:631 msgid "" @@ -1099,7 +1101,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:780 msgid "Removed support for :attr:`__members__` and :attr:`__methods__`." -msgstr "" +msgstr "移除對 :attr:`__members__` 和 :attr:`__methods__` 的支援。" #: ../../whatsnew/3.0.rst:782 msgid "" @@ -1113,8 +1115,8 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:792 -msgid ":meth:`__nonzero__` is now :meth:`__bool__`." -msgstr ":meth:`__nonzero__` 現在為 :meth:`__bool__`\\ 。" +msgid ":meth:`!__nonzero__` is now :meth:`~object.__bool__`." +msgstr ":meth:`!__nonzero__` 現在為 :meth:`~object.__bool__`。" #: ../../whatsnew/3.0.rst:795 msgid "Builtins" @@ -1259,7 +1261,7 @@ msgstr "" #: ../../whatsnew/3.0.rst:878 msgid "" "Removed :c:macro:`METH_OLDARGS` and :c:macro:`WITH_CYCLE_GC` from the C API." -msgstr "" +msgstr "移除 C API 中的 :c:macro:`METH_OLDARGS` 和 :c:macro:`WITH_CYCLE_GC`。" #: ../../whatsnew/3.0.rst:884 msgid "Performance" From 23323017d8eeada46ebeb01c277be666d649c9db Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:55:48 +0800 Subject: [PATCH 027/105] Adds more translations of library/io (#512) Adds more translations of library/io --- library/io.po | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/library/io.po b/library/io.po index be5adcfaa4..2291d2cf67 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-07-17 17:38+0800\n" +"PO-Revision-Date: 2023-07-31 18:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -39,6 +39,11 @@ msgid "" "any of these categories is called a :term:`file object`. Other common terms " "are *stream* and *file-like object*." msgstr "" +":mod:`io` 模組替 Python 提供處理各種類型 IO 的主要工具。有三種主要的 IO 類" +"型: *文字 I/O (text I/O)*、*二進位 I/O (binary I/O)* 以及\\ *原始 I/O (raw " +"I/O)*。這些均為泛用 (generic) 類型,且每種類型都可以使用各式後端儲存 " +"(backing store)。任一種屬於這些類型的具體物件稱為 :term:`file object`。其它常" +"見的名詞還有\\ *資料串流 (stream)* 以及\\ *類檔案物件 (file-like objects)*。" #: ../../library/io.rst:34 msgid "" @@ -48,6 +53,9 @@ msgid "" "location), or only sequential access (for example in the case of a socket or " "pipe)." msgstr "" +"無論其類型為何,每個具體的資料串流物件也將具有各種能力:唯讀的、只接受寫入" +"的、或者讀寫兼具的。它還允許任意的隨機存取(向前或向後尋找至任意位置),或者" +"只能依順序存取(例如 socket 或 pipe 的情形下)。" #: ../../library/io.rst:40 msgid "" @@ -58,16 +66,16 @@ msgid "" msgstr "" "所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" "`str` 物件給二進位資料串流的 ``write()`` 方法將會引發 :exc:`TypeError`。同樣" -"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發同" -"樣的錯誤。" +"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發" +"同樣的錯誤。" #: ../../library/io.rst:45 msgid "" "Operations that used to raise :exc:`IOError` now raise :exc:`OSError`, " "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" -"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :" -"exc:`IOError` 現在是 :exc:`OSError` 的別名。" +"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" +"`IOError` 現在是 :exc:`OSError` 的別名。" #: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122 msgid "Text I/O" @@ -80,6 +88,9 @@ msgid "" "a file), encoding and decoding of data is made transparently as well as " "optional translation of platform-specific newline characters." msgstr "" +"文字 I/O 要求和產出 :class:`str` 物件。這意味著每當後端儲存為原生 bytes 時" +"(例如在檔案的情形下),資料的編碼與解碼會以清楚易懂的方式進行,也可選擇同時" +"轉換特定於平台的換行字元。" #: ../../library/io.rst:58 msgid "" @@ -116,6 +127,10 @@ msgid "" "be used for all kinds of non-text data, and also when manual control over " "the handling of text data is desired." msgstr "" +"二進位 I/O(也稱為\\ *緩衝 I/O (buffered I/O)*)要求的是\\ :term:`類位元組物" +"件 (bytes-like objects) ` 且產生 :class:`bytes` 物件。不進" +"行編碼、解碼或者換行字元轉換。這種類型的資料串流可用於各種非文字資料,以及需" +"要手動控制對文字資料的處理時。" #: ../../library/io.rst:80 msgid "" @@ -160,6 +175,12 @@ msgid "" "manipulate a raw stream from user code. Nevertheless, you can create a raw " "stream by opening a file in binary mode with buffering disabled::" msgstr "" +"原始 I/O(也稱為\\ *無緩衝 I/O (unbuffered I/O)*)通常作為二進位以及文字資料" +"串流的低階 building-block 使用;在使用者程式碼中直接操作原始資料串流很少有" +"用。然而,你可以透過以無緩衝的二進位模式開啟一個檔案來建立一個原始資料串" +"流:\n" +"\n" +"::" #: ../../library/io.rst:106 msgid "" @@ -302,6 +323,8 @@ msgid "" "This is a helper function for callables that use :func:`open` or :class:" "`TextIOWrapper` and have an ``encoding=None`` parameter." msgstr "" +"這是個輔助函數,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " +"``encoding=None`` 參數的可呼叫物件。" #: ../../library/io.rst:203 msgid "" From 0047efda8a2f2431b41a89219a60ebcd234714c7 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:10:29 +0800 Subject: [PATCH 028/105] Removes fuzzy translations of library/bisect (#516) * Removes fuzzy translations of library/bisect * Update library/bisect.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/bisect.po | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/library/bisect.po b/library/bisect.po index df4faccd7f..ed33160d81 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-06-22 15:12+0800\n" +"PO-Revision-Date: 2023-08-01 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -21,7 +21,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.3.1\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/bisect.rst:2 msgid ":mod:`bisect` --- Array bisection algorithm" @@ -39,7 +39,8 @@ msgid "" "searches or frequent resorting." msgstr "" "這個模組維護一個已經排序過的 list ,當我們每次做完插入後不需要再次排序整個 " -"list 。一個很長的 list 的比較操作很花費時間,可以透過線性搜索或頻繁地詢問來改善。" +"list 。一個很長的 list 的比較操作很花費時間,可以透過線性搜索或頻繁地詢問來改" +"善。" #: ../../library/bisect.rst:19 msgid "" @@ -51,6 +52,10 @@ msgid "" "only call the :meth:`__lt__` method and will return an insertion point " "between values in an array." msgstr "" +"這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它搜尋" +"特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會呼" +"叫 :meth:`__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼叫 :meth:" +"`__lt__` 方法,並在陣列中的值回傳一個插入點。" #: ../../library/bisect.rst:29 msgid "The following functions are provided:" @@ -71,15 +76,15 @@ msgstr "" "insert()`` 的第一個參數,但列表 *a* 必須先排序過。" #: ../../library/bisect.rst:41 -#, fuzzy msgid "" "The returned insertion point *ip* partitions the array *a* into two slices " "such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " "slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " "slice." msgstr "" -"回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val < x for val in a[lo : " -"i])`` 都在左側且 ``all(val >= x for val in a[i : hi])`` 都在右側。" +"回傳的插入點 *ip* 將陣列 *a* 劃分為左右兩個切片,使得對於左切片而言 " +"``all(elem < x for elem in a[lo : ip])`` 為真,對於右切片而言 ``all(elem >= " +"x for elem in a[ip : hi])`` 為真。" #: ../../library/bisect.rst:46 msgid "" @@ -92,11 +97,10 @@ msgstr "" "套用在 *x*。" #: ../../library/bisect.rst:50 -#, fuzzy msgid "" "If *key* is ``None``, the elements are compared directly and no key function " "is called." -msgstr "若 *key* 為 ``None``,則排序順位將直接以陣列中元素值決定。" +msgstr "若 *key* 為 ``None``,元素將直接進行比較,不會呼叫任何鍵函式。" #: ../../library/bisect.rst:53 ../../library/bisect.rst:67 #: ../../library/bisect.rst:85 ../../library/bisect.rst:105 @@ -112,15 +116,15 @@ msgstr "" "的後面(右邊)。" #: ../../library/bisect.rst:63 -#, fuzzy msgid "" "The returned insertion point *ip* partitions the array *a* into two slices " "such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " "slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " "slice." msgstr "" -"回傳的插入位置 *i* 將陣列 *a* 分為兩半,使得 ``all(val <= x for val in " -"a[lo : i])`` 都在左側且 ``all(val > x for val in a[i : hi])`` 都在右側。" +"回傳的插入點 *ip* 將陣列 *a* 劃分為左右兩個切片,使得對於左切片而言 " +"``all(elem <= x for elem in a[lo : ip])`` 為真,對於右切片而言 ``all(elem > " +"x for elem in a[ip : hi])`` 為真。" #: ../../library/bisect.rst:73 msgid "Insert *x* in *a* in sorted order." From 3e38b1ac2cd3335c6df45b7050f84e7300ea30b6 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Tue, 1 Aug 2023 18:08:45 +0800 Subject: [PATCH 029/105] Adds more translations of library/io (#515) * Adds more translations of library/io * Update library/io.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/io.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/io.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/io.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/io.po | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/library/io.po b/library/io.po index 2291d2cf67..738c69063a 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-07-31 18:24+0800\n" +"PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -266,6 +266,11 @@ msgid "" "`EncodingWarning` if they don't pass an ``encoding``. However, please " "consider using UTF-8 by default (i.e. ``encoding=\"utf-8\"``) for new APIs." msgstr "" +"如果你正在提供一個使用 :func:`open` 或 :class:`TextIOWrapper` 且傳遞 " +"``encoding=None`` 作為參數的 API,你可以使用 :func:`text_encoding`。如此一來" +"如果 API 的呼叫方沒有傳遞 ``encoding``,呼叫方就會發出一個 :exc:" +"`EncodingWarning`。然而,對於新的 API,請考慮預設使用 UTF-8(即 " +"``encoding=\"utf-8\"``)。" #: ../../library/io.rst:162 msgid "High-level Module Interface" @@ -277,6 +282,8 @@ msgid "" "classes. :func:`open` uses the file's blksize (as obtained by :func:`os." "stat`) if possible." msgstr "" +"一個包含模組中緩衝 I/O 類別所使用的預設緩衝區大小的整數。若可能的話,:func:" +"`open` 會使用檔案的 blksize (透過 :func:`os.stat` 取得)。" #: ../../library/io.rst:173 msgid "This is an alias for the builtin :func:`open` function." @@ -296,6 +303,9 @@ msgid "" "arguments ``path``, ``mode`` and ``flags``. The ``mode`` and ``flags`` " "arguments may have been modified or inferred from the original call." msgstr "" +"此函式會引發一個帶有引數 ``path``、``mode`` 以及 ``flags`` 的\\ :ref:`稽核事件 " +"(auditing event) ` ``open``。``mode`` 與 ``flags`` 引數可能已經被修" +"改或者從原始呼叫中被推斷出來。" #: ../../library/io.rst:184 msgid "" @@ -345,6 +355,8 @@ msgid "" "In this example, an :class:`EncodingWarning` is emitted for the caller of " "``read_text()``." msgstr "" +"在此範例中,對於 ``read_text()`` 的呼叫方會引發一個 :class:" +"`EncodingWarning`。" #: ../../library/io.rst:220 msgid "See :ref:`io-text-encoding` for more information." @@ -355,18 +367,22 @@ msgid "" ":func:`text_encoding` returns \"utf-8\" when UTF-8 mode is enabled and " "*encoding* is ``None``." msgstr "" +"當 UTF-8 模式啟用且 *encoding* 為 ``None`` 時,:func:`text_encoding` 會回傳 " +"\"utf-8\"。" #: ../../library/io.rst:231 msgid "" "This is a compatibility alias for the builtin :exc:`BlockingIOError` " "exception." -msgstr "" +msgstr "這是內建的 :exc:`BlockingIOError` 例外的相容性別名。" #: ../../library/io.rst:237 msgid "" "An exception inheriting :exc:`OSError` and :exc:`ValueError` that is raised " "when an unsupported operation is called on a stream." msgstr "" +"當在資料串流上呼叫不支援的操作時,會引發繼承自 :exc:`OSError` 與 :exc:" +"`ValueError` 的例外。" #: ../../library/io.rst:244 msgid ":mod:`sys`" @@ -377,10 +393,12 @@ msgid "" "contains the standard IO streams: :data:`sys.stdin`, :data:`sys.stdout`, " "and :data:`sys.stderr`." msgstr "" +"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:`sys." +"stderr`。" #: ../../library/io.rst:249 msgid "Class hierarchy" -msgstr "" +msgstr "類別階層" #: ../../library/io.rst:251 msgid "" @@ -438,12 +456,12 @@ msgstr "" msgid "" "Argument names are not part of the specification, and only the arguments of :" "func:`open` are intended to be used as keyword arguments." -msgstr "" +msgstr "引數名稱不是規範的一部份,只有 :func:`open` 的引數將作為關鍵字引數。" #: ../../library/io.rst:289 msgid "" "The following table summarizes the ABCs provided by the :mod:`io` module:" -msgstr "" +msgstr "以下表格總結了 :mod:`io` 模組提供的抽象基礎類別 (ABC):" #: ../../library/io.rst:294 msgid "ABC" From b54c5b225875f88b35dc4e5c13ff9005b35826ee Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:23:50 +0800 Subject: [PATCH 030/105] Update CSV Translation #188 (#553) * Update CSV Translation * Update with Reviewer's comment --- library/csv.po | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/library/csv.po b/library/csv.po index bbd0f10de3..f6fc5c0358 100644 --- a/library/csv.po +++ b/library/csv.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/csv.rst:2 msgid ":mod:`csv` --- CSV File Reading and Writing" -msgstr "" +msgstr ":mod:`csv` --- CSV 檔案讀取及寫入" #: ../../library/csv.rst:9 msgid "**Source code:** :source:`Lib/csv.py`" @@ -39,6 +39,13 @@ msgid "" "single module which can efficiently manipulate such data, hiding the details " "of reading and writing the data from the programmer." msgstr "" +"所謂的 CSV (Comma Separated Values) 檔案格式是試算表及資料庫中最常見的" +"匯入、匯出檔案格式。在嘗試以 :rfc:`4180` 中的標準化方式來描述格式之前," +"CSV 格式已經使用了許多年。由於缺少一個完善定義的標準,意味著各個不同的" +"應用程式會在資料產生及銷毀時有微妙的差別。這些不同之處使得從不同資料來源" +"處理 CSV 檔案時會非常擾人。儘管如此,雖然分隔符號和引號字元有所不同,整體的" +"格式非常相似,可以寫個單一模組來高效率的操作這樣的資料,讓程式設計師可以隱藏" +"讀取及寫入資料的細節。" #: ../../library/csv.rst:28 msgid "" @@ -56,6 +63,9 @@ msgid "" "write sequences. Programmers can also read and write data in dictionary " "form using the :class:`DictReader` and :class:`DictWriter` classes." msgstr "" +":mod:`csv` 模組的 :class:`reader` 及 :class:`writer` 物件可以讀取" +"及寫入序列。程式設計師也可以透過 :class:`DictReader` 及 :class:`DictWriter`" +" class(類別)使用 dictionary (字典)讀取及寫入資料。" #: ../../library/csv.rst:41 msgid ":pep:`305` - CSV File API" From 74743866f7427623aa844fb746271840c1dfdf8e Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 8 Aug 2023 11:45:41 +0800 Subject: [PATCH 031/105] Translate `c-api/complex.po` (#561) * translate `c-api/complex.po` * Apply suggestions from code review Co-authored-by: cschan <45995789+cschan1828@users.noreply.github.com> --------- Co-authored-by: cschan <45995789+cschan1828@users.noreply.github.com> --- c-api/complex.po | 58 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/c-api/complex.po b/c-api/complex.po index 647379d243..464482f05a 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-29 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../c-api/complex.rst:6 msgid "Complex Number Objects" -msgstr "" +msgstr "複數物件" #: ../../c-api/complex.rst:10 msgid "" @@ -29,10 +29,13 @@ msgid "" "and the other is a C structure which represents the actual complex number " "value. The API provides functions for working with both." msgstr "" +"從 C API 來看,Python 的複數物件被實作為兩種不同的型別:一種是公開給 Python " +"程式的 Python 物件,另一種是表示實際複數值的 C 結構。API 提供了與兩者一起作用" +"的函式。" #: ../../c-api/complex.rst:17 msgid "Complex Numbers as C Structures" -msgstr "" +msgstr "作為 C 結構的複數" #: ../../c-api/complex.rst:19 msgid "" @@ -40,6 +43,9 @@ msgid "" "return them as results do so *by value* rather than dereferencing them " "through pointers. This is consistent throughout the API." msgstr "" +"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by " +"value)* 執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API 中" +"都是一致的。" #: ../../c-api/complex.rst:26 msgid "" @@ -48,103 +54,116 @@ msgid "" "objects use structures of this type as input or output values, as " "appropriate. It is defined as::" msgstr "" +"相對於 Python 複數物件之數值部分的 C 結構。大多數處理複數物件的函式根據需求會" +"使用這種型別的結構作為輸入或輸出值。它定義為: ::" #: ../../c-api/complex.rst:39 msgid "" "Return the sum of two complex numbers, using the C :c:type:`Py_complex` " "representation." -msgstr "" +msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數之和。" #: ../../c-api/complex.rst:45 msgid "" "Return the difference between two complex numbers, using the C :c:type:" "`Py_complex` representation." -msgstr "" +msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的差。" #: ../../c-api/complex.rst:51 msgid "" "Return the negation of the complex number *num*, using the C :c:type:" "`Py_complex` representation." -msgstr "" +msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。" #: ../../c-api/complex.rst:57 msgid "" "Return the product of two complex numbers, using the C :c:type:`Py_complex` " "representation." -msgstr "" +msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的乘積。" #: ../../c-api/complex.rst:63 msgid "" "Return the quotient of two complex numbers, using the C :c:type:`Py_complex` " "representation." -msgstr "" +msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數的商。" #: ../../c-api/complex.rst:66 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" "c:macro:`!EDOM`." msgstr "" +"如果 *divisor* 為 null,則此方法會回傳零並將 :c:data:`errno` 設定為 :c:macro:" +"`!EDOM`。" #: ../../c-api/complex.rst:72 msgid "" "Return the exponentiation of *num* by *exp*, using the C :c:type:" "`Py_complex` representation." msgstr "" +"以 C 的 :c:type:`Py_complex` 表示形式來回傳 *num* 的 *exp* 次方的結果。" #: ../../c-api/complex.rst:75 msgid "" "If *num* is null and *exp* is not a positive real number, this method " "returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." msgstr "" +"如果 *num* 為 null 且 *exp* 不是正實數,則此方法會回傳零並將 :c:data:`errno` " +"設定為 :c:macro:`!EDOM`。" #: ../../c-api/complex.rst:80 msgid "Complex Numbers as Python Objects" -msgstr "" +msgstr "作為 Python 物件的複數" #: ../../c-api/complex.rst:85 msgid "" "This subtype of :c:type:`PyObject` represents a Python complex number object." -msgstr "" +msgstr "這個 :c:type:`PyObject` 的子型別代表一個 Python 複數物件。" #: ../../c-api/complex.rst:90 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python complex number " "type. It is the same object as :class:`complex` in the Python layer." msgstr "" +"這個 :c:type:`PyTypeObject` 的實例代表 Python 複數型別。它與 Python 層中的 :" +"class:`complex` 是同一個物件。" #: ../../c-api/complex.rst:96 msgid "" "Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" "c:type:`PyComplexObject`. This function always succeeds." msgstr "" +"如果其引數是一個 :c:type:`PyComplexObject` 或者是 :c:type:`PyComplexObject` " +"的子型別,則會回傳 true。這個函式不會失敗。" #: ../../c-api/complex.rst:102 msgid "" "Return true if its argument is a :c:type:`PyComplexObject`, but not a " "subtype of :c:type:`PyComplexObject`. This function always succeeds." msgstr "" +"如果其引數是一個 :c:type:`PyComplexObject`,但不是 :c:type:`PyComplexObject` " +"的子型別,則會回傳 true。這個函式不會失敗。" #: ../../c-api/complex.rst:108 msgid "" "Create a new Python complex number object from a C :c:type:`Py_complex` " "value." -msgstr "" +msgstr "從 C 的 :c:type:`Py_complex` 值建立一個新的 Python 複數物件。" #: ../../c-api/complex.rst:113 msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*." -msgstr "" +msgstr "從 *real* 和 *imag* 回傳一個新的 :c:type:`PyComplexObject` 物件。" #: ../../c-api/complex.rst:118 msgid "Return the real part of *op* as a C :c:expr:`double`." -msgstr "" +msgstr "以 C 的 :c:expr:`double` 形式回傳 *op* 的實部。" #: ../../c-api/complex.rst:123 msgid "Return the imaginary part of *op* as a C :c:expr:`double`." -msgstr "" +msgstr "將 *op* 的虛部作為 C 的 :c:expr:`double` 回傳。" #: ../../c-api/complex.rst:128 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." -msgstr "" +msgstr "回傳複數 *op* 的 :c:type:`Py_complex` 值。" #: ../../c-api/complex.rst:130 msgid "" @@ -155,6 +174,11 @@ msgid "" "defined then it falls back to :meth:`~object.__index__`. Upon failure, this " "method returns ``-1.0`` as a real value." msgstr "" +"如果 *op* 不是 Python 複數物件,但有一個 :meth:`~object.__complex__` 方法,則" +"首先會呼叫該方法將 *op* 轉換為 Python 複數物件。如果 :meth:`!__complex__` 並" +"未定義,那麼它會回退到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未" +"定義,則它將繼續回退為 :meth:`~object.__index__`。失敗時,此方法回傳 " +"``-1.0`` 作為實部值。" #: ../../c-api/complex.rst:137 msgid "Use :meth:`~object.__index__` if available." From e1b3c52d8c3a3db5da4bbcc03871b635a6f85cdd Mon Sep 17 00:00:00 2001 From: Jay <74105438+weijay0804@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:07:09 +0800 Subject: [PATCH 032/105] =?UTF-8?q?docs(howto/sockets.po):=20=E7=BF=BB?= =?UTF-8?q?=E8=AD=AF=20`Binary=20Data`=20=E5=92=8C=20`Disconnecting`=20?= =?UTF-8?q?=E5=8D=80=E5=A1=8A=20(#518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(howto/sockets.po): 翻譯 `Binary Data` 和 `Disconnecting` 區塊 gh-466 * docs(howto/sockets.po): 修改 文法、專有名詞 gh-466 --- howto/sockets.po | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/howto/sockets.po b/howto/sockets.po index 4f17400d73..f061aec37f 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-10 00:16+0000\n" -"PO-Revision-Date: 2023-07-19 20:17+0800\n" +"PO-Revision-Date: 2023-08-03 18:11+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -417,7 +417,7 @@ msgstr "" #: ../../howto/sockets.rst:252 msgid "Binary Data" -msgstr "" +msgstr "二進位資料" #: ../../howto/sockets.rst:254 msgid "" @@ -430,6 +430,13 @@ msgid "" "little-endian, with the least significant byte first - that same ``1`` would " "be ``01 00``." msgstr "" +"使用 socket 傳輸二進位資料完全是可行的。最主要的問題在於不同機器使用不同的二" +"進位資料格式。例如,`網路二進位順序 `_ 採用的是「大端序 big-endian」," +"所以一個值為 ``1`` 的 16 位元整數會表示成兩個 16 進位的位元組 ``00 01``。然而" +"大多數常見的處理器 (x86/AMD64,ARM,RISC-V) 採用的是「小端序 little-" +"endian」,所以相同的 ``1`` 會被表示成 ``01 00``。" +"(譯者注:將一個多位數的低位放在較小的位址處,高位放在較大的位址處,則稱小端序;反之則稱大端序。)" #: ../../howto/sockets.rst:262 msgid "" @@ -439,6 +446,10 @@ msgid "" "these do nothing, but where the machine is byte-reversed, these swap the " "bytes around appropriately." msgstr "" +"Socket 函式庫提供了用於轉換 16 位元和 32 位元整數的函式 - ``ntohl, htonl, " +"ntohs, htons``,其中 \"n\" 表示 *network*,\"h\" 表示 *host*,\"s\" 表示 " +"*short*,\"l\" 表示 *long*。當網路的位元組順序和主機位元組順序相同時,這些函" +"式不會做任何操作,但當主機的位元組順序相反時,這些函式會適當的交換位元組順序。" #: ../../howto/sockets.rst:268 msgid "" @@ -449,10 +460,14 @@ msgid "" "be 8. Of course, this doesn't fit well with fixed-length messages. " "Decisions, decisions." msgstr "" +"在現今的 64 位元機器中,二進位資料的 ASCII 表示通常會比二進位表示要小,這是因" +"為在很多情況下,大多數整數的值為 0 或者 1。例如,字串形式的 ``\"0\"`` 是兩個" +"位元組,而完整的 64 位元整數則是 8 個位元組。當然,這對固定長度的訊息來說不太" +"適合,需要自行決定。" #: ../../howto/sockets.rst:277 msgid "Disconnecting" -msgstr "" +msgstr "結束連線" #: ../../howto/sockets.rst:279 msgid "" @@ -465,6 +480,12 @@ msgid "" "same as ``shutdown(); close()``. So in most situations, an explicit " "``shutdown`` is not needed." msgstr "" +"嚴格來說,在關閉 socket 前,你應該使用 ``shutdown`` 函式。``shutdown`` 函式是" +"發送給 socket 另一端的一個提醒。根據你傳遞的引數,它可以表示「我不會再發送任" +"何訊息了,但我仍然會持續監聽」,或者是「我不會再繼續監聽了,真讚!」。然而," +"大多數的 socket 函式庫或程式設計師都習慣忽略這種禮節,因為通常情況下 " +"``close`` 跟 ``shutdown(); close()`` 是一樣的。所以在大多數情況下,不需要再特" +"地使用 ``shutdown`` 了。" #: ../../howto/sockets.rst:287 msgid "" @@ -475,6 +496,11 @@ msgid "" "complete request. The server sends a reply. If the ``send`` completes " "successfully then, indeed, the client was still receiving." msgstr "" +"有效使用 ``shutdown`` 的一種方式是在類似 HTTP 的交換中,用戶端發送請求後,然" +"後使用 ``shutdown(1)``。這告訴伺服器「這個用戶端已經發送完成,但仍可以接" +"收」。伺服器可以通過接收「零位元組」來檢測 \"EOF\"。這樣它就可以確定已經接收到" +"完整的請求。伺服器發送回覆,如果 ``send`` 成功完成,那麼用戶端確實在持續接" +"收。" #: ../../howto/sockets.rst:294 msgid "" @@ -485,6 +511,11 @@ msgid "" "indefinitely, thinking you're just being slow. *Please* ``close`` your " "sockets when you're done." msgstr "" +"Python 更進一步地採取自動關閉的步驟,並且當 socket 被垃圾回收機制回收時,如果需要" +"的話,他會自動執行 ``close``。但依賴這個機制是一個非常不好的習慣,如果你的 " +"socket 在沒有 ``close`` 的情況下消失了,那麼另一端的 socket 可能會認為你只是" +"慢了一步,而無期限的等待。*請務必* \\在使用完畢後使用 ``close`` 關閉你的 " +"sockets。" #: ../../howto/sockets.rst:302 msgid "When Sockets Die" From 94fa0249c4bbec30a5df76362c7acf8c2c3ab1c9 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Thu, 10 Aug 2023 22:32:29 +0800 Subject: [PATCH 033/105] Update Translation of CSV Module #188 (#570) * Translate with two paragraph * Fix with Reviewer's comment and typo * Add more translation for several terms * Replace some words --- library/csv.po | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/library/csv.po b/library/csv.po index f6fc5c0358..8ae6c46395 100644 --- a/library/csv.po +++ b/library/csv.po @@ -56,6 +56,11 @@ msgid "" "Excel. Programmers can also describe the CSV formats understood by other " "applications or define their own special-purpose CSV formats." msgstr "" +":mod:`csv` 模組實作透過 class 去讀取、寫入 CSV 格式的表格資料。" +"它讓程式設計師可以說出:「以 Excel 為首選並寫入該種格式的資料」或是" +"「從 Excel 產生的檔案來讀取資料」,且無需知道這是 Excel 所使用的 " +"CSV 格式等精確的細節。程式設計師也可以描述其他應用程式所理解的 CSV 格式" +"或他們自行定義具有特殊意義的 CSV 格式。" #: ../../library/csv.rst:35 msgid "" @@ -73,7 +78,7 @@ msgstr ":pep:`305` - CSV 檔案 API" #: ../../library/csv.rst:42 msgid "The Python Enhancement Proposal which proposed this addition to Python." -msgstr "" +msgstr "Python Enhancement Proposal (PEP) 所提出的 Python 附加功能。" #: ../../library/csv.rst:48 msgid "Module Contents" @@ -98,6 +103,18 @@ msgid "" "in the current dialect. For full details about the dialect and formatting " "parameters, see section :ref:`csv-fmt-params`." msgstr "" +"回傳一個讀取器物件 (reader object) 並在指定的 *csvfile* 中逐行疊代 (iterate)," +"*csvfile* 可以成為任何物件並支援 :term:`iterator` 協定,每次呼叫 " +":meth:`!__next__` method(方法)時皆會回傳一個字串," +":term:`檔案物件 (file object) ` 及串列物件 (list object) " +"皆適用。如果 *csvfile* 是個檔案物件,則需開啟時使用 ``newline=''``。" +" [1]_ *dialect* 為一個可選填的參數,可以用為特定的 CSV dialect(方言)" +" 定義一組參數。它可能為 :class:`Dialect` 的一個子類別 (subclass) 的實例" +"或是由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。" +"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中 override(覆寫)" +"獨立的格式化參數 (formatting parameter)。關於 dialect 及格式化參數的完整" +"說明,請見段落 :ref:`csv-fmt-params`。" + #: ../../library/csv.rst:71 msgid "" @@ -111,9 +128,7 @@ msgstr "" #: ../../library/csv.rst:216 msgid "A short usage example::" msgstr "" -"一個簡短的用法範例:\n" -"\n" -"::" +"一個簡短的用法範例: ::" #: ../../library/csv.rst:88 msgid "" From eb9f39f7e786bfad05d681a61f7d4ceb75969d3b Mon Sep 17 00:00:00 2001 From: mindihx Date: Fri, 11 Aug 2023 16:02:58 +0800 Subject: [PATCH 034/105] Translate howto/sorting from begin to section 'Sort Stability and Complex Sorts' (#571) * Translate howto/sorting from begin to section 'Sort Stability and Complex Sorts' * Refine translations --- howto/sorting.po | 50 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/howto/sorting.po b/howto/sorting.po index d5f50b1ced..2feb1b11fe 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 14:37+0000\n" +"PO-Revision-Date: 2023-08-09 18:16+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -45,12 +45,15 @@ msgid "" "in-place. There is also a :func:`sorted` built-in function that builds a " "new sorted list from an iterable." msgstr "" +"Python 的串列有一個內建的 :meth:`list.sort` 方法可以原地 (in-place) 排序該串" +"列,也有一個內建的 :func:`sorted` 函式可以排序可疊代物件 (iterable) 並建立一" +"個新的排序好的串列。" #: ../../howto/sorting.rst:14 msgid "" "In this document, we explore the various techniques for sorting data using " "Python." -msgstr "在此文件,我們使用Python進行各種方式排序資料" +msgstr "在這份文件裡,我們探索使用 Python 排序資料的各種方法。" #: ../../howto/sorting.rst:18 msgid "Sorting Basics" @@ -61,6 +64,8 @@ msgid "" "A simple ascending sort is very easy: just call the :func:`sorted` function. " "It returns a new sorted list:" msgstr "" +"單純的升冪排序很容易做到:只要呼叫 :func:`sorted` 函式,它會回傳一個新的串" +"列:" #: ../../howto/sorting.rst:28 msgid "" @@ -69,16 +74,21 @@ msgid "" "than :func:`sorted` - but if you don't need the original list, it's slightly " "more efficient." msgstr "" +"你也可以使用 :meth:`list.sort` 方法,它會原地排序串列(並回傳 ``None`` 以避免" +"混淆)。它通常會比 :func:`sorted` 來得不方便——但如果你不需要保留原始串列的" +"話,它會稍微有效率一點。" #: ../../howto/sorting.rst:40 msgid "" "Another difference is that the :meth:`list.sort` method is only defined for " "lists. In contrast, the :func:`sorted` function accepts any iterable." msgstr "" +"另一個差異是 :meth:`list.sort` 方法只有定義在串列上,而 :func:`sorted` 函式可" +"以接受任何可疊代物件。" #: ../../howto/sorting.rst:49 msgid "Key Functions" -msgstr "" +msgstr "鍵函式 (key functions)" #: ../../howto/sorting.rst:51 msgid "" @@ -86,10 +96,12 @@ msgid "" "a function (or other callable) to be called on each list element prior to " "making comparisons." msgstr "" +":meth:`list.sort` 和 :func:`sorted` 都有一個參數 *key* 可以指定一個函式(或其" +"它可呼叫物件 (callable)),這個函式會在每個串列元素做比較前被呼叫。" #: ../../howto/sorting.rst:55 msgid "For example, here's a case-insensitive string comparison:" -msgstr "" +msgstr "例如這裡有一個不區分大小寫的字串比對:" #: ../../howto/sorting.rst:62 msgid "" @@ -98,21 +110,25 @@ msgid "" "This technique is fast because the key function is called exactly once for " "each input record." msgstr "" +"參數 *key* 的值必須是一個函式(或其它可呼叫物件),且這個函式接受單一引數並回" +"傳一個用來排序的鍵。因為對每個輸入來說鍵函式只會被呼叫一次,所以這個做法是快" +"速的。" #: ../../howto/sorting.rst:67 msgid "" "A common pattern is to sort complex objects using some of the object's " "indices as keys. For example:" msgstr "" +"一個常見的模式是在排序複雜物件的時候使用一部分物件的索引值當作鍵,例如:" #: ../../howto/sorting.rst:80 msgid "" "The same technique works for objects with named attributes. For example:" -msgstr "" +msgstr "相同的做法也適用在有命名屬性的物件,例如:" #: ../../howto/sorting.rst:101 msgid "Operator Module Functions" -msgstr "" +msgstr "Operator 模組的函式" #: ../../howto/sorting.rst:103 msgid "" @@ -121,16 +137,20 @@ msgid "" "`operator` module has :func:`~operator.itemgetter`, :func:`~operator." "attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" +"上述的鍵函式模式非常常見,所以 Python 提供了方便的函式讓物件存取更簡單且快" +"速。:mod:`operator` 模組裡有 :func:`~operator.itemgetter`、:func:" +"`~operator.attrgetter` 及 :func:`~operator.methodcaller` 函式可以使用。" #: ../../howto/sorting.rst:108 msgid "Using those functions, the above examples become simpler and faster:" -msgstr "" +msgstr "使用這些函式讓上面的範例變得更簡單且快速:" #: ../../howto/sorting.rst:120 msgid "" "The operator module functions allow multiple levels of sorting. For example, " "to sort by *grade* then by *age*:" msgstr "" +"operator 模組的函式允許多層的排序,例如先用 *grade* 排序再用 *age* 排序:" #: ../../howto/sorting.rst:132 msgid "Ascending and Descending" @@ -142,10 +162,12 @@ msgid "" "a boolean value. This is used to flag descending sorts. For example, to get " "the student data in reverse *age* order:" msgstr "" +":meth:`list.sort` 和 :func:`sorted` 都有一個 boolean 參數 *reverse* 用來表示" +"是否要降冪排序。例如將學生資料依據 *age* 做降冪排序:" #: ../../howto/sorting.rst:147 msgid "Sort Stability and Complex Sorts" -msgstr "" +msgstr "排序穩定性與複合排序" #: ../../howto/sorting.rst:149 msgid "" @@ -153,12 +175,17 @@ msgid "" "Sorting_algorithm#Stability>`_\\. That means that when multiple records have " "the same key, their original order is preserved." msgstr "" +"排序保證是\\ `穩定的 `_\\ ,意思是當有多筆資料有相同的鍵,它們會維持原" +"來的順序。" #: ../../howto/sorting.rst:159 msgid "" "Notice how the two records for *blue* retain their original order so that " "``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." msgstr "" +"可以注意到有兩筆資料的鍵都是 *blue*,它們會維持本來的順序,即 ``('blue', " +"1)`` 保證在 ``('blue', 2)`` 前面。" #: ../../howto/sorting.rst:162 msgid "" @@ -166,12 +193,17 @@ msgid "" "steps. For example, to sort the student data by descending *grade* and then " "ascending *age*, do the *age* sort first and then sort again using *grade*:" msgstr "" +"這個美妙的特性讓你可以用一連串的排序來作出複合排序。例如對學生資料用 *grade* " +"做降冪排序再用 *age* 做升冪排序,你可以先用 *age* 排序一遍再用 *grade* 排序一" +"遍:" #: ../../howto/sorting.rst:172 msgid "" "This can be abstracted out into a wrapper function that can take a list and " "tuples of field and order to sort them on multiple passes." msgstr "" +"這可以抽出一個包裝函式 (wrapper function),接受一個串列及多個欄位及升降冪的元" +"組為引數,來對這個串列排序多遍。" #: ../../howto/sorting.rst:185 msgid "" @@ -179,6 +211,8 @@ msgid "" "Python does multiple sorts efficiently because it can take advantage of any " "ordering already present in a dataset." msgstr "" +"Python 裡使用的 `Timsort `_ 演算法,因" +"為能利用資料集裡已經有的順序,可以有效率地做多次排序。" #: ../../howto/sorting.rst:190 msgid "Decorate-Sort-Undecorate" From b1ec9540973091d3f3557aa23aafbecd2bc994a2 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sat, 12 Aug 2023 12:40:11 +0800 Subject: [PATCH 035/105] Translate `library/__future__.po` (#574) * feat: translate `library/__future__.po` * fix library/__future__.po based on review comments --- library/__future__.po | 78 ++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/library/__future__.po b/library/__future__.po index bcca6e9a8f..7ed9891f84 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \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" +"PO-Revision-Date: 2023-08-11 02:12+0000\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/__future__.rst:2 msgid ":mod:`__future__` --- Future statement definitions" -msgstr "" +msgstr ":mod:`__future__` --- Future 陳述式定義" #: ../../library/__future__.rst:7 msgid "**Source code:** :source:`Lib/__future__.py`" @@ -28,13 +28,13 @@ msgstr "**原始碼:**\\ :source:`Lib/__future__.py`" #: ../../library/__future__.rst:11 msgid ":mod:`__future__` is a real module, and serves three purposes:" -msgstr "" +msgstr ":mod:`__future__` 是一個真正的模組,有三個用途:" #: ../../library/__future__.rst:13 msgid "" "To avoid confusing existing tools that analyze import statements and expect " "to find the modules they're importing." -msgstr "" +msgstr "為了避免混淆分析引入陳述式並預期要找到它們正在引入之模組的現有工具。" #: ../../library/__future__.rst:16 msgid "" @@ -42,6 +42,9 @@ msgid "" "2.1 at least yield runtime exceptions (the import of :mod:`__future__` will " "fail, because there was no module of that name prior to 2.1)." msgstr "" +"確保 :ref:`future 陳述式 `\\ 在 2.1 之前的版本中運行至少會產生 " +"runtime 例外( :mod:`__future__` 的引入將會失敗,因為 2.1 之前沒有該名稱的模" +"組)。" #: ../../library/__future__.rst:20 msgid "" @@ -50,22 +53,26 @@ msgid "" "and can be inspected programmatically via importing :mod:`__future__` and " "examining its contents." msgstr "" +"記錄何時出現不相容的變更,以及何時開始強制執行這些變更。這是一種可執行文件的" +"形式,可以透過引入 :mod:`__future__` 並檢查其內容以程式化的方式進行檢查。" #: ../../library/__future__.rst:25 msgid "Each statement in :file:`__future__.py` is of the form::" -msgstr "" +msgstr ":file:`__future__.py` 中的每個陳述式的形式如下: ::" #: ../../library/__future__.rst:31 msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " "are 5-tuples of the same form as :data:`sys.version_info`::" msgstr "" +"通常,*OptionalRelease* 會小於 *MandatoryRelease*,且兩者都是與 :data:`sys." +"version_info` 形式相同的 5 元組 (5-tuple): ::" #: ../../library/__future__.rst:41 msgid "" "*OptionalRelease* records the first release in which the feature was " "accepted." -msgstr "" +msgstr "*OptionalRelease* 記錄該功能首次發布時的 Python 版本。" #: ../../library/__future__.rst:43 msgid "" @@ -73,6 +80,8 @@ msgid "" "*MandatoryRelease* predicts the release in which the feature will become " "part of the language." msgstr "" +"如果 *MandatoryRelease* 尚未發布,*MandatoryRelease* 會預測該功能將成為該語言" +"一部分的版本。" #: ../../library/__future__.rst:47 msgid "" @@ -81,18 +90,22 @@ msgid "" "statement to use the feature in question, but may continue to use such " "imports." msgstr "" +"否則 *MandatoryRelease* 會記錄該功能是何時成為語言的一部分;在該版本或之後的" +"版本中,模組不再需要 future 聲明來使用相關功能,但可以繼續使用此種引入方式。" #: ../../library/__future__.rst:51 msgid "" "*MandatoryRelease* may also be ``None``, meaning that a planned feature got " "dropped." -msgstr "" +msgstr "*MandatoryRelease* 也可能是 ``None``,這意味著計劃中的功能被丟棄。" #: ../../library/__future__.rst:54 msgid "" "Instances of class :class:`_Feature` have two corresponding methods, :meth:" "`getOptionalRelease` and :meth:`getMandatoryRelease`." msgstr "" +":class:`_Feature` 類別的實例有兩個相應的方法::meth:`getOptionalRelease` 和 :" +"meth:`getMandatoryRelease`。" #: ../../library/__future__.rst:57 msgid "" @@ -101,6 +114,9 @@ msgid "" "dynamically compiled code. This flag is stored in the :attr:`compiler_flag` " "attribute on :class:`_Feature` instances." msgstr "" +"*CompilerFlag* 是(位元欄位 (bitfield))旗標,應在第四個引數中傳遞給內建函" +"式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標存儲在 :class:" +"`_Feature` 實例上的 :attr:`compiler_flag` 屬性中。" #: ../../library/__future__.rst:62 msgid "" @@ -108,22 +124,24 @@ msgid "" "its introduction in Python 2.1 the following features have found their way " "into the language using this mechanism:" msgstr "" +"不會從 :mod:`__future__` 中刪除任何功能描述。自從在 Python 2.1 中引入以來,以" +"下功能已透過這種機制引入到該語言中:" #: ../../library/__future__.rst:67 msgid "feature" -msgstr "" +msgstr "功能" #: ../../library/__future__.rst:67 msgid "optional in" -msgstr "" +msgstr "可選的版本" #: ../../library/__future__.rst:67 msgid "mandatory in" -msgstr "" +msgstr "強制性的版本" #: ../../library/__future__.rst:67 msgid "effect" -msgstr "" +msgstr "影響" #: ../../library/__future__.rst:69 msgid "nested_scopes" @@ -139,11 +157,11 @@ msgstr "2.2" #: ../../library/__future__.rst:69 msgid ":pep:`227`: *Statically Nested Scopes*" -msgstr "" +msgstr ":pep:`227`: *靜態巢狀作用域 (Statically Nested Scopes)*" #: ../../library/__future__.rst:72 msgid "generators" -msgstr "" +msgstr "generators" #: ../../library/__future__.rst:72 msgid "2.2.0a1" @@ -155,11 +173,11 @@ msgstr "2.3" #: ../../library/__future__.rst:72 msgid ":pep:`255`: *Simple Generators*" -msgstr "" +msgstr ":pep:`255`: *簡單產生器 (Simple Generators)*" #: ../../library/__future__.rst:75 msgid "division" -msgstr "" +msgstr "division" #: ../../library/__future__.rst:75 msgid "2.2.0a2" @@ -172,7 +190,7 @@ msgstr "3.0" #: ../../library/__future__.rst:75 msgid ":pep:`238`: *Changing the Division Operator*" -msgstr "" +msgstr ":pep:`238`: *更改除法運算子 (Changing the Division Operator)*" #: ../../library/__future__.rst:78 msgid "absolute_import" @@ -185,6 +203,8 @@ msgstr "2.5.0a1" #: ../../library/__future__.rst:78 msgid ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" msgstr "" +":pep:`328`: *引入:多列與絕對/相對 (Imports: Multi-Line and Absolute/" +"Relative)*" #: ../../library/__future__.rst:81 msgid "with_statement" @@ -196,7 +216,7 @@ msgstr "2.6" #: ../../library/__future__.rst:81 msgid ":pep:`343`: *The \"with\" Statement*" -msgstr "" +msgstr ":pep:`343`: *\"with\" 陳述式 (The \"with\" Statement)*" #: ../../library/__future__.rst:84 msgid "print_function" @@ -208,7 +228,7 @@ msgstr "2.6.0a2" #: ../../library/__future__.rst:84 msgid ":pep:`3105`: *Make print a function*" -msgstr "" +msgstr ":pep:`3105`: *使 print 成為一個函式 (Make print a function)*" #: ../../library/__future__.rst:87 msgid "unicode_literals" @@ -217,6 +237,7 @@ msgstr "unicode_literals" #: ../../library/__future__.rst:87 msgid ":pep:`3112`: *Bytes literals in Python 3000*" msgstr "" +":pep:`3112`: *Python 3000 中的位元組字面值 (Bytes literals in Python 3000)*" #: ../../library/__future__.rst:90 msgid "generator_stop" @@ -233,10 +254,12 @@ msgstr "3.7" #: ../../library/__future__.rst:90 msgid ":pep:`479`: *StopIteration handling inside generators*" msgstr "" +":pep:`479`: *產生器內部的 StopIteration 處理 (StopIteration handling inside " +"generators)*" #: ../../library/__future__.rst:93 msgid "annotations" -msgstr "" +msgstr "annotations" #: ../../library/__future__.rst:93 msgid "3.7.0b1" @@ -248,7 +271,7 @@ msgstr "TBD [1]_" #: ../../library/__future__.rst:93 msgid ":pep:`563`: *Postponed evaluation of annotations*" -msgstr "" +msgstr ":pep:`563`: *推遲對註釋的求值 (Postponed evaluation of annotations)*" #: ../../library/__future__.rst:100 msgid "" @@ -260,6 +283,13 @@ msgid "" "python-dev@python.org/message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__). No " "final decision has been made yet. See also :pep:`563` and :pep:`649`." msgstr "" +"之前原本計劃在 Python 3.10 中強制使用 ``from __future__ import " +"annotations``,但 Python 指導委員會 (Python Steering Council) 兩次決議推遲這" +"一變動(`Python 3.10 的公告 `__;`Python 3.11 的" +"公告 `__)。目前還尚未做出決定。另請參閱 :pep:" +"`563` 和 :pep:`649`。" #: ../../library/__future__.rst:110 msgid ":ref:`future`" @@ -267,4 +297,4 @@ msgstr ":ref:`future`" #: ../../library/__future__.rst:111 msgid "How the compiler treats future imports." -msgstr "" +msgstr "編譯器如何處理 future 引入。" From f89b3897543773a40efd5698511241bd7a8b816b Mon Sep 17 00:00:00 2001 From: bananaiselite <70698133+bananaiselite@users.noreply.github.com> Date: Sun, 13 Aug 2023 21:53:43 +0800 Subject: [PATCH 036/105] Translate extending/building.po rst:7 and rst:9 (#557) * Translate extending/building.po rst:7 and rst:9 * modify language and correct the format. * rst:9 format modifying * new commit * Delete iterator.po * new commit * new modification --------- Co-authored-by: bananaiselite --- extending/building.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extending/building.po b/extending/building.po index e638c4f94d..83ef47cbff 100644 --- a/extending/building.po +++ b/extending/building.po @@ -20,13 +20,15 @@ msgstr "" #: ../../extending/building.rst:7 msgid "Building C and C++ Extensions" -msgstr "" +msgstr "建立 C 與 C++ 擴充套件" #: ../../extending/building.rst:9 msgid "" "A C extension for CPython is a shared library (e.g. a ``.so`` file on Linux, " "``.pyd`` on Windows), which exports an *initialization function*." msgstr "" +"一個 CPython 的 C 擴充套件是一個共用函式庫(例如在 Linux 上的 ``.so`` 檔案," +"在 Windows 上的 ``.pyd``),會匯出一個\\ *初始化函式*。" #: ../../extending/building.rst:12 msgid "" From 46d082cae5442a819df6f85d4dc0aec68c092b59 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Mon, 14 Aug 2023 21:44:57 +0800 Subject: [PATCH 037/105] Translation from Aug 5th meetup (#554) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * /library/datetime.rst:2485 (#549) * Translate datetime.rst:754 (#548) * datetime.rst:754 * Apply suggestions from code review * translate datetime.rst:196 (#545) * git commit rst:157 translate (#535) * feat(translate): json.po line 323 to tranditional chinese (#532) * Datetime/upstream/3.12 (#550) * translate-datetime.rst:2369 * datetime-2369-fixed-by-reviewer --------- Co-authored-by: Dai Stella Co-authored-by: Wei-Hsiang (Matt) Wang * translate `library/datetime.rst:2619` (#524) * docs: translate footnote 1 * fix: translate msg * fix: translate of Relativity * Add translations to `library/json` rst:26 and rst:29 (#537) * Add translations to `library/json` rst:26 and rst:29 * fix literal code block marker * Update library/json.po Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> --------- Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * translate json title (#523) * Add translation for library/json (#555) * Add translation for library/json * Fix using single backslash to escape space * Translate library/datetime.rst:124 (#543) * Translate library/datetime.rst:124 * Apply suggestions from code review Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * Update datetime.po * Update datetime.po --------- Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * Add translation for library/json (#527) * Add translation for library/json * Refine sentence in library/json * :memo: docs(3.12): translate library/json.rst:63 (#542) * :memo: docs(3.12): translate library/json.rst:63 for procedure test purpose, translate /library/json.rst:63 * :memo: docs(3.12): translate library/json.rst:63 通順語句與空格修正 * :memo: docs(3.12): translate library/json.rst:63 fix rst issue --------- Co-authored-by: 鄭宇辰 Co-authored-by: Wei-Hsiang (Matt) Wang * Translate library/datetime.rst:2501 (#526) * Translate library/datetime.rst:2501 * Translate library/datetime.rst:2501, remove spaces * Update library/datetime.rst:2501, punctuation mark * Update library/datetime.rst:2501, 'format code' * Update library/datetime.rst:2505 --------- Co-authored-by: Wei-Hsiang (Matt) Wang * Translated the weekday sentence (#534) * Translated the weekday sentence * Modified the error * Update library/datetime.po --------- Co-authored-by: 李逸帆 Co-authored-by: Wei-Hsiang (Matt) Wang * Translate datetime rst: 709 (#539) * Translate datetime rst: 709 * Update library/datetime.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang * translate datetime.rst:872 (#540) * translate datetime.rst:872 * Update library/datetime.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang * translated 'check reference' is Falses841u0 (#525) * translated 'check reference' is Falses841u0 * 依建議改為將'視為'改為'設為' * Update library/json.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang * New branch2 (#544) * git commit rst:157 translate * 改rst:179 * Update library/datetime.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: isabellechiu <39623214+isabellechiu@users.noreply.github.com> Co-authored-by: Song-Lin Tsai <55531306+Bradley-Tsai@users.noreply.github.com> Co-authored-by: ccchian <72912233+ccchian@users.noreply.github.com> Co-authored-by: neo <71454430+neo-maker-sudo@users.noreply.github.com> Co-authored-by: ai.Stella <63219262+estelladai@users.noreply.github.com> Co-authored-by: Dai Stella Co-authored-by: Simon Chu Co-authored-by: Yu-Sheng Li Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> Co-authored-by: mindihx Co-authored-by: 933yee <92087014+933yee@users.noreply.github.com> Co-authored-by: Payon Co-authored-by: 鄭宇辰 Co-authored-by: Griiid Co-authored-by: Ivan Lee Co-authored-by: 李逸帆 Co-authored-by: Yang_yang <31895597+Yang92047111@users.noreply.github.com> Co-authored-by: PinErh Chen Co-authored-by: Nick (Shun-Fu) Hu --- library/datetime.po | 36 +++++++++++++++++++++++++++++------- library/json.po | 30 +++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index ae13bec8e3..3f4ecc4e75 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2018-05-23 14:42+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-08-07 10:20+0800\n" +"Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: 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.3.2\n" #: ../../library/datetime.rst:2 msgid ":mod:`datetime` --- Basic date and time types" @@ -175,6 +176,8 @@ msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." msgstr "" +"表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" +"異,以微秒為解析度。" #: ../../library/datetime.rst:131 msgid "" @@ -200,7 +203,7 @@ msgstr "" #: ../../library/datetime.rst:157 msgid "Common Properties" -msgstr "" +msgstr "常見屬性" #: ../../library/datetime.rst:159 msgid "" @@ -247,7 +250,7 @@ msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" #: ../../library/datetime.rst:179 msgid "Otherwise, *d* is naive." -msgstr "" +msgstr "否則 *d* 會是 naive 的。" #: ../../library/datetime.rst:181 msgid "A :class:`.time` object *t* is aware if both of the following hold:" @@ -280,6 +283,7 @@ msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" +"一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" #: ../../library/datetime.rst:201 msgid "" @@ -931,6 +935,8 @@ msgid "" "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" +"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。" +"例如 ``date(2002, 12, 4).weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" #: ../../library/datetime.rst:678 msgid "" @@ -973,6 +979,9 @@ msgstr "" msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" +"回傳一以 ISO 8601 格式 ``YYYY-MM-DD`` 表示的日期字串:\n" +"\n" +"::" #: ../../library/datetime.rst:717 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." @@ -1019,6 +1028,9 @@ msgstr "用法範例:\\ :class:`date`" #: ../../library/datetime.rst:754 msgid "Example of counting days to an event::" msgstr "" +"計算一個事件的天數的範例: \n" +"\n" +"::" #: ../../library/datetime.rst:773 msgid "More examples of working with :class:`date`:" @@ -1122,6 +1134,9 @@ msgid "" "going through a :func:`time.time` timestamp (for example, this may be " "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" +"如果選用的引數 *tz* 為 ``None`` 或未指定,則會像是 :meth:`today`,但盡可能提" +"供比透過 :func:`time.time` 取得的時間戳記更多位數的資訊(例如,這在有提供 C " +":c:func:`gettimeofday` 函式的平台上可能可行)。" #: ../../library/datetime.rst:878 msgid "" @@ -2652,7 +2667,7 @@ msgstr "``%m``" #: ../../library/datetime.rst:2369 msgid "Month as a zero-padded decimal number." -msgstr "" +msgstr "以零填充的並以十進位數字表示的月份。" #: ../../library/datetime.rst:2369 ../../library/datetime.rst:2381 msgid "01, 02, ..., 12" @@ -2992,7 +3007,7 @@ msgstr "" #: ../../library/datetime.rst:2483 msgid "Technical Detail" -msgstr "" +msgstr "技術細節" #: ../../library/datetime.rst:2485 msgid "" @@ -3019,13 +3034,18 @@ msgid "" "by ``time.strptime``." msgstr "" +# format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) #: ../../library/datetime.rst:2501 +#, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " "anyway, ``1900`` is substituted for the year, and ``1`` for the month and " "day." msgstr "" +"對 :class:`.time` 物件來說,不應該使用年、月、日的格式碼 (format code),因" +"為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" +"替、月及日會以 ``1`` 代替。" #: ../../library/datetime.rst:2505 msgid "" @@ -3033,6 +3053,8 @@ msgid "" "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" +"對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" +"`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" #: ../../library/datetime.rst:2509 msgid "" @@ -3188,7 +3210,7 @@ msgstr "註解" #: ../../library/datetime.rst:2619 msgid "If, that is, we ignore the effects of Relativity" -msgstr "" +msgstr "也就是說,我們會忽略相對論的效應" #: ../../library/datetime.rst:2621 msgid "" diff --git a/library/json.po b/library/json.po index bca98e8f85..34790dc35c 100644 --- a/library/json.po +++ b/library/json.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-29 10:36+0000\n" -"PO-Revision-Date: 2018-05-23 16:04+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-08-05 15:25+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -18,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/json.rst:2 msgid ":mod:`json` --- JSON encoder and decoder" -msgstr "" +msgstr ":mod:`json` --- JSON 編碼器與解碼器" #: ../../library/json.rst:10 msgid "**Source code:** :source:`Lib/json/__init__.py`" @@ -36,6 +37,12 @@ msgid "" "wikipedia.org/wiki/JavaScript>`_ object literal syntax (although it is not a " "strict subset of JavaScript [#rfc-errata]_ )." msgstr "" +"`JSON (JavaScript Object Notation) `_ 是一個輕量化的資料交" +"換格式,在 :rfc:`7159`\\ (其廢棄了 :rfc:`4627`\\ )及 `ECMA-404 `_ " +"裡面有詳細說明,它啟發自 `JavaScript `_ 的物件字面語法 (object literal syntax)(雖然它並不是 " +"JavaScript 的嚴格子集 [#rfc-errata]_\\ )。" #: ../../library/json.rst:22 msgid "" @@ -43,16 +50,23 @@ msgid "" "string may cause the decoder to consume considerable CPU and memory " "resources. Limiting the size of data to be parsed is recommended." msgstr "" +"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致" +"解碼器耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" #: ../../library/json.rst:26 msgid "" ":mod:`json` exposes an API familiar to users of the standard library :mod:" "`marshal` and :mod:`pickle` modules." msgstr "" +":mod:`json` 為標準函式庫 :mod:`marshal` 與 :mod:`pickle` 模組的使用者提供熟悉" +"的 API。" #: ../../library/json.rst:29 msgid "Encoding basic Python object hierarchies::" msgstr "" +"對基本 Python 物件階層進行編碼:\n" +"\n" +"::" #: ../../library/json.rst:48 msgid "Compact encoding::" @@ -65,6 +79,9 @@ msgstr "美化輸出:" #: ../../library/json.rst:63 msgid "Decoding JSON::" msgstr "" +"JSON 解碼:\n" +"\n" +"::" #: ../../library/json.rst:75 msgid "Specializing JSON object decoding::" @@ -133,6 +150,9 @@ msgid "" "reference check for container types will be skipped and a circular reference " "will result in a :exc:`RecursionError` (or worse)." msgstr "" +"如果 *chech_circular* 設為 false(預設是 ``True``),則針對不同容器型別的循環" +"參照 (circular reference) 的檢查將會被跳過,若有循環參照則最後將引發 :exc:" +"`RecursionError` (或者更糟的錯誤)。" #: ../../library/json.rst:162 msgid "" @@ -320,7 +340,7 @@ msgstr "" #: ../../library/json.rst:299 msgid "The keyword argument *encoding* has been removed." -msgstr "" +msgstr "關鍵字引數 *encoding* 已經被刪除。" #: ../../library/json.rst:304 msgid "Encoders and Decoders" @@ -693,7 +713,7 @@ msgstr "" #: ../../library/json.rst:630 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." -msgstr "" +msgstr "*object_parts_hook* 參數可以被使用來改變此行為。" #: ../../library/json.rst:634 msgid "Top-level Non-Object, Non-Array Values" From e468d6737c280d3a6e4724f34da6e84283b0fd5d Mon Sep 17 00:00:00 2001 From: Simon Chu Date: Tue, 15 Aug 2023 13:40:31 +0800 Subject: [PATCH 038/105] docs: translate bytearray.po (#577) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: translate bytearray.po * fix: translated words * fix: style format * fix: row length * fix: remove blank * fix: "Resize the internal buffer of *bytearray* to *len*." * fix: rename to "位元組陣列" * fix: rename "子型別" * fix: rename "instance" to "實例" and "type" to "型別" * fix: capitalization * Update c-api/bytearray.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- c-api/bytearray.po | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 377d1c7c3d..15d1dc4bfb 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" +"PO-Revision-Date: 2023-08-12 11:42+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,72 +17,84 @@ 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.3.2\n" #: ../../c-api/bytearray.rst:6 msgid "Byte Array Objects" -msgstr "位元組串列物件 (Byte Array Objects)" +msgstr "位元組陣列物件 (Byte Array Objects)" #: ../../c-api/bytearray.rst:13 msgid "" "This subtype of :c:type:`PyObject` represents a Python bytearray object." -msgstr "" +msgstr "這個 :c:type:`PyObject` 的子型別代表了 Python 的位元組陣列物件。" #: ../../c-api/bytearray.rst:18 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python bytearray " "type; it is the same object as :class:`bytearray` in the Python layer." msgstr "" +"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python 層" +"中的 :class:`bytearray` 為同一個物件。" #: ../../c-api/bytearray.rst:23 msgid "Type check macros" -msgstr "" +msgstr "型別檢查巨集" #: ../../c-api/bytearray.rst:27 msgid "" "Return true if the object *o* is a bytearray object or an instance of a " "subtype of the bytearray type. This function always succeeds." msgstr "" +"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳真" +"值。此函式總是會成功執行。" #: ../../c-api/bytearray.rst:33 msgid "" "Return true if the object *o* is a bytearray object, but not an instance of " "a subtype of the bytearray type. This function always succeeds." msgstr "" +"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳真" +"值。此函式總是會成功執行。" #: ../../c-api/bytearray.rst:38 msgid "Direct API functions" -msgstr "" +msgstr "直接 API 函式" #: ../../c-api/bytearray.rst:42 msgid "" "Return a new bytearray object from any object, *o*, that implements the :ref:" "`buffer protocol `." msgstr "" +"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協議 (buffer " +"protocol) `\\ 。" #: ../../c-api/bytearray.rst:48 msgid "" "Create a new bytearray object from *string* and its length, *len*. On " "failure, ``NULL`` is returned." msgstr "" +"從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。若失敗則回傳 ``NULL``。" #: ../../c-api/bytearray.rst:54 msgid "" "Concat bytearrays *a* and *b* and return a new bytearray with the result." -msgstr "" +msgstr "連接位元組陣列 *a* 和 *b*,並回傳一個包含結果的新位元組陣列。" #: ../../c-api/bytearray.rst:59 msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." -msgstr "" +msgstr "在檢查為 ``NULL`` 指標後,回傳 *bytearray* 的大小。" #: ../../c-api/bytearray.rst:64 msgid "" "Return the contents of *bytearray* as a char array after checking for a " "``NULL`` pointer. The returned array always has an extra null byte appended." msgstr "" +"在檢查是否為 ``NULL`` 指標後,將 *bytearray* 的內容回傳為字元陣列。回傳的陣列" +"總是會多附加一個空位元組。" #: ../../c-api/bytearray.rst:71 msgid "Resize the internal buffer of *bytearray* to *len*." -msgstr "" +msgstr "將 *bytearray* 的內部緩衝區大小調整為 *len*。" #: ../../c-api/bytearray.rst:74 msgid "Macros" @@ -90,15 +102,15 @@ msgstr "巨集" #: ../../c-api/bytearray.rst:76 msgid "These macros trade safety for speed and they don't check pointers." -msgstr "" +msgstr "這些巨集犧牲了安全性以換取速度,並且它們不會檢查指標。" #: ../../c-api/bytearray.rst:80 msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking." -msgstr "" +msgstr "與 :c:func:`PyByteArray_AsString` 類似,但沒有錯誤檢查。" #: ../../c-api/bytearray.rst:85 msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." -msgstr "" +msgstr "與 :c:func:`PyByteArray_Size` 類似,但沒有錯誤檢查。" #: ../../c-api/bytearray.rst:8 msgid "object" @@ -106,4 +118,4 @@ msgstr "object(物件)" #: ../../c-api/bytearray.rst:8 msgid "bytearray" -msgstr "bytearray(位元組串列)" +msgstr "bytearray(位元組陣列)" From be48283f2e54635b4b1a4aae86d4a5b526562feb Mon Sep 17 00:00:00 2001 From: isabellechiu <39623214+isabellechiu@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:16:28 +0800 Subject: [PATCH 039/105] translate library/email.charset.rst:2-22 (#576) * translate library/email.charset.rst:2-22 * email.charset:fix rst:2-22 --- library/email.charset.po | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/email.charset.po b/library/email.charset.po index bd49436a4e..72c705d2cd 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/email.charset.rst:2 msgid ":mod:`email.charset`: Representing character sets" -msgstr "" +msgstr ":mod:`email.charset`: 表示字元集合" #: ../../library/email.charset.rst:7 msgid "**Source code:** :source:`Lib/email/charset.py`" @@ -31,12 +31,15 @@ msgid "" "This module is part of the legacy (``Compat32``) email API. In the new API " "only the aliases table is used." msgstr "" +"此模組是舊版 (``Compat32``) email API的其中一部份,在新版的 API " +"只有使用別名表。" #: ../../library/email.charset.rst:14 msgid "" "The remaining text in this section is the original documentation of the " "module." msgstr "" +"此章節的其餘文字是原始模組的說明文件" #: ../../library/email.charset.rst:16 msgid "" @@ -46,10 +49,13 @@ msgid "" "Instances of :class:`Charset` are used in several other modules within the :" "mod:`email` package." msgstr "" +"此模組提供一個 class(類別) :class:`Charset` 來表示電子郵件中的字元" +"集合和字元集合轉換,以及字元集合登錄檔 (registry) 和其他許多便捷的方法以運用此登錄檔。" +"在 :mod:`email` 套件中有許多其他模組使用 :class:`Charset` 的實例。" #: ../../library/email.charset.rst:22 msgid "Import this class from the :mod:`email.charset` module." -msgstr "" +msgstr "從 :mod:`email.charset` 模組中 import 此類別" #: ../../library/email.charset.rst:27 msgid "Map character sets to their email properties." From 732575d696e42a6732716b795a0fc310a90aa558 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Tue, 15 Aug 2023 20:53:11 +0800 Subject: [PATCH 040/105] Translate CSV Module rst:71 to rst:152 (#582) * Translate rst:71 to rst:152 * Update with Reviewer's comment * HOTFIX --- library/csv.po | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/library/csv.po b/library/csv.po index 8ae6c46395..8b742a9fca 100644 --- a/library/csv.po +++ b/library/csv.po @@ -111,8 +111,8 @@ msgstr "" " [1]_ *dialect* 為一個可選填的參數,可以用為特定的 CSV dialect(方言)" " 定義一組參數。它可能為 :class:`Dialect` 的一個子類別 (subclass) 的實例" "或是由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。" -"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中 override(覆寫)" -"獨立的格式化參數 (formatting parameter)。關於 dialect 及格式化參數的完整" +"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中覆寫 (override) " +"個別的格式化參數 (formatting parameter)。關於 dialect 及格式化參數的完整" "說明,請見段落 :ref:`csv-fmt-params`。" @@ -123,6 +123,9 @@ msgid "" "format option is specified (in which case unquoted fields are transformed " "into floats)." msgstr "" +"從 CSV 檔案讀取的每一列會回傳為一個字串列表。除非格式選項 " +"``QUOTE_NONNUMERIC`` 有被指定(在這個情況之下,沒有引號的欄位" +"都會被轉換成浮點數),否則不會進行自動資料型別轉換。" #: ../../library/csv.rst:75 ../../library/csv.rst:105 ../../library/csv.rst:178 #: ../../library/csv.rst:216 @@ -149,6 +152,19 @@ msgid "" "returned from a ``cursor.fetch*`` call. All other non-string data are " "stringified with :func:`str` before being written." msgstr "" +"回傳一個寫入器物件 (writer object),其負責在給定的類檔案物件 (file-like " +"object) 上將使用者的資料轉換為分隔字串 (delimited string)。*csvfile* 可以為" +"具有 :func:`write` method 的任何物件。若 *csvfile* 為一個檔案物件,它應該使用" +" ``newline=''`` 開啟 [1]_ 。*dialect* 為一個可選填的參數,可以用為特定的" +" CSV dialect 定義一組參數。它可能為 :class:`Dialect` 的一個子類別的實例" +"或是由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。" +"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中覆寫" +"個別的格式化參數。關於 dialect 及格式化參數的完整說明,請見段落" +" :ref:`csv-fmt-params`。為了更容易與有實作 DB API 的模組互相接合," +":const:`None` 值會被寫成空字串。雖然這不是一個可逆的變換,這使得" +"dump (傾印) SQL NULL 資料值到 CSV 檔案上就無需讓 ``cursor.fetch*`` " +"呼叫回傳的資料進行預處理 (preprocessing)。其餘非字串的資料則會在寫入之前" +"用 :func:`str` 函式進行字串化 (stringify)。" #: ../../library/csv.rst:117 msgid "" @@ -158,12 +174,18 @@ msgid "" "parameters of the dialect. For full details about dialects and formatting " "parameters, see section :ref:`csv-fmt-params`." msgstr "" +"將 *dialect* 與 *name* 進行關聯 (associate)。*name* 必須為字串。這個 dialect " +"可以透過傳遞 :class:`Dialect` 的子類別進行指定;或是關鍵字引數 " +"*fmtparams*;或是以上兩者皆是,並透過關鍵字引數來覆寫 dialect 的參數。" +"關於 dialect 及格式化參數的完整說明,請見段落 :ref:`csv-fmt-params`。" #: ../../library/csv.rst:126 msgid "" "Delete the dialect associated with *name* from the dialect registry. An :" "exc:`Error` is raised if *name* is not a registered dialect name." msgstr "" +"從 dialect 註冊表 (registry) 中,刪除與 *name* 關聯的 dialect。若 *name* 如" +"果不是註冊的 dialect 名稱,則會產生一個 :exc:`Error`。" #: ../../library/csv.rst:132 msgid "" @@ -171,20 +193,25 @@ msgid "" "*name* is not a registered dialect name. This function returns an " "immutable :class:`Dialect`." msgstr "" +"回傳一個與 *name* 關聯的 dialect。若 *name* 如果不是註冊的 dialect 名稱" +",則會產生一個 :exc:`Error`。這個函式會回傳一個 immutable (不可變物件) " +":class:`Dialect`。" #: ../../library/csv.rst:138 msgid "Return the names of all registered dialects." -msgstr "" +msgstr "回傳所有已註冊的 dialect 名稱。" #: ../../library/csv.rst:143 msgid "" "Returns the current maximum field size allowed by the parser. If *new_limit* " "is given, this becomes the new limit." msgstr "" +"回傳當前的剖析器 (parser) 允許的最大字串大小。如果 *new_limit* 被給定," +"則會變成新的最大字串大小。" #: ../../library/csv.rst:147 msgid "The :mod:`csv` module defines the following classes:" -msgstr "" +msgstr ":mod:`csv` 模組定義了下列的類別:" #: ../../library/csv.rst:152 msgid "" @@ -192,6 +219,8 @@ msgid "" "information in each row to a :class:`dict` whose keys are given by the " "optional *fieldnames* parameter." msgstr "" +"建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映)" +" 到 :class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" #: ../../library/csv.rst:156 msgid "" From 7c0cb515dd4399faf65ea6e955310917b67bb87a Mon Sep 17 00:00:00 2001 From: bananaiselite <70698133+bananaiselite@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:26:31 +0800 Subject: [PATCH 041/105] Working on iterator.po tst:8 (#546) * Working on iterator.po tst:8 * modify the missused parts * new commit * new commit --------- Co-authored-by: bananaiselite --- c-api/iterator.po | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c-api/iterator.po b/c-api/iterator.po index 805a6ed7bb..b64f1214b2 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -31,6 +31,10 @@ msgid "" "value, calling the callable for each item in the sequence, and ending the " "iteration when the sentinel value is returned." msgstr "" +"Python 提供了兩種通用的疊代器 (Iterator) 物件,第一種是序列 (sequence)。疊代" +"器能夠與有支援 :meth:`~object.__getitem__` 方法的任意序列使用,第二種是與可呼" +"叫 (callable) 物件和哨兵值 (sentinel value) 一起使用,會呼叫序列中的每個可呼" +"叫物件,當回傳哨兵值時就結束疊代。" #: ../../c-api/iterator.rst:17 msgid "" From 7566af51157e01736a1a66fca3d9c67eda6fbe67 Mon Sep 17 00:00:00 2001 From: 933yee <92087014+933yee@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:36:47 +0800 Subject: [PATCH 042/105] Translate library/uuid.po (#572) * translate library/uuid.po * "Translate library/uuid.po" * correct some errors * modify some details * correct a translation error * make some adjustments * make some adjustments * make some adjustments * modify parentheses * make two adjustments --- library/uuid.po | 134 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 101 insertions(+), 33 deletions(-) diff --git a/library/uuid.po b/library/uuid.po index 468dc3043d..f2b28e52d6 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/uuid.rst:2 msgid ":mod:`uuid` --- UUID objects according to :rfc:`4122`" -msgstr "" +msgstr ":mod:`uuid` --- :rfc:`4122` 定義的 UUID 物件" #: ../../library/uuid.rst:9 msgid "**Source code:** :source:`Lib/uuid.py`" @@ -33,6 +33,9 @@ msgid "" "`uuid5` for generating version 1, 3, 4, and 5 UUIDs as specified in :rfc:" "`4122`." msgstr "" +"這個模組提供了不可變的 :class:`UUID` 物件(:class:`UUID` 類別)和 :func:" +"`uuid1`、:func:`uuid3`、:func:`uuid4`、:func:`uuid5` 等函式,用於生成 :rfc:" +"`4122` 定義的第 1、3、4、5 版本的 UUID。" #: ../../library/uuid.rst:17 msgid "" @@ -41,6 +44,9 @@ msgid "" "creates a UUID containing the computer's network address. :func:`uuid4` " "creates a random UUID." msgstr "" +"如果你只需要一個唯一的 ID,你應該呼叫 :func:`uuid1` 或 :func:`uuid4`。需要注" +"意的是,:func:`uuid1` 可能會危害隱私,因為它會建立一個包含了電腦網路位址的 " +"UUID。而 :func:`uuid4` 則會建立一個隨機的 UUID。" #: ../../library/uuid.rst:22 msgid "" @@ -50,20 +56,24 @@ msgid "" "UUID. All instances of :class:`UUID` have an :attr:`is_safe` attribute " "which relays any information about the UUID's safety, using this enumeration:" msgstr "" +"根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」" +"UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程獲取到相同的 " +"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`is_safe` 屬性,該屬性使用下面" +"這個列舉來傳遞有關 UUID 安全性的任何資訊:" #: ../../library/uuid.rst:34 msgid "The UUID was generated by the platform in a multiprocessing-safe way." -msgstr "" +msgstr "該 UUID 是由平台以多行程安全的 (multiprocessing-safe) 方式生成的。" #: ../../library/uuid.rst:38 msgid "The UUID was not generated in a multiprocessing-safe way." -msgstr "" +msgstr "該 UUID 不是以多行程安全的方式生成的。" #: ../../library/uuid.rst:42 msgid "" "The platform does not provide information on whether the UUID was generated " "safely or not." -msgstr "" +msgstr "該平台不提供 UUID 是否為安全生成的資訊。" #: ../../library/uuid.rst:47 msgid "" @@ -76,6 +86,16 @@ msgid "" "string of hex digits is given, curly braces, hyphens, and a URN prefix are " "all optional. For example, these expressions all yield the same UUID::" msgstr "" +"從以下其中一種引數來建立 UUID:由 32 個十六進位的數字組成的字串、以大端順序 " +"(big-endian) 排列的 16 個位元組組成的字串作為 *bytes* 引數、以小端順序 " +"(little-endian) 排列的 16 個位元組組成的字串作為 *bytes_le* 引數、由 6 個整數" +"(32 位元的 *time_low*、16 位元的 *time_mid*、16 位元的 *time_hi_version*、8 " +"位元的 *clock_seq_hi_variant*、8 位元的 *clock_seq_low*、48 位元的 *node*)組" +"成的元組 (tuple) 作為 *fields* 引數,或者是單一的 128 位元整數作為 *int* 引" +"數。當給定由十六進位的數字組成的字串時,大括號、連字符號和 URN 前綴都是可以選" +"用的。例如,以下這些運算式都會產生相同的 UUID:\n" +"\n" +"::" #: ../../library/uuid.rst:66 msgid "" @@ -84,6 +104,10 @@ msgid "" "its variant and version number set according to :rfc:`4122`, overriding bits " "in the given *hex*, *bytes*, *bytes_le*, *fields*, or *int*." msgstr "" +"必須正好給定其中一個引數 *hex*、*bytes*、*bytes_le*、*fields* 或 *int*。" +"*version* 引數是選用的;如果給定了該引數,生成的 UUID 將根據 :rfc:`4122` 設置" +"其變體 (variant) 和版本號,覆蓋掉給定的 *hex*、*bytes*、*bytes_le*、*fields* " +"或 *int* 中的位元。" #: ../../library/uuid.rst:71 msgid "" @@ -91,6 +115,8 @@ msgid "" "int` attributes. Comparison with a non-UUID object raises a :exc:" "`TypeError`." msgstr "" +"UUID 物件之間的比較是透過比較它們的 :attr:`UUID.int` 屬性。與非 UUID 的物件進" +"行比較會引發 :exc:`TypeError`。" #: ../../library/uuid.rst:75 msgid "" @@ -98,28 +124,35 @@ msgid "" "``12345678-1234-5678-1234-567812345678`` where the 32 hexadecimal digits " "represent the UUID." msgstr "" +"``str(uuid)`` 會回傳一個像是 ``12345678-1234-5678-1234-567812345678`` 形式的" +"字串,其中 32 個十六進位的數字代表 UUID。" #: ../../library/uuid.rst:79 msgid ":class:`UUID` instances have these read-only attributes:" -msgstr "" +msgstr ":class:`UUID` 實例有以下唯讀的屬性:" #: ../../library/uuid.rst:83 msgid "" "The UUID as a 16-byte string (containing the six integer fields in big-" "endian byte order)." msgstr "" +"UUID 以 16 位元組的字串表示(包含 6 個整數欄位,按照大端位元組順序排列)。" #: ../../library/uuid.rst:89 msgid "" "The UUID as a 16-byte string (with *time_low*, *time_mid*, and " "*time_hi_version* in little-endian byte order)." msgstr "" +"UUID 以 16 位元組的字串表示(其中 *time_low*、*time_mid* 和 " +"*time_hi_version* 按照小端位元組順序排列)。" #: ../../library/uuid.rst:95 msgid "" "A tuple of the six integer fields of the UUID, which are also available as " "six individual attributes and two derived attributes:" msgstr "" +"UUID 以 6 個整數欄位所組成的元組表示,也可以看作有 6 個個別屬性和 2 個衍生屬" +"性:" #: ../../library/uuid.rst:99 msgid "Field" @@ -135,7 +168,7 @@ msgstr ":attr:`time_low`" #: ../../library/uuid.rst:101 msgid "the first 32 bits of the UUID" -msgstr "" +msgstr "UUID 的前 32 位元" #: ../../library/uuid.rst:103 msgid ":attr:`time_mid`" @@ -143,7 +176,7 @@ msgstr ":attr:`time_mid`" #: ../../library/uuid.rst:103 ../../library/uuid.rst:105 msgid "the next 16 bits of the UUID" -msgstr "" +msgstr "UUID 接下來的 16 位元" #: ../../library/uuid.rst:105 msgid ":attr:`time_hi_version`" @@ -155,7 +188,7 @@ msgstr ":attr:`clock_seq_hi_variant`" #: ../../library/uuid.rst:107 ../../library/uuid.rst:109 msgid "the next 8 bits of the UUID" -msgstr "" +msgstr "UUID 接下來的 8 位元" #: ../../library/uuid.rst:109 msgid ":attr:`clock_seq_low`" @@ -167,7 +200,7 @@ msgstr ":attr:`node`" #: ../../library/uuid.rst:111 msgid "the last 48 bits of the UUID" -msgstr "" +msgstr "UUID 最後的 48 位元" #: ../../library/uuid.rst:113 msgid ":attr:`time`" @@ -175,7 +208,7 @@ msgstr ":attr:`time`" #: ../../library/uuid.rst:113 msgid "the 60-bit timestamp" -msgstr "" +msgstr "60 位元的時間戳" #: ../../library/uuid.rst:115 msgid ":attr:`clock_seq`" @@ -183,19 +216,19 @@ msgstr ":attr:`clock_seq`" #: ../../library/uuid.rst:115 msgid "the 14-bit sequence number" -msgstr "" +msgstr "14 位元的序列號" #: ../../library/uuid.rst:121 msgid "The UUID as a 32-character lowercase hexadecimal string." -msgstr "" +msgstr "UUID 以 32 個小寫十六進位字元組成的字串表示。" #: ../../library/uuid.rst:126 msgid "The UUID as a 128-bit integer." -msgstr "" +msgstr "UUID 以 128 位元的整數表示。" #: ../../library/uuid.rst:131 msgid "The UUID as a URN as specified in :rfc:`4122`." -msgstr "" +msgstr "UUID 以 :rfc:`4122` 中指定的 URN 形式表示。" #: ../../library/uuid.rst:136 msgid "" @@ -203,22 +236,25 @@ msgid "" "will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :" "const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`." msgstr "" +"UUID 的變體,決定 UUID 內部的佈局 (layout),是 :const:`RESERVED_NCS`、:const:" +"`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個" +"常數。" #: ../../library/uuid.rst:143 msgid "" "The UUID version number (1 through 5, meaningful only when the variant is :" "const:`RFC_4122`)." -msgstr "" +msgstr "UUID 的版本號(1 到 5,只有當變體是 :const:`RFC_4122` 時才有意義)。" #: ../../library/uuid.rst:148 msgid "" "An enumeration of :class:`SafeUUID` which indicates whether the platform " "generated the UUID in a multiprocessing-safe way." -msgstr "" +msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。" #: ../../library/uuid.rst:153 msgid "The :mod:`uuid` module defines the following functions:" -msgstr "" +msgstr ":mod:`uuid` 模組定義了以下函式:" #: ../../library/uuid.rst:158 msgid "" @@ -232,6 +268,14 @@ msgid "" "least significant bit of the first octet is *unset*) will be preferred over " "locally administered MAC addresses, but with no other ordering guarantees." msgstr "" +"取得 48 位元正整數形式的硬體位址。第一次執行時,有可能會啟動一個獨立的程式," +"這也許會相當耗時。如果所有獲取硬體位址的嘗試都失敗,我們會根據 :rfc:`4122` 中" +"的建議,使用一個 48 位元的隨機數,其中群播位元 (multicast bit)(第一個八位元" +"組的最低有效位)設置為 1。「硬體位址」指的是網路介面 (network interface) 的 " +"MAC 位址。在具有多個網路介面的機器上,將優先選擇通用管理 (universally " +"administered) 的 MAC 位址(即第一個八位元組的第二個最低有效位是 *未設置的" +"*),而不是本地管理 (locally administered) 的 MAC 位址,除此之外不保證任何選" +"擇的順序。" #: ../../library/uuid.rst:168 msgid "" @@ -239,6 +283,8 @@ msgid "" "administered MAC addresses, since the former are guaranteed to be globally " "unique, while the latter are not." msgstr "" +"通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者" +"不是。" #: ../../library/uuid.rst:178 msgid "" @@ -247,6 +293,9 @@ msgid "" "If *clock_seq* is given, it is used as the sequence number; otherwise a " "random 14-bit sequence number is chosen." msgstr "" +"從主機 ID、序列號和當前時間生成 UUID。如果未給定 *node*,將使用 :func:" +"`getnode` 獲取硬體位址。如果給定 *clock_seq*,會將其用作序列號;否則將使用一" +"個隨機 14 位元的序列號。" #: ../../library/uuid.rst:188 msgid "" @@ -254,10 +303,12 @@ msgid "" "UUID) and a name (which is a :class:`bytes` object or a string that will be " "encoded using UTF-8)." msgstr "" +"基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一個 :class:" +"`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" #: ../../library/uuid.rst:197 msgid "Generate a random UUID." -msgstr "" +msgstr "生成一個隨機的 UUID。" #: ../../library/uuid.rst:204 msgid "" @@ -265,87 +316,98 @@ msgid "" "a UUID) and a name (which is a :class:`bytes` object or a string that will " "be encoded using UTF-8)." msgstr "" +"基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " +"編碼的字串)的 SHA-1 hash 來生成 UUID。" #: ../../library/uuid.rst:210 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." msgstr "" +":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" +"碼。" #: ../../library/uuid.rst:216 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." msgstr "" +"當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain " +"name)。" #: ../../library/uuid.rst:222 msgid "When this namespace is specified, the *name* string is a URL." -msgstr "" +msgstr "當指定這個命名空間時,*name* 字串是一個 URL。" #: ../../library/uuid.rst:227 msgid "When this namespace is specified, the *name* string is an ISO OID." -msgstr "" +msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。" #: ../../library/uuid.rst:232 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" +"當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" #: ../../library/uuid.rst:235 msgid "" "The :mod:`uuid` module defines the following constants for the possible " "values of the :attr:`variant` attribute:" -msgstr "" +msgstr ":mod:`uuid` 模組為 :attr:`variant` 屬性的可能值定義了以下常數:" #: ../../library/uuid.rst:241 msgid "Reserved for NCS compatibility." -msgstr "" +msgstr "保留供 NCS 相容性使用。" #: ../../library/uuid.rst:246 msgid "Specifies the UUID layout given in :rfc:`4122`." -msgstr "" +msgstr "使用在 :rfc:`4122` 中給定的 UUID 佈局。" #: ../../library/uuid.rst:251 msgid "Reserved for Microsoft compatibility." -msgstr "" +msgstr "保留供 Microsoft 相容性使用。" #: ../../library/uuid.rst:256 msgid "Reserved for future definition." -msgstr "" +msgstr "保留供未來定義使用。" #: ../../library/uuid.rst:262 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" +":rfc:`4122` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命" +"名空間" #: ../../library/uuid.rst:262 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." msgstr "" +"這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的" +"內部格式和生成 UUID 的方法。" #: ../../library/uuid.rst:269 msgid "Command-Line Usage" -msgstr "" +msgstr "命令列的用法" #: ../../library/uuid.rst:273 msgid "" "The :mod:`uuid` module can be executed as a script from the command line." -msgstr "" +msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" #: ../../library/uuid.rst:279 msgid "The following options are accepted:" -msgstr "" +msgstr "可以接受以下選項:" #: ../../library/uuid.rst:285 msgid "Show the help message and exit." -msgstr "" +msgstr "顯示幫助訊息並退出。" #: ../../library/uuid.rst:290 msgid "" "Specify the function name to use to generate the uuid. By default :func:" "`uuid4` is used." -msgstr "" +msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" #: ../../library/uuid.rst:296 msgid "" @@ -354,12 +416,15 @@ msgid "" "``@oid``, and ``@x500``. Only required for :func:`uuid3` / :func:`uuid5` " "functions." msgstr "" +"該命名空間是一個 ``UUID`` 或 ``@ns``,其中 ``ns`` 是指知名預定義 UUID 的命名" +"空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" +"`uuid3` / :func:`uuid5` 函式會需要。" #: ../../library/uuid.rst:303 msgid "" "The name used as part of generating the uuid. Only required for :func:" "`uuid3` / :func:`uuid5` functions." -msgstr "" +msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" #: ../../library/uuid.rst:310 msgid "Example" @@ -368,16 +433,19 @@ msgstr "範例" #: ../../library/uuid.rst:312 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" +"以下是一些 :mod:`uuid` 模組的典型使用範例:\n" +"\n" +"::" #: ../../library/uuid.rst:351 msgid "Command-Line Example" -msgstr "" +msgstr "命令列的範例" #: ../../library/uuid.rst:353 msgid "" "Here are some examples of typical usage of the :mod:`uuid` command line " "interface:" -msgstr "" +msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" #: ../../library/uuid.rst:173 msgid "getnode" From f479a630e6fe9086f004f94ecd99970f8db926ef Mon Sep 17 00:00:00 2001 From: Griiid Date: Wed, 16 Aug 2023 22:01:28 +0800 Subject: [PATCH 043/105] Translate `internet.po` (#586) --- library/internet.po | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/internet.po b/library/internet.po index cb9d7e3f9b..ff55f254eb 100644 --- a/library/internet.po +++ b/library/internet.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2023-08-15 22:14+0800\n" +"Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/internet.rst:5 msgid "Internet Protocols and Support" -msgstr "" +msgstr "網路協定 (Internet protocols) 及支援" #: ../../library/internet.rst:14 msgid "" @@ -30,6 +31,9 @@ msgid "" "`socket`, which is currently supported on most popular platforms. Here is " "an overview:" msgstr "" +"這個章節講述的模組實作了網路協定及相關技術的支援;他們全都是用 Python 實作" +"的。這裡的大多數模組都需要相依於系統的模組 :mod:`socket`,目前普遍的平台都支" +"援該模組。 以下為概述:" #: ../../library/internet.rst:7 msgid "WWW" From bbc8024ce34ee8b352d10f52d17d6d7e429daf84 Mon Sep 17 00:00:00 2001 From: mindihx Date: Sat, 19 Aug 2023 02:11:54 +0800 Subject: [PATCH 044/105] Translate howto/sorting from section 'Decorate-Sort-Undecorate' to end (#580) * Translate howto/sorting from section 'Decorate-Sort-Undecorate' to end * Refine translation of howto/sorting * Refine translation for howto/sorting --- howto/sorting.po | 53 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/howto/sorting.po b/howto/sorting.po index 2feb1b11fe..358468a15f 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: 2023-08-09 18:16+0800\n" +"PO-Revision-Date: 2023-08-12 15:09+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -216,32 +216,32 @@ msgstr "" #: ../../howto/sorting.rst:190 msgid "Decorate-Sort-Undecorate" -msgstr "" +msgstr "裝飾-排序-移除裝飾 (decorate-sort-undecorate)" #: ../../howto/sorting.rst:192 msgid "This idiom is called Decorate-Sort-Undecorate after its three steps:" -msgstr "" +msgstr "這個用語的來源是因為它做了以下三件事情:" #: ../../howto/sorting.rst:194 msgid "" "First, the initial list is decorated with new values that control the sort " "order." -msgstr "" +msgstr "首先,原始串列會裝飾 (decorated) 上新的值用來控制排序的順序。" #: ../../howto/sorting.rst:196 msgid "Second, the decorated list is sorted." -msgstr "" +msgstr "接下來,排序裝飾過的串列。" #: ../../howto/sorting.rst:198 msgid "" "Finally, the decorations are removed, creating a list that contains only the " "initial values in the new order." -msgstr "" +msgstr "最後,裝飾會被移除,並以新的順序產生一個只包含原始值的串列。" #: ../../howto/sorting.rst:201 msgid "" "For example, to sort the student data by *grade* using the DSU approach:" -msgstr "" +msgstr "例如用上面說的方式來以 *grade* 排序學生資料:" #: ../../howto/sorting.rst:208 msgid "" @@ -249,18 +249,24 @@ msgid "" "items are compared; if they are the same then the second items are compared, " "and so on." msgstr "" +"這個方式會有效是因為元組是依照字典順序 (lexicographically) 來比較,先比較第" +"一個項目,如果一樣再比較第二個項目,並依此類推。" #: ../../howto/sorting.rst:212 msgid "" "It is not strictly necessary in all cases to include the index *i* in the " "decorated list, but including it gives two benefits:" msgstr "" +"在所有情況下都把索引 *i* 加入已裝飾的串列並不是絕對需要的,但這樣做會有兩個好" +"處:" #: ../../howto/sorting.rst:215 msgid "" "The sort is stable -- if two items have the same key, their order will be " "preserved in the sorted list." msgstr "" +"排序會是穩定的 -- 如果兩個項目有相同的鍵,它們在排序好的串列中會保持原來的順" +"序。" #: ../../howto/sorting.rst:218 msgid "" @@ -269,6 +275,8 @@ msgid "" "example the original list could contain complex numbers which cannot be " "sorted directly." msgstr "" +"原始項目不需要是可以比較的,因為最多只會用到前兩個項目就能決定裝飾過的元組的" +"順序。例如原始串列可以包含不能直接用來排序的複數。" #: ../../howto/sorting.rst:223 msgid "" @@ -276,22 +284,25 @@ msgid "" "org/wiki/Schwartzian_transform>`_\\, after Randal L. Schwartz, who " "popularized it among Perl programmers." msgstr "" +"這個用語的另一個名字是 `Schwartzian transform `_\\ ,是由於 Randal L. Schwartz 讓這個方法在 Perl 程式" +"設計師間普及。" #: ../../howto/sorting.rst:227 msgid "" "Now that Python sorting provides key-functions, this technique is not often " "needed." -msgstr "" +msgstr "而因為 Python 的排序提供了鍵函式,已經不太需要用到這個方法了。" #: ../../howto/sorting.rst:230 msgid "Comparison Functions" -msgstr "" +msgstr "比較函式 (comparison functions)" #: ../../howto/sorting.rst:232 msgid "" "Unlike key functions that return an absolute value for sorting, a comparison " "function computes the relative ordering for two inputs." -msgstr "" +msgstr "不像鍵函式回傳一個用來排序的值,比較函式計算兩個輸入間的相對順序。" #: ../../howto/sorting.rst:235 msgid "" @@ -301,6 +312,10 @@ msgid "" "function such as ``cmp(a, b)`` will return a negative value for less-than, " "zero if the inputs are equal, or a positive value for greater-than." msgstr "" +"例如\\ `天秤 `_\\ 比較兩邊樣本並給出相對的順序:較輕、相同或較" +"重。同樣地,像是 ``cmp(a, b)`` 這樣的比較函式會回傳負數代表小於、0 代表輸入相" +"同或正數代表大於。" #: ../../howto/sorting.rst:242 msgid "" @@ -309,6 +324,8 @@ msgid "" "part of their API. For example, :func:`locale.strcoll` is a comparison " "function." msgstr "" +"當從其它語言翻譯演算法的時候常看到比較函式。有些函式庫也會提供比較函式作為其 " +"API 的一部份,例如 :func:`locale.strcoll` 就是一個比較函式。" #: ../../howto/sorting.rst:246 msgid "" @@ -316,10 +333,12 @@ msgid "" "cmp_to_key` to wrap the comparison function to make it usable as a key " "function::" msgstr "" +"為了滿足這些情境,Python 提供 :class:`functools.cmp_to_key` 來包裝比較函式," +"讓其可以當作鍵函式來使用: ::" #: ../../howto/sorting.rst:253 msgid "Odds and Ends" -msgstr "" +msgstr "雜項說明" #: ../../howto/sorting.rst:255 msgid "" @@ -328,6 +347,9 @@ msgid "" "\"alphabetical\" sort orderings can vary across cultures even if the " "underlying alphabet is the same." msgstr "" +"要處理能理解本地語系 (locale aware) 的排序可以使用 :func:`locale.strxfrm` 當" +"作鍵函式,或 :func:`locale.strcoll` 當作比較函式。這樣做是必要的,因為在不同" +"文化中就算是相同的字母,按「字母順序」排序的結果也各不相同。" #: ../../howto/sorting.rst:260 msgid "" @@ -336,6 +358,9 @@ msgid "" "simulated without the parameter by using the builtin :func:`reversed` " "function twice:" msgstr "" +"*reverse* 參數依然會維持排序穩定性(即有相同鍵的資料會保持原來順序)。有趣的" +"是,不加這個參數也可以模擬這個效果,只要使用內建的 :func:`reversed` 函式兩" +"次:" #: ../../howto/sorting.rst:274 msgid "" @@ -343,12 +368,16 @@ msgid "" "it is easy to add a standard sort order to a class by defining an :meth:" "`~object.__lt__` method:" msgstr "" +"排序時會使用 ``<`` 來比較兩個物件,因此要在類別裡面加入排序順序比較規則是簡單" +"的,只要透過定義 :meth:`~object.__lt__` 方法:" #: ../../howto/sorting.rst:284 msgid "" "However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" "meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`)." msgstr "" +"然而,需要注意如果沒有實作 :meth:`~object.__lt__`,則 ``<`` 會退而使用 :meth:" +"`~object.__gt__`\\ (參見 :func:`object.__lt__`)。" #: ../../howto/sorting.rst:287 msgid "" @@ -357,3 +386,5 @@ msgid "" "grades are stored in a dictionary, they can be used to sort a separate list " "of student names:" msgstr "" +"鍵函式不需要直接依賴用來排序的物件。鍵函式也可以存取外部資源,例如如果學生成" +"績儲存在字典裡,它可以用來排序一個單獨的學生姓名串列:" From eda10c149c25cad0da22ff241f5196d4b20f546c Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sat, 19 Aug 2023 23:23:49 +0800 Subject: [PATCH 045/105] Translate `c-api/refcounting.po` (#559) * translate `c-api/refcounting.po` * fix: updated the source strings and their translations * fix(c-api/refcounting): modify based on review comments --- c-api/refcounting.po | 273 +++++++++++++++++++++++++------------------ 1 file changed, 159 insertions(+), 114 deletions(-) diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 7f9b3153dd..855b69a842 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: 2023-07-01 14:19+0800\n" +"POT-Creation-Date: 2023-08-14 22:55+0800\n" +"PO-Revision-Date: 2023-08-06 14:19+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -36,26 +36,55 @@ msgstr "取得物件 *o* 的參照計數。" #: ../../c-api/refcounting.rst:18 msgid "" -"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +"Note that the returned value may not actually reflect how many references to " +"the object are actually held. For example, some objects are \"immortal\" " +"and have a very high refcount that does not reflect the actual number of " +"references. Consequently, do not rely on the returned value to be accurate, " +"other than a value of 0 or 1." msgstr "" +"請注意,回傳的值可能實際上並不反映實際保存了多少對該物件的參照。例如,某些物" +"件是「不滅的 (immortal)」,並且具有非常高的參照計數,不能反映實際的參照數量。" +"因此,除了 0 或 1 以外,不要依賴回傳值的準確性。" -#: ../../c-api/refcounting.rst:20 +#: ../../c-api/refcounting.rst:24 +msgid "" +"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +msgstr "使用 :c:func:`Py_SET_REFCNT()` 函式設定物件參照計數。" + +#: ../../c-api/refcounting.rst:26 msgid "The parameter type is no longer :c:expr:`const PyObject*`." -msgstr "" +msgstr "參數型別不再是 :c:expr:`const PyObject*`。" -#: ../../c-api/refcounting.rst:23 +#: ../../c-api/refcounting.rst:29 msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." -msgstr "" +msgstr ":c:func:`Py_REFCNT()` 更改為行內靜態函式 (inline static function)。" -#: ../../c-api/refcounting.rst:29 +#: ../../c-api/refcounting.rst:35 msgid "Set the object *o* reference counter to *refcnt*." msgstr "設定物件 *o* 的參照計數。" -#: ../../c-api/refcounting.rst:36 -msgid "Increment the reference count for object *o*." -msgstr "增加物件 *o* 的參照計數。" +#: ../../c-api/refcounting.rst:37 +msgid "" +"Note that this function has no effect on `immortal `_ objects." +msgstr "" +"請注意,此函式對\\ `不滅的 `_\\ 物件沒有影" +"響。" + +#: ../../c-api/refcounting.rst:43 ../../c-api/refcounting.rst:65 +#: ../../c-api/refcounting.rst:142 +msgid "Immortal objects are not modified." +msgstr "不滅的物件不會被修改。" + +#: ../../c-api/refcounting.rst:49 +msgid "" +"Indicate taking a new :term:`strong reference` to object *o*, indicating it " +"is in use and should not be destroyed." +msgstr "" +"代表取得對於物件 *o* 的新\\ :term:`強參照 `,即它正在使用且" +"不應被銷毀。" -#: ../../c-api/refcounting.rst:38 +#: ../../c-api/refcounting.rst:52 msgid "" "This function is usually used to convert a :term:`borrowed reference` to a :" "term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " @@ -65,7 +94,11 @@ msgstr "" "換為\\ :term:`強參照 `。:c:func:`Py_NewRef` 函式可用於建立" "新的\\ :term:`強參照 `。" -#: ../../c-api/refcounting.rst:42 +#: ../../c-api/refcounting.rst:56 +msgid "When done using the object, release it by calling :c:func:`Py_DECREF`." +msgstr "使用完該物件後,透過呼叫 :c:func:`Py_DECREF` 來釋放它。" + +#: ../../c-api/refcounting.rst:58 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XINCREF`." @@ -73,34 +106,44 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使用 :c:func:" "`Py_XINCREF`。" -#: ../../c-api/refcounting.rst:48 +#: ../../c-api/refcounting.rst:61 ../../c-api/refcounting.rst:127 msgid "" -"Increment the reference count for object *o*. The object may be ``NULL``, " -"in which case the macro has no effect." +"Do not expect this function to actually modify *o* in any way. For at least " +"`some objects `_, this function has no " +"effect." msgstr "" -"增加物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用。" +"不要期望此函式會以任何方式實際修改 *o*,至少對於\\ `某些物件 `_\\ 來說,此函式沒有任何效果。" -#: ../../c-api/refcounting.rst:51 +#: ../../c-api/refcounting.rst:71 +msgid "" +"Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which " +"case this has no effect." +msgstr "" +"與 :c:func:`Py_INCREF` 類似,但物件 *o* 可以為 ``NULL``,在這種情況下這就不會" +"有任何效果。" + +#: ../../c-api/refcounting.rst:74 msgid "See also :c:func:`Py_XNewRef`." msgstr "另請見 :c:func:`Py_XNewRef`。" -#: ../../c-api/refcounting.rst:56 +#: ../../c-api/refcounting.rst:79 msgid "" -"Create a new :term:`strong reference` to an object: increment the reference " -"count of the object *o* and return the object *o*." +"Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` " +"on *o* and return the object *o*." msgstr "" -"建立對物件的新\\ :term:`強參照 `:增加物件 *o* 的參照計數並" -"回傳物件 *o*。" +"建立對物件的新\\ :term:`強參照 `:於 *o* 呼叫 :c:func:" +"`Py_INCREF` 並回傳物件 *o*。" -#: ../../c-api/refcounting.rst:59 +#: ../../c-api/refcounting.rst:82 msgid "" "When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " -"should be called on it to decrement the object reference count." +"should be called on it to release the reference." msgstr "" "當不再需要\\ :term:`強參照 `\\ 時,應對其呼叫 :c:func:" -"`Py_DECREF` 以減少物件參照計數。" +"`Py_DECREF` 以釋放該參照。" -#: ../../c-api/refcounting.rst:62 +#: ../../c-api/refcounting.rst:85 msgid "" "The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " "``NULL``." @@ -108,52 +151,52 @@ msgstr "" "物件 *o* 不能為 ``NULL``;如果 *o* 可以為 ``NULL``,則使用 :c:func:" "`Py_XNewRef`。" -#: ../../c-api/refcounting.rst:65 +#: ../../c-api/refcounting.rst:88 msgid "For example::" -msgstr "" -"舉例來說:\n" -"\n" -"::" +msgstr "舉例來說: ::" -#: ../../c-api/refcounting.rst:70 +#: ../../c-api/refcounting.rst:93 msgid "can be written as::" -msgstr "" -"可以寫成:\n" -"\n" -"::" +msgstr "可以寫成: ::" -#: ../../c-api/refcounting.rst:74 +#: ../../c-api/refcounting.rst:97 msgid "See also :c:func:`Py_INCREF`." -msgstr "另請參閱 :c:func:`Py_INCREF`\\ 。" +msgstr "另請參閱 :c:func:`Py_INCREF`。" -#: ../../c-api/refcounting.rst:81 +#: ../../c-api/refcounting.rst:104 msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." msgstr "與 :c:func:`Py_NewRef` 類似,但物件 *o* 可以為 NULL。" -#: ../../c-api/refcounting.rst:83 +#: ../../c-api/refcounting.rst:106 msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." msgstr "如果物件 *o* 為 ``NULL``,則該函式僅回傳 ``NULL``。" -#: ../../c-api/refcounting.rst:90 -msgid "Decrement the reference count for object *o*." -msgstr "減少物件 *o* 的參照計數。" +#: ../../c-api/refcounting.rst:113 +msgid "" +"Release a :term:`strong reference` to object *o*, indicating the reference " +"is no longer used." +msgstr "" +"釋放一個對物件 *o* 的\\ :term:`強參照 `,代表該參照不會再被" +"使用。" -#: ../../c-api/refcounting.rst:92 +#: ../../c-api/refcounting.rst:116 msgid "" -"If the reference count reaches zero, the object's type's deallocation " -"function (which must not be ``NULL``) is invoked." +"Once the last :term:`strong reference` is released (i.e. the object's " +"reference count reaches 0), the object's type's deallocation function (which " +"must not be ``NULL``) is invoked." msgstr "" -"如果參照計數達到零,則調用物件之型別的釋放函式 (deallocation function)(不得" -"為 ``NULL``)。" +"如果最後一個\\ :term:`強參照 `\\ 被釋放(即物件的參照計數達" +"到零),則觸發物件之型別的釋放函式 (deallocation function)(不得為 " +"``NULL``\\ )。" -#: ../../c-api/refcounting.rst:95 +#: ../../c-api/refcounting.rst:121 msgid "" "This function is usually used to delete a :term:`strong reference` before " "exiting its scope." msgstr "" "此函式通常用於在退出作用域之前刪除\\ :term:`強參照 `。" -#: ../../c-api/refcounting.rst:98 +#: ../../c-api/refcounting.rst:124 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XDECREF`." @@ -161,7 +204,7 @@ msgstr "" "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改用 :c:func:" "`Py_XDECREF`。" -#: ../../c-api/refcounting.rst:103 +#: ../../c-api/refcounting.rst:133 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." "g. when a class instance with a :meth:`~object.__del__` method is " @@ -173,103 +216,105 @@ msgid "" "object in a temporary variable, update the list data structure, and then " "call :c:func:`Py_DECREF` for the temporary variable." msgstr "" -"釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`~object.__del__` 方" -"法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但​​執行的程式碼可以自" -"由存取所有 Python 全域變數。這意味著在調用 :c:func:`Py_DECREF` 之前,可從全域" -"變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程式碼應將已刪" -"除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數呼叫 :c:func:" -"`Py_DECREF`。" - -#: ../../c-api/refcounting.rst:115 +"釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`~object." +"__del__` 方法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但​​執行的程" +"式碼可以自由存取所有 Python 全域變數。這意味著在調用 :c:func:`Py_DECREF` 之" +"前,可從全域變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程" +"式碼應將已刪除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數" +"呼叫 :c:func:`Py_DECREF`。" + +#: ../../c-api/refcounting.rst:148 msgid "" -"Decrement the reference count for object *o*. The object may be ``NULL``, " -"in which case the macro has no effect; otherwise the effect is the same as " -"for :c:func:`Py_DECREF`, and the same warning applies." +"Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which " +"case this has no effect. The same warning from :c:func:`Py_DECREF` applies " +"here as well." msgstr "" -"減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否" -"則效果與 :c:func:`Py_DECREF` 相同,且使得應用了相同的警告。" +"和 :c:func:`Py_DECREF` 類似,但該物件可以是 ``NULL``,在這種情況下巨集不起作" +"用。在這裡也會出現與 :c:func:`Py_DECREF` 相同的警告。" -#: ../../c-api/refcounting.rst:122 +#: ../../c-api/refcounting.rst:155 msgid "" -"Decrement the reference count for object *o*. The object may be ``NULL``, " -"in which case the macro has no effect; otherwise the effect is the same as " -"for :c:func:`Py_DECREF`, except that the argument is also set to ``NULL``. " -"The warning for :c:func:`Py_DECREF` does not apply with respect to the " -"object passed because the macro carefully uses a temporary variable and sets " -"the argument to ``NULL`` before decrementing its reference count." +"Release a :term:`strong reference` for object *o*. The object may be " +"``NULL``, in which case the macro has no effect; otherwise the effect is the " +"same as for :c:func:`Py_DECREF`, except that the argument is also set to " +"``NULL``. The warning for :c:func:`Py_DECREF` does not apply with respect " +"to the object passed because the macro carefully uses a temporary variable " +"and sets the argument to ``NULL`` before releasing the reference." msgstr "" -"減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否" -"則,效果與 :c:func:`Py_DECREF` 相同,只是引數也設定為 ``NULL``。:c:func:" -"`Py_DECREF` 的警告不適用於傳遞的物件,因為巨集在遞減其參照計數之前小心地使用" -"臨時變數並將參數設定為 ``NULL``。" +"釋放對於物件 *o* 的\\ :term:`強參照 `。該物件可能是 " +"``NULL``,在這種情況下巨集不起作用;否則,效果與 :c:func:`Py_DECREF` 相同,除" +"非引數也設定為 ``NULL``。:c:func:`Py_DECREF` 的警告不適用於傳遞的物件,因為巨" +"集在釋放其參照之前小心地使用臨時變數並將引數設定為 ``NULL``。" -#: ../../c-api/refcounting.rst:129 +#: ../../c-api/refcounting.rst:163 msgid "" -"It is a good idea to use this macro whenever decrementing the reference " -"count of an object that might be traversed during garbage collection." +"It is a good idea to use this macro whenever releasing a reference to an " +"object that might be traversed during garbage collection." msgstr "" -"每當要減少垃圾收集期間可能被遍歷到之物件的參照計數時,使用此巨集是個好主意。" +"每當要釋放垃圾回收 (garbage collection) 期間可能被遍歷到之對於物件的參照時," +"使用此巨集是個好主意。" -#: ../../c-api/refcounting.rst:132 +#: ../../c-api/refcounting.rst:166 msgid "" "The macro argument is now only evaluated once. If the argument has side " "effects, these are no longer duplicated." msgstr "" +"巨集引數現在僅會被求值 (evaluate) 一次。如果引數有其他副作用,則不再重複作" +"用。" -#: ../../c-api/refcounting.rst:139 +#: ../../c-api/refcounting.rst:173 msgid "" -"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." +"Indicate taking a new :term:`strong reference` to object *o*. A function " +"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " +"embedding of Python." msgstr "" -"增加物件 *o* 的參照計數。:c:func:`Py_XINCREF` 的函式版本。它可用於 Python 的" -"執行環境動態嵌入。" +"代表取得對於物件 *o* 的\\ :term:`強參照 `。:c:func:" +"`Py_XINCREF` 的函式版本。它可用於 Python 的 runtime 動態嵌入。" -#: ../../c-api/refcounting.rst:145 +#: ../../c-api/refcounting.rst:180 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." +"Release a :term:`strong reference` to object *o*. A function version of :c:" +"func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." msgstr "" -"減少物件 *o* 的參照計數。:c:func:`Py_XDECREF` 的函式版本。它可用於 Python 的" -"執行環境動態嵌入。" +"釋放對物件 *o* 的\\ :term:`強參照 `。:c:func:`Py_XDECREF` " +"的函式版本。它可用於 Python 的 runtime 動態嵌入。" -#: ../../c-api/refcounting.rst:151 +#: ../../c-api/refcounting.rst:187 msgid "" -"Macro safely decrementing the `dst` reference count and setting `dst` to " -"`src`." +"Macro safely releasing a :term:`strong reference` to object *dst* and " +"setting *dst* to *src*." msgstr "" +"巨集安全地釋放對於物件 *dst* 的\\ :term:`強參照 `\\ 並將 " +"*dst* 設定為 *src*。" -#: ../../c-api/refcounting.rst:154 +#: ../../c-api/refcounting.rst:190 msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" -msgstr "" +msgstr "與 :c:func:`Py_CLEAR` 的情況一樣,「明顯的」程式碼可能是致命的: ::" -#: ../../c-api/refcounting.rst:159 +#: ../../c-api/refcounting.rst:195 msgid "The safe way is::" -msgstr "" +msgstr "安全的方法是: ::" -#: ../../c-api/refcounting.rst:163 +#: ../../c-api/refcounting.rst:199 msgid "" -"That arranges to set `dst` to `src` _before_ decrementing reference count of " -"*dst* old value, so that any code triggered as a side-effect of `dst` " -"getting torn down no longer believes `dst` points to a valid object." +"That arranges to set *dst* to *src* _before_ releasing the reference to the " +"old value of *dst*, so that any code triggered as a side-effect of *dst* " +"getting torn down no longer believes *dst* points to a valid object." msgstr "" +"這會在釋放對 *dst* 舊值的參照\\ _之前_\\ 將 *dst* 設定為 *src*,使得因 *dst* " +"被拆除而觸發的任何副作用 (side-effect) 之程式碼不會相信 *dst* 是指向一個有效" +"物件。" -#: ../../c-api/refcounting.rst:169 ../../c-api/refcounting.rst:181 +#: ../../c-api/refcounting.rst:206 ../../c-api/refcounting.rst:218 msgid "" "The macro arguments are now only evaluated once. If an argument has side " "effects, these are no longer duplicated." -msgstr "" +msgstr "巨集引數現在僅會被求值一次。如果引數有其他副作用,則不再重複作用。" -#: ../../c-api/refcounting.rst:176 +#: ../../c-api/refcounting.rst:213 msgid "" "Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " "of :c:func:`Py_DECREF`." msgstr "" - -#~ msgid "" -#~ "The following functions or macros are only for use within the interpreter " -#~ "core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:" -#~ "`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`." -#~ msgstr "" -#~ "以下函式或巨集僅在直譯器核心內使用::c:func:`_Py_Dealloc`、:c:func:" -#~ "`_Py_ForgetReference`、:c:func:`_Py_NewReference` 以及全域變數 :c:data:" -#~ "`_Py_RefTotal`。" +":c:macro:`Py_SETREF` 巨集的變體,請改用 :c:func:`Py_XDECREF` 而非 :c:func:" +"`Py_DECREF`。" From a1e5917a9efdb7fa84895a2328675d90bc1345b0 Mon Sep 17 00:00:00 2001 From: Jay <74105438+weijay0804@users.noreply.github.com> Date: Sun, 20 Aug 2023 23:44:06 +0800 Subject: [PATCH 046/105] =?UTF-8?q?feat(howto/sockets.po):=20=E7=BF=BB?= =?UTF-8?q?=E8=AD=AF=20When=20Sockets=20Die=20=E5=92=8C=20Non-blocking=20S?= =?UTF-8?q?ockets=20=E5=8D=80=E5=A1=8A=20(#581)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(howto/sockets.po): 翻譯 When Sockets Die 和 Non-blocking Sockets 區塊 gh-466 * fix(howto/sockets.po): 根據 review 建議更改翻譯內容 gh-466 * fix(howto/sockets.po): 修改 rst 語法 gh-466 * Apply suggestions from code review * fix(howto/sockets.po): 更改專有名詞 gh-466 --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- howto/sockets.po | 56 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/howto/sockets.po b/howto/sockets.po index f061aec37f..8d49421e8c 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-06-10 00:16+0000\n" -"PO-Revision-Date: 2023-08-03 18:11+0800\n" +"PO-Revision-Date: 2023-08-12 15:16+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -240,7 +240,7 @@ msgstr "" msgid "" "The :mod:`multiprocessing` integrates cross-platform IPC into a higher-level " "API." -msgstr ":mod:`multiprocessing` 將跨平台的行程間通訊整合到更高層的 API 中。" +msgstr ":mod:`multiprocessing` 將跨平台行程間通訊整合到更高層的 API 中。" #: ../../howto/sockets.rst:134 msgid "Using a Socket" @@ -519,7 +519,7 @@ msgstr "" #: ../../howto/sockets.rst:302 msgid "When Sockets Die" -msgstr "" +msgstr "Sockets 何時銷毀" #: ../../howto/sockets.rst:304 msgid "" @@ -535,10 +535,17 @@ msgid "" "automatic recycling of resources. In other words, if you do manage to kill " "the thread, your whole process is likely to be screwed up." msgstr "" +"使用阻塞式 socket 最糟糕的地方可能是在另一端突然強制關閉(未執行 ``close``)" +"的情況下會發生什麼?你的 socket 很可能會處於阻塞狀態。TCP 是一種可靠的協議," +"它在放棄連線之前會等待很長很長的時間。如果你正在使用執行緒,整個執行緒基本上" +"已經無法使用。在這方面,你無法做太多事情。只要你不做一些愚蠢的事情,比如在" +"執行阻塞式讀取時持有一個鎖,那麼執行緒並不會消耗太多資源。*不要*\\ 試圖終止" +"執行緒 - 執行緒比行程更有效的部分原因是它們避免了與自動回收資源相關的開銷。換" +"句話說,如果你確實設法終止了執行緒,整個行程可能會出現問題。" #: ../../howto/sockets.rst:318 msgid "Non-blocking Sockets" -msgstr "" +msgstr "非阻塞的 Sockets" #: ../../howto/sockets.rst:320 msgid "" @@ -547,6 +554,9 @@ msgid "" "calls, in much the same ways. It's just that, if you do it right, your app " "will be almost inside-out." msgstr "" +"如果你已經理解了前面的內容,你已經知道了大部分關於使用 sockets 的機制的所需知" +"識,你仍然會以非常相似的方式使用相同的函式。就這樣而已,如果你做的對,你的程式" +"就會是近乎完美的。" #: ../../howto/sockets.rst:325 msgid "" @@ -557,6 +567,11 @@ msgid "" "the exact same idea. You do this after creating the socket, but before using " "it. (Actually, if you're nuts, you can switch back and forth.)" msgstr "" +"在 Python 中可以使用 ``socket.setblocking(False)`` 來設定為非阻塞。在 C 的作" +"法更為複雜(例如,你需要在 BSD 風格的 ``O_NONBLOCK`` 和幾乎沒有區別的 POSIX 風" +"格的 ``O_NDELAY`` 之間做出選擇,這與 ``TCP_NODELAY`` 完全不同),但基本思想是" +"一樣的,你要在建立 socket 後但在使用它之前執行此操作。(實際上,如果你願意的" +"話,你甚至可以來回切換。)" #: ../../howto/sockets.rst:332 msgid "" @@ -567,10 +582,14 @@ msgid "" "will grow large, buggy and suck CPU. So let's skip the brain-dead solutions " "and do it right." msgstr "" +"主要的機制差異在於 ``send``、``recv``、``connect`` 和 ``accept`` 可能在沒有執" +"行任何操作的情況下就回傳了。你當然有多種選擇。你可以檢查回傳值和錯誤代碼,但" +"這些操作通常會讓自己抓狂。如果你不相信我,不妨試試看。你的應用程式會變得臃" +"腫、錯誤百出,並且占用 CPU。所以,讓我們跳過無腦的解決方案,使用正確的方式。" #: ../../howto/sockets.rst:339 msgid "Use ``select``." -msgstr "" +msgstr "使用 ``select``。" #: ../../howto/sockets.rst:341 msgid "" @@ -578,6 +597,9 @@ msgid "" "but it's close enough to the C version that if you understand ``select`` in " "Python, you'll have little trouble with it in C::" msgstr "" +"在 C 中,編寫 ``select`` 是非常複雜的,但在 Python 中,這很簡單,並與 C 的版" +"本非常類似,如果你理解了 Python 中的 ``select``,在 C 中處理它時也不會有太大" +"的困難: ::" #: ../../howto/sockets.rst:352 msgid "" @@ -589,6 +611,11 @@ msgid "" "generally a sensible thing to do - give it a nice long timeout (say a " "minute) unless you have good reason to do otherwise." msgstr "" +"你傳遞給 ``select`` 三個列表:第一個列表包含你可能想要嘗試讀取的所有 " +"sockets;第二個包含所有你可能想要嘗試寫入的 sockets,最後一個(通常為空)包含" +"你想要檢查錯誤的 sockets。你應該注意,一個 socket 可以同時存在於多個列表中。" +"``select`` 呼叫是阻塞的,但你可以設置超時。通常這是一個明智的做法 - 除非有" +"充分的理由,否則給它一個很長的超時(比如一分鐘)。" #: ../../howto/sockets.rst:360 msgid "" @@ -596,6 +623,8 @@ msgid "" "actually readable, writable and in error. Each of these lists is a subset " "(possibly empty) of the corresponding list you passed in." msgstr "" +"作為回傳,你將獲得三個列表。它們包含實際上可讀取、可寫入和出錯的 sockets。這" +"些列表中的每一個都是你傳入的相應列表的子集(可能為空)。" #: ../../howto/sockets.rst:364 msgid "" @@ -606,6 +635,11 @@ msgid "" "nothing. (Actually, any reasonably healthy socket will return as writable - " "it just means outbound network buffer space is available.)" msgstr "" +"如果一個 socket 在輸出的可讀列表中,你可以幾乎確定,在這個業務中我們能夠得到" +"的最接近確定的事情是,對該 socket 的 ``recv`` 呼叫將會回傳一些\\ *內容*。對於可寫" +"列表,也是同樣的想法。你將能夠發送一些 *內容*。也許不是全部,但\\ *一些內容*\\ 總比" +"什麼都沒有好。(實際上,任何比較正常的 socket 都會以可寫的方式回傳 - 這只是意味" +"者「外送網路 (outbound network)」的緩衝空間是可用的。)" #: ../../howto/sockets.rst:371 msgid "" @@ -615,6 +649,10 @@ msgid "" "it in the potential_writers list. If it shows up in the writable list, you " "have a decent chance that it has connected." msgstr "" +"如果你有一個「伺服器端」socket,請將其放在 potential_readers 列表中,如果它在" +"可讀列表中出現,你的 ``accept`` 呼叫(幾乎可以確定)會成功。如果你建立了一個" +"新的 socket 去 ``connect`` 到其他地方,請將它放在 potential_writers 列表中," +"如果它在可寫列表中出現,那麼他有可能已經連接上了。" #: ../../howto/sockets.rst:377 msgid "" @@ -624,6 +662,9 @@ msgid "" "problem of determining whether the other end is done, or just busy with " "something else." msgstr "" +"實際上,即使是使用阻塞式 socket 的情況下,``select`` 也很方便。這是一種判斷是否" +"會被阻塞的方法之一 - 當緩衝區中有某些內容時, socket 會回傳為可讀。然而,這" +"仍然無法解決判斷另一端是否完成,或者只是忙於其他事情的問題。" #: ../../howto/sockets.rst:382 msgid "" @@ -633,3 +674,8 @@ msgid "" "differently on Windows. In fact, on Windows I usually use threads (which " "work very, very well) with my sockets." msgstr "" +"**可移植性警告**:在 Unix 上,``select`` 同時適用於 sockets 和文件。但請不要" +"在 Windows 上嘗試這麼做,在 Windows 上,``select`` 只適用於 sockets。同時,請" +"注意,在 C 語言中,許多更進階的 socket 選項在 Windows 上有不同的實現方式。實" +"際上,在 Windows 上,我通常會使用執行緒(這非常,非常有效)與我的 sockets 一起" +"使用。" From e82ea00798347dee805032008b8c667f4374356c Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 02:08:59 +0800 Subject: [PATCH 047/105] Sync with CPython 3.12 (#511) * sync with cpython e3b5ed7b * sync with cpython 0b3d6381 * sync with cpython 54aaaade * sync with cpython fc4532a5 * sync with cpython 0e7a4f73 * sync with cpython ab1988d5 * sync with cpython e5582bdb * sync with cpython aa2ecef2 * sync with cpython d20d52bc * sync with cpython ba8ab4e8 * resolve fuzzy entries * sync with cpython e8963a86 * sync with cpython 91d935b4 * sync with cpython 931df0a4 * sync with cpython 9342ac31 * sync with cpython af6e5fa7 * sync with cpython 0e5eee01 * sync with cpython 7f5a741a * resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/allocation.po | 23 +- c-api/arg.po | 238 ++--- c-api/buffer.po | 262 ++--- c-api/bytes.po | 6 +- c-api/code.po | 12 +- c-api/exceptions.po | 708 ++++++------- c-api/init.po | 251 ++--- c-api/init_config.po | 4 +- c-api/intro.po | 331 +++--- c-api/memory.po | 147 +-- c-api/module.po | 114 +- c-api/object.po | 54 +- c-api/sys.po | 162 +-- c-api/typeobj.po | 802 +++++++------- c-api/unicode.po | 16 +- distributing/index.po | 307 +----- extending/building.po | 6 +- extending/extending.po | 12 +- faq/programming.po | 23 +- glossary.po | 959 ++++++++--------- howto/clinic.po | 1090 +++++++++---------- howto/curses.po | 2 +- howto/isolating-extensions.po | 194 ++-- installing/index.po | 102 +- library/asyncio-eventloop.po | 2 +- library/asyncio-runner.po | 2 +- library/asyncio-stream.po | 2 +- library/asyncio-task.po | 6 +- library/csv.po | 2 +- library/ctypes.po | 1148 ++++++++++---------- library/datetime.po | 2 +- library/dis.po | 410 ++++---- library/enum.po | 2 +- library/functions.po | 10 +- library/functools.po | 115 +- library/gzip.po | 4 +- library/io.po | 335 +++--- library/logging.po | 590 ++++++----- library/lzma.po | 4 +- library/math.po | 4 +- library/optparse.po | 6 +- library/os.po | 1874 +++++++++++++++++---------------- library/profile.po | 6 +- library/random.po | 2 +- library/re.po | 2 +- library/runpy.po | 91 +- library/shelve.po | 2 +- library/shutil.po | 2 +- library/site.po | 9 +- library/socket.po | 4 +- library/sqlite3.po | 2 +- library/statistics.po | 78 +- library/subprocess.po | 2 +- library/sys.po | 868 ++++++++------- library/sysconfig.po | 12 +- library/test.po | 2 +- library/time.po | 2 +- library/tkinter.po | 12 +- library/tokenize.po | 4 +- library/traceback.po | 4 +- library/typing.po | 12 +- library/unittest.po | 14 +- library/urllib.parse.po | 2 +- library/warnings.po | 4 +- library/xml.sax.reader.po | 4 +- library/zipfile.po | 10 +- license.po | 72 +- tutorial/venv.po | 8 +- using/cmdline.po | 5 +- using/configure.po | 246 ++--- using/mac.po | 48 +- using/windows.po | 10 +- whatsnew/2.2.po | 4 +- whatsnew/2.3.po | 23 +- whatsnew/2.4.po | 10 +- whatsnew/2.5.po | 14 +- whatsnew/2.6.po | 34 +- whatsnew/2.7.po | 31 +- whatsnew/3.0.po | 8 +- whatsnew/3.1.po | 12 +- whatsnew/3.12.po | 1211 +++++++++++---------- whatsnew/3.2.po | 42 +- whatsnew/3.3.po | 4 +- whatsnew/3.4.po | 4 +- whatsnew/3.5.po | 6 +- whatsnew/3.6.po | 16 +- whatsnew/3.7.po | 2 +- whatsnew/3.8.po | 4 +- whatsnew/3.9.po | 6 +- 89 files changed, 6632 insertions(+), 6681 deletions(-) diff --git a/c-api/allocation.po b/c-api/allocation.po index 53b2905968..f167bb99fa 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,16 +50,17 @@ msgstr "" msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " -"Python object header are not initialized; the object's reference count will " -"be one. The size of the memory allocation is determined from the :c:member:" -"`~PyTypeObject.tp_basicsize` field of the type object." +"Python object header are not initialized. The caller will own the only " +"reference to the object (i.e. its reference count will be one). The size of " +"the memory allocation is determined from the :c:member:`~PyTypeObject." +"tp_basicsize` field of the type object." msgstr "" "使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配" "一個新的 Python 物件。未在該 Python 物件標頭 (header) 中定義的欄位不會被初始" -"化;物件的參照計數將為一。記憶體分配大小由 type 物件的 :c:member:" -"`~PyTypeObject.tp_basicsize` 欄位來指定。" +"化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小" +"由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。" -#: ../../c-api/allocation.rst:42 +#: ../../c-api/allocation.rst:43 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " @@ -78,7 +79,7 @@ msgstr "" "於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌" "入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。" -#: ../../c-api/allocation.rst:56 +#: ../../c-api/allocation.rst:57 msgid "" "Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:" "macro:`PyObject_NewVar`. This is normally called from the :c:member:" @@ -91,7 +92,7 @@ msgstr "" "handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的" "記憶體已不再是一個有效的 Python 物件。" -#: ../../c-api/allocation.rst:65 +#: ../../c-api/allocation.rst:66 msgid "" "Object which is visible in Python as ``None``. This should only be accessed " "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " @@ -100,10 +101,10 @@ msgstr "" "這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" "取,該巨集的拿到指向該物件的指標。" -#: ../../c-api/allocation.rst:72 +#: ../../c-api/allocation.rst:73 msgid ":c:func:`PyModule_Create`" msgstr ":c:func:`PyModule_Create`" -#: ../../c-api/allocation.rst:73 +#: ../../c-api/allocation.rst:74 msgid "To allocate and create extension modules." msgstr "分配記憶體和建立擴充模組。" diff --git a/c-api/arg.po b/c-api/arg.po index 3b28780c5b..f70d871cf2 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -178,7 +178,7 @@ msgid "" "encoding." msgstr "" -#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:544 +#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:547 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]" @@ -428,7 +428,7 @@ msgid "" "c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:238 ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:238 ../../c-api/arg.rst:581 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" @@ -438,7 +438,7 @@ msgid "" "a C :c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:241 ../../c-api/arg.rst:572 +#: ../../c-api/arg.rst:241 ../../c-api/arg.rst:575 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" @@ -446,7 +446,7 @@ msgstr "``h`` (:class:`int`) [short int]" msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" -#: ../../c-api/arg.rst:245 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:245 ../../c-api/arg.rst:584 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" @@ -458,7 +458,7 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:566 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:569 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" @@ -466,7 +466,7 @@ msgstr "``i`` (:class:`int`) [int]" msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:587 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" @@ -477,7 +477,7 @@ msgid "" msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:575 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:578 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" @@ -485,7 +485,7 @@ msgstr "``l`` (:class:`int`) [long int]" msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" -#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:590 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" @@ -496,7 +496,7 @@ msgid "" msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:590 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:593 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" @@ -504,7 +504,7 @@ msgstr "``L`` (:class:`int`) [long long]" msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" -#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:596 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" @@ -516,7 +516,7 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:596 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:599 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" @@ -538,7 +538,7 @@ msgstr "" msgid "Allow :class:`bytearray` objects." msgstr "允許 :class:`bytearray` 物件。" -#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:607 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" @@ -548,7 +548,7 @@ msgid "" "1, to a C :c:expr:`int`." msgstr "" -#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:613 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" @@ -556,7 +556,7 @@ msgstr "``f`` (:class:`float`) [float]" msgid "Convert a Python floating point number to a C :c:expr:`float`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" -#: ../../c-api/arg.rst:286 ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:286 ../../c-api/arg.rst:610 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" @@ -576,22 +576,23 @@ msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" msgid "Other objects" msgstr "其他物件" -#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:299 ../../c-api/arg.rst:626 msgid "``O`` (object) [PyObject \\*]" msgstr "``O``\\ (物件)[PyObject \\*]" #: ../../c-api/arg.rst:295 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " -"program thus receives the actual object that was passed. The object's " -"reference count is not increased. The pointer stored is not ``NULL``." +"program thus receives the actual object that was passed. A new :term:" +"`strong reference` to the object is not created (i.e. its reference count is " +"not increased). The pointer stored is not ``NULL``." msgstr "" -#: ../../c-api/arg.rst:304 +#: ../../c-api/arg.rst:306 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:300 +#: ../../c-api/arg.rst:302 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -600,11 +601,11 @@ msgid "" "required type, :exc:`TypeError` is raised." msgstr "" -#: ../../c-api/arg.rst:329 ../../c-api/arg.rst:635 +#: ../../c-api/arg.rst:331 ../../c-api/arg.rst:640 msgid "``O&`` (object) [*converter*, *anything*]" msgstr "``O&``\\ (物件)[*converter*, *anything*]" -#: ../../c-api/arg.rst:309 +#: ../../c-api/arg.rst:311 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -612,7 +613,7 @@ msgid "" "*converter* function in turn is called as follows::" msgstr "" -#: ../../c-api/arg.rst:316 +#: ../../c-api/arg.rst:318 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" "expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " @@ -622,7 +623,7 @@ msgid "" "unmodified." msgstr "" -#: ../../c-api/arg.rst:322 +#: ../../c-api/arg.rst:324 msgid "" "If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " "second time if the argument parsing eventually fails, giving the converter a " @@ -631,15 +632,15 @@ msgid "" "value as in the original call." msgstr "" -#: ../../c-api/arg.rst:328 +#: ../../c-api/arg.rst:330 msgid "``Py_CLEANUP_SUPPORTED`` was added." msgstr "加入 ``Py_CLEANUP_SUPPORTED``。" -#: ../../c-api/arg.rst:338 +#: ../../c-api/arg.rst:340 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:332 +#: ../../c-api/arg.rst:334 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -648,18 +649,18 @@ msgid "" "how Python tests values for truth." msgstr "" -#: ../../c-api/arg.rst:343 ../../c-api/arg.rst:638 +#: ../../c-api/arg.rst:345 ../../c-api/arg.rst:643 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:341 +#: ../../c-api/arg.rst:343 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " "units in *items*. Format units for sequences may be nested." msgstr "" -#: ../../c-api/arg.rst:345 +#: ../../c-api/arg.rst:347 msgid "" "It is possible to pass \"long\" integers (integers whose value exceeds the " "platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " @@ -668,17 +669,17 @@ msgid "" "downcasts in C --- your mileage may vary)." msgstr "" -#: ../../c-api/arg.rst:351 +#: ../../c-api/arg.rst:353 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" msgstr "" -#: ../../c-api/arg.rst:359 +#: ../../c-api/arg.rst:361 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:355 +#: ../../c-api/arg.rst:357 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -687,11 +688,11 @@ msgid "" "corresponding C variable(s)." msgstr "" -#: ../../c-api/arg.rst:368 +#: ../../c-api/arg.rst:370 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:362 +#: ../../c-api/arg.rst:364 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -699,35 +700,36 @@ msgid "" "be specified before ``$`` in the format string." msgstr "" -#: ../../c-api/arg.rst:373 +#: ../../c-api/arg.rst:375 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:371 +#: ../../c-api/arg.rst:373 msgid "" "The list of format units ends here; the string after the colon is used as " "the function name in error messages (the \"associated value\" of the " "exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:380 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:376 +#: ../../c-api/arg.rst:378 msgid "" "The list of format units ends here; the string after the semicolon is used " "as the error message *instead* of the default error message. ``:`` and ``;" "`` mutually exclude each other." msgstr "" -#: ../../c-api/arg.rst:380 +#: ../../c-api/arg.rst:382 msgid "" "Note that any Python object references which are provided to the caller are " -"*borrowed* references; do not decrement their reference count!" +"*borrowed* references; do not release them (i.e. do not decrement their " +"reference count)!" msgstr "" -#: ../../c-api/arg.rst:383 +#: ../../c-api/arg.rst:386 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -737,7 +739,7 @@ msgid "" "unit in that case." msgstr "" -#: ../../c-api/arg.rst:389 +#: ../../c-api/arg.rst:392 msgid "" "For the conversion to succeed, the *arg* object must match the format and " "the format must be exhausted. On success, the ``PyArg_Parse*`` functions " @@ -747,24 +749,24 @@ msgid "" "the following format units are left untouched." msgstr "" -#: ../../c-api/arg.rst:398 +#: ../../c-api/arg.rst:401 msgid "API Functions" msgstr "API 函式" -#: ../../c-api/arg.rst:402 +#: ../../c-api/arg.rst:405 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " "and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:409 +#: ../../c-api/arg.rst:412 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:415 +#: ../../c-api/arg.rst:418 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -773,26 +775,26 @@ msgid "" "success; on failure, it returns false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:422 +#: ../../c-api/arg.rst:425 msgid "" "Added support for :ref:`positional-only parameters `." msgstr "" -#: ../../c-api/arg.rst:429 +#: ../../c-api/arg.rst:432 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:435 +#: ../../c-api/arg.rst:438 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: ../../c-api/arg.rst:445 +#: ../../c-api/arg.rst:448 msgid "" "Function used to deconstruct the argument lists of \"old-style\" functions " "--- these are functions which use the :const:`METH_OLDARGS` parameter " @@ -803,7 +805,7 @@ msgid "" "continue to be used for that purpose." msgstr "" -#: ../../c-api/arg.rst:456 +#: ../../c-api/arg.rst:459 msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " @@ -821,23 +823,23 @@ msgid "" "if there was a failure." msgstr "" -#: ../../c-api/arg.rst:471 +#: ../../c-api/arg.rst:474 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" msgstr "" -#: ../../c-api/arg.rst:487 +#: ../../c-api/arg.rst:490 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: ../../c-api/arg.rst:495 +#: ../../c-api/arg.rst:498 msgid "Building values" msgstr "" -#: ../../c-api/arg.rst:499 +#: ../../c-api/arg.rst:502 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -845,7 +847,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: ../../c-api/arg.rst:504 +#: ../../c-api/arg.rst:507 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -854,7 +856,7 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: ../../c-api/arg.rst:510 +#: ../../c-api/arg.rst:513 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " @@ -865,7 +867,7 @@ msgid "" "`Py_BuildValue` returns." msgstr "" -#: ../../c-api/arg.rst:518 +#: ../../c-api/arg.rst:521 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -873,155 +875,155 @@ msgid "" "be passed." msgstr "" -#: ../../c-api/arg.rst:522 +#: ../../c-api/arg.rst:525 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: ../../c-api/arg.rst:528 +#: ../../c-api/arg.rst:531 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:527 +#: ../../c-api/arg.rst:530 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: ../../c-api/arg.rst:533 +#: ../../c-api/arg.rst:536 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:531 +#: ../../c-api/arg.rst:534 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:537 +#: ../../c-api/arg.rst:540 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:536 +#: ../../c-api/arg.rst:539 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:541 +#: ../../c-api/arg.rst:544 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:540 +#: ../../c-api/arg.rst:543 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:544 ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:547 ../../c-api/arg.rst:563 msgid "Same as ``s``." msgstr "和 ``s`` 相同。" -#: ../../c-api/arg.rst:547 +#: ../../c-api/arg.rst:550 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:547 ../../c-api/arg.rst:563 +#: ../../c-api/arg.rst:550 ../../c-api/arg.rst:566 msgid "Same as ``s#``." msgstr "和 ``s#`` 相同。" -#: ../../c-api/arg.rst:552 +#: ../../c-api/arg.rst:555 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:550 +#: ../../c-api/arg.rst:553 msgid "" "Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:557 +#: ../../c-api/arg.rst:560 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:555 +#: ../../c-api/arg.rst:558 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:563 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:563 +#: ../../c-api/arg.rst:566 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:566 +#: ../../c-api/arg.rst:569 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:572 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:572 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:572 +#: ../../c-api/arg.rst:575 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:575 +#: ../../c-api/arg.rst:578 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:581 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:584 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:587 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:590 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:590 +#: ../../c-api/arg.rst:593 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:596 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:596 +#: ../../c-api/arg.rst:599 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:603 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" -#: ../../c-api/arg.rst:599 +#: ../../c-api/arg.rst:602 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." @@ -1029,7 +1031,7 @@ msgstr "" "將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`bytes`。" -#: ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:606 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." @@ -1037,52 +1039,52 @@ msgstr "" "將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`str`。" -#: ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:610 msgid "Convert a C :c:expr:`double` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:613 msgid "Convert a C :c:expr:`float` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:616 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:616 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:619 msgid "" -"Pass a Python object untouched (except for its reference count, which is " -"incremented by one). If the object passed in is a ``NULL`` pointer, it is " -"assumed that this was caused because the call producing the argument found " -"an error and set an exception. Therefore, :c:func:`Py_BuildValue` will " -"return ``NULL`` but won't raise an exception. If no exception has been " -"raised yet, :exc:`SystemError` is set." +"Pass a Python object untouched but create a new :term:`strong reference` to " +"it (i.e. its reference count is incremented by one). If the object passed in " +"is a ``NULL`` pointer, it is assumed that this was caused because the call " +"producing the argument found an error and set an exception. Therefore, :c:" +"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " +"no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -#: ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:629 msgid "``S`` (object) [PyObject \\*]" msgstr "``S``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:629 msgid "Same as ``O``." msgstr "和 ``O`` 相同。" -#: ../../c-api/arg.rst:629 +#: ../../c-api/arg.rst:634 msgid "``N`` (object) [PyObject \\*]" msgstr "``N``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:632 msgid "" -"Same as ``O``, except it doesn't increment the reference count on the " -"object. Useful when the object is created by a call to an object constructor " -"in the argument list." +"Same as ``O``, except it doesn't create a new :term:`strong reference`. " +"Useful when the object is created by a call to an object constructor in the " +"argument list." msgstr "" -#: ../../c-api/arg.rst:632 +#: ../../c-api/arg.rst:637 msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:expr:" @@ -1090,40 +1092,40 @@ msgid "" "``NULL`` if an error occurred." msgstr "" -#: ../../c-api/arg.rst:638 +#: ../../c-api/arg.rst:643 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:646 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:646 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:646 +#: ../../c-api/arg.rst:651 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:649 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:653 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:658 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." diff --git a/c-api/buffer.po b/c-api/buffer.po index 6ce805e8d0..a154f8edbe 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-17 00:04+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,19 +150,19 @@ msgstr "" #: ../../c-api/buffer.rst:104 msgid "" "A new reference to the exporting object. The reference is owned by the " -"consumer and automatically decremented and set to ``NULL`` by :c:func:" -"`PyBuffer_Release`. The field is the equivalent of the return value of any " -"standard C-API function." +"consumer and automatically released (i.e. reference count decremented) and " +"set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent " +"of the return value of any standard C-API function." msgstr "" -#: ../../c-api/buffer.rst:109 +#: ../../c-api/buffer.rst:111 msgid "" "As a special case, for *temporary* buffers that are wrapped by :c:func:" "`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " "``NULL``. In general, exporting objects MUST NOT use this scheme." msgstr "" -#: ../../c-api/buffer.rst:116 +#: ../../c-api/buffer.rst:118 msgid "" "``product(shape) * itemsize``. For contiguous arrays, this is the length of " "the underlying memory block. For non-contiguous arrays, it is the length " @@ -170,7 +170,7 @@ msgid "" "representation." msgstr "" -#: ../../c-api/buffer.rst:121 +#: ../../c-api/buffer.rst:123 msgid "" "Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if " "the buffer has been obtained by a request that guarantees contiguity. In " @@ -178,19 +178,19 @@ msgid "" "`PyBUF_WRITABLE`." msgstr "" -#: ../../c-api/buffer.rst:127 +#: ../../c-api/buffer.rst:129 msgid "" "An indicator of whether the buffer is read-only. This field is controlled by " "the :c:macro:`PyBUF_WRITABLE` flag." msgstr "" -#: ../../c-api/buffer.rst:132 +#: ../../c-api/buffer.rst:134 msgid "" "Item size in bytes of a single element. Same as the value of :func:`struct." "calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." msgstr "" -#: ../../c-api/buffer.rst:135 +#: ../../c-api/buffer.rst:137 msgid "" "Important exception: If a consumer requests a buffer without the :c:macro:" "`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to " @@ -198,47 +198,41 @@ msgid "" "original format." msgstr "" -#: ../../c-api/buffer.rst:140 +#: ../../c-api/buffer.rst:142 msgid "" "If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " "itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer." "itemsize` to navigate the buffer." msgstr "" -#: ../../c-api/buffer.rst:144 +#: ../../c-api/buffer.rst:146 msgid "" "If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:" "`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must " "disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." msgstr "" -#: ../../c-api/buffer.rst:150 +#: ../../c-api/buffer.rst:152 msgid "" "A *NUL* terminated string in :mod:`struct` module style syntax describing " "the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " "bytes) is assumed." msgstr "" -#: ../../c-api/buffer.rst:154 +#: ../../c-api/buffer.rst:156 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." msgstr "" -#: ../../c-api/buffer.rst:158 +#: ../../c-api/buffer.rst:160 msgid "" "The number of dimensions the memory represents as an n-dimensional array. If " "it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing " "a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer." -"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``." +"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``. The maximum " +"number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`." msgstr "" -#: ../../c-api/buffer.rst:163 -msgid "" -"The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions " -"to 64. Exporters MUST respect this limit, consumers of multi-dimensional " -"buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions." -msgstr "" - -#: ../../c-api/buffer.rst:169 +#: ../../c-api/buffer.rst:168 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "indicating the shape of the memory as an n-dimensional array. Note that " @@ -246,34 +240,34 @@ msgid "" "`~Py_buffer.len`." msgstr "" -#: ../../c-api/buffer.rst:174 +#: ../../c-api/buffer.rst:173 msgid "" "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " "requires special attention. See `complex arrays`_ for further information." msgstr "" -#: ../../c-api/buffer.rst:178 +#: ../../c-api/buffer.rst:177 msgid "The shape array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:182 +#: ../../c-api/buffer.rst:181 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "giving the number of bytes to skip to get to a new element in each dimension." msgstr "" -#: ../../c-api/buffer.rst:186 +#: ../../c-api/buffer.rst:185 msgid "" "Stride values can be any integer. For regular arrays, strides are usually " "positive, but a consumer MUST be able to handle the case ``strides[n] <= " "0``. See `complex arrays`_ for further information." msgstr "" -#: ../../c-api/buffer.rst:190 +#: ../../c-api/buffer.rst:189 msgid "The strides array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:194 +#: ../../c-api/buffer.rst:193 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If " "``suboffsets[n] >= 0``, the values stored along the nth dimension are " @@ -282,24 +276,24 @@ msgid "" "that no de-referencing should occur (striding in a contiguous memory block)." msgstr "" -#: ../../c-api/buffer.rst:201 +#: ../../c-api/buffer.rst:200 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed), then this " "field must be ``NULL`` (the default value)." msgstr "" -#: ../../c-api/buffer.rst:204 +#: ../../c-api/buffer.rst:203 msgid "" "This type of array representation is used by the Python Imaging Library " "(PIL). See `complex arrays`_ for further information how to access elements " "of such an array." msgstr "" -#: ../../c-api/buffer.rst:208 +#: ../../c-api/buffer.rst:207 msgid "The suboffsets array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:212 +#: ../../c-api/buffer.rst:211 msgid "" "This is for use internally by the exporting object. For example, this might " "be re-cast as an integer by the exporter and used to store flags about " @@ -307,11 +301,22 @@ msgid "" "the buffer is released. The consumer MUST NOT alter this value." msgstr "" -#: ../../c-api/buffer.rst:221 +#: ../../c-api/buffer.rst:218 +msgid "Constants:" +msgstr "" + +#: ../../c-api/buffer.rst:222 +msgid "" +"The maximum number of dimensions the memory represents. Exporters MUST " +"respect this limit, consumers of multi-dimensional buffers SHOULD be able to " +"handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." +msgstr "" + +#: ../../c-api/buffer.rst:231 msgid "Buffer request types" msgstr "" -#: ../../c-api/buffer.rst:223 +#: ../../c-api/buffer.rst:233 msgid "" "Buffers are usually obtained by sending a buffer request to an exporting " "object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical " @@ -319,16 +324,16 @@ msgid "" "argument to specify the exact buffer type it can handle." msgstr "" -#: ../../c-api/buffer.rst:228 +#: ../../c-api/buffer.rst:238 msgid "" "All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" -#: ../../c-api/buffer.rst:232 +#: ../../c-api/buffer.rst:242 msgid "request-independent fields" msgstr "" -#: ../../c-api/buffer.rst:233 +#: ../../c-api/buffer.rst:243 msgid "" "The following fields are not influenced by *flags* and must always be filled " "in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:" @@ -336,11 +341,11 @@ msgid "" "itemsize`, :c:member:`~Py_buffer.ndim`." msgstr "" -#: ../../c-api/buffer.rst:239 +#: ../../c-api/buffer.rst:249 msgid "readonly, format" msgstr "" -#: ../../c-api/buffer.rst:243 +#: ../../c-api/buffer.rst:253 msgid "" "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " "MUST provide a writable buffer or else report failure. Otherwise, the " @@ -348,13 +353,13 @@ msgid "" "MUST be consistent for all consumers." msgstr "" -#: ../../c-api/buffer.rst:250 +#: ../../c-api/buffer.rst:260 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:254 +#: ../../c-api/buffer.rst:264 msgid "" ":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next " "section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:" @@ -362,158 +367,158 @@ msgid "" "writable buffer." msgstr "" -#: ../../c-api/buffer.rst:258 +#: ../../c-api/buffer.rst:268 msgid "" ":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:" "`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)." msgstr "" -#: ../../c-api/buffer.rst:263 +#: ../../c-api/buffer.rst:273 msgid "shape, strides, suboffsets" msgstr "" -#: ../../c-api/buffer.rst:265 +#: ../../c-api/buffer.rst:275 msgid "" "The flags that control the logical structure of the memory are listed in " "decreasing order of complexity. Note that each flag contains all bits of the " "flags below it." msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "Request" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "shape" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "strides" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "suboffsets" msgstr "" -#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:276 -#: ../../c-api/buffer.rst:278 ../../c-api/buffer.rst:298 -#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 -#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:323 -#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:286 +#: ../../c-api/buffer.rst:288 ../../c-api/buffer.rst:308 +#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:347 msgid "yes" msgstr "" -#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:323 -#: ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:335 msgid "if needed" msgstr "" -#: ../../c-api/buffer.rst:276 ../../c-api/buffer.rst:278 -#: ../../c-api/buffer.rst:280 ../../c-api/buffer.rst:298 -#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 -#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:286 ../../c-api/buffer.rst:288 +#: ../../c-api/buffer.rst:290 ../../c-api/buffer.rst:308 +#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:347 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:287 +#: ../../c-api/buffer.rst:297 msgid "contiguity requests" msgstr "" -#: ../../c-api/buffer.rst:289 +#: ../../c-api/buffer.rst:299 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " "must be C-contiguous." msgstr "" -#: ../../c-api/buffer.rst:296 ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:306 ../../c-api/buffer.rst:331 msgid "contig" msgstr "" -#: ../../c-api/buffer.rst:298 ../../c-api/buffer.rst:304 -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:308 ../../c-api/buffer.rst:314 +#: ../../c-api/buffer.rst:345 ../../c-api/buffer.rst:347 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:300 +#: ../../c-api/buffer.rst:310 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:302 +#: ../../c-api/buffer.rst:312 msgid "C or F" msgstr "C 或 F" -#: ../../c-api/buffer.rst:304 +#: ../../c-api/buffer.rst:314 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:309 +#: ../../c-api/buffer.rst:319 msgid "compound requests" msgstr "" -#: ../../c-api/buffer.rst:311 +#: ../../c-api/buffer.rst:321 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " "frequently used combinations as single flags." msgstr "" -#: ../../c-api/buffer.rst:315 +#: ../../c-api/buffer.rst:325 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:331 msgid "readonly" msgstr "" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:331 msgid "format" msgstr "" -#: ../../c-api/buffer.rst:323 ../../c-api/buffer.rst:325 -#: ../../c-api/buffer.rst:327 ../../c-api/buffer.rst:329 -#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:337 ../../c-api/buffer.rst:339 +#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:343 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:323 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:345 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:329 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:339 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:347 msgid "1 or 0" msgstr "1 或 0" -#: ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:352 msgid "Complex arrays" msgstr "" -#: ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:355 msgid "NumPy-style: shape and strides" msgstr "" -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:357 msgid "" "The logical structure of NumPy-style arrays is defined by :c:member:" "`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." "shape` and :c:member:`~Py_buffer.strides`." msgstr "" -#: ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:360 msgid "" "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer." "buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In " @@ -521,25 +526,25 @@ msgid "" "strides` are ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:364 msgid "" "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " "standard n-dimensional C-array. Otherwise, the consumer must access an n-" "dimensional array as follows:" msgstr "" -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:374 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " "the actual memory block. An exporter can check the validity of a buffer with " "this function:" msgstr "" -#: ../../c-api/buffer.rst:398 +#: ../../c-api/buffer.rst:408 msgid "PIL-style: shape, strides and suboffsets" msgstr "" -#: ../../c-api/buffer.rst:400 +#: ../../c-api/buffer.rst:410 msgid "" "In addition to the regular items, PIL-style arrays can contain pointers that " "must be followed in order to get to the next element in a dimension. For " @@ -550,32 +555,32 @@ msgid "" "x[2][3]`` arrays that can be located anywhere in memory." msgstr "" -#: ../../c-api/buffer.rst:409 +#: ../../c-api/buffer.rst:419 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-``NULL`` " "strides and suboffsets::" msgstr "" -#: ../../c-api/buffer.rst:428 +#: ../../c-api/buffer.rst:438 msgid "Buffer-related functions" msgstr "" -#: ../../c-api/buffer.rst:432 +#: ../../c-api/buffer.rst:442 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. This function always succeeds." msgstr "" -#: ../../c-api/buffer.rst:439 +#: ../../c-api/buffer.rst:449 msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " -"the exporter cannot provide a buffer of the exact type, it MUST raise :c:" -"data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +"the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" +"`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/buffer.rst:444 +#: ../../c-api/buffer.rst:454 msgid "" "On success, fill in *view*, set ``view->obj`` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " @@ -583,7 +588,7 @@ msgid "" "instead of *exporter* (See :ref:`Buffer Object Structures `)." msgstr "" -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:459 msgid "" "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " "to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:" @@ -591,26 +596,27 @@ msgid "" "`PyBuffer_Release` must be called exactly once." msgstr "" -#: ../../c-api/buffer.rst:457 +#: ../../c-api/buffer.rst:467 msgid "" -"Release the buffer *view* and decrement the reference count for ``view-" +"Release the buffer *view* and release the :term:`strong reference` (i.e. " +"decrement the reference count) to the view's supporting object, ``view-" ">obj``. This function MUST be called when the buffer is no longer being " "used, otherwise reference leaks may occur." msgstr "" -#: ../../c-api/buffer.rst:461 +#: ../../c-api/buffer.rst:472 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../c-api/buffer.rst:467 +#: ../../c-api/buffer.rst:478 msgid "" "Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" "`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" -#: ../../c-api/buffer.rst:475 +#: ../../c-api/buffer.rst:486 msgid "" "Return ``1`` if the memory defined by the *view* is C-style (*order* is " "``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " @@ -618,69 +624,69 @@ msgid "" "succeeds." msgstr "" -#: ../../c-api/buffer.rst:482 +#: ../../c-api/buffer.rst:493 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." msgstr "" -#: ../../c-api/buffer.rst:488 +#: ../../c-api/buffer.rst:499 msgid "" "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " "``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " "success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:495 +#: ../../c-api/buffer.rst:506 msgid "" "Copy *len* bytes from *src* to its contiguous representation in *buf*. " "*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " "ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:499 +#: ../../c-api/buffer.rst:510 msgid "This function fails if *len* != *src->len*." msgstr "" -#: ../../c-api/buffer.rst:504 +#: ../../c-api/buffer.rst:515 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." msgstr "" -#: ../../c-api/buffer.rst:507 +#: ../../c-api/buffer.rst:518 msgid "``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:511 +#: ../../c-api/buffer.rst:522 msgid "" "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " "if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" -#: ../../c-api/buffer.rst:518 +#: ../../c-api/buffer.rst:529 msgid "" "Handle buffer requests for an exporter that wants to expose *buf* of size " "*len* with writability set according to *readonly*. *buf* is interpreted as " "a sequence of unsigned bytes." msgstr "" -#: ../../c-api/buffer.rst:522 +#: ../../c-api/buffer.rst:533 msgid "" "The *flags* argument indicates the request type. This function always fills " "in *view* as specified by flags, unless *buf* has been designated as read-" "only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" -#: ../../c-api/buffer.rst:526 +#: ../../c-api/buffer.rst:537 msgid "" "On success, set ``view->obj`` to a new reference to *exporter* and return 0. " -"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` " -"and return ``-1``;" +"Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " +"return ``-1``;" msgstr "" -#: ../../c-api/buffer.rst:530 +#: ../../c-api/buffer.rst:541 msgid "" "If this function is used as part of a :ref:`getbufferproc `, " "*exporter* MUST be set to the exporting object and *flags* must be passed " @@ -707,14 +713,14 @@ msgstr "buffer object(緩衝物件)" msgid "PyBufferProcs" msgstr "PyBufferProcs" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" diff --git a/c-api/bytes.po b/c-api/bytes.po index ae0d5ed2b7..dc329a20bf 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -310,8 +310,8 @@ msgstr "" #: ../../c-api/bytes.rst:186 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " -"appended to *bytes*. This version decrements the reference count of " -"*newpart*." +"appended to *bytes*. This version releases the :term:`strong reference` to " +"*newpart* (i.e. decrements its reference count)." msgstr "" #: ../../c-api/bytes.rst:193 diff --git a/c-api/code.po b/c-api/code.po index beed548be4..3ffca4a8c2 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-07-30 00:03+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-" @@ -70,9 +70,9 @@ msgid "" "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:48 ../../c-api/code.rst:68 -msgid "Added ``exceptiontable`` parameter." -msgstr "" +#: ../../c-api/code.rst:48 +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" #: ../../c-api/code.rst:55 msgid "" @@ -91,6 +91,10 @@ msgstr "" msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" +#: ../../c-api/code.rst:68 +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" + #: ../../c-api/code.rst:73 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c539882ea8..2950357cf0 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -153,18 +153,18 @@ msgstr "" msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " -"e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference " -"count. The second argument is an error message; it is decoded from " -"``'utf-8'``." +"e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong " +"reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an " +"error message; it is decoded from ``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:119 +#: ../../c-api/exceptions.rst:120 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: ../../c-api/exceptions.rst:125 +#: ../../c-api/exceptions.rst:126 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -172,31 +172,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:134 +#: ../../c-api/exceptions.rst:135 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/exceptions.rst:142 +#: ../../c-api/exceptions.rst:143 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:147 +#: ../../c-api/exceptions.rst:148 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: ../../c-api/exceptions.rst:154 +#: ../../c-api/exceptions.rst:155 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: ../../c-api/exceptions.rst:163 +#: ../../c-api/exceptions.rst:164 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -210,7 +210,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:177 +#: ../../c-api/exceptions.rst:178 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -218,21 +218,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:186 +#: ../../c-api/exceptions.rst:187 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: ../../c-api/exceptions.rst:195 +#: ../../c-api/exceptions.rst:196 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:202 +#: ../../c-api/exceptions.rst:203 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`!" @@ -245,44 +245,44 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:211 ../../c-api/exceptions.rst:219 -#: ../../c-api/exceptions.rst:228 ../../c-api/exceptions.rst:236 -#: ../../c-api/exceptions.rst:244 ../../c-api/exceptions.rst:254 +#: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 +#: ../../c-api/exceptions.rst:229 ../../c-api/exceptions.rst:237 +#: ../../c-api/exceptions.rst:245 ../../c-api/exceptions.rst:255 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:216 +#: ../../c-api/exceptions.rst:217 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:224 +#: ../../c-api/exceptions.rst:225 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " "filename is given as a C string. *filename* is decoded from the filesystem " "encoding (:func:`os.fsdecode`)." msgstr "" -#: ../../c-api/exceptions.rst:233 +#: ../../c-api/exceptions.rst:234 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " "additional parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:241 +#: ../../c-api/exceptions.rst:242 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:251 +#: ../../c-api/exceptions.rst:252 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:259 +#: ../../c-api/exceptions.rst:260 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -290,13 +290,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:269 +#: ../../c-api/exceptions.rst:270 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:277 +#: ../../c-api/exceptions.rst:278 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -304,19 +304,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:287 +#: ../../c-api/exceptions.rst:288 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:295 +#: ../../c-api/exceptions.rst:296 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:301 +#: ../../c-api/exceptions.rst:302 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -324,11 +324,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:308 +#: ../../c-api/exceptions.rst:309 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:310 +#: ../../c-api/exceptions.rst:311 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -344,7 +344,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:325 +#: ../../c-api/exceptions.rst:326 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -354,7 +354,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:332 +#: ../../c-api/exceptions.rst:333 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -363,14 +363,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:338 +#: ../../c-api/exceptions.rst:339 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:345 +#: ../../c-api/exceptions.rst:346 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -378,31 +378,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:356 +#: ../../c-api/exceptions.rst:357 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:363 +#: ../../c-api/exceptions.rst:364 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:372 +#: ../../c-api/exceptions.rst:373 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:379 +#: ../../c-api/exceptions.rst:380 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:383 +#: ../../c-api/exceptions.rst:384 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -411,11 +411,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:389 +#: ../../c-api/exceptions.rst:390 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:393 +#: ../../c-api/exceptions.rst:394 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -423,14 +423,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:401 +#: ../../c-api/exceptions.rst:402 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:408 +#: ../../c-api/exceptions.rst:409 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -438,43 +438,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:416 +#: ../../c-api/exceptions.rst:417 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:419 +#: ../../c-api/exceptions.rst:420 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:422 ../../c-api/exceptions.rst:466 +#: ../../c-api/exceptions.rst:423 ../../c-api/exceptions.rst:467 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:432 +#: ../../c-api/exceptions.rst:433 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:440 +#: ../../c-api/exceptions.rst:441 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:446 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:454 +#: ../../c-api/exceptions.rst:455 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:456 +#: ../../c-api/exceptions.rst:457 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -483,17 +483,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:463 +#: ../../c-api/exceptions.rst:464 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:482 +#: ../../c-api/exceptions.rst:483 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:484 +#: ../../c-api/exceptions.rst:485 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -506,20 +506,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:498 +#: ../../c-api/exceptions.rst:499 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:507 +#: ../../c-api/exceptions.rst:508 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:510 +#: ../../c-api/exceptions.rst:511 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -529,14 +529,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:518 +#: ../../c-api/exceptions.rst:519 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:529 +#: ../../c-api/exceptions.rst:530 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -544,7 +544,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:536 +#: ../../c-api/exceptions.rst:537 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -552,14 +552,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:545 +#: ../../c-api/exceptions.rst:546 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:552 +#: ../../c-api/exceptions.rst:553 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -567,7 +567,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:561 +#: ../../c-api/exceptions.rst:562 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -577,7 +577,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:570 +#: ../../c-api/exceptions.rst:571 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -585,7 +585,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:580 +#: ../../c-api/exceptions.rst:581 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -595,7 +595,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:590 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -603,22 +603,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:596 +#: ../../c-api/exceptions.rst:597 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:604 +#: ../../c-api/exceptions.rst:605 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:614 +#: ../../c-api/exceptions.rst:615 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:616 +#: ../../c-api/exceptions.rst:617 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -626,7 +626,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:621 +#: ../../c-api/exceptions.rst:622 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -635,44 +635,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:627 +#: ../../c-api/exceptions.rst:628 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:630 +#: ../../c-api/exceptions.rst:631 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:634 +#: ../../c-api/exceptions.rst:635 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:646 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:649 ../../c-api/exceptions.rst:676 +#: ../../c-api/exceptions.rst:650 ../../c-api/exceptions.rst:677 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:659 +#: ../../c-api/exceptions.rst:660 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:663 +#: ../../c-api/exceptions.rst:664 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -680,27 +680,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:669 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:671 +#: ../../c-api/exceptions.rst:672 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:684 +#: ../../c-api/exceptions.rst:685 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:688 +#: ../../c-api/exceptions.rst:689 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -708,15 +708,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:694 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:698 +#: ../../c-api/exceptions.rst:699 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:702 +#: ../../c-api/exceptions.rst:703 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -725,7 +725,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:708 +#: ../../c-api/exceptions.rst:709 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -735,31 +735,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:717 +#: ../../c-api/exceptions.rst:718 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:725 +#: ../../c-api/exceptions.rst:726 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:729 +#: ../../c-api/exceptions.rst:730 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:736 +#: ../../c-api/exceptions.rst:737 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:742 +#: ../../c-api/exceptions.rst:743 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -767,41 +767,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:750 +#: ../../c-api/exceptions.rst:751 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:757 +#: ../../c-api/exceptions.rst:758 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:764 +#: ../../c-api/exceptions.rst:765 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:768 +#: ../../c-api/exceptions.rst:769 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:773 +#: ../../c-api/exceptions.rst:774 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:779 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:782 +#: ../../c-api/exceptions.rst:783 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -813,72 +813,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:796 +#: ../../c-api/exceptions.rst:797 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:798 +#: ../../c-api/exceptions.rst:799 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:802 +#: ../../c-api/exceptions.rst:803 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:809 +#: ../../c-api/exceptions.rst:810 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:815 +#: ../../c-api/exceptions.rst:816 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:821 +#: ../../c-api/exceptions.rst:822 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:829 +#: ../../c-api/exceptions.rst:830 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:836 +#: ../../c-api/exceptions.rst:837 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:844 +#: ../../c-api/exceptions.rst:845 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:851 +#: ../../c-api/exceptions.rst:852 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:857 +#: ../../c-api/exceptions.rst:858 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:864 +#: ../../c-api/exceptions.rst:865 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:866 +#: ../../c-api/exceptions.rst:867 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -888,44 +888,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:876 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:877 +#: ../../c-api/exceptions.rst:878 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:881 +#: ../../c-api/exceptions.rst:882 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:885 +#: ../../c-api/exceptions.rst:886 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:889 ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:898 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:894 +#: ../../c-api/exceptions.rst:895 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:900 +#: ../../c-api/exceptions.rst:901 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -934,13 +934,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:908 +#: ../../c-api/exceptions.rst:909 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:912 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -948,30 +948,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:918 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:922 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:927 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:933 +#: ../../c-api/exceptions.rst:934 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:936 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -979,451 +979,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 -#: ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1175 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1175 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 -#: ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1175 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:999 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:999 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:998 ../../c-api/exceptions.rst:1000 -#: ../../c-api/exceptions.rst:1002 ../../c-api/exceptions.rst:1048 -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:999 ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1061 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1001 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1001 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1003 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1005 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1007 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1009 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1020 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1020 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1030 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1030 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1034 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1034 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1036 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1036 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1038 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1038 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1044 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1044 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1050 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1050 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1106 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1443,58 +1443,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1118 +#: ../../c-api/exceptions.rst:1119 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1122 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1132 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1134 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1136 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1139 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1141 ../../c-api/exceptions.rst:1202 +#: ../../c-api/exceptions.rst:1142 ../../c-api/exceptions.rst:1203 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1144 +#: ../../c-api/exceptions.rst:1145 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:1148 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1153 +#: ../../c-api/exceptions.rst:1154 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1155 +#: ../../c-api/exceptions.rst:1156 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1502,393 +1502,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1179 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1179 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1181 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1183 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1184 +#: ../../c-api/exceptions.rst:1185 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1184 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1186 +#: ../../c-api/exceptions.rst:1187 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1186 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1190 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1190 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1192 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1192 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1200 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1206 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:161 +#: ../../c-api/exceptions.rst:162 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/init.po b/c-api/init.po index ea7e11da21..0247553cf1 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-01 00:03+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1770,40 +1770,41 @@ msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " "is currently active. Otherwise only multi-phase init extension modules (see :" -"pep:`489`) may be imported." +"pep:`489`) may be imported. (Also see :c:macro:" +"`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1559 +#: ../../c-api/init.rst:1560 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1564 +#: ../../c-api/init.rst:1565 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1571 +#: ../../c-api/init.rst:1572 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1576 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1580 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1581 +#: ../../c-api/init.rst:1582 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1595 +#: ../../c-api/init.rst:1596 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1816,13 +1817,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1606 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1608 +#: ../../c-api/init.rst:1609 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1833,7 +1834,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1617 +#: ../../c-api/init.rst:1618 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1845,13 +1846,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1628 +#: ../../c-api/init.rst:1629 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1642 +#: ../../c-api/init.rst:1643 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1859,11 +1860,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1651 +#: ../../c-api/init.rst:1652 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1654 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1871,7 +1872,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1659 +#: ../../c-api/init.rst:1660 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1883,7 +1884,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1670 +#: ../../c-api/init.rst:1671 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1893,7 +1894,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1690 +#: ../../c-api/init.rst:1691 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1902,7 +1903,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1703 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1912,17 +1913,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1710 +#: ../../c-api/init.rst:1711 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1716 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1717 +#: ../../c-api/init.rst:1718 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1934,7 +1935,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1728 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -1948,7 +1949,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1739 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -1956,7 +1957,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1743 +#: ../../c-api/init.rst:1744 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -1966,11 +1967,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1754 +#: ../../c-api/init.rst:1755 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1756 +#: ../../c-api/init.rst:1757 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1983,7 +1984,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1767 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1992,7 +1993,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1772 +#: ../../c-api/init.rst:1773 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2004,25 +2005,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1783 +#: ../../c-api/init.rst:1784 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1785 +#: ../../c-api/init.rst:1786 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1795 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1798 +#: ../../c-api/init.rst:1799 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2030,17 +2031,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1804 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1804 +#: ../../c-api/init.rst:1805 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1808 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2048,20 +2049,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1812 +#: ../../c-api/init.rst:1813 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1815 +#: ../../c-api/init.rst:1816 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1821 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2071,7 +2072,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1827 +#: ../../c-api/init.rst:1828 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2079,18 +2080,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:1839 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1843 +#: ../../c-api/init.rst:1844 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1848 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2100,7 +2101,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1857 +#: ../../c-api/init.rst:1858 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2112,66 +2113,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1867 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1867 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:1869 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1868 ../../c-api/init.rst:1873 -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1869 ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1885 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1871 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1871 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1874 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1876 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1876 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1879 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1878 ../../c-api/init.rst:1880 -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1881 +#: ../../c-api/init.rst:1883 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1881 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1883 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1885 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:1890 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2180,7 +2181,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1898 +#: ../../c-api/init.rst:1899 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2192,7 +2193,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1910 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2200,31 +2201,31 @@ msgid "" "*0* on that frame." msgstr "" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1917 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1922 +#: ../../c-api/init.rst:1923 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1929 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1934 +#: ../../c-api/init.rst:1935 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1940 +#: ../../c-api/init.rst:1941 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2232,7 +2233,7 @@ msgid "" "attr:`f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1948 +#: ../../c-api/init.rst:1949 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2242,29 +2243,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1955 +#: ../../c-api/init.rst:1956 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1964 -#: ../../c-api/init.rst:1983 ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:1958 ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:1984 ../../c-api/init.rst:1991 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1961 +#: ../../c-api/init.rst:1962 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1967 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:1975 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2275,65 +2276,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1981 +#: ../../c-api/init.rst:1982 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1987 +#: ../../c-api/init.rst:1988 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1992 +#: ../../c-api/init.rst:1993 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2002 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2006 +#: ../../c-api/init.rst:2007 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2012 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2016 +#: ../../c-api/init.rst:2017 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2021 +#: ../../c-api/init.rst:2022 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2027 +#: ../../c-api/init.rst:2028 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2033 +#: ../../c-api/init.rst:2034 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2041 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2045 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2343,19 +2344,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2052 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2054 +#: ../../c-api/init.rst:2055 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2059 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2363,22 +2364,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2066 +#: ../../c-api/init.rst:2067 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2069 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2074 +#: ../../c-api/init.rst:2075 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2079 +#: ../../c-api/init.rst:2080 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2386,52 +2387,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2084 +#: ../../c-api/init.rst:2085 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2091 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2095 +#: ../../c-api/init.rst:2096 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2097 +#: ../../c-api/init.rst:2098 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2104 +#: ../../c-api/init.rst:2105 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2111 +#: ../../c-api/init.rst:2112 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2117 +#: ../../c-api/init.rst:2118 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2122 +#: ../../c-api/init.rst:2123 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2124 +#: ../../c-api/init.rst:2125 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2439,13 +2440,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2132 +#: ../../c-api/init.rst:2133 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2138 +#: ../../c-api/init.rst:2139 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2454,7 +2455,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2148 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2463,31 +2464,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2156 +#: ../../c-api/init.rst:2157 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2163 +#: ../../c-api/init.rst:2164 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2171 +#: ../../c-api/init.rst:2172 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2174 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2178 +#: ../../c-api/init.rst:2179 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2496,7 +2497,7 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2184 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." @@ -2519,20 +2520,20 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 -#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1587 -#: ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1588 +#: ../../c-api/init.rst:1683 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "sys" msgstr "sys" @@ -2552,11 +2553,11 @@ msgstr "PySys_SetArgv()" msgid "PySys_SetArgvEx()" msgstr "PySys_SetArgvEx()" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1648 ../../c-api/init.rst:1701 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1647 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1648 msgid "Py_Initialize()" msgstr "Py_Initialize()" @@ -2656,22 +2657,22 @@ msgstr "PyEval_ReleaseThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1678 msgid "close() (in module os)" msgstr "close()(sys 模組中)" -#: ../../c-api/init.rst:1792 +#: ../../c-api/init.rst:1793 msgid "Py_AddPendingCall()" msgstr "Py_AddPendingCall()" diff --git a/c-api/init_config.po b/c-api/init_config.po index 3515990b20..6958b33c49 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -1422,7 +1422,7 @@ msgid "Value of the :option:`-m` command line option." msgstr "" #: ../../c-api/init_config.rst:1112 -msgid "Show total reference count at exit?" +msgid "Show total reference count at exit (excluding immortal objects)?" msgstr "" #: ../../c-api/init_config.rst:1114 diff --git a/c-api/intro.po b/c-api/intro.po index 3434e5e689..0808d31558 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -441,109 +441,116 @@ msgstr "參照計數" #: ../../c-api/intro.rst:290 msgid "" "The reference count is important because today's computers have a finite " -"(and often severely limited) memory size; it counts how many different " -"places there are that have a reference to an object. Such a place could be " -"another object, or a global (or static) C variable, or a local variable in " -"some C function. When an object's reference count becomes zero, the object " -"is deallocated. If it contains references to other objects, their " -"reference count is decremented. Those other objects may be deallocated in " -"turn, if this decrement makes their reference count become zero, and so on. " -"(There's an obvious problem with objects that reference each other here; " -"for now, the solution is \"don't do that.\")" +"(and often severely limited) memory size; it counts how many different " +"places there are that have a :term:`strong reference` to an object. Such a " +"place could be another object, or a global (or static) C variable, or a " +"local variable in some C function. When the last :term:`strong reference` to " +"an object is released (i.e. its reference count becomes zero), the object is " +"deallocated. If it contains references to other objects, those references " +"are released. Those other objects may be deallocated in turn, if there are " +"no more references to them, and so on. (There's an obvious problem with " +"objects that reference each other here; for now, the solution is \"don't do " +"that.\")" msgstr "" "參照計數很重要,因為現今的電腦記憶體大小是有限的(而且通常是非常有限的);它" -"計算有多少個不同的地方參照了一個物件。這樣的地方可以是另一個物件,或者全域" -"(或靜態)C 變數,或者某個 C 函式中的本地變數。當一個物件的參照計數變為零時," -"該物件將被釋放 (deallocated)。如果它包含對其他物件的參照,則它們的參照計數會" -"減少。如果這樣的減少使它們的參照計數變為零,則可以依次釋放那些其他物件,依此" -"類推。 (此處相互參照物件的存在是個明顯的問題;目前,解決方案是「就不要那樣" -"做」。)" - -#: ../../c-api/intro.rst:305 -msgid "" -"Reference counts are always manipulated explicitly. The normal way is to " -"use the macro :c:func:`Py_INCREF` to increment an object's reference count " -"by one, and :c:func:`Py_DECREF` to decrement it by one. The :c:func:" +"計算有多少個不同的地方用有了一個物件的\\ :term:`強參照 `。" +"這樣的地方可以是另一個物件,或者全域(或靜態)C 變數,或者某個 C 函式中的本地" +"變數。當一個物件的最後一個\\ :term:`強參照 `\\ 被釋放時(即" +"其的參照計數變為零),該物件將被解除配置 (deallocated)。如果它包含對其他物件" +"的參照,則它們的參照會被釋放。如果這樣的釋放使得再也沒有任何對於它們的參照," +"則可以依次為那些其他物件解除配置,依此類推。 (此處相互參照物件的存在是個明顯" +"的問題;目前,解決方案是「就不要那樣做」。)" + +#: ../../c-api/intro.rst:307 +msgid "" +"Reference counts are always manipulated explicitly. The normal way is to " +"use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " +"increment its reference count by one), and :c:func:`Py_DECREF` to release " +"that reference (i.e. decrement the reference count by one). The :c:func:" "`Py_DECREF` macro is considerably more complex than the incref one, since it " "must check whether the reference count becomes zero and then cause the " -"object's deallocator to be called. The deallocator is a function pointer " +"object's deallocator to be called. The deallocator is a function pointer " "contained in the object's type structure. The type-specific deallocator " -"takes care of decrementing the reference counts for other objects contained " -"in the object if this is a compound object type, such as a list, as well as " -"performing any additional finalization that's needed. There's no chance " -"that the reference count can overflow; at least as many bits are used to " -"hold the reference count as there are distinct memory locations in virtual " -"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the " -"reference count increment is a simple operation." -msgstr "" -"參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 將物件的參" -"照計數加一,並使用巨集 :c:func:`Py_DECREF` 來將其減一。:c:func:`Py_DECREF` 巨" -"集比 incref 巨集複雜得多,因為它必須檢查參照計數是否變為零,然後呼叫物件的釋" -"放器 (deallocator)。釋放器是包含在物件型別結構中的函式指標。特定型別的釋放" -"器,在如果是一個複合物件型別(例如 list)時負責減少物件中包含的其他物件的參照" -"計數,並執行任何需要的額外完結步驟。參照計數不可能溢出;至少與虛擬記憶體中用" -"來保存參照計數的不同記憶體位置數量一樣多的位元會被使用(假設 " -"``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加是一個簡單的操作。" - -#: ../../c-api/intro.rst:319 -msgid "" -"It is not necessary to increment an object's reference count for every " -"local variable that contains a pointer to an object. In theory, the " -"object's reference count goes up by one when the variable is made to point " -"to it and it goes down by one when the variable goes out of scope. " -"However, these two cancel each other out, so at the end the reference count " -"hasn't changed. The only real reason to use the reference count is to " -"prevent the object from being deallocated as long as our variable is " -"pointing to it. If we know that there is at least one other reference to " -"the object that lives at least as long as our variable, there is no need to " -"increment the reference count temporarily. An important situation where " -"this arises is in objects that are passed as arguments to C functions in an " -"extension module that are called from Python; the call mechanism guarantees " -"to hold a reference to every argument for the duration of the call." -msgstr "" -"沒有必要為每個包含物件指標的本地變數增加物件的參照計數。理論上,當變數指向它" -"時,物件的參照計數會增加 1,而當變數離開作用域時就會減少 1。然而這兩者會相互" -"抵消,所以最後參照計數沒有改變。使用參照計數的唯一真正原因是防止物件還有變數" -"指向它時被釋放。如果我們知道至少有一個物件的其他參照生存了至少與我們的變數一" -"樣久,就不需要臨時增加參照計數。出現這種情況的一個重要情況是在從 Python 呼叫" -"的擴充模組中作為引數傳遞給 C 函式的物件;呼叫機制保證在呼叫期間保持對每個參數" -"的參照。" - -#: ../../c-api/intro.rst:333 +"takes care of releasing references for other objects contained in the object " +"if this is a compound object type, such as a list, as well as performing any " +"additional finalization that's needed. There's no chance that the reference " +"count can overflow; at least as many bits are used to hold the reference " +"count as there are distinct memory locations in virtual memory (assuming " +"``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count " +"increment is a simple operation." +msgstr "" +"參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 來取得對於" +"物件的參照(即參照計數加一),並使用巨集 :c:func:`Py_DECREF` 來釋放參照(即將" +"參照計數減一)。:c:func:`Py_DECREF` 巨集比 incref 巨集複雜得多,因為它必須檢" +"查參照計數是否變為零,然後呼叫物件的釋放器 (deallocator)。釋放器是包含在物件" +"型別結構中的函式指標。特定型別的釋放器,在如果是一個複合物件型別(例如 list)" +"時負責釋放物件中包含的其他物件的參照,並執行任何需要的額外完結步驟。參照計數" +"不可能溢出;至少與虛擬記憶體中用來保存參照計數的不同記憶體位置數量一樣多的位" +"元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" +"是一個簡單的操作。" + +#: ../../c-api/intro.rst:323 +msgid "" +"It is not necessary to hold a :term:`strong reference` (i.e. increment the " +"reference count) for every local variable that contains a pointer to an " +"object. In theory, the object's reference count goes up by one when the " +"variable is made to point to it and it goes down by one when the variable " +"goes out of scope. However, these two cancel each other out, so at the end " +"the reference count hasn't changed. The only real reason to use the " +"reference count is to prevent the object from being deallocated as long as " +"our variable is pointing to it. If we know that there is at least one " +"other reference to the object that lives at least as long as our variable, " +"there is no need to take a new :term:`strong reference` (i.e. increment the " +"reference count) temporarily. An important situation where this arises is in " +"objects that are passed as arguments to C functions in an extension module " +"that are called from Python; the call mechanism guarantees to hold a " +"reference to every argument for the duration of the call." +msgstr "" +"沒有必要為每個包含物件指標的本地變數物件都持有一個\\ :term:`強參照 `\\ (即增加參照計數)。理論上,當變數指向它時,物件的參照計數會增" +"加 1,而當變數離開作用域時就會減少 1。然而這兩者會相互抵消,所以最後參照計數" +"沒有改變。使用參照計數的唯一真正原因是防止物件還有變數指向它時被解除配置。如" +"果我們知道至少有一個物件的其他參照生存了至少與我們的變數一樣久,就不需要臨時" +"增加建立新的\\ :term:`強參照 `\\ (即增加參照計數)。出現這" +"種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" +"件;呼叫機制保證在呼叫期間保持對每個參數的參照。" + +#: ../../c-api/intro.rst:339 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " -"it for a while without incrementing its reference count. Some other " -"operation might conceivably remove the object from the list, decrementing " -"its reference count and possibly deallocating it. The real danger is that " -"innocent-looking operations may invoke arbitrary Python code which could do " -"this; there is a code path which allows control to flow back to the user " -"from a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous." +"it for a while without taking a new reference. Some other operation might " +"conceivably remove the object from the list, releasing that reference, and " +"possibly deallocating it. The real danger is that innocent-looking " +"operations may invoke arbitrary Python code which could do this; there is a " +"code path which allows control to flow back to the user from a :c:func:" +"`Py_DECREF`, so almost any operation is potentially dangerous." msgstr "" -"然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不增加其參" -"照計數。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配" -"它。真正的危險是看似無害的操作可能會呼叫可以執行此操作的任意 Python 程式碼;" -"有一個程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作" -"都有潛在危險。" +"然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不取得其參" +"照。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配它。真" +"正的危險是看似無害的操作可能會呼叫可以執行此操作的任意 Python 程式碼;有一個" +"程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" +"在危險。" -#: ../../c-api/intro.rst:341 +#: ../../c-api/intro.rst:347 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " -"``PyMapping_``). These operations always increment the reference count of " -"the object they return. This leaves the caller with the responsibility to " -"call :c:func:`Py_DECREF` when they are done with the result; this soon " -"becomes second nature." +"``PyMapping_``). These operations always create a new :term:`strong " +"reference` (i.e. increment the reference count) of the object they return. " +"This leaves the caller with the responsibility to call :c:func:`Py_DECREF` " +"when they are done with the result; this soon becomes second nature." msgstr "" "一種安全的方法是都使用通用 (generics) 操作(名稱以 ``PyObject_``、" -"``PyNumber_``、``PySequence_`` 或 ``PyMapping_`` 開頭的函式)。這些操作總是增" -"加它們回傳的物件的參照計數。這讓呼叫者有責任在處理完結果後呼叫 :c:func:" -"`Py_DECREF`;這就成為第二本質。" +"``PyNumber_``、``PySequence_`` 或 ``PyMapping_`` 開頭的函式)。這些操作總是建" +"立新的對於它們回傳物件的\\ :term:`強參照 `\\ (即增加其參照" +"計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" +"本質。" -#: ../../c-api/intro.rst:351 +#: ../../c-api/intro.rst:358 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:353 +#: ../../c-api/intro.rst:360 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -551,8 +558,8 @@ msgid "" "shared). \"Owning a reference\" means being responsible for calling " "Py_DECREF on it when the reference is no longer needed. Ownership can also " "be transferred, meaning that the code that receives ownership of the " -"reference then becomes responsible for eventually decref'ing it by calling :" -"c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " +"reference then becomes responsible for eventually releasing it by calling :c:" +"func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " "passing on this responsibility (usually to its caller). When a function " "passes ownership of a reference on to its caller, the caller is said to " "receive a *new* reference. When no ownership is transferred, the caller is " @@ -563,12 +570,12 @@ msgstr "" "於參照而非物件(物件並非被擁有,它們總是共享的)。「擁有參照」意味著當不再需" "要該參照時,負責在其上呼叫 Py_DECREF。所有權也可以轉移,這意味著接收參照所有" "權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` 或 :c:func:" -"`Py_XDECREF` 減少參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當" +"`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當" "一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ *新*\\ 參" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:366 +#: ../../c-api/intro.rst:373 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -580,7 +587,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:376 +#: ../../c-api/intro.rst:383 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -597,7 +604,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:391 +#: ../../c-api/intro.rst:398 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -608,7 +615,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。" -#: ../../c-api/intro.rst:396 +#: ../../c-api/intro.rst:403 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -620,7 +627,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:401 +#: ../../c-api/intro.rst:408 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -628,7 +635,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:404 +#: ../../c-api/intro.rst:411 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -643,22 +650,22 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:415 +#: ../../c-api/intro.rst:422 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " "passed in to the function you are writing. In that case, their behaviour " -"regarding reference counts is much saner, since you don't have to increment " -"a reference count so you can give a reference away (\"have it be stolen\"). " +"regarding references is much saner, since you don't have to take a new " +"reference just so you can give that reference away (\"have it be stolen\"). " "For example, this function sets all items of a list (actually, any mutable " "sequence) to a given item::" msgstr "" "更常見的是以那些借用參照的項目來使用 :c:func:`PyObject_SetItem` 及其系列函" -"式,比如傳遞給你正在編寫的函式的引數。在那種情況下,他們關於參照計數的行為會" -"比較穩健,因為你不必增加參照計數就可以放棄參照(「讓它被竊取」)。例如,此函" -"式將 list(實際上是任何可變序列)的所有項目設定於給定項目:" +"式,比如傳遞給你正在編寫的函式的引數。在那種情況下,他們關於參照的行為會比較" +"穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" +"將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:445 +#: ../../c-api/intro.rst:452 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -676,7 +683,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:454 +#: ../../c-api/intro.rst:461 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -692,7 +699,7 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:466 +#: ../../c-api/intro.rst:473 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -703,11 +710,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:530 +#: ../../c-api/intro.rst:537 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:532 +#: ../../c-api/intro.rst:539 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -722,7 +729,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:542 +#: ../../c-api/intro.rst:549 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 " @@ -733,11 +740,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:551 +#: ../../c-api/intro.rst:558 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:553 +#: ../../c-api/intro.rst:560 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -749,7 +756,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:561 +#: ../../c-api/intro.rst:568 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 " @@ -771,7 +778,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:576 +#: ../../c-api/intro.rst:583 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 " @@ -790,7 +797,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:586 +#: ../../c-api/intro.rst:593 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -809,7 +816,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:598 +#: ../../c-api/intro.rst:605 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." @@ -829,7 +836,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊幀 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:609 +#: ../../c-api/intro.rst:616 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 " @@ -844,7 +851,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:618 +#: ../../c-api/intro.rst:625 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 " @@ -858,11 +865,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:633 +#: ../../c-api/intro.rst:640 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:692 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:" @@ -881,11 +888,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:706 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:701 +#: ../../c-api/intro.rst:708 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 " @@ -895,7 +902,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:714 +#: ../../c-api/intro.rst:721 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -906,7 +913,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:719 +#: ../../c-api/intro.rst:726 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 " @@ -918,7 +925,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:724 +#: ../../c-api/intro.rst:731 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -936,7 +943,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:733 +#: ../../c-api/intro.rst:740 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/" @@ -953,7 +960,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:755 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -970,7 +977,7 @@ msgstr "" "`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:" "`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:758 +#: ../../c-api/intro.rst:765 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -991,11 +998,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:779 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:774 +#: ../../c-api/intro.rst:781 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 " @@ -1004,7 +1011,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:778 +#: ../../c-api/intro.rst:785 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 " @@ -1017,7 +1024,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:784 +#: ../../c-api/intro.rst:791 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1041,7 +1048,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:795 +#: ../../c-api/intro.rst:802 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1056,7 +1063,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:802 +#: ../../c-api/intro.rst:809 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1072,122 +1079,122 @@ msgstr "object(物件)" msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:301 +#: ../../c-api/intro.rst:303 msgid "Py_INCREF()" msgstr "Py_INCREF()" -#: ../../c-api/intro.rst:301 +#: ../../c-api/intro.rst:303 msgid "Py_DECREF()" msgstr "Py_DECREF()" -#: ../../c-api/intro.rst:372 +#: ../../c-api/intro.rst:379 msgid "PyList_SetItem()" msgstr "PyList_SetItem()" -#: ../../c-api/intro.rst:372 +#: ../../c-api/intro.rst:379 msgid "PyTuple_SetItem()" msgstr "PyTuple_SetItem()" -#: ../../c-api/intro.rst:443 +#: ../../c-api/intro.rst:450 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:462 +#: ../../c-api/intro.rst:469 msgid "PyList_GetItem()" msgstr "PyList_GetItem()" -#: ../../c-api/intro.rst:462 +#: ../../c-api/intro.rst:469 msgid "PySequence_GetItem()" msgstr "PySequence_GetItem()" -#: ../../c-api/intro.rst:492 +#: ../../c-api/intro.rst:499 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:524 ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:531 ../../c-api/intro.rst:623 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:559 +#: ../../c-api/intro.rst:566 msgid "PyErr_Occurred()" msgstr "PyErr_Occurred()" -#: ../../c-api/intro.rst:572 +#: ../../c-api/intro.rst:579 msgid "PyErr_SetString()" msgstr "PyErr_SetString()" -#: ../../c-api/intro.rst:572 ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:579 ../../c-api/intro.rst:687 msgid "PyErr_Clear()" msgstr "PyErr_Clear()" -#: ../../c-api/intro.rst:596 +#: ../../c-api/intro.rst:603 msgid "exc_info() (in module sys)" msgstr "exc_info() (sys 模組中)" -#: ../../c-api/intro.rst:631 ../../c-api/intro.rst:678 +#: ../../c-api/intro.rst:638 ../../c-api/intro.rst:685 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:687 msgid "PyErr_ExceptionMatches()" msgstr "PyErr_ExceptionMatches()" -#: ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:687 msgid "Py_XDECREF()" msgstr "Py_XDECREF()" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetPrefix()" msgstr "Py_GetPrefix()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetExecPrefix()" msgstr "Py_GetExecPrefix()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetProgramFullPath()" msgstr "Py_GetProgramFullPath()" -#: ../../c-api/intro.rst:756 +#: ../../c-api/intro.rst:763 msgid "Py_IsInitialized()" msgstr "Py_IsInitialized()" diff --git a/c-api/memory.po b/c-api/memory.po index 70ab0af2cf..9a8b640b46 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-01 00:03+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-" @@ -557,19 +557,19 @@ msgid "" "following fields:" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 msgid "user context passed as first argument" msgstr "" @@ -691,22 +691,29 @@ msgstr "" #: ../../c-api/memory.rst:479 msgid "" +"For the remaining domains, the allocator must also be thread-safe: the " +"allocator may be called in different interpreters that do not share a " +"``GIL``." +msgstr "" + +#: ../../c-api/memory.rst:483 +msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " "debug hooks on top on the new allocator." msgstr "" -#: ../../c-api/memory.rst:483 +#: ../../c-api/memory.rst:487 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: ../../c-api/memory.rst:488 +#: ../../c-api/memory.rst:492 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: ../../c-api/memory.rst:490 +#: ../../c-api/memory.rst:494 msgid "" "It can be called after :c:func:`Py_PreInitialize` and before :c:func:" "`Py_InitializeFromConfig` to install a custom memory allocator. There are no " @@ -716,7 +723,7 @@ msgid "" "domains>` for more information." msgstr "" -#: ../../c-api/memory.rst:498 +#: ../../c-api/memory.rst:502 msgid "" "If called after Python has finish initializing (after :c:func:" "`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " @@ -725,16 +732,20 @@ msgid "" msgstr "" #: ../../c-api/memory.rst:507 +msgid "All allocators must be thread-safe." +msgstr "" + +#: ../../c-api/memory.rst:513 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:514 +#: ../../c-api/memory.rst:520 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: ../../c-api/memory.rst:516 +#: ../../c-api/memory.rst:522 msgid "" "When :ref:`Python is built in debug mode `, the :c:func:" "`PyMem_SetupDebugHooks` function is called at the :ref:`Python " @@ -742,19 +753,19 @@ msgid "" "allocators to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:521 +#: ../../c-api/memory.rst:527 msgid "" "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " "hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" -#: ../../c-api/memory.rst:524 +#: ../../c-api/memory.rst:530 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " "after calling :c:func:`PyMem_SetAllocator`." msgstr "" -#: ../../c-api/memory.rst:527 +#: ../../c-api/memory.rst:533 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -764,25 +775,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: ../../c-api/memory.rst:534 +#: ../../c-api/memory.rst:540 msgid "Runtime checks:" msgstr "" -#: ../../c-api/memory.rst:536 +#: ../../c-api/memory.rst:542 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:538 +#: ../../c-api/memory.rst:544 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: ../../c-api/memory.rst:539 +#: ../../c-api/memory.rst:545 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: ../../c-api/memory.rst:540 +#: ../../c-api/memory.rst:546 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -790,7 +801,7 @@ msgid "" "called." msgstr "" -#: ../../c-api/memory.rst:545 +#: ../../c-api/memory.rst:551 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -798,7 +809,7 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:550 +#: ../../c-api/memory.rst:556 msgid "" "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " "block of *N* bytes requested. The memory layout is like so, where p " @@ -808,49 +819,49 @@ msgid "" "from a Python slice):" msgstr "" -#: ../../c-api/memory.rst:557 +#: ../../c-api/memory.rst:563 msgid "``p[-2*S:-S]``" msgstr "``p[-2*S:-S]``" -#: ../../c-api/memory.rst:557 +#: ../../c-api/memory.rst:563 msgid "" "Number of bytes originally asked for. This is a size_t, big-endian (easier " "to read in a memory dump)." msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:570 msgid "``p[-S]``" msgstr "``p[-S]``" -#: ../../c-api/memory.rst:560 +#: ../../c-api/memory.rst:566 msgid "API identifier (ASCII character):" msgstr "" -#: ../../c-api/memory.rst:562 +#: ../../c-api/memory.rst:568 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: ../../c-api/memory.rst:563 +#: ../../c-api/memory.rst:569 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:570 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: ../../c-api/memory.rst:567 +#: ../../c-api/memory.rst:573 msgid "``p[-S+1:0]``" msgstr "``p[-S+1:0]``" -#: ../../c-api/memory.rst:567 +#: ../../c-api/memory.rst:573 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: ../../c-api/memory.rst:576 +#: ../../c-api/memory.rst:582 msgid "``p[0:N]``" msgstr "``p[0:N]``" -#: ../../c-api/memory.rst:570 +#: ../../c-api/memory.rst:576 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -861,25 +872,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: ../../c-api/memory.rst:579 +#: ../../c-api/memory.rst:585 msgid "``p[N:N+S]``" msgstr "``p[N:N+S]``" -#: ../../c-api/memory.rst:579 +#: ../../c-api/memory.rst:585 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: ../../c-api/memory.rst:590 +#: ../../c-api/memory.rst:596 msgid "``p[N+S:N+2*S]``" msgstr "``p[N+S:N+2*S]``" -#: ../../c-api/memory.rst:582 +#: ../../c-api/memory.rst:588 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: ../../c-api/memory.rst:585 +#: ../../c-api/memory.rst:591 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" "like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " @@ -889,7 +900,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: ../../c-api/memory.rst:592 +#: ../../c-api/memory.rst:598 msgid "" "A realloc-like or free-like function first checks that the " "PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " @@ -902,7 +913,7 @@ msgid "" "getting used)." msgstr "" -#: ../../c-api/memory.rst:601 +#: ../../c-api/memory.rst:607 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" @@ -911,7 +922,7 @@ msgid "" "`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: ../../c-api/memory.rst:609 +#: ../../c-api/memory.rst:615 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -919,11 +930,11 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:619 +#: ../../c-api/memory.rst:625 msgid "The pymalloc allocator" msgstr "" -#: ../../c-api/memory.rst:621 +#: ../../c-api/memory.rst:627 msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " @@ -932,114 +943,114 @@ msgid "" "512 bytes." msgstr "" -#: ../../c-api/memory.rst:626 +#: ../../c-api/memory.rst:632 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:630 +#: ../../c-api/memory.rst:636 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:638 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:633 +#: ../../c-api/memory.rst:639 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:634 +#: ../../c-api/memory.rst:640 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:636 +#: ../../c-api/memory.rst:642 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:641 +#: ../../c-api/memory.rst:647 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:647 +#: ../../c-api/memory.rst:653 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:661 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:661 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:663 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:663 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:668 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:672 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:670 +#: ../../c-api/memory.rst:676 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:682 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:678 +#: ../../c-api/memory.rst:684 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:681 +#: ../../c-api/memory.rst:687 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:685 +#: ../../c-api/memory.rst:691 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:688 +#: ../../c-api/memory.rst:694 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:700 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:696 +#: ../../c-api/memory.rst:702 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:709 +#: ../../c-api/memory.rst:715 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:721 +#: ../../c-api/memory.rst:727 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1049,14 +1060,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:736 +#: ../../c-api/memory.rst:742 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:740 +#: ../../c-api/memory.rst:746 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/module.po b/c-api/module.po index bfca4455de..56d28314f2 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -426,15 +426,53 @@ msgid "" "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:379 +#: ../../c-api/module.rst:381 +msgid "Specifies one of the following values:" +msgstr "" + +#: ../../c-api/module.rst:385 +msgid "The module does not support being imported in subinterpreters." +msgstr "" + +#: ../../c-api/module.rst:389 +msgid "" +"The module supports being imported in subinterpreters, but only when they " +"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +#: ../../c-api/module.rst:395 +msgid "" +"The module supports being imported in subinterpreters, even when they have " +"their own GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +#: ../../c-api/module.rst:399 +msgid "" +"This slot determines whether or not importing this module in a " +"subinterpreter will fail." +msgstr "" + +#: ../../c-api/module.rst:402 +msgid "" +"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " +"module definition." +msgstr "" + +#: ../../c-api/module.rst:405 +msgid "" +"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." +msgstr "" + +#: ../../c-api/module.rst:410 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:382 +#: ../../c-api/module.rst:413 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:415 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -442,14 +480,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:391 +#: ../../c-api/module.rst:422 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:430 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -457,24 +495,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:406 +#: ../../c-api/module.rst:437 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:413 +#: ../../c-api/module.rst:444 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:419 +#: ../../c-api/module.rst:450 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:428 +#: ../../c-api/module.rst:459 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -486,11 +524,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:471 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:442 +#: ../../c-api/module.rst:473 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -498,82 +536,82 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:449 +#: ../../c-api/module.rst:480 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:452 +#: ../../c-api/module.rst:483 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:454 +#: ../../c-api/module.rst:485 msgid "" "Return ``NULL`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:457 ../../c-api/module.rst:506 +#: ../../c-api/module.rst:488 ../../c-api/module.rst:537 msgid "Example usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../c-api/module.rst:471 ../../c-api/module.rst:524 +#: ../../c-api/module.rst:502 ../../c-api/module.rst:555 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:483 ../../c-api/module.rst:540 +#: ../../c-api/module.rst:514 ../../c-api/module.rst:571 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:491 +#: ../../c-api/module.rst:522 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:494 +#: ../../c-api/module.rst:525 msgid "" "The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " "easy to introduce reference leaks by misusing the :c:func:" "`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:500 +#: ../../c-api/module.rst:531 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " -"decrements the reference count of *value* **on success**." +"releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:503 +#: ../../c-api/module.rst:534 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:546 +#: ../../c-api/module.rst:577 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` on " "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:553 +#: ../../c-api/module.rst:584 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " "be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:560 +#: ../../c-api/module.rst:591 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -581,11 +619,11 @@ msgid "" "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:568 +#: ../../c-api/module.rst:599 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:572 +#: ../../c-api/module.rst:603 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -593,25 +631,25 @@ msgid "" "``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:582 +#: ../../c-api/module.rst:613 msgid "Module lookup" msgstr "" -#: ../../c-api/module.rst:584 +#: ../../c-api/module.rst:615 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:588 +#: ../../c-api/module.rst:619 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:593 +#: ../../c-api/module.rst:624 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -620,18 +658,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:600 +#: ../../c-api/module.rst:631 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:634 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:605 +#: ../../c-api/module.rst:636 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -642,15 +680,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:613 ../../c-api/module.rst:624 +#: ../../c-api/module.rst:644 ../../c-api/module.rst:655 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:615 +#: ../../c-api/module.rst:646 msgid "Return 0 on success or -1 on failure." msgstr "" -#: ../../c-api/module.rst:621 +#: ../../c-api/module.rst:652 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." diff --git a/c-api/object.po b/c-api/object.po index 9c7f786d81..26c27baa4c 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -31,8 +31,8 @@ msgstr "" #: ../../c-api/object.rst:17 msgid "" "Properly handle returning :c:data:`Py_NotImplemented` from within a C " -"function (that is, increment the reference count of NotImplemented and " -"return it)." +"function (that is, create a new :term:`strong reference` to NotImplemented " +"and return it)." msgstr "" #: ../../c-api/object.rst:24 @@ -339,19 +339,19 @@ msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " "``NULL``. This is equivalent to the Python expression ``type(o)``. This " -"function increments the reference count of the return value. There's really " -"no reason to use this function instead of the :c:func:`Py_TYPE()` function, " -"which returns a pointer of type :c:expr:`PyTypeObject*`, except when the " -"incremented reference count is needed." +"function creates a new :term:`strong reference` to the return value. There's " +"really no reason to use this function instead of the :c:func:`Py_TYPE()` " +"function, which returns a pointer of type :c:expr:`PyTypeObject*`, except " +"when a new :term:`strong reference` is needed." msgstr "" -#: ../../c-api/object.rst:332 +#: ../../c-api/object.rst:333 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:341 +#: ../../c-api/object.rst:342 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -359,7 +359,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:348 +#: ../../c-api/object.rst:349 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -368,26 +368,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:358 +#: ../../c-api/object.rst:359 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:364 +#: ../../c-api/object.rst:365 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:372 +#: ../../c-api/object.rst:373 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:378 +#: ../../c-api/object.rst:379 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -397,7 +397,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:387 +#: ../../c-api/object.rst:388 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -405,7 +405,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:395 +#: ../../c-api/object.rst:396 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -414,51 +414,51 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:405 +#: ../../c-api/object.rst:406 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:407 +#: ../../c-api/object.rst:408 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:411 +#: ../../c-api/object.rst:412 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:417 +#: ../../c-api/object.rst:418 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:420 +#: ../../c-api/object.rst:421 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:423 +#: ../../c-api/object.rst:424 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:427 +#: ../../c-api/object.rst:428 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:433 +#: ../../c-api/object.rst:434 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:436 +#: ../../c-api/object.rst:437 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." @@ -466,7 +466,7 @@ msgstr "" #: ../../c-api/object.rst:197 ../../c-api/object.rst:209 #: ../../c-api/object.rst:234 ../../c-api/object.rst:285 -#: ../../c-api/object.rst:319 ../../c-api/object.rst:339 +#: ../../c-api/object.rst:319 ../../c-api/object.rst:340 msgid "built-in function" msgstr "bulit-in function(內建函式)" @@ -498,6 +498,6 @@ msgstr "hash(雜湊)" msgid "type" msgstr "type(型別)" -#: ../../c-api/object.rst:339 +#: ../../c-api/object.rst:340 msgid "len" msgstr "len" diff --git a/c-api/sys.po b/c-api/sys.po index c047265062..ba49aadc7f 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -28,14 +28,14 @@ msgstr "作業系統工具" #: ../../c-api/sys.rst:10 msgid "" "Return the file system representation for *path*. If the object is a :class:" -"`str` or :class:`bytes` object, then its reference count is incremented. If " -"the object implements the :class:`os.PathLike` interface, then :meth:`~os." -"PathLike.__fspath__` is returned as long as it is a :class:`str` or :class:" -"`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` is " -"returned." +"`str` or :class:`bytes` object, then a new :term:`strong reference` is " +"returned. If the object implements the :class:`os.PathLike` interface, then :" +"meth:`~os.PathLike.__fspath__` is returned as long as it is a :class:`str` " +"or :class:`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` " +"is returned." msgstr "" -#: ../../c-api/sys.rst:22 +#: ../../c-api/sys.rst:23 msgid "" "Return true (nonzero) if the standard I/O file *fp* with name *filename* is " "deemed interactive. This is the case for files for which " @@ -45,11 +45,11 @@ msgid "" "``'???'``." msgstr "" -#: ../../c-api/sys.rst:28 +#: ../../c-api/sys.rst:29 msgid "This function must not be called before Python is initialized." msgstr "" -#: ../../c-api/sys.rst:33 +#: ../../c-api/sys.rst:34 msgid "" "Function to prepare some internal state before a process fork. This should " "be called before calling :c:func:`fork` or any similar function that clones " @@ -57,14 +57,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:39 +#: ../../c-api/sys.rst:40 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" -#: ../../c-api/sys.rst:49 +#: ../../c-api/sys.rst:50 msgid "" "Function to update some internal state after a process fork. This should be " "called from the parent process after calling :c:func:`fork` or any similar " @@ -73,14 +73,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:56 +#: ../../c-api/sys.rst:57 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" -#: ../../c-api/sys.rst:66 +#: ../../c-api/sys.rst:67 msgid "" "Function to update internal interpreter state after a process fork. This " "must be called from the child process after calling :c:func:`fork`, or any " @@ -89,21 +89,21 @@ msgid "" "systems where :c:func:`fork` is defined." msgstr "" -#: ../../c-api/sys.rst:73 +#: ../../c-api/sys.rst:74 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" -#: ../../c-api/sys.rst:81 +#: ../../c-api/sys.rst:82 msgid "" ":func:`os.register_at_fork` allows registering custom Python functions to be " "called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" "c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../c-api/sys.rst:88 +#: ../../c-api/sys.rst:89 msgid "" "Function to update some internal state after a process fork; this should be " "called in the new process if the Python interpreter will continue to be " @@ -111,11 +111,11 @@ msgid "" "not need to be called." msgstr "" -#: ../../c-api/sys.rst:93 +#: ../../c-api/sys.rst:94 msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." msgstr "" -#: ../../c-api/sys.rst:99 +#: ../../c-api/sys.rst:100 msgid "" "Return true when the interpreter runs out of stack space. This is a " "reliable check, but is only available when :c:macro:`USE_STACKCHECK` is " @@ -124,7 +124,7 @@ msgid "" "should never change the definition in your own code." msgstr "" -#: ../../c-api/sys.rst:108 +#: ../../c-api/sys.rst:109 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " "around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " @@ -132,7 +132,7 @@ msgid "" "expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:116 +#: ../../c-api/sys.rst:117 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " "handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" @@ -140,21 +140,21 @@ msgid "" "`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:124 +#: ../../c-api/sys.rst:125 msgid "" "This function should not be called directly: use the :c:type:`PyConfig` API " "with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" "`Python is preinitialized `." msgstr "" -#: ../../c-api/sys.rst:128 ../../c-api/sys.rst:195 +#: ../../c-api/sys.rst:129 ../../c-api/sys.rst:196 msgid "" "This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" "func:`Py_PreInitialize` function." msgstr "" -#: ../../c-api/sys.rst:132 +#: ../../c-api/sys.rst:133 msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " @@ -164,57 +164,57 @@ msgid "" "instead of decoding them." msgstr "" -#: ../../c-api/sys.rst:139 +#: ../../c-api/sys.rst:140 msgid "" "Return a pointer to a newly allocated wide character string, use :c:func:" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " "number of wide characters excluding the null character into ``*size``" msgstr "" -#: ../../c-api/sys.rst:143 +#: ../../c-api/sys.rst:144 msgid "" "Return ``NULL`` on decoding error or memory allocation error. If *size* is " "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " "``(size_t)-2`` on decoding error." msgstr "" -#: ../../c-api/sys.rst:147 ../../c-api/sys.rst:187 +#: ../../c-api/sys.rst:148 ../../c-api/sys.rst:188 msgid "" "The :term:`filesystem encoding and error handler` are selected by :c:func:" "`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" "`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" -#: ../../c-api/sys.rst:151 +#: ../../c-api/sys.rst:152 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "" -#: ../../c-api/sys.rst:154 +#: ../../c-api/sys.rst:155 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." msgstr "" -#: ../../c-api/sys.rst:159 +#: ../../c-api/sys.rst:160 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" -#: ../../c-api/sys.rst:164 ../../c-api/sys.rst:206 +#: ../../c-api/sys.rst:165 ../../c-api/sys.rst:207 msgid "" "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " "`." msgstr "" -#: ../../c-api/sys.rst:168 +#: ../../c-api/sys.rst:169 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" -#: ../../c-api/sys.rst:175 +#: ../../c-api/sys.rst:176 msgid "" "Encode a wide character string to the :term:`filesystem encoding and error " "handler`. If the error handler is :ref:`surrogateescape error handler " @@ -222,42 +222,42 @@ msgid "" "converted to bytes 0x80..0xFF." msgstr "" -#: ../../c-api/sys.rst:180 +#: ../../c-api/sys.rst:181 msgid "" "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " "to free the memory. Return ``NULL`` on encoding error or memory allocation " "error." msgstr "" -#: ../../c-api/sys.rst:184 +#: ../../c-api/sys.rst:185 msgid "" "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " "success, or set to the index of the invalid character on encoding error." msgstr "" -#: ../../c-api/sys.rst:191 +#: ../../c-api/sys.rst:192 msgid "" "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " "to a wide character string." msgstr "" -#: ../../c-api/sys.rst:201 +#: ../../c-api/sys.rst:202 msgid "" "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " "functions." msgstr "" -#: ../../c-api/sys.rst:210 +#: ../../c-api/sys.rst:211 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero." msgstr "" -#: ../../c-api/sys.rst:218 +#: ../../c-api/sys.rst:219 msgid "System Functions" msgstr "系統函式" -#: ../../c-api/sys.rst:220 +#: ../../c-api/sys.rst:221 msgid "" "These are utility functions that make functionality from the :mod:`sys` " "module accessible to C code. They all work with the current interpreter " @@ -265,43 +265,43 @@ msgid "" "state structure." msgstr "" -#: ../../c-api/sys.rst:226 +#: ../../c-api/sys.rst:227 msgid "" "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " "not exist, without setting an exception." msgstr "" -#: ../../c-api/sys.rst:231 +#: ../../c-api/sys.rst:232 msgid "" "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " "case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " "on error." msgstr "" -#: ../../c-api/sys.rst:237 +#: ../../c-api/sys.rst:238 msgid "" "Reset :data:`sys.warnoptions` to an empty list. This function may be called " "prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:242 ../../c-api/sys.rst:253 +#: ../../c-api/sys.rst:243 ../../c-api/sys.rst:254 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "warnoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:246 +#: ../../c-api/sys.rst:247 msgid "" "Append *s* to :data:`sys.warnoptions`. This function must be called prior " "to :c:func:`Py_Initialize` in order to affect the warnings filter list." msgstr "" -#: ../../c-api/sys.rst:257 +#: ../../c-api/sys.rst:258 msgid "Append *unicode* to :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/sys.rst:259 +#: ../../c-api/sys.rst:260 msgid "" "Note: this function is not currently usable from outside the CPython " "implementation, as it must be called prior to the implicit import of :mod:" @@ -310,7 +310,7 @@ msgid "" "Unicode objects." msgstr "" -#: ../../c-api/sys.rst:269 +#: ../../c-api/sys.rst:270 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -318,20 +318,20 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/sys.rst:274 +#: ../../c-api/sys.rst:275 msgid "" "Set :data:`sys.path` to a list object of paths found in *path* which should " "be a list of paths separated with the platform's search path delimiter (``:" "`` on Unix, ``;`` on Windows)." msgstr "" -#: ../../c-api/sys.rst:282 +#: ../../c-api/sys.rst:283 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." msgstr "" -#: ../../c-api/sys.rst:285 +#: ../../c-api/sys.rst:286 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -342,58 +342,58 @@ msgid "" "of digits for very large numbers." msgstr "" -#: ../../c-api/sys.rst:293 +#: ../../c-api/sys.rst:294 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." msgstr "" -#: ../../c-api/sys.rst:298 +#: ../../c-api/sys.rst:299 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:303 +#: ../../c-api/sys.rst:304 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " "length." msgstr "" -#: ../../c-api/sys.rst:311 +#: ../../c-api/sys.rst:312 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:318 +#: ../../c-api/sys.rst:319 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "xoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:322 +#: ../../c-api/sys.rst:323 msgid "" "Parse *s* as a set of :option:`-X` options and add them to the current " "options mapping as returned by :c:func:`PySys_GetXOptions`. This function " "may be called prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:332 +#: ../../c-api/sys.rst:333 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." msgstr "" -#: ../../c-api/sys.rst:341 +#: ../../c-api/sys.rst:342 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: ../../c-api/sys.rst:344 +#: ../../c-api/sys.rst:345 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " @@ -404,23 +404,23 @@ msgid "" "leaks.)" msgstr "" -#: ../../c-api/sys.rst:352 +#: ../../c-api/sys.rst:353 msgid "" "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:355 +#: ../../c-api/sys.rst:356 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: ../../c-api/sys.rst:361 +#: ../../c-api/sys.rst:362 msgid "" "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: ../../c-api/sys.rst:367 +#: ../../c-api/sys.rst:368 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " "on success and non-zero on failure. If the runtime has been initialized, " @@ -428,14 +428,14 @@ msgid "" "all interpreters created by the runtime." msgstr "" -#: ../../c-api/sys.rst:373 +#: ../../c-api/sys.rst:374 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -#: ../../c-api/sys.rst:377 +#: ../../c-api/sys.rst:378 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -443,7 +443,7 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: ../../c-api/sys.rst:382 +#: ../../c-api/sys.rst:383 msgid "" "The hook function is of type :c:expr:`int (*)(const char *event, PyObject " "*args, void *userData)`, where *args* is guaranteed to be a :c:type:" @@ -451,21 +451,21 @@ msgid "" "Python interpreter that raised the event." msgstr "" -#: ../../c-api/sys.rst:387 +#: ../../c-api/sys.rst:388 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:392 +#: ../../c-api/sys.rst:393 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" -#: ../../c-api/sys.rst:394 +#: ../../c-api/sys.rst:395 msgid "" "If the interpreter is initialized, this function raises a auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -474,11 +474,11 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" -#: ../../c-api/sys.rst:406 +#: ../../c-api/sys.rst:407 msgid "Process Control" -msgstr "行程(Process)控制" +msgstr "行程控制" -#: ../../c-api/sys.rst:413 +#: ../../c-api/sys.rst:414 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " @@ -488,29 +488,29 @@ msgid "" "file:`core` file." msgstr "" -#: ../../c-api/sys.rst:420 +#: ../../c-api/sys.rst:421 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: ../../c-api/sys.rst:424 +#: ../../c-api/sys.rst:425 msgid "Log the function name automatically." msgstr "" -#: ../../c-api/sys.rst:434 +#: ../../c-api/sys.rst:435 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" "`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" -#: ../../c-api/sys.rst:438 +#: ../../c-api/sys.rst:439 msgid "Errors from finalization no longer ignored." msgstr "" -#: ../../c-api/sys.rst:448 +#: ../../c-api/sys.rst:449 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -522,18 +522,18 @@ msgid "" "should be called by *func*." msgstr "" -#: ../../c-api/sys.rst:411 +#: ../../c-api/sys.rst:412 msgid "abort()" msgstr "abort()" -#: ../../c-api/sys.rst:430 ../../c-api/sys.rst:444 +#: ../../c-api/sys.rst:431 ../../c-api/sys.rst:445 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/sys.rst:430 +#: ../../c-api/sys.rst:431 msgid "exit()" msgstr "exit()" -#: ../../c-api/sys.rst:444 +#: ../../c-api/sys.rst:445 msgid "cleanup functions" msgstr "cleanup functions(清理函式)" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 5bca8b7244..7b0d0db989 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -579,8 +579,8 @@ msgid "[:c:member:`~PyTypeObject.tp_watched`]" msgstr "[:c:member:`~PyTypeObject.tp_watched`]" #: ../../c-api/typeobj.rst:150 -msgid "char" -msgstr "char" +msgid "unsigned char" +msgstr "unsigned char" #: ../../c-api/typeobj.rst:155 msgid "" @@ -1185,36 +1185,36 @@ msgstr "" #: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526 #: ../../c-api/typeobj.rst:548 ../../c-api/typeobj.rst:562 #: ../../c-api/typeobj.rst:606 ../../c-api/typeobj.rst:649 -#: ../../c-api/typeobj.rst:707 ../../c-api/typeobj.rst:748 -#: ../../c-api/typeobj.rst:765 ../../c-api/typeobj.rst:782 -#: ../../c-api/typeobj.rst:800 ../../c-api/typeobj.rst:824 -#: ../../c-api/typeobj.rst:841 ../../c-api/typeobj.rst:853 -#: ../../c-api/typeobj.rst:865 ../../c-api/typeobj.rst:898 -#: ../../c-api/typeobj.rst:916 ../../c-api/typeobj.rst:936 -#: ../../c-api/typeobj.rst:957 ../../c-api/typeobj.rst:983 -#: ../../c-api/typeobj.rst:1002 ../../c-api/typeobj.rst:1018 -#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1067 -#: ../../c-api/typeobj.rst:1077 ../../c-api/typeobj.rst:1087 -#: ../../c-api/typeobj.rst:1101 ../../c-api/typeobj.rst:1119 -#: ../../c-api/typeobj.rst:1142 ../../c-api/typeobj.rst:1157 -#: ../../c-api/typeobj.rst:1170 ../../c-api/typeobj.rst:1192 -#: ../../c-api/typeobj.rst:1236 ../../c-api/typeobj.rst:1257 -#: ../../c-api/typeobj.rst:1276 ../../c-api/typeobj.rst:1306 -#: ../../c-api/typeobj.rst:1328 ../../c-api/typeobj.rst:1354 -#: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1489 -#: ../../c-api/typeobj.rst:1550 ../../c-api/typeobj.rst:1586 -#: ../../c-api/typeobj.rst:1611 ../../c-api/typeobj.rst:1634 -#: ../../c-api/typeobj.rst:1647 ../../c-api/typeobj.rst:1662 -#: ../../c-api/typeobj.rst:1676 ../../c-api/typeobj.rst:1706 -#: ../../c-api/typeobj.rst:1738 ../../c-api/typeobj.rst:1764 -#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1811 -#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1872 -#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1935 -#: ../../c-api/typeobj.rst:1967 ../../c-api/typeobj.rst:1995 -#: ../../c-api/typeobj.rst:2008 ../../c-api/typeobj.rst:2018 -#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2052 -#: ../../c-api/typeobj.rst:2066 ../../c-api/typeobj.rst:2112 -#: ../../c-api/typeobj.rst:2135 +#: ../../c-api/typeobj.rst:708 ../../c-api/typeobj.rst:749 +#: ../../c-api/typeobj.rst:766 ../../c-api/typeobj.rst:783 +#: ../../c-api/typeobj.rst:801 ../../c-api/typeobj.rst:825 +#: ../../c-api/typeobj.rst:842 ../../c-api/typeobj.rst:854 +#: ../../c-api/typeobj.rst:866 ../../c-api/typeobj.rst:899 +#: ../../c-api/typeobj.rst:917 ../../c-api/typeobj.rst:937 +#: ../../c-api/typeobj.rst:958 ../../c-api/typeobj.rst:984 +#: ../../c-api/typeobj.rst:1003 ../../c-api/typeobj.rst:1019 +#: ../../c-api/typeobj.rst:1057 ../../c-api/typeobj.rst:1068 +#: ../../c-api/typeobj.rst:1078 ../../c-api/typeobj.rst:1088 +#: ../../c-api/typeobj.rst:1102 ../../c-api/typeobj.rst:1120 +#: ../../c-api/typeobj.rst:1143 ../../c-api/typeobj.rst:1158 +#: ../../c-api/typeobj.rst:1171 ../../c-api/typeobj.rst:1193 +#: ../../c-api/typeobj.rst:1237 ../../c-api/typeobj.rst:1258 +#: ../../c-api/typeobj.rst:1277 ../../c-api/typeobj.rst:1307 +#: ../../c-api/typeobj.rst:1329 ../../c-api/typeobj.rst:1355 +#: ../../c-api/typeobj.rst:1423 ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1552 ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1613 ../../c-api/typeobj.rst:1636 +#: ../../c-api/typeobj.rst:1649 ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1678 ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1740 ../../c-api/typeobj.rst:1766 +#: ../../c-api/typeobj.rst:1784 ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1857 ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1915 ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:1997 +#: ../../c-api/typeobj.rst:2010 ../../c-api/typeobj.rst:2020 +#: ../../c-api/typeobj.rst:2037 ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2068 ../../c-api/typeobj.rst:2114 +#: ../../c-api/typeobj.rst:2137 msgid "**Inheritance:**" msgstr "" @@ -1243,12 +1243,12 @@ msgid "" "class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:709 -#: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:918 -#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1613 -#: ../../c-api/typeobj.rst:1636 ../../c-api/typeobj.rst:1766 -#: ../../c-api/typeobj.rst:1784 ../../c-api/typeobj.rst:1857 -#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:2114 +#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:710 +#: ../../c-api/typeobj.rst:827 ../../c-api/typeobj.rst:919 +#: ../../c-api/typeobj.rst:939 ../../c-api/typeobj.rst:1615 +#: ../../c-api/typeobj.rst:1638 ../../c-api/typeobj.rst:1768 +#: ../../c-api/typeobj.rst:1786 ../../c-api/typeobj.rst:1859 +#: ../../c-api/typeobj.rst:1971 ../../c-api/typeobj.rst:2116 msgid "This field is inherited by subtypes." msgstr "" @@ -1448,33 +1448,33 @@ msgstr "" #: ../../c-api/typeobj.rst:692 msgid "" "Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " -"deallocator should decrement the reference count for its type object after " -"calling the type deallocator. In order to avoid dangling pointers, the " -"recommended way to achieve this is:" +"deallocator should release the owned reference to its type object (via :c:" +"func:`Py_DECREF`) after calling the type deallocator. In order to avoid " +"dangling pointers, the recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:714 +#: ../../c-api/typeobj.rst:715 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:719 +#: ../../c-api/typeobj.rst:720 msgid "" "This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:723 +#: ../../c-api/typeobj.rst:724 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:727 +#: ../../c-api/typeobj.rst:728 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1482,13 +1482,13 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:734 +#: ../../c-api/typeobj.rst:735 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:740 +#: ../../c-api/typeobj.rst:741 msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" @@ -1498,7 +1498,7 @@ msgid "" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: ../../c-api/typeobj.rst:750 +#: ../../c-api/typeobj.rst:751 msgid "" "This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " @@ -1506,11 +1506,11 @@ msgid "" "func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: ../../c-api/typeobj.rst:759 +#: ../../c-api/typeobj.rst:760 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:761 +#: ../../c-api/typeobj.rst:762 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1518,7 +1518,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:767 ../../c-api/typeobj.rst:959 +#: ../../c-api/typeobj.rst:768 ../../c-api/typeobj.rst:960 msgid "" "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." "tp_getattro`" @@ -1526,7 +1526,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject." "tp_getattro`" -#: ../../c-api/typeobj.rst:769 +#: ../../c-api/typeobj.rst:770 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1535,12 +1535,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:776 ../../c-api/typeobj.rst:972 +#: ../../c-api/typeobj.rst:777 ../../c-api/typeobj.rst:973 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:778 +#: ../../c-api/typeobj.rst:779 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1548,7 +1548,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:784 ../../c-api/typeobj.rst:985 +#: ../../c-api/typeobj.rst:785 ../../c-api/typeobj.rst:986 msgid "" "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." "tp_setattro`" @@ -1556,7 +1556,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject." "tp_setattro`" -#: ../../c-api/typeobj.rst:786 +#: ../../c-api/typeobj.rst:787 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1565,34 +1565,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:793 +#: ../../c-api/typeobj.rst:794 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:797 +#: ../../c-api/typeobj.rst:798 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:802 +#: ../../c-api/typeobj.rst:803 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:810 +#: ../../c-api/typeobj.rst:811 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:813 +#: ../../c-api/typeobj.rst:814 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:817 +#: ../../c-api/typeobj.rst:818 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1601,81 +1601,81 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:828 ../../c-api/typeobj.rst:940 -#: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:991 -#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1559 -#: ../../c-api/typeobj.rst:1593 ../../c-api/typeobj.rst:1710 -#: ../../c-api/typeobj.rst:1743 ../../c-api/typeobj.rst:1818 -#: ../../c-api/typeobj.rst:1859 ../../c-api/typeobj.rst:1877 -#: ../../c-api/typeobj.rst:1919 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1971 +#: ../../c-api/typeobj.rst:829 ../../c-api/typeobj.rst:941 +#: ../../c-api/typeobj.rst:966 ../../c-api/typeobj.rst:992 +#: ../../c-api/typeobj.rst:1033 ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1595 ../../c-api/typeobj.rst:1712 +#: ../../c-api/typeobj.rst:1745 ../../c-api/typeobj.rst:1820 +#: ../../c-api/typeobj.rst:1861 ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1921 ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1973 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:830 +#: ../../c-api/typeobj.rst:831 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:837 +#: ../../c-api/typeobj.rst:838 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:843 +#: ../../c-api/typeobj.rst:844 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:849 +#: ../../c-api/typeobj.rst:850 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:855 +#: ../../c-api/typeobj.rst:856 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:861 +#: ../../c-api/typeobj.rst:862 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:867 +#: ../../c-api/typeobj.rst:868 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:875 +#: ../../c-api/typeobj.rst:876 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:878 +#: ../../c-api/typeobj.rst:879 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:882 +#: ../../c-api/typeobj.rst:883 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:886 +#: ../../c-api/typeobj.rst:887 msgid "" "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " "is not set), an attempt to take the hash of the object raises :exc:" @@ -1683,7 +1683,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:890 +#: ../../c-api/typeobj.rst:891 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1694,7 +1694,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1552 +#: ../../c-api/typeobj.rst:901 ../../c-api/typeobj.rst:1554 msgid "" "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." "tp_richcompare`" @@ -1702,7 +1702,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject." "tp_richcompare`" -#: ../../c-api/typeobj.rst:902 +#: ../../c-api/typeobj.rst:903 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1711,14 +1711,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:910 +#: ../../c-api/typeobj.rst:911 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:923 +#: ../../c-api/typeobj.rst:924 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1727,11 +1727,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:928 +#: ../../c-api/typeobj.rst:929 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:932 +#: ../../c-api/typeobj.rst:933 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1739,28 +1739,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:942 +#: ../../c-api/typeobj.rst:943 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:948 +#: ../../c-api/typeobj.rst:949 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:950 +#: ../../c-api/typeobj.rst:951 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:954 +#: ../../c-api/typeobj.rst:955 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:961 +#: ../../c-api/typeobj.rst:962 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1769,15 +1769,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:967 +#: ../../c-api/typeobj.rst:968 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:974 +#: ../../c-api/typeobj.rst:975 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:978 +#: ../../c-api/typeobj.rst:979 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1785,7 +1785,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:987 +#: ../../c-api/typeobj.rst:988 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1794,24 +1794,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:993 +#: ../../c-api/typeobj.rst:994 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:998 +#: ../../c-api/typeobj.rst:999 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:1004 +#: ../../c-api/typeobj.rst:1005 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1010 +#: ../../c-api/typeobj.rst:1011 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1823,7 +1823,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1020 +#: ../../c-api/typeobj.rst:1021 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1839,17 +1839,17 @@ msgid "" "*really* inherited individually?" msgstr "" -#: ../../c-api/typeobj.rst:1034 +#: ../../c-api/typeobj.rst:1035 msgid "" ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1037 +#: ../../c-api/typeobj.rst:1038 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1041 +#: ../../c-api/typeobj.rst:1042 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1858,7 +1858,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1048 +#: ../../c-api/typeobj.rst:1049 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1869,32 +1869,32 @@ msgid "" "instance's ob_type gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1058 ../../c-api/typeobj.rst:1069 -#: ../../c-api/typeobj.rst:1079 ../../c-api/typeobj.rst:1089 -#: ../../c-api/typeobj.rst:1121 +#: ../../c-api/typeobj.rst:1059 ../../c-api/typeobj.rst:1070 +#: ../../c-api/typeobj.rst:1080 ../../c-api/typeobj.rst:1090 +#: ../../c-api/typeobj.rst:1122 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1063 +#: ../../c-api/typeobj.rst:1064 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1074 +#: ../../c-api/typeobj.rst:1075 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1085 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1094 +#: ../../c-api/typeobj.rst:1095 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:macro:`PyObject_GC_New` and " @@ -1904,14 +1904,14 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1103 ../../c-api/typeobj.rst:1424 -#: ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1104 ../../c-api/typeobj.rst:1425 +#: ../../c-api/typeobj.rst:1493 msgid "" "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." "tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1105 +#: ../../c-api/typeobj.rst:1106 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" "member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " @@ -1921,99 +1921,99 @@ msgid "" "values." msgstr "" -#: ../../c-api/typeobj.rst:1115 +#: ../../c-api/typeobj.rst:1116 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1126 +#: ../../c-api/typeobj.rst:1127 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1129 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1130 +#: ../../c-api/typeobj.rst:1131 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1133 +#: ../../c-api/typeobj.rst:1134 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1136 +#: ../../c-api/typeobj.rst:1137 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1144 +#: ../../c-api/typeobj.rst:1145 msgid "" "This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1150 +#: ../../c-api/typeobj.rst:1151 msgid "" "This bit indicates that instances of the class have a ``__dict__`` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" -#: ../../c-api/typeobj.rst:1153 +#: ../../c-api/typeobj.rst:1154 msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" -#: ../../c-api/typeobj.rst:1159 +#: ../../c-api/typeobj.rst:1160 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1165 +#: ../../c-api/typeobj.rst:1166 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: ../../c-api/typeobj.rst:1172 +#: ../../c-api/typeobj.rst:1173 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1178 +#: ../../c-api/typeobj.rst:1179 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/typeobj.rst:1181 +#: ../../c-api/typeobj.rst:1182 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" ">tp_basicsize`` (which may be different in each subclass)." msgstr "" -#: ../../c-api/typeobj.rst:1186 +#: ../../c-api/typeobj.rst:1187 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: ../../c-api/typeobj.rst:1194 +#: ../../c-api/typeobj.rst:1195 msgid "This flag is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1208 +#: ../../c-api/typeobj.rst:1209 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2023,90 +2023,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1219 +#: ../../c-api/typeobj.rst:1220 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1224 +#: ../../c-api/typeobj.rst:1225 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1232 +#: ../../c-api/typeobj.rst:1233 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1238 +#: ../../c-api/typeobj.rst:1239 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1245 +#: ../../c-api/typeobj.rst:1246 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: ../../c-api/typeobj.rst:1248 +#: ../../c-api/typeobj.rst:1249 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1253 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1254 +#: ../../c-api/typeobj.rst:1255 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1259 +#: ../../c-api/typeobj.rst:1260 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1265 +#: ../../c-api/typeobj.rst:1266 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1269 +#: ../../c-api/typeobj.rst:1270 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1272 +#: ../../c-api/typeobj.rst:1273 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1278 +#: ../../c-api/typeobj.rst:1279 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1285 +#: ../../c-api/typeobj.rst:1286 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1296 +#: ../../c-api/typeobj.rst:1297 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2114,23 +2114,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1303 ../../c-api/typeobj.rst:1325 +#: ../../c-api/typeobj.rst:1304 ../../c-api/typeobj.rst:1326 msgid "" ":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " "mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1308 +#: ../../c-api/typeobj.rst:1309 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1311 ../../c-api/typeobj.rst:1333 +#: ../../c-api/typeobj.rst:1312 ../../c-api/typeobj.rst:1334 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1318 +#: ../../c-api/typeobj.rst:1319 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2138,49 +2138,49 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1330 +#: ../../c-api/typeobj.rst:1331 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1340 +#: ../../c-api/typeobj.rst:1341 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: ../../c-api/typeobj.rst:1344 +#: ../../c-api/typeobj.rst:1345 msgid "" "This flag is present in header files, but is an internal feature and should " "not be used. It will be removed in a future version of CPython" msgstr "" -#: ../../c-api/typeobj.rst:1350 +#: ../../c-api/typeobj.rst:1351 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1356 +#: ../../c-api/typeobj.rst:1357 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1361 +#: ../../c-api/typeobj.rst:1362 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1366 ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1367 ../../c-api/typeobj.rst:1488 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1369 +#: ../../c-api/typeobj.rst:1370 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2190,7 +2190,7 @@ msgid "" "`!_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1384 +#: ../../c-api/typeobj.rst:1385 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2198,14 +2198,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1388 +#: ../../c-api/typeobj.rst:1389 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1393 +#: ../../c-api/typeobj.rst:1394 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2234,14 +2234,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1417 +#: ../../c-api/typeobj.rst:1418 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1426 +#: ../../c-api/typeobj.rst:1427 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2249,14 +2249,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1435 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1439 +#: ../../c-api/typeobj.rst:1440 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2271,7 +2271,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1449 +#: ../../c-api/typeobj.rst:1450 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2279,22 +2279,22 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1464 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " -"delicate: the reference to the contained object must not be decremented " -"until after the pointer to the contained object is set to ``NULL``. This is " -"because decrementing the reference count may cause the contained object to " -"become trash, triggering a chain of reclamation activity that may include " -"invoking arbitrary Python code (due to finalizers, or weakref callbacks, " -"associated with the contained object). If it's possible for such code to " -"reference *self* again, it's important that the pointer to the contained " -"object be ``NULL`` at that time, so that *self* knows the contained object " -"can no longer be used. The :c:func:`Py_CLEAR` macro performs the operations " -"in a safe order." +"delicate: the reference to the contained object must not be released (via :" +"c:func:`Py_DECREF`) until after the pointer to the contained object is set " +"to ``NULL``. This is because releasing the reference may cause the " +"contained object to become trash, triggering a chain of reclamation activity " +"that may include invoking arbitrary Python code (due to finalizers, or " +"weakref callbacks, associated with the contained object). If it's possible " +"for such code to reference *self* again, it's important that the pointer to " +"the contained object be ``NULL`` at that time, so that *self* knows the " +"contained object can no longer be used. The :c:func:`Py_CLEAR` macro " +"performs the operations in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1474 +#: ../../c-api/typeobj.rst:1476 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2302,7 +2302,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1480 +#: ../../c-api/typeobj.rst:1482 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2312,7 +2312,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1493 +#: ../../c-api/typeobj.rst:1495 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" @@ -2320,18 +2320,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1501 +#: ../../c-api/typeobj.rst:1503 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1505 +#: ../../c-api/typeobj.rst:1507 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1508 +#: ../../c-api/typeobj.rst:1510 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2339,50 +2339,50 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1513 +#: ../../c-api/typeobj.rst:1515 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1521 +#: ../../c-api/typeobj.rst:1523 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1525 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1527 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1527 +#: ../../c-api/typeobj.rst:1529 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1529 +#: ../../c-api/typeobj.rst:1531 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1531 +#: ../../c-api/typeobj.rst:1533 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1534 +#: ../../c-api/typeobj.rst:1536 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1538 +#: ../../c-api/typeobj.rst:1540 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2390,15 +2390,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1544 -msgid "The return value's reference count is properly incremented." +#: ../../c-api/typeobj.rst:1546 +msgid "The returned value is a new :term:`strong reference`." msgstr "" -#: ../../c-api/typeobj.rst:1546 +#: ../../c-api/typeobj.rst:1548 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1554 +#: ../../c-api/typeobj.rst:1556 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2406,7 +2406,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1563 msgid "" ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." "tp_richcompare` implementation, which may be inherited. However, if only :c:" @@ -2415,13 +2415,13 @@ msgid "" "comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1570 +#: ../../c-api/typeobj.rst:1572 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1573 +#: ../../c-api/typeobj.rst:1575 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2431,19 +2431,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1580 +#: ../../c-api/typeobj.rst:1582 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1583 +#: ../../c-api/typeobj.rst:1585 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1590 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2452,7 +2452,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1595 +#: ../../c-api/typeobj.rst:1597 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." @@ -2460,24 +2460,24 @@ msgid "" "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1605 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1607 +#: ../../c-api/typeobj.rst:1609 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1618 +#: ../../c-api/typeobj.rst:1620 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1623 +#: ../../c-api/typeobj.rst:1625 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2485,74 +2485,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1628 +#: ../../c-api/typeobj.rst:1630 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1632 +#: ../../c-api/typeobj.rst:1634 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1641 +#: ../../c-api/typeobj.rst:1643 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1646 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1649 +#: ../../c-api/typeobj.rst:1651 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1655 +#: ../../c-api/typeobj.rst:1657 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1659 +#: ../../c-api/typeobj.rst:1661 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1666 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1670 +#: ../../c-api/typeobj.rst:1672 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1673 +#: ../../c-api/typeobj.rst:1675 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1678 +#: ../../c-api/typeobj.rst:1680 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1684 +#: ../../c-api/typeobj.rst:1686 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2560,7 +2560,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1692 +#: ../../c-api/typeobj.rst:1694 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2568,35 +2568,35 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1697 +#: ../../c-api/typeobj.rst:1699 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" -"func:`PyBaseObject_Type` is not required to produce an address constant. " +"data:`PyBaseObject_Type` is not required to produce an address constant. " "Compilers may support this (gcc does), MSVC does not. Both compilers are " "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1703 +#: ../../c-api/typeobj.rst:1705 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1710 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1712 +#: ../../c-api/typeobj.rst:1714 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1720 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1720 +#: ../../c-api/typeobj.rst:1722 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2607,64 +2607,64 @@ msgid "" "be treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:1728 +#: ../../c-api/typeobj.rst:1730 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retreive the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1734 +#: ../../c-api/typeobj.rst:1736 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1740 +#: ../../c-api/typeobj.rst:1742 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1747 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1750 +#: ../../c-api/typeobj.rst:1752 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1756 +#: ../../c-api/typeobj.rst:1758 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1758 ../../c-api/typeobj.rst:1774 -#: ../../c-api/typeobj.rst:1838 ../../c-api/typeobj.rst:1868 -#: ../../c-api/typeobj.rst:1892 +#: ../../c-api/typeobj.rst:1760 ../../c-api/typeobj.rst:1776 +#: ../../c-api/typeobj.rst:1840 ../../c-api/typeobj.rst:1870 +#: ../../c-api/typeobj.rst:1894 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1771 +#: ../../c-api/typeobj.rst:1773 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1780 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1789 +#: ../../c-api/typeobj.rst:1791 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1792 +#: ../../c-api/typeobj.rst:1794 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2672,19 +2672,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1797 +#: ../../c-api/typeobj.rst:1799 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1802 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1802 +#: ../../c-api/typeobj.rst:1804 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2693,13 +2693,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1808 +#: ../../c-api/typeobj.rst:1810 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1815 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -2707,25 +2707,25 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1820 +#: ../../c-api/typeobj.rst:1822 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`~object.__dict__` gets created for " "instances." msgstr "" -#: ../../c-api/typeobj.rst:1823 +#: ../../c-api/typeobj.rst:1825 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1831 +#: ../../c-api/typeobj.rst:1833 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1833 +#: ../../c-api/typeobj.rst:1835 msgid "" "This function corresponds to the :meth:`~object.__init__` method of " "classes. Like :meth:`!__init__`, it is possible to create an instance " @@ -2733,14 +2733,14 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1844 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`~object.__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1846 +#: ../../c-api/typeobj.rst:1848 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2752,43 +2752,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1855 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1861 +#: ../../c-api/typeobj.rst:1863 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1866 +#: ../../c-api/typeobj.rst:1868 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1876 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1881 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1883 +#: ../../c-api/typeobj.rst:1885 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1890 +#: ../../c-api/typeobj.rst:1892 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1896 +#: ../../c-api/typeobj.rst:1898 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2797,7 +2797,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1902 +#: ../../c-api/typeobj.rst:1904 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2809,20 +2809,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1910 +#: ../../c-api/typeobj.rst:1912 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1915 +#: ../../c-api/typeobj.rst:1917 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1923 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2830,40 +2830,40 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1931 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1935 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1939 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1944 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1946 +#: ../../c-api/typeobj.rst:1948 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/typeobj.rst:1951 +#: ../../c-api/typeobj.rst:1953 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1953 +#: ../../c-api/typeobj.rst:1955 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2875,89 +2875,89 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1963 +#: ../../c-api/typeobj.rst:1965 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1973 +#: ../../c-api/typeobj.rst:1975 msgid "" "This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1979 +#: ../../c-api/typeobj.rst:1981 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1981 ../../c-api/typeobj.rst:2005 +#: ../../c-api/typeobj.rst:1983 ../../c-api/typeobj.rst:2007 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1984 +#: ../../c-api/typeobj.rst:1986 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1991 +#: ../../c-api/typeobj.rst:1993 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1997 ../../c-api/typeobj.rst:2020 -#: ../../c-api/typeobj.rst:2037 ../../c-api/typeobj.rst:2054 -#: ../../c-api/typeobj.rst:2068 +#: ../../c-api/typeobj.rst:1999 ../../c-api/typeobj.rst:2022 +#: ../../c-api/typeobj.rst:2039 ../../c-api/typeobj.rst:2056 +#: ../../c-api/typeobj.rst:2070 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:2002 +#: ../../c-api/typeobj.rst:2004 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:2010 +#: ../../c-api/typeobj.rst:2012 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2016 +#: ../../c-api/typeobj.rst:2018 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2025 +#: ../../c-api/typeobj.rst:2027 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2027 +#: ../../c-api/typeobj.rst:2029 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2032 +#: ../../c-api/typeobj.rst:2034 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2042 +#: ../../c-api/typeobj.rst:2044 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2047 +#: ../../c-api/typeobj.rst:2049 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -2965,21 +2965,21 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2059 +#: ../../c-api/typeobj.rst:2061 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:2066 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2073 +#: ../../c-api/typeobj.rst:2075 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2077 +#: ../../c-api/typeobj.rst:2079 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2989,14 +2989,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2084 +#: ../../c-api/typeobj.rst:2086 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2101 +#: ../../c-api/typeobj.rst:2103 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -3009,18 +3009,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2120 +#: ../../c-api/typeobj.rst:2122 msgid "" "Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2124 +#: ../../c-api/typeobj.rst:2126 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2129 +#: ../../c-api/typeobj.rst:2131 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -3028,65 +3028,65 @@ msgid "" "meth:`~object.__new__` and :meth:`~object.__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2137 +#: ../../c-api/typeobj.rst:2139 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2139 +#: ../../c-api/typeobj.rst:2141 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2144 +#: ../../c-api/typeobj.rst:2146 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2152 +#: ../../c-api/typeobj.rst:2154 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2154 +#: ../../c-api/typeobj.rst:2156 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2158 +#: ../../c-api/typeobj.rst:2160 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2160 +#: ../../c-api/typeobj.rst:2162 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2162 +#: ../../c-api/typeobj.rst:2164 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2164 +#: ../../c-api/typeobj.rst:2166 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2168 +#: ../../c-api/typeobj.rst:2170 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2176 +#: ../../c-api/typeobj.rst:2178 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2178 +#: ../../c-api/typeobj.rst:2180 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3094,29 +3094,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2183 +#: ../../c-api/typeobj.rst:2185 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2191 +#: ../../c-api/typeobj.rst:2193 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2198 +#: ../../c-api/typeobj.rst:2200 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2204 ../../c-api/typeobj.rst:2528 +#: ../../c-api/typeobj.rst:2206 ../../c-api/typeobj.rst:2530 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2251 +#: ../../c-api/typeobj.rst:2253 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3126,31 +3126,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2260 +#: ../../c-api/typeobj.rst:2262 msgid "" "The :c:member:`~PyNumberMethods.nb_reserved` field should always be " "``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " "Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2305 +#: ../../c-api/typeobj.rst:2307 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2314 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2317 +#: ../../c-api/typeobj.rst:2319 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2323 +#: ../../c-api/typeobj.rst:2325 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3158,7 +3158,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2333 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" @@ -3168,17 +3168,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2342 +#: ../../c-api/typeobj.rst:2344 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2349 +#: ../../c-api/typeobj.rst:2351 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2354 +#: ../../c-api/typeobj.rst:2356 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3186,21 +3186,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2361 +#: ../../c-api/typeobj.rst:2363 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2367 +#: ../../c-api/typeobj.rst:2369 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2373 +#: ../../c-api/typeobj.rst:2375 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3209,7 +3209,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2379 +#: ../../c-api/typeobj.rst:2381 msgid "" "Negative indexes are handled as follows: if the :c:member:" "`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " @@ -3218,7 +3218,7 @@ msgid "" "index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2388 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3227,14 +3227,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2395 +#: ../../c-api/typeobj.rst:2397 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2402 +#: ../../c-api/typeobj.rst:2404 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3244,7 +3244,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2411 +#: ../../c-api/typeobj.rst:2413 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3254,72 +3254,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2422 +#: ../../c-api/typeobj.rst:2424 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2430 +#: ../../c-api/typeobj.rst:2432 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2436 ../../c-api/typeobj.rst:2485 -#: ../../c-api/typeobj.rst:2539 ../../c-api/typeobj.rst:2550 -#: ../../c-api/typeobj.rst:2562 ../../c-api/typeobj.rst:2572 +#: ../../c-api/typeobj.rst:2438 ../../c-api/typeobj.rst:2487 +#: ../../c-api/typeobj.rst:2541 ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2564 ../../c-api/typeobj.rst:2574 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2440 +#: ../../c-api/typeobj.rst:2442 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2444 +#: ../../c-api/typeobj.rst:2446 msgid "" -"Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " -"set :c:expr:`view->obj` to ``NULL`` and return ``-1``." +"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" +"expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2447 +#: ../../c-api/typeobj.rst:2449 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2451 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2451 +#: ../../c-api/typeobj.rst:2453 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2455 msgid "Return ``0``." -msgstr "" +msgstr "回傳 ``0``。" -#: ../../c-api/typeobj.rst:2455 +#: ../../c-api/typeobj.rst:2457 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2458 +#: ../../c-api/typeobj.rst:2460 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2461 +#: ../../c-api/typeobj.rst:2463 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2465 +#: ../../c-api/typeobj.rst:2467 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3327,7 +3327,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2470 +#: ../../c-api/typeobj.rst:2472 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3336,19 +3336,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2477 +#: ../../c-api/typeobj.rst:2479 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2480 +#: ../../c-api/typeobj.rst:2482 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2489 +#: ../../c-api/typeobj.rst:2491 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3356,15 +3356,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2496 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2496 +#: ../../c-api/typeobj.rst:2498 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2500 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3372,68 +3372,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2504 +#: ../../c-api/typeobj.rst:2506 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2509 +#: ../../c-api/typeobj.rst:2511 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2517 +#: ../../c-api/typeobj.rst:2519 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2525 +#: ../../c-api/typeobj.rst:2527 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2543 +#: ../../c-api/typeobj.rst:2545 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2548 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2554 +#: ../../c-api/typeobj.rst:2556 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." "__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2557 +#: ../../c-api/typeobj.rst:2559 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2566 +#: ../../c-api/typeobj.rst:2568 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2576 +#: ../../c-api/typeobj.rst:2578 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2585 +#: ../../c-api/typeobj.rst:2587 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2589 +#: ../../c-api/typeobj.rst:2591 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3447,80 +3447,80 @@ msgid "" "length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2599 +#: ../../c-api/typeobj.rst:2601 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2606 +#: ../../c-api/typeobj.rst:2608 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2610 +#: ../../c-api/typeobj.rst:2612 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2614 +#: ../../c-api/typeobj.rst:2616 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2618 +#: ../../c-api/typeobj.rst:2620 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2622 ../../c-api/typeobj.rst:2631 +#: ../../c-api/typeobj.rst:2624 ../../c-api/typeobj.rst:2633 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2626 ../../c-api/typeobj.rst:2637 +#: ../../c-api/typeobj.rst:2628 ../../c-api/typeobj.rst:2639 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2633 +#: ../../c-api/typeobj.rst:2635 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2640 +#: ../../c-api/typeobj.rst:2642 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2644 +#: ../../c-api/typeobj.rst:2646 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2648 +#: ../../c-api/typeobj.rst:2650 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2652 +#: ../../c-api/typeobj.rst:2654 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2656 +#: ../../c-api/typeobj.rst:2658 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2660 +#: ../../c-api/typeobj.rst:2662 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2664 +#: ../../c-api/typeobj.rst:2666 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2678 +#: ../../c-api/typeobj.rst:2680 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2694 +#: ../../c-api/typeobj.rst:2696 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2696 +#: ../../c-api/typeobj.rst:2698 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3528,46 +3528,46 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2701 +#: ../../c-api/typeobj.rst:2703 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2718 +#: ../../c-api/typeobj.rst:2720 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2762 +#: ../../c-api/typeobj.rst:2764 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2787 +#: ../../c-api/typeobj.rst:2789 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2806 +#: ../../c-api/typeobj.rst:2808 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2817 +#: ../../c-api/typeobj.rst:2819 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: ../../c-api/typeobj.rst:808 ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:809 ../../c-api/typeobj.rst:874 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/typeobj.rst:808 +#: ../../c-api/typeobj.rst:809 msgid "repr" msgstr "repr" -#: ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:874 msgid "hash" msgstr "hash(雜湊)" diff --git a/c-api/unicode.po b/c-api/unicode.po index 7739b467b3..4795cf2177 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+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-" @@ -757,7 +757,7 @@ msgstr "" msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " -"the reference with incremented refcount." +"a new :term:`strong reference` to the object." msgstr "" #: ../../c-api/unicode.rst:576 @@ -1697,12 +1697,12 @@ 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 " "is an existing interned string that is the same as *\\*string*, it sets " -"*\\*string* to it (decrementing the reference count of the old string object " -"and incrementing the reference count of the interned string object), " -"otherwise it leaves *\\*string* alone and interns it (incrementing its " -"reference count). (Clarification: even though there is a lot of talk about " -"reference counts, think of this function as reference-count-neutral; you own " -"the object after the call if and only if you owned it before the call.)" +"*\\*string* to it (releasing the reference to the old string object and " +"creating a new :term:`strong reference` to the interned string object), " +"otherwise it leaves *\\*string* alone and interns it (creating a new :term:" +"`strong reference`). (Clarification: even though there is a lot of talk " +"about references, think of this function as reference-neutral; you own the " +"object after the call if and only if you owned it before the call.)" msgstr "" #: ../../c-api/unicode.rst:1458 diff --git a/distributing/index.po b/distributing/index.po index 2275126ded..c21b18ddd6 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,308 +21,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.2.2\n" -#: ../../distributing/index.rst:5 +#: ../../distributing/index.rst:10 msgid "Distributing Python Modules" msgstr "發布 Python 模組" -#: ../../distributing/index.rst:0 -msgid "Email" -msgstr "電子郵件" - -#: ../../distributing/index.rst:7 -msgid "distutils-sig@python.org" -msgstr "distutils-sig@python.org" - -#: ../../distributing/index.rst:10 -msgid "" -"As a popular open source development project, Python has an active " -"supporting community of contributors and users that also make their software " -"available for other Python developers to use under open source license terms." -msgstr "" -"作為一個普及的開源開發專案,Python 有一個活躍的支持社群,由其貢獻者及使用者組" -"成,而他們也讓他們的軟體可被其他 Python 開發者在開源授權條款下使用。" - #: ../../distributing/index.rst:14 msgid "" -"This allows Python users to share and collaborate effectively, benefiting " -"from the solutions others have already created to common (and sometimes even " -"rare!) problems, as well as potentially contributing their own solutions to " -"the common pool." -msgstr "" -"這樣可以讓 Python 使用者們有效地共享和合作,並受益於其他人對常見(有時甚至是" -"罕見)的問題已經建立的解決方案,更可以在公開社群中潛在地貢獻他們自己的解決方" -"案。" - -#: ../../distributing/index.rst:19 -msgid "" -"This guide covers the distribution part of the process. For a guide to " -"installing other Python projects, refer to the :ref:`installation guide " -"`." -msgstr "" -"這份指南涵蓋了上述過程中的發布部分。如果是要安裝其他的 Python 專案,請參考" -"\\ :ref:`安裝 Python 模組 `\\ 指南。" - -#: ../../distributing/index.rst:25 -msgid "" -"For corporate and other institutional users, be aware that many " -"organisations have their own policies around using and contributing to open " -"source software. Please take such policies into account when making use of " -"the distribution and installation tools provided with Python." -msgstr "" -"對於企業和其他機構的使用者,要注意到,許多組織對於使用和貢獻開源軟體都有自己" -"的政策。在開始使用配備 Python 的發布及安裝工具時,請將那些政策納入考量。" - -#: ../../distributing/index.rst:32 -msgid "Key terms" -msgstr "關鍵術語" - -#: ../../distributing/index.rst:34 -msgid "" -"the `Python Package Index `__ is a public repository of " -"open source licensed packages made available for use by other Python users" -msgstr "" -"`Python 套件索引 (Python Package Index) `__ 是開源授權套件" -"的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用" - -#: ../../distributing/index.rst:37 -msgid "" -"the `Python Packaging Authority `__ are the group of " -"developers and documentation authors responsible for the maintenance and " -"evolution of the standard packaging tools and the associated metadata and " -"file format standards. They maintain a variety of tools, documentation and " -"issue trackers on `GitHub `__." -msgstr "" -"`Python 封裝管理站 (Python Packaging Authority) `__ 是" -"一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" -"元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 平台上維護各種工具、說明文件及問題追蹤系統。" - -#: ../../distributing/index.rst:43 -msgid "" -"``distutils`` is the original build and distribution system first added to " -"the Python standard library in 1998. While direct use of ``distutils`` is " -"being phased out, it still laid the foundation for the current packaging and " -"distribution infrastructure, and it not only remains part of the standard " -"library, but its name lives on in other ways (such as the name of the " -"mailing list used to coordinate Python packaging standards development)." -msgstr "" -"``distutils`` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" -"庫。雖然直接使用 ``distutils`` 的方式已經被逐步淘汰,它仍然是現今封裝和發布的" -"基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" -"著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" - -#: ../../distributing/index.rst:50 -msgid "" -"`setuptools`_ is a (largely) drop-in replacement for ``distutils`` first " -"published in 2004. Its most notable addition over the unmodified " -"``distutils`` tools was the ability to declare dependencies on other " -"packages. It is currently recommended as a more regularly updated " -"alternative to ``distutils`` that offers consistent support for more recent " -"packaging standards across a wide range of Python versions." -msgstr "" -"`setuptools`_ 是 ``distutils`` 的一個(主要的)偶然出現的替代品,它於 2004 年" -"首次被發布。相較於未修改的 ``distutils`` 工具,它最值得注意的新功能,是能夠宣" -"告對其他套件的依賴性 (dependency)。它目前被推薦為 ``distutils`` 的一個替代方" -"案,因其更新較為頻繁,且能在各個廣泛的 Python 版本之間,為較新的封裝標準提供" -"一致性的支援。" - -#: ../../distributing/index.rst:56 -msgid "" -"`wheel`_ (in this context) is a project that adds the ``bdist_wheel`` " -"command to ``distutils``/`setuptools`_. This produces a cross platform " -"binary packaging format (called \"wheels\" or \"wheel files\" and defined " -"in :pep:`427`) that allows Python libraries, even those including binary " -"extensions, to be installed on a system without needing to be built locally." -msgstr "" -"`wheel`_\\ (在此文中)是一個將 ``bdist_wheel`` 指令附加到 ``distutils``/" -"`setuptools`_ 的專案。這會產生一個跨平台的二進制封裝格式(稱為「wheels」或" -"「wheel 檔案」,並於 :pep:`427` 中被定義),它可讓 Python 函式庫,甚至那些包" -"含二進制擴充的函式庫,可以在系統中被安裝,但不需要在本機進行建置。" - -#: ../../distributing/index.rst:67 -msgid "Open source licensing and collaboration" -msgstr "開源授權與協同合作" - -#: ../../distributing/index.rst:69 -msgid "" -"In most parts of the world, software is automatically covered by copyright. " -"This means that other developers require explicit permission to copy, use, " -"modify and redistribute the software." +"Information and guidance on distributing Python modules and packages has " +"been moved to the `Python Packaging User Guide`_, and the tutorial on " +"`packaging Python projects`_." msgstr "" -"在世界上多數地方,軟體會自動受版權所保護。這代表著其他開發人員需要明確的許" -"可,才能複製、使用、修改和重新發布軟體。" - -#: ../../distributing/index.rst:73 -msgid "" -"Open source licensing is a way of explicitly granting such permission in a " -"relatively consistent way, allowing developers to share and collaborate " -"efficiently by making common solutions to various problems freely available. " -"This leaves many developers free to spend more time focusing on the problems " -"that are relatively unique to their specific situation." -msgstr "" -"開源授權是一種以相對一致的方式,明確地授予此類許可的方法,它允許開發人員透過" -"為各種問題提供免費可用的共通解決方案,來達到高效率的共享和協作。這使得許多開" -"發人員可以自由地將更多時間專注於處理他們在特定情況中遇到的相對獨特的問題。" - -#: ../../distributing/index.rst:79 -msgid "" -"The distribution tools provided with Python are designed to make it " -"reasonably straightforward for developers to make their own contributions " -"back to that common pool of software if they choose to do so." -msgstr "" -"Python 所提供的發布工具,被設計為讓開發人員能夠以合理的直觀方式,對該公用軟體" -"庫回饋他們自己的貢獻,前提是他們願意這樣做。" - -#: ../../distributing/index.rst:83 -msgid "" -"The same distribution tools can also be used to distribute software within " -"an organisation, regardless of whether that software is published as open " -"source software or not." -msgstr "" -"同一個發布工具也可用於在組織內發布軟體,不論該軟體是否有作為開源軟體被發布。" - -#: ../../distributing/index.rst:89 -msgid "Installing the tools" -msgstr "安裝工具" - -#: ../../distributing/index.rst:91 -msgid "" -"The standard library does not include build tools that support modern Python " -"packaging standards, as the core development team has found that it is " -"important to have standard tools that work consistently, even on older " -"versions of Python." -msgstr "" -"標準函式庫並不包含那些支援現代 Python 封裝標準的建置工具,因為核心開發團隊發" -"現,提供始終可運作的標準工具是很重要的,即使它們是在舊版的 Python 上運作。" - -#: ../../distributing/index.rst:96 -msgid "" -"The currently recommended build and distribution tools can be installed by " -"invoking the ``pip`` module at the command line::" -msgstr "" -"當今被推薦的建置及發布工具,可以透過在命令列中呼叫 ``pip`` 模組來安裝它們:\n" -"\n" -"::" - -#: ../../distributing/index.rst:103 -msgid "" -"For POSIX users (including macOS and Linux users), these instructions assume " -"the use of a :term:`virtual environment`." -msgstr "" -"對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),這些教學皆假設有使用 :" -"term:`virtual environment`\\ 。" - -#: ../../distributing/index.rst:106 -msgid "" -"For Windows users, these instructions assume that the option to adjust the " -"system PATH environment variable was selected when installing Python." -msgstr "" -"對於 Windows 使用者,這些教學皆假設在安裝 Python 時,「可調整系統 PATH 環境變" -"數」的選項已被選取。" - -#: ../../distributing/index.rst:110 -msgid "" -"The Python Packaging User Guide includes more details on the `currently " -"recommended tools`_." -msgstr "Python 封裝使用者指南包含了關於\\ `當今推薦工具`_\\ 的更多細節。" - -#: ../../distributing/index.rst:122 -msgid "Reading the Python Packaging User Guide" -msgstr "閱讀 Python 封裝使用者指南" - -#: ../../distributing/index.rst:124 -msgid "" -"The Python Packaging User Guide covers the various key steps and elements " -"involved in creating and publishing a project:" -msgstr "" -"Python 封裝使用者指南涵蓋了關於建立和發布一個專案的各項關鍵步驟和元素:" - -#: ../../distributing/index.rst:127 -msgid "`Project structure`_" -msgstr "`專案結構`_" - -#: ../../distributing/index.rst:128 -msgid "`Building and packaging the project`_" -msgstr "`專案建置與封裝`_" - -#: ../../distributing/index.rst:129 -msgid "`Uploading the project to the Python Package Index`_" -msgstr "`上傳專案至 Python 套件索引 (Python Package Index)`_" - -#: ../../distributing/index.rst:130 -msgid "`The .pypirc file`_" -msgstr "`.pypirc 檔案`_" - -#: ../../distributing/index.rst:139 -msgid "How do I...?" -msgstr "我該如何...?" - -#: ../../distributing/index.rst:141 -msgid "These are quick answers or links for some common tasks." -msgstr "接下來是關於一些常見任務的快速解答或連結。" - -#: ../../distributing/index.rst:144 -msgid "... choose a name for my project?" -msgstr "...為我的專案選擇一個名稱?" - -#: ../../distributing/index.rst:146 -msgid "This isn't an easy topic, but here are a few tips:" -msgstr "這不是一個簡單的題目,但這裡有一些提示:" - -#: ../../distributing/index.rst:148 -msgid "check the Python Package Index to see if the name is already in use" -msgstr "檢查 Python 套件索引,看看該名稱是否已被使用" - -#: ../../distributing/index.rst:149 -msgid "" -"check popular hosting sites like GitHub, Bitbucket, etc to see if there is " -"already a project with that name" -msgstr "" -"檢查常用的代管網站,像是 GitHub、Bitbucket 等,看看是否已經有一個使用該名稱的" -"專案" - -#: ../../distributing/index.rst:151 -msgid "check what comes up in a web search for the name you're considering" -msgstr "檢查您正在考慮的名稱在網路搜尋中會出現的內容" - -#: ../../distributing/index.rst:152 -msgid "" -"avoid particularly common words, especially ones with multiple meanings, as " -"they can make it difficult for users to find your software when searching " -"for it" -msgstr "" -"避免使用特別常見的單字,尤其是那些有多重含義的單字,因為它們會讓使用者在搜尋" -"你的軟體時時很難找到它" - -#: ../../distributing/index.rst:158 -msgid "... create and distribute binary extensions?" -msgstr "...建立和發布二進制擴充?" - -#: ../../distributing/index.rst:160 -msgid "" -"This is actually quite a complex topic, with a variety of alternatives " -"available depending on exactly what you're aiming to achieve. See the Python " -"Packaging User Guide for more information and recommendations." -msgstr "" -"實際上這是一個非常複雜的題目,因為有各式各樣的替代方案可使用,取決於您確實想" -"要達成的目標。更多的資訊和建議,請參閱 Python 封裝使用者指南。" - -#: ../../distributing/index.rst:166 -msgid "" -"`Python Packaging User Guide: Binary Extensions `__" -msgstr "" -"`Python 封裝使用者指南:二進制擴充 `__" - -#: ../../distributing/index.rst:115 -msgid "Python Package Index (PyPI)" -msgstr "Python Package Index (PyPI)" - -#: ../../distributing/index.rst:115 -msgid "PyPI" -msgstr "PyPI" - -#: ../../distributing/index.rst:115 -msgid "(see Python Package Index (PyPI))" -msgstr "(請見 Python Package Index (PyPI))" +"有關發布 Python 模組和套件的資訊和指南已移至 `Python Packaging User Guide`_," +"而相關教學已經移至 `packaging Python projects`_。" diff --git a/extending/building.po b/extending/building.po index 83ef47cbff..ea72239809 100644 --- a/extending/building.po +++ b/extending/building.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,11 +67,11 @@ msgid "" "in one library\"* section in :pep:`489` for details." msgstr "" -#: ../../extending/building.rst:51 +#: ../../extending/building.rst:52 msgid "Building C and C++ Extensions with setuptools" msgstr "" -#: ../../extending/building.rst:53 +#: ../../extending/building.rst:54 msgid "" "Python 3.12 and newer no longer come with distutils. Please refer to the " "``setuptools`` documentation at https://setuptools.readthedocs.io/en/latest/" diff --git a/extending/extending.po b/extending/extending.po index 958e723db0..3df03f58c9 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -307,8 +307,8 @@ msgstr "" #: ../../extending/extending.rst:245 msgid "" -"We discuss the use of ``PyMODINIT_FUNC`` as a function return type later in " -"this sample." +"We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " +"later in this sample." msgstr "" #: ../../extending/extending.rst:248 @@ -422,9 +422,9 @@ msgstr "" #: ../../extending/extending.rst:366 msgid "" -"Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return " -"type, declares any special linkage declarations required by the platform, " -"and for C++ declares the function as ``extern \"C\"``." +"Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " +"return type, declares any special linkage declarations required by the " +"platform, and for C++ declares the function as ``extern \"C\"``." msgstr "" #: ../../extending/extending.rst:370 diff --git a/faq/programming.po b/faq/programming.po index c9a99333a9..f569f5483c 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -796,11 +796,11 @@ msgstr "list 是 :term:`mutable`,這意味著你可以變更它們的內容。 #: ../../faq/programming.rst:457 #, fuzzy msgid "" -"After the call to :meth:`~list.append`, the content of the mutable object " -"has changed from ``[]`` to ``[10]``. Since both the variables refer to the " -"same object, using either name accesses the modified value ``[10]``." +"After the call to :meth:`!append`, the content of the mutable object has " +"changed from ``[]`` to ``[10]``. Since both the variables refer to the same " +"object, using either name accesses the modified value ``[10]``." msgstr "" -"在呼叫 :meth:`~list.append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由" +"在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由" "於這兩個變數都引用同一個物件,因此使用任一名稱都可以存取修改後的值 " "``[10]`` 。" @@ -2222,14 +2222,13 @@ msgid "" "an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " "augmented assignment is executed, and its return value is what gets used in " "the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent " -"to calling :meth:`~list.extend` on the list and returning the list. That's " -"why we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list." -"extend`::" +"to calling :meth:`!extend` on the list and returning the list. That's why " +"we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" msgstr "" "要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一個 :meth:" "`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並且它的回傳" "value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當於在list上" -"呼叫 :meth:`~list.extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :" +"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :" "meth:`!list.extend` 的「簡寫」:\n" "\n" "::" @@ -2959,12 +2958,10 @@ msgstr "" #: ../../faq/programming.rst:1905 msgid "" -"For example, here is the implementation of :meth:`collections.abc.Sequence." +"For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" -"例如,以下是 :meth:`collections.abc.Sequence.__contains__` 的實作:\n" -"\n" -"::" +"例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" #: ../../faq/programming.rst:1916 msgid "" diff --git a/glossary.po b/glossary.po index 5e6d394234..a5b4f9f455 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:19+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,7 +57,7 @@ msgstr "" #: ../../glossary.rst:23 msgid "The :const:`Ellipsis` built-in constant." -msgstr "內建常數 :const:`Ellipsis`\\ 。" +msgstr "內建常數 :const:`Ellipsis`。" #: ../../glossary.rst:24 msgid "2to3" @@ -80,7 +80,7 @@ msgid "" "reference`." msgstr "" "2to3 在可以標準函式庫中以 :mod:`lib2to3` 被使用;它提供了一個獨立的入口點," -"在 :file:`Tools/scripts/2to3`\\ 。請參閱 :ref:`2to3-reference`。" +"在 :file:`Tools/scripts/2to3`。請參閱 :ref:`2to3-reference`。" #: ../../glossary.rst:33 msgid "abstract base class" @@ -100,8 +100,8 @@ msgid "" "You can create your own ABCs with the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" -"typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`\\ ,則顯得" -"笨拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" "(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" "mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" @@ -138,9 +138,9 @@ msgid "" "and :pep:`526`, which describe this functionality. Also see :ref:" "`annotations-howto` for best practices on working with annotations." msgstr "" -"請參閱 :term:`variable annotation`\\ 、\\ :term:`function " -"annotation`\\ 、\\ :pep:`484` 和 :pep:`526`,這些章節皆有此功能的說明。關於註" -"釋的最佳實踐方法也請參閱 :ref:`annotations-howto`\\ 。" +"請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484` " +"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參閱 :ref:" +"`annotations-howto`。" #: ../../glossary.rst:62 msgid "argument" @@ -199,7 +199,7 @@ msgid "" "and :pep:`362`." msgstr "" "另請參閱術語表的 :term:`parameter`\\ (參數)條目、常見問題中的\\ :ref:`引數" -"和參數之間的差異 `\\ ,以及 :pep:`362`\\ 。" +"和參數之間的差異 `,以及 :pep:`362`。" #: ../../glossary.rst:92 msgid "asynchronous context manager" @@ -364,11 +364,11 @@ msgid "" "github.io/>`_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " -"`_\\ ,Python 的創造者。" +"`_,Python 的創造者。" #: ../../glossary.rst:158 msgid "binary file" -msgstr "binary file(二進制檔案)" +msgstr "binary file(二進位檔案)" #: ../../glossary.rst:160 msgid "" @@ -379,10 +379,10 @@ msgid "" "GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" -"組串物件)的 :term:`file object`\\ (檔案物件)。二進制檔案的例子有:以二進制" -"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、\\ :data:`sys.stdin." -"buffer`、\\ :data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:" -"`gzip.GzipFile` 實例。" +"組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" +"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin." +"buffer`、:data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:`gzip." +"GzipFile` 實例。" #: ../../glossary.rst:167 msgid "" @@ -398,17 +398,17 @@ msgstr "borrowed reference(借用參照)" #: ../../glossary.rst:171 msgid "" -"In Python's C API, a borrowed reference is a reference to an object. It does " -"not modify the object reference count. It becomes a dangling pointer if the " -"object is destroyed. For example, a garbage collection can remove the last :" -"term:`strong reference` to the object and so destroy it." +"In Python's C API, a borrowed reference is a reference to an object, where " +"the code using the object does not own the reference. It becomes a dangling " +"pointer if the object is destroyed. For example, a garbage collection can " +"remove the last :term:`strong reference` to the object and so destroy it." msgstr "" -"在 Python 的 C API 中,借用參照是一個對物件的參照。它不會修改該物件的參照計" -"數 (reference count)。如果該物件被銷毀,它會成為一個迷途指標 (dangling " -"pointer)。例如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :" -"term:`strong reference`\\ (強參照),而將該物件銷毀。" +"在 Python 的 C API 中,借用參照是一個對物件的參照,其中使用該物件的程式碼並不" +"擁有這個參照。如果該物件被銷毀,它會成為一個迷途指標 (dangling pointer)。例" +"如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :term:`strong " +"reference`\\ (強參照),而將該物件銷毀。" -#: ../../glossary.rst:176 +#: ../../glossary.rst:177 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " @@ -418,14 +418,14 @@ msgid "" msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " "轉換為 :term:`strong reference` 是被建議的做法,除非該物件不能在最後一次使用" -"借用參照之前被銷毀。\\ :c:func:`Py_NewRef` 函式可用於建立一個新的 :term:" -"`strong reference`。" +"借用參照之前被銷毀。:c:func:`Py_NewRef` 函式可用於建立一個新的 :term:`strong " +"reference`。" -#: ../../glossary.rst:181 +#: ../../glossary.rst:182 msgid "bytes-like object" msgstr "bytes-like object(類位元組串物件)" -#: ../../glossary.rst:183 +#: ../../glossary.rst:184 msgid "" "An object that supports the :ref:`bufferobjects` and can export a C-:term:" "`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " @@ -435,12 +435,11 @@ msgid "" "sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" -"件。這包括所有的 :class:`bytes`、\\ :class:`bytearray` 和 :class:`array." -"array` 物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處" -"理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過 socket(插" -"座)發送。" +"件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " +"物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處理二進位" +"資料的各種運算;這些運算包括壓縮、儲存至二進位檔案和透過 socket(插座)發送。" -#: ../../glossary.rst:190 +#: ../../glossary.rst:191 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " @@ -449,17 +448,17 @@ msgid "" "immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" -"有些運算需要二進制資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" +"有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" "組串物件」。可變緩衝區的物件包括 :class:`bytearray`,以及 :class:`bytearray` " -"的 :class:`memoryview`。其他的運算需要讓二進制資料被儲存在不可變物件(「唯讀" +"的 :class:`memoryview`。其他的運算需要讓二進位資料被儲存在不可變物件(「唯讀" "的類位元組串物件」)中;這些物件包括 :class:`bytes`,以及 :class:`bytes` 物件" "的 :class:`memoryview`。" -#: ../../glossary.rst:198 +#: ../../glossary.rst:199 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../glossary.rst:200 +#: ../../glossary.rst:201 msgid "" "Python source code is compiled into bytecode, the internal representation of " "a Python program in the CPython interpreter. The bytecode is also cached in " @@ -478,18 +477,18 @@ msgstr "" "上是無法在不同的 Python 虛擬機器之間運作的,也不能在不同版本的 Python 之間保" "持穩定。" -#: ../../glossary.rst:210 +#: ../../glossary.rst:211 msgid "" "A list of bytecode instructions can be found in the documentation for :ref:" "`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" -#: ../../glossary.rst:212 +#: ../../glossary.rst:213 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../glossary.rst:214 +#: ../../glossary.rst:215 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" @@ -499,7 +498,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:219 +#: ../../glossary.rst:220 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " "instance of a class that implements the :meth:`~object.__call__` method is " @@ -508,22 +507,22 @@ msgstr "" "一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" "meth:`~object.__call__` 方法的 class 之實例也是個 callable。" -#: ../../glossary.rst:222 +#: ../../glossary.rst:223 msgid "callback" msgstr "callback(回呼)" -#: ../../glossary.rst:224 +#: ../../glossary.rst:225 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:226 +#: ../../glossary.rst:227 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:228 +#: ../../glossary.rst:229 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -531,11 +530,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:231 +#: ../../glossary.rst:232 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:233 +#: ../../glossary.rst:234 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -543,11 +542,11 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:235 +#: ../../glossary.rst:236 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:237 +#: ../../glossary.rst:238 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -567,23 +566,23 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:247 +#: ../../glossary.rst:248 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:249 +#: ../../glossary.rst:250 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" +"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`。" -#: ../../glossary.rst:252 +#: ../../glossary.rst:253 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:254 +#: ../../glossary.rst:255 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -596,13 +595,13 @@ msgstr "" "Local Storage),在其中,一個變數在每個執行緒可能具有不同的值。然而,關於情境" "變數,在一個執行緒中可能會有多個情境,而情境變數的主要用途,是在並行的非同步" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" -"`contextvars`\\ 。" +"`contextvars`。" -#: ../../glossary.rst:261 +#: ../../glossary.rst:262 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:265 +#: ../../glossary.rst:266 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -619,11 +618,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:274 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:276 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -632,13 +631,13 @@ msgid "" msgstr "" "協程是副程式 (subroutine) 的一種更為廣義的形式。副程式是在某個時間點被進入並" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" -"以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" +"以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:281 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:282 +#: ../../glossary.rst:283 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -646,14 +645,14 @@ msgid "" "These were introduced by :pep:`492`." msgstr "" "一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" -"`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" -"`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " +"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:287 +#: ../../glossary.rst:288 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:289 +#: ../../glossary.rst:290 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -664,11 +663,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:293 +#: ../../glossary.rst:294 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:295 +#: ../../glossary.rst:296 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -676,9 +675,9 @@ msgid "" msgstr "" "一個函式,它會回傳另一個函式,通常它會使用 ``@wrapper`` 語法,被應用為一種函" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " -"和 :func:`staticmethod`\\ 。" +"和 :func:`staticmethod`。" -#: ../../glossary.rst:299 +#: ../../glossary.rst:300 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -687,7 +686,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:310 +#: ../../glossary.rst:311 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -696,11 +695,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:313 +#: ../../glossary.rst:314 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:315 +#: ../../glossary.rst:316 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -712,27 +711,27 @@ msgid "" "including functions, methods, properties, class methods, static methods, and " "reference to super classes." msgstr "" -"任何定義了 :meth:`__get__`\\ 、\\ :meth:`__set__` 或 :meth:`__delete__` " -"method 的物件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找" -"時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字" -"典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method " -"會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎," -"這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " -"super class(父類別)的參照。" +"任何定義了 :meth:`__get__`、:meth:`__set__` 或 :meth:`__delete__` method 的物" +"件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找時被觸發。通" +"常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字典中查找名稱" +"為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method 會被呼叫。對" +"描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎,這些功能包括" +"函式、method、屬性 (property)、class method、靜態 method,以及對 super class" +"(父類別)的參照。" -#: ../../glossary.rst:325 +#: ../../glossary.rst:326 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" -"使用指南 `\\ 。" +"使用指南 `。" -#: ../../glossary.rst:327 +#: ../../glossary.rst:328 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:329 +#: ../../glossary.rst:330 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " @@ -742,11 +741,11 @@ msgstr "" "有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " "(hash)。" -#: ../../glossary.rst:332 +#: ../../glossary.rst:333 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:334 +#: ../../glossary.rst:335 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -755,13 +754,13 @@ msgid "" msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" -"了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" +"了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:338 +#: ../../glossary.rst:339 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:340 +#: ../../glossary.rst:341 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -769,16 +768,16 @@ msgid "" "reflects these changes. To force the dictionary view to become a full list " "use ``list(dictview)``. See :ref:`dict-views`." msgstr "" -"從 :meth:`dict.keys`\\ 、\\ :meth:`dict.values` 及 :meth:`dict.items` 回傳的" -"物件被稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該" -"檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " -"``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" +"從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" +"稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" +"反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " +"``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:346 +#: ../../glossary.rst:347 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:348 +#: ../../glossary.rst:349 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -791,11 +790,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:354 +#: ../../glossary.rst:355 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:356 +#: ../../glossary.rst:357 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -816,11 +815,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:365 +#: ../../glossary.rst:366 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:367 +#: ../../glossary.rst:368 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -835,11 +834,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:373 +#: ../../glossary.rst:374 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:375 +#: ../../glossary.rst:376 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -852,14 +851,14 @@ msgstr "" "一段可以被評估並求值的語法。換句話說,一個運算式就是文字、名稱、屬性存取、運" "算子或函式呼叫等運算式元件的累積,而這些元件都能回傳一個值。與許多其他語言不" "同的是,並非所有的 Python 語言構造都是運算式。另外有一些 :term:`statement`\\ " -"(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" -"陳述式,而不是運算式。" +"(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" +"式,而不是運算式。" -#: ../../glossary.rst:382 +#: ../../glossary.rst:383 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:384 +#: ../../glossary.rst:385 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -867,24 +866,24 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:387 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:388 +#: ../../glossary.rst:389 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" -"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" +"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:391 +#: ../../glossary.rst:392 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:393 +#: ../../glossary.rst:394 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " @@ -897,9 +896,9 @@ msgstr "" "`write()` 等 method)來操作底層資源的物件。根據檔案物件被建立的方式,它能夠協" "調對真實磁碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內" "緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" -"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" +"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:401 +#: ../../glossary.rst:402 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -907,24 +906,23 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進制檔案 `\\ 、緩衝的" -"\\ :term:`二進制檔案 `\\ 和\\ :term:`文字檔案 `\\ 。" -"它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" -"`open` 函式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" +"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" +"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:406 +#: ../../glossary.rst:407 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:408 +#: ../../glossary.rst:409 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:409 +#: ../../glossary.rst:410 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:411 +#: ../../glossary.rst:412 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -932,16 +930,16 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:414 +#: ../../glossary.rst:415 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " "functions can raise :exc:`UnicodeError`." msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" -"此保證,則 API 函式會引發 :exc:`UnicodeError`\\ 。" +"此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:419 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -950,7 +948,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:422 +#: ../../glossary.rst:423 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -959,44 +957,44 @@ msgid "" msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" "式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" -"member:`~PyConfig.filesystem_encoding`\\ ,以及 :c:type:`PyConfig` 的成員 :c:" -"member:`~PyConfig.filesystem_errors`\\ 。" +"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" +"member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:427 +#: ../../glossary.rst:428 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:429 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:430 +#: ../../glossary.rst:431 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:433 +#: ../../glossary.rst:434 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " "entry finders ` for use with :data:`sys.path_hooks`." msgstr "" "從 Python 3.3 開始,有兩種類型的尋檢器:\\ :term:`元路徑尋檢器 (meta path " -"finder) ` 會使用 :data:`sys.meta_path`\\ ,而\\ :term:`路徑" -"項目尋檢器 (path entry finder) ` 會使用 :data:`sys." -"path_hooks`\\ 。" +"finder) ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項" +"目尋檢器 (path entry finder) ` 會使用 :data:`sys." +"path_hooks`。" -#: ../../glossary.rst:437 +#: ../../glossary.rst:438 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." -msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" +msgstr "請參閱 :pep:`302`、:pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:438 +#: ../../glossary.rst:439 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:440 +#: ../../glossary.rst:441 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1007,13 +1005,13 @@ msgstr "" "向下無條件捨去到最接近整數的數學除法。向下取整除法的運算子是 ``//``。例如,運" "算式 ``11 // 4`` 的計算結果為 ``2``,與 float(浮點數)真除法所回傳的 " "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " -"*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" +"*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:445 +#: ../../glossary.rst:446 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:447 +#: ../../glossary.rst:448 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1021,19 +1019,19 @@ msgid "" "ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `\\ ,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:" "`function`\\ 章節。" -#: ../../glossary.rst:451 +#: ../../glossary.rst:452 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:453 +#: ../../glossary.rst:454 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:455 +#: ../../glossary.rst:456 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1044,24 +1042,24 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:463 +#: ../../glossary.rst:464 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:465 +#: ../../glossary.rst:466 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" -"請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。關於註" -"釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" +"請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" +"的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:469 +#: ../../glossary.rst:470 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:471 +#: ../../glossary.rst:472 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1079,11 +1077,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:482 +#: ../../glossary.rst:483 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:484 +#: ../../glossary.rst:485 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1095,11 +1093,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:489 ../../glossary.rst:490 +#: ../../glossary.rst:490 ../../glossary.rst:491 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:492 +#: ../../glossary.rst:493 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1110,24 +1108,24 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:497 +#: ../../glossary.rst:498 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" -"代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" +"代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:500 +#: ../../glossary.rst:501 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:502 +#: ../../glossary.rst:503 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:504 +#: ../../glossary.rst:505 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1138,11 +1136,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:510 ../../glossary.rst:511 +#: ../../glossary.rst:511 ../../glossary.rst:512 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:513 +#: ../../glossary.rst:514 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -1155,11 +1153,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:520 +#: ../../glossary.rst:521 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:522 +#: ../../glossary.rst:523 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1168,49 +1166,49 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:526 +#: ../../glossary.rst:527 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" -"`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" +"`functools.singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:528 +#: ../../glossary.rst:529 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:530 +#: ../../glossary.rst:531 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" "term:`type hints ` and :term:`annotations `." msgstr "" "一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" -"`容器型別 `\\ ,像是 :class:`list` 和 :class:`dict`。它被用於" -"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `\\ 。" +"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:535 +#: ../../glossary.rst:536 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `\\ 、\\ :pep:" -"`483`\\ 、\\ :pep:`484`\\ 、\\ :pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" +"`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:537 +#: ../../glossary.rst:538 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:539 +#: ../../glossary.rst:540 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:540 +#: ../../glossary.rst:541 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:542 +#: ../../glossary.rst:543 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1227,7 +1225,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:551 +#: ../../glossary.rst:552 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1238,7 +1236,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:556 +#: ../../glossary.rst:557 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1250,24 +1248,24 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:562 +#: ../../glossary.rst:563 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:564 +#: ../../glossary.rst:565 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" -"間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" +"間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:567 +#: ../../glossary.rst:568 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:569 +#: ../../glossary.rst:570 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -1279,7 +1277,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:574 +#: ../../glossary.rst:575 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1287,7 +1285,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:577 +#: ../../glossary.rst:578 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1300,13 +1298,13 @@ msgstr "" "dictionary)並不是;而不可變的容器(例如 tuple(元組)和 frozenset),只有當" "它們的元素是可雜湊的,它們本身才是可雜湊的。若物件是使用者自定 class 的實例," "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" -"較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" +"較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:584 +#: ../../glossary.rst:585 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:586 +#: ../../glossary.rst:587 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1316,11 +1314,11 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:589 +#: ../../glossary.rst:590 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:591 +#: ../../glossary.rst:592 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1332,11 +1330,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:597 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:598 +#: ../../glossary.rst:599 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1345,14 +1343,14 @@ msgid "" msgstr "" "一個位置(或\\ :term:`路徑項目 `\\ )的列表,而那些位置就是在 " "import 模組時,會被 :term:`path based finder`\\ (基於路徑的尋檢器)搜尋模組" -"的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" -"件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" +"的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " +"(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:603 +#: ../../glossary.rst:604 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:605 +#: ../../glossary.rst:606 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1360,11 +1358,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:607 +#: ../../glossary.rst:608 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:609 +#: ../../glossary.rst:610 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1372,11 +1370,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:611 +#: ../../glossary.rst:612 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:613 +#: ../../glossary.rst:614 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1389,11 +1387,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:619 +#: ../../glossary.rst:620 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:621 +#: ../../glossary.rst:622 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1407,11 +1405,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:628 +#: ../../glossary.rst:629 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:630 +#: ../../glossary.rst:631 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1424,23 +1422,23 @@ msgid "" msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " -"(garbage collector) `\\ 。這能夠觸發使用者自定的解構函式 " +"(garbage collector) `。這能夠觸發使用者自定的解構函式 " "(destructor) 或弱引用的回呼 (weakref callback),並執行其中的程式碼。在關閉階" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:639 +#: ../../glossary.rst:640 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:641 +#: ../../glossary.rst:642 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:643 +#: ../../glossary.rst:644 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1450,13 +1448,12 @@ msgid "" "term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" -"是 :class:`list`\\ 、\\ :class:`str` 和 :class:`tuple`\\ )和某些非序列型別," -"像是 :class:`dict`\\ 、\\ :term:`檔案物件 `\\ ,以及你所定義的任" -"何 class 物件,只要那些 class 有 :meth:`__iter__` method 或是實作 :term:" -"`sequence`\\ (序列)語意的 :meth:`__getitem__` method,該物件就是可疊代物" -"件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" +"class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," +"只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" +"列)語意的 :meth:`__getitem__` method,該物件就是可疊代物件。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:651 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1469,18 +1466,18 @@ msgid "" "also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" "可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" -"`zip`\\ 、\\ :func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :" -"func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 " -"(one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器" -"物件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數," -"用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" +"`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數,用" +"於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:660 +#: ../../glossary.rst:661 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:662 +#: ../../glossary.rst:663 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1501,19 +1498,19 @@ msgstr "" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" "任何對其 :meth:`__next__` method 的進一步呼叫,都只會再次引發 :exc:" -"`StopIteration`\\ 。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器" -"物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件" -"的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。" -"一個容器物件(像是 :class:`list`\\ )在每次你將它傳遞給 :func:`iter` 函式或" -"在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此" -"事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" -"件,使其看起來就像一個空的容器。" - -#: ../../glossary.rst:677 +"`StopIteration`。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器物件" +"本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件的場" +"合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。一個" +"容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式或在 :" +"keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此事" +"(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物件," +"使其看起來就像一個空的容器。" + +#: ../../glossary.rst:678 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:682 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`__iter__`." @@ -1521,11 +1518,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`__iter__`\\ 」這個規" "定。" -#: ../../glossary.rst:683 +#: ../../glossary.rst:684 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:685 +#: ../../glossary.rst:686 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1535,7 +1532,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:690 +#: ../../glossary.rst:691 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1543,11 +1540,11 @@ msgid "" "nlargest`, and :func:`itertools.groupby`." msgstr "" "Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" -"func:`min`\\ 、\\ :func:`max`\\ 、\\ :func:`sorted`\\ 、\\ :meth:`list." -"sort`\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" -"`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" +"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." +"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." +"groupby`。" -#: ../../glossary.rst:696 +#: ../../glossary.rst:697 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1557,26 +1554,26 @@ msgid "" "are three key function constructors. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" -"有幾種方法可以建立一個鍵函式。例如,\\ :meth:`str.lower` method 可以作為不分" -"大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造," -"例如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`\\ 、\\ :" -"func:`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建" -"構函式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排" -"序 `\\ 。" +"有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" +"寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" +"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" +"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " +"`。" -#: ../../glossary.rst:703 +#: ../../glossary.rst:704 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:705 ../../glossary.rst:994 +#: ../../glossary.rst:706 ../../glossary.rst:995 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:706 +#: ../../glossary.rst:707 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:708 +#: ../../glossary.rst:709 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1586,11 +1583,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:711 +#: ../../glossary.rst:712 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:713 +#: ../../glossary.rst:714 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1601,7 +1598,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:718 +#: ../../glossary.rst:719 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1615,11 +1612,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:723 +#: ../../glossary.rst:724 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:725 +#: ../../glossary.rst:726 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1627,28 +1624,28 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:728 +#: ../../glossary.rst:729 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:730 +#: ../../glossary.rst:731 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:732 +#: ../../glossary.rst:733 msgid "``locale.getencoding()`` can be used to get the locale encoding." msgstr "``locale.getencoding()`` 可以用來取得區域編碼。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:735 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:735 +#: ../../glossary.rst:736 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:737 +#: ../../glossary.rst:738 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1658,11 +1655,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:740 +#: ../../glossary.rst:741 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:742 +#: ../../glossary.rst:743 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1672,15 +1669,15 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。\\ :" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:748 +#: ../../glossary.rst:749 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:750 +#: ../../glossary.rst:751 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1690,21 +1687,21 @@ msgstr "" "一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" "法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" -"`importlib.abc.Loader`\\ 。" +"`importlib.abc.Loader`。" -#: ../../glossary.rst:754 +#: ../../glossary.rst:755 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:758 +#: ../../glossary.rst:759 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:759 +#: ../../glossary.rst:760 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:761 +#: ../../glossary.rst:762 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1714,16 +1711,16 @@ msgid "" "`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ 中,\\ :class:`collections." +"基底類別) `\\ 中,:class:`collections." "abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" -"包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`\\ 、\\ :class:" -"`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" +"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." +"OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:767 +#: ../../glossary.rst:768 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:769 +#: ../../glossary.rst:770 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:773 +#: ../../glossary.rst:774 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" -"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc." -"MetaPathFinder`\\ 。" +"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:775 +#: ../../glossary.rst:776 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:777 +#: ../../glossary.rst:778 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1765,15 +1761,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:787 +#: ../../glossary.rst:788 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:756 ../../glossary.rst:788 ../../glossary.rst:1120 +#: ../../glossary.rst:757 ../../glossary.rst:789 ../../glossary.rst:1123 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:790 +#: ../../glossary.rst:791 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1785,11 +1781,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:794 +#: ../../glossary.rst:795 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:796 +#: ../../glossary.rst:797 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_\\ 。" +"析順序 `_。" -#: ../../glossary.rst:800 +#: ../../glossary.rst:801 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:802 +#: ../../glossary.rst:803 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1814,15 +1810,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:806 +#: ../../glossary.rst:807 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:808 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:809 +#: ../../glossary.rst:810 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1830,31 +1826,31 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:811 +#: ../../glossary.rst:812 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:813 +#: ../../glossary.rst:814 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:815 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:816 +#: ../../glossary.rst:817 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:818 +#: ../../glossary.rst:819 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:820 +#: ../../glossary.rst:821 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1864,18 +1860,18 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:824 +#: ../../glossary.rst:825 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." "float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " -"回傳的值。另一個例子是 :data:`sys.float_info`\\ :\n" +"回傳的值。另一個例子是 :data:`sys.float_info`:\n" "\n" "::" -#: ../../glossary.rst:835 +#: ../../glossary.rst:836 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1885,17 +1881,17 @@ msgid "" "methods that may not be found in hand-written or built-in named tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" -"規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`\\ ,且定義了附名" -"欄位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " +"規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" +"位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " "(factory function) :func:`collections.namedtuple` 來建立。後者技術也增加了一" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:842 +#: ../../glossary.rst:843 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:844 +#: ../../glossary.rst:845 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1915,11 +1911,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:854 +#: ../../glossary.rst:855 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:856 +#: ../../glossary.rst:857 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1930,15 +1926,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:861 +#: ../../glossary.rst:862 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:862 +#: ../../glossary.rst:863 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:864 +#: ../../glossary.rst:865 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1950,14 +1946,14 @@ msgstr "" "能夠參照外層定義 (enclosing definition) 中的變數的能力。舉例來說,一個函式如" "果是在另一個函式中被定義,則它便能夠參照外層函式中的變數。請注意,在預設情況" "下,巢狀作用域僅適用於參照,而無法用於賦值。區域變數能在最內層作用域中讀取及" -"寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" -"許對外層作用域進行寫入。" +"寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" +"對外層作用域進行寫入。" -#: ../../glossary.rst:871 +#: ../../glossary.rst:872 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:873 +#: ../../glossary.rst:874 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -1966,14 +1962,14 @@ msgid "" msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" "本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." -"__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" -"`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`__getattribute__`、" +"class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:878 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:879 +#: ../../glossary.rst:880 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1981,11 +1977,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:882 +#: ../../glossary.rst:883 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:884 +#: ../../glossary.rst:885 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -1995,17 +1991,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:888 +#: ../../glossary.rst:889 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:889 +#: ../../glossary.rst:890 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:891 +#: ../../glossary.rst:892 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2015,7 +2011,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:895 +#: ../../glossary.rst:896 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2028,7 +2024,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:904 +#: ../../glossary.rst:905 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2041,7 +2037,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:913 +#: ../../glossary.rst:914 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2056,7 +2052,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:921 +#: ../../glossary.rst:922 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2070,7 +2066,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:929 +#: ../../glossary.rst:930 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2081,14 +2077,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:935 +#: ../../glossary.rst:936 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:938 +#: ../../glossary.rst:939 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2096,14 +2092,14 @@ msgid "" "`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" -"參數之間的差異 `\\ 、\\ :class:`inspect." -"Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" +"參數之間的差異 `、:class:`inspect.Parameter` " +"class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:942 +#: ../../glossary.rst:943 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:944 +#: ../../glossary.rst:945 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2111,33 +2107,33 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:946 +#: ../../glossary.rst:947 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:948 +#: ../../glossary.rst:949 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" "`path entry`." msgstr "" "被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" -"`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:952 +#: ../../glossary.rst:953 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." -"PathEntryFinder`\\ 。" +"PathEntryFinder`。" -#: ../../glossary.rst:954 +#: ../../glossary.rst:955 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:956 +#: ../../glossary.rst:957 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2147,11 +2143,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:959 +#: ../../glossary.rst:960 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:961 +#: ../../glossary.rst:962 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2159,11 +2155,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:963 +#: ../../glossary.rst:964 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:965 +#: ../../glossary.rst:966 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2181,11 +2177,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:973 +#: ../../glossary.rst:974 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:975 +#: ../../glossary.rst:976 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2196,7 +2192,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:981 +#: ../../glossary.rst:982 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2208,15 +2204,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:987 +#: ../../glossary.rst:988 msgid "See :pep:`1`." -msgstr "請參閱 :pep:`1`\\ 。" +msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:989 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:990 +#: ../../glossary.rst:991 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2224,15 +2220,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:992 +#: ../../glossary.rst:993 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:995 +#: ../../glossary.rst:996 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:997 +#: ../../glossary.rst:998 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2248,7 +2244,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1007 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2257,7 +2253,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1011 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2266,19 +2262,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1014 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1016 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1017 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1019 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2287,11 +2283,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1022 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1024 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2307,18 +2303,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1034 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:1037 +#: ../../glossary.rst:1038 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1039 +#: ../../glossary.rst:1040 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2331,7 +2327,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1057 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2342,28 +2338,31 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1063 +#: ../../glossary.rst:1064 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1066 msgid "" "The number of references to an object. When the reference count of an " -"object drops to zero, it is deallocated. Reference counting is generally " -"not visible to Python code, but it is a key element of the :term:`CPython` " -"implementation. Programmers can call the :func:`sys.getrefcount` function " -"to return the reference count for a particular object." +"object drops to zero, it is deallocated. Some objects are \"immortal\" and " +"have reference counts that are never modified, and therefore the objects are " +"never deallocated. Reference counting is generally not visible to Python " +"code, but it is a key element of the :term:`CPython` implementation. " +"Programmers can call the :func:`sys.getrefcount` function to return the " +"reference count for a particular object." msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " -"(deallocated)。參照計數通常在 Python 程式碼中看不到,但它卻是 :term:" +"(deallocated)。有些物件是「不滅的 (immortal)」並擁有不會被改變的參照計數,也" +"因此永遠不會被解除配置。參照計數通常在 Python 程式碼中看不到,但它卻是 :term:" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1074 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1076 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2371,15 +2370,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1079 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1080 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1079 +#: ../../glossary.rst:1082 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2392,11 +2391,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1084 +#: ../../glossary.rst:1087 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1086 +#: ../../glossary.rst:1089 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -2408,13 +2407,12 @@ msgid "" msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " "method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" -"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" -"`list`\\ 、\\ :class:`str`\\ 、\\ :class:`tuple` 和 :class:`bytes`\\ 。請注" -"意,雖然 :class:`dict` 也支援 :meth:`__getitem__` 和 :meth:`__len__`\\ ,但它" -"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:" -"`immutable` 鍵,而不是整數。" +"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`、:" +"class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:`dict` 也" +"支援 :meth:`__getitem__` 和 :meth:`__len__`,但它被視為對映 (mapping) 而不是" +"序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是整數。" -#: ../../glossary.rst:1095 +#: ../../glossary.rst:1098 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" @@ -2423,16 +2421,16 @@ msgid "" "registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`\\ ,還增" -"加了 :meth:`count`\\ 、\\ :meth:`index`\\ 、\\ :meth:`__contains__` 和 :meth:" -"`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." -"register` 被明確地註冊。" +"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`,還增加" +"了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" +"`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " +"被明確地註冊。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1105 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1107 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2441,13 +2439,13 @@ msgid "" msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" -"個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" +"個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1111 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1113 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2455,11 +2453,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:1115 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1114 +#: ../../glossary.rst:1117 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2467,15 +2465,15 @@ msgid "" "(subscript) notation uses :class:`slice` objects internally." msgstr "" "一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切片" -"的方法是使用下標符號 (subscript notation) ``[]``\\ ,若要給出多個數字,則在數" -"字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" +"的方法是使用下標符號 (subscript notation) ``[]``,若要給出多個數字,則在數字" +"之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1121 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1125 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2486,34 +2484,36 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1129 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1128 +#: ../../glossary.rst:1131 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" "keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" "陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" -"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" -"keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" +"`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1134 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1136 msgid "" -"In Python's C API, a strong reference is a reference to an object which " -"increments the object's reference count when it is created and decrements " -"the object's reference count when it is deleted." +"In Python's C API, a strong reference is a reference to an object which is " +"owned by the code holding the reference. The strong reference is taken by " +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." msgstr "" -"在 Python 的 C API 中,強參照是一個對物件的參照,在它被建立時會增加該物件的參" -"照計數 (reference count),在它被刪除時則會減少該物件的參照計數。" +"在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" +"func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1142 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2523,15 +2523,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1147 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1148 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1150 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 " @@ -2540,7 +2540,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1154 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\"." @@ -2548,7 +2548,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1152 +#: ../../glossary.rst:1157 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2556,11 +2556,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1155 +#: ../../glossary.rst:1160 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1157 +#: ../../glossary.rst:1162 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:" @@ -2571,22 +2571,22 @@ msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" -"data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`、:data:" +"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1169 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1171 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1173 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 " @@ -2601,11 +2601,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1180 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1182 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." @@ -2615,15 +2615,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1186 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1183 +#: ../../glossary.rst:1188 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1185 +#: ../../glossary.rst:1190 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2632,22 +2632,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1192 +#: ../../glossary.rst:1197 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1199 ../../glossary.rst:1213 +#: ../../glossary.rst:1204 ../../glossary.rst:1218 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." -msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" +msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1205 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1207 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2655,7 +2655,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1210 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 " @@ -2664,7 +2664,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1214 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2672,11 +2672,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1214 +#: ../../glossary.rst:1219 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1216 +#: ../../glossary.rst:1221 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 " @@ -2686,18 +2686,18 @@ msgid "" msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1226 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1228 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1225 +#: ../../glossary.rst:1230 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2705,35 +2705,34 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1235 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" -"變數註釋通常用於\\ :term:`型別提示 (type hint) `\\ :例如,這個變" -"數預期會取得 :class:`int`\\ (整數)值:\n" +"變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" +"期會取得 :class:`int`\\ (整數)值:\n" "\n" "::" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1241 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1243 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" -"請參閱 :term:`function annotation`\\ (函式註釋)、\\ :pep:`484` 和 :pep:" -"`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" -"`annotations-howto`\\ 。" +"請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," +"皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1247 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1249 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2744,15 +2743,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1254 msgid "See also :mod:`venv`." -msgstr "另請參閱 :mod:`venv`\\ 。" +msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1255 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1257 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2760,11 +2759,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1254 +#: ../../glossary.rst:1259 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1261 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2773,50 +2772,18 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:263 +#: ../../glossary.rst:264 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:263 +#: ../../glossary.rst:264 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:756 +#: ../../glossary.rst:757 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1123 msgid "special" msgstr "special" - -#~ msgid "coercion" -#~ msgstr "coercion(強制轉型)" - -#~ msgid "" -#~ "The implicit conversion of an instance of one type to another during an " -#~ "operation which involves two arguments of the same type. For example, " -#~ "``int(3.15)`` converts the floating point number to the integer ``3``, " -#~ "but in ``3+4.5``, each argument is of a different type (one int, one " -#~ "float), and both must be converted to the same type before they can be " -#~ "added or it will raise a :exc:`TypeError`. Without coercion, all " -#~ "arguments of even compatible types would have to be normalized to the " -#~ "same value by the programmer, e.g., ``float(3)+4.5`` rather than just " -#~ "``3+4.5``." -#~ msgstr "" -#~ "在涉及兩個不同型別引數的操作過程中,將某一種型別的實例換為另一種型別的隱式" -#~ "轉換 (implicit conversion) 過程。例如,``int(3.15)`` 會將浮點數轉換為整數 " -#~ "``3``,但在 ``3+4.5`` 中,每個引數是不同的型別(一個 int,一個 float),而" -#~ "這兩個引數必須在被轉換為相同的型別之後才能相加,否則就會引發 :exc:" -#~ "`TypeError`\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由" -#~ "程式設計師正規化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不" -#~ "能只是 ``3+4.5``。" - -#~ msgid "" -#~ "Python uses the :term:`filesystem encoding and error handler` to convert " -#~ "between Unicode filenames and bytes filenames." -#~ msgstr "" -#~ "Python 使用 :term:`filesystem encoding and error handler`\\ (檔案系統編碼" -#~ "和錯誤處理函式)在 Unicode 檔案名稱和位元組檔案名稱之間進行轉換。" - -#~ msgid "A codec which encodes Unicode strings to bytes." -#~ msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" diff --git a/howto/clinic.po b/howto/clinic.po index e873f731db..469e7f45c1 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2023-08-08 00:03+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-" @@ -40,35 +40,36 @@ msgstr "摘要" #: ../../howto/clinic.rst:15 msgid "" -"Argument Clinic is a preprocessor for CPython C files. Its purpose is to " -"automate all the boilerplate involved with writing argument parsing code for " -"\"builtins\", module level functions, and class methods. This document is " -"divided in four major sections:" +"Argument Clinic is a preprocessor for CPython C files. It was introduced in " +"Python 3.4 with :pep:`436`, in order to provide introspection signatures, " +"and to generate performant and tailor-made boilerplate code for argument " +"parsing in CPython builtins, module level functions, and class methods. This " +"document is divided in four major sections:" msgstr "" -#: ../../howto/clinic.rst:21 +#: ../../howto/clinic.rst:23 msgid "" ":ref:`clinic-background` talks about the basic concepts and goals of " "Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:23 +#: ../../howto/clinic.rst:25 msgid "" ":ref:`clinic-reference` describes the command-line interface and Argument " "Clinic terminology." msgstr "" -#: ../../howto/clinic.rst:25 +#: ../../howto/clinic.rst:27 msgid "" ":ref:`clinic-tutorial` guides you through all the steps required to adapt an " "existing C function to Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:27 +#: ../../howto/clinic.rst:29 msgid ":ref:`clinic-howtos` details how to handle specific tasks." msgstr "" -#: ../../howto/clinic.rst:32 +#: ../../howto/clinic.rst:34 msgid "" "Argument Clinic is considered internal-only for CPython. Its use is not " "supported for files outside CPython, and no guarantees are made regarding " @@ -79,85 +80,26 @@ msgid "" "and break all your code." msgstr "" -#: ../../howto/clinic.rst:45 +#: ../../howto/clinic.rst:47 msgid "Background" msgstr "" -#: ../../howto/clinic.rst:49 -msgid "The goals of Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:51 -msgid "" -"Argument Clinic's primary goal is to take over responsibility for all " -"argument parsing code inside CPython. This means that, when you convert a " -"function to work with Argument Clinic, that function should no longer do any " -"of its own argument parsing—the code generated by Argument Clinic should be " -"a \"black box\" to you, where CPython calls in at the top, and your code " -"gets called at the bottom, with ``PyObject *args`` (and maybe ``PyObject " -"*kwargs``) magically converted into the C variables and types you need." -msgstr "" - -#: ../../howto/clinic.rst:61 -msgid "" -"In order for Argument Clinic to accomplish its primary goal, it must be easy " -"to use. Currently, working with CPython's argument parsing library is a " -"chore, requiring maintaining redundant information in a surprising number of " -"places. When you use Argument Clinic, you don't have to repeat yourself." -msgstr "" - -#: ../../howto/clinic.rst:67 -msgid "" -"Obviously, no one would want to use Argument Clinic unless it's solving " -"their problem—and without creating new problems of its own. So it's " -"paramount that Argument Clinic generate correct code. It'd be nice if the " -"code was faster, too, but at the very least it should not introduce a major " -"speed regression. (Eventually Argument Clinic *should* make a major speedup " -"possible—we could rewrite its code generator to produce tailor-made argument " -"parsing code, rather than calling the general-purpose CPython argument " -"parsing library. That would make for the fastest argument parsing possible!)" -msgstr "" - -#: ../../howto/clinic.rst:79 -msgid "" -"Additionally, Argument Clinic must be flexible enough to work with any " -"approach to argument parsing. Python has some functions with some very " -"strange parsing behaviors; Argument Clinic's goal is to support all of them." -msgstr "" - -#: ../../howto/clinic.rst:84 -msgid "" -"Finally, the original motivation for Argument Clinic was to provide " -"introspection \"signatures\" for CPython builtins. It used to be, the " -"introspection query functions would throw an exception if you passed in a " -"builtin. With Argument Clinic, that's a thing of the past!" -msgstr "" - -#: ../../howto/clinic.rst:90 -msgid "" -"One idea you should keep in mind, as you work with Argument Clinic: the more " -"information you give it, the better job it'll be able to do. Argument Clinic " -"is admittedly relatively simple right now. But as it evolves it will get " -"more sophisticated, and it should be able to do many interesting and smart " -"things with all the information you give it." -msgstr "" - -#: ../../howto/clinic.rst:100 +#: ../../howto/clinic.rst:50 msgid "Basic concepts" msgstr "" -#: ../../howto/clinic.rst:102 +#: ../../howto/clinic.rst:52 msgid "" "When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " "via ``make clinic``, it will scan over the input files looking for :term:" "`start lines `:" msgstr "" -#: ../../howto/clinic.rst:110 +#: ../../howto/clinic.rst:60 msgid "When it finds one, it reads everything up to the :term:`end line`:" msgstr "" -#: ../../howto/clinic.rst:116 +#: ../../howto/clinic.rst:66 msgid "" "Everything in between these two lines is Argument Clinic :term:`input`. When " "Argument Clinic parses input, it generates :term:`output`. The output is " @@ -167,7 +109,7 @@ msgid "" "`block`:" msgstr "" -#: ../../howto/clinic.rst:131 +#: ../../howto/clinic.rst:81 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old :term:`output` and write out the new output with a " @@ -175,7 +117,7 @@ msgid "" "won't change either." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:88 msgid "" "You should never modify the output of an Argument Clinic block, as any " "change will be lost in future Argument Clinic runs; Argument Clinic will " @@ -184,29 +126,29 @@ msgid "" "until it produces the output you want." msgstr "" -#: ../../howto/clinic.rst:149 +#: ../../howto/clinic.rst:99 msgid "Reference" msgstr "" -#: ../../howto/clinic.rst:155 +#: ../../howto/clinic.rst:105 msgid "Terminology" msgstr "" -#: ../../howto/clinic.rst:158 +#: ../../howto/clinic.rst:108 msgid "start line" msgstr "" -#: ../../howto/clinic.rst:160 +#: ../../howto/clinic.rst:110 msgid "" "The line ``/*[clinic input]``. This line marks the beginning of Argument " "Clinic input. Note that the *start line* opens a C block comment." msgstr "" -#: ../../howto/clinic.rst:163 +#: ../../howto/clinic.rst:113 msgid "end line" msgstr "" -#: ../../howto/clinic.rst:165 +#: ../../howto/clinic.rst:115 msgid "" "The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " "of Argument Clinic :term:`input`, but at the same time marks the _start_ of " @@ -215,21 +157,21 @@ msgid "" "by the *start line*." msgstr "" -#: ../../howto/clinic.rst:171 +#: ../../howto/clinic.rst:121 msgid "checksum" msgstr "" -#: ../../howto/clinic.rst:173 +#: ../../howto/clinic.rst:123 msgid "" "A hash to distinguish unique :term:`inputs ` and :term:`outputs " "`." msgstr "" -#: ../../howto/clinic.rst:175 +#: ../../howto/clinic.rst:125 msgid "checksum line" msgstr "" -#: ../../howto/clinic.rst:177 +#: ../../howto/clinic.rst:127 msgid "" "A line that looks like ``/*[clinic end generated code: ...]*/``. The three " "dots will be replaced by a :term:`checksum` generated from the :term:" @@ -238,86 +180,148 @@ msgid "" "by Argument Clinic to determine if it needs to regenerate output." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:133 msgid "input" msgstr "" -#: ../../howto/clinic.rst:185 +#: ../../howto/clinic.rst:135 msgid "" "The text between the :term:`start line` and the :term:`end line`. Note that " "the start and end lines open and close a C block comment; the *input* is " "thus a part of that same C block comment." msgstr "" -#: ../../howto/clinic.rst:188 +#: ../../howto/clinic.rst:138 msgid "output" msgstr "" -#: ../../howto/clinic.rst:190 +#: ../../howto/clinic.rst:140 msgid "The text between the :term:`end line` and the :term:`checksum line`." msgstr "" -#: ../../howto/clinic.rst:191 +#: ../../howto/clinic.rst:141 msgid "block" msgstr "" -#: ../../howto/clinic.rst:193 +#: ../../howto/clinic.rst:143 msgid "" "All text from the :term:`start line` to the :term:`checksum line` " "inclusively." msgstr "" -#: ../../howto/clinic.rst:199 +#: ../../howto/clinic.rst:149 msgid "Command-line interface" msgstr "" -#: ../../howto/clinic.rst:201 +#: ../../howto/clinic.rst:151 msgid "" "The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " "to process a single source file, like this:" msgstr "" -#: ../../howto/clinic.rst:208 +#: ../../howto/clinic.rst:158 msgid "The CLI supports the following options:" msgstr "" -#: ../../howto/clinic.rst:215 +#: ../../howto/clinic.rst:165 msgid "Print CLI usage." msgstr "" -#: ../../howto/clinic.rst:219 +#: ../../howto/clinic.rst:169 msgid "Force output regeneration." msgstr "" -#: ../../howto/clinic.rst:223 +#: ../../howto/clinic.rst:173 msgid "Redirect file output to OUTPUT" msgstr "" -#: ../../howto/clinic.rst:227 +#: ../../howto/clinic.rst:177 msgid "Enable verbose mode." msgstr "" -#: ../../howto/clinic.rst:231 +#: ../../howto/clinic.rst:181 msgid "Print a list of all supported converters and return converters." msgstr "" -#: ../../howto/clinic.rst:235 +#: ../../howto/clinic.rst:185 msgid "Walk :option:`--srcdir` to run over all relevant files." msgstr "" -#: ../../howto/clinic.rst:239 +#: ../../howto/clinic.rst:189 msgid "The directory tree to walk in :option:`--make` mode." msgstr "" -#: ../../howto/clinic.rst:243 +#: ../../howto/clinic.rst:193 msgid "The list of files to process." msgstr "" -#: ../../howto/clinic.rst:249 +#: ../../howto/clinic.rst:199 +msgid "Classes for extending Argument Clinic" +msgstr "" + +#: ../../howto/clinic.rst:205 +msgid "" +"The base class for all converters. See :ref:`clinic-howto-custom-converter` " +"for how to subclass this class." +msgstr "" + +#: ../../howto/clinic.rst:210 +msgid "" +"The C type to use for this variable. :attr:`!type` should be a Python string " +"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " +"string should end with ``' *'``." +msgstr "" + +#: ../../howto/clinic.rst:217 +msgid "" +"The Python default value for this parameter, as a Python value. Or the magic " +"value ``unspecified`` if there is no default." +msgstr "" + +#: ../../howto/clinic.rst:222 +msgid "" +":attr:`!default` as it should appear in Python code, as a string. Or " +"``None`` if there is no default." +msgstr "" + +#: ../../howto/clinic.rst:228 +msgid "" +":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " +"there is no default." +msgstr "" + +#: ../../howto/clinic.rst:234 +msgid "" +"The default value used to initialize the C variable when there is no " +"default, but not specifying a default may result in an \"uninitialized " +"variable\" warning. This can easily happen when using option groups—" +"although properly written code will never actually use this value, the " +"variable does get passed in to the impl, and the C compiler will complain " +"about the \"use\" of the uninitialized value. This value should always be a " +"non-empty string." +msgstr "" + +#: ../../howto/clinic.rst:246 +msgid "The name of the C converter function, as a string." +msgstr "" + +#: ../../howto/clinic.rst:250 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into the impl function." +msgstr "" + +#: ../../howto/clinic.rst:256 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." +msgstr "" + +#: ../../howto/clinic.rst:264 msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:251 +#: ../../howto/clinic.rst:266 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -329,13 +333,13 @@ msgid "" "walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:262 +#: ../../howto/clinic.rst:277 msgid "" "First, make sure you're working with a freshly updated checkout of the " "CPython trunk." msgstr "" -#: ../../howto/clinic.rst:265 +#: ../../howto/clinic.rst:280 msgid "" "Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" "c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " @@ -343,20 +347,20 @@ msgid "" "Pickler.dump `." msgstr "" -#: ../../howto/clinic.rst:271 +#: ../../howto/clinic.rst:286 msgid "" "If the call to the :c:func:`!PyArg_Parse*` function uses any of the " "following format units...:" msgstr "" -#: ../../howto/clinic.rst:283 +#: ../../howto/clinic.rst:298 msgid "" "... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " "choose a different function. (See :ref:`clinic-howto-advanced-converters` " "for those scenarios.)" msgstr "" -#: ../../howto/clinic.rst:287 +#: ../../howto/clinic.rst:302 msgid "" "Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" "c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " @@ -366,13 +370,13 @@ msgid "" "functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:294 +#: ../../howto/clinic.rst:309 msgid "" "Next, add the following boilerplate above the function, creating our input " "block::" msgstr "" -#: ../../howto/clinic.rst:300 +#: ../../howto/clinic.rst:315 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -380,7 +384,7 @@ msgid "" "80 characters. Argument Clinic will preserve indents inside the docstring." msgstr "" -#: ../../howto/clinic.rst:306 +#: ../../howto/clinic.rst:321 msgid "" "If the old docstring had a first line that looked like a function signature, " "throw that line away; The docstring doesn't need it anymore --- when you " @@ -388,11 +392,11 @@ msgid "" "built automatically based on the function's signature." msgstr "" -#: ../../howto/clinic.rst:311 +#: ../../howto/clinic.rst:326 msgid "Example docstring summary line::" msgstr "" -#: ../../howto/clinic.rst:317 +#: ../../howto/clinic.rst:332 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain, so let's make sure it has one. The \"summary\" line should be a " @@ -400,13 +404,13 @@ msgid "" "docstring. (See :pep:`257` regarding docstring conventions.)" msgstr "" -#: ../../howto/clinic.rst:323 +#: ../../howto/clinic.rst:338 msgid "" "Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step." msgstr "" -#: ../../howto/clinic.rst:326 +#: ../../howto/clinic.rst:341 msgid "" "Now, above the docstring, enter the name of the function, followed by a " "blank line. This should be the Python name of the function, and should be " @@ -415,14 +419,14 @@ msgid "" "class it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:333 +#: ../../howto/clinic.rst:348 msgid "" "In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " "class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" "_pickle.Pickler.dump`::" msgstr "" -#: ../../howto/clinic.rst:343 +#: ../../howto/clinic.rst:358 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -432,21 +436,21 @@ msgid "" "next to each other." msgstr "" -#: ../../howto/clinic.rst:351 +#: ../../howto/clinic.rst:366 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:355 +#: ../../howto/clinic.rst:370 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " "class, and a pointer to the :c:type:`!PyTypeObject` for this class::" msgstr "" -#: ../../howto/clinic.rst:370 +#: ../../howto/clinic.rst:385 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " @@ -454,21 +458,21 @@ msgid "" "follows:" msgstr "" -#: ../../howto/clinic.rst:379 +#: ../../howto/clinic.rst:394 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:386 +#: ../../howto/clinic.rst:401 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "see :ref:`clinic-howto-default-values` for more information." msgstr "" -#: ../../howto/clinic.rst:389 +#: ../../howto/clinic.rst:404 msgid "Next, add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:391 +#: ../../howto/clinic.rst:406 msgid "" "What's a \"converter\"? It establishes both the type of the variable used in " "C, and the method to convert the Python value into a C value at runtime. For " @@ -477,7 +481,7 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:398 +#: ../../howto/clinic.rst:413 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the :c:" "func:`PyArg_Parse` format argument and specify *that* as its converter, as a " @@ -487,59 +491,59 @@ msgid "" "more on format units please see :ref:`arg-parsing`." msgstr "" -#: ../../howto/clinic.rst:407 +#: ../../howto/clinic.rst:422 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:410 ../../howto/clinic.rst:445 -#: ../../howto/clinic.rst:473 ../../howto/clinic.rst:579 -#: ../../howto/clinic.rst:632 +#: ../../howto/clinic.rst:425 ../../howto/clinic.rst:460 +#: ../../howto/clinic.rst:488 ../../howto/clinic.rst:594 +#: ../../howto/clinic.rst:647 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:425 +#: ../../howto/clinic.rst:440 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:430 +#: ../../howto/clinic.rst:445 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:435 +#: ../../howto/clinic.rst:450 msgid "" ":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." msgstr "" -#: ../../howto/clinic.rst:437 +#: ../../howto/clinic.rst:452 msgid "" "Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " "opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " "are positional-only." msgstr "" -#: ../../howto/clinic.rst:441 +#: ../../howto/clinic.rst:456 msgid "" "To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " "line by itself after the last positional-only parameter, indented the same " "as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:461 +#: ../../howto/clinic.rst:476 msgid "" "It can be helpful to write a per-parameter docstring for each parameter. " "Since per-parameter docstrings are optional, you can skip this step if you " "prefer." msgstr "" -#: ../../howto/clinic.rst:465 +#: ../../howto/clinic.rst:480 msgid "" "Nevertheless, here's how to add a per-parameter docstring. The first line of " "the per-parameter docstring must be indented further than the parameter " @@ -549,7 +553,7 @@ msgid "" "multiple lines if you wish." msgstr "" -#: ../../howto/clinic.rst:490 +#: ../../howto/clinic.rst:505 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a :file:`.c.h` file " @@ -557,27 +561,27 @@ msgid "" "code::" msgstr "" -#: ../../howto/clinic.rst:509 +#: ../../howto/clinic.rst:524 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:514 +#: ../../howto/clinic.rst:529 msgid "" "For readability, most of the glue code has been generated to a :file:`.c.h` " "file. You'll need to include that in your original :file:`.c` file, " "typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:520 +#: ../../howto/clinic.rst:535 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:523 +#: ../../howto/clinic.rst:538 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -585,21 +589,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:529 +#: ../../howto/clinic.rst:544 msgid "" "Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" "func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:534 +#: ../../howto/clinic.rst:549 msgid "" "Argument Clinic always generates its format strings with a ``:`` followed by " "the name of the function. If the existing code's format string ends with ``;" "``, to provide usage help, this change is harmless --- don't worry about it." msgstr "" -#: ../../howto/clinic.rst:539 +#: ../../howto/clinic.rst:554 msgid "" "Third, for parameters whose format units require two arguments, like a " "length variable, an encoding string, or a pointer to a conversion function, " @@ -607,27 +611,27 @@ msgid "" "invocations." msgstr "" -#: ../../howto/clinic.rst:544 +#: ../../howto/clinic.rst:559 msgid "" "Fourth, inside the output portion of the block, you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:551 +#: ../../howto/clinic.rst:566 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:554 +#: ../../howto/clinic.rst:569 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:558 +#: ../../howto/clinic.rst:573 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -638,20 +642,20 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:566 +#: ../../howto/clinic.rst:581 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:575 +#: ../../howto/clinic.rst:590 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening and closing curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:621 +#: ../../howto/clinic.rst:636 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " "function? Find the existing :c:type:`!PyMethodDef` structure for this " @@ -661,24 +665,24 @@ msgid "" "to the implementation." msgstr "" -#: ../../howto/clinic.rst:628 +#: ../../howto/clinic.rst:643 msgid "" "Note that the body of the macro contains a trailing comma; when you replace " "the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " "add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:640 +#: ../../howto/clinic.rst:655 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:659 msgid "" "If it does, you'll have to run ``make regen-global-objects`` to regenerate " "the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:647 +#: ../../howto/clinic.rst:662 msgid "" "Finally, compile, then run the relevant portions of the regression-test " "suite. This change should not introduce any new compile-time warnings or " @@ -687,21 +691,21 @@ msgid "" "your function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:668 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:659 +#: ../../howto/clinic.rst:674 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:663 +#: ../../howto/clinic.rst:678 msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:665 +#: ../../howto/clinic.rst:680 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -713,19 +717,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:673 +#: ../../howto/clinic.rst:688 msgid "" "For example, if we wanted to rename the C function names generated for :py:" "meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:681 +#: ../../howto/clinic.rst:696 msgid "" "The base function would now be named :c:func:`!pickler_dumper`, and the impl " "function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:685 +#: ../../howto/clinic.rst:700 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -733,21 +737,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:699 +#: ../../howto/clinic.rst:714 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:702 +#: ../../howto/clinic.rst:717 msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:706 +#: ../../howto/clinic.rst:721 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:708 +#: ../../howto/clinic.rst:723 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -756,17 +760,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:714 +#: ../../howto/clinic.rst:729 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:719 +#: ../../howto/clinic.rst:734 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:721 +#: ../../howto/clinic.rst:736 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -777,7 +781,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:728 +#: ../../howto/clinic.rst:743 msgid "" "While functions using this approach can often be converted to use :c:func:`!" "PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -791,7 +795,7 @@ msgid "" "don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:740 +#: ../../howto/clinic.rst:755 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -801,7 +805,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:748 +#: ../../howto/clinic.rst:763 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -812,7 +816,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:757 +#: ../../howto/clinic.rst:772 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -821,11 +825,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:786 +#: ../../howto/clinic.rst:801 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:788 +#: ../../howto/clinic.rst:803 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -838,34 +842,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:799 +#: ../../howto/clinic.rst:814 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:802 +#: ../../howto/clinic.rst:817 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:805 +#: ../../howto/clinic.rst:820 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:807 +#: ../../howto/clinic.rst:822 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:812 +#: ../../howto/clinic.rst:827 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:814 +#: ../../howto/clinic.rst:829 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -874,38 +878,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:821 +#: ../../howto/clinic.rst:836 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:840 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:841 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:844 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:848 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:851 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -913,17 +917,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:857 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:865 msgid "*c_default*" msgstr "*c_default*" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:861 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -931,36 +935,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:870 msgid "*annotation*" msgstr "*annotation*" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:868 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:873 msgid "*unused*" msgstr "*unused*" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:873 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:875 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:884 msgid "*accept*" msgstr "*accept*" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:879 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -968,68 +972,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:884 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:889 msgid "*bitwise*" msgstr "*bitwise*" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:887 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:879 +#: ../../howto/clinic.rst:894 msgid "*converter*" msgstr "*converter*" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:892 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:884 +#: ../../howto/clinic.rst:899 msgid "*encoding*" msgstr "*encoding*" -#: ../../howto/clinic.rst:882 +#: ../../howto/clinic.rst:897 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:888 +#: ../../howto/clinic.rst:903 msgid "*subclass_of*" msgstr "*subclass_of*" -#: ../../howto/clinic.rst:887 +#: ../../howto/clinic.rst:902 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:908 msgid "*type*" msgstr "" -#: ../../howto/clinic.rst:891 +#: ../../howto/clinic.rst:906 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:899 +#: ../../howto/clinic.rst:914 msgid "*zeroes*" msgstr "*zeroes*" -#: ../../howto/clinic.rst:896 +#: ../../howto/clinic.rst:911 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -1037,7 +1041,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:901 +#: ../../howto/clinic.rst:916 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " @@ -1048,350 +1052,350 @@ msgid "" "(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:909 +#: ../../howto/clinic.rst:924 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:914 +#: ../../howto/clinic.rst:929 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:914 +#: ../../howto/clinic.rst:929 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:930 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:930 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:916 +#: ../../howto/clinic.rst:931 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:916 +#: ../../howto/clinic.rst:931 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:932 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:932 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:933 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:933 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:919 +#: ../../howto/clinic.rst:934 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:919 +#: ../../howto/clinic.rst:934 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:935 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:935 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:936 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:936 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:922 +#: ../../howto/clinic.rst:937 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:922 +#: ../../howto/clinic.rst:937 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:923 +#: ../../howto/clinic.rst:938 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:923 +#: ../../howto/clinic.rst:938 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:924 +#: ../../howto/clinic.rst:939 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:924 +#: ../../howto/clinic.rst:939 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:925 +#: ../../howto/clinic.rst:940 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:925 +#: ../../howto/clinic.rst:940 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:926 +#: ../../howto/clinic.rst:941 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:926 +#: ../../howto/clinic.rst:941 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:927 +#: ../../howto/clinic.rst:942 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:927 +#: ../../howto/clinic.rst:942 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:943 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:943 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:929 +#: ../../howto/clinic.rst:944 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:929 +#: ../../howto/clinic.rst:944 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:930 +#: ../../howto/clinic.rst:945 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:930 +#: ../../howto/clinic.rst:945 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:931 +#: ../../howto/clinic.rst:946 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:931 +#: ../../howto/clinic.rst:946 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:932 +#: ../../howto/clinic.rst:947 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:932 +#: ../../howto/clinic.rst:947 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:933 +#: ../../howto/clinic.rst:948 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:933 +#: ../../howto/clinic.rst:948 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:949 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:949 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:935 +#: ../../howto/clinic.rst:950 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:935 +#: ../../howto/clinic.rst:950 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:951 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:951 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:937 +#: ../../howto/clinic.rst:952 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:937 +#: ../../howto/clinic.rst:952 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:938 +#: ../../howto/clinic.rst:953 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:938 +#: ../../howto/clinic.rst:953 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:939 +#: ../../howto/clinic.rst:954 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:939 +#: ../../howto/clinic.rst:954 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:940 +#: ../../howto/clinic.rst:955 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:940 +#: ../../howto/clinic.rst:955 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:941 +#: ../../howto/clinic.rst:956 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:941 +#: ../../howto/clinic.rst:956 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:942 +#: ../../howto/clinic.rst:957 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:942 +#: ../../howto/clinic.rst:957 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:943 +#: ../../howto/clinic.rst:958 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:943 +#: ../../howto/clinic.rst:958 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:944 +#: ../../howto/clinic.rst:959 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:944 +#: ../../howto/clinic.rst:959 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:960 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:960 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:946 +#: ../../howto/clinic.rst:961 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:946 +#: ../../howto/clinic.rst:961 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:962 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:962 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:948 +#: ../../howto/clinic.rst:963 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:948 +#: ../../howto/clinic.rst:963 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:964 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:964 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:950 +#: ../../howto/clinic.rst:965 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:950 +#: ../../howto/clinic.rst:965 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:951 +#: ../../howto/clinic.rst:966 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:951 +#: ../../howto/clinic.rst:966 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:952 +#: ../../howto/clinic.rst:967 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:952 +#: ../../howto/clinic.rst:967 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:968 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:968 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:954 +#: ../../howto/clinic.rst:969 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:954 +#: ../../howto/clinic.rst:969 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:957 +#: ../../howto/clinic.rst:972 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:970 +#: ../../howto/clinic.rst:985 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1400,7 +1404,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:976 +#: ../../howto/clinic.rst:991 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1408,11 +1412,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:983 +#: ../../howto/clinic.rst:998 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:985 +#: ../../howto/clinic.rst:1000 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1420,17 +1424,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:994 +#: ../../howto/clinic.rst:1009 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:996 +#: ../../howto/clinic.rst:1011 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:999 +#: ../../howto/clinic.rst:1014 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1441,7 +1445,7 @@ msgid "" "start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:1007 +#: ../../howto/clinic.rst:1022 msgid "" "When using *subclass_of*, you may also want to use the other custom argument " "for ``object()``: *type*, which lets you set the type actually used for the " @@ -1450,7 +1454,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:1013 +#: ../../howto/clinic.rst:1028 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a :c:" @@ -1463,31 +1467,31 @@ msgid "" "parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:1027 +#: ../../howto/clinic.rst:1042 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:1029 +#: ../../howto/clinic.rst:1044 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:1038 +#: ../../howto/clinic.rst:1053 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:1046 +#: ../../howto/clinic.rst:1061 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1066 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:1053 +#: ../../howto/clinic.rst:1068 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1497,45 +1501,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:1062 +#: ../../howto/clinic.rst:1077 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1079 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:1067 +#: ../../howto/clinic.rst:1082 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:1068 +#: ../../howto/clinic.rst:1083 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:1069 +#: ../../howto/clinic.rst:1084 msgid "``True``, ``False``, and ``None``" -msgstr "" +msgstr "``True``、``False`` 和 ``None``" -#: ../../howto/clinic.rst:1070 +#: ../../howto/clinic.rst:1085 msgid "" "Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " "the name of the module" msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1088 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:1078 +#: ../../howto/clinic.rst:1093 msgid "Expressions as default values" msgstr "" -#: ../../howto/clinic.rst:1080 +#: ../../howto/clinic.rst:1095 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1543,11 +1547,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:1085 +#: ../../howto/clinic.rst:1100 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:1091 +#: ../../howto/clinic.rst:1106 msgid "" ":py:data:`sys.maxsize` can have different values on different platforms. " "Therefore Argument Clinic can't simply evaluate that expression locally and " @@ -1555,7 +1559,7 @@ msgid "" "evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:1096 +#: ../../howto/clinic.rst:1111 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " @@ -1563,7 +1567,7 @@ msgid "" "it:" msgstr "" -#: ../../howto/clinic.rst:1104 +#: ../../howto/clinic.rst:1119 msgid "" "If the symbol isn't found in the current module, it fails over to looking " "in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " @@ -1572,7 +1576,7 @@ msgid "" "are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1124 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1580,7 +1584,7 @@ msgid "" "expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1118 +#: ../../howto/clinic.rst:1133 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1588,38 +1592,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1123 +#: ../../howto/clinic.rst:1138 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1127 +#: ../../howto/clinic.rst:1142 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1128 +#: ../../howto/clinic.rst:1143 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1129 +#: ../../howto/clinic.rst:1144 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1130 +#: ../../howto/clinic.rst:1145 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1146 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1152 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1154 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1629,38 +1633,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1147 +#: ../../howto/clinic.rst:1162 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1166 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1155 +#: ../../howto/clinic.rst:1170 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1168 +#: ../../howto/clinic.rst:1183 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1172 +#: ../../howto/clinic.rst:1187 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1175 +#: ../../howto/clinic.rst:1190 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1673,127 +1677,127 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1184 +#: ../../howto/clinic.rst:1199 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1198 +#: ../../howto/clinic.rst:1213 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1201 +#: ../../howto/clinic.rst:1216 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1207 +#: ../../howto/clinic.rst:1222 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1209 +#: ../../howto/clinic.rst:1224 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1213 +#: ../../howto/clinic.rst:1228 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1215 +#: ../../howto/clinic.rst:1230 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1217 +#: ../../howto/clinic.rst:1232 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1219 +#: ../../howto/clinic.rst:1234 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1221 +#: ../../howto/clinic.rst:1236 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1223 +#: ../../howto/clinic.rst:1238 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1226 +#: ../../howto/clinic.rst:1241 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1228 +#: ../../howto/clinic.rst:1243 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1231 +#: ../../howto/clinic.rst:1246 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1239 +#: ../../howto/clinic.rst:1254 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1243 +#: ../../howto/clinic.rst:1258 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1246 +#: ../../howto/clinic.rst:1261 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1266 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1253 +#: ../../howto/clinic.rst:1268 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1257 +#: ../../howto/clinic.rst:1272 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1264 +#: ../../howto/clinic.rst:1279 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1268 +#: ../../howto/clinic.rst:1283 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1281 +#: ../../howto/clinic.rst:1296 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1283 +#: ../../howto/clinic.rst:1298 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1804,13 +1808,13 @@ msgid "" "self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1292 +#: ../../howto/clinic.rst:1307 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1295 +#: ../../howto/clinic.rst:1310 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1818,18 +1822,18 @@ msgid "" "want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1311 +#: ../../howto/clinic.rst:1326 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing :" "class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1333 +#: ../../howto/clinic.rst:1348 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1335 +#: ../../howto/clinic.rst:1350 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1839,25 +1843,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1341 +#: ../../howto/clinic.rst:1356 msgid "" "Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " "added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1353 +#: ../../howto/clinic.rst:1368 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1363 +#: ../../howto/clinic.rst:1378 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1369 +#: ../../howto/clinic.rst:1384 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1865,14 +1869,14 @@ msgid "" "appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1374 +#: ../../howto/clinic.rst:1389 msgid "" "The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " "and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " "convention." msgstr "" -#: ../../howto/clinic.rst:1378 +#: ../../howto/clinic.rst:1393 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1881,134 +1885,74 @@ msgid "" "``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1393 +#: ../../howto/clinic.rst:1408 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1414 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1399 -msgid "" -"As we hinted at in the previous section... you can write your own " -"converters! A converter is simply a Python class that inherits from :py:" -"class:`!CConverter`. The main purpose of a custom converter is if you have a " -"parameter using the ``O&`` format unit—parsing this parameter means calling " -"a :c:func:`PyArg_ParseTuple` \"converter function\"." -msgstr "" - -#: ../../howto/clinic.rst:1405 +#: ../../howto/clinic.rst:1416 msgid "" -"Your converter class should be named ``*something*_converter``. If the name " -"follows this convention, then your converter class will be automatically " -"registered with Argument Clinic; its name will be the name of your class " -"with the ``_converter`` suffix stripped off. (This is accomplished with a " -"metaclass.)" +"A converter is a Python class that inherits from :py:class:`CConverter`. The " +"main purpose of a custom converter, is for parameters parsed with the ``O&`` " +"format unit --- parsing such a parameter means calling a :c:func:" +"`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1411 +#: ../../howto/clinic.rst:1421 msgid "" -"You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " -"write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " -"always accepts a *self* parameter; after that, all additional parameters " -"*must* be keyword-only. Any arguments passed in to the converter in " -"Argument Clinic will be passed along to your :py:meth:`!converter_init`." +"Your converter class should be named :samp:`{ConverterName}_converter`. By " +"following this convention, your converter class will be automatically " +"registered with Argument Clinic, with its *converter name* being the name of " +"your converter class with the ``_converter`` suffix stripped off." msgstr "" -#: ../../howto/clinic.rst:1418 +#: ../../howto/clinic.rst:1426 msgid "" -"There are some additional members of :py:class:`!CConverter` you may wish to " -"specify in your subclass. Here's the current list:" -msgstr "" - -#: ../../howto/clinic.rst:1427 -msgid "" -"The C type to use for this variable. :attr:`!type` should be a Python string " -"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " -"string should end with ``' *'``." -msgstr "" - -#: ../../howto/clinic.rst:1434 -msgid "" -"The Python default value for this parameter, as a Python value. Or the magic " -"value ``unspecified`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1439 -msgid "" -":attr:`!default` as it should appear in Python code, as a string. Or " -"``None`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1445 -msgid "" -":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " -"there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1451 -msgid "" -"The default value used to initialize the C variable when there is no " -"default, but not specifying a default may result in an \"uninitialized " -"variable\" warning. This can easily happen when using option groups—" -"although properly written code will never actually use this value, the " -"variable does get passed in to the impl, and the C compiler will complain " -"about the \"use\" of the uninitialized value. This value should always be a " -"non-empty string." -msgstr "" - -#: ../../howto/clinic.rst:1463 -msgid "The name of the C converter function, as a string." -msgstr "" - -#: ../../howto/clinic.rst:1467 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into the impl function." +"Instead of subclassing :py:meth:`!CConverter.__init__`, write a :py:meth:`!" +"converter_init` method. :py:meth:`!converter_init` always accepts a *self* " +"parameter. After *self*, all additional parameters **must** be keyword-only. " +"Any arguments passed to the converter in Argument Clinic will be passed " +"along to your :py:meth:`!converter_init` method. See :py:class:`CConverter` " +"for a list of members you may wish to specify in your subclass." msgstr "" -#: ../../howto/clinic.rst:1473 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." -msgstr "" - -#: ../../howto/clinic.rst:1478 +#: ../../howto/clinic.rst:1435 msgid "" "Here's the simplest example of a custom converter, from :source:`Modules/" "zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1489 +#: ../../howto/clinic.rst:1446 msgid "" -"This block adds a converter to Argument Clinic named ``ssize_t``. " -"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." +"This block adds a converter named ``ssize_t`` to Argument Clinic. Parameters " +"declared as ``ssize_t`` will be declared with type :c:type:`Py_ssize_t`, and " +"will be parsed by the ``'O&'`` format unit, which will call the :c:func:`!" +"ssize_t_converter` converter C function. ``ssize_t`` variables automatically " +"support default values." msgstr "" -#: ../../howto/clinic.rst:1495 +#: ../../howto/clinic.rst:1452 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string :py:class:`!" -"CConverter`." +"in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1502 +#: ../../howto/clinic.rst:1459 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1504 +#: ../../howto/clinic.rst:1461 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1465 msgid "" "Return converters must subclass :py:class:`!CReturnConverter`. There are no " "examples yet of custom return converters, because they are not widely used " @@ -2017,60 +1961,60 @@ msgid "" "CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1474 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1519 +#: ../../howto/clinic.rst:1476 msgid "" "To convert a function using :c:macro:`METH_O`, make sure the function's " "single argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1531 +#: ../../howto/clinic.rst:1488 msgid "" "To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1534 +#: ../../howto/clinic.rst:1491 msgid "" "You can still use a self converter, a return converter, and specify a *type* " "argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1539 +#: ../../howto/clinic.rst:1496 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1541 +#: ../../howto/clinic.rst:1498 msgid "" "You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" "`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " "``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1545 +#: ../../howto/clinic.rst:1502 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1549 +#: ../../howto/clinic.rst:1506 msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1551 +#: ../../howto/clinic.rst:1508 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1553 +#: ../../howto/clinic.rst:1510 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1555 +#: ../../howto/clinic.rst:1512 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -2079,11 +2023,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1520 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1565 +#: ../../howto/clinic.rst:1522 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2092,7 +2036,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1571 +#: ../../howto/clinic.rst:1528 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2104,15 +2048,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1537 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1564 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1540 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " @@ -2120,7 +2064,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1598 +#: ../../howto/clinic.rst:1555 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2133,45 +2077,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1598 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1567 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1615 ../../howto/clinic.rst:1690 -#: ../../howto/clinic.rst:1768 +#: ../../howto/clinic.rst:1572 ../../howto/clinic.rst:1647 +#: ../../howto/clinic.rst:1725 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1614 +#: ../../howto/clinic.rst:1571 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1621 ../../howto/clinic.rst:1717 -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1578 ../../howto/clinic.rst:1674 +#: ../../howto/clinic.rst:1728 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1575 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1632 ../../howto/clinic.rst:1703 -#: ../../howto/clinic.rst:1797 +#: ../../howto/clinic.rst:1589 ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1754 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1624 +#: ../../howto/clinic.rst:1581 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2180,65 +2124,65 @@ msgid "" "for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1588 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1637 ../../howto/clinic.rst:1730 -#: ../../howto/clinic.rst:1801 +#: ../../howto/clinic.rst:1594 ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1758 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1635 +#: ../../howto/clinic.rst:1592 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1641 ../../howto/clinic.rst:1764 +#: ../../howto/clinic.rst:1598 ../../howto/clinic.rst:1721 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1640 +#: ../../howto/clinic.rst:1597 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1600 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1645 +#: ../../howto/clinic.rst:1602 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1608 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1655 +#: ../../howto/clinic.rst:1612 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1619 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1623 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1632 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2247,25 +2191,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1682 +#: ../../howto/clinic.rst:1639 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1643 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1646 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1693 +#: ../../howto/clinic.rst:1650 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2273,17 +2217,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1656 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1660 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1706 +#: ../../howto/clinic.rst:1663 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2293,14 +2237,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1715 +#: ../../howto/clinic.rst:1672 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1720 +#: ../../howto/clinic.rst:1677 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2309,18 +2253,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1727 +#: ../../howto/clinic.rst:1684 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1741 +#: ../../howto/clinic.rst:1698 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1733 +#: ../../howto/clinic.rst:1690 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2330,137 +2274,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1697 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1743 +#: ../../howto/clinic.rst:1700 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1749 +#: ../../howto/clinic.rst:1706 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1751 +#: ../../howto/clinic.rst:1708 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1753 +#: ../../howto/clinic.rst:1710 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1759 +#: ../../howto/clinic.rst:1716 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1761 +#: ../../howto/clinic.rst:1718 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1764 +#: ../../howto/clinic.rst:1721 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1767 +#: ../../howto/clinic.rst:1724 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1728 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1774 +#: ../../howto/clinic.rst:1731 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1734 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1779 +#: ../../howto/clinic.rst:1736 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1782 +#: ../../howto/clinic.rst:1739 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1783 +#: ../../howto/clinic.rst:1740 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1784 +#: ../../howto/clinic.rst:1741 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1742 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1786 +#: ../../howto/clinic.rst:1743 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1787 +#: ../../howto/clinic.rst:1744 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1789 +#: ../../howto/clinic.rst:1746 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1789 +#: ../../howto/clinic.rst:1746 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1793 +#: ../../howto/clinic.rst:1750 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1792 +#: ../../howto/clinic.rst:1749 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1795 +#: ../../howto/clinic.rst:1752 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1800 +#: ../../howto/clinic.rst:1757 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1803 +#: ../../howto/clinic.rst:1760 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1809 +#: ../../howto/clinic.rst:1766 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1813 +#: ../../howto/clinic.rst:1770 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1820 +#: ../../howto/clinic.rst:1777 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2468,35 +2412,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1824 +#: ../../howto/clinic.rst:1781 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1827 +#: ../../howto/clinic.rst:1784 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1827 +#: ../../howto/clinic.rst:1784 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1787 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1787 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1832 +#: ../../howto/clinic.rst:1789 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1839 +#: ../../howto/clinic.rst:1796 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2505,36 +2449,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1846 +#: ../../howto/clinic.rst:1803 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1848 +#: ../../howto/clinic.rst:1805 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1859 +#: ../../howto/clinic.rst:1816 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1868 +#: ../../howto/clinic.rst:1825 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1882 +#: ../../howto/clinic.rst:1839 msgid "" "Then, remove those three lines from the :c:type:`PyMethodDef` structure, " "replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1889 +#: ../../howto/clinic.rst:1846 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2542,27 +2486,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1894 +#: ../../howto/clinic.rst:1851 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1897 +#: ../../howto/clinic.rst:1854 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1905 +#: ../../howto/clinic.rst:1862 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1909 +#: ../../howto/clinic.rst:1866 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2570,24 +2514,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1913 +#: ../../howto/clinic.rst:1870 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1921 +#: ../../howto/clinic.rst:1878 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1927 +#: ../../howto/clinic.rst:1884 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1929 +#: ../../howto/clinic.rst:1886 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2595,7 +2539,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1934 +#: ../../howto/clinic.rst:1891 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/howto/curses.po b/howto/curses.po index 35aa97a92e..76ed9f39c4 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -352,7 +352,7 @@ msgstr "描述" #: ../../howto/curses.rst:281 msgid "*str* or *ch*" -msgstr "" +msgstr "*str* 或 *ch*" #: ../../howto/curses.rst:281 msgid "Display the string *str* or character *ch* at the current position" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index d422a77854..f6f7481fe9 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../howto/isolating-extensions.rst:5 +#: ../../howto/isolating-extensions.rst:7 msgid "Isolating Extension Modules" msgstr "" @@ -25,14 +25,14 @@ msgstr "" msgid "Abstract" msgstr "" -#: ../../howto/isolating-extensions.rst:9 +#: ../../howto/isolating-extensions.rst:11 msgid "" "Traditionally, state belonging to Python extension modules was kept in C " "``static`` variables, which have process-wide scope. This document describes " "problems of such per-process state and shows a safer way: per-module state." msgstr "" -#: ../../howto/isolating-extensions.rst:14 +#: ../../howto/isolating-extensions.rst:16 msgid "" "The document also describes how to switch to per-module state where " "possible. This transition involves allocating space for that state, " @@ -40,47 +40,47 @@ msgid "" "importantly—accessing per-module state from code." msgstr "" -#: ../../howto/isolating-extensions.rst:21 +#: ../../howto/isolating-extensions.rst:23 msgid "Who should read this" msgstr "" -#: ../../howto/isolating-extensions.rst:23 +#: ../../howto/isolating-extensions.rst:25 msgid "" "This guide is written for maintainers of :ref:`C-API ` " "extensions who would like to make that extension safer to use in " "applications where Python itself is used as a library." msgstr "" -#: ../../howto/isolating-extensions.rst:29 +#: ../../howto/isolating-extensions.rst:31 msgid "Background" msgstr "" -#: ../../howto/isolating-extensions.rst:31 +#: ../../howto/isolating-extensions.rst:33 msgid "" "An *interpreter* is the context in which Python code runs. It contains " "configuration (e.g. the import path) and runtime state (e.g. the set of " "imported modules)." msgstr "" -#: ../../howto/isolating-extensions.rst:35 +#: ../../howto/isolating-extensions.rst:37 msgid "" "Python supports running multiple interpreters in one process. There are two " "cases to think about—users may run interpreters:" msgstr "" -#: ../../howto/isolating-extensions.rst:38 +#: ../../howto/isolating-extensions.rst:40 msgid "" "in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " "cycles, and" msgstr "" -#: ../../howto/isolating-extensions.rst:40 +#: ../../howto/isolating-extensions.rst:42 msgid "" "in parallel, managing \"sub-interpreters\" using :c:func:" "`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." msgstr "" -#: ../../howto/isolating-extensions.rst:43 +#: ../../howto/isolating-extensions.rst:45 msgid "" "Both cases (and combinations of them) would be most useful when embedding " "Python within a library. Libraries generally shouldn't make assumptions " @@ -88,7 +88,7 @@ msgid "" "\"main Python interpreter\"." msgstr "" -#: ../../howto/isolating-extensions.rst:48 +#: ../../howto/isolating-extensions.rst:50 msgid "" "Historically, Python extension modules don't handle this use case well. Many " "extension modules (and even some stdlib modules) use *per-process* global " @@ -99,18 +99,18 @@ msgid "" "than one interpreter in the same process." msgstr "" -#: ../../howto/isolating-extensions.rst:56 +#: ../../howto/isolating-extensions.rst:58 msgid "" "Unfortunately, *per-interpreter* state is not easy to achieve. Extension " "authors tend to not keep multiple interpreters in mind when developing, and " "it is currently cumbersome to test the behavior." msgstr "" -#: ../../howto/isolating-extensions.rst:61 +#: ../../howto/isolating-extensions.rst:63 msgid "Enter Per-Module State" msgstr "" -#: ../../howto/isolating-extensions.rst:63 +#: ../../howto/isolating-extensions.rst:65 msgid "" "Instead of focusing on per-interpreter state, Python's C API is evolving to " "better support the more granular *per-module* state. This means that C-level " @@ -120,7 +120,7 @@ msgid "" "loaded in a single interpreter." msgstr "" -#: ../../howto/isolating-extensions.rst:70 +#: ../../howto/isolating-extensions.rst:72 msgid "" "Per-module state provides an easy way to think about lifetime and resource " "ownership: the extension module will initialize when a module object is " @@ -129,7 +129,7 @@ msgid "" "hooks to think—or forget—about." msgstr "" -#: ../../howto/isolating-extensions.rst:76 +#: ../../howto/isolating-extensions.rst:78 msgid "" "Note that there are use cases for different kinds of \"globals\": per-" "process, per-interpreter, per-thread or per-task state. With per-module " @@ -138,18 +138,18 @@ msgid "" "and testing. (Note that this guide does not cover them.)" msgstr "" -#: ../../howto/isolating-extensions.rst:85 +#: ../../howto/isolating-extensions.rst:87 msgid "Isolated Module Objects" msgstr "" -#: ../../howto/isolating-extensions.rst:87 +#: ../../howto/isolating-extensions.rst:89 msgid "" "The key point to keep in mind when developing an extension module is that " "several module objects can be created from a single shared library. For " "example:" msgstr "" -#: ../../howto/isolating-extensions.rst:101 +#: ../../howto/isolating-extensions.rst:103 msgid "" "As a rule of thumb, the two modules should be completely independent. All " "objects and state specific to the module should be encapsulated within the " @@ -159,18 +159,18 @@ msgid "" "and attention to edge cases." msgstr "" -#: ../../howto/isolating-extensions.rst:109 +#: ../../howto/isolating-extensions.rst:111 msgid "" "While some modules could do with less stringent restrictions, isolated " "modules make it easier to set clear expectations and guidelines that work " "across a variety of use cases." msgstr "" -#: ../../howto/isolating-extensions.rst:115 +#: ../../howto/isolating-extensions.rst:117 msgid "Surprising Edge Cases" msgstr "" -#: ../../howto/isolating-extensions.rst:117 +#: ../../howto/isolating-extensions.rst:119 msgid "" "Note that isolated modules do create some surprising edge cases. Most " "notably, each module object will typically not share its classes and " @@ -180,43 +180,43 @@ msgid "" "exception is *not* caught:" msgstr "" -#: ../../howto/isolating-extensions.rst:137 +#: ../../howto/isolating-extensions.rst:139 msgid "" "This is expected. Notice that pure-Python modules behave the same way: it is " "a part of how Python works." msgstr "" -#: ../../howto/isolating-extensions.rst:140 +#: ../../howto/isolating-extensions.rst:142 msgid "" "The goal is to make extension modules safe at the C level, not to make hacks " "behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." msgstr "" -#: ../../howto/isolating-extensions.rst:146 +#: ../../howto/isolating-extensions.rst:148 msgid "Making Modules Safe with Multiple Interpreters" msgstr "" -#: ../../howto/isolating-extensions.rst:150 +#: ../../howto/isolating-extensions.rst:152 msgid "Managing Global State" msgstr "" -#: ../../howto/isolating-extensions.rst:152 +#: ../../howto/isolating-extensions.rst:154 msgid "" "Sometimes, the state associated with a Python module is not specific to that " "module, but to the entire process (or something else \"more global\" than a " "module). For example:" msgstr "" -#: ../../howto/isolating-extensions.rst:156 +#: ../../howto/isolating-extensions.rst:158 msgid "The ``readline`` module manages *the* terminal." msgstr "" -#: ../../howto/isolating-extensions.rst:157 +#: ../../howto/isolating-extensions.rst:159 msgid "" "A module running on a circuit board wants to control *the* on-board LED." msgstr "" -#: ../../howto/isolating-extensions.rst:160 +#: ../../howto/isolating-extensions.rst:162 msgid "" "In these cases, the Python module should provide *access* to the global " "state, rather than *own* it. If possible, write the module so that multiple " @@ -225,7 +225,7 @@ msgid "" "explicit locking." msgstr "" -#: ../../howto/isolating-extensions.rst:166 +#: ../../howto/isolating-extensions.rst:168 msgid "" "If it is necessary to use process-global state, the simplest way to avoid " "issues with multiple interpreters is to explicitly prevent a module from " @@ -233,18 +233,18 @@ msgid "" "Object per Process`_." msgstr "" -#: ../../howto/isolating-extensions.rst:173 +#: ../../howto/isolating-extensions.rst:175 msgid "Managing Per-Module State" msgstr "" -#: ../../howto/isolating-extensions.rst:175 +#: ../../howto/isolating-extensions.rst:177 msgid "" "To use per-module state, use :ref:`multi-phase extension module " "initialization `. This signals that your module " "supports multiple interpreters correctly." msgstr "" -#: ../../howto/isolating-extensions.rst:179 +#: ../../howto/isolating-extensions.rst:181 msgid "" "Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " "of storage local to the module. Usually, this will be set to the size of " @@ -255,7 +255,7 @@ msgid "" "function." msgstr "" -#: ../../howto/isolating-extensions.rst:188 +#: ../../howto/isolating-extensions.rst:190 msgid "" "Another option is to store state in the module's ``__dict__``, but you must " "avoid crashing when users modify ``__dict__`` from Python code. This usually " @@ -263,13 +263,13 @@ msgid "" "and hard to test sufficiently." msgstr "" -#: ../../howto/isolating-extensions.rst:193 +#: ../../howto/isolating-extensions.rst:195 msgid "" "However, if module state is not needed in C code, storing it in ``__dict__`` " "only is a good idea." msgstr "" -#: ../../howto/isolating-extensions.rst:196 +#: ../../howto/isolating-extensions.rst:198 msgid "" "If the module state includes ``PyObject`` pointers, the module object must " "hold references to those objects and implement the module-level hooks " @@ -279,18 +279,18 @@ msgid "" "unloaded cleanly." msgstr "" -#: ../../howto/isolating-extensions.rst:203 +#: ../../howto/isolating-extensions.rst:205 msgid "" "An example of a module with per-module state is currently available as " "`xxlimited `__; example module initialization shown at the bottom of the file." msgstr "" -#: ../../howto/isolating-extensions.rst:209 +#: ../../howto/isolating-extensions.rst:211 msgid "Opt-Out: Limiting to One Module Object per Process" msgstr "" -#: ../../howto/isolating-extensions.rst:211 +#: ../../howto/isolating-extensions.rst:213 msgid "" "A non-negative ``PyModuleDef.m_size`` signals that a module supports " "multiple interpreters correctly. If this is not yet the case for your " @@ -298,36 +298,36 @@ msgid "" "For example::" msgstr "" -#: ../../howto/isolating-extensions.rst:232 +#: ../../howto/isolating-extensions.rst:234 msgid "Module State Access from Functions" msgstr "" -#: ../../howto/isolating-extensions.rst:234 +#: ../../howto/isolating-extensions.rst:236 msgid "" "Accessing the state from module-level functions is straightforward. " "Functions get the module object as their first argument; for extracting the " "state, you can use ``PyModule_GetState``::" msgstr "" -#: ../../howto/isolating-extensions.rst:249 +#: ../../howto/isolating-extensions.rst:251 msgid "" "``PyModule_GetState`` may return ``NULL`` without setting an exception if " "there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " "module, you're in control of ``m_size``, so this is easy to prevent." msgstr "" -#: ../../howto/isolating-extensions.rst:256 +#: ../../howto/isolating-extensions.rst:258 msgid "Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:258 +#: ../../howto/isolating-extensions.rst:260 msgid "" "Traditionally, types defined in C code are *static*; that is, ``static " "PyTypeObject`` structures defined directly in code and initialized using " "``PyType_Ready()``." msgstr "" -#: ../../howto/isolating-extensions.rst:262 +#: ../../howto/isolating-extensions.rst:264 msgid "" "Such types are necessarily shared across the process. Sharing them between " "module objects requires paying attention to any state they own or access. To " @@ -335,7 +335,7 @@ msgid "" "for example, you can't set ``str.myattribute = 123``." msgstr "" -#: ../../howto/isolating-extensions.rst:268 +#: ../../howto/isolating-extensions.rst:270 msgid "" "Sharing truly immutable objects between interpreters is fine, as long as " "they don't provide access to mutable objects. However, in CPython, every " @@ -345,7 +345,7 @@ msgid "" "process-wide GIL." msgstr "" -#: ../../howto/isolating-extensions.rst:275 +#: ../../howto/isolating-extensions.rst:277 msgid "" "Because they are immutable and process-global, static types cannot access " "\"their\" module state. If any method of such a type requires access to " @@ -354,15 +354,15 @@ msgid "" "Python's ``class`` statement." msgstr "" -#: ../../howto/isolating-extensions.rst:282 +#: ../../howto/isolating-extensions.rst:284 msgid "For new modules, using heap types by default is a good rule of thumb." msgstr "" -#: ../../howto/isolating-extensions.rst:286 +#: ../../howto/isolating-extensions.rst:288 msgid "Changing Static Types to Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:288 +#: ../../howto/isolating-extensions.rst:290 msgid "" "Static types can be converted to heap types, but note that the heap type API " "was not designed for \"lossless\" conversion from static types—that is, " @@ -372,126 +372,126 @@ msgid "" "slots). Always test the details that are important to you." msgstr "" -#: ../../howto/isolating-extensions.rst:297 +#: ../../howto/isolating-extensions.rst:299 msgid "" "Watch out for the following two points in particular (but note that this is " "not a comprehensive list):" msgstr "" -#: ../../howto/isolating-extensions.rst:300 +#: ../../howto/isolating-extensions.rst:302 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" "macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" -#: ../../howto/isolating-extensions.rst:302 +#: ../../howto/isolating-extensions.rst:304 msgid "" "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " "become possible to instantiate them from Python code. You can prevent this " "with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" -#: ../../howto/isolating-extensions.rst:308 +#: ../../howto/isolating-extensions.rst:310 msgid "Defining Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:310 +#: ../../howto/isolating-extensions.rst:312 msgid "" "Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " "description or \"blueprint\" of a class, and calling :c:func:" "`PyType_FromModuleAndSpec` to construct a new class object." msgstr "" -#: ../../howto/isolating-extensions.rst:315 +#: ../../howto/isolating-extensions.rst:317 msgid "" "Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, " "but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " "allowing access to the module state from methods." msgstr "" -#: ../../howto/isolating-extensions.rst:319 +#: ../../howto/isolating-extensions.rst:321 msgid "" "The class should generally be stored in *both* the module state (for safe " "access from C) and the module's ``__dict__`` (for access from Python code)." msgstr "" -#: ../../howto/isolating-extensions.rst:325 +#: ../../howto/isolating-extensions.rst:327 msgid "Garbage-Collection Protocol" msgstr "" -#: ../../howto/isolating-extensions.rst:327 +#: ../../howto/isolating-extensions.rst:329 msgid "" "Instances of heap types hold a reference to their type. This ensures that " "the type isn't destroyed before all its instances are, but may result in " "reference cycles that need to be broken by the garbage collector." msgstr "" -#: ../../howto/isolating-extensions.rst:332 +#: ../../howto/isolating-extensions.rst:334 msgid "" "To avoid memory leaks, instances of heap types must implement the garbage " "collection protocol. That is, heap types should:" msgstr "" -#: ../../howto/isolating-extensions.rst:336 +#: ../../howto/isolating-extensions.rst:338 msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../howto/isolating-extensions.rst:337 +#: ../../howto/isolating-extensions.rst:339 msgid "" "Define a traverse function using ``Py_tp_traverse``, which visits the type " "(e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`)." msgstr "" -#: ../../howto/isolating-extensions.rst:340 +#: ../../howto/isolating-extensions.rst:342 msgid "" "Please refer to the :ref:`the documentation ` of :c:macro:" "`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for " "additional considerations." msgstr "" -#: ../../howto/isolating-extensions.rst:344 +#: ../../howto/isolating-extensions.rst:346 msgid "" "If your traverse function delegates to the ``tp_traverse`` of its base class " "(or another type), ensure that ``Py_TYPE(self)`` is visited only once. Note " "that only heap type are expected to visit the type in ``tp_traverse``." msgstr "" -#: ../../howto/isolating-extensions.rst:348 +#: ../../howto/isolating-extensions.rst:350 msgid "For example, if your traverse function includes::" msgstr "" -#: ../../howto/isolating-extensions.rst:352 +#: ../../howto/isolating-extensions.rst:354 msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" -#: ../../howto/isolating-extensions.rst:360 +#: ../../howto/isolating-extensions.rst:362 msgid "" "It is not necessary to handle the type's reference count in ``tp_new`` and " "``tp_clear``." msgstr "" -#: ../../howto/isolating-extensions.rst:365 +#: ../../howto/isolating-extensions.rst:367 msgid "Module State Access from Classes" msgstr "" -#: ../../howto/isolating-extensions.rst:367 +#: ../../howto/isolating-extensions.rst:369 msgid "" "If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " "you can call :c:func:`PyType_GetModule` to get the associated module, and " "then :c:func:`PyModule_GetState` to get the module's state." msgstr "" -#: ../../howto/isolating-extensions.rst:371 +#: ../../howto/isolating-extensions.rst:373 msgid "" "To save a some tedious error-handling boilerplate code, you can combine " "these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" -#: ../../howto/isolating-extensions.rst:381 +#: ../../howto/isolating-extensions.rst:383 msgid "Module State Access from Regular Methods" msgstr "" -#: ../../howto/isolating-extensions.rst:383 +#: ../../howto/isolating-extensions.rst:385 msgid "" "Accessing the module-level state from methods of a class is somewhat more " "complicated, but is possible thanks to API introduced in Python 3.9. To get " @@ -499,27 +499,27 @@ msgid "" "module state from it." msgstr "" -#: ../../howto/isolating-extensions.rst:388 +#: ../../howto/isolating-extensions.rst:390 msgid "" "The largest roadblock is getting *the class a method was defined in*, or " "that method's \"defining class\" for short. The defining class can have a " "reference to the module it is part of." msgstr "" -#: ../../howto/isolating-extensions.rst:392 +#: ../../howto/isolating-extensions.rst:394 msgid "" "Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the " "method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer " "to that subclass, which may be defined in different module than yours." msgstr "" -#: ../../howto/isolating-extensions.rst:397 +#: ../../howto/isolating-extensions.rst:399 msgid "" "The following Python code can illustrate the concept. ``Base." "get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" -#: ../../howto/isolating-extensions.rst:413 +#: ../../howto/isolating-extensions.rst:415 msgid "" "For a method to get its \"defining class\", it must use the :ref:" "`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `__." msgstr "" -#: ../../howto/isolating-extensions.rst:524 +#: ../../howto/isolating-extensions.rst:526 msgid "Per-Class Scope" msgstr "" -#: ../../howto/isolating-extensions.rst:526 +#: ../../howto/isolating-extensions.rst:528 msgid "" "It is currently (as of Python 3.11) not possible to attach state to " "individual *types* without relying on CPython implementation details (which " @@ -624,11 +624,11 @@ msgid "" "per-class scope)." msgstr "" -#: ../../howto/isolating-extensions.rst:533 +#: ../../howto/isolating-extensions.rst:535 msgid "Lossless Conversion to Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:535 +#: ../../howto/isolating-extensions.rst:537 msgid "" "The heap type API was not designed for \"lossless\" conversion from static " "types; that is, creating a type that works exactly like a given static type." diff --git a/installing/index.po b/installing/index.po index 8ac251689f..8d490a1b4c 100644 --- a/installing/index.po +++ b/installing/index.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2022-06-27 09:37+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,13 +57,13 @@ msgstr "" #: ../../installing/index.rst:20 msgid "" "This guide covers the installation part of the process. For a guide to " -"creating and sharing your own Python projects, refer to the :ref:" -"`distribution guide `." +"creating and sharing your own Python projects, refer to the `Python " +"packaging user guide`_." msgstr "" "這份指南涵蓋了上述過程中的安裝部分。如果是要建立及分享您自己的 Python 專案," -"請參考\\ :ref:`發布 Python 模組 `\\ 指南。" +"請參考 `Python packaging user guide`_。" -#: ../../installing/index.rst:26 +#: ../../installing/index.rst:28 msgid "" "For corporate and other institutional users, be aware that many " "organisations have their own policies around using and contributing to open " @@ -73,11 +73,11 @@ msgstr "" "對於企業和其他機構的使用者,要注意到,許多組織對於使用和貢獻開源軟體都有自己" "的政策。在開始使用配備 Python 的發布及安裝工具時,請將那些政策納入考量。" -#: ../../installing/index.rst:33 +#: ../../installing/index.rst:35 msgid "Key terms" msgstr "關鍵術語" -#: ../../installing/index.rst:35 +#: ../../installing/index.rst:37 msgid "" "``pip`` is the preferred installer program. Starting with Python 3.4, it is " "included by default with the Python binary installers." @@ -85,7 +85,7 @@ msgstr "" "``pip`` 是首選的安裝程式。從 Python 3.4 開始,它被預設包含在 Python 二進制安" "裝程式中。" -#: ../../installing/index.rst:37 +#: ../../installing/index.rst:39 msgid "" "A *virtual environment* is a semi-isolated Python environment that allows " "packages to be installed for use by a particular application, rather than " @@ -94,7 +94,7 @@ msgstr "" "*virtual environment(虛擬環境)*\\ 是一種半隔離的 Python 環境,可以為某個特" "定應用程式安裝其所需的套件,而不用在整個系統上安裝它們。" -#: ../../installing/index.rst:40 +#: ../../installing/index.rst:42 msgid "" "``venv`` is the standard tool for creating virtual environments, and has " "been part of Python since Python 3.3. Starting with Python 3.4, it defaults " @@ -103,7 +103,7 @@ msgstr "" "``venv`` 是建立虛擬環境的標準工具,它從 Python 3.3 開始成為 Python 的一部分。" "從 Python 3.4 開始,它會預設地安裝 ``pip`` 到所有被建立的虛擬環境。" -#: ../../installing/index.rst:43 +#: ../../installing/index.rst:45 msgid "" "``virtualenv`` is a third party alternative (and predecessor) to ``venv``. " "It allows virtual environments to be used on versions of Python prior to " @@ -114,7 +114,7 @@ msgstr "" "在 Python 3.4 之前的版本被使用,那些版本要不是根本沒提供 ``venv``,就是無法自" "動安裝 ``pip`` 到所建立的環境中。" -#: ../../installing/index.rst:47 +#: ../../installing/index.rst:49 msgid "" "The `Python Package Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." @@ -122,7 +122,7 @@ msgstr "" "`Python 套件索引 (Python Package Index) `__ 是開源授權套件" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" -#: ../../installing/index.rst:50 +#: ../../installing/index.rst:52 msgid "" "the `Python Packaging Authority `__ is the group of " "developers and documentation authors responsible for the maintenance and " @@ -135,7 +135,7 @@ msgstr "" "元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 平台上維護各種工具、說明文件及問題追蹤系統。" -#: ../../installing/index.rst:56 +#: ../../installing/index.rst:58 msgid "" "``distutils`` is the original build and distribution system first added to " "the Python standard library in 1998. While direct use of ``distutils`` is " @@ -149,12 +149,12 @@ msgstr "" "基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" "著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" -#: ../../installing/index.rst:64 +#: ../../installing/index.rst:66 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." msgstr "對於建立虛擬環境,現在推薦使用 ``venv``。" -#: ../../installing/index.rst:69 +#: ../../installing/index.rst:71 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" @@ -162,17 +162,17 @@ msgstr "" "`Python 封裝使用者指南:建立和使用虛擬環境 `__" -#: ../../installing/index.rst:74 +#: ../../installing/index.rst:76 msgid "Basic usage" msgstr "基本用法" -#: ../../installing/index.rst:76 +#: ../../installing/index.rst:78 msgid "" "The standard packaging tools are all designed to be used from the command " "line." msgstr "標準封裝工具皆是以能從命令列使用的方式被設計的。" -#: ../../installing/index.rst:79 +#: ../../installing/index.rst:81 msgid "" "The following command will install the latest version of a module and its " "dependencies from the Python Package Index::" @@ -182,7 +182,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:86 +#: ../../installing/index.rst:88 msgid "" "For POSIX users (including macOS and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." @@ -190,7 +190,7 @@ msgstr "" "對於 POSIX 使用者(包括 macOS 和 Linux 使用者),本指南中的範例皆假設有使用 :" "term:`virtual environment`\\ 。" -#: ../../installing/index.rst:89 +#: ../../installing/index.rst:91 msgid "" "For Windows users, the examples in this guide assume that the option to " "adjust the system PATH environment variable was selected when installing " @@ -199,7 +199,7 @@ msgstr "" "對於 Windows 使用者,本指南中的範例皆假設在安裝 Python 時,「可調整系統 PATH " "環境變數」的選項已被選取。" -#: ../../installing/index.rst:93 +#: ../../installing/index.rst:95 msgid "" "It's also possible to specify an exact or minimum version directly on the " "command line. When using comparator operators such as ``>``, ``<`` or some " @@ -212,7 +212,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:101 +#: ../../installing/index.rst:103 msgid "" "Normally, if a suitable module is already installed, attempting to install " "it again will have no effect. Upgrading existing modules must be requested " @@ -223,7 +223,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:107 +#: ../../installing/index.rst:109 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " "found in the `Python Packaging User Guide `__." @@ -231,7 +231,7 @@ msgstr "" "關於 ``pip`` 及其能力的更多資訊和資源,可以在 `Python 封裝使用者指南 " "`__\\ 中找到。" -#: ../../installing/index.rst:110 +#: ../../installing/index.rst:112 msgid "" "Creation of virtual environments is done through the :mod:`venv` module. " "Installing packages into an active virtual environment uses the commands " @@ -240,7 +240,7 @@ msgstr "" "虛擬環境的建立是使用 :mod:`venv` 模組來完成。要在一個已啟用的虛擬環境中安裝套" "件,可使用前面展示的指令。" -#: ../../installing/index.rst:116 +#: ../../installing/index.rst:118 msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" @@ -248,19 +248,19 @@ msgstr "" "`Python 封裝使用者指南:安裝 Python 發布套件 `__" -#: ../../installing/index.rst:121 +#: ../../installing/index.rst:123 msgid "How do I ...?" msgstr "我該如何...?" -#: ../../installing/index.rst:123 +#: ../../installing/index.rst:125 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../installing/index.rst:126 +#: ../../installing/index.rst:128 msgid "... install ``pip`` in versions of Python prior to Python 3.4?" msgstr "...在 Python 3.4 之前的 Python 版本中安裝 ``pip``?" -#: ../../installing/index.rst:128 +#: ../../installing/index.rst:130 msgid "" "Python only started bundling ``pip`` with Python 3.4. For earlier versions, " "``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " @@ -269,7 +269,7 @@ msgstr "" "Python 是從 Python 3.4 才開始綁定 ``pip`` 的。對於更早的版本,\\ ``pip`` 需要" "被「自助安裝 (bootstrapped)」,請參考 Python 封裝使用者指南中的說明。" -#: ../../installing/index.rst:134 +#: ../../installing/index.rst:136 msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" @@ -277,11 +277,11 @@ msgstr "" "`Python 封裝使用者指南:安裝套件的需求 `__" -#: ../../installing/index.rst:141 +#: ../../installing/index.rst:143 msgid "... install packages just for the current user?" msgstr "...只為目前的使用者安裝套件?" -#: ../../installing/index.rst:143 +#: ../../installing/index.rst:145 msgid "" "Passing the ``--user`` option to ``python -m pip install`` will install a " "package just for the current user, rather than for all users of the system." @@ -289,11 +289,11 @@ msgstr "" "把 ``--user`` 選項傳給 ``python -m pip install``,這樣將會只為目前使用者而非" "系統的所有使用者安裝套件。" -#: ../../installing/index.rst:148 +#: ../../installing/index.rst:150 msgid "... install scientific Python packages?" msgstr "...安裝科學的 Python 套件?" -#: ../../installing/index.rst:150 +#: ../../installing/index.rst:152 msgid "" "A number of scientific Python packages have complex binary dependencies, and " "aren't currently easy to install using ``pip`` directly. At this point in " @@ -305,7 +305,7 @@ msgstr "" "``pip`` 安裝。目前為止,使用\\ `其他方法 `__\\ 而非嘗試用 ``pip`` 來安裝它們,對使用者來說通常會更簡單。" -#: ../../installing/index.rst:158 +#: ../../installing/index.rst:160 msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" @@ -313,11 +313,11 @@ msgstr "" "`Python 封裝使用者指南:安裝科學套件 `__" -#: ../../installing/index.rst:163 +#: ../../installing/index.rst:165 msgid "... work with multiple versions of Python installed in parallel?" msgstr "...平行安裝多個 Python 版本並使用它們?" -#: ../../installing/index.rst:165 +#: ../../installing/index.rst:167 msgid "" "On Linux, macOS, and other POSIX systems, use the versioned Python commands " "in combination with the ``-m`` switch to run the appropriate copy of " @@ -328,11 +328,11 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:174 +#: ../../installing/index.rst:176 msgid "Appropriately versioned ``pip`` commands may also be available." msgstr "使用帶有合適版本編號的 ``pip`` 指令,也是可行的。" -#: ../../installing/index.rst:176 +#: ../../installing/index.rst:178 msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" @@ -342,15 +342,15 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:193 +#: ../../installing/index.rst:195 msgid "Common installation issues" msgstr "常見的安裝問題" -#: ../../installing/index.rst:196 +#: ../../installing/index.rst:198 msgid "Installing into the system Python on Linux" msgstr "在 Linux 上安裝套件至系統 Python" -#: ../../installing/index.rst:198 +#: ../../installing/index.rst:200 msgid "" "On Linux systems, a Python installation will typically be included as part " "of the distribution. Installing into this Python installation requires root " @@ -362,7 +362,7 @@ msgstr "" "件到這個 Python 版本上需要系統的 root 權限,並且可能會干擾到系統套件管理器的" "運作。如果其他系統組件非預期地以 ``pip`` 被升級,也會干擾這些組件的運作。" -#: ../../installing/index.rst:204 +#: ../../installing/index.rst:206 msgid "" "On such systems, it is often better to use a virtual environment or a per-" "user installation when installing packages with ``pip``." @@ -370,11 +370,11 @@ msgstr "" "在這樣的系統上,以 ``pip`` 安裝套件時,通常較好的方式是使用虛擬環境,或以個別" "使用者安裝。" -#: ../../installing/index.rst:209 +#: ../../installing/index.rst:211 msgid "Pip not installed" msgstr "未安裝 pip" -#: ../../installing/index.rst:211 +#: ../../installing/index.rst:213 msgid "" "It is possible that ``pip`` does not get installed by default. One potential " "fix is::" @@ -383,7 +383,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:215 +#: ../../installing/index.rst:217 msgid "" "There are also additional resources for `installing pip. `__\\ 的資源。" -#: ../../installing/index.rst:220 +#: ../../installing/index.rst:222 msgid "Installing binary extensions" msgstr "安裝二進制擴充 (binary extension)" -#: ../../installing/index.rst:222 +#: ../../installing/index.rst:224 msgid "" "Python has typically relied heavily on source based distribution, with end " "users being expected to compile extension modules from source as part of the " @@ -406,7 +406,7 @@ msgstr "" "Python 基本上相當倚賴以原始碼為基礎的發布方式,也會期望使用者在安裝過程的某個" "階段,從原始碼來編譯擴充模組。" -#: ../../installing/index.rst:226 +#: ../../installing/index.rst:228 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " "ability to publish wheels for at least Windows and macOS through the Python " @@ -418,7 +418,7 @@ msgstr "" "Windows 和 macOS 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能夠" "更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" -#: ../../installing/index.rst:232 +#: ../../installing/index.rst:234 msgid "" "Some of the solutions for installing `scientific software `__ that are not yet available as pre-built ``wheel`` " @@ -429,7 +429,7 @@ msgstr "" "軟體 `__\\ ,這些方案也有助於取得其他" "的二進制擴充,且無需在本機對它們進行建置。" -#: ../../installing/index.rst:239 +#: ../../installing/index.rst:241 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 05d60d7dee..7bb353e610 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -697,7 +697,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:508 #: ../../library/asyncio-eventloop.rst:750 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." -msgstr "" +msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" #: ../../library/asyncio-eventloop.rst:512 msgid "" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 639f5fea43..682cea2052 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -97,7 +97,7 @@ msgstr "" #: ../../library/asyncio-runner.rst:69 msgid "Added *loop_factory* parameter." -msgstr "" +msgstr "新增 *loop_factory* 參數。" #: ../../library/asyncio-runner.rst:73 msgid "Runner context manager" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index a256bb058c..fd1ced339d 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -100,7 +100,7 @@ msgstr "新增 *ssl_handshake_timeout* 參數。" #: ../../library/asyncio-stream.rst:80 msgid "Added *happy_eyeballs_delay* and *interleave* parameters." -msgstr "" +msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" #: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 #: ../../library/asyncio-stream.rst:157 ../../library/asyncio-stream.rst:187 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 16372ee81e..20eded89b3 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 00:03+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-" @@ -602,8 +602,8 @@ msgstr "" #: ../../library/asyncio-task.rst:633 msgid "" -"An :ref:`asynchronous context manager ` that can be " -"used to limit the amount of time spent waiting on something." +"Return an :ref:`asynchronous context manager ` that " +"can be used to limit the amount of time spent waiting on something." msgstr "" #: ../../library/asyncio-task.rst:637 diff --git a/library/csv.po b/library/csv.po index 8b742a9fca..ceefe0fe93 100644 --- a/library/csv.po +++ b/library/csv.po @@ -602,7 +602,7 @@ msgstr "" #: ../../library/csv.rst:505 msgid "Added support of arbitrary iterables." -msgstr "" +msgstr "新增對任意 iterable 的支援。" #: ../../library/csv.rst:510 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index db3176d87a..120a3fae5a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,9 +69,9 @@ msgid "" "loads libraries which export functions using the standard ``cdecl`` calling " "convention, while *windll* libraries call functions using the ``stdcall`` " "calling convention. *oledll* also uses the ``stdcall`` calling convention, " -"and assumes the functions return a Windows :c:type:`HRESULT` error code. The " -"error code is used to automatically raise an :class:`OSError` exception when " -"the function call fails." +"and assumes the functions return a Windows :c:type:`!HRESULT` error code. " +"The error code is used to automatically raise an :class:`OSError` exception " +"when the function call fails." msgstr "" #: ../../library/ctypes.rst:48 @@ -103,20 +103,20 @@ msgstr "" msgid "" "On Linux, it is required to specify the filename *including* the extension " "to load a library, so attribute access can not be used to load libraries. " -"Either the :meth:`LoadLibrary` method of the dll loaders should be used, or " -"you should load the library by creating an instance of CDLL by calling the " -"constructor::" +"Either the :meth:`~LibraryLoader.LoadLibrary` method of the dll loaders " +"should be used, or you should load the library by creating an instance of " +"CDLL by calling the constructor::" msgstr "" -#: ../../library/ctypes.rst:91 +#: ../../library/ctypes.rst:92 msgid "Accessing functions from loaded dlls" msgstr "" -#: ../../library/ctypes.rst:93 +#: ../../library/ctypes.rst:94 msgid "Functions are accessed as attributes of dll objects::" msgstr "" -#: ../../library/ctypes.rst:108 +#: ../../library/ctypes.rst:109 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " @@ -127,65 +127,65 @@ msgid "" "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" -#: ../../library/ctypes.rst:121 +#: ../../library/ctypes.rst:122 msgid "" "*windll* does not try to select one of them by magic, you must access the " "version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " "explicitly, and then call it with bytes or string objects respectively." msgstr "" -#: ../../library/ctypes.rst:125 +#: ../../library/ctypes.rst:126 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " "identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" "`getattr` to retrieve the function::" msgstr "" -#: ../../library/ctypes.rst:133 +#: ../../library/ctypes.rst:134 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " "functions can be accessed by indexing the dll object with the ordinal " "number::" msgstr "" -#: ../../library/ctypes.rst:150 +#: ../../library/ctypes.rst:151 msgid "Calling functions" msgstr "" -#: ../../library/ctypes.rst:152 +#: ../../library/ctypes.rst:153 msgid "" "You can call these functions like any other Python callable. This example " "uses the ``rand()`` function, which takes no arguments and returns a pseudo-" "random integer::" msgstr "" -#: ../../library/ctypes.rst:158 +#: ../../library/ctypes.rst:159 msgid "" "On Windows, you can call the ``GetModuleHandleA()`` function, which returns " "a win32 module handle (passing ``None`` as single argument to call it with a " "``NULL`` pointer)::" msgstr "" -#: ../../library/ctypes.rst:165 +#: ../../library/ctypes.rst:166 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" -#: ../../library/ctypes.rst:180 +#: ../../library/ctypes.rst:181 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." msgstr "" -#: ../../library/ctypes.rst:183 +#: ../../library/ctypes.rst:184 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" -#: ../../library/ctypes.rst:193 +#: ../../library/ctypes.rst:194 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -193,7 +193,7 @@ msgid "" "library calls)." msgstr "" -#: ../../library/ctypes.rst:198 +#: ../../library/ctypes.rst:199 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -204,259 +204,259 @@ msgid "" "the C type." msgstr "" -#: ../../library/ctypes.rst:205 +#: ../../library/ctypes.rst:206 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2198 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2201 msgid "Fundamental data types" msgstr "" -#: ../../library/ctypes.rst:214 +#: ../../library/ctypes.rst:215 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "ctypes type" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "C type" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "Python type" msgstr "" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:222 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:221 ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:222 ../../library/ctypes.rst:226 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:222 msgid "1-character bytes object" msgstr "" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid ":c:type:`wchar_t`" msgstr ":c:type:`wchar_t`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid "1-character string" msgstr "" -#: ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:226 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:225 ../../library/ctypes.rst:227 -#: ../../library/ctypes.rst:229 ../../library/ctypes.rst:231 -#: ../../library/ctypes.rst:233 ../../library/ctypes.rst:235 -#: ../../library/ctypes.rst:237 ../../library/ctypes.rst:239 -#: ../../library/ctypes.rst:241 ../../library/ctypes.rst:243 -#: ../../library/ctypes.rst:246 ../../library/ctypes.rst:248 -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:226 ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:230 ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:234 ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:238 ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:242 ../../library/ctypes.rst:244 +#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:252 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:228 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:228 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:230 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:230 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:232 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:232 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:234 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:234 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:236 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:236 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:238 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:238 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:240 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:240 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:242 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:242 msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:244 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:244 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:247 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:247 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:249 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:249 msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:type:`ssize_t` 或 :c:expr:`Py_ssize_t`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:252 msgid ":class:`c_time_t`" msgstr ":class:`c_time_t`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:252 msgid ":c:type:`time_t`" msgstr ":c:type:`time_t`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:254 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:254 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:254 ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:258 msgid "float" msgstr "float" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:256 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:256 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:258 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:258 msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid ":c:expr:`char *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid "bytes object or ``None``" msgstr "" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid "string or ``None``" msgstr "字串或 ``None``" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid "int or ``None``" msgstr "" -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:268 msgid "The constructor accepts any object with a truth value." msgstr "" -#: ../../library/ctypes.rst:269 +#: ../../library/ctypes.rst:270 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" msgstr "" -#: ../../library/ctypes.rst:280 +#: ../../library/ctypes.rst:281 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" -#: ../../library/ctypes.rst:292 +#: ../../library/ctypes.rst:293 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " @@ -464,7 +464,7 @@ msgid "" "Python bytes objects are immutable)::" msgstr "" -#: ../../library/ctypes.rst:312 +#: ../../library/ctypes.rst:313 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -474,37 +474,37 @@ msgid "" "``value`` property::" msgstr "" -#: ../../library/ctypes.rst:336 +#: ../../library/ctypes.rst:337 msgid "" -"The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " +"The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " "function (which is still available as an alias). To create a mutable memory " "block containing unicode characters of the C type :c:type:`wchar_t`, use " "the :func:`create_unicode_buffer` function." msgstr "" -#: ../../library/ctypes.rst:345 +#: ../../library/ctypes.rst:346 msgid "Calling functions, continued" msgstr "" -#: ../../library/ctypes.rst:347 +#: ../../library/ctypes.rst:348 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " "from within *IDLE* or *PythonWin*::" msgstr "" -#: ../../library/ctypes.rst:367 +#: ../../library/ctypes.rst:368 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" -#: ../../library/ctypes.rst:379 +#: ../../library/ctypes.rst:380 msgid "Calling variadic functions" msgstr "" -#: ../../library/ctypes.rst:381 +#: ../../library/ctypes.rst:382 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -513,127 +513,130 @@ msgid "" "functions." msgstr "" -#: ../../library/ctypes.rst:386 +#: ../../library/ctypes.rst:387 msgid "" -"On those platforms it is required to specify the *argtypes* attribute for " -"the regular, non-variadic, function arguments:" +"On those platforms it is required to specify the :attr:`~_FuncPtr.argtypes` " +"attribute for the regular, non-variadic, function arguments:" msgstr "" -#: ../../library/ctypes.rst:393 +#: ../../library/ctypes.rst:394 msgid "" "Because specifying the attribute does not inhibit portability it is advised " -"to always specify ``argtypes`` for all variadic functions." +"to always specify :attr:`~_FuncPtr.argtypes` for all variadic functions." msgstr "" -#: ../../library/ctypes.rst:400 +#: ../../library/ctypes.rst:401 msgid "Calling functions with your own custom data types" msgstr "" -#: ../../library/ctypes.rst:402 +#: ../../library/ctypes.rst:403 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " -"of your own classes be used as function arguments. :mod:`ctypes` looks for " -"an :attr:`_as_parameter_` attribute and uses this as the function argument. " -"Of course, it must be one of integer, string, or bytes::" +"of your own classes be used as function arguments. :mod:`ctypes` looks for " +"an :attr:`!_as_parameter_` attribute and uses this as the function argument. " +"The attribute must be an integer, string, bytes, a :mod:`ctypes` instance, " +"or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" -#: ../../library/ctypes.rst:417 +#: ../../library/ctypes.rst:419 msgid "" -"If you don't want to store the instance's data in the :attr:`_as_parameter_` " -"instance variable, you could define a :class:`property` which makes the " -"attribute available on request." +"If you don't want to store the instance's data in the :attr:`!" +"_as_parameter_` instance variable, you could define a :class:`property` " +"which makes the attribute available on request." msgstr "" -#: ../../library/ctypes.rst:425 +#: ../../library/ctypes.rst:427 msgid "Specifying the required argument types (function prototypes)" msgstr "" -#: ../../library/ctypes.rst:427 +#: ../../library/ctypes.rst:429 msgid "" "It is possible to specify the required argument types of functions exported " -"from DLLs by setting the :attr:`argtypes` attribute." +"from DLLs by setting the :attr:`~_FuncPtr.argtypes` attribute." msgstr "" -#: ../../library/ctypes.rst:430 +#: ../../library/ctypes.rst:432 msgid "" -":attr:`argtypes` must be a sequence of C data types (the ``printf`` function " -"is probably not a good example here, because it takes a variable number and " -"different types of parameters depending on the format string, on the other " -"hand this is quite handy to experiment with this feature)::" +":attr:`~_FuncPtr.argtypes` must be a sequence of C data types (the :func:`!" +"printf` function is probably not a good example here, because it takes a " +"variable number and different types of parameters depending on the format " +"string, on the other hand this is quite handy to experiment with this " +"feature)::" msgstr "" -#: ../../library/ctypes.rst:441 +#: ../../library/ctypes.rst:443 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " "types::" msgstr "" -#: ../../library/ctypes.rst:453 +#: ../../library/ctypes.rst:455 msgid "" "If you have defined your own classes which you pass to function calls, you " -"have to implement a :meth:`from_param` class method for them to be able to " -"use them in the :attr:`argtypes` sequence. The :meth:`from_param` class " -"method receives the Python object passed to the function call, it should do " -"a typecheck or whatever is needed to make sure this object is acceptable, " -"and then return the object itself, its :attr:`_as_parameter_` attribute, or " -"whatever you want to pass as the C function argument in this case. Again, " -"the result should be an integer, string, bytes, a :mod:`ctypes` instance, or " -"an object with an :attr:`_as_parameter_` attribute." -msgstr "" - -#: ../../library/ctypes.rst:467 +"have to implement a :meth:`~_CData.from_param` class method for them to be " +"able to use them in the :attr:`~_FuncPtr.argtypes` sequence. The :meth:" +"`~_CData.from_param` class method receives the Python object passed to the " +"function call, it should do a typecheck or whatever is needed to make sure " +"this object is acceptable, and then return the object itself, its :attr:`!" +"_as_parameter_` attribute, or whatever you want to pass as the C function " +"argument in this case. Again, the result should be an integer, string, " +"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" +"_as_parameter_` attribute." +msgstr "" + +#: ../../library/ctypes.rst:469 msgid "Return types" msgstr "" -#: ../../library/ctypes.rst:477 +#: ../../library/ctypes.rst:479 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " -"return types can be specified by setting the :attr:`restype` attribute of " -"the function object." +"return types can be specified by setting the :attr:`~_FuncPtr.restype` " +"attribute of the function object." msgstr "" -#: ../../library/ctypes.rst:481 +#: ../../library/ctypes.rst:483 msgid "" -"The C prototype of ``time()`` is ``time_t time(time_t *)``. Because :c:type:" -"`time_t` might be of a different type than the default return type ``int``, " -"you should specify the ``restype``::" +"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" +"type:`time_t` might be of a different type than the default return type :c:" +"expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" -#: ../../library/ctypes.rst:487 -msgid "The argument types can be specified using ``argtypes``::" +#: ../../library/ctypes.rst:489 +msgid "The argument types can be specified using :attr:`~_FuncPtr.argtypes`::" msgstr "" -#: ../../library/ctypes.rst:491 +#: ../../library/ctypes.rst:493 msgid "" "To call the function with a ``NULL`` pointer as first argument, use " "``None``::" msgstr "" -#: ../../library/ctypes.rst:496 +#: ../../library/ctypes.rst:498 msgid "" -"Here is a more advanced example, it uses the ``strchr`` function, which " +"Here is a more advanced example, it uses the :func:`!strchr` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" -#: ../../library/ctypes.rst:509 +#: ../../library/ctypes.rst:511 msgid "" -"If you want to avoid the ``ord(\"x\")`` calls above, you can set the :attr:" -"`argtypes` attribute, and the second argument will be converted from a " -"single character Python bytes object into a C char:" +"If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " +"the :attr:`~_FuncPtr.argtypes` attribute, and the second argument will be " +"converted from a single character Python bytes object into a C char:" msgstr "" -#: ../../library/ctypes.rst:528 +#: ../../library/ctypes.rst:530 msgid "" "You can also use a callable Python object (a function or a class for " -"example) as the :attr:`restype` attribute, if the foreign function returns " -"an integer. The callable will be called with the *integer* the C function " -"returns, and the result of this call will be used as the result of your " -"function call. This is useful to check for error return values and " +"example) as the :attr:`~_FuncPtr.restype` attribute, if the foreign function " +"returns an integer. The callable will be called with the *integer* the C " +"function returns, and the result of this call will be used as the result of " +"your function call. This is useful to check for error return values and " "automatically raise an exception::" msgstr "" -#: ../../library/ctypes.rst:551 +#: ../../library/ctypes.rst:553 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -641,17 +644,18 @@ msgid "" "used, it calls :func:`GetLastError` to retrieve it." msgstr "" -#: ../../library/ctypes.rst:556 +#: ../../library/ctypes.rst:558 msgid "" "Please note that a much more powerful error checking mechanism is available " -"through the :attr:`errcheck` attribute; see the reference manual for details." +"through the :attr:`~_FuncPtr.errcheck` attribute; see the reference manual " +"for details." msgstr "" -#: ../../library/ctypes.rst:563 +#: ../../library/ctypes.rst:566 msgid "Passing pointers (or: passing parameters by reference)" msgstr "" -#: ../../library/ctypes.rst:565 +#: ../../library/ctypes.rst:568 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -659,7 +663,7 @@ msgid "" "reference*." msgstr "" -#: ../../library/ctypes.rst:569 +#: ../../library/ctypes.rst:572 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -668,56 +672,57 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" -#: ../../library/ctypes.rst:591 +#: ../../library/ctypes.rst:594 msgid "Structures and unions" msgstr "" -#: ../../library/ctypes.rst:593 +#: ../../library/ctypes.rst:596 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " -"subclass must define a :attr:`_fields_` attribute. :attr:`_fields_` must be " -"a list of *2-tuples*, containing a *field name* and a *field type*." +"subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" +"_fields_` must be a list of *2-tuples*, containing a *field name* and a " +"*field type*." msgstr "" -#: ../../library/ctypes.rst:598 +#: ../../library/ctypes.rst:601 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." msgstr "" -#: ../../library/ctypes.rst:601 +#: ../../library/ctypes.rst:604 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " "constructor::" msgstr "" -#: ../../library/ctypes.rst:621 +#: ../../library/ctypes.rst:624 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." msgstr "" -#: ../../library/ctypes.rst:624 +#: ../../library/ctypes.rst:627 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" msgstr "" -#: ../../library/ctypes.rst:638 +#: ../../library/ctypes.rst:641 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" -#: ../../library/ctypes.rst:643 +#: ../../library/ctypes.rst:646 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information::" msgstr "" -#: ../../library/ctypes.rst:657 +#: ../../library/ctypes.rst:660 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -725,20 +730,20 @@ msgid "" "structures with bit-fields should always be passed to functions by pointer." msgstr "" -#: ../../library/ctypes.rst:663 +#: ../../library/ctypes.rst:666 msgid "Structure/union alignment and byte order" msgstr "" -#: ../../library/ctypes.rst:665 +#: ../../library/ctypes.rst:668 msgid "" "By default, Structure and Union fields are aligned in the same way the C " "compiler does it. It is possible to override this behavior by specifying a :" -"attr:`_pack_` class attribute in the subclass definition. This must be set " -"to a positive integer and specifies the maximum alignment for the fields. " -"This is what ``#pragma pack(n)`` also does in MSVC." +"attr:`~Structure._pack_` class attribute in the subclass definition. This " +"must be set to a positive integer and specifies the maximum alignment for " +"the fields. This is what ``#pragma pack(n)`` also does in MSVC." msgstr "" -#: ../../library/ctypes.rst:671 +#: ../../library/ctypes.rst:674 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -747,91 +752,91 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:681 +#: ../../library/ctypes.rst:684 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:683 +#: ../../library/ctypes.rst:686 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " -"the third item in the :attr:`_fields_` tuples::" +"the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:701 +#: ../../library/ctypes.rst:704 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:703 +#: ../../library/ctypes.rst:706 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:705 +#: ../../library/ctypes.rst:708 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:710 +#: ../../library/ctypes.rst:713 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:726 +#: ../../library/ctypes.rst:729 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:732 +#: ../../library/ctypes.rst:735 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:735 +#: ../../library/ctypes.rst:738 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:751 +#: ../../library/ctypes.rst:754 msgid "Pointers" msgstr "" -#: ../../library/ctypes.rst:753 +#: ../../library/ctypes.rst:756 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:761 +#: ../../library/ctypes.rst:764 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:768 +#: ../../library/ctypes.rst:771 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:777 +#: ../../library/ctypes.rst:780 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:789 +#: ../../library/ctypes.rst:792 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:795 +#: ../../library/ctypes.rst:798 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:804 +#: ../../library/ctypes.rst:807 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -840,7 +845,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:810 +#: ../../library/ctypes.rst:813 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -848,46 +853,47 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:826 +#: ../../library/ctypes.rst:829 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:834 +#: ../../library/ctypes.rst:837 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:853 +#: ../../library/ctypes.rst:856 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:855 +#: ../../library/ctypes.rst:858 msgid "" "Usually, ctypes does strict type checking. This means, if you have " -"``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type " -"of a member field in a structure definition, only instances of exactly the " -"same type are accepted. There are some exceptions to this rule, where " -"ctypes accepts other objects. For example, you can pass compatible array " -"instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes " -"accepts an array of c_int::" +"``POINTER(c_int)`` in the :attr:`~_FuncPtr.argtypes` list of a function or " +"as the type of a member field in a structure definition, only instances of " +"exactly the same type are accepted. There are some exceptions to this rule, " +"where ctypes accepts other objects. For example, you can pass compatible " +"array instances instead of pointer types. So, for ``POINTER(c_int)``, " +"ctypes accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:876 +#: ../../library/ctypes.rst:879 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " -"type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the " -"pointed type (``c_int`` in this case) can be passed to the function. ctypes " -"will apply the required :func:`byref` conversion in this case automatically." +"type (such as ``POINTER(c_int)``) in :attr:`~_FuncPtr.argtypes`, an object " +"of the pointed type (``c_int`` in this case) can be passed to the function. " +"ctypes will apply the required :func:`byref` conversion in this case " +"automatically." msgstr "" -#: ../../library/ctypes.rst:881 +#: ../../library/ctypes.rst:884 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:888 +#: ../../library/ctypes.rst:891 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -896,11 +902,11 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:900 +#: ../../library/ctypes.rst:903 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:902 +#: ../../library/ctypes.rst:905 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -909,60 +915,60 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:913 +#: ../../library/ctypes.rst:916 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:926 +#: ../../library/ctypes.rst:929 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:928 +#: ../../library/ctypes.rst:931 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:939 +#: ../../library/ctypes.rst:942 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:952 +#: ../../library/ctypes.rst:955 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" -"`_fields_` attribute later, after the class statement::" +"`~Structure._fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:964 +#: ../../library/ctypes.rst:967 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:985 +#: ../../library/ctypes.rst:988 msgid "Callback functions" msgstr "" -#: ../../library/ctypes.rst:987 +#: ../../library/ctypes.rst:990 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:990 +#: ../../library/ctypes.rst:993 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:994 +#: ../../library/ctypes.rst:997 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -970,23 +976,23 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:999 +#: ../../library/ctypes.rst:1002 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:1003 +#: ../../library/ctypes.rst:1006 msgid "" -"I will present an example here which uses the standard C library's :c:func:" -"`qsort` function, that is used to sort items with the help of a callback " -"function. :c:func:`qsort` will be used to sort an array of integers::" +"I will present an example here which uses the standard C library's :c:func:`!" +"qsort` function, that is used to sort items with the help of a callback " +"function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:1013 +#: ../../library/ctypes.rst:1016 msgid "" -":func:`qsort` must be called with a pointer to the data to sort, the number " +":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " "comparison function, the callback. The callback will then be called with two " "pointers to items, and it must return a negative integer if the first item " @@ -994,44 +1000,44 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:1019 +#: ../../library/ctypes.rst:1022 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:1025 +#: ../../library/ctypes.rst:1028 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1035 +#: ../../library/ctypes.rst:1038 msgid "The result::" msgstr "" -#: ../../library/ctypes.rst:1045 +#: ../../library/ctypes.rst:1048 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1060 +#: ../../library/ctypes.rst:1063 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1067 +#: ../../library/ctypes.rst:1070 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1085 +#: ../../library/ctypes.rst:1088 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1089 +#: ../../library/ctypes.rst:1092 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1041,42 +1047,42 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1099 +#: ../../library/ctypes.rst:1102 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1101 +#: ../../library/ctypes.rst:1104 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" -#: ../../library/ctypes.rst:1105 +#: ../../library/ctypes.rst:1108 msgid "" -":mod:`ctypes` can access values like this with the :meth:`in_dll` class " -"methods of the type. *pythonapi* is a predefined symbol giving access to " -"the Python C api::" +":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " +"class methods of the type. *pythonapi* is a predefined symbol giving access " +"to the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1113 +#: ../../library/ctypes.rst:1116 msgid "" "If the interpreter would have been started with :option:`-O`, the sample " "would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " "have been specified." msgstr "" -#: ../../library/ctypes.rst:1117 +#: ../../library/ctypes.rst:1120 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1120 +#: ../../library/ctypes.rst:1123 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1122 +#: ../../library/ctypes.rst:1125 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1085,19 +1091,19 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1127 +#: ../../library/ctypes.rst:1130 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1141 +#: ../../library/ctypes.rst:1144 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1148 +#: ../../library/ctypes.rst:1151 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1106,34 +1112,34 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1164 +#: ../../library/ctypes.rst:1167 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1172 +#: ../../library/ctypes.rst:1175 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1174 +#: ../../library/ctypes.rst:1177 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1177 +#: ../../library/ctypes.rst:1180 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1197 +#: ../../library/ctypes.rst:1200 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1205 +#: ../../library/ctypes.rst:1208 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1142,26 +1148,26 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1211 +#: ../../library/ctypes.rst:1214 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1215 +#: ../../library/ctypes.rst:1218 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1227 +#: ../../library/ctypes.rst:1230 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1230 +#: ../../library/ctypes.rst:1233 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1170,16 +1176,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1240 +#: ../../library/ctypes.rst:1243 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1242 +#: ../../library/ctypes.rst:1245 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1244 +#: ../../library/ctypes.rst:1247 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1188,50 +1194,50 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1264 +#: ../../library/ctypes.rst:1267 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1276 +#: ../../library/ctypes.rst:1279 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1287 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1290 +#: ../../library/ctypes.rst:1293 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1292 +#: ../../library/ctypes.rst:1295 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1295 +#: ../../library/ctypes.rst:1298 msgid "" -"The purpose of the :func:`find_library` function is to locate a library in a " -"way similar to what the compiler or runtime loader does (on platforms with " -"several versions of a shared library the most recent should be loaded), " -"while the ctypes library loaders act like when a program is run, and call " -"the runtime loader directly." +"The purpose of the :func:`~ctypes.util.find_library` function is to locate a " +"library in a way similar to what the compiler or runtime loader does (on " +"platforms with several versions of a shared library the most recent should " +"be loaded), while the ctypes library loaders act like when a program is run, " +"and call the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1301 +#: ../../library/ctypes.rst:1304 msgid "" -"The :mod:`ctypes.util` module provides a function which can help to " +"The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1309 +#: ../../library/ctypes.rst:1312 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 " @@ -1239,70 +1245,72 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1314 ../../library/ctypes.rst:1973 +#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1976 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1316 +#: ../../library/ctypes.rst:1319 msgid "" -"On Linux, :func:`find_library` tries to run external programs (``/sbin/" -"ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " -"returns the filename of the library file." +"On Linux, :func:`~ctypes.util.find_library` tries to run external programs " +"(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " +"file. It returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1320 +#: ../../library/ctypes.rst:1323 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1324 +#: ../../library/ctypes.rst:1327 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../library/ctypes.rst:1335 +#: ../../library/ctypes.rst:1338 msgid "" -"On macOS, :func:`find_library` tries several predefined naming schemes and " -"paths to locate the library, and returns a full pathname if successful::" +"On macOS, :func:`~ctypes.util.find_library` tries several predefined naming " +"schemes and paths to locate the library, and returns a full pathname if " +"successful::" msgstr "" -#: ../../library/ctypes.rst:1349 +#: ../../library/ctypes.rst:1352 msgid "" -"On Windows, :func:`find_library` searches along the system search path, and " -"returns the full pathname, but since there is no predefined naming scheme a " -"call like ``find_library(\"c\")`` will fail and return ``None``." +"On Windows, :func:`~ctypes.util.find_library` searches along the system " +"search path, and returns the full pathname, but since there is no predefined " +"naming scheme a call like ``find_library(\"c\")`` will fail and return " +"``None``." msgstr "" -#: ../../library/ctypes.rst:1353 +#: ../../library/ctypes.rst:1356 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " -"into the wrapper module instead of using :func:`find_library` to locate the " -"library at runtime." +"into the wrapper module instead of using :func:`~ctypes.util.find_library` " +"to locate the library at runtime." msgstr "" -#: ../../library/ctypes.rst:1361 +#: ../../library/ctypes.rst:1364 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1363 +#: ../../library/ctypes.rst:1366 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1369 +#: ../../library/ctypes.rst:1372 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1373 +#: ../../library/ctypes.rst:1376 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -1314,18 +1322,18 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1385 ../../library/ctypes.rst:1407 -#: ../../library/ctypes.rst:1418 ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1410 +#: ../../library/ctypes.rst:1421 ../../library/ctypes.rst:1438 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/ctypes.rst:1389 +#: ../../library/ctypes.rst:1392 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1395 +#: ../../library/ctypes.rst:1398 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1335,24 +1343,24 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1402 +#: ../../library/ctypes.rst:1405 msgid ":exc:`WindowsError` used to be raised." msgstr "" -#: ../../library/ctypes.rst:1412 +#: ../../library/ctypes.rst:1415 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1420 +#: ../../library/ctypes.rst:1423 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1426 +#: ../../library/ctypes.rst:1429 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 " @@ -1360,21 +1368,21 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1431 +#: ../../library/ctypes.rst:1434 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1437 +#: ../../library/ctypes.rst:1440 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 " "handle to an already loaded shared library, it can be passed as the " -"``handle`` named parameter, otherwise the underlying platforms ``dlopen`` or " -"``LoadLibrary`` function is used to load the library into the process, and " -"to get a handle to it." +"``handle`` named parameter, otherwise the underlying platforms :c:func:`!" +"dlopen` or :c:func:`!LoadLibrary` function is used to load the library into " +"the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1444 +#: ../../library/ctypes.rst:1447 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 " @@ -1382,7 +1390,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1449 +#: ../../library/ctypes.rst:1452 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:" @@ -1392,23 +1400,23 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1456 +#: ../../library/ctypes.rst:1459 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:1460 +#: ../../library/ctypes.rst:1463 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 :" -"func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` " +"func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` " "and :func:`ctypes.set_last_error` are used to request and change the ctypes " "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1466 +#: ../../library/ctypes.rst:1469 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 " @@ -1418,29 +1426,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1473 +#: ../../library/ctypes.rst:1476 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1480 +#: ../../library/ctypes.rst:1483 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:1487 +#: ../../library/ctypes.rst:1490 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:1494 +#: ../../library/ctypes.rst:1497 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:1497 +#: ../../library/ctypes.rst:1500 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 " @@ -1449,96 +1457,97 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1510 +#: ../../library/ctypes.rst:1513 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1516 +#: ../../library/ctypes.rst:1519 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1521 +#: ../../library/ctypes.rst:1524 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1523 +#: ../../library/ctypes.rst:1526 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " -"calling the :meth:`LoadLibrary` method, or by retrieving the library as " -"attribute of the loader instance." +"calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the " +"library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1531 +#: ../../library/ctypes.rst:1534 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:1534 +#: ../../library/ctypes.rst:1537 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." +":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:1540 +#: ../../library/ctypes.rst:1543 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:1544 +#: ../../library/ctypes.rst:1547 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1549 +#: ../../library/ctypes.rst:1552 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1555 +#: ../../library/ctypes.rst:1558 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1561 +#: ../../library/ctypes.rst:1564 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1567 +#: ../../library/ctypes.rst:1570 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1573 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1576 +#: ../../library/ctypes.rst:1579 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:expr:" "`int`, which is of course not always the truth, so you have to assign the " -"correct :attr:`restype` attribute to use these functions." +"correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1581 +#: ../../library/ctypes.rst:1584 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1583 +#: ../../library/ctypes.rst:1586 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:1587 +#: ../../library/ctypes.rst:1590 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1547,14 +1556,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1589 +#: ../../library/ctypes.rst:1592 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:1593 +#: ../../library/ctypes.rst:1596 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1563,18 +1572,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1595 +#: ../../library/ctypes.rst:1598 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:1602 +#: ../../library/ctypes.rst:1605 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1604 +#: ../../library/ctypes.rst:1607 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1583,39 +1592,39 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1613 +#: ../../library/ctypes.rst:1616 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1615 +#: ../../library/ctypes.rst:1618 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1621 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1623 +#: ../../library/ctypes.rst:1626 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1629 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:expr:`int`, and the " "callable will be called with this integer, allowing further processing or " "error checking. Using this is deprecated, for more flexible post processing " -"or error checking use a ctypes data type as :attr:`restype` and assign a " +"or error checking use a ctypes data type as :attr:`!restype` and assign a " "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1635 +#: ../../library/ctypes.rst:1638 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1624,62 +1633,62 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1641 +#: ../../library/ctypes.rst:1644 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, " -"this method allows adapting the actual argument to an object that the " +"meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " +"tuple, this method allows adapting the actual argument to an object that the " "foreign function accepts. For example, a :class:`c_char_p` item in the :" "attr:`argtypes` tuple will convert a string passed as argument into a bytes " "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1648 +#: ../../library/ctypes.rst:1651 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 " -"usable as argument (integer, string, ctypes instance). This allows defining " -"adapters that can adapt custom objects as function parameters." +"but each item must have a :meth:`~_CData.from_param` method which returns a " +"value usable as argument (integer, string, ctypes instance). This allows " +"defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1655 +#: ../../library/ctypes.rst:1658 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:1662 +#: ../../library/ctypes.rst:1665 msgid "" -"*result* is what the foreign function returns, as specified by the :attr:" -"`restype` attribute." +"*result* is what the foreign function returns, as specified by the :attr:`!" +"restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1668 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:1669 +#: ../../library/ctypes.rst:1672 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:1673 +#: ../../library/ctypes.rst:1676 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:1680 +#: ../../library/ctypes.rst:1683 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1684 +#: ../../library/ctypes.rst:1687 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1688,7 +1697,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1686 +#: ../../library/ctypes.rst:1689 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 " @@ -1697,7 +1706,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1692 +#: ../../library/ctypes.rst:1695 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1706,18 +1715,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1697 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:1700 +#: ../../library/ctypes.rst:1703 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1702 +#: ../../library/ctypes.rst:1705 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1728,7 +1737,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1713 +#: ../../library/ctypes.rst:1716 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1737,37 +1746,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1723 +#: ../../library/ctypes.rst:1726 msgid "" "Windows only: The returned function prototype creates functions that use the " "``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:1731 +#: ../../library/ctypes.rst:1734 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:1734 +#: ../../library/ctypes.rst:1737 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:1742 +#: ../../library/ctypes.rst:1745 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1749 +#: ../../library/ctypes.rst:1752 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1756 +#: ../../library/ctypes.rst:1759 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 " @@ -1775,7 +1784,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1766 +#: ../../library/ctypes.rst:1769 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* " @@ -1783,85 +1792,87 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1771 +#: ../../library/ctypes.rst:1774 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." +"specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1775 +#: ../../library/ctypes.rst:1778 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1778 -msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." +#: ../../library/ctypes.rst:1781 +msgid "" +"*paramflags* must be a tuple of the same length as :attr:`~_FuncPtr." +"argtypes`." msgstr "" -#: ../../library/ctypes.rst:1780 +#: ../../library/ctypes.rst:1783 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:1783 +#: ../../library/ctypes.rst:1786 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1787 +#: ../../library/ctypes.rst:1790 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1787 +#: ../../library/ctypes.rst:1790 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1793 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1793 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1796 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1796 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1795 +#: ../../library/ctypes.rst:1798 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:1798 +#: ../../library/ctypes.rst:1801 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1800 +#: ../../library/ctypes.rst:1803 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:1811 ../../library/ctypes.rst:1834 +#: ../../library/ctypes.rst:1814 ../../library/ctypes.rst:1837 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1819 +#: ../../library/ctypes.rst:1822 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1825 +#: ../../library/ctypes.rst:1828 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1869,7 +1880,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1846 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1877,35 +1888,35 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1848 +#: ../../library/ctypes.rst:1851 msgid "" -"Output parameters can be combined with the :attr:`errcheck` protocol to do " -"further output processing and error checking. The win32 ``GetWindowRect`` " -"api function returns a ``BOOL`` to signal success or failure, so this " -"function could do the error checking, and raises an exception when the api " -"call failed::" +"Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " +"protocol to do further output processing and error checking. The win32 " +"``GetWindowRect`` api function returns a ``BOOL`` to signal success or " +"failure, so this function could do the error checking, and raises an " +"exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1861 +#: ../../library/ctypes.rst:1864 msgid "" -"If the :attr:`errcheck` function returns the argument tuple it receives " -"unchanged, :mod:`ctypes` continues the normal processing it does on the " -"output parameters. If you want to return a tuple of window coordinates " +"If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " +"receives unchanged, :mod:`ctypes` continues the normal processing it does on " +"the output parameters. If you want to return a tuple of window coordinates " "instead of a ``RECT`` instance, you can retrieve the fields in the function " "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1880 +#: ../../library/ctypes.rst:1883 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1887 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1890 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1913,30 +1924,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1892 +#: ../../library/ctypes.rst:1895 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1901 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:1902 +#: ../../library/ctypes.rst:1905 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1909 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:1912 +#: ../../library/ctypes.rst:1915 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* " @@ -1944,19 +1955,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1923 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1926 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:1926 +#: ../../library/ctypes.rst:1929 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 " @@ -1965,7 +1976,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1931 +#: ../../library/ctypes.rst:1934 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1973,19 +1984,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1936 +#: ../../library/ctypes.rst:1939 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1942 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:1942 +#: ../../library/ctypes.rst:1945 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 " @@ -1994,7 +2005,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1948 +#: ../../library/ctypes.rst:1951 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2002,21 +2013,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1953 +#: ../../library/ctypes.rst:1956 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:1960 +#: ../../library/ctypes.rst:1963 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:1968 +#: ../../library/ctypes.rst:1971 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 " @@ -2024,94 +2035,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1979 +#: ../../library/ctypes.rst:1982 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:1983 +#: ../../library/ctypes.rst:1986 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:1990 +#: ../../library/ctypes.rst:1993 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:1997 +#: ../../library/ctypes.rst:2000 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:2003 +#: ../../library/ctypes.rst:2006 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:2009 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2010 +#: ../../library/ctypes.rst:2013 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " -"system :data:`LastError` variable in the calling thread." +"system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2013 +#: ../../library/ctypes.rst:2016 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2020 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:2024 +#: ../../library/ctypes.rst:2027 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:2031 +#: ../../library/ctypes.rst:2034 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." +"Create and return 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:2038 +#: ../../library/ctypes.rst:2041 msgid "" -"This function creates a new pointer instance, pointing to *obj*. The " -"returned object is of the type ``POINTER(type(obj))``." +"Create a new pointer instance, pointing to *obj*. The returned object is of " +"the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2041 +#: ../../library/ctypes.rst:2044 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:2047 +#: ../../library/ctypes.rst:2050 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 " @@ -2119,13 +2130,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2058 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:2058 +#: ../../library/ctypes.rst:2061 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2133,14 +2144,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2063 +#: ../../library/ctypes.rst:2066 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 " +"system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2070 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2148,20 +2159,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2075 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:2078 +#: ../../library/ctypes.rst:2081 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:2082 +#: ../../library/ctypes.rst:2085 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2169,7 +2180,7 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2087 +#: ../../library/ctypes.rst:2090 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2178,11 +2189,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2093 +#: ../../library/ctypes.rst:2096 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2099 +#: ../../library/ctypes.rst:2102 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 " @@ -2190,7 +2201,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:2107 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2198,11 +2209,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2110 +#: ../../library/ctypes.rst:2113 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2115 +#: ../../library/ctypes.rst:2118 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 " @@ -2212,13 +2223,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2122 +#: ../../library/ctypes.rst:2125 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:2127 +#: ../../library/ctypes.rst:2130 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2227,7 +2238,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2133 ../../library/ctypes.rst:2143 +#: ../../library/ctypes.rst:2136 ../../library/ctypes.rst:2146 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2235,7 +2246,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2137 +#: ../../library/ctypes.rst:2140 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2243,13 +2254,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2147 +#: ../../library/ctypes.rst:2150 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2153 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2257,39 +2268,39 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2155 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2158 +#: ../../library/ctypes.rst:2161 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 " -"foreign function's :attr:`argtypes` tuple; it must return an object that can " -"be used as a function call parameter." +"foreign function's :attr:`~_FuncPtr.argtypes` tuple; it must return an " +"object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2163 +#: ../../library/ctypes.rst:2166 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:2169 +#: ../../library/ctypes.rst:2172 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:2173 +#: ../../library/ctypes.rst:2176 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2177 +#: ../../library/ctypes.rst:2180 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:" @@ -2297,13 +2308,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2184 +#: ../../library/ctypes.rst:2187 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2192 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. " @@ -2311,7 +2322,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2202 +#: ../../library/ctypes.rst:2205 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 " @@ -2320,11 +2331,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2208 +#: ../../library/ctypes.rst:2211 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2212 +#: ../../library/ctypes.rst:2215 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 " @@ -2332,7 +2343,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2220 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2340,42 +2351,43 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2226 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " "transparently converted to native Python types. In other words, if a " -"foreign function has a :attr:`restype` of :class:`c_char_p`, you will always " -"receive a Python bytes object, *not* a :class:`c_char_p` instance." +"foreign function has a :attr:`~_FuncPtr.restype` of :class:`c_char_p`, you " +"will always receive a Python bytes object, *not* a :class:`c_char_p` " +"instance." msgstr "" -#: ../../library/ctypes.rst:2231 +#: ../../library/ctypes.rst:2234 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 " +"a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " "will receive an instance of this subclass from the function call. Of course, " "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2236 +#: ../../library/ctypes.rst:2239 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2240 +#: ../../library/ctypes.rst:2243 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2247 +#: ../../library/ctypes.rst:2250 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2254 +#: ../../library/ctypes.rst:2257 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2383,224 +2395,224 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2262 +#: ../../library/ctypes.rst:2265 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2268 +#: ../../library/ctypes.rst:2271 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2274 +#: ../../library/ctypes.rst:2277 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2280 +#: ../../library/ctypes.rst:2283 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2287 +#: ../../library/ctypes.rst:2290 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2293 +#: ../../library/ctypes.rst:2296 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2299 +#: ../../library/ctypes.rst:2302 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2305 +#: ../../library/ctypes.rst:2308 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2311 +#: ../../library/ctypes.rst:2314 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2317 +#: ../../library/ctypes.rst:2320 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2323 +#: ../../library/ctypes.rst:2326 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2329 +#: ../../library/ctypes.rst:2332 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2334 +#: ../../library/ctypes.rst:2337 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2341 +#: ../../library/ctypes.rst:2344 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2348 +#: ../../library/ctypes.rst:2351 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2355 +#: ../../library/ctypes.rst:2358 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2362 +#: ../../library/ctypes.rst:2365 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2368 +#: ../../library/ctypes.rst:2371 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2374 +#: ../../library/ctypes.rst:2377 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2380 +#: ../../library/ctypes.rst:2383 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2386 +#: ../../library/ctypes.rst:2389 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2392 +#: ../../library/ctypes.rst:2395 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2398 +#: ../../library/ctypes.rst:2401 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2404 +#: ../../library/ctypes.rst:2407 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2410 +#: ../../library/ctypes.rst:2413 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:2417 +#: ../../library/ctypes.rst:2420 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2424 +#: ../../library/ctypes.rst:2427 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2431 +#: ../../library/ctypes.rst:2434 msgid "" -"Windows only: Represents a :c:type:`HRESULT` value, which contains success " +"Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2437 +#: ../../library/ctypes.rst:2440 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2443 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:" -"`DWORD`. Some useful structures like :c:type:`MSG` or :c:type:`RECT` are " -"also defined." +"The :mod:`!ctypes.wintypes` module provides quite some other Windows " +"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" +"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` " +"are also defined." msgstr "" -#: ../../library/ctypes.rst:2448 +#: ../../library/ctypes.rst:2451 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2453 +#: ../../library/ctypes.rst:2456 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2458 +#: ../../library/ctypes.rst:2461 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2464 +#: ../../library/ctypes.rst:2467 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2470 +#: ../../library/ctypes.rst:2473 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2475 +#: ../../library/ctypes.rst:2478 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2477 +#: ../../library/ctypes.rst:2480 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2483 +#: ../../library/ctypes.rst:2486 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2485 +#: ../../library/ctypes.rst:2488 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:" @@ -2608,34 +2620,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2493 +#: ../../library/ctypes.rst:2496 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:2497 +#: ../../library/ctypes.rst:2500 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:2501 +#: ../../library/ctypes.rst:2504 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:2504 +#: ../../library/ctypes.rst:2507 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:2514 +#: ../../library/ctypes.rst:2517 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, " @@ -2643,14 +2655,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2522 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:2526 +#: ../../library/ctypes.rst:2529 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2658,14 +2670,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2534 +#: ../../library/ctypes.rst:2537 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:2538 +#: ../../library/ctypes.rst:2541 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 " @@ -2673,11 +2685,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2546 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2556 +#: ../../library/ctypes.rst:2559 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 " @@ -2687,7 +2699,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2568 +#: ../../library/ctypes.rst:2571 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:" @@ -2695,7 +2707,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2573 +#: ../../library/ctypes.rst:2576 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2705,15 +2717,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2584 +#: ../../library/ctypes.rst:2587 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2588 +#: ../../library/ctypes.rst:2591 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2590 +#: ../../library/ctypes.rst:2593 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 " @@ -2723,34 +2735,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2600 +#: ../../library/ctypes.rst:2603 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:2607 +#: ../../library/ctypes.rst:2610 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2610 +#: ../../library/ctypes.rst:2613 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2616 +#: ../../library/ctypes.rst:2619 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2618 +#: ../../library/ctypes.rst:2621 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:2622 +#: ../../library/ctypes.rst:2625 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 :" @@ -2759,11 +2771,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2632 +#: ../../library/ctypes.rst:2635 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2636 +#: ../../library/ctypes.rst:2639 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/datetime.po b/library/datetime.po index 3f4ecc4e75..ae93d210f7 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -2966,7 +2966,7 @@ msgstr "\\(8), \\(9)" #: ../../library/datetime.rst:2459 ../../library/datetime.rst:2580 msgid "``%:z``" -msgstr "" +msgstr "``%:z``" #: ../../library/datetime.rst:2459 msgid "" diff --git a/library/dis.po b/library/dis.po index 73254c868c..a3c151150f 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-31 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -556,9 +556,9 @@ msgstr "" #: ../../library/dis.rst:546 ../../library/dis.rst:554 #: ../../library/dis.rst:566 ../../library/dis.rst:654 #: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:893 ../../library/dis.rst:903 -#: ../../library/dis.rst:1002 ../../library/dis.rst:1014 -#: ../../library/dis.rst:1026 +#: ../../library/dis.rst:894 ../../library/dis.rst:904 +#: ../../library/dis.rst:1003 ../../library/dis.rst:1015 +#: ../../library/dis.rst:1027 msgid "Implements::" msgstr "" @@ -797,7 +797,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1464 +#: ../../library/dis.rst:846 ../../library/dis.rst:1465 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -819,10 +819,10 @@ msgstr "" #: ../../library/dis.rst:866 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " -"stack right-to-left::" +"stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:874 +#: ../../library/dis.rst:875 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -830,11 +830,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:879 +#: ../../library/dis.rst:880 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:881 +#: ../../library/dis.rst:882 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -843,46 +843,46 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:887 +#: ../../library/dis.rst:888 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:899 +#: ../../library/dis.rst:900 msgid "where *namei* is the index of name in :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:908 +#: ../../library/dis.rst:909 msgid "where *namei* is the index of name into :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:913 +#: ../../library/dis.rst:914 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:918 +#: ../../library/dis.rst:919 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:923 +#: ../../library/dis.rst:924 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:928 +#: ../../library/dis.rst:929 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:934 +#: ../../library/dis.rst:935 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:943 +#: ../../library/dis.rst:944 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -891,69 +891,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:954 +#: ../../library/dis.rst:955 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:964 +#: ../../library/dis.rst:965 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:969 +#: ../../library/dis.rst:970 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:974 +#: ../../library/dis.rst:975 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:978 +#: ../../library/dis.rst:979 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:985 +#: ../../library/dis.rst:986 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:994 +#: ../../library/dis.rst:995 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1007 +#: ../../library/dis.rst:1008 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1020 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1031 +#: ../../library/dis.rst:1032 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1038 +#: ../../library/dis.rst:1039 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1045 +#: ../../library/dis.rst:1046 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1049 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -964,13 +964,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1057 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1064 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -980,33 +980,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1071 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1074 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1082 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1087 +#: ../../library/dis.rst:1088 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1094 +#: ../../library/dis.rst:1095 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1101 +#: ../../library/dis.rst:1102 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1015,68 +1015,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1109 +#: ../../library/dis.rst:1110 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1116 +#: ../../library/dis.rst:1117 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1121 +#: ../../library/dis.rst:1122 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1128 +#: ../../library/dis.rst:1129 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1135 +#: ../../library/dis.rst:1136 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1138 ../../library/dis.rst:1151 +#: ../../library/dis.rst:1139 ../../library/dis.rst:1152 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1143 ../../library/dis.rst:1156 -#: ../../library/dis.rst:1169 ../../library/dis.rst:1183 +#: ../../library/dis.rst:1144 ../../library/dis.rst:1157 +#: ../../library/dis.rst:1170 ../../library/dis.rst:1184 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1148 +#: ../../library/dis.rst:1149 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:1162 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1164 ../../library/dis.rst:1178 +#: ../../library/dis.rst:1165 ../../library/dis.rst:1179 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1175 +#: ../../library/dis.rst:1176 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1188 +#: ../../library/dis.rst:1189 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1084,83 +1084,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1193 +#: ../../library/dis.rst:1194 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1198 +#: ../../library/dis.rst:1199 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1201 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1206 +#: ../../library/dis.rst:1207 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1208 +#: ../../library/dis.rst:1209 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1214 +#: ../../library/dis.rst:1215 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1222 +#: ../../library/dis.rst:1223 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1230 +#: ../../library/dis.rst:1231 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1235 +#: ../../library/dis.rst:1236 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1240 +#: ../../library/dis.rst:1241 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1248 +#: ../../library/dis.rst:1249 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1251 +#: ../../library/dis.rst:1252 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1254 ../../library/dis.rst:1263 -#: ../../library/dis.rst:1285 ../../library/dis.rst:1296 +#: ../../library/dis.rst:1255 ../../library/dis.rst:1264 +#: ../../library/dis.rst:1286 ../../library/dis.rst:1297 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1261 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1269 +#: ../../library/dis.rst:1270 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1170,94 +1170,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1282 +#: ../../library/dis.rst:1283 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1291 +#: ../../library/dis.rst:1292 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1303 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1311 +#: ../../library/dis.rst:1312 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1315 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1316 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1317 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1322 +#: ../../library/dis.rst:1323 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1328 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1328 ../../library/dis.rst:1334 +#: ../../library/dis.rst:1329 ../../library/dis.rst:1335 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:1330 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1330 ../../library/dis.rst:1337 +#: ../../library/dis.rst:1331 ../../library/dis.rst:1338 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1333 msgid "or:" -msgstr "" +msgstr "或:" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1336 msgid "``self``" -msgstr "" +msgstr "``self``" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1337 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1340 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1343 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1351 +#: ../../library/dis.rst:1352 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1269,70 +1269,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1366 +#: ../../library/dis.rst:1367 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1375 +#: ../../library/dis.rst:1376 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1384 +#: ../../library/dis.rst:1385 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1388 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1389 +#: ../../library/dis.rst:1390 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1391 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1392 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1393 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1395 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1398 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1405 +#: ../../library/dis.rst:1406 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1411 +#: ../../library/dis.rst:1412 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1418 +#: ../../library/dis.rst:1419 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1423 +#: ../../library/dis.rst:1424 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1340,54 +1340,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1431 +#: ../../library/dis.rst:1432 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1435 +#: ../../library/dis.rst:1436 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1437 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1439 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1440 +#: ../../library/dis.rst:1441 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1442 +#: ../../library/dis.rst:1443 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1446 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1453 +#: ../../library/dis.rst:1454 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1457 +#: ../../library/dis.rst:1458 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1395,258 +1395,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1471 +#: ../../library/dis.rst:1472 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1473 +#: ../../library/dis.rst:1474 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1475 +#: ../../library/dis.rst:1476 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1477 +#: ../../library/dis.rst:1478 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1479 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1480 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1486 +#: ../../library/dis.rst:1487 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1495 +#: ../../library/dis.rst:1496 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1499 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1507 +#: ../../library/dis.rst:1508 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1511 +#: ../../library/dis.rst:1512 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1515 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1518 +#: ../../library/dis.rst:1519 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1526 +#: ../../library/dis.rst:1527 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1530 ../../library/dis.rst:1580 +#: ../../library/dis.rst:1531 ../../library/dis.rst:1581 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 msgid "Description" msgstr "" -#: ../../library/dis.rst:1535 +#: ../../library/dis.rst:1536 msgid "``INTRINSIC_1_INVALID``" -msgstr "" +msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1535 ../../library/dis.rst:1585 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1537 +#: ../../library/dis.rst:1538 msgid "``INTRINSIC_PRINT``" -msgstr "" +msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1537 +#: ../../library/dis.rst:1538 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1541 msgid "``INTRINSIC_IMPORT_STAR``" -msgstr "" +msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1541 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 msgid "``INTRINSIC_STOPITERATION_ERROR``" -msgstr "" +msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1547 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" -msgstr "" +msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1547 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1548 +#: ../../library/dis.rst:1549 msgid "``INTRINSIC_UNARY_POSITIVE``" -msgstr "" +msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1548 +#: ../../library/dis.rst:1549 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1552 msgid "``INTRINSIC_LIST_TO_TUPLE``" -msgstr "" +msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1552 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1553 +#: ../../library/dis.rst:1554 msgid "``INTRINSIC_TYPEVAR``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1553 +#: ../../library/dis.rst:1554 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1556 msgid "``INTRINSIC_PARAMSPEC``" -msgstr "" +msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1556 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1559 msgid "``INTRINSIC_TYPEVARTUPLE``" -msgstr "" +msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1559 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1562 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" -msgstr "" +msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1562 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1565 msgid "``INTRINSIC_TYPEALIAS``" -msgstr "" +msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1565 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1577 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1585 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_2_INVALID``" -msgstr "" +msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_PREP_RERAISE_STAR``" -msgstr "" +msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -msgstr "" +msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1605 +#: ../../library/dis.rst:1606 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1607 +#: ../../library/dis.rst:1608 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1613 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1620 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1655,75 +1655,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1628 +#: ../../library/dis.rst:1629 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1633 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1640 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1645 +#: ../../library/dis.rst:1646 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1650 +#: ../../library/dis.rst:1651 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1658 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1659 +#: ../../library/dis.rst:1660 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1663 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1668 +#: ../../library/dis.rst:1669 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1673 +#: ../../library/dis.rst:1674 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1678 +#: ../../library/dis.rst:1679 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1683 +#: ../../library/dis.rst:1684 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1690 +#: ../../library/dis.rst:1691 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1695 +#: ../../library/dis.rst:1696 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1731,34 +1731,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1704 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1709 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1713 +#: ../../library/dis.rst:1714 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1718 +#: ../../library/dis.rst:1719 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1723 +#: ../../library/dis.rst:1724 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1727 +#: ../../library/dis.rst:1728 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1404 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1404 msgid "slice" msgstr "slice(切片)" diff --git a/library/enum.po b/library/enum.po index e045611996..3c8abf841a 100644 --- a/library/enum.po +++ b/library/enum.po @@ -531,7 +531,7 @@ msgstr "" #: ../../library/enum.rst:399 msgid "Added :ref:`enum-dataclass-support`" -msgstr "" +msgstr "新增 :ref:`enum-dataclass-support`" #: ../../library/enum.rst:404 msgid "" diff --git a/library/functions.po b/library/functions.po index 855f6a80f4..e26b4be9d6 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-07 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,14 +48,14 @@ msgstr ":func:`aiter`" msgid ":func:`all`" msgstr ":func:`all`" -#: ../../library/functions.rst:0 -msgid ":func:`any`" -msgstr ":func:`any`" - #: ../../library/functions.rst:0 msgid ":func:`anext`" msgstr ":func:`anext`" +#: ../../library/functions.rst:0 +msgid ":func:`any`" +msgstr ":func:`any`" + #: ../../library/functions.rst:0 msgid ":func:`ascii`" msgstr ":func:`ascii`" diff --git a/library/functools.po b/library/functools.po index 83a9ae983a..3286029405 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 15:45+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-" @@ -53,7 +53,7 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:290 +#: ../../library/functools.rst:39 ../../library/functools.rst:291 msgid "For example::" msgstr "" "舉例來說:\n" @@ -83,7 +83,7 @@ msgid "" msgstr "" #: ../../library/functools.rst:70 ../../library/functools.rst:142 -#: ../../library/functools.rst:382 +#: ../../library/functools.rst:383 msgid "Example::" msgstr "" "範例:\n" @@ -288,47 +288,48 @@ msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " "functions with side-effects, functions that need to create distinct mutable " -"objects on each call, or impure functions such as time() or random()." +"objects on each call (such as generators and async functions), or impure " +"functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:232 +#: ../../library/functools.rst:233 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:251 +#: ../../library/functools.rst:252 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:271 +#: ../../library/functools.rst:272 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:274 +#: ../../library/functools.rst:275 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:277 +#: ../../library/functools.rst:278 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:282 +#: ../../library/functools.rst:283 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:286 +#: ../../library/functools.rst:287 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:310 +#: ../../library/functools.rst:311 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -337,7 +338,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:319 +#: ../../library/functools.rst:320 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -345,13 +346,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:326 +#: ../../library/functools.rst:327 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:332 +#: ../../library/functools.rst:333 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -360,7 +361,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:348 +#: ../../library/functools.rst:349 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -369,20 +370,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:363 +#: ../../library/functools.rst:364 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:367 +#: ../../library/functools.rst:368 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:370 +#: ../../library/functools.rst:371 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -391,7 +392,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:376 +#: ../../library/functools.rst:377 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -400,7 +401,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:407 +#: ../../library/functools.rst:408 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -413,30 +414,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:416 +#: ../../library/functools.rst:417 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:428 +#: ../../library/functools.rst:429 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:433 +#: ../../library/functools.rst:434 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:436 +#: ../../library/functools.rst:437 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:447 +#: ../../library/functools.rst:448 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -444,36 +445,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:465 +#: ../../library/functools.rst:466 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:482 +#: ../../library/functools.rst:483 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:493 +#: ../../library/functools.rst:494 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:501 +#: ../../library/functools.rst:502 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:515 +#: ../../library/functools.rst:516 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:535 +#: ../../library/functools.rst:536 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -482,42 +483,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:541 +#: ../../library/functools.rst:542 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:556 +#: ../../library/functools.rst:557 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:564 +#: ../../library/functools.rst:565 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:578 +#: ../../library/functools.rst:579 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:582 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:588 +#: ../../library/functools.rst:589 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:591 +#: ../../library/functools.rst:592 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -525,7 +526,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:609 +#: ../../library/functools.rst:610 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -534,14 +535,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:631 +#: ../../library/functools.rst:632 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:640 +#: ../../library/functools.rst:641 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -555,7 +556,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:650 +#: ../../library/functools.rst:651 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -563,7 +564,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:655 +#: ../../library/functools.rst:656 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -572,7 +573,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:661 +#: ../../library/functools.rst:662 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -581,26 +582,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:667 +#: ../../library/functools.rst:668 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:670 +#: ../../library/functools.rst:671 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:673 +#: ../../library/functools.rst:674 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:676 +#: ../../library/functools.rst:677 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:684 +#: ../../library/functools.rst:685 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -608,42 +609,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:710 +#: ../../library/functools.rst:711 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:718 +#: ../../library/functools.rst:719 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:720 +#: ../../library/functools.rst:721 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:726 +#: ../../library/functools.rst:727 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:732 +#: ../../library/functools.rst:733 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:738 +#: ../../library/functools.rst:739 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:741 +#: ../../library/functools.rst:742 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/gzip.po b/library/gzip.po index 21cfdbb063..703b7bda25 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -103,7 +103,7 @@ msgstr "" #: ../../library/gzip.rst:56 msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." -msgstr "" +msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" #: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." @@ -247,7 +247,7 @@ msgstr "" #: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." -msgstr "" +msgstr "新增 ``'x'`` 和 ``'xb'`` 模式的支援。" #: ../../library/gzip.rst:165 msgid "" diff --git a/library/io.po b/library/io.po index 738c69063a..c203f3ad5a 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 18:13+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,14 +60,14 @@ msgstr "" #: ../../library/io.rst:40 msgid "" "All streams are careful about the type of data you give to them. For " -"example giving a :class:`str` object to the ``write()`` method of a binary " -"stream will raise a :exc:`TypeError`. So will giving a :class:`bytes` " -"object to the ``write()`` method of a text stream." +"example giving a :class:`str` object to the :meth:`!write` method of a " +"binary stream will raise a :exc:`TypeError`. So will giving a :class:" +"`bytes` object to the :meth:`!write` method of a text stream." msgstr "" "所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" -"`str` 物件給二進位資料串流的 ``write()`` 方法將會引發 :exc:`TypeError`。同樣" -"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發" -"同樣的錯誤。" +"`str` 物件給二進位資料串流的 :meth:`!write` 方法將會引發 :exc:`TypeError`。同" +"樣地,若提供一個 :class:`bytes` 物件給文字資料串流的 :meth:`!write` 方法,也" +"會引發同樣的錯誤。" #: ../../library/io.rst:45 msgid "" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122 +#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1123 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1110 +#: ../../library/io.rst:72 ../../library/io.rst:1111 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -249,14 +249,15 @@ msgstr "更多資訊請見 :pep:`597`\\ 。" #: ../../library/io.rst:148 msgid "" -"To find where the default locale encoding is used, you can enable the ``-X " -"warn_default_encoding`` command line option or set the :envvar:" -"`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :exc:" -"`EncodingWarning` when the default encoding is used." +"To find where the default locale encoding is used, you can enable the :" +"option:`-X warn_default_encoding <-X>` command line option or set the :" +"envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :" +"exc:`EncodingWarning` when the default encoding is used." msgstr "" -"要找出哪些地方使用到預設的地區編碼,你可以啟用 ``-X warn_default_encoding`` " -"命令列選項,或者設定環境變數 :envvar:`PYTHONWARNDEFAULTENCODING`。當使用到預" -"設編碼時,會引發 :exc:`EncodingWarning`。" +"要找出哪些地方使用到預設的地區編碼,你可以啟用 :option:`-X " +"warn_default_encoding <-X>` 命令列選項,或者設定環境變數 :envvar:" +"`PYTHONWARNDEFAULTENCODING`。當使用到預設編碼時,會引發 :exc:" +"`EncodingWarning`。" #: ../../library/io.rst:153 msgid "" @@ -300,12 +301,12 @@ msgstr "" #: ../../library/io.rst:177 msgid "" "This function raises an :ref:`auditing event ` ``open`` with " -"arguments ``path``, ``mode`` and ``flags``. The ``mode`` and ``flags`` " -"arguments may have been modified or inferred from the original call." +"arguments *path*, *mode* and *flags*. The *mode* and *flags* arguments may " +"have been modified or inferred from the original call." msgstr "" -"此函式會引發一個帶有引數 ``path``、``mode`` 以及 ``flags`` 的\\ :ref:`稽核事件 " -"(auditing event) ` ``open``。``mode`` 與 ``flags`` 引數可能已經被修" -"改或者從原始呼叫中被推斷出來。" +"此函式會引發一個帶有引數 *path*、*mode* 以及 *flags* 的\\ :ref:`稽核事件 " +"(auditing event) ` ``open``。*mode* 與 *flags* 引數可能已經被修改或" +"者從原始呼叫中被推斷出來。" #: ../../library/io.rst:184 msgid "" @@ -316,13 +317,13 @@ msgstr "" "況下。" #: ../../library/io.rst:187 -msgid "``path`` should be a :class:`str` and an absolute path." -msgstr "``path`` 應該要屬於 :class:`str` 類別,且是個絕對路徑。" +msgid "*path* should be a :class:`str` and an absolute path." +msgstr "*path* 應該要屬於 :class:`str` 類別,且是個絕對路徑。" #: ../../library/io.rst:189 msgid "" "The behavior of this function may be overridden by an earlier call to the :c:" -"func:`PyFile_SetOpenCodeHook`. However, assuming that ``path`` is a :class:" +"func:`PyFile_SetOpenCodeHook`. However, assuming that *path* is a :class:" "`str` and an absolute path, ``open_code(path)`` should always behave the " "same as ``open(path, 'rb')``. Overriding the behavior is intended for " "additional validation or preprocessing of the file." @@ -393,8 +394,8 @@ msgid "" "contains the standard IO streams: :data:`sys.stdin`, :data:`sys.stdout`, " "and :data:`sys.stderr`." msgstr "" -"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:`sys." -"stderr`。" +"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:" +"`sys.stderr`。" #: ../../library/io.rst:249 msgid "Class hierarchy" @@ -413,7 +414,7 @@ msgid "" "The abstract base classes also provide default implementations of some " "methods in order to help implementation of concrete stream classes. For " "example, :class:`BufferedIOBase` provides unoptimized implementations of :" -"meth:`~IOBase.readinto` and :meth:`~IOBase.readline`." +"meth:`!readinto` and :meth:`!readline`." msgstr "" #: ../../library/io.rst:263 @@ -549,7 +550,7 @@ msgstr "" #: ../../library/io.rst:323 msgid "" -"Even though :class:`IOBase` does not declare :meth:`read` or :meth:`write` " +"Even though :class:`IOBase` does not declare :meth:`!read` or :meth:`!write` " "because their signatures will vary, implementations and clients should " "consider those methods part of the interface. Also, implementations may " "raise a :exc:`ValueError` (or :exc:`UnsupportedOperation`) when operations " @@ -627,7 +628,7 @@ msgstr "" #: ../../library/io.rst:382 msgid "" -"Return ``True`` if the stream can be read from. If ``False``, :meth:`read` " +"Return ``True`` if the stream can be read from. If ``False``, :meth:`!read` " "will raise :exc:`OSError`." msgstr "" @@ -659,39 +660,39 @@ msgstr "" #: ../../library/io.rst:403 msgid "" "Note that it's already possible to iterate on file objects using ``for line " -"in file: ...`` without calling ``file.readlines()``." +"in file: ...`` without calling :meth:`!file.readlines`." msgstr "" #: ../../library/io.rst:408 msgid "" "Change the stream position to the given byte *offset*. *offset* is " "interpreted relative to the position indicated by *whence*. The default " -"value for *whence* is :data:`SEEK_SET`. Values for *whence* are:" +"value for *whence* is :data:`!SEEK_SET`. Values for *whence* are:" msgstr "" #: ../../library/io.rst:412 msgid "" -":data:`SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " +":data:`!SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" #: ../../library/io.rst:414 msgid "" -":data:`SEEK_CUR` or ``1`` -- current stream position; *offset* may be " +":data:`!SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" #: ../../library/io.rst:416 msgid "" -":data:`SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" +":data:`!SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" msgstr "" #: ../../library/io.rst:419 msgid "Return the new absolute position." msgstr "" -#: ../../library/io.rst:421 ../../library/io.rst:930 -msgid "The ``SEEK_*`` constants." +#: ../../library/io.rst:421 ../../library/io.rst:931 +msgid "The :data:`!SEEK_*` constants." msgstr "" #: ../../library/io.rst:424 @@ -726,8 +727,8 @@ msgstr "" #: ../../library/io.rst:452 msgid "" -"Return ``True`` if the stream supports writing. If ``False``, :meth:`write` " -"and :meth:`truncate` will raise :exc:`OSError`." +"Return ``True`` if the stream supports writing. If ``False``, :meth:`!" +"write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" #: ../../library/io.rst:457 @@ -990,11 +991,12 @@ msgstr "" #: ../../library/io.rst:657 msgid "" -"The :meth:`read` (when called with a positive argument), :meth:`readinto` " -"and :meth:`write` methods on this class will only make one system call." +"The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" +"`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " +"will only make one system call." msgstr "" -#: ../../library/io.rst:660 +#: ../../library/io.rst:661 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 " @@ -1003,371 +1005,372 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:666 +#: ../../library/io.rst:667 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:668 +#: ../../library/io.rst:669 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:671 +#: ../../library/io.rst:672 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:675 +#: ../../library/io.rst:676 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:678 +#: ../../library/io.rst:679 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:683 +#: ../../library/io.rst:684 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:687 +#: ../../library/io.rst:688 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:692 +#: ../../library/io.rst:693 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:694 +#: ../../library/io.rst:695 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:699 +#: ../../library/io.rst:700 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:703 +#: ../../library/io.rst:704 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:706 +#: ../../library/io.rst:707 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:711 +#: ../../library/io.rst:712 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:722 +#: ../../library/io.rst:723 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:729 +#: ../../library/io.rst:730 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:734 +#: ../../library/io.rst:735 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:736 ../../library/io.rst:779 +#: ../../library/io.rst:737 ../../library/io.rst:780 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:741 +#: ../../library/io.rst:742 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:747 +#: ../../library/io.rst:748 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:751 +#: ../../library/io.rst:752 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:755 +#: ../../library/io.rst:756 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:759 +#: ../../library/io.rst:760 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:764 +#: ../../library/io.rst:765 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:770 +#: ../../library/io.rst:771 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:775 +#: ../../library/io.rst:776 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:785 +#: ../../library/io.rst:786 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:789 +#: ../../library/io.rst:790 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:793 +#: ../../library/io.rst:794 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:794 -msgid "when :meth:`flush()` is called;" +#: ../../library/io.rst:795 +msgid "when :meth:`flush` is called;" msgstr "" -#: ../../library/io.rst:795 +#: ../../library/io.rst:796 msgid "" -"when a :meth:`seek()` is requested (for :class:`BufferedRandom` objects);" +"when a :meth:`~IOBase.seek` is requested (for :class:`BufferedRandom` " +"objects);" msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:797 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:798 +#: ../../library/io.rst:799 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:802 +#: ../../library/io.rst:803 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:807 +#: ../../library/io.rst:808 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:812 +#: ../../library/io.rst:813 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:820 +#: ../../library/io.rst:821 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:824 +#: ../../library/io.rst:825 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:828 +#: ../../library/io.rst:829 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" -"class:`BufferedWriter` can do. In addition, :meth:`seek` and :meth:`tell` " -"are guaranteed to be implemented." +"class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" +"`~IOBase.tell` are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:835 +#: ../../library/io.rst:836 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:839 +#: ../../library/io.rst:840 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:843 +#: ../../library/io.rst:844 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:849 +#: ../../library/io.rst:850 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:859 +#: ../../library/io.rst:860 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:862 +#: ../../library/io.rst:863 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:867 +#: ../../library/io.rst:868 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:872 +#: ../../library/io.rst:873 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:876 +#: ../../library/io.rst:877 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:882 +#: ../../library/io.rst:883 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:888 +#: ../../library/io.rst:889 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:891 +#: ../../library/io.rst:892 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:894 +#: ../../library/io.rst:895 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:902 +#: ../../library/io.rst:903 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:907 +#: ../../library/io.rst:908 msgid "" -"Read until newline or EOF and return a single ``str``. If the stream is " -"already at EOF, an empty string is returned." +"Read until newline or EOF and return a single :class:`str`. If the stream " +"is already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:910 +#: ../../library/io.rst:911 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:914 +#: ../../library/io.rst:915 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " -"*whence* parameter. The default value for *whence* is :data:`SEEK_SET`." +"*whence* parameter. The default value for *whence* is :data:`!SEEK_SET`." msgstr "" -#: ../../library/io.rst:918 +#: ../../library/io.rst:919 msgid "" -":data:`SEEK_SET` or ``0``: seek from the start of the stream (the default); " +":data:`!SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:922 +#: ../../library/io.rst:923 msgid "" -":data:`SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " +":data:`!SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:925 +#: ../../library/io.rst:926 msgid "" -":data:`SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " +":data:`!SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:928 +#: ../../library/io.rst:929 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:935 +#: ../../library/io.rst:936 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:941 +#: ../../library/io.rst:942 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:948 +#: ../../library/io.rst:949 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:952 +#: ../../library/io.rst:953 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getencoding()`. " @@ -1375,7 +1378,7 @@ msgid "" "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: ../../library/io.rst:957 +#: ../../library/io.rst:958 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1390,13 +1393,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:973 +#: ../../library/io.rst:974 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:976 +#: ../../library/io.rst:977 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1408,7 +1411,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:985 +#: ../../library/io.rst:986 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1417,24 +1420,25 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:991 +#: ../../library/io.rst:992 msgid "" -"If *line_buffering* is ``True``, :meth:`flush` is implied when a call to " -"write contains a newline character or a carriage return." +"If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " +"call to write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:994 +#: ../../library/io.rst:995 msgid "" -"If *write_through* is ``True``, calls to :meth:`write` are guaranteed not to " -"be buffered: any data written on the :class:`TextIOWrapper` object is " -"immediately handled to its underlying binary *buffer*." +"If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " +"guaranteed not to be buffered: any data written on the :class:" +"`TextIOWrapper` object is immediately handled to its underlying binary " +"*buffer*." msgstr "" -#: ../../library/io.rst:998 +#: ../../library/io.rst:999 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:1001 +#: ../../library/io.rst:1002 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1442,65 +1446,65 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:1007 +#: ../../library/io.rst:1008 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: ../../library/io.rst:1010 +#: ../../library/io.rst:1011 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1015 +#: ../../library/io.rst:1016 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:1019 +#: ../../library/io.rst:1020 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:1027 +#: ../../library/io.rst:1028 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:1030 +#: ../../library/io.rst:1031 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:1034 +#: ../../library/io.rst:1035 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:1038 +#: ../../library/io.rst:1039 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:1043 +#: ../../library/io.rst:1044 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1050 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1052 +#: ../../library/io.rst:1053 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1055 +#: ../../library/io.rst:1056 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1512,50 +1516,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1064 +#: ../../library/io.rst:1065 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1068 +#: ../../library/io.rst:1069 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1073 +#: ../../library/io.rst:1074 msgid "" -"Return a ``str`` containing the entire contents of the buffer. Newlines are " -"decoded as if by :meth:`~TextIOBase.read`, although the stream position is " -"not changed." +"Return a :class:`str` containing the entire contents of the buffer. Newlines " +"are decoded as if by :meth:`~TextIOBase.read`, although the stream position " +"is not changed." msgstr "" -#: ../../library/io.rst:1077 +#: ../../library/io.rst:1078 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1099 +#: ../../library/io.rst:1100 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1104 +#: ../../library/io.rst:1105 msgid "Performance" msgstr "" -#: ../../library/io.rst:1106 +#: ../../library/io.rst:1107 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1112 +#: ../../library/io.rst:1113 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1568,33 +1572,34 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1124 +#: ../../library/io.rst:1125 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " "unicode and binary data using a character codec. This can become noticeable " "handling huge amounts of text data like large log files. Also, :meth:" -"`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both quite slow due " -"to the reconstruction algorithm used." +"`~TextIOBase.tell` and :meth:`~TextIOBase.seek` are both quite slow due to " +"the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1131 +#: ../../library/io.rst:1132 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1135 +#: ../../library/io.rst:1136 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1137 +#: ../../library/io.rst:1138 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " -"system calls (such as ``read(2)`` under Unix) they wrap are thread-safe too." +"system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" +"safe too." msgstr "" -#: ../../library/io.rst:1140 +#: ../../library/io.rst:1141 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1602,15 +1607,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1145 +#: ../../library/io.rst:1146 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1148 +#: ../../library/io.rst:1149 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1150 +#: ../../library/io.rst:1151 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1621,7 +1626,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1158 +#: ../../library/io.rst:1159 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1637,14 +1642,14 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:970 ../../library/io.rst:1094 +#: ../../library/io.rst:971 ../../library/io.rst:1095 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/io.rst:970 +#: ../../library/io.rst:971 msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1094 +#: ../../library/io.rst:1095 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/logging.po b/library/logging.po index 8f4ec3c021..48729d0e13 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-14 13:46+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-" @@ -204,7 +204,7 @@ msgid "" "level." msgstr "" -#: ../../library/logging.rst:134 ../../library/logging.rst:459 +#: ../../library/logging.rst:134 ../../library/logging.rst:477 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" @@ -278,7 +278,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:201 ../../library/logging.rst:1088 +#: ../../library/logging.rst:201 ../../library/logging.rst:1106 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -290,14 +290,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:210 ../../library/logging.rst:1097 +#: ../../library/logging.rst:210 ../../library/logging.rst:1115 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1105 +#: ../../library/logging.rst:218 ../../library/logging.rst:1123 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -346,7 +346,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:258 ../../library/logging.rst:1136 +#: ../../library/logging.rst:258 ../../library/logging.rst:1154 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -364,7 +364,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:269 ../../library/logging.rst:1147 +#: ../../library/logging.rst:269 ../../library/logging.rst:1165 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -512,35 +512,75 @@ msgstr "" msgid "Numeric value" msgstr "" +#: ../../library/logging.rst:401 +msgid "What it means / When to use it" +msgstr "" + #: ../../library/logging.rst:403 -msgid "50" -msgstr "50" +msgid "0" +msgstr "0" -#: ../../library/logging.rst:405 -msgid "40" -msgstr "40" +#: ../../library/logging.rst:403 +msgid "" +"When set on a logger, indicates that ancestor loggers are to be consulted to " +"determine the effective level. If that still resolves to :const:`!NOTSET`, " +"then all events are logged. When set on a handler, all events are handled." +msgstr "" -#: ../../library/logging.rst:407 -msgid "30" -msgstr "30" +#: ../../library/logging.rst:411 +msgid "10" +msgstr "10" -#: ../../library/logging.rst:409 +#: ../../library/logging.rst:411 +msgid "" +"Detailed information, typically only of interest to a developer trying to " +"diagnose a problem." +msgstr "" + +#: ../../library/logging.rst:415 msgid "20" msgstr "20" -#: ../../library/logging.rst:411 -msgid "10" -msgstr "10" +#: ../../library/logging.rst:415 +msgid "Confirmation that things are working as expected." +msgstr "" -#: ../../library/logging.rst:413 -msgid "0" -msgstr "0" +#: ../../library/logging.rst:418 +msgid "30" +msgstr "30" + +#: ../../library/logging.rst:418 +msgid "" +"An indication that something unexpected happened, or that a problem might " +"occur in the near future (e.g. 'disk space low'). The software is still " +"working as expected." +msgstr "" + +#: ../../library/logging.rst:425 +msgid "40" +msgstr "40" + +#: ../../library/logging.rst:425 +msgid "" +"Due to a more serious problem, the software has not been able to perform " +"some function." +msgstr "" -#: ../../library/logging.rst:420 +#: ../../library/logging.rst:429 +msgid "50" +msgstr "50" + +#: ../../library/logging.rst:429 +msgid "" +"A serious error, indicating that the program itself may be unable to " +"continue running." +msgstr "" + +#: ../../library/logging.rst:438 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:422 +#: ../../library/logging.rst:440 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -548,53 +588,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:431 +#: ../../library/logging.rst:449 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:438 +#: ../../library/logging.rst:456 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:444 +#: ../../library/logging.rst:462 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:449 +#: ../../library/logging.rst:467 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:472 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:461 +#: ../../library/logging.rst:479 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:469 +#: ../../library/logging.rst:487 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:474 +#: ../../library/logging.rst:492 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:479 +#: ../../library/logging.rst:497 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:484 +#: ../../library/logging.rst:502 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -603,13 +643,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:493 +#: ../../library/logging.rst:511 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:499 +#: ../../library/logging.rst:517 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -617,14 +657,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:507 +#: ../../library/logging.rst:525 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:514 +#: ../../library/logging.rst:532 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute " @@ -637,20 +677,20 @@ msgid "" "more useful during development)." msgstr "" -#: ../../library/logging.rst:527 +#: ../../library/logging.rst:545 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:533 +#: ../../library/logging.rst:551 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:537 +#: ../../library/logging.rst:555 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -659,13 +699,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:543 +#: ../../library/logging.rst:561 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:546 +#: ../../library/logging.rst:564 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -675,16 +715,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:553 +#: ../../library/logging.rst:571 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:558 +#: ../../library/logging.rst:576 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:564 +#: ../../library/logging.rst:582 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -694,7 +734,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:567 +#: ../../library/logging.rst:585 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -702,14 +742,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:575 +#: ../../library/logging.rst:593 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:580 +#: ../../library/logging.rst:598 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -720,32 +760,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:590 +#: ../../library/logging.rst:608 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:595 +#: ../../library/logging.rst:613 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:600 +#: ../../library/logging.rst:618 msgid "The *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:603 +#: ../../library/logging.rst:621 msgid "The *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:606 +#: ../../library/logging.rst:624 msgid "The *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:612 +#: ../../library/logging.rst:630 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -764,13 +804,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:628 +#: ../../library/logging.rst:646 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:634 +#: ../../library/logging.rst:652 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -783,7 +823,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:644 +#: ../../library/logging.rst:662 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -793,7 +833,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:652 +#: ../../library/logging.rst:670 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -808,11 +848,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:665 +#: ../../library/logging.rst:683 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:670 +#: ../../library/logging.rst:688 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -820,14 +860,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:677 +#: ../../library/logging.rst:695 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:683 +#: ../../library/logging.rst:701 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -836,7 +876,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:691 +#: ../../library/logging.rst:709 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -844,14 +884,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:698 +#: ../../library/logging.rst:716 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:705 +#: ../../library/logging.rst:723 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -859,11 +899,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:713 +#: ../../library/logging.rst:731 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:715 +#: ../../library/logging.rst:733 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -873,7 +913,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:725 +#: ../../library/logging.rst:743 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -881,7 +921,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:732 +#: ../../library/logging.rst:750 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -889,7 +929,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:737 +#: ../../library/logging.rst:755 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -899,13 +939,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:744 +#: ../../library/logging.rst:762 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:747 +#: ../../library/logging.rst:765 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -916,7 +956,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:757 +#: ../../library/logging.rst:775 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -924,7 +964,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:763 +#: ../../library/logging.rst:781 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -936,11 +976,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:776 +#: ../../library/logging.rst:794 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:778 +#: ../../library/logging.rst:796 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -948,17 +988,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:804 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:788 +#: ../../library/logging.rst:806 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:792 +#: ../../library/logging.rst:810 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -966,7 +1006,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:800 +#: ../../library/logging.rst:818 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -974,46 +1014,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:807 +#: ../../library/logging.rst:825 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:829 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:815 +#: ../../library/logging.rst:833 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:838 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:842 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:829 +#: ../../library/logging.rst:847 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:833 +#: ../../library/logging.rst:851 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:858 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1022,7 +1062,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:865 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1030,24 +1070,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:871 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:883 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:874 +#: ../../library/logging.rst:892 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:894 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1058,7 +1098,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:902 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1066,7 +1106,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:908 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1075,324 +1115,324 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:897 +#: ../../library/logging.rst:915 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:897 ../../library/logging.rst:1305 +#: ../../library/logging.rst:915 ../../library/logging.rst:1323 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:897 ../../library/logging.rst:1305 +#: ../../library/logging.rst:915 ../../library/logging.rst:1323 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:899 +#: ../../library/logging.rst:0 ../../library/logging.rst:917 msgid "args" msgstr "" -#: ../../library/logging.rst:899 ../../library/logging.rst:913 -#: ../../library/logging.rst:941 ../../library/logging.rst:959 +#: ../../library/logging.rst:917 ../../library/logging.rst:931 +#: ../../library/logging.rst:959 ../../library/logging.rst:977 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:917 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "asctime" msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "created" msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:913 +#: ../../library/logging.rst:0 ../../library/logging.rst:931 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:913 +#: ../../library/logging.rst:931 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "filename" msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "funcName" msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "levelname" msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "levelno" msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "lineno" msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "message" msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "module" msgstr "模組" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "msecs" msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:941 +#: ../../library/logging.rst:0 ../../library/logging.rst:959 msgid "msg" msgstr "" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:959 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:946 +#: ../../library/logging.rst:0 ../../library/logging.rst:964 msgid "name" msgstr "" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:964 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:964 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "pathname" msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "process" msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "processName" msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:977 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:977 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "thread" msgstr "" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "threadName" msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:990 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:993 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:981 +#: ../../library/logging.rst:999 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:1001 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:989 +#: ../../library/logging.rst:1007 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:994 +#: ../../library/logging.rst:1012 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1401,7 +1441,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1018 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1413,24 +1453,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1027 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1032 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1038 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1040 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1439,7 +1479,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1045 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1447,17 +1487,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1052 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1054 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1042 +#: ../../library/logging.rst:1060 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1466,14 +1506,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1065 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1072 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1482,24 +1522,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1083 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1085 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1072 +#: ../../library/logging.rst:1090 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1077 +#: ../../library/logging.rst:1095 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1508,7 +1548,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1082 +#: ../../library/logging.rst:1100 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1518,7 +1558,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1126 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1527,18 +1567,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1119 +#: ../../library/logging.rst:1137 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1125 +#: ../../library/logging.rst:1143 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1147 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1549,58 +1589,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1161 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1170 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1176 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1161 +#: ../../library/logging.rst:1179 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1168 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1192 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1198 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1204 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1191 +#: ../../library/logging.rst:1209 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 " @@ -1614,7 +1654,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1220 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 " @@ -1622,13 +1662,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1225 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1231 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1638,24 +1678,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1238 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1243 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1251 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1253 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1665,20 +1705,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1242 +#: ../../library/logging.rst:1260 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:1246 +#: ../../library/logging.rst:1264 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1267 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 " @@ -1687,7 +1727,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1273 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. " @@ -1695,17 +1735,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1263 +#: ../../library/logging.rst:1281 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1270 +#: ../../library/logging.rst:1288 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1294 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1713,7 +1753,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1284 +#: ../../library/logging.rst:1302 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1722,13 +1762,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1308 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:1293 +#: ../../library/logging.rst:1311 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 " @@ -1737,54 +1777,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1318 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1325 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1325 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1329 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1329 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1333 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1333 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1338 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1338 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1341 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1341 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1352 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1352 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:1340 +#: ../../library/logging.rst:1358 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1358 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 " @@ -1824,33 +1864,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1367 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1367 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:1355 +#: ../../library/logging.rst:1373 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1373 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:1360 +#: ../../library/logging.rst:1378 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1378 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 " @@ -1859,39 +1899,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1389 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1374 +#: ../../library/logging.rst:1392 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:1380 +#: ../../library/logging.rst:1398 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1401 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1406 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:1392 +#: ../../library/logging.rst:1410 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:1399 +#: ../../library/logging.rst:1417 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 " @@ -1903,32 +1943,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1410 +#: ../../library/logging.rst:1428 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1412 +#: ../../library/logging.rst:1430 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1432 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:1419 +#: ../../library/logging.rst:1437 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1421 +#: ../../library/logging.rst:1439 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1423 +#: ../../library/logging.rst:1441 msgid "The logger name." msgstr "" @@ -1936,7 +1976,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1424 +#: ../../library/logging.rst:1442 msgid "The logging level (numeric)." msgstr "" @@ -1944,7 +1984,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1443 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1952,19 +1992,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1426 +#: ../../library/logging.rst:1444 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1427 +#: ../../library/logging.rst:1445 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1446 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1429 +#: ../../library/logging.rst:1447 msgid "An exception tuple, or ``None``." msgstr "" @@ -1972,7 +2012,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1430 +#: ../../library/logging.rst:1448 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1980,7 +2020,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1450 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1990,15 +2030,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1434 +#: ../../library/logging.rst:1452 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1438 +#: ../../library/logging.rst:1456 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1460 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``, " @@ -2009,22 +2049,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1471 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1455 +#: ../../library/logging.rst:1473 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1478 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1463 +#: ../../library/logging.rst:1481 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2033,46 +2073,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1468 +#: ../../library/logging.rst:1486 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:1476 +#: ../../library/logging.rst:1494 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1476 +#: ../../library/logging.rst:1494 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1497 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1497 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1501 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1500 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1506 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1504 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/lzma.po b/library/lzma.po index aecb819a41..9ccd407592 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -103,7 +103,7 @@ msgstr "" #: ../../library/lzma.rst:65 msgid "Added support for the ``\"x\"``, ``\"xb\"`` and ``\"xt\"`` modes." -msgstr "" +msgstr "新增 ``\"x\"``、``\"xb\"`` 和 ``\"xt\"`` 模式的支援。" #: ../../library/lzma.rst:68 ../../library/lzma.rst:127 msgid "Accepts a :term:`path-like object`." @@ -172,7 +172,7 @@ msgstr "" #: ../../library/lzma.rst:120 msgid "Added support for the ``\"x\"`` and ``\"xb\"`` modes." -msgstr "" +msgstr "新增 ``\"x\"`` 和 ``\"xb\"`` 模式的支援。" #: ../../library/lzma.rst:123 msgid "" diff --git a/library/math.po b/library/math.po index fb3969ca2c..2a69da0cae 100644 --- a/library/math.po +++ b/library/math.po @@ -298,11 +298,11 @@ msgstr "" #: ../../library/math.rst:240 msgid "See also :func:`math.ulp`." -msgstr "另請參閱 :func:`math.ulp`\\ 。" +msgstr "另請參閱 :func:`math.ulp`。" #: ../../library/math.rst:242 msgid "Added the *steps* argument." -msgstr "" +msgstr "新增 *steps* 引數。" #: ../../library/math.rst:249 msgid "" diff --git a/library/optparse.po b/library/optparse.po index 6fb9346cbf..e1b0fcc815 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -1222,7 +1222,7 @@ msgstr "" #: ../../library/optparse.rst:1019 msgid "(default: ``\"store\"``)" -msgstr "" +msgstr "(預設值: ``\"store\"`` )" #: ../../library/optparse.rst:1021 msgid "" @@ -1233,7 +1233,7 @@ msgstr "" #: ../../library/optparse.rst:1027 msgid "(default: ``\"string\"``)" -msgstr "" +msgstr "(預設值: ``\"string\"`` )" #: ../../library/optparse.rst:1029 msgid "" @@ -1262,7 +1262,7 @@ msgstr "" #: ../../library/optparse.rst:1049 msgid "(default: 1)" -msgstr "" +msgstr "(預設值:1)" #: ../../library/optparse.rst:1051 msgid "" diff --git a/library/os.po b/library/os.po index 624383d5bb..c321c7d755 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 00:03+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -294,33 +294,33 @@ msgstr "" #: ../../library/os.rst:678 ../../library/os.rst:687 ../../library/os.rst:694 #: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 #: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 -#: ../../library/os.rst:1305 ../../library/os.rst:1331 -#: ../../library/os.rst:1568 ../../library/os.rst:1607 -#: ../../library/os.rst:1616 ../../library/os.rst:1980 -#: ../../library/os.rst:2069 ../../library/os.rst:2109 -#: ../../library/os.rst:2389 ../../library/os.rst:2411 -#: ../../library/os.rst:3993 ../../library/os.rst:4000 -#: ../../library/os.rst:4007 ../../library/os.rst:4014 -#: ../../library/os.rst:4021 ../../library/os.rst:4028 -#: ../../library/os.rst:4035 ../../library/os.rst:4043 -#: ../../library/os.rst:4051 ../../library/os.rst:4058 -#: ../../library/os.rst:4065 ../../library/os.rst:4074 -#: ../../library/os.rst:4082 ../../library/os.rst:4090 -#: ../../library/os.rst:4097 ../../library/os.rst:4104 -#: ../../library/os.rst:4125 ../../library/os.rst:4142 -#: ../../library/os.rst:4182 ../../library/os.rst:4189 -#: ../../library/os.rst:4219 ../../library/os.rst:4346 -#: ../../library/os.rst:4395 ../../library/os.rst:4632 -#: ../../library/os.rst:4666 ../../library/os.rst:4724 -#: ../../library/os.rst:4738 ../../library/os.rst:4755 -#: ../../library/os.rst:4770 ../../library/os.rst:4781 -#: ../../library/os.rst:4793 ../../library/os.rst:4806 -#: ../../library/os.rst:4815 ../../library/os.rst:4825 -#: ../../library/os.rst:4838 ../../library/os.rst:4889 -#: ../../library/os.rst:4900 ../../library/os.rst:4912 -#: ../../library/os.rst:4919 ../../library/os.rst:4928 -#: ../../library/os.rst:4937 ../../library/os.rst:4946 -#: ../../library/os.rst:4955 +#: ../../library/os.rst:1345 ../../library/os.rst:1371 +#: ../../library/os.rst:1608 ../../library/os.rst:1647 +#: ../../library/os.rst:1656 ../../library/os.rst:2020 +#: ../../library/os.rst:2109 ../../library/os.rst:2149 +#: ../../library/os.rst:2429 ../../library/os.rst:2451 +#: ../../library/os.rst:4035 ../../library/os.rst:4042 +#: ../../library/os.rst:4049 ../../library/os.rst:4056 +#: ../../library/os.rst:4063 ../../library/os.rst:4070 +#: ../../library/os.rst:4077 ../../library/os.rst:4085 +#: ../../library/os.rst:4093 ../../library/os.rst:4100 +#: ../../library/os.rst:4107 ../../library/os.rst:4116 +#: ../../library/os.rst:4124 ../../library/os.rst:4132 +#: ../../library/os.rst:4139 ../../library/os.rst:4146 +#: ../../library/os.rst:4167 ../../library/os.rst:4184 +#: ../../library/os.rst:4224 ../../library/os.rst:4231 +#: ../../library/os.rst:4261 ../../library/os.rst:4388 +#: ../../library/os.rst:4437 ../../library/os.rst:4674 +#: ../../library/os.rst:4708 ../../library/os.rst:4766 +#: ../../library/os.rst:4780 ../../library/os.rst:4797 +#: ../../library/os.rst:4812 ../../library/os.rst:4823 +#: ../../library/os.rst:4835 ../../library/os.rst:4848 +#: ../../library/os.rst:4857 ../../library/os.rst:4867 +#: ../../library/os.rst:4880 ../../library/os.rst:4931 +#: ../../library/os.rst:4942 ../../library/os.rst:4954 +#: ../../library/os.rst:4961 ../../library/os.rst:4970 +#: ../../library/os.rst:4979 ../../library/os.rst:4988 +#: ../../library/os.rst:4997 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -371,7 +371,7 @@ msgstr "" #: ../../library/os.rst:216 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " -"cause memory leaks. Refer to the system documentation for :c:func:`putenv`." +"cause memory leaks. Refer to the system documentation for :c:func:`!putenv`." msgstr "" #: ../../library/os.rst:220 @@ -476,12 +476,12 @@ msgid "" msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 -#: ../../library/os.rst:1110 ../../library/os.rst:1317 -#: ../../library/os.rst:1588 ../../library/os.rst:1756 -#: ../../library/os.rst:2489 ../../library/os.rst:3332 -#: ../../library/os.rst:3369 ../../library/os.rst:3985 -#: ../../library/os.rst:4483 ../../library/os.rst:4494 -#: ../../library/os.rst:4611 +#: ../../library/os.rst:1110 ../../library/os.rst:1357 +#: ../../library/os.rst:1628 ../../library/os.rst:1796 +#: ../../library/os.rst:2529 ../../library/os.rst:3374 +#: ../../library/os.rst:3411 ../../library/os.rst:4027 +#: ../../library/os.rst:4525 ../../library/os.rst:4536 +#: ../../library/os.rst:4653 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -504,17 +504,17 @@ msgstr "" #: ../../library/os.rst:787 ../../library/os.rst:1004 ../../library/os.rst:1019 #: ../../library/os.rst:1030 ../../library/os.rst:1053 #: ../../library/os.rst:1074 ../../library/os.rst:1138 -#: ../../library/os.rst:1150 ../../library/os.rst:1356 -#: ../../library/os.rst:1371 ../../library/os.rst:1384 -#: ../../library/os.rst:1453 ../../library/os.rst:1667 -#: ../../library/os.rst:1694 ../../library/os.rst:1729 -#: ../../library/os.rst:2052 ../../library/os.rst:2083 -#: ../../library/os.rst:2124 ../../library/os.rst:2137 -#: ../../library/os.rst:2455 ../../library/os.rst:2467 -#: ../../library/os.rst:3198 ../../library/os.rst:3355 -#: ../../library/os.rst:3588 ../../library/os.rst:5101 -#: ../../library/os.rst:5110 ../../library/os.rst:5131 -#: ../../library/os.rst:5141 ../../library/os.rst:5150 +#: ../../library/os.rst:1150 ../../library/os.rst:1396 +#: ../../library/os.rst:1411 ../../library/os.rst:1424 +#: ../../library/os.rst:1493 ../../library/os.rst:1707 +#: ../../library/os.rst:1734 ../../library/os.rst:1769 +#: ../../library/os.rst:2092 ../../library/os.rst:2123 +#: ../../library/os.rst:2164 ../../library/os.rst:2177 +#: ../../library/os.rst:2495 ../../library/os.rst:2507 +#: ../../library/os.rst:3240 ../../library/os.rst:3397 +#: ../../library/os.rst:3630 ../../library/os.rst:5143 +#: ../../library/os.rst:5152 ../../library/os.rst:5173 +#: ../../library/os.rst:5183 ../../library/os.rst:5192 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -586,10 +586,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3950 -#: ../../library/os.rst:4166 ../../library/os.rst:4464 -#: ../../library/os.rst:4588 ../../library/os.rst:4704 -#: ../../library/os.rst:4873 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3992 +#: ../../library/os.rst:4208 ../../library/os.rst:4506 +#: ../../library/os.rst:4630 ../../library/os.rst:4746 +#: ../../library/os.rst:4915 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -682,7 +682,7 @@ msgstr "" #: ../../library/os.rst:566 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " -"cause memory leaks. Refer to the system documentation for :c:func:`putenv`." +"cause memory leaks. Refer to the system documentation for :c:func:`!putenv`." msgstr "" #: ../../library/os.rst:569 @@ -773,14 +773,14 @@ msgstr ":func:`~os.unshare` 函式。" #: ../../library/os.rst:649 msgid "" -"Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " +"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:657 msgid "" -"Call the system call :c:func:`setpgid` to set the process group id of the " +"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 "" @@ -887,7 +887,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4613 +#: ../../library/os.rst:789 ../../library/os.rst:4655 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1089,7 +1089,7 @@ msgstr "" msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/os.rst:976 ../../library/os.rst:1204 +#: ../../library/os.rst:976 ../../library/os.rst:1244 msgid "The new file descriptor is now non-inheritable." msgstr "" @@ -1116,8 +1116,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1002 ../../library/os.rst:2028 -#: ../../library/os.rst:2122 +#: ../../library/os.rst:1002 ../../library/os.rst:2068 +#: ../../library/os.rst:2162 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1126,9 +1126,9 @@ msgstr "" "` ``os.chmod``。" #: ../../library/os.rst:1006 ../../library/os.rst:1021 -#: ../../library/os.rst:1112 ../../library/os.rst:1590 -#: ../../library/os.rst:2025 ../../library/os.rst:2054 -#: ../../library/os.rst:3334 +#: ../../library/os.rst:1112 ../../library/os.rst:1630 +#: ../../library/os.rst:2065 ../../library/os.rst:2094 +#: ../../library/os.rst:3376 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1141,8 +1141,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1017 ../../library/os.rst:2050 -#: ../../library/os.rst:2135 +#: ../../library/os.rst:1017 ../../library/os.rst:2090 +#: ../../library/os.rst:2175 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1171,7 +1171,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1046 ../../library/os.rst:2447 +#: ../../library/os.rst:1046 ../../library/os.rst:2487 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 " @@ -1193,7 +1193,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1065 ../../library/os.rst:2282 +#: ../../library/os.rst:1065 ../../library/os.rst:2322 msgid "The :func:`.stat` function." msgstr "" @@ -1207,7 +1207,7 @@ msgstr "" #: ../../library/os.rst:1079 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` " +"the native :c:func:`!fsync` function; on Windows, the MS :c:func:`!_commit` " "function." msgstr "" @@ -1233,7 +1233,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3373 +#: ../../library/os.rst:1099 ../../library/os.rst:3415 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1248,11 +1248,11 @@ msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1115 ../../library/os.rst:1593 +#: ../../library/os.rst:1115 ../../library/os.rst:1633 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1119 ../../library/os.rst:1597 +#: ../../library/os.rst:1119 ../../library/os.rst:1637 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" @@ -1290,26 +1290,109 @@ msgstr "" #: ../../library/os.rst:1168 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 " -"beginning of the file; :const:`SEEK_CUR` or ``1`` to set it relative to the " -"current position; :const:`SEEK_END` or ``2`` to set it relative to the end " -"of the file. Return the new cursor position in bytes, starting from the " -"beginning." +"by *whence*, and return the new position in bytes relative to the start of " +"the file. Valid values for *whence* are:" msgstr "" -#: ../../library/os.rst:1179 +#: ../../library/os.rst:1173 msgid "" -"Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " -"respectively." +":const:`SEEK_SET` or ``0`` -- set *pos* relative to the beginning of the file" +msgstr "" + +#: ../../library/os.rst:1174 +msgid "" +":const:`SEEK_CUR` or ``1`` -- set *pos* relative to the current file position" +msgstr "" + +#: ../../library/os.rst:1175 +msgid ":const:`SEEK_END` or ``2`` -- set *pos* relative to the end of the file" msgstr "" -#: ../../library/os.rst:1182 +#: ../../library/os.rst:1176 msgid "" -"Some operating systems could support additional values, like :const:`os." -"SEEK_HOLE` or :const:`os.SEEK_DATA`." +":const:`SEEK_HOLE` -- set *pos* to the next data location, relative to *pos*" msgstr "" -#: ../../library/os.rst:1189 +#: ../../library/os.rst:1177 +msgid "" +":const:`SEEK_DATA` -- set *pos* to the next data hole, relative to *pos*" +msgstr "" + +#: ../../library/os.rst:1181 +msgid "Add support for :const:`!SEEK_HOLE` and :const:`!SEEK_DATA`." +msgstr "" + +#: ../../library/os.rst:1188 +msgid "" +"Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " +"method on :term:`file-like objects `, for whence to adjust the " +"file position indicator." +msgstr "" + +#: ../../library/os.rst:1192 +msgid ":const:`SEEK_SET`" +msgstr ":const:`SEEK_SET`" + +#: ../../library/os.rst:1193 +msgid "Adjust the file position relative to the beginning of the file." +msgstr "" + +#: ../../library/os.rst:1194 +msgid ":const:`SEEK_CUR`" +msgstr ":const:`SEEK_CUR`" + +#: ../../library/os.rst:1195 +msgid "Adjust the file position relative to the current file position." +msgstr "" + +#: ../../library/os.rst:1197 +msgid ":const:`SEEK_END`" +msgstr ":const:`SEEK_END`" + +#: ../../library/os.rst:1197 +msgid "Adjust the file position relative to the end of the file." +msgstr "" + +#: ../../library/os.rst:1199 +msgid "Their values are 0, 1, and 2, respectively." +msgstr "" + +#: ../../library/os.rst:1205 +msgid "" +"Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " +"method on :term:`file-like objects `, for seeking file data and " +"holes on sparsely allocated files." +msgstr "" + +#: ../../library/os.rst:1211 +msgid ":data:`!SEEK_DATA`" +msgstr ":data:`!SEEK_DATA`" + +#: ../../library/os.rst:1210 +msgid "" +"Adjust the file offset to the next location containing data, relative to the " +"seek position." +msgstr "" + +#: ../../library/os.rst:1216 +msgid ":data:`!SEEK_HOLE`" +msgstr "" + +#: ../../library/os.rst:1214 +msgid "" +"Adjust the file offset to the next location containing a hole, relative to " +"the seek position. A hole is defined as a sequence of zeros." +msgstr "" + +#: ../../library/os.rst:1220 +msgid "These operations only make sense for filesystems that support them." +msgstr "" + +#: ../../library/os.rst:1222 +msgid ":ref:`Availability `: Linux >= 3.1, macOS, Unix" +msgstr ":ref:`適用 `:Linux 3.1 以上、macOS、Unix。" + +#: ../../library/os.rst:1229 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 " @@ -1317,7 +1400,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1194 +#: ../../library/os.rst:1234 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`) " @@ -1325,13 +1408,13 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1199 +#: ../../library/os.rst:1239 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1202 +#: ../../library/os.rst:1242 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1339,7 +1422,7 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/os.rst:1209 +#: ../../library/os.rst:1249 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 :" @@ -1347,39 +1430,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1214 ../../library/os.rst:2323 -#: ../../library/os.rst:2391 ../../library/os.rst:2413 -#: ../../library/os.rst:2494 ../../library/os.rst:2525 +#: ../../library/os.rst:1254 ../../library/os.rst:2363 +#: ../../library/os.rst:2431 ../../library/os.rst:2453 +#: ../../library/os.rst:2534 ../../library/os.rst:2565 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1217 ../../library/os.rst:1536 -#: ../../library/os.rst:1711 ../../library/os.rst:4706 +#: ../../library/os.rst:1257 ../../library/os.rst:1576 +#: ../../library/os.rst:1751 ../../library/os.rst:4748 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:1222 ../../library/os.rst:1922 -#: ../../library/os.rst:1954 ../../library/os.rst:1985 -#: ../../library/os.rst:2034 ../../library/os.rst:2071 -#: ../../library/os.rst:2111 ../../library/os.rst:2126 -#: ../../library/os.rst:2139 ../../library/os.rst:2198 -#: ../../library/os.rst:2290 ../../library/os.rst:2326 -#: ../../library/os.rst:2367 ../../library/os.rst:2394 -#: ../../library/os.rst:2416 ../../library/os.rst:2457 -#: ../../library/os.rst:2528 ../../library/os.rst:2547 -#: ../../library/os.rst:2635 ../../library/os.rst:2925 -#: ../../library/os.rst:3212 ../../library/os.rst:3376 -#: ../../library/os.rst:3392 ../../library/os.rst:3432 -#: ../../library/os.rst:3531 ../../library/os.rst:3592 -#: ../../library/os.rst:3776 ../../library/os.rst:3956 -#: ../../library/os.rst:4471 +#: ../../library/os.rst:1262 ../../library/os.rst:1962 +#: ../../library/os.rst:1994 ../../library/os.rst:2025 +#: ../../library/os.rst:2074 ../../library/os.rst:2111 +#: ../../library/os.rst:2151 ../../library/os.rst:2166 +#: ../../library/os.rst:2179 ../../library/os.rst:2238 +#: ../../library/os.rst:2330 ../../library/os.rst:2366 +#: ../../library/os.rst:2407 ../../library/os.rst:2434 +#: ../../library/os.rst:2456 ../../library/os.rst:2497 +#: ../../library/os.rst:2568 ../../library/os.rst:2587 +#: ../../library/os.rst:2675 ../../library/os.rst:2965 +#: ../../library/os.rst:3254 ../../library/os.rst:3418 +#: ../../library/os.rst:3434 ../../library/os.rst:3474 +#: ../../library/os.rst:3573 ../../library/os.rst:3634 +#: ../../library/os.rst:3818 ../../library/os.rst:3998 +#: ../../library/os.rst:4513 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1225 +#: ../../library/os.rst:1265 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 ``|" @@ -1389,45 +1472,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1240 +#: ../../library/os.rst:1280 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1251 +#: ../../library/os.rst:1291 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1253 +#: ../../library/os.rst:1293 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1264 +#: ../../library/os.rst:1304 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1271 +#: ../../library/os.rst:1311 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1273 +#: ../../library/os.rst:1313 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1287 +#: ../../library/os.rst:1327 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1290 +#: ../../library/os.rst:1330 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:1300 +#: ../../library/os.rst:1340 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 " @@ -1435,18 +1518,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1307 ../../library/os.rst:1319 +#: ../../library/os.rst:1347 ../../library/os.rst:1359 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1313 +#: ../../library/os.rst:1353 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:1325 +#: ../../library/os.rst:1365 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:" @@ -1454,17 +1537,17 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1338 +#: ../../library/os.rst:1378 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:1341 +#: ../../library/os.rst:1381 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" -#: ../../library/os.rst:1348 +#: ../../library/os.rst:1388 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 " @@ -1475,25 +1558,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1368 +#: ../../library/os.rst:1408 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:1378 +#: ../../library/os.rst:1418 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1381 ../../library/os.rst:1525 +#: ../../library/os.rst:1421 ../../library/os.rst:1565 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:1391 +#: ../../library/os.rst:1431 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1501,38 +1584,38 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1396 ../../library/os.rst:1466 +#: ../../library/os.rst:1436 ../../library/os.rst:1506 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1399 +#: ../../library/os.rst:1439 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1400 +#: ../../library/os.rst:1440 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1402 ../../library/os.rst:1661 +#: ../../library/os.rst:1442 ../../library/os.rst:1701 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:1405 ../../library/os.rst:1475 -#: ../../library/os.rst:1664 ../../library/os.rst:1726 +#: ../../library/os.rst:1445 ../../library/os.rst:1515 +#: ../../library/os.rst:1704 ../../library/os.rst:1766 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:1408 +#: ../../library/os.rst:1448 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1410 ../../library/os.rst:1480 +#: ../../library/os.rst:1450 ../../library/os.rst:1520 msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " ">= 2.7, AIX >= 7.1." @@ -1540,55 +1623,55 @@ msgstr "" ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " "以上、AIX 7.1 以上。" -#: ../../library/os.rst:1412 ../../library/os.rst:1482 +#: ../../library/os.rst:1452 ../../library/os.rst:1522 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1419 +#: ../../library/os.rst:1459 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:1423 +#: ../../library/os.rst:1463 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 :const:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1427 +#: ../../library/os.rst:1467 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1434 +#: ../../library/os.rst:1474 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:1438 +#: ../../library/os.rst:1478 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1441 +#: ../../library/os.rst:1481 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1448 +#: ../../library/os.rst:1488 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1451 ../../library/os.rst:1701 +#: ../../library/os.rst:1491 ../../library/os.rst:1741 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1460 +#: ../../library/os.rst:1500 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:" @@ -1597,43 +1680,43 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1469 +#: ../../library/os.rst:1509 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1470 +#: ../../library/os.rst:1510 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1471 +#: ../../library/os.rst:1511 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1473 +#: ../../library/os.rst:1513 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1478 +#: ../../library/os.rst:1518 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1489 +#: ../../library/os.rst:1529 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:1492 ../../library/os.rst:1502 +#: ../../library/os.rst:1532 ../../library/os.rst:1542 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1499 +#: ../../library/os.rst:1539 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:1509 +#: ../../library/os.rst:1549 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 " @@ -1643,15 +1726,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1516 +#: ../../library/os.rst:1556 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1523 +#: ../../library/os.rst:1563 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1530 +#: ../../library/os.rst:1570 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 " @@ -1660,26 +1743,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1545 +#: ../../library/os.rst:1585 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:1549 +#: ../../library/os.rst:1589 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1552 +#: ../../library/os.rst:1592 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:1555 +#: ../../library/os.rst:1595 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 " @@ -1687,59 +1770,59 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1559 +#: ../../library/os.rst:1599 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:1562 +#: ../../library/os.rst:1602 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:1565 +#: ../../library/os.rst:1605 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1572 +#: ../../library/os.rst:1612 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1577 +#: ../../library/os.rst:1617 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1583 +#: ../../library/os.rst:1623 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:1586 +#: ../../library/os.rst:1626 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1604 +#: ../../library/os.rst:1644 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1613 +#: ../../library/os.rst:1653 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1623 +#: ../../library/os.rst:1663 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1751,7 +1834,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1632 +#: ../../library/os.rst:1672 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 " @@ -1759,7 +1842,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1637 +#: ../../library/os.rst:1677 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, " @@ -1768,11 +1851,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1643 +#: ../../library/os.rst:1683 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1656 +#: ../../library/os.rst:1696 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1780,34 +1863,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1674 +#: ../../library/os.rst:1714 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:1677 ../../library/os.rst:1685 +#: ../../library/os.rst:1717 ../../library/os.rst:1725 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1682 +#: ../../library/os.rst:1722 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:1690 +#: ../../library/os.rst:1730 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:1699 +#: ../../library/os.rst:1739 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1705 +#: ../../library/os.rst:1745 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 " @@ -1816,7 +1899,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1719 +#: ../../library/os.rst:1759 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1824,70 +1907,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1724 +#: ../../library/os.rst:1764 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1737 +#: ../../library/os.rst:1777 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1743 +#: ../../library/os.rst:1783 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1746 +#: ../../library/os.rst:1786 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1749 +#: ../../library/os.rst:1789 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1752 +#: ../../library/os.rst:1792 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:1760 +#: ../../library/os.rst:1800 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1764 +#: ../../library/os.rst:1804 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1768 +#: ../../library/os.rst:1808 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1774 +#: ../../library/os.rst:1814 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1778 +#: ../../library/os.rst:1818 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:1782 +#: ../../library/os.rst:1822 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:1785 +#: ../../library/os.rst:1825 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, " @@ -1898,46 +1981,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1793 +#: ../../library/os.rst:1833 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1798 +#: ../../library/os.rst:1838 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1802 +#: ../../library/os.rst:1842 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1806 +#: ../../library/os.rst:1846 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1808 ../../library/os.rst:1814 -#: ../../library/os.rst:3881 ../../library/os.rst:4506 -#: ../../library/os.rst:4551 +#: ../../library/os.rst:1848 ../../library/os.rst:1854 +#: ../../library/os.rst:3923 ../../library/os.rst:4548 +#: ../../library/os.rst:4593 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1852 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1820 +#: ../../library/os.rst:1860 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1822 +#: ../../library/os.rst:1862 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1827 +#: ../../library/os.rst:1867 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. " @@ -1948,7 +2031,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1835 +#: ../../library/os.rst:1875 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 " @@ -1956,13 +2039,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1840 +#: ../../library/os.rst:1880 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:1845 +#: ../../library/os.rst:1885 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 " @@ -1973,14 +2056,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1892 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:1858 +#: ../../library/os.rst:1898 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 " @@ -1989,14 +2072,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1864 +#: ../../library/os.rst:1904 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:1872 +#: ../../library/os.rst:1912 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 " @@ -2008,13 +2091,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1881 +#: ../../library/os.rst:1921 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1884 +#: ../../library/os.rst:1924 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2023,7 +2106,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1932 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 " @@ -2032,117 +2115,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1903 +#: ../../library/os.rst:1943 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1915 +#: ../../library/os.rst:1955 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:1919 +#: ../../library/os.rst:1959 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1931 +#: ../../library/os.rst:1971 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:1940 +#: ../../library/os.rst:1980 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1982 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:1945 +#: ../../library/os.rst:1985 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1948 ../../library/os.rst:2081 +#: ../../library/os.rst:1988 ../../library/os.rst:2121 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1950 +#: ../../library/os.rst:1990 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1960 +#: ../../library/os.rst:2000 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:1963 +#: ../../library/os.rst:2003 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:1964 +#: ../../library/os.rst:2004 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1965 +#: ../../library/os.rst:2005 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:1966 +#: ../../library/os.rst:2006 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1967 +#: ../../library/os.rst:2007 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1968 +#: ../../library/os.rst:2008 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1969 +#: ../../library/os.rst:2009 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1970 +#: ../../library/os.rst:2010 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:2011 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1972 +#: ../../library/os.rst:2012 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:1973 +#: ../../library/os.rst:2013 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1974 +#: ../../library/os.rst:2014 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:2016 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1978 ../../library/os.rst:2107 +#: ../../library/os.rst:2018 ../../library/os.rst:2147 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2150,164 +2233,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:2022 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1991 +#: ../../library/os.rst:2031 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:1995 +#: ../../library/os.rst:2035 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:1996 +#: ../../library/os.rst:2036 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:1997 +#: ../../library/os.rst:2037 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:1998 +#: ../../library/os.rst:2038 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:1999 +#: ../../library/os.rst:2039 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2040 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2001 +#: ../../library/os.rst:2041 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2002 +#: ../../library/os.rst:2042 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2003 +#: ../../library/os.rst:2043 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2004 +#: ../../library/os.rst:2044 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2045 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2046 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2047 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2008 +#: ../../library/os.rst:2048 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2009 +#: ../../library/os.rst:2049 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2050 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2011 +#: ../../library/os.rst:2051 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2052 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2053 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2015 ../../library/os.rst:2043 -#: ../../library/os.rst:3422 +#: ../../library/os.rst:2055 ../../library/os.rst:2083 +#: ../../library/os.rst:3464 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:2021 +#: ../../library/os.rst:2061 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:2030 ../../library/os.rst:2057 +#: ../../library/os.rst:2070 ../../library/os.rst:2097 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2080 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:2047 +#: ../../library/os.rst:2087 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2061 +#: ../../library/os.rst:2101 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2067 +#: ../../library/os.rst:2107 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2077 +#: ../../library/os.rst:2117 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:2088 +#: ../../library/os.rst:2128 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2093 +#: ../../library/os.rst:2133 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2095 +#: ../../library/os.rst:2135 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:2103 +#: ../../library/os.rst:2143 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:2117 +#: ../../library/os.rst:2157 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` " @@ -2315,25 +2398,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2131 +#: ../../library/os.rst:2171 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:2145 +#: ../../library/os.rst:2185 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2147 +#: ../../library/os.rst:2187 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:2151 +#: ../../library/os.rst:2191 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2341,24 +2424,24 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2153 +#: ../../library/os.rst:2193 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2155 +#: ../../library/os.rst:2195 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2158 +#: ../../library/os.rst:2198 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:2161 ../../library/os.rst:2579 -#: ../../library/os.rst:2616 ../../library/os.rst:3344 +#: ../../library/os.rst:2201 ../../library/os.rst:2619 +#: ../../library/os.rst:2656 ../../library/os.rst:3386 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2167 +#: ../../library/os.rst:2207 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 " @@ -2367,7 +2450,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2173 +#: ../../library/os.rst:2213 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2375,42 +2458,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2178 ../../library/os.rst:2664 +#: ../../library/os.rst:2218 ../../library/os.rst:2704 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2181 +#: ../../library/os.rst:2221 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2184 +#: ../../library/os.rst:2224 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2188 +#: ../../library/os.rst:2228 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:2192 +#: ../../library/os.rst:2232 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2195 ../../library/os.rst:3203 +#: ../../library/os.rst:2235 ../../library/os.rst:3245 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2204 +#: ../../library/os.rst:2244 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2206 +#: ../../library/os.rst:2246 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2418,27 +2501,27 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2211 +#: ../../library/os.rst:2251 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2214 +#: ../../library/os.rst:2254 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2216 ../../library/os.rst:2240 -#: ../../library/os.rst:2260 +#: ../../library/os.rst:2256 ../../library/os.rst:2280 +#: ../../library/os.rst:2300 msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:2223 +#: ../../library/os.rst:2263 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2226 +#: ../../library/os.rst:2266 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2446,19 +2529,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2232 +#: ../../library/os.rst:2272 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2235 +#: ../../library/os.rst:2275 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2238 +#: ../../library/os.rst:2278 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2466,11 +2549,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2247 +#: ../../library/os.rst:2287 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2249 +#: ../../library/os.rst:2289 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2479,53 +2562,53 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2256 +#: ../../library/os.rst:2296 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2258 +#: ../../library/os.rst:2298 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2267 +#: ../../library/os.rst:2307 msgid "" -"Perform the equivalent of an :c:func:`lstat` system call on the given path. " +"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:2271 +#: ../../library/os.rst:2311 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2274 +#: ../../library/os.rst:2314 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2277 ../../library/os.rst:2315 -#: ../../library/os.rst:2380 ../../library/os.rst:2408 -#: ../../library/os.rst:2482 +#: ../../library/os.rst:2317 ../../library/os.rst:2355 +#: ../../library/os.rst:2420 ../../library/os.rst:2448 +#: ../../library/os.rst:2522 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2284 ../../library/os.rst:2491 -#: ../../library/os.rst:3337 +#: ../../library/os.rst:2324 ../../library/os.rst:2531 +#: ../../library/os.rst:3379 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2327 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2293 +#: ../../library/os.rst:2333 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2533,18 +2616,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2302 +#: ../../library/os.rst:2342 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2304 +#: ../../library/os.rst:2344 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:2309 +#: ../../library/os.rst:2349 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 " @@ -2553,13 +2636,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2318 +#: ../../library/os.rst:2358 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2321 ../../library/os.rst:2355 +#: ../../library/os.rst:2361 ../../library/os.rst:2395 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2567,13 +2650,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2336 +#: ../../library/os.rst:2376 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2339 +#: ../../library/os.rst:2379 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2582,27 +2665,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2345 +#: ../../library/os.rst:2385 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2350 +#: ../../library/os.rst:2390 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2353 +#: ../../library/os.rst:2393 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2357 +#: ../../library/os.rst:2397 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2362 +#: ../../library/os.rst:2402 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 " @@ -2610,19 +2693,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2370 +#: ../../library/os.rst:2410 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2377 +#: ../../library/os.rst:2417 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:2383 +#: ../../library/os.rst:2423 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 " @@ -2632,7 +2715,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2400 +#: ../../library/os.rst:2440 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 " @@ -2643,23 +2726,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2422 +#: ../../library/os.rst:2462 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2428 +#: ../../library/os.rst:2468 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2434 +#: ../../library/os.rst:2474 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2439 +#: ../../library/os.rst:2479 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2670,20 +2753,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2452 ../../library/os.rst:3196 -#: ../../library/os.rst:3365 +#: ../../library/os.rst:2492 ../../library/os.rst:3238 +#: ../../library/os.rst:3407 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2463 +#: ../../library/os.rst:2503 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:2472 +#: ../../library/os.rst:2512 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 " @@ -2691,7 +2774,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2477 +#: ../../library/os.rst:2517 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 " @@ -2699,42 +2782,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2485 +#: ../../library/os.rst:2525 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:2497 +#: ../../library/os.rst:2537 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2500 +#: ../../library/os.rst:2540 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2543 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:2510 +#: ../../library/os.rst:2550 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2514 ../../library/os.rst:2627 -#: ../../library/os.rst:3316 +#: ../../library/os.rst:2554 ../../library/os.rst:2667 +#: ../../library/os.rst:3358 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2517 +#: ../../library/os.rst:2557 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 " @@ -2742,12 +2825,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2521 +#: ../../library/os.rst:2561 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2523 ../../library/os.rst:2545 -#: ../../library/os.rst:3387 +#: ../../library/os.rst:2563 ../../library/os.rst:2585 +#: ../../library/os.rst:3429 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2755,7 +2838,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2536 +#: ../../library/os.rst:2576 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2767,20 +2850,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2553 +#: ../../library/os.rst:2593 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:2556 +#: ../../library/os.rst:2596 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2560 +#: ../../library/os.rst:2600 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 " @@ -2792,20 +2875,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2569 ../../library/os.rst:2609 +#: ../../library/os.rst:2609 ../../library/os.rst:2649 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:2572 +#: ../../library/os.rst:2612 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2574 ../../library/os.rst:2595 -#: ../../library/os.rst:2612 +#: ../../library/os.rst:2614 ../../library/os.rst:2635 +#: ../../library/os.rst:2652 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2813,11 +2896,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2616 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2585 +#: ../../library/os.rst:2625 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2826,17 +2909,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2592 +#: ../../library/os.rst:2632 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:2597 +#: ../../library/os.rst:2637 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2603 +#: ../../library/os.rst:2643 msgid "" "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 " @@ -2845,7 +2928,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2622 +#: ../../library/os.rst:2662 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2853,7 +2936,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2630 +#: ../../library/os.rst:2670 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2861,11 +2944,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2632 ../../library/os.rst:3389 +#: ../../library/os.rst:2672 ../../library/os.rst:3431 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2641 +#: ../../library/os.rst:2681 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2875,7 +2958,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2648 +#: ../../library/os.rst:2688 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2887,7 +2970,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2658 +#: ../../library/os.rst:2698 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 " @@ -2896,31 +2979,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2667 +#: ../../library/os.rst:2707 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2669 +#: ../../library/os.rst:2709 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2674 +#: ../../library/os.rst:2714 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2676 +#: ../../library/os.rst:2716 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:2683 +#: ../../library/os.rst:2723 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 " @@ -2928,7 +3011,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2695 +#: ../../library/os.rst:2735 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2939,7 +3022,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2707 +#: ../../library/os.rst:2747 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2947,28 +3030,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2713 +#: ../../library/os.rst:2753 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2715 +#: ../../library/os.rst:2755 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2721 +#: ../../library/os.rst:2761 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2724 +#: ../../library/os.rst:2764 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:2728 +#: ../../library/os.rst:2768 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 " @@ -2976,7 +3059,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2733 +#: ../../library/os.rst:2773 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 " @@ -2984,29 +3067,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2738 +#: ../../library/os.rst:2778 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2741 +#: ../../library/os.rst:2781 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2745 +#: ../../library/os.rst:2785 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2748 +#: ../../library/os.rst:2788 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:2754 +#: ../../library/os.rst:2794 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 " @@ -3016,51 +3099,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2801 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:2767 +#: ../../library/os.rst:2807 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2769 +#: ../../library/os.rst:2809 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:2773 +#: ../../library/os.rst:2813 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2818 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:2782 +#: ../../library/os.rst:2822 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:2786 +#: ../../library/os.rst:2826 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:2790 +#: ../../library/os.rst:2830 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 " @@ -3070,46 +3153,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2797 ../../library/os.rst:2827 +#: ../../library/os.rst:2837 ../../library/os.rst:2867 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2802 +#: ../../library/os.rst:2842 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:2806 +#: ../../library/os.rst:2846 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:2810 +#: ../../library/os.rst:2850 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:2815 +#: ../../library/os.rst:2855 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:2819 +#: ../../library/os.rst:2859 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:2822 +#: ../../library/os.rst:2862 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 " @@ -3117,48 +3200,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2832 +#: ../../library/os.rst:2872 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2836 +#: ../../library/os.rst:2876 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2843 +#: ../../library/os.rst:2883 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:2847 +#: ../../library/os.rst:2887 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:2852 +#: ../../library/os.rst:2892 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:2856 +#: ../../library/os.rst:2896 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:2860 +#: ../../library/os.rst:2900 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3166,13 +3249,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2868 +#: ../../library/os.rst:2908 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2912 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3180,7 +3263,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2881 +#: ../../library/os.rst:2921 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 " @@ -3189,21 +3272,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:2927 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2890 ../../library/os.rst:3755 -#: ../../library/os.rst:3771 ../../library/os.rst:3787 -#: ../../library/os.rst:3807 +#: ../../library/os.rst:2930 ../../library/os.rst:3797 +#: ../../library/os.rst:3813 ../../library/os.rst:3829 +#: ../../library/os.rst:3849 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2893 +#: ../../library/os.rst:2933 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3217,24 +3300,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2906 ../../library/os.rst:3675 +#: ../../library/os.rst:2946 ../../library/os.rst:3717 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2919 +#: ../../library/os.rst:2959 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2961 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2928 +#: ../../library/os.rst:2968 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3244,122 +3327,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2939 +#: ../../library/os.rst:2979 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2943 +#: ../../library/os.rst:2983 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2947 +#: ../../library/os.rst:2987 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2951 +#: ../../library/os.rst:2991 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2954 +#: ../../library/os.rst:2994 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2955 +#: ../../library/os.rst:2995 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:3001 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:3005 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2969 +#: ../../library/os.rst:3009 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2973 +#: ../../library/os.rst:3013 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2977 +#: ../../library/os.rst:3017 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:2981 +#: ../../library/os.rst:3021 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2985 +#: ../../library/os.rst:3025 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2989 +#: ../../library/os.rst:3029 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2993 +#: ../../library/os.rst:3033 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:3035 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3002 +#: ../../library/os.rst:3042 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3006 +#: ../../library/os.rst:3046 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3011 +#: ../../library/os.rst:3051 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3014 +#: ../../library/os.rst:3054 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3021 +#: ../../library/os.rst:3061 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3024 +#: ../../library/os.rst:3064 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3069 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3037 +#: ../../library/os.rst:3077 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3369,7 +3452,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3044 +#: ../../library/os.rst:3084 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3382,96 +3465,97 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3094 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3059 +#: ../../library/os.rst:3099 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:3064 +#: ../../library/os.rst:3104 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:3069 +#: ../../library/os.rst:3109 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3073 +#: ../../library/os.rst:3113 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3075 +#: ../../library/os.rst:3115 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:3080 +#: ../../library/os.rst:3120 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3082 +#: ../../library/os.rst:3122 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3087 +#: ../../library/os.rst:3127 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3090 +#: ../../library/os.rst:3130 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3134 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3098 +#: ../../library/os.rst:3138 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3102 +#: ../../library/os.rst:3142 msgid "File type." msgstr "" -#: ../../library/os.rst:3104 +#: ../../library/os.rst:3144 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3108 +#: ../../library/os.rst:3148 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " -"``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" -"`GetFileInformationByHandle`. See the ``FILE_ATTRIBUTE_*`` constants in the :" -"mod:`stat` module." +"``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" +"GetFileInformationByHandle`. See the :const:`!FILE_ATTRIBUTE_* ` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3115 +#: ../../library/os.rst:3156 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." +"When :attr:`st_file_attributes` has the :const:`~stat." +"FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " +"the type of reparse point. See the :const:`IO_REPARSE_TAG_* ` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3161 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3123 +#: ../../library/os.rst:3165 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 " @@ -3483,69 +3567,69 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3132 +#: ../../library/os.rst:3174 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:3136 +#: ../../library/os.rst:3178 msgid "Added the :attr:`st_file_attributes` member on Windows." -msgstr "" +msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" -#: ../../library/os.rst:3139 +#: ../../library/os.rst:3181 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3143 +#: ../../library/os.rst:3185 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3146 +#: ../../library/os.rst:3188 msgid "Added the :attr:`st_reparse_tag` member on Windows." -msgstr "" +msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3149 +#: ../../library/os.rst:3191 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:3154 +#: ../../library/os.rst:3196 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3160 +#: ../../library/os.rst:3202 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3207 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3169 +#: ../../library/os.rst:3211 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: ../../library/os.rst:3175 +#: ../../library/os.rst:3217 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 " -"correspond to the members of the :c:struct:`statvfs` structure, namely: :" -"attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`, :attr:" -"`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`, :attr:" -"`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." +"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 correspond to the members of the :c:struct:`statvfs` structure, " +"namely: :attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:" +"`f_bfree`, :attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:" +"`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3182 +#: ../../library/os.rst:3224 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-" @@ -3553,7 +3637,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3187 +#: ../../library/os.rst:3229 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3566,11 +3650,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3200 +#: ../../library/os.rst:3242 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3206 +#: ../../library/os.rst:3248 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3578,11 +3662,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3215 +#: ../../library/os.rst:3257 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:3221 +#: ../../library/os.rst:3263 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3594,7 +3678,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3231 +#: ../../library/os.rst:3273 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 " @@ -3602,13 +3686,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3238 +#: ../../library/os.rst:3280 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3246 +#: ../../library/os.rst:3288 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3617,19 +3701,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3252 +#: ../../library/os.rst:3294 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3299 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3265 +#: ../../library/os.rst:3307 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 " @@ -3638,7 +3722,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3272 +#: ../../library/os.rst:3314 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3647,7 +3731,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3285 +#: ../../library/os.rst:3327 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3660,7 +3744,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3295 +#: ../../library/os.rst:3337 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3669,11 +3753,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3308 +#: ../../library/os.rst:3350 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3310 +#: ../../library/os.rst:3352 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 " @@ -3683,7 +3767,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3321 +#: ../../library/os.rst:3363 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3691,12 +3775,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3369 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3330 +#: ../../library/os.rst:3372 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3704,27 +3788,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3340 +#: ../../library/os.rst:3382 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3347 +#: ../../library/os.rst:3389 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3353 +#: ../../library/os.rst:3395 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3362 +#: ../../library/os.rst:3404 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3367 +#: ../../library/os.rst:3409 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3732,46 +3816,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3382 +#: ../../library/os.rst:3424 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:3398 +#: ../../library/os.rst:3440 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3400 +#: ../../library/os.rst:3442 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:3403 +#: ../../library/os.rst:3445 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:3406 +#: ../../library/os.rst:3448 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:3409 +#: ../../library/os.rst:3451 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:3413 +#: ../../library/os.rst:3455 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3415 +#: ../../library/os.rst:3457 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 " @@ -3781,7 +3865,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3426 +#: ../../library/os.rst:3468 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3789,13 +3873,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3428 +#: ../../library/os.rst:3470 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3442 +#: ../../library/os.rst:3484 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* " @@ -3803,7 +3887,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3447 +#: ../../library/os.rst:3489 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3817,7 +3901,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3458 +#: ../../library/os.rst:3500 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 " @@ -3828,7 +3912,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3466 +#: ../../library/os.rst:3508 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3841,7 +3925,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3475 +#: ../../library/os.rst:3517 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 " @@ -3851,42 +3935,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3481 +#: ../../library/os.rst:3523 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:3487 +#: ../../library/os.rst:3529 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:3493 +#: ../../library/os.rst:3535 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:3497 ../../library/os.rst:3558 +#: ../../library/os.rst:3539 ../../library/os.rst:3600 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:3510 +#: ../../library/os.rst:3552 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:3525 +#: ../../library/os.rst:3567 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3894,25 +3978,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3527 +#: ../../library/os.rst:3569 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:3541 +#: ../../library/os.rst:3583 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:3544 +#: ../../library/os.rst:3586 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:3547 +#: ../../library/os.rst:3589 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3920,20 +4004,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3554 +#: ../../library/os.rst:3596 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:3571 +#: ../../library/os.rst:3613 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:3586 +#: ../../library/os.rst:3628 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -3941,11 +4025,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3595 +#: ../../library/os.rst:3637 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3601 +#: ../../library/os.rst:3643 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 " @@ -3953,7 +4037,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3606 +#: ../../library/os.rst:3648 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/" @@ -3963,23 +4047,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3655 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3636 +#: ../../library/os.rst:3678 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3638 +#: ../../library/os.rst:3680 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3682 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3647 +#: ../../library/os.rst:3689 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." @@ -3988,7 +4072,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3695 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 " @@ -3996,87 +4080,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3658 +#: ../../library/os.rst:3700 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3661 +#: ../../library/os.rst:3703 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:3664 +#: ../../library/os.rst:3706 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:3668 +#: ../../library/os.rst:3710 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3671 +#: ../../library/os.rst:3713 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:3692 +#: ../../library/os.rst:3734 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3698 +#: ../../library/os.rst:3740 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:3701 ../../library/os.rst:3710 -#: ../../library/os.rst:3718 ../../library/os.rst:3727 +#: ../../library/os.rst:3743 ../../library/os.rst:3752 +#: ../../library/os.rst:3760 ../../library/os.rst:3769 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3707 +#: ../../library/os.rst:3749 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:3716 +#: ../../library/os.rst:3758 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3724 +#: ../../library/os.rst:3766 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3733 +#: ../../library/os.rst:3775 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:3736 +#: ../../library/os.rst:3778 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3742 +#: ../../library/os.rst:3784 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3788 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3750 +#: ../../library/os.rst:3792 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4084,7 +4168,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3758 +#: ../../library/os.rst:3800 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4092,12 +4176,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3760 ../../library/os.rst:3792 -#: ../../library/os.rst:3817 +#: ../../library/os.rst:3802 ../../library/os.rst:3834 +#: ../../library/os.rst:3859 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3766 +#: ../../library/os.rst:3808 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4105,14 +4189,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3774 +#: ../../library/os.rst:3816 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3782 +#: ../../library/os.rst:3824 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4120,7 +4204,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3790 +#: ../../library/os.rst:3832 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4128,7 +4212,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3798 +#: ../../library/os.rst:3840 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4140,13 +4224,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3854 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:3815 +#: ../../library/os.rst:3857 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4154,33 +4238,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3823 +#: ../../library/os.rst:3865 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3829 +#: ../../library/os.rst:3871 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:3835 +#: ../../library/os.rst:3877 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:3842 +#: ../../library/os.rst:3884 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3844 +#: ../../library/os.rst:3886 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3846 +#: ../../library/os.rst:3888 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 " @@ -4191,7 +4275,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3899 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 " @@ -4200,31 +4284,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3866 +#: ../../library/os.rst:3908 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3868 +#: ../../library/os.rst:3910 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:3872 +#: ../../library/os.rst:3914 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3875 +#: ../../library/os.rst:3917 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3879 +#: ../../library/os.rst:3921 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4232,7 +4316,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3925 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4240,14 +4324,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3890 +#: ../../library/os.rst:3932 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:3905 +#: ../../library/os.rst:3947 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 " @@ -4255,7 +4339,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3952 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 " @@ -4263,7 +4347,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3916 +#: ../../library/os.rst:3958 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4276,7 +4360,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3967 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4290,7 +4374,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3936 +#: ../../library/os.rst:3978 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 " @@ -4300,7 +4384,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3943 +#: ../../library/os.rst:3985 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 " @@ -4309,7 +4393,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3948 +#: ../../library/os.rst:3990 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4317,25 +4401,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3994 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3961 +#: ../../library/os.rst:4003 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3966 +#: ../../library/os.rst:4008 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3969 +#: ../../library/os.rst:4011 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 " @@ -4343,125 +4427,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:4017 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:3982 +#: ../../library/os.rst:4024 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:4032 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3998 +#: ../../library/os.rst:4040 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4005 +#: ../../library/os.rst:4047 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4054 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4019 +#: ../../library/os.rst:4061 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4068 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4033 +#: ../../library/os.rst:4075 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4082 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:4048 +#: ../../library/os.rst:4090 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:4056 +#: ../../library/os.rst:4098 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4063 +#: ../../library/os.rst:4105 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4070 +#: ../../library/os.rst:4112 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:4079 +#: ../../library/os.rst:4121 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4087 +#: ../../library/os.rst:4129 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:4095 +#: ../../library/os.rst:4137 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4102 +#: ../../library/os.rst:4144 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4109 +#: ../../library/os.rst:4151 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:4112 +#: ../../library/os.rst:4154 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4115 +#: ../../library/os.rst:4157 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4117 +#: ../../library/os.rst:4159 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4123 +#: ../../library/os.rst:4165 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4172 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, " @@ -4470,24 +4554,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4136 +#: ../../library/os.rst:4178 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4180 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4151 +#: ../../library/os.rst:4193 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:4154 +#: ../../library/os.rst:4196 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4498,11 +4582,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4162 +#: ../../library/os.rst:4204 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4164 +#: ../../library/os.rst:4206 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4510,15 +4594,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4168 +#: ../../library/os.rst:4210 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4220 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4222 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4526,27 +4610,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4187 +#: ../../library/os.rst:4229 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4236 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4198 +#: ../../library/os.rst:4240 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4200 +#: ../../library/os.rst:4242 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4247 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4554,17 +4638,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4252 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4216 +#: ../../library/os.rst:4258 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4224 +#: ../../library/os.rst:4266 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 " @@ -4574,7 +4658,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4232 +#: ../../library/os.rst:4274 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4586,60 +4670,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4284 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:4247 +#: ../../library/os.rst:4289 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:4251 +#: ../../library/os.rst:4293 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4254 +#: ../../library/os.rst:4296 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4257 +#: ../../library/os.rst:4299 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4266 -msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." +#: ../../library/os.rst:4308 +msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4268 +#: ../../library/os.rst:4310 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4270 +#: ../../library/os.rst:4312 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4315 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:4277 +#: ../../library/os.rst:4319 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 " @@ -4648,49 +4732,49 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4327 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4287 +#: ../../library/os.rst:4329 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4291 +#: ../../library/os.rst:4333 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4335 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4297 +#: ../../library/os.rst:4339 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4341 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4301 +#: ../../library/os.rst:4343 msgid "" -"These tuples correspond to the C library :c:func:" -"`posix_spawn_file_actions_addopen`, :c:func:" -"`posix_spawn_file_actions_addclose`, and :c:func:" -"`posix_spawn_file_actions_adddup2` API calls used to prepare for the :c:func:" -"`posix_spawn` call itself." +"These tuples correspond to the C library :c:func:`!" +"posix_spawn_file_actions_addopen`, :c:func:`!" +"posix_spawn_file_actions_addclose`, and :c:func:`!" +"posix_spawn_file_actions_adddup2` API calls used to prepare for the :c:func:" +"`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4307 +#: ../../library/os.rst:4349 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 " "will be made the same as its process ID. If the value of *setpgroup* is not " "set, the child will inherit the parent's process group ID. This argument " -"corresponds to the C library :c:macro:`POSIX_SPAWN_SETPGROUP` flag." +"corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4355 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 " @@ -4698,43 +4782,43 @@ msgid "" "the parent. In either case, if the set-user-ID and set-group-ID permission " "bits are enabled on the executable file, their effect will override the " "setting of the effective UID and GID. This argument corresponds to the C " -"library :c:macro:`POSIX_SPAWN_RESETIDS` flag." +"library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4321 +#: ../../library/os.rst:4363 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " -"``posix_spawn``. *setsid* requires :c:macro:`POSIX_SPAWN_SETSID` or :c:macro:" -"`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` is " -"raised." +"``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" +"macro:`!POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` " +"is raised." msgstr "" -#: ../../library/os.rst:4326 +#: ../../library/os.rst:4368 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 " -"parent's signal mask. This argument corresponds to the C library :c:macro:" -"`POSIX_SPAWN_SETSIGMASK` flag." +"parent's signal mask. This argument corresponds to the C library :c:macro:`!" +"POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4331 +#: ../../library/os.rst:4373 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " -"specified. This argument corresponds to the C library :c:macro:" -"`POSIX_SPAWN_SETSIGDEF` flag." +"specified. This argument corresponds to the C library :c:macro:`!" +"POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4377 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " "parameters. A value of ``None`` in the place of the scheduler policy " "indicates that is not being provided. This argument is a combination of the " -"C library :c:macro:`POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:" -"`POSIX_SPAWN_SETSCHEDULER` flags." +"C library :c:macro:`!POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:`!" +"POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4342 ../../library/os.rst:4358 +#: ../../library/os.rst:4384 ../../library/os.rst:4400 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4742,76 +4826,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4352 -msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." +#: ../../library/os.rst:4394 +msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4354 +#: ../../library/os.rst:4396 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:4362 +#: ../../library/os.rst:4404 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4406 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4370 +#: ../../library/os.rst:4412 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:4375 +#: ../../library/os.rst:4417 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4376 +#: ../../library/os.rst:4418 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4420 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4380 +#: ../../library/os.rst:4422 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:4384 +#: ../../library/os.rst:4426 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:4389 +#: ../../library/os.rst:4431 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:4393 +#: ../../library/os.rst:4435 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4409 +#: ../../library/os.rst:4451 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4453 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4819,7 +4903,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4458 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 " @@ -4828,13 +4912,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4464 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:4425 +#: ../../library/os.rst:4467 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4846,7 +4930,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4476 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4859,7 +4943,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4444 +#: ../../library/os.rst:4486 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 " @@ -4871,13 +4955,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4495 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4462 +#: ../../library/os.rst:4504 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4885,7 +4969,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4466 +#: ../../library/os.rst:4508 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4893,7 +4977,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4478 +#: ../../library/os.rst:4520 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4901,7 +4985,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4488 +#: ../../library/os.rst:4530 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4910,7 +4994,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4500 +#: ../../library/os.rst:4542 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4920,11 +5004,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4511 +#: ../../library/os.rst:4553 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4513 +#: ../../library/os.rst:4555 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -4932,7 +5016,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4518 +#: ../../library/os.rst:4560 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 " @@ -4940,28 +5024,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4523 +#: ../../library/os.rst:4565 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:4527 +#: ../../library/os.rst:4569 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:4531 +#: ../../library/os.rst:4573 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." +"supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4535 +#: ../../library/os.rst:4577 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 " @@ -4972,14 +5056,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4585 msgid "" -"To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " +"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:4547 +#: ../../library/os.rst:4589 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -4987,7 +5071,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4549 +#: ../../library/os.rst:4591 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -4995,13 +5079,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4595 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4602 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 " @@ -5012,13 +5096,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4568 +#: ../../library/os.rst:4610 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:4571 +#: ../../library/os.rst:4613 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 :" @@ -5027,7 +5111,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4619 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5035,54 +5119,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4582 +#: ../../library/os.rst:4624 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:4586 +#: ../../library/os.rst:4628 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4593 +#: ../../library/os.rst:4635 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4638 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4597 +#: ../../library/os.rst:4639 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4598 +#: ../../library/os.rst:4640 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4599 +#: ../../library/os.rst:4641 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4600 +#: ../../library/os.rst:4642 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4644 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:4606 +#: ../../library/os.rst:4648 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5092,7 +5176,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4662 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5101,83 +5185,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4626 +#: ../../library/os.rst:4668 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4629 ../../library/os.rst:4701 +#: ../../library/os.rst:4671 ../../library/os.rst:4743 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4678 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4685 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4687 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4690 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4652 +#: ../../library/os.rst:4694 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4655 +#: ../../library/os.rst:4697 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4656 +#: ../../library/os.rst:4698 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4657 +#: ../../library/os.rst:4699 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4658 +#: ../../library/os.rst:4700 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4659 +#: ../../library/os.rst:4701 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4661 +#: ../../library/os.rst:4703 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4673 +#: ../../library/os.rst:4715 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4675 +#: ../../library/os.rst:4717 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 " @@ -5186,7 +5270,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4680 +#: ../../library/os.rst:4722 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 " @@ -5196,7 +5280,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4729 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5205,7 +5289,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4693 +#: ../../library/os.rst:4735 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 " @@ -5217,7 +5301,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4756 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 " @@ -5226,13 +5310,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4721 ../../library/os.rst:4735 +#: ../../library/os.rst:4763 ../../library/os.rst:4777 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4771 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5241,118 +5325,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4746 +#: ../../library/os.rst:4788 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4749 +#: ../../library/os.rst:4791 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4750 +#: ../../library/os.rst:4792 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4751 +#: ../../library/os.rst:4793 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4752 +#: ../../library/os.rst:4794 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4799 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4760 +#: ../../library/os.rst:4802 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4766 +#: ../../library/os.rst:4808 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4775 +#: ../../library/os.rst:4817 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4778 +#: ../../library/os.rst:4820 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4788 +#: ../../library/os.rst:4830 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4791 ../../library/os.rst:4823 +#: ../../library/os.rst:4833 ../../library/os.rst:4865 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4842 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4804 +#: ../../library/os.rst:4846 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4811 +#: ../../library/os.rst:4853 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4862 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4835 +#: ../../library/os.rst:4877 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4884 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4848 +#: ../../library/os.rst:4890 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4892 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4852 +#: ../../library/os.rst:4894 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:4855 +#: ../../library/os.rst:4897 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 " @@ -5360,15 +5444,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4859 +#: ../../library/os.rst:4901 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4861 +#: ../../library/os.rst:4903 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4905 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 " @@ -5376,217 +5460,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4870 +#: ../../library/os.rst:4912 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4920 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:4884 +#: ../../library/os.rst:4926 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4887 ../../library/os.rst:4953 +#: ../../library/os.rst:4929 ../../library/os.rst:4995 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4936 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4898 +#: ../../library/os.rst:4940 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4947 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4908 +#: ../../library/os.rst:4950 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:4916 +#: ../../library/os.rst:4958 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4924 +#: ../../library/os.rst:4966 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:4933 +#: ../../library/os.rst:4975 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4935 +#: ../../library/os.rst:4977 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4942 +#: ../../library/os.rst:4984 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4944 +#: ../../library/os.rst:4986 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4993 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4959 +#: ../../library/os.rst:5001 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4961 +#: ../../library/os.rst:5003 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:4967 +#: ../../library/os.rst:5009 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4972 +#: ../../library/os.rst:5014 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4976 +#: ../../library/os.rst:5018 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4981 +#: ../../library/os.rst:5023 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5027 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4989 +#: ../../library/os.rst:5031 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:5035 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4997 +#: ../../library/os.rst:5039 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:5004 +#: ../../library/os.rst:5046 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:5008 +#: ../../library/os.rst:5050 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5012 +#: ../../library/os.rst:5054 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5017 +#: ../../library/os.rst:5059 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5065 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5029 +#: ../../library/os.rst:5071 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:5036 +#: ../../library/os.rst:5078 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:5043 +#: ../../library/os.rst:5085 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:5049 +#: ../../library/os.rst:5091 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:5055 +#: ../../library/os.rst:5097 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:5061 +#: ../../library/os.rst:5103 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5108 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:5073 +#: ../../library/os.rst:5115 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:5080 +#: ../../library/os.rst:5122 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5085 +#: ../../library/os.rst:5127 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 " @@ -5597,13 +5681,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5093 +#: ../../library/os.rst:5135 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5096 +#: ../../library/os.rst:5138 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 " @@ -5611,33 +5695,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5106 +#: ../../library/os.rst:5148 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:5115 +#: ../../library/os.rst:5157 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:5117 +#: ../../library/os.rst:5159 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:5127 +#: ../../library/os.rst:5169 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:5136 +#: ../../library/os.rst:5178 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5646,44 +5730,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5146 +#: ../../library/os.rst:5188 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:5152 +#: ../../library/os.rst:5194 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5155 +#: ../../library/os.rst:5197 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5158 +#: ../../library/os.rst:5200 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5164 +#: ../../library/os.rst:5206 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:5172 +#: ../../library/os.rst:5214 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:5181 +#: ../../library/os.rst:5223 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5692,7 +5776,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5191 +#: ../../library/os.rst:5233 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5700,27 +5784,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5200 +#: ../../library/os.rst:5242 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:5208 +#: ../../library/os.rst:5250 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:5215 +#: ../../library/os.rst:5257 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:5222 +#: ../../library/os.rst:5264 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 " @@ -5729,36 +5813,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5231 +#: ../../library/os.rst:5273 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:5242 +#: ../../library/os.rst:5284 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:5250 +#: ../../library/os.rst:5292 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5255 +#: ../../library/os.rst:5297 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5258 +#: ../../library/os.rst:5300 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5261 +#: ../../library/os.rst:5303 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5766,36 +5850,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5266 +#: ../../library/os.rst:5308 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5270 +#: ../../library/os.rst:5312 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5315 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5279 +#: ../../library/os.rst:5321 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5281 +#: ../../library/os.rst:5323 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:5285 +#: ../../library/os.rst:5327 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5805,63 +5889,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5292 +#: ../../library/os.rst:5334 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:5296 +#: ../../library/os.rst:5338 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5299 +#: ../../library/os.rst:5341 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:5303 +#: ../../library/os.rst:5345 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5307 +#: ../../library/os.rst:5349 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:5311 +#: ../../library/os.rst:5353 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:5317 +#: ../../library/os.rst:5359 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5365 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:5327 +#: ../../library/os.rst:5369 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:5334 +#: ../../library/os.rst:5376 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5877,7 +5961,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "process" msgstr "process" @@ -5917,94 +6001,94 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2534 +#: ../../library/os.rst:796 ../../library/os.rst:2574 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1298 ../../library/os.rst:2904 +#: ../../library/os.rst:1338 ../../library/os.rst:2944 msgid "module" msgstr "module(模組)" -#: ../../library/os.rst:1298 +#: ../../library/os.rst:1338 msgid "pty" msgstr "pty" -#: ../../library/os.rst:1938 ../../library/os.rst:2332 -#: ../../library/os.rst:2534 ../../library/os.rst:3438 -#: ../../library/os.rst:3537 +#: ../../library/os.rst:1978 ../../library/os.rst:2372 +#: ../../library/os.rst:2574 ../../library/os.rst:3480 +#: ../../library/os.rst:3579 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1938 +#: ../../library/os.rst:1978 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2904 +#: ../../library/os.rst:2944 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3438 ../../library/os.rst:3537 +#: ../../library/os.rst:3480 ../../library/os.rst:3579 msgid "walking" msgstr "" -#: ../../library/os.rst:3438 ../../library/os.rst:3537 +#: ../../library/os.rst:3480 ../../library/os.rst:3579 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "killing" msgstr "" -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5161 ../../library/os.rst:5197 +#: ../../library/os.rst:5203 ../../library/os.rst:5239 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5161 ../../library/os.rst:5169 -#: ../../library/os.rst:5177 ../../library/os.rst:5188 -#: ../../library/os.rst:5197 +#: ../../library/os.rst:5203 ../../library/os.rst:5211 +#: ../../library/os.rst:5219 ../../library/os.rst:5230 +#: ../../library/os.rst:5239 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5211 msgid ".." msgstr ".." -#: ../../library/os.rst:5177 ../../library/os.rst:5188 +#: ../../library/os.rst:5219 ../../library/os.rst:5230 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5220 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5220 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/profile.po b/library/profile.po index 07d71efeb7..220591bbab 100644 --- a/library/profile.po +++ b/library/profile.po @@ -197,11 +197,11 @@ msgstr "" #: ../../library/profile.rst:136 msgid "Added the ``-m`` option to :mod:`cProfile`." -msgstr "" +msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" #: ../../library/profile.rst:139 msgid "Added the ``-m`` option to :mod:`profile`." -msgstr "" +msgstr "新增 ``-m`` 選項到 :mod:`profile`。" #: ../../library/profile.rst:142 msgid "" @@ -354,7 +354,7 @@ msgstr "" #: ../../library/profile.rst:279 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/profile.rst:284 msgid "Start collecting profiling data. Only in :mod:`cProfile`." diff --git a/library/random.po b/library/random.po index d61258b9d7..a8f2db6573 100644 --- a/library/random.po +++ b/library/random.po @@ -551,7 +551,7 @@ msgstr "" #: ../../library/random.rst:331 msgid "Added the default value for ``lambd``." -msgstr "" +msgstr "新增 ``lambd`` 的預設值。" #: ../../library/random.rst:337 msgid "" diff --git a/library/re.po b/library/re.po index e7d4eef380..e55587d2b6 100644 --- a/library/re.po +++ b/library/re.po @@ -1190,7 +1190,7 @@ msgstr "" #: ../../library/re.rst:926 ../../library/re.rst:1017 ../../library/re.rst:1046 msgid "Added the optional flags argument." -msgstr "" +msgstr "新增可選的旗標引數。" #: ../../library/re.rst:929 msgid "" diff --git a/library/runpy.po b/library/runpy.po index 43339e044b..1e22ec3f77 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-07 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -65,8 +65,8 @@ msgstr "" msgid "" "The *mod_name* argument should be an absolute module name. If the module " "name refers to a package rather than a normal module, then that package is " -"imported and the ``__main__`` submodule within that package is then executed " -"and the resulting module globals dictionary returned." +"imported and the :mod:`__main__` submodule within that package is then " +"executed and the resulting module globals dictionary returned." msgstr "" #: ../../library/runpy.rst:46 @@ -78,7 +78,7 @@ msgid "" "overridden by :func:`run_module`." msgstr "" -#: ../../library/runpy.rst:52 ../../library/runpy.rst:126 +#: ../../library/runpy.rst:52 ../../library/runpy.rst:127 msgid "" "The special global variables ``__name__``, ``__spec__``, ``__file__``, " "``__cached__``, ``__loader__`` and ``__package__`` are set in the globals " @@ -120,7 +120,7 @@ msgstr "" msgid "" "Note that this manipulation of :mod:`sys` is not thread-safe. Other threads " "may see the partially initialised module, as well as the altered list of " -"arguments. It is recommended that the :mod:`sys` module be left alone when " +"arguments. It is recommended that the ``sys`` module be left alone when " "invoking this function from threaded code." msgstr "" @@ -132,7 +132,7 @@ msgstr "" #: ../../library/runpy.rst:84 msgid "" -"Added ability to execute packages by looking for a ``__main__`` submodule." +"Added ability to execute packages by looking for a :mod:`__main__` submodule." msgstr "" #: ../../library/runpy.rst:87 @@ -158,22 +158,23 @@ msgid "" "Execute the code at the named filesystem location and return the resulting " "module globals dictionary. As with a script name supplied to the CPython " "command line, the supplied path may refer to a Python source file, a " -"compiled bytecode file or a valid sys.path entry containing a ``__main__`` " -"module (e.g. a zipfile containing a top-level ``__main__.py`` file)." +"compiled bytecode file or a valid :data:`sys.path` entry containing a :mod:" +"`__main__` module (e.g. a zipfile containing a top-level ``__main__.py`` " +"file)." msgstr "" -#: ../../library/runpy.rst:112 +#: ../../library/runpy.rst:113 msgid "" "For a simple script, the specified code is simply executed in a fresh module " -"namespace. For a valid sys.path entry (typically a zipfile or directory), " -"the entry is first added to the beginning of ``sys.path``. The function then " -"looks for and executes a :mod:`__main__` module using the updated path. Note " -"that there is no special protection against invoking an existing :mod:" -"`__main__` entry located elsewhere on ``sys.path`` if there is no such " -"module at the specified location." +"namespace. For a valid :data:`sys.path` entry (typically a zipfile or " +"directory), the entry is first added to the beginning of ``sys.path``. The " +"function then looks for and executes a :mod:`__main__` module using the " +"updated path. Note that there is no special protection against invoking an " +"existing ``__main__`` entry located elsewhere on ``sys.path`` if there is no " +"such module at the specified location." msgstr "" -#: ../../library/runpy.rst:120 +#: ../../library/runpy.rst:121 msgid "" "The optional dictionary argument *init_globals* may be used to pre-populate " "the module's globals dictionary before the code is executed. The supplied " @@ -182,13 +183,13 @@ msgid "" "overridden by :func:`run_path`." msgstr "" -#: ../../library/runpy.rst:132 +#: ../../library/runpy.rst:133 msgid "" "``__name__`` is set to *run_name* if this optional argument is not :const:" "`None` and to ``''`` otherwise." msgstr "" -#: ../../library/runpy.rst:135 +#: ../../library/runpy.rst:136 msgid "" "If the supplied path directly references a script file (whether as source or " "as precompiled byte code), then ``__file__`` will be set to the supplied " @@ -196,79 +197,79 @@ msgid "" "will all be set to :const:`None`." msgstr "" -#: ../../library/runpy.rst:140 +#: ../../library/runpy.rst:141 msgid "" -"If the supplied path is a reference to a valid sys.path entry, then " -"``__spec__`` will be set appropriately for the imported ``__main__`` module " -"(that is, ``__spec__.name`` will always be ``__main__``). ``__file__``, " -"``__cached__``, ``__loader__`` and ``__package__`` will be :ref:`set as " -"normal ` based on the module spec." +"If the supplied path is a reference to a valid :data:`sys.path` entry, then " +"``__spec__`` will be set appropriately for the imported :mod:`__main__` " +"module (that is, ``__spec__.name`` will always be ``__main__``). " +"``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be :" +"ref:`set as normal ` based on the module spec." msgstr "" -#: ../../library/runpy.rst:146 +#: ../../library/runpy.rst:147 msgid "" -"A number of alterations are also made to the :mod:`sys` module. Firstly, " -"``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated " -"with the value of ``path_name`` and ``sys.modules[__name__]`` is updated " -"with a temporary module object for the module being executed. All " +"A number of alterations are also made to the :mod:`sys` module. Firstly, :" +"data:`sys.path` may be altered as described above. ``sys.argv[0]`` is " +"updated with the value of ``path_name`` and ``sys.modules[__name__]`` is " +"updated with a temporary module object for the module being executed. All " "modifications to items in :mod:`sys` are reverted before the function " "returns." msgstr "" -#: ../../library/runpy.rst:153 +#: ../../library/runpy.rst:154 msgid "" "Note that, unlike :func:`run_module`, the alterations made to :mod:`sys` are " "not optional in this function as these adjustments are essential to allowing " -"the execution of sys.path entries. As the thread-safety limitations still " -"apply, use of this function in threaded code should be either serialised " -"with the import lock or delegated to a separate process." +"the execution of :data:`sys.path` entries. As the thread-safety limitations " +"still apply, use of this function in threaded code should be either " +"serialised with the import lock or delegated to a separate process." msgstr "" -#: ../../library/runpy.rst:160 +#: ../../library/runpy.rst:161 msgid "" ":ref:`using-on-interface-options` for equivalent functionality on the " "command line (``python path/to/script``)." msgstr "" -#: ../../library/runpy.rst:165 +#: ../../library/runpy.rst:166 msgid "" "Updated to take advantage of the module spec feature added by :pep:`451`. " "This allows ``__cached__`` to be set correctly in the case where " -"``__main__`` is imported from a valid sys.path entry rather than being " -"executed directly." +"``__main__`` is imported from a valid :data:`sys.path` entry rather than " +"being executed directly." msgstr "" -#: ../../library/runpy.rst:171 +#: ../../library/runpy.rst:172 msgid "" "The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " "deprecated." msgstr "" -#: ../../library/runpy.rst:178 +#: ../../library/runpy.rst:179 msgid ":pep:`338` -- Executing modules as scripts" msgstr "" -#: ../../library/runpy.rst:178 ../../library/runpy.rst:181 +#: ../../library/runpy.rst:179 ../../library/runpy.rst:182 msgid "PEP written and implemented by Nick Coghlan." msgstr "" -#: ../../library/runpy.rst:181 +#: ../../library/runpy.rst:182 msgid ":pep:`366` -- Main module explicit relative imports" msgstr "" -#: ../../library/runpy.rst:184 +#: ../../library/runpy.rst:185 msgid ":pep:`451` -- A ModuleSpec Type for the Import System" msgstr "" -#: ../../library/runpy.rst:184 +#: ../../library/runpy.rst:185 msgid "PEP written and implemented by Eric Snow" msgstr "" -#: ../../library/runpy.rst:186 +#: ../../library/runpy.rst:187 msgid ":ref:`using-on-general` - CPython command line details" msgstr "" -#: ../../library/runpy.rst:188 +#: ../../library/runpy.rst:189 msgid "The :func:`importlib.import_module` function" msgstr "" diff --git a/library/shelve.po b/library/shelve.po index b669a8f6f7..cc3258444d 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -191,7 +191,7 @@ msgstr "" #: ../../library/shelve.rst:142 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/shelve.rst:152 msgid "" diff --git a/library/shutil.po b/library/shutil.po index 83786bf0f4..9a21435530 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -446,7 +446,7 @@ msgstr "*dir_fd* 參數。" #: ../../library/shutil.rst:343 msgid "Added the *onexc* parameter, deprecated *onerror*." -msgstr "" +msgstr "新增 *onexc* 參數並棄用 *onerror*。" #: ../../library/shutil.rst:348 msgid "" diff --git a/library/site.po b/library/site.po index 37bb58f89f..8e1b8bb8fc 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -214,10 +214,9 @@ msgid "" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." "local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" "` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " -"Windows. This value is used by Distutils to compute the installation " -"directories for scripts, data files, Python modules, etc. for the :ref:`user " -"installation scheme `. See also :envvar:" -"`PYTHONUSERBASE`." +"Windows. This value is used to compute the installation directories for " +"scripts, data files, Python modules, etc. for the user installation scheme. " +"See also :envvar:`PYTHONUSERBASE`." msgstr "" #: ../../library/site.rst:200 diff --git a/library/socket.po b/library/socket.po index 7bc624ab87..ab9e6f8da9 100644 --- a/library/socket.po +++ b/library/socket.po @@ -423,11 +423,11 @@ msgstr "" #: ../../library/socket.rst:247 msgid "``HV_GUID_ZERO``" -msgstr "" +msgstr "``HV_GUID_ZERO``" #: ../../library/socket.rst:248 msgid "``HV_GUID_BROADCAST``" -msgstr "" +msgstr "``HV_GUID_BROADCAST``" #: ../../library/socket.rst:249 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index d2781b6b84..0e6a2ccf5f 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1657,7 +1657,7 @@ msgstr "" #: ../../library/sqlite3.rst:1749 msgid "Added support of slicing." -msgstr "" +msgstr "新增對切片的支援。" #: ../../library/sqlite3.rst:1756 msgid "Blob objects" diff --git a/library/statistics.po b/library/statistics.po index 6f8f10c91f..7858cc8acd 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-08-15 00:03+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1275,11 +1275,15 @@ msgstr "" msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:925 +#: ../../library/statistics.rst:927 +msgid "Classic probability problems" +msgstr "" + +#: ../../library/statistics.rst:929 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:927 +#: ../../library/statistics.rst:931 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1291,7 +1295,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:940 +#: ../../library/statistics.rst:944 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1299,7 +1303,11 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:950 +#: ../../library/statistics.rst:956 +msgid "Monte Carlo inputs for simulations" +msgstr "" + +#: ../../library/statistics.rst:958 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1309,7 +1317,11 @@ msgstr "" "樣本以進行 `Monte Carlo 模擬 `_:" -#: ../../library/statistics.rst:966 +#: ../../library/statistics.rst:975 +msgid "Approximating binomial distributions" +msgstr "" + +#: ../../library/statistics.rst:977 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1319,7 +1331,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:971 +#: ../../library/statistics.rst:982 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1332,11 +1344,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1003 +#: ../../library/statistics.rst:1016 +msgid "Naive bayesian classifier" +msgstr "" + +#: ../../library/statistics.rst:1018 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1005 +#: ../../library/statistics.rst:1020 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1347,7 +1363,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1010 +#: ../../library/statistics.rst:1025 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1356,13 +1372,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1023 +#: ../../library/statistics.rst:1038 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1032 +#: ../../library/statistics.rst:1047 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1373,7 +1389,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1047 +#: ../../library/statistics.rst:1062 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" + +#: ../../library/statistics.rst:1073 +msgid "Kernel density estimation" +msgstr "" + +#: ../../library/statistics.rst:1075 +msgid "" +"It is possible to estimate a continuous probability density function from a " +"fixed number of discrete samples." +msgstr "" + +#: ../../library/statistics.rst:1078 +msgid "" +"The basic idea is to smooth the data using `a kernel function such as a " +"normal distribution, triangular distribution, or uniform distribution " +"`_. The degree of " +"smoothing is controlled by a single parameter, ``h``, representing the " +"variance of the kernel function." +msgstr "" + +#: ../../library/statistics.rst:1097 +msgid "" +"`Wikipedia has an example `_ where we can use the ``kde_normal()`` " +"recipe to generate and plot a probability density function estimated from a " +"small sample:" +msgstr "" + +#: ../../library/statistics.rst:1109 +msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" +msgstr "" + +#: ../../library/statistics.rst:-1 +msgid "Scatter plot of the estimated probability density function." +msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index 7f62188dbe..3aaa6cf07c 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -893,7 +893,7 @@ msgstr "" #: ../../library/subprocess.rst:704 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/subprocess.rst:707 msgid "" diff --git a/library/sys.po b/library/sys.po index 7f8d4f11b0..c8381f9521 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -368,8 +368,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:910 -#: ../../library/sys.rst:1647 ../../library/sys.rst:1880 +#: ../../library/sys.rst:282 ../../library/sys.rst:940 +#: ../../library/sys.rst:1677 ../../library/sys.rst:1914 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -414,13 +414,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:339 ../../library/sys.rst:1057 -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:339 ../../library/sys.rst:1087 +#: ../../library/sys.rst:1793 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:339 ../../library/sys.rst:1057 -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:339 ../../library/sys.rst:1087 +#: ../../library/sys.rst:1793 msgid "Explanation" msgstr "解釋" @@ -658,7 +658,7 @@ msgid "" msgstr "" #: ../../library/sys.rst:519 ../../library/sys.rst:580 -#: ../../library/sys.rst:956 +#: ../../library/sys.rst:986 msgid "attribute" msgstr "屬性" @@ -857,191 +857,171 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:580 +#: ../../library/sys.rst:577 +msgid "Attributes of the :data:`!float_info` :term:`named tuple`" +msgstr "" + +#: ../../library/sys.rst:581 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:580 ../../library/sys.rst:956 +#: ../../library/sys.rst:582 ../../library/sys.rst:986 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:582 -msgid "``epsilon``" -msgstr "``epsilon``" - -#: ../../library/sys.rst:582 -msgid "``DBL_EPSILON``" -msgstr "``DBL_EPSILON``" +#: ../../library/sys.rst:585 +msgid ":c:macro:`!DBL_EPSILON`" +msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " -"representable as a float" +"representable as a float." msgstr "" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "See also :func:`math.ulp`." -msgstr "另請參閱 :func:`math.ulp`\\ 。" +msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:587 -msgid "``dig``" -msgstr "``dig``" +#: ../../library/sys.rst:592 +msgid ":c:macro:`!DBL_DIG`" +msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:587 -msgid "``DBL_DIG``" -msgstr "``DBL_DIG``" - -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:593 msgid "" -"maximum number of decimal digits that can be faithfully represented in a " -"float; see below" +"The maximum number of decimal digits that can be faithfully represented in a " +"float; see below." msgstr "" -#: ../../library/sys.rst:590 -msgid "``mant_dig``" -msgstr "``mant_dig``" - -#: ../../library/sys.rst:590 -msgid "``DBL_MANT_DIG``" -msgstr "``DBL_MANT_DIG``" +#: ../../library/sys.rst:597 +msgid ":c:macro:`!DBL_MANT_DIG`" +msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:598 msgid "" -"float precision: the number of base-``radix`` digits in the significand of a " -"float" +"Float precision: the number of base-``radix`` digits in the significand of a " +"float." msgstr "" -#: ../../library/sys.rst:593 -msgid "``max``" -msgstr "``max``" +#: ../../library/sys.rst:602 +msgid ":c:macro:`!DBL_MAX`" +msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:593 -msgid "``DBL_MAX``" -msgstr "``DBL_MAX``" - -#: ../../library/sys.rst:593 -msgid "maximum representable positive finite float" +#: ../../library/sys.rst:603 +msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:595 -msgid "``max_exp``" -msgstr "``max_exp``" - -#: ../../library/sys.rst:595 -msgid "``DBL_MAX_EXP``" -msgstr "``DBL_MAX_EXP``" +#: ../../library/sys.rst:606 +msgid ":c:macro:`!DBL_MAX_EXP`" +msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:595 +#: ../../library/sys.rst:607 msgid "" -"maximum integer *e* such that ``radix**(e-1)`` is a representable finite " -"float" +"The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " +"float." msgstr "" -#: ../../library/sys.rst:598 -msgid "``max_10_exp``" -msgstr "``max_10_exp``" +#: ../../library/sys.rst:611 +msgid ":c:macro:`!DBL_MAX_10_EXP`" +msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:598 -msgid "``DBL_MAX_10_EXP``" -msgstr "``DBL_MAX_10_EXP``" - -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:612 msgid "" -"maximum integer *e* such that ``10**e`` is in the range of representable " -"finite floats" +"The maximum integer *e* such that ``10**e`` is in the range of representable " +"finite floats." msgstr "" -#: ../../library/sys.rst:601 -msgid "``min``" -msgstr "``min``" +#: ../../library/sys.rst:616 +msgid ":c:macro:`!DBL_MIN`" +msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:601 -msgid "``DBL_MIN``" -msgstr "``DBL_MIN``" - -#: ../../library/sys.rst:601 -msgid "minimum representable positive *normalized* float" +#: ../../library/sys.rst:617 +msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:619 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:607 -msgid "``min_exp``" -msgstr "``min_exp``" - -#: ../../library/sys.rst:607 -msgid "``DBL_MIN_EXP``" -msgstr "``DBL_MIN_EXP``" +#: ../../library/sys.rst:623 +msgid ":c:macro:`!DBL_MIN_EXP`" +msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:607 -msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" +#: ../../library/sys.rst:624 +msgid "" +"The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:610 -msgid "``min_10_exp``" -msgstr "``min_10_exp``" +#: ../../library/sys.rst:628 +msgid ":c:macro:`!DBL_MIN_10_EXP`" +msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:610 -msgid "``DBL_MIN_10_EXP``" -msgstr "``DBL_MIN_10_EXP``" +#: ../../library/sys.rst:629 +msgid "The minimum integer *e* such that ``10**e`` is a normalized float." +msgstr "" -#: ../../library/sys.rst:610 -msgid "minimum integer *e* such that ``10**e`` is a normalized float" +#: ../../library/sys.rst:632 +msgid ":c:macro:`!FLT_RADIX`" +msgstr ":c:macro:`!FLT_RADIX`" + +#: ../../library/sys.rst:633 +msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:613 -msgid "``radix``" -msgstr "``radix``" +#: ../../library/sys.rst:636 +msgid ":c:macro:`!FLT_ROUNDS`" +msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:613 -msgid "``FLT_RADIX``" -msgstr "``FLT_RADIX``" +#: ../../library/sys.rst:637 +msgid "" +"An integer representing the rounding mode for floating-point arithmetic. " +"This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " +"interpreter startup time:" +msgstr "" -#: ../../library/sys.rst:613 -msgid "radix of exponent representation" +#: ../../library/sys.rst:641 +msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:615 -msgid "``rounds``" -msgstr "``rounds``" +#: ../../library/sys.rst:642 +msgid "``0``: toward zero" +msgstr "" -#: ../../library/sys.rst:615 -msgid "``FLT_ROUNDS``" -msgstr "``FLT_ROUNDS``" +#: ../../library/sys.rst:643 +msgid "``1``: to nearest" +msgstr "" -#: ../../library/sys.rst:615 -msgid "" -"integer representing the rounding mode for floating-point arithmetic. This " -"reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " -"time: ``-1`` indeterminable, ``0`` toward zero, ``1`` to nearest, ``2`` " -"toward positive infinity, ``3`` toward negative infinity" +#: ../../library/sys.rst:644 +msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:645 +msgid "``3``: toward negative infinity" +msgstr "" + +#: ../../library/sys.rst:647 msgid "" -"All other values for ``FLT_ROUNDS`` characterize implementation-defined " -"rounding behavior." +"All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" +"defined rounding behavior." msgstr "" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:650 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " -"``s`` is any string representing a decimal number with at most :attr:`sys." +"``s`` is any string representing a decimal number with at most :attr:`!sys." "float_info.dig` significant digits, then converting ``s`` to a float and " "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:642 +#: ../../library/sys.rst:663 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:651 +#: ../../library/sys.rst:672 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1051,7 +1031,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:685 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1061,42 +1041,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:671 +#: ../../library/sys.rst:692 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:700 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:686 +#: ../../library/sys.rst:707 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:688 +#: ../../library/sys.rst:709 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:716 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:701 +#: ../../library/sys.rst:722 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:706 ../../library/sys.rst:1377 +#: ../../library/sys.rst:727 ../../library/sys.rst:1407 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:711 +#: ../../library/sys.rst:732 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:744 +#: ../../library/sys.rst:765 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1151,20 +1131,35 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:762 +#: ../../library/sys.rst:783 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:769 +#: ../../library/sys.rst:790 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:776 +#: ../../library/sys.rst:794 +msgid "" +"Note that the returned value may not actually reflect how many references to " +"the object are actually held. For example, some objects are \"immortal\" " +"and have a very high refcount that does not reflect the actual number of " +"references. Consequently, do not rely on the returned value to be accurate, " +"other than a value of 0 or 1." +msgstr "" + +#: ../../library/sys.rst:800 +msgid "" +"Immortal objects have very large refcounts that do not match the actual " +"number of references to the object." +msgstr "" + +#: ../../library/sys.rst:806 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1172,46 +1167,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:814 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:789 +#: ../../library/sys.rst:819 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:792 +#: ../../library/sys.rst:822 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:795 +#: ../../library/sys.rst:825 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:799 +#: ../../library/sys.rst:829 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:805 +#: ../../library/sys.rst:835 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:813 +#: ../../library/sys.rst:843 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1220,7 +1215,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:818 +#: ../../library/sys.rst:848 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1228,13 +1223,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:822 ../../library/sys.rst:838 +#: ../../library/sys.rst:852 ../../library/sys.rst:868 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:828 +#: ../../library/sys.rst:858 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1243,7 +1238,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:834 +#: ../../library/sys.rst:864 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1251,15 +1246,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:878 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:887 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:891 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1267,7 +1262,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:899 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1279,54 +1274,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:880 +#: ../../library/sys.rst:910 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:882 +#: ../../library/sys.rst:912 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:915 msgid "Constant" msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:915 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:917 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:917 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:889 +#: ../../library/sys.rst:919 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:889 +#: ../../library/sys.rst:919 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:922 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:922 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:926 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:900 +#: ../../library/sys.rst:930 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1334,24 +1329,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:906 +#: ../../library/sys.rst:936 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:942 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:916 +#: ../../library/sys.rst:946 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:952 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1361,103 +1356,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:959 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:933 ../../library/sys.rst:1579 +#: ../../library/sys.rst:963 ../../library/sys.rst:1609 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:939 +#: ../../library/sys.rst:969 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:945 ../../library/sys.rst:1600 +#: ../../library/sys.rst:975 ../../library/sys.rst:1630 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:981 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:988 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:988 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:990 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:990 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:992 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:992 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:964 +#: ../../library/sys.rst:994 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:964 +#: ../../library/sys.rst:994 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:996 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:996 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:999 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:999 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:972 +#: ../../library/sys.rst:1002 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:972 +#: ../../library/sys.rst:1002 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:1004 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:1004 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:980 +#: ../../library/sys.rst:1010 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:986 +#: ../../library/sys.rst:1016 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1465,7 +1460,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1027 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1473,25 +1468,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1002 +#: ../../library/sys.rst:1032 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1007 +#: ../../library/sys.rst:1037 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1011 +#: ../../library/sys.rst:1041 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1015 +#: ../../library/sys.rst:1045 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1503,13 +1498,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1025 +#: ../../library/sys.rst:1055 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1058 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1518,7 +1513,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1065 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1528,61 +1523,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1046 +#: ../../library/sys.rst:1076 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1081 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1089 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1089 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1063 +#: ../../library/sys.rst:1093 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1063 +#: ../../library/sys.rst:1093 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1096 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1096 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1100 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1100 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1108 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1084 +#: ../../library/sys.rst:1114 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1090 +#: ../../library/sys.rst:1120 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1599,13 +1594,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1092 +#: ../../library/sys.rst:1122 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1101 +#: ../../library/sys.rst:1131 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1617,19 +1612,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1109 +#: ../../library/sys.rst:1139 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1145 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1152 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1640,34 +1635,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1166 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1142 +#: ../../library/sys.rst:1172 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1149 +#: ../../library/sys.rst:1179 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1182 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1190 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1680,27 +1675,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1203 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1203 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1177 +#: ../../library/sys.rst:1207 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1176 +#: ../../library/sys.rst:1206 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1212 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1708,7 +1703,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1220 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1720,78 +1715,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1202 +#: ../../library/sys.rst:1232 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1205 +#: ../../library/sys.rst:1235 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1214 +#: ../../library/sys.rst:1244 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1218 +#: ../../library/sys.rst:1248 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1222 +#: ../../library/sys.rst:1252 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1224 +#: ../../library/sys.rst:1254 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1226 +#: ../../library/sys.rst:1256 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1229 +#: ../../library/sys.rst:1259 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1232 +#: ../../library/sys.rst:1262 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1238 +#: ../../library/sys.rst:1268 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1273 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1247 ../../library/sys.rst:1258 +#: ../../library/sys.rst:1277 ../../library/sys.rst:1288 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1282 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1799,13 +1794,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1293 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1266 +#: ../../library/sys.rst:1296 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1814,75 +1809,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1279 +#: ../../library/sys.rst:1309 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1312 msgid "System" msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1312 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1314 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1314 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1315 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1315 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1316 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1316 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1317 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1317 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1318 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1318 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1319 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1319 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1290 +#: ../../library/sys.rst:1320 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1290 +#: ../../library/sys.rst:1320 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1323 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1890,7 +1885,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1329 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1898,57 +1893,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1307 +#: ../../library/sys.rst:1337 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1310 +#: ../../library/sys.rst:1340 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1346 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1349 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1353 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1325 +#: ../../library/sys.rst:1355 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1328 +#: ../../library/sys.rst:1358 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1360 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1338 +#: ../../library/sys.rst:1368 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1957,14 +1952,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1344 +#: ../../library/sys.rst:1374 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1389 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1974,7 +1969,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1399 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1985,14 +1980,14 @@ msgid "" "const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1381 +#: ../../library/sys.rst:1411 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1423 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -2007,7 +2002,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1404 +#: ../../library/sys.rst:1434 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2015,71 +2010,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1439 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1411 ../../library/sys.rst:1492 +#: ../../library/sys.rst:1441 ../../library/sys.rst:1522 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1415 ../../library/sys.rst:1497 +#: ../../library/sys.rst:1445 ../../library/sys.rst:1527 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1444 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1420 ../../library/sys.rst:1512 +#: ../../library/sys.rst:1450 ../../library/sys.rst:1542 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1418 +#: ../../library/sys.rst:1448 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1424 +#: ../../library/sys.rst:1454 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1453 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1457 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1457 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1459 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1430 +#: ../../library/sys.rst:1460 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1464 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1438 +#: ../../library/sys.rst:1468 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2087,19 +2082,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1473 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1446 +#: ../../library/sys.rst:1476 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1483 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2110,7 +2105,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1500 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2119,7 +2114,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1475 +#: ../../library/sys.rst:1505 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2127,7 +2122,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1480 +#: ../../library/sys.rst:1510 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2135,31 +2130,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1515 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1489 +#: ../../library/sys.rst:1519 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1495 +#: ../../library/sys.rst:1525 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1506 +#: ../../library/sys.rst:1536 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1530 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2169,7 +2164,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1509 +#: ../../library/sys.rst:1539 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2177,22 +2172,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1547 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1515 +#: ../../library/sys.rst:1545 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1525 +#: ../../library/sys.rst:1555 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1520 +#: ../../library/sys.rst:1550 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2201,13 +2196,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1527 +#: ../../library/sys.rst:1557 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1530 +#: ../../library/sys.rst:1560 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2221,17 +2216,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1541 +#: ../../library/sys.rst:1571 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1573 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1577 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2239,13 +2234,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1554 +#: ../../library/sys.rst:1584 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1589 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2254,7 +2249,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1595 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2262,7 +2257,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1567 +#: ../../library/sys.rst:1597 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2270,20 +2265,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1569 +#: ../../library/sys.rst:1599 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1572 +#: ../../library/sys.rst:1602 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1614 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2292,105 +2287,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1621 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1625 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1605 +#: ../../library/sys.rst:1635 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1608 ../../library/sys.rst:1623 -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1638 ../../library/sys.rst:1653 +#: ../../library/sys.rst:1661 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1614 +#: ../../library/sys.rst:1644 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1615 +#: ../../library/sys.rst:1645 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1619 +#: ../../library/sys.rst:1649 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1651 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1629 +#: ../../library/sys.rst:1659 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1667 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1641 +#: ../../library/sys.rst:1671 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1674 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1679 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1656 +#: ../../library/sys.rst:1686 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1659 +#: ../../library/sys.rst:1689 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1691 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1663 +#: ../../library/sys.rst:1693 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1695 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1669 +#: ../../library/sys.rst:1699 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1672 +#: ../../library/sys.rst:1702 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2401,14 +2396,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1681 +#: ../../library/sys.rst:1711 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1686 +#: ../../library/sys.rst:1716 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2417,7 +2412,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1693 +#: ../../library/sys.rst:1723 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2426,19 +2421,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1729 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1735 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1709 +#: ../../library/sys.rst:1739 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2446,7 +2441,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1719 +#: ../../library/sys.rst:1749 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2454,7 +2449,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1724 +#: ../../library/sys.rst:1754 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2462,7 +2457,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1730 +#: ../../library/sys.rst:1760 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2470,12 +2465,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1768 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1770 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2483,7 +2478,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1775 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2491,72 +2486,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1750 +#: ../../library/sys.rst:1780 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1757 +#: ../../library/sys.rst:1787 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1795 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1795 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1767 +#: ../../library/sys.rst:1797 msgid "``'nt'``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1798 msgid "``'pthread'``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1799 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1801 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1803 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1803 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1805 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1806 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1778 +#: ../../library/sys.rst:1808 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1810 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1810 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1819 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2565,72 +2560,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1797 +#: ../../library/sys.rst:1827 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1829 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1803 +#: ../../library/sys.rst:1833 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1805 -msgid "*exc_type*: Exception type." -msgstr "*exc_type*: 例外型別。" +#: ../../library/sys.rst:1835 +msgid ":attr:`!exc_type`: Exception type." +msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1806 -msgid "*exc_value*: Exception value, can be ``None``." -msgstr "*exc_value*: 例外值,可以為 ``None``。" +#: ../../library/sys.rst:1836 +msgid ":attr:`!exc_value`: Exception value, can be ``None``." +msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1807 -msgid "*exc_traceback*: Exception traceback, can be ``None``." -msgstr "*exc_traceback*: 例外追蹤,可以為 ``None``。" +#: ../../library/sys.rst:1837 +msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." +msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1808 -msgid "*err_msg*: Error message, can be ``None``." -msgstr "*err_msg*: 錯誤訊息,可以為 ``None``。" +#: ../../library/sys.rst:1838 +msgid ":attr:`!err_msg`: Error message, can be ``None``." +msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1809 -msgid "*object*: Object causing the exception, can be ``None``." -msgstr "*object*: 導致例外的物件,可以為 ``None``。" +#: ../../library/sys.rst:1839 +msgid ":attr:`!object`: Object causing the exception, can be ``None``." +msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1811 +#: ../../library/sys.rst:1841 msgid "" -"The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" -"r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." +"The default hook formats :attr:`!err_msg` and :attr:`!object` as: " +"``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" +"attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1845 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1818 +#: ../../library/sys.rst:1850 +msgid ":func:`excepthook` which handles uncaught exceptions." +msgstr "處理未被捕捉到例外的 :func:`excepthook`。" + +#: ../../library/sys.rst:1854 msgid "" -"Storing *exc_value* using a custom hook can create a reference cycle. It " -"should be cleared explicitly to break the reference cycle when the exception " -"is no longer needed." +"Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " +"It should be cleared explicitly to break the reference cycle when the " +"exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1822 +#: ../../library/sys.rst:1858 msgid "" -"Storing *object* using a custom hook can resurrect it if it is set to an " -"object which is being finalized. Avoid storing *object* after the custom " -"hook completes to avoid resurrecting objects." +"Storing :attr:`!object` using a custom hook can resurrect it if it is set to " +"an object which is being finalized. Avoid storing :attr:`!object` after the " +"custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1826 -msgid "See also :func:`excepthook` which handles uncaught exceptions." -msgstr "關於處理未捕捉得例外,另請參閱 :func:`excepthook`。" - -#: ../../library/sys.rst:1828 +#: ../../library/sys.rst:1862 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2639,15 +2635,15 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1830 +#: ../../library/sys.rst:1864 msgid "" -"Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " -"``unraisable`` when an exception that cannot be handled occurs. The " -"``unraisable`` object is the same as what will be passed to the hook. If no " -"hook has been set, ``hook`` may be ``None``." +"Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " +"*unraisable* when an exception that cannot be handled occurs. The " +"*unraisable* object is the same as what will be passed to the hook. If no " +"hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1873 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2656,13 +2652,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1882 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1888 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2673,18 +2669,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1862 +#: ../../library/sys.rst:1896 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1867 +#: ../../library/sys.rst:1901 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1874 +#: ../../library/sys.rst:1908 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2693,25 +2689,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1885 +#: ../../library/sys.rst:1919 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1935 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1909 +#: ../../library/sys.rst:1943 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1910 +#: ../../library/sys.rst:1944 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2732,50 +2728,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:844 ../../library/sys.rst:1389 +#: ../../library/sys.rst:874 ../../library/sys.rst:1419 msgid "profile function" msgstr "" -#: ../../library/sys.rst:844 ../../library/sys.rst:1389 +#: ../../library/sys.rst:874 ../../library/sys.rst:1419 msgid "profiler" msgstr "" -#: ../../library/sys.rst:853 ../../library/sys.rst:1466 +#: ../../library/sys.rst:883 ../../library/sys.rst:1496 msgid "trace function" msgstr "" -#: ../../library/sys.rst:853 ../../library/sys.rst:1466 +#: ../../library/sys.rst:883 ../../library/sys.rst:1496 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "..." msgstr "..." diff --git a/library/sysconfig.po b/library/sysconfig.po index 7dc03abf28..ed92e796c6 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-20 15:45+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-" @@ -134,7 +134,7 @@ msgstr "" #: ../../library/sysconfig.rst:86 msgid "" "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " -"platforms; by default it is the same as *posix_prefix* ." +"platforms; by default it is the same as *posix_prefix*." msgstr "" #: ../../library/sysconfig.rst:88 @@ -148,13 +148,13 @@ msgstr "" #: ../../library/sysconfig.rst:90 msgid "" "*nt_venv*: scheme for :mod:`Python virtual environments ` on NT " -"platforms; by default it is the same as *nt* ." +"platforms; by default it is the same as *nt*." msgstr "" #: ../../library/sysconfig.rst:92 msgid "" -"*venv*: a scheme with values from ether *posix_venv* or *nt_venv* depending " -"on the platform Python runs on" +"*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending " +"on the platform Python runs on." msgstr "" #: ../../library/sysconfig.rst:94 @@ -311,7 +311,7 @@ msgstr "" #: ../../library/sysconfig.rst:189 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " -"the dictionary return by :func:`get_config_vars`." +"the dictionary returned by :func:`get_config_vars`." msgstr "" #: ../../library/sysconfig.rst:192 diff --git a/library/test.po b/library/test.po index a645b8a761..42104f34c1 100644 --- a/library/test.po +++ b/library/test.po @@ -1472,7 +1472,7 @@ msgstr "" #: ../../library/test.rst:1440 msgid "Added dictionary interface." -msgstr "" +msgstr "新增字典介面。" #: ../../library/test.rst:1446 msgid "" diff --git a/library/time.po b/library/time.po index 001fe0f4e4..994feb6c80 100644 --- a/library/time.po +++ b/library/time.po @@ -859,7 +859,7 @@ msgstr ":attr:`tm_year`" #: ../../library/time.rst:572 msgid "(for example, 1993)" -msgstr "" +msgstr "(例如 1993)" #: ../../library/time.rst:574 msgid "1" diff --git a/library/tkinter.po b/library/tkinter.po index 8e14e38bc9..30c7155ee1 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -257,7 +257,7 @@ msgstr "" #: ../../library/tkinter.rst:137 msgid "*screenName*" -msgstr "" +msgstr "*screenName*" #: ../../library/tkinter.rst:137 msgid "" @@ -267,7 +267,7 @@ msgstr "" #: ../../library/tkinter.rst:140 msgid "*baseName*" -msgstr "" +msgstr "*baseName*" #: ../../library/tkinter.rst:140 msgid "" @@ -277,7 +277,7 @@ msgstr "" #: ../../library/tkinter.rst:143 msgid "*className*" -msgstr "" +msgstr "*className*" #: ../../library/tkinter.rst:143 msgid "" @@ -287,7 +287,7 @@ msgstr "" #: ../../library/tkinter.rst:146 msgid "*useTk*" -msgstr "" +msgstr "*useTk*" #: ../../library/tkinter.rst:146 msgid "" @@ -297,7 +297,7 @@ msgstr "" #: ../../library/tkinter.rst:149 msgid "*sync*" -msgstr "" +msgstr "*sync*" #: ../../library/tkinter.rst:149 msgid "" @@ -307,7 +307,7 @@ msgstr "" #: ../../library/tkinter.rst:159 msgid "*use*" -msgstr "" +msgstr "*use*" #: ../../library/tkinter.rst:152 msgid "" diff --git a/library/tokenize.po b/library/tokenize.po index d8b04edc57..fed2840797 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -89,11 +89,11 @@ msgstr "" #: ../../library/tokenize.rst:60 msgid "Added support for named tuples." -msgstr "" +msgstr "新增附名元組 (named tuple) 的支援。" #: ../../library/tokenize.rst:63 msgid "Added support for ``exact_type``." -msgstr "" +msgstr "新增 ``exact_type`` 的支援。" #: ../../library/tokenize.rst:66 msgid "" diff --git a/library/traceback.po b/library/traceback.po index eda90a6d58..775bdb77a3 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -76,7 +76,7 @@ msgstr "" #: ../../library/traceback.rst:41 ../../library/traceback.rst:103 msgid "Added negative *limit* support." -msgstr "" +msgstr "新增負數 *limit* 的支援。" #: ../../library/traceback.rst:48 msgid "" @@ -403,7 +403,7 @@ msgstr "新增 *compact* 參數。" #: ../../library/traceback.rst:353 msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "" +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" #: ../../library/traceback.rst:358 msgid ":class:`StackSummary` Objects" diff --git a/library/typing.po b/library/typing.po index 5d4181011d..88e5ca116c 100644 --- a/library/typing.po +++ b/library/typing.po @@ -2210,7 +2210,7 @@ msgstr "" #: ../../library/typing.rst:2410 msgid "``init``" -msgstr "" +msgstr "``init``" #: ../../library/typing.rst:2411 msgid "" @@ -2220,7 +2220,7 @@ msgstr "" #: ../../library/typing.rst:2414 msgid "``default``" -msgstr "" +msgstr "``default``" #: ../../library/typing.rst:2415 msgid "Provides the default value for the field." @@ -2228,7 +2228,7 @@ msgstr "" #: ../../library/typing.rst:2416 msgid "``default_factory``" -msgstr "" +msgstr "``default_factory``" #: ../../library/typing.rst:2417 msgid "" @@ -2240,7 +2240,7 @@ msgstr "" #: ../../library/typing.rst:2422 msgid "``factory``" -msgstr "" +msgstr "``factory``" #: ../../library/typing.rst:2423 msgid "An alias for the ``default_factory`` parameter on field specifiers." @@ -2248,7 +2248,7 @@ msgstr "" #: ../../library/typing.rst:2424 msgid "``kw_only``" -msgstr "" +msgstr "``kw_only``" #: ../../library/typing.rst:2425 msgid "" @@ -2262,7 +2262,7 @@ msgstr "" #: ../../library/typing.rst:2431 msgid "``alias``" -msgstr "" +msgstr "``alias``" #: ../../library/typing.rst:2432 msgid "" diff --git a/library/unittest.po b/library/unittest.po index f01c6aabbf..daf13a07ff 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -1320,7 +1320,7 @@ msgstr "" #: ../../library/unittest.rst:1025 msgid "Added the ability to use :meth:`assertRaises` as a context manager." -msgstr "" +msgstr "新增 :meth:`assertRaises` 可作為情境管理器使用的能力。" #: ../../library/unittest.rst:1028 msgid "Added the :attr:`exception` attribute." @@ -1329,7 +1329,7 @@ msgstr "新增 :attr:`exception` 屬性。" #: ../../library/unittest.rst:1031 ../../library/unittest.rst:1057 #: ../../library/unittest.rst:1098 ../../library/unittest.rst:1121 msgid "Added the *msg* keyword argument when used as a context manager." -msgstr "" +msgstr "新增作為情境管理器使用時的 *msg* 引數。" #: ../../library/unittest.rst:1038 msgid "" @@ -1348,11 +1348,11 @@ msgstr "" #: ../../library/unittest.rst:1051 msgid "Added under the name ``assertRaisesRegexp``." -msgstr "" +msgstr "以 ``assertRaisesRegexp`` 為名新增。" #: ../../library/unittest.rst:1054 msgid "Renamed to :meth:`assertRaisesRegex`." -msgstr "重新命名為 :meth:`assertRaisesRegex`\\ 。" +msgstr "重新命名為 :meth:`assertRaisesRegex`。" #: ../../library/unittest.rst:1064 msgid "" @@ -1589,7 +1589,7 @@ msgstr "" #: ../../library/unittest.rst:1263 msgid "Added under the name ``assertRegexpMatches``." -msgstr "" +msgstr "以 ``assertRegexpMatches`` 為名新增。" #: ../../library/unittest.rst:1265 msgid "" @@ -1599,7 +1599,7 @@ msgstr "" #: ../../library/unittest.rst:1268 msgid ":meth:`.assertNotRegex`." -msgstr ":meth:`.assertNotRegex`\\ 。" +msgstr ":meth:`.assertNotRegex`。" #: ../../library/unittest.rst:1274 msgid "" @@ -2619,7 +2619,7 @@ msgstr "" #: ../../library/unittest.rst:2191 msgid "Added *durations* keyword argument." -msgstr "" +msgstr "新增 *durations* 關鍵字引數。" #: ../../library/unittest.rst:2196 msgid "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 0471ef6215..83389d4993 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -286,7 +286,7 @@ msgstr "" #: ../../library/urllib.parse.rst:167 msgid "Added IPv6 URL parsing capabilities." -msgstr "" +msgstr "新增剖析 IPv6 URL 的能力。" #: ../../library/urllib.parse.rst:170 msgid "" diff --git a/library/warnings.po b/library/warnings.po index e0776df6ea..6dca98010a 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -620,7 +620,7 @@ msgstr "新增 *source* 參數。" #: ../../library/warnings.rst:450 msgid "Added *skip_file_prefixes*." -msgstr "" +msgstr "新增 *skip_file_prefixes*。" #: ../../library/warnings.rst:456 msgid "" @@ -733,7 +733,7 @@ msgstr "" #: ../../library/warnings.rst:558 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." -msgstr "" +msgstr "新增 *action*、*category*、*lineno* 和 *append* 參數。" #: ../../library/warnings.rst:9 msgid "warnings" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index 33d977be06..081eadaaaa 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -144,11 +144,11 @@ msgstr "" #: ../../library/xml.sax.reader.rst:110 msgid "Added support of character streams." -msgstr "" +msgstr "新增對字元串流的支援。" #: ../../library/xml.sax.reader.rst:113 msgid "Added support of path-like objects." -msgstr "" +msgstr "新增對類路徑物件的支援。" #: ../../library/xml.sax.reader.rst:119 msgid "Return the current :class:`~xml.sax.handler.ContentHandler`." diff --git a/library/zipfile.po b/library/zipfile.po index 5837948100..311b00b85b 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -253,11 +253,11 @@ msgstr "" #: ../../library/zipfile.rst:216 msgid "Added the ability to use :class:`ZipFile` as a context manager." -msgstr "" +msgstr "新增 :class:`ZipFile` 作為情境管理器使用的能力。" #: ../../library/zipfile.rst:219 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." -msgstr "" +msgstr "新增對於 :mod:`bzip2 ` 和 :mod:`lzma` 壓縮的支援。" #: ../../library/zipfile.rst:222 ../../library/zipfile.rst:648 msgid "ZIP64 extensions are enabled by default." @@ -676,7 +676,7 @@ msgstr "" #: ../../library/zipfile.rst:582 msgid "Added :data:`Path.suffix` property." -msgstr "" +msgstr "新增 :data:`Path.suffix` 特性。" #: ../../library/zipfile.rst:587 msgid "The final path component, without its suffix." @@ -684,7 +684,7 @@ msgstr "" #: ../../library/zipfile.rst:589 msgid "Added :data:`Path.stem` property." -msgstr "" +msgstr "新增 :data:`Path.stem` 特性。" #: ../../library/zipfile.rst:594 msgid "A list of the path’s file extensions." @@ -692,7 +692,7 @@ msgstr "" #: ../../library/zipfile.rst:596 msgid "Added :data:`Path.suffixes` property." -msgstr "" +msgstr "新增 :data:`Path.suffixes` 特性。" #: ../../library/zipfile.rst:601 msgid "" diff --git a/license.po b/license.po index 1cb146b32e..25935edd95 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -321,12 +321,13 @@ msgstr "Sockets" #: ../../license.rst:355 msgid "" -"The :mod:`socket` module uses the functions, :func:`getaddrinfo`, and :func:" -"`getnameinfo`, which are coded in separate source files from the WIDE " +"The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, and :c:" +"func:`!getnameinfo`, which are coded in separate source files from the WIDE " "Project, https://www.wide.ad.jp/. ::" msgstr "" -":mod:`socket` 模組使用 :func:`getaddrinfo` 和 :func:`getnameinfo` 函式,它們" -"在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編碼:\n" +":mod:`socket` 模組使用 :c:func:`!getaddrinfo` 和 :c:func:`!getnameinfo` 函" +"式,它們在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編" +"碼:\n" "\n" "::" @@ -336,10 +337,10 @@ msgstr "非同步 socket 服務" #: ../../license.rst:390 msgid "" -"The :mod:`test.support.asynchat` and :mod:`test.support.asyncore` modules " +"The :mod:`!test.support.asynchat` and :mod:`!test.support.asyncore` modules " "contain the following notice::" msgstr "" -":mod:`test.support.asynchat` 和 :mod:`test.support.asyncore` 模組包含以下聲" +":mod:`!test.support.asynchat` 和 :mod:`!test.support.asyncore` 模組包含以下聲" "明:\n" "\n" "::" @@ -393,9 +394,9 @@ msgid "test_epoll" msgstr "test_epoll" #: ../../license.rst:542 -msgid "The :mod:`test_epoll` module contains the following notice::" +msgid "The :mod:`!test.test_epoll` module contains the following notice::" msgstr "" -":mod:`test_epoll` 模組包含以下聲明:\n" +":mod:`!test.test_epoll` 模組包含以下聲明:\n" "\n" "::" @@ -456,34 +457,37 @@ msgid "" "OpenSSL library for added performance if made available by the operating " "system. Additionally, the Windows and macOS installers for Python may " "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " -"license here::" +"license here. For the OpenSSL 3.0 release, and later releases derived from " +"that, the Apache License v2 applies::" msgstr "" -"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:" -"`posix`\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外," -"因為 Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我" -"們也在此收錄 OpenSSL 授權的副本:\n" +"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`、:mod:`posix`、:mod:" +"`ssl`、:mod:`crypt` 模組會使用它來提升效能。此外,因為 Windows 和 macOS 的 " +"Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也在此收錄 OpenSSL 授權" +"的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則適用 Apache 許可證 " +"v2:\n" "\n" "::" -#: ../../license.rst:793 +#: ../../license.rst:845 msgid "expat" msgstr "expat" -#: ../../license.rst:795 +#: ../../license.rst:847 msgid "" -"The :mod:`pyexpat` extension is built using an included copy of the expat " -"sources unless the build is configured ``--with-system-expat``::" +"The :mod:`pyexpat ` extension is built using an included " +"copy of the expat sources unless the build is configured ``--with-system-" +"expat``::" msgstr "" -"除非在建置 :mod:`pyexpat` 擴充時設定為 ``--with-system-expat``\\ ,否則該擴充" -"會用一個內含 expat 原始碼的副本來建置:\n" +"除非在建置 :mod:`pyexpat ` 擴充時設定為 ``--with-system-" +"expat``\\ ,否則該擴充會用一個內含 expat 原始碼的副本來建置:\n" "\n" "::" -#: ../../license.rst:822 +#: ../../license.rst:874 msgid "libffi" msgstr "libffi" -#: ../../license.rst:824 +#: ../../license.rst:876 msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " @@ -494,11 +498,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:852 +#: ../../license.rst:904 msgid "zlib" msgstr "zlib" -#: ../../license.rst:854 +#: ../../license.rst:906 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " @@ -509,11 +513,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:883 +#: ../../license.rst:935 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:885 +#: ../../license.rst:937 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" @@ -523,11 +527,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:924 +#: ../../license.rst:976 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:926 +#: ../../license.rst:978 msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " @@ -539,11 +543,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:957 +#: ../../license.rst:1009 msgid "W3C C14N test suite" msgstr "W3C C14N 測試套件" -#: ../../license.rst:959 +#: ../../license.rst:1011 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" @@ -555,11 +559,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:994 +#: ../../license.rst:1046 msgid "Audioop" -msgstr "" +msgstr "Audioop" -#: ../../license.rst:996 +#: ../../license.rst:1048 msgid "" "The audioop module uses the code base in g771.c file of the SoX project::" -msgstr "" +msgstr "audioop 模組使用 SoX 專案的 g771.c 檔案中的程式碼: ::" diff --git a/tutorial/venv.po b/tutorial/venv.po index 56e7eb3ec9..832d03b91f 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-04 00:16+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2022-10-16 05:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -261,9 +261,9 @@ msgstr "" msgid "" "``pip`` has many more options. Consult the :ref:`installing-index` guide " "for complete documentation for ``pip``. When you've written a package and " -"want to make it available on the Python Package Index, consult the :ref:" -"`distributing-index` guide." +"want to make it available on the Python Package Index, consult the `Python " +"packaging user guide`_." msgstr "" "``pip`` 還有更多功能。可以參考\\ :ref:`installing-index`\\ 指南,來取得完整" "的 ``pip`` 說明文件。當你撰寫了一個套件並且想要讓它在 Python Package Index 上" -"可以取得的話,可以參考\\ :ref:`distributing-index`\\ 指南。" +"可以取得的話,可以參考 `Python packaging user guide`_。" diff --git a/using/cmdline.po b/using/cmdline.po index fe3c4326c9..06d0f4d366 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -1061,8 +1061,7 @@ msgstr "" msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and :ref:`Distutils installation paths ` " -"for ``python setup.py install --user``." +"USER_SITE>` and installation paths for ``python -m pip install --user``." msgstr "" #: ../../using/cmdline.rst:824 diff --git a/using/configure.po b/using/configure.po index 27c4a13987..27dd931962 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -525,11 +525,11 @@ msgstr "" #: ../../using/configure.rst:371 msgid "Add :func:`sys.gettotalrefcount` function." -msgstr "" +msgstr "新增 :func:`sys.gettotalrefcount` 函式。" #: ../../using/configure.rst:372 msgid "Add :option:`-X showrefcount <-X>` command line option." -msgstr "" +msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" #: ../../using/configure.rst:373 msgid "" @@ -551,7 +551,7 @@ msgstr "" #: ../../using/configure.rst:379 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." -msgstr "" +msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" #: ../../using/configure.rst:380 msgid "" @@ -627,15 +627,15 @@ msgstr "" #: ../../using/configure.rst:420 msgid "Define the ``Py_TRACE_REFS`` macro." -msgstr "" +msgstr "定義 ``Py_TRACE_REFS`` 巨集。" #: ../../using/configure.rst:421 msgid "Add :func:`sys.getobjects` function." -msgstr "" +msgstr "新增 :func:`sys.getobjects` 函式。" #: ../../using/configure.rst:422 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." -msgstr "" +msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" #: ../../using/configure.rst:424 msgid "" @@ -663,11 +663,11 @@ msgstr "" #: ../../using/configure.rst:444 msgid "Enable Valgrind support (default is no)." -msgstr "" +msgstr "啟用 Valgrind 支援(預設不啟用)。" #: ../../using/configure.rst:448 msgid "Enable DTrace support (default is no)." -msgstr "" +msgstr "啟用 DTrace 支援(預設不啟用)。" #: ../../using/configure.rst:450 msgid "" @@ -730,7 +730,7 @@ msgstr "" #: ../../using/configure.rst:513 msgid "Define the ``WITH_EDITLINE`` macro." -msgstr "" +msgstr "定義 ``WITH_EDITLINE`` 巨集。" #: ../../using/configure.rst:519 msgid "Don't build the :mod:`readline` module (built by default)." @@ -738,7 +738,7 @@ msgstr "" #: ../../using/configure.rst:521 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." -msgstr "" +msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" #: ../../using/configure.rst:527 msgid "" @@ -784,11 +784,11 @@ msgstr "" #: ../../using/configure.rst:559 msgid "``siphash24``;" -msgstr "" +msgstr "``siphash24``;" #: ../../using/configure.rst:560 msgid "``fnv``." -msgstr "" +msgstr "``fnv``。" #: ../../using/configure.rst:564 msgid "``siphash13`` is added and it is the new default." @@ -796,7 +796,7 @@ msgstr "" #: ../../using/configure.rst:569 msgid "Built-in hash modules:" -msgstr "" +msgstr "內建雜湊模組:" #: ../../using/configure.rst:571 msgid "``md5``;" @@ -840,7 +840,7 @@ msgstr "" #: ../../using/configure.rst:588 msgid "See the :mod:`ssl` module." -msgstr "" +msgstr "請見 :mod:`ssl` 模組。" #: ../../using/configure.rst:594 msgid "" @@ -850,11 +850,11 @@ msgstr "" #: ../../using/configure.rst:598 msgid "macOS Options" -msgstr "" +msgstr "macOS 選項" #: ../../using/configure.rst:600 msgid "See ``Mac/README.rst``." -msgstr "參閱 ``Mac/README.rst``\\ 。" +msgstr "參閱 ``Mac/README.rst``。" #: ../../using/configure.rst:605 msgid "" @@ -876,7 +876,7 @@ msgstr "" #: ../../using/configure.rst:619 msgid "Options:" -msgstr "" +msgstr "選項:" #: ../../using/configure.rst:621 msgid "``universal2``;" @@ -980,49 +980,43 @@ msgid "" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:689 -msgid ":file:`setup.py`: C extensions built using the ``setuptools`` package." -msgstr "" - -#: ../../using/configure.rst:692 +#: ../../using/configure.rst:691 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:693 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:694 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:696 +#: ../../using/configure.rst:695 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:698 -msgid "" -"C extensions are built by the Makefile (see :file:`Modules/Setup`) and " -"``python setup.py build``." +#: ../../using/configure.rst:697 +msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:700 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:704 +#: ../../using/configure.rst:702 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:703 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:707 +#: ../../using/configure.rst:705 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1030,53 +1024,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:711 +#: ../../using/configure.rst:709 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:712 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:713 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:718 +#: ../../using/configure.rst:716 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:717 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:721 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:723 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:737 +#: ../../using/configure.rst:735 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:745 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1084,309 +1078,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:749 msgid "" -"The :file:`setup.py` script only builds C extensions as shared libraries " -"using the :mod:`distutils` module." +"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" +"`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " +"depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:754 -msgid "" -"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and :c:macro:" -"`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined " -"differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" -msgstr "" - -#: ../../using/configure.rst:758 +#: ../../using/configure.rst:753 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:754 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:761 +#: ../../using/configure.rst:756 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:767 +#: ../../using/configure.rst:762 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:769 +#: ../../using/configure.rst:764 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:773 +#: ../../using/configure.rst:768 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:777 +#: ../../using/configure.rst:772 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:778 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:786 ../../using/configure.rst:976 +#: ../../using/configure.rst:781 ../../using/configure.rst:971 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " -"value for setup.py to be able to build extension modules using the " -"directories specified in the environment variables." +"value to be able to build extension modules using the directories specified " +"in the environment variables." msgstr "" -#: ../../using/configure.rst:796 +#: ../../using/configure.rst:791 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:793 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:803 +#: ../../using/configure.rst:798 msgid "Compiler flags" -msgstr "" +msgstr "編譯器旗標" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:802 msgid "C compiler command." -msgstr "" +msgstr "C 編譯器指令。" -#: ../../using/configure.rst:809 +#: ../../using/configure.rst:804 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:813 +#: ../../using/configure.rst:808 msgid "C++ compiler command." -msgstr "" +msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:810 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:814 msgid "C compiler flags." -msgstr "" +msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:818 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " -"extensions. Use it when a compiler flag should *not* be part of the " -"distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`)." +"extensions. Use it when a compiler flag should *not* be part of :envvar:" +"`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:827 +#: ../../using/configure.rst:822 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:824 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:834 +#: ../../using/configure.rst:829 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:842 +#: ../../using/configure.rst:837 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:849 +#: ../../using/configure.rst:844 msgid "Extra C compiler flags." -msgstr "" +msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:853 +#: ../../using/configure.rst:848 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:855 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:862 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:871 +#: ../../using/configure.rst:866 msgid "Optimization flags." -msgstr "" +msgstr "最佳化旗標。" -#: ../../using/configure.rst:875 +#: ../../using/configure.rst:870 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:881 +#: ../../using/configure.rst:876 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:883 +#: ../../using/configure.rst:878 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:887 +#: ../../using/configure.rst:882 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:884 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:894 +#: ../../using/configure.rst:889 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:893 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:904 +#: ../../using/configure.rst:899 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:901 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:907 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:913 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:921 +#: ../../using/configure.rst:916 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:927 +#: ../../using/configure.rst:922 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:924 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:933 +#: ../../using/configure.rst:928 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:932 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:934 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:943 +#: ../../using/configure.rst:938 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:940 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:953 +#: ../../using/configure.rst:948 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" -"`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of the " -"distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`)." +"`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" +"`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:957 +#: ../../using/configure.rst:952 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:959 +#: ../../using/configure.rst:954 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:961 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:973 +#: ../../using/configure.rst:968 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:982 +#: ../../using/configure.rst:977 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:985 +#: ../../using/configure.rst:980 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:989 +#: ../../using/configure.rst:984 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:991 +#: ../../using/configure.rst:986 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." -msgstr "" +msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:995 +#: ../../using/configure.rst:990 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:997 +#: ../../using/configure.rst:992 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." -msgstr "" +msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:996 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." -msgstr "" +msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1000 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." -msgstr "" +msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1006 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/using/mac.po b/using/mac.po index 636fdd92ee..9b4760d661 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-17 00:04+0000\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -249,36 +249,20 @@ msgid "Installing Additional Python Packages" msgstr "安裝額外的 Python 套件" #: ../../using/mac.rst:128 -msgid "There are several methods to install additional Python packages:" -msgstr "有幾個方法可以安裝額外的 Python 套件:" +msgid "This section has moved to the `Python Packaging User Guide`_." +msgstr "這個章節已經被移動到 `Python Packaging User Guide`_。" -#: ../../using/mac.rst:130 -msgid "" -"Packages can be installed via the standard Python distutils mode (``python " -"setup.py install``)." -msgstr "" -"可以透過標準的 Python distutils 模式(\\ ``python setup.py install``\\ )安裝" -"套件。" - -#: ../../using/mac.rst:133 -msgid "" -"Many packages can also be installed via the :program:`setuptools` extension " -"or :program:`pip` wrapper, see https://pip.pypa.io/." -msgstr "" -"許多套件也可以透過 :program:`setuptools` 擴充套件或 :program:`pip` 包裝器 " -"(wrapper) 安裝,請參閱 https://pip.pypa.io/\\ 。" - -#: ../../using/mac.rst:138 +#: ../../using/mac.rst:134 msgid "GUI Programming on the Mac" msgstr "於 Mac 上開發 GUI 程式" -#: ../../using/mac.rst:140 +#: ../../using/mac.rst:136 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "於 Mac 上使用 Python 來建立 GUI 應用程式有許多選項。" -#: ../../using/mac.rst:142 +#: ../../using/mac.rst:138 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " "is the foundation of most modern Mac development. Information on PyObjC is " @@ -288,7 +272,7 @@ msgstr "" "多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 https://pypi.org/project/" "pyobjc/。" -#: ../../using/mac.rst:146 +#: ../../using/mac.rst:142 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " @@ -299,7 +283,7 @@ msgstr "" "(https://www.tcl.tk)。Apple 的 macOS 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" -#: ../../using/mac.rst:151 +#: ../../using/mac.rst:147 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " "on macOS. Packages and documentation are available from https://www.wxpython." @@ -308,7 +292,7 @@ msgstr "" "*wxPython* 是另一種流行的跨平臺 GUI 工具套件,可在 macOS 上本機執行。套件和文" "件可從 https://www.wxpython.org 獲得。" -#: ../../using/mac.rst:154 +#: ../../using/mac.rst:150 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " "macOS. More information can be found at https://riverbankcomputing.com/" @@ -317,11 +301,11 @@ msgstr "" "*PyQt* 是另一種流行的跨平臺 GUI 工具套件,可在原生 macOS 上執行。更多資訊可" "在 https://riverbankcomputing.com/software/pyqt/intro 上找到。" -#: ../../using/mac.rst:160 +#: ../../using/mac.rst:156 msgid "Distributing Python Applications on the Mac" msgstr "於 Mac 上發行 Python 應用程式" -#: ../../using/mac.rst:162 +#: ../../using/mac.rst:158 msgid "" "The standard tool for deploying standalone Python applications on the Mac " "is :program:`py2app`. More information on installing and using py2app can be " @@ -330,25 +314,25 @@ msgstr "" "在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" "和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" -#: ../../using/mac.rst:168 +#: ../../using/mac.rst:164 msgid "Other Resources" msgstr "其他資源" -#: ../../using/mac.rst:170 +#: ../../using/mac.rst:166 msgid "" "The MacPython mailing list is an excellent support resource for Python users " "and developers on the Mac:" msgstr "" "MacPython 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資源:" -#: ../../using/mac.rst:173 +#: ../../using/mac.rst:169 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" -#: ../../using/mac.rst:175 +#: ../../using/mac.rst:171 msgid "Another useful resource is the MacPython wiki:" msgstr "另一個好用資源是 MacPython wiki:" -#: ../../using/mac.rst:177 +#: ../../using/mac.rst:173 msgid "https://wiki.python.org/moin/MacPython" msgstr "https://wiki.python.org/moin/MacPython" diff --git a/using/windows.po b/using/windows.po index a0ab02d8eb..a210a5b577 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-17 00:04+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-" @@ -2060,10 +2060,10 @@ msgstr "cx_Freeze" #: ../../using/windows.rst:1249 msgid "" -"`cx_Freeze `_ is a " -"``distutils`` extension which wraps Python scripts into executable Windows " -"programs (:file:`{*}.exe` files). When you have done this, you can " -"distribute your application without requiring your users to install Python." +"`cx_Freeze `_ wraps Python " +"scripts into executable Windows programs (:file:`{*}.exe` files). When you " +"have done this, you can distribute your application without requiring your " +"users to install Python." msgstr "" #: ../../using/windows.rst:1256 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index f96663c5b7..bbf65b2517 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -1319,7 +1319,7 @@ msgid "" "method definition tables to simplify implementation of methods with no " "arguments or a single untyped argument. Calling such methods is more " "efficient than calling a corresponding method that uses :c:macro:" -"`METH_VARARGS`. Also, the old :c:macro:`METH_OLDARGS` style of writing C " +"`METH_VARARGS`. Also, the old :c:macro:`!METH_OLDARGS` style of writing C " "methods is now officially deprecated." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 685e9a2976..186727b21f 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -1079,7 +1079,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1037 msgid "(Contributed by Just van Rossum.)" -msgstr "" +msgstr "(由 Just van Rossum 所貢獻。)" #: ../../whatsnew/2.3.rst:1039 msgid "" @@ -1228,7 +1228,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1174 msgid "(Contributed by Walter Dörwald.)" -msgstr "" +msgstr "(由 Walter Dörwald 所貢獻。)" #: ../../whatsnew/2.3.rst:1176 msgid "" @@ -1247,7 +1247,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1189 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.3.rst:1191 msgid "" @@ -1405,7 +1405,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1294 msgid "(Contributed by Peter Åstrand.)" -msgstr "" +msgstr "(由 Peter Åstrand 所貢獻。)" #: ../../whatsnew/2.3.rst:1296 msgid "" @@ -1438,7 +1438,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1332 msgid "(Contributed by Kevin O'Connor.)" -msgstr "" +msgstr "(由 Kevin O'Connor 所貢獻。)" #: ../../whatsnew/2.3.rst:1334 msgid "" @@ -1776,7 +1776,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1639 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.3.rst:1641 msgid "" @@ -2066,10 +2066,11 @@ msgstr "" #: ../../whatsnew/2.3.rst:1889 msgid "" -"The :c:macro:`DL_EXPORT` and :c:macro:`DL_IMPORT` macros are now deprecated. " -"Initialization functions for Python extension modules should now be declared " -"using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python core will " -"generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` macros." +"The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " +"deprecated. Initialization functions for Python extension modules should now " +"be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " +"core will generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` " +"macros." msgstr "" #: ../../whatsnew/2.3.rst:1894 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 2dbfd429e4..d442af8ca9 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -995,7 +995,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:891 ../../whatsnew/2.4.rst:919 #: ../../whatsnew/2.4.rst:1212 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.4.rst:893 ../../whatsnew/2.4.rst:1519 msgid "" @@ -1043,7 +1043,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:933 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.4.rst:935 msgid "" @@ -1294,7 +1294,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1140 msgid "(Contributed by Hye-Shik Chang.)" -msgstr "" +msgstr "(由 Hye-Shik Chang 所貢獻。)" #: ../../whatsnew/2.4.rst:1142 msgid "" @@ -1682,7 +1682,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1479 msgid "" -"A new method flag, :c:macro:`METH_COEXISTS`, allows a function defined in " +"A new method flag, :c:macro:`METH_COEXIST`, allows a function defined in " "slots to co-exist with a :c:type:`PyCFunction` having the same name. This " "can halve the access time for a method such as :meth:`set.__contains__`. " "(Contributed by Raymond Hettinger.)" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 17d26a33fd..88fbcaede3 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -1192,7 +1192,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1043 msgid "(Contributed by Steven Bethard and Raymond Hettinger.)" -msgstr "" +msgstr "(由 Steven Bethard 和 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.5.rst:1045 msgid "" @@ -1303,7 +1303,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1139 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.5.rst:1141 msgid "" @@ -1455,7 +1455,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1269 msgid "(Contributed by Guido van Rossum.)" -msgstr "" +msgstr "(由 Guido van Rossum 所貢獻。)" #: ../../whatsnew/2.5.rst:1271 msgid "" @@ -1517,7 +1517,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1309 msgid "(Contributed by Skip Montanaro and Andrew McNamara.)" -msgstr "" +msgstr "(由 Skip Montanaro 和 Andrew McNamara 所貢獻。)" #: ../../whatsnew/2.5.rst:1311 msgid "" @@ -1589,7 +1589,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1373 ../../whatsnew/2.5.rst:1382 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.5.rst:1375 msgid "" @@ -1629,7 +1629,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1400 msgid "(Contributed by Georg Brandl.)" -msgstr "" +msgstr "(由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.5.rst:1404 msgid "" @@ -1929,7 +1929,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1632 msgid "(Contributed by Ka-Ping Yee.)" -msgstr "" +msgstr "(由 Ka-Ping Yee 所貢獻。)" #: ../../whatsnew/2.5.rst:1634 msgid "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index dde7069360..dd902227eb 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -1647,7 +1647,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1517 msgid "(Contributed by Alexander Belopolsky; :issue:`1686487`.)" -msgstr "" +msgstr "(由 Alexander Belopolsky 所貢獻;:issue:`1686487`。)" #: ../../whatsnew/2.6.rst:1519 msgid "" @@ -1677,7 +1677,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1546 msgid "(Contributed by Raymond Hettinger)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.6.rst:1548 msgid "" @@ -1705,7 +1705,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1596 ../../whatsnew/2.6.rst:1880 #: ../../whatsnew/2.6.rst:1901 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.6.rst:1598 msgid "" @@ -1827,7 +1827,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1693 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.6.rst:1695 msgid "" @@ -2352,7 +2352,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2132 msgid "(Contributed by Christian Heimes and Mark Dickinson.)" -msgstr "" +msgstr "(由 Christian Heimes 和 Mark Dickinson 所貢獻。)" #: ../../whatsnew/2.6.rst:2134 msgid "" @@ -2371,7 +2371,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2150 msgid "(Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)" -msgstr "" +msgstr "(經 Gregory Petrosyan 建議後由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.6.rst:2152 msgid "" @@ -2381,7 +2381,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2162 msgid "(Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)" -msgstr "" +msgstr "(經 Barry Warsaw 建議後由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.6.rst:2164 msgid "" @@ -2481,7 +2481,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2241 msgid "(Contributed by Paul Moore; :issue:`2439`.)" -msgstr "" +msgstr "(由 Paul Moore 貢獻;:issue:`2439`。)" #: ../../whatsnew/2.6.rst:2243 msgid "" @@ -2578,7 +2578,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2315 msgid "(Contributed by Tarek Ziadé; :issue:`2663`.)" -msgstr "" +msgstr "(由 Tarek Ziadé 貢獻;:issue:`2663`。)" #: ../../whatsnew/2.6.rst:2317 msgid "" @@ -2604,7 +2604,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2335 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" -msgstr "" +msgstr "(由 Adam Olsen 貢獻;:issue:`1583`。)" #: ../../whatsnew/2.6.rst:2337 msgid "" @@ -2843,7 +2843,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2534 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" -msgstr "" +msgstr "(由 Dwayne Bailey 貢獻;:issue:`1581073`。)" #: ../../whatsnew/2.6.rst:2536 msgid "" @@ -3006,7 +3006,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2653 msgid "(Contributed by Alan McIntyre; :issue:`467924`.)" -msgstr "" +msgstr "(由 Alan McIntyre 貢獻;:issue:`467924`。)" #: ../../whatsnew/2.6.rst:2655 msgid "" @@ -3427,10 +3427,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:3061 msgid "" "Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " -"are macros, not functions. :c:macro:`Py_Size()` became :c:macro:" -"`Py_SIZE()`, :c:macro:`Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" -"`Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are still " -"available in Python 2.6 for backward compatibility. (:issue:`1629`)" +"are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" +"`Py_SIZE()`, :c:macro:`!Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" +"`!Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are " +"still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" #: ../../whatsnew/2.6.rst:3070 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index e5008d3cd9..ce47e5c2bc 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -849,7 +849,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:843 msgid "(Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)" -msgstr "" +msgstr "(由 Fredrik Johansson 和 Victor Stinner 貢獻;:issue:`3439`。)" #: ../../whatsnew/2.7.rst:845 msgid "" @@ -957,7 +957,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:928 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.7.rst:930 msgid "Several performance enhancements have been added:" @@ -1017,7 +1017,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:976 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" #: ../../whatsnew/2.7.rst:978 msgid "" @@ -1195,7 +1195,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1157 msgid "(Contributed by Mats Kindahl; :issue:`7005`.)" -msgstr "" +msgstr "(由 Mats Kindahl 貢獻;:issue:`7005`。)" #: ../../whatsnew/2.7.rst:1159 msgid "" @@ -1765,7 +1765,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1588 msgid "(Contributed by Gregory P. Smith.)" -msgstr "" +msgstr "(由 Gregory P. Smith 所貢獻。)" #: ../../whatsnew/2.7.rst:1590 msgid "" @@ -2693,11 +2693,12 @@ msgstr "" #: ../../whatsnew/2.7.rst:2289 msgid "" -"There is an existing data type already used for this, :c:type:`PyCObject`, " +"There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " -"cause a segmentation fault by taking a :c:type:`PyCObject` from module A and " -"somehow substituting it for the :c:type:`PyCObject` in module B. Capsules " -"know their own name, and getting the pointer requires providing the name:" +"cause a segmentation fault by taking a :c:type:`!PyCObject` from module A " +"and somehow substituting it for the :c:type:`!PyCObject` in module B. " +"Capsules know their own name, and getting the pointer requires providing the " +"name:" msgstr "" #: ../../whatsnew/2.7.rst:2307 @@ -2711,10 +2712,10 @@ msgstr "" #: ../../whatsnew/2.7.rst:2312 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " -"APIs, but the :c:func:`PyCObject_AsVoidPtr` was modified to handle capsules, " -"preserving compile-time compatibility with the :c:type:`CObject` interface. " -"Use of :c:func:`PyCObject_AsVoidPtr` will signal a :exc:" -"`PendingDeprecationWarning`, which is silent by default." +"APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " +"capsules, preserving compile-time compatibility with the :c:type:`!" +"PyCObject` interface. Use of :c:func:`!PyCObject_AsVoidPtr` will signal a :" +"exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" #: ../../whatsnew/2.7.rst:2319 @@ -3283,7 +3284,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" #: ../../whatsnew/2.7.rst:2779 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index fe738984c0..c533da625c 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -1260,8 +1260,10 @@ msgstr "" #: ../../whatsnew/3.0.rst:878 msgid "" -"Removed :c:macro:`METH_OLDARGS` and :c:macro:`WITH_CYCLE_GC` from the C API." -msgstr "移除 C API 中的 :c:macro:`METH_OLDARGS` 和 :c:macro:`WITH_CYCLE_GC`。" +"Removed :c:macro:`!METH_OLDARGS` and :c:macro:`!WITH_CYCLE_GC` from the C " +"API." +msgstr "" +"移除 C API 中的 :c:macro:`!METH_OLDARGS` 和 :c:macro:`!WITH_CYCLE_GC`。" #: ../../whatsnew/3.0.rst:884 msgid "Performance" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index eb995e6eb8..5e5a29c54c 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -194,8 +194,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " -"`_。)" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" #: ../../whatsnew/3.1.rst:178 msgid "" @@ -568,8 +568,8 @@ msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" msgstr "" -"(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 Py3." -"1;:issue:`4136`。)" +"(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 " +"Py3.1;:issue:`4136`。)" #: ../../whatsnew/3.1.rst:460 msgid "" @@ -660,7 +660,7 @@ msgstr "(由 Mark Dickinson 貢獻;:issue:`5914`。)" #: ../../whatsnew/3.1.rst:513 msgid "" -"Added :c:type:`PyCapsule` as a replacement for the :c:type:`PyCObject` API. " +"Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. " "The principal difference is that the new type has a well defined interface " "for passing typing safety information and a less complicated signature for " "calling a destructor. The old type had a problematic API and is now " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 733d5754b4..b130430e5e 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-14 13:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,52 +66,60 @@ msgid ":pep:`701`: Syntactic formalization of f-strings" msgstr "" #: ../../whatsnew/3.12.rst:73 +msgid "Interpreter improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:75 +msgid ":ref:`whatsnew312-pep684`" +msgstr "" + +#: ../../whatsnew/3.12.rst:77 msgid "New typing features:" msgstr "新增型別特性:" -#: ../../whatsnew/3.12.rst:75 +#: ../../whatsnew/3.12.rst:79 msgid ":pep:`688`: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:77 +#: ../../whatsnew/3.12.rst:81 msgid ":ref:`whatsnew312-pep692`" msgstr ":ref:`whatsnew312-pep692`" -#: ../../whatsnew/3.12.rst:79 +#: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep695`" msgstr ":ref:`whatsnew312-pep695`" -#: ../../whatsnew/3.12.rst:81 +#: ../../whatsnew/3.12.rst:85 msgid ":pep:`698`: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:83 +#: ../../whatsnew/3.12.rst:87 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.12.rst:85 +#: ../../whatsnew/3.12.rst:89 msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" -#: ../../whatsnew/3.12.rst:87 +#: ../../whatsnew/3.12.rst:91 msgid "" ":pep:`632`: Remove the ``distutils`` package. See `the migration guide " "`_ for advice on its " "replacement." msgstr "" -#: ../../whatsnew/3.12.rst:92 +#: ../../whatsnew/3.12.rst:96 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:94 +#: ../../whatsnew/3.12.rst:98 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:103 +#: ../../whatsnew/3.12.rst:107 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -120,14 +128,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:124 +#: ../../whatsnew/3.12.rst:128 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:134 +#: ../../whatsnew/3.12.rst:138 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -135,15 +143,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:145 ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1639 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:150 +#: ../../whatsnew/3.12.rst:154 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:152 +#: ../../whatsnew/3.12.rst:156 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -152,7 +160,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:157 +#: ../../whatsnew/3.12.rst:161 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -160,7 +168,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:166 +#: ../../whatsnew/3.12.rst:170 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -168,13 +176,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:174 +#: ../../whatsnew/3.12.rst:178 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:180 +#: ../../whatsnew/3.12.rst:184 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -183,7 +191,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:193 +#: ../../whatsnew/3.12.rst:197 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -192,11 +200,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:206 +#: ../../whatsnew/3.12.rst:210 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:208 +#: ../../whatsnew/3.12.rst:212 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -205,7 +213,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:221 +#: ../../whatsnew/3.12.rst:225 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -213,25 +221,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:233 +#: ../../whatsnew/3.12.rst:237 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:240 +#: ../../whatsnew/3.12.rst:244 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:242 +#: ../../whatsnew/3.12.rst:246 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:246 +#: ../../whatsnew/3.12.rst:250 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -239,24 +247,24 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:251 +#: ../../whatsnew/3.12.rst:255 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:253 +#: ../../whatsnew/3.12.rst:257 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:255 +#: ../../whatsnew/3.12.rst:259 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:258 +#: ../../whatsnew/3.12.rst:262 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -266,22 +274,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:265 +#: ../../whatsnew/3.12.rst:269 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:268 +#: ../../whatsnew/3.12.rst:272 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:270 +#: ../../whatsnew/3.12.rst:274 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:274 +#: ../../whatsnew/3.12.rst:278 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -289,46 +297,76 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:287 +msgid "PEP 684: A Per-Interpreter GIL" +msgstr "" + +#: ../../whatsnew/3.12.rst:289 +msgid "" +"Sub-interpreters may now be created with a unique GIL per interpreter. This " +"allows Python programs to take full advantage of multiple CPU cores." +msgstr "" + +#: ../../whatsnew/3.12.rst:293 +msgid "" +"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " +"interpreter with its own GIL::" +msgstr "" + +#: ../../whatsnew/3.12.rst:307 +msgid "" +"For further examples how to use the C-API for sub-interpreters with a per-" +"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +msgstr "" + +#: ../../whatsnew/3.12.rst:310 +msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:312 +msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" +msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" + +#: ../../whatsnew/3.12.rst:315 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:283 +#: ../../whatsnew/3.12.rst:317 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:323 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:291 +#: ../../whatsnew/3.12.rst:325 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:295 +#: ../../whatsnew/3.12.rst:329 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:306 +#: ../../whatsnew/3.12.rst:340 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:308 +#: ../../whatsnew/3.12.rst:342 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" -msgstr "" +msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:311 +#: ../../whatsnew/3.12.rst:345 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:313 +#: ../../whatsnew/3.12.rst:347 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -337,51 +375,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:319 +#: ../../whatsnew/3.12.rst:353 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:337 +#: ../../whatsnew/3.12.rst:371 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "" +msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:376 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:344 +#: ../../whatsnew/3.12.rst:378 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:348 +#: ../../whatsnew/3.12.rst:382 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:361 +#: ../../whatsnew/3.12.rst:395 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:401 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:371 +#: ../../whatsnew/3.12.rst:405 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:380 +#: ../../whatsnew/3.12.rst:414 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -389,7 +427,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:385 +#: ../../whatsnew/3.12.rst:419 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -399,7 +437,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:392 +#: ../../whatsnew/3.12.rst:426 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -408,21 +446,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:398 +#: ../../whatsnew/3.12.rst:432 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:400 +#: ../../whatsnew/3.12.rst:434 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:404 +#: ../../whatsnew/3.12.rst:438 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:406 +#: ../../whatsnew/3.12.rst:440 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -433,7 +471,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:416 +#: ../../whatsnew/3.12.rst:450 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -443,32 +481,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:424 +#: ../../whatsnew/3.12.rst:458 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:428 +#: ../../whatsnew/3.12.rst:462 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:431 +#: ../../whatsnew/3.12.rst:465 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:434 +#: ../../whatsnew/3.12.rst:468 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:472 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -478,7 +516,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:445 +#: ../../whatsnew/3.12.rst:479 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -489,7 +527,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:454 +#: ../../whatsnew/3.12.rst:488 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -497,14 +535,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:460 +#: ../../whatsnew/3.12.rst:494 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:464 +#: ../../whatsnew/3.12.rst:498 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -514,28 +552,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:471 +#: ../../whatsnew/3.12.rst:505 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:474 +#: ../../whatsnew/3.12.rst:508 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:478 +#: ../../whatsnew/3.12.rst:512 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:482 +#: ../../whatsnew/3.12.rst:516 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -543,33 +581,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:489 +#: ../../whatsnew/3.12.rst:523 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:491 +#: ../../whatsnew/3.12.rst:525 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:495 +#: ../../whatsnew/3.12.rst:529 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:532 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:500 +#: ../../whatsnew/3.12.rst:534 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:504 +#: ../../whatsnew/3.12.rst:538 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:506 +#: ../../whatsnew/3.12.rst:540 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -577,7 +615,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:511 +#: ../../whatsnew/3.12.rst:545 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -585,7 +623,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:550 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -593,7 +631,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:521 +#: ../../whatsnew/3.12.rst:555 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -605,7 +643,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:530 +#: ../../whatsnew/3.12.rst:564 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -613,57 +651,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:536 +#: ../../whatsnew/3.12.rst:570 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:540 +#: ../../whatsnew/3.12.rst:574 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:543 +#: ../../whatsnew/3.12.rst:577 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:547 +#: ../../whatsnew/3.12.rst:581 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:552 +#: ../../whatsnew/3.12.rst:586 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:554 +#: ../../whatsnew/3.12.rst:588 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:558 +#: ../../whatsnew/3.12.rst:592 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:560 +#: ../../whatsnew/3.12.rst:594 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:565 +#: ../../whatsnew/3.12.rst:599 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:567 +#: ../../whatsnew/3.12.rst:601 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -672,35 +710,35 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:576 +#: ../../whatsnew/3.12.rst:610 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:578 +#: ../../whatsnew/3.12.rst:612 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:582 +#: ../../whatsnew/3.12.rst:616 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:584 +#: ../../whatsnew/3.12.rst:618 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:622 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:626 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -708,60 +746,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:598 +#: ../../whatsnew/3.12.rst:632 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:600 +#: ../../whatsnew/3.12.rst:634 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:605 +#: ../../whatsnew/3.12.rst:639 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:607 +#: ../../whatsnew/3.12.rst:641 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:644 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:615 +#: ../../whatsnew/3.12.rst:649 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:617 +#: ../../whatsnew/3.12.rst:651 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:621 +#: ../../whatsnew/3.12.rst:655 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:625 +#: ../../whatsnew/3.12.rst:659 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:629 +#: ../../whatsnew/3.12.rst:663 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -774,27 +812,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:640 +#: ../../whatsnew/3.12.rst:674 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:642 +#: ../../whatsnew/3.12.rst:676 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:645 +#: ../../whatsnew/3.12.rst:679 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:649 +#: ../../whatsnew/3.12.rst:683 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:685 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -802,14 +840,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:656 +#: ../../whatsnew/3.12.rst:690 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:660 +#: ../../whatsnew/3.12.rst:694 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -817,13 +855,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:665 +#: ../../whatsnew/3.12.rst:699 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:668 +#: ../../whatsnew/3.12.rst:702 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -831,38 +869,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:673 +#: ../../whatsnew/3.12.rst:707 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:675 +#: ../../whatsnew/3.12.rst:709 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:681 +#: ../../whatsnew/3.12.rst:715 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:717 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:686 +#: ../../whatsnew/3.12.rst:720 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:690 +#: ../../whatsnew/3.12.rst:724 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:692 +#: ../../whatsnew/3.12.rst:726 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -870,7 +908,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:698 +#: ../../whatsnew/3.12.rst:732 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -878,14 +916,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:738 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:709 +#: ../../whatsnew/3.12.rst:743 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -893,24 +931,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:714 +#: ../../whatsnew/3.12.rst:748 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:754 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:756 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:725 +#: ../../whatsnew/3.12.rst:759 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -918,36 +956,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:766 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:737 +#: ../../whatsnew/3.12.rst:771 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:777 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:779 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:750 +#: ../../whatsnew/3.12.rst:784 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:752 +#: ../../whatsnew/3.12.rst:786 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -957,7 +995,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:761 +#: ../../whatsnew/3.12.rst:795 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -966,34 +1004,42 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 ../../whatsnew/3.12.rst:1504 +#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1547 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:772 +#: ../../whatsnew/3.12.rst:805 +msgid "" +":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " +"recursion limit now applies only to Python code. Builtin functions do not " +"use the recursion limit, but are protected by a different mechanism that " +"prevents recursion from causing a virtual machine crash." +msgstr "" + +#: ../../whatsnew/3.12.rst:811 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:774 +#: ../../whatsnew/3.12.rst:813 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:776 +#: ../../whatsnew/3.12.rst:815 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:782 +#: ../../whatsnew/3.12.rst:821 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:823 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1001,11 +1047,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:790 +#: ../../whatsnew/3.12.rst:829 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:792 +#: ../../whatsnew/3.12.rst:831 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1015,11 +1061,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 +#: ../../whatsnew/3.12.rst:840 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:842 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1027,22 +1073,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:809 +#: ../../whatsnew/3.12.rst:848 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:850 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:816 +#: ../../whatsnew/3.12.rst:855 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:818 +#: ../../whatsnew/3.12.rst:857 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1055,7 +1101,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 +#: ../../whatsnew/3.12.rst:868 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1063,13 +1109,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:851 +#: ../../whatsnew/3.12.rst:890 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:854 +#: ../../whatsnew/3.12.rst:893 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1080,71 +1126,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:862 +#: ../../whatsnew/3.12.rst:901 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:866 +#: ../../whatsnew/3.12.rst:905 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:909 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:872 +#: ../../whatsnew/3.12.rst:911 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:915 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:917 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:894 +#: ../../whatsnew/3.12.rst:933 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "" +msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:897 +#: ../../whatsnew/3.12.rst:936 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:899 +#: ../../whatsnew/3.12.rst:938 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:904 +#: ../../whatsnew/3.12.rst:943 msgid "Optimizations" -msgstr "" +msgstr "最佳化" -#: ../../whatsnew/3.12.rst:906 +#: ../../whatsnew/3.12.rst:945 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:910 +#: ../../whatsnew/3.12.rst:949 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:914 +#: ../../whatsnew/3.12.rst:953 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1152,13 +1198,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:919 +#: ../../whatsnew/3.12.rst:958 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:922 +#: ../../whatsnew/3.12.rst:961 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1166,18 +1212,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:927 +#: ../../whatsnew/3.12.rst:966 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:972 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:935 +#: ../../whatsnew/3.12.rst:974 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1185,20 +1231,20 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:940 +#: ../../whatsnew/3.12.rst:979 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:943 +#: ../../whatsnew/3.12.rst:982 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:946 +#: ../../whatsnew/3.12.rst:985 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1207,35 +1253,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:952 +#: ../../whatsnew/3.12.rst:991 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:956 +#: ../../whatsnew/3.12.rst:995 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:997 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:963 +#: ../../whatsnew/3.12.rst:1002 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:970 ../../whatsnew/3.12.rst:1869 +#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1938 msgid "Deprecated" -msgstr "" +msgstr "已棄用" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:1011 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1243,14 +1289,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:977 +#: ../../whatsnew/3.12.rst:1016 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" "`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:981 +#: ../../whatsnew/3.12.rst:1020 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1260,7 +1306,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:989 +#: ../../whatsnew/3.12.rst:1028 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1269,25 +1315,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:995 +#: ../../whatsnew/3.12.rst:1034 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1049 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:999 +#: ../../whatsnew/3.12.rst:1038 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1005 +#: ../../whatsnew/3.12.rst:1044 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1297,28 +1343,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1012 +#: ../../whatsnew/3.12.rst:1051 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1055 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1020 +#: ../../whatsnew/3.12.rst:1059 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1023 +#: ../../whatsnew/3.12.rst:1062 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1326,7 +1372,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1067 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1334,14 +1380,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1033 +#: ../../whatsnew/3.12.rst:1072 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1038 +#: ../../whatsnew/3.12.rst:1077 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1350,7 +1396,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1043 +#: ../../whatsnew/3.12.rst:1082 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1359,148 +1405,148 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1050 +#: ../../whatsnew/3.12.rst:1089 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1052 +#: ../../whatsnew/3.12.rst:1091 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1055 +#: ../../whatsnew/3.12.rst:1094 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1096 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1058 +#: ../../whatsnew/3.12.rst:1097 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1098 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1060 +#: ../../whatsnew/3.12.rst:1099 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1061 +#: ../../whatsnew/3.12.rst:1100 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1101 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1063 +#: ../../whatsnew/3.12.rst:1102 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1064 +#: ../../whatsnew/3.12.rst:1103 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1065 +#: ../../whatsnew/3.12.rst:1104 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1105 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1106 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1068 +#: ../../whatsnew/3.12.rst:1107 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1108 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1070 +#: ../../whatsnew/3.12.rst:1109 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1071 +#: ../../whatsnew/3.12.rst:1110 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1111 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1073 +#: ../../whatsnew/3.12.rst:1112 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1113 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1075 +#: ../../whatsnew/3.12.rst:1114 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1116 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1079 +#: ../../whatsnew/3.12.rst:1118 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1119 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1081 +#: ../../whatsnew/3.12.rst:1120 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1121 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1083 +#: ../../whatsnew/3.12.rst:1122 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1084 +#: ../../whatsnew/3.12.rst:1123 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1085 +#: ../../whatsnew/3.12.rst:1124 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1125 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1126 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1129 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1092 +#: ../../whatsnew/3.12.rst:1131 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1097 +#: ../../whatsnew/3.12.rst:1136 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1508,33 +1554,33 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1140 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1141 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1142 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1143 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1144 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1146 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1149 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1542,47 +1588,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1115 +#: ../../whatsnew/3.12.rst:1154 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1157 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1160 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1161 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1162 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1164 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1166 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1167 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1169 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "" +msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1590,7 +1636,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1177 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1601,52 +1647,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1190 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1194 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1197 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1200 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1203 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API." msgstr "" -#: ../../whatsnew/3.12.rst:1167 +#: ../../whatsnew/3.12.rst:1206 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1209 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1654,21 +1700,21 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1216 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1218 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1182 +#: ../../whatsnew/3.12.rst:1221 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1184 +#: ../../whatsnew/3.12.rst:1223 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1680,42 +1726,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1195 ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1234 ../../whatsnew/3.12.rst:2020 msgid "Removed" -msgstr "" +msgstr "已移除" -#: ../../whatsnew/3.12.rst:1197 +#: ../../whatsnew/3.12.rst:1236 msgid "" "``asynchat`` and ``asyncore``: These two modules have been removed according " "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1203 +#: ../../whatsnew/3.12.rst:1242 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1245 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1247 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1210 +#: ../../whatsnew/3.12.rst:1249 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1252 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1724,13 +1770,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1258 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1222 +#: ../../whatsnew/3.12.rst:1261 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1738,7 +1784,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1228 +#: ../../whatsnew/3.12.rst:1267 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1748,17 +1794,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1235 +#: ../../whatsnew/3.12.rst:1274 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" +msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1276 +msgid "" +":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " +"enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1237 +#: ../../whatsnew/3.12.rst:1280 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1284 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1767,7 +1819,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1290 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1776,178 +1828,178 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1253 +#: ../../whatsnew/3.12.rst:1296 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1256 +#: ../../whatsnew/3.12.rst:1299 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1259 +#: ../../whatsnew/3.12.rst:1302 msgid "" "``importlib.util.set_package`` has been removed. (Contributed by Brett " "Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1305 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1308 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1268 +#: ../../whatsnew/3.12.rst:1311 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1271 +#: ../../whatsnew/3.12.rst:1314 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1319 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1319 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1320 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1320 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1278 +#: ../../whatsnew/3.12.rst:1321 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1278 +#: ../../whatsnew/3.12.rst:1321 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1322 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1322 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1324 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1324 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1282 +#: ../../whatsnew/3.12.rst:1325 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1282 +#: ../../whatsnew/3.12.rst:1325 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1326 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1326 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1327 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1327 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1285 +#: ../../whatsnew/3.12.rst:1328 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1285 +#: ../../whatsnew/3.12.rst:1328 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1288 +#: ../../whatsnew/3.12.rst:1331 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1346 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1348 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1307 +#: ../../whatsnew/3.12.rst:1350 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1351 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1309 +#: ../../whatsnew/3.12.rst:1352 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1310 +#: ../../whatsnew/3.12.rst:1353 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1355 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1357 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1318 +#: ../../whatsnew/3.12.rst:1361 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -1956,14 +2008,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1367 msgid "" ":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1371 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -1971,27 +2023,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1379 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1382 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1383 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1385 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1388 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -1999,22 +2051,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1393 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" -msgstr "" +msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1395 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1397 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1401 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2022,7 +2074,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1407 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2033,174 +2085,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1416 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1418 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1423 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1430 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1381 -#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1383 -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1385 -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1429 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1424 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1424 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1382 +#: ../../whatsnew/3.12.rst:1425 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1431 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1426 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1383 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1426 ../../whatsnew/3.12.rst:1432 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1427 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1433 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1428 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1385 ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1428 ../../whatsnew/3.12.rst:1434 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1429 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1429 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1430 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1387 ../../whatsnew/3.12.rst:1388 -#: ../../whatsnew/3.12.rst:1389 ../../whatsnew/3.12.rst:1390 -#: ../../whatsnew/3.12.rst:1391 ../../whatsnew/3.12.rst:1392 -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1430 ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1434 ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1436 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1431 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1432 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1433 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1434 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1435 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1435 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1436 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1436 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1440 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1443 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1446 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1450 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1453 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1455 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2208,7 +2260,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1459 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2217,21 +2269,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1465 msgid "" ":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1470 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1475 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2241,21 +2293,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1486 ../../whatsnew/3.12.rst:1798 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1488 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1492 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1494 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2264,7 +2316,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1501 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2276,7 +2328,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1509 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2286,21 +2338,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1515 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1519 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1481 +#: ../../whatsnew/3.12.rst:1524 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2308,7 +2360,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1529 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2320,7 +2372,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1538 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2332,14 +2384,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1551 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1556 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2351,45 +2403,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1567 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1579 msgid "" -"Additionally, there may be some minor behavioral changes as a consecuence of " +"Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1539 +#: ../../whatsnew/3.12.rst:1582 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1585 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1588 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1591 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1595 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1554 +#: ../../whatsnew/3.12.rst:1597 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2398,21 +2450,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1603 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1565 +#: ../../whatsnew/3.12.rst:1608 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1612 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2421,41 +2473,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1618 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1620 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1621 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1622 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1624 msgid "(Contributed by Zhang Na in :gh:`90656`.)" -msgstr "" +msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1626 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1628 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1632 +msgid "" +"Windows builds and macOS installers from python.org now use OpenSSL 3.0." +msgstr "" + +#: ../../whatsnew/3.12.rst:1636 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1642 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2463,84 +2520,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1648 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1605 +#: ../../whatsnew/3.12.rst:1650 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1651 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1653 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1655 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1656 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1657 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1659 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1662 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" -msgstr "" +msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1664 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1667 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1669 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1626 +#: ../../whatsnew/3.12.rst:1671 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1674 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1677 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" -msgstr "" +msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2548,29 +2605,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1684 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1643 +#: ../../whatsnew/3.12.rst:1688 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1644 +#: ../../whatsnew/3.12.rst:1689 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1690 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1646 +#: ../../whatsnew/3.12.rst:1691 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1693 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2581,7 +2638,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1701 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2589,32 +2646,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1706 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1665 +#: ../../whatsnew/3.12.rst:1710 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1711 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1712 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1714 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1673 +#: ../../whatsnew/3.12.rst:1718 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2622,14 +2679,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1724 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1683 +#: ../../whatsnew/3.12.rst:1728 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2638,28 +2695,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1734 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1743 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1747 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2669,14 +2726,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1755 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1759 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2684,91 +2741,99 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1764 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1768 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1771 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1772 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1773 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1774 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1730 +#: ../../whatsnew/3.12.rst:1775 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1776 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1777 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1778 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1779 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1782 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1781 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:1784 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" +msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1786 +msgid "" +":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " +"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" +"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " +"info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1792 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1749 +#: ../../whatsnew/3.12.rst:1800 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1752 +#: ../../whatsnew/3.12.rst:1803 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1807 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2777,7 +2842,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1763 +#: ../../whatsnew/3.12.rst:1814 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2785,13 +2850,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1819 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1823 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2800,7 +2865,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1829 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2809,13 +2874,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1835 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1839 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2829,7 +2894,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1800 +#: ../../whatsnew/3.12.rst:1851 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2837,7 +2902,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1856 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2845,7 +2910,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1861 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2853,7 +2918,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1815 +#: ../../whatsnew/3.12.rst:1866 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2861,25 +2926,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1871 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1874 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:1875 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:1876 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1827 +#: ../../whatsnew/3.12.rst:1878 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2887,14 +2952,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1832 +#: ../../whatsnew/3.12.rst:1883 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1887 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2903,17 +2968,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1894 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1845 +#: ../../whatsnew/3.12.rst:1896 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:1898 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -2921,20 +2986,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1903 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1907 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:1910 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -2942,288 +3007,316 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1915 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1919 +msgid "" +":c:struct:`PyLongObject` has had its internals changed for better " +"performance. Although the internals of :c:struct:`PyLongObject` are private, " +"they are used by some extension modules. The internal fields should no " +"longer be accessed directly, instead the API functions beginning ``PyLong_..." +"`` should be used instead. Two new *unstable* API functions are provided for " +"efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " +"a single machine word:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1927 +msgid ":c:func:`PyUnstable_Long_IsCompact`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1928 +msgid ":c:func:`PyUnstable_Long_CompactValue`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1930 +msgid "" +"Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " +"be thread-safe, regardless of memory domain. Allocators that don't have " +"their own state, including \"hooks\", are not affected. If your custom " +"allocator is not already thread-safe and you need guidance then please " +"create a new GitHub issue and CC ``@ericsnowcurrently``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1940 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:1942 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1943 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1944 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1945 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1946 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1947 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1948 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1949 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1950 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:1951 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1952 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1953 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1885 +#: ../../whatsnew/3.12.rst:1954 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:1955 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1957 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1958 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1890 +#: ../../whatsnew/3.12.rst:1959 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1960 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:1961 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1962 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1963 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1965 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1969 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:1972 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1906 +#: ../../whatsnew/3.12.rst:1975 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1978 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1980 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1913 +#: ../../whatsnew/3.12.rst:1982 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1985 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:1918 +#: ../../whatsnew/3.12.rst:1987 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:1988 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:1989 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1921 +#: ../../whatsnew/3.12.rst:1990 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:1992 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:1926 +#: ../../whatsnew/3.12.rst:1995 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:1931 +#: ../../whatsnew/3.12.rst:2000 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:2003 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1939 +#: ../../whatsnew/3.12.rst:2008 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:2011 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:2014 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:2027 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:2029 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2030 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:2031 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:2032 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:2033 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:2034 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2035 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:2036 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:2037 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:2039 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:2042 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2045 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 904feb82e4..74ef2a0d5b 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+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-" @@ -623,8 +623,8 @@ msgid "" "(Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky " "in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)" msgstr "" -"(由 Daniel Stutzbach 在 :issue:`9213`、Alexander Belopolsky 在 " -":issue:`2690`、Nick Coghlan 在 :issue:`10889` 中貢獻。)" +"(由 Daniel Stutzbach 在 :issue:`9213`、Alexander Belopolsky 在 :issue:" +"`2690`、Nick Coghlan 在 :issue:`10889` 中貢獻。)" #: ../../whatsnew/3.2.rst:640 msgid "" @@ -1129,9 +1129,9 @@ msgid "" "`1289118`, :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :" "issue:`8013`, and :issue:`10827`.)" msgstr "" -"(由 Alexander Belopolsky 和 Victor Stinner 在 :issue:`1289118`" -"、:issue:`5094`、:issue:`6641`、:issue:`2706`、:issue:`1777412`、:issue:`8013` " -"和 :issue:`10827` 中貢獻。)" +"(由 Alexander Belopolsky 和 Victor Stinner 在 :issue:`1289118`、:issue:" +"`5094`、:issue:`6641`、:issue:`2706`、:issue:`1777412`、:issue:`8013` 和 :" +"issue:`10827` 中貢獻。)" #: ../../whatsnew/3.2.rst:1046 msgid "math" @@ -1494,7 +1494,8 @@ msgid "" "(Contributed by Antoine Pitrou and Brian Curtin in :issue:`7461` and :issue:" "`10554`.)" msgstr "" -"(由 Antoine Pitrou 和 Brian Curtin 在 :issue:`7461` 和 :issue:`10554` 中貢獻。)" +"(由 Antoine Pitrou 和 Brian Curtin 在 :issue:`7461` 和 :issue:`10554` 中貢" +"獻。)" #: ../../whatsnew/3.2.rst:1388 msgid "select" @@ -1818,8 +1819,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:" "`8322`, :issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)" msgstr "" -"(由 Antoine Pitrou 在 :issue:`8850`、:issue:`1589`、:issue:`8322`、:issue:`5" -"639`、:issue:`4870`、:issue:`8484` 和 :issue:`8321` 中貢獻。)" +"(由 Antoine Pitrou 在 :issue:`8850`、:issue:`1589`、:issue:`8322`、:issue:" +"`5639`、:issue:`4870`、:issue:`8484` 和 :issue:`8321` 中貢獻。)" #: ../../whatsnew/3.2.rst:1677 msgid "nntp" @@ -1844,7 +1845,9 @@ msgstr "" msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" -msgstr "(由 Antoine Pitrou 在 :issue:`9360` 中和 Andrew Vant 在 :issue:`1926` 中貢獻。)" +msgstr "" +"(由 Antoine Pitrou 在 :issue:`9360` 中和 Andrew Vant 在 :issue:`1926` 中貢" +"獻。)" #: ../../whatsnew/3.2.rst:1691 msgid "certificates" @@ -2604,7 +2607,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2349 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.2.rst:2351 msgid "A number of small performance enhancements have been added:" @@ -2640,8 +2643,8 @@ msgid "" "(Contributed by Alexandre Vassalotti, Antoine Pitrou and the Unladen Swallow " "team in :issue:`9410` and :issue:`3873`.)" msgstr "" -"(由 Alexandre Vassalotti、Antoine Pitrou 和 Unladen Swallow 團隊在 :issue:`9410` " -"和 :issue:`3873` 中貢獻。)" +"(由 Alexandre Vassalotti、Antoine Pitrou 和 Unladen Swallow 團隊在 :issue:" +"`9410` 和 :issue:`3873` 中貢獻。)" #: ../../whatsnew/3.2.rst:2373 msgid "" @@ -2670,8 +2673,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" -"(由 Antoine Pitrou 在 :issue:`7451` 中貢獻、由 Raymond Hettinger 和 Antoine Pitrou " -"在 :issue:`10314` 中貢獻。)" +"(由 Antoine Pitrou 在 :issue:`7451` 中貢獻、由 Raymond Hettinger 和 Antoine " +"Pitrou 在 :issue:`10314` 中貢獻。)" #: ../../whatsnew/3.2.rst:2390 msgid "" @@ -2866,7 +2869,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:2507 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" -msgstr "(由 Kevin Walzer、Ned Deily 和 Ronald Oussoren 貢獻;:issue:`6075`。)" +msgstr "" +"(由 Kevin Walzer、Ned Deily 和 Ronald Oussoren 貢獻;:issue:`6075`。)" #: ../../whatsnew/3.2.rst:2510 msgid "Code Repository" @@ -3130,7 +3134,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2661 msgid "" -"The :c:type:`PyCObject` type, deprecated in 3.1, has been removed. To wrap " +"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 " "used instead; the new type has a well-defined interface for passing typing " "safety information and a less complicated signature for calling a destructor." @@ -3178,8 +3182,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " -"`_。)" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" #: ../../whatsnew/3.2.rst:2698 msgid "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index f99076c0d2..4d7fa2d5d6 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -3147,7 +3147,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2150 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.3.rst:2152 msgid "Major performance enhancements have been added:" @@ -3297,7 +3297,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2210 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.3.rst:2213 msgid "Unsupported Operating Systems" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index c4446f704f..a0e58c3027 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -2828,7 +2828,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2067 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.4.rst:2069 msgid "" @@ -2954,7 +2954,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2157 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.4.rst:2161 msgid "Operating Systems No Longer Supported" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index a1af180a8a..4ebf6aad9c 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -2629,7 +2629,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2105 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.5.rst:2107 msgid "" @@ -2900,7 +2900,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2262 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.5.rst:2265 msgid "New Keywords" @@ -3038,7 +3038,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2352 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.5.rst:2355 msgid "API and Feature Removals" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 47fd83b3b1..ff85eacb82 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -791,7 +791,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:707 msgid "(Contributed by Victor Stinner in :issue:`26516` and :issue:`26564`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`26516` 和 :issue:`26564` 中貢獻。)" #: ../../whatsnew/3.6.rst:713 msgid "DTrace and SystemTap probing support" @@ -1229,7 +1229,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1007 msgid "(Contributed by Stefan Krah amd Mark Dickinson in :issue:`25928`.)" -msgstr "" +msgstr "(由 Stefan Krah 和 Mark Dickinson 於 :issue:`25928` 中貢獻。)" #: ../../whatsnew/3.6.rst:1012 ../../whatsnew/3.6.rst:1986 msgid "distutils" @@ -2020,7 +2020,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1580 msgid "(Contributed by Emanuel Barry in :issue:`26823`.)" -msgstr "" +msgstr "(由 Emanuel Barry 於 :issue:`26823` 中貢獻。)" #: ../../whatsnew/3.6.rst:1584 msgid "tracemalloc" @@ -2040,7 +2040,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1592 msgid "(Contributed by Victor Stinner in :issue:`26588`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`26588` 中貢獻。)" #: ../../whatsnew/3.6.rst:1598 msgid "typing" @@ -2272,7 +2272,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1779 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.6.rst:1781 msgid "" @@ -2503,7 +2503,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1923 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.6.rst:1926 msgid "New Keywords" @@ -2704,7 +2704,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2086 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.6.rst:2089 msgid "API and Feature Removals" @@ -3154,7 +3154,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2398 ../../whatsnew/3.6.rst:2411 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" #: ../../whatsnew/3.6.rst:2404 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 237fc0e345..1c567304b2 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -2513,7 +2513,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1771 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.7.rst:1773 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 56b4ba2e38..c950b96b9c 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -1779,7 +1779,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1458 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.8.rst:1460 msgid "" @@ -2077,7 +2077,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1638 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.8.rst:1640 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 2dd9c0da9f..35ad207120 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -1106,7 +1106,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:746 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.9.rst:748 msgid "" @@ -1214,7 +1214,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:856 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.9.rst:858 msgid "" @@ -1364,7 +1364,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:955 ../../whatsnew/3.9.rst:1410 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.9.rst:957 msgid "" From d8aee9754bcac64ccca760c7cc52a88a61049ed9 Mon Sep 17 00:00:00 2001 From: mindihx Date: Wed, 23 Aug 2023 19:27:41 +0800 Subject: [PATCH 048/105] Translate library/calendar part 1/2 (#593) * Translate library/calendar part 1/2 * Refine translation for library/calendar --- library/calendar.po | 84 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 14 deletions(-) diff --git a/library/calendar.po b/library/calendar.po index 59c41e1239..55370dc52a 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2018-05-23 14:40+0000\n" +"PO-Revision-Date: 2023-08-18 15:42+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/calendar.rst:2 msgid ":mod:`calendar` --- General calendar-related functions" -msgstr "" +msgstr ":mod:`calendar` --- 日曆相關函式" #: ../../library/calendar.rst:10 msgid "**Source code:** :source:`Lib/calendar.py`" @@ -36,6 +36,11 @@ msgid "" "Parameters that specify dates are given as integers. For related " "functionality, see also the :mod:`datetime` and :mod:`time` modules." msgstr "" +"這個模組讓你可以像 Unix 的 :program:`cal` 程式一樣輸出日曆,並額外提供有用的" +"日曆相關函式。這些日曆預設把週一當作一週的第一天,而週日當作最後一天(歐洲的" +"慣例)。可以使用 :func:`setfirstweekday` 設定一週的第一天為週日 (6) 或一週的" +"其它任一天,其中指定日期的參數是整數。相關功能參考 :mod:`datetime` 和 :mod:" +"`time` 模組。" #: ../../library/calendar.rst:22 msgid "" @@ -47,16 +52,21 @@ msgid "" "as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is 2 BC, " "and so on." msgstr "" +"這個模組定義的函式和類別使用理想化的日曆,也就是公曆 (Gregorian calendar) 無" +"限往前後兩個方向延伸。這符合 Dershowitz 和 Reingold 在「Calendrical " +"Calculations」這本書定義的「逆推公曆」(proleptic Gregorian),是做所有計算的基" +"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 年,-1" +" 年是公元前 2 年依此類推。" #: ../../library/calendar.rst:33 msgid "" "Enumeration defining the days of the week as integer constants, from 0 to 6." -msgstr "" +msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" #: ../../library/calendar.rst:54 msgid "" "Enumeration defining months of the year as integer constants, from 1 to 12." -msgstr "" +msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" #: ../../library/calendar.rst:85 msgid "" @@ -64,6 +74,8 @@ msgid "" "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." msgstr "" +"建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" +"const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" #: ../../library/calendar.rst:88 msgid "" @@ -71,10 +83,12 @@ msgid "" "preparing the calendar data for formatting. This class doesn't do any " "formatting itself. This is the job of subclasses." msgstr "" +":class:`Calendar` 物件提供一些方法來為日曆資料的格式化做準備。這個類別本身不" +"做任何格式化,這是子類別的工作。" #: ../../library/calendar.rst:93 msgid ":class:`Calendar` instances have the following methods:" -msgstr "" +msgstr ":class:`Calendar` 實例有以下方法:" #: ../../library/calendar.rst:97 msgid "" @@ -82,6 +96,8 @@ msgid "" "The first value from the iterator will be the same as the value of the :attr:" "`firstweekday` property." msgstr "" +"回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" +"`firstweekday` 屬性的值一樣。" #: ../../library/calendar.rst:104 msgid "" @@ -90,6 +106,8 @@ msgid "" "month and all days before the start of the month or after the end of the " "month that are required to get a complete week." msgstr "" +"回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" +"期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" #: ../../library/calendar.rst:112 msgid "" @@ -98,6 +116,9 @@ msgid "" "Days returned will simply be day of the month numbers. For the days outside " "of the specified month, the day number is ``0``." msgstr "" +"類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" +"限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" +"之外的日期數字會是 ``0``。" #: ../../library/calendar.rst:120 msgid "" @@ -106,6 +127,9 @@ msgid "" "Days returned will be tuples consisting of a day of the month number and a " "week day number." msgstr "" +"類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" +"限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" +"幾的數字組成的元組。" #: ../../library/calendar.rst:128 msgid "" @@ -114,6 +138,9 @@ msgid "" "Days returned will be tuples consisting of a year, a month and a day of the " "month numbers." msgstr "" +"類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" +"限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" +"元組。" #: ../../library/calendar.rst:138 msgid "" @@ -122,24 +149,33 @@ msgid "" "Days returned will be tuples consisting of a year, a month, a day of the " "month, and a day of the week numbers." msgstr "" +"類似 :meth:`itermonthdates`,回傳一個在 *year* 年 *month* 月的疊代器,但不受" +"限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" +"數字組成的元組。" #: ../../library/calendar.rst:148 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." msgstr "" +"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" +"class:`datetime.date` 物件。" #: ../../library/calendar.rst:154 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." msgstr "" +"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" +"月當日的數字及代表週幾的數字組成的元組。" #: ../../library/calendar.rst:161 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." msgstr "" +"回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" +"月當日的數字。" #: ../../library/calendar.rst:167 msgid "" @@ -148,6 +184,9 @@ msgid "" "(defaulting to 3). Each month contains between 4 and 6 weeks and each week " "contains 1--7 days. Days are :class:`datetime.date` objects." msgstr "" +"回傳用來格式化的指定年份的資料。回傳值是月份列的串列,每個月份列最多由 " +"*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" +"一天則是一個 :class:`datetime.date` 物件。" #: ../../library/calendar.rst:175 msgid "" @@ -155,6 +194,8 @@ msgid "" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " "numbers and weekday numbers. Day numbers outside this month are zero." msgstr "" +"回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" +"個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" #: ../../library/calendar.rst:182 msgid "" @@ -162,14 +203,16 @@ msgid "" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " "numbers outside this month are zero." msgstr "" +"回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" +"個該月當日的數字,該月外的日期的該月當日數字為 0。" #: ../../library/calendar.rst:189 msgid "This class can be used to generate plain text calendars." -msgstr "" +msgstr "這個類別用來產生純文字的日曆。" #: ../../library/calendar.rst:191 msgid ":class:`TextCalendar` instances have the following methods:" -msgstr "" +msgstr ":class:`TextCalendar` 實例有以下方法:" #: ../../library/calendar.rst:195 msgid "" @@ -179,10 +222,13 @@ msgid "" "the first weekday as specified in the constructor or set by the :meth:" "`setfirstweekday` method." msgstr "" +"以多行字串的形式回傳一個月份的日曆。如果給定 *w*,它會指定置中的日期欄的寬" +"度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" +"者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" #: ../../library/calendar.rst:204 msgid "Print a month's calendar as returned by :meth:`formatmonth`." -msgstr "" +msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" #: ../../library/calendar.rst:209 msgid "" @@ -193,31 +239,38 @@ msgid "" "`setfirstweekday` method. The earliest year for which a calendar can be " "generated is platform-dependent." msgstr "" +"以多行字串的形式回傳有 *m* 欄的一整年的日曆。可選的參數 *w*、*l* 及 *c* 分別" +"是日期欄寬度、每週行數及月份欄中間的空白數。這個日曆會依據在建構函式中指定或" +"者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" +"的年份會依據平台而不同。" #: ../../library/calendar.rst:219 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." -msgstr "" +msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" #: ../../library/calendar.rst:224 msgid "This class can be used to generate HTML calendars." -msgstr "" +msgstr "這個類別用來產生 HTML 日曆。" #: ../../library/calendar.rst:227 msgid ":class:`!HTMLCalendar` instances have the following methods:" -msgstr "" +msgstr ":class:`!HTMLCalendar` 實例有以下方法:" #: ../../library/calendar.rst:231 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." msgstr "" +"以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" +"份,否則只會有月份名稱。" #: ../../library/calendar.rst:238 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" +"以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" #: ../../library/calendar.rst:244 msgid "" @@ -227,6 +280,9 @@ msgid "" "be used. *encoding* specifies the encoding to be used for the output " "(defaulting to the system default encoding)." msgstr "" +"以完整 HTML 頁面的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個" +"月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " +"表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" #: ../../library/calendar.rst:251 msgid "" @@ -432,7 +488,7 @@ msgstr "" #: ../../library/calendar.rst:470 msgid "" "Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." -msgstr "" +msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" #: ../../library/calendar.rst:476 msgid "Module :mod:`datetime`" @@ -442,7 +498,7 @@ msgstr ":mod:`datetime` 模組" msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." -msgstr "" +msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" #: ../../library/calendar.rst:478 msgid "Module :mod:`time`" @@ -450,4 +506,4 @@ msgstr ":mod:`time` 模組" #: ../../library/calendar.rst:479 msgid "Low-level time related functions." -msgstr "" +msgstr "底層的時間相關函式。" From b77bd3a8e0aec48b69d4dc3357d493c927d3b7a9 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Thu, 24 Aug 2023 13:05:42 +0800 Subject: [PATCH 049/105] Translate `library/xml.po` (#604) * translate `library/xml.po` * Apply suggestions from code review Co-authored-by: mindihx * fix(library/xml): update based on reviewer's comment * fix(library/xml): modify based on review comment --------- Co-authored-by: mindihx --- library/xml.po | 97 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 31 deletions(-) diff --git a/library/xml.po b/library/xml.po index 4313c020b9..0bdf948410 100644 --- a/library/xml.po +++ b/library/xml.po @@ -1,16 +1,16 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Leon H., 2017 +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-29 10:36+0000\n" -"PO-Revision-Date: 2018-05-23 16:16+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-08-21 02:16+0000\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -30,7 +30,7 @@ msgstr "**原始碼:**\\ :source:`Lib/xml/`" #: ../../library/xml.rst:16 msgid "" "Python's interfaces for processing XML are grouped in the ``xml`` package." -msgstr "" +msgstr "Python 處理 XML 的介面被歸類於 ``xml`` 套件中。" #: ../../library/xml.rst:20 msgid "" @@ -38,6 +38,8 @@ msgid "" "data. If you need to parse untrusted or unauthenticated data see the :ref:" "`xml-vulnerabilities` and :ref:`defusedxml-package` sections." msgstr "" +"XML 模組無法抵禦錯誤或惡意建構的資料。如果你需要剖析不受信任或未經身份驗證的" +"資料,請參閱 :ref:`xml-vulnerabilities` 和 :ref:`defusedxml-package` 段落。" #: ../../library/xml.rst:25 msgid "" @@ -46,46 +48,52 @@ msgid "" "is included with Python, so the :mod:`xml.parsers.expat` module will always " "be available." msgstr "" +"請務必注意 :mod:`xml` 套件中的模組要求至少有一個可用的 SAX 相容 XML 剖析器。" +"Expat 剖析器包含在 Python 中,所以總是可以使用 :mod:`xml.parsers.expat` 模" +"組。" #: ../../library/xml.rst:30 msgid "" "The documentation for the :mod:`xml.dom` and :mod:`xml.sax` packages are the " "definition of the Python bindings for the DOM and SAX interfaces." msgstr "" +":mod:`xml.dom` 和 :mod:`xml.sax` 套件的文件為 DOM 和 SAX 介面的 Python 繫結的" +"定義。" #: ../../library/xml.rst:33 msgid "The XML handling submodules are:" -msgstr "" +msgstr "以下是 XML 處理子模組:" #: ../../library/xml.rst:35 msgid "" ":mod:`xml.etree.ElementTree`: the ElementTree API, a simple and lightweight " "XML processor" msgstr "" +":mod:`xml.etree.ElementTree`:ElementTree API,一個簡單且輕量級的 XML 處理器" #: ../../library/xml.rst:40 msgid ":mod:`xml.dom`: the DOM API definition" -msgstr "" +msgstr ":mod:`xml.dom`:DOM API 定義" #: ../../library/xml.rst:41 msgid ":mod:`xml.dom.minidom`: a minimal DOM implementation" -msgstr "" +msgstr ":mod:`xml.dom.minidom`:最小的 DOM 實作" #: ../../library/xml.rst:42 msgid ":mod:`xml.dom.pulldom`: support for building partial DOM trees" -msgstr "" +msgstr ":mod:`xml.dom.pulldom`:支援建置部分 DOM 樹" #: ../../library/xml.rst:46 msgid ":mod:`xml.sax`: SAX2 base classes and convenience functions" -msgstr "" +msgstr ":mod:`xml.sax`:SAX2 基底類別和便利函式" #: ../../library/xml.rst:47 msgid ":mod:`xml.parsers.expat`: the Expat parser binding" -msgstr "" +msgstr ":mod:`xml.parsers.expat`:Expat 剖析器繫結" #: ../../library/xml.rst:53 msgid "XML vulnerabilities" -msgstr "" +msgstr "XML 漏洞" #: ../../library/xml.rst:55 msgid "" @@ -94,16 +102,19 @@ msgid "" "attacks, access local files, generate network connections to other machines, " "or circumvent firewalls." msgstr "" +"XML 處理模組無法抵禦惡意建構的資料。攻擊者可以濫用 XML 功能來執行阻斷服務攻" +"擊 (denial of service attack)、存取本地檔案、生成與其他機器的網路連接或繞過防" +"火牆。" #: ../../library/xml.rst:60 msgid "" "The following table gives an overview of the known attacks and whether the " "various modules are vulnerable to them." -msgstr "" +msgstr "下表概述了已知的攻擊以及各個模組是否易有漏洞。" #: ../../library/xml.rst:64 msgid "kind" -msgstr "" +msgstr "種類" #: ../../library/xml.rst:64 msgid "sax" @@ -127,51 +138,51 @@ msgstr "xmlrpc" #: ../../library/xml.rst:66 msgid "billion laughs" -msgstr "" +msgstr "十億笑聲 (billion laughs)" #: ../../library/xml.rst:66 ../../library/xml.rst:67 msgid "**Vulnerable** (1)" -msgstr "" +msgstr "**脆弱** (1)" #: ../../library/xml.rst:67 msgid "quadratic blowup" -msgstr "" +msgstr "二次爆炸 (quadratic blowup)" #: ../../library/xml.rst:68 ../../library/xml.rst:103 msgid "external entity expansion" -msgstr "" +msgstr "外部實體擴展 (external entity expansion)" #: ../../library/xml.rst:68 ../../library/xml.rst:69 msgid "Safe (5)" -msgstr "" +msgstr "安全 (5)" #: ../../library/xml.rst:68 msgid "Safe (2)" -msgstr "" +msgstr "安全 (2)" #: ../../library/xml.rst:68 msgid "Safe (3)" -msgstr "" +msgstr "安全 (3)" #: ../../library/xml.rst:68 msgid "Safe (4)" -msgstr "" +msgstr "安全 (4)" #: ../../library/xml.rst:69 ../../library/xml.rst:108 msgid "`DTD`_ retrieval" -msgstr "" +msgstr "`DTD`_ 檢索" #: ../../library/xml.rst:69 ../../library/xml.rst:70 msgid "Safe" -msgstr "" +msgstr "安全" #: ../../library/xml.rst:70 ../../library/xml.rst:115 msgid "decompression bomb" -msgstr "" +msgstr "解壓縮炸彈 (decompression bomb)" #: ../../library/xml.rst:70 msgid "**Vulnerable**" -msgstr "" +msgstr "**脆弱**" #: ../../library/xml.rst:73 msgid "" @@ -180,32 +191,37 @@ msgid "" "to potential reliance on system-provided libraries. Check :const:`pyexpat." "EXPAT_VERSION`." msgstr "" +"Expat 2.4.1 及更新的版本不易受到「十億笑聲」和「二次爆炸」漏洞的影響。但仍可" +"能由於依賴系統提供的函式庫而被列為易受攻擊的項目。請檢查 :const:`pyexpat." +"EXPAT_VERSION`。" #: ../../library/xml.rst:77 msgid "" ":mod:`xml.etree.ElementTree` doesn't expand external entities and raises a :" "exc:`~xml.etree.ElementTree.ParseError` when an entity occurs." msgstr "" +":mod:`xml.etree.ElementTree` 不會擴展外部實體,並在實體出現時引發 :exc:`~xml." +"etree.ElementTree.ParseError`。" #: ../../library/xml.rst:79 msgid "" ":mod:`xml.dom.minidom` doesn't expand external entities and simply returns " "the unexpanded entity verbatim." -msgstr "" +msgstr ":mod:`xml.dom.minidom` 不會擴展外部實體,只會逐字回傳未擴展的實體。" #: ../../library/xml.rst:81 msgid ":mod:`xmlrpc.client` doesn't expand external entities and omits them." -msgstr "" +msgstr ":mod:`xmlrpc.client` 不會擴展外部實體且會忽略它們。" #: ../../library/xml.rst:82 msgid "" "Since Python 3.7.1, external general entities are no longer processed by " "default." -msgstr "" +msgstr "從 Python 3.7.1 開始,預設情況下不再處理外部通用實體。" #: ../../library/xml.rst:91 msgid "billion laughs / exponential entity expansion" -msgstr "" +msgstr "十億笑聲 / 指數實體擴展" #: ../../library/xml.rst:87 msgid "" @@ -215,10 +231,13 @@ msgid "" "string. The exponential expansion results in several gigabytes of text and " "consumes lots of memory and CPU time." msgstr "" +"`十億笑聲 `_\\ 攻擊(也稱為指數實體擴展 (exponential entity " +"expansion))使用多層巢狀實體。每個實體多次引用另一個實體,最終的實體定義包含" +"一個小字串。指數擴展會產生數 GB 的文本,並消耗大量記憶體和 CPU 時間。" #: ../../library/xml.rst:98 msgid "quadratic blowup entity expansion" -msgstr "" +msgstr "二次爆炸實體擴展" #: ../../library/xml.rst:94 msgid "" @@ -228,6 +247,9 @@ msgid "" "isn't as efficient as the exponential case but it avoids triggering parser " "countermeasures that forbid deeply nested entities." msgstr "" +"二次爆炸攻擊類似於\\ `十億笑聲 `_\\ 攻擊;它也濫用實體擴展。" +"它不是巢狀實體,而是一遍又一遍地重複一個具有幾千個字元的大型實體。該攻擊不如" +"指數擴展那麼有效率,但它不會觸發那些用來防止深度巢狀實體的剖析器對策。" #: ../../library/xml.rst:101 msgid "" @@ -235,6 +257,8 @@ msgid "" "can also point to external resources or local files. The XML parser accesses " "the resource and embeds the content into the XML document." msgstr "" +"實體聲明不僅僅可以包含用於替換的文本,它們還可以指向外部資源或本地檔案。XML " +"剖析器會存取資源並將內容嵌入到 XML 文件中。" #: ../../library/xml.rst:106 msgid "" @@ -242,6 +266,8 @@ msgid "" "type definitions from remote or local locations. The feature has similar " "implications as the external entity expansion issue." msgstr "" +"一些 XML 函式庫(例如 Python 的 :mod:`xml.dom.pulldom`)從遠端或本地位置檢索" +"文件類型定義。該功能與外部實體擴展問題具有類似的含義。" #: ../../library/xml.rst:111 msgid "" @@ -250,12 +276,17 @@ msgid "" "files. For an attacker it can reduce the amount of transmitted data by three " "magnitudes or more." msgstr "" +"解壓縮炸彈(又名 `ZIP bomb`_\\ )適用於所有可以剖析壓縮 XML 串流(例如 gzip " +"壓縮的 HTTP 串流或 LZMA 壓縮檔案)的 XML 函式庫。對於攻擊者來說,它可以將傳輸" +"的資料量減少三個或更多數量級。" #: ../../library/xml.rst:117 msgid "" "The documentation for `defusedxml`_ on PyPI has further information about " "all known attack vectors with examples and references." msgstr "" +"PyPI 上的 `defusedxml`_ 文件包含有關所有已知攻擊媒介 (attack vector) 的更多資" +"訊以及範例和參考資料。" #: ../../library/xml.rst:123 msgid "The :mod:`!defusedxml` Package" @@ -269,3 +300,7 @@ msgid "" "data. The package also ships with example exploits and extended " "documentation on more XML exploits such as XPath injection." msgstr "" +"`defusedxml`_ 是一個純 Python 套件,其中包含所有標準函式庫中 XML 剖析器的修正" +"版本子類別,可防止任何潛在的惡意操作。當伺服器程式會剖析任何不受信任的 XML 資" +"料時建議使用此套件。該套件還附帶了更多有關 XML 漏洞(例如 XPath 注入)的範例" +"和延伸文件。" From fff6b2944fe637860032ee16bda7906d405fcc81 Mon Sep 17 00:00:00 2001 From: minghx Date: Thu, 24 Aug 2023 06:18:29 +0000 Subject: [PATCH 050/105] Translate library/calendar part 2/2 --- library/calendar.po | 77 ++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/library/calendar.po b/library/calendar.po index 55370dc52a..772b019861 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-08-18 15:42+0800\n" +"PO-Revision-Date: 2023-08-23 15:28+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -288,54 +288,62 @@ msgstr "" msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" -msgstr "" +msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" #: ../../library/calendar.rst:256 msgid "" "A list of CSS classes used for each weekday. The default class list is::" -msgstr "" +msgstr "一週每一天使用的 CSS 類別的串列。預設的串列內容為: ::" #: ../../library/calendar.rst:260 msgid "more styles can be added for each day::" -msgstr "" +msgstr "可以在每一天增加更多樣式: ::" #: ../../library/calendar.rst:264 msgid "Note that the length of this list must be seven items." -msgstr "" +msgstr "注意這個串列的長度必須是七個項目。" #: ../../library/calendar.rst:269 msgid "The CSS class for a weekday occurring in the previous or coming month." -msgstr "" +msgstr "前一個或下一個月份的一週每一天的 CSS 類別。" #: ../../library/calendar.rst:276 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." msgstr "" +"在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" +"同。" #: ../../library/calendar.rst:284 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." msgstr "" +"月份標題的 CSS 類別 (:meth:`formatmonthname` 會用到),預設值是 " +"``\"month\"``。" #: ../../library/calendar.rst:292 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." msgstr "" +"整個月份表格的 CSS 類別 (:meth:`formatmonth` 會用到),預設值是 " +"``\"month\"``。" #: ../../library/calendar.rst:300 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" +"整年表格的 CSS 類別(:meth:`formatyear` 會用到),預設值是 ``\"year\"``。" #: ../../library/calendar.rst:308 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" +"整年表格標題的 CSS 類別(:meth:`formatyear` 會用到),預設值是 ``\"year\"``。" #: ../../library/calendar.rst:314 msgid "" @@ -343,25 +351,29 @@ msgid "" "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " "single CSS class with a space separated list of CSS classes, for example::" msgstr "" +"注意雖然上面提到的 CSS 屬性名稱是單數(例如 ``cssclass_month``、" +"``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," +"例如: ::" #: ../../library/calendar.rst:320 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" -msgstr "" -"以下是客製化 :class:`!HTMLCalendar` 的範例:\n" -"\n" -"::" +msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" #: ../../library/calendar.rst:332 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" +":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" +"的月份及一週每一天的名稱。" #: ../../library/calendar.rst:338 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." msgstr "" +":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" +"的月份及一週每一天的名稱。" #: ../../library/calendar.rst:344 msgid "" @@ -370,10 +382,13 @@ msgid "" "*locale*. Because the current locale is a process-wide setting, they are not " "thread-safe." msgstr "" +"這兩個類別的建構函式、:meth:`formatweekday` 及 :meth:`formatmonthname` 方法會" +"把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程的設" +"定,它們不是執行緒安全的。" #: ../../library/calendar.rst:350 msgid "For simple text calendars this module provides the following functions." -msgstr "" +msgstr "這個模組提供以下函式給單純的文字日曆使用。" #: ../../library/calendar.rst:354 msgid "" @@ -382,43 +397,48 @@ msgid "" "`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are " "provided for convenience. For example, to set the first weekday to Sunday::" msgstr "" +"設定一週的第一天(``0`` 是週一、``6`` 是週日)。提供 :const:`MONDAY`、:const:" +"`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" +"`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" #: ../../library/calendar.rst:365 msgid "Returns the current setting for the weekday to start each week." -msgstr "" +msgstr "回傳目前設定的一週的第一天。" #: ../../library/calendar.rst:370 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." -msgstr "" +msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" #: ../../library/calendar.rst:375 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." -msgstr "" +msgstr "回傳從 *y1* 到 *y2* (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" #: ../../library/calendar.rst:378 msgid "This function works for ranges spanning a century change." -msgstr "" +msgstr "這個函式也適用在跨越世紀的時間範圍。" #: ../../library/calendar.rst:383 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." msgstr "" +"回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" +"``31``) 是週幾(``0`` 是星期一)。" #: ../../library/calendar.rst:389 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." -msgstr "" +msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的寬度即字元數。" #: ../../library/calendar.rst:395 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." -msgstr "" +msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" #: ../../library/calendar.rst:401 msgid "" @@ -426,27 +446,33 @@ msgid "" "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" +"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。除非在 :" +"func:`setfirstweekday` 有設定,每一週以週一開始。" #: ../../library/calendar.rst:408 msgid "Prints a month's calendar as returned by :func:`month`." -msgstr "" +msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" #: ../../library/calendar.rst:413 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`formatmonth` of the :class:`TextCalendar` class." msgstr "" +"以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" +"`formatmonth`。" #: ../../library/calendar.rst:419 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." -msgstr "" +msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" #: ../../library/calendar.rst:424 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`formatyear` of the :class:`TextCalendar` class." msgstr "" +"以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" +"`formatyear`。" #: ../../library/calendar.rst:430 msgid "" @@ -456,20 +482,23 @@ msgid "" "encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others' " "inverse." msgstr "" +"一個跟日曆無關但方便的函式,它接受一個像 :mod:`time` 模組裡的 :func:`~time." +"gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" +"碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" #: ../../library/calendar.rst:437 msgid "The :mod:`calendar` module exports the following data attributes:" -msgstr "" +msgstr ":mod:`calendar` 模組匯出以下資料屬性:" #: ../../library/calendar.rst:441 msgid "An array that represents the days of the week in the current locale." -msgstr "" +msgstr "以目前語系來表示的一週每一天名稱的陣列。" #: ../../library/calendar.rst:446 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." -msgstr "" +msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" #: ../../library/calendar.rst:451 msgid "" @@ -477,6 +506,8 @@ msgid "" "follows normal convention of January being month number 1, so it has a " "length of 13 and ``month_name[0]`` is the empty string." msgstr "" +"以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" +"此它的長度為 13,而 ``month_name[0]`` 是空字串。" #: ../../library/calendar.rst:458 msgid "" @@ -484,6 +515,8 @@ msgid "" "locale. This follows normal convention of January being month number 1, so " "it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" +"以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" +"月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" #: ../../library/calendar.rst:470 msgid "" From dd4e9fbc59256101b242ddc060cb2408bfff2531 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sat, 26 Aug 2023 23:52:42 +0800 Subject: [PATCH 051/105] Translate `library/symtable.po` (#573) * feat: translate `library/symtable.po` * fix(library/symtable): modify based on review comments --- library/symtable.po | 90 ++++++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 34 deletions(-) diff --git a/library/symtable.po b/library/symtable.po index 7a0f028965..a1da8da3f2 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-15 20:43+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/symtable.rst:2 msgid ":mod:`symtable` --- Access to the compiler's symbol tables" -msgstr "" +msgstr ":mod:`symtable` --- 存取編譯器的符號表" #: ../../library/symtable.rst:7 msgid "**Source code:** :source:`Lib/symtable.py`" @@ -33,10 +33,13 @@ msgid "" "every identifier in the code. :mod:`symtable` provides an interface to " "examine these tables." msgstr "" +"符號表 (symbol table) 是在生成位元組碼 (bytecode) 之前由編譯器從 AST 生成的。" +"符號表負責計算程式碼中每個識別器 (identifier) 的範圍。:mod:`symtable` 提供了" +"一個介面來檢查這些表。" #: ../../library/symtable.rst:22 msgid "Generating Symbol Tables" -msgstr "" +msgstr "產生符號表" #: ../../library/symtable.rst:26 msgid "" @@ -44,24 +47,29 @@ msgid "" "*filename* is the name of the file containing the code. *compile_type* is " "like the *mode* argument to :func:`compile`." msgstr "" +"回傳 Python 原始 *code* 的頂層 :class:`SymbolTable`。*filename* 是包含程式碼" +"之檔案之名稱。*compile_type* 類似於 :func:`compile` 的 *mode* 引數。" #: ../../library/symtable.rst:32 msgid "Examining Symbol Tables" -msgstr "" +msgstr "檢查符號表" #: ../../library/symtable.rst:36 msgid "A namespace table for a block. The constructor is not public." msgstr "" +"一個區塊 (block) 的命名空間表 (namespace table) 。建構函式 (constructor) 並不" +"公開。" #: ../../library/symtable.rst:40 msgid "" "Return the type of the symbol table. Possible values are ``'class'``, " "``'module'``, and ``'function'``." msgstr "" +"回傳符號表的種類。可能的值為 ``'class'``、``'module'`` 和 ``'function'``。" #: ../../library/symtable.rst:45 msgid "Return the table's identifier." -msgstr "" +msgstr "回傳表的識別器。" #: ../../library/symtable.rst:49 msgid "" @@ -69,139 +77,149 @@ msgid "" "a class, the name of the function if the table is for a function, or " "``'top'`` if the table is global (:meth:`get_type` returns ``'module'``)." msgstr "" +"回傳表的名稱。如果表用於類別,則這是類別的名稱;如果表用於函式,則這是函式的" +"名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " +"``'module'``)。" #: ../../library/symtable.rst:55 msgid "Return the number of the first line in the block this table represents." -msgstr "" +msgstr "回傳此表所代表的區塊中第一行的編號。" #: ../../library/symtable.rst:59 msgid "Return ``True`` if the locals in this table can be optimized." -msgstr "" +msgstr "如果可以最佳化該表中的區域變數,則回傳 ``True``。" #: ../../library/symtable.rst:63 msgid "Return ``True`` if the block is a nested class or function." -msgstr "" +msgstr "如果區塊是巢狀類別或函式,則回傳 ``True``。" #: ../../library/symtable.rst:67 msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." msgstr "" +"如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以通過 :meth:`get_children` " +"獲得。" #: ../../library/symtable.rst:72 msgid "" "Return a view object containing the names of symbols in the table. See the :" "ref:`documentation of view objects `." msgstr "" +"回傳包含表中符號之名稱的視圖物件 (view object)。請參閱\\ :ref:`視圖物件的文" +"件 `。" #: ../../library/symtable.rst:77 msgid "Lookup *name* in the table and return a :class:`Symbol` instance." -msgstr "" +msgstr "在表中查找 *name* 並回傳一個 :class:`Symbol` 實例。" #: ../../library/symtable.rst:81 msgid "Return a list of :class:`Symbol` instances for names in the table." -msgstr "" +msgstr "回傳表中名稱的 :class:`Symbol` 實例串列。" #: ../../library/symtable.rst:85 msgid "Return a list of the nested symbol tables." -msgstr "" +msgstr "回傳巢狀符號表的串列。" #: ../../library/symtable.rst:90 msgid "" "A namespace for a function or method. This class inherits :class:" "`SymbolTable`." -msgstr "" +msgstr "一個函式或方法的命名空間。該類別繼承自 :class:`SymbolTable`。" #: ../../library/symtable.rst:95 msgid "Return a tuple containing names of parameters to this function." -msgstr "" +msgstr "回傳一個包含此函式參數名稱的元組 (tuple)。" #: ../../library/symtable.rst:99 msgid "Return a tuple containing names of locals in this function." -msgstr "" +msgstr "回傳一個包含此函式中區域變數 (locals) 名稱的元組。" #: ../../library/symtable.rst:103 msgid "Return a tuple containing names of globals in this function." -msgstr "" +msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" #: ../../library/symtable.rst:107 msgid "Return a tuple containing names of nonlocals in this function." -msgstr "" +msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" #: ../../library/symtable.rst:111 msgid "Return a tuple containing names of free variables in this function." -msgstr "" +msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" #: ../../library/symtable.rst:116 msgid "A namespace of a class. This class inherits :class:`SymbolTable`." -msgstr "" +msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" #: ../../library/symtable.rst:120 msgid "Return a tuple containing the names of methods declared in the class." -msgstr "" +msgstr "回傳一個包含類別中聲明的方法名稱的元組。" #: ../../library/symtable.rst:125 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" +":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" #: ../../library/symtable.rst:130 msgid "Return the symbol's name." -msgstr "" +msgstr "回傳符號的名稱。" #: ../../library/symtable.rst:134 msgid "Return ``True`` if the symbol is used in its block." -msgstr "" +msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" #: ../../library/symtable.rst:138 msgid "Return ``True`` if the symbol is created from an import statement." -msgstr "" +msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" #: ../../library/symtable.rst:142 msgid "Return ``True`` if the symbol is a parameter." -msgstr "" +msgstr "如果符號是一個參數,則回傳 ``True``。" #: ../../library/symtable.rst:146 msgid "Return ``True`` if the symbol is global." -msgstr "" +msgstr "如果符號是全域的,則回傳 ``True``。" #: ../../library/symtable.rst:150 msgid "Return ``True`` if the symbol is nonlocal." -msgstr "" +msgstr "如果符號是非區域的,則回傳 ``True``。" #: ../../library/symtable.rst:154 msgid "" "Return ``True`` if the symbol is declared global with a global statement." -msgstr "" +msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" #: ../../library/symtable.rst:158 msgid "Return ``True`` if the symbol is local to its block." -msgstr "" +msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" #: ../../library/symtable.rst:162 msgid "Return ``True`` if the symbol is annotated." -msgstr "" +msgstr "如果符號有被註釋,則回傳 ``True``。" #: ../../library/symtable.rst:168 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." msgstr "" +"如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " +"``True``。" #: ../../library/symtable.rst:173 msgid "Return ``True`` if the symbol is assigned to in its block." -msgstr "" +msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" #: ../../library/symtable.rst:177 msgid "Return ``True`` if name binding introduces new namespace." -msgstr "" +msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" #: ../../library/symtable.rst:179 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." -msgstr "" +msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" #: ../../library/symtable.rst:182 msgid "For example::" @@ -216,13 +234,17 @@ msgid "" "``True``, the name may also be bound to other objects, like an int or list, " "that does not introduce a new namespace." msgstr "" +"請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" +"到其他物件,例如 int 或 list,而不會引入新的命名空間。" #: ../../library/symtable.rst:194 msgid "Return a list of namespaces bound to this name." -msgstr "" +msgstr "回傳綁定到該名稱的命名空間的串列。" #: ../../library/symtable.rst:198 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." msgstr "" +"回傳綁定到該名稱的命名空間。如果該名稱綁定了多個命名空間或沒有命名空間,則會" +"引發 :exc:`ValueError`。" From 3a037c0001368245d09d5a109e6700e4200767e2 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Mon, 28 Aug 2023 02:14:04 +0800 Subject: [PATCH 052/105] Translate CSV Library from rst:156 to rst:278 (#590) * Traslate CSV Module from rst:156 to rst:278 * Fix Conplie Issue * Fix with Reviewer's Comments --- library/csv.po | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/library/csv.po b/library/csv.po index ceefe0fe93..e4ecefd84c 100644 --- a/library/csv.po +++ b/library/csv.po @@ -229,6 +229,9 @@ msgid "" "fieldnames. Regardless of how the fieldnames are determined, the dictionary " "preserves their original ordering." msgstr "" +"參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了," +"檔案 *f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary" +"都會保留原始的排序。" #: ../../library/csv.rst:161 msgid "" @@ -238,26 +241,31 @@ msgid "" "values are filled-in with the value of *restval* (which defaults to " "``None``)." msgstr "" +"如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 ``None``)" +"特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中的欄位比" +"欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。" #: ../../library/csv.rst:167 msgid "" "All other optional or keyword arguments are passed to the underlying :class:" "`reader` instance." msgstr "" +"所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" #: ../../library/csv.rst:170 ../../library/csv.rst:214 msgid "" "If the argument passed to *fieldnames* is an iterator, it will be coerced to " "a :class:`list`." msgstr "" +"如果傳遞至 *fieldnames* 的引數是個疊代器,則會被迫成為一個 :class:`list`。" #: ../../library/csv.rst:172 msgid "Returned rows are now of type :class:`OrderedDict`." -msgstr "" +msgstr "回傳的列已成為型別 :class:`OrderedDict`。" #: ../../library/csv.rst:175 msgid "Returned rows are now of type :class:`dict`." -msgstr "" +msgstr "回傳的列已成為型別 :class:`dict`。" #: ../../library/csv.rst:196 msgid "" @@ -274,12 +282,23 @@ msgid "" "other optional or keyword arguments are passed to the underlying :class:" "`writer` instance." msgstr "" +"建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列上。" +"參數 *fieldnames* 是一個鍵值的 :mod:`sequence ` 且可以" +"辨識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。" +"如果 dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值" +"。如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* " +"中不存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定" +"為 ``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``," +"dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞" +"至下層的 :class:`writer` 實例。" #: ../../library/csv.rst:211 msgid "" "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " "of the :class:`DictWriter` class is not optional." msgstr "" +"請記得這不像類別 :class:`DictReader`,在類別 :class:`DictWriter` 中,參數 " +"*fieldnames* 並不是選填的。" #: ../../library/csv.rst:232 msgid "" @@ -289,6 +308,10 @@ msgid "" "subtly different CSV data. :class:`Dialect` instances define how :class:" "`reader` and :class:`writer` instances behave." msgstr "" +"類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、" +"空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出" +"有巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 " +":class:`writer` 的實例該如何表示。" #: ../../library/csv.rst:238 msgid "" @@ -296,12 +319,17 @@ msgid "" "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" +"所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且" +"它們可以透過特定 :class:`reader` 及 :class:`writer` 類別的" +"初始器 (initializer, ``__init__``) 函式進行註冊,就像這樣: ::" #: ../../library/csv.rst:251 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." msgstr "" +"類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的" +" dialect 名稱為 ``'excel'``。" #: ../../library/csv.rst:257 msgid "" @@ -309,6 +337,8 @@ msgid "" "generated TAB-delimited file. It is registered with the dialect name " "``'excel-tab'``." msgstr "" +"類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案" +"的慣用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。" #: ../../library/csv.rst:263 msgid "" @@ -316,14 +346,17 @@ msgid "" "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " "quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" +"類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性," +"換句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的" +" dialect 名稱為 ``'unix'``。" #: ../../library/csv.rst:272 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." -msgstr "" +msgstr "類別 :class:`Sniffer` 被用來推斷 CSV 檔案的格式。" #: ../../library/csv.rst:274 msgid "The :class:`Sniffer` class provides two methods:" -msgstr "" +msgstr "類別 :class:`Sniffer` 提供了兩個 method:" #: ../../library/csv.rst:278 msgid "" @@ -331,6 +364,9 @@ msgid "" "the parameters found. If the optional *delimiters* parameter is given, it " "is interpreted as a string containing possible valid delimiter characters." msgstr "" +"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參數。" +"如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、" +"有效的分隔字符。" #: ../../library/csv.rst:286 msgid "" From 50a2f2060fc72c3163489622e1fff760863ecab8 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 03:12:16 +0800 Subject: [PATCH 053/105] Sync with CPython 3.12 (#607) * sync with cpython f2cc0052 * sync with cpython 47f60c3f * sync with cpython 200af429 * sync with cpython b312d4fd * sync with cpython 09487a20 * sync with cpython ce37fbc7 * sync with cpython 3e203037 * resolve fuzzy entries * sync with cpython 752d5254 --------- Co-authored-by: github-actions[bot] Co-authored-by: Wei-Hsiang (Matt) Wang --- .scripts/poetry.lock | 177 ++-- c-api/datetime.po | 183 ++-- c-api/dict.po | 81 +- c-api/exceptions.po | 686 +++++++------- c-api/init_config.po | 840 ++++++++--------- c-api/module.po | 102 +- c-api/unicode.po | 4 +- extending/newtypes.po | 4 +- extending/newtypes_tutorial.po | 118 ++- faq/design.po | 10 +- faq/library.po | 73 +- glossary.po | 2 +- howto/isolating-extensions.po | 6 +- howto/pyporting.po | 409 ++++---- library/asyncio-dev.po | 8 +- library/asyncio-eventloop.po | 170 ++-- library/calendar.po | 36 +- library/dataclasses.po | 4 +- library/datetime.po | 1166 +++++++++++------------ library/enum.po | 210 +++-- library/errno.po | 76 +- library/io.po | 82 +- library/logging.po | 246 ++--- library/re.po | 368 ++++---- library/stringprep.po | 6 +- library/sys.po | 1101 +++++++++++----------- library/tarfile.po | 243 ++--- library/textwrap.po | 4 +- library/timeit.po | 96 +- reference/datamodel.po | 1603 ++++++++++++++++---------------- tutorial/classes.po | 273 +++--- tutorial/controlflow.po | 55 +- tutorial/datastructures.po | 35 +- tutorial/inputoutput.po | 46 +- tutorial/modules.po | 184 ++-- whatsnew/2.2.po | 20 +- whatsnew/2.3.po | 4 +- whatsnew/2.4.po | 6 +- whatsnew/2.5.po | 22 +- whatsnew/2.6.po | 12 +- whatsnew/2.7.po | 16 +- whatsnew/3.0.po | 6 +- whatsnew/3.1.po | 8 +- whatsnew/3.10.po | 122 ++- whatsnew/3.11.po | 1514 ++++++++++++++++-------------- whatsnew/3.12.po | 694 +++++++------- whatsnew/3.2.po | 16 +- whatsnew/3.3.po | 370 +++++--- whatsnew/3.5.po | 11 +- whatsnew/3.6.po | 8 +- whatsnew/3.8.po | 42 +- whatsnew/3.9.po | 20 +- 52 files changed, 5968 insertions(+), 5630 deletions(-) diff --git a/.scripts/poetry.lock b/.scripts/poetry.lock index 188366127e..7fa4a914bc 100644 --- a/.scripts/poetry.lock +++ b/.scripts/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "certifi" -version = "2023.5.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, - {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] @@ -143,95 +143,108 @@ files = [ [[package]] name = "lxml" -version = "4.9.2" +version = "4.9.3" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" files = [ - {file = "lxml-4.9.2-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:76cf573e5a365e790396a5cc2b909812633409306c6531a6877c59061e42c4f2"}, - {file = "lxml-4.9.2-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b1f42b6921d0e81b1bcb5e395bc091a70f41c4d4e55ba99c6da2b31626c44892"}, - {file = "lxml-4.9.2-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:9f102706d0ca011de571de32c3247c6476b55bb6bc65a20f682f000b07a4852a"}, - {file = "lxml-4.9.2-cp27-cp27m-win32.whl", hash = "sha256:8d0b4612b66ff5d62d03bcaa043bb018f74dfea51184e53f067e6fdcba4bd8de"}, - {file = "lxml-4.9.2-cp27-cp27m-win_amd64.whl", hash = "sha256:4c8f293f14abc8fd3e8e01c5bd86e6ed0b6ef71936ded5bf10fe7a5efefbaca3"}, - {file = "lxml-4.9.2-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2899456259589aa38bfb018c364d6ae7b53c5c22d8e27d0ec7609c2a1ff78b50"}, - {file = "lxml-4.9.2-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6749649eecd6a9871cae297bffa4ee76f90b4504a2a2ab528d9ebe912b101975"}, - {file = "lxml-4.9.2-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:a08cff61517ee26cb56f1e949cca38caabe9ea9fbb4b1e10a805dc39844b7d5c"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:85cabf64adec449132e55616e7ca3e1000ab449d1d0f9d7f83146ed5bdcb6d8a"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8340225bd5e7a701c0fa98284c849c9b9fc9238abf53a0ebd90900f25d39a4e4"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:1ab8f1f932e8f82355e75dda5413a57612c6ea448069d4fb2e217e9a4bed13d4"}, - {file = "lxml-4.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:699a9af7dffaf67deeae27b2112aa06b41c370d5e7633e0ee0aea2e0b6c211f7"}, - {file = "lxml-4.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b9cc34af337a97d470040f99ba4282f6e6bac88407d021688a5d585e44a23184"}, - {file = "lxml-4.9.2-cp310-cp310-win32.whl", hash = "sha256:d02a5399126a53492415d4906ab0ad0375a5456cc05c3fc0fc4ca11771745cda"}, - {file = "lxml-4.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:a38486985ca49cfa574a507e7a2215c0c780fd1778bb6290c21193b7211702ab"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:c83203addf554215463b59f6399835201999b5e48019dc17f182ed5ad87205c9"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:2a87fa548561d2f4643c99cd13131acb607ddabb70682dcf1dff5f71f781a4bf"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:d6b430a9938a5a5d85fc107d852262ddcd48602c120e3dbb02137c83d212b380"}, - {file = "lxml-4.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3efea981d956a6f7173b4659849f55081867cf897e719f57383698af6f618a92"}, - {file = "lxml-4.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:df0623dcf9668ad0445e0558a21211d4e9a149ea8f5666917c8eeec515f0a6d1"}, - {file = "lxml-4.9.2-cp311-cp311-win32.whl", hash = "sha256:da248f93f0418a9e9d94b0080d7ebc407a9a5e6d0b57bb30db9b5cc28de1ad33"}, - {file = "lxml-4.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:3818b8e2c4b5148567e1b09ce739006acfaa44ce3156f8cbbc11062994b8e8dd"}, - {file = "lxml-4.9.2-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ca989b91cf3a3ba28930a9fc1e9aeafc2a395448641df1f387a2d394638943b0"}, - {file = "lxml-4.9.2-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:822068f85e12a6e292803e112ab876bc03ed1f03dddb80154c395f891ca6b31e"}, - {file = "lxml-4.9.2-cp35-cp35m-win32.whl", hash = "sha256:be7292c55101e22f2a3d4d8913944cbea71eea90792bf914add27454a13905df"}, - {file = "lxml-4.9.2-cp35-cp35m-win_amd64.whl", hash = "sha256:998c7c41910666d2976928c38ea96a70d1aa43be6fe502f21a651e17483a43c5"}, - {file = "lxml-4.9.2-cp36-cp36m-macosx_10_15_x86_64.whl", hash = "sha256:b26a29f0b7fc6f0897f043ca366142d2b609dc60756ee6e4e90b5f762c6adc53"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:ab323679b8b3030000f2be63e22cdeea5b47ee0abd2d6a1dc0c8103ddaa56cd7"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:689bb688a1db722485e4610a503e3e9210dcc20c520b45ac8f7533c837be76fe"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:f49e52d174375a7def9915c9f06ec4e569d235ad428f70751765f48d5926678c"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:36c3c175d34652a35475a73762b545f4527aec044910a651d2bf50de9c3352b1"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a35f8b7fa99f90dd2f5dc5a9fa12332642f087a7641289ca6c40d6e1a2637d8e"}, - {file = "lxml-4.9.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:58bfa3aa19ca4c0f28c5dde0ff56c520fbac6f0daf4fac66ed4c8d2fb7f22e74"}, - {file = "lxml-4.9.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc718cd47b765e790eecb74d044cc8d37d58562f6c314ee9484df26276d36a38"}, - {file = "lxml-4.9.2-cp36-cp36m-win32.whl", hash = "sha256:d5bf6545cd27aaa8a13033ce56354ed9e25ab0e4ac3b5392b763d8d04b08e0c5"}, - {file = "lxml-4.9.2-cp36-cp36m-win_amd64.whl", hash = "sha256:3ab9fa9d6dc2a7f29d7affdf3edebf6ece6fb28a6d80b14c3b2fb9d39b9322c3"}, - {file = "lxml-4.9.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:05ca3f6abf5cf78fe053da9b1166e062ade3fa5d4f92b4ed688127ea7d7b1d03"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:a5da296eb617d18e497bcf0a5c528f5d3b18dadb3619fbdadf4ed2356ef8d941"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:04876580c050a8c5341d706dd464ff04fd597095cc8c023252566a8826505726"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c9ec3eaf616d67db0764b3bb983962b4f385a1f08304fd30c7283954e6a7869b"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2a29ba94d065945944016b6b74e538bdb1751a1db6ffb80c9d3c2e40d6fa9894"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a82d05da00a58b8e4c0008edbc8a4b6ec5a4bc1e2ee0fb6ed157cf634ed7fa45"}, - {file = "lxml-4.9.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:223f4232855ade399bd409331e6ca70fb5578efef22cf4069a6090acc0f53c0e"}, - {file = "lxml-4.9.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d17bc7c2ccf49c478c5bdd447594e82692c74222698cfc9b5daae7ae7e90743b"}, - {file = "lxml-4.9.2-cp37-cp37m-win32.whl", hash = "sha256:b64d891da92e232c36976c80ed7ebb383e3f148489796d8d31a5b6a677825efe"}, - {file = "lxml-4.9.2-cp37-cp37m-win_amd64.whl", hash = "sha256:a0a336d6d3e8b234a3aae3c674873d8f0e720b76bc1d9416866c41cd9500ffb9"}, - {file = "lxml-4.9.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:da4dd7c9c50c059aba52b3524f84d7de956f7fef88f0bafcf4ad7dde94a064e8"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:821b7f59b99551c69c85a6039c65b75f5683bdc63270fec660f75da67469ca24"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:e5168986b90a8d1f2f9dc1b841467c74221bd752537b99761a93d2d981e04889"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8e20cb5a47247e383cf4ff523205060991021233ebd6f924bca927fcf25cf86f"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:13598ecfbd2e86ea7ae45ec28a2a54fb87ee9b9fdb0f6d343297d8e548392c03"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:880bbbcbe2fca64e2f4d8e04db47bcdf504936fa2b33933efd945e1b429bea8c"}, - {file = "lxml-4.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:7d2278d59425777cfcb19735018d897ca8303abe67cc735f9f97177ceff8027f"}, - {file = "lxml-4.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5344a43228767f53a9df6e5b253f8cdca7dfc7b7aeae52551958192f56d98457"}, - {file = "lxml-4.9.2-cp38-cp38-win32.whl", hash = "sha256:925073b2fe14ab9b87e73f9a5fde6ce6392da430f3004d8b72cc86f746f5163b"}, - {file = "lxml-4.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:9b22c5c66f67ae00c0199f6055705bc3eb3fcb08d03d2ec4059a2b1b25ed48d7"}, - {file = "lxml-4.9.2-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:5f50a1c177e2fa3ee0667a5ab79fdc6b23086bc8b589d90b93b4bd17eb0e64d1"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:090c6543d3696cbe15b4ac6e175e576bcc3f1ccfbba970061b7300b0c15a2140"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:63da2ccc0857c311d764e7d3d90f429c252e83b52d1f8f1d1fe55be26827d1f4"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:5b4545b8a40478183ac06c073e81a5ce4cf01bf1734962577cf2bb569a5b3bbf"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2e430cd2824f05f2d4f687701144556646bae8f249fd60aa1e4c768ba7018947"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6804daeb7ef69e7b36f76caddb85cccd63d0c56dedb47555d2fc969e2af6a1a5"}, - {file = "lxml-4.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a6e441a86553c310258aca15d1c05903aaf4965b23f3bc2d55f200804e005ee5"}, - {file = "lxml-4.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ca34efc80a29351897e18888c71c6aca4a359247c87e0b1c7ada14f0ab0c0fb2"}, - {file = "lxml-4.9.2-cp39-cp39-win32.whl", hash = "sha256:6b418afe5df18233fc6b6093deb82a32895b6bb0b1155c2cdb05203f583053f1"}, - {file = "lxml-4.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:f1496ea22ca2c830cbcbd473de8f114a320da308438ae65abad6bab7867fe38f"}, - {file = "lxml-4.9.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:b264171e3143d842ded311b7dccd46ff9ef34247129ff5bf5066123c55c2431c"}, - {file = "lxml-4.9.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:0dc313ef231edf866912e9d8f5a042ddab56c752619e92dfd3a2c277e6a7299a"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-macosx_10_15_x86_64.whl", hash = "sha256:16efd54337136e8cd72fb9485c368d91d77a47ee2d42b057564aae201257d419"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:0f2b1e0d79180f344ff9f321327b005ca043a50ece8713de61d1cb383fb8ac05"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:7b770ed79542ed52c519119473898198761d78beb24b107acf3ad65deae61f1f"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:efa29c2fe6b4fdd32e8ef81c1528506895eca86e1d8c4657fda04c9b3786ddf9"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7e91ee82f4199af8c43d8158024cbdff3d931df350252288f0d4ce656df7f3b5"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:b23e19989c355ca854276178a0463951a653309fb8e57ce674497f2d9f208746"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:01d36c05f4afb8f7c20fd9ed5badca32a2029b93b1750f571ccc0b142531caf7"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7b515674acfdcadb0eb5d00d8a709868173acece5cb0be3dd165950cbfdf5409"}, - {file = "lxml-4.9.2.tar.gz", hash = "sha256:2455cfaeb7ac70338b3257f41e21f0724f4b5b0c0e7702da67ee6c3640835b67"}, + {file = "lxml-4.9.3-cp27-cp27m-macosx_11_0_x86_64.whl", hash = "sha256:b0a545b46b526d418eb91754565ba5b63b1c0b12f9bd2f808c852d9b4b2f9b5c"}, + {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:075b731ddd9e7f68ad24c635374211376aa05a281673ede86cbe1d1b3455279d"}, + {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:1e224d5755dba2f4a9498e150c43792392ac9b5380aa1b845f98a1618c94eeef"}, + {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c0781a98ff5e6586926293e59480b64ddd46282953203c76ae15dbbbf302e8bb"}, + {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cef2502e7e8a96fe5ad686d60b49e1ab03e438bd9123987994528febd569868e"}, + {file = "lxml-4.9.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:b86164d2cff4d3aaa1f04a14685cbc072efd0b4f99ca5708b2ad1b9b5988a991"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:42871176e7896d5d45138f6d28751053c711ed4d48d8e30b498da155af39aebd"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ae8b9c6deb1e634ba4f1930eb67ef6e6bf6a44b6eb5ad605642b2d6d5ed9ce3c"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:411007c0d88188d9f621b11d252cce90c4a2d1a49db6c068e3c16422f306eab8"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:cd47b4a0d41d2afa3e58e5bf1f62069255aa2fd6ff5ee41604418ca925911d76"}, + {file = "lxml-4.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0e2cb47860da1f7e9a5256254b74ae331687b9672dfa780eed355c4c9c3dbd23"}, + {file = "lxml-4.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1247694b26342a7bf47c02e513d32225ededd18045264d40758abeb3c838a51f"}, + {file = "lxml-4.9.3-cp310-cp310-win32.whl", hash = "sha256:cdb650fc86227eba20de1a29d4b2c1bfe139dc75a0669270033cb2ea3d391b85"}, + {file = "lxml-4.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:97047f0d25cd4bcae81f9ec9dc290ca3e15927c192df17331b53bebe0e3ff96d"}, + {file = "lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:1f447ea5429b54f9582d4b955f5f1985f278ce5cf169f72eea8afd9502973dd5"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:57d6ba0ca2b0c462f339640d22882acc711de224d769edf29962b09f77129cbf"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:9767e79108424fb6c3edf8f81e6730666a50feb01a328f4a016464a5893f835a"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:71c52db65e4b56b8ddc5bb89fb2e66c558ed9d1a74a45ceb7dcb20c191c3df2f"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d73d8ecf8ecf10a3bd007f2192725a34bd62898e8da27eb9d32a58084f93962b"}, + {file = "lxml-4.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0a3d3487f07c1d7f150894c238299934a2a074ef590b583103a45002035be120"}, + {file = "lxml-4.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e28c51fa0ce5674be9f560c6761c1b441631901993f76700b1b30ca6c8378d6"}, + {file = "lxml-4.9.3-cp311-cp311-win32.whl", hash = "sha256:0bfd0767c5c1de2551a120673b72e5d4b628737cb05414f03c3277bf9bed3305"}, + {file = "lxml-4.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:25f32acefac14ef7bd53e4218fe93b804ef6f6b92ffdb4322bb6d49d94cad2bc"}, + {file = "lxml-4.9.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:d3ff32724f98fbbbfa9f49d82852b159e9784d6094983d9a8b7f2ddaebb063d4"}, + {file = "lxml-4.9.3-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:48d6ed886b343d11493129e019da91d4039826794a3e3027321c56d9e71505be"}, + {file = "lxml-4.9.3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:9a92d3faef50658dd2c5470af249985782bf754c4e18e15afb67d3ab06233f13"}, + {file = "lxml-4.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b4e4bc18382088514ebde9328da057775055940a1f2e18f6ad2d78aa0f3ec5b9"}, + {file = "lxml-4.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fc9b106a1bf918db68619fdcd6d5ad4f972fdd19c01d19bdb6bf63f3589a9ec5"}, + {file = "lxml-4.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:d37017287a7adb6ab77e1c5bee9bcf9660f90ff445042b790402a654d2ad81d8"}, + {file = "lxml-4.9.3-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:56dc1f1ebccc656d1b3ed288f11e27172a01503fc016bcabdcbc0978b19352b7"}, + {file = "lxml-4.9.3-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:578695735c5a3f51569810dfebd05dd6f888147a34f0f98d4bb27e92b76e05c2"}, + {file = "lxml-4.9.3-cp35-cp35m-win32.whl", hash = "sha256:704f61ba8c1283c71b16135caf697557f5ecf3e74d9e453233e4771d68a1f42d"}, + {file = "lxml-4.9.3-cp35-cp35m-win_amd64.whl", hash = "sha256:c41bfca0bd3532d53d16fd34d20806d5c2b1ace22a2f2e4c0008570bf2c58833"}, + {file = "lxml-4.9.3-cp36-cp36m-macosx_11_0_x86_64.whl", hash = "sha256:64f479d719dc9f4c813ad9bb6b28f8390360660b73b2e4beb4cb0ae7104f1c12"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:dd708cf4ee4408cf46a48b108fb9427bfa00b9b85812a9262b5c668af2533ea5"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c31c7462abdf8f2ac0577d9f05279727e698f97ecbb02f17939ea99ae8daa98"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e3cd95e10c2610c360154afdc2f1480aea394f4a4f1ea0a5eacce49640c9b190"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:4930be26af26ac545c3dffb662521d4e6268352866956672231887d18f0eaab2"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4aec80cde9197340bc353d2768e2a75f5f60bacda2bab72ab1dc499589b3878c"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:14e019fd83b831b2e61baed40cab76222139926b1fb5ed0e79225bc0cae14584"}, + {file = "lxml-4.9.3-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0c0850c8b02c298d3c7006b23e98249515ac57430e16a166873fc47a5d549287"}, + {file = "lxml-4.9.3-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:aca086dc5f9ef98c512bac8efea4483eb84abbf926eaeedf7b91479feb092458"}, + {file = "lxml-4.9.3-cp36-cp36m-win32.whl", hash = "sha256:50baa9c1c47efcaef189f31e3d00d697c6d4afda5c3cde0302d063492ff9b477"}, + {file = "lxml-4.9.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bef4e656f7d98aaa3486d2627e7d2df1157d7e88e7efd43a65aa5dd4714916cf"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:46f409a2d60f634fe550f7133ed30ad5321ae2e6630f13657fb9479506b00601"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4c28a9144688aef80d6ea666c809b4b0e50010a2aca784c97f5e6bf143d9f129"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:141f1d1a9b663c679dc524af3ea1773e618907e96075262726c7612c02b149a4"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:53ace1c1fd5a74ef662f844a0413446c0629d151055340e9893da958a374f70d"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17a753023436a18e27dd7769e798ce302963c236bc4114ceee5b25c18c52c693"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7d298a1bd60c067ea75d9f684f5f3992c9d6766fadbc0bcedd39750bf344c2f4"}, + {file = "lxml-4.9.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:081d32421db5df44c41b7f08a334a090a545c54ba977e47fd7cc2deece78809a"}, + {file = "lxml-4.9.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:23eed6d7b1a3336ad92d8e39d4bfe09073c31bfe502f20ca5116b2a334f8ec02"}, + {file = "lxml-4.9.3-cp37-cp37m-win32.whl", hash = "sha256:1509dd12b773c02acd154582088820893109f6ca27ef7291b003d0e81666109f"}, + {file = "lxml-4.9.3-cp37-cp37m-win_amd64.whl", hash = "sha256:120fa9349a24c7043854c53cae8cec227e1f79195a7493e09e0c12e29f918e52"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4d2d1edbca80b510443f51afd8496be95529db04a509bc8faee49c7b0fb6d2cc"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8d7e43bd40f65f7d97ad8ef5c9b1778943d02f04febef12def25f7583d19baac"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:71d66ee82e7417828af6ecd7db817913cb0cf9d4e61aa0ac1fde0583d84358db"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:6fc3c450eaa0b56f815c7b62f2b7fba7266c4779adcf1cece9e6deb1de7305ce"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:65299ea57d82fb91c7f019300d24050c4ddeb7c5a190e076b5f48a2b43d19c42"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:eadfbbbfb41b44034a4c757fd5d70baccd43296fb894dba0295606a7cf3124aa"}, + {file = "lxml-4.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3e9bdd30efde2b9ccfa9cb5768ba04fe71b018a25ea093379c857c9dad262c40"}, + {file = "lxml-4.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fcdd00edfd0a3001e0181eab3e63bd5c74ad3e67152c84f93f13769a40e073a7"}, + {file = "lxml-4.9.3-cp38-cp38-win32.whl", hash = "sha256:57aba1bbdf450b726d58b2aea5fe47c7875f5afb2c4a23784ed78f19a0462574"}, + {file = "lxml-4.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:92af161ecbdb2883c4593d5ed4815ea71b31fafd7fd05789b23100d081ecac96"}, + {file = "lxml-4.9.3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:9bb6ad405121241e99a86efff22d3ef469024ce22875a7ae045896ad23ba2340"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8ed74706b26ad100433da4b9d807eae371efaa266ffc3e9191ea436087a9d6a7"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fbf521479bcac1e25a663df882c46a641a9bff6b56dc8b0fafaebd2f66fb231b"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:303bf1edce6ced16bf67a18a1cf8339d0db79577eec5d9a6d4a80f0fb10aa2da"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:5515edd2a6d1a5a70bfcdee23b42ec33425e405c5b351478ab7dc9347228f96e"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:690dafd0b187ed38583a648076865d8c229661ed20e48f2335d68e2cf7dc829d"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b6420a005548ad52154c8ceab4a1290ff78d757f9e5cbc68f8c77089acd3c432"}, + {file = "lxml-4.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bb3bb49c7a6ad9d981d734ef7c7193bc349ac338776a0360cc671eaee89bcf69"}, + {file = "lxml-4.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d27be7405547d1f958b60837dc4c1007da90b8b23f54ba1f8b728c78fdb19d50"}, + {file = "lxml-4.9.3-cp39-cp39-win32.whl", hash = "sha256:8df133a2ea5e74eef5e8fc6f19b9e085f758768a16e9877a60aec455ed2609b2"}, + {file = "lxml-4.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:4dd9a263e845a72eacb60d12401e37c616438ea2e5442885f65082c276dfb2b2"}, + {file = "lxml-4.9.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6689a3d7fd13dc687e9102a27e98ef33730ac4fe37795d5036d18b4d527abd35"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:f6bdac493b949141b733c5345b6ba8f87a226029cbabc7e9e121a413e49441e0"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:05186a0f1346ae12553d66df1cfce6f251589fea3ad3da4f3ef4e34b2d58c6a3"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c2006f5c8d28dee289f7020f721354362fa304acbaaf9745751ac4006650254b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:5c245b783db29c4e4fbbbfc9c5a78be496c9fea25517f90606aa1f6b2b3d5f7b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4fb960a632a49f2f089d522f70496640fdf1218f1243889da3822e0a9f5f3ba7"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:50670615eaf97227d5dc60de2dc99fb134a7130d310d783314e7724bf163f75d"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9719fe17307a9e814580af1f5c6e05ca593b12fb7e44fe62450a5384dbf61b4b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:3331bece23c9ee066e0fb3f96c61322b9e0f54d775fccefff4c38ca488de283a"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:ed667f49b11360951e201453fc3967344d0d0263aa415e1619e85ae7fd17b4e0"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8b77946fd508cbf0fccd8e400a7f71d4ac0e1595812e66025bac475a8e811694"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e4da8ca0c0c0aea88fd46be8e44bd49716772358d648cce45fe387f7b92374a7"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fe4bda6bd4340caa6e5cf95e73f8fea5c4bfc55763dd42f1b50a94c1b4a2fbd4"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f3df3db1d336b9356dd3112eae5f5c2b8b377f3bc826848567f10bfddfee77e9"}, + {file = "lxml-4.9.3.tar.gz", hash = "sha256:48628bd53a426c9eb9bc066a923acaa0878d1e86129fd5359aee99285f4eed9c"}, ] [package.extras] cssselect = ["cssselect (>=0.7)"] html5 = ["html5lib"] htmlsoup = ["BeautifulSoup4"] -source = ["Cython (>=0.29.7)"] +source = ["Cython (>=0.29.35)"] [[package]] name = "polib" diff --git a/c-api/datetime.po b/c-api/datetime.po index aaf1c117c2..86b591964a 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-15 00:18+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2023-07-01 04:14+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,43 +31,92 @@ msgid "" "Various date and time objects are supplied by the :mod:`datetime` module. " "Before using any of these functions, the header file :file:`datetime.h` must " "be included in your source (note that this is not included by :file:`Python." -"h`), and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as " +"h`), and the macro :c:macro:`!PyDateTime_IMPORT` must be invoked, usually as " "part of the module initialisation function. The macro puts a pointer to a C " -"structure into a static variable, :c:data:`PyDateTimeAPI`, that is used by " +"structure into a static variable, :c:data:`!PyDateTimeAPI`, that is used by " "the following macros." msgstr "" ":mod:`datetime` 模組提供各種日期和時間物件。在使用任何這些函式之前,必須將標" "頭檔 :file:`datetime.h` 引入於原始碼中(請注意,:file:`Python.h` 並無引入該標" -"頭檔),且巨集 :c:macro:`PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始" +"頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始" "化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:" -"`PyDateTimeAPI` 中,該變數會被以下巨集使用。" +"`!PyDateTimeAPI` 中,該變數會被以下巨集使用。" -#: ../../c-api/datetime.rst:16 +#: ../../c-api/datetime.rst:18 +msgid "This subtype of :c:type:`PyObject` represents a Python date object." +msgstr "" + +#: ../../c-api/datetime.rst:22 +msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." +msgstr "" + +#: ../../c-api/datetime.rst:26 +msgid "This subtype of :c:type:`PyObject` represents a Python time object." +msgstr "" + +#: ../../c-api/datetime.rst:30 +msgid "" +"This subtype of :c:type:`PyObject` represents the difference between two " +"datetime values." +msgstr "" + +#: ../../c-api/datetime.rst:34 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python date type; it " +"is the same object as :class:`datetime.date` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:39 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python datetime type; " +"it is the same object as :class:`datetime.datetime` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:44 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python time type; it " +"is the same object as :class:`datetime.time` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:49 +msgid "" +"This instance of :c:type:`PyTypeObject` represents Python type for the " +"difference between two datetime values; it is the same object as :class:" +"`datetime.timedelta` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:55 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python time zone info " +"type; it is the same object as :class:`datetime.tzinfo` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:59 msgid "Macro for access to the UTC singleton:" msgstr "用於存取 UTC 單例 (singleton) 的巨集:" -#: ../../c-api/datetime.rst:20 +#: ../../c-api/datetime.rst:63 msgid "" "Returns the time zone singleton representing UTC, the same object as :attr:" "`datetime.timezone.utc`." msgstr "" "回傳表示 UTC 的時區單例,是與 :attr:`datetime.timezone.utc` 相同的物件。" -#: ../../c-api/datetime.rst:26 +#: ../../c-api/datetime.rst:69 msgid "Type-check macros:" msgstr "型別檢查巨集:" -#: ../../c-api/datetime.rst:30 +#: ../../c-api/datetime.rst:73 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype " -"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`!PyDateTime_DateType`. *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:" -"`PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:37 +#: ../../c-api/datetime.rst:80 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -75,17 +124,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateType`,則回傳 true。 *ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:43 +#: ../../c-api/datetime.rst:86 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a " -"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " +"subtype of :c:data:`!PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " "This function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:" -"`PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" +"`!PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" "式一定會執行成功。" -#: ../../c-api/datetime.rst:50 +#: ../../c-api/datetime.rst:93 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -93,17 +142,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType`,則回傳 true。*ob* 不得" "為 ``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:56 +#: ../../c-api/datetime.rst:99 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype " -"of :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`!PyDateTime_TimeType`. *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:" -"`PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" +"`!PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" "定會執行成功。" -#: ../../c-api/datetime.rst:63 +#: ../../c-api/datetime.rst:106 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -111,17 +160,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType`,則回傳 true。*ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:69 +#: ../../c-api/datetime.rst:112 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype " -"of :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " +"of :c:data:`!PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:" -"`PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:76 +#: ../../c-api/datetime.rst:119 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -129,17 +178,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType`,則回傳 true。*ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:82 +#: ../../c-api/datetime.rst:125 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype " -"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " +"of :c:data:`!PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:" -"`PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:89 +#: ../../c-api/datetime.rst:132 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -147,24 +196,24 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType`,則回傳 true。 *ob* 不得" "為 ``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:93 +#: ../../c-api/datetime.rst:136 msgid "Macros to create objects:" msgstr "建立物件的巨集:" -#: ../../c-api/datetime.rst:97 +#: ../../c-api/datetime.rst:140 msgid "" "Return a :class:`datetime.date` object with the specified year, month and " "day." msgstr "回傳一個有特定年、月、日的物件 :class:`datetime.date`。" -#: ../../c-api/datetime.rst:102 +#: ../../c-api/datetime.rst:145 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second and microsecond." msgstr "" "回傳一個有特定年、月、日、時、分、秒、微秒的物件 :class:`datetime.datetime`。" -#: ../../c-api/datetime.rst:108 +#: ../../c-api/datetime.rst:151 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second, microsecond and fold." @@ -172,13 +221,13 @@ msgstr "" "回傳一個有特定年、月、日、時、分、秒、微秒與 fold(時間折疊)的物件 :class:" "`datetime.datetime`。" -#: ../../c-api/datetime.rst:116 +#: ../../c-api/datetime.rst:159 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." msgstr "回傳一個有特定時、分、秒、微秒的物件 :class:`datetime.date`。" -#: ../../c-api/datetime.rst:122 +#: ../../c-api/datetime.rst:165 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second, microsecond and fold." @@ -186,7 +235,7 @@ msgstr "" "回傳一個有特定時、分、秒、微秒與 fold(時間折疊)的物件 :class:`datetime." "time`。" -#: ../../c-api/datetime.rst:130 +#: ../../c-api/datetime.rst:173 msgid "" "Return a :class:`datetime.timedelta` object representing the given number of " "days, seconds and microseconds. Normalization is performed so that the " @@ -197,7 +246,7 @@ msgstr "" "標準化 (normalization) 以便生成的微秒數和秒數位於 :class:`datetime." "timedelta` 物件記錄的範圍內。" -#: ../../c-api/datetime.rst:138 +#: ../../c-api/datetime.rst:181 msgid "" "Return a :class:`datetime.timezone` object with an unnamed fixed offset " "represented by the *offset* argument." @@ -205,7 +254,7 @@ msgstr "" "回傳一個 :class:`datetime.timezone` 物件,其未命名的固定偏移量由 *offset* 引" "數表示。" -#: ../../c-api/datetime.rst:146 +#: ../../c-api/datetime.rst:189 msgid "" "Return a :class:`datetime.timezone` object with a fixed offset represented " "by the *offset* argument and with tzname *name*." @@ -213,97 +262,97 @@ msgstr "" "回傳一個 :class:`datetime.timezone` 物件,其固定偏移量由 *offset* 引數表示," "並帶有 tzname *name*。" -#: ../../c-api/datetime.rst:152 +#: ../../c-api/datetime.rst:195 msgid "" "Macros to extract fields from date objects. The argument must be an " -"instance of :c:data:`PyDateTime_Date`, including subclasses (such as :c:data:" +"instance of :c:type:`PyDateTime_Date`, including subclasses (such as :c:type:" "`PyDateTime_DateTime`). The argument must not be ``NULL``, and the type is " "not checked:" msgstr "" -"從 date 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Date` 的實例," -"包括子類別(例如 :c:data:`PyDateTime_DateTime`)。引數不得為 ``NULL``,並且不" +"從 date 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Date` 的實例," +"包括子類別(例如 :c:type:`PyDateTime_DateTime`)。引數不得為 ``NULL``,並且不" "會檢查型別:" -#: ../../c-api/datetime.rst:159 +#: ../../c-api/datetime.rst:202 msgid "Return the year, as a positive int." msgstr "回傳年份,為正整數。" -#: ../../c-api/datetime.rst:164 +#: ../../c-api/datetime.rst:207 msgid "Return the month, as an int from 1 through 12." msgstr "回傳月份,為正整數,從 1 到 12。" -#: ../../c-api/datetime.rst:169 +#: ../../c-api/datetime.rst:212 msgid "Return the day, as an int from 1 through 31." msgstr "回傳日期,為正整數,從 1 到 31。" -#: ../../c-api/datetime.rst:172 +#: ../../c-api/datetime.rst:215 msgid "" "Macros to extract fields from datetime objects. The argument must be an " -"instance of :c:data:`PyDateTime_DateTime`, including subclasses. The " +"instance of :c:type:`PyDateTime_DateTime`, including subclasses. The " "argument must not be ``NULL``, and the type is not checked:" msgstr "" -"從 datetime 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_DateTime` " +"從 datetime 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_DateTime` " "的實例,包括子類別。引數不得為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:178 ../../c-api/datetime.rst:216 +#: ../../c-api/datetime.rst:221 ../../c-api/datetime.rst:259 msgid "Return the hour, as an int from 0 through 23." msgstr "回傳小時,為正整數,從 0 到 23。" -#: ../../c-api/datetime.rst:183 ../../c-api/datetime.rst:221 +#: ../../c-api/datetime.rst:226 ../../c-api/datetime.rst:264 msgid "Return the minute, as an int from 0 through 59." msgstr "回傳分鐘,為正整數,從 0 到 59。" -#: ../../c-api/datetime.rst:188 ../../c-api/datetime.rst:226 +#: ../../c-api/datetime.rst:231 ../../c-api/datetime.rst:269 msgid "Return the second, as an int from 0 through 59." msgstr "回傳秒,為正整數,從0 到59。" -#: ../../c-api/datetime.rst:193 ../../c-api/datetime.rst:231 +#: ../../c-api/datetime.rst:236 ../../c-api/datetime.rst:274 msgid "Return the microsecond, as an int from 0 through 999999." msgstr "回傳微秒,為正整數,從 0 到 999999。" -#: ../../c-api/datetime.rst:198 ../../c-api/datetime.rst:236 +#: ../../c-api/datetime.rst:241 ../../c-api/datetime.rst:279 msgid "Return the fold, as an int from 0 through 1." msgstr "回傳 fold,為 0 或 1 的正整數。" -#: ../../c-api/datetime.rst:205 ../../c-api/datetime.rst:243 +#: ../../c-api/datetime.rst:248 ../../c-api/datetime.rst:286 msgid "Return the tzinfo (which may be ``None``)." msgstr "回傳 tzinfo(可能是 ``None``)。" -#: ../../c-api/datetime.rst:210 +#: ../../c-api/datetime.rst:253 msgid "" "Macros to extract fields from time objects. The argument must be an " -"instance of :c:data:`PyDateTime_Time`, including subclasses. The argument " +"instance of :c:type:`PyDateTime_Time`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -"從 time 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Time` 的實例," +"從 time 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Time` 的實例," "包括子類別。引數不得為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:248 +#: ../../c-api/datetime.rst:291 msgid "" "Macros to extract fields from time delta objects. The argument must be an " -"instance of :c:data:`PyDateTime_Delta`, including subclasses. The argument " +"instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -"從 time delta 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Delta` " +"從 time delta 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Delta` " "的實例,包括子類別。引數不能為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:254 +#: ../../c-api/datetime.rst:297 msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "以 -999999999 到 999999999 之間的整數形式回傳天數。" -#: ../../c-api/datetime.rst:261 +#: ../../c-api/datetime.rst:304 msgid "Return the number of seconds, as an int from 0 through 86399." msgstr "以 0 到 86399 之間的整數形式回傳秒數。" -#: ../../c-api/datetime.rst:268 +#: ../../c-api/datetime.rst:311 msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "以 0 到 999999 之間的整數形式回傳微秒數。" -#: ../../c-api/datetime.rst:273 +#: ../../c-api/datetime.rst:316 msgid "Macros for the convenience of modules implementing the DB API:" msgstr "為了方便模組實作 DB API 的巨集:" -#: ../../c-api/datetime.rst:277 +#: ../../c-api/datetime.rst:320 msgid "" "Create and return a new :class:`datetime.datetime` object given an argument " "tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`." @@ -311,7 +360,7 @@ msgstr "" "給定一個適合傳遞給 :meth:`datetime.datetime.fromtimestamp()` 的引數元組,建立" "並回傳一個新的 :class:`datetime.datetime` 物件。" -#: ../../c-api/datetime.rst:283 +#: ../../c-api/datetime.rst:326 msgid "" "Create and return a new :class:`datetime.date` object given an argument " "tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`." diff --git a/c-api/dict.po b/c-api/dict.po index f6b39b92e0..5f484c64d1 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-26 00:03+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-" @@ -90,9 +90,9 @@ msgstr "" #: ../../c-api/dict.rst:75 msgid "" "Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:expr:`const char*`. The key object is created using " -"``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " -"failure. This function *does not* steal a reference to *val*." +"a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is " +"created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " +"``-1`` on failure. This function *does not* steal a reference to *val*." msgstr "" #: ../../c-api/dict.rst:83 @@ -105,44 +105,45 @@ msgstr "" #: ../../c-api/dict.rst:91 msgid "" -"Remove the entry in dictionary *p* which has a key specified by the string " -"*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return " -"``0`` on success or ``-1`` on failure." +"Remove the entry in dictionary *p* which has a key specified by the UTF-8 " +"encoded bytes string *key*. If *key* is not in the dictionary, :exc:" +"`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." msgstr "" -#: ../../c-api/dict.rst:98 +#: ../../c-api/dict.rst:99 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:103 +#: ../../c-api/dict.rst:104 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:107 +#: ../../c-api/dict.rst:108 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:114 +#: ../../c-api/dict.rst:115 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:122 +#: ../../c-api/dict.rst:123 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" -"expr:`const char*`, rather than a :c:expr:`PyObject*`." +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:127 +#: ../../c-api/dict.rst:129 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -150,7 +151,7 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:136 +#: ../../c-api/dict.rst:138 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -160,29 +161,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:146 +#: ../../c-api/dict.rst:148 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:151 +#: ../../c-api/dict.rst:153 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:156 +#: ../../c-api/dict.rst:158 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:166 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:170 +#: ../../c-api/dict.rst:172 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -196,21 +197,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:181 +#: ../../c-api/dict.rst:183 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:191 +#: ../../c-api/dict.rst:193 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:216 +#: ../../c-api/dict.rst:218 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -220,7 +221,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:226 +#: ../../c-api/dict.rst:228 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -229,7 +230,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:235 +#: ../../c-api/dict.rst:237 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -238,7 +239,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:249 +#: ../../c-api/dict.rst:251 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -246,21 +247,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:258 +#: ../../c-api/dict.rst:260 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: ../../c-api/dict.rst:266 +#: ../../c-api/dict.rst:268 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:274 +#: ../../c-api/dict.rst:276 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -268,7 +269,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:283 +#: ../../c-api/dict.rst:285 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -276,11 +277,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:291 +#: ../../c-api/dict.rst:293 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:295 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -289,7 +290,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:299 +#: ../../c-api/dict.rst:301 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -297,14 +298,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:305 +#: ../../c-api/dict.rst:307 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: ../../c-api/dict.rst:309 +#: ../../c-api/dict.rst:311 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -313,20 +314,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:315 +#: ../../c-api/dict.rst:317 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: ../../c-api/dict.rst:318 +#: ../../c-api/dict.rst:320 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/dict.rst:322 +#: ../../c-api/dict.rst:324 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -347,10 +348,10 @@ msgstr "dictionary(字典)" msgid "PyUnicode_FromString()" msgstr "PyUnicode_FromString()" -#: ../../c-api/dict.rst:162 +#: ../../c-api/dict.rst:164 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:162 +#: ../../c-api/dict.rst:164 msgid "len" msgstr "len" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 2950357cf0..5a9c81c291 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -246,8 +246,8 @@ msgid "" msgstr "" #: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 -#: ../../c-api/exceptions.rst:229 ../../c-api/exceptions.rst:237 -#: ../../c-api/exceptions.rst:245 ../../c-api/exceptions.rst:255 +#: ../../c-api/exceptions.rst:231 ../../c-api/exceptions.rst:241 +#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:259 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -259,30 +259,34 @@ msgstr "" #: ../../c-api/exceptions.rst:225 msgid "" -"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " -"filename is given as a C string. *filename* is decoded from the filesystem " -"encoding (:func:`os.fsdecode`)." +"Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " +"that if *filename* is not ``NULL``, it is decoded from the filesystem " +"encoding (:func:`os.fsdecode`) and passed to the constructor of :exc:" +"`OSError` as a third parameter to be used to define the :attr:`!filename` " +"attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:234 +#: ../../c-api/exceptions.rst:236 msgid "" -"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " -"additional parameter specifying the exception type to be raised." +"Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " +"behavior that if *filename* is not ``NULL``, it is passed to the constructor " +"of :exc:`OSError` as a third parameter to be used to define the :attr:`!" +"filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:242 +#: ../../c-api/exceptions.rst:246 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:252 +#: ../../c-api/exceptions.rst:256 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:260 +#: ../../c-api/exceptions.rst:264 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -290,13 +294,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:270 +#: ../../c-api/exceptions.rst:274 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:278 +#: ../../c-api/exceptions.rst:282 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -304,19 +308,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:288 +#: ../../c-api/exceptions.rst:292 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:296 +#: ../../c-api/exceptions.rst:300 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:302 +#: ../../c-api/exceptions.rst:306 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -324,11 +328,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:309 +#: ../../c-api/exceptions.rst:313 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:311 +#: ../../c-api/exceptions.rst:315 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -344,7 +348,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:326 +#: ../../c-api/exceptions.rst:330 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -354,7 +358,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:333 +#: ../../c-api/exceptions.rst:337 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -363,14 +367,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:339 +#: ../../c-api/exceptions.rst:343 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:346 +#: ../../c-api/exceptions.rst:350 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -378,31 +382,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:357 +#: ../../c-api/exceptions.rst:361 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:364 +#: ../../c-api/exceptions.rst:368 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:373 +#: ../../c-api/exceptions.rst:377 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:380 +#: ../../c-api/exceptions.rst:384 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:384 +#: ../../c-api/exceptions.rst:388 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -411,11 +415,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:394 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:394 +#: ../../c-api/exceptions.rst:398 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -423,14 +427,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:402 +#: ../../c-api/exceptions.rst:406 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:409 +#: ../../c-api/exceptions.rst:413 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -438,43 +442,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:417 +#: ../../c-api/exceptions.rst:421 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:420 +#: ../../c-api/exceptions.rst:424 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:423 ../../c-api/exceptions.rst:467 +#: ../../c-api/exceptions.rst:427 ../../c-api/exceptions.rst:471 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:433 +#: ../../c-api/exceptions.rst:437 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:441 +#: ../../c-api/exceptions.rst:445 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:446 +#: ../../c-api/exceptions.rst:450 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:455 +#: ../../c-api/exceptions.rst:459 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:457 +#: ../../c-api/exceptions.rst:461 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -483,17 +487,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:464 +#: ../../c-api/exceptions.rst:468 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:483 +#: ../../c-api/exceptions.rst:487 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:485 +#: ../../c-api/exceptions.rst:489 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -506,20 +510,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:499 +#: ../../c-api/exceptions.rst:503 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:508 +#: ../../c-api/exceptions.rst:512 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:511 +#: ../../c-api/exceptions.rst:515 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -529,14 +533,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:519 +#: ../../c-api/exceptions.rst:523 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:530 +#: ../../c-api/exceptions.rst:534 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -544,7 +548,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:537 +#: ../../c-api/exceptions.rst:541 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -552,14 +556,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:546 +#: ../../c-api/exceptions.rst:550 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:553 +#: ../../c-api/exceptions.rst:557 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -567,7 +571,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:562 +#: ../../c-api/exceptions.rst:566 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -577,7 +581,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:571 +#: ../../c-api/exceptions.rst:575 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -585,7 +589,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:581 +#: ../../c-api/exceptions.rst:585 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -595,7 +599,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:590 +#: ../../c-api/exceptions.rst:594 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -603,22 +607,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:597 +#: ../../c-api/exceptions.rst:601 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:605 +#: ../../c-api/exceptions.rst:609 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:615 +#: ../../c-api/exceptions.rst:619 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:621 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -626,7 +630,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:622 +#: ../../c-api/exceptions.rst:626 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -635,44 +639,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:628 +#: ../../c-api/exceptions.rst:632 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:631 +#: ../../c-api/exceptions.rst:635 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:635 +#: ../../c-api/exceptions.rst:639 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:646 +#: ../../c-api/exceptions.rst:650 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:650 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:654 ../../c-api/exceptions.rst:681 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:664 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:668 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -680,27 +684,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:669 +#: ../../c-api/exceptions.rst:673 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:672 +#: ../../c-api/exceptions.rst:676 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:685 +#: ../../c-api/exceptions.rst:689 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:689 +#: ../../c-api/exceptions.rst:693 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -708,15 +712,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:698 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:699 +#: ../../c-api/exceptions.rst:703 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:703 +#: ../../c-api/exceptions.rst:707 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -725,7 +729,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:709 +#: ../../c-api/exceptions.rst:713 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -735,31 +739,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:718 +#: ../../c-api/exceptions.rst:722 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:730 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:734 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:737 +#: ../../c-api/exceptions.rst:741 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:743 +#: ../../c-api/exceptions.rst:747 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -767,41 +771,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:751 +#: ../../c-api/exceptions.rst:755 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:758 +#: ../../c-api/exceptions.rst:762 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:765 +#: ../../c-api/exceptions.rst:769 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:769 +#: ../../c-api/exceptions.rst:773 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:774 +#: ../../c-api/exceptions.rst:778 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:779 +#: ../../c-api/exceptions.rst:783 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:783 +#: ../../c-api/exceptions.rst:787 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -813,72 +817,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:797 +#: ../../c-api/exceptions.rst:801 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:799 +#: ../../c-api/exceptions.rst:803 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:803 +#: ../../c-api/exceptions.rst:807 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:810 +#: ../../c-api/exceptions.rst:814 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:816 +#: ../../c-api/exceptions.rst:820 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:822 +#: ../../c-api/exceptions.rst:826 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:830 +#: ../../c-api/exceptions.rst:834 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:837 +#: ../../c-api/exceptions.rst:841 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:845 +#: ../../c-api/exceptions.rst:849 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:852 +#: ../../c-api/exceptions.rst:856 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:858 +#: ../../c-api/exceptions.rst:862 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:869 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:867 +#: ../../c-api/exceptions.rst:871 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -888,44 +892,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:876 +#: ../../c-api/exceptions.rst:880 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:878 +#: ../../c-api/exceptions.rst:882 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:886 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:886 +#: ../../c-api/exceptions.rst:890 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:898 +#: ../../c-api/exceptions.rst:894 ../../c-api/exceptions.rst:902 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:899 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:905 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -934,13 +938,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:913 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:912 +#: ../../c-api/exceptions.rst:916 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -948,30 +952,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:918 +#: ../../c-api/exceptions.rst:922 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:926 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:931 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:938 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:936 +#: ../../c-api/exceptions.rst:940 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -979,451 +983,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1179 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1179 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1179 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:999 +#: ../../c-api/exceptions.rst:1003 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:999 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:999 ../../c-api/exceptions.rst:1001 -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1049 -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1007 ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1065 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1005 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1007 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1009 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1105 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1107 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1110 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1443,58 +1447,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1116 +#: ../../c-api/exceptions.rst:1120 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1123 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1122 +#: ../../c-api/exceptions.rst:1126 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1132 +#: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1138 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1140 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1140 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1143 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1142 ../../c-api/exceptions.rst:1203 +#: ../../c-api/exceptions.rst:1146 ../../c-api/exceptions.rst:1207 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1149 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1148 +#: ../../c-api/exceptions.rst:1152 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1158 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1156 +#: ../../c-api/exceptions.rst:1160 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1502,103 +1506,103 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1183 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1185 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1187 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1199 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1201 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1201 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1200 +#: ../../c-api/exceptions.rst:1204 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1210 msgid "This is a base class for other standard warning categories." msgstr "" @@ -1606,289 +1610,289 @@ msgstr "" msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/init_config.po b/c-api/init_config.po index 6958b33c49..ef69a88c37 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -86,310 +86,310 @@ msgid "" "be non-``NULL``." msgstr "" -#: ../../c-api/init_config.rst:85 +#: ../../c-api/init_config.rst:87 msgid "Methods:" msgstr "" -#: ../../c-api/init_config.rst:89 +#: ../../c-api/init_config.rst:91 msgid "Append *item* to *list*." msgstr "" -#: ../../c-api/init_config.rst:91 ../../c-api/init_config.rst:102 +#: ../../c-api/init_config.rst:93 ../../c-api/init_config.rst:104 msgid "Python must be preinitialized to call this function." msgstr "" -#: ../../c-api/init_config.rst:95 +#: ../../c-api/init_config.rst:97 msgid "Insert *item* into *list* at *index*." msgstr "" -#: ../../c-api/init_config.rst:97 +#: ../../c-api/init_config.rst:99 msgid "" "If *index* is greater than or equal to *list* length, append *item* to " "*list*." msgstr "" -#: ../../c-api/init_config.rst:100 +#: ../../c-api/init_config.rst:102 msgid "*index* must be greater than or equal to ``0``." msgstr "" -#: ../../c-api/init_config.rst:104 ../../c-api/init_config.rst:124 -#: ../../c-api/init_config.rst:231 ../../c-api/init_config.rst:540 +#: ../../c-api/init_config.rst:108 ../../c-api/init_config.rst:128 +#: ../../c-api/init_config.rst:235 ../../c-api/init_config.rst:544 msgid "Structure fields:" msgstr "" -#: ../../c-api/init_config.rst:108 +#: ../../c-api/init_config.rst:112 msgid "List length." msgstr "" -#: ../../c-api/init_config.rst:112 +#: ../../c-api/init_config.rst:116 msgid "List items." msgstr "" -#: ../../c-api/init_config.rst:115 +#: ../../c-api/init_config.rst:119 msgid "PyStatus" msgstr "PyStatus" -#: ../../c-api/init_config.rst:119 +#: ../../c-api/init_config.rst:123 msgid "" "Structure to store an initialization function status: success, error or exit." msgstr "" -#: ../../c-api/init_config.rst:122 +#: ../../c-api/init_config.rst:126 msgid "For an error, it can store the C function name which created the error." msgstr "" -#: ../../c-api/init_config.rst:128 +#: ../../c-api/init_config.rst:132 msgid "Exit code. Argument passed to ``exit()``." msgstr "" -#: ../../c-api/init_config.rst:132 +#: ../../c-api/init_config.rst:136 msgid "Error message." msgstr "錯誤訊息。" -#: ../../c-api/init_config.rst:136 +#: ../../c-api/init_config.rst:140 msgid "Name of the function which created an error, can be ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:140 +#: ../../c-api/init_config.rst:144 msgid "Functions to create a status:" msgstr "" -#: ../../c-api/init_config.rst:144 +#: ../../c-api/init_config.rst:148 msgid "Success." msgstr "" -#: ../../c-api/init_config.rst:148 +#: ../../c-api/init_config.rst:152 msgid "Initialization error with a message." msgstr "" -#: ../../c-api/init_config.rst:150 +#: ../../c-api/init_config.rst:154 msgid "*err_msg* must not be ``NULL``." msgstr "*err_msg* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:154 +#: ../../c-api/init_config.rst:158 msgid "Memory allocation failure (out of memory)." msgstr "" -#: ../../c-api/init_config.rst:158 +#: ../../c-api/init_config.rst:162 msgid "Exit Python with the specified exit code." msgstr "" -#: ../../c-api/init_config.rst:160 +#: ../../c-api/init_config.rst:164 msgid "Functions to handle a status:" msgstr "" -#: ../../c-api/init_config.rst:164 +#: ../../c-api/init_config.rst:168 msgid "" "Is the status an error or an exit? If true, the exception must be handled; " "by calling :c:func:`Py_ExitStatusException` for example." msgstr "" -#: ../../c-api/init_config.rst:169 +#: ../../c-api/init_config.rst:173 msgid "Is the result an error?" msgstr "" -#: ../../c-api/init_config.rst:173 +#: ../../c-api/init_config.rst:177 msgid "Is the result an exit?" msgstr "" -#: ../../c-api/init_config.rst:177 +#: ../../c-api/init_config.rst:181 msgid "" "Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " "exit with a non-zero exit code if *status* is an error. Must only be called " "if ``PyStatus_Exception(status)`` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:182 +#: ../../c-api/init_config.rst:186 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:185 +#: ../../c-api/init_config.rst:189 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/init_config.rst:209 +#: ../../c-api/init_config.rst:213 msgid "PyPreConfig" msgstr "PyPreConfig" -#: ../../c-api/init_config.rst:213 +#: ../../c-api/init_config.rst:217 msgid "Structure used to preinitialize Python." msgstr "" -#: ../../c-api/init_config.rst:217 +#: ../../c-api/init_config.rst:221 msgid "Function to initialize a preconfiguration:" msgstr "" -#: ../../c-api/init_config.rst:221 +#: ../../c-api/init_config.rst:225 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:226 +#: ../../c-api/init_config.rst:230 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:235 +#: ../../c-api/init_config.rst:239 msgid "Name of the Python memory allocators:" msgstr "" -#: ../../c-api/init_config.rst:237 +#: ../../c-api/init_config.rst:241 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" -#: ../../c-api/init_config.rst:239 +#: ../../c-api/init_config.rst:243 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" -#: ../../c-api/init_config.rst:241 +#: ../../c-api/init_config.rst:245 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:244 +#: ../../c-api/init_config.rst:248 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "" -#: ../../c-api/init_config.rst:245 +#: ../../c-api/init_config.rst:249 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:247 +#: ../../c-api/init_config.rst:251 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" -#: ../../c-api/init_config.rst:249 +#: ../../c-api/init_config.rst:253 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:253 +#: ../../c-api/init_config.rst:257 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:257 +#: ../../c-api/init_config.rst:261 msgid "See :ref:`Memory Management `." msgstr "請見\\ :ref:`記憶體管理 `\\ 。" -#: ../../c-api/init_config.rst:259 +#: ../../c-api/init_config.rst:263 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "預設:\\ ``PYMEM_ALLOCATOR_NOT_SET``\\ 。" -#: ../../c-api/init_config.rst:263 +#: ../../c-api/init_config.rst:267 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" -#: ../../c-api/init_config.rst:265 +#: ../../c-api/init_config.rst:269 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" -#: ../../c-api/init_config.rst:268 ../../c-api/init_config.rst:279 +#: ../../c-api/init_config.rst:272 ../../c-api/init_config.rst:283 msgid "See the :term:`locale encoding`." msgstr "請見 :term:`locale encoding`\\ 。" -#: ../../c-api/init_config.rst:270 ../../c-api/init_config.rst:325 -#: ../../c-api/init_config.rst:680 +#: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:329 +#: ../../c-api/init_config.rst:684 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:274 +#: ../../c-api/init_config.rst:278 msgid "If equals to ``2``, coerce the C locale." msgstr "" -#: ../../c-api/init_config.rst:276 +#: ../../c-api/init_config.rst:280 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" -#: ../../c-api/init_config.rst:281 ../../c-api/init_config.rst:287 +#: ../../c-api/init_config.rst:285 ../../c-api/init_config.rst:291 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:285 +#: ../../c-api/init_config.rst:289 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: ../../c-api/init_config.rst:291 +#: ../../c-api/init_config.rst:295 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:689 -#: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:1184 +#: ../../c-api/init_config.rst:298 ../../c-api/init_config.rst:693 +#: ../../c-api/init_config.rst:735 ../../c-api/init_config.rst:1188 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:298 +#: ../../c-api/init_config.rst:302 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:300 ../../c-api/init_config.rst:876 +#: ../../c-api/init_config.rst:304 ../../c-api/init_config.rst:880 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:304 +#: ../../c-api/init_config.rst:308 msgid "If non-zero:" msgstr "如果不為 0:" -#: ../../c-api/init_config.rst:306 +#: ../../c-api/init_config.rst:310 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "將 :c:member:`PyPreConfig.utf8_mode` 設為 ``0``\\ 、" -#: ../../c-api/init_config.rst:307 +#: ../../c-api/init_config.rst:311 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "將 :c:member:`PyConfig.filesystem_encoding` 設為 ``\"mbcs\"``\\ 、" -#: ../../c-api/init_config.rst:308 +#: ../../c-api/init_config.rst:312 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "將 :c:member:`PyConfig.filesystem_errors` 設為 ``\"replace\"``\\ 。" -#: ../../c-api/init_config.rst:310 +#: ../../c-api/init_config.rst:314 msgid "" "Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -#: ../../c-api/init_config.rst:313 ../../c-api/init_config.rst:890 +#: ../../c-api/init_config.rst:317 ../../c-api/init_config.rst:894 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" -#: ../../c-api/init_config.rst:316 ../../c-api/init_config.rst:628 -#: ../../c-api/init_config.rst:635 ../../c-api/init_config.rst:702 -#: ../../c-api/init_config.rst:811 ../../c-api/init_config.rst:825 -#: ../../c-api/init_config.rst:839 ../../c-api/init_config.rst:893 -#: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:967 -#: ../../c-api/init_config.rst:1019 ../../c-api/init_config.rst:1079 -#: ../../c-api/init_config.rst:1119 ../../c-api/init_config.rst:1148 -#: ../../c-api/init_config.rst:1235 +#: ../../c-api/init_config.rst:320 ../../c-api/init_config.rst:632 +#: ../../c-api/init_config.rst:639 ../../c-api/init_config.rst:706 +#: ../../c-api/init_config.rst:815 ../../c-api/init_config.rst:829 +#: ../../c-api/init_config.rst:843 ../../c-api/init_config.rst:897 +#: ../../c-api/init_config.rst:911 ../../c-api/init_config.rst:971 +#: ../../c-api/init_config.rst:1023 ../../c-api/init_config.rst:1083 +#: ../../c-api/init_config.rst:1123 ../../c-api/init_config.rst:1152 +#: ../../c-api/init_config.rst:1239 msgid "Default: ``0``." msgstr "預設:\\ ``0``。" -#: ../../c-api/init_config.rst:320 +#: ../../c-api/init_config.rst:324 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" "`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " @@ -397,95 +397,95 @@ msgid "" "Arguments `." msgstr "" -#: ../../c-api/init_config.rst:329 +#: ../../c-api/init_config.rst:333 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:332 ../../c-api/init_config.rst:1209 +#: ../../c-api/init_config.rst:336 ../../c-api/init_config.rst:1213 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:336 +#: ../../c-api/init_config.rst:340 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:338 +#: ../../c-api/init_config.rst:342 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" -#: ../../c-api/init_config.rst:341 +#: ../../c-api/init_config.rst:345 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" -#: ../../c-api/init_config.rst:343 +#: ../../c-api/init_config.rst:347 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:349 +#: ../../c-api/init_config.rst:353 msgid "Preinitialize Python with PyPreConfig" msgstr "" -#: ../../c-api/init_config.rst:351 +#: ../../c-api/init_config.rst:355 msgid "The preinitialization of Python:" msgstr "" -#: ../../c-api/init_config.rst:353 +#: ../../c-api/init_config.rst:357 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" -#: ../../c-api/init_config.rst:354 +#: ../../c-api/init_config.rst:358 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" -#: ../../c-api/init_config.rst:355 +#: ../../c-api/init_config.rst:359 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" -#: ../../c-api/init_config.rst:358 +#: ../../c-api/init_config.rst:362 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -#: ../../c-api/init_config.rst:361 +#: ../../c-api/init_config.rst:365 msgid "Functions to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:365 ../../c-api/init_config.rst:371 -#: ../../c-api/init_config.rst:380 +#: ../../c-api/init_config.rst:369 ../../c-api/init_config.rst:375 +#: ../../c-api/init_config.rst:384 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: ../../c-api/init_config.rst:367 ../../c-api/init_config.rst:376 -#: ../../c-api/init_config.rst:385 +#: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:380 +#: ../../c-api/init_config.rst:389 msgid "*preconfig* must not be ``NULL``." msgstr "*preconfig* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:373 +#: ../../c-api/init_config.rst:377 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:382 +#: ../../c-api/init_config.rst:386 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:387 ../../c-api/init_config.rst:1297 +#: ../../c-api/init_config.rst:391 ../../c-api/init_config.rst:1301 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -#: ../../c-api/init_config.rst:390 +#: ../../c-api/init_config.rst:394 msgid "" "For :ref:`Python Configuration ` (:c:func:" "`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " @@ -495,7 +495,7 @@ msgid "" "`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:397 +#: ../../c-api/init_config.rst:401 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " @@ -503,7 +503,7 @@ msgid "" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: ../../c-api/init_config.rst:402 +#: ../../c-api/init_config.rst:406 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " @@ -511,90 +511,90 @@ msgid "" "not be called before the Python preinitialization." msgstr "" -#: ../../c-api/init_config.rst:407 +#: ../../c-api/init_config.rst:411 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" -#: ../../c-api/init_config.rst:429 +#: ../../c-api/init_config.rst:433 msgid "PyConfig" msgstr "PyConfig" -#: ../../c-api/init_config.rst:433 +#: ../../c-api/init_config.rst:437 msgid "Structure containing most parameters to configure Python." msgstr "" -#: ../../c-api/init_config.rst:435 +#: ../../c-api/init_config.rst:439 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" -#: ../../c-api/init_config.rst:440 +#: ../../c-api/init_config.rst:444 msgid "Structure methods:" msgstr "" -#: ../../c-api/init_config.rst:444 +#: ../../c-api/init_config.rst:448 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:449 +#: ../../c-api/init_config.rst:453 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:454 +#: ../../c-api/init_config.rst:458 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:456 ../../c-api/init_config.rst:463 -#: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:478 -#: ../../c-api/init_config.rst:484 ../../c-api/init_config.rst:501 +#: ../../c-api/init_config.rst:460 ../../c-api/init_config.rst:467 +#: ../../c-api/init_config.rst:474 ../../c-api/init_config.rst:482 +#: ../../c-api/init_config.rst:488 ../../c-api/init_config.rst:505 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" -#: ../../c-api/init_config.rst:460 +#: ../../c-api/init_config.rst:464 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:467 +#: ../../c-api/init_config.rst:471 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" -#: ../../c-api/init_config.rst:474 +#: ../../c-api/init_config.rst:478 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using :c:func:" "`Py_DecodeLocale`." msgstr "" -#: ../../c-api/init_config.rst:482 +#: ../../c-api/init_config.rst:486 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: ../../c-api/init_config.rst:488 +#: ../../c-api/init_config.rst:492 msgid "Read all Python configuration." msgstr "" -#: ../../c-api/init_config.rst:490 +#: ../../c-api/init_config.rst:494 msgid "Fields which are already initialized are left unchanged." msgstr "" -#: ../../c-api/init_config.rst:492 +#: ../../c-api/init_config.rst:496 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: ../../c-api/init_config.rst:495 ../../c-api/init_config.rst:996 +#: ../../c-api/init_config.rst:499 ../../c-api/init_config.rst:1000 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -603,25 +603,25 @@ msgid "" "as Python options." msgstr "" -#: ../../c-api/init_config.rst:503 +#: ../../c-api/init_config.rst:507 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" "`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " "arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" -#: ../../c-api/init_config.rst:509 +#: ../../c-api/init_config.rst:513 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " "under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" -#: ../../c-api/init_config.rst:517 +#: ../../c-api/init_config.rst:521 msgid "Release configuration memory." msgstr "" -#: ../../c-api/init_config.rst:519 +#: ../../c-api/init_config.rst:523 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" @@ -630,23 +630,23 @@ msgid "" "before calling a :c:type:`PyConfig` method:" msgstr "" -#: ../../c-api/init_config.rst:525 +#: ../../c-api/init_config.rst:529 msgid ":c:member:`PyConfig.dev_mode`" msgstr ":c:member:`PyConfig.dev_mode`" -#: ../../c-api/init_config.rst:526 +#: ../../c-api/init_config.rst:530 msgid ":c:member:`PyConfig.isolated`" msgstr ":c:member:`PyConfig.isolated`" -#: ../../c-api/init_config.rst:527 +#: ../../c-api/init_config.rst:531 msgid ":c:member:`PyConfig.parse_argv`" msgstr ":c:member:`PyConfig.parse_argv`" -#: ../../c-api/init_config.rst:528 +#: ../../c-api/init_config.rst:532 msgid ":c:member:`PyConfig.use_environment`" msgstr ":c:member:`PyConfig.use_environment`" -#: ../../c-api/init_config.rst:530 +#: ../../c-api/init_config.rst:534 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " @@ -654,412 +654,412 @@ msgid "" "member:`~PyConfig.parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:535 +#: ../../c-api/init_config.rst:539 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" -#: ../../c-api/init_config.rst:544 +#: ../../c-api/init_config.rst:548 msgid "Command line arguments: :data:`sys.argv`." msgstr "" -#: ../../c-api/init_config.rst:546 +#: ../../c-api/init_config.rst:550 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." "argv` the same way the regular Python parses Python command line arguments " "and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:551 +#: ../../c-api/init_config.rst:555 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" -#: ../../c-api/init_config.rst:554 ../../c-api/init_config.rst:581 -#: ../../c-api/init_config.rst:593 ../../c-api/init_config.rst:601 -#: ../../c-api/init_config.rst:709 ../../c-api/init_config.rst:718 -#: ../../c-api/init_config.rst:800 ../../c-api/init_config.rst:937 -#: ../../c-api/init_config.rst:1038 ../../c-api/init_config.rst:1056 -#: ../../c-api/init_config.rst:1070 ../../c-api/init_config.rst:1087 -#: ../../c-api/init_config.rst:1100 ../../c-api/init_config.rst:1108 +#: ../../c-api/init_config.rst:558 ../../c-api/init_config.rst:585 +#: ../../c-api/init_config.rst:597 ../../c-api/init_config.rst:605 +#: ../../c-api/init_config.rst:713 ../../c-api/init_config.rst:722 +#: ../../c-api/init_config.rst:804 ../../c-api/init_config.rst:941 +#: ../../c-api/init_config.rst:1042 ../../c-api/init_config.rst:1060 +#: ../../c-api/init_config.rst:1074 ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1104 ../../c-api/init_config.rst:1112 msgid "Default: ``NULL``." msgstr "預設值:\\ ``NULL``\\ 。" -#: ../../c-api/init_config.rst:556 +#: ../../c-api/init_config.rst:560 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:560 +#: ../../c-api/init_config.rst:564 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" -#: ../../c-api/init_config.rst:563 +#: ../../c-api/init_config.rst:567 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" -#: ../../c-api/init_config.rst:565 +#: ../../c-api/init_config.rst:569 msgid "" "If running a script (``python script.py``), prepend the script's directory. " "If it's a symbolic link, resolve symbolic links." msgstr "" -#: ../../c-api/init_config.rst:567 +#: ../../c-api/init_config.rst:571 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" -#: ../../c-api/init_config.rst:570 +#: ../../c-api/init_config.rst:574 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:573 +#: ../../c-api/init_config.rst:577 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:579 +#: ../../c-api/init_config.rst:583 msgid ":data:`sys.base_exec_prefix`." msgstr ":data:`sys.base_exec_prefix`\\ 。" -#: ../../c-api/init_config.rst:583 ../../c-api/init_config.rst:595 -#: ../../c-api/init_config.rst:603 ../../c-api/init_config.rst:711 -#: ../../c-api/init_config.rst:720 ../../c-api/init_config.rst:954 -#: ../../c-api/init_config.rst:1040 +#: ../../c-api/init_config.rst:587 ../../c-api/init_config.rst:599 +#: ../../c-api/init_config.rst:607 ../../c-api/init_config.rst:715 +#: ../../c-api/init_config.rst:724 ../../c-api/init_config.rst:958 +#: ../../c-api/init_config.rst:1044 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" -#: ../../c-api/init_config.rst:587 +#: ../../c-api/init_config.rst:591 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" -#: ../../c-api/init_config.rst:589 +#: ../../c-api/init_config.rst:593 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" -#: ../../c-api/init_config.rst:591 +#: ../../c-api/init_config.rst:595 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:599 +#: ../../c-api/init_config.rst:603 msgid ":data:`sys.base_prefix`." msgstr ":data:`sys.base_prefix`\\ 。" -#: ../../c-api/init_config.rst:607 +#: ../../c-api/init_config.rst:611 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:610 +#: ../../c-api/init_config.rst:614 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:613 +#: ../../c-api/init_config.rst:617 msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:615 ../../c-api/init_config.rst:648 -#: ../../c-api/init_config.rst:1136 ../../c-api/init_config.rst:1267 +#: ../../c-api/init_config.rst:619 ../../c-api/init_config.rst:652 +#: ../../c-api/init_config.rst:1140 ../../c-api/init_config.rst:1271 msgid "Default: ``1``." msgstr "預設值:\\ ``1``\\ 。" -#: ../../c-api/init_config.rst:619 +#: ../../c-api/init_config.rst:623 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" "`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" -#: ../../c-api/init_config.rst:623 +#: ../../c-api/init_config.rst:627 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" -#: ../../c-api/init_config.rst:626 +#: ../../c-api/init_config.rst:630 msgid "Incremented by the :option:`-b` command line option." msgstr "" -#: ../../c-api/init_config.rst:632 +#: ../../c-api/init_config.rst:636 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." "TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " "details." msgstr "" -#: ../../c-api/init_config.rst:641 +#: ../../c-api/init_config.rst:645 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" -#: ../../c-api/init_config.rst:645 +#: ../../c-api/init_config.rst:649 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:654 +#: ../../c-api/init_config.rst:658 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the :" "option:`--check-hash-based-pycs` command line option." msgstr "" -#: ../../c-api/init_config.rst:657 +#: ../../c-api/init_config.rst:661 msgid "Valid values:" msgstr "" -#: ../../c-api/init_config.rst:659 +#: ../../c-api/init_config.rst:663 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" -#: ../../c-api/init_config.rst:661 +#: ../../c-api/init_config.rst:665 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" -#: ../../c-api/init_config.rst:662 +#: ../../c-api/init_config.rst:666 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" -#: ../../c-api/init_config.rst:665 +#: ../../c-api/init_config.rst:669 msgid "Default: ``L\"default\"``." msgstr "預設:\\ ``L\"default\"``。" -#: ../../c-api/init_config.rst:667 +#: ../../c-api/init_config.rst:671 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" -#: ../../c-api/init_config.rst:671 +#: ../../c-api/init_config.rst:675 msgid "If non-zero, configure C standard streams:" msgstr "" -#: ../../c-api/init_config.rst:673 +#: ../../c-api/init_config.rst:677 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:675 +#: ../../c-api/init_config.rst:679 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" -#: ../../c-api/init_config.rst:677 +#: ../../c-api/init_config.rst:681 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " "stdin and stdout (only stdout on Windows)." msgstr "" -#: ../../c-api/init_config.rst:684 +#: ../../c-api/init_config.rst:688 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: ../../c-api/init_config.rst:686 +#: ../../c-api/init_config.rst:690 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:693 +#: ../../c-api/init_config.rst:697 msgid "Dump Python references?" msgstr "" -#: ../../c-api/init_config.rst:695 +#: ../../c-api/init_config.rst:699 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: ../../c-api/init_config.rst:697 +#: ../../c-api/init_config.rst:701 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:699 +#: ../../c-api/init_config.rst:703 msgid "" "Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: see " "the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" -#: ../../c-api/init_config.rst:706 +#: ../../c-api/init_config.rst:710 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" -#: ../../c-api/init_config.rst:715 +#: ../../c-api/init_config.rst:719 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" -#: ../../c-api/init_config.rst:724 +#: ../../c-api/init_config.rst:728 msgid "Enable faulthandler?" msgstr "" -#: ../../c-api/init_config.rst:726 +#: ../../c-api/init_config.rst:730 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" -#: ../../c-api/init_config.rst:728 +#: ../../c-api/init_config.rst:732 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" -#: ../../c-api/init_config.rst:735 +#: ../../c-api/init_config.rst:739 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" -#: ../../c-api/init_config.rst:738 +#: ../../c-api/init_config.rst:742 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:740 +#: ../../c-api/init_config.rst:744 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" "`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" "zero." msgstr "" -#: ../../c-api/init_config.rst:744 +#: ../../c-api/init_config.rst:748 msgid "Default encoding on other platforms:" msgstr "" -#: ../../c-api/init_config.rst:746 +#: ../../c-api/init_config.rst:750 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:747 +#: ../../c-api/init_config.rst:751 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " "encoding (usually Latin1)." msgstr "" -#: ../../c-api/init_config.rst:750 +#: ../../c-api/init_config.rst:754 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: ../../c-api/init_config.rst:751 +#: ../../c-api/init_config.rst:755 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: ../../c-api/init_config.rst:754 +#: ../../c-api/init_config.rst:758 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: ../../c-api/init_config.rst:757 +#: ../../c-api/init_config.rst:761 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" -#: ../../c-api/init_config.rst:761 +#: ../../c-api/init_config.rst:765 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:764 +#: ../../c-api/init_config.rst:768 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: ../../c-api/init_config.rst:768 +#: ../../c-api/init_config.rst:772 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:770 +#: ../../c-api/init_config.rst:774 msgid "Supported error handlers:" msgstr "" -#: ../../c-api/init_config.rst:772 +#: ../../c-api/init_config.rst:776 msgid "``\"strict\"``" msgstr "``\"strict\"``" -#: ../../c-api/init_config.rst:773 +#: ../../c-api/init_config.rst:777 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" -#: ../../c-api/init_config.rst:774 +#: ../../c-api/init_config.rst:778 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" -#: ../../c-api/init_config.rst:776 +#: ../../c-api/init_config.rst:780 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" -#: ../../c-api/init_config.rst:781 +#: ../../c-api/init_config.rst:785 msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:783 +#: ../../c-api/init_config.rst:787 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:786 +#: ../../c-api/init_config.rst:790 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:788 +#: ../../c-api/init_config.rst:792 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:793 +#: ../../c-api/init_config.rst:797 msgid "Python home directory." msgstr "" -#: ../../c-api/init_config.rst:795 +#: ../../c-api/init_config.rst:799 msgid "" "If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not " "``NULL``." msgstr "" -#: ../../c-api/init_config.rst:798 +#: ../../c-api/init_config.rst:802 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:802 ../../c-api/init_config.rst:919 -#: ../../c-api/init_config.rst:939 ../../c-api/init_config.rst:1028 -#: ../../c-api/init_config.rst:1058 +#: ../../c-api/init_config.rst:806 ../../c-api/init_config.rst:923 +#: ../../c-api/init_config.rst:943 ../../c-api/init_config.rst:1032 +#: ../../c-api/init_config.rst:1062 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: ../../c-api/init_config.rst:806 +#: ../../c-api/init_config.rst:810 msgid "If non-zero, profile import time." msgstr "" -#: ../../c-api/init_config.rst:808 +#: ../../c-api/init_config.rst:812 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:815 +#: ../../c-api/init_config.rst:819 msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: ../../c-api/init_config.rst:817 +#: ../../c-api/init_config.rst:821 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " @@ -1067,30 +1067,30 @@ msgid "" "a terminal." msgstr "" -#: ../../c-api/init_config.rst:822 +#: ../../c-api/init_config.rst:826 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: ../../c-api/init_config.rst:829 +#: ../../c-api/init_config.rst:833 msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:831 ../../c-api/init_config.rst:1002 -#: ../../c-api/init_config.rst:1026 ../../c-api/init_config.rst:1219 +#: ../../c-api/init_config.rst:835 ../../c-api/init_config.rst:1006 +#: ../../c-api/init_config.rst:1030 ../../c-api/init_config.rst:1223 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:835 +#: ../../c-api/init_config.rst:839 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" -#: ../../c-api/init_config.rst:837 +#: ../../c-api/init_config.rst:841 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: ../../c-api/init_config.rst:843 +#: ../../c-api/init_config.rst:847 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " @@ -1100,30 +1100,30 @@ msgid "" "str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" -#: ../../c-api/init_config.rst:851 +#: ../../c-api/init_config.rst:855 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:854 +#: ../../c-api/init_config.rst:858 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:861 +#: ../../c-api/init_config.rst:865 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:863 +#: ../../c-api/init_config.rst:867 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" -#: ../../c-api/init_config.rst:867 +#: ../../c-api/init_config.rst:871 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." @@ -1131,77 +1131,77 @@ msgstr "" "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變" "數。" -#: ../../c-api/init_config.rst:869 +#: ../../c-api/init_config.rst:873 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:871 +#: ../../c-api/init_config.rst:875 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:874 +#: ../../c-api/init_config.rst:878 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: ../../c-api/init_config.rst:878 +#: ../../c-api/init_config.rst:882 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:883 +#: ../../c-api/init_config.rst:887 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." "stderr`." msgstr "" -#: ../../c-api/init_config.rst:887 +#: ../../c-api/init_config.rst:891 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:895 +#: ../../c-api/init_config.rst:899 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:899 +#: ../../c-api/init_config.rst:903 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:902 +#: ../../c-api/init_config.rst:906 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:904 +#: ../../c-api/init_config.rst:908 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:911 +#: ../../c-api/init_config.rst:915 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:917 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:915 +#: ../../c-api/init_config.rst:919 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: ../../c-api/init_config.rst:923 +#: ../../c-api/init_config.rst:927 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -1209,21 +1209,21 @@ msgid "" "and virtual environments." msgstr "" -#: ../../c-api/init_config.rst:932 +#: ../../c-api/init_config.rst:936 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:935 +#: ../../c-api/init_config.rst:939 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:944 +#: ../../c-api/init_config.rst:948 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:946 +#: ../../c-api/init_config.rst:950 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -1231,41 +1231,41 @@ msgid "" "to ``1``." msgstr "" -#: ../../c-api/init_config.rst:951 +#: ../../c-api/init_config.rst:955 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:958 +#: ../../c-api/init_config.rst:962 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:960 +#: ../../c-api/init_config.rst:964 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:961 +#: ../../c-api/init_config.rst:965 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:962 +#: ../../c-api/init_config.rst:966 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:964 +#: ../../c-api/init_config.rst:968 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:971 +#: ../../c-api/init_config.rst:975 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:974 +#: ../../c-api/init_config.rst:978 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1274,388 +1274,388 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:981 +#: ../../c-api/init_config.rst:985 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:984 ../../c-api/init_config.rst:1254 -#: ../../c-api/init_config.rst:1273 +#: ../../c-api/init_config.rst:988 ../../c-api/init_config.rst:1258 +#: ../../c-api/init_config.rst:1277 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:990 +#: ../../c-api/init_config.rst:994 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:992 +#: ../../c-api/init_config.rst:996 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1004 +#: ../../c-api/init_config.rst:1008 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1010 +#: ../../c-api/init_config.rst:1014 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:1013 +#: ../../c-api/init_config.rst:1017 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1016 +#: ../../c-api/init_config.rst:1020 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1023 +#: ../../c-api/init_config.rst:1027 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: ../../c-api/init_config.rst:1030 +#: ../../c-api/init_config.rst:1034 msgid "Now also applies on Windows." msgstr "" -#: ../../c-api/init_config.rst:1035 +#: ../../c-api/init_config.rst:1039 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:1044 +#: ../../c-api/init_config.rst:1048 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1047 +#: ../../c-api/init_config.rst:1051 msgid "If :func:`Py_SetProgramName` has been called, use its argument." msgstr "" -#: ../../c-api/init_config.rst:1048 +#: ../../c-api/init_config.rst:1052 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1049 +#: ../../c-api/init_config.rst:1053 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1051 +#: ../../c-api/init_config.rst:1055 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:1053 +#: ../../c-api/init_config.rst:1057 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:1062 +#: ../../c-api/init_config.rst:1066 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1065 +#: ../../c-api/init_config.rst:1069 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1068 +#: ../../c-api/init_config.rst:1072 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1074 +#: ../../c-api/init_config.rst:1078 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1077 +#: ../../c-api/init_config.rst:1081 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:1083 +#: ../../c-api/init_config.rst:1087 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:1085 ../../c-api/init_config.rst:1106 +#: ../../c-api/init_config.rst:1089 ../../c-api/init_config.rst:1110 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1095 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: ../../c-api/init_config.rst:1095 +#: ../../c-api/init_config.rst:1099 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: ../../c-api/init_config.rst:1098 +#: ../../c-api/init_config.rst:1102 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。" -#: ../../c-api/init_config.rst:1104 +#: ../../c-api/init_config.rst:1108 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1112 +#: ../../c-api/init_config.rst:1116 msgid "Show total reference count at exit (excluding immortal objects)?" msgstr "" -#: ../../c-api/init_config.rst:1114 +#: ../../c-api/init_config.rst:1118 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1116 +#: ../../c-api/init_config.rst:1120 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1123 +#: ../../c-api/init_config.rst:1127 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1125 +#: ../../c-api/init_config.rst:1129 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1128 +#: ../../c-api/init_config.rst:1132 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1131 +#: ../../c-api/init_config.rst:1135 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1133 +#: ../../c-api/init_config.rst:1137 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of :c:" "member:`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1140 +#: ../../c-api/init_config.rst:1144 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1143 +#: ../../c-api/init_config.rst:1147 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1146 +#: ../../c-api/init_config.rst:1150 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1153 +#: ../../c-api/init_config.rst:1157 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1157 +#: ../../c-api/init_config.rst:1161 msgid "" "If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " "and *errors* arguments if they are not ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:1160 +#: ../../c-api/init_config.rst:1164 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1163 +#: ../../c-api/init_config.rst:1167 msgid "Default encoding:" msgstr "" -#: ../../c-api/init_config.rst:1165 +#: ../../c-api/init_config.rst:1169 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1166 +#: ../../c-api/init_config.rst:1170 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: ../../c-api/init_config.rst:1168 +#: ../../c-api/init_config.rst:1172 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1170 +#: ../../c-api/init_config.rst:1174 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: ../../c-api/init_config.rst:1171 +#: ../../c-api/init_config.rst:1175 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1173 +#: ../../c-api/init_config.rst:1177 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1177 +#: ../../c-api/init_config.rst:1181 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1179 +#: ../../c-api/init_config.rst:1183 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1181 +#: ../../c-api/init_config.rst:1185 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1188 +#: ../../c-api/init_config.rst:1192 msgid "Enable compatibility mode with the perf profiler?" msgstr "" -#: ../../c-api/init_config.rst:1190 +#: ../../c-api/init_config.rst:1194 msgid "" "If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " "more information." msgstr "" -#: ../../c-api/init_config.rst:1193 +#: ../../c-api/init_config.rst:1197 msgid "" "Set by :option:`-X perf <-X>` command line option and by the :envvar:" "`PYTHONPERFSUPPORT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1196 +#: ../../c-api/init_config.rst:1200 msgid "Default: ``-1``." msgstr "預設值:``1``。" -#: ../../c-api/init_config.rst:1202 +#: ../../c-api/init_config.rst:1206 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1204 +#: ../../c-api/init_config.rst:1208 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1207 +#: ../../c-api/init_config.rst:1211 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1213 +#: ../../c-api/init_config.rst:1217 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1215 +#: ../../c-api/init_config.rst:1219 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1217 +#: ../../c-api/init_config.rst:1221 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1223 +#: ../../c-api/init_config.rst:1227 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1227 +#: ../../c-api/init_config.rst:1231 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1231 +#: ../../c-api/init_config.rst:1235 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1233 +#: ../../c-api/init_config.rst:1237 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1239 +#: ../../c-api/init_config.rst:1243 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1242 +#: ../../c-api/init_config.rst:1246 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1247 +#: ../../c-api/init_config.rst:1251 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1250 +#: ../../c-api/init_config.rst:1254 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1258 +#: ../../c-api/init_config.rst:1262 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1261 +#: ../../c-api/init_config.rst:1265 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1264 +#: ../../c-api/init_config.rst:1268 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1271 +#: ../../c-api/init_config.rst:1275 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1275 +#: ../../c-api/init_config.rst:1279 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1663,29 +1663,29 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1280 +#: ../../c-api/init_config.rst:1284 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1289 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1289 +#: ../../c-api/init_config.rst:1293 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1291 +#: ../../c-api/init_config.rst:1295 msgid "Function to initialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1295 +#: ../../c-api/init_config.rst:1299 msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:1300 +#: ../../c-api/init_config.rst:1304 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1694,17 +1694,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1307 +#: ../../c-api/init_config.rst:1311 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1314 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1338 +#: ../../c-api/init_config.rst:1342 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1713,18 +1713,18 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1405 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1403 +#: ../../c-api/init_config.rst:1407 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1408 +#: ../../c-api/init_config.rst:1412 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1732,115 +1732,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1417 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1421 +#: ../../c-api/init_config.rst:1425 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1423 +#: ../../c-api/init_config.rst:1427 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1427 +#: ../../c-api/init_config.rst:1431 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1430 +#: ../../c-api/init_config.rst:1434 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1439 +#: ../../c-api/init_config.rst:1443 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1445 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1443 +#: ../../c-api/init_config.rst:1447 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1445 +#: ../../c-api/init_config.rst:1449 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1446 +#: ../../c-api/init_config.rst:1450 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1447 +#: ../../c-api/init_config.rst:1451 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1448 +#: ../../c-api/init_config.rst:1452 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1449 +#: ../../c-api/init_config.rst:1453 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1450 +#: ../../c-api/init_config.rst:1454 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1451 +#: ../../c-api/init_config.rst:1455 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1453 +#: ../../c-api/init_config.rst:1457 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1454 +#: ../../c-api/init_config.rst:1458 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1458 +#: ../../c-api/init_config.rst:1462 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1460 +#: ../../c-api/init_config.rst:1464 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1461 +#: ../../c-api/init_config.rst:1465 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1462 +#: ../../c-api/init_config.rst:1466 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1463 +#: ../../c-api/init_config.rst:1467 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1468 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1465 +#: ../../c-api/init_config.rst:1469 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -1848,11 +1848,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1467 +#: ../../c-api/init_config.rst:1471 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1469 +#: ../../c-api/init_config.rst:1473 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1861,7 +1861,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1475 +#: ../../c-api/init_config.rst:1479 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1871,52 +1871,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1482 +#: ../../c-api/init_config.rst:1486 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1485 +#: ../../c-api/init_config.rst:1489 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1489 +#: ../../c-api/init_config.rst:1493 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1491 +#: ../../c-api/init_config.rst:1495 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1494 +#: ../../c-api/init_config.rst:1498 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1496 +#: ../../c-api/init_config.rst:1500 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1498 +#: ../../c-api/init_config.rst:1502 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1500 +#: ../../c-api/init_config.rst:1504 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1506 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -1925,170 +1925,170 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1512 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1514 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1515 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1516 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1514 +#: ../../c-api/init_config.rst:1518 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1520 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1521 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1518 +#: ../../c-api/init_config.rst:1522 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1519 +#: ../../c-api/init_config.rst:1523 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1521 +#: ../../c-api/init_config.rst:1525 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1530 msgid "Py_RunMain()" msgstr "Py_RunMain()" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1534 msgid "" "Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" "member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." "run_module`) specified on the command line or in the configuration." msgstr "" -#: ../../c-api/init_config.rst:1535 +#: ../../c-api/init_config.rst:1539 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:1537 +#: ../../c-api/init_config.rst:1541 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:1540 +#: ../../c-api/init_config.rst:1544 msgid "" "See :ref:`Python Configuration ` for an example of " "customized Python always running in isolated mode using :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1546 +#: ../../c-api/init_config.rst:1550 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1550 +#: ../../c-api/init_config.rst:1554 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1552 +#: ../../c-api/init_config.rst:1556 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:1560 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1558 +#: ../../c-api/init_config.rst:1562 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1561 +#: ../../c-api/init_config.rst:1565 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1563 +#: ../../c-api/init_config.rst:1567 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1564 +#: ../../c-api/init_config.rst:1568 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1565 +#: ../../c-api/init_config.rst:1569 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1566 +#: ../../c-api/init_config.rst:1570 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1569 +#: ../../c-api/init_config.rst:1573 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1575 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1572 +#: ../../c-api/init_config.rst:1576 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1577 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1578 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1576 +#: ../../c-api/init_config.rst:1580 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1581 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1578 +#: ../../c-api/init_config.rst:1582 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1584 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1582 +#: ../../c-api/init_config.rst:1586 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1587 +#: ../../c-api/init_config.rst:1591 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1589 +#: ../../c-api/init_config.rst:1593 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2097,14 +2097,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1595 +#: ../../c-api/init_config.rst:1599 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1599 +#: ../../c-api/init_config.rst:1603 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2112,7 +2112,7 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1604 +#: ../../c-api/init_config.rst:1608 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" diff --git a/c-api/module.po b/c-api/module.po index 56d28314f2..e0ceacc0f2 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -373,27 +373,27 @@ msgid "" "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:342 +#: ../../c-api/module.rst:343 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:347 +#: ../../c-api/module.rst:348 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:351 +#: ../../c-api/module.rst:352 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." msgstr "" -#: ../../c-api/module.rst:354 +#: ../../c-api/module.rst:355 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -402,7 +402,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:361 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -412,7 +412,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:369 +#: ../../c-api/module.rst:370 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -420,59 +420,59 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:376 +#: ../../c-api/module.rst:378 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:381 +#: ../../c-api/module.rst:383 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:385 +#: ../../c-api/module.rst:389 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:389 +#: ../../c-api/module.rst:393 msgid "" "The module supports being imported in subinterpreters, but only when they " "share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:395 +#: ../../c-api/module.rst:399 msgid "" "The module supports being imported in subinterpreters, even when they have " "their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:403 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:402 +#: ../../c-api/module.rst:406 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:405 +#: ../../c-api/module.rst:409 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:410 +#: ../../c-api/module.rst:414 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:413 +#: ../../c-api/module.rst:417 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:415 +#: ../../c-api/module.rst:419 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -480,14 +480,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:422 +#: ../../c-api/module.rst:426 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:430 +#: ../../c-api/module.rst:434 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -495,24 +495,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:437 +#: ../../c-api/module.rst:441 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:444 +#: ../../c-api/module.rst:448 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:454 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:459 +#: ../../c-api/module.rst:463 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -524,11 +524,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:471 +#: ../../c-api/module.rst:475 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:473 +#: ../../c-api/module.rst:477 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -536,82 +536,82 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:480 +#: ../../c-api/module.rst:484 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:483 +#: ../../c-api/module.rst:487 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:485 +#: ../../c-api/module.rst:489 msgid "" "Return ``NULL`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:488 ../../c-api/module.rst:537 +#: ../../c-api/module.rst:492 ../../c-api/module.rst:541 msgid "Example usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../c-api/module.rst:502 ../../c-api/module.rst:555 +#: ../../c-api/module.rst:506 ../../c-api/module.rst:559 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:514 ../../c-api/module.rst:571 +#: ../../c-api/module.rst:518 ../../c-api/module.rst:575 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:522 +#: ../../c-api/module.rst:526 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:525 +#: ../../c-api/module.rst:529 msgid "" "The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " "easy to introduce reference leaks by misusing the :c:func:" "`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:531 +#: ../../c-api/module.rst:535 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:534 +#: ../../c-api/module.rst:538 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:577 +#: ../../c-api/module.rst:581 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` on " "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:584 +#: ../../c-api/module.rst:588 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " "be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:591 +#: ../../c-api/module.rst:595 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -619,11 +619,11 @@ msgid "" "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:599 +#: ../../c-api/module.rst:603 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:607 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -631,25 +631,25 @@ msgid "" "``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:613 +#: ../../c-api/module.rst:617 msgid "Module lookup" msgstr "" -#: ../../c-api/module.rst:615 +#: ../../c-api/module.rst:619 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:619 +#: ../../c-api/module.rst:623 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:624 +#: ../../c-api/module.rst:628 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -658,18 +658,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:631 +#: ../../c-api/module.rst:635 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:634 +#: ../../c-api/module.rst:638 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:636 +#: ../../c-api/module.rst:640 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -680,15 +680,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:644 ../../c-api/module.rst:655 +#: ../../c-api/module.rst:648 ../../c-api/module.rst:659 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:646 +#: ../../c-api/module.rst:650 msgid "Return 0 on success or -1 on failure." msgstr "" -#: ../../c-api/module.rst:652 +#: ../../c-api/module.rst:656 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." diff --git a/c-api/unicode.po b/c-api/unicode.po index 4795cf2177..313c860031 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1538,7 +1538,7 @@ msgstr "" 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:macro:`CP_ACP` code page to get the MBCS encoder." +"c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" #: ../../c-api/unicode.rst:1308 diff --git a/extending/newtypes.po b/extending/newtypes.po index d352b52139..2ca6d500b7 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -307,7 +307,7 @@ msgstr "" #: ../../extending/newtypes.rst:301 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " -"with a :c:member:`~PyMethodDef.name` value of ``NULL`` is required." +"with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." msgstr "" #: ../../extending/newtypes.rst:315 diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index b28bcd6288..9af5fbe23a 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -230,56 +230,50 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:198 msgid "" "That's it! All that remains is to build it; put the above code in a file " -"called :file:`custom.c` and:" +"called :file:`custom.c`," msgstr "" -#: ../../extending/newtypes_tutorial.rst:207 +#: ../../extending/newtypes_tutorial.rst:203 +msgid "in a file called :file:`pyproject.toml`, and" +msgstr "" + +#: ../../extending/newtypes_tutorial.rst:210 msgid "in a file called :file:`setup.py`; then typing" msgstr "" -#: ../../extending/newtypes_tutorial.rst:213 +#: ../../extending/newtypes_tutorial.rst:216 msgid "" -"at a shell should produce a file :file:`custom.so` in a subdirectory; move " -"to that directory and fire up Python --- you should be able to ``import " -"custom`` and play around with Custom objects." +"in a shell should produce a file :file:`custom.so` in a subdirectory and " +"install it; now fire up Python --- you should be able to ``import custom`` " +"and play around with ``Custom`` objects." msgstr "" -#: ../../extending/newtypes_tutorial.rst:217 +#: ../../extending/newtypes_tutorial.rst:220 msgid "That wasn't so hard, was it?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:219 +#: ../../extending/newtypes_tutorial.rst:222 msgid "" "Of course, the current Custom type is pretty uninteresting. It has no data " "and doesn't do anything. It can't even be subclassed." msgstr "" -#: ../../extending/newtypes_tutorial.rst:223 -msgid "" -"While this documentation showcases the standard :mod:`!distutils` module for " -"building C extensions, it is recommended in real-world use cases to use the " -"newer and better-maintained ``setuptools`` library. Documentation on how to " -"do this is out of scope for this document and can be found in the `Python " -"Packaging User's Guide `_." -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:231 +#: ../../extending/newtypes_tutorial.rst:227 msgid "Adding data and methods to the Basic example" msgstr "" -#: ../../extending/newtypes_tutorial.rst:233 +#: ../../extending/newtypes_tutorial.rst:229 msgid "" "Let's extend the basic example to add some data and methods. Let's also " "make the type usable as a base class. We'll create a new module, :mod:`!" "custom2` that adds these capabilities:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:240 +#: ../../extending/newtypes_tutorial.rst:236 msgid "This version of the module has a number of changes." msgstr "" -#: ../../extending/newtypes_tutorial.rst:242 +#: ../../extending/newtypes_tutorial.rst:238 msgid "" "The :class:`!Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " @@ -287,21 +281,21 @@ msgid "" "integer." msgstr "" -#: ../../extending/newtypes_tutorial.rst:246 +#: ../../extending/newtypes_tutorial.rst:242 msgid "The object structure is updated accordingly::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:255 +#: ../../extending/newtypes_tutorial.rst:251 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:266 +#: ../../extending/newtypes_tutorial.rst:262 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:270 +#: ../../extending/newtypes_tutorial.rst:266 msgid "" "This method first clears the reference counts of the two Python attributes. :" "c:func:`Py_XDECREF` correctly handles the case where its argument is " @@ -312,7 +306,7 @@ msgid "" "an instance of a subclass." msgstr "" -#: ../../extending/newtypes_tutorial.rst:279 +#: ../../extending/newtypes_tutorial.rst:275 msgid "" "The explicit cast to ``destructor`` above is needed because we defined " "``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " @@ -321,17 +315,17 @@ msgid "" "oriented polymorphism, in C!" msgstr "" -#: ../../extending/newtypes_tutorial.rst:285 +#: ../../extending/newtypes_tutorial.rst:281 msgid "" "We want to make sure that the first and last names are initialized to empty " "strings, so we provide a ``tp_new`` implementation::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:309 +#: ../../extending/newtypes_tutorial.rst:305 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:313 +#: ../../extending/newtypes_tutorial.rst:309 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" @@ -342,7 +336,7 @@ msgid "" "``first`` and ``last`` attributes to non-``NULL`` default values." msgstr "" -#: ../../extending/newtypes_tutorial.rst:321 +#: ../../extending/newtypes_tutorial.rst:317 msgid "" "``tp_new`` is passed the type being instantiated (not necessarily " "``CustomType``, if a subclass is instantiated) and any arguments passed when " @@ -352,25 +346,25 @@ msgid "" "k.a. ``tp_init`` in C or ``__init__`` in Python) methods." msgstr "" -#: ../../extending/newtypes_tutorial.rst:329 +#: ../../extending/newtypes_tutorial.rst:325 msgid "" "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " "it itself." msgstr "" -#: ../../extending/newtypes_tutorial.rst:332 +#: ../../extending/newtypes_tutorial.rst:328 msgid "" "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " "slot to allocate memory::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:337 +#: ../../extending/newtypes_tutorial.rst:333 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." "tp_alloc` result against ``NULL`` before proceeding." msgstr "" -#: ../../extending/newtypes_tutorial.rst:341 +#: ../../extending/newtypes_tutorial.rst:337 msgid "" "We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " "Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " @@ -378,7 +372,7 @@ msgid "" "allocation strategy." msgstr "" -#: ../../extending/newtypes_tutorial.rst:347 +#: ../../extending/newtypes_tutorial.rst:343 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " "that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." @@ -391,17 +385,17 @@ msgid "" "subclasses without getting a :exc:`TypeError`.)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:357 +#: ../../extending/newtypes_tutorial.rst:353 msgid "" "We also define an initialization function which accepts arguments to provide " "initial values for our instance::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:386 +#: ../../extending/newtypes_tutorial.rst:382 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:390 +#: ../../extending/newtypes_tutorial.rst:386 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" "`~object.__init__` method. It is used to initialize an object after it's " @@ -409,7 +403,7 @@ msgid "" "they should return either ``0`` on success or ``-1`` on error." msgstr "" -#: ../../extending/newtypes_tutorial.rst:395 +#: ../../extending/newtypes_tutorial.rst:391 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " @@ -420,7 +414,7 @@ msgid "" "``first`` member like this::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:409 +#: ../../extending/newtypes_tutorial.rst:405 msgid "" "But this would be risky. Our type doesn't restrict the type of the " "``first`` member, so it could be any kind of object. It could have a " @@ -430,49 +424,49 @@ msgid "" "accesses and modifies our object." msgstr "" -#: ../../extending/newtypes_tutorial.rst:416 +#: ../../extending/newtypes_tutorial.rst:412 msgid "" "To be paranoid and protect ourselves against this possibility, we almost " "always reassign members before decrementing their reference counts. When " "don't we have to do this?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:420 +#: ../../extending/newtypes_tutorial.rst:416 msgid "when we absolutely know that the reference count is greater than 1;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:422 +#: ../../extending/newtypes_tutorial.rst:418 msgid "" "when we know that deallocation of the object [#]_ will neither release the :" "term:`GIL` nor cause any calls back into our type's code;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:425 +#: ../../extending/newtypes_tutorial.rst:421 msgid "" "when decrementing a reference count in a :c:member:`~PyTypeObject." "tp_dealloc` handler on a type which doesn't support cyclic garbage " "collection [#]_." msgstr "" -#: ../../extending/newtypes_tutorial.rst:428 +#: ../../extending/newtypes_tutorial.rst:424 msgid "" "We want to expose our instance variables as attributes. There are a number " "of ways to do that. The simplest way is to define member definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:441 +#: ../../extending/newtypes_tutorial.rst:437 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:445 +#: ../../extending/newtypes_tutorial.rst:441 msgid "" "Each member definition has a member name, type, offset, access flags and " "documentation string. See the :ref:`Generic-Attribute-Management` section " "below for details." msgstr "" -#: ../../extending/newtypes_tutorial.rst:449 +#: ../../extending/newtypes_tutorial.rst:445 msgid "" "A disadvantage of this approach is that it doesn't provide a way to restrict " "the types of objects that can be assigned to the Python attributes. We " @@ -483,13 +477,13 @@ msgid "" "deleted." msgstr "" -#: ../../extending/newtypes_tutorial.rst:456 +#: ../../extending/newtypes_tutorial.rst:452 msgid "" "We define a single method, :meth:`!Custom.name()`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:473 +#: ../../extending/newtypes_tutorial.rst:469 msgid "" "The method is implemented as a C function that takes a :class:`!Custom` (or :" "class:`!Custom` subclass) instance as the first argument. Methods always " @@ -499,7 +493,7 @@ msgid "" "method is equivalent to the Python method:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:485 +#: ../../extending/newtypes_tutorial.rst:481 msgid "" "Note that we have to check for the possibility that our :attr:`!first` and :" "attr:`!last` members are ``NULL``. This is because they can be deleted, in " @@ -508,23 +502,23 @@ msgid "" "We'll see how to do that in the next section." msgstr "" -#: ../../extending/newtypes_tutorial.rst:491 +#: ../../extending/newtypes_tutorial.rst:487 msgid "" "Now that we've defined the method, we need to create an array of method " "definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:501 +#: ../../extending/newtypes_tutorial.rst:497 msgid "" "(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " "method is expecting no arguments other than *self*)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:504 +#: ../../extending/newtypes_tutorial.rst:500 msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:508 +#: ../../extending/newtypes_tutorial.rst:504 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " @@ -532,15 +526,19 @@ msgid "" "to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:515 +#: ../../extending/newtypes_tutorial.rst:511 msgid "" "We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" -#: ../../extending/newtypes_tutorial.rst:519 -msgid "Finally, we update our :file:`setup.py` file to build the new module:" +#: ../../extending/newtypes_tutorial.rst:515 +msgid "Finally, we update our :file:`setup.py` file to include the new module," +msgstr "" + +#: ../../extending/newtypes_tutorial.rst:525 +msgid "and then we re-install so that we can ``import custom2``:" msgstr "" #: ../../extending/newtypes_tutorial.rst:532 diff --git a/faq/design.po b/faq/design.po index 4fd16d64f1..235df21366 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-02-18 13:10+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1025,16 +1025,16 @@ msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " "be better because an interface specification cannot test certain properties " -"of a program. For example, the :meth:`list.append` method is expected to " +"of a program. For example, the :meth:`!list.append` method is expected to " "add new elements to the end of some internal list; an interface " -"specification cannot test that your :meth:`list.append` implementation will " +"specification cannot test that your :meth:`!list.append` implementation will " "actually do this correctly, but it's trivial to check this property in a " "test suite." msgstr "" "就像介面規範一樣,一個適當的測試規則在建造大型又複雜的 Python 應用程式時可以" "幫上忙。事實上,他可能可以有更好的表現,因為介面規範無法測試程式的特定屬性。" -"舉例來說,:meth:`list.append` 方法應該要在某個內部的串列最後面加上新的元素," -"而介面規範沒辦法測試你的 :meth:`list.append` 是不是真的有正確的實作,但這在測" +"舉例來說,:meth:`!list.append` 方法應該要在某個內部的串列最後面加上新的元素," +"而介面規範沒辦法測試你的 :meth:`!list.append` 是不是真的有正確的實作,但這在測" "試套件裡是件很簡單的事。" #: ../../faq/design.rst:592 diff --git a/faq/library.po b/faq/library.po index 13cf2d4551..bc85469cc8 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-02-18 13:22+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -222,7 +222,7 @@ msgstr "Python 中是否有等同於 C 的 onexit() 的函式?" #, fuzzy msgid "" "The :mod:`atexit` module provides a register function that is similar to " -"C's :c:func:`onexit`." +"C's :c:func:`!onexit`." msgstr "" ":mod:`atexit` 模組提供了一個類似於 C 的 :c:func:`onexit` 的寄存器函式。" @@ -554,9 +554,9 @@ msgstr "" #, fuzzy msgid "" "Operations that replace other objects may invoke those other objects' :meth:" -"`__del__` method when their reference count reaches zero, and that can " -"affect things. This is especially true for the mass updates to dictionaries " -"and lists. When in doubt, use a mutex!" +"`~object.__del__` method when their reference count reaches zero, and that " +"can affect things. This is especially true for the mass updates to " +"dictionaries and lists. When in doubt, use a mutex!" msgstr "" "替換其他物件的操作可能會在引用計數達到零時呼叫其他物件的 :meth:`__del__` 方" "法,這可能會影響事情。對於字典和列表的大量更新尤其如此。如有疑問,請使用互斥" @@ -1031,32 +1031,33 @@ msgstr ":mod:`select` 模組通常用於幫助處理 socket 上的非同步 I/O #, fuzzy 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 " -"connect immediately (unlikely) or get an exception that contains the error " -"number as ``.errno``. ``errno.EINPROGRESS`` indicates that the connection is " -"in progress, but hasn't finished yet. Different OSes will return different " -"values, so you're going to have to check what's returned on your system." +"blocking mode. Then when you do the :meth:`~socket.socket.connect`, you " +"will either connect immediately (unlikely) or get an exception that contains " +"the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the " +"connection is in progress, but hasn't finished yet. Different OSes will " +"return different values, so you're going to have to check what's returned on " +"your system." msgstr "" "為防止 TCP 連接阻塞,可以將 socket 設定為非阻塞模式。然後當你執行 :meth:" "`socket.connect` 時,你要麼立即連接(不太可能),要麼得到一個例外,其中包含錯" "誤號 ``.errno``。 ``errno.EINPROGRESS`` 表示連接正在進行中,但尚未完成。不同" "的作業系統將回傳不同的值,因此你將不得不檢查系統回傳的內容。" -#: ../../faq/library.rst:774 +#: ../../faq/library.rst:775 #, fuzzy 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 :" -"meth:`socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` indicate " -"that you're connected -- or you can pass this socket to :meth:`select." -"select` to check if it's writable." +"You can use the :meth:`~socket.socket.connect_ex` method to avoid creating " +"an exception. It will just return the errno value. To poll, you can call :" +"meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` " +"indicate that you're connected -- or you can pass this socket to :meth:" +"`select.select` to check if it's writable." msgstr "" "你可以使用 :meth:`socket.connect_ex` 方法來避免建立例外。它只會回傳 errno " "值。要輪詢,你可以稍後再次呼叫:meth:`socket.connect_ex` - ``0`` 或 ``errno." "EISCONN`` 表示你已連接 - 或者你可以將此 socket 傳遞給:meth:` select." "select` 檢查它是否可寫。" -#: ../../faq/library.rst:780 +#: ../../faq/library.rst:783 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -1067,19 +1068,19 @@ msgstr "" "網路程式碼。第三方 `Twisted `_ 函式庫是一種流行且功能豐" "富的替代方案。" -#: ../../faq/library.rst:788 +#: ../../faq/library.rst:791 msgid "Databases" msgstr "資料庫" -#: ../../faq/library.rst:791 +#: ../../faq/library.rst:794 msgid "Are there any interfaces to database packages in Python?" msgstr "Python 中是否有任何資料庫套件的介面?" -#: ../../faq/library.rst:793 +#: ../../faq/library.rst:796 msgid "Yes." msgstr "有的。" -#: ../../faq/library.rst:795 +#: ../../faq/library.rst:798 #, fuzzy msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " @@ -1091,7 +1092,7 @@ msgstr "" "含在標準 Python 中。還有 :mod:`sqlite3` 模組,它提供了一個輕量級的基於磁盤的" "關係資料庫。" -#: ../../faq/library.rst:800 +#: ../../faq/library.rst:803 #, fuzzy msgid "" "Support for most relational databases is available. See the " @@ -1101,12 +1102,12 @@ msgstr "" "支援大多數關係資料庫。有關詳細資訊,請參閱`DatabaseProgramming 維基頁面 " "`_。" -#: ../../faq/library.rst:806 +#: ../../faq/library.rst:809 #, fuzzy msgid "How do you implement persistent objects in Python?" msgstr "你如何在 Python 中實作持久物件?" -#: ../../faq/library.rst:808 +#: ../../faq/library.rst:811 #, fuzzy msgid "" "The :mod:`pickle` library module solves this in a very general way (though " @@ -1118,15 +1119,15 @@ msgstr "" "如打開的檔案、socket 或窗口之類的東西),而 :mod:`shelve` 庫模組使用 pickle " "和 (g) dbm 建立包含任意 Python 物件的持久映射。" -#: ../../faq/library.rst:815 +#: ../../faq/library.rst:818 msgid "Mathematics and Numerics" msgstr "數學和數值" -#: ../../faq/library.rst:818 +#: ../../faq/library.rst:821 msgid "How do I generate random numbers in Python?" msgstr "如何在 Python 中生成隨機數?" -#: ../../faq/library.rst:820 +#: ../../faq/library.rst:823 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" @@ -1135,41 +1136,41 @@ msgstr "" "\n" "::" -#: ../../faq/library.rst:826 +#: ../../faq/library.rst:829 msgid "This returns a random floating point number in the range [0, 1)." msgstr "這將回傳 [0, 1) 範圍內的隨機浮點數。" -#: ../../faq/library.rst:828 +#: ../../faq/library.rst:831 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "該模組中還有許多其他專用生成器,例如:" -#: ../../faq/library.rst:830 +#: ../../faq/library.rst:833 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "``randrange(a, b)`` 會選擇 [a, b) 範圍內的一個整數。" -#: ../../faq/library.rst:831 +#: ../../faq/library.rst:834 msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." msgstr "``uniform(a, b)`` 會選擇 [a, b) 範圍內的浮點數。" -#: ../../faq/library.rst:832 +#: ../../faq/library.rst:835 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行採樣 (sample)。" -#: ../../faq/library.rst:834 +#: ../../faq/library.rst:837 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "一些更高階的函式會直接對序列進行操作,例如:" -#: ../../faq/library.rst:836 +#: ../../faq/library.rst:839 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "``choice(S)`` 會從給定序列中選擇一個隨機元素。" -#: ../../faq/library.rst:837 +#: ../../faq/library.rst:840 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "``shuffle(L)`` 會原地 (in-place) 打亂 list,即隨機排列它。" -#: ../../faq/library.rst:839 +#: ../../faq/library.rst:842 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/glossary.po b/glossary.po index a5b4f9f455..e3237f4157 100644 --- a/glossary.po +++ b/glossary.po @@ -2596,7 +2596,7 @@ msgid "" "continuation character, making them especially useful when writing " "docstrings." msgstr "" -"由三個雙引號 (“) 或單引號 (') 的作為邊界的一個字串。雖然它們並沒有提供異於單" +"由三個雙引號 (\") 或單引號 (') 的作為邊界的一個字串。雖然它們並沒有提供異於單" "引號字串的任何額外功能,但基於許多原因,它們仍是很有用的。它們讓你可以在字串" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index f6f7481fe9..4ed313d54e 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,8 +114,8 @@ msgstr "" msgid "" "Instead of focusing on per-interpreter state, Python's C API is evolving to " "better support the more granular *per-module* state. This means that C-level " -"data is be attached to a *module object*. Each interpreter creates its own " -"module object, keeping the data separate. For testing the isolation, " +"data should be attached to a *module object*. Each interpreter creates its " +"own module object, keeping the data separate. For testing the isolation, " "multiple module objects corresponding to a single extension can even be " "loaded in a single interpreter." msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po index 55115aa436..d20f916a8f 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-03 00:13+0000\n" +"POT-Creation-Date: 2023-08-25 00:03+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-" @@ -20,8 +20,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/pyporting.rst:5 -msgid "Porting Python 2 Code to Python 3" -msgstr "Python 2 的程式碼移植到Python 3" +msgid "How to port Python 2 Code to Python 3" +msgstr "如何將 Python 2 的程式碼移植到 Python 3" #: ../../howto/pyporting.rst:0 msgid "author" @@ -37,161 +37,144 @@ msgstr "摘要" #: ../../howto/pyporting.rst:11 msgid "" -"With Python 3 being the future of Python while Python 2 is still in active " -"use, it is good to have your project available for both major releases of " -"Python. This guide is meant to help you figure out how best to support both " -"Python 2 & 3 simultaneously." +"Python 2 reached its official end-of-life at the start of 2020. This means " +"that no new bug reports, fixes, or changes will be made to Python 2 - it's " +"no longer supported." msgstr "" -#: ../../howto/pyporting.rst:16 +#: ../../howto/pyporting.rst:15 msgid "" -"If you are looking to port an extension module instead of pure Python code, " -"please see :ref:`cporting-howto`." +"This guide is intended to provide you with a path to Python 3 for your code, " +"that includes compatibility with Python 2 as a first step." msgstr "" -#: ../../howto/pyporting.rst:19 +#: ../../howto/pyporting.rst:18 msgid "" -"If you would like to read one core Python developer's take on why Python 3 " -"came into existence, you can read Nick Coghlan's `Python 3 Q & A`_ or Brett " -"Cannon's `Why Python 3 exists`_." +"If you are looking to port an extension module instead of pure Python code, " +"please see :ref:`cporting-howto`." msgstr "" -#: ../../howto/pyporting.rst:24 +#: ../../howto/pyporting.rst:21 msgid "" -"For help with porting, you can view the archived python-porting_ mailing " -"list." +"The archived python-porting_ mailing list may contain some useful guidance." msgstr "" -#: ../../howto/pyporting.rst:27 +#: ../../howto/pyporting.rst:25 msgid "The Short Explanation" msgstr "簡短的說明" -#: ../../howto/pyporting.rst:29 +#: ../../howto/pyporting.rst:27 msgid "" -"To make your project be single-source Python 2/3 compatible, the basic steps " +"To achieve Python 2/3 compatibility in a single code base, the basic steps " "are:" msgstr "" -#: ../../howto/pyporting.rst:32 +#: ../../howto/pyporting.rst:30 msgid "Only worry about supporting Python 2.7" msgstr "" -#: ../../howto/pyporting.rst:33 +#: ../../howto/pyporting.rst:31 msgid "" "Make sure you have good test coverage (coverage.py_ can help; ``python -m " "pip install coverage``)" msgstr "" -#: ../../howto/pyporting.rst:35 ../../howto/pyporting.rst:122 -msgid "Learn the differences between Python 2 & 3" -msgstr "瞭解Python 2 & 3的差異" +#: ../../howto/pyporting.rst:33 +msgid "Learn the differences between Python 2 and 3" +msgstr "瞭解 Python 2 & 3 的差異" -#: ../../howto/pyporting.rst:36 +#: ../../howto/pyporting.rst:34 msgid "" "Use Futurize_ (or Modernize_) to update your code (e.g. ``python -m pip " "install future``)" msgstr "" -#: ../../howto/pyporting.rst:37 +#: ../../howto/pyporting.rst:35 msgid "" "Use Pylint_ to help make sure you don't regress on your Python 3 support " "(``python -m pip install pylint``)" msgstr "" -#: ../../howto/pyporting.rst:39 +#: ../../howto/pyporting.rst:37 msgid "" "Use caniusepython3_ to find out which of your dependencies are blocking your " "use of Python 3 (``python -m pip install caniusepython3``)" msgstr "" -#: ../../howto/pyporting.rst:41 +#: ../../howto/pyporting.rst:39 msgid "" "Once your dependencies are no longer blocking you, use continuous " -"integration to make sure you stay compatible with Python 2 & 3 (tox_ can " +"integration to make sure you stay compatible with Python 2 and 3 (tox_ can " "help test against multiple versions of Python; ``python -m pip install tox``)" msgstr "" -#: ../../howto/pyporting.rst:44 +#: ../../howto/pyporting.rst:42 msgid "" "Consider using optional static type checking to make sure your type usage " -"works in both Python 2 & 3 (e.g. use mypy_ to check your typing under both " -"Python 2 & Python 3; ``python -m pip install mypy``)." +"works in both Python 2 and 3 (e.g. use mypy_ to check your typing under both " +"Python 2 and Python 3; ``python -m pip install mypy``)." msgstr "" -#: ../../howto/pyporting.rst:50 +#: ../../howto/pyporting.rst:48 msgid "" "Note: Using ``python -m pip install`` guarantees that the ``pip`` you invoke " "is the one installed for the Python currently in use, whether it be a system-" "wide ``pip`` or one installed within a :ref:`virtual environment `." msgstr "" -#: ../../howto/pyporting.rst:56 +#: ../../howto/pyporting.rst:54 msgid "Details" msgstr "詳細的" -#: ../../howto/pyporting.rst:58 +#: ../../howto/pyporting.rst:56 msgid "" -"A key point about supporting Python 2 & 3 simultaneously is that you can " -"start **today**! Even if your dependencies are not supporting Python 3 yet " -"that does not mean you can't modernize your code **now** to support Python " -"3. Most changes required to support Python 3 lead to cleaner code using " -"newer practices even in Python 2 code." +"Even if other factors - say, dependencies over which you have no control - " +"still require you to support Python 2, that does not prevent you taking the " +"step of including Python 3 support." msgstr "" -#: ../../howto/pyporting.rst:64 +#: ../../howto/pyporting.rst:60 msgid "" -"Another key point is that modernizing your Python 2 code to also support " -"Python 3 is largely automated for you. While you might have to make some API " -"decisions thanks to Python 3 clarifying text data versus binary data, the " -"lower-level work is now mostly done for you and thus can at least benefit " -"from the automated changes immediately." +"Most changes required to support Python 3 lead to cleaner code using newer " +"practices even in Python 2 code." msgstr "" -#: ../../howto/pyporting.rst:70 -msgid "" -"Keep those key points in mind while you read on about the details of porting " -"your code to support Python 2 & 3 simultaneously." +#: ../../howto/pyporting.rst:65 +msgid "Different versions of Python 2" msgstr "" -#: ../../howto/pyporting.rst:75 -msgid "Drop support for Python 2.6 and older" -msgstr "向下支援Python 2.6和更舊的版本" +#: ../../howto/pyporting.rst:67 +msgid "" +"Ideally, your code should be compatible with Python 2.7, which was the last " +"supported version of Python 2." +msgstr "" -#: ../../howto/pyporting.rst:77 +#: ../../howto/pyporting.rst:70 msgid "" -"While you can make Python 2.5 work with Python 3, it is **much** easier if " -"you only have to work with Python 2.7. If dropping Python 2.5 is not an " -"option then the six_ project can help you support Python 2.5 & 3 " -"simultaneously (``python -m pip install six``). Do realize, though, that " -"nearly all the projects listed in this HOWTO will not be available to you." +"Some of the tools mentioned in this guide will not work with Python 2.6." msgstr "" -#: ../../howto/pyporting.rst:83 +#: ../../howto/pyporting.rst:72 msgid "" -"If you are able to skip Python 2.5 and older, then the required changes to " -"your code should continue to look and feel like idiomatic Python code. At " -"worst you will have to use a function instead of a method in some instances " -"or have to import a function instead of using a built-in one, but otherwise " -"the overall transformation should not feel foreign to you." +"If absolutely necessary, the six_ project can help you support Python 2.5 " +"and 3 simultaneously. Do realize, though, that nearly all the projects " +"listed in this guide will not be available to you." msgstr "" -#: ../../howto/pyporting.rst:89 +#: ../../howto/pyporting.rst:76 msgid "" -"But you should aim for only supporting Python 2.7. Python 2.6 is no longer " -"freely supported and thus is not receiving bugfixes. This means **you** will " -"have to work around any issues you come across with Python 2.6. There are " -"also some tools mentioned in this HOWTO which do not support Python 2.6 (e." -"g., Pylint_), and this will become more commonplace as time goes on. It will " -"simply be easier for you if you only support the versions of Python that you " -"have to support." +"If you are able to skip Python 2.5 and older, the required changes to your " +"code will be minimal. At worst you will have to use a function instead of a " +"method in some instances or have to import a function instead of using a " +"built-in one." msgstr "" -#: ../../howto/pyporting.rst:98 +#: ../../howto/pyporting.rst:83 msgid "" "Make sure you specify the proper version support in your ``setup.py`` file" msgstr "" -#: ../../howto/pyporting.rst:100 +#: ../../howto/pyporting.rst:85 msgid "" "In your ``setup.py`` file you should have the proper `trove classifier`_ " "specifying what versions of Python you support. As your project does not " @@ -201,11 +184,11 @@ msgid "" "Python :: 2.7``." msgstr "" -#: ../../howto/pyporting.rst:109 +#: ../../howto/pyporting.rst:94 msgid "Have good test coverage" msgstr "有好的測試覆蓋率" -#: ../../howto/pyporting.rst:111 +#: ../../howto/pyporting.rst:96 msgid "" "Once you have your code supporting the oldest version of Python 2 you want " "it to, you will want to make sure your test suite has good coverage. A good " @@ -217,88 +200,105 @@ msgid "" "test coverage then coverage.py_ is recommended." msgstr "" -#: ../../howto/pyporting.rst:124 +#: ../../howto/pyporting.rst:107 +msgid "Be aware of the differences between Python 2 and 3" +msgstr "注意 Python 2 & 3 的差異" + +#: ../../howto/pyporting.rst:109 msgid "" "Once you have your code well-tested you are ready to begin porting your code " "to Python 3! But to fully understand how your code is going to change and " "what you want to look out for while you code, you will want to learn what " -"changes Python 3 makes in terms of Python 2. Typically the two best ways of " -"doing that is reading the :ref:`\"What's New\" ` doc for " -"each release of Python 3 and the `Porting to Python 3`_ book (which is free " -"online). There is also a handy `cheat sheet`_ from the Python-Future project." +"changes Python 3 makes in terms of Python 2." +msgstr "" + +#: ../../howto/pyporting.rst:114 +msgid "" +"Some resources for understanding the differences and their implications for " +"you code:" +msgstr "" + +#: ../../howto/pyporting.rst:117 +msgid "" +"the :ref:`\"What's New\" ` doc for each release of Python 3" msgstr "" -#: ../../howto/pyporting.rst:134 +#: ../../howto/pyporting.rst:118 +msgid "the `Porting to Python 3`_ book (which is free online)" +msgstr "" + +#: ../../howto/pyporting.rst:119 +msgid "the handy `cheat sheet`_ from the Python-Future project." +msgstr "" + +#: ../../howto/pyporting.rst:123 msgid "Update your code" msgstr "更新你的程式碼" -#: ../../howto/pyporting.rst:136 +#: ../../howto/pyporting.rst:125 +msgid "There are tools available that can port your code automatically." +msgstr "" + +#: ../../howto/pyporting.rst:127 msgid "" -"Once you feel like you know what is different in Python 3 compared to Python " -"2, it's time to update your code! You have a choice between two tools in " -"porting your code automatically: Futurize_ and Modernize_. Which tool you " -"choose will depend on how much like Python 3 you want your code to be. " "Futurize_ does its best to make Python 3 idioms and practices exist in " "Python 2, e.g. backporting the ``bytes`` type from Python 3 so that you have " -"semantic parity between the major versions of Python. Modernize_, on the " -"other hand, is more conservative and targets a Python 2/3 subset of Python, " -"directly relying on six_ to help provide compatibility. As Python 3 is the " -"future, it might be best to consider Futurize to begin adjusting to any new " -"practices that Python 3 introduces which you are not accustomed to yet." +"semantic parity between the major versions of Python. This is the better " +"approach for most cases." msgstr "" -#: ../../howto/pyporting.rst:148 +#: ../../howto/pyporting.rst:132 msgid "" -"Regardless of which tool you choose, they will update your code to run under " -"Python 3 while staying compatible with the version of Python 2 you started " -"with. Depending on how conservative you want to be, you may want to run the " -"tool over your test suite first and visually inspect the diff to make sure " -"the transformation is accurate. After you have transformed your test suite " -"and verified that all the tests still pass as expected, then you can " -"transform your application code knowing that any tests which fail is a " -"translation failure." +"Modernize_, on the other hand, is more conservative and targets a Python 2/3 " +"subset of Python, directly relying on six_ to help provide compatibility." msgstr "" -#: ../../howto/pyporting.rst:156 +#: ../../howto/pyporting.rst:135 +msgid "" +"A good approach is to run the tool over your test suite first and visually " +"inspect the diff to make sure the transformation is accurate. After you have " +"transformed your test suite and verified that all the tests still pass as " +"expected, then you can transform your application code knowing that any " +"tests which fail is a translation failure." +msgstr "" + +#: ../../howto/pyporting.rst:141 msgid "" "Unfortunately the tools can't automate everything to make your code work " -"under Python 3 and so there are a handful of things you will need to update " -"manually to get full Python 3 support (which of these steps are necessary " -"vary between the tools). Read the documentation for the tool you choose to " -"use to see what it fixes by default and what it can do optionally to know " -"what will (not) be fixed for you and what you may have to fix on your own (e." -"g. using ``io.open()`` over the built-in ``open()`` function is off by " -"default in Modernize). Luckily, though, there are only a couple of things to " -"watch out for which can be considered large issues that may be hard to debug " -"if not watched for." -msgstr "" - -#: ../../howto/pyporting.rst:168 +"under Python 3, and you will also need to read the tools' documentation in " +"case some options you need are turned off by default." +msgstr "" + +#: ../../howto/pyporting.rst:145 +msgid "Key issues to be aware of and check for:" +msgstr "" + +#: ../../howto/pyporting.rst:148 msgid "Division" msgstr "" -#: ../../howto/pyporting.rst:170 +#: ../../howto/pyporting.rst:150 msgid "" -"In Python 3, ``5 / 2 == 2.5`` and not ``2``; all division between ``int`` " -"values result in a ``float``. This change has actually been planned since " -"Python 2.2 which was released in 2002. Since then users have been encouraged " -"to add ``from __future__ import division`` to any and all files which use " -"the ``/`` and ``//`` operators or to be running the interpreter with the ``-" -"Q`` flag. If you have not been doing this then you will need to go through " -"your code and do two things:" +"In Python 3, ``5 / 2 == 2.5`` and not ``2`` as it was in Python 2; all " +"division between ``int`` values result in a ``float``. This change has " +"actually been planned since Python 2.2 which was released in 2002. Since " +"then users have been encouraged to add ``from __future__ import division`` " +"to any and all files which use the ``/`` and ``//`` operators or to be " +"running the interpreter with the ``-Q`` flag. If you have not been doing " +"this then you will need to go through your code and do two things:" msgstr "" -#: ../../howto/pyporting.rst:178 +#: ../../howto/pyporting.rst:158 msgid "Add ``from __future__ import division`` to your files" msgstr "" -#: ../../howto/pyporting.rst:179 +#: ../../howto/pyporting.rst:159 msgid "" "Update any division operator as necessary to either use ``//`` to use floor " "division or continue using ``/`` and expect a float" msgstr "" -#: ../../howto/pyporting.rst:182 +#: ../../howto/pyporting.rst:162 msgid "" "The reason that ``/`` isn't simply translated to ``//`` automatically is " "that if an object defines a ``__truediv__`` method but not ``__floordiv__`` " @@ -306,11 +306,11 @@ msgid "" "`` to signify some operation but not ``//`` for the same thing or at all)." msgstr "" -#: ../../howto/pyporting.rst:189 +#: ../../howto/pyporting.rst:169 msgid "Text versus binary data" msgstr "" -#: ../../howto/pyporting.rst:191 +#: ../../howto/pyporting.rst:171 msgid "" "In Python 2 you could use the ``str`` type for both text and binary data. " "Unfortunately this confluence of two different concepts could lead to " @@ -322,71 +322,73 @@ msgid "" "``unicode`` when they claimed text data support." msgstr "" -#: ../../howto/pyporting.rst:200 +#: ../../howto/pyporting.rst:180 msgid "" -"To make the distinction between text and binary data clearer and more " -"pronounced, Python 3 did what most languages created in the age of the " -"internet have done and made text and binary data distinct types that cannot " -"blindly be mixed together (Python predates widespread access to the " -"internet). For any code that deals only with text or only binary data, this " -"separation doesn't pose an issue. But for code that has to deal with both, " -"it does mean you might have to now care about when you are using text " +"Python 3 made text and binary data distinct types that cannot simply be " +"mixed together. For any code that deals only with text or only binary data, " +"this separation doesn't pose an issue. But for code that has to deal with " +"both, it does mean you might have to now care about when you are using text " "compared to binary data, which is why this cannot be entirely automated." msgstr "" -#: ../../howto/pyporting.rst:209 +#: ../../howto/pyporting.rst:186 msgid "" -"To start, you will need to decide which APIs take text and which take binary " -"(it is **highly** recommended you don't design APIs that can take both due " -"to the difficulty of keeping the code working; as stated earlier it is " -"difficult to do well). In Python 2 this means making sure the APIs that take " -"text can work with ``unicode`` and those that work with binary data work " -"with the ``bytes`` type from Python 3 (which is a subset of ``str`` in " -"Python 2 and acts as an alias for ``bytes`` type in Python 2). Usually the " -"biggest issue is realizing which methods exist on which types in Python 2 & " -"3 simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " +"Decide which APIs take text and which take binary (it is **highly** " +"recommended you don't design APIs that can take both due to the difficulty " +"of keeping the code working; as stated earlier it is difficult to do well). " +"In Python 2 this means making sure the APIs that take text can work with " +"``unicode`` and those that work with binary data work with the ``bytes`` " +"type from Python 3 (which is a subset of ``str`` in Python 2 and acts as an " +"alias for ``bytes`` type in Python 2). Usually the biggest issue is " +"realizing which methods exist on which types in Python 2 and 3 " +"simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " "Python 3, for binary that's ``str``/``bytes`` in Python 2 and ``bytes`` in " -"Python 3). The following table lists the **unique** methods of each data " -"type across Python 2 & 3 (e.g., the ``decode()`` method is usable on the " -"equivalent binary data type in either Python 2 or 3, but it can't be used by " -"the textual data type consistently between Python 2 and 3 because ``str`` in " +"Python 3)." +msgstr "" + +#: ../../howto/pyporting.rst:197 +msgid "" +"The following table lists the **unique** methods of each data type across " +"Python 2 and 3 (e.g., the ``decode()`` method is usable on the equivalent " +"binary data type in either Python 2 or 3, but it can't be used by the " +"textual data type consistently between Python 2 and 3 because ``str`` in " "Python 3 doesn't have the method). Do note that as of Python 3.5 the " "``__mod__`` method was added to the bytes type." msgstr "" -#: ../../howto/pyporting.rst:226 +#: ../../howto/pyporting.rst:205 msgid "**Text data**" msgstr "" -#: ../../howto/pyporting.rst:226 +#: ../../howto/pyporting.rst:205 msgid "**Binary data**" msgstr "" -#: ../../howto/pyporting.rst:228 +#: ../../howto/pyporting.rst:207 msgid "\\" msgstr "\\" -#: ../../howto/pyporting.rst:228 +#: ../../howto/pyporting.rst:207 msgid "decode" msgstr "" -#: ../../howto/pyporting.rst:230 +#: ../../howto/pyporting.rst:209 msgid "encode" msgstr "" -#: ../../howto/pyporting.rst:232 +#: ../../howto/pyporting.rst:211 msgid "format" msgstr "" -#: ../../howto/pyporting.rst:234 +#: ../../howto/pyporting.rst:213 msgid "isdecimal" msgstr "isdecimal" -#: ../../howto/pyporting.rst:236 +#: ../../howto/pyporting.rst:215 msgid "isnumeric" msgstr "isnumeric" -#: ../../howto/pyporting.rst:239 +#: ../../howto/pyporting.rst:218 msgid "" "Making the distinction easier to handle can be accomplished by encoding and " "decoding between binary data and text at the edge of your code. This means " @@ -396,20 +398,19 @@ msgid "" "eliminates having to keep track of what type of data you are working with." msgstr "" -#: ../../howto/pyporting.rst:246 +#: ../../howto/pyporting.rst:225 msgid "" "The next issue is making sure you know whether the string literals in your " "code represent text or binary data. You should add a ``b`` prefix to any " "literal that presents binary data. For text you should add a ``u`` prefix to " -"the text literal. (there is a :mod:`__future__` import to force all " +"the text literal. (There is a :mod:`__future__` import to force all " "unspecified literals to be Unicode, but usage has shown it isn't as " "effective as adding a ``b`` or ``u`` prefix to all literals explicitly)" msgstr "" -#: ../../howto/pyporting.rst:253 +#: ../../howto/pyporting.rst:232 msgid "" -"As part of this dichotomy you also need to be careful about opening files. " -"Unless you have been working on Windows, there is a chance you have not " +"You also need to be careful about opening files. Possibly you have not " "always bothered to add the ``b`` mode when opening a binary file (e.g., " "``rb`` for binary reading). Under Python 3, binary files and text files are " "clearly distinct and mutually incompatible; see the :mod:`io` module for " @@ -424,20 +425,20 @@ msgid "" "2.5." msgstr "" -#: ../../howto/pyporting.rst:267 +#: ../../howto/pyporting.rst:245 msgid "" "The constructors of both ``str`` and ``bytes`` have different semantics for " -"the same arguments between Python 2 & 3. Passing an integer to ``bytes`` in " -"Python 2 will give you the string representation of the integer: ``bytes(3) " -"== '3'``. But in Python 3, an integer argument to ``bytes`` will give you a " -"bytes object as long as the integer specified, filled with null bytes: " -"``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " +"the same arguments between Python 2 and 3. Passing an integer to ``bytes`` " +"in Python 2 will give you the string representation of the integer: " +"``bytes(3) == '3'``. But in Python 3, an integer argument to ``bytes`` will " +"give you a bytes object as long as the integer specified, filled with null " +"bytes: ``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " "passing a bytes object to ``str``. In Python 2 you just get the bytes object " "back: ``str(b'3') == b'3'``. But in Python 3 you get the string " "representation of the bytes object: ``str(b'3') == \"b'3'\"``." msgstr "" -#: ../../howto/pyporting.rst:277 +#: ../../howto/pyporting.rst:255 msgid "" "Finally, the indexing of binary data requires careful handling (slicing does " "**not** require any special handling). In Python 2, ``b'123'[1] == b'2'`` " @@ -449,48 +450,48 @@ msgid "" "indexbytes(b'123', 1)``." msgstr "" -#: ../../howto/pyporting.rst:286 +#: ../../howto/pyporting.rst:264 msgid "To summarize:" msgstr "" -#: ../../howto/pyporting.rst:288 +#: ../../howto/pyporting.rst:266 msgid "Decide which of your APIs take text and which take binary data" msgstr "" -#: ../../howto/pyporting.rst:289 +#: ../../howto/pyporting.rst:267 msgid "" "Make sure that your code that works with text also works with ``unicode`` " "and code for binary data works with ``bytes`` in Python 2 (see the table " "above for what methods you cannot use for each type)" msgstr "" -#: ../../howto/pyporting.rst:292 +#: ../../howto/pyporting.rst:270 msgid "" "Mark all binary literals with a ``b`` prefix, textual literals with a ``u`` " "prefix" msgstr "" -#: ../../howto/pyporting.rst:294 +#: ../../howto/pyporting.rst:272 msgid "" "Decode binary data to text as soon as possible, encode text as binary data " "as late as possible" msgstr "" -#: ../../howto/pyporting.rst:296 +#: ../../howto/pyporting.rst:274 msgid "" "Open files using :func:`io.open` and make sure to specify the ``b`` mode " "when appropriate" msgstr "" -#: ../../howto/pyporting.rst:298 +#: ../../howto/pyporting.rst:276 msgid "Be careful when indexing into binary data" msgstr "" -#: ../../howto/pyporting.rst:302 +#: ../../howto/pyporting.rst:280 msgid "Use feature detection instead of version detection" msgstr "" -#: ../../howto/pyporting.rst:304 +#: ../../howto/pyporting.rst:282 msgid "" "Inevitably you will have code that has to choose what to do based on what " "version of Python is running. The best way to do this is with feature " @@ -500,7 +501,7 @@ msgid "" "let's look at an example." msgstr "" -#: ../../howto/pyporting.rst:311 +#: ../../howto/pyporting.rst:289 msgid "" "Let's pretend that you need access to a feature of :mod:`importlib` that is " "available in Python's standard library since Python 3.3 and available for " @@ -508,7 +509,7 @@ msgid "" "access e.g. the :mod:`importlib.abc` module by doing the following::" msgstr "" -#: ../../howto/pyporting.rst:323 +#: ../../howto/pyporting.rst:301 msgid "" "The problem with this code is what happens when Python 4 comes out? It would " "be better to treat Python 2 as the exceptional case instead of Python 3 and " @@ -516,18 +517,18 @@ msgid "" "than Python 2::" msgstr "" -#: ../../howto/pyporting.rst:335 +#: ../../howto/pyporting.rst:313 msgid "" "The best solution, though, is to do no version detection at all and instead " "rely on feature detection. That avoids any potential issues of getting the " "version detection wrong and helps keep you future-compatible::" msgstr "" -#: ../../howto/pyporting.rst:346 +#: ../../howto/pyporting.rst:324 msgid "Prevent compatibility regressions" msgstr "" -#: ../../howto/pyporting.rst:348 +#: ../../howto/pyporting.rst:326 msgid "" "Once you have fully translated your code to be compatible with Python 3, you " "will want to make sure your code doesn't regress and stop working under " @@ -535,13 +536,13 @@ msgid "" "you from actually running under Python 3 at the moment." msgstr "" -#: ../../howto/pyporting.rst:353 +#: ../../howto/pyporting.rst:331 msgid "" "To help with staying compatible, any new modules you create should have at " "least the following block of code at the top of it::" msgstr "" -#: ../../howto/pyporting.rst:360 +#: ../../howto/pyporting.rst:338 msgid "" "You can also run Python 2 with the ``-3`` flag to be warned about various " "compatibility issues your code triggers during execution. If you turn " @@ -549,7 +550,7 @@ msgid "" "accidentally miss a warning." msgstr "" -#: ../../howto/pyporting.rst:365 +#: ../../howto/pyporting.rst:343 msgid "" "You can also use the Pylint_ project and its ``--py3k`` flag to lint your " "code to receive warnings when your code begins to deviate from Python 3 " @@ -559,11 +560,11 @@ msgid "" "Pylint's minimum Python version support." msgstr "" -#: ../../howto/pyporting.rst:374 +#: ../../howto/pyporting.rst:352 msgid "Check which dependencies block your transition" msgstr "" -#: ../../howto/pyporting.rst:376 +#: ../../howto/pyporting.rst:354 msgid "" "**After** you have made your code compatible with Python 3 you should begin " "to care about whether your dependencies have also been ported. The " @@ -573,7 +574,7 @@ msgid "" "caniusepython3.com." msgstr "" -#: ../../howto/pyporting.rst:383 +#: ../../howto/pyporting.rst:361 msgid "" "The project also provides code which you can integrate into your test suite " "so that you will have a failing test when you no longer have dependencies " @@ -582,11 +583,11 @@ msgid "" "start running on Python 3." msgstr "" -#: ../../howto/pyporting.rst:390 +#: ../../howto/pyporting.rst:368 msgid "Update your ``setup.py`` file to denote Python 3 compatibility" msgstr "" -#: ../../howto/pyporting.rst:392 +#: ../../howto/pyporting.rst:370 msgid "" "Once your code works under Python 3, you should update the classifiers in " "your ``setup.py`` to contain ``Programming Language :: Python :: 3`` and to " @@ -595,20 +596,20 @@ msgid "" "classifiers for each major/minor version of Python you now support." msgstr "" -#: ../../howto/pyporting.rst:400 +#: ../../howto/pyporting.rst:378 msgid "Use continuous integration to stay compatible" msgstr "" -#: ../../howto/pyporting.rst:402 +#: ../../howto/pyporting.rst:380 msgid "" "Once you are able to fully run under Python 3 you will want to make sure " -"your code always works under both Python 2 & 3. Probably the best tool for " +"your code always works under both Python 2 and 3. Probably the best tool for " "running your tests under multiple Python interpreters is tox_. You can then " "integrate tox with your continuous integration system so that you never " "accidentally break Python 2 or 3 support." msgstr "" -#: ../../howto/pyporting.rst:408 +#: ../../howto/pyporting.rst:386 msgid "" "You may also want to use the ``-bb`` flag with the Python 3 interpreter to " "trigger an exception when you are comparing bytes to strings or bytes to an " @@ -620,19 +621,11 @@ msgid "" "down." msgstr "" -#: ../../howto/pyporting.rst:416 -msgid "" -"And that's mostly it! At this point your code base is compatible with both " -"Python 2 and 3 simultaneously. Your testing will also be set up so that you " -"don't accidentally break Python 2 or 3 compatibility regardless of which " -"version you typically run your tests under while developing." -msgstr "" - -#: ../../howto/pyporting.rst:423 +#: ../../howto/pyporting.rst:396 msgid "Consider using optional static type checking" msgstr "" -#: ../../howto/pyporting.rst:425 +#: ../../howto/pyporting.rst:398 msgid "" "Another way to help port your code is to use a static type checker like " "mypy_ or pytype_ on your code. These tools can be used to analyze your code " diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 27f0911772..7509085757 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,10 +187,8 @@ msgstr "" "::" #: ../../library/asyncio-dev.rst:102 -msgid "" -"To handle signals and to execute subprocesses, the event loop must be run in " -"the main thread." -msgstr "為了能夠處理訊號和執行子行程,事件迴圈必須於主執行緒中運行。" +msgid "To handle signals the event loop must be run in the main thread." +msgstr "為了能夠處理訊號,事件迴圈必須於主執行緒中運行。" #: ../../library/asyncio-dev.rst:105 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 7bb353e610..372e08e38e 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,7 +259,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:176 #: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1642 +#: ../../library/asyncio-eventloop.rst:1643 msgid "Example::" msgstr "" "範例:\n" @@ -1026,8 +1026,8 @@ msgid "" "option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 " -":py:const:`~socket.TCP_NODELAY` socket 選項。" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" +"py:const:`~socket.TCP_NODELAY` socket 選項。" #: ../../library/asyncio-eventloop.rst:768 msgid "" @@ -1787,64 +1787,70 @@ msgid "*stdin* can be any of these:" msgstr "" #: ../../library/asyncio-eventloop.rst:1444 -#: ../../library/asyncio-eventloop.rst:1454 -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1455 +#: ../../library/asyncio-eventloop.rst:1465 msgid "a file-like object" msgstr "" #: ../../library/asyncio-eventloop.rst:1445 -#: ../../library/asyncio-eventloop.rst:1455 -#: ../../library/asyncio-eventloop.rst:1465 +msgid "" +"an existing file descriptor (a positive integer), for example those created " +"with :meth:`os.pipe()`" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1446 +#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1466 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1447 -#: ../../library/asyncio-eventloop.rst:1457 -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1458 +#: ../../library/asyncio-eventloop.rst:1468 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1449 -#: ../../library/asyncio-eventloop.rst:1459 -#: ../../library/asyncio-eventloop.rst:1469 +#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1453 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1462 +#: ../../library/asyncio-eventloop.rst:1463 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1472 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1475 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1480 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1852,52 +1858,52 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1489 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1491 +#: ../../library/asyncio-eventloop.rst:1492 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1505 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1511 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1514 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1907,116 +1913,116 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1528 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1532 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1537 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1544 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1549 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1555 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1558 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1561 +#: ../../library/asyncio-eventloop.rst:1562 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1564 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1571 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1572 +#: ../../library/asyncio-eventloop.rst:1573 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1576 +#: ../../library/asyncio-eventloop.rst:1577 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1581 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1593 +#: ../../library/asyncio-eventloop.rst:1594 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1602 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1604 +#: ../../library/asyncio-eventloop.rst:1605 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1608 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1612 +#: ../../library/asyncio-eventloop.rst:1613 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1618 +#: ../../library/asyncio-eventloop.rst:1619 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1623 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2025,98 +2031,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1639 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1660 +#: ../../library/asyncio-eventloop.rst:1661 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1666 +#: ../../library/asyncio-eventloop.rst:1667 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1670 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1673 +#: ../../library/asyncio-eventloop.rst:1674 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1684 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1686 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1688 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1695 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1696 +#: ../../library/asyncio-eventloop.rst:1697 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1711 +#: ../../library/asyncio-eventloop.rst:1712 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1716 +#: ../../library/asyncio-eventloop.rst:1717 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1718 +#: ../../library/asyncio-eventloop.rst:1719 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1722 +#: ../../library/asyncio-eventloop.rst:1723 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1728 +#: ../../library/asyncio-eventloop.rst:1729 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1730 +#: ../../library/asyncio-eventloop.rst:1731 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1737 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1738 +#: ../../library/asyncio-eventloop.rst:1739 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2124,70 +2130,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1748 +#: ../../library/asyncio-eventloop.rst:1749 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1750 +#: ../../library/asyncio-eventloop.rst:1751 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1774 +#: ../../library/asyncio-eventloop.rst:1775 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1781 +#: ../../library/asyncio-eventloop.rst:1782 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1783 +#: ../../library/asyncio-eventloop.rst:1784 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1811 +#: ../../library/asyncio-eventloop.rst:1812 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1818 +#: ../../library/asyncio-eventloop.rst:1819 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1820 +#: ../../library/asyncio-eventloop.rst:1821 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1858 +#: ../../library/asyncio-eventloop.rst:1859 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1862 +#: ../../library/asyncio-eventloop.rst:1863 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1870 +#: ../../library/asyncio-eventloop.rst:1871 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1872 +#: ../../library/asyncio-eventloop.rst:1873 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1874 +#: ../../library/asyncio-eventloop.rst:1875 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/calendar.po b/library/calendar.po index 55370dc52a..b4e689ca0d 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-08-18 15:42+0800\n" +"POT-Creation-Date: 2023-08-26 00:03+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-" "tw)\n" @@ -490,20 +490,44 @@ msgid "" "Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:476 +#: ../../library/calendar.rst:473 +msgid "The :mod:`calendar` module defines the following exceptions:" +msgstr "" + +#: ../../library/calendar.rst:477 +msgid "" +"A subclass of :exc:`ValueError`, raised when the given month number is " +"outside of the range 1-12 (inclusive)." +msgstr "" + +#: ../../library/calendar.rst:482 +msgid "The invalid month number." +msgstr "" + +#: ../../library/calendar.rst:487 +msgid "" +"A subclass of :exc:`ValueError`, raised when the given weekday number is " +"outside of the range 0-6 (inclusive)." +msgstr "" + +#: ../../library/calendar.rst:492 +msgid "The invalid weekday number." +msgstr "" + +#: ../../library/calendar.rst:499 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:475 +#: ../../library/calendar.rst:498 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:478 +#: ../../library/calendar.rst:501 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:479 +#: ../../library/calendar.rst:502 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" diff --git a/library/dataclasses.po b/library/dataclasses.po index adf66b1e07..4bd6371f89 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-24 00:03+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -960,7 +960,7 @@ msgstr "" msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " -"must use :meth:`~object.__setattr__`." +"must use :meth:`!object.__setattr__`." msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" diff --git a/library/datetime.po b/library/datetime.po index ae93d210f7..a61def35c8 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,49 +38,53 @@ msgid "" "is on efficient attribute extraction for output formatting and manipulation." msgstr "" -#: ../../library/datetime.rst:25 +#: ../../library/datetime.rst:24 +msgid "Skip to :ref:`the format codes `." +msgstr "" + +#: ../../library/datetime.rst:29 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/datetime.rst:25 +#: ../../library/datetime.rst:29 msgid "General calendar related functions." msgstr "" -#: ../../library/datetime.rst:28 +#: ../../library/datetime.rst:32 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/datetime.rst:28 +#: ../../library/datetime.rst:32 msgid "Time access and conversions." msgstr "" -#: ../../library/datetime.rst:31 +#: ../../library/datetime.rst:35 msgid "Module :mod:`zoneinfo`" msgstr ":mod:`zoneinfo` 模組" -#: ../../library/datetime.rst:31 +#: ../../library/datetime.rst:35 msgid "Concrete time zones representing the IANA time zone database." msgstr "" -#: ../../library/datetime.rst:33 +#: ../../library/datetime.rst:37 msgid "Package `dateutil `_" msgstr "" -#: ../../library/datetime.rst:34 +#: ../../library/datetime.rst:38 msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:39 +#: ../../library/datetime.rst:43 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:41 +#: ../../library/datetime.rst:45 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:44 +#: ../../library/datetime.rst:48 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -89,7 +93,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:50 +#: ../../library/datetime.rst:54 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -100,7 +104,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:57 +#: ../../library/datetime.rst:61 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -110,7 +114,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:63 +#: ../../library/datetime.rst:67 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -121,42 +125,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:72 +#: ../../library/datetime.rst:76 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:74 +#: ../../library/datetime.rst:78 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:78 +#: ../../library/datetime.rst:82 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:84 +#: ../../library/datetime.rst:88 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:89 +#: ../../library/datetime.rst:93 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:94 +#: ../../library/datetime.rst:98 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:99 +#: ../../library/datetime.rst:103 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:107 +#: ../../library/datetime.rst:111 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -164,14 +168,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:116 +#: ../../library/datetime.rst:120 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:124 +#: ../../library/datetime.rst:128 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -179,7 +183,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:131 +#: ../../library/datetime.rst:135 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -187,158 +191,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:139 +#: ../../library/datetime.rst:143 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:144 ../../library/datetime.rst:162 +#: ../../library/datetime.rst:148 ../../library/datetime.rst:166 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:146 +#: ../../library/datetime.rst:150 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:157 +#: ../../library/datetime.rst:161 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:159 +#: ../../library/datetime.rst:163 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:167 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:165 +#: ../../library/datetime.rst:169 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:168 +#: ../../library/datetime.rst:172 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:170 +#: ../../library/datetime.rst:174 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:176 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:178 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:180 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:177 +#: ../../library/datetime.rst:181 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:179 +#: ../../library/datetime.rst:183 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:185 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:183 +#: ../../library/datetime.rst:187 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:184 +#: ../../library/datetime.rst:188 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:186 +#: ../../library/datetime.rst:190 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:188 +#: ../../library/datetime.rst:192 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:194 +#: ../../library/datetime.rst:198 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:196 +#: ../../library/datetime.rst:200 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:201 +#: ../../library/datetime.rst:205 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:204 +#: ../../library/datetime.rst:208 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:207 +#: ../../library/datetime.rst:211 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:212 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:209 +#: ../../library/datetime.rst:213 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:210 +#: ../../library/datetime.rst:214 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:216 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:215 +#: ../../library/datetime.rst:219 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:220 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:217 +#: ../../library/datetime.rst:221 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:223 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:237 +#: ../../library/datetime.rst:241 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -347,281 +351,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:244 +#: ../../library/datetime.rst:248 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:247 +#: ../../library/datetime.rst:251 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:256 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1065 ../../library/datetime.rst:1684 -#: ../../library/datetime.rst:2286 +#: ../../library/datetime.rst:260 ../../library/datetime.rst:556 +#: ../../library/datetime.rst:1069 ../../library/datetime.rst:1688 +#: ../../library/datetime.rst:2290 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:260 +#: ../../library/datetime.rst:264 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:265 +#: ../../library/datetime.rst:269 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:275 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:274 +#: ../../library/datetime.rst:278 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:277 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1085 ../../library/datetime.rst:1704 +#: ../../library/datetime.rst:281 ../../library/datetime.rst:574 +#: ../../library/datetime.rst:1089 ../../library/datetime.rst:1708 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:280 +#: ../../library/datetime.rst:284 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:280 +#: ../../library/datetime.rst:284 msgid "Value" msgstr "" -#: ../../library/datetime.rst:282 +#: ../../library/datetime.rst:286 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:282 +#: ../../library/datetime.rst:286 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:289 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1138 +#: ../../library/datetime.rst:293 ../../library/datetime.rst:591 +#: ../../library/datetime.rst:1142 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 +#: ../../library/datetime.rst:1145 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 +#: ../../library/datetime.rst:1145 msgid "Result" msgstr "" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:300 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:300 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:299 +#: ../../library/datetime.rst:303 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:299 +#: ../../library/datetime.rst:303 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:310 +#: ../../library/datetime.rst:314 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:310 +#: ../../library/datetime.rst:314 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:333 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:333 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:338 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:338 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:341 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:341 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:346 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:346 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:349 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:349 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:355 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:359 ../../library/datetime.rst:608 +#: ../../library/datetime.rst:2521 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:358 +#: ../../library/datetime.rst:362 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:361 +#: ../../library/datetime.rst:365 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:368 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:367 +#: ../../library/datetime.rst:371 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:370 +#: ../../library/datetime.rst:374 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:380 +#: ../../library/datetime.rst:384 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:384 +#: ../../library/datetime.rst:388 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:392 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -629,119 +633,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:395 +#: ../../library/datetime.rst:399 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:397 +#: ../../library/datetime.rst:401 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:408 +#: ../../library/datetime.rst:412 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:419 +#: ../../library/datetime.rst:423 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:422 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1212 ../../library/datetime.rst:1812 +#: ../../library/datetime.rst:426 ../../library/datetime.rst:637 +#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1816 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:426 +#: ../../library/datetime.rst:430 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:434 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:436 +#: ../../library/datetime.rst:440 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:438 +#: ../../library/datetime.rst:442 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:450 +#: ../../library/datetime.rst:454 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:469 +#: ../../library/datetime.rst:473 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:471 +#: ../../library/datetime.rst:475 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:479 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:480 +#: ../../library/datetime.rst:484 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:483 +#: ../../library/datetime.rst:487 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:484 +#: ../../library/datetime.rst:488 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:485 +#: ../../library/datetime.rst:489 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:487 ../../library/datetime.rst:848 +#: ../../library/datetime.rst:491 ../../library/datetime.rst:852 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:490 ../../library/datetime.rst:853 +#: ../../library/datetime.rst:494 ../../library/datetime.rst:857 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:494 +#: ../../library/datetime.rst:498 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:496 +#: ../../library/datetime.rst:500 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:504 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:503 +#: ../../library/datetime.rst:507 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -751,7 +755,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:510 +#: ../../library/datetime.rst:514 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -759,96 +763,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:519 +#: ../../library/datetime.rst:523 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:522 +#: ../../library/datetime.rst:526 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:529 +#: ../../library/datetime.rst:533 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:541 +#: ../../library/datetime.rst:545 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:546 +#: ../../library/datetime.rst:550 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:556 +#: ../../library/datetime.rst:560 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:561 +#: ../../library/datetime.rst:565 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:566 +#: ../../library/datetime.rst:570 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1089 +#: ../../library/datetime.rst:578 ../../library/datetime.rst:1093 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1094 +#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1099 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:596 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:596 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:599 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:599 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:598 +#: ../../library/datetime.rst:602 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1147 +#: ../../library/datetime.rst:602 ../../library/datetime.rst:1151 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:604 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:604 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:607 +#: ../../library/datetime.rst:611 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -857,17 +861,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:614 +#: ../../library/datetime.rst:618 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:617 +#: ../../library/datetime.rst:621 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:621 +#: ../../library/datetime.rst:625 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -880,83 +884,83 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:631 +#: ../../library/datetime.rst:635 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:637 +#: ../../library/datetime.rst:641 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:640 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:644 ../../library/datetime.rst:1859 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1325 +#: ../../library/datetime.rst:654 ../../library/datetime.rst:1329 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:652 +#: ../../library/datetime.rst:656 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:658 ../../library/datetime.rst:1331 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:658 +#: ../../library/datetime.rst:662 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:664 +#: ../../library/datetime.rst:668 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:671 +#: ../../library/datetime.rst:675 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" -"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。" -"例如 ``date(2002, 12, 4).weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" +"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." +"weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:678 +#: ../../library/datetime.rst:682 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:685 +#: ../../library/datetime.rst:689 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:688 +#: ../../library/datetime.rst:692 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:690 +#: ../../library/datetime.rst:694 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -965,17 +969,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:695 +#: ../../library/datetime.rst:699 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:704 +#: ../../library/datetime.rst:708 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:709 +#: ../../library/datetime.rst:713 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -983,29 +987,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:717 +#: ../../library/datetime.rst:721 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:722 +#: ../../library/datetime.rst:726 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:728 ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:732 ../../library/datetime.rst:1515 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:732 +#: ../../library/datetime.rst:736 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:739 +#: ../../library/datetime.rst:743 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1013,7 +1017,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:746 +#: ../../library/datetime.rst:750 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1443,7 +1447,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1163 +#: ../../library/datetime.rst:1167 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1451,14 +1455,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1168 +#: ../../library/datetime.rst:1172 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1172 +#: ../../library/datetime.rst:1176 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1466,7 +1470,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1177 +#: ../../library/datetime.rst:1181 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1475,20 +1479,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1183 +#: ../../library/datetime.rst:1187 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1186 +#: ../../library/datetime.rst:1190 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1194 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1498,13 +1502,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1196 +#: ../../library/datetime.rst:1200 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:1206 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1517,27 +1521,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1220 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1221 +#: ../../library/datetime.rst:1225 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1224 ../../library/datetime.rst:1233 +#: ../../library/datetime.rst:1228 ../../library/datetime.rst:1237 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1230 +#: ../../library/datetime.rst:1234 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1241 +#: ../../library/datetime.rst:1245 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1545,21 +1549,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1252 +#: ../../library/datetime.rst:1256 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1256 +#: ../../library/datetime.rst:1260 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1567,7 +1571,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1265 +#: ../../library/datetime.rst:1269 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1576,7 +1580,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1271 +#: ../../library/datetime.rst:1275 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1584,56 +1588,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1276 +#: ../../library/datetime.rst:1280 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1288 +#: ../../library/datetime.rst:1292 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1291 +#: ../../library/datetime.rst:1295 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1298 +#: ../../library/datetime.rst:1302 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1302 ../../library/datetime.rst:1895 -#: ../../library/datetime.rst:2001 ../../library/datetime.rst:2246 -#: ../../library/datetime.rst:2258 ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1899 +#: ../../library/datetime.rst:2005 ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2574 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1308 +#: ../../library/datetime.rst:1312 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1312 ../../library/datetime.rst:1905 -#: ../../library/datetime.rst:2055 +#: ../../library/datetime.rst:1316 ../../library/datetime.rst:1909 +#: ../../library/datetime.rst:2059 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1318 +#: ../../library/datetime.rst:1322 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1333 +#: ../../library/datetime.rst:1337 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1643,14 +1647,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1344 +#: ../../library/datetime.rst:1348 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1348 +#: ../../library/datetime.rst:1352 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1659,7 +1663,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1357 +#: ../../library/datetime.rst:1361 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1669,20 +1673,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1366 +#: ../../library/datetime.rst:1370 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1371 +#: ../../library/datetime.rst:1375 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1375 +#: ../../library/datetime.rst:1379 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1692,18 +1696,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1382 +#: ../../library/datetime.rst:1386 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:1393 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1395 +#: ../../library/datetime.rst:1399 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1711,49 +1715,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:1407 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1413 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1415 +#: ../../library/datetime.rst:1419 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1422 +#: ../../library/datetime.rst:1426 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1432 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1430 +#: ../../library/datetime.rst:1434 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1431 +#: ../../library/datetime.rst:1435 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1433 +#: ../../library/datetime.rst:1437 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1436 +#: ../../library/datetime.rst:1440 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1761,99 +1765,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1438 +#: ../../library/datetime.rst:1442 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1448 +#: ../../library/datetime.rst:1452 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1462 ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1841 +#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1469 ../../library/datetime.rst:1842 +#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1846 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1480 +#: ../../library/datetime.rst:1484 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1490 ../../library/datetime.rst:1866 +#: ../../library/datetime.rst:1494 ../../library/datetime.rst:1870 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1496 +#: ../../library/datetime.rst:1500 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1506 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1508 +#: ../../library/datetime.rst:1512 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:1519 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1522 +#: ../../library/datetime.rst:1526 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1529 +#: ../../library/datetime.rst:1533 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1861,70 +1865,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1536 +#: ../../library/datetime.rst:1540 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1538 +#: ../../library/datetime.rst:1542 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:1595 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1638 +#: ../../library/datetime.rst:1642 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1664 +#: ../../library/datetime.rst:1668 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1666 +#: ../../library/datetime.rst:1670 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:1675 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1681 +#: ../../library/datetime.rst:1685 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1689 +#: ../../library/datetime.rst:1693 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1694 +#: ../../library/datetime.rst:1698 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1699 +#: ../../library/datetime.rst:1703 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1728 +#: ../../library/datetime.rst:1732 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1742 +#: ../../library/datetime.rst:1746 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1933,7 +1937,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1748 +#: ../../library/datetime.rst:1752 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1947,18 +1951,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1758 +#: ../../library/datetime.rst:1762 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1762 +#: ../../library/datetime.rst:1766 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:1768 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1966,35 +1970,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1771 +#: ../../library/datetime.rst:1775 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1783 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1781 +#: ../../library/datetime.rst:1785 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1807 +#: ../../library/datetime.rst:1811 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1817 +#: ../../library/datetime.rst:1821 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2002,46 +2006,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1828 +#: ../../library/datetime.rst:1832 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1830 +#: ../../library/datetime.rst:1834 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1835 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1836 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1833 +#: ../../library/datetime.rst:1837 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1853 +#: ../../library/datetime.rst:1857 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1872 +#: ../../library/datetime.rst:1876 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1877 +#: ../../library/datetime.rst:1881 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1883 +#: ../../library/datetime.rst:1887 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2138 +#: ../../library/datetime.rst:2142 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2311,7 +2315,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2152 +#: ../../library/datetime.rst:2156 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2320,7 +2324,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2171 +#: ../../library/datetime.rst:2175 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2335,13 +2339,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2193 +#: ../../library/datetime.rst:2197 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2196 +#: ../../library/datetime.rst:2200 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2351,28 +2355,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2210 +#: ../../library/datetime.rst:2214 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2205 +#: ../../library/datetime.rst:2209 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2213 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2216 +#: ../../library/datetime.rst:2220 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2217 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2381,24 +2385,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2223 +#: ../../library/datetime.rst:2227 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2225 +#: ../../library/datetime.rst:2229 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2233 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2240 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2406,25 +2410,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2241 +#: ../../library/datetime.rst:2245 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2252 ../../library/datetime.rst:2263 +#: ../../library/datetime.rst:2256 ../../library/datetime.rst:2267 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2255 +#: ../../library/datetime.rst:2259 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2266 +#: ../../library/datetime.rst:2270 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2433,144 +2437,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2272 +#: ../../library/datetime.rst:2276 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2279 +#: ../../library/datetime.rst:2283 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:2294 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2299 +#: ../../library/datetime.rst:2303 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2301 +#: ../../library/datetime.rst:2305 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2309 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2313 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2326 +#: ../../library/datetime.rst:2332 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2328 +#: ../../library/datetime.rst:2334 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2336 +#: ../../library/datetime.rst:2342 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2348 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2348 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2582,11 +2586,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2353 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2353 msgid "Weekday as locale's full name." msgstr "" @@ -2598,42 +2602,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2369 -#: ../../library/datetime.rst:2372 ../../library/datetime.rst:2378 -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2387 -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2411 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2365 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2365 msgid "Month as locale's abbreviated name." msgstr "" @@ -2645,11 +2649,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "Month as locale's full name." msgstr "" @@ -2661,67 +2665,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2375 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2375 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2369 ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2387 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2381 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2381 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2451 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2387 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2387 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2733,128 +2737,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2393 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2393 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2396 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2572 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2403 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2403 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2402 -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2465 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2402 ../../library/datetime.rst:2594 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2600 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2408 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2408 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2414 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2414 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2430 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2430 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2866,11 +2870,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2429 +#: ../../library/datetime.rst:2435 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2429 +#: ../../library/datetime.rst:2435 msgid "Locale's appropriate date representation." msgstr "" @@ -2886,11 +2890,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2439 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2439 msgid "Locale's appropriate time representation." msgstr "" @@ -2902,83 +2906,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2445 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2451 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2451 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2451 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2459 ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2586 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2465 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2465 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2471 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2987,7 +2991,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2470 +#: ../../library/datetime.rst:2476 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2997,37 +3001,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2482 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2479 +#: ../../library/datetime.rst:2485 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2489 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2491 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2495 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2499 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2503 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3035,7 +3039,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2507 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3047,7 +3051,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2511 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3056,7 +3060,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2515 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3065,7 +3069,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2524 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3073,37 +3077,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2530 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2527 +#: ../../library/datetime.rst:2533 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2537 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2536 +#: ../../library/datetime.rst:2542 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2546 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2550 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3111,17 +3115,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2557 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2554 +#: ../../library/datetime.rst:2560 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2563 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3135,7 +3139,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2571 +#: ../../library/datetime.rst:2577 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3143,53 +3147,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2579 +#: ../../library/datetime.rst:2585 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2583 +#: ../../library/datetime.rst:2589 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2587 +#: ../../library/datetime.rst:2593 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2595 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2596 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2592 +#: ../../library/datetime.rst:2598 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2602 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2608 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2607 +#: ../../library/datetime.rst:2613 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3197,22 +3201,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2619 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2618 +#: ../../library/datetime.rst:2624 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2625 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2627 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3221,23 +3225,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2633 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2631 +#: ../../library/datetime.rst:2637 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2297 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2297 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/enum.po b/library/enum.po index 3c8abf841a..84d1026bc1 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -417,43 +417,47 @@ msgstr "" msgid "Returns each member in *cls* in reverse definition order::" msgstr "" -#: ../../library/enum.rst:247 -msgid "*Enum* is the base class for all *enum* enumerations." +#: ../../library/enum.rst:246 +msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" #: ../../library/enum.rst:251 +msgid "*Enum* is the base class for all *enum* enumerations." +msgstr "" + +#: ../../library/enum.rst:255 msgid "The name used to define the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:258 +#: ../../library/enum.rst:262 msgid "The value given to the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:263 +#: ../../library/enum.rst:267 msgid "Enum member values" msgstr "" -#: ../../library/enum.rst:265 +#: ../../library/enum.rst:269 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:276 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "" -#: ../../library/enum.rst:275 +#: ../../library/enum.rst:279 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:285 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -463,11 +467,11 @@ msgstr "" msgid "name" msgstr "" -#: ../../library/enum.rst:302 +#: ../../library/enum.rst:306 msgid "The name of the member being defined (e.g. 'RED')." msgstr "" -#: ../../library/enum.rst:303 +#: ../../library/enum.rst:307 msgid "The start value for the Enum; the default is 1." msgstr "" @@ -475,7 +479,7 @@ msgstr "" msgid "count" msgstr "" -#: ../../library/enum.rst:304 +#: ../../library/enum.rst:308 msgid "The number of members currently defined, not including this one." msgstr "" @@ -483,57 +487,57 @@ msgstr "" msgid "last_values" msgstr "" -#: ../../library/enum.rst:305 +#: ../../library/enum.rst:309 msgid "A list of the previous values." msgstr "" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:311 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "" -#: ../../library/enum.rst:323 +#: ../../library/enum.rst:327 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "" -#: ../../library/enum.rst:328 +#: ../../library/enum.rst:332 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" -#: ../../library/enum.rst:350 +#: ../../library/enum.rst:354 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:366 +#: ../../library/enum.rst:370 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" -#: ../../library/enum.rst:381 +#: ../../library/enum.rst:385 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:396 +#: ../../library/enum.rst:400 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:399 +#: ../../library/enum.rst:403 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:404 +#: ../../library/enum.rst:408 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -541,20 +545,20 @@ msgid "" "enumeration status." msgstr "" -#: ../../library/enum.rst:425 +#: ../../library/enum.rst:429 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:428 +#: ../../library/enum.rst:432 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:435 +#: ../../library/enum.rst:439 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -562,7 +566,7 @@ msgid "" "the enumeration." msgstr "" -#: ../../library/enum.rst:441 +#: ../../library/enum.rst:445 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -570,285 +574,285 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: ../../library/enum.rst:448 +#: ../../library/enum.rst:452 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:457 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:461 +#: ../../library/enum.rst:465 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" -#: ../../library/enum.rst:467 +#: ../../library/enum.rst:471 msgid "Returns *True* if value is in self::" msgstr "" -#: ../../library/enum.rst:488 +#: ../../library/enum.rst:492 msgid "Returns all contained non-alias members::" msgstr "" -#: ../../library/enum.rst:497 +#: ../../library/enum.rst:501 msgid "Aliases are no longer returned during iteration." msgstr "" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:505 msgid "Returns number of members in flag::" msgstr "" -#: ../../library/enum.rst:510 +#: ../../library/enum.rst:514 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:522 +#: ../../library/enum.rst:526 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:529 +#: ../../library/enum.rst:533 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:538 +#: ../../library/enum.rst:542 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:547 +#: ../../library/enum.rst:551 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:558 +#: ../../library/enum.rst:562 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:563 +#: ../../library/enum.rst:567 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:566 +#: ../../library/enum.rst:570 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:574 +#: ../../library/enum.rst:578 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:588 +#: ../../library/enum.rst:592 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:594 +#: ../../library/enum.rst:598 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "" -#: ../../library/enum.rst:596 +#: ../../library/enum.rst:600 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:597 +#: ../../library/enum.rst:601 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:599 +#: ../../library/enum.rst:603 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:606 +#: ../../library/enum.rst:610 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:615 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:615 +#: ../../library/enum.rst:619 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:625 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:624 +#: ../../library/enum.rst:628 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:629 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:627 +#: ../../library/enum.rst:631 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:636 +#: ../../library/enum.rst:640 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:645 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:657 +#: ../../library/enum.rst:661 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:672 +#: ../../library/enum.rst:676 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: ../../library/enum.rst:689 +#: ../../library/enum.rst:693 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:695 +#: ../../library/enum.rst:699 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:700 +#: ../../library/enum.rst:704 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:718 +#: ../../library/enum.rst:722 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:732 +#: ../../library/enum.rst:736 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:745 +#: ../../library/enum.rst:749 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:762 +#: ../../library/enum.rst:766 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:768 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:771 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:777 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:779 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:780 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:778 +#: ../../library/enum.rst:782 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:784 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:787 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:789 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:794 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:797 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:800 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:801 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:802 +#: ../../library/enum.rst:806 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:810 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -859,58 +863,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:814 +#: ../../library/enum.rst:818 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:820 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:821 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:822 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:823 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:824 +#: ../../library/enum.rst:828 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:831 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:834 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:836 +#: ../../library/enum.rst:840 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:844 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -918,29 +922,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:849 +#: ../../library/enum.rst:853 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:867 +#: ../../library/enum.rst:871 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:875 +#: ../../library/enum.rst:879 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:881 +#: ../../library/enum.rst:885 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:887 +#: ../../library/enum.rst:891 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -948,41 +952,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:901 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:908 msgid "Notes" msgstr "" -#: ../../library/enum.rst:906 +#: ../../library/enum.rst:910 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:912 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:911 +#: ../../library/enum.rst:915 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:917 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:916 +#: ../../library/enum.rst:920 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:923 +#: ../../library/enum.rst:927 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/errno.po b/library/errno.po index 31b37592c1..c4eacd920d 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+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-" @@ -452,137 +452,153 @@ msgid "Operation not supported on transport endpoint" msgstr "" #: ../../library/errno.rst:516 +msgid "Operation not supported" +msgstr "" + +#: ../../library/errno.rst:523 msgid "Protocol family not supported" msgstr "" -#: ../../library/errno.rst:521 +#: ../../library/errno.rst:528 msgid "Address family not supported by protocol" msgstr "" -#: ../../library/errno.rst:526 +#: ../../library/errno.rst:533 msgid "Address already in use" msgstr "" -#: ../../library/errno.rst:531 +#: ../../library/errno.rst:538 msgid "Cannot assign requested address" msgstr "" -#: ../../library/errno.rst:536 +#: ../../library/errno.rst:543 msgid "Network is down" msgstr "" -#: ../../library/errno.rst:541 +#: ../../library/errno.rst:548 msgid "Network is unreachable" msgstr "" -#: ../../library/errno.rst:546 +#: ../../library/errno.rst:553 msgid "Network dropped connection because of reset" msgstr "" -#: ../../library/errno.rst:551 +#: ../../library/errno.rst:558 msgid "" "Software caused connection abort. This error is mapped to the exception :exc:" "`ConnectionAbortedError`." msgstr "" -#: ../../library/errno.rst:557 +#: ../../library/errno.rst:564 msgid "" "Connection reset by peer. This error is mapped to the exception :exc:" "`ConnectionResetError`." msgstr "" -#: ../../library/errno.rst:563 +#: ../../library/errno.rst:570 msgid "No buffer space available" msgstr "" -#: ../../library/errno.rst:568 +#: ../../library/errno.rst:575 msgid "Transport endpoint is already connected" msgstr "" -#: ../../library/errno.rst:573 +#: ../../library/errno.rst:580 msgid "Transport endpoint is not connected" msgstr "" -#: ../../library/errno.rst:578 +#: ../../library/errno.rst:585 msgid "" "Cannot send after transport endpoint shutdown. This error is mapped to the " "exception :exc:`BrokenPipeError`." msgstr "" -#: ../../library/errno.rst:584 +#: ../../library/errno.rst:591 msgid "Too many references: cannot splice" msgstr "" -#: ../../library/errno.rst:589 +#: ../../library/errno.rst:596 msgid "" "Connection timed out. This error is mapped to the exception :exc:" "`TimeoutError`." msgstr "" -#: ../../library/errno.rst:595 +#: ../../library/errno.rst:602 msgid "" "Connection refused. This error is mapped to the exception :exc:" "`ConnectionRefusedError`." msgstr "" -#: ../../library/errno.rst:601 +#: ../../library/errno.rst:608 msgid "Host is down" msgstr "" -#: ../../library/errno.rst:606 +#: ../../library/errno.rst:613 msgid "No route to host" msgstr "" -#: ../../library/errno.rst:611 +#: ../../library/errno.rst:618 msgid "" "Operation already in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" -#: ../../library/errno.rst:617 +#: ../../library/errno.rst:624 msgid "" "Operation now in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" -#: ../../library/errno.rst:623 +#: ../../library/errno.rst:630 msgid "Stale NFS file handle" msgstr "" -#: ../../library/errno.rst:628 +#: ../../library/errno.rst:635 msgid "Structure needs cleaning" msgstr "" -#: ../../library/errno.rst:633 +#: ../../library/errno.rst:640 msgid "Not a XENIX named type file" msgstr "" -#: ../../library/errno.rst:638 +#: ../../library/errno.rst:645 msgid "No XENIX semaphores available" msgstr "" -#: ../../library/errno.rst:643 +#: ../../library/errno.rst:650 msgid "Is a named type file" msgstr "" -#: ../../library/errno.rst:648 +#: ../../library/errno.rst:655 msgid "Remote I/O error" msgstr "" -#: ../../library/errno.rst:653 +#: ../../library/errno.rst:660 msgid "Quota exceeded" msgstr "" -#: ../../library/errno.rst:657 +#: ../../library/errno.rst:664 msgid "Interface output queue is full" msgstr "" -#: ../../library/errno.rst:663 +#: ../../library/errno.rst:670 msgid "" "Capabilities insufficient. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:666 +#: ../../library/errno.rst:673 msgid ":ref:`Availability `: WASI, FreeBSD" msgstr ":ref:`適用 `:WASI, FreeBSD" + +#: ../../library/errno.rst:680 +msgid "Operation canceled" +msgstr "" + +#: ../../library/errno.rst:687 +msgid "Owner died" +msgstr "" + +#: ../../library/errno.rst:694 +msgid "State not recoverable" +msgstr "" diff --git a/library/io.po b/library/io.po index c203f3ad5a..4c42b73fc0 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 18:13+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1123 +#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1139 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1111 +#: ../../library/io.rst:72 ../../library/io.rst:1127 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -1493,18 +1493,50 @@ msgstr "" msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1050 +#: ../../library/io.rst:1049 +msgid "" +"Set the stream position. Return the new stream position as an :class:`int`." +msgstr "" + +#: ../../library/io.rst:1052 +msgid "" +"Four operations are supported, given by the following argument combinations:" +msgstr "" + +#: ../../library/io.rst:1055 +msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." +msgstr "" + +#: ../../library/io.rst:1056 +msgid "" +"``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " +"be** a number returned by :meth:`!tell`." +msgstr "" + +#: ../../library/io.rst:1058 +msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." +msgstr "" + +#: ../../library/io.rst:1059 +msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." +msgstr "" + +#: ../../library/io.rst:1061 +msgid "Any other argument combinations are invalid, and may raise exceptions." +msgstr "" + +#: ../../library/io.rst:1066 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1053 +#: ../../library/io.rst:1069 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1056 +#: ../../library/io.rst:1072 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1516,50 +1548,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1065 +#: ../../library/io.rst:1081 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1069 +#: ../../library/io.rst:1085 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1074 +#: ../../library/io.rst:1090 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1078 +#: ../../library/io.rst:1094 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1100 +#: ../../library/io.rst:1116 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1105 +#: ../../library/io.rst:1121 msgid "Performance" msgstr "" -#: ../../library/io.rst:1107 +#: ../../library/io.rst:1123 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1113 +#: ../../library/io.rst:1129 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1572,7 +1604,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1125 +#: ../../library/io.rst:1141 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1582,24 +1614,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1132 +#: ../../library/io.rst:1148 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1136 +#: ../../library/io.rst:1152 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1138 +#: ../../library/io.rst:1154 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1141 +#: ../../library/io.rst:1157 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1607,15 +1639,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1146 +#: ../../library/io.rst:1162 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1149 +#: ../../library/io.rst:1165 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1151 +#: ../../library/io.rst:1167 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1626,7 +1658,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1159 +#: ../../library/io.rst:1175 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1642,7 +1674,7 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1095 +#: ../../library/io.rst:971 ../../library/io.rst:1111 msgid "universal newlines" msgstr "universal newlines" @@ -1650,6 +1682,6 @@ msgstr "universal newlines" msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1095 +#: ../../library/io.rst:1111 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/logging.po b/library/logging.po index 48729d0e13..f2ebe0de95 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-14 13:46+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+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-" @@ -278,7 +278,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:201 ../../library/logging.rst:1106 +#: ../../library/logging.rst:201 ../../library/logging.rst:1116 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -290,14 +290,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:210 ../../library/logging.rst:1115 +#: ../../library/logging.rst:210 ../../library/logging.rst:1125 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1123 +#: ../../library/logging.rst:218 ../../library/logging.rst:1133 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -346,7 +346,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:258 ../../library/logging.rst:1154 +#: ../../library/logging.rst:258 ../../library/logging.rst:1164 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -364,7 +364,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:269 ../../library/logging.rst:1165 +#: ../../library/logging.rst:269 ../../library/logging.rst:1175 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -584,7 +584,7 @@ msgstr "" msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " -"useful subclasses. However, the :meth:`__init__` method in subclasses needs " +"useful subclasses. However, the :meth:`!__init__` method in subclasses needs " "to call :meth:`Handler.__init__`." msgstr "" @@ -1119,11 +1119,11 @@ msgstr "" msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:915 ../../library/logging.rst:1323 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:915 ../../library/logging.rst:1323 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Description" msgstr "描述" @@ -1441,7 +1441,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1020 +msgid "Delegates to the underlying :attr:`!manager`` on *logger*." +msgstr "" + +#: ../../library/logging.rst:1024 +msgid "Delegates to the underlying :meth:`!_log`` method on *logger*." +msgstr "" + +#: ../../library/logging.rst:1026 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1453,24 +1461,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1037 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1043 msgid "" -"Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " -"to the underlying logger and allow adapters to be nested." +"Attribute :attr:`!manager` and method :meth:`!_log` were added, which " +"delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1038 +#: ../../library/logging.rst:1048 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1040 +#: ../../library/logging.rst:1050 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1479,7 +1487,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1055 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1487,17 +1495,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1062 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1064 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1070 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1506,14 +1514,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1075 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1072 +#: ../../library/logging.rst:1082 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1522,24 +1530,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1083 +#: ../../library/logging.rst:1093 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1085 +#: ../../library/logging.rst:1095 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1090 +#: ../../library/logging.rst:1100 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1095 +#: ../../library/logging.rst:1105 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1548,7 +1556,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1100 +#: ../../library/logging.rst:1110 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1558,7 +1566,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1126 +#: ../../library/logging.rst:1136 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1567,18 +1575,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1147 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1153 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1147 +#: ../../library/logging.rst:1157 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1589,58 +1597,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1161 +#: ../../library/logging.rst:1171 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1170 +#: ../../library/logging.rst:1180 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1176 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1179 +#: ../../library/logging.rst:1189 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1196 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1202 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1208 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1214 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1219 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 " @@ -1654,7 +1662,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1230 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 " @@ -1662,13 +1670,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1235 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1231 +#: ../../library/logging.rst:1241 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1678,24 +1686,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1248 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1243 +#: ../../library/logging.rst:1253 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1261 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1253 +#: ../../library/logging.rst:1263 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1705,20 +1713,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1260 +#: ../../library/logging.rst:1270 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:1264 +#: ../../library/logging.rst:1274 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1277 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 " @@ -1727,7 +1735,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1283 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. " @@ -1735,17 +1743,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1291 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1298 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1294 +#: ../../library/logging.rst:1304 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1753,7 +1761,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1312 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1762,13 +1770,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1318 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:1311 +#: ../../library/logging.rst:1321 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 " @@ -1777,54 +1785,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1318 +#: ../../library/logging.rst:1328 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1335 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1335 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1339 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1339 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1343 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1343 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1348 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1348 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1351 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1351 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1362 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1362 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:1358 +#: ../../library/logging.rst:1368 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1358 +#: ../../library/logging.rst:1368 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 " @@ -1864,33 +1872,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1377 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1377 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:1373 +#: ../../library/logging.rst:1383 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1383 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:1378 +#: ../../library/logging.rst:1388 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1388 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 " @@ -1899,43 +1907,43 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1399 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1402 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:1398 +#: ../../library/logging.rst:1408 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1401 +#: ../../library/logging.rst:1411 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1406 +#: ../../library/logging.rst:1416 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:1410 +#: ../../library/logging.rst:1420 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:1417 +#: ../../library/logging.rst:1427 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 " -"argument is required, and the :meth:`__init__` should call :meth:`Logger." +"logger. The class should define :meth:`!__init__` such that only a name " +"argument is required, and the :meth:`!__init__` should call :meth:`!Logger." "__init__`. This function is typically called before any loggers are " "instantiated by applications which need to use custom logger behavior. After " "this call, as at any other time, do not instantiate loggers directly using " @@ -1943,32 +1951,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1438 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1430 +#: ../../library/logging.rst:1440 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1442 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:1437 +#: ../../library/logging.rst:1447 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1439 +#: ../../library/logging.rst:1449 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1451 msgid "The logger name." msgstr "" @@ -1976,7 +1984,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1452 msgid "The logging level (numeric)." msgstr "" @@ -1984,7 +1992,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1443 +#: ../../library/logging.rst:1453 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1992,19 +2000,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1454 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1455 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1446 +#: ../../library/logging.rst:1456 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1457 msgid "An exception tuple, or ``None``." msgstr "" @@ -2012,7 +2020,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1458 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2020,7 +2028,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1450 +#: ../../library/logging.rst:1460 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2030,15 +2038,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1462 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1456 +#: ../../library/logging.rst:1466 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1470 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``, " @@ -2049,22 +2057,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1471 +#: ../../library/logging.rst:1481 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1473 +#: ../../library/logging.rst:1483 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1478 +#: ../../library/logging.rst:1488 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1491 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2073,46 +2081,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1496 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:1494 +#: ../../library/logging.rst:1504 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1504 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1507 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1507 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1501 +#: ../../library/logging.rst:1511 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1500 +#: ../../library/logging.rst:1510 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1506 +#: ../../library/logging.rst:1516 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1504 +#: ../../library/logging.rst:1514 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/re.po b/library/re.po index e55587d2b6..66510021f6 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-27 00:04+0000\n" "PO-Revision-Date: 2023-05-20 13:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,7 +147,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1545 +#: ../../library/re.rst:104 ../../library/re.rst:1552 msgid "``.``" msgstr "``.``" @@ -1126,41 +1126,40 @@ msgstr "" #: ../../library/re.rst:858 msgid "" "Scan through *string* looking for the first location where the regular " -"expression *pattern* produces a match, and return a corresponding :ref:" -"`match object `. Return ``None`` if no position in the " -"string matches the pattern; note that this is different from finding a zero-" -"length match at some point in the string." +"expression *pattern* produces a match, and return a corresponding :class:" +"`~re.Match`. Return ``None`` if no position in the string matches the " +"pattern; note that this is different from finding a zero-length match at " +"some point in the string." msgstr "" -#: ../../library/re.rst:867 +#: ../../library/re.rst:866 msgid "" "If zero or more characters at the beginning of *string* match the regular " -"expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the string does not match the pattern; note " -"that this is different from a zero-length match." +"expression *pattern*, return a corresponding :class:`~re.Match`. Return " +"``None`` if the string does not match the pattern; note that this is " +"different from a zero-length match." msgstr "" -#: ../../library/re.rst:872 +#: ../../library/re.rst:871 msgid "" "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match " "at the beginning of the string and not at the beginning of each line." msgstr "" -#: ../../library/re.rst:875 +#: ../../library/re.rst:874 msgid "" "If you want to locate a match anywhere in *string*, use :func:`search` " "instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:881 +#: ../../library/re.rst:880 msgid "" "If the whole *string* matches the regular expression *pattern*, return a " -"corresponding :ref:`match object `. Return ``None`` if the " -"string does not match the pattern; note that this is different from a zero-" -"length match." +"corresponding :class:`~re.Match`. Return ``None`` if the string does not " +"match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:891 +#: ../../library/re.rst:889 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1169,42 +1168,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:906 +#: ../../library/re.rst:904 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:913 +#: ../../library/re.rst:911 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:916 +#: ../../library/re.rst:914 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:926 ../../library/re.rst:1017 ../../library/re.rst:1046 +#: ../../library/re.rst:924 ../../library/re.rst:1015 ../../library/re.rst:1044 msgid "Added the optional flags argument." msgstr "新增可選的旗標引數。" -#: ../../library/re.rst:929 +#: ../../library/re.rst:927 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:935 +#: ../../library/re.rst:933 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:939 +#: ../../library/re.rst:937 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1214,19 +1213,19 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:951 ../../library/re.rst:962 +#: ../../library/re.rst:949 ../../library/re.rst:960 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:957 +#: ../../library/re.rst:955 msgid "" -"Return an :term:`iterator` yielding :ref:`match objects ` " -"over all non-overlapping matches for the RE *pattern* in *string*. The " -"*string* is scanned left-to-right, and matches are returned in the order " -"found. Empty matches are included in the result." +"Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-" +"overlapping matches for the RE *pattern* in *string*. The *string* is " +"scanned left-to-right, and matches are returned in the order found. Empty " +"matches are included in the result." msgstr "" -#: ../../library/re.rst:968 +#: ../../library/re.rst:966 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1240,18 +1239,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:982 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " -"of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" +"of *pattern*. The function takes a single :class:`~re.Match` argument, and " +"returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:997 -msgid "The pattern may be a string or a :ref:`pattern object `." +#: ../../library/re.rst:995 +msgid "The pattern may be a string or a :class:`~re.Pattern`." msgstr "" -#: ../../library/re.rst:999 +#: ../../library/re.rst:997 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1260,7 +1259,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:1007 +#: ../../library/re.rst:1005 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1273,60 +1272,60 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1020 ../../library/re.rst:1049 -#: ../../library/re.rst:1283 +#: ../../library/re.rst:1018 ../../library/re.rst:1047 +#: ../../library/re.rst:1290 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1023 +#: ../../library/re.rst:1021 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1027 +#: ../../library/re.rst:1025 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1031 +#: ../../library/re.rst:1029 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1035 +#: ../../library/re.rst:1033 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:1043 +#: ../../library/re.rst:1041 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1055 +#: ../../library/re.rst:1053 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1070 +#: ../../library/re.rst:1068 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1078 +#: ../../library/re.rst:1076 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1081 +#: ../../library/re.rst:1079 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1334,15 +1333,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1090 +#: ../../library/re.rst:1088 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1094 +#: ../../library/re.rst:1092 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1098 +#: ../../library/re.rst:1096 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1351,50 +1350,54 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1106 +#: ../../library/re.rst:1104 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1110 +#: ../../library/re.rst:1108 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1114 +#: ../../library/re.rst:1112 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1118 +#: ../../library/re.rst:1116 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1122 +#: ../../library/re.rst:1120 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1122 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1130 +#: ../../library/re.rst:1128 msgid "Regular Expression Objects" msgstr "" #: ../../library/re.rst:1132 +msgid "Compiled regular expression object returned by :func:`re.compile`." +msgstr "" + +#: ../../library/re.rst:1134 msgid "" -"Compiled regular expression objects support the following methods and " -"attributes:" +":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " +"pattern. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1137 +#: ../../library/re.rst:1140 msgid "" "Scan through *string* looking for the first location where this regular " -"expression produces a match, and return a corresponding :ref:`match object " -"`. Return ``None`` if no position in the string matches the " -"pattern; note that this is different from finding a zero-length match at " -"some point in the string." +"expression produces a match, and return a corresponding :class:`~re.Match`. " +"Return ``None`` if no position in the string matches the pattern; note that " +"this is different from finding a zero-length match at some point in the " +"string." msgstr "" -#: ../../library/re.rst:1143 +#: ../../library/re.rst:1145 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1403,7 +1406,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1149 +#: ../../library/re.rst:1151 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1413,104 +1416,109 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1164 +#: ../../library/re.rst:1166 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " -"expression, return a corresponding :ref:`match object `. " -"Return ``None`` if the string does not match the pattern; note that this is " -"different from a zero-length match." +"expression, return a corresponding :class:`~re.Match`. Return ``None`` if " +"the string does not match the pattern; note that this is different from a " +"zero-length match." msgstr "" -#: ../../library/re.rst:1169 ../../library/re.rst:1187 +#: ../../library/re.rst:1171 ../../library/re.rst:1189 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1177 +#: ../../library/re.rst:1179 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1183 +#: ../../library/re.rst:1185 msgid "" "If the whole *string* matches this regular expression, return a " -"corresponding :ref:`match object `. Return ``None`` if the " -"string does not match the pattern; note that this is different from a zero-" -"length match." +"corresponding :class:`~re.Match`. Return ``None`` if the string does not " +"match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:1201 +#: ../../library/re.rst:1203 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1206 +#: ../../library/re.rst:1208 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1213 +#: ../../library/re.rst:1215 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1220 +#: ../../library/re.rst:1222 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1225 +#: ../../library/re.rst:1227 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1230 +#: ../../library/re.rst:1232 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1239 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1242 +#: ../../library/re.rst:1244 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1249 +#: ../../library/re.rst:1251 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1252 +#: ../../library/re.rst:1254 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1260 +#: ../../library/re.rst:1262 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1262 +#: ../../library/re.rst:1264 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1271 -msgid "Match objects support the following methods and attributes:" +#: ../../library/re.rst:1275 +msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -#: ../../library/re.rst:1276 +#: ../../library/re.rst:1277 +msgid "" +":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " +"match. See :ref:`types-genericalias`." +msgstr "" + +#: ../../library/re.rst:1283 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1519,7 +1527,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1288 +#: ../../library/re.rst:1295 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1534,7 +1542,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1310 +#: ../../library/re.rst:1317 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1542,57 +1550,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1315 +#: ../../library/re.rst:1322 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1323 +#: ../../library/re.rst:1330 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1330 +#: ../../library/re.rst:1337 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1339 +#: ../../library/re.rst:1346 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1350 +#: ../../library/re.rst:1357 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1363 +#: ../../library/re.rst:1370 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1367 ../../library/re.rst:1592 +#: ../../library/re.rst:1374 ../../library/re.rst:1599 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1373 +#: ../../library/re.rst:1380 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1386 +#: ../../library/re.rst:1393 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1398 +#: ../../library/re.rst:1405 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1601,7 +1609,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1413 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1609,32 +1617,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1411 +#: ../../library/re.rst:1418 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1428 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1428 +#: ../../library/re.rst:1435 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1442 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1449 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1643,43 +1651,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1451 +#: ../../library/re.rst:1458 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1457 +#: ../../library/re.rst:1464 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1463 +#: ../../library/re.rst:1470 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1466 +#: ../../library/re.rst:1473 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1474 +#: ../../library/re.rst:1481 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1478 +#: ../../library/re.rst:1485 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1480 +#: ../../library/re.rst:1487 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1488 +#: ../../library/re.rst:1495 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1687,28 +1695,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1493 +#: ../../library/re.rst:1500 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1503 +#: ../../library/re.rst:1510 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1513 +#: ../../library/re.rst:1520 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1539 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1543 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1717,124 +1725,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1543 +#: ../../library/re.rst:1550 msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1543 +#: ../../library/re.rst:1550 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1545 +#: ../../library/re.rst:1552 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1547 +#: ../../library/re.rst:1554 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1547 +#: ../../library/re.rst:1554 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1556 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1556 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1551 +#: ../../library/re.rst:1558 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1551 +#: ../../library/re.rst:1558 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1560 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1560 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1555 +#: ../../library/re.rst:1562 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1555 +#: ../../library/re.rst:1562 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1564 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1564 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1559 +#: ../../library/re.rst:1566 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1559 +#: ../../library/re.rst:1566 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1568 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1568 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1571 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1575 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1572 +#: ../../library/re.rst:1579 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1580 +#: ../../library/re.rst:1587 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1584 +#: ../../library/re.rst:1591 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1586 +#: ../../library/re.rst:1593 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1587 +#: ../../library/re.rst:1594 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1589 +#: ../../library/re.rst:1596 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1608 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1609 +#: ../../library/re.rst:1616 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1842,11 +1850,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1619 +#: ../../library/re.rst:1626 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1621 +#: ../../library/re.rst:1628 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1854,37 +1862,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1633 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1639 +#: ../../library/re.rst:1646 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1652 +#: ../../library/re.rst:1659 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1665 +#: ../../library/re.rst:1672 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1680 +#: ../../library/re.rst:1687 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1689 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1892,11 +1900,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1700 +#: ../../library/re.rst:1707 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1702 +#: ../../library/re.rst:1709 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1904,24 +1912,24 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1713 +#: ../../library/re.rst:1720 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1715 +#: ../../library/re.rst:1722 msgid "" "If one wants more information about all matches of a pattern than the " -"matched text, :func:`finditer` is useful as it provides :ref:`match objects " -"` instead of strings. Continuing with the previous example, " -"if a writer wanted to find all of the adverbs *and their positions* in some " -"text, they would use :func:`finditer` in the following manner::" +"matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " +"objects instead of strings. Continuing with the previous example, if a " +"writer wanted to find all of the adverbs *and their positions* in some text, " +"they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1729 +#: ../../library/re.rst:1736 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1731 +#: ../../library/re.rst:1738 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1929,7 +1937,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1741 +#: ../../library/re.rst:1748 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1937,29 +1945,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1753 +#: ../../library/re.rst:1760 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1755 +#: ../../library/re.rst:1762 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1759 +#: ../../library/re.rst:1766 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1815 +#: ../../library/re.rst:1822 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1838 +#: ../../library/re.rst:1845 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -1984,7 +1992,7 @@ msgstr ". (點)" #: ../../library/re.rst:555 ../../library/re.rst:567 ../../library/re.rst:574 #: ../../library/re.rst:588 ../../library/re.rst:595 ../../library/re.rst:609 #: ../../library/re.rst:618 ../../library/re.rst:623 ../../library/re.rst:798 -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1003 msgid "in regular expressions" msgstr "於正規表示式中" @@ -2184,10 +2192,10 @@ msgstr "\\\\" msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1003 msgid "\\g" msgstr "\\g" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1541 msgid "scanf()" msgstr "scanf()" diff --git a/library/stringprep.po b/library/stringprep.po index 5114ad1eb7..748e2b6f3a 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-08-27 18:15+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,8 @@ msgstr "" #: ../../library/stringprep.rst:29 msgid "" "The module :mod:`stringprep` only exposes the tables from :rfc:`3454`. As " -"these tables would be very large to represent them as dictionaries or lists, " -"the module uses the Unicode character database internally. The module source " +"these tables would be very large to represent as dictionaries or lists, the " +"module uses the Unicode character database internally. The module source " "code itself was generated using the ``mkstringprep.py`` utility." msgstr "" diff --git a/library/sys.po b/library/sys.po index c8381f9521..bf8dcc3cde 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -368,8 +368,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:940 -#: ../../library/sys.rst:1677 ../../library/sys.rst:1914 +#: ../../library/sys.rst:282 ../../library/sys.rst:972 +#: ../../library/sys.rst:1717 ../../library/sys.rst:1953 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -414,31 +414,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:339 ../../library/sys.rst:1087 -#: ../../library/sys.rst:1793 -msgid "Attribute" -msgstr "屬性" - -#: ../../library/sys.rst:339 ../../library/sys.rst:1087 -#: ../../library/sys.rst:1793 -msgid "Explanation" -msgstr "解釋" - -#: ../../library/sys.rst:341 -msgid ":const:`emscripten_version`" -msgstr ":const:`emscripten_version`" - -#: ../../library/sys.rst:341 +#: ../../library/sys.rst:338 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:344 -msgid ":const:`runtime`" -msgstr ":const:`runtime`" - -#: ../../library/sys.rst:344 +#: ../../library/sys.rst:342 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -446,27 +428,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:347 -msgid ":const:`pthreads`" -msgstr ":const:`pthreads`" - -#: ../../library/sys.rst:347 +#: ../../library/sys.rst:346 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:350 -msgid ":const:`shared_memory`" -msgstr ":const:`shared_memory`" - #: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:354 +#: ../../library/sys.rst:352 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:361 +#: ../../library/sys.rst:359 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -477,12 +451,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:369 +#: ../../library/sys.rst:367 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:371 +#: ../../library/sys.rst:369 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -490,12 +464,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:381 +#: ../../library/sys.rst:379 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:383 +#: ../../library/sys.rst:381 msgid "" "When an exception is raised and uncaught, the interpreter calls ``sys." "excepthook`` with three arguments, the exception class, exception instance, " @@ -506,7 +480,7 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:390 +#: ../../library/sys.rst:388 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -514,7 +488,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:392 +#: ../../library/sys.rst:390 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -524,14 +498,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:401 +#: ../../library/sys.rst:399 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:411 +#: ../../library/sys.rst:409 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -540,15 +514,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:417 +#: ../../library/sys.rst:415 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:420 +#: ../../library/sys.rst:418 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:426 +#: ../../library/sys.rst:424 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -556,11 +530,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:431 +#: ../../library/sys.rst:429 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:438 +#: ../../library/sys.rst:436 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -571,13 +545,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:449 +#: ../../library/sys.rst:447 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:452 +#: ../../library/sys.rst:450 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -585,7 +559,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:460 +#: ../../library/sys.rst:458 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -597,7 +571,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:471 +#: ../../library/sys.rst:469 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -605,7 +579,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:479 +#: ../../library/sys.rst:477 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -613,13 +587,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:487 +#: ../../library/sys.rst:485 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:489 +#: ../../library/sys.rst:487 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -635,7 +609,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:502 +#: ../../library/sys.rst:500 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -644,194 +618,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:507 +#: ../../library/sys.rst:505 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:515 +#: ../../library/sys.rst:513 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 ../../library/sys.rst:580 -#: ../../library/sys.rst:986 -msgid "attribute" -msgstr "屬性" - #: ../../library/sys.rst:519 -msgid "flag" -msgstr "旗標" - -#: ../../library/sys.rst:521 -msgid ":const:`debug`" -msgstr ":const:`debug`" - -#: ../../library/sys.rst:521 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:522 -msgid ":const:`inspect`" -msgstr ":const:`inspect`" - -#: ../../library/sys.rst:522 ../../library/sys.rst:523 +#: ../../library/sys.rst:522 ../../library/sys.rst:525 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:523 -msgid ":const:`interactive`" -msgstr ":const:`interactive`" - -#: ../../library/sys.rst:524 -msgid ":const:`isolated`" -msgstr ":const:`isolated`" - -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:528 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:525 -msgid ":const:`optimize`" -msgstr ":const:`optimize`" - -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:531 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:526 -msgid ":const:`dont_write_bytecode`" -msgstr ":const:`dont_write_bytecode`" - -#: ../../library/sys.rst:526 +#: ../../library/sys.rst:534 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:527 -msgid ":const:`no_user_site`" -msgstr ":const:`no_user_site`" - -#: ../../library/sys.rst:527 +#: ../../library/sys.rst:537 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:528 -msgid ":const:`no_site`" -msgstr ":const:`no_site`" - -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:540 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:529 -msgid ":const:`ignore_environment`" -msgstr ":const:`ignore_environment`" - -#: ../../library/sys.rst:529 +#: ../../library/sys.rst:543 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:530 -msgid ":const:`verbose`" -msgstr ":const:`verbose`" - -#: ../../library/sys.rst:530 +#: ../../library/sys.rst:546 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:531 -msgid ":const:`bytes_warning`" -msgstr ":const:`bytes_warning`" - -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:549 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:532 -msgid ":const:`quiet`" -msgstr ":const:`quiet`" - -#: ../../library/sys.rst:532 +#: ../../library/sys.rst:552 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:533 -msgid ":const:`hash_randomization`" -msgstr ":const:`hash_randomization`" - -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:555 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:534 -msgid ":const:`dev_mode`" -msgstr ":const:`dev_mode`" - -#: ../../library/sys.rst:534 +#: ../../library/sys.rst:558 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:535 -msgid ":const:`utf8_mode`" -msgstr ":const:`utf8_mode`" - -#: ../../library/sys.rst:535 +#: ../../library/sys.rst:561 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:536 -msgid ":const:`safe_path`" -msgstr ":const:`safe_path`" - -#: ../../library/sys.rst:536 +#: ../../library/sys.rst:564 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:537 -msgid ":const:`int_max_str_digits`" -msgstr ":const:`int_max_str_digits`" - -#: ../../library/sys.rst:537 +#: ../../library/sys.rst:567 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:538 -msgid ":const:`warn_default_encoding`" -msgstr ":const:`warn_default_encoding`" - -#: ../../library/sys.rst:538 +#: ../../library/sys.rst:571 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:541 +#: ../../library/sys.rst:573 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:544 +#: ../../library/sys.rst:576 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:547 +#: ../../library/sys.rst:579 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:550 +#: ../../library/sys.rst:582 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:585 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:558 +#: ../../library/sys.rst:590 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -839,15 +732,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:561 +#: ../../library/sys.rst:593 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:564 +#: ../../library/sys.rst:596 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:570 +#: ../../library/sys.rst:602 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -857,157 +750,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:577 +#: ../../library/sys.rst:609 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:612 +msgid "attribute" +msgstr "屬性" + +#: ../../library/sys.rst:613 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:582 ../../library/sys.rst:986 +#: ../../library/sys.rst:614 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:617 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:618 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:621 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:592 +#: ../../library/sys.rst:624 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:625 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:629 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:630 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:634 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:635 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:638 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:639 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:611 +#: ../../library/sys.rst:643 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:612 +#: ../../library/sys.rst:644 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:616 +#: ../../library/sys.rst:648 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:649 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:619 +#: ../../library/sys.rst:651 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:623 +#: ../../library/sys.rst:655 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:624 +#: ../../library/sys.rst:656 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:660 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:661 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:632 +#: ../../library/sys.rst:664 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:633 +#: ../../library/sys.rst:665 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:636 +#: ../../library/sys.rst:668 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:637 +#: ../../library/sys.rst:669 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:641 +#: ../../library/sys.rst:673 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:642 +#: ../../library/sys.rst:674 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:675 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:676 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:645 +#: ../../library/sys.rst:677 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:647 +#: ../../library/sys.rst:679 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:650 +#: ../../library/sys.rst:682 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -1015,13 +912,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:663 +#: ../../library/sys.rst:695 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:672 +#: ../../library/sys.rst:704 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1031,7 +928,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:685 +#: ../../library/sys.rst:717 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1041,42 +938,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:692 +#: ../../library/sys.rst:724 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:700 +#: ../../library/sys.rst:732 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:707 +#: ../../library/sys.rst:739 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:709 +#: ../../library/sys.rst:741 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:716 +#: ../../library/sys.rst:748 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:722 +#: ../../library/sys.rst:754 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:727 ../../library/sys.rst:1407 +#: ../../library/sys.rst:759 ../../library/sys.rst:1447 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:764 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:797 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1131,20 +1028,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:783 +#: ../../library/sys.rst:815 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:790 +#: ../../library/sys.rst:822 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:794 +#: ../../library/sys.rst:826 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1153,13 +1050,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:800 +#: ../../library/sys.rst:832 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:806 +#: ../../library/sys.rst:838 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1167,46 +1064,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:814 +#: ../../library/sys.rst:846 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:819 +#: ../../library/sys.rst:851 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:822 +#: ../../library/sys.rst:854 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:825 +#: ../../library/sys.rst:857 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:829 +#: ../../library/sys.rst:861 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:835 +#: ../../library/sys.rst:867 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:875 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1215,7 +1112,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:880 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1223,13 +1120,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:852 ../../library/sys.rst:868 +#: ../../library/sys.rst:884 ../../library/sys.rst:900 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:890 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1238,7 +1135,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:864 +#: ../../library/sys.rst:896 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1246,15 +1143,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:878 +#: ../../library/sys.rst:910 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:919 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:891 +#: ../../library/sys.rst:923 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1262,7 +1159,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:899 +#: ../../library/sys.rst:931 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1274,54 +1171,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:942 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:944 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:915 +#: ../../library/sys.rst:947 msgid "Constant" msgstr "" -#: ../../library/sys.rst:915 +#: ../../library/sys.rst:947 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:917 +#: ../../library/sys.rst:949 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:917 +#: ../../library/sys.rst:949 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:951 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:951 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:954 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:954 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:926 +#: ../../library/sys.rst:958 msgid "" -"This function wraps the Win32 :c:func:`GetVersionEx` function; see the " -"Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " +"This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " +"Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:930 +#: ../../library/sys.rst:962 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1329,24 +1226,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:936 +#: ../../library/sys.rst:968 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:974 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:946 +#: ../../library/sys.rst:978 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:952 +#: ../../library/sys.rst:984 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1356,103 +1253,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:959 +#: ../../library/sys.rst:991 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:963 ../../library/sys.rst:1609 +#: ../../library/sys.rst:995 ../../library/sys.rst:1649 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:1001 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:975 ../../library/sys.rst:1630 +#: ../../library/sys.rst:1007 ../../library/sys.rst:1670 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:981 +#: ../../library/sys.rst:1013 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:988 -msgid ":const:`width`" -msgstr ":const:`width`" - -#: ../../library/sys.rst:988 -msgid "width in bits used for hash values" +#: ../../library/sys.rst:1019 +msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:990 -msgid ":const:`modulus`" -msgstr ":const:`modulus`" - -#: ../../library/sys.rst:990 -msgid "prime modulus P used for numeric hash scheme" +#: ../../library/sys.rst:1023 +msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:992 -msgid ":const:`inf`" -msgstr ":const:`inf`" - -#: ../../library/sys.rst:992 -msgid "hash value returned for a positive infinity" +#: ../../library/sys.rst:1027 +msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:994 -msgid ":const:`nan`" -msgstr ":const:`nan`" - -#: ../../library/sys.rst:994 -msgid "(this attribute is no longer used)" +#: ../../library/sys.rst:1031 +msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:996 -msgid ":const:`imag`" -msgstr ":const:`imag`" - -#: ../../library/sys.rst:996 -msgid "multiplier used for the imaginary part of a complex number" +#: ../../library/sys.rst:1035 +msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:999 -msgid ":const:`algorithm`" -msgstr ":const:`algorithm`" - -#: ../../library/sys.rst:999 -msgid "name of the algorithm for hashing of str, bytes, and memoryview" +#: ../../library/sys.rst:1039 +msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1002 -msgid ":const:`hash_bits`" -msgstr ":const:`hash_bits`" - -#: ../../library/sys.rst:1002 -msgid "internal output size of the hash algorithm" +#: ../../library/sys.rst:1043 +msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1004 -msgid ":const:`seed_bits`" -msgstr ":const:`seed_bits`" - -#: ../../library/sys.rst:1004 -msgid "size of the seed key of the hash algorithm" +#: ../../library/sys.rst:1047 +msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1010 +#: ../../library/sys.rst:1051 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1016 +#: ../../library/sys.rst:1057 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1460,7 +1325,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1068 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1468,25 +1333,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1073 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1037 +#: ../../library/sys.rst:1078 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1041 +#: ../../library/sys.rst:1082 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1045 +#: ../../library/sys.rst:1086 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1498,13 +1363,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1096 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1058 +#: ../../library/sys.rst:1099 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1513,7 +1378,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1065 +#: ../../library/sys.rst:1106 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1523,61 +1388,49 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1076 +#: ../../library/sys.rst:1117 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1081 +#: ../../library/sys.rst:1122 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1089 -msgid ":const:`bits_per_digit`" -msgstr ":const:`bits_per_digit`" - -#: ../../library/sys.rst:1089 +#: ../../library/sys.rst:1127 msgid "" -"number of bits held in each digit. Python integers are stored internally in " -"base ``2**int_info.bits_per_digit``" +"The number of bits held in each digit. Python integers are stored internally " +"in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1093 -msgid ":const:`sizeof_digit`" -msgstr ":const:`sizeof_digit`" - -#: ../../library/sys.rst:1093 -msgid "size in bytes of the C type used to represent a digit" +#: ../../library/sys.rst:1132 +msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1096 -msgid ":const:`default_max_str_digits`" -msgstr ":const:`default_max_str_digits`" - -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1136 msgid "" -"default value for :func:`sys.get_int_max_str_digits` when it is not " +"The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1100 -msgid ":const:`str_digits_check_threshold`" -msgstr ":const:`str_digits_check_threshold`" - -#: ../../library/sys.rst:1100 +#: ../../library/sys.rst:1141 msgid "" -"minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" +"The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1108 -msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." -msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" +#: ../../library/sys.rst:1148 +msgid "" +"Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." +"str_digits_check_threshold`." +msgstr "" +"新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." +"str_digits_check_threshold`。" -#: ../../library/sys.rst:1114 +#: ../../library/sys.rst:1154 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1120 +#: ../../library/sys.rst:1160 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1594,13 +1447,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1162 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1131 +#: ../../library/sys.rst:1171 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1612,19 +1465,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1179 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1145 +#: ../../library/sys.rst:1185 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1192 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1635,34 +1488,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1166 +#: ../../library/sys.rst:1206 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1172 +#: ../../library/sys.rst:1212 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1179 +#: ../../library/sys.rst:1219 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1222 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1230 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1675,27 +1528,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1243 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1243 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1207 +#: ../../library/sys.rst:1247 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1206 +#: ../../library/sys.rst:1246 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1252 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1703,7 +1556,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1220 +#: ../../library/sys.rst:1260 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1715,78 +1568,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1232 +#: ../../library/sys.rst:1272 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1235 +#: ../../library/sys.rst:1275 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1244 +#: ../../library/sys.rst:1284 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1288 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1292 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1294 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1296 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1299 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1262 +#: ../../library/sys.rst:1302 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1268 +#: ../../library/sys.rst:1308 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1273 +#: ../../library/sys.rst:1313 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1277 ../../library/sys.rst:1288 +#: ../../library/sys.rst:1317 ../../library/sys.rst:1328 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1322 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1794,13 +1647,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1333 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1336 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1809,75 +1662,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1309 +#: ../../library/sys.rst:1349 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1352 msgid "System" msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1352 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1354 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1354 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1315 +#: ../../library/sys.rst:1355 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1315 +#: ../../library/sys.rst:1355 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1356 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1356 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1357 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1357 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1318 +#: ../../library/sys.rst:1358 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1318 +#: ../../library/sys.rst:1358 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1359 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1359 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1360 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1360 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1363 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1885,7 +1738,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1369 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1893,57 +1746,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1337 +#: ../../library/sys.rst:1377 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1340 +#: ../../library/sys.rst:1380 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1346 +#: ../../library/sys.rst:1386 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1389 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1393 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1395 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1398 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1400 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1408 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1952,14 +1805,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1374 +#: ../../library/sys.rst:1414 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1429 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1969,7 +1822,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1439 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1980,14 +1833,14 @@ msgid "" "const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1411 +#: ../../library/sys.rst:1451 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1463 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -2002,7 +1855,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1474 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2010,71 +1863,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1479 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1441 ../../library/sys.rst:1522 +#: ../../library/sys.rst:1481 ../../library/sys.rst:1562 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1445 ../../library/sys.rst:1527 +#: ../../library/sys.rst:1485 ../../library/sys.rst:1567 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1484 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1450 ../../library/sys.rst:1542 +#: ../../library/sys.rst:1490 ../../library/sys.rst:1582 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1448 +#: ../../library/sys.rst:1488 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1454 +#: ../../library/sys.rst:1494 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1493 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1457 +#: ../../library/sys.rst:1497 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1457 +#: ../../library/sys.rst:1497 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1499 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1460 +#: ../../library/sys.rst:1500 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1464 +#: ../../library/sys.rst:1504 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1468 +#: ../../library/sys.rst:1508 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2082,19 +1935,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1513 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1516 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1483 +#: ../../library/sys.rst:1523 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2105,7 +1958,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1540 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2114,7 +1967,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1505 +#: ../../library/sys.rst:1545 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2122,7 +1975,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1510 +#: ../../library/sys.rst:1550 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2130,41 +1983,41 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1515 +#: ../../library/sys.rst:1555 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1519 +#: ../../library/sys.rst:1559 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1525 +#: ../../library/sys.rst:1565 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1536 +#: ../../library/sys.rst:1576 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1530 +#: ../../library/sys.rst:1570 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " "the return value specifies the new local trace function. See :file:`Objects/" "lnotab_notes.txt` for a detailed explanation of how this works. Per-line " -"events may be disabled for a frame by setting :attr:`f_trace_lines` to :" -"const:`False` on that frame." +"events may be disabled for a frame by setting :attr:`!f_trace_lines` to :" +"const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1579 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2172,37 +2025,37 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1587 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1585 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1595 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1590 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " "value specifies the new local trace function. Per-opcode events are not " -"emitted by default: they must be explicitly requested by setting :attr:" -"`f_trace_opcodes` to :const:`True` on the frame." +"emitted by default: they must be explicitly requested by setting :attr:`!" +"f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1557 +#: ../../library/sys.rst:1597 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1560 +#: ../../library/sys.rst:1600 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2216,17 +2069,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1611 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1573 +#: ../../library/sys.rst:1613 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1577 +#: ../../library/sys.rst:1617 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2234,13 +2087,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1624 msgid "" -"``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" -"`f_trace_opcodes` attributes added to frames" +"``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" +"f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1629 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2249,7 +2102,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1635 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2257,7 +2110,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1637 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2265,20 +2118,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1639 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1602 +#: ../../library/sys.rst:1642 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1614 +#: ../../library/sys.rst:1654 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2287,105 +2140,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1661 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1665 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1635 +#: ../../library/sys.rst:1675 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1638 ../../library/sys.rst:1653 -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1678 ../../library/sys.rst:1693 +#: ../../library/sys.rst:1701 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1684 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1645 +#: ../../library/sys.rst:1685 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1689 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1651 +#: ../../library/sys.rst:1691 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1659 +#: ../../library/sys.rst:1699 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1667 +#: ../../library/sys.rst:1707 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1671 +#: ../../library/sys.rst:1711 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1674 +#: ../../library/sys.rst:1714 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1679 +#: ../../library/sys.rst:1719 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1686 +#: ../../library/sys.rst:1726 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1729 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1731 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1693 +#: ../../library/sys.rst:1733 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1735 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1739 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1702 +#: ../../library/sys.rst:1742 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2396,14 +2249,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1751 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1716 +#: ../../library/sys.rst:1756 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2412,7 +2265,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1723 +#: ../../library/sys.rst:1763 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2421,27 +2274,27 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1769 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1775 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1779 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " "replaced with file-like objects like :class:`io.StringIO` which do not " -"support the :attr:`~io.BufferedIOBase.buffer` attribute." +"support the :attr:!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1789 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2449,7 +2302,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1754 +#: ../../library/sys.rst:1794 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2457,7 +2310,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1800 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2465,12 +2318,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1808 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1770 +#: ../../library/sys.rst:1810 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2478,7 +2331,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1815 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2486,72 +2339,62 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1820 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1787 +#: ../../library/sys.rst:1827 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1795 -msgid ":const:`name`" -msgstr ":const:`name`" - -#: ../../library/sys.rst:1795 -msgid "Name of the thread implementation:" +#: ../../library/sys.rst:1832 +msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1797 -msgid "``'nt'``: Windows threads" +#: ../../library/sys.rst:1834 +#, fuzzy +msgid "``\"nt\"``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1798 -msgid "``'pthread'``: POSIX threads" +#: ../../library/sys.rst:1835 +#, fuzzy +msgid "``\"pthread\"``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1836 msgid "" -"``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " +"``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1801 -msgid "``'solaris'``: Solaris threads" +#: ../../library/sys.rst:1838 +msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1803 -msgid ":const:`lock`" -msgstr ":const:`lock`" - -#: ../../library/sys.rst:1803 -msgid "Name of the lock implementation:" +#: ../../library/sys.rst:1842 +msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1805 -msgid "``'semaphore'``: a lock uses a semaphore" +#: ../../library/sys.rst:1844 +msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1806 -msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" +#: ../../library/sys.rst:1845 +msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1846 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1810 -msgid ":const:`version`" -msgstr ":const:`version`" - -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1850 msgid "" -"Name and version of the thread library. It is a string, or ``None`` if this " -"information is unknown." +"The name and version of the thread library. It is a string, or ``None`` if " +"this information is unknown." msgstr "" -#: ../../library/sys.rst:1819 +#: ../../library/sys.rst:1858 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2560,73 +2403,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1827 +#: ../../library/sys.rst:1866 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1829 +#: ../../library/sys.rst:1868 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1833 +#: ../../library/sys.rst:1872 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1835 +#: ../../library/sys.rst:1874 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1875 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1837 +#: ../../library/sys.rst:1876 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1877 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1878 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1880 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1845 +#: ../../library/sys.rst:1884 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1889 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1893 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1897 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1862 +#: ../../library/sys.rst:1901 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2635,7 +2478,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1864 +#: ../../library/sys.rst:1903 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2643,7 +2486,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1873 +#: ../../library/sys.rst:1912 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2652,13 +2495,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1882 +#: ../../library/sys.rst:1921 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1888 +#: ../../library/sys.rst:1927 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2669,18 +2512,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1935 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1940 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1908 +#: ../../library/sys.rst:1947 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2689,25 +2532,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1919 +#: ../../library/sys.rst:1958 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1974 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1943 +#: ../../library/sys.rst:1982 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1944 +#: ../../library/sys.rst:1983 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2720,58 +2563,178 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:445 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:445 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:874 ../../library/sys.rst:1419 +#: ../../library/sys.rst:906 ../../library/sys.rst:1459 msgid "profile function" msgstr "" -#: ../../library/sys.rst:874 ../../library/sys.rst:1419 +#: ../../library/sys.rst:906 ../../library/sys.rst:1459 msgid "profiler" msgstr "" -#: ../../library/sys.rst:883 ../../library/sys.rst:1496 +#: ../../library/sys.rst:915 ../../library/sys.rst:1536 msgid "trace function" msgstr "" -#: ../../library/sys.rst:883 ../../library/sys.rst:1496 +#: ../../library/sys.rst:915 ../../library/sys.rst:1536 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "..." msgstr "..." + +#~ msgid "Attribute" +#~ msgstr "屬性" + +#~ msgid "Explanation" +#~ msgstr "解釋" + +#~ msgid ":const:`emscripten_version`" +#~ msgstr ":const:`emscripten_version`" + +#~ msgid ":const:`runtime`" +#~ msgstr ":const:`runtime`" + +#~ msgid ":const:`pthreads`" +#~ msgstr ":const:`pthreads`" + +#~ msgid ":const:`shared_memory`" +#~ msgstr ":const:`shared_memory`" + +#~ msgid "flag" +#~ msgstr "旗標" + +#~ msgid ":const:`debug`" +#~ msgstr ":const:`debug`" + +#~ msgid ":const:`inspect`" +#~ msgstr ":const:`inspect`" + +#~ msgid ":const:`interactive`" +#~ msgstr ":const:`interactive`" + +#~ msgid ":const:`isolated`" +#~ msgstr ":const:`isolated`" + +#~ msgid ":const:`optimize`" +#~ msgstr ":const:`optimize`" + +#~ msgid ":const:`dont_write_bytecode`" +#~ msgstr ":const:`dont_write_bytecode`" + +#~ msgid ":const:`no_user_site`" +#~ msgstr ":const:`no_user_site`" + +#~ msgid ":const:`no_site`" +#~ msgstr ":const:`no_site`" + +#~ msgid ":const:`ignore_environment`" +#~ msgstr ":const:`ignore_environment`" + +#~ msgid ":const:`verbose`" +#~ msgstr ":const:`verbose`" + +#~ msgid ":const:`bytes_warning`" +#~ msgstr ":const:`bytes_warning`" + +#~ msgid ":const:`quiet`" +#~ msgstr ":const:`quiet`" + +#~ msgid ":const:`hash_randomization`" +#~ msgstr ":const:`hash_randomization`" + +#~ msgid ":const:`dev_mode`" +#~ msgstr ":const:`dev_mode`" + +#~ msgid ":const:`utf8_mode`" +#~ msgstr ":const:`utf8_mode`" + +#~ msgid ":const:`safe_path`" +#~ msgstr ":const:`safe_path`" + +#~ msgid ":const:`int_max_str_digits`" +#~ msgstr ":const:`int_max_str_digits`" + +#~ msgid ":const:`warn_default_encoding`" +#~ msgstr ":const:`warn_default_encoding`" + +#~ msgid ":const:`width`" +#~ msgstr ":const:`width`" + +#~ msgid ":const:`modulus`" +#~ msgstr ":const:`modulus`" + +#~ msgid ":const:`inf`" +#~ msgstr ":const:`inf`" + +#~ msgid ":const:`nan`" +#~ msgstr ":const:`nan`" + +#~ msgid ":const:`imag`" +#~ msgstr ":const:`imag`" + +#~ msgid ":const:`algorithm`" +#~ msgstr ":const:`algorithm`" + +#~ msgid ":const:`hash_bits`" +#~ msgstr ":const:`hash_bits`" + +#~ msgid ":const:`seed_bits`" +#~ msgstr ":const:`seed_bits`" + +#~ msgid ":const:`bits_per_digit`" +#~ msgstr ":const:`bits_per_digit`" + +#~ msgid ":const:`sizeof_digit`" +#~ msgstr ":const:`sizeof_digit`" + +#~ msgid ":const:`default_max_str_digits`" +#~ msgstr ":const:`default_max_str_digits`" + +#~ msgid ":const:`str_digits_check_threshold`" +#~ msgstr ":const:`str_digits_check_threshold`" + +#~ msgid ":const:`name`" +#~ msgstr ":const:`name`" + +#~ msgid ":const:`lock`" +#~ msgstr ":const:`lock`" + +#~ msgid ":const:`version`" +#~ msgstr ":const:`version`" diff --git a/library/tarfile.po b/library/tarfile.po index b355c6558f..4accd94181 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+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-" @@ -988,8 +988,8 @@ msgid "" msgstr "" #: ../../library/tarfile.rst:708 ../../library/tarfile.rst:719 -#: ../../library/tarfile.rst:746 ../../library/tarfile.rst:757 -#: ../../library/tarfile.rst:768 ../../library/tarfile.rst:779 +#: ../../library/tarfile.rst:751 ../../library/tarfile.rst:762 +#: ../../library/tarfile.rst:773 ../../library/tarfile.rst:784 msgid "" "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`, causing extraction to skip applying this attribute." @@ -1014,87 +1014,94 @@ msgid "" "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:742 +#: ../../library/tarfile.rst:738 +msgid "" +"For symbolic links (``SYMTYPE``), the *linkname* is relative to the " +"directory that contains the link. For hard links (``LNKTYPE``), the " +"*linkname* is relative to the root of the archive." +msgstr "" + +#: ../../library/tarfile.rst:747 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:753 +#: ../../library/tarfile.rst:758 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:764 +#: ../../library/tarfile.rst:769 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:775 +#: ../../library/tarfile.rst:780 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:786 +#: ../../library/tarfile.rst:791 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:794 +#: ../../library/tarfile.rst:799 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:800 +#: ../../library/tarfile.rst:805 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:804 +#: ../../library/tarfile.rst:809 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:809 +#: ../../library/tarfile.rst:814 msgid "Return :const:`True` if the :class:`Tarinfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:814 +#: ../../library/tarfile.rst:819 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:819 +#: ../../library/tarfile.rst:824 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:824 +#: ../../library/tarfile.rst:829 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:829 +#: ../../library/tarfile.rst:834 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:834 +#: ../../library/tarfile.rst:839 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:839 +#: ../../library/tarfile.rst:844 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:844 +#: ../../library/tarfile.rst:849 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:849 +#: ../../library/tarfile.rst:854 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:855 +#: ../../library/tarfile.rst:860 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:859 +#: ../../library/tarfile.rst:864 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1104,66 +1111,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:867 +#: ../../library/tarfile.rst:872 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:873 +#: ../../library/tarfile.rst:878 msgid ":pep:`706`" msgstr "" -#: ../../library/tarfile.rst:874 +#: ../../library/tarfile.rst:879 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:881 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:879 +#: ../../library/tarfile.rst:884 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:884 +#: ../../library/tarfile.rst:889 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:888 +#: ../../library/tarfile.rst:893 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:892 +#: ../../library/tarfile.rst:897 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:894 +#: ../../library/tarfile.rst:899 msgid "" "If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " "fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " "matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:898 +#: ../../library/tarfile.rst:903 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:901 +#: ../../library/tarfile.rst:906 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1171,23 +1178,23 @@ msgid "" "members)::" msgstr "" -#: ../../library/tarfile.rst:908 +#: ../../library/tarfile.rst:913 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:912 +#: ../../library/tarfile.rst:917 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:914 +#: ../../library/tarfile.rst:919 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:915 +#: ../../library/tarfile.rst:920 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1195,118 +1202,118 @@ msgid "" "attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:921 +#: ../../library/tarfile.rst:926 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:923 +#: ../../library/tarfile.rst:928 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:928 +#: ../../library/tarfile.rst:933 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:930 +#: ../../library/tarfile.rst:935 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:934 +#: ../../library/tarfile.rst:939 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:936 +#: ../../library/tarfile.rst:941 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:937 +#: ../../library/tarfile.rst:942 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:941 +#: ../../library/tarfile.rst:946 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:944 +#: ../../library/tarfile.rst:949 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP`|:const:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:947 ../../library/tarfile.rst:980 +#: ../../library/tarfile.rst:952 ../../library/tarfile.rst:985 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:951 +#: ../../library/tarfile.rst:956 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:954 +#: ../../library/tarfile.rst:959 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:957 +#: ../../library/tarfile.rst:962 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:960 +#: ../../library/tarfile.rst:965 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:963 +#: ../../library/tarfile.rst:968 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:967 +#: ../../library/tarfile.rst:972 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:969 +#: ../../library/tarfile.rst:974 msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR`|:const:" "`~stat.S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:971 +#: ../../library/tarfile.rst:976 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP`|:" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:975 +#: ../../library/tarfile.rst:980 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:977 +#: ../../library/tarfile.rst:982 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:991 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:988 +#: ../../library/tarfile.rst:993 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1315,11 +1322,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:996 +#: ../../library/tarfile.rst:1001 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:998 +#: ../../library/tarfile.rst:1003 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1327,69 +1334,69 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1003 +#: ../../library/tarfile.rst:1008 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1005 +#: ../../library/tarfile.rst:1010 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: ../../library/tarfile.rst:1008 +#: ../../library/tarfile.rst:1013 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1010 +#: ../../library/tarfile.rst:1015 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: ../../library/tarfile.rst:1013 +#: ../../library/tarfile.rst:1018 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1015 +#: ../../library/tarfile.rst:1020 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1017 +#: ../../library/tarfile.rst:1022 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1019 +#: ../../library/tarfile.rst:1024 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1021 +#: ../../library/tarfile.rst:1026 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1025 +#: ../../library/tarfile.rst:1030 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1031 +#: ../../library/tarfile.rst:1036 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1033 +#: ../../library/tarfile.rst:1038 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1397,163 +1404,163 @@ msgid "" "version." msgstr "" -#: ../../library/tarfile.rst:1038 +#: ../../library/tarfile.rst:1043 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1042 +#: ../../library/tarfile.rst:1047 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1047 +#: ../../library/tarfile.rst:1052 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1054 +#: ../../library/tarfile.rst:1059 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1058 +#: ../../library/tarfile.rst:1063 msgid "or::" msgstr "" -#: ../../library/tarfile.rst:1063 +#: ../../library/tarfile.rst:1068 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1074 +#: ../../library/tarfile.rst:1079 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1076 +#: ../../library/tarfile.rst:1081 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1083 +#: ../../library/tarfile.rst:1088 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1105 +#: ../../library/tarfile.rst:1110 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:1109 +#: ../../library/tarfile.rst:1114 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1112 +#: ../../library/tarfile.rst:1117 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1119 +#: ../../library/tarfile.rst:1124 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1125 +#: ../../library/tarfile.rst:1130 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1132 +#: ../../library/tarfile.rst:1137 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1139 +#: ../../library/tarfile.rst:1144 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1147 +#: ../../library/tarfile.rst:1152 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:1152 +#: ../../library/tarfile.rst:1157 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1157 +#: ../../library/tarfile.rst:1162 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1162 +#: ../../library/tarfile.rst:1167 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1167 +#: ../../library/tarfile.rst:1172 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1171 +#: ../../library/tarfile.rst:1176 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1175 +#: ../../library/tarfile.rst:1180 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: ../../library/tarfile.rst:1183 +#: ../../library/tarfile.rst:1188 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:1185 +#: ../../library/tarfile.rst:1190 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:1192 +#: ../../library/tarfile.rst:1197 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:1207 +#: ../../library/tarfile.rst:1212 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:1215 +#: ../../library/tarfile.rst:1220 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:1222 +#: ../../library/tarfile.rst:1227 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:1236 +#: ../../library/tarfile.rst:1241 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1252 +#: ../../library/tarfile.rst:1257 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:1254 +#: ../../library/tarfile.rst:1259 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:1256 +#: ../../library/tarfile.rst:1261 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1561,7 +1568,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:1261 +#: ../../library/tarfile.rst:1266 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1569,7 +1576,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:1266 +#: ../../library/tarfile.rst:1271 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1580,7 +1587,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:1274 +#: ../../library/tarfile.rst:1279 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1589,13 +1596,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:1280 +#: ../../library/tarfile.rst:1285 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:1283 +#: ../../library/tarfile.rst:1288 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1604,17 +1611,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:1288 +#: ../../library/tarfile.rst:1293 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:1294 +#: ../../library/tarfile.rst:1299 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:1296 +#: ../../library/tarfile.rst:1301 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1629,13 +1636,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:1308 +#: ../../library/tarfile.rst:1313 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:1311 +#: ../../library/tarfile.rst:1316 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1644,7 +1651,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:1317 +#: ../../library/tarfile.rst:1322 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1652,7 +1659,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:1322 +#: ../../library/tarfile.rst:1327 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/textwrap.po b/library/textwrap.po index 30be1a125a..b3e2baf799 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+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-" @@ -75,7 +75,7 @@ msgid "" "First the whitespace in *text* is collapsed (all whitespace is replaced by " "single spaces). If the result fits in the *width*, it is returned. " "Otherwise, enough words are dropped from the end so that the remaining words " -"plus the :attr:`.placeholder` fit within :attr:`.width`::" +"plus the *placeholder* fit within *width*::" msgstr "" #: ../../library/textwrap.rst:72 diff --git a/library/timeit.po b/library/timeit.po index d813034cd4..3682b031a4 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgid "" msgstr "" #: ../../library/timeit.rst:72 ../../library/timeit.rst:83 -#: ../../library/timeit.rst:120 +#: ../../library/timeit.rst:122 msgid "The optional *globals* parameter was added." msgstr "新增 *globals* 選用參數。" @@ -90,23 +90,25 @@ msgid "" "namespace in which to execute the code." msgstr "" -#: ../../library/timeit.rst:86 ../../library/timeit.rst:181 +#: ../../library/timeit.rst:86 ../../library/timeit.rst:183 msgid "Default value of *repeat* changed from 3 to 5." msgstr "" -#: ../../library/timeit.rst:91 -msgid "The default timer, which is always :func:`time.perf_counter`." +#: ../../library/timeit.rst:92 +msgid "" +"The default timer, which is always time.perf_counter(), returns float " +"seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." msgstr "" -#: ../../library/timeit.rst:93 +#: ../../library/timeit.rst:95 msgid ":func:`time.perf_counter` is now the default timer." msgstr "" -#: ../../library/timeit.rst:99 +#: ../../library/timeit.rst:101 msgid "Class for timing execution speed of small code snippets." msgstr "" -#: ../../library/timeit.rst:101 +#: ../../library/timeit.rst:103 msgid "" "The constructor takes a statement to be timed, an additional statement used " "for setup, and a timer function. Both statements default to ``'pass'``; the " @@ -117,20 +119,20 @@ msgid "" "controlled by passing a namespace to *globals*." msgstr "" -#: ../../library/timeit.rst:109 +#: ../../library/timeit.rst:111 msgid "" "To measure the execution time of the first statement, use the :meth:`." "timeit` method. The :meth:`.repeat` and :meth:`.autorange` methods are " "convenience methods to call :meth:`.timeit` multiple times." msgstr "" -#: ../../library/timeit.rst:113 +#: ../../library/timeit.rst:115 msgid "" "The execution time of *setup* is excluded from the overall timed execution " "run." msgstr "" -#: ../../library/timeit.rst:115 +#: ../../library/timeit.rst:117 msgid "" "The *stmt* and *setup* parameters can also take objects that are callable " "without arguments. This will embed calls to them in a timer function that " @@ -138,17 +140,17 @@ msgid "" "a little larger in this case because of the extra function calls." msgstr "" -#: ../../library/timeit.rst:125 +#: ../../library/timeit.rst:127 msgid "" "Time *number* executions of the main statement. This executes the setup " "statement once, and then returns the time it takes to execute the main " -"statement a number of times, measured in seconds as a float. The argument is " -"the number of times through the loop, defaulting to one million. The main " -"statement, the setup statement and the timer function to be used are passed " -"to the constructor." +"statement a number of times. The default timer returns seconds as a float. " +"The argument is the number of times through the loop, defaulting to one " +"million. The main statement, the setup statement and the timer function to " +"be used are passed to the constructor." msgstr "" -#: ../../library/timeit.rst:134 +#: ../../library/timeit.rst:136 msgid "" "By default, :meth:`.timeit` temporarily turns off :term:`garbage collection` " "during the timing. The advantage of this approach is that it makes " @@ -158,11 +160,11 @@ msgid "" "example::" msgstr "" -#: ../../library/timeit.rst:146 +#: ../../library/timeit.rst:148 msgid "Automatically determine how many times to call :meth:`.timeit`." msgstr "" -#: ../../library/timeit.rst:148 +#: ../../library/timeit.rst:150 msgid "" "This is a convenience function that calls :meth:`.timeit` repeatedly so that " "the total time >= 0.2 second, returning the eventual (number of loops, time " @@ -171,17 +173,17 @@ msgid "" "at least 0.2 second." msgstr "" -#: ../../library/timeit.rst:154 +#: ../../library/timeit.rst:156 msgid "" "If *callback* is given and is not ``None``, it will be called after each " "trial with two arguments: ``callback(number, time_taken)``." msgstr "" -#: ../../library/timeit.rst:162 +#: ../../library/timeit.rst:164 msgid "Call :meth:`.timeit` a few times." msgstr "" -#: ../../library/timeit.rst:164 +#: ../../library/timeit.rst:166 msgid "" "This is a convenience function that calls the :meth:`.timeit` repeatedly, " "returning a list of results. The first argument specifies how many times to " @@ -189,7 +191,7 @@ msgid "" "for :meth:`.timeit`." msgstr "" -#: ../../library/timeit.rst:171 +#: ../../library/timeit.rst:173 msgid "" "It's tempting to calculate mean and standard deviation from the result " "vector and report these. However, this is not very useful. In a typical " @@ -201,67 +203,67 @@ msgid "" "entire vector and apply common sense rather than statistics." msgstr "" -#: ../../library/timeit.rst:187 +#: ../../library/timeit.rst:189 msgid "Helper to print a traceback from the timed code." msgstr "" -#: ../../library/timeit.rst:189 +#: ../../library/timeit.rst:191 msgid "Typical use::" msgstr "" -#: ../../library/timeit.rst:197 +#: ../../library/timeit.rst:199 msgid "" "The advantage over the standard traceback is that source lines in the " "compiled template will be displayed. The optional *file* argument directs " "where the traceback is sent; it defaults to :data:`sys.stderr`." msgstr "" -#: ../../library/timeit.rst:205 +#: ../../library/timeit.rst:207 msgid "Command-Line Interface" msgstr "命令執行列介面" -#: ../../library/timeit.rst:207 +#: ../../library/timeit.rst:209 msgid "" "When called as a program from the command line, the following form is used::" msgstr "" -#: ../../library/timeit.rst:211 +#: ../../library/timeit.rst:213 msgid "Where the following options are understood:" msgstr "" -#: ../../library/timeit.rst:217 +#: ../../library/timeit.rst:219 msgid "how many times to execute 'statement'" msgstr "" -#: ../../library/timeit.rst:221 +#: ../../library/timeit.rst:223 msgid "how many times to repeat the timer (default 5)" msgstr "" -#: ../../library/timeit.rst:225 +#: ../../library/timeit.rst:227 msgid "statement to be executed once initially (default ``pass``)" msgstr "" -#: ../../library/timeit.rst:229 +#: ../../library/timeit.rst:231 msgid "" "measure process time, not wallclock time, using :func:`time.process_time` " "instead of :func:`time.perf_counter`, which is the default" msgstr "" -#: ../../library/timeit.rst:236 +#: ../../library/timeit.rst:238 msgid "" "specify a time unit for timer output; can select ``nsec``, ``usec``, " "``msec``, or ``sec``" msgstr "" -#: ../../library/timeit.rst:242 +#: ../../library/timeit.rst:244 msgid "print raw timing results; repeat for more digits precision" msgstr "" -#: ../../library/timeit.rst:246 +#: ../../library/timeit.rst:248 msgid "print a short usage message and exit" msgstr "" -#: ../../library/timeit.rst:248 +#: ../../library/timeit.rst:250 msgid "" "A multi-line statement may be given by specifying each line as a separate " "statement argument; indented lines are possible by enclosing an argument in " @@ -269,14 +271,14 @@ msgid "" "similarly." msgstr "" -#: ../../library/timeit.rst:253 +#: ../../library/timeit.rst:255 msgid "" "If :option:`-n` is not given, a suitable number of loops is calculated by " "trying increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until " "the total time is at least 0.2 seconds." msgstr "" -#: ../../library/timeit.rst:257 +#: ../../library/timeit.rst:259 msgid "" ":func:`default_timer` measurements can be affected by other programs running " "on the same machine, so the best thing to do when accurate timing is " @@ -286,7 +288,7 @@ msgid "" "measure CPU time." msgstr "" -#: ../../library/timeit.rst:265 +#: ../../library/timeit.rst:267 msgid "" "There is a certain baseline overhead associated with executing a pass " "statement. The code here doesn't try to hide it, but you should be aware of " @@ -294,17 +296,17 @@ msgid "" "arguments, and it might differ between Python versions." msgstr "" -#: ../../library/timeit.rst:274 +#: ../../library/timeit.rst:276 msgid "Examples" msgstr "範例" -#: ../../library/timeit.rst:276 +#: ../../library/timeit.rst:278 msgid "" "It is possible to provide a setup statement that is executed only once at " "the beginning:" msgstr "" -#: ../../library/timeit.rst:285 +#: ../../library/timeit.rst:287 msgid "" "In the output, there are three fields. The loop count, which tells you how " "many times the statement body was run per timing loop repetition. The " @@ -314,24 +316,24 @@ msgid "" "repetition took divided by the loop count." msgstr "" -#: ../../library/timeit.rst:300 +#: ../../library/timeit.rst:302 msgid "The same can be done using the :class:`Timer` class and its methods::" msgstr "" -#: ../../library/timeit.rst:310 +#: ../../library/timeit.rst:312 msgid "" "The following examples show how to time expressions that contain multiple " "lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" "keyword:`except` to test for missing and present object attributes:" msgstr "" -#: ../../library/timeit.rst:356 +#: ../../library/timeit.rst:358 msgid "" "To give the :mod:`timeit` module access to functions you define, you can " "pass a *setup* parameter which contains an import statement::" msgstr "" -#: ../../library/timeit.rst:367 +#: ../../library/timeit.rst:369 msgid "" "Another option is to pass :func:`globals` to the *globals* parameter, which " "will cause the code to be executed within your current global namespace. " diff --git a/reference/datamodel.po b/reference/datamodel.po index fea062ec1b..45236e1665 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-26 00:03+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-" @@ -158,11 +158,11 @@ msgid "" "future." msgstr "" -#: ../../reference/datamodel.rst:145 ../../reference/datamodel.rst:150 +#: ../../reference/datamodel.rst:146 ../../reference/datamodel.rst:148 msgid "None" msgstr "" -#: ../../reference/datamodel.rst:147 +#: ../../reference/datamodel.rst:150 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the built-in name ``None``. It is used to " @@ -170,11 +170,11 @@ msgid "" "functions that don't explicitly return anything. Its truth value is false." msgstr "" -#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:170 +#: ../../reference/datamodel.rst:157 ../../reference/datamodel.rst:159 msgid "NotImplemented" msgstr "NotImplemented" -#: ../../reference/datamodel.rst:155 +#: ../../reference/datamodel.rst:161 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the built-in name ``NotImplemented``. " @@ -184,33 +184,33 @@ msgid "" "the operator.) It should not be evaluated in a boolean context." msgstr "" -#: ../../reference/datamodel.rst:162 +#: ../../reference/datamodel.rst:168 msgid "See :ref:`implementing-the-arithmetic-operations` for more details." msgstr "更多細節請見 :ref:`implementing-the-arithmetic-operations`\\ 。" -#: ../../reference/datamodel.rst:166 +#: ../../reference/datamodel.rst:172 msgid "" "Evaluating ``NotImplemented`` in a boolean context is deprecated. While it " "currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " "will raise a :exc:`TypeError` in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:173 ../../reference/datamodel.rst:179 +#: ../../reference/datamodel.rst:179 ../../reference/datamodel.rst:180 msgid "Ellipsis" msgstr "" -#: ../../reference/datamodel.rst:177 +#: ../../reference/datamodel.rst:184 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the literal ``...`` or the built-in name " "``Ellipsis``. Its truth value is true." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:190 msgid ":class:`numbers.Number`" msgstr ":class:`numbers.Number`" -#: ../../reference/datamodel.rst:184 +#: ../../reference/datamodel.rst:194 msgid "" "These are created by numeric literals and returned as results by arithmetic " "operators and arithmetic built-in functions. Numeric objects are immutable; " @@ -219,64 +219,71 @@ msgid "" "numerical representation in computers." msgstr "" -#: ../../reference/datamodel.rst:190 +#: ../../reference/datamodel.rst:200 msgid "" "The string representations of the numeric classes, computed by :meth:" "`~object.__repr__` and :meth:`~object.__str__`, have the following " "properties:" msgstr "" -#: ../../reference/datamodel.rst:194 +#: ../../reference/datamodel.rst:204 msgid "" "They are valid numeric literals which, when passed to their class " "constructor, produce an object having the value of the original numeric." msgstr "" -#: ../../reference/datamodel.rst:198 +#: ../../reference/datamodel.rst:208 msgid "The representation is in base 10, when possible." msgstr "" -#: ../../reference/datamodel.rst:200 +#: ../../reference/datamodel.rst:210 msgid "" "Leading zeros, possibly excepting a single zero before a decimal point, are " "not shown." msgstr "" -#: ../../reference/datamodel.rst:203 +#: ../../reference/datamodel.rst:213 msgid "" "Trailing zeros, possibly excepting a single zero after a decimal point, are " "not shown." msgstr "" -#: ../../reference/datamodel.rst:206 +#: ../../reference/datamodel.rst:216 msgid "A sign is shown only when the number is negative." msgstr "" -#: ../../reference/datamodel.rst:208 +#: ../../reference/datamodel.rst:218 msgid "" "Python distinguishes between integers, floating point numbers, and complex " "numbers:" msgstr "" -#: ../../reference/datamodel.rst:241 +#: ../../reference/datamodel.rst:223 msgid ":class:`numbers.Integral`" msgstr ":class:`numbers.Integral`" -#: ../../reference/datamodel.rst:214 +#: ../../reference/datamodel.rst:227 msgid "" "These represent elements from the mathematical set of integers (positive and " "negative)." msgstr "" -#: ../../reference/datamodel.rst:217 +#: ../../reference/datamodel.rst:233 +msgid "" +"The rules for integer representation are intended to give the most " +"meaningful interpretation of shift and mask operations involving negative " +"integers." +msgstr "" + +#: ../../reference/datamodel.rst:236 msgid "There are two types of integers:" msgstr "" -#: ../../reference/datamodel.rst:224 +#: ../../reference/datamodel.rst:243 msgid "Integers (:class:`int`)" msgstr "" -#: ../../reference/datamodel.rst:220 +#: ../../reference/datamodel.rst:239 msgid "" "These represent numbers in an unlimited range, subject to available " "(virtual) memory only. For the purpose of shift and mask operations, a " @@ -285,11 +292,11 @@ msgid "" "sign bits extending to the left." msgstr "" -#: ../../reference/datamodel.rst:236 +#: ../../reference/datamodel.rst:256 msgid "Booleans (:class:`bool`)" msgstr "" -#: ../../reference/datamodel.rst:232 +#: ../../reference/datamodel.rst:251 msgid "" "These represent the truth values False and True. The two objects " "representing the values ``False`` and ``True`` are the only Boolean objects. " @@ -299,18 +306,11 @@ msgid "" "``\"True\"`` are returned, respectively." msgstr "" -#: ../../reference/datamodel.rst:240 -msgid "" -"The rules for integer representation are intended to give the most " -"meaningful interpretation of shift and mask operations involving negative " -"integers." -msgstr "" - -#: ../../reference/datamodel.rst:256 +#: ../../reference/datamodel.rst:259 msgid ":class:`numbers.Real` (:class:`float`)" msgstr ":class:`numbers.Real` (:class:`float`)" -#: ../../reference/datamodel.rst:250 +#: ../../reference/datamodel.rst:267 msgid "" "These represent machine-level double precision floating point numbers. You " "are at the mercy of the underlying machine architecture (and C or Java " @@ -321,11 +321,11 @@ msgid "" "complicate the language with two kinds of floating point numbers." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:277 msgid ":class:`numbers.Complex` (:class:`complex`)" msgstr ":class:`numbers.Complex` (:class:`complex`)" -#: ../../reference/datamodel.rst:263 +#: ../../reference/datamodel.rst:283 msgid "" "These represent complex numbers as a pair of machine-level double precision " "floating point numbers. The same caveats apply as for floating point " @@ -333,11 +333,11 @@ msgid "" "retrieved through the read-only attributes ``z.real`` and ``z.imag``." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:290 msgid "Sequences" msgstr "" -#: ../../reference/datamodel.rst:276 +#: ../../reference/datamodel.rst:299 msgid "" "These represent finite ordered sets indexed by non-negative numbers. The " "built-in function :func:`len` returns the number of items of a sequence. " @@ -345,7 +345,7 @@ msgid "" "1, ..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``." msgstr "" -#: ../../reference/datamodel.rst:283 +#: ../../reference/datamodel.rst:306 msgid "" "Sequences also support slicing: ``a[i:j]`` selects all items with index *k* " "such that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is " @@ -353,22 +353,22 @@ msgid "" "so that it starts at 0." msgstr "" -#: ../../reference/datamodel.rst:288 +#: ../../reference/datamodel.rst:311 msgid "" "Some sequences also support \"extended slicing\" with a third \"step\" " "parameter: ``a[i:j:k]`` selects all items of *a* with index *x* where ``x = " "i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<`` *j*." msgstr "" -#: ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:315 msgid "Sequences are distinguished according to their mutability:" msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:319 msgid "Immutable sequences" msgstr "" -#: ../../reference/datamodel.rst:299 +#: ../../reference/datamodel.rst:325 msgid "" "An object of an immutable sequence type cannot change once it is created. " "(If the object contains references to other objects, these other objects may " @@ -376,15 +376,15 @@ msgid "" "referenced by an immutable object cannot change.)" msgstr "" -#: ../../reference/datamodel.rst:304 +#: ../../reference/datamodel.rst:330 msgid "The following types are immutable sequences:" msgstr "" -#: ../../reference/datamodel.rst:327 +#: ../../reference/datamodel.rst:353 msgid "Strings" msgstr "字串 (String)" -#: ../../reference/datamodel.rst:317 +#: ../../reference/datamodel.rst:343 msgid "" "A string is a sequence of values that represent Unicode code points. All the " "code points in the range ``U+0000 - U+10FFFF`` can be represented in a " @@ -398,11 +398,11 @@ msgid "" "to achieve the opposite." msgstr "" -#: ../../reference/datamodel.rst:340 +#: ../../reference/datamodel.rst:366 msgid "Tuples" msgstr "" -#: ../../reference/datamodel.rst:335 +#: ../../reference/datamodel.rst:361 msgid "" "The items of a tuple are arbitrary Python objects. Tuples of two or more " "items are formed by comma-separated lists of expressions. A tuple of one " @@ -412,11 +412,11 @@ msgid "" "empty pair of parentheses." msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:376 msgid "Bytes" msgstr "" -#: ../../reference/datamodel.rst:345 +#: ../../reference/datamodel.rst:371 msgid "" "A bytes object is an immutable array. The items are 8-bit bytes, " "represented by integers in the range 0 <= x < 256. Bytes literals (like " @@ -425,37 +425,43 @@ msgid "" "the :meth:`~bytes.decode` method." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:379 msgid "Mutable sequences" msgstr "" -#: ../../reference/datamodel.rst:359 +#: ../../reference/datamodel.rst:388 msgid "" "Mutable sequences can be changed after they are created. The subscription " "and slicing notations can be used as the target of assignment and :keyword:" "`del` (delete) statements." msgstr "" -#: ../../reference/datamodel.rst:363 +#: ../../reference/datamodel.rst:396 +msgid "" +"The :mod:`collections` and :mod:`array` module provide additional examples " +"of mutable sequence types." +msgstr "" + +#: ../../reference/datamodel.rst:399 msgid "There are currently two intrinsic mutable sequence types:" msgstr "" -#: ../../reference/datamodel.rst:370 +#: ../../reference/datamodel.rst:406 msgid "Lists" msgstr "List(串列)" -#: ../../reference/datamodel.rst:368 +#: ../../reference/datamodel.rst:404 msgid "" "The items of a list are arbitrary Python objects. Lists are formed by " "placing a comma-separated list of expressions in square brackets. (Note that " "there are no special cases needed to form lists of length 0 or 1.)" msgstr "" -#: ../../reference/datamodel.rst:378 +#: ../../reference/datamodel.rst:415 msgid "Byte Arrays" msgstr "" -#: ../../reference/datamodel.rst:375 +#: ../../reference/datamodel.rst:411 msgid "" "A bytearray object is a mutable array. They are created by the built-in :" "func:`bytearray` constructor. Aside from being mutable (and hence " @@ -463,17 +469,11 @@ msgid "" "functionality as immutable :class:`bytes` objects." msgstr "" -#: ../../reference/datamodel.rst:382 -msgid "" -"The extension module :mod:`array` provides an additional example of a " -"mutable sequence type, as does the :mod:`collections` module." -msgstr "" - -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:418 msgid "Set types" msgstr "" -#: ../../reference/datamodel.rst:390 +#: ../../reference/datamodel.rst:424 msgid "" "These represent unordered, finite sets of unique, immutable objects. As " "such, they cannot be indexed by any subscript. However, they can be iterated " @@ -483,7 +483,7 @@ msgid "" "union, difference, and symmetric difference." msgstr "" -#: ../../reference/datamodel.rst:397 +#: ../../reference/datamodel.rst:431 msgid "" "For set elements, the same immutability rules apply as for dictionary keys. " "Note that numeric types obey the normal rules for numeric comparison: if two " @@ -491,37 +491,37 @@ msgid "" "contained in a set." msgstr "" -#: ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:436 msgid "There are currently two intrinsic set types:" msgstr "" -#: ../../reference/datamodel.rst:409 +#: ../../reference/datamodel.rst:445 msgid "Sets" msgstr "" -#: ../../reference/datamodel.rst:407 +#: ../../reference/datamodel.rst:442 msgid "" "These represent a mutable set. They are created by the built-in :func:`set` " "constructor and can be modified afterwards by several methods, such as :meth:" "`~set.add`." msgstr "" -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:454 msgid "Frozen sets" msgstr "" -#: ../../reference/datamodel.rst:414 +#: ../../reference/datamodel.rst:450 msgid "" "These represent an immutable set. They are created by the built-in :func:" "`frozenset` constructor. As a frozenset is immutable and :term:`hashable`, " "it can be used again as an element of another set, or as a dictionary key." msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:457 msgid "Mappings" msgstr "" -#: ../../reference/datamodel.rst:425 +#: ../../reference/datamodel.rst:464 msgid "" "These represent finite sets of objects indexed by arbitrary index sets. The " "subscript notation ``a[k]`` selects the item indexed by ``k`` from the " @@ -530,15 +530,15 @@ msgid "" "returns the number of items in a mapping." msgstr "" -#: ../../reference/datamodel.rst:431 +#: ../../reference/datamodel.rst:470 msgid "There is currently a single intrinsic mapping type:" msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:474 msgid "Dictionaries" msgstr "字典" -#: ../../reference/datamodel.rst:436 +#: ../../reference/datamodel.rst:478 msgid "" "These represent finite sets of objects indexed by nearly arbitrary values. " "The only types of values not acceptable as keys are values containing lists " @@ -550,7 +550,7 @@ msgid "" "interchangeably to index the same dictionary entry." msgstr "" -#: ../../reference/datamodel.rst:445 +#: ../../reference/datamodel.rst:487 msgid "" "Dictionaries preserve insertion order, meaning that keys will be produced in " "the same order they were added sequentially over the dictionary. Replacing " @@ -558,159 +558,159 @@ msgid "" "inserting it will add it to the end instead of keeping its old place." msgstr "" -#: ../../reference/datamodel.rst:450 +#: ../../reference/datamodel.rst:492 msgid "" "Dictionaries are mutable; they can be created by the ``{...}`` notation (see " "section :ref:`dict`)." msgstr "" -#: ../../reference/datamodel.rst:457 +#: ../../reference/datamodel.rst:499 msgid "" "The extension modules :mod:`dbm.ndbm` and :mod:`dbm.gnu` provide additional " "examples of mapping types, as does the :mod:`collections` module." msgstr "" -#: ../../reference/datamodel.rst:461 +#: ../../reference/datamodel.rst:503 msgid "" "Dictionaries did not preserve insertion order in versions of Python before " "3.6. In CPython 3.6, insertion order was preserved, but it was considered an " "implementation detail at that time rather than a language guarantee." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:510 msgid "Callable types" msgstr "" -#: ../../reference/datamodel.rst:473 +#: ../../reference/datamodel.rst:518 msgid "" "These are the types to which the function call operation (see section :ref:" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:586 +#: ../../reference/datamodel.rst:523 msgid "User-defined functions" msgstr "" -#: ../../reference/datamodel.rst:482 +#: ../../reference/datamodel.rst:530 msgid "" "A user-defined function object is created by a function definition (see " "section :ref:`function`). It should be called with an argument list " "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:487 ../../reference/datamodel.rst:849 +#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:926 msgid "Special attributes:" msgstr "" -#: ../../reference/datamodel.rst:506 +#: ../../reference/datamodel.rst:554 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:506 +#: ../../reference/datamodel.rst:554 msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:769 -#: ../../reference/datamodel.rst:865 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:843 +#: ../../reference/datamodel.rst:942 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" -#: ../../reference/datamodel.rst:508 +#: ../../reference/datamodel.rst:556 msgid "" "The function's documentation string, or ``None`` if unavailable; not " "inherited by subclasses." msgstr "" -#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:513 -#: ../../reference/datamodel.rst:516 ../../reference/datamodel.rst:521 -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:531 -#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:552 -#: ../../reference/datamodel.rst:562 ../../reference/datamodel.rst:565 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:569 +#: ../../reference/datamodel.rst:573 ../../reference/datamodel.rst:579 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:610 ../../reference/datamodel.rst:613 msgid "Writable" msgstr "" -#: ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:561 msgid ":attr:`~definition.\\ __name__`" msgstr ":attr:`~definition.\\ __name__`" -#: ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:561 msgid "The function's name." msgstr "" -#: ../../reference/datamodel.rst:516 +#: ../../reference/datamodel.rst:564 msgid ":attr:`~definition.\\ __qualname__`" msgstr ":attr:`~definition.\\ __qualname__`" -#: ../../reference/datamodel.rst:516 +#: ../../reference/datamodel.rst:564 msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:521 ../../reference/datamodel.rst:855 +#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:932 msgid ":attr:`__module__`" msgstr ":attr:`__module__`" -#: ../../reference/datamodel.rst:521 +#: ../../reference/datamodel.rst:569 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:573 msgid ":attr:`__defaults__`" msgstr ":attr:`__defaults__`" -#: ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:573 msgid "" "A tuple containing default argument values for those arguments that have " "defaults, or ``None`` if no arguments have a default value." msgstr "" -#: ../../reference/datamodel.rst:531 +#: ../../reference/datamodel.rst:579 msgid ":attr:`__code__`" msgstr ":attr:`__code__`" -#: ../../reference/datamodel.rst:531 +#: ../../reference/datamodel.rst:579 msgid "The code object representing the compiled function body." msgstr "" -#: ../../reference/datamodel.rst:534 +#: ../../reference/datamodel.rst:582 msgid ":attr:`__globals__`" msgstr ":attr:`__globals__`" -#: ../../reference/datamodel.rst:534 +#: ../../reference/datamodel.rst:582 msgid "" "A reference to the dictionary that holds the function's global variables --- " "the global namespace of the module in which the function was defined." msgstr "" -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:582 ../../reference/datamodel.rst:593 msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:935 msgid ":attr:`~object.__dict__`" msgstr ":attr:`~object.__dict__`" -#: ../../reference/datamodel.rst:541 +#: ../../reference/datamodel.rst:589 msgid "The namespace supporting arbitrary function attributes." msgstr "" -#: ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:593 msgid ":attr:`__closure__`" msgstr ":attr:`__closure__`" -#: ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:593 msgid "" "``None`` or a tuple of cells that contain bindings for the function's free " "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:552 ../../reference/datamodel.rst:784 -#: ../../reference/datamodel.rst:872 +#: ../../reference/datamodel.rst:600 ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:949 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" -#: ../../reference/datamodel.rst:552 +#: ../../reference/datamodel.rst:600 msgid "" "A dict containing annotations of parameters. The keys of the dict are the " "parameter names, and ``'return'`` for the return annotation, if provided. " @@ -718,31 +718,31 @@ msgid "" "howto`." msgstr "" -#: ../../reference/datamodel.rst:562 +#: ../../reference/datamodel.rst:610 msgid ":attr:`__kwdefaults__`" msgstr ":attr:`__kwdefaults__`" -#: ../../reference/datamodel.rst:562 +#: ../../reference/datamodel.rst:610 msgid "A dict containing defaults for keyword-only parameters." msgstr "" -#: ../../reference/datamodel.rst:565 ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:613 ../../reference/datamodel.rst:954 msgid ":attr:`__type_params__`" msgstr ":attr:`__type_params__`" -#: ../../reference/datamodel.rst:565 +#: ../../reference/datamodel.rst:613 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic function `." msgstr "" -#: ../../reference/datamodel.rst:572 +#: ../../reference/datamodel.rst:620 msgid "" "Most of the attributes labelled \"Writable\" check the type of the assigned " "value." msgstr "" -#: ../../reference/datamodel.rst:574 +#: ../../reference/datamodel.rst:622 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " @@ -752,30 +752,30 @@ msgid "" "future.*" msgstr "" -#: ../../reference/datamodel.rst:580 +#: ../../reference/datamodel.rst:628 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:583 +#: ../../reference/datamodel.rst:631 msgid "" "Additional information about a function's definition can be retrieved from " "its code object; see the description of internal types below. The :data:" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:649 +#: ../../reference/datamodel.rst:638 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:594 +#: ../../reference/datamodel.rst:645 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:604 +#: ../../reference/datamodel.rst:655 msgid "" "Special read-only attributes: :attr:`__self__` is the class instance " "object, :attr:`__func__` is the function object; :attr:`__doc__` is the " @@ -785,20 +785,20 @@ msgid "" "``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:661 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying function object." msgstr "" -#: ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:664 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" "defined function object or a class method object." msgstr "" -#: ../../reference/datamodel.rst:617 +#: ../../reference/datamodel.rst:668 msgid "" "When an instance method object is created by retrieving a user-defined " "function object from a class via one of its instances, its :attr:`__self__` " @@ -806,7 +806,7 @@ msgid "" "new method's :attr:`__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:623 +#: ../../reference/datamodel.rst:674 msgid "" "When an instance method object is created by retrieving a class method " "object from a class or instance, its :attr:`__self__` attribute is the class " @@ -814,7 +814,7 @@ msgid "" "the class method." msgstr "" -#: ../../reference/datamodel.rst:628 +#: ../../reference/datamodel.rst:679 msgid "" "When an instance method object is called, the underlying function (:attr:" "`__func__`) is called, inserting the class instance (:attr:`__self__`) in " @@ -823,7 +823,7 @@ msgid "" "class:`C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:635 +#: ../../reference/datamodel.rst:686 msgid "" "When an instance method object is derived from a class method object, the " "\"class instance\" stored in :attr:`__self__` will actually be the class " @@ -831,7 +831,7 @@ msgid "" "calling ``f(C,1)`` where ``f`` is the underlying function." msgstr "" -#: ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:691 msgid "" "Note that the transformation from function object to instance method object " "happens each time the attribute is retrieved from the instance. In some " @@ -844,11 +844,11 @@ msgid "" "the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:664 +#: ../../reference/datamodel.rst:704 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:656 +#: ../../reference/datamodel.rst:710 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -861,11 +861,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:674 +#: ../../reference/datamodel.rst:722 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:727 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -874,11 +874,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:694 +#: ../../reference/datamodel.rst:735 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:741 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -887,7 +887,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:687 +#: ../../reference/datamodel.rst:747 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -898,11 +898,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:709 +#: ../../reference/datamodel.rst:758 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:702 +#: ../../reference/datamodel.rst:765 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -914,11 +914,11 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:721 +#: ../../reference/datamodel.rst:776 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:783 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -927,11 +927,11 @@ msgid "" "attr:`__self__` is set to the object denoted by *alist*." msgstr "" -#: ../../reference/datamodel.rst:728 +#: ../../reference/datamodel.rst:791 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:793 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -940,21 +940,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:801 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:731 +#: ../../reference/datamodel.rst:803 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:796 +#: ../../reference/datamodel.rst:808 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:740 +#: ../../reference/datamodel.rst:814 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -968,33 +968,33 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:752 +#: ../../reference/datamodel.rst:826 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:836 msgid "Predefined (writable) attributes:" msgstr "" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:839 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:839 msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:768 +#: ../../reference/datamodel.rst:842 msgid "The module's documentation string, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:852 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../reference/datamodel.rst:772 +#: ../../reference/datamodel.rst:846 msgid "" "The pathname of the file from which the module was loaded, if it was loaded " "from a file. The :attr:`__file__` attribute may be missing for certain types " @@ -1003,20 +1003,20 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:781 +#: ../../reference/datamodel.rst:855 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:788 +#: ../../reference/datamodel.rst:862 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:867 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1024,11 +1024,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:874 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:876 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1044,7 +1044,7 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:900 msgid "" "When a class attribute reference (for class :class:`C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1055,66 +1055,66 @@ msgid "" "in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:910 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:838 +#: ../../reference/datamodel.rst:915 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:929 msgid ":attr:`~definition.__name__`" msgstr ":attr:`~definition.__name__`" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:929 msgid "The class name." msgstr "" -#: ../../reference/datamodel.rst:855 +#: ../../reference/datamodel.rst:932 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:935 msgid "The dictionary containing the class's namespace." msgstr "" -#: ../../reference/datamodel.rst:862 +#: ../../reference/datamodel.rst:939 msgid ":attr:`~class.__bases__`" msgstr ":attr:`~class.__bases__`" -#: ../../reference/datamodel.rst:861 +#: ../../reference/datamodel.rst:938 msgid "" "A tuple containing the base classes, in the order of their occurrence in the " "base class list." msgstr "" -#: ../../reference/datamodel.rst:865 +#: ../../reference/datamodel.rst:942 msgid "The class's documentation string, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:868 +#: ../../reference/datamodel.rst:945 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:875 +#: ../../reference/datamodel.rst:952 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic class `." msgstr "" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:957 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:885 +#: ../../reference/datamodel.rst:965 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1131,7 +1131,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:901 +#: ../../reference/datamodel.rst:981 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1139,23 +1139,23 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:911 +#: ../../reference/datamodel.rst:991 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:918 +#: ../../reference/datamodel.rst:998 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:945 +#: ../../reference/datamodel.rst:1003 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:935 +#: ../../reference/datamodel.rst:1018 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1164,7 +1164,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:941 +#: ../../reference/datamodel.rst:1024 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1172,22 +1172,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1233 +#: ../../reference/datamodel.rst:1032 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:952 +#: ../../reference/datamodel.rst:1038 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1063 +#: ../../reference/datamodel.rst:1046 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:1048 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:987 +#: ../../reference/datamodel.rst:1076 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1013 +#: ../../reference/datamodel.rst:1102 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1019 +#: ../../reference/datamodel.rst:1108 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1025 +#: ../../reference/datamodel.rst:1114 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1029 +#: ../../reference/datamodel.rst:1118 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1123 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1037 +#: ../../reference/datamodel.rst:1126 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1043 +#: ../../reference/datamodel.rst:1132 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1046 +#: ../../reference/datamodel.rst:1135 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1047 +#: ../../reference/datamodel.rst:1136 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1137 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1138 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1052 +#: ../../reference/datamodel.rst:1141 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1058 +#: ../../reference/datamodel.rst:1147 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,17 +1307,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1125 +#: ../../reference/datamodel.rst:1158 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1070 +#: ../../reference/datamodel.rst:1162 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1081 +#: ../../reference/datamodel.rst:1173 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1328,7 +1328,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1089 +#: ../../reference/datamodel.rst:1181 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1336,7 +1336,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1098 +#: ../../reference/datamodel.rst:1190 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1344,7 +1344,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:1195 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1352,7 +1352,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1200 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1360,11 +1360,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1205 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1209 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1372,22 +1372,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1123 +#: ../../reference/datamodel.rst:1215 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1223 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1236 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1145 +#: ../../reference/datamodel.rst:1240 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1397,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1153 +#: ../../reference/datamodel.rst:1248 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1253 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1168 +#: ../../reference/datamodel.rst:1263 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1421,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1272 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1429,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1183 +#: ../../reference/datamodel.rst:1278 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1187 +#: ../../reference/datamodel.rst:1282 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1216 +#: ../../reference/datamodel.rst:1288 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1194 +#: ../../reference/datamodel.rst:1292 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1203 +#: ../../reference/datamodel.rst:1301 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1207 +#: ../../reference/datamodel.rst:1305 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1309 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1473,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1318 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1320 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1488,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1233 +#: ../../reference/datamodel.rst:1330 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1228 +#: ../../reference/datamodel.rst:1332 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1501,11 +1501,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1238 +#: ../../reference/datamodel.rst:1342 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1244 +#: ../../reference/datamodel.rst:1348 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1519,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1255 +#: ../../reference/datamodel.rst:1359 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1528,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1261 +#: ../../reference/datamodel.rst:1365 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1538,11 +1538,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1376 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1382 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1552,7 +1552,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1285 +#: ../../reference/datamodel.rst:1389 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1560,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1394 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1569,13 +1569,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1399 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1298 +#: ../../reference/datamodel.rst:1402 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1583,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1411 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1593,7 +1593,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1314 +#: ../../reference/datamodel.rst:1418 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1601,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1327 +#: ../../reference/datamodel.rst:1431 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1610,7 +1610,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1333 +#: ../../reference/datamodel.rst:1437 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1620,20 +1620,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1340 +#: ../../reference/datamodel.rst:1444 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1449 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1350 +#: ../../reference/datamodel.rst:1454 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1644,18 +1644,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1464 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1468 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1368 +#: ../../reference/datamodel.rst:1472 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1664,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1374 +#: ../../reference/datamodel.rst:1478 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1675,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1493 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1687,13 +1687,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1398 +#: ../../reference/datamodel.rst:1502 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1513 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1701,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1518 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1522 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:1532 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1439 +#: ../../reference/datamodel.rst:1543 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1732,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1553 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1451 +#: ../../reference/datamodel.rst:1555 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1557 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1457 +#: ../../reference/datamodel.rst:1561 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1577 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1666 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1872,7 +1872,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1571 +#: ../../reference/datamodel.rst:1675 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1880,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1576 +#: ../../reference/datamodel.rst:1680 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1888,22 +1888,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1685 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1585 +#: ../../reference/datamodel.rst:1689 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1691 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1595 +#: ../../reference/datamodel.rst:1699 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1912,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1606 +#: ../../reference/datamodel.rst:1710 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1608 +#: ../../reference/datamodel.rst:1712 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1720 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1933,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1727 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1946,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1636 +#: ../../reference/datamodel.rst:1740 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1958,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1647 +#: ../../reference/datamodel.rst:1751 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1651 +#: ../../reference/datamodel.rst:1755 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +1973,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1653 +#: ../../reference/datamodel.rst:1757 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1660 +#: ../../reference/datamodel.rst:1764 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1664 +#: ../../reference/datamodel.rst:1768 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1668 +#: ../../reference/datamodel.rst:1772 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2001,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1670 +#: ../../reference/datamodel.rst:1774 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1677 +#: ../../reference/datamodel.rst:1781 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1784 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2023,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1786 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1793 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1694 +#: ../../reference/datamodel.rst:1798 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1701 +#: ../../reference/datamodel.rst:1805 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2051,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1814 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1714 +#: ../../reference/datamodel.rst:1818 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1732 +#: ../../reference/datamodel.rst:1836 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2073,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1737 +#: ../../reference/datamodel.rst:1841 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1844 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1745 +#: ../../reference/datamodel.rst:1849 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1746 +#: ../../reference/datamodel.rst:1850 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1752 +#: ../../reference/datamodel.rst:1856 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1754 +#: ../../reference/datamodel.rst:1858 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2103,7 +2103,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1764 +#: ../../reference/datamodel.rst:1868 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2112,13 +2112,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1770 +#: ../../reference/datamodel.rst:1874 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1877 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,25 +2128,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1782 +#: ../../reference/datamodel.rst:1886 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1785 +#: ../../reference/datamodel.rst:1889 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1791 +#: ../../reference/datamodel.rst:1895 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1794 +#: ../../reference/datamodel.rst:1898 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2157,11 +2157,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1909 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1807 +#: ../../reference/datamodel.rst:1911 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2170,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1813 +#: ../../reference/datamodel.rst:1917 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2178,7 +2178,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1922 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2186,54 +2186,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:1927 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1932 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1827 +#: ../../reference/datamodel.rst:1931 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1832 +#: ../../reference/datamodel.rst:1936 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1831 +#: ../../reference/datamodel.rst:1935 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1940 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1835 +#: ../../reference/datamodel.rst:1939 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1842 +#: ../../reference/datamodel.rst:1946 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1839 +#: ../../reference/datamodel.rst:1943 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1876 +#: ../../reference/datamodel.rst:1980 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2250,7 +2250,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1890 +#: ../../reference/datamodel.rst:1994 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2259,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1896 +#: ../../reference/datamodel.rst:2000 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1903 +#: ../../reference/datamodel.rst:2007 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:1905 +#: ../../reference/datamodel.rst:2009 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:1909 +#: ../../reference/datamodel.rst:2013 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:1914 +#: ../../reference/datamodel.rst:2018 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2290,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1924 -msgid "Notes on using *__slots__*" +#: ../../reference/datamodel.rst:2027 +msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:1926 +#: ../../reference/datamodel.rst:2029 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:1930 +#: ../../reference/datamodel.rst:2033 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2310,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1937 +#: ../../reference/datamodel.rst:2040 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2318,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:2046 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2326,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1949 +#: ../../reference/datamodel.rst:2052 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2335,7 +2335,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1955 +#: ../../reference/datamodel.rst:2058 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2344,7 +2344,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:2063 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2352,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:2068 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1967 +#: ../../reference/datamodel.rst:2070 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2364,13 +2364,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1972 +#: ../../reference/datamodel.rst:2075 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:2078 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2378,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2084 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1989 +#: ../../reference/datamodel.rst:2092 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:2094 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2399,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2103 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2004 +#: ../../reference/datamodel.rst:2107 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2414,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2121 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2126 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2428,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2031 +#: ../../reference/datamodel.rst:2134 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2036 +#: ../../reference/datamodel.rst:2139 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2042 +#: ../../reference/datamodel.rst:2145 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2156 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2164 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2171 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2072 +#: ../../reference/datamodel.rst:2175 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2470,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2189 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2089 +#: ../../reference/datamodel.rst:2192 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2091 +#: ../../reference/datamodel.rst:2194 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2195 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2093 +#: ../../reference/datamodel.rst:2196 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2197 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2198 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2099 +#: ../../reference/datamodel.rst:2202 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2206 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2516,59 +2516,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2115 +#: ../../reference/datamodel.rst:2218 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2115 +#: ../../reference/datamodel.rst:2218 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2119 +#: ../../reference/datamodel.rst:2222 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2118 +#: ../../reference/datamodel.rst:2221 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2224 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2122 +#: ../../reference/datamodel.rst:2225 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2229 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2130 +#: ../../reference/datamodel.rst:2233 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2132 +#: ../../reference/datamodel.rst:2235 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2236 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2135 +#: ../../reference/datamodel.rst:2238 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2241 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2577,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2148 +#: ../../reference/datamodel.rst:2251 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2153 +#: ../../reference/datamodel.rst:2256 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2593,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2162 +#: ../../reference/datamodel.rst:2265 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2167 +#: ../../reference/datamodel.rst:2270 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2271 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2172 +#: ../../reference/datamodel.rst:2275 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2280 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2620,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2183 +#: ../../reference/datamodel.rst:2286 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2629,11 +2629,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2295 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2302 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2641,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2204 +#: ../../reference/datamodel.rst:2307 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2652,7 +2652,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2317 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2661,39 +2661,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2323 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2327 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2226 +#: ../../reference/datamodel.rst:2329 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2331 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2334 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2338 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2701,19 +2701,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2242 +#: ../../reference/datamodel.rst:2345 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2243 +#: ../../reference/datamodel.rst:2346 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2350 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2352 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2721,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2359 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2361 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2261 +#: ../../reference/datamodel.rst:2364 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2739,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2371 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2378 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2383 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2761,11 +2761,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2291 +#: ../../reference/datamodel.rst:2394 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2288 +#: ../../reference/datamodel.rst:2391 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2774,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2296 +#: ../../reference/datamodel.rst:2399 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2401 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2786,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2409 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2409 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2412 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2412 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2415 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2415 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2315 +#: ../../reference/datamodel.rst:2418 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2320 +#: ../../reference/datamodel.rst:2423 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2426 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2432 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2434 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2335 +#: ../../reference/datamodel.rst:2438 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2853,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2341 +#: ../../reference/datamodel.rst:2444 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2861,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2351 +#: ../../reference/datamodel.rst:2454 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2353 +#: ../../reference/datamodel.rst:2456 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2875,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2463 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2388 +#: ../../reference/datamodel.rst:2491 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2892,40 +2892,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2407 +#: ../../reference/datamodel.rst:2510 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2432 +#: ../../reference/datamodel.rst:2535 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2534 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2439 +#: ../../reference/datamodel.rst:2542 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2446 +#: ../../reference/datamodel.rst:2549 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2453 +#: ../../reference/datamodel.rst:2556 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2455 +#: ../../reference/datamodel.rst:2558 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2961,7 +2961,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2598 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2969,7 +2969,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2502 +#: ../../reference/datamodel.rst:2605 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -2978,7 +2978,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2614 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2988,20 +2988,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2525 +#: ../../reference/datamodel.rst:2628 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2632 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2636 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2641 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3014,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2653 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2658 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2563 +#: ../../reference/datamodel.rst:2666 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3036,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2675 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3045,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2581 +#: ../../reference/datamodel.rst:2684 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2587 +#: ../../reference/datamodel.rst:2690 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3059,14 +3059,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2698 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2702 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3075,7 +3075,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2606 +#: ../../reference/datamodel.rst:2709 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3083,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2613 +#: ../../reference/datamodel.rst:2716 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2617 +#: ../../reference/datamodel.rst:2720 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3098,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2729 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2731 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3110,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2757 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3124,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2665 +#: ../../reference/datamodel.rst:2768 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2688 +#: ../../reference/datamodel.rst:2791 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3143,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2700 +#: ../../reference/datamodel.rst:2803 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2705 +#: ../../reference/datamodel.rst:2808 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3158,7 +3158,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2726 +#: ../../reference/datamodel.rst:2829 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3174,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2850 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2760 +#: ../../reference/datamodel.rst:2863 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2767 +#: ../../reference/datamodel.rst:2870 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3195,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2876 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2785 +#: ../../reference/datamodel.rst:2888 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3211,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2894 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2794 +#: ../../reference/datamodel.rst:2897 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2904 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2906 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3235,32 +3235,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2814 +#: ../../reference/datamodel.rst:2917 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2817 +#: ../../reference/datamodel.rst:2920 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2925 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2932 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2833 +#: ../../reference/datamodel.rst:2936 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3268,27 +3268,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2837 +#: ../../reference/datamodel.rst:2940 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2947 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2947 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:2954 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2853 +#: ../../reference/datamodel.rst:2956 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3296,7 +3296,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2963 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3305,7 +3305,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2969 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3315,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2979 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2877 +#: ../../reference/datamodel.rst:2980 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2883 +#: ../../reference/datamodel.rst:2986 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2988 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3335,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2890 +#: ../../reference/datamodel.rst:2993 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:2895 +#: ../../reference/datamodel.rst:2998 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3351,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:3007 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3360,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:3019 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:3019 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:2918 +#: ../../reference/datamodel.rst:3021 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:2919 +#: ../../reference/datamodel.rst:3022 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:2924 +#: ../../reference/datamodel.rst:3027 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2926 +#: ../../reference/datamodel.rst:3029 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3389,7 +3389,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2941 +#: ../../reference/datamodel.rst:3044 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3398,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:3058 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2964 +#: ../../reference/datamodel.rst:3067 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2990 +#: ../../reference/datamodel.rst:3093 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3421,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3104 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3005 +#: ../../reference/datamodel.rst:3108 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3110 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3013 +#: ../../reference/datamodel.rst:3116 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3122 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3025 +#: ../../reference/datamodel.rst:3128 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3458,15 +3458,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3136 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3039 +#: ../../reference/datamodel.rst:3142 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3144 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,18 +3477,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3049 +#: ../../reference/datamodel.rst:3152 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3053 +#: ../../reference/datamodel.rst:3156 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3162 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3499,7 +3499,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3173 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3510,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3081 +#: ../../reference/datamodel.rst:3184 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3086 +#: ../../reference/datamodel.rst:3189 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3526,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3094 +#: ../../reference/datamodel.rst:3197 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:3203 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3205 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3208 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3212 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3216 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3116 +#: ../../reference/datamodel.rst:3219 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3133 +#: ../../reference/datamodel.rst:3236 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3138 +#: ../../reference/datamodel.rst:3241 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3146 +#: ../../reference/datamodel.rst:3249 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3251 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3151 +#: ../../reference/datamodel.rst:3254 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3258 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3160 +#: ../../reference/datamodel.rst:3263 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3266 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3176 +#: ../../reference/datamodel.rst:3279 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3177 +#: ../../reference/datamodel.rst:3280 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3181 +#: ../../reference/datamodel.rst:3284 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3626,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3187 +#: ../../reference/datamodel.rst:3290 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3634,30 +3634,30 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3193 +#: ../../reference/datamodel.rst:3296 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " "operation is not supported, which is why the reflected method is not called." msgstr "" -#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:145 -#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:173 -#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:212 -#: ../../reference/datamodel.rst:227 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:269 -#: ../../reference/datamodel.rst:295 ../../reference/datamodel.rst:330 -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:366 -#: ../../reference/datamodel.rst:386 ../../reference/datamodel.rst:405 -#: ../../reference/datamodel.rst:412 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:467 -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 -#: ../../reference/datamodel.rst:697 ../../reference/datamodel.rst:712 -#: ../../reference/datamodel.rst:736 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:906 -#: ../../reference/datamodel.rst:956 ../../reference/datamodel.rst:1011 -#: ../../reference/datamodel.rst:1068 ../../reference/datamodel.rst:1130 -#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:148 +#: ../../reference/datamodel.rst:159 ../../reference/datamodel.rst:180 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:225 +#: ../../reference/datamodel.rst:246 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:321 ../../reference/datamodel.rst:356 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:440 +#: ../../reference/datamodel.rst:448 ../../reference/datamodel.rst:459 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 +#: ../../reference/datamodel.rst:1042 ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:1160 ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2624 msgid "object" msgstr "object(物件)" @@ -3665,16 +3665,16 @@ msgstr "object(物件)" msgid "data" msgstr "data(資料)" -#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:269 -#: ../../reference/datamodel.rst:310 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:697 -#: ../../reference/datamodel.rst:922 ../../reference/datamodel.rst:1192 -#: ../../reference/datamodel.rst:1426 ../../reference/datamodel.rst:1431 -#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2063 -#: ../../reference/datamodel.rst:2491 ../../reference/datamodel.rst:2649 -#: ../../reference/datamodel.rst:2684 ../../reference/datamodel.rst:2698 -#: ../../reference/datamodel.rst:2745 ../../reference/datamodel.rst:2755 -#: ../../reference/datamodel.rst:2783 +#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1530 ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2594 ../../reference/datamodel.rst:2752 +#: ../../reference/datamodel.rst:2787 ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2848 ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2886 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3683,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "type" msgstr "type(型別)" @@ -3719,7 +3719,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:891 msgid "container" msgstr "container(容器)" @@ -3731,25 +3731,26 @@ msgstr "hierarchy(階層)" msgid "extension" msgstr "extension(擴充)" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:380 -#: ../../reference/datamodel.rst:453 ../../reference/datamodel.rst:736 -#: ../../reference/datamodel.rst:755 ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:393 +#: ../../reference/datamodel.rst:394 ../../reference/datamodel.rst:495 +#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:1005 msgid "module" msgstr "module(模組)" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:760 msgid "C" msgstr "C" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:760 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:831 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:908 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:979 msgid "attribute" msgstr "attribute(屬性)" @@ -3761,830 +3762,834 @@ msgstr "special" msgid "generic" msgstr "generic(泛型)" -#: ../../reference/datamodel.rst:173 +#: ../../reference/datamodel.rst:180 msgid "..." msgstr "..." -#: ../../reference/datamodel.rst:173 +#: ../../reference/datamodel.rst:180 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:986 msgid "numeric" msgstr "numeric(數值)" -#: ../../reference/datamodel.rst:212 ../../reference/datamodel.rst:238 -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:225 ../../reference/datamodel.rst:231 +#: ../../reference/datamodel.rst:336 msgid "integer" msgstr "integer(整數)" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:231 +msgid "representation" +msgstr "representation(表示)" + +#: ../../reference/datamodel.rst:246 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:246 msgid "False" msgstr "False" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:246 msgid "True" msgstr "True" -#: ../../reference/datamodel.rst:238 -msgid "representation" -msgstr "representation(表示)" - -#: ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:261 msgid "floating point" msgstr "floating point(浮點)" -#: ../../reference/datamodel.rst:244 ../../reference/datamodel.rst:259 +#: ../../reference/datamodel.rst:261 ../../reference/datamodel.rst:279 msgid "number" msgstr "number(數字)" -#: ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:261 msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2858 msgid "complex" msgstr "complex(複數)" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2594 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:986 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:292 msgid "index operation" msgstr "index operation(索引操作)" -#: ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:292 msgid "item selection" msgstr "item selection(項目選取)" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:352 -#: ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:381 +#: ../../reference/datamodel.rst:459 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/datamodel.rst:281 ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:304 ../../reference/datamodel.rst:381 msgid "slicing" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:295 +#: ../../reference/datamodel.rst:321 msgid "immutable sequence" msgstr "immutable sequence(不可變序列)" -#: ../../reference/datamodel.rst:295 +#: ../../reference/datamodel.rst:321 msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:306 ../../reference/datamodel.rst:1401 -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1535 msgid "string" msgstr "string(字串)" -#: ../../reference/datamodel.rst:306 +#: ../../reference/datamodel.rst:332 msgid "immutable sequences" msgstr "immutable sequences(不可變序列)" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "chr" msgstr "chr" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "ord" msgstr "ord" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "character" msgstr "character(字元)" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "Unicode" msgstr "Unicode" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "tuple" msgstr "tuple(元組)" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "singleton" msgstr "singleton(單例)" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1530 msgid "bytes" msgstr "bytes(位元組)" -#: ../../reference/datamodel.rst:343 +#: ../../reference/datamodel.rst:369 msgid "byte" msgstr "byte(位元組)" -#: ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:381 msgid "mutable sequence" msgstr "mutable sequence(可變序列)" -#: ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:381 msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:831 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:908 +#: ../../reference/datamodel.rst:979 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:736 -#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1322 -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:1257 ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:2913 msgid "statement" msgstr "statement(陳述式)" -#: ../../reference/datamodel.rst:366 +#: ../../reference/datamodel.rst:393 +msgid "array" +msgstr "array(陣列)" + +#: ../../reference/datamodel.rst:394 +msgid "collections" +msgstr "collections" + +#: ../../reference/datamodel.rst:402 msgid "list" msgstr "list(串列)" -#: ../../reference/datamodel.rst:373 +#: ../../reference/datamodel.rst:409 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../reference/datamodel.rst:380 -msgid "array" -msgstr "array(陣列)" - -#: ../../reference/datamodel.rst:386 +#: ../../reference/datamodel.rst:420 msgid "set type" msgstr "set type(集合型別)" -#: ../../reference/datamodel.rst:405 +#: ../../reference/datamodel.rst:440 msgid "set" msgstr "set(集合)" -#: ../../reference/datamodel.rst:412 +#: ../../reference/datamodel.rst:448 msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:986 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:1616 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../reference/datamodel.rst:453 +#: ../../reference/datamodel.rst:495 msgid "dbm.ndbm" msgstr "dbm.ndbm" -#: ../../reference/datamodel.rst:453 +#: ../../reference/datamodel.rst:495 msgid "dbm.gnu" msgstr "dbm.gnu" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:477 -#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:667 -#: ../../reference/datamodel.rst:677 ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:737 ../../reference/datamodel.rst:760 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:836 ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2547 msgid "call" msgstr "call(呼叫)" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "invocation" msgstr "invocation(調用)" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/datamodel.rst:477 +#: ../../reference/datamodel.rst:525 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__closure__ (function attribute)" msgstr "__closure__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__globals__ (function attribute)" msgstr "__globals__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:491 ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:539 ../../reference/datamodel.rst:829 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:640 ../../reference/datamodel.rst:778 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:640 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:1011 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1100 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:652 +#: ../../reference/datamodel.rst:706 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:667 ../../reference/datamodel.rst:2997 +#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3100 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:677 +#: ../../reference/datamodel.rst:737 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:677 +#: ../../reference/datamodel.rst:737 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:778 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:778 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:736 +#: ../../reference/datamodel.rst:810 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:786 +#: ../../reference/datamodel.rst:860 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:831 -#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:1305 -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:2277 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:979 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:2547 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:836 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:913 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:994 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:994 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:948 +#: ../../reference/datamodel.rst:1034 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:948 +#: ../../reference/datamodel.rst:1034 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1027 +#: ../../reference/datamodel.rst:1116 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1068 +#: ../../reference/datamodel.rst:1160 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1180 +#: ../../reference/datamodel.rst:1275 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1192 ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:1290 ../../reference/datamodel.rst:2624 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1380 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1380 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1409 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1488 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1488 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1470 +#: ../../reference/datamodel.rst:1574 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:1616 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1697 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2230 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2253 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2277 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2297 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2297 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2594 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2801 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2848 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2858 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2858 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2783 +#: ../../reference/datamodel.rst:2886 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2913 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2913 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/tutorial/classes.po b/tutorial/classes.po index 5bc1b1749f..c7e6db0e8f 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgid "" "also have methods (defined by its class) for modifying its state." msgstr "" "Class 提供了一種結合資料與功能的手段。建立一個 class 將會新增一個物件的\\ *型" -"別 (type)*\\ ,並且允許建立該型別的新\\ *實例 (instance)*\\ 。每一個 class 實" -"例可以擁有一些維持該實例狀態的屬性 (attribute)。Class 實例也可以有一些(由其 " +"別 (type)*\\ ,並且允許建立該型別的新\\ *實例 (instance)*。每一個 class 實例" +"可以擁有一些維持該實例狀態的屬性 (attribute)。Class 實例也可以有一些(由其 " "class 所定義的)method(方法),用於修改該實例的狀態。" #: ../../tutorial/classes.rst:13 @@ -75,7 +75,7 @@ msgid "" "instances." msgstr "" "在 C++ 的術語中,class 成員(包含資料成員)通常都是\\ *公開*\\ 的(除了以下內" -"容:\\ :ref:`tut-private`\\ ),而所有的成員函式都是\\ *虛擬*\\ 的。如同在 " +"容::ref:`tut-private`\\ ),而所有的成員函式都是\\ *虛擬*\\ 的。如同在 " "Modula-3 中一樣,Python 並沒有提供簡寫可以從物件的 method 裡參照其成員:" "method 函式與一個外顯的 (explicit)、第一個代表物件的引數被宣告,而此引數是在" "呼叫時隱性地 (implicitly) 被提供。如同在 Smalltak 中,class 都是物件,這為 " @@ -176,10 +176,10 @@ msgid "" "the global names defined in the module: they share the same namespace! [#]_" msgstr "" "順帶一提,我使用\\ *屬性 (attribute)* 這個字,統稱句號 (dot) 後面的任何名稱——" -"例如,運算式中的 ``z.real``,\\ ``real`` 是物件 ``z`` 的一個屬性。嚴格來說," -"模組中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,\\ " -"``modname`` 是模組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和" -"模組中定義的全域名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" +"例如,運算式中的 ``z.real``,``real`` 是物件 ``z`` 的一個屬性。嚴格來說,模組" +"中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,``modname`` 是模" +"組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和模組中定義的全域" +"名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" #: ../../tutorial/classes.rst:90 msgid "" @@ -187,12 +187,13 @@ msgid "" "attributes is possible. Module attributes are writable: you can write " "``modname.the_answer = 42``. Writable attributes may also be deleted with " "the :keyword:`del` statement. For example, ``del modname.the_answer`` will " -"remove the attribute :attr:`the_answer` from the object named by ``modname``." +"remove the attribute :attr:`!the_answer` from the object named by " +"``modname``." msgstr "" "屬性可以是唯讀的或可寫的。在後者的情況下,對屬性的賦值是可能的。模組屬性是可" "寫的:你可以寫 ``modname.the_answer = 42``。可寫屬性也可以用 :keyword:`del` " -"陳述式刪除。例如,\\ ``del modname.the_answer`` 將從名為 ``modname`` 的物件中" -"刪除屬性 :attr:`the_answer`\\ 。" +"陳述式刪除。例如,``del modname.the_answer`` 將從名為 ``modname`` 的物件中刪" +"除屬性 :attr:`!the_answer`。" #: ../../tutorial/classes.rst:96 msgid "" @@ -211,8 +212,7 @@ msgstr "" "命名空間會被建立;一般情況下,模組的命名空間也會持續到直譯器結束。被直譯器的" "頂層調用 (top-level invocation) 執行的陳述式,不論是從腳本檔案讀取的或是互動" "模式中的,會被視為一個稱為 :mod:`__main__` 的模組的一部分,因此它們具有自己的" -"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:" -"`builtins`\\ 。)" +"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:`builtins`。)" #: ../../tutorial/classes.rst:106 msgid "" @@ -335,8 +335,8 @@ msgid "" "enclosing scope and should be rebound there." msgstr "" ":keyword:`global` 陳述式可以用來表示特定變數存活在全域作用域,應該被重新綁定" -"到那裡;\\ :keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重" -"新綁定到那裡。" +"到那裡;:keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重新" +"綁定到那裡。" #: ../../tutorial/classes.rst:162 msgid "Scopes and Namespaces Example" @@ -364,9 +364,9 @@ msgid "" "changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` " "assignment changed the module-level binding." msgstr "" -"請注意,\\ *區域*\\ 賦值(預設情況)不會改變 *scope_test* 對 *spam* 的連" -"結。\\ :keyword:`nonlocal` 賦值改變了 *scope_test* 對 *spam* 的連結,而 :" -"keyword:`global` 賦值改變了模組層次的連結。" +"請注意,\\ *區域*\\ 賦值(預設情況)不會改變 *scope_test* 對 *spam* 的連結。:" +"keyword:`nonlocal` 賦值改變了 *scope_test* 對 *spam* 的連結,而 :keyword:" +"`global` 賦值改變了模組層次的連結。" #: ../../tutorial/classes.rst:205 msgid "" @@ -436,14 +436,14 @@ msgid "" "created by the class definition; we'll learn more about class objects in the " "next section. The original local scope (the one in effect just before the " "class definition was entered) is reinstated, and the class object is bound " -"here to the class name given in the class definition header (:class:" -"`ClassName` in the example)." +"here to the class name given in the class definition header (:class:`!" +"ClassName` in the example)." msgstr "" "正常地(從結尾處)離開 class definition 時,一個 *class 物件*\\ 會被建立。基" "本上這是一個包裝器 (wrapper),裝著 class definition 建立的命名空間內容;我們" "將在下一節中更加了解 class 物件。原始的區域作用域(在進入 class definition 之" "前已生效的作用域)會恢復,在此 class 物件會被連結到 class definition 標頭中給" -"出的 class 名稱(在範例中為 :class:`ClassName`\\ )。" +"出的 class 名稱(在範例中為 :class:`!ClassName`\\ )。" #: ../../tutorial/classes.rst:259 msgid "Class Objects" @@ -464,8 +464,8 @@ msgid "" "that were in the class's namespace when the class object was created. So, " "if the class definition looked like this::" msgstr "" -"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:\\ ``obj.name``。有效的屬" -"性名稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " +"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:``obj.name``。有效的屬性名" +"稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " "definition 看起來像這樣:\n" "\n" "::" @@ -480,8 +480,8 @@ msgid "" msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" "一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " -"``MyClass.i`` 的值。\\ :attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 " -"class 的說明字串 (docstring):\\ ``\"A simple example class\"``。" +"``MyClass.i`` 的值。:attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的" +"說明字串 (docstring):``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" @@ -505,35 +505,35 @@ msgid "" "The instantiation operation (\"calling\" a class object) creates an empty " "object. Many classes like to create objects with instances customized to a " "specific initial state. Therefore a class may define a special method named :" -"meth:`__init__`, like this::" +"meth:`~object.__init__`, like this::" msgstr "" "實例化運算(「呼叫」一個 class 物件)會建立一個空的物件。許多 class 喜歡在建" "立物件時有著自訂的特定實例初始狀態。因此,class 可以定義一個名為 :meth:" -"`__init__` 的特別 method,像這樣:\n" +"`~object.__init__` 的特別 method,像這樣:\n" "\n" "::" #: ../../tutorial/classes.rst:299 msgid "" -"When a class defines an :meth:`__init__` method, class instantiation " -"automatically invokes :meth:`__init__` for the newly created class " +"When a class defines an :meth:`~object.__init__` method, class instantiation " +"automatically invokes :meth:`!__init__` for the newly created class " "instance. So in this example, a new, initialized instance can be obtained " "by::" msgstr "" -"當 class 定義了 :meth:`__init__` method,class 實例化會為新建的 class 實例自" -"動調用 :meth:`__init__`。所以在這個範例中,一個新的、初始化的實例可以如此獲" -"得:\n" +"當 class 定義了 :meth:`~object.__init__` method,class 實例化會為新建的 " +"class 實例自動調用 :meth:`!__init__`。所以在這個範例中,一個新的、初始化的實" +"例可以如此獲得:\n" "\n" "::" #: ../../tutorial/classes.rst:305 msgid "" -"Of course, the :meth:`__init__` method may have arguments for greater " -"flexibility. In that case, arguments given to the class instantiation " -"operator are passed on to :meth:`__init__`. For example, ::" +"Of course, the :meth:`~object.__init__` method may have arguments for " +"greater flexibility. In that case, arguments given to the class " +"instantiation operator are passed on to :meth:`!__init__`. For example, ::" msgstr "" -"當然,\\ :meth:`__init__` method 可能為了更多的彈性而有引數。在這種情況下,要" -"給 class 實例化運算子的引數會被傳遞給 :meth:`__init__`\\ 。例如:\n" +"當然,:meth:`~object.__init__` method 可能為了更多的彈性而有引數。在這種情況" +"下,要給 class 實例化運算子的引數會被傳遞給 :meth:`!__init__`。例如:\n" "\n" "::" @@ -555,13 +555,13 @@ msgid "" "*data attributes* correspond to \"instance variables\" in Smalltalk, and to " "\"data members\" in C++. Data attributes need not be declared; like local " "variables, they spring into existence when they are first assigned to. For " -"example, if ``x`` is the instance of :class:`MyClass` created above, the " +"example, if ``x`` is the instance of :class:`!MyClass` created above, the " "following piece of code will print the value ``16``, without leaving a " "trace::" msgstr "" "*資料屬性*\\ 對應 Smalltalk 中的「實例變數」,以及 C++ 中的「資料成員」。資料" "屬性不需要被宣告;和區域變數一樣,它們在第一次被賦值時就會立即存在。例如,如" -"果 ``x`` 是 :class:`MyClass` 在上述例子中建立的實例,下面的程式碼將印出值 " +"果 ``x`` 是 :class:`!MyClass` 在上述例子中建立的實例,下面的程式碼將印出值 " "``16``,而不留下蹤跡:\n" "\n" "::" @@ -576,7 +576,7 @@ msgid "" "exclusively to mean methods of class instance objects, unless explicitly " "stated otherwise.)" msgstr "" -"實例的另一種屬性參照是 *method*\\ 。Method 是一個「屬於」物件的函式。(在 " +"實例的另一種屬性參照是 *method*。Method 是一個「屬於」物件的函式。(在 " "Python 中,術語 method 並不是 class 實例所獨有的:其他物件型別也可以有 " "method。例如,list 物件具有稱為 append、insert、remove、sort 等 method。但" "是,在下面的討論中,我們將用術語 method 來專門表示 class 實例物件的 method," @@ -592,10 +592,10 @@ msgid "" "``MyClass.f`` --- it is a *method object*, not a function object." msgstr "" "實例物件的有效 method 名稱取決於其 class。根據定義,一個 class 中所有的函式物" -"件屬性,就定義了實例的對應 method。所以在我們的例子中,\\ ``x.f`` 是一個有效" -"的 method 參照,因為 ``MyClass.f`` 是一個函式,但 ``x.i`` 不是,因為 " -"``MyClass.i`` 不是。但 ``x.f`` 與 ``MyClass.f`` 是不一樣的——它是一個 *method " -"物件*\\ ,而不是函式物件。" +"件屬性,就定義了實例的對應 method。所以在我們的例子中,``x.f`` 是一個有效的 " +"method 參照,因為 ``MyClass.f`` 是一個函式,但 ``x.i`` 不是,因為 ``MyClass." +"i`` 不是。但 ``x.f`` 與 ``MyClass.f`` 是不一樣的——它是一個 *method 物件*,而" +"不是函式物件。" #: ../../tutorial/classes.rst:360 msgid "Method Objects" @@ -610,14 +610,14 @@ msgstr "" #: ../../tutorial/classes.rst:366 msgid "" -"In the :class:`MyClass` example, this will return the string ``'hello " +"In the :class:`!MyClass` example, this will return the string ``'hello " "world'``. However, it is not necessary to call a method right away: ``x.f`` " "is a method object, and can be stored away and called at a later time. For " "example::" msgstr "" -"在 :class:`MyClass` 的例子中,這將回傳字串 ``'hello world'``。然而,並沒有必" -"要立即呼叫一個 method:\\ ``x.f`` 是一個 method 物件,並且可以被儲藏起來,之" -"後再被呼叫。舉例來說:\n" +"在 :class:`!MyClass` 的例子中,這將回傳字串 ``'hello world'``。然而,並沒有必" +"要立即呼叫一個 method:``x.f`` 是一個 method 物件,並且可以被儲藏起來,之後再" +"被呼叫。舉例來說:\n" "\n" "::" @@ -629,15 +629,15 @@ msgstr "將會持續印出 ``hello world`` 直到天荒地老。" msgid "" "What exactly happens when a method is called? You may have noticed that ``x." "f()`` was called without an argument above, even though the function " -"definition for :meth:`f` specified an argument. What happened to the " +"definition for :meth:`!f` specified an argument. What happened to the " "argument? Surely Python raises an exception when a function that requires an " "argument is called without any --- even if the argument isn't actually " "used..." msgstr "" "當一個 method 被呼叫時究竟會發生什麼事?你可能已經注意到 ``x.f()`` 被呼叫時沒" -"有任何的引數,儘管 :meth:`f` 的函式定義有指定一個引數。這個引數發生了什麼事?" -"當一個需要引數的函式被呼叫而沒有給任何引數時,Python 肯定會引發例外——即使該引" -"數實際上沒有被使用..." +"有任何的引數,儘管 :meth:`!f` 的函式定義有指定一個引數。這個引數發生了什麼" +"事?當一個需要引數的函式被呼叫而沒有給任何引數時,Python 肯定會引發例外——即使" +"該引數實際上沒有被使用..." #: ../../tutorial/classes.rst:382 msgid "" @@ -650,9 +650,9 @@ msgid "" "argument." msgstr "" "事實上,你可能已經猜到了答案:method 的特殊之處在於,實例物件會作為函式中的第" -"一個引數被傳遞。在我們的例子中,\\ ``x.f()`` 這個呼叫等同於 ``MyClass." -"f(x)``。一般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其" -"引數列表 (argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" +"一個引數被傳遞。在我們的例子中,``x.f()`` 這個呼叫等同於 ``MyClass.f(x)``。一" +"般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其引數列表 " +"(argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" #: ../../tutorial/classes.rst:389 msgid "" @@ -771,10 +771,10 @@ msgid "" "that a *class browser* program might be written that relies upon such a " "convention." msgstr "" -"通常,方法的第一個引數稱為 ``self``。這僅僅只是一個慣例:\\ ``self`` 這個名字" -"對 Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對" -"其他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而" -"編寫的 *class 瀏覽器 (browser)* 程式。" +"通常,方法的第一個引數稱為 ``self``。這僅僅只是一個慣例:``self`` 這個名字對 " +"Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對其" +"他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而編" +"寫的 *class 瀏覽器 (browser)* 程式。" #: ../../tutorial/classes.rst:518 msgid "" @@ -791,13 +791,13 @@ msgstr "" #: ../../tutorial/classes.rst:535 msgid "" -"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer " -"to function objects, and consequently they are all methods of instances of :" -"class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this " -"practice usually only serves to confuse the reader of a program." +"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that " +"refer to function objects, and consequently they are all methods of " +"instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note " +"that this practice usually only serves to confuse the reader of a program." msgstr "" -"現在 ``f``、\\ ``g`` 和 ``h`` 都是 class :class:`C` 的屬性,並指向函式物件," -"所以他們都是class :class:`C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" +"現在 ``f``、``g`` 和 ``h`` 都是 class :class:`!C` 的屬性,並指向函式物件,所" +"以他們都是class :class:`!C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" "注意,這種做法通常只會使該程式的讀者感到困惑。" #: ../../tutorial/classes.rst:540 @@ -833,8 +833,8 @@ msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." msgstr "" -"每個值都是一個物件,因此都具有一個 *class*\\ ,也可以稱為它的 *type(型別)" -"*\\ 。它以 ``object.__class__`` 被儲存。" +"每個值都是一個物件,因此都具有一個 *class*,也可以稱為它的 *type(型別)*。它" +"以 ``object.__class__`` 被儲存。" #: ../../tutorial/classes.rst:571 msgid "Inheritance" @@ -853,12 +853,12 @@ msgstr "" #: ../../tutorial/classes.rst:584 msgid "" -"The name :class:`BaseClassName` must be defined in a namespace accessible " +"The name :class:`!BaseClassName` must be defined in a namespace accessible " "from the scope containing the derived class definition. In place of a base " "class name, other arbitrary expressions are also allowed. This can be " "useful, for example, when the base class is defined in another module::" msgstr "" -"名稱 :class:`BaseClassName` 必須被定義於作用域可及的命名空間,且該作用域要包" +"名稱 :class:`!BaseClassName` 必須被定義於作用域可及的命名空間,且該作用域要包" "含 derived class 定義。要代替 base class(基底類別)的名稱,用其他任意的運算" "式也是被允許的。這會很有用,例如,當一個 base class 是在另一個模組中被定義" "時:\n" @@ -887,10 +887,10 @@ msgid "" "searched, descending down the chain of base classes if necessary, and the " "method reference is valid if this yields a function object." msgstr "" -"關於 derived class 的實例化並沒有特別之處:\\ ``DerivedClassName()`` 會建立" -"該 class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如" -"果需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 " -"method 的參照是有效的。" +"關於 derived class 的實例化並沒有特別之處:``DerivedClassName()`` 會建立該 " +"class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如果" +"需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 method " +"的參照是有效的。" #: ../../tutorial/classes.rst:604 msgid "" @@ -931,8 +931,8 @@ msgid "" "will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " "derived from :class:`int`." msgstr "" -"使用 :func:`isinstance` 判斷一個實例的型別:\\ ``isinstance(obj, int)`` 只有" -"在 ``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " +"使用 :func:`isinstance` 判斷一個實例的型別:``isinstance(obj, int)`` 只有在 " +"``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " "``True``。" #: ../../tutorial/classes.rst:623 @@ -942,8 +942,8 @@ msgid "" "``issubclass(float, int)`` is ``False`` since :class:`float` is not a " "subclass of :class:`int`." msgstr "" -"使用 :func:`issubclass` 判斷 class 繼承:\\ ``issubclass(bool, int)`` 會是 " -"``True``,因為 :class:`bool` 是 :class:`int` 的 subclass(子類別)。但是,\\ " +"使用 :func:`issubclass` 判斷 class 繼承:``issubclass(bool, int)`` 會是 " +"``True``,因為 :class:`bool` 是 :class:`int` 的 subclass(子類別)。但是," "``issubclass(float, int)`` 是 ``False``,因為 :class:`float` 並不是 :class:" "`int` 的 subclass。" @@ -966,16 +966,16 @@ msgid "" "For most purposes, in the simplest cases, you can think of the search for " "attributes inherited from a parent class as depth-first, left-to-right, not " "searching twice in the same class where there is an overlap in the " -"hierarchy. Thus, if an attribute is not found in :class:`DerivedClassName`, " -"it is searched for in :class:`Base1`, then (recursively) in the base classes " -"of :class:`Base1`, and if it was not found there, it was searched for in :" -"class:`Base2`, and so on." +"hierarchy. Thus, if an attribute is not found in :class:`!DerivedClassName`, " +"it is searched for in :class:`!Base1`, then (recursively) in the base " +"classes of :class:`!Base1`, and if it was not found there, it was searched " +"for in :class:`!Base2`, and so on." msgstr "" "在大多數情況下,最簡單的例子裡,你可以這樣思考,對於繼承自 parent class(父類" "別)的屬性,其搜尋規則為:深度優先、從左到右、在階層裡重疊的相同 class 中不重" -"複搜尋。因此,假如有一個屬性在 :class:`DerivedClassName` 沒有被找到,則在 :" -"class:`Base1` 搜尋它,接著(遞迴地)在 :class:`Base1` 的 base class 中搜尋," -"假如在那裡又沒有找到的話,會在 :class:`Base2` 搜尋,依此類推。" +"複搜尋。因此,假如有一個屬性在 :class:`!DerivedClassName` 沒有被找到,則在 :" +"class:`!Base1` 搜尋它,接著(遞迴地)在 :class:`!Base1` 的 base class 中搜" +"尋,假如在那裡又沒有找到的話,會在 :class:`!Base2` 搜尋,依此類推。" #: ../../tutorial/classes.rst:652 msgid "" @@ -1007,13 +1007,13 @@ msgid "" msgstr "" "動態排序是必要的,因為多重繼承的所有情況都表現一或多的菱形關係(其中至少一個 " "parent class 可以從最底層 class 透過多個路徑存取)。例如,所有的 class 都繼承" -"自 :class:`object`\\ ,因此任何多重繼承的情況都提供了多個到達 :class:" -"`object` 的路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順" -"序線性化 (linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只" -"會呼叫一次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed" -"(子類別化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可" -"靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python." -"org/download/releases/2.3/mro/。" +"自 :class:`object`,因此任何多重繼承的情況都提供了多個到達 :class:`object` 的" +"路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順序線性化 " +"(linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只會呼叫一" +"次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed(子類別" +"化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可靠又可擴" +"充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python.org/" +"download/releases/2.3/mro/。" #: ../../tutorial/classes.rst:675 msgid "Private Variables" @@ -1118,29 +1118,30 @@ msgid "" "A piece of Python code that expects a particular abstract data type can " "often be passed a class that emulates the methods of that data type " "instead. For instance, if you have a function that formats some data from a " -"file object, you can define a class with methods :meth:`read` and :meth:`!" -"readline` that get the data from a string buffer instead, and pass it as an " -"argument." +"file object, you can define a class with methods :meth:`~io.TextIOBase.read` " +"and :meth:`~io.TextIOBase.readline` that get the data from a string buffer " +"instead, and pass it as an argument." msgstr "" "用來處理特殊抽象資料型別的一段 Python 程式碼,經常能以傳遞一個 class 來替代," "此 class 模擬該資料型別的多種 method。例如,如果你有一個函式,它會從一個檔案" -"物件來格式化某些資料,你也可以定義一個有 :meth:`read` 和 :meth:`!readline` " -"method 的 class 作為替代方式,從字串緩衝區取得資料,並將其作為引數來傳遞。" +"物件來格式化某些資料,你也可以定義一個有 :meth:`~io.TextIOBase.read` 和 :" +"meth:`~io.TextIOBase.readline` method 的 class 作為替代方式,從字串緩衝區取得" +"資料,並將其作為引數來傳遞。" -#: ../../tutorial/classes.rst:771 +#: ../../tutorial/classes.rst:772 msgid "" "Instance method objects have attributes, too: ``m.__self__`` is the instance " -"object with the method :meth:`m`, and ``m.__func__`` is the function object " +"object with the method :meth:`!m`, and ``m.__func__`` is the function object " "corresponding to the method." msgstr "" -"實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`m` 的實例" -"物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" +"實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`!m` 的實" +"例物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" -#: ../../tutorial/classes.rst:779 +#: ../../tutorial/classes.rst:780 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:781 +#: ../../tutorial/classes.rst:782 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1150,7 +1151,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:795 +#: ../../tutorial/classes.rst:796 msgid "" "This style of access is clear, concise, and convenient. The use of " "iterators pervades and unifies Python. Behind the scenes, the :keyword:" @@ -1163,34 +1164,35 @@ msgid "" "func:`next` built-in function; this example shows how it all works::" msgstr "" "這種存取風格清晰、簡潔且方便。疊代器的使用在 Python 中處處可見且用法一致。在" -"幕後,\\ :keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`\\ 。該函式回傳" -"一個疊代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method " -"會逐一存取容器中的元素。當元素用盡時,\\ :meth:`~iterator.__next__` 將引發 :" -"exc:`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函" -"式 :func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的" -"運作方式:\n" +"幕後,:keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`。該函式回傳一個疊" +"代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method 會逐一" +"存取容器中的元素。當元素用盡時,:meth:`~iterator.__next__` 將引發 :exc:" +"`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函式 :" +"func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的運作" +"方式:\n" "\n" "::" -#: ../../tutorial/classes.rst:820 +#: ../../tutorial/classes.rst:821 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " -"iterator behavior to your classes. Define an :meth:`__iter__` method which " -"returns an object with a :meth:`~iterator.__next__` method. If the class " -"defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::" +"iterator behavior to your classes. Define an :meth:`~container.__iter__` " +"method which returns an object with a :meth:`~iterator.__next__` method. If " +"the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return " +"``self``::" msgstr "" "看過疊代器協定的幕後機制後,在你的 class 加入疊代器的行為就很容易了。定義一" -"個 :meth:`__iter__` method 來回傳一個帶有 :meth:`~iterator.__next__` method " -"的物件。如果 class 已定義了 :meth:`__next__`\\ ,則 :meth:`__iter__` 可以只回" -"傳 ``self``:\n" +"個 :meth:`~container.__iter__` method 來回傳一個帶有 :meth:`~iterator." +"__next__` method 的物件。如果 class 已定義了 :meth:`!__next__`,則 :meth:`!" +"__iter__` 可以只回傳 ``self``:\n" "\n" "::" -#: ../../tutorial/classes.rst:857 +#: ../../tutorial/classes.rst:858 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:859 +#: ../../tutorial/classes.rst:860 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1206,18 +1208,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:880 +#: ../../tutorial/classes.rst:881 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " -"compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods " -"are created automatically." +"compact is that the :meth:`~iterator.__iter__` and :meth:`~generator." +"__next__` methods are created automatically." msgstr "" "任何可以用產生器來完成的事,也能用以 class 為基礎的疊代器來完成,如同前一節的" -"描述。而讓產生器的程式碼更為精簡的原因是,\\ :meth:`__iter__` 和 :meth:" -"`~generator.__next__` method 會自動被建立。" +"描述。而讓產生器的程式碼更為精簡的原因是,:meth:`~iterator.__iter__` 和 :" +"meth:`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:885 +#: ../../tutorial/classes.rst:886 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " @@ -1228,7 +1230,7 @@ msgstr "" "函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" "清晰。" -#: ../../tutorial/classes.rst:890 +#: ../../tutorial/classes.rst:891 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1236,14 +1238,13 @@ msgid "" "effort than writing a regular function." msgstr "" "除了會自動建立 method 和儲存程式狀態,當產生器終止時,它們還會自動引發 :exc:" -"`StopIteration`\\ 。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容" -"易。" +"`StopIteration`。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容易。" -#: ../../tutorial/classes.rst:899 +#: ../../tutorial/classes.rst:900 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:901 +#: ../../tutorial/classes.rst:902 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1258,18 +1259,18 @@ msgstr "" "產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" "省記憶體。" -#: ../../tutorial/classes.rst:908 +#: ../../tutorial/classes.rst:909 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:929 +#: ../../tutorial/classes.rst:930 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:930 +#: ../../tutorial/classes.rst:931 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " @@ -1278,10 +1279,10 @@ msgid "" "abstraction of namespace implementation, and should be restricted to things " "like post-mortem debuggers." msgstr "" -"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`\\ ," -"它回傳用於實作模組命名空間的 dictionary;\\ :attr:`~object.__dict__` 這個名稱" -"是一個屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該" -"僅限用於事後除錯器 (post-mortem debugger) 之類的東西。" +"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`,它回" +"傳用於實作模組命名空間的 dictionary;:attr:`~object.__dict__` 這個名稱是一個" +"屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該僅限用" +"於事後除錯器 (post-mortem debugger) 之類的東西。" #: ../../tutorial/classes.rst:347 msgid "object" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 17d4264089..0b8dd67511 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -199,16 +199,15 @@ msgid "" "The :keyword:`break` statement breaks out of the innermost enclosing :" "keyword:`for` or :keyword:`while` loop." msgstr "" -":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :" -"keyword:`while` 迴圈。" +":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :keyword:" +"`while` 迴圈。" #: ../../tutorial/controlflow.rst:169 msgid "" "A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " "clause." msgstr "" -":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` " -"子句" +":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` 子句" #: ../../tutorial/controlflow.rst:171 msgid "" @@ -646,18 +645,19 @@ msgid "" "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" -"ref:`tut-classes`) The method :meth:`append` shown in the example is defined " -"for list objects; it adds a new element at the end of the list. In this " -"example it is equivalent to ``result = result + [a]``, but more efficient." +"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"defined for list objects; it adds a new element at the end of the list. In " +"this example it is equivalent to ``result = result + [a]``, but more " +"efficient." msgstr "" "``result.append(a)`` 陳述式呼叫了一個 list 物件 ``result`` 的 *method(方法)" -"*\\ 。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``\\ ,其" -"中 ``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名" -"稱,並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可" -"以擁有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己" -"的物件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`append` " +"*\\ 。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``,其中 " +"``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," +"並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" +"有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" +"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`~list.append` " "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" -"於 ``result = result + [a]``\\ ,但更有效率。" +"於 ``result = result + [a]``,但更有效率。" #: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" @@ -712,8 +712,7 @@ msgstr "" msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." -msgstr "" -"此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" +msgstr "此例也使用了關鍵字 :keyword:`in`,用於測試序列中是否包含某個特定值。" #: ../../tutorial/controlflow.rst:584 msgid "" @@ -726,7 +725,7 @@ msgstr "" #: ../../tutorial/controlflow.rst:595 msgid "will print ``5``." -msgstr "將會輸出 ``5``\\ 。" +msgstr "將會輸出 ``5``。" #: ../../tutorial/controlflow.rst:597 msgid "" @@ -764,8 +763,8 @@ msgid "" "argument>` of the form ``kwarg=value``. For instance, the following " "function::" msgstr "" -"函式也可以使用\\ :term:`關鍵字引數 `\\ ,以 " -"``kwarg=value`` 的形式呼叫。舉例來說,以下函式:\n" +"函式也可以使用\\ :term:`關鍵字引數 `,以 ``kwarg=value`` 的" +"形式呼叫。舉例來說,以下函式:\n" "\n" "::" @@ -816,9 +815,9 @@ msgid "" "occur before ``**name``.) For example, if we define a function like this::" msgstr "" "當最後一個參數為 ``**name`` 形式時,它接收一個 dictionary(字典,詳見 :ref:" -"`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。\\ " -"``**name`` 可以與 ``*name`` 參數(下一小節介紹)組合使用,\\ ``*name`` 接收一" -"個 :ref:`tuple `\\ ,該 tuple 包含一般參數以外的位置引數(\\ " +"`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。" +"``**name`` 可以與 ``*name`` 參數(下一小節介紹)組合使用,``*name`` 接收一" +"個 :ref:`tuple `,該 tuple 包含一般參數以外的位置引數(\\ " "``*name`` 必須出現在 ``**name`` 前面)。例如,若我們定義這樣的函式:\n" "\n" "::" @@ -921,7 +920,7 @@ msgid "" "the first *keyword-only* parameter." msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" -"表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" +"表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``。" #: ../../tutorial/controlflow.rst:771 msgid "Function Examples" @@ -952,7 +951,7 @@ msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" -"第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``\\ ,因此僅限使用位置參數:\n" +"第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``,因此僅限使用位置參數:\n" "\n" "::" @@ -1132,10 +1131,10 @@ msgid "" "definitions, lambda functions can reference variables from the containing " "scope::" msgstr "" -":keyword:`lambda` 關鍵字用於建立小巧的匿名函式。\\ ``lambda a, b: a+b`` 函式" -"返回兩個引數的和。Lambda 函式可用於任何需要函式物件的地方。在語法上,它們被限" -"定只能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic " -"sugar)。與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數:\n" +":keyword:`lambda` 關鍵字用於建立小巧的匿名函式。``lambda a, b: a+b`` 函式返回" +"兩個引數的和。Lambda 函式可用於任何需要函式物件的地方。在語法上,它們被限定只" +"能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic sugar)。" +"與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數:\n" "\n" "::" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 193e22cf10..b061e79147 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-11-12 15:11+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -176,14 +176,14 @@ msgstr "將 List 作為 Stack(堆疊)使用" msgid "" "The list methods make it very easy to use a list as a stack, where the last " "element added is the first element retrieved (\"last-in, first-out\"). To " -"add an item to the top of the stack, use :meth:`append`. To retrieve an " -"item from the top of the stack, use :meth:`pop` without an explicit index. " -"For example::" +"add an item to the top of the stack, use :meth:`~list.append`. To retrieve " +"an item from the top of the stack, use :meth:`~list.pop` without an explicit " +"index. For example::" msgstr "" "List 的操作方法使得它非常簡單可以用來實作 stack(堆疊)。Stack 為一個遵守最後" "加入元素最先被取回(後進先出,\"last-in, first-out\")規則的資料結構。你可以" -"使用方法 :meth:`append` 將一個項目放到堆疊的頂層。而使用方法 :meth:`pop` 且不" -"給定索引值去取得堆疊最上面的項目。舉例而言:\n" +"使用方法 :meth:`~list.append` 將一個項目放到堆疊的頂層。而使用方法 :meth:" +"`~list.pop` 且不給定索引值去取得堆疊最上面的項目。舉例而言:\n" "\n" "::" @@ -371,15 +371,15 @@ msgstr ":keyword:`!del` 陳述式" #: ../../tutorial/datastructures.rst:343 msgid "" "There is a way to remove an item from a list given its index instead of its " -"value: the :keyword:`del` statement. This differs from the :meth:`pop` " -"method which returns a value. The :keyword:`!del` statement can also be " -"used to remove slices from a list or clear the entire list (which we did " +"value: the :keyword:`del` statement. This differs from the :meth:`~list." +"pop` method which returns a value. The :keyword:`!del` statement can also " +"be used to remove slices from a list or clear the entire list (which we did " "earlier by assignment of an empty list to the slice). For example::" msgstr "" "有一個方法可以藉由索引而不是值來刪除 list 中的項目:\\ :keyword:`del` 陳述" -"式。這和 :meth:`pop` method 傳回一個值不同,\\ :keyword:`!del` 陳述式可以用來" -"刪除 list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想刪除的" -"片段來完成這件事)。例如:\n" +"式。這和 :meth:`~list.pop` method 傳回一個值不同,\\ :keyword:`!del` 陳述式可" +"以用來刪除 list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想" +"刪除的片段來完成這件事)。例如:\n" "\n" "::" @@ -552,7 +552,7 @@ msgid "" "tuple contains any mutable object either directly or indirectly, it cannot " "be used as a key. You can't use lists as keys, since lists can be modified " "in place using index assignments, slice assignments, or methods like :meth:" -"`append` and :meth:`extend`." +"`~list.append` and :meth:`~list.extend`." msgstr "" "下一個常用的 Python 內建資料類型為 *dictionary*\\ (請參考\\ :ref:" "`typesmapping`\\ )。 Dictionary 有時被稱為「關聯記憶體」(associative " @@ -561,7 +561,8 @@ msgstr "" "和數字都可以當作鍵。Tuple 也可以當作鍵,如果他們只含有字串、數字或 tuple;若" "一個 tuple 直接或間接地含有任何可變的物件,它就不能當作鍵。你無法使用 list 當" "作鍵,因為 list 可以經由索引指派 (index assignment)、切片指派 (slice " -"assignment) 或是像 :meth:`append` 和 :meth:`extend` 等 method 被修改。" +"assignment) 或是像 :meth:`~list.append` 和 :meth:`~list.extend` 等 method 被" +"修改。" #: ../../tutorial/datastructures.rst:507 msgid "" @@ -640,10 +641,10 @@ msgstr "迴圈技巧" #: ../../tutorial/datastructures.rst:569 msgid "" "When looping through dictionaries, the key and corresponding value can be " -"retrieved at the same time using the :meth:`items` method. ::" +"retrieved at the same time using the :meth:`~dict.items` method. ::" msgstr "" -"當對 dictionary 作迴圈時,鍵以及其對應的值可以藉由使用 :meth:`items` method " -"來同時取得:\n" +"當對 dictionary 作迴圈時,鍵以及其對應的值可以藉由使用 :meth:`~dict.items` " +"method 來同時取得:\n" "\n" "::" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index e3081e1fab..0189e81ec1 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-10-05 10:26+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,14 +41,15 @@ msgstr "更華麗的輸出格式" #: ../../tutorial/inputoutput.rst:17 msgid "" "So far we've encountered two ways of writing values: *expression statements* " -"and the :func:`print` function. (A third way is using the :meth:`write` " -"method of file objects; the standard output file can be referenced as ``sys." -"stdout``. See the Library Reference for more information on this.)" +"and the :func:`print` function. (A third way is using the :meth:`~io." +"TextIOBase.write` method of file objects; the standard output file can be " +"referenced as ``sys.stdout``. See the Library Reference for more information " +"on this.)" msgstr "" "目前為止我們已經學過兩種寫值的方式:\\ *運算式陳述 (expression statements)* " -"與 :func:`print` 函式。(第三種方法是使用檔案物件的 :meth:`write` 方法;標準" -"輸出的檔案是使用 ``sys.stdout`` 來達成的。詳細的資訊請參考對應的函式庫說" -"明。)" +"與 :func:`print` 函式。(第三種方法是使用檔案物件的 :meth:`~io.TextIOBase." +"write` 方法;標準輸出的檔案是使用 ``sys.stdout`` 來達成的。詳細的資訊請參考對" +"應的函式庫說明。)" #: ../../tutorial/inputoutput.rst:22 msgid "" @@ -594,12 +595,12 @@ msgstr "" #: ../../tutorial/inputoutput.rst:459 msgid "" -"File objects have some additional methods, such as :meth:`~file.isatty` and :" -"meth:`~file.truncate` which are less frequently used; consult the Library " -"Reference for a complete guide to file objects." +"File objects have some additional methods, such as :meth:`~io.IOBase.isatty` " +"and :meth:`~io.IOBase.truncate` which are less frequently used; consult the " +"Library Reference for a complete guide to file objects." msgstr "" -"檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~file.isatty` 和 :" -"meth:`~file.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" +"檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~io.IOBase.isatty` " +"和 :meth:`~io.IOBase.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" #: ../../tutorial/inputoutput.rst:467 msgid "Saving structured data with :mod:`json`" @@ -608,16 +609,17 @@ msgstr "使用 :mod:`json` 儲存結構化資料" #: ../../tutorial/inputoutput.rst:471 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 " -"have to be passed to a function like :func:`int`, which takes a string like " -"``'123'`` and returns its numeric value 123. When you want to save more " -"complex data types like nested lists and dictionaries, parsing and " -"serializing by hand becomes complicated." -msgstr "" -"字串可以簡單地從檔案中被寫入和讀取。數字則稍嫌麻煩,因為 :meth:`read` method " -"只回傳字串,這些字串必須傳遞給像 :func:`int` 這樣的函式,它接受 ``'123'`` 這" -"樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 dictionary(字典)等複雜" -"的資料類型時,手動剖析 (parsing) 和序列化 (serializing) 就變得複雜。" +"more effort, since the :meth:`~io.TextIOBase.read` method only returns " +"strings, which will have to be passed to a function like :func:`int`, which " +"takes a string like ``'123'`` and returns its numeric value 123. When you " +"want to save more complex data types like nested lists and dictionaries, " +"parsing and serializing by hand becomes complicated." +msgstr "" +"字串可以簡單地從檔案中被寫入和讀取。數字則稍嫌麻煩,因為 :meth:`~io." +"TextIOBase.read` method 只回傳字串,這些字串必須傳遞給像 :func:`int` 這樣的函" +"式,它接受 ``'123'`` 這樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 " +"dictionary(字典)等複雜的資料類型時,手動剖析 (parsing) 和序列化 " +"(serializing) 就變得複雜。" #: ../../tutorial/inputoutput.rst:478 msgid "" diff --git a/tutorial/modules.po b/tutorial/modules.po index 14e3459cad..fa8bfdde9f 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,9 +66,9 @@ msgid "" "to create a file called :file:`fibo.py` in the current directory with the " "following contents::" msgstr "" -"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱加上 :file:`.py`\\ 。" -"在模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用您喜" -"歡的文字編輯器在資料夾中創一個名為 :file:`fibo.py` 的檔案,內容如下:\n" +"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱加上 :file:`.py`。在" +"模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用您喜歡" +"的文字編輯器在資料夾中創一個名為 :file:`fibo.py` 的檔案,內容如下:\n" "\n" "::" @@ -129,8 +129,8 @@ msgstr "" "每個模組都有它自己的私有命名空間 (namespace),模組內定義的函式會把該模組的私" "有符號表當成全域命名空間使用。因此,模組的作者可以在模組中使用全域變數,而不" "必擔心和使用者的全域變數發生意外的名稱衝突。另一方面,如果你知道自己在做什" -"麼,你可以用這個方式取用模組的全域變數,以和引用函式一樣的寫法,\\ ``modname." -"itemname``\\ 。" +"麼,你可以用這個方式取用模組的全域變數,以和引用函式一樣的寫法,``modname." +"itemname``。" #: ../../tutorial/modules.rst:86 msgid "" @@ -176,9 +176,9 @@ msgid "" "an unknown set of names into the interpreter, possibly hiding some things " "you have already defined." msgstr "" -"這個寫法會 import 模組中所有的名稱,除了使用底線(\\ ``_``\\ )開頭的名稱。大" -"多數情況下,Python 程式設計師不大使用這個功能,因為它在直譯器中引入了一組未知" -"的名稱,並且可能覆蓋了某些您已經定義的內容。" +"這個寫法會 import 模組中所有的名稱,除了使用底線 (``_``) 開頭的名稱。大多數情" +"況下,Python 程式設計師不大使用這個功能,因為它在直譯器中引入了一組未知的名" +"稱,並且可能覆蓋了某些您已經定義的內容。" #: ../../tutorial/modules.rst:112 msgid "" @@ -195,8 +195,8 @@ msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和" -"被 import 模組綁定在一起。" +"如果模組名稱後面出現 :keyword:`!as`,則 :keyword:`!as` 之後的名稱將直接和被 " +"import 模組綁定在一起。" #: ../../tutorial/modules.rst:125 msgid "" @@ -224,8 +224,8 @@ msgid "" msgstr "" "出於效率原因,每個模組在每個直譯器 session 中僅會被 import 一次。因此,如果您" "更改了模組,則必須重啟直譯器——或者,如果只是一個想要在互動模式下測試的模組," -"可以使用 :func:`importlib.reload`\\ 。例如:\\ ``import importlib; importlib." -"reload(modulename)``\\ 。" +"可以使用 :func:`importlib.reload`。例如:``import importlib; importlib." +"reload(modulename)``。" #: ../../tutorial/modules.rst:147 msgid "Executing modules as scripts" @@ -245,7 +245,7 @@ msgid "" "this code at the end of your module::" msgstr "" "如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 " -"``\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" +"``\"__main__\"``。這意味著,透過在模組的末尾添加以下程式碼:\n" "\n" "::" @@ -280,16 +280,16 @@ msgstr "模組的搜尋路徑" #: ../../tutorial/modules.rst:186 msgid "" -"When a module named :mod:`spam` is imported, the interpreter first searches " +"When a module named :mod:`!spam` is imported, the interpreter first searches " "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` 的模組時,直譯器首先會搜尋具有該名稱的內建模組。" +"Import 一個名為 :mod:`!spam` 的模組時,直譯器首先會搜尋具有該名稱的內建模組。" "模組名稱列在 :data:`sys.builtin_module_names` 當中。如果找不到,接下來會在變" "數 :data:`sys.path` 所給定的資料夾清單之中,搜尋一個名為 :file:`spam.py` 的檔" -"案。\\ :data:`sys.path` 從這些位置開始進行初始化:" +"案。:data:`sys.path` 從這些位置開始進行初始化:" #: ../../tutorial/modules.rst:192 msgid "" @@ -336,9 +336,9 @@ msgid "" "library directory. This is an error unless the replacement is intended. See " "section :ref:`tut-standardmodules` for more information." msgstr "" -"初始化之後,Python 程式可以修改 :data:`sys.path`\\ 。執行中腳本的所在資料夾會" -"在搜尋路徑的開頭,在標準函式庫路徑之前。這代表該資料夾中的腳本會優先被載入," -"而不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" +"初始化之後,Python 程式可以修改 :data:`sys.path`。執行中腳本的所在資料夾會在" +"搜尋路徑的開頭,在標準函式庫路徑之前。這代表該資料夾中的腳本會優先被載入,而" +"不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" "誤。 請參見\\ :ref:`tut-standardmodules`\\ 以瞭解更多資訊。" #: ../../tutorial/modules.rst:219 @@ -356,10 +356,10 @@ msgid "" "different releases and different versions of Python to coexist." msgstr "" "為了加快載入模組的速度,Python 將每個模組的編譯版本暫存在 ``__pycache__`` 資" -"料夾下,並命名為 :file:`module.{version}.pyc`\\ , 這裡的 version 是編譯後的" -"檔案的格式名稱,且名稱通常會包含 Python 的版本編號。例如,在 CPython 3.3 中," -"spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``\\ 。此命名準" -"則可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" +"料夾下,並命名為 :file:`module.{version}.pyc`, 這裡的 version 是編譯後的檔案" +"的格式名稱,且名稱通常會包含 Python 的版本編號。例如,在 CPython 3.3 中," +"spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``。此命名準則" +"可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" #: ../../tutorial/modules.rst:229 msgid "" @@ -425,7 +425,7 @@ msgstr "模組 :mod:`compileall` 可以為資料夾中的所有模組創建 .pyc msgid "" "There is more detail on this process, including a flow chart of the " "decisions, in :pep:`3147`." -msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`\\ 。" +msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`。" #: ../../tutorial/modules.rst:265 msgid "Standard Modules" @@ -449,9 +449,9 @@ msgstr "" "手冊」(簡稱為「函式庫參考手冊」)。有些模組是直譯器中內建的;它們使一些不屬" "於語言核心但依然內建的運算得以存取,其目的是為了提高效率,或提供作業系統基本" "操作(例如系統呼叫)。這些模組的集合是一個組態選項,它們取決於底層平台。例" -"如:\\ :mod:`winreg` 模組僅供 Windows 使用。值得注意的模組是 :mod:`sys`\\ ," -"它被內建在每個 Python 直譯器中。變數 ``sys.ps1`` 和 ``sys.ps2`` 則用來定義" -"主、次提示字元的字串:\n" +"如::mod:`winreg` 模組僅供 Windows 使用。值得注意的模組是 :mod:`sys`,它被內" +"建在每個 Python 直譯器中。變數 ``sys.ps1`` 和 ``sys.ps2`` 則用來定義主、次提" +"示字元的字串:\n" "\n" "::" @@ -493,7 +493,7 @@ msgstr "" msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" -"沒有給引數時,\\ :func:`dir` 列出目前已定義的名稱:\n" +"沒有給引數時,:func:`dir` 列出目前已定義的名稱:\n" "\n" "::" @@ -520,15 +520,15 @@ msgstr "套件 (Package)" #: ../../tutorial/modules.rst:391 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 " -"a submodule named ``B`` in a package named ``A``. Just like the use of " -"modules saves the authors of different modules from having to worry about " -"each other's global variable names, the use of dotted module names saves the " -"authors of multi-module packages like NumPy or Pillow from having to worry " -"about each other's module names." +"\"dotted module names\". For example, the module name :mod:`!A.B` " +"designates a submodule named ``B`` in a package named ``A``. Just like the " +"use of modules saves the authors of different modules from having to worry " +"about each other's global variable names, the use of dotted module names " +"saves the authors of multi-module packages like NumPy or Pillow from having " +"to worry about each other's module names." msgstr "" "套件是一種使用「點分隔模組名稱」組織 Python 模組命名空間的方法。例如,模組名" -"稱 :mod:`A.B` 表示套件 ``A`` 中名為 ``B`` 的子模組。正如模組使用時,不同模組" +"稱 :mod:`!A.B` 表示套件 ``A`` 中名為 ``B`` 的子模組。正如模組使用時,不同模組" "的作者不需擔心與其他模組的全域變數名稱重複,點分隔模組名稱的使用,也讓多模組" "套件(像 NumPy 或 Pillow)的作者們不須擔心其他套件的模組名稱。" @@ -547,12 +547,11 @@ msgid "" "terms of a hierarchical filesystem):" msgstr "" "假設你想設計一個能統一處理音訊檔案及音訊數據的模組集(「套件」)。因為音訊檔" -"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`." -"wav`\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間" -"的轉換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多" -"不同作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將" -"編寫一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案" -"系統的方式表示):" +"案有很多的不同的格式(通常以它們的副檔名來辨識,例如::file:`.wav`、:file:`." +"aiff`、:file:`.au`\\ ),因此,為了不同檔案格式之間的轉換,你會需要建立和維護" +"一個不斷增長的模組集合。為了要達成對音訊數據的許多不同作業(例如,音訊混合、" +"增加回聲、套用等化器功能、創造人工立體音效),你將編寫一系列無止盡的模組來執" +"行這些作業。以下是你的套件可能的架構(以階層式檔案系統的方式表示):" #: ../../tutorial/modules.rst:436 msgid "" @@ -571,7 +570,7 @@ msgid "" msgstr "" "目錄中必須含有 :file:`__init__.py` 檔案,才會被 Pyhon 當成套件;這樣可以避免" "一些以常用名稱命名(例如 ``string``\\ )的目錄,無意中隱藏了較晚出現在模組搜" -"尋路徑中的有效模組。在最簡單的情況,\\ :file:`__init__.py` 可以只是一個空白檔" +"尋路徑中的有效模組。在最簡單的情況,:file:`__init__.py` 可以只是一個空白檔" "案;但它也可以執行套件的初始化程式碼,或設置 ``__all__`` 變數,之後會詳述。" #: ../../tutorial/modules.rst:446 @@ -585,10 +584,10 @@ msgstr "" #: ../../tutorial/modules.rst:451 msgid "" -"This loads the submodule :mod:`sound.effects.echo`. It must be referenced " +"This loads the submodule :mod:`!sound.effects.echo`. It must be referenced " "with its full name. ::" msgstr "" -"這樣就載入了子模組 :mod:`sound.effects.echo`\\ 。引用時必須用它的全名:\n" +"這樣就載入了子模組 :mod:`!sound.effects.echo`。引用時必須用它的全名:\n" "\n" "::" @@ -601,11 +600,11 @@ msgstr "" #: ../../tutorial/modules.rst:460 msgid "" -"This also loads the submodule :mod:`echo`, and makes it available without " +"This also loads the submodule :mod:`!echo`, and makes it available without " "its package prefix, so it can be used as follows::" msgstr "" -"這段程式碼一樣可以載入子模組 :mod:`echo`\\ ,並且不加套件前綴也可以使用,因此" -"能以如下方式使用:\n" +"這段程式碼一樣可以載入子模組 :mod:`!echo`,並且不加套件前綴也可以使用,因此能" +"以如下方式使用:\n" "\n" "::" @@ -620,10 +619,10 @@ msgstr "" #: ../../tutorial/modules.rst:469 msgid "" -"Again, this loads the submodule :mod:`echo`, but this makes its function :" -"func:`echofilter` directly available::" +"Again, this loads the submodule :mod:`!echo`, but this makes its function :" +"func:`!echofilter` directly available::" msgstr "" -"同樣地,這樣也會載入子模組 :mod:`echo`\\ ,但它的函式 :func:`echofilter` 就可" +"同樣地,這樣也會載入子模組 :mod:`!echo`,但它的函式 :func:`!echofilter` 就可" "以直接使用:\n" "\n" "::" @@ -682,11 +681,11 @@ msgid "" "importing \\* from their package. For example, the file :file:`sound/" "effects/__init__.py` could contain the following code::" msgstr "" -"唯一的解法是由套件作者為套件提供明確的索引。\\ :keyword:`import` 陳述式使用以" -"下慣例:如果套件的 :file:`__init__.py` 程式碼有定義一個名為 ``__all__`` 的 " +"唯一的解法是由套件作者為套件提供明確的索引。:keyword:`import` 陳述式使用以下" +"慣例:如果套件的 :file:`__init__.py` 程式碼有定義一個名為 ``__all__`` 的 " "list,若遇到 ``from package import *`` 的時候,它就會是要被 import 的模組名" "稱。發布套件的新版本時,套件作者可自行決定是否更新此 list。如果套件作者認為沒" -"有人會從他的套件中 import \\*,他也可能會決定不支援這個 list。舉例來說,\\ :" +"有人會從他的套件中 import \\*,他也可能會決定不支援這個 list。舉例來說,:" "file:`sound/effects/__init__.py` 檔案可包含以下程式碼:\n" "\n" "::" @@ -694,10 +693,10 @@ msgstr "" #: ../../tutorial/modules.rst:512 msgid "" "This would mean that ``from sound.effects import *`` would import the three " -"named submodules of the :mod:`sound.effects` package." +"named submodules of the :mod:`!sound.effects` package." msgstr "" -"意思是,\\ ``from sound.effects import *`` 將會 import :mod:`sound.effects` " -"套件中,這三個被提名的子模組。" +"意思是,``from sound.effects import *`` 將會 import :mod:`!sound.effects` 套" +"件中,這三個被提名的子模組。" #: ../../tutorial/modules.rst:515 msgid "" @@ -712,33 +711,33 @@ msgstr "" #: ../../tutorial/modules.rst:531 msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " -"does *not* import all submodules from the package :mod:`sound.effects` into " -"the current namespace; it only ensures that the package :mod:`sound.effects` " -"has been imported (possibly running any initialization code in :file:" -"`__init__.py`) and then imports whatever names are defined in the package. " -"This includes any names defined (and submodules explicitly loaded) by :file:" -"`__init__.py`. It also includes any submodules of the package that were " -"explicitly loaded by previous :keyword:`import` statements. Consider this " -"code::" -msgstr "" -"如果 ``__all__`` 沒有被定義,\\ ``from sound.effects import *`` 陳述式\\ *並" -"不會*\\ 把 :mod:`sound.effects` 套件中所有子模組都 import 到當前的命名空間;" -"它只保證 :mod:`sound.effects` 套件有被 import(可能會運行 :file:`__init__." -"py` 中的初始化程式碼),然後 import 套件中被定義的全部名稱。這包含 :file:" -"`__init__.py` 定義(以及被明確載入的子模組)的任何名稱。它也包括任何之前被 :" -"keyword:`import` 陳述式明確載入的套件子模組。請看以下程式碼:\n" +"does *not* import all submodules from the package :mod:`!sound.effects` into " +"the current namespace; it only ensures that the package :mod:`!sound." +"effects` has been imported (possibly running any initialization code in :" +"file:`__init__.py`) and then imports whatever names are defined in the " +"package. This includes any names defined (and submodules explicitly loaded) " +"by :file:`__init__.py`. It also includes any submodules of the package that " +"were explicitly loaded by previous :keyword:`import` statements. Consider " +"this code::" +msgstr "" +"如果 ``__all__`` 沒有被定義,``from sound.effects import *`` 陳述式\\ *並不會" +"*\\ 把 :mod:`!sound.effects` 套件中所有子模組都 import 到當前的命名空間;它只" +"保證 :mod:`!sound.effects` 套件有被 import(可能會運行 :file:`__init__.py` 中" +"的初始化程式碼),然後 import 套件中被定義的全部名稱。這包含 :file:`__init__." +"py` 定義(以及被明確載入的子模組)的任何名稱。它也包括任何之前被 :keyword:" +"`import` 陳述式明確載入的套件子模組。請看以下程式碼:\n" "\n" "::" #: ../../tutorial/modules.rst:544 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` " -"package when the ``from...import`` statement is executed. (This also works " -"when ``__all__`` is defined.)" +"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` package when the ``from...import`` statement is executed. (This " +"also works when ``__all__`` is defined.)" msgstr "" -"此例中,當 ``from...import`` 陳述式被執行時,\\ :mod:`echo` 和 :mod:" -"`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " +"此例中,當 ``from...import`` 陳述式被執行時,:mod:`!echo` 和 :mod:`!" +"surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`!sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" #: ../../tutorial/modules.rst:549 @@ -766,27 +765,27 @@ msgstr "套件內引用" #: ../../tutorial/modules.rst:564 msgid "" -"When packages are structured into subpackages (as with the :mod:`sound` " +"When packages are structured into subpackages (as with the :mod:`!sound` " "package in the example), you can use absolute imports to refer to submodules " -"of siblings packages. For example, if the module :mod:`sound.filters." -"vocoder` needs to use the :mod:`echo` module in the :mod:`sound.effects` " +"of siblings packages. For example, if the module :mod:`!sound.filters." +"vocoder` needs to use the :mod:`!echo` module in the :mod:`!sound.effects` " "package, it can use ``from sound.effects import echo``." msgstr "" -"當套件的結構為多個子套件的組合時(如同範例中的 :mod:`sound` 套件),可以使用" -"「絕對 (absolute) import」,引用同層套件中的子模組。例如,要在 :mod:`sound." -"filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" -"以用 ``from sound.effects import echo``\\ 。" +"當套件的結構為多個子套件的組合時(如同範例中的 :mod:`!sound` 套件),可以使用" +"「絕對 (absolute) import」,引用同層套件中的子模組。例如,要在 :mod:`!sound." +"filters.vocoder` 模組中使用 :mod:`!sound.effects` 中的 :mod:`!echo` 模組時," +"可以用 ``from sound.effects import echo``。" #: ../../tutorial/modules.rst:570 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 " "current and parent packages involved in the relative import. From the :mod:" -"`surround` module for example, you might use::" +"`!surround` module for example, you might use::" msgstr "" "你也可以用 ``from module import name`` 的 import 陳述式,編寫「相對 " "(relative) import」。這些 import 使用前導句號指示相對 import 中的當前套件和母" -"套件。例如,在 :mod:`surround` 模組中,你可以使用:\n" +"套件。例如,在 :mod:`!urround` 模組中,你可以使用:\n" "\n" "::" @@ -798,8 +797,8 @@ msgid "" "absolute imports." msgstr "" "請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 " -"``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" -"必須永遠使用絕對 import。" +"``\"__main__\"``,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" +"須永遠使用絕對 import。" #: ../../tutorial/modules.rst:585 msgid "Packages in Multiple Directories" @@ -813,10 +812,9 @@ msgid "" "This variable can be modified; doing so affects future searches for modules " "and subpackages contained in the package." msgstr "" -"套件也支援一個特殊屬性 :attr:`__path__`\\ 。它在初始化時是一個 list,包含該套" -"件的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時機是在這個檔案的程式碼被" -"執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" -"尋。" +"套件也支援一個特殊屬性 :attr:`__path__`。它在初始化時是一個 list,包含該套件" +"的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時機是在這個檔案的程式碼被執" +"行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜尋。" #: ../../tutorial/modules.rst:593 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index bbf65b2517..2108feb605 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1263,7 +1263,7 @@ msgid "" msgstr "" #: ../../whatsnew/2.2.rst:1081 -msgid "Rename :c:func:`Py_TPFLAGS_GC` to :c:func:`PyTPFLAGS_HAVE_GC`." +msgid "Rename :c:macro:`!Py_TPFLAGS_GC` to :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" #: ../../whatsnew/2.2.rst:1084 @@ -1275,21 +1275,19 @@ msgstr "" msgid "objects, and :c:func:`PyObject_GC_Del` to deallocate them." msgstr "" -#: ../../whatsnew/2.2.rst:1087 -msgid "Rename :c:func:`PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and" -msgstr "" - -#: ../../whatsnew/2.2.rst:1087 -msgid ":c:func:`PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." +#: ../../whatsnew/2.2.rst:1086 +msgid "" +"Rename :c:func:`!PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and :c:" +"func:`!PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." msgstr "" #: ../../whatsnew/2.2.rst:1089 -msgid "Remove :c:func:`PyGC_HEAD_SIZE` from object size calculations." +msgid "Remove :c:macro:`!PyGC_HEAD_SIZE` from object size calculations." msgstr "" #: ../../whatsnew/2.2.rst:1091 msgid "" -"Remove calls to :c:func:`PyObject_AS_GC` and :c:func:`PyObject_FROM_GC`." +"Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`." msgstr "" #: ../../whatsnew/2.2.rst:1093 @@ -1459,7 +1457,7 @@ msgid "" "operator, but these features were rarely used and therefore buggy. The :" "meth:`tolist` method and the :attr:`start`, :attr:`stop`, and :attr:`step` " "attributes are also being deprecated. At the C level, the fourth argument " -"to the :c:func:`PyRange_New` function, ``repeat``, has also been deprecated." +"to the :c:func:`!PyRange_New` function, ``repeat``, has also been deprecated." msgstr "" #: ../../whatsnew/2.2.rst:1224 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 186727b21f..ea946a8f00 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -2084,7 +2084,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1900 msgid "" -"The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it " +"The :c:func:`!PyArg_NoArgs` macro is now deprecated, and code that uses it " "should be changed. For Python 2.2 and later, the method definition table " "can specify the :c:macro:`METH_NOARGS` flag, signalling that there are no " "arguments, and the argument checking can then be removed. If compatibility " diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index d442af8ca9..db666a88bd 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1667,8 +1667,8 @@ msgstr "" #: ../../whatsnew/2.4.rst:1470 msgid "" -"C code can avoid unnecessary locking by using the new :c:func:" -"`PyEval_ThreadsInitialized` function to tell if any thread operations have " +"C code can avoid unnecessary locking by using the new :c:func:`!" +"PyEval_ThreadsInitialized` function to tell if any thread operations have " "been performed. If this function returns false, no lock operations are " "needed. (Contributed by Nick Coghlan.)" msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 88fbcaede3..f20f05f3ff 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -2517,10 +2517,10 @@ msgid "" "definition of the various AST nodes in :file:`Parser/Python.asdl`. A Python " "script reads this file and generates a set of C structure definitions in :" "file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and :c:" -"func:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take " +"func:`!PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take " "Python source as input and return the root of an AST representing the " -"contents. This AST can then be turned into a code object by :c:func:" -"`PyAST_Compile`. For more information, read the source code, and then ask " +"contents. This AST can then be turned into a code object by :c:func:`!" +"PyAST_Compile`. For more information, read the source code, and then ask " "questions on python-dev." msgstr "" @@ -2590,11 +2590,11 @@ msgid "" "``Py_LOCAL(type)`` declares the function as returning a value of the " "specified *type* and uses a fast-calling qualifier. " "``Py_LOCAL_INLINE(type)`` does the same thing and also requests the function " -"be inlined. If :c:func:`PY_LOCAL_AGGRESSIVE` is defined before :file:" -"`python.h` is included, a set of more aggressive optimizations are enabled " -"for the module; you should benchmark the results to find out if these " -"optimizations actually make the code faster. (Contributed by Fredrik Lundh " -"at the NeedForSpeed sprint.)" +"be inlined. If macro :c:macro:`!PY_LOCAL_AGGRESSIVE` is defined before :" +"file:`python.h` is included, a set of more aggressive optimizations are " +"enabled for the module; you should benchmark the results to find out if " +"these optimizations actually make the code faster. (Contributed by Fredrik " +"Lundh at the NeedForSpeed sprint.)" msgstr "" #: ../../whatsnew/2.5.rst:2181 @@ -2605,7 +2605,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2184 msgid "" -"The :c:func:`PyErr_Warn` function for issuing warnings is now deprecated in " +"The :c:func:`!PyErr_Warn` function for issuing warnings is now deprecated in " "favour of ``PyErr_WarnEx(category, message, stacklevel)`` which lets you " "specify the number of stack frames separating this function and the caller. " "A *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the " @@ -2621,7 +2621,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2194 msgid "" -"The :c:func:`PyRange_New` function was removed. It was never documented, " +"The :c:func:`!PyRange_New` function was removed. It was never documented, " "never used in the core code, and had dangerously lax error checking. In the " "unlikely case that your extensions were using it, you can replace it by " "something like the following::" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index dd902227eb..736ee4d980 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1092,7 +1092,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:979 msgid "" "At the C level, Python 3.0 will rename the existing 8-bit string type, " -"called :c:type:`PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " +"called :c:type:`!PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " "Python 2.6 uses ``#define`` to support using the names :c:func:" "`PyBytesObject`, :c:func:`PyBytes_Check`, :c:func:" "`PyBytes_FromStringAndSize`, and all the other functions and macros used " @@ -3368,11 +3368,11 @@ msgid "" "thread-safe as the underlying library is. A long-standing potential bug " "occurred if one thread closed a file object while another thread was reading " "from or writing to the object. In 2.6 file objects have a reference count, " -"manipulated by the :c:func:`PyFile_IncUseCount` and :c:func:" -"`PyFile_DecUseCount` functions. File objects can't be closed unless the " -"reference count is zero. :c:func:`PyFile_IncUseCount` should be called " +"manipulated by the :c:func:`!PyFile_IncUseCount` and :c:func:`!" +"PyFile_DecUseCount` functions. File objects can't be closed unless the " +"reference count is zero. :c:func:`!PyFile_IncUseCount` should be called " "while the GIL is still held, before carrying out an I/O operation using the " -"``FILE *`` pointer, and :c:func:`PyFile_DecUseCount` should be called " +"``FILE *`` pointer, and :c:func:`!PyFile_DecUseCount` should be called " "immediately after the GIL is re-acquired. (Contributed by Antoine Pitrou and " "Gregory P. Smith.)" msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index ce47e5c2bc..2b70b2c4ce 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -2513,8 +2513,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2153 msgid "" "New function: stemming from the rewrite of string-to-float conversion, a " -"new :c:func:`PyOS_string_to_double` function was added. The old :c:func:" -"`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions are now " +"new :c:func:`PyOS_string_to_double` function was added. The old :c:func:`!" +"PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions are now " "deprecated." msgstr "" @@ -2566,7 +2566,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2198 msgid "" -"Removed function: :c:macro:`PyEval_CallObject` is now only available as a " +"Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " "compatibility, but that was in 1997; it can certainly be deleted by now. " "(Removed by Antoine Pitrou; :issue:`8276`.)" @@ -2574,8 +2574,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2203 msgid "" -"New format codes: the :c:func:`PyFormat_FromString`, :c:func:" -"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept " +"New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" +"PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " "``%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" @@ -2959,8 +2959,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2542 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" -"func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions, which are " -"now deprecated." +"func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions, which " +"are now deprecated." msgstr "" #: ../../whatsnew/2.7.rst:2546 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index c533da625c..4dc3a9af51 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1241,8 +1241,8 @@ msgstr "" #: ../../whatsnew/3.0.rst:868 msgid "" -":c:func:`PyNumber_Coerce`, :c:func:`PyNumber_CoerceEx`, :c:func:" -"`PyMember_Get`, and :c:func:`PyMember_Set` C APIs are removed." +":c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`, :c:func:`!" +"PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed." msgstr "" #: ../../whatsnew/3.0.rst:871 diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 5e5a29c54c..12436bb343 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -640,7 +640,7 @@ msgstr "(由 Mark Dickinson 和 Lisandro Dalcrin 貢獻;:issue:`5175`。)" #: ../../whatsnew/3.1.rst:504 msgid "" -"Deprecated :c:func:`PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." +"Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" #: ../../whatsnew/3.1.rst:506 @@ -650,8 +650,8 @@ msgstr "(由 Mark Dickinson 貢獻;:issue:`4910`。)" #: ../../whatsnew/3.1.rst:508 msgid "" "Added a new :c:func:`PyOS_string_to_double` function to replace the " -"deprecated functions :c:func:`PyOS_ascii_strtod` and :c:func:" -"`PyOS_ascii_atof`." +"deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" +"PyOS_ascii_atof`." msgstr "" #: ../../whatsnew/3.1.rst:511 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 84c95a3415..e1f2db7479 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1933,8 +1933,8 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34204`.)" msgstr "" "現在,:mod:`shelve` 模組在建立 shelve 時預設使用 :const:`pickle." -"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz " -"在 :issue:`34204` 中貢獻。)" +"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz 在 :" +"issue:`34204` 中貢獻。)" #: ../../whatsnew/3.10.rst:1327 msgid "statistics" @@ -2002,9 +2002,9 @@ msgid "" "`43799`, :issue:`43920`, :issue:`43789`, and :issue:`43811`.)" msgstr "" "ssl 模組初步支援 OpenSSL 3.0.0 和新選項 :const:`~ssl." -"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:" -"issue:`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:" -"`43920`、:issue:`43789` 和 :issue:`43811` 貢獻。)" +"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:issue:" +"`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:`43920`、:" +"issue:`43789` 和 :issue:`43811` 貢獻。)" #: ../../whatsnew/3.10.rst:1364 msgid "" @@ -2115,9 +2115,9 @@ msgid "" "simulate (the default is still :const:`signal.SIGINT`). (Contributed by " "Antoine Pitrou in :issue:`43356`.)" msgstr "" -":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設" -"值仍然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` " -"中貢獻。)" +":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設值仍" +"然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1420 msgid "threading" @@ -2493,7 +2493,6 @@ msgstr "" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" #: ../../whatsnew/3.10.rst:1608 -#, fuzzy msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2509,16 +2508,15 @@ msgid "" "appropriate to help identify code which needs updating during this " "transition." msgstr "" -"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語" -"義。具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" -"`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." -"find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" -"`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." -"module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." -"parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " -"``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" -"`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :" -"exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" +"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語義。" +"具體來說, :meth:`!find_loader`/:meth:`!find_module` (被 :meth:`~importlib." +"abc.Finder.find_spec` 取代)、:meth:`~importlib.abc.Loader.load_module` " +"(被 :meth:`~importlib.abc.Loader.exec_module` 取代)、 :meth:`!module_repr` " +"(引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__.parent`` 取" +"代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 ``__cached__`` 屬" +"性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:`importlib` 中的其他" +"類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" +"`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" #: ../../whatsnew/3.10.rst:1625 msgid "" @@ -2579,11 +2577,11 @@ msgid "" "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" "引入系統使用 :meth:`!importlib.abc.MetaPathFinder.find_module` 和 :!meth:" -"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:" -"`ImportWarning`,因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :" -"meth:`importlib.abc.PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :" -"func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :" -"issue:`42134` 中貢獻。)" +"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:`ImportWarning`," +"因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :meth:`importlib.abc." +"PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :func:`importlib." +"util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1657 msgid "" @@ -2593,10 +2591,10 @@ msgid "" "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :issue:" "`43672`.)" msgstr "" -"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸" -"發 :exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder." -"find_spec` 是首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫" -"助移植。(由 Brett Cannon 在 :issue:`43672` 中貢獻。)" +"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸發 :" +"exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder.find_spec` 是" +"首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " +"Brett Cannon 在 :issue:`43672` 中貢獻。)" #: ../../whatsnew/3.10.rst:1663 msgid "" @@ -2612,17 +2610,16 @@ msgid "" "removal in Python 3.12 (previously they were documented as deprecated in " "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" -"`!importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." +":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:`!" +"importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." "machinery.FrozenImporter.find_module`、:meth:`!importlib.machinery." "WindowsRegistryFinder.find_module`、:meth:`!importlib.machinery.PathFinder." -"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:" -"`!importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." +"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:`!" +"importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." "FileFinder.find_module` ) 和 :meth:`!importlib.abc.PathEntryFinder." "find_loader` (:meth:`!importlib.machinery.FileFinder.find_loader` ) 現在引" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " -"Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢" -"獻。)" +"Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1678 msgid "" @@ -2632,10 +2629,10 @@ msgid "" "should inherit from one of these two classes as appropriate instead. " "(Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :" -"meth:`!find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :" -"class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需" -"求來選擇其一以繼承。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" +":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`!" +"find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :class:`importlib." +"abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" +"(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1685 msgid "" @@ -2648,11 +2645,11 @@ msgid "" "Brett Cannon in :issue:`43720`.)" msgstr "" "棄用 :mod:`!imp`、:func:`!importlib.find_loader`、:func:`!importlib.util." -"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:" -"`!importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :" -"class:`!pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本" -"(它們開始在過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 " -"Brett Cannon 在 :issue:`43720` 中貢獻。)" +"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:`!" +"importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :class:`!" +"pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本(它們開始在" +"過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" +"issue:`43720` 中貢獻。)" #: ../../whatsnew/3.10.rst:1695 msgid "" @@ -2661,10 +2658,9 @@ msgid "" "Removal of the use of ``module_repr()`` is scheduled for Python 3.12. " "(Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:`!module_repr`" -" 作為模組的 ``__repr__()`` 方法。計劃" -"在 Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :" -"issue:`42137` 中貢獻。)" +"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:`!" +"module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " +"``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" #: ../../whatsnew/3.10.rst:1701 msgid "" @@ -2675,8 +2671,8 @@ msgid "" msgstr "" ":meth:`!importlib.abc.Loader.module_repr`、:meth:`!importlib.machinery." "FrozenLoader.module_repr` 和 :meth:`!importlib.machinery.BuiltinLoader." -"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :" -"issue:`42136` 中貢獻。)" +"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" +"`42136` 中貢獻。)" #: ../../whatsnew/3.10.rst:1707 msgid "" @@ -2921,13 +2917,13 @@ msgstr "" #: ../../whatsnew/3.10.rst:1822 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`.)" +"Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " +"now due to the :mod:`!_warnings` module was converted to a builtin module in " +"2.6. (Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -"刪除了 :c:func:`PyModule_GetWarningsModule` 函式,該函式現在無用,因為 " -"_warnings 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中貢" -"獻。)" +"刪除了 :c:func:`!PyModule_GetWarningsModule` 函式,該函式現在無用,因為 :mod:" +"`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" +"貢獻。)" #: ../../whatsnew/3.10.rst:1826 msgid "" @@ -3529,9 +3525,9 @@ msgid "" "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" -"新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無" -"法設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:`43908` " -"中貢獻。)" +"新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無法" +"設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" +"`43908` 中貢獻。)" #: ../../whatsnew/3.10.rst:2138 msgid "" @@ -3647,10 +3643,10 @@ msgid "" "is set instead. (Contributed by Victor Stinner and Erlend E. Aasland in :" "issue:`43908`.)" msgstr "" -"使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要" -"依賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否" -"設定了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend " -"E. Aasland 在 :issue:`35134` 中貢獻。)" +"使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要依" +"賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否設定" +"了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " +"Aasland 在 :issue:`35134` 中貢獻。)" #: ../../whatsnew/3.10.rst:2196 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 4b7eda8345..8f1f96a9a8 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-24 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -149,7 +149,7 @@ msgid "" "pep670>`" msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" -#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2193 +#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2197 msgid "New Features" msgstr "新增特性" @@ -613,16 +613,13 @@ msgid "" "class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections." "deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies " "and pickles instance attributes implemented as :term:`slots <__slots__>`. " -"(Contributed by Serhiy Storchaka in :issue:`26579`.)" +"This change has an unintended side effect: It trips up a small minority of " +"existing Python projects not expecting :meth:`object.__getstate__` to exist. " +"See the later comments on :gh:`70766` for discussions of what workarounds " +"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" -"添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預設實" -"作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:class:" -"`collections.OrderedDict`、:class:`collections.deque`、:class:`weakref." -"WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:`pickle` 實例,現" -"在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬性。 (由 Serhiy " -"Storchaka 在 :issue:`26579` 中貢獻。)" -#: ../../whatsnew/3.11.rst:466 +#: ../../whatsnew/3.11.rst:470 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " "environment variable, which disable the automatic prepending to :data:`sys." @@ -639,7 +636,7 @@ msgstr "" "keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" "的)目錄中的模組重疊。 (由 Victor Stinner 在 :gh:`57684` 中貢獻。)" -#: ../../whatsnew/3.11.rst:477 +#: ../../whatsnew/3.11.rst:481 msgid "" "A ``\"z\"`` option was added to the :ref:`formatspec` that coerces negative " "to positive zero after rounding to the format precision. See :pep:`682` for " @@ -648,7 +645,7 @@ msgstr "" "``\"z\"`` 選項被新增到 :ref:`formatspec`,它會強迫負的 0 在進位到格式精度後成" "為正的。更多詳情請見 :pep:`682`。(由 John Belmonte 於 :gh:`90153` 中貢獻。)" -#: ../../whatsnew/3.11.rst:482 +#: ../../whatsnew/3.11.rst:486 msgid "" "Bytes are no longer accepted on :data:`sys.path`. Support broke sometime " "between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0 " @@ -663,11 +660,11 @@ msgstr "" "會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" "`91181` 中貢獻。)" -#: ../../whatsnew/3.11.rst:493 +#: ../../whatsnew/3.11.rst:497 msgid "Other CPython Implementation Changes" msgstr "其他 CPython 實作更動" -#: ../../whatsnew/3.11.rst:495 +#: ../../whatsnew/3.11.rst:499 msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" @@ -679,7 +676,7 @@ msgstr "" "__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " "Na 於 :issue:`24234` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:500 +#: ../../whatsnew/3.11.rst:504 msgid "" "``siphash13`` is added as a new internal hashing algorithm. It has similar " "security properties as ``siphash24``, but it is slightly faster for long " @@ -694,7 +691,7 @@ msgstr "" "案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" "`29410` 中貢獻。)" -#: ../../whatsnew/3.11.rst:509 +#: ../../whatsnew/3.11.rst:513 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " "no parameters, the traceback attached to this exception is now always ``sys." @@ -707,7 +704,7 @@ msgstr "" "當前 :keyword:`except` 子句的追蹤上做的改動會反映在被重複引發的例外上。(由 " "Irit Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:515 +#: ../../whatsnew/3.11.rst:519 msgid "" "The interpreter state's representation of handled exceptions (aka " "``exc_info`` or ``_PyErr_StackItem``) now only has the ``exc_value`` field; " @@ -719,7 +716,7 @@ msgstr "" "``exc_traceback`` 已被移除,現在只能透過 ``exc_value`` 來取得它們。(由 Irit " "Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:521 +#: ../../whatsnew/3.11.rst:525 msgid "" "A new :ref:`command line option `, ``AppendPath``, has " "been added for the Windows installer. It behaves similarly to " @@ -730,7 +727,7 @@ msgstr "" "Windows 安裝程式。它的行為類似於 ``PrependPath``,但在安裝和腳本目錄後面附加" "而非新增於它們前面。 (由 Bastian Neuburger 在 :issue:`44934` 中貢獻。)" -#: ../../whatsnew/3.11.rst:527 +#: ../../whatsnew/3.11.rst:531 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to " "``1`` for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -741,7 +738,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:532 +#: ../../whatsnew/3.11.rst:536 msgid "" "The output of the :option:`--help` option now fits in 50 lines/80 columns. " "Information about :ref:`Python environment variables ` " @@ -754,7 +751,7 @@ msgstr "" "option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " "一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" -#: ../../whatsnew/3.11.rst:539 +#: ../../whatsnew/3.11.rst:543 msgid "" "Converting between :class:`int` and :class:`str` in bases other than 2 " "(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " @@ -776,11 +773,11 @@ msgstr "" "或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度限制 " "` 文件。預設限制為字串形式的 4300 位數字。" -#: ../../whatsnew/3.11.rst:554 +#: ../../whatsnew/3.11.rst:558 msgid "New Modules" msgstr "新增模組" -#: ../../whatsnew/3.11.rst:556 +#: ../../whatsnew/3.11.rst:560 msgid "" ":mod:`tomllib`: For parsing `TOML `_. See :pep:`680` for " "more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)" @@ -788,7 +785,7 @@ msgstr "" ":mod:`tomllib`:用於剖析 `TOML `_。詳情請見 :pep:`680`。" "(由 Taneli Hukkinen 於 :issue:`40059` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:560 +#: ../../whatsnew/3.11.rst:564 msgid "" ":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type " "checking. (Contributed by Sebastian Rittau in :issue:`42012`.)" @@ -796,15 +793,15 @@ msgstr "" ":mod:`wsgiref.types`:\\ :pep:`WSGI <3333>` 限定型別,用於靜態型別檢查。" "(Sebastian Rittau 於 :issue:`42012` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:568 +#: ../../whatsnew/3.11.rst:572 msgid "Improved Modules" msgstr "模組改進" -#: ../../whatsnew/3.11.rst:573 +#: ../../whatsnew/3.11.rst:577 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.11.rst:575 +#: ../../whatsnew/3.11.rst:579 msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " @@ -818,7 +815,7 @@ msgstr "" "和 :func:`~asyncio.gather`。(由 Yury Selivanov 和其他人在 :gh:`90908` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:582 +#: ../../whatsnew/3.11.rst:586 msgid "" "Added :func:`~asyncio.timeout`, an asynchronous context manager for setting " "a timeout on asynchronous operations. For new code this is recommended over " @@ -829,7 +826,7 @@ msgstr "" "管理器,新的程式建議直接使用它以取代 :func:`~asyncio.wait_for`。(由 Andrew " "Svetlov 於 :gh:`90927` 貢獻。)" -#: ../../whatsnew/3.11.rst:587 +#: ../../whatsnew/3.11.rst:591 msgid "" "Added the :class:`~asyncio.Runner` class, which exposes the machinery used " "by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)" @@ -837,7 +834,7 @@ msgstr "" "新增 :class:`~asyncio.Runner` 類別,它會對外公布了 :func:`~asyncio.run` 的使" "用機制。(由 Andrew Svetlov 於 :gh:`91218` 貢獻。)" -#: ../../whatsnew/3.11.rst:591 +#: ../../whatsnew/3.11.rst:595 msgid "" "Added the :class:`~asyncio.Barrier` class to the synchronization primitives " "in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` " @@ -847,7 +844,7 @@ msgstr "" "相關的 :exc:`~asyncio.BrokenBarrierError` 例外。(由 Yves Duprat 和 Andrew " "Svetlov in :gh:`87518` 貢獻。)" -#: ../../whatsnew/3.11.rst:596 +#: ../../whatsnew/3.11.rst:600 msgid "" "Added keyword argument *all_errors* to :meth:`asyncio.loop." "create_connection` so that multiple connection errors can be raised as an :" @@ -856,7 +853,7 @@ msgstr "" "在 :meth:`asyncio.loop.create_connection` 新增關鍵字引數 *all_errors*,這樣多" "個連接錯誤就可以一起用一個 :exc:`ExceptionGroup` 來引發。" -#: ../../whatsnew/3.11.rst:599 +#: ../../whatsnew/3.11.rst:603 msgid "" "Added the :meth:`asyncio.StreamWriter.start_tls` method for upgrading " "existing stream-based connections to TLS. (Contributed by Ian Good in :issue:" @@ -865,7 +862,7 @@ msgstr "" "新增 :meth:`asyncio.StreamWriter.start_tls` 方法,用來將已存在的串流連線升級" "至 TLS。(由 Ian Good 於 :issue:`34975` 中貢獻。)" -#: ../../whatsnew/3.11.rst:603 +#: ../../whatsnew/3.11.rst:607 msgid "" "Added raw datagram socket functions to the event loop: :meth:`~asyncio.loop." "sock_sendto`, :meth:`~asyncio.loop.sock_recvfrom` and :meth:`~asyncio.loop." @@ -879,7 +876,7 @@ msgstr "" "`~asyncio.ProactorEventLoop` 中都有實作。(由 Alex Grönholm 在 :issue:" "`46805` 中貢獻。)" -#: ../../whatsnew/3.11.rst:611 +#: ../../whatsnew/3.11.rst:615 msgid "" "Added :meth:`~asyncio.Task.cancelling` and :meth:`~asyncio.Task.uncancel` " "methods to :class:`~asyncio.Task`. These are primarily intended for internal " @@ -889,11 +886,11 @@ msgstr "" "`~asyncio.Task.uncancel` 方法。這些預期是只用於內部,尤其是 :class:`~asyncio." "TaskGroup`。" -#: ../../whatsnew/3.11.rst:620 +#: ../../whatsnew/3.11.rst:624 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.11.rst:622 +#: ../../whatsnew/3.11.rst:626 msgid "" "Added non parallel-safe :func:`~contextlib.chdir` context manager to change " "the current working directory and then restore it on exit. Simple wrapper " @@ -903,11 +900,11 @@ msgstr "" "後在退出時恢復它。:func:`~os.chdir` 的簡單包裝器。(由 Filipe Laíns 在 :" "issue:`25625` 中貢獻)" -#: ../../whatsnew/3.11.rst:630 +#: ../../whatsnew/3.11.rst:634 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.11.rst:632 +#: ../../whatsnew/3.11.rst:636 msgid "" "Change field default mutability check, allowing only defaults which are :" "term:`hashable` instead of any object which is not an instance of :class:" @@ -918,11 +915,11 @@ msgstr "" "而不是任何非 :class:`dict`、:class:`list` 或 :class:`set` 實例的物件。(由 " "Eric V. Smith 在 :issue:`44674` 中貢獻。)" -#: ../../whatsnew/3.11.rst:641 +#: ../../whatsnew/3.11.rst:645 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.11.rst:643 +#: ../../whatsnew/3.11.rst:647 msgid "" "Add :const:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" @@ -930,7 +927,7 @@ msgstr "" "新增 :const:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" "(由 Kabir Kwatra 於 :gh:`91973` 所貢獻。)" -#: ../../whatsnew/3.11.rst:646 +#: ../../whatsnew/3.11.rst:650 msgid "" ":meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` " "and :meth:`datetime.datetime.fromisoformat` can now be used to parse most " @@ -942,11 +939,11 @@ msgstr "" "(除了那些支援分數形式的小時與分鐘)。(由 Paul Ganssle 於 :gh:`80010` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:655 +#: ../../whatsnew/3.11.rst:659 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.11.rst:657 +#: ../../whatsnew/3.11.rst:661 msgid "" "Renamed :class:`!EnumMeta` to :class:`~enum.EnumType` (:class:`!EnumMeta` " "kept as an alias)." @@ -954,13 +951,13 @@ msgstr "" ":class:`!EnumMeta` 更名為 :class:`~enum.EnumType`\\ (:class:`!EnumMeta` 保留" "為別名)。" -#: ../../whatsnew/3.11.rst:660 +#: ../../whatsnew/3.11.rst:664 msgid "" "Added :class:`~enum.StrEnum`, with members that can be used as (and must be) " "strings." msgstr "增加 :class:`~enum.StrEnum`,列舉 (enum) 內的成員必須是字串。" -#: ../../whatsnew/3.11.rst:663 +#: ../../whatsnew/3.11.rst:667 msgid "" "Added :class:`~enum.ReprEnum`, which only modifies the :meth:`~object." "__repr__` of members while returning their literal values (rather than " @@ -972,7 +969,7 @@ msgstr "" "`format` 和 :term:`f-string` 所使用的)\\ :meth:`~object.__str__` 和 :meth:" "`~object.__format__`。" -#: ../../whatsnew/3.11.rst:669 +#: ../../whatsnew/3.11.rst:673 msgid "" "Changed :meth:`Enum.__format__() ` (the default for :" "func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " @@ -985,7 +982,7 @@ msgstr "" "`enum.Enum.__str__` 產生相同結果:對於繼承自 :class:`~enum.ReprEnum` 的列舉," "這會是成員之值;而其他的列舉會是列舉與成員名稱(例如 ``Color.RED``)。" -#: ../../whatsnew/3.11.rst:675 +#: ../../whatsnew/3.11.rst:679 msgid "" "Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" "class:`~enum.FlagBoundary` enum with its options, to control how to handle " @@ -994,7 +991,7 @@ msgstr "" "新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." "FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" -#: ../../whatsnew/3.11.rst:679 +#: ../../whatsnew/3.11.rst:683 msgid "" "Added the :func:`~enum.verify` enum decorator and the :class:`~enum." "EnumCheck` enum with its options, to check enum classes against several " @@ -1003,7 +1000,7 @@ msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" -#: ../../whatsnew/3.11.rst:683 +#: ../../whatsnew/3.11.rst:687 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." @@ -1011,7 +1008,7 @@ msgstr "" "新增 :func:`~enum.member` 與 :func:`~enum.nonmember` 裝飾器以確保被裝飾的物件" "會/不會被轉換成一個列舉成員。" -#: ../../whatsnew/3.11.rst:686 +#: ../../whatsnew/3.11.rst:690 msgid "" "Added the :func:`~enum.property` decorator, which works like :func:" "`property` except for enums. Use this instead of :func:`types." @@ -1020,7 +1017,7 @@ msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" -#: ../../whatsnew/3.11.rst:690 +#: ../../whatsnew/3.11.rst:694 msgid "" "Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" "`~object.__repr__` and :meth:`~object.__str__` to show values as members of " @@ -1030,10 +1027,10 @@ msgid "" msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " "和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" -"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." -"ASCII'``。" +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " +"``'RegexFlag.ASCII'``。" -#: ../../whatsnew/3.11.rst:696 +#: ../../whatsnew/3.11.rst:700 msgid "" "Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" "`in`/:keyword:`not in` on its members. For example, the following now works: " @@ -1043,7 +1040,7 @@ msgstr "" "keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" -#: ../../whatsnew/3.11.rst:701 +#: ../../whatsnew/3.11.rst:705 msgid "" "Changed :class:`~enum.Enum` and :class:`~enum.Flag` so that members are now " "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " @@ -1053,7 +1050,7 @@ msgstr "" "__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" "法。" -#: ../../whatsnew/3.11.rst:706 +#: ../../whatsnew/3.11.rst:710 msgid "" "Changed :class:`~enum.Flag` to only consider primary values (power of two) " "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " @@ -1063,11 +1060,11 @@ msgstr "" "``6``、``10`` 等)被視為別名;倒置旗標 (inverted flags) 會被強制轉換為正等價" "的值。" -#: ../../whatsnew/3.11.rst:715 +#: ../../whatsnew/3.11.rst:719 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.11.rst:717 +#: ../../whatsnew/3.11.rst:721 msgid "" "On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags " "respectively are supported, the former equals to ``dup2`` usage while the " @@ -1076,11 +1073,11 @@ msgstr "" "FreeBSD 上,:data:`!F_DUP2FD` 和 :data:`!F_DUP2FD_CLOEXEC` 旗標分別有被支援," "前者等同於 ``dup2`` 用法,而後者設定了 ``FD_CLOEXEC`` 旗標。" -#: ../../whatsnew/3.11.rst:725 +#: ../../whatsnew/3.11.rst:729 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.11.rst:727 +#: ../../whatsnew/3.11.rst:731 msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" @@ -1088,7 +1085,7 @@ msgstr "" "支援有 :PEP:`515` 風格的 :class:`~fractions.Fraction` 以字串初始化。(Sergey " "B Kirpichev 於 :issue:`44258` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:730 +#: ../../whatsnew/3.11.rst:734 msgid "" ":class:`~fractions.Fraction` now implements an ``__int__`` method, so that " "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " @@ -1098,11 +1095,11 @@ msgstr "" "``isinstance(some_fraction, typing.SupportsInt)`` 的檢查會通過。(由 Mark " "Dickinson 在 :issue:`44547` 中貢獻。)" -#: ../../whatsnew/3.11.rst:738 +#: ../../whatsnew/3.11.rst:742 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.11.rst:740 +#: ../../whatsnew/3.11.rst:744 msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" @@ -1112,15 +1109,15 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:765 +#: ../../whatsnew/3.11.rst:769 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" msgstr "(由 Yurii Karabas 於 :issue:`46014` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:771 +#: ../../whatsnew/3.11.rst:775 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.11.rst:773 +#: ../../whatsnew/3.11.rst:777 msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" @@ -1129,7 +1126,7 @@ msgstr "" "於 Python 自發行版的複製。(由 Christian Heimes 於 :issue:`47095` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:777 +#: ../../whatsnew/3.11.rst:781 msgid "" "The internal ``_sha3`` module with SHA3 and SHAKE algorithms now uses " "*tiny_sha3* instead of the *Keccak Code Package* to reduce code and binary " @@ -1142,7 +1139,7 @@ msgstr "" "來自 OpenSSL 的 SHA3 和 SHAKE 最佳化實作。此更改僅影響沒有 OpenSSL 支援的安" "裝。(由 Christian Heimes 在 :issue:`47098` 中貢獻。)" -#: ../../whatsnew/3.11.rst:784 +#: ../../whatsnew/3.11.rst:788 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" @@ -1150,11 +1147,11 @@ msgstr "" "新增 :func:`hashlib.file_digest`,是個能夠為檔案或類檔案物件做高效率雜湊的幫" "助函式。(由 Christian Heimes 於 :gh:`89313` 中貢獻。)" -#: ../../whatsnew/3.11.rst:792 +#: ../../whatsnew/3.11.rst:796 msgid "IDLE and idlelib" msgstr "IDLE 與 idlelib" -#: ../../whatsnew/3.11.rst:794 +#: ../../whatsnew/3.11.rst:798 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1162,7 +1159,7 @@ msgstr "" "在 `.pyi` 檔案施用語法突顯 (syntax highlight)。(由 Alex Waygood 與 Terry " "Jan Reedy 於 :issue:`45447` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:797 +#: ../../whatsnew/3.11.rst:801 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1170,11 +1167,11 @@ msgstr "" "當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" "gh:`95191` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:804 +#: ../../whatsnew/3.11.rst:808 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.11.rst:806 +#: ../../whatsnew/3.11.rst:810 msgid "" "Add :func:`~inspect.getmembers_static` to return all members without " "triggering dynamic lookup via the descriptor protocol. (Contributed by " @@ -1184,7 +1181,7 @@ msgstr "" "(descriptor protocol) 觸發動態查找。 (由 Weipeng Hong 在 :issue:`30533` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:810 +#: ../../whatsnew/3.11.rst:814 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " "is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" @@ -1193,7 +1190,7 @@ msgstr "" "新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" "`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:814 +#: ../../whatsnew/3.11.rst:818 msgid "" "Change the frame-related functions in the :mod:`inspect` module to return " "new :class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class " @@ -1206,35 +1203,35 @@ msgstr "" "`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" "欄)。受影響的功能是:" -#: ../../whatsnew/3.11.rst:820 +#: ../../whatsnew/3.11.rst:824 msgid ":func:`inspect.getframeinfo`" msgstr ":func:`inspect.getframeinfo`" -#: ../../whatsnew/3.11.rst:821 +#: ../../whatsnew/3.11.rst:825 msgid ":func:`inspect.getouterframes`" msgstr ":func:`inspect.getouterframes`" -#: ../../whatsnew/3.11.rst:822 +#: ../../whatsnew/3.11.rst:826 msgid ":func:`inspect.getinnerframes`," msgstr ":func:`inspect.getinnerframes`," -#: ../../whatsnew/3.11.rst:823 +#: ../../whatsnew/3.11.rst:827 msgid ":func:`inspect.stack`" msgstr ":func:`inspect.stack`" -#: ../../whatsnew/3.11.rst:824 +#: ../../whatsnew/3.11.rst:828 msgid ":func:`inspect.trace`" msgstr ":func:`inspect.trace`" -#: ../../whatsnew/3.11.rst:826 +#: ../../whatsnew/3.11.rst:830 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" msgstr "(由 Pablo Galindo 於 :gh:`88116` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:832 +#: ../../whatsnew/3.11.rst:836 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.11.rst:834 +#: ../../whatsnew/3.11.rst:838 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " "similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" @@ -1244,11 +1241,11 @@ msgstr "" "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " "`。" -#: ../../whatsnew/3.11.rst:842 +#: ../../whatsnew/3.11.rst:846 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.11.rst:844 +#: ../../whatsnew/3.11.rst:848 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " "level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" @@ -1259,7 +1256,7 @@ msgstr "" "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的映射。" "(由 Andrei Kulakovin 於 :gh:`88024` 中貢獻。)" -#: ../../whatsnew/3.11.rst:849 +#: ../../whatsnew/3.11.rst:853 msgid "" "Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" "class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." @@ -1273,11 +1270,11 @@ msgstr "" "用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。 (由 Kirill " "Pinchuk 在 :gh:`88457` 中貢獻。)" -#: ../../whatsnew/3.11.rst:861 +#: ../../whatsnew/3.11.rst:865 msgid "math" msgstr "math" -#: ../../whatsnew/3.11.rst:863 +#: ../../whatsnew/3.11.rst:867 msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" @@ -1285,7 +1282,7 @@ msgstr "" "新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" "`45917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:866 +#: ../../whatsnew/3.11.rst:870 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" @@ -1293,7 +1290,7 @@ msgstr "" "新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" "`44357` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:869 +#: ../../whatsnew/3.11.rst:873 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " "consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" @@ -1306,7 +1303,7 @@ msgstr "" "現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" "issue:`44339` 中貢獻。)" -#: ../../whatsnew/3.11.rst:875 +#: ../../whatsnew/3.11.rst:879 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" @@ -1314,11 +1311,11 @@ msgstr "" ":data:`math.nan` 現為隨時可用。(由 Victor Stinner 於 :issue:`46917` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:882 +#: ../../whatsnew/3.11.rst:886 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.11.rst:884 +#: ../../whatsnew/3.11.rst:888 msgid "" "A new function ``operator.call`` has been added, such that ``operator." "call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " @@ -1327,11 +1324,11 @@ msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:892 +#: ../../whatsnew/3.11.rst:896 msgid "os" msgstr "os" -#: ../../whatsnew/3.11.rst:894 +#: ../../whatsnew/3.11.rst:898 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" @@ -1340,11 +1337,11 @@ msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:902 +#: ../../whatsnew/3.11.rst:906 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.11.rst:904 +#: ../../whatsnew/3.11.rst:908 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " "directories if *pattern* ends with a pathname components separator: :data:" @@ -1355,11 +1352,11 @@ msgstr "" "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" "(由 Eisuke Kawasima 於 :issue:`22276` 與 :issue:`33392` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:913 +#: ../../whatsnew/3.11.rst:917 msgid "re" msgstr "re" -#: ../../whatsnew/3.11.rst:915 +#: ../../whatsnew/3.11.rst:919 msgid "" "Atomic grouping (``(?>...)``) and possessive quantifiers (``*+``, ``++``, ``?" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " @@ -1370,11 +1367,11 @@ msgstr "" "``{m,n}+``) 的。 (由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" "`433030` 中貢獻。)" -#: ../../whatsnew/3.11.rst:923 +#: ../../whatsnew/3.11.rst:927 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.11.rst:925 +#: ../../whatsnew/3.11.rst:929 msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" @@ -1382,11 +1379,11 @@ msgstr "" "新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" "issue:`46245` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:932 +#: ../../whatsnew/3.11.rst:936 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.11.rst:934 +#: ../../whatsnew/3.11.rst:938 msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" @@ -1394,7 +1391,7 @@ msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:937 +#: ../../whatsnew/3.11.rst:941 msgid "" ":meth:`~socket.create_connection` has an option to raise, in case of failure " "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " @@ -1404,11 +1401,11 @@ msgstr "" "錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" "issue:`29980` 中貢獻。)" -#: ../../whatsnew/3.11.rst:946 +#: ../../whatsnew/3.11.rst:950 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.11.rst:948 +#: ../../whatsnew/3.11.rst:952 msgid "" "You can now disable the authorizer by passing :const:`None` to :meth:" "`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" @@ -1418,7 +1415,7 @@ msgstr "" "set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:952 +#: ../../whatsnew/3.11.rst:956 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " "any Unicode character. Collation names with invalid characters now raise :" @@ -1430,7 +1427,7 @@ msgstr "" "`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " "Aasland 在 :issue:`44688` 中貢獻。)" -#: ../../whatsnew/3.11.rst:957 +#: ../../whatsnew/3.11.rst:961 msgid "" ":mod:`sqlite3` exceptions now include the SQLite extended error code as :" "attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" @@ -1442,7 +1439,7 @@ msgstr "" "sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " "在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" -#: ../../whatsnew/3.11.rst:963 +#: ../../whatsnew/3.11.rst:967 msgid "" "Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." "getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " @@ -1453,7 +1450,7 @@ msgstr "" "getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" "制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" -#: ../../whatsnew/3.11.rst:968 +#: ../../whatsnew/3.11.rst:972 msgid "" ":mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on the default " "threading mode the underlying SQLite library has been compiled with. " @@ -1463,7 +1460,7 @@ msgstr "" "定 :attr:`sqlite3.threadsafety`。(由 Erlend E. Aasland 在 :issue:`45613` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:972 +#: ../../whatsnew/3.11.rst:976 msgid "" ":mod:`sqlite3` C callbacks now use unraisable exceptions if callback " "tracebacks are enabled. Users can now register an :func:`unraisable hook " @@ -1475,7 +1472,7 @@ msgstr "" "(unraisable hook handler) ` 來改善他們的除錯體驗。(由 " "Erlend E. Aasland 在 :issue:`45828` 中貢獻。)" -#: ../../whatsnew/3.11.rst:978 +#: ../../whatsnew/3.11.rst:982 msgid "" "Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`. " "Instead we leave it to the SQLite library to handle these cases. " @@ -1485,7 +1482,7 @@ msgstr "" "們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" "`44092` 中貢獻。)" -#: ../../whatsnew/3.11.rst:982 +#: ../../whatsnew/3.11.rst:986 msgid "" "Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." "deserialize` to :class:`sqlite3.Connection` for serializing and " @@ -1496,7 +1493,7 @@ msgstr "" "deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" "庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" -#: ../../whatsnew/3.11.rst:987 +#: ../../whatsnew/3.11.rst:991 msgid "" "Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." "Connection` for creating aggregate window functions. (Contributed by Erlend " @@ -1506,7 +1503,7 @@ msgstr "" "create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " "Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" -#: ../../whatsnew/3.11.rst:991 +#: ../../whatsnew/3.11.rst:995 msgid "" "Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" "class:`sqlite3.Blob` allows incremental I/O operations on blobs. " @@ -1517,11 +1514,11 @@ msgstr "" "operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:999 +#: ../../whatsnew/3.11.rst:1003 msgid "string" msgstr "string" -#: ../../whatsnew/3.11.rst:1001 +#: ../../whatsnew/3.11.rst:1005 msgid "" "Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." "is_valid` to :class:`string.Template`, which respectively return all valid " @@ -1533,11 +1530,11 @@ msgstr "" "(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" "`90465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1011 +#: ../../whatsnew/3.11.rst:1015 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.11.rst:1013 +#: ../../whatsnew/3.11.rst:1017 msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " @@ -1549,7 +1546,7 @@ msgstr "" "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" "exc_info` 後續呼叫的結果中。 (由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1019 +#: ../../whatsnew/3.11.rst:1023 msgid "" "Add :func:`sys.exception` which returns the active exception instance " "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" @@ -1559,7 +1556,7 @@ msgstr "" "exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" "issue:`46328` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1023 +#: ../../whatsnew/3.11.rst:1027 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -1567,11 +1564,11 @@ msgstr "" "新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" "gh:`57684` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1030 +#: ../../whatsnew/3.11.rst:1034 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.11.rst:1032 +#: ../../whatsnew/3.11.rst:1036 msgid "" "Three new :ref:`installation schemes ` (*posix_venv*, " "*nt_venv* and *venv*) were added and are used when Python creates new " @@ -1592,11 +1589,11 @@ msgstr "" "的第三方程式碼應該使用新的 *venv* 安裝方案來確定路徑,就像 :mod:`venv` 一樣。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1049 +#: ../../whatsnew/3.11.rst:1053 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.11.rst:1051 +#: ../../whatsnew/3.11.rst:1055 msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " @@ -1609,11 +1606,11 @@ msgstr "" "能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" "`70363` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1062 +#: ../../whatsnew/3.11.rst:1066 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.11.rst:1064 +#: ../../whatsnew/3.11.rst:1068 msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " @@ -1624,15 +1621,15 @@ msgid "" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" "本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" -"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:const:" -"`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" -"issue:`41710` 中貢獻。)" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " +"在 :issue:`41710` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1075 +#: ../../whatsnew/3.11.rst:1079 msgid "time" msgstr "time" -#: ../../whatsnew/3.11.rst:1077 +#: ../../whatsnew/3.11.rst:1081 msgid "" "On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or " "``nanosleep()`` function, if available, which has a resolution of 1 " @@ -1645,7 +1642,7 @@ msgstr "" "`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" "(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1083 +#: ../../whatsnew/3.11.rst:1087 msgid "" "On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based " "on `high-resolution timers `. " @@ -1819,7 +1816,7 @@ msgstr "" "`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1174 +#: ../../whatsnew/3.11.rst:1178 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " "parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" @@ -1828,7 +1825,7 @@ msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1178 +#: ../../whatsnew/3.11.rst:1182 msgid "" ":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" @@ -1838,7 +1835,7 @@ msgstr "" "的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" "`90711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1182 +#: ../../whatsnew/3.11.rst:1186 msgid "" ":func:`typing.no_type_check` no longer modifies external classes and " "functions. It also now correctly marks classmethods as not to be type " @@ -1847,11 +1844,11 @@ msgstr "" ":func:`typing.no_type_check` 不再修改外部類別和函式。它現在也正確地將類別方法" "標記為不需進行型別檢查。(由 Nikita Sobolev 在 :gh:`90729` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1190 +#: ../../whatsnew/3.11.rst:1194 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.11.rst:1192 +#: ../../whatsnew/3.11.rst:1196 msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." @@ -1859,11 +1856,11 @@ msgstr "" "Unicode 資料庫被更新為 14.0.0 版本。(Benjamin Peterson 於 :issue:`45190` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:1199 +#: ../../whatsnew/3.11.rst:1203 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.11.rst:1201 +#: ../../whatsnew/3.11.rst:1205 msgid "" "Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." "TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" @@ -1877,11 +1874,11 @@ msgstr "" "IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." "enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" -#: ../../whatsnew/3.11.rst:1213 +#: ../../whatsnew/3.11.rst:1217 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.11.rst:1215 +#: ../../whatsnew/3.11.rst:1219 msgid "" "When new Python virtual environments are created, the *venv* :ref:`sysconfig " "installation scheme ` is used to determine the paths " @@ -1898,11 +1895,11 @@ msgstr "" "下更改預設的 sysconfig 安裝方案。建立新虛擬環境的第三方程式碼也應該這樣做。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1229 +#: ../../whatsnew/3.11.rst:1233 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.11.rst:1231 +#: ../../whatsnew/3.11.rst:1235 msgid "" ":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." "simplefilter`, providing a more concise way to locally ignore warnings or " @@ -1913,11 +1910,11 @@ msgstr "" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。 (由 Zac " "Hatfield-Dodds 在 :issue:`47074` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1239 +#: ../../whatsnew/3.11.rst:1243 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.11.rst:1241 +#: ../../whatsnew/3.11.rst:1245 msgid "" "Added support for specifying member name encoding for reading metadata in a :" "class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " @@ -1927,7 +1924,7 @@ msgstr "" "標頭中讀取元資料 (metadata)。(由 Stephen J. Turnbull 和 Serhiy Storchaka " "在 :issue:`28080` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1245 +#: ../../whatsnew/3.11.rst:1249 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" @@ -1935,7 +1932,7 @@ msgstr "" "新增 :meth:`ZipFile.mkdir() ` 以在 ZIP 歸檔中建立新的" "目錄。(由 Sam Ezeh 於 :gh:`49083` 貢獻。)" -#: ../../whatsnew/3.11.rst:1249 +#: ../../whatsnew/3.11.rst:1253 msgid "" "Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" "`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " @@ -1945,11 +1942,11 @@ msgstr "" "Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" "`88261` 貢獻。)" -#: ../../whatsnew/3.11.rst:1257 +#: ../../whatsnew/3.11.rst:1261 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.11.rst:1259 +#: ../../whatsnew/3.11.rst:1263 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." @@ -1957,7 +1954,7 @@ msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" -#: ../../whatsnew/3.11.rst:1262 +#: ../../whatsnew/3.11.rst:1266 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes " @@ -1969,7 +1966,7 @@ msgstr "" "` 最佳化並使其與相應的 :term:`f-string` 運算式一樣快。" "(由 Serhiy Storchaka 在 :issue:`28307` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1268 +#: ../../whatsnew/3.11.rst:1272 msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " @@ -1980,7 +1977,7 @@ msgstr "" "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " "Peters 在 :gh:`90564` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1273 +#: ../../whatsnew/3.11.rst:1277 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" @@ -1988,7 +1985,7 @@ msgstr "" "針對小於 ``2**30`` 的整數,:func:`sum` 現在快了將近 30%。(由 Stefan Behnel " "於 :gh:`68264` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1276 +#: ../../whatsnew/3.11.rst:1280 msgid "" "Resizing lists is streamlined for the common case, speeding up :meth:`list." "append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " @@ -1998,7 +1995,7 @@ msgstr "" "為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" "gh:`91165` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1281 +#: ../../whatsnew/3.11.rst:1285 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " "decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." @@ -2010,7 +2007,7 @@ msgstr "" "元組減少到 272 位元組(減少 23%)。(由 Inada Naoki 在 :issue:`46845` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1287 +#: ../../whatsnew/3.11.rst:1291 msgid "" "Using :class:`asyncio.DatagramProtocol` is now orders of magnitude faster " "when transferring large files over UDP, with speeds over 100 times higher " @@ -2020,7 +2017,7 @@ msgstr "" "了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" "`91487` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1292 +#: ../../whatsnew/3.11.rst:1296 msgid "" ":mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now ≈10 " "times faster for large arguments (with a larger speedup for larger *k*). " @@ -2030,7 +2027,7 @@ msgstr "" "了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" "`37295` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1296 +#: ../../whatsnew/3.11.rst:1300 msgid "" "The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." "variance` and :func:`~statistics.stdev` now consume iterators in one pass " @@ -2043,7 +2040,7 @@ msgstr "" "們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " "Raymond Hettinger 在 :gh:`90415` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1302 +#: ../../whatsnew/3.11.rst:1306 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" @@ -2051,11 +2048,11 @@ msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" "串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1310 +#: ../../whatsnew/3.11.rst:1314 msgid "Faster CPython" msgstr "更快的 CPython" -#: ../../whatsnew/3.11.rst:1312 +#: ../../whatsnew/3.11.rst:1316 msgid "" "CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " @@ -2068,7 +2065,7 @@ msgstr "" "Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,整體加速程度可達 10-60%。" -#: ../../whatsnew/3.11.rst:1319 +#: ../../whatsnew/3.11.rst:1323 msgid "" "This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " @@ -2078,15 +2075,15 @@ msgstr "" "`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" "`whatsnew311-optimizations`。" -#: ../../whatsnew/3.11.rst:1328 +#: ../../whatsnew/3.11.rst:1332 msgid "Faster Startup" msgstr "更快的啟動" -#: ../../whatsnew/3.11.rst:1333 +#: ../../whatsnew/3.11.rst:1337 msgid "Frozen imports / Static code objects" msgstr "凍結引入 (Frozen imports) / 靜態程式碼物件 (Static code objects)" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1339 msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." @@ -2094,11 +2091,11 @@ msgstr "" "Python 將\\ :term:`位元組碼 `\\ 於 :ref:`__pycache__` " "目錄中存為快取來加速模組的載入。" -#: ../../whatsnew/3.11.rst:1338 +#: ../../whatsnew/3.11.rst:1342 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "在先前的 3.10 中,執行 Python 模組會像是這樣:" -#: ../../whatsnew/3.11.rst:1344 +#: ../../whatsnew/3.11.rst:1348 msgid "" "In Python 3.11, the core modules essential for Python startup are " "\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " @@ -2109,7 +2106,7 @@ msgstr "" "ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" "執行過程中的步驟減少為:" -#: ../../whatsnew/3.11.rst:1353 +#: ../../whatsnew/3.11.rst:1357 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." @@ -2117,21 +2114,21 @@ msgstr "" "在 Python 3.11 中直譯器啟動速度快了 10-15%。這對於使用 Python 所撰寫的短暫程" "式有著巨大影響。" -#: ../../whatsnew/3.11.rst:1356 +#: ../../whatsnew/3.11.rst:1360 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" "(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" -#: ../../whatsnew/3.11.rst:1362 +#: ../../whatsnew/3.11.rst:1366 msgid "Faster Runtime" msgstr "更快的運行程式" -#: ../../whatsnew/3.11.rst:1367 +#: ../../whatsnew/3.11.rst:1371 msgid "Cheaper, lazy Python frames" msgstr "所需資源更少 (cheaper) 且惰性的 (lazy)) Python 幀 (frame)" -#: ../../whatsnew/3.11.rst:1369 +#: ../../whatsnew/3.11.rst:1373 msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" @@ -2139,16 +2136,16 @@ msgstr "" "每當 Python 呼叫 Python 函式時,就會建立保存執行資訊的 Python 幀。以下是針對" "幀而做的新最佳化:" -#: ../../whatsnew/3.11.rst:1373 +#: ../../whatsnew/3.11.rst:1377 msgid "Streamlined the frame creation process." msgstr "使幀的建立過程更有效率。" -#: ../../whatsnew/3.11.rst:1374 +#: ../../whatsnew/3.11.rst:1378 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "在 C 堆疊 (stack) 中盡量重複利用幀的空間來避免記憶體分配。" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1379 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." @@ -2156,7 +2153,7 @@ msgstr "" "讓內部幀結構只包含必要資訊,使其更加精簡。在過去,幀必須帶有額外的偵錯與記憶" "體管理的資訊。" -#: ../../whatsnew/3.11.rst:1378 +#: ../../whatsnew/3.11.rst:1382 msgid "" "Old-style :ref:`frame objects ` are now created only when " "requested by debuggers or by Python introspection functions such as :func:" @@ -2170,15 +2167,15 @@ msgstr "" "對於大多數使用者程式碼,根本不會建立任何幀物件。結果幾乎所有 Python 函式呼叫" "都顯著加速。我們以 pyperformance 測得了 3-7% 的加速。" -#: ../../whatsnew/3.11.rst:1385 +#: ../../whatsnew/3.11.rst:1389 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "(由 Mark Shannon 於 :issue:`44590` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1392 +#: ../../whatsnew/3.11.rst:1396 msgid "Inlined Python function calls" msgstr "行內 Python 函式呼叫" -#: ../../whatsnew/3.11.rst:1394 +#: ../../whatsnew/3.11.rst:1398 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " @@ -2187,7 +2184,7 @@ msgstr "" "在 Python 函式呼叫期間,Python 將呼叫一個正在求值的 C 函式來直譯該函式的程式" "碼,這有效地將純 Python 遞迴限制在對 C 堆疊的安全範圍內。" -#: ../../whatsnew/3.11.rst:1398 +#: ../../whatsnew/3.11.rst:1402 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " @@ -2197,7 +2194,7 @@ msgstr "" "一個新框架 (frame),並「跳轉」到新框架內的新程式碼,這避免了呼叫整個 C 直譯函" "式。" -#: ../../whatsnew/3.11.rst:1402 +#: ../../whatsnew/3.11.rst:1406 msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " @@ -2210,15 +2207,15 @@ msgstr "" "以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" -#: ../../whatsnew/3.11.rst:1409 +#: ../../whatsnew/3.11.rst:1413 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "(由 Pablo Galindo 與 Mark Shannon 於 :issue:`45256` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1415 +#: ../../whatsnew/3.11.rst:1419 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "PEP 659:特化的適應性直譯器" -#: ../../whatsnew/3.11.rst:1417 +#: ../../whatsnew/3.11.rst:1421 msgid "" ":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " @@ -2229,7 +2226,7 @@ msgstr "" "種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" "型別穩定 (type stability)*\\ 。" -#: ../../whatsnew/3.11.rst:1421 +#: ../../whatsnew/3.11.rst:1425 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " @@ -2245,7 +2242,7 @@ msgstr "" "稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" "快取在\\ :term:`位元組碼 `\\ 中。" -#: ../../whatsnew/3.11.rst:1429 +#: ../../whatsnew/3.11.rst:1433 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." @@ -2253,7 +2250,7 @@ msgstr "" "特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" "示 (superinstruction),這減少了執行期間的開銷。" -#: ../../whatsnew/3.11.rst:1432 +#: ../../whatsnew/3.11.rst:1436 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " "multiple times). This prevents Python from wasting time on run-once code. " @@ -2267,7 +2264,7 @@ msgstr "" "特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" "得以適應新的環境。" -#: ../../whatsnew/3.11.rst:1439 +#: ../../whatsnew/3.11.rst:1443 msgid "" "(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" "pep:`659` for more information. Implementation by Mark Shannon and Brandt " @@ -2277,43 +2274,43 @@ msgstr "" "`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " "亦提供了額外的幫助。)" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Operation" msgstr "操作" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Form" msgstr "形式" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Specialization" msgstr "特化" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Operation speedup (up to)" msgstr "操作加速程度(上限)" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Contributor(s)" msgstr "貢獻者" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "Binary operations" msgstr "二元操作" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "``x + x``" msgstr "``x + x``" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1456 msgid "``x - x``" msgstr "``x - x``" -#: ../../whatsnew/3.11.rst:1454 +#: ../../whatsnew/3.11.rst:1458 msgid "``x * x``" msgstr "``x * x``" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "" "Binary add, multiply and subtract for common types such as :class:`int`, :" "class:`float` and :class:`str` take custom fast paths for their underlying " @@ -2322,23 +2319,23 @@ msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "Subscript" msgstr "下標" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." @@ -2346,7 +2343,7 @@ msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1464 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." @@ -2354,43 +2351,43 @@ msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" -#: ../../whatsnew/3.11.rst:1456 ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1460 ../../whatsnew/3.11.rst:1467 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Store subscript" msgstr "儲存下標" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Similar to subscripting specialization above." msgstr "類似於上面的下標特化。" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "Calls" msgstr "呼叫" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "``f(arg)``" msgstr "``f(arg)``" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1472 msgid "``C(arg)``" msgstr "``C(arg)``" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "" "Calls to common builtin (C) functions and types such as :func:`len` and :" "class:`str` directly call their underlying C version. This avoids going " @@ -2399,27 +2396,27 @@ msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" "們的 C 版本底層,這避免了通過內部呼叫的慣例。" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "Load global variable" msgstr "載入全域變數" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "``print``" msgstr "``print``" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1477 msgid "``len``" msgstr "``len``" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." @@ -2427,24 +2424,24 @@ msgstr "" "全域/內建之命名空間內的物件索引被快取起來。載入全域與內建變數不需要任何命名空" "間的查找。" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "[#load-global]_" msgstr "[#load-global]_" -#: ../../whatsnew/3.11.rst:1471 ../../whatsnew/3.11.rst:1475 -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1475 ../../whatsnew/3.11.rst:1479 +#: ../../whatsnew/3.11.rst:1488 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "Load attribute" msgstr "載入屬性" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " @@ -2453,19 +2450,19 @@ msgstr "" "和載入全域變數類似,類別/物件之命名空間內的屬性索引被快取起來。在大部分情況" "中,載入屬性不需要任何命名空間的查找。" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "[#load-attr]_" msgstr "[#load-attr]_" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "Load methods for call" msgstr "載入要呼叫的方法" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." @@ -2473,54 +2470,54 @@ msgstr "" "方法的真實記憶體地址被快取 (cache) 起來,方法的載入現在不需要命名空間的查找 " "-- 即便有很長繼承鏈結的類別也是。" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "Store attribute" msgstr "儲存屬性" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "Similar to load attribute optimization." msgstr "和載入屬性的最佳化相似。" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "2% in pyperformance" msgstr "2% 於 pyperformance 中" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "Unpack Sequence" msgstr "拆解 (unpack) 序列" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "" "Specialized for common containers such as :class:`list` and :class:`tuple`. " "Avoids internal calling convention." msgstr "" "為像是 :class:`list` 和 :class:`tuple` 的常見容器所特化,避免了內部呼叫慣例。" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "Brandt Bucher" msgstr "Brandt Bucher" -#: ../../whatsnew/3.11.rst:1492 +#: ../../whatsnew/3.11.rst:1496 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." @@ -2528,7 +2525,7 @@ msgstr "" "類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " "(overhead)。" -#: ../../whatsnew/3.11.rst:1495 +#: ../../whatsnew/3.11.rst:1499 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " "for more forms. Furthermore, all attribute loads should be sped up by :issue:" @@ -2537,11 +2534,11 @@ msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" -#: ../../whatsnew/3.11.rst:1503 +#: ../../whatsnew/3.11.rst:1507 msgid "Misc" msgstr "雜項" -#: ../../whatsnew/3.11.rst:1505 +#: ../../whatsnew/3.11.rst:1509 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " @@ -2551,7 +2548,7 @@ msgstr "" "字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" "`40116` 貢獻。 )" -#: ../../whatsnew/3.11.rst:1509 +#: ../../whatsnew/3.11.rst:1513 msgid "" "\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" "`try` statements when no exception is raised. (Contributed by Mark Shannon " @@ -2560,7 +2557,7 @@ msgstr "" "實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" "`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" -#: ../../whatsnew/3.11.rst:1513 +#: ../../whatsnew/3.11.rst:1517 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " @@ -2569,7 +2566,7 @@ msgstr "" "在直譯器內使用更簡潔的例外表示法將捕獲一個例外所需的時間減少了大約 10%。 由 " "Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1517 +#: ../../whatsnew/3.11.rst:1521 msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " @@ -2584,15 +2581,15 @@ msgstr "" "benchmarks.html#regex-dna>`_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1528 +#: ../../whatsnew/3.11.rst:1532 msgid "FAQ" msgstr "FAQ" -#: ../../whatsnew/3.11.rst:1533 +#: ../../whatsnew/3.11.rst:1537 msgid "How should I write my code to utilize these speedups?" msgstr "我該如何在程式碼中獲取這些加速?" -#: ../../whatsnew/3.11.rst:1535 +#: ../../whatsnew/3.11.rst:1539 msgid "" "Write Pythonic code that follows common best practices; you don't have to " "change your code. The Faster CPython project optimizes for common code " @@ -2601,11 +2598,11 @@ msgstr "" "撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實踐的程式碼就好,你不需要改變" "你的程式碼。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳化。" -#: ../../whatsnew/3.11.rst:1543 +#: ../../whatsnew/3.11.rst:1547 msgid "Will CPython 3.11 use more memory?" msgstr "Python 3.11 會不會使用更多記憶體?" -#: ../../whatsnew/3.11.rst:1545 +#: ../../whatsnew/3.11.rst:1549 msgid "" "Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " @@ -2614,11 +2611,11 @@ msgstr "" "也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物件與" "物件字典的記憶體最佳化而有所偏差。" -#: ../../whatsnew/3.11.rst:1553 +#: ../../whatsnew/3.11.rst:1557 msgid "I don't see any speedups in my workload. Why?" msgstr "我在我的程式當中沒感覺到任何加速,為什麼?" -#: ../../whatsnew/3.11.rst:1555 +#: ../../whatsnew/3.11.rst:1559 msgid "" "Certain code won't have noticeable benefits. If your code spends most of its " "time on I/O operations, or already does most of its computation in a C " @@ -2629,7 +2626,7 @@ msgstr "" "將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個計畫" "是對純 Python 的工作負荷最有幫助。" -#: ../../whatsnew/3.11.rst:1560 +#: ../../whatsnew/3.11.rst:1564 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " @@ -2638,19 +2635,19 @@ msgstr "" "此外,pyperformance 數值為一個幾何平均數 (geometric mean)。即便在 " "pyperformance 基準量測中,某些測試稍微慢了一些,但其他加快了將近兩倍!" -#: ../../whatsnew/3.11.rst:1568 +#: ../../whatsnew/3.11.rst:1572 msgid "Is there a JIT compiler?" msgstr "有用到 JIT 編譯器嗎?" -#: ../../whatsnew/3.11.rst:1570 +#: ../../whatsnew/3.11.rst:1574 msgid "No. We're still exploring other optimizations." msgstr "沒有,我們還在探索其他最佳化方式。" -#: ../../whatsnew/3.11.rst:1576 +#: ../../whatsnew/3.11.rst:1580 msgid "About" msgstr "關於" -#: ../../whatsnew/3.11.rst:1578 +#: ../../whatsnew/3.11.rst:1582 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2661,11 +2658,11 @@ msgstr "" "(microsoft) 所資助以全職發展該計畫,Pablo Galindo Salgado 亦由彭博有限合夥企" "業 (Bloomberg LP) 資助來兼職開發,更有許許多多來自社群的自發性貢獻者。" -#: ../../whatsnew/3.11.rst:1587 +#: ../../whatsnew/3.11.rst:1591 msgid "CPython bytecode changes" msgstr "CPython 位元組碼 (bytecode) 變更" -#: ../../whatsnew/3.11.rst:1589 +#: ../../whatsnew/3.11.rst:1593 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2679,11 +2676,11 @@ msgstr "" "(populated) 快取看起來像任意指示,因此在讀取或修改包含加速資料的原始且適應 " "(adaptive) 位元組碼時應格外小心。" -#: ../../whatsnew/3.11.rst:1601 +#: ../../whatsnew/3.11.rst:1605 msgid "New opcodes" msgstr "新增 opcode" -#: ../../whatsnew/3.11.rst:1603 +#: ../../whatsnew/3.11.rst:1607 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." @@ -2691,7 +2688,7 @@ msgstr "" ":opcode:`ASYNC_GEN_WRAP`、:opcode:`RETURN_GENERATOR` 和 :opcode:`SEND` 被用於" "產生器與協程。" -#: ../../whatsnew/3.11.rst:1606 +#: ../../whatsnew/3.11.rst:1610 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." @@ -2699,17 +2696,17 @@ msgstr "" ":opcode:`COPY_FREE_VARS`,避免了為閉包 (closure) 而生的特殊呼叫方 (caller-" "side) 程式碼的需求。" -#: ../../whatsnew/3.11.rst:1609 +#: ../../whatsnew/3.11.rst:1613 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`,用於某些不需要處理中斷的循環。" -#: ../../whatsnew/3.11.rst:1612 +#: ../../whatsnew/3.11.rst:1616 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" -#: ../../whatsnew/3.11.rst:1614 +#: ../../whatsnew/3.11.rst:1618 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" @@ -2718,29 +2715,29 @@ msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`PREP_RERAISE_STAR`,處理 :pep:`654` 所加" "入的\\ :ref:`新增例外群組和 except* `。" -#: ../../whatsnew/3.11.rst:1618 +#: ../../whatsnew/3.11.rst:1622 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr ":opcode:`PUSH_EXC_INFO` 被用於例外處理函式。" -#: ../../whatsnew/3.11.rst:1620 +#: ../../whatsnew/3.11.rst:1624 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr ":opcode:`RESUME`,為無操作 (no-po),用於內部追查、除錯和最佳化檢查。" -#: ../../whatsnew/3.11.rst:1627 +#: ../../whatsnew/3.11.rst:1631 msgid "Replaced opcodes" msgstr "被取代的操作碼 (opcode)" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "Replaced Opcode(s)" msgstr "被取代的操作碼" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "New Opcode(s)" msgstr "新的操作碼" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "Notes" msgstr "註記" @@ -2752,11 +2749,11 @@ msgstr ":opcode:`!BINARY_*`" msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1636 msgid ":opcode:`BINARY_OP`" msgstr ":opcode:`BINARY_OP`" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1636 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" @@ -2788,7 +2785,7 @@ msgstr ":opcode:`PRECALL`" msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" -#: ../../whatsnew/3.11.rst:1635 +#: ../../whatsnew/3.11.rst:1639 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2828,7 +2825,7 @@ msgstr ":opcode:`COPY`" msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" -#: ../../whatsnew/3.11.rst:1640 +#: ../../whatsnew/3.11.rst:1644 msgid "Stack manipulation instructions" msgstr "堆疊操作指示" @@ -2840,7 +2837,7 @@ msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:1647 +#: ../../whatsnew/3.11.rst:1651 msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" @@ -2868,7 +2865,7 @@ msgstr ":opcode:`POP_JUMP_BACKWARD_IF_* `" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr ":opcode:`POP_JUMP_FORWARD_IF_* `" -#: ../../whatsnew/3.11.rst:1649 +#: ../../whatsnew/3.11.rst:1653 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2884,15 +2881,15 @@ msgstr ":opcode:`!SETUP_WITH`" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1659 msgid ":opcode:`BEFORE_WITH`" msgstr ":opcode:`BEFORE_WITH`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1659 msgid ":keyword:`with` block setup" msgstr ":keyword:`with` 區塊設置" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:1663 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " @@ -2902,11 +2899,11 @@ msgstr "" "`JUMP_IF_TRUE_OR_POP` 和 :opcode:`JUMP_IF_FALSE_OR_POP`。該引數現在是當前指" "示 (instruction) 的偏移量而不是絕對位置。" -#: ../../whatsnew/3.11.rst:1670 +#: ../../whatsnew/3.11.rst:1674 msgid "Changed/removed opcodes" msgstr "有更動/被移除的 opcode" -#: ../../whatsnew/3.11.rst:1672 +#: ../../whatsnew/3.11.rst:1676 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " @@ -2916,7 +2913,7 @@ msgstr "" "值來表示成功/失敗。取而代之的是會在失敗時推送 ``None``,而非一個包含提取值的" "元組。" -#: ../../whatsnew/3.11.rst:1677 +#: ../../whatsnew/3.11.rst:1681 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." @@ -2924,7 +2921,7 @@ msgstr "" "更改了運作於例外的操作碼以反映它們現在在堆疊中的表示為一項而不是三項(請參" "閱 :gh:`89874`)。" -#: ../../whatsnew/3.11.rst:1681 +#: ../../whatsnew/3.11.rst:1685 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." @@ -2932,26 +2929,26 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1689 ../../whatsnew/3.11.rst:2561 +#: ../../whatsnew/3.11.rst:1693 ../../whatsnew/3.11.rst:2565 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.11.rst:1691 +#: ../../whatsnew/3.11.rst:1695 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "這個部分列出了在 Python 3.11 中棄用的 Python API。" -#: ../../whatsnew/3.11.rst:1693 +#: ../../whatsnew/3.11.rst:1697 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "被棄用的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1700 +#: ../../whatsnew/3.11.rst:1704 msgid "Language/Builtins" msgstr "語言/內建" -#: ../../whatsnew/3.11.rst:1702 +#: ../../whatsnew/3.11.rst:1706 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2966,7 +2963,7 @@ msgstr "" "慮使用 Python 3.10 中添加的 :attr:`!__wrapped__` 屬性。(由 Raymond " "Hettinger 在 :gh:`89519` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1710 +#: ../../whatsnew/3.11.rst:1714 msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " @@ -2978,7 +2975,7 @@ msgstr "" "Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" "`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1720 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2991,93 +2988,93 @@ msgstr "" "meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" "`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1726 +#: ../../whatsnew/3.11.rst:1730 msgid "Modules" msgstr "模組" -#: ../../whatsnew/3.11.rst:1730 +#: ../../whatsnew/3.11.rst:1734 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr ":pep:`594` 引領下列模組的棄用,並排訂於 Python 3.13 移除:" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1743 +#: ../../whatsnew/3.11.rst:1747 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" @@ -3085,7 +3082,7 @@ msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1750 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -3096,7 +3093,7 @@ msgstr "" "用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" "(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1751 +#: ../../whatsnew/3.11.rst:1755 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -3107,7 +3104,7 @@ msgstr "" "析 Python 3.10 或更新版本。有關詳細資訊請參閱 :pep:`617`,它引入了新的 PEG 剖" "析器。(由 Victor Stinner 在 :issue:`40360` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1756 +#: ../../whatsnew/3.11.rst:1760 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" @@ -3117,11 +3114,11 @@ msgstr "" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1764 +#: ../../whatsnew/3.11.rst:1768 msgid "Standard Library" msgstr "標準函式庫" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1770 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " @@ -3130,23 +3127,23 @@ msgstr "" "以下 :mod:`configparser` 相關項目已在 Python 3.2 中棄用,它們的棄用警告現在會" "提示它們即將於 Python 3.12 中移除:" -#: ../../whatsnew/3.11.rst:1770 +#: ../../whatsnew/3.11.rst:1774 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr ":class:`!configparser.SafeConfigParser` 類別" -#: ../../whatsnew/3.11.rst:1771 +#: ../../whatsnew/3.11.rst:1775 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr ":attr:`!configparser.ParsingError.filename` 屬性" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1776 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1778 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45173` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1776 +#: ../../whatsnew/3.11.rst:1780 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -3161,7 +3158,7 @@ msgstr "" "BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " "Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1783 +#: ../../whatsnew/3.11.rst:1787 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -3172,35 +3169,35 @@ msgstr "" "用、並將在未來的 Python 版本中刪除,取而代之的是在 Python 3.9 中添加的替代方" "案:" -#: ../../whatsnew/3.11.rst:1788 +#: ../../whatsnew/3.11.rst:1792 msgid ":func:`importlib.resources.contents`" msgstr ":func:`importlib.resources.contents`" -#: ../../whatsnew/3.11.rst:1789 +#: ../../whatsnew/3.11.rst:1793 msgid ":func:`importlib.resources.is_resource`" msgstr ":func:`importlib.resources.is_resource`" -#: ../../whatsnew/3.11.rst:1790 +#: ../../whatsnew/3.11.rst:1794 msgid ":func:`importlib.resources.open_binary`" msgstr ":func:`importlib.resources.open_binary`" -#: ../../whatsnew/3.11.rst:1791 +#: ../../whatsnew/3.11.rst:1795 msgid ":func:`importlib.resources.open_text`" msgstr ":func:`importlib.resources.open_text`" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1796 msgid ":func:`importlib.resources.read_binary`" msgstr ":func:`importlib.resources.read_binary`" -#: ../../whatsnew/3.11.rst:1793 +#: ../../whatsnew/3.11.rst:1797 msgid ":func:`importlib.resources.read_text`" msgstr ":func:`importlib.resources.read_text`" -#: ../../whatsnew/3.11.rst:1794 +#: ../../whatsnew/3.11.rst:1798 msgid ":func:`importlib.resources.path`" msgstr ":func:`importlib.resources.path`" -#: ../../whatsnew/3.11.rst:1796 +#: ../../whatsnew/3.11.rst:1800 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -3212,7 +3209,7 @@ msgstr "" "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1802 +#: ../../whatsnew/3.11.rst:1806 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " @@ -3222,7 +3219,7 @@ msgstr "" "``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" "`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1806 +#: ../../whatsnew/3.11.rst:1810 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -3238,7 +3235,7 @@ msgstr "" "字母、數字和底線。目前,會針對違反這些規則的語法發出棄用警告。(由 Serhiy " "Storchaka 在 :gh:`91760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1814 +#: ../../whatsnew/3.11.rst:1818 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :const:`!re.TEMPLATE` and :const:`!re.T` flags are deprecated, " @@ -3247,11 +3244,11 @@ msgid "" "in :gh:`92728`.)" msgstr "" "在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " -"和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它們" -"將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它" +"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" "`92728` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1820 +#: ../../whatsnew/3.11.rst:1824 msgid "" ":func:`turtle.settiltangle` has been deprecated since Python 3.1; it now " "emits a deprecation warning and will be removed in Python 3.13. Use :func:" @@ -3264,7 +3261,7 @@ msgstr "" "誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" "`45837` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1826 +#: ../../whatsnew/3.11.rst:1830 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -3275,7 +3272,7 @@ msgstr "" "用。目前未計劃刪除它,但鼓勵用戶盡可能使用 :class:`str` 代替。(由 Alex " "Waygood 在 :gh:`92332` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1832 +#: ../../whatsnew/3.11.rst:1836 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " @@ -3284,7 +3281,7 @@ msgstr "" "用於建構 :data:`typing.TypedDict` 型別的關鍵字引數語法現已棄用。將在 Python " "3.13 中停止支援。(由 Jingchen Ye 在 :gh:`90224` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1836 +#: ../../whatsnew/3.11.rst:1840 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " @@ -3294,7 +3291,7 @@ msgstr "" "過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" "issue:`42255`。)" -#: ../../whatsnew/3.11.rst:1840 +#: ../../whatsnew/3.11.rst:1844 msgid "" "The behavior of returning a value from a :class:`~unittest.TestCase` and :" "class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " @@ -3304,7 +3301,7 @@ msgstr "" "IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" "用。" -#: ../../whatsnew/3.11.rst:1844 +#: ../../whatsnew/3.11.rst:1848 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" @@ -3312,39 +3309,39 @@ msgstr "" "棄用以下並沒有正式紀錄於文件中的 :mod:`unittest` 函式,並預計於 Python 3.13 " "中移除:" -#: ../../whatsnew/3.11.rst:1847 +#: ../../whatsnew/3.11.rst:1851 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.11.rst:1848 +#: ../../whatsnew/3.11.rst:1852 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.11.rst:1849 +#: ../../whatsnew/3.11.rst:1853 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1855 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "改用 :class:`~unittest.TestLoader` 方法:" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1857 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1854 +#: ../../whatsnew/3.11.rst:1858 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1859 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1861 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1863 msgid "" ":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " "in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" @@ -3352,17 +3349,17 @@ msgstr "" ":meth:`~!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" "(由 Carlos Damázio 在 :gh:`67048` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1868 ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:1872 ../../whatsnew/3.11.rst:2593 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" -#: ../../whatsnew/3.11.rst:1870 +#: ../../whatsnew/3.11.rst:1874 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "下列 API 已在先前的 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:1873 +#: ../../whatsnew/3.11.rst:1877 msgid "" "C APIs pending removal are :ref:`listed separately `." @@ -3370,270 +3367,270 @@ msgstr "" "待定的 C API 移除項目為\\ :ref:`獨立列出的 `。" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1880 msgid "The :mod:`asynchat` module" msgstr ":mod:`asynchat` 模組" -#: ../../whatsnew/3.11.rst:1877 +#: ../../whatsnew/3.11.rst:1881 msgid "The :mod:`asyncore` module" msgstr ":mod:`asyncore` 模組" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1882 msgid "The :ref:`entire distutils package `" msgstr ":ref:`整個 distutils 套件 `" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1883 msgid "The :mod:`!imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1880 +#: ../../whatsnew/3.11.rst:1884 msgid "The :class:`typing.io ` namespace" msgstr ":class:`typing.io ` 命名空間" -#: ../../whatsnew/3.11.rst:1881 +#: ../../whatsnew/3.11.rst:1885 msgid "The :class:`typing.re ` namespace" msgstr ":class:`typing.re ` 命名空間" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1886 msgid ":func:`!cgi.log`" msgstr ":func:`!cgi.log`" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1887 msgid ":func:`!importlib.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1888 msgid ":meth:`!importlib.abc.Loader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.abc.MetaPathFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.abc.PathEntryFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.abc.PathEntryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr ":meth:`!importlib.machinery.BuiltinImporter.find_module`" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr ":meth:`!importlib.machinery.FileFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr ":meth:`!importlib.machinery.FileFinder.find_module`" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1896 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr ":meth:`!importlib.machinery.FrozenImporter.find_module`" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1897 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1898 msgid ":meth:`!importlib.machinery.PathFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1899 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1900 msgid ":func:`!importlib.util.module_for_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1901 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr ":func:`!importlib.util.set_loader_wrapper`" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr ":func:`!importlib.util.set_package_wrapper`" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1903 msgid ":class:`!pkgutil.ImpImporter`" msgstr "" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1904 msgid ":class:`!pkgutil.ImpLoader`" msgstr "" -#: ../../whatsnew/3.11.rst:1901 +#: ../../whatsnew/3.11.rst:1905 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1902 +#: ../../whatsnew/3.11.rst:1906 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr ":func:`!sqlite3.enable_shared_cache`" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1907 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr ":func:`!sqlite3.OptimizedUnicode`" -#: ../../whatsnew/3.11.rst:1904 +#: ../../whatsnew/3.11.rst:1908 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" -#: ../../whatsnew/3.11.rst:1905 +#: ../../whatsnew/3.11.rst:1909 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr ":mod:`unittest` 中被棄用的別名:" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Deprecated in" msgstr "棄用於" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 #: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1915 -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1920 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1915 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1915 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.11.rst:1912 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1917 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1918 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1919 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1925 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1920 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1921 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 -#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 #: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1922 -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1925 ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1927 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1923 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1925 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1927 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1927 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1931 ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:1935 ../../whatsnew/3.11.rst:2619 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.11.rst:1933 +#: ../../whatsnew/3.11.rst:1937 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "此部分列出 Python 3.11 中移除的 Python API。" -#: ../../whatsnew/3.11.rst:1935 +#: ../../whatsnew/3.11.rst:1939 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "被移除的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1937 +#: ../../whatsnew/3.11.rst:1941 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -3646,7 +3643,7 @@ msgstr "" "相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" "keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1944 +#: ../../whatsnew/3.11.rst:1948 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " @@ -3655,7 +3652,7 @@ msgstr "" "移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." "CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1948 +#: ../../whatsnew/3.11.rst:1952 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3668,7 +3665,7 @@ msgstr "" "socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" "`45129` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1954 +#: ../../whatsnew/3.11.rst:1958 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" @@ -3676,31 +3673,31 @@ msgstr "" "移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" "`binascii` 函式也一併被移除:" -#: ../../whatsnew/3.11.rst:1957 +#: ../../whatsnew/3.11.rst:1961 msgid ":func:`!binascii.a2b_hqx`" msgstr ":func:`!binascii.a2b_hqx`" -#: ../../whatsnew/3.11.rst:1958 +#: ../../whatsnew/3.11.rst:1962 msgid ":func:`!binascii.b2a_hqx`" msgstr ":func:`!binascii.b2a_hqx`" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1963 msgid ":func:`!binascii.rlecode_hqx`" msgstr ":func:`!binascii.rlecode_hqx`" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1964 msgid ":func:`!binascii.rldecode_hqx`" msgstr ":func:`!binascii.rldecode_hqx`" -#: ../../whatsnew/3.11.rst:1962 +#: ../../whatsnew/3.11.rst:1966 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr ":func:`binascii.crc_hqx` 維持可用。" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1968 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "(由 Victor Stinner 於 :issue:`45085` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1966 +#: ../../whatsnew/3.11.rst:1970 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " @@ -3710,7 +3707,7 @@ msgstr "" "``bdist_wheel``\\ (wheel 套件)。(由 Hugo van Kemenade 於 :issue:`45124` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:1970 +#: ../../whatsnew/3.11.rst:1974 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3722,7 +3719,7 @@ msgstr "" "`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1975 +#: ../../whatsnew/3.11.rst:1979 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3739,11 +3736,11 @@ msgstr "" "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" "式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1985 +#: ../../whatsnew/3.11.rst:1989 msgid "Removed from the :mod:`inspect` module:" msgstr "於 :mod:`inspect` 模組中移除:" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:1991 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." @@ -3751,7 +3748,7 @@ msgstr "" "Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" "func:`inspect.getfullargspec`。" -#: ../../whatsnew/3.11.rst:1990 +#: ../../whatsnew/3.11.rst:1994 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " @@ -3760,7 +3757,7 @@ msgstr "" "Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." "signature` 函式或 :class:`inspect.Signature` 物件。" -#: ../../whatsnew/3.11.rst:1994 +#: ../../whatsnew/3.11.rst:1998 msgid "" "The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." "from_function` methods, deprecated since Python 3.5; use the :meth:" @@ -3770,11 +3767,11 @@ msgstr "" "meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " "` 方法。" -#: ../../whatsnew/3.11.rst:1999 +#: ../../whatsnew/3.11.rst:2003 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:2005 msgid "" "Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." "PurePath`, because it was not used and added by mistake in previous " @@ -3784,7 +3781,7 @@ msgstr "" "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:2006 +#: ../../whatsnew/3.11.rst:2010 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " @@ -3793,7 +3790,7 @@ msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" "套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" -#: ../../whatsnew/3.11.rst:2010 +#: ../../whatsnew/3.11.rst:2014 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" @@ -3801,7 +3798,7 @@ msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" -#: ../../whatsnew/3.11.rst:2013 +#: ../../whatsnew/3.11.rst:2017 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " @@ -3810,7 +3807,7 @@ msgstr "" "從 :mod:`unittest` 中刪除了命名空間套件支援。它在 Python 3.4 中引入,但自 " "Python 3.7 以來已無法運作。(由 Inada Naoki 在 :issue:`23882` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2017 +#: ../../whatsnew/3.11.rst:2021 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3823,7 +3820,7 @@ msgstr "" "到:「你大概不會想要使用這個函式,它只為了讓 Python 測試系列套件 (suite) 使用" "而存在。」(由 Victor Stinner 於 :issue:`46852` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2023 +#: ../../whatsnew/3.11.rst:2027 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " @@ -3832,7 +3829,7 @@ msgstr "" "移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" "c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" -#: ../../whatsnew/3.11.rst:2027 +#: ../../whatsnew/3.11.rst:2031 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3843,11 +3840,11 @@ msgstr "" "編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" -#: ../../whatsnew/3.11.rst:2037 ../../whatsnew/3.11.rst:2259 +#: ../../whatsnew/3.11.rst:2041 ../../whatsnew/3.11.rst:2263 msgid "Porting to Python 3.11" msgstr "移植至 Python 3.11" -#: ../../whatsnew/3.11.rst:2039 +#: ../../whatsnew/3.11.rst:2043 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." @@ -3855,13 +3852,13 @@ msgstr "" "本部分列出了之前描述的 Python API 中可能需要你去更改 Python 程式碼的變更和其" "他錯誤修復。" -#: ../../whatsnew/3.11.rst:2042 +#: ../../whatsnew/3.11.rst:2046 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "C API 的移植被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:2045 +#: ../../whatsnew/3.11.rst:2049 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3878,7 +3875,7 @@ msgstr "" "ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" "(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2054 +#: ../../whatsnew/3.11.rst:2058 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3889,7 +3886,7 @@ msgstr "" "證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" "gh:`93351` 中貢獻)" -#: ../../whatsnew/3.11.rst:2058 +#: ../../whatsnew/3.11.rst:2062 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " @@ -3899,7 +3896,7 @@ msgstr "" "ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" "(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2063 +#: ../../whatsnew/3.11.rst:2067 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3911,7 +3908,7 @@ msgstr "" "getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" "issue:`46659` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2069 +#: ../../whatsnew/3.11.rst:2073 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " @@ -3920,7 +3917,7 @@ msgstr "" ":mod:`pdb` 模組現在會讀取 ``'UTF-8'`` 編碼的 :file:`.pdbrc` 配置檔案。" "(Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 於 :issue:`41137` 貢獻。)" -#: ../../whatsnew/3.11.rst:2073 +#: ../../whatsnew/3.11.rst:2077 msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " @@ -3932,7 +3929,7 @@ msgstr "" "`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" "exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2079 +#: ../../whatsnew/3.11.rst:2083 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " "was previously an arbitrary random function to use for the shuffle; now, :" @@ -3942,7 +3939,7 @@ msgstr "" "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" "預設值)。" -#: ../../whatsnew/3.11.rst:2083 +#: ../../whatsnew/3.11.rst:2087 msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " @@ -3953,7 +3950,7 @@ msgstr "" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。 (由 " "Serhiy Storchaka 在 :issue:`47066` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2088 +#: ../../whatsnew/3.11.rst:2092 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3964,11 +3961,11 @@ msgstr "" "致捕獲群組 (capture group) 得到錯誤的結果。因此,這可能會在這些情況下更改捕獲" "的輸出。(Ma Lin 在 :issue:`35859` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2097 +#: ../../whatsnew/3.11.rst:2101 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2103 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3992,11 +3989,11 @@ msgstr "" "Christian Heimes 和 Ethan Smith 在 :gh:`84461` 貢獻,WASI 由 Christian " "Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" -#: ../../whatsnew/3.11.rst:2113 +#: ../../whatsnew/3.11.rst:2117 msgid "Building CPython now requires:" msgstr "建置 CPython 現在必須要有:" -#: ../../whatsnew/3.11.rst:2115 +#: ../../whatsnew/3.11.rst:2119 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ 並非必要。(由 Victor Stinner " "於 :issue:`46656`、:issue:`45440` 和 :issue:`46640` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2122 +#: ../../whatsnew/3.11.rst:2126 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" @@ -4017,7 +4014,7 @@ msgstr "" "對 `IEEE 754 `_ 浮點數的支援(由 " "Victor Stinner 於 :issue:`46917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2126 +#: ../../whatsnew/3.11.rst:2130 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " @@ -4026,7 +4023,7 @@ msgstr "" ":c:macro:`!Py_NO_NAN` 巨集已被移除。因為 CPython 現在需要 IEEE 754 浮點數," "NaN 數值皆為可得的。(由 Victor Stinner 在 :issue:`46656` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2130 +#: ../../whatsnew/3.11.rst:2134 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" @@ -4034,7 +4031,7 @@ msgstr "" ":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" "的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2134 +#: ../../whatsnew/3.11.rst:2138 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -4053,7 +4050,7 @@ msgstr "" "和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" "issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2144 +#: ../../whatsnew/3.11.rst:2148 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" @@ -4061,7 +4058,7 @@ msgstr "" "libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2147 +#: ../../whatsnew/3.11.rst:2151 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -4073,7 +4070,7 @@ msgstr "" "html>`_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2152 +#: ../../whatsnew/3.11.rst:2156 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`--without-freelists` can be used to disable all freelists " @@ -4081,7 +4078,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2157 +#: ../../whatsnew/3.11.rst:2161 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -4094,7 +4091,7 @@ msgstr "" "的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" "`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2164 +#: ../../whatsnew/3.11.rst:2168 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -4105,7 +4102,7 @@ msgstr "" "Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" "includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" -#: ../../whatsnew/3.11.rst:2170 +#: ../../whatsnew/3.11.rst:2174 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -4117,7 +4114,7 @@ msgstr "" "pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" "示。" -#: ../../whatsnew/3.11.rst:2175 +#: ../../whatsnew/3.11.rst:2179 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " @@ -4135,11 +4132,11 @@ msgstr "" "此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:2188 +#: ../../whatsnew/3.11.rst:2192 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.11.rst:2195 +#: ../../whatsnew/3.11.rst:2199 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" @@ -4147,7 +4144,7 @@ msgstr "" "新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" "`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2198 +#: ../../whatsnew/3.11.rst:2202 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" @@ -4155,7 +4152,7 @@ msgstr "" "新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" "(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2201 +#: ../../whatsnew/3.11.rst:2205 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -4166,7 +4163,7 @@ msgstr "" "c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" "析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2206 +#: ../../whatsnew/3.11.rst:2210 msgid "" "Added the :c:data:`Py_Version` constant which bears the same value as :c:" "macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" @@ -4175,61 +4172,61 @@ msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2210 +#: ../../whatsnew/3.11.rst:2214 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr ":c:type:`Py_buffer` 與 API 目前是受限 API 與穩定 ABI 中的一部分:" -#: ../../whatsnew/3.11.rst:2213 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2214 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2218 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2219 -msgid ":c:func:`PyBuffer_CopyData`" -msgstr ":c:func:`PyBuffer_CopyData`" +#: ../../whatsnew/3.11.rst:2223 +msgid ":c:func:`PyObject_CopyData`" +msgstr "" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2225 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2226 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2225 +#: ../../whatsnew/3.11.rst:2229 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" @@ -4237,11 +4234,11 @@ msgstr "" ":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." "bf_releasebuffer` 型別插槽 (type slot)" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2232 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2234 msgid "" "Added the :c:func:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -4252,7 +4249,7 @@ msgstr "" "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2235 +#: ../../whatsnew/3.11.rst:2239 msgid "" "Add new functions to pack and unpack C double (serialize and deserialize): :" "c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" @@ -4264,7 +4261,7 @@ msgstr "" "`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" "(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2241 +#: ../../whatsnew/3.11.rst:2245 msgid "" "Add new functions to get frame object attributes: :c:func:" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" @@ -4274,7 +4271,7 @@ msgstr "" "`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" "`PyFrame_GetLasti`。" -#: ../../whatsnew/3.11.rst:2245 +#: ../../whatsnew/3.11.rst:2249 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -4288,7 +4285,7 @@ msgstr "" "例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2252 +#: ../../whatsnew/3.11.rst:2256 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -4296,7 +4293,7 @@ msgstr "" "新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " "中所貢獻。)" -#: ../../whatsnew/3.11.rst:2263 +#: ../../whatsnew/3.11.rst:2267 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -4314,7 +4311,7 @@ msgstr "" "要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2274 +#: ../../whatsnew/3.11.rst:2278 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -4325,7 +4322,7 @@ msgstr "" "現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" "照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2280 +#: ../../whatsnew/3.11.rst:2284 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " @@ -4335,7 +4332,7 @@ msgstr "" "``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2284 +#: ../../whatsnew/3.11.rst:2288 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -4346,7 +4343,7 @@ msgstr "" "件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " "Kumar Aditya 在 :issue:`46608` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2290 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " @@ -4356,7 +4353,7 @@ msgstr "" "數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" "閱 :pep:`523`。" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2298 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -4369,7 +4366,7 @@ msgstr "" "碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" "版本。" -#: ../../whatsnew/3.11.rst:2300 +#: ../../whatsnew/3.11.rst:2304 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -4384,7 +4381,7 @@ msgstr "" "和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" "`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2308 +#: ../../whatsnew/3.11.rst:2312 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " @@ -4394,21 +4391,21 @@ msgstr "" "``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " "``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" -#: ../../whatsnew/3.11.rst:2312 +#: ../../whatsnew/3.11.rst:2316 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" "一個用到老舊巨集的 tp_dealloc 函式,像是:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2323 +#: ../../whatsnew/3.11.rst:2327 msgid "should migrate to the new macros as follows::" msgstr "" "應該要搬遷到新的巨集,如下所示:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2334 +#: ../../whatsnew/3.11.rst:2338 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." @@ -4416,7 +4413,7 @@ msgstr "" "請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函式 " "(deallocation function)。" -#: ../../whatsnew/3.11.rst:2337 +#: ../../whatsnew/3.11.rst:2341 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " @@ -4427,7 +4424,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2349 +#: ../../whatsnew/3.11.rst:2353 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " @@ -4439,18 +4436,18 @@ msgstr "" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:2354 +#: ../../whatsnew/3.11.rst:2358 msgid "" "Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" "ref:`static types `. (Contributed by Erlend E. Aasland in :" "issue:`43908`)" msgstr "" -"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:`590` " -"向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:" +"`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2359 +#: ../../whatsnew/3.11.rst:2363 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -4462,11 +4459,11 @@ msgstr "" "c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" "個巨集:" -#: ../../whatsnew/3.11.rst:2371 ../../whatsnew/3.11.rst:2385 +#: ../../whatsnew/3.11.rst:2375 ../../whatsnew/3.11.rst:2389 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2373 +#: ../../whatsnew/3.11.rst:2377 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -4478,7 +4475,7 @@ msgstr "" "`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" "集:" -#: ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2391 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -4491,7 +4488,7 @@ msgstr "" "和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" "標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2393 +#: ../../whatsnew/3.11.rst:2397 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -4508,7 +4505,7 @@ msgstr "" "檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " "(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2405 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -4519,7 +4516,7 @@ msgstr "" "使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" "`46007` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2406 +#: ../../whatsnew/3.11.rst:2410 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " @@ -4528,49 +4525,49 @@ msgstr "" "以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" "用,不必再加上 ``#include ``:" -#: ../../whatsnew/3.11.rst:2410 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2411 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2413 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2414 +#: ../../whatsnew/3.11.rst:2418 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2419 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2420 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2421 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2423 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2423 +#: ../../whatsnew/3.11.rst:2427 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr ":c:type:`PyFrameObject` 結構成員已經從公開的 C API 中移除。" -#: ../../whatsnew/3.11.rst:2426 +#: ../../whatsnew/3.11.rst:2430 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " @@ -4579,7 +4576,7 @@ msgstr "" "雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" "長時間,並被用於幾個流行的擴充套件中。" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2434 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " @@ -4588,39 +4585,39 @@ msgstr "" "Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" "位被整個移除。" -#: ../../whatsnew/3.11.rst:2434 +#: ../../whatsnew/3.11.rst:2438 msgid ":c:type:`PyFrameObject` fields:" msgstr ":c:type:`PyFrameObject` 欄位:" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2437 +#: ../../whatsnew/3.11.rst:2441 msgid "``f_blockstack``: removed." msgstr "``f_blockstack``:已移除。" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" -#: ../../whatsnew/3.11.rst:2439 +#: ../../whatsnew/3.11.rst:2443 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" -#: ../../whatsnew/3.11.rst:2441 +#: ../../whatsnew/3.11.rst:2445 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" -#: ../../whatsnew/3.11.rst:2442 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_iblock``: removed." msgstr "``f_iblock``:已移除。" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2447 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " @@ -4630,51 +4627,51 @@ msgstr "" "``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" "`PyFrame_GetLineNumber`;它可能會更快。" -#: ../../whatsnew/3.11.rst:2446 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" -#: ../../whatsnew/3.11.rst:2447 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_stackdepth``: removed." msgstr "``f_stackdepth``:已移除。" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_trace``: no public API." msgstr "``f_trace``:無公開 API。" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2455 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" "``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " -"“f_trace_lines”)``。" +"\"f_trace_lines\")``。" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2456 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" "``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " -"“f_trace_opcodes”)``。" +"\"f_trace_opcodes\")``。" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2457 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2458 msgid "``f_valuestack``: removed." msgstr "``f_valuestack``:已移除。" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2460 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -4684,7 +4681,7 @@ msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" "接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2461 +#: ../../whatsnew/3.11.rst:2465 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -4697,21 +4694,21 @@ msgstr "" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2467 +#: ../../whatsnew/3.11.rst:2471 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2477 +#: ../../whatsnew/3.11.rst:2481 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2487 +#: ../../whatsnew/3.11.rst:2491 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4719,11 +4716,11 @@ msgstr "" "或是使用 `pythoncap_compat 計畫 `__\\ 來在舊版 Python 函式中取得這兩個函式。" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2495 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2493 +#: ../../whatsnew/3.11.rst:2497 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4733,7 +4730,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2497 +#: ../../whatsnew/3.11.rst:2501 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4743,7 +4740,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2500 +#: ../../whatsnew/3.11.rst:2504 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4751,18 +4748,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2502 +#: ../../whatsnew/3.11.rst:2506 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2504 +#: ../../whatsnew/3.11.rst:2508 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2514 +#: ../../whatsnew/3.11.rst:2518 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4772,7 +4769,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2540 +#: ../../whatsnew/3.11.rst:2544 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." @@ -4780,13 +4777,13 @@ msgstr "" "或是使用 `pythoncap-compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2544 +#: ../../whatsnew/3.11.rst:2548 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2547 +#: ../../whatsnew/3.11.rst:2551 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -4797,7 +4794,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2552 +#: ../../whatsnew/3.11.rst:2556 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " @@ -4810,60 +4807,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2563 +#: ../../whatsnew/3.11.rst:2567 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2565 -msgid ":c:func:`PySys_AddWarnOptionUnicode`" -msgstr ":c:func:`PySys_AddWarnOptionUnicode`" - -#: ../../whatsnew/3.11.rst:2566 -msgid ":c:func:`PySys_AddWarnOption`" -msgstr ":c:func:`PySys_AddWarnOption`" - -#: ../../whatsnew/3.11.rst:2567 -msgid ":c:func:`PySys_AddXOption`" -msgstr ":c:func:`PySys_AddXOption`" - -#: ../../whatsnew/3.11.rst:2568 -msgid ":c:func:`PySys_HasWarnOptions`" -msgstr ":c:func:`PySys_HasWarnOptions`" - #: ../../whatsnew/3.11.rst:2569 -msgid ":c:func:`PySys_SetArgvEx`" -msgstr ":c:func:`PySys_SetArgvEx`" +msgid ":c:func:`!PySys_AddWarnOptionUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2570 -msgid ":c:func:`PySys_SetArgv`" -msgstr ":c:func:`PySys_SetArgv`" +msgid ":c:func:`!PySys_AddWarnOption`" +msgstr "" #: ../../whatsnew/3.11.rst:2571 -msgid ":c:func:`PySys_SetPath`" -msgstr ":c:func:`PySys_SetPath`" +msgid ":c:func:`!PySys_AddXOption`" +msgstr "" #: ../../whatsnew/3.11.rst:2572 -msgid ":c:func:`Py_SetPath`" -msgstr ":c:func:`Py_SetPath`" +msgid ":c:func:`!PySys_HasWarnOptions`" +msgstr "" #: ../../whatsnew/3.11.rst:2573 -msgid ":c:func:`Py_SetProgramName`" -msgstr ":c:func:`Py_SetProgramName`" +msgid ":c:func:`!PySys_SetArgvEx`" +msgstr "" #: ../../whatsnew/3.11.rst:2574 -msgid ":c:func:`Py_SetPythonHome`" -msgstr ":c:func:`Py_SetPythonHome`" +msgid ":c:func:`!PySys_SetArgv`" +msgstr "" #: ../../whatsnew/3.11.rst:2575 -msgid ":c:func:`Py_SetStandardStreamEncoding`" -msgstr ":c:func:`Py_SetStandardStreamEncoding`" +msgid ":c:func:`!PySys_SetPath`" +msgstr "" #: ../../whatsnew/3.11.rst:2576 -msgid ":c:func:`_Py_SetProgramFullPath`" -msgstr ":c:func:`_Py_SetProgramFullPath`" +msgid ":c:func:`!Py_SetPath`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2577 +msgid ":c:func:`!Py_SetProgramName`" +msgstr "" #: ../../whatsnew/3.11.rst:2578 +msgid ":c:func:`!Py_SetPythonHome`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2579 +msgid ":c:func:`!Py_SetStandardStreamEncoding`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2580 +msgid ":c:func:`!_Py_SetProgramFullPath`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2582 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4872,7 +4869,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2586 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4880,113 +4877,111 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:2595 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:2594 -msgid ":c:func:`PyUnicode_AS_DATA`" -msgstr ":c:func:`PyUnicode_AS_DATA`" - -#: ../../whatsnew/3.11.rst:2595 -msgid ":c:func:`PyUnicode_AS_UNICODE`" -msgstr ":c:func:`PyUnicode_AS_UNICODE`" - -#: ../../whatsnew/3.11.rst:2596 -msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" -msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" - -#: ../../whatsnew/3.11.rst:2597 -msgid ":c:func:`PyUnicode_AsUnicode`" -msgstr ":c:func:`PyUnicode_AsUnicode`" - #: ../../whatsnew/3.11.rst:2598 -msgid ":c:func:`PyUnicode_FromUnicode`" -msgstr ":c:func:`PyUnicode_FromUnicode`" +msgid ":c:func:`!PyUnicode_AS_DATA`" +msgstr "" #: ../../whatsnew/3.11.rst:2599 -msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" -msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" +msgid ":c:func:`!PyUnicode_AS_UNICODE`" +msgstr "" #: ../../whatsnew/3.11.rst:2600 -msgid ":c:func:`PyUnicode_GET_SIZE`" -msgstr ":c:func:`PyUnicode_GET_SIZE`" +msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" +msgstr "" #: ../../whatsnew/3.11.rst:2601 -msgid ":c:func:`PyUnicode_GetSize`" -msgstr ":c:func:`PyUnicode_GetSize`" +msgid ":c:func:`!PyUnicode_AsUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2602 -msgid ":c:func:`PyUnicode_IS_COMPACT`" -msgstr ":c:func:`PyUnicode_IS_COMPACT`" +msgid ":c:func:`!PyUnicode_FromUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2603 -msgid ":c:func:`PyUnicode_IS_READY`" -msgstr ":c:func:`PyUnicode_IS_READY`" +msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" +msgstr "" #: ../../whatsnew/3.11.rst:2604 -msgid ":c:func:`PyUnicode_READY`" -msgstr ":c:func:`PyUnicode_READY`" +msgid ":c:func:`!PyUnicode_GET_SIZE`" +msgstr "" #: ../../whatsnew/3.11.rst:2605 -msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" -msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" +msgid ":c:func:`!PyUnicode_GetSize`" +msgstr "" #: ../../whatsnew/3.11.rst:2606 -msgid ":c:func:`_PyUnicode_AsUnicode`" -msgstr ":c:func:`_PyUnicode_AsUnicode`" +msgid ":c:func:`PyUnicode_IS_COMPACT`" +msgstr ":c:func:`PyUnicode_IS_COMPACT`" #: ../../whatsnew/3.11.rst:2607 -msgid ":c:macro:`PyUnicode_WCHAR_KIND`" -msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" +msgid ":c:func:`PyUnicode_IS_READY`" +msgstr ":c:func:`PyUnicode_IS_READY`" #: ../../whatsnew/3.11.rst:2608 +msgid ":c:func:`PyUnicode_READY`" +msgstr ":c:func:`PyUnicode_READY`" + +#: ../../whatsnew/3.11.rst:2609 +msgid ":c:func:`!PyUnicode_WSTR_LENGTH`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2610 +msgid ":c:func:`!_PyUnicode_AsUnicode`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2611 +msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2612 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2609 -msgid ":c:func:`PyUnicode_InternImmortal()`" -msgstr ":c:func:`PyUnicode_InternImmortal()`" +#: ../../whatsnew/3.11.rst:2613 +msgid ":c:func:`!PyUnicode_InternImmortal`" +msgstr "" -#: ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:2621 msgid "" -":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " +":c:func:`!PyFrame_BlockSetup` and :c:func:`!PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -"移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " -"Shannon 於 :issue:`40222` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2625 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2627 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2624 +#: ../../whatsnew/3.11.rst:2628 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2630 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2631 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2633 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2635 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4998,7 +4993,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2636 +#: ../../whatsnew/3.11.rst:2640 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5007,7 +5002,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2640 +#: ../../whatsnew/3.11.rst:2644 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5016,41 +5011,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2644 +#: ../../whatsnew/3.11.rst:2648 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" -#: ../../whatsnew/3.11.rst:2647 +#: ../../whatsnew/3.11.rst:2651 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2648 +#: ../../whatsnew/3.11.rst:2652 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2653 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2654 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2655 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2657 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2659 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2661 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " @@ -5060,7 +5055,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2666 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -5071,7 +5066,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2671 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5079,7 +5074,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2673 +#: ../../whatsnew/3.11.rst:2677 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " @@ -5088,66 +5083,165 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2678 +#: ../../whatsnew/3.11.rst:2682 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2680 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2681 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2683 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2698 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" + +#~ msgid "" +#~ "Added :meth:`object.__getstate__`, which provides the default " +#~ "implementation of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :" +#~ "mod:`pickle`\\ing instances of subclasses of builtin types :class:" +#~ "`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections." +#~ "OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, and :" +#~ "class:`datetime.tzinfo` now copies and pickles instance attributes " +#~ "implemented as :term:`slots <__slots__>`. (Contributed by Serhiy " +#~ "Storchaka in :issue:`26579`.)" +#~ msgstr "" +#~ "添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預" +#~ "設實作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:" +#~ "class:`collections.OrderedDict`、:class:`collections.deque`、:class:" +#~ "`weakref.WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:" +#~ "`pickle` 實例,現在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬" +#~ "性。 (由 Serhiy Storchaka 在 :issue:`26579` 中貢獻。)" + +#~ msgid ":c:func:`PyBuffer_CopyData`" +#~ msgstr ":c:func:`PyBuffer_CopyData`" + +#~ msgid ":c:func:`PySys_AddWarnOptionUnicode`" +#~ msgstr ":c:func:`PySys_AddWarnOptionUnicode`" + +#~ msgid ":c:func:`PySys_AddWarnOption`" +#~ msgstr ":c:func:`PySys_AddWarnOption`" + +#~ msgid ":c:func:`PySys_AddXOption`" +#~ msgstr ":c:func:`PySys_AddXOption`" + +#~ msgid ":c:func:`PySys_HasWarnOptions`" +#~ msgstr ":c:func:`PySys_HasWarnOptions`" + +#~ msgid ":c:func:`PySys_SetArgvEx`" +#~ msgstr ":c:func:`PySys_SetArgvEx`" + +#~ msgid ":c:func:`PySys_SetArgv`" +#~ msgstr ":c:func:`PySys_SetArgv`" + +#~ msgid ":c:func:`PySys_SetPath`" +#~ msgstr ":c:func:`PySys_SetPath`" + +#~ msgid ":c:func:`Py_SetPath`" +#~ msgstr ":c:func:`Py_SetPath`" + +#~ msgid ":c:func:`Py_SetProgramName`" +#~ msgstr ":c:func:`Py_SetProgramName`" + +#~ msgid ":c:func:`Py_SetPythonHome`" +#~ msgstr ":c:func:`Py_SetPythonHome`" + +#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" +#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" + +#~ msgid ":c:func:`_Py_SetProgramFullPath`" +#~ msgstr ":c:func:`_Py_SetProgramFullPath`" + +#~ msgid ":c:func:`PyUnicode_AS_DATA`" +#~ msgstr ":c:func:`PyUnicode_AS_DATA`" + +#~ msgid ":c:func:`PyUnicode_AS_UNICODE`" +#~ msgstr ":c:func:`PyUnicode_AS_UNICODE`" + +#~ msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" +#~ msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" + +#~ msgid ":c:func:`PyUnicode_AsUnicode`" +#~ msgstr ":c:func:`PyUnicode_AsUnicode`" + +#~ msgid ":c:func:`PyUnicode_FromUnicode`" +#~ msgstr ":c:func:`PyUnicode_FromUnicode`" + +#~ msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" +#~ msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" + +#~ msgid ":c:func:`PyUnicode_GET_SIZE`" +#~ msgstr ":c:func:`PyUnicode_GET_SIZE`" + +#~ msgid ":c:func:`PyUnicode_GetSize`" +#~ msgstr ":c:func:`PyUnicode_GetSize`" + +#~ msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" +#~ msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" + +#~ msgid ":c:func:`_PyUnicode_AsUnicode`" +#~ msgstr ":c:func:`_PyUnicode_AsUnicode`" + +#~ msgid ":c:macro:`PyUnicode_WCHAR_KIND`" +#~ msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" + +#~ msgid ":c:func:`PyUnicode_InternImmortal()`" +#~ msgstr ":c:func:`PyUnicode_InternImmortal()`" + +#~ msgid "" +#~ ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " +#~ "removed. (Contributed by Mark Shannon in :issue:`40222`.)" +#~ msgstr "" +#~ "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 " +#~ "Mark Shannon 於 :issue:`40222` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index b130430e5e..20e10941bc 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-14 13:46+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -143,7 +143,7 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1652 msgid "New Features" msgstr "新增特性" @@ -1004,7 +1004,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1547 +#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1560 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " @@ -1277,7 +1277,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1951 msgid "Deprecated" msgstr "已棄用" @@ -1496,57 +1496,65 @@ msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" #: ../../whatsnew/3.12.rst:1116 -msgid "APIs:" +msgid "Other modules:" msgstr "" #: ../../whatsnew/3.12.rst:1118 +msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1120 +msgid "APIs:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1122 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1119 +#: ../../whatsnew/3.12.rst:1123 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1124 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1125 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1126 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1127 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1128 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1129 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1130 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1133 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1135 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1140 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1554,33 +1562,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1144 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1145 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1146 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1147 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1148 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1150 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1153 +msgid "" +":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " +"and :meth:`asyncio.Task.cancel` (:gh:`90985`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1157 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1588,47 +1602,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1162 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1165 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1168 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1169 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1170 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1172 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1174 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1167 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1177 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1179 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1636,7 +1650,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1647,52 +1661,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1190 +#: ../../whatsnew/3.12.rst:1198 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1194 +#: ../../whatsnew/3.12.rst:1202 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1197 +#: ../../whatsnew/3.12.rst:1205 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1200 +#: ../../whatsnew/3.12.rst:1208 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1203 +#: ../../whatsnew/3.12.rst:1211 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API." +"bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1214 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1217 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1700,21 +1714,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1216 +#: ../../whatsnew/3.12.rst:1223 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases using the C API (:gh:`95388`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1227 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1218 +#: ../../whatsnew/3.12.rst:1229 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1221 +#: ../../whatsnew/3.12.rst:1232 +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1234 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1223 +#: ../../whatsnew/3.12.rst:1236 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1726,42 +1750,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2033 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1249 msgid "" "``asynchat`` and ``asyncore``: These two modules have been removed according " "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1242 +#: ../../whatsnew/3.12.rst:1255 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1245 +#: ../../whatsnew/3.12.rst:1258 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1260 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1262 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1252 +#: ../../whatsnew/3.12.rst:1265 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1770,13 +1794,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1271 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1261 +#: ../../whatsnew/3.12.rst:1274 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1784,7 +1808,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1280 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1794,23 +1818,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1287 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1289 msgid "" ":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1293 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1819,7 +1843,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1303 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1828,178 +1852,178 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1296 +#: ../../whatsnew/3.12.rst:1309 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1312 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1315 msgid "" "``importlib.util.set_package`` has been removed. (Contributed by Brett " "Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1318 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1321 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1311 +#: ../../whatsnew/3.12.rst:1324 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1327 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1330 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1330 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1319 +#: ../../whatsnew/3.12.rst:1332 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1319 +#: ../../whatsnew/3.12.rst:1332 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1333 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1333 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1334 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1334 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1335 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1335 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1336 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1336 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1337 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1337 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1338 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1338 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1326 +#: ../../whatsnew/3.12.rst:1339 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1326 +#: ../../whatsnew/3.12.rst:1339 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1340 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1340 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1341 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1341 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1344 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1359 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1361 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1363 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1364 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1365 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1366 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1368 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1370 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1374 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2008,14 +2032,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1380 msgid "" ":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1384 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2023,27 +2047,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1392 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1382 +#: ../../whatsnew/3.12.rst:1395 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1396 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1398 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1401 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2051,22 +2075,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1406 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1408 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1410 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1414 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2074,7 +2098,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1420 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2085,174 +2109,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1429 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1418 +#: ../../whatsnew/3.12.rst:1431 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1436 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1443 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1424 -#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1426 -#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1428 -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1442 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1437 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1437 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1438 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1444 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1439 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1426 ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1440 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1441 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1428 ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1442 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1442 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1443 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1430 ../../whatsnew/3.12.rst:1431 -#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1433 -#: ../../whatsnew/3.12.rst:1434 ../../whatsnew/3.12.rst:1435 -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1445 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1449 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1444 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1445 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1446 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1447 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1448 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1448 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1449 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1449 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1453 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1456 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1459 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1463 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1466 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1468 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2260,7 +2284,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1472 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2269,21 +2293,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1478 msgid "" ":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1483 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1488 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2293,21 +2317,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 ../../whatsnew/3.12.rst:1798 +#: ../../whatsnew/3.12.rst:1499 ../../whatsnew/3.12.rst:1811 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1501 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1505 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1507 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2316,7 +2340,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1514 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2328,7 +2352,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1522 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2338,21 +2362,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1528 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1532 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1537 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2360,7 +2384,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:1542 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2372,7 +2396,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1551 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2384,14 +2408,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1564 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1556 +#: ../../whatsnew/3.12.rst:1569 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2403,45 +2427,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1580 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1592 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1595 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1598 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1604 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1608 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1610 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2450,21 +2474,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1616 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1621 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1625 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2473,46 +2497,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1631 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1633 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1634 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1635 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1637 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1626 +#: ../../whatsnew/3.12.rst:1639 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1641 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1645 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1636 +#: ../../whatsnew/3.12.rst:1649 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1655 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2520,84 +2544,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1661 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1650 +#: ../../whatsnew/3.12.rst:1663 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1664 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1666 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1668 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1669 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1657 +#: ../../whatsnew/3.12.rst:1670 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1659 +#: ../../whatsnew/3.12.rst:1672 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1675 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1677 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1680 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1682 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1671 +#: ../../whatsnew/3.12.rst:1684 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1674 +#: ../../whatsnew/3.12.rst:1687 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1677 +#: ../../whatsnew/3.12.rst:1690 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1692 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2605,29 +2629,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1697 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1701 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1702 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1703 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1704 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1706 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2638,7 +2662,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1714 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2646,32 +2670,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1719 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1723 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1724 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1725 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1727 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1731 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2679,14 +2703,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1737 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1741 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2695,28 +2719,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1747 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1751 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1756 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1760 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2726,14 +2750,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1768 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1759 +#: ../../whatsnew/3.12.rst:1772 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2741,71 +2765,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1777 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1781 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1784 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1785 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1773 +#: ../../whatsnew/3.12.rst:1786 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1774 +#: ../../whatsnew/3.12.rst:1787 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1775 +#: ../../whatsnew/3.12.rst:1788 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1776 +#: ../../whatsnew/3.12.rst:1789 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1790 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1791 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1779 +#: ../../whatsnew/3.12.rst:1792 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1782 +#: ../../whatsnew/3.12.rst:1795 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1781 +#: ../../whatsnew/3.12.rst:1794 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1797 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1799 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2813,27 +2837,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1805 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1800 +#: ../../whatsnew/3.12.rst:1813 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1803 +#: ../../whatsnew/3.12.rst:1816 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1807 +#: ../../whatsnew/3.12.rst:1820 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2842,7 +2866,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1827 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2850,13 +2874,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1819 +#: ../../whatsnew/3.12.rst:1832 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1836 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2865,7 +2889,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1829 +#: ../../whatsnew/3.12.rst:1842 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2874,13 +2898,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1835 +#: ../../whatsnew/3.12.rst:1848 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1839 +#: ../../whatsnew/3.12.rst:1852 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2894,7 +2918,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:1864 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2902,7 +2926,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1869 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2910,7 +2934,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1861 +#: ../../whatsnew/3.12.rst:1874 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2918,7 +2942,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1866 +#: ../../whatsnew/3.12.rst:1879 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2926,25 +2950,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1884 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1887 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1888 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1889 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1891 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2952,14 +2976,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1896 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1887 +#: ../../whatsnew/3.12.rst:1900 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2968,17 +2992,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1907 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1909 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1911 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -2986,20 +3010,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:1916 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:1920 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1910 +#: ../../whatsnew/3.12.rst:1923 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3007,14 +3031,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1915 +#: ../../whatsnew/3.12.rst:1928 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:1932 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3025,15 +3049,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1940 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:1941 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1943 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3042,281 +3066,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1953 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1955 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1956 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1944 +#: ../../whatsnew/3.12.rst:1957 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:1958 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1959 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1947 +#: ../../whatsnew/3.12.rst:1960 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1961 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1949 +#: ../../whatsnew/3.12.rst:1962 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1963 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1965 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1966 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1954 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:1968 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1971 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1972 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1973 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1974 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1975 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1976 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1978 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1982 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1985 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1988 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1991 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1993 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1995 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1998 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2000 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2001 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2002 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2003 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2005 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2008 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2000 +#: ../../whatsnew/3.12.rst:2013 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2016 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2021 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2011 +#: ../../whatsnew/3.12.rst:2024 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2014 +#: ../../whatsnew/3.12.rst:2027 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2035 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2040 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2029 +#: ../../whatsnew/3.12.rst:2042 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2031 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2032 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2036 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2037 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2039 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2055 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2058 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 74ef2a0d5b..88b5c3adfa 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -2981,7 +2981,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2572 msgid "" -":c:macro:`PyEval_CallObject` is now only available in macro form. The " +":c:func:`!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 "" @@ -3251,10 +3251,10 @@ msgstr "(由 Antoine Pitrou 於 :issue:`10272` 貢獻。)" #: ../../whatsnew/3.2.rst:2734 msgid "" -"The misleading functions :c:func:`PyEval_AcquireLock()` and :c:func:" -"`PyEval_ReleaseLock()` have been officially deprecated. The thread-state " -"aware APIs (such as :c:func:`PyEval_SaveThread()` and :c:func:" -"`PyEval_RestoreThread()`) should be used instead." +"The misleading functions :c:func:`!PyEval_AcquireLock` and :c:func:`!" +"PyEval_ReleaseLock` have been officially deprecated. The thread-state aware " +"APIs (such as :c:func:`PyEval_SaveThread` and :c:func:" +"`PyEval_RestoreThread`) should be used instead." msgstr "" #: ../../whatsnew/3.2.rst:2739 @@ -3270,6 +3270,6 @@ msgstr "(由 Giampaolo Rodola 在 :issue:`6706` 中貢獻。)" #: ../../whatsnew/3.2.rst:2744 msgid "" -"Due to the new :term:`GIL` implementation, :c:func:`PyEval_InitThreads()` " -"cannot be called before :c:func:`Py_Initialize()` anymore." +"Due to the new :term:`GIL` implementation, :c:func:`!PyEval_InitThreads` " +"cannot be called before :c:func:`Py_Initialize` anymore." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 4d7fa2d5d6..8242c1e3d3 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+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-" @@ -31,7 +31,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:51 msgid ":pep:`398` - Python 3.3 Release Schedule" -msgstr "" +msgstr ":pep:`398` - Python 3.3 發佈時間表" #: ../../whatsnew/3.3.rst:55 msgid "Summary -- Release highlights" @@ -39,7 +39,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新的語法特徵:" #: ../../whatsnew/3.3.rst:62 msgid "" @@ -48,11 +48,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:63 msgid "The ``u'unicode'`` syntax is accepted again for :class:`str` objects." -msgstr "" +msgstr ":class:`str` 物件再次接受 ``u'unicode'`` 語法。" #: ../../whatsnew/3.3.rst:65 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.3.rst:67 msgid ":mod:`faulthandler` (helps debugging low-level crashes)" @@ -81,15 +81,15 @@ msgstr "" #: ../../whatsnew/3.3.rst:74 msgid "New built-in features:" -msgstr "" +msgstr "新的內建功能:" #: ../../whatsnew/3.3.rst:76 msgid "Reworked :ref:`I/O exception hierarchy `." -msgstr "" +msgstr "重新設計 :ref:`I/O 例外層次結構 `。" #: ../../whatsnew/3.3.rst:78 msgid "Implementation improvements:" -msgstr "" +msgstr "實作改進:" #: ../../whatsnew/3.3.rst:80 msgid "" @@ -120,11 +120,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:90 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.3.rst:92 msgid "Hash randomization is switched on by default." -msgstr "" +msgstr "預設情況下,雜湊隨機化處於打開狀態。" #: ../../whatsnew/3.3.rst:94 msgid "Please read on for a comprehensive list of user-facing changes." @@ -132,7 +132,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:100 msgid "PEP 405: Virtual Environments" -msgstr "" +msgstr "PEP 405:虛擬環境" #: ../../whatsnew/3.3.rst:102 msgid "" @@ -155,7 +155,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:118 msgid ":pep:`405` - Python Virtual Environments" -msgstr "" +msgstr ":pep:`405` - Python 虛擬環境" #: ../../whatsnew/3.3.rst:119 msgid "PEP written by Carl Meyer; implementation by Carl Meyer and Vinay Sajip" @@ -181,7 +181,7 @@ msgstr "" msgid "" "PEP written by Eric V. Smith; implementation by Eric V. Smith and Barry " "Warsaw" -msgstr "" +msgstr "由 Eric V. Smith 撰寫 PEP;由 Eric V. Smith 和 Barry Warsaw 實施" #: ../../whatsnew/3.3.rst:140 msgid "" @@ -219,7 +219,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1123 msgid "Features" -msgstr "" +msgstr "功能" #: ../../whatsnew/3.3.rst:163 msgid "" @@ -256,7 +256,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1133 msgid "API changes" -msgstr "" +msgstr "API 變更" #: ../../whatsnew/3.3.rst:182 msgid "The maximum number of dimensions is officially limited to 64." @@ -325,11 +325,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:227 msgid "Functionality" -msgstr "" +msgstr "功能性" #: ../../whatsnew/3.3.rst:229 msgid "Changes introduced by :pep:`393` are the following:" -msgstr "" +msgstr ":pep:`393` 引入的更改如下:" #: ../../whatsnew/3.3.rst:231 msgid "" @@ -372,18 +372,18 @@ msgstr "" #: ../../whatsnew/3.3.rst:251 msgid "" "The value of :data:`sys.maxunicode` is now always ``1114111`` (``0x10FFFF`` " -"in hexadecimal). The :c:func:`PyUnicode_GetMax` function still returns " +"in hexadecimal). The :c:func:`!PyUnicode_GetMax` function still returns " "either ``0xFFFF`` or ``0x10FFFF`` for backward compatibility, and it should " "not be used with the new Unicode API (see :issue:`13054`)." msgstr "" #: ../../whatsnew/3.3.rst:256 msgid "The :file:`./configure` flag ``--with-wide-unicode`` has been removed." -msgstr "" +msgstr ":file:`./configure` 旗標 ``--with-wide-unicode`` 已被刪除。" #: ../../whatsnew/3.3.rst:259 msgid "Performance and resource usage" -msgstr "" +msgstr "性能和資源使用情況" #: ../../whatsnew/3.3.rst:261 msgid "" @@ -426,10 +426,11 @@ msgid "" "PEP written by Martin von Löwis; implementation by Torsten Becker and Martin " "von Löwis." msgstr "" +"PEP 由 Martin von Löwis 撰寫;由 Torsten Becker 和 Martin von Löwis 實作。" #: ../../whatsnew/3.3.rst:290 msgid "PEP 397: Python Launcher for Windows" -msgstr "" +msgstr "PEP 397:適用於 Windows 的 Python 啟動器" #: ../../whatsnew/3.3.rst:292 msgid "" @@ -466,17 +467,17 @@ msgstr "" #: ../../whatsnew/3.3.rst:317 msgid ":pep:`397` - Python Launcher for Windows" -msgstr "" +msgstr ":pep:`397` - 適用於 Windows 的 Python 啟動器" #: ../../whatsnew/3.3.rst:316 msgid "" "PEP written by Mark Hammond and Martin v. Löwis; implementation by Vinay " "Sajip." -msgstr "" +msgstr "由 Mark Hammond 和 Martin v. Löwis 撰寫 PEP;由 Vinay Sajip 實作。" #: ../../whatsnew/3.3.rst:319 msgid "Launcher documentation: :ref:`launcher`" -msgstr "" +msgstr "啟動器文件::ref:`launcher`" #: ../../whatsnew/3.3.rst:321 msgid "Installer PATH modification: :ref:`windows-path-mod`" @@ -761,7 +762,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:623 msgid ":pep:`412` - Key-Sharing Dictionary" -msgstr "" +msgstr ":pep:`412` - 密鑰共享字典" #: ../../whatsnew/3.3.rst:624 msgid "PEP written and implemented by Mark Shannon." @@ -769,7 +770,7 @@ msgstr "由 Mark Shannon 撰寫 PEP 與實作。" #: ../../whatsnew/3.3.rst:628 msgid "PEP 362: Function Signature Object" -msgstr "" +msgstr "PEP 362:函式簽名物件" #: ../../whatsnew/3.3.rst:630 msgid "" @@ -785,17 +786,19 @@ msgstr "" #: ../../whatsnew/3.3.rst:642 msgid ":pep:`362`: - Function Signature Object" -msgstr "" +msgstr ":pep:`362`: - 函式簽名物件" #: ../../whatsnew/3.3.rst:642 msgid "" "PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo; " "implemented by Yury Selivanov." msgstr "" +"PEP 由 Brett Cannon、Yury Selivanov、Larry Hastings、Jiwon Seo 撰寫;由 Yury " +"Selivanov 實作。" #: ../../whatsnew/3.3.rst:647 msgid "PEP 421: Adding sys.implementation" -msgstr "" +msgstr "PEP 421:新增 sys.implementation" #: ../../whatsnew/3.3.rst:649 msgid "" @@ -840,7 +843,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:679 msgid ":pep:`421` - Adding sys.implementation" -msgstr "" +msgstr ":pep:`421` - 新增 sys.implementation" #: ../../whatsnew/3.3.rst:680 msgid "PEP written and implemented by Eric Snow." @@ -848,7 +851,7 @@ msgstr "由 Eric Snow 撰寫 PEP 與實作。" #: ../../whatsnew/3.3.rst:686 msgid "Using importlib as the Implementation of Import" -msgstr "" +msgstr "使用 importlib 作為 import 的實作" #: ../../whatsnew/3.3.rst:687 msgid "" @@ -880,7 +883,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:707 msgid "New APIs" -msgstr "" +msgstr "新 API" #: ../../whatsnew/3.3.rst:708 msgid "" @@ -934,7 +937,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:742 msgid "Visible Changes" -msgstr "" +msgstr "明顯的變更" #: ../../whatsnew/3.3.rst:744 msgid "" @@ -995,7 +998,7 @@ msgstr "其他語言更動" #: ../../whatsnew/3.3.rst:779 msgid "Some smaller changes made to the core Python language are:" -msgstr "" +msgstr "對核心 Python 語言所做的一些較小的更改包括:" #: ../../whatsnew/3.3.rst:781 msgid "" @@ -1010,7 +1013,7 @@ msgstr "(由 Ezio Melotti 在 :issue:`12753` 中貢獻。)" #: ../../whatsnew/3.3.rst:787 msgid "Unicode database updated to UCD version 6.1.0" -msgstr "" +msgstr "Unicode 資料庫更新至 UCD 版本 6.1.0" #: ../../whatsnew/3.3.rst:789 msgid "" @@ -1101,7 +1104,7 @@ msgstr "(由 Antoine Pitrou 在 :issue:`9260` 中貢獻。)" #: ../../whatsnew/3.3.rst:841 msgid "Builtin functions and types" -msgstr "" +msgstr "內建函式和型別" #: ../../whatsnew/3.3.rst:843 msgid "" @@ -1194,7 +1197,7 @@ msgstr "(由 Nadeem Vawda 和 Per Øyvind Karlsen 在 :issue:`6715` 中貢獻 #: ../../whatsnew/3.3.rst:910 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.3.rst:913 msgid "abc" @@ -1213,18 +1216,24 @@ msgid "" ":class:`abc.abstractproperty` has been deprecated, use :class:`property` " "with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractproperty` 已被棄用,請改 :class:`property` 和 :func:`abc." +"abstractmethod`。" #: ../../whatsnew/3.3.rst:922 ../../whatsnew/3.3.rst:2248 msgid "" ":class:`abc.abstractclassmethod` has been deprecated, use :class:" "`classmethod` with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractclassmethod` 已被棄用,請改用 :class:`classmethod` 和 :" +"func:`abc.abstractmethod`。" #: ../../whatsnew/3.3.rst:924 ../../whatsnew/3.3.rst:2250 msgid "" ":class:`abc.abstractstaticmethod` has been deprecated, use :class:" "`staticmethod` with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractstaticmethod` 已被棄用,請改用 :class:`staticmethod` 和 :" +"func:`abc.abstractmethod`。" #: ../../whatsnew/3.3.rst:927 msgid "(Contributed by Darren Dale in :issue:`11610`.)" @@ -1367,7 +1376,7 @@ msgstr "(:issue:`12100`)" #: ../../whatsnew/3.3.rst:1015 msgid "The ``unicode_internal`` codec has been deprecated." -msgstr "" +msgstr "``unicode_internal`` 編解碼器已被棄用。" #: ../../whatsnew/3.3.rst:1019 msgid "collections" @@ -1448,12 +1457,15 @@ msgstr "" msgid "" ":class:`curses.window` has a new :attr:`curses.window.encoding` attribute." msgstr "" +":class:`curses.window` 有一個新的 :attr:`curses.window.encoding` 屬性。" #: ../../whatsnew/3.3.rst:1068 msgid "" "The :class:`curses.window` class has a new :meth:`~curses.window.get_wch` " "method to get a wide character" msgstr "" +":class:`curses.window` 類別有一個新的 :meth:`~curses.window.get_wch` 方法來獲" +"取寬字元" #: ../../whatsnew/3.3.rst:1070 msgid "" @@ -1505,7 +1517,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1097 msgid "C-module and libmpdec written by Stefan Krah." -msgstr "" +msgstr "由 Stefan Krah 編寫的 C 模組和 libmpdec。" #: ../../whatsnew/3.3.rst:1099 msgid "" @@ -1611,11 +1623,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:1139 msgid "32-bit" -msgstr "" +msgstr "32 位元" #: ../../whatsnew/3.3.rst:1139 msgid "64-bit" -msgstr "" +msgstr "64 位元" #: ../../whatsnew/3.3.rst:1141 msgid ":const:`MAX_PREC`" @@ -1699,7 +1711,7 @@ msgstr "" msgid "" "The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method " "is deprecated." -msgstr "" +msgstr ":meth:`~decimal.Decimal.quantize` 方法中的 ``watchexp`` 參數已棄用。" #: ../../whatsnew/3.3.rst:1193 msgid "email" @@ -1864,7 +1876,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1326 msgid "Decoding to unicode is done automatically::" -msgstr "" +msgstr "解碼為 unicode 是自動完成的:: :" #: ../../whatsnew/3.3.rst:1332 msgid "" @@ -1883,7 +1895,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1347 msgid "Other API Changes" -msgstr "" +msgstr "其他 API 變更" #: ../../whatsnew/3.3.rst:1349 msgid "" @@ -1894,7 +1906,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1353 msgid "New utility functions:" -msgstr "" +msgstr "新工具函式:" #: ../../whatsnew/3.3.rst:1355 msgid "" @@ -2236,8 +2248,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1591 msgid "" "(Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)" -msgstr "" -"(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" +msgstr "(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" #: ../../whatsnew/3.3.rst:1593 msgid "" @@ -2363,7 +2374,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1672 msgid "Additional new posix functions:" -msgstr "" +msgstr "其他新的 posix 函式:" #: ../../whatsnew/3.3.rst:1674 msgid "" @@ -2526,12 +2537,16 @@ msgid "" "*argument* parameter is now optional. (Contributed by Chris Clark in :issue:" "`13245`.)" msgstr "" +":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` " +"*argument* 參數現在是可選的。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" #: ../../whatsnew/3.3.rst:1764 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` now " "accept a *kwargs* parameter. (Contributed by Chris Clark in :issue:`13245`.)" msgstr "" +":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` 現在接受 " +"*kwargs* 參數。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" #: ../../whatsnew/3.3.rst:1770 msgid "select" @@ -2562,7 +2577,7 @@ msgstr "shutil" #: ../../whatsnew/3.3.rst:1789 msgid "New functions:" -msgstr "" +msgstr "新功能:" #: ../../whatsnew/3.3.rst:1791 msgid "" @@ -2633,27 +2648,28 @@ msgstr "" #: ../../whatsnew/3.3.rst:1829 msgid ":func:`~signal.pthread_kill`: send a signal to a thread;" -msgstr "" +msgstr ":func:`~signal.pthread_kill`:向執行緒發送訊號;" #: ../../whatsnew/3.3.rst:1830 msgid ":func:`~signal.sigpending`: examine pending functions;" -msgstr "" +msgstr ":func:`~signal.sigpending`:檢查未定的函式;" #: ../../whatsnew/3.3.rst:1831 msgid ":func:`~signal.sigwait`: wait a signal;" -msgstr "" +msgstr ":func:`~signal.sigwait`:等待訊號;" #: ../../whatsnew/3.3.rst:1832 msgid "" ":func:`~signal.sigwaitinfo`: wait for a signal, returning detailed " "information about it;" -msgstr "" +msgstr ":func:`~signal.sigwaitinfo`:等待訊號,回傳有關該訊號的詳細資訊;" #: ../../whatsnew/3.3.rst:1834 msgid "" ":func:`~signal.sigtimedwait`: like :func:`~signal.sigwaitinfo` but with a " "timeout." msgstr "" +":func:`~signal.sigtimedwait`:類似於 :func:`~signal.sigwaitinfo` 但有超時。" #: ../../whatsnew/3.3.rst:1837 msgid "" @@ -2667,6 +2683,8 @@ msgid "" ":func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError, " "instead of a RuntimeError: OSError has an errno attribute." msgstr "" +":func:`signal.signal` 和 :func:`signal.siginterrupt` 會引發 OSError,而不是 " +"RuntimeError:OSError 有一個 errno 屬性。" #: ../../whatsnew/3.3.rst:1846 msgid "smtpd" @@ -2705,6 +2723,8 @@ msgid "" "allowing an ``SMTP`` instance to be used in a ``with`` statement. " "(Contributed by Giampaolo Rodolà in :issue:`11289`.)" msgstr "" +":class:`~smtplib.SMTP` 現在支援情境管理協議,允許在 ``with`` 陳述式中使用 " +"``SMTP`` 實例。 (由 Giampaolo Rodolà 在 :issue:`11289` 中貢獻。)" #: ../../whatsnew/3.3.rst:1870 msgid "" @@ -2712,6 +2732,9 @@ msgid "" "starttls` method now accept an SSLContext parameter to control parameters of " "the secure channel. (Contributed by Kasun Herath in :issue:`8809`.)" msgstr "" +":class:`~smtplib.SMTP_SSL` 構造函式和 :meth:`~smtplib.SMTP.starttls` 方法現在" +"接受 SSLContext 參數來控制安全通道的參數。 (由 Kasun Herath 在 :issue:" +"`8809` 中貢獻。)" #: ../../whatsnew/3.3.rst:1876 msgid "socket" @@ -2722,6 +2745,8 @@ msgid "" "The :class:`~socket.socket` class now exposes additional methods to process " "ancillary data when supported by the underlying platform:" msgstr "" +"當底層平台支援時,:class:`~socket.socket` 類現在公開了額外的方法來處理輔助資" +"料:" #: ../../whatsnew/3.3.rst:1881 msgid ":func:`~socket.socket.sendmsg`" @@ -2739,7 +2764,8 @@ msgstr ":func:`~socket.socket.recvmsg_into`" msgid "" "(Contributed by David Watson in :issue:`6560`, based on an earlier patch by " "Heiko Wundram)" -msgstr "(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" +msgstr "" +"(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" #: ../../whatsnew/3.3.rst:1888 msgid "" @@ -2752,7 +2778,8 @@ msgstr "" msgid "" "(Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:" "`10141`.)" -msgstr "(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" +msgstr "" +"(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" #: ../../whatsnew/3.3.rst:1894 msgid "" @@ -2761,12 +2788,18 @@ msgid "" "oracle.com/projects/rds `__)." msgstr "" +":class:`~socket.socket` 類別現在支援 PF_RDS 協議系列(https://en.wikipedia." +"org/wiki/Reliable_Datagram_Sockets 和 `https://oss.oracle.com/projects/rds " +"`__\\ )。" #: ../../whatsnew/3.3.rst:1898 msgid "" "The :class:`~socket.socket` class now supports the ``PF_SYSTEM`` protocol " "family on OS X. (Contributed by Michael Goderbauer in :issue:`13777`.)" msgstr "" +":class:`~socket.socket` 類別現在支援 OS X 上的 ``PF_SYSTEM`` 協議系列。(由 " +"Michael Goderbauer 在 :issue:`13777` 中貢獻。)" #: ../../whatsnew/3.3.rst:1901 msgid "" @@ -2805,17 +2838,17 @@ msgstr "ssl" #: ../../whatsnew/3.3.rst:1928 msgid "The :mod:`ssl` module has two new random generation functions:" -msgstr "" +msgstr ":mod:`ssl` 模組有兩個新的隨機生成函式:" #: ../../whatsnew/3.3.rst:1930 msgid "" ":func:`~ssl.RAND_bytes`: generate cryptographically strong pseudo-random " "bytes." -msgstr "" +msgstr ":func:`~ssl.RAND_bytes`:生成加密的強偽隨機位元組。" #: ../../whatsnew/3.3.rst:1932 msgid ":func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes." -msgstr "" +msgstr ":func:`~ssl.RAND_pseudo_bytes`:生成偽隨機位元組。" #: ../../whatsnew/3.3.rst:1934 msgid "(Contributed by Victor Stinner in :issue:`12049`.)" @@ -2947,6 +2980,8 @@ msgid "" ":mod:`tarfile` now supports ``lzma`` encoding via the :mod:`lzma` module. " "(Contributed by Lars Gustäbel in :issue:`5689`.)" msgstr "" +":mod:`tarfile` 現在透過 :mod:`lzma` 模組支援 ``lzma`` 編碼。 (由 Lars " +"Gustäbel 在 :issue:`5689` 中貢獻。)" #: ../../whatsnew/3.3.rst:2019 msgid "tempfile" @@ -3005,17 +3040,18 @@ msgstr "time" #: ../../whatsnew/3.3.rst:2057 msgid "The :pep:`418` added new functions to the :mod:`time` module:" -msgstr "" +msgstr ":pep:`418` 向 :mod:`time` 模組新增了新功能:" #: ../../whatsnew/3.3.rst:2059 msgid ":func:`~time.get_clock_info`: Get information on a clock." -msgstr "" +msgstr ":func:`~time.get_clock_info`:獲取時鐘資訊。" #: ../../whatsnew/3.3.rst:2060 msgid "" ":func:`~time.monotonic`: Monotonic clock (cannot go backward), not affected " "by system clock updates." msgstr "" +":func:`~time.monotonic`:單調時鐘(不能倒退),不受系統時鐘更新的影響。" #: ../../whatsnew/3.3.rst:2062 msgid "" @@ -3027,11 +3063,11 @@ msgstr "" msgid "" ":func:`~time.process_time`: Sum of the system and user CPU time of the " "current process." -msgstr "" +msgstr ":func:`~time.process_time`:當前行程的系統和使用者 CPU 時間總和。" #: ../../whatsnew/3.3.rst:2067 msgid "Other new functions:" -msgstr "" +msgstr "其他新功能:" #: ../../whatsnew/3.3.rst:2069 msgid "" @@ -3039,6 +3075,9 @@ msgid "" "clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" +":func:`~time.clock_getres`、:func:`~time.clock_gettime` 和 :func:`~time." +"clock_settime` 函式帶有 ``CLOCK_xxx`` 常數。 (由 Victor Stinner 在 :issue:" +"`10278` 中貢獻。)" #: ../../whatsnew/3.3.rst:2073 msgid "" @@ -3081,6 +3120,7 @@ msgid "" ":meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult` " "object." msgstr "" +":meth:`unittest.TestCase.run` 現在回傳 :class:`~unittest.TestResult` 物件。" #: ../../whatsnew/3.3.rst:2102 msgid "urllib" @@ -3095,7 +3135,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2110 msgid "(:issue:`1673007`)" -msgstr "" +msgstr "(:issue:`1673007`)" #: ../../whatsnew/3.3.rst:2114 msgid "webbrowser" @@ -3187,20 +3227,20 @@ msgid "" "(Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:" "`15026`.)" msgstr "" -"(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` " -"貢獻。)" +"(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` 貢" +"獻。)" #: ../../whatsnew/3.3.rst:2170 msgid "Build and C API Changes" -msgstr "" +msgstr "建置和 C API 更改" #: ../../whatsnew/3.3.rst:2172 msgid "Changes to Python's build process and to the C API include:" -msgstr "" +msgstr "Python 建置程序和 C API 的更改包括:" #: ../../whatsnew/3.3.rst:2174 msgid "New :pep:`3118` related function:" -msgstr "" +msgstr "新的 :pep:`3118` 相關功能:" #: ../../whatsnew/3.3.rst:2176 msgid ":c:func:`PyMemoryView_FromMemory`" @@ -3212,7 +3252,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2180 msgid "High-level API:" -msgstr "" +msgstr "高階 API:" #: ../../whatsnew/3.3.rst:2182 msgid ":c:func:`PyUnicode_CopyCharacters`" @@ -3248,7 +3288,7 @@ msgstr ":c:type:`Py_UCS1`、:c:type:`Py_UCS2`、:c:type:`Py_UCS4` 型別" #: ../../whatsnew/3.3.rst:2192 msgid ":c:type:`PyASCIIObject` and :c:type:`PyCompactUnicodeObject` structures" -msgstr "" +msgstr ":c:type:`PyASCIIObject` 和 :c:type:`PyCompactUnicodeObject` 結構" #: ../../whatsnew/3.3.rst:2193 msgid ":c:macro:`PyUnicode_READY`" @@ -3272,8 +3312,8 @@ msgstr "" #: ../../whatsnew/3.3.rst:2198 msgid "" -":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:" -"`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" +":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:`!" +"PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" "`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" msgstr "" @@ -3294,6 +3334,8 @@ msgid "" ":c:macro:`PyArg_ParseTuple` now accepts a :class:`bytearray` for the ``c`` " "format (:issue:`12380`)." msgstr "" +":c:macro:`PyArg_ParseTuple` 現在接受 :class:`bytearray` 為 ``c`` 格式 (:" +"issue:`12380`)。" #: ../../whatsnew/3.3.rst:2210 msgid "Deprecated" @@ -3301,11 +3343,11 @@ msgstr "已棄用" #: ../../whatsnew/3.3.rst:2213 msgid "Unsupported Operating Systems" -msgstr "" +msgstr "不支援的作業系統" #: ../../whatsnew/3.3.rst:2215 msgid "OS/2 and VMS are no longer supported due to the lack of a maintainer." -msgstr "" +msgstr "由於缺乏維護者,OS/2 和 VMS 不再受支援。" #: ../../whatsnew/3.3.rst:2217 msgid "" @@ -3315,11 +3357,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:2220 msgid "OSF support, which was deprecated in 3.2, has been completely removed." -msgstr "" +msgstr "OSF 支援在 3.2 中已棄用,現已完全刪除。" #: ../../whatsnew/3.3.rst:2224 msgid "Deprecated Python modules, functions and methods" -msgstr "" +msgstr "已棄用的 Python 模組、函式和方法" #: ../../whatsnew/3.3.rst:2226 msgid "" @@ -3339,12 +3381,16 @@ msgid "" ":meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use :meth:`ftplib.FTP." "mlsd`" msgstr "" +":meth:`ftplib.FTP.nlst` 和 :meth:`ftplib.FTP.dir`:使用 :meth:`ftplib.FTP." +"mlsd`" #: ../../whatsnew/3.3.rst:2233 msgid "" ":func:`platform.popen`: use the :mod:`subprocess` module. Check especially " "the :ref:`subprocess-replacements` section (:issue:`11377`)." msgstr "" +":func:`platform.popen`:使用 :mod:`subprocess` 模組。請特別檢查 :ref:" +"`subprocess-replacements` 部分 (:issue:`11377`)。" #: ../../whatsnew/3.3.rst:2235 msgid "" @@ -3368,7 +3414,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2243 msgid "The :func:`os.stat_float_times` function is deprecated." -msgstr "" +msgstr ":func:`os.stat_float_times` 函式已棄用。" #: ../../whatsnew/3.3.rst:2244 msgid ":mod:`abc` module:" @@ -3376,7 +3422,7 @@ msgstr ":mod:`abc` 模組:" #: ../../whatsnew/3.3.rst:2253 msgid ":mod:`importlib` package:" -msgstr "" +msgstr ":mod:`importlib` 套件:" #: ../../whatsnew/3.3.rst:2255 msgid "" @@ -3388,13 +3434,15 @@ msgstr "" #: ../../whatsnew/3.3.rst:2265 msgid "Deprecated functions and types of the C API" -msgstr "" +msgstr "C API 中已棄用的函式和型別" #: ../../whatsnew/3.3.rst:2267 msgid "" "The :c:type:`Py_UNICODE` has been deprecated by :pep:`393` and will be " "removed in Python 4. All functions using this type are deprecated:" msgstr "" +":c:type:`Py_UNICODE` 已被 :pep:`393` 棄用,並將在 Python 4 中刪除。所有使用此" +"型別的函式均已棄用:" #: ../../whatsnew/3.3.rst:2270 msgid "" @@ -3404,161 +3452,192 @@ msgstr "" #: ../../whatsnew/3.3.rst:2273 msgid "" -":c:macro:`PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :c:" -"func:`PyUnicode_FromKindAndData`" +":c:macro:`!PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :" +"c:func:`PyUnicode_FromKindAndData`" msgstr "" +":c:macro:`!PyUnicode_FromUnicode`:使用 :c:func:`PyUnicode_FromWideChar` 或 :" +"c:func:`PyUnicode_FromKindAndData`" #: ../../whatsnew/3.3.rst:2275 msgid "" -":c:macro:`PyUnicode_AS_UNICODE`, :c:func:`PyUnicode_AsUnicode`, :c:func:" -"`PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" +":c:macro:`!PyUnicode_AS_UNICODE`, :c:func:`!PyUnicode_AsUnicode`, :c:func:`!" +"PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" msgstr "" +":c:macro:`!PyUnicode_AS_UNICODE`、:c:func:`!PyUnicode_AsUnicode`、:c:func:`!" +"PyUnicode_AsUnicodeAndSize`:使用 :c:func:`PyUnicode_AsWideCharString`" #: ../../whatsnew/3.3.rst:2277 msgid "" -":c:macro:`PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" +":c:macro:`!PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" "`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`" msgstr "" +":c:macro:`!PyUnicode_AS_DATA`:將 :c:macro:`PyUnicode_DATA` 與 :c:macro:" +"`PyUnicode_READ` 和 :c:macro:`PyUnicode_WRITE` 一起使用" #: ../../whatsnew/3.3.rst:2279 msgid "" -":c:macro:`PyUnicode_GET_SIZE`, :c:func:`PyUnicode_GetSize`: use :c:macro:" +":c:macro:`!PyUnicode_GET_SIZE`, :c:func:`!PyUnicode_GetSize`: use :c:macro:" "`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`" msgstr "" +":c:macro:`!PyUnicode_GET_SIZE`、:c:func:`!PyUnicode_GetSize`:使用 :c:macro:" +"`PyUnicode_GET_LENGTH` 或 :c:func:`PyUnicode_GetLength`" #: ../../whatsnew/3.3.rst:2281 msgid "" -":c:macro:`PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " +":c:macro:`!PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " "PyUnicode_KIND(str)`` (only work on ready strings)" msgstr "" +":c:macro:`!PyUnicode_GET_DATA_SIZE`:使用 ``PyUnicode_GET_LENGTH(str) * " +"PyUnicode_KIND(str)``\\ (僅適用於準備好的字串)" #: ../../whatsnew/3.3.rst:2284 msgid "" -":c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" +":c:func:`!PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" "func:`PyUnicode_AsWideCharString`" msgstr "" +":c:func:`!PyUnicode_AsUnicodeCopy`:使用 :c:func:`PyUnicode_AsUCS4Copy` 或 :" +"c:func:`PyUnicode_AsWideCharString`" #: ../../whatsnew/3.3.rst:2286 -msgid ":c:func:`PyUnicode_GetMax`" -msgstr ":c:func:`PyUnicode_GetMax`" +msgid ":c:func:`!PyUnicode_GetMax`" +msgstr ":c:func:`!PyUnicode_GetMax`" #: ../../whatsnew/3.3.rst:2289 msgid "Functions and macros manipulating Py_UNICODE* strings:" -msgstr "" +msgstr "操作 Py_UNICODE* 字串的函式和巨集:" #: ../../whatsnew/3.3.rst:2291 msgid "" -":c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or :c:macro:" -"`PyUnicode_GET_LENGTH`" +":c:macro:`!Py_UNICODE_strlen()`: use :c:func:`PyUnicode_GetLength` or :c:" +"macro:`PyUnicode_GET_LENGTH`" msgstr "" +":c:macro:`!Py_UNICODE_strlen()`:使用 :c:func:`PyUnicode_GetLength` 或 :c:" +"macro:`PyUnicode_GET_LENGTH`" #: ../../whatsnew/3.3.rst:2293 msgid "" -":c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or :c:" -"func:`PyUnicode_FromFormat`" +":c:macro:`!Py_UNICODE_strcat()`: use :c:func:`PyUnicode_CopyCharacters` or :" +"c:func:`PyUnicode_FromFormat`" msgstr "" +":c:macro:`!Py_UNICODE_strcat()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :" +"c:func:`PyUnicode_FromFormat`" #: ../../whatsnew/3.3.rst:2295 msgid "" -":c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`, :c:macro:" -"`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" +":c:macro:`!Py_UNICODE_strcpy()`, :c:macro:`!Py_UNICODE_strncpy()`, :c:macro:" +"`!Py_UNICODE_COPY()`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_Substring`" msgstr "" +":c:macro:`!Py_UNICODE_strcpy()`、:c:macro:`!Py_UNICODE_strncpy()`、:c:macro:" +"`!Py_UNICODE_COPY()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" +"`PyUnicode_Substring`" #: ../../whatsnew/3.3.rst:2298 -msgid ":c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_strcmp()`: use :c:func:`PyUnicode_Compare`" +msgstr ":c:macro:`!Py_UNICODE_strcmp()`:使用 :c:func:`PyUnicode_Compare`" #: ../../whatsnew/3.3.rst:2299 -msgid ":c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_strncmp()`: use :c:func:`PyUnicode_Tailmatch`" +msgstr ":c:macro:`!Py_UNICODE_strncmp()`: 使用 :c:func:`PyUnicode_Tailmatch`" #: ../../whatsnew/3.3.rst:2300 msgid "" -":c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use :c:func:" -"`PyUnicode_FindChar`" +":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: use :c:" +"func:`PyUnicode_FindChar`" msgstr "" +":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: 使用 :c:" +"func:`PyUnicode_FindChar`" #: ../../whatsnew/3.3.rst:2302 -msgid ":c:macro:`Py_UNICODE_FILL`: use :c:func:`PyUnicode_Fill`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_FILL()`: use :c:func:`PyUnicode_Fill`" +msgstr ":c:macro:`!Py_UNICODE_FILL()`: 使用 :c:func:`PyUnicode_Fill`" #: ../../whatsnew/3.3.rst:2303 -msgid ":c:macro:`Py_UNICODE_MATCH`" -msgstr ":c:macro:`Py_UNICODE_MATCH`" +msgid ":c:macro:`!Py_UNICODE_MATCH`" +msgstr ":c:macro:`!Py_UNICODE_MATCH`" #: ../../whatsnew/3.3.rst:2305 msgid "Encoders:" -msgstr "" +msgstr "編碼器:" #: ../../whatsnew/3.3.rst:2307 -msgid ":c:func:`PyUnicode_Encode`: use :c:func:`PyUnicode_AsEncodedObject`" -msgstr "" +msgid ":c:func:`!PyUnicode_Encode`: use :c:func:`!PyUnicode_AsEncodedObject`" +msgstr ":c:func:`!PyUnicode_Encode`:使用 :c:func:`!PyUnicode_AsEncodedObject`" #: ../../whatsnew/3.3.rst:2308 -msgid ":c:func:`PyUnicode_EncodeUTF7`" -msgstr ":c:func:`PyUnicode_EncodeUTF7`" +msgid ":c:func:`!PyUnicode_EncodeUTF7`" +msgstr ":c:func:`!PyUnicode_EncodeUTF7`" #: ../../whatsnew/3.3.rst:2309 msgid "" -":c:func:`PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" +":c:func:`!PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" "`PyUnicode_AsUTF8String`" msgstr "" +":c:func:`!PyUnicode_EncodeUTF8`:使用 :c:func:`PyUnicode_AsUTF8` 或 :c:func:" +"`PyUnicode_AsUTF8String`" #: ../../whatsnew/3.3.rst:2311 -msgid ":c:func:`PyUnicode_EncodeUTF32`" -msgstr ":c:func:`PyUnicode_EncodeUTF32`" +msgid ":c:func:`!PyUnicode_EncodeUTF32`" +msgstr ":c:func:`!PyUnicode_EncodeUTF32`" #: ../../whatsnew/3.3.rst:2312 -msgid ":c:func:`PyUnicode_EncodeUTF16`" -msgstr ":c:func:`PyUnicode_EncodeUTF16`" +msgid ":c:func:`!PyUnicode_EncodeUTF16`" +msgstr ":c:func:`!PyUnicode_EncodeUTF16`" #: ../../whatsnew/3.3.rst:2313 msgid "" -":c:func:`PyUnicode_EncodeUnicodeEscape` use :c:func:" +":c:func:`!PyUnicode_EncodeUnicodeEscape` use :c:func:" "`PyUnicode_AsUnicodeEscapeString`" msgstr "" +":c:func:`!PyUnicode_EncodeUnicodeEscape` 使用 :c:func:" +"`PyUnicode_AsUnicodeEscapeString`" #: ../../whatsnew/3.3.rst:2315 msgid "" -":c:func:`PyUnicode_EncodeRawUnicodeEscape` use :c:func:" +":c:func:`!PyUnicode_EncodeRawUnicodeEscape` use :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" msgstr "" +":c:func:`!PyUnicode_EncodeRawUnicodeEscape` 使用 :c:func:" +"`PyUnicode_AsRawUnicodeEscapeString`" #: ../../whatsnew/3.3.rst:2317 msgid "" -":c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" -msgstr ":c:func:`PyUnicode_EncodeLatin1`:使用 :c:func:`PyUnicode_AsLatin1String`" +":c:func:`!PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" +msgstr "" +":c:func:`!PyUnicode_EncodeLatin1`: 使用 :c:func:`PyUnicode_AsLatin1String`" #: ../../whatsnew/3.3.rst:2318 -msgid ":c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" -msgstr ":c:func:`PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" +msgid ":c:func:`!PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" +msgstr "" +":c:func:`!PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" #: ../../whatsnew/3.3.rst:2319 -msgid ":c:func:`PyUnicode_EncodeCharmap`" -msgstr ":c:func:`PyUnicode_EncodeCharmap`" +msgid ":c:func:`!PyUnicode_EncodeCharmap`" +msgstr ":c:func:`!PyUnicode_EncodeCharmap`" #: ../../whatsnew/3.3.rst:2320 -msgid ":c:func:`PyUnicode_TranslateCharmap`" -msgstr ":c:func:`PyUnicode_TranslateCharmap`" +msgid ":c:func:`!PyUnicode_TranslateCharmap`" +msgstr ":c:func:`!PyUnicode_TranslateCharmap`" #: ../../whatsnew/3.3.rst:2321 msgid "" -":c:func:`PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" +":c:func:`!PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" "func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)" msgstr "" +":c:func:`!PyUnicode_EncodeMBCS`:使用 :c:func:`PyUnicode_AsMBCSString` 或 :c:" +"func:`PyUnicode_EncodeCodePage` (帶有 ``CP_ACP`` code_page)" #: ../../whatsnew/3.3.rst:2323 msgid "" -":c:func:`PyUnicode_EncodeDecimal`, :c:func:" -"`PyUnicode_TransformDecimalToASCII`" +":c:func:`!PyUnicode_EncodeDecimal`, :c:func:`!" +"PyUnicode_TransformDecimalToASCII`" msgstr "" -":c:func:`PyUnicode_EncodeDecimal`、:c:func:" -"`PyUnicode_TransformDecimalToASCII`" +":c:func:`!PyUnicode_EncodeDecimal`、:c:func:`!" +"PyUnicode_TransformDecimalToASCII`" #: ../../whatsnew/3.3.rst:2328 msgid "Deprecated features" -msgstr "" +msgstr "已棄用的功能" #: ../../whatsnew/3.3.rst:2330 msgid "" @@ -3568,17 +3647,17 @@ msgstr "" #: ../../whatsnew/3.3.rst:2335 msgid "Porting to Python 3.3" -msgstr "" +msgstr "移植到 Python 3.3" #: ../../whatsnew/3.3.rst:2337 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." -msgstr "" +msgstr "本節列出了前面描述的更改以及可能需要你更改程式碼的其他錯誤修復。" #: ../../whatsnew/3.3.rst:2343 msgid "Porting Python code" -msgstr "" +msgstr "移植 Python 程式碼" #: ../../whatsnew/3.3.rst:2345 msgid "" @@ -3711,16 +3790,18 @@ msgid "" "The ``strict`` argument to :class:`email.parser.Parser`, deprecated since " "Python 2.4, has finally been removed." msgstr "" +"自 Python 2.4 以來已棄用的 :class:`email.parser.Parser` 的 ``strict`` 引數終" +"於被刪除了。" #: ../../whatsnew/3.3.rst:2431 msgid "" "The deprecated method ``unittest.TestCase.assertSameElements`` has been " "removed." -msgstr "" +msgstr "已棄用的方法 ``unittest.TestCase.assertSameElements`` 已被刪除。" #: ../../whatsnew/3.3.rst:2434 msgid "The deprecated variable ``time.accept2dyear`` has been removed." -msgstr "" +msgstr "已棄用的變數 ``time.accept2dyear`` 已被刪除。" #: ../../whatsnew/3.3.rst:2436 msgid "" @@ -3770,9 +3851,9 @@ msgstr "" #: ../../whatsnew/3.3.rst:2464 msgid "" -"In the course of changes to the buffer API the undocumented :c:member:" -"`~Py_buffer.smalltable` member of the :c:type:`Py_buffer` structure has been " -"removed and the layout of the :c:type:`PyMemoryViewObject` has changed." +"In the course of changes to the buffer API the undocumented :c:member:`!" +"smalltable` member of the :c:type:`Py_buffer` structure has been removed and " +"the layout of the :c:type:`PyMemoryViewObject` has changed." msgstr "" #: ../../whatsnew/3.3.rst:2469 @@ -3801,7 +3882,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2484 msgid ":c:func:`PyImport_GetMagicNumber` now returns ``-1`` upon failure." -msgstr "" +msgstr ":c:func:`PyImport_GetMagicNumber` 現在在失敗時回傳 ``-1``。" #: ../../whatsnew/3.3.rst:2486 msgid "" @@ -3831,7 +3912,7 @@ msgstr "(於 :issue:`14040` 中實作。)" #: ../../whatsnew/3.3.rst:2507 msgid "Command Line Switch Changes" -msgstr "" +msgstr "命令列開關更改" #: ../../whatsnew/3.3.rst:2509 msgid "" @@ -3862,3 +3943,10 @@ msgstr "yield" #: ../../whatsnew/3.3.rst:396 msgid "yield from (in What's New)" msgstr "yield from(在有什麼新功能中)" + +#~ msgid "" +#~ "The :class:`~socket.socket` class now supports the PF_CAN protocol family " +#~ "(https://en.wikipedia.org/wiki/Socketcan), on Linux ." +#~ msgstr "" +#~ "~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) 上的 " +#~ "PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 4ebf6aad9c..d09d5e9665 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -3280,10 +3280,9 @@ msgstr "C API 中的改動" #: ../../whatsnew/3.5.rst:2515 msgid "" -"The undocumented :c:member:`~PyMemoryViewObject.format` member of the (non-" -"public) :c:type:`PyMemoryViewObject` structure has been removed. All " -"extensions relying on the relevant parts in ``memoryobject.h`` must be " -"rebuilt." +"The undocumented :c:member:`!format` member of the (non-public) :c:type:" +"`PyMemoryViewObject` structure has been removed. All extensions relying on " +"the relevant parts in ``memoryobject.h`` must be rebuilt." msgstr "" #: ../../whatsnew/3.5.rst:2520 @@ -3294,7 +3293,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2523 msgid "" -"Removed non-documented macro :c:macro:`PyObject_REPR` which leaked " +"Removed non-documented macro :c:macro:`!PyObject_REPR()` which leaked " "references. Use format character ``%R`` in :c:func:`PyUnicode_FromFormat`-" "like functions to format the :func:`repr` of the object. (Contributed by " "Serhiy Storchaka in :issue:`22453`.)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index ff85eacb82..722a05f71c 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2683,9 +2683,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:2069 msgid "" -"Undocumented functions :c:func:`PyUnicode_AsEncodedObject`, :c:func:" -"`PyUnicode_AsDecodedObject`, :c:func:`PyUnicode_AsEncodedUnicode` and :c:" -"func:`PyUnicode_AsDecodedUnicode` are deprecated now. Use the :ref:`generic " +"Undocumented functions :c:func:`!PyUnicode_AsEncodedObject`, :c:func:`!" +"PyUnicode_AsDecodedObject`, :c:func:`!PyUnicode_AsEncodedUnicode` and :c:" +"func:`!PyUnicode_AsDecodedUnicode` are deprecated now. Use the :ref:`generic " "codec based API ` instead." msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index c950b96b9c..876384f4a2 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -488,7 +488,8 @@ msgid "" "(Contributed by Jeroen Demeyer, Mark Shannon and Petr Viktorin in :issue:" "`36974`.)" msgstr "" -"(由 Jeroen Demeyer、Mark Shannon 和 Petr Viktorin 在 :issue:`36974` 中貢獻。)" +"(由 Jeroen Demeyer、Mark Shannon 和 Petr Viktorin 在 :issue:`36974` 中貢" +"獻。)" #: ../../whatsnew/3.8.rst:369 msgid "Pickle protocol 5 with out-of-band data buffers" @@ -1195,8 +1196,8 @@ msgid "" "(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond " "Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.)" msgstr "" -"(由 Yash Aggarwal、Keller Fuchs、Serhiy Storchaka 和 Raymond Hettinger 在 " -":issue:`37128`、:issue:`37178` 和 :issue:`35431` 中貢獻。)" +"(由 Yash Aggarwal、Keller Fuchs、Serhiy Storchaka 和 Raymond Hettinger 在 :" +"issue:`37128`、:issue:`37178` 和 :issue:`35431` 中貢獻。)" #: ../../whatsnew/3.8.rst:985 msgid "" @@ -1965,8 +1966,8 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" -"(由 Victor Stinner 在 :issue:`35134` 和 :issue:`35081` 中貢獻,該工作由 Eric Snow 在 Python " -"3.7 中發起。)" +"(由 Victor Stinner 在 :issue:`35134` 和 :issue:`35081` 中貢獻,該工作由 " +"Eric Snow 在 Python 3.7 中發起。)" #: ../../whatsnew/3.8.rst:1570 msgid "" @@ -1989,8 +1990,8 @@ msgstr ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" #: ../../whatsnew/3.8.rst:1577 msgid "" -"Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" -"`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" +"Private functions: :c:func:`!_PyObject_GC_TRACK`, :c:func:`!" +"_PyObject_GC_UNTRACK`, :c:func:`!_Py_Dealloc`" msgstr "" #: ../../whatsnew/3.8.rst:1580 @@ -1999,9 +2000,9 @@ msgstr "(由 Victor Stinner 在 :issue:`35059` 中貢獻。)" #: ../../whatsnew/3.8.rst:1582 msgid "" -"The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` functions have " -"been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were " -"excluded from the limited API (stable ABI), and were not documented. " +"The :c:func:`!PyByteArray_Init` and :c:func:`!PyByteArray_Fini` functions " +"have been removed. They did nothing since Python 2.7.4 and Python 3.2.0, " +"were excluded from the limited API (stable ABI), and were not documented. " "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" @@ -2070,7 +2071,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1631 msgid "" -":c:func:`Py_SetPath` now sets :data:`sys.executable` to the program full " +":c:func:`!Py_SetPath` now sets :data:`sys.executable` to the program full " "path (:c:func:`Py_GetProgramFullPath`) rather than to the program name (:c:" "func:`Py_GetProgramName`). (Contributed by Victor Stinner in :issue:`38234`.)" msgstr "" @@ -2407,11 +2408,11 @@ msgstr "" #: ../../whatsnew/3.8.rst:1848 msgid "" -":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " +":c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " "making them consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`. If this behavior is " -"not desired, guard the call by checking :c:func:`_Py_IsFinalizing` or :func:" +"not desired, guard the call by checking :c:func:`!_Py_IsFinalizing` or :func:" "`sys.is_finalizing`. (Contributed by Joannah Nanjekye in :issue:`36475`.)" msgstr "" @@ -2641,8 +2642,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:2024 msgid "" -"The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " -"It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " +"The :c:func:`!PyEval_ReInitThreads` function has been removed from the C " +"API. It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" @@ -2744,8 +2745,9 @@ msgstr "(由 Antoine Pitrou 在 :issue:`32388` 中貢獻。)" #: ../../whatsnew/3.8.rst:2124 msgid "" -"The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " -"accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." +"The functions :c:func:`!PyNode_AddChild` and :c:func:`!PyParser_AddToken` " +"now accept two additional ``int`` arguments *end_lineno* and " +"*end_col_offset*." msgstr "" #: ../../whatsnew/3.8.rst:2127 @@ -2796,8 +2798,8 @@ msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -"(由 Mark Shannon、Antoine Pitrou 和 Serhiy Storchaka 在 :issue:`17611` " -"中貢獻。)" +"(由 Mark Shannon、Antoine Pitrou 和 Serhiy Storchaka 在 :issue:`17611` 中貢" +"獻。)" #: ../../whatsnew/3.8.rst:2164 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 35ad207120..05e821457f 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1242,9 +1242,9 @@ msgstr "" #: ../../whatsnew/3.9.rst:873 msgid "" -"The Public C API functions :c:func:`PyParser_SimpleParseStringFlags`, :c:" -"func:`PyParser_SimpleParseStringFlagsFilename`, :c:func:" -"`PyParser_SimpleParseFileFlags` and :c:func:`PyNode_Compile` are deprecated " +"The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" +"func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" +"PyParser_SimpleParseFileFlags` and :c:func:`!PyNode_Compile` are deprecated " "and will be removed in Python 3.10 together with the old parser." msgstr "" @@ -1326,11 +1326,11 @@ msgstr "" #: ../../whatsnew/3.9.rst:926 msgid "" -"The :c:func:`PyEval_InitThreads` and :c:func:`PyEval_ThreadsInitialized` " +"The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" -"func:`PyEval_InitThreads` now does nothing. The :term:`GIL` is initialized " -"by :c:func:`Py_Initialize()` since Python 3.7. (Contributed by Victor " -"Stinner in :issue:`39877`.)" +"func:`!PyEval_InitThreads` now does nothing. The :term:`GIL` is initialized " +"by :c:func:`Py_Initialize` since Python 3.7. (Contributed by Victor Stinner " +"in :issue:`39877`.)" msgstr "" #: ../../whatsnew/3.9.rst:932 @@ -1962,8 +1962,8 @@ msgstr "" #: ../../whatsnew/3.9.rst:1372 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" -"func:`PyUnicode_FromUnicode`, :c:func:`PyUnicode_AsUnicode`, " -"``_PyUnicode_AsUnicode``, and :c:func:`PyUnicode_AsUnicodeAndSize` are " +"func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " +"``_PyUnicode_AsUnicode``, and :c:func:`!PyUnicode_AsUnicodeAndSize` are " "marked as deprecated in C. They have been deprecated by :pep:`393` since " "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" From b6af7d9002e86ebabb377bcaa7a4f7c24bf9f66a Mon Sep 17 00:00:00 2001 From: Hsiang-Jen Li <71996166+hsiangjenli@users.noreply.github.com> Date: Mon, 28 Aug 2023 03:15:40 +0800 Subject: [PATCH 054/105] trans: how venv work (#609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * trans: venv * feat: trans venv * feat: trans venv * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang * trans: format * fix: ``#!`` to \"shebang\" * fix: 修正語句、標點符號 * fix: 修正語句 * chore(library/venv): format with powrap * fix(library/venv): fix incorrect translation --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/venv.po | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/library/venv.po b/library/venv.po index 8fab2532c7..a2c1384326 100644 --- a/library/venv.po +++ b/library/venv.po @@ -238,6 +238,11 @@ msgid "" "activation script is platform-specific (:samp:`{}` must be replaced by " "the path to the directory containing the virtual environment):" msgstr "" +"虛擬環境可以透過位於二進位檔案目錄中的腳本「啟用」(在 POSIX 上為 ``bin``;" +"在 Windows 上為 ``Scripts``)這會將該目錄加入到你的 :envvar:`PATH`,當你運" +"行 :program:`python` 時就會調用該環境的直譯器並且執行已安裝的腳本,而不需要使" +"用完整的路徑。啟動腳本的方式因平台而異(:samp:`{}` 需要替換成包含虛擬環" +"境的目錄路徑)" #: ../../library/venv.rst:71 msgid "Platform" @@ -245,11 +250,11 @@ msgstr "平台" #: ../../library/venv.rst:71 msgid "Shell" -msgstr "" +msgstr "Shell" #: ../../library/venv.rst:71 msgid "Command to activate virtual environment" -msgstr "" +msgstr "啟動虛擬環境的指令" #: ../../library/venv.rst:73 msgid "POSIX" @@ -305,13 +310,13 @@ msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" #: ../../library/venv.rst:86 msgid ":program:`fish` and :program:`csh` activation scripts." -msgstr "" +msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" #: ../../library/venv.rst:89 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." -msgstr "" +msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" #: ../../library/venv.rst:93 msgid "" @@ -320,6 +325,9 @@ msgid "" "invoking Python. Furthermore, all scripts installed in the environment " "should be runnable without activating it." msgstr "" +"你不用特別開啟虛擬環境,你可以在調用 Python 時指定該環境下 Python 直譯器的完" +"整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" +"行。" #: ../../library/venv.rst:99 msgid "" @@ -332,6 +340,12 @@ msgid "" "window should run it with the correct interpreter without the environment " "needing to be activated or on the :envvar:`PATH`." msgstr "" +"為了實現這一點,安裝在虛擬環境中的腳本會有一個 \"shebang\" 列,此列指向該環境" +"的 Python 直譯器,例如: :samp:`#!/{}/bin/python`。這代表無論 :" +"envvar:`PATH` 的值為何,該腳本都會在直譯器上運行。在 Windows 上,如果你安裝" +"了 :ref:`launcher`,則支援 \"shebang\" 列處理。因此,在 Windows 檔案總管" +"(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :" +"envvar:`PATH` 的情況下正確地運行。" #: ../../library/venv.rst:108 msgid "" @@ -341,6 +355,9 @@ msgid "" "VIRTUAL_ENV` cannot be relied upon to determine whether a virtual " "environment is being used." msgstr "" +"當虛擬環境被啟用時,:envvar:`!VIRTUAL_ENV` 環境變數會被設置為該環境的路徑。由" +"於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" +"判斷是否正在使用虛擬環境。" #: ../../library/venv.rst:114 msgid "" @@ -357,6 +374,13 @@ msgid "" "directory of it, you should recreate the environment in its new location. " "Otherwise, software installed into the environment may not work as expected." msgstr "" +"因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" +"環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt``" +"的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所" +"需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重" +"新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新" +"位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" #: ../../library/venv.rst:128 msgid "" @@ -364,6 +388,8 @@ msgid "" "shell. The exact mechanism is platform-specific and is an internal " "implementation detail (typically, a script or shell function will be used)." msgstr "" +"你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," +"是內部實作的細節(通常會使用腳本或是 shell 函式)" #: ../../library/venv.rst:136 msgid "API" From 78f3579d414e4990ac2e4c98c3dc25d4b0b6a5e3 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 28 Aug 2023 03:44:57 +0800 Subject: [PATCH 055/105] chore(tutorial): resolve fuzzy entries --- library/venv.po | 2 +- tutorial/controlflow.po | 57 +++++++++++---------- tutorial/errors.po | 105 ++++++++++++-------------------------- tutorial/floatingpoint.po | 31 +++++------ tutorial/modules.po | 27 ++++++---- tutorial/stdlib.po | 30 +++++------ whatsnew/3.3.po | 2 +- 7 files changed, 112 insertions(+), 142 deletions(-) diff --git a/library/venv.po b/library/venv.po index a2c1384326..24fac4e9c1 100644 --- a/library/venv.po +++ b/library/venv.po @@ -376,7 +376,7 @@ msgid "" msgstr "" "因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" "環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" -"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt``" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt`` " "的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所" "需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重" "新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 0b8dd67511..70a87a9db4 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -214,24 +214,27 @@ msgid "" "In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " "loop reaches its final iteration." msgstr "" +"在 :keyword:`for` 迴圈中,:keyword:`!else` 子句會在迴圈到達最終的疊代後執行。" #: ../../tutorial/controlflow.rst:174 msgid "" "In a :keyword:`while` loop, it's executed after the loop's condition becomes " "false." -msgstr "" +msgstr "在 :keyword:`while` 迴圈中,它會在迴圈條件變為 false 後執行。" #: ../../tutorial/controlflow.rst:176 msgid "" "In either kind of loop, the :keyword:`!else` clause is **not** executed if " "the loop was terminated by a :keyword:`break`." msgstr "" +"在任何一種迴圈中,如果迴圈由 :keyword:`break` 終止,則不會執行 :keyword:`!" +"else` 子句。" #: ../../tutorial/controlflow.rst:179 msgid "" "This is exemplified in the following :keyword:`!for` loop, which searches " "for prime numbers::" -msgstr "" +msgstr "下面的 :keyword:`!for` 迴圈對此進行了舉例說明,該迴圈用以搜索質數: ::" #: ../../tutorial/controlflow.rst:200 msgid "" @@ -254,7 +257,7 @@ msgstr "" "keyword:`try` 陳述式中的 ``else`` 子句更為相似::keyword:`try` 陳述式的 " "``else`` 子句在沒有發生例外 (exception) 時執行,而迴圈的 ``else`` 子句在沒有" "任何 ``break`` 發生時執行。更多有關 :keyword:`!try` 陳述式和例外的介紹,見" -"\\ :ref:`tut-handling`\\ 。" +"\\ :ref:`tut-handling`。" #: ../../tutorial/controlflow.rst:210 msgid "" @@ -294,7 +297,7 @@ msgid "" "ignored::" msgstr "" ":keyword:`pass` 亦可作為一個函式或條件判斷主體的預留位置,在你撰寫新的程式碼" -"時讓你保持在更抽象的思維層次。\\ :keyword:`!pass` 會直接被忽略:\n" +"時讓你保持在更抽象的思維層次。:keyword:`!pass` 會直接被忽略:\n" "\n" "::" @@ -363,8 +366,8 @@ msgid "" msgstr "" "請仔細研究那個例子!第一個模式有兩個字面值,可以想作是之前所述的字面值模式的" "延伸。但是接下來的兩個模式結合了一個字面值和一個變數,且該變數\\ *繫結 " -"(bind)*\\ 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在" -"概念上類似於拆解賦值 ``(x, y) = point``。" +"(bind)* 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在概" +"念上類似於拆解賦值 ``(x, y) = point``。" #: ../../tutorial/controlflow.rst:312 msgid "" @@ -451,10 +454,10 @@ msgid "" "also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items " "without binding the remaining items." msgstr "" -"序列模式 (sequence pattern) 可支援擴充拆解 (extended unpacking):\\ ``[x, y, " -"*rest]`` 與 ``(x, y, *rest)`` 的作用類似於拆解賦值。\\ ``*`` 後面的名稱也可以" -"是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" -"的其餘項。" +"序列模式 (sequence pattern) 可支援擴充拆解 (extended unpacking):``[x, y, " +"*rest]`` 與 ``(x, y, *rest)`` 的作用類似於拆解賦值。``*`` 後面的名稱也可以是 " +"``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外的其" +"餘項。" #: ../../tutorial/controlflow.rst:394 msgid "" @@ -463,10 +466,10 @@ msgid "" "sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " "also supported. (But ``**_`` would be redundant, so it is not allowed.)" msgstr "" -"映射模式 (mapping pattern):\\ ``{\"bandwidth\": b, \"latency\": l}`` 能從一" -"個 dictionary(字典)中擷取 ``\"bandwidth\"`` 及 ``\"latency\"`` 的值。與序列" -"模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" -"援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" +"映射模式 (mapping pattern):``{\"bandwidth\": b, \"latency\": l}`` 能從一個 " +"dictionary(字典)中擷取 ``\"bandwidth\"`` 及 ``\"latency\"`` 的值。與序列模" +"式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支援" +"的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" #: ../../tutorial/controlflow.rst:399 msgid "Subpatterns may be captured using the ``as`` keyword::" @@ -489,7 +492,7 @@ msgid "" "``False`` and ``None`` are compared by identity." msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " -"``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" +"``True``、``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" #: ../../tutorial/controlflow.rst:409 msgid "" @@ -542,7 +545,7 @@ msgid "" "write, so make a habit of it." msgstr "" "一個函式的第一個陳述式可以是一個字串文本;該字串文本被視為該函式的說明文件字" -"串,即 :dfn:`docstring`\\ 。(關於 docstring 的細節請參見\\ :ref:`tut-" +"串,即 :dfn:`docstring`。(關於 docstring 的細節請參見\\ :ref:`tut-" "docstrings`\\ 段落。)有些工具可以使用 docstring 來自動產生線上或可列印的文" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" @@ -633,8 +636,8 @@ msgid "" "off the end of a function also returns ``None``." msgstr "" ":keyword:`return` 陳述式會讓一個函式回傳一個值。單獨使用 :keyword:`!return` " -"不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " -"``None``\\ 。" +"不外加一個運算式作為引數時會回傳 ``None``。一個函式執行到結束也會回傳 " +"``None``。" #: ../../tutorial/controlflow.rst:530 msgid "" @@ -651,7 +654,7 @@ msgid "" "efficient." msgstr "" "``result.append(a)`` 陳述式呼叫了一個 list 物件 ``result`` 的 *method(方法)" -"*\\ 。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``,其中 " +"*。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``,其中 " "``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," "並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" "有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" @@ -692,21 +695,21 @@ msgstr "該函式可以用以下幾種方式被呼叫:" #: ../../tutorial/controlflow.rst:574 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" -msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" +msgstr "只給必要引數:``ask_ok('Do you really want to quit?')``" #: ../../tutorial/controlflow.rst:576 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" -msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" +msgstr "給予一個選擇性引數:``ask_ok('OK to overwrite the file?', 2)``" #: ../../tutorial/controlflow.rst:578 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" msgstr "" -"給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " -"or no!')``" +"給予所有引數:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or " +"no!')``" #: ../../tutorial/controlflow.rst:581 msgid "" @@ -989,8 +992,8 @@ msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" msgstr "" -"呼叫該函式不可能回傳 ``True``\\ ,因為關鍵字 ``'name'`` 永遠是連結在第一個參" -"數。例如:\n" +"呼叫該函式不可能回傳 ``True``,因為關鍵字 ``'name'`` 永遠是連結在第一個參數。" +"例如:\n" "\n" "::" @@ -1313,8 +1316,8 @@ msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." msgstr "" -"運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " -"4)``\\ 。" +"運算子前後、逗號後要加空格,但不要直接放在括號內側:``a = f(1, 2) + g(3, " +"4)``。" #: ../../tutorial/controlflow.rst:1108 msgid "" diff --git a/tutorial/errors.po b/tutorial/errors.po index 9d343be225..4b96e3e6cc 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -33,8 +33,8 @@ msgid "" "two distinguishable kinds of errors: *syntax errors* and *exceptions*." msgstr "" "到目前為止還沒有提到錯誤訊息,但如果你嘗試運行範例,你可能會發現一些錯誤訊" -"息。常見的(至少)兩種不同的錯誤類別為:\\ *語法錯誤 (syntax error)* 和\\ *例" -"外 (exception)*\\ 。" +"息。常見的(至少)兩種不同的錯誤類別為:*語法錯誤 (syntax error)* 和\\ *例外 " +"(exception)*。" #: ../../tutorial/errors.rst:15 msgid "Syntax Errors" @@ -61,9 +61,9 @@ msgid "" msgstr "" "剖析器 (parser) 會重複犯錯的那一行,並用一個小「箭頭」指向該行檢測到的第一個" "錯誤點。錯誤是由箭頭\\ *之前*\\ 的標記 (token) 導致的(或至少是在這裡檢測到" -"的):此例中,錯誤是在 :func:`print` 函式中被檢測到,因為在它前面少了一個冒號" -"(\\ ``':'``)。檔案名稱和行號會被印出來,所以如果訊息是來自腳本時,就可以知" -"道去哪裡找問題。" +"的):此例中,錯誤是在 :func:`print` 函式中被檢測到,因為在它前面少了一個冒" +"號 (``':'``)。檔案名稱和行號會被印出來,所以如果訊息是來自腳本時,就可以知道" +"去哪裡找問題。" #: ../../tutorial/errors.rst:37 msgid "Exceptions" @@ -96,11 +96,11 @@ msgid "" "keywords)." msgstr "" "錯誤訊息的最後一行指示發生了什麼事。例外有不同的類型,而類型名稱會作為訊息的" -"一部份被印出。範例中的例外類型為:\\ :exc:`ZeroDivisionError`\\ 、\\ :exc:" -"`NameError` 和 :exc:`TypeError`\\ 。作為例外類型被印出的字串,就是發生的內建" -"例外 (built-in exception) 的名稱。所有的內建例外都是如此運作,但對於使用者自" -"定的例外則不一定需要遵守(雖然這是一個有用的慣例)。標準例外名稱是內建的識別" -"字 (identifier),不是保留關鍵字 (reserved keyword)。" +"一部份被印出。範例中的例外類型為::exc:`ZeroDivisionError`、:exc:`NameError` " +"和 :exc:`TypeError`。作為例外類型被印出的字串,就是發生的內建例外 (built-in " +"exception) 的名稱。所有的內建例外都是如此運作,但對於使用者自定的例外則不一定" +"需要遵守(雖然這是一個有用的慣例)。標準例外名稱是內建的識別字 (identifier)," +"不是保留關鍵字 (reserved keyword)。" #: ../../tutorial/errors.rst:66 msgid "" @@ -161,7 +161,7 @@ msgid "" "If no exception occurs, the *except clause* is skipped and execution of the :" "keyword:`try` statement is finished." msgstr "" -"如果沒有發生例外,則 *except 子句*\\ 會被跳過,\\ :keyword:`try` 陳述式執行完" +"如果沒有發生例外,則 *except 子句*\\ 會被跳過,:keyword:`try` 陳述式執行完" "畢。" #: ../../tutorial/errors.rst:104 @@ -182,9 +182,9 @@ msgid "" "handler is found, it is an *unhandled exception* and execution stops with a " "message as shown above." msgstr "" -"如果發生的例外未符合 *except 子句*\\ 中的例外名稱,則將其傳遞到外層的 :" -"keyword:`try` 陳述式;如果仍無法找到處理者,則它是一個\\ *未處理例外 " -"(unhandled exception)*\\ ,執行將停止,並顯示如上所示的訊息。" +"如果發生的例外未符合 *except 子句* 中的例外名稱,則將其傳遞到外層的 :keyword:" +"`try` 陳述式;如果仍無法找到處理者,則它是一個\\ *未處理例外 (unhandled " +"exception)*,執行將停止,並顯示如上所示的訊息。" #: ../../tutorial/errors.rst:114 msgid "" @@ -195,10 +195,10 @@ msgid "" "An *except clause* may name multiple exceptions as a parenthesized tuple, " "for example::" msgstr "" -":keyword:`try` 陳述式可以有不只一個 *except 子句*\\ ,為不同的例外指定處理" -"者,而最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而" -"不會處理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句" -"*\\ 可以用一組括號內的 tuple 列舉多個例外,例如:\n" +":keyword:`try` 陳述式可以有不只一個 *except 子句*,為不同的例外指定處理者,而" +"最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而不會處" +"理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*\\ 可以" +"用一組括號內的 tuple 列舉多個例外,例如:\n" "\n" "::" @@ -244,7 +244,7 @@ msgid "" msgstr "" "*except 子句*\\ 可以在例外名稱後面指定一個變數。這個變數被綁定到一個例外實例 " "(instance),其引數通常儲存在 ``args`` 屬性中。為了方便,內建例外型別定義了 :" -"meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``\\ :\n" +"meth:`~object.__str__` 以印出所有引數而不需顯式地取用 ``.args``:\n" "\n" "::" @@ -253,7 +253,8 @@ msgid "" "The exception's :meth:`~object.__str__` output is printed as the last part " "('detail') of the message for unhandled exceptions." msgstr "" -"例外的 :meth:`~object.__str__` 輸出會被印在未處理例外訊息的最後一部分(「細節」)。" +"例外的 :meth:`~object.__str__` 輸出會被印在未處理例外訊息的最後一部分(「細" +"節」)。" #: ../../tutorial/errors.rst:180 msgid "" @@ -300,8 +301,8 @@ msgid "" "useful for code that must be executed if the *try clause* does not raise an " "exception. For example::" msgstr "" -":keyword:`try` ... :keyword:`except` 陳述式有一個選擇性的 *else 子句*\\ ,使" -"用時,該子句必須放在所有 *except 子句*\\ 之後。如果一段程式碼必須被執行,但 " +":keyword:`try` ... :keyword:`except` 陳述式有一個選擇性的 *else 子句*,使用" +"時,該子句必須放在所有 *except 子句*\\ 之後。如果一段程式碼必須被執行,但 " "*try 子句*\\ 又沒有引發例外時,這個子句很有用。例如:\n" "\n" "::" @@ -411,7 +412,7 @@ msgstr "" #: ../../tutorial/errors.rst:345 msgid "" "For more information about chaining mechanics, see :ref:`bltin-exceptions`." -msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`\\ 。" +msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`。" #: ../../tutorial/errors.rst:351 msgid "User-defined Exceptions" @@ -503,8 +504,8 @@ msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised." msgstr "" -"如果 :keyword:`!finally` 子句執行 :keyword:`break`\\ 、\\ :keyword:" -"`continue` 或 :keyword:`return` 陳述式,則例外不會被重新引發。" +"如果 :keyword:`!finally` 子句執行 :keyword:`break`、:keyword:`continue` 或 :" +"keyword:`return` 陳述式,則例外不會被重新引發。" #: ../../tutorial/errors.rst:407 msgid "" @@ -513,9 +514,9 @@ msgid "" "will execute just prior to the :keyword:`!break`, :keyword:`!continue` or :" "keyword:`!return` statement's execution." msgstr "" -"如果 :keyword:`!try` 陳述式遇到 :keyword:`break`\\ 、\\ :keyword:`continue` " -"或 :keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" -"break`\\ 、\\ :keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" +"如果 :keyword:`!try` 陳述式遇到 :keyword:`break`、:keyword:`continue` 或 :" +"keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" +"break`、:keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" #: ../../tutorial/errors.rst:413 msgid "" @@ -549,8 +550,8 @@ msgid "" "keyword:`except` clause and therefore re-raised after the :keyword:`!" "finally` clause has been executed." msgstr "" -"如你所見,\\ :keyword:`finally` 子句在任何情況下都會被執行。兩個字串相除所引" -"發的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" +"如你所見,:keyword:`finally` 子句在任何情況下都會被執行。兩個字串相除所引發" +"的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" "finally` 子句執行後被重新引發。" #: ../../tutorial/errors.rst:460 @@ -559,8 +560,8 @@ msgid "" "releasing external resources (such as files or network connections), " "regardless of whether the use of the resource was successful." msgstr "" -"在真實應用程式中,\\ :keyword:`finally` 子句對於釋放外部資源(例如檔案或網路" -"連線)很有用,無論該資源的使用是否成功。" +"在真實應用程式中,:keyword:`finally` 子句對於釋放外部資源(例如檔案或網路連" +"線)很有用,無論該資源的使用是否成功。" #: ../../tutorial/errors.rst:468 msgid "Predefined Clean-up Actions" @@ -588,7 +589,7 @@ msgid "" "correctly. ::" msgstr "" "這段程式碼的問題在於,執行完該程式碼後,它讓檔案在一段不確定的時間內處於開啟" -"狀態。在簡單腳本中這不是問題,但對於較大的應用程式來說可能會是個問題。\\ :" +"狀態。在簡單腳本中這不是問題,但對於較大的應用程式來說可能會是個問題。:" "keyword:`with` 陳述式讓物件(例如檔案)在被使用時,能保證它們總是及時、正確地" "被清理。\n" "\n" @@ -691,41 +692,3 @@ msgstr "" "訊。在以下範例中,群組中的每個例外都有一條註解,指示此錯誤是在何時發生。\n" "\n" "::" - -#~ msgid "" -#~ "All exceptions inherit from :exc:`BaseException`, and so it can be used " -#~ "to serve as a wildcard. Use this with extreme caution, since it is easy " -#~ "to mask a real programming error in this way! It can also be used to " -#~ "print an error message and then re-raise the exception (allowing a caller " -#~ "to handle the exception as well)::" -#~ msgstr "" -#~ "所有例外繼承自 :exc:`BaseException`\\ ,以統一處理所有其他例外,但使用上要" -#~ "極其小心,因為這種方式容易遮蔽真正的程式設計錯誤!它也可用於印出錯誤訊息," -#~ "然後重新引發例外(也讓呼叫者可以處理該例外):\n" -#~ "\n" -#~ "::" - -#~ msgid "" -#~ "Alternatively the last except clause may omit the exception name(s), " -#~ "however the exception value must then be retrieved from ``sys.exc_info()" -#~ "[1]``." -#~ msgstr "" -#~ "或者讓最後一個 except 子句可以省略例外名稱,但之後例外的值必須是從 ``sys." -#~ "exc_info()[1]`` 得到的。" - -#~ msgid "" -#~ "The :keyword:`raise` statement allows an optional :keyword:`from` " -#~ "which enables chaining exceptions. For example::" -#~ msgstr "" -#~ ":keyword:`raise` 陳述式容許一個選擇性的 :keyword:`from`\\ ,它透過" -#~ "被引發例外中的 ``__cause__`` 屬性的設定,來啟用例外鏈接。例如:\n" -#~ "\n" -#~ "::" - -#~ msgid "" -#~ "Exception chaining happens automatically when an exception is raised " -#~ "inside an :keyword:`except` or :keyword:`finally` section. This can be " -#~ "disabled by using ``from None`` idiom:" -#~ msgstr "" -#~ "當例外是在一個 :keyword:`except` 或 :keyword:`finally` 段落的內部被引發" -#~ "時,例外鏈接會自動發生。要使其停止作用,可以使用慣用語 ``from None``:" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index b9f25ddaf9..fdd9c5324d 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -188,7 +188,7 @@ msgid "" "simply rounding the *display* of the true machine value." msgstr "" "要了解一件很重要的事,在真正意義上,浮點數的表示是一種幻覺:你基本上在捨入真" -"正機器數值所\\ *展示的值*\\ 。" +"正機器數值所\\ *展示的值*。" #: ../../tutorial/floatingpoint.rst:114 msgid "" @@ -212,7 +212,8 @@ msgid "" "Though the numbers cannot be made closer to their intended exact values, " "the :func:`math.isclose` function can be useful for comparing inexact values:" msgstr "" -"雖然數字不會再更接近他們的精準數值,但 :func:`math.isclose` 函式可以用來比較不精確的值:\n" +"雖然數字不會再更接近他們的精準數值,但 :func:`math.isclose` 函式可以用來比較" +"不精確的值:\n" "\n" "::" @@ -220,7 +221,7 @@ msgstr "" msgid "" "Alternatively, the :func:`round` function can be used to compare rough " "approximations::" -msgstr "" +msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值: ::" #: ../../tutorial/floatingpoint.rst:147 msgid "" @@ -265,9 +266,9 @@ msgid "" "`str.format` method's format specifiers in :ref:`formatstrings`." msgstr "" "雖然浮點運算確實存在一些問題,但在一般情況下,如果你只是把最終結果的顯示值," -"以十進位方式捨入至預期的位數,那麼仍會得到你預期的結果。\\ :func:`str` 通常就" -"能滿足要求,而若想要更細緻的控制,可參閱\\ :ref:`formatstrings`\\ 中關於 :" -"meth:`str.format` method(方法)的格式規範。" +"以十進位方式捨入至預期的位數,那麼仍會得到你預期的結果。:func:`str` 通常就能" +"滿足要求,而若想要更細緻的控制,可參閱\\ :ref:`formatstrings`\\ 中關於 :meth:" +"`str.format` method(方法)的格式規範。" #: ../../tutorial/floatingpoint.rst:169 msgid "" @@ -304,15 +305,14 @@ msgid "" "as_integer_ratio` method expresses the value of a float as a fraction:" msgstr "" "在罕見情況下,當你\\ *真的*\\ 想知道一個 float 的精準值,Python 提供的工具可" -"協助達成。\\ :meth:`float.as_integer_ratio` method 可將一個 float 的值表示為" -"分數:" +"協助達成。:meth:`float.as_integer_ratio` method 可將一個 float 的值表示為分" +"數:" #: ../../tutorial/floatingpoint.rst:192 msgid "" "Since the ratio is exact, it can be used to losslessly recreate the original " "value:" -msgstr "" -"由於該比率是精準的,它可無損地再現該原始值:" +msgstr "由於該比率是精準的,它可無損地再現該原始值:" #: ../../tutorial/floatingpoint.rst:200 msgid "" @@ -339,7 +339,6 @@ msgstr "" "於系統平台),並與支援相同格式的其他語言(如 JAVA 和 C99)交換資料。" #: ../../tutorial/floatingpoint.rst:220 -#, fuzzy msgid "" "Another helpful tool is the :func:`sum` function which helps mitigate loss-" "of-precision during summation. It uses extended precision for intermediate " @@ -347,10 +346,9 @@ msgid "" "difference in overall accuracy so that the errors do not accumulate to the " "point where they affect the final total:" msgstr "" -"另一個有用的工具是 :func:`math.fsum` 函式,能在計算總和時幫忙減少精確度的損" -"失。當數值被加到運行中的總計值時,它會追蹤「失去的位數 (lost digits)」。這可" -"以明顯改善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的" -"程度:" +"另一個有用的工具是 :func:`sum` 函式,能在計算總和時幫忙減少精確度的損失。當數" +"值被加到運行中的總計值時,它會追蹤「失去的位數 (lost digits)」。這可以明顯改" +"善總體準確度 (overall accuracy),使得誤差不至於累積到影響最終總計值的程度:" #: ../../tutorial/floatingpoint.rst:233 msgid "" @@ -360,6 +358,9 @@ msgid "" "in uncommon cases where large magnitude inputs mostly cancel each other out " "leaving a final sum near zero:" msgstr "" +":func:`math.fsum()` 更進一步將數值被加到運行總計中的總計時追蹤所有「失去的位" +"數」,以便結果僅有一次捨入。這比 :func:`sum` 慢,但在不常見的情況下會更準確," +"在這種情況下,大量輸入大多相互抵消,最終的總和會接近於零:" #: ../../tutorial/floatingpoint.rst:260 msgid "Representation Error" diff --git a/tutorial/modules.po b/tutorial/modules.po index fa8bfdde9f..599045b9da 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -40,9 +40,9 @@ msgid "" msgstr "" "如果從 Python 直譯器離開後又再次進入,之前(幫函式或變數)做的定義都會消失。" "因此,想要寫一些比較長的程式時,你最好使用編輯器來準備要輸入給直譯器的內容," -"並且用該檔案來運行它。這就是一個\\ *腳本 (script)*\\ 。隨著你的程式越變越長," -"你可能會想要把它分開成幾個檔案,讓它比較好維護。你可能也會想用一個你之前已經" -"在其他程式寫好的函式,但不想要複製該函式的原始定義到所有使用它的程式裡。" +"並且用該檔案來運行它。這就是一個\\ *腳本 (script)*。隨著你的程式越變越長,你" +"可能會想要把它分開成幾個檔案,讓它比較好維護。你可能也會想用一個你之前已經在" +"其他程式寫好的函式,但不想要複製該函式的原始定義到所有使用它的程式裡。" #: ../../tutorial/modules.rst:16 msgid "" @@ -53,9 +53,9 @@ msgid "" "access to in a script executed at the top level and in calculator mode)." msgstr "" "為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在互動模式下的直譯器" -"中使用它們。這種檔案稱為\\ *模組 (module)*\\ ;模組中的定義可以被 *import* 到" -"其他模組中,或是被 *import* 至\\ *主 (main)* 模組(在最頂層執行的腳本,以及互" -"動模式下,所使用的變數集合)。" +"中使用它們。這種檔案稱為\\ *模組 (module)*;模組中的定義可以被 *import* 到其" +"他模組中,或是被 *import* 至\\ *主 (main)* 模組(在最頂層執行的腳本,以及互動" +"模式下,所使用的變數集合)。" #: ../../tutorial/modules.rst:22 msgid "" @@ -67,7 +67,7 @@ msgid "" "following contents::" msgstr "" "模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱加上 :file:`.py`。在" -"模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用您喜歡" +"模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用你喜歡" "的文字編輯器在資料夾中創一個名為 :file:`fibo.py` 的檔案,內容如下:\n" "\n" "::" @@ -98,7 +98,7 @@ msgstr "" msgid "" "If you intend to use a function often you can assign it to a local name::" msgstr "" -"如果您打算經常使用其中某個函式,可以將其指定至區域變數:\n" +"如果你打算經常使用其中某個函式,可以將其指定至區域變數:\n" "\n" "::" @@ -178,7 +178,7 @@ msgid "" msgstr "" "這個寫法會 import 模組中所有的名稱,除了使用底線 (``_``) 開頭的名稱。大多數情" "況下,Python 程式設計師不大使用這個功能,因為它在直譯器中引入了一組未知的名" -"稱,並且可能覆蓋了某些您已經定義的內容。" +"稱,並且可能覆蓋了某些你已經定義的內容。" #: ../../tutorial/modules.rst:112 msgid "" @@ -222,7 +222,7 @@ msgid "" "use :func:`importlib.reload`, e.g. ``import importlib; importlib." "reload(modulename)``." msgstr "" -"出於效率原因,每個模組在每個直譯器 session 中僅會被 import 一次。因此,如果您" +"出於效率原因,每個模組在每個直譯器 session 中僅會被 import 一次。因此,如果你" "更改了模組,則必須重啟直譯器——或者,如果只是一個想要在互動模式下測試的模組," "可以使用 :func:`importlib.reload`。例如:``import importlib; importlib." "reload(modulename)``。" @@ -403,7 +403,7 @@ msgstr "" "可以在 Python 指令上使用開關參數 (switch) :option:`-O` 或 :option:`-OO` 來減" "小已編譯模組的大小。開關參數 ``-O`` 刪除 assert(斷言)陳述式,而 ``-OO`` 同" "時刪除 assert 陳述式和 __doc__ 字串。由於有些程式可能依賴於上述這些內容,因此" -"只有在您知道自己在做什麼時,才應使用此參數。「已優化」模組有 ``opt-`` 標記," +"只有在你知道自己在做什麼時,才應使用此參數。「已優化」模組有 ``opt-`` 標記," "且通常較小。未來的版本可能會改變優化的效果。" #: ../../tutorial/modules.rst:251 @@ -707,6 +707,11 @@ msgid "" "submodule, because it is shadowed by the locally defined ``reverse`` " "function::" msgstr "" +"請注意,子模組可能會被區域定義 (locally defined) 的名稱遮蔽。例如,如果你在 :" +"file:`sound/effects/__init__.py` 檔案中新增了一個 ``reverse`` 函式,則 " +"``from sound.effects import *`` 只會引入兩個子模組 ``echo`` 和 ``surround``," +"但\\ *不是* ``reverse`` 子模組,因為它被區域定義的 ``reverse`` 函式遮蔽" +"了: ::" #: ../../tutorial/modules.rst:531 msgid "" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 3b58a82c21..782d7448b2 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -50,7 +50,7 @@ msgid "" "function which operates much differently." msgstr "" "務必使用 ``import os`` 而非 ``from os import *``。這將避免因系統不同而有實作" -"差異的 :func:`os.open` 覆蓋內建函式 :func:`open`\\ 。" +"差異的 :func:`os.open` 覆蓋內建函式 :func:`open`。" #: ../../tutorial/stdlib.rst:29 msgid "" @@ -67,8 +67,7 @@ msgid "" "For daily file and directory management tasks, the :mod:`shutil` module " "provides a higher level interface that is easier to use::" msgstr "" -"對於日常檔案和目錄管理任務,\\ :mod:`shutil` 模組提供了更容易使用的高階介" -"面:\n" +"對於日常檔案和目錄管理任務,:mod:`shutil` 模組提供了更容易使用的高階介面:\n" "\n" "::" @@ -104,7 +103,7 @@ msgstr "" msgid "" "Here is the output from running ``python demo.py one two three`` at the " "command line::" -msgstr "" +msgstr "以下是在命令列運行 ``python demo.py one two three`` 的輸出: ::" #: ../../tutorial/stdlib.rst:79 msgid "" @@ -254,9 +253,8 @@ msgid "" "modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:" "`zipfile` and :mod:`tarfile`. ::" msgstr "" -"常見的解壓縮以及壓縮格式都有直接支援的模組。包括:\\ :mod:`zlib`\\ 、\\ :mod:" -"`gzip`\\ 、\\ :mod:`bz2`\\ 、\\ :mod:`lzma`\\ 、\\ :mod:`zipfile` 以及 :mod:" -"`tarfile`\\ 。\n" +"常見的解壓縮以及壓縮格式都有直接支援的模組。包括::mod:`zlib`、:mod:`gzip`、:" +"mod:`bz2`、:mod:`lzma`、:mod:`zipfile` 以及 :mod:`tarfile`。\n" "\n" "::" @@ -279,7 +277,7 @@ msgid "" "feature instead of the traditional approach to swapping arguments. The :mod:" "`timeit` module quickly demonstrates a modest performance advantage::" msgstr "" -"舉例來說,有人可能會試著用 tuple 的打包機制來交換引數代替傳統的方式。\\ :mod:" +"舉例來說,有人可能會試著用 tuple 的打包機制來交換引數代替傳統的方式。:mod:" "`timeit` 模組可以迅速地展示效能的進步:\n" "\n" "::" @@ -290,7 +288,7 @@ msgid "" "and :mod:`pstats` modules provide tools for identifying time critical " "sections in larger blocks of code." msgstr "" -"相對於 :mod:`timeit` 模組提供這麼細的粒度,\\ :mod:`profile` 模組以及 :mod:" +"相對於 :mod:`timeit` 模組提供這麼細的粒度,:mod:`profile` 模組以及 :mod:" "`pstats` 模組則提供了一些在大型的程式碼識別時間使用上關鍵的區塊 (time " "critical section) 的工具。" @@ -381,11 +379,11 @@ msgid "" "these modules and packages greatly simplify data interchange between Python " "applications and other tools." msgstr "" -":mod:`json` 套件對 JSON 資料交換格式的剖析,提供強大的支援。\\ :mod:`csv` 模" -"組則提供直接讀寫 CSV(以逗號分隔值的檔案格式,通常資料庫和電子表格都有支" -"援)。\\ :mod:`xml.etree.ElementTree`\\ 、\\ :mod:`xml.dom` 與 :mod:`xml." -"sax` 套件則支援 XML 的處理。綜觀所有,這些模組和套件都簡化了 Python 應用程式" -"與其他工具之間的資料交換。" +":mod:`json` 套件對 JSON 資料交換格式的剖析,提供強大的支援。:mod:`csv` 模組則" +"提供直接讀寫 CSV(以逗號分隔值的檔案格式,通常資料庫和電子表格都有支援)。:" +"mod:`xml.etree.ElementTree`、:mod:`xml.dom` 與 :mod:`xml.sax` 套件則支援 XML " +"的處理。綜觀所有,這些模組和套件都簡化了 Python 應用程式與其他工具之間的資料" +"交換。" #: ../../tutorial/stdlib.rst:353 msgid "" @@ -401,8 +399,8 @@ msgid "" "Internationalization is supported by a number of modules including :mod:" "`gettext`, :mod:`locale`, and the :mod:`codecs` package." msgstr "" -"有數種支援國際化的模組,包括 :mod:`gettext`\\ 、\\ :mod:`locale` 和 :mod:" -"`codecs` 等套件。" +"有數種支援國際化的模組,包括 :mod:`gettext`、:mod:`locale` 和 :mod:`codecs` " +"等套件。" #: ../../tutorial/stdlib.rst:27 msgid "built-in function" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 8242c1e3d3..7ba13abbd8 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -1876,7 +1876,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1326 msgid "Decoding to unicode is done automatically::" -msgstr "解碼為 unicode 是自動完成的:: :" +msgstr "解碼為 unicode 是自動完成的: ::" #: ../../whatsnew/3.3.rst:1332 msgid "" From 3b90a373375298fad967655c422b556c969f88a9 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 29 Aug 2023 06:14:40 +0800 Subject: [PATCH 056/105] feat(library/tempfile): translate new strings from 3.12 (#626) --- library/tempfile.po | 66 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/library/tempfile.po b/library/tempfile.po index 1ab417eb37..a6b5b3d670 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -1,10 +1,9 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Adrian Liaw , 2018 -# Matt Wang , 2021-2022 +# Matt Wang , 2021-2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" @@ -74,11 +73,12 @@ msgid "" "rely on a temporary file created using this function having or not having a " "visible name in the file system." msgstr "" -"回傳一個可當作臨時儲存區域的 :term:`file-like object`。建立該檔案使用了與 :" -"func:`mkstemp` 相同的安全規則。它將在關閉(包括當物件被垃圾回收 (garbage " -"collect) 時的隱式關閉)後立即銷毀。在 Unix 下,該檔案所在的目錄可能根本不被建" -"立、或者在建立檔案後立即就被刪除,其他平臺不支援此功能;你的程式不應依賴使用" -"此功能建立的臨時檔案名稱,因為它在檔案系統中的名稱有可能是不可見的。" +"回傳一個可當作臨時儲存區域的\\ :term:`類檔案物件 `。建立該" +"檔案使用了與 :func:`mkstemp` 相同的安全規則。它將在關閉(包括當物件被垃圾回" +"收 (garbage collect) 時的隱式關閉)後立即銷毀。在 Unix 下,該檔案所在的目錄可" +"能根本不被建立、或者在建立檔案後立即就被刪除,其他平臺不支援此功能;你的程式" +"不應依賴使用此功能建立的臨時檔案名稱,因為它在檔案系統中的名稱有可能是不可見" +"的。" #: ../../library/tempfile.rst:44 msgid "" @@ -156,13 +156,13 @@ msgstr "新增 *errors* 參數。" msgid "" "This function operates exactly as :func:`TemporaryFile` does, except the " "following differences:" -msgstr "" +msgstr "此函式的操作與 :func:`TemporaryFile` 完全相同,但存在以下差異:" #: ../../library/tempfile.rst:83 msgid "" "This function returns a file that is guaranteed to have a visible name in " "the file system." -msgstr "" +msgstr "此函式回傳一個保證在檔案系統中具有可見名稱的檔案。" #: ../../library/tempfile.rst:85 msgid "" @@ -170,6 +170,8 @@ msgid "" "with *delete* and *delete_on_close* parameters that determine whether and " "how the named file should be automatically deleted." msgstr "" +"為了管理指定檔案,它使用 *delete* 和 *delete_on_close* 參數擴充 :func:" +"`TemporaryFile` 來指定是否以及如何自動刪除指定檔案。" #: ../../library/tempfile.rst:89 msgid "" @@ -181,6 +183,11 @@ msgid "" "`TemporaryFile`, the directory entry does not get unlinked immediately after " "the file creation." msgstr "" +"回傳的物件始終是一個\\ :term:`類檔案物件 `,其 :attr:`!" +"file` 屬性是底層的真實檔案物件。這個\\ :term:`類檔案物件 `\\ 可以在 :keyword:`with` 陳述式中使用,就像普通檔案一樣。臨時檔案的" +"名稱可以從回傳的類檔案物件的 :attr:`name` 屬性中取得。在 Unix 上則與 :func:" +"`TemporaryFile` 不同,目錄條目不會在檔案建立後立即被取消鏈接 (unlink)。" #: ../../library/tempfile.rst:97 msgid "" @@ -191,6 +198,12 @@ msgid "" "not always guaranteed in this case (see :meth:`object.__del__`). If *delete* " "is false, the value of *delete_on_close* is ignored." msgstr "" +"如果 *delete* 為 true(預設值)並且 *delete_on_close* 為 true(預設值),則檔" +"案在關閉後會立即被刪除。如果 *delete* 為 true 並且 *delete_on_close* 為 " +"false,則僅在情境管理器退出時刪除檔案,或者在\\ :term:`類檔案物件 `\\ 完結時刪除檔案。在這種情況下,並不總是保證能成功刪除(請參閱 :" +"meth:`object.__del__`\\ )。如果 *delete* 為 false,則會忽略 " +"*delete_on_close* 的值。" #: ../../library/tempfile.rst:104 msgid "" @@ -201,32 +214,38 @@ msgid "" "false. The latter approach is recommended as it provides assistance in " "automatic cleaning of the temporary file upon the context manager exit." msgstr "" +"因此,要在關閉檔案後使用臨時檔案的名稱重新打開檔案,請確保在關閉時不刪除檔案" +"(將 *delete* 參數設定為 false),或者如果臨時檔案是以 :keyword:`with` 陳述式" +"建立,要將 *delete_on_close* 參數設定為 false。建議使用後者,因為它有助於在情" +"境管理器退出時自動清理臨時檔案。" #: ../../library/tempfile.rst:111 msgid "" "Opening the temporary file again by its name while it is still open works as " "follows:" -msgstr "" +msgstr "在臨時檔案仍處於打開狀態時再次按其名稱打開它,其作用方式如下:" #: ../../library/tempfile.rst:114 msgid "On POSIX the file can always be opened again." -msgstr "" +msgstr "在 POSIX 上,檔案始終可以再次打開。" #: ../../library/tempfile.rst:115 msgid "" "On Windows, make sure that at least one of the following conditions are " "fulfilled:" -msgstr "" +msgstr "在 Windows 上,確保至少滿足以下條件之一:" #: ../../library/tempfile.rst:118 msgid "*delete* is false" -msgstr "" +msgstr "*delete* 為 false" #: ../../library/tempfile.rst:119 msgid "" "additional open shares delete access (e.g. by calling :func:`os.open` with " "the flag ``O_TEMPORARY``)" msgstr "" +"額外的 open 會共享刪除存取權限(例如,通過使用旗標 ``O_TEMPORARY`` 來呼叫 :" +"func:`os.open`\\ )" #: ../../library/tempfile.rst:121 msgid "" @@ -236,6 +255,10 @@ msgid "" "func:`os.unlink` call on context manager exit will fail with a :exc:" "`PermissionError`." msgstr "" +"*delete* 為 true 但 *delete_on_close* 為 false。請注意,在這種情況下不共享刪" +"除存取權限的其他 open(例如透過內建的 :func:`open` 建立)必須在退出情境管理器" +"之前關閉,否則情境管理器上的 :func:`os.unlink` 呼叫退出將失敗並出現 :exc:" +"`PermissionError`。" #: ../../library/tempfile.rst:127 msgid "" @@ -246,12 +269,18 @@ msgid "" "requested by the open, which fails immediately if the requested access is " "not granted." msgstr "" +"在 Windows 上,如果 *delete_on_close* 為 false,並且檔案是在使用者缺乏刪除存" +"取權限的目錄中建立的,則情境管理器退出時的 :func:`os.unlink` 呼叫將失敗,並引" +"發 :exc:`PermissionError`。當 *delete_on_close* 為 true 時,不會發生這種情" +"況,因為刪除存取權限是由 open 來要求的,如果未授予存取權限則會立即失敗。" #: ../../library/tempfile.rst:134 msgid "" "On POSIX (only), a process that is terminated abruptly with SIGKILL cannot " "automatically delete any NamedTemporaryFiles it created." msgstr "" +"(僅)在 POSIX 上,因使用 SIGKILL 而被終止的行程無法自動刪除它建立的任何 " +"NamedTemporaryFiles。" #: ../../library/tempfile.rst:142 msgid "Added *delete_on_close* parameter." @@ -299,6 +328,8 @@ msgid "" "abstract base classes (depending on whether binary or text *mode* was " "specified)." msgstr "" +"完全實作 :class:`io.BufferedIOBase` 和 :class:`io.TextIOBase` 抽象基底類別" +"(取決於指定的是二進位還是文本 *mode*\\ )。" #: ../../library/tempfile.rst:178 msgid "" @@ -349,6 +380,9 @@ msgid "" "during debugging or when you need your cleanup behavior to be conditional " "based on other logic." msgstr "" +"*delete* 參數可以停用在退出情境時對目錄樹的清理,雖然停用情境管理器在退出情境" +"時所採取的操作似乎不常見,但它在除錯期間或當你需要基於其他邏輯的清理行為時會" +"非常有用。" #: ../../library/tempfile.rst:204 ../../library/tempfile.rst:284 msgid "" @@ -494,13 +528,13 @@ msgstr "" #: ../../library/tempfile.rst:282 msgid ":func:`mkdtemp` returns the absolute pathname of the new directory." -msgstr "" +msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑名稱。" #: ../../library/tempfile.rst:295 msgid "" ":func:`mkdtemp` now always returns an absolute path, even if *dir* is " "relative." -msgstr "" +msgstr ":func:`mkdtemp` 現在都會回傳絕對路徑,即使 *dir* 是相對路徑。" #: ../../library/tempfile.rst:301 msgid "" From e119d025abfd04a45fea791b30fde86a5059b36e Mon Sep 17 00:00:00 2001 From: Leo Wang Date: Tue, 29 Aug 2023 17:22:03 +0800 Subject: [PATCH 057/105] Translate `library/html.po` (#623) * Translate * Fix translation in library/html.po --------- Co-authored-by: Leo Wang --- library/html.po | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/library/html.po b/library/html.po index 361d1c2069..12a6a39c4e 100644 --- a/library/html.po +++ b/library/html.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/html.rst:2 msgid ":mod:`html` --- HyperText Markup Language support" -msgstr "" +msgstr ":mod:`html` --- 超連結標記語言 (HTML) 支援" #: ../../library/html.rst:7 msgid "**Source code:** :source:`Lib/html/__init__.py`" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/html/__init__.py`" #: ../../library/html.rst:11 msgid "This module defines utilities to manipulate HTML." -msgstr "" +msgstr "此模組定義了操作 HTML 的工具。" #: ../../library/html.rst:15 msgid "" @@ -38,6 +38,10 @@ msgid "" "\"``) and (``'``) are also translated; this helps for inclusion in an HTML " "attribute value delimited by quotes, as in ````." msgstr "" +"將字串 *s* 中的 ``&``、``<`` 和 ``>`` 字元轉換為在 HTML 中安全的序列 (sequence)" +"。如果你需要在 HTML 中顯示可能包含這些字元的文字,可以使用這個函式。如果選擇性的旗標 " +"*quote* 為 true,則 (``\"``) 與 (``'``) 字元也會被轉換;這樣能包含在 HTML " +"中,被引號分隔的屬性值,如 ```` 。" #: ../../library/html.rst:26 msgid "" @@ -47,15 +51,19 @@ msgid "" "and invalid character references, and the :data:`list of HTML 5 named " "character references `." msgstr "" +"將字串 *s* 中所有附名 (named) 且為數值的 (numeric) 字元參照(如: ``>``、" +" ``>``、``>`` )轉換為對應的 Unicode 字元。此函式針對有效及無效的字元參" +"照,皆使用 HTML 5 標準所定義的規則,以及 :data:`HTML 5 附名字元參照清單" +" ` 。" #: ../../library/html.rst:36 msgid "Submodules in the ``html`` package are:" -msgstr "" +msgstr "``html`` 套件中的子模組為:" #: ../../library/html.rst:38 msgid ":mod:`html.parser` -- HTML/XHTML parser with lenient parsing mode" -msgstr "" +msgstr ":mod:`html.parser` -- 帶有寬鬆剖析模式的 HTML/XHTML 剖析器" #: ../../library/html.rst:39 msgid ":mod:`html.entities` -- HTML entity definitions" -msgstr "" +msgstr ":mod:`html.entities` -- HTML 實體的定義" From 84a0fc5a5d693ad1a90fcdedec8eb5ec08e231f8 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 29 Aug 2023 17:35:25 +0800 Subject: [PATCH 058/105] feat(library/statistics): translate newly-added strings (#627) --- library/statistics.po | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/library/statistics.po b/library/statistics.po index 7858cc8acd..7c0597019a 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -1156,7 +1156,7 @@ msgid "" "random variable *X* will be near the given value *x*. Mathematically, it is " "the limit of the ratio ``P(x <= X < x+dx) / dx`` as *dx* approaches zero." msgstr "" -"利用\\ `機率密度函式 (probability density function, pdf) `_ 計算隨機變數 *X* 接近給定" "值 *x* 的相對概度 (relative likelihood)。數學上,它是比率 ``P(x <= X < " "x+dx) / dx`` 在 *dx* 趨近於零時的極限值。" @@ -1277,7 +1277,7 @@ msgstr ":class:`NormalDist` 範例與錦囊妙計" #: ../../library/statistics.rst:927 msgid "Classic probability problems" -msgstr "" +msgstr "經典機率問題" #: ../../library/statistics.rst:929 msgid ":class:`NormalDist` readily solves classic probability problems." @@ -1305,7 +1305,7 @@ msgstr "" #: ../../library/statistics.rst:956 msgid "Monte Carlo inputs for simulations" -msgstr "" +msgstr "用於模擬的蒙地卡羅 (Monte Carlo) 輸入" #: ../../library/statistics.rst:958 msgid "" @@ -1314,12 +1314,12 @@ msgid "" "Carlo simulation `_:" msgstr "" "欲估計一個不易透過解析方法求解的模型的分布,:class:`NormalDist` 可以產生輸入" -"樣本以進行 `Monte Carlo 模擬 `_:" #: ../../library/statistics.rst:975 msgid "Approximating binomial distributions" -msgstr "" +msgstr "近似二項分布" #: ../../library/statistics.rst:977 msgid "" @@ -1346,7 +1346,7 @@ msgstr "" #: ../../library/statistics.rst:1016 msgid "Naive bayesian classifier" -msgstr "" +msgstr "單純貝氏分類器 (Naive bayesian classifier)" #: ../../library/statistics.rst:1018 msgid "Normal distributions commonly arise in machine learning problems." @@ -1401,13 +1401,13 @@ msgstr "" #: ../../library/statistics.rst:1073 msgid "Kernel density estimation" -msgstr "" +msgstr "核密度估計 (Kernel density estimation)" #: ../../library/statistics.rst:1075 msgid "" "It is possible to estimate a continuous probability density function from a " "fixed number of discrete samples." -msgstr "" +msgstr "可以從固定數量的離散樣本估計出連續機率密度函式。" #: ../../library/statistics.rst:1078 msgid "" @@ -1418,6 +1418,9 @@ msgid "" "smoothing is controlled by a single parameter, ``h``, representing the " "variance of the kernel function." msgstr "" +"基本想法是使用\\ `一個核函式如常態分布、三角分布或均勻分布 `_\\ 來" +"使資料更加平滑。平滑程度由單個參數 ``h`` 控制,代表核函數的變異數。" #: ../../library/statistics.rst:1097 msgid "" @@ -1426,11 +1429,14 @@ msgid "" "recipe to generate and plot a probability density function estimated from a " "small sample:" msgstr "" +"`維基百科有一個範例 `_,我們可以使用 ``kde_normal()`` 這個錦囊" +"妙計來生成並繪製從小樣本估計的機率密度函式:" #: ../../library/statistics.rst:1109 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" -msgstr "" +msgstr "``xarr`` 和 ``yarr`` 中的點可用於繪製 PDF 圖:" #: ../../library/statistics.rst:-1 msgid "Scatter plot of the estimated probability density function." -msgstr "" +msgstr "估計機率密度函式的散點圖 (scatter plot)。" From 62185092cf8f3d9242b166e9c8400a5cbfaace7d Mon Sep 17 00:00:00 2001 From: neo <71454430+neo-maker-sudo@users.noreply.github.com> Date: Tue, 29 Aug 2023 20:26:02 +0800 Subject: [PATCH 059/105] feat(translate): wsgiref.po (#612) * docs(wsgiref): add partial document translation from english to traditional chinese * docs(wsgiref): modified partial document translation content from rst:2 to rst:118 * docs(wsgiref): fixed formatting issue at rst:112 * Update library/wsgiref.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/wsgiref.po | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index f0af46c1b2..4a32e3dffa 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/wsgiref.rst:2 msgid ":mod:`wsgiref` --- WSGI Utilities and Reference Implementation" -msgstr "" +msgstr ":mod:`wsgiref` --- WSGI 工具與參考實作" #: ../../library/wsgiref.rst:10 msgid "**Source code:** :source:`Lib/wsgiref`" @@ -33,6 +33,8 @@ msgid "" "interface makes it easy to use an application that supports WSGI with a " "number of different web servers." msgstr "" +"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁" +"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。" #: ../../library/wsgiref.rst:19 msgid "" @@ -41,6 +43,8 @@ msgid "" "every detail of WSGI just to install a WSGI application or to write a web " "application using an existing framework." msgstr "" +"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程" +"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。" #: ../../library/wsgiref.rst:24 msgid "" @@ -52,16 +56,21 @@ msgid "" "that checks WSGI servers and applications for conformance to the WSGI " "specification (:pep:`3333`)." msgstr "" +":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI " +"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程" +"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" #: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" +"參閱 `wsgi.readthedocs.io ` 更多 WSGI 相關資訊,以及教學連結" +"與其他資源。" #: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" -msgstr "" +msgstr ":mod:`wsgiref.util` -- WSGI 環境工具" #: ../../library/wsgiref.rst:45 msgid "" @@ -72,6 +81,9 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。" +"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:" +"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。 #: ../../library/wsgiref.rst:56 msgid "" @@ -79,6 +91,8 @@ msgid "" "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" +"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\" 或 \"https\"" +" 的猜測。回傳值為一個字串。" #: ../../library/wsgiref.rst:60 msgid "" @@ -88,6 +102,9 @@ msgid "" "a request is received via SSL. So, this function returns \"https\" if such " "a value is found, and \"http\" otherwise." msgstr "" +"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的" +"伺服器在通過 SSL 接收到請求時會包含 \"1\",\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函" +"式回傳 \"https\",否則回傳 \"http\"。 #: ../../library/wsgiref.rst:69 msgid "" @@ -96,6 +113,8 @@ msgid "" "If *include_query* is false, the query string is not included in the " "resulting URI." msgstr "" +"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串," +"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。" #: ../../library/wsgiref.rst:76 msgid "" @@ -103,6 +122,8 @@ msgid "" "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" +"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的" +"的基本 URI。" #: ../../library/wsgiref.rst:83 msgid "" @@ -110,12 +131,15 @@ msgid "" "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" +"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如" +"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。" #: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." msgstr "" +"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" #: ../../library/wsgiref.rst:89 msgid "" @@ -130,6 +154,11 @@ msgid "" "bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" +"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於" +"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``," +"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用" +"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``," +"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。" #: ../../library/wsgiref.rst:100 msgid "" @@ -140,10 +169,13 @@ msgid "" "difference between URIs ending in ``/x`` from ones ending in ``/x/`` when " "using this routine to do object traversal." msgstr "" +"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片" +"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可" +"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" #: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." -msgstr "" +msgstr "為測試目的,以簡單的預設值更新 *environ* 。" #: ../../library/wsgiref.rst:112 msgid "" @@ -153,6 +185,9 @@ msgid "" "*`` variables. It only supplies default values, and does not replace any " "existing settings for these variables." msgstr "" +"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``" +"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代" +"現有的這些變數設定。" #: ../../library/wsgiref.rst:118 msgid "" @@ -160,6 +195,9 @@ msgid "" "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" +"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為" +"所產生的數據是假的!" + #: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 #: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425 From bcc8d405f4d548710e56351af6014a9efca4c98f Mon Sep 17 00:00:00 2001 From: Payon Date: Tue, 29 Aug 2023 22:31:24 +0800 Subject: [PATCH 060/105] Translate unittest.mock.po, from rst:17 to rst:201 (#610) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(translate-mock): mock page翻譯 翻譯rst:17與rst:21 可能需討論部分譯名(例如stub) * docs: mock translate translate from rst:27 to rst:42 * docs(translate-mock): mock page翻譯 翻譯rst:60 * docs(translate-mock): mock page翻譯 翻譯rst:72至rst:201 * docs(translate-mock): mock page翻譯 fix rst error * docs(translate-mock): mock page翻譯 fix format * docs: mock translate 用詞修正 * docs: mock translate space修正 * fix(translate-mock): fix space * fix(translate-mock): 修正半形冒號 * fix: 用詞修正 修正錯用簡中用詞 * fix(translate-mock): 修正 mock 為不翻譯 --------- Co-authored-by: 鄭宇辰 --- library/unittest.mock.po | 60 +++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 7a74c0c444..35249ae1b7 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2018-05-23 16:14+0000\n" +"PO-Revision-Date: 2023-08-29 15:33+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" -msgstr "" +msgstr ":mod:`unittest.mock` — mock 物件函式庫" #: ../../library/unittest.mock.rst:13 msgid "**Source code:** :source:`Lib/unittest/mock.py`" @@ -32,6 +33,8 @@ msgid "" "replace parts of your system under test with mock objects and make " "assertions about how they have been used." msgstr "" +":mod:`unittest.mock` 在 Python 中是一個用於進行測試的函式庫。 它允許你用 " +"mock 物件在測試中替換部分系統,並判定它們是如何被使用的。" #: ../../library/unittest.mock.rst:21 msgid "" @@ -41,6 +44,9 @@ msgid "" "and arguments they were called with. You can also specify return values and " "set needed attributes in the normal way." msgstr "" +":mod:`unittest.mock` 提供了一個以 :class:`Mock` 為核心的類別,去除在測試中建" +"立大量 stubs 的需求。 在執行動作之後,你可以判定哪些 method (方法)/屬性被" +"使用,以及有哪些引數被呼叫。 你還可以用常規的方式指定回傳值與設定所需的屬性。" #: ../../library/unittest.mock.rst:27 msgid "" @@ -50,6 +56,10 @@ msgid "" "some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:" "`patch`." msgstr "" +"此外,mock 還提供了一個 :func:`patch` 裝飾器,用於 patching 測試範圍內對 " +"module(模組)以及 class(類別)級別的屬性,以及用於建立唯一物件的 :const:" +"`sentinel`\\ 。有關如何使用 :class:`Mock`\\、\\ :class:`MagicMock` 和 :func:" +"`patch` 的一些範例,請參閱\\ `快速導引 `_。" #: ../../library/unittest.mock.rst:33 msgid "" @@ -57,16 +67,21 @@ msgid "" "assertion' pattern instead of 'record -> replay' used by many mocking " "frameworks." msgstr "" +"Mock 被設計用於與 :mod:`unittest` 一起使用,並且基於 「action(操作) -> " +"assertion(判定)」 模式,而不是許多 mocking 框架使用的 「record(記錄) -> " +"replay(重播)」 模式。" #: ../../library/unittest.mock.rst:37 msgid "" "There is a backport of :mod:`unittest.mock` for earlier versions of Python, " "available as `mock on PyPI `_." msgstr "" +"對於早期版本的 Python,有一個 backport(向後移植的)\\ :mod:`unittest.mock` " +"可以使用,\\ `從 PyPI 下載 mock `_。" #: ../../library/unittest.mock.rst:42 msgid "Quick Guide" -msgstr "" +msgstr "快速導引" #: ../../library/unittest.mock.rst:60 msgid "" @@ -75,12 +90,16 @@ msgid "" "can configure them, to specify return values or limit what attributes are " "available, and then make assertions about how they have been used:" msgstr "" +":class:`Mock` 和 :class:`MagicMock` 物件在你存取它們時建立所有屬性和 method" +"(方法),並儲存它們如何被使用的詳細訊息。你可以配置它們,以指定回傳值或限制" +"可用的屬性,然後對它們的使用方式做出判定:" #: ../../library/unittest.mock.rst:72 msgid "" ":attr:`side_effect` allows you to perform side effects, including raising an " "exception when a mock is called:" msgstr "" +":attr:`side_effect` 允許你執行 side effects,包含在 mock 被呼叫時引發例外:" #: ../../library/unittest.mock.rst:93 msgid "" @@ -89,6 +108,9 @@ msgid "" "from another object. Attempting to access attributes or methods on the mock " "that don't exist on the spec will fail with an :exc:`AttributeError`." msgstr "" +"Mock 有許多其他方法可以讓你配置與控制它的行為。例如,\\ *spec* 引數可以配置 " +"mock ,讓其從另一個物件獲取規格。嘗試讀取 mock 中不存在於規格中的屬性或方法將" +"會失敗,並出現 :exc:`AttributeError`\\ 。" #: ../../library/unittest.mock.rst:98 msgid "" @@ -97,6 +119,10 @@ msgid "" "with a mock (or other object) during the test and restored when the test " "ends::" msgstr "" +":func:`patch` 裝飾器/情境管理器可以在測試中簡單的 mock 模組中的類別或物件。" +"被指定的物件在測試期間會被替換為 mock(或其他物件),並在測試結束時恢復:\n" +"\n" +"::" #: ../../library/unittest.mock.rst:117 msgid "" @@ -105,6 +131,9 @@ msgid "" "decorators are applied). This means from the bottom up, so in the example " "above the mock for ``module.ClassName1`` is passed in first." msgstr "" +"當你嵌套 patch 裝飾器時,mock 會以被應用的順序傳遞到裝飾函數(裝飾器應用的正" +"常 *Python* 順序)。這意味著由下而上,因此在上面的範例中,\\ ``module." +"ClassName1`` 的 mock 會先被傳入。" #: ../../library/unittest.mock.rst:122 msgid "" @@ -112,12 +141,15 @@ msgid "" "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" +"使用 :func:`patch` 時,需注意的是你得在被查找物件的命名空間中(in the " +"namespace where they are looked up)patch 物件。這通常很直接,但若需要快速導" +"引,請參閱\\ :ref:`該 patch 何處 `\\ 。" #: ../../library/unittest.mock.rst:126 msgid "" "As well as a decorator :func:`patch` can be used as a context manager in a " "with statement:" -msgstr "" +msgstr "裝飾器 :func:`patch` 也可以在 with 陳述式中被用來作為情境管理器:" #: ../../library/unittest.mock.rst:136 msgid "" @@ -125,6 +157,8 @@ msgid "" "during a scope and restoring the dictionary to its original state when the " "test ends:" msgstr "" +"也有 :func:`patch.dict`\\ ,用於在測試範圍中設定 dictionary(字典)內的值,並" +"在測試結束時將其恢復為原始狀態:" #: ../../library/unittest.mock.rst:147 msgid "" @@ -132,6 +166,8 @@ msgid "" "The easiest way of using magic methods is with the :class:`MagicMock` class. " "It allows you to do things like:" msgstr "" +"Mock 支援對 Python 的\\ :ref:`魔術方法 `\\ 的 mocking。最簡單" +"使用魔術方法的方式是使用 :class:`MagicMock` 類別。它允許你執行以下操作:" #: ../../library/unittest.mock.rst:157 msgid "" @@ -140,12 +176,15 @@ msgid "" "is just a Mock variant that has all of the magic methods pre-created for you " "(well, all the useful ones anyway)." msgstr "" +"Mock 允許你將函式(或其他 Mock 實例)分配給魔術方法,並且它們將被適當地呼" +"叫。\\ :class:`MagicMock` 類別是一個 Mock 的變體,它為你預先建好了所有魔術方" +"法(好吧,所有有用的方法)。" #: ../../library/unittest.mock.rst:162 msgid "" "The following is an example of using magic methods with the ordinary Mock " "class:" -msgstr "" +msgstr "以下是在一般 Mock 類別中使用魔術方法的範例:" #: ../../library/unittest.mock.rst:170 msgid "" @@ -157,12 +196,17 @@ msgid "" "replacing, and any functions and methods (including constructors) have the " "same call signature as the real object." msgstr "" +"為了確保測試中的 mock 物件與它們要替換的物件具有相同的 api,你可以使用\\ :" +"ref:`自動規格 `\\ 。自動規格(auto-speccing)可以通過 patch " +"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 " +"mock 物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構" +"函式)都具有與真實物件相同的呼叫簽名(call signature)。" #: ../../library/unittest.mock.rst:178 msgid "" "This ensures that your mocks will fail in the same way as your production " "code if they are used incorrectly:" -msgstr "" +msgstr "這可以確保如果使用方法錯誤,你的 mock 會跟實際程式碼以相同的方式失敗:" #: ../../library/unittest.mock.rst:194 msgid "" @@ -170,10 +214,12 @@ msgid "" "signature of the ``__init__`` method, and on callable objects where it " "copies the signature of the ``__call__`` method." msgstr "" +":func:`create_autospec` 也可以用在類別上,它複製了 ``__init__`` 方法的簽名," +"它也可以用在可呼叫物件上,其複製了 ``__call__`` 方法的簽名。" #: ../../library/unittest.mock.rst:201 msgid "The Mock Class" -msgstr "" +msgstr "Mock 類別" #: ../../library/unittest.mock.rst:212 msgid "" From e8060c2144207928c74e76c16dac06ee4c24c3a2 Mon Sep 17 00:00:00 2001 From: Leo Wang Date: Tue, 29 Aug 2023 22:40:30 +0800 Subject: [PATCH 061/105] Translate asyncio.po (#630) Co-authored-by: Leo Wang --- library/asyncio.po | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/asyncio.po b/library/asyncio.po index 3a4f1a92e2..b1deae96b2 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -4,6 +4,7 @@ # Translators: # Adrian Liaw , 2018 # Matt Wang , 2021 +# Leo Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" @@ -128,11 +129,11 @@ msgstr "" #: ../../library/asyncio.rst:59 msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" -msgstr "" +msgstr "你能在 REPL 中對一個 ``asyncio`` 的並行情境 (context) 進行實驗:" #: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" +msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -140,6 +141,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/asyncio.rst:77 msgid "Reference" From 4a2b11ac2119cc5eff0aa0078baa86a704f4285c Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 30 Aug 2023 01:14:54 +0800 Subject: [PATCH 062/105] translate `library/security_warnings .po` (#606) --- library/security_warnings.po | 47 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/library/security_warnings.po b/library/security_warnings.po index a706bc13ae..8a2bfa8fe4 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # +# Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2023-08-21 02:41+0000\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -19,21 +19,23 @@ msgstr "" #: ../../library/security_warnings.rst:6 msgid "Security Considerations" -msgstr "" +msgstr "安全性注意事項" #: ../../library/security_warnings.rst:8 msgid "The following modules have specific security considerations:" -msgstr "" +msgstr "以下模組具有特定的安全性注意事項:" #: ../../library/security_warnings.rst:10 msgid "" ":mod:`base64`: :ref:`base64 security considerations ` in :" "rfc:`4648`" msgstr "" +":mod:`base64`::ref:`base64 安全性注意事項 `\\ 在 :rfc:" +"`4648`" #: ../../library/security_warnings.rst:12 msgid ":mod:`cgi`: :ref:`CGI security considerations `" -msgstr "" +msgstr ":mod:`cgi`::ref:`CGI 安全性注意事項 `" #: ../../library/security_warnings.rst:13 msgid "" @@ -41,6 +43,8 @@ msgid "" "only argument disabling known insecure and blocked algorithms `" msgstr "" +":mod:`hashlib`::ref:`所有建構函式都採用 \"usedforsecurity\" 僅限關鍵字引數," +"並禁用已知的不安全與被阻擋的演算法 `" #: ../../library/security_warnings.rst:16 msgid "" @@ -48,60 +52,70 @@ msgid "" "basic security checks. See the :ref:`security considerations `." msgstr "" +":mod:`http.server` 不適合在正式環境使用,因其僅實作基本的安全檢查。請參閱\\ :" +"ref:`安全注意事項 `。" #: ../../library/security_warnings.rst:18 msgid "" ":mod:`logging`: :ref:`Logging configuration uses eval() `" -msgstr "" +msgstr ":mod:`logging`::ref:`日誌配置使用 eval() `" #: ../../library/security_warnings.rst:20 msgid "" ":mod:`multiprocessing`: :ref:`Connection.recv() uses pickle `" msgstr "" +":mod:`multiprocessing`::ref:`Connection.recv() 使用 pickle `" #: ../../library/security_warnings.rst:22 msgid ":mod:`pickle`: :ref:`Restricting globals in pickle `" -msgstr "" +msgstr ":mod:`pickle`::ref:`限制 pickle 中的全域變數 `" #: ../../library/security_warnings.rst:23 msgid "" ":mod:`random` shouldn't be used for security purposes, use :mod:`secrets` " "instead" -msgstr "" +msgstr ":mod:`random` 不該用於安全性相關用途,請改用 :mod:`secrets`" #: ../../library/security_warnings.rst:25 msgid "" ":mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for " "dealing with untrusted sources `" msgstr "" +":mod:`shelve`::ref:`shelve 為基於 pickle,因此不適合用來處理不受信任的來源 " +"`" #: ../../library/security_warnings.rst:27 msgid ":mod:`ssl`: :ref:`SSL/TLS security considerations `" -msgstr "" +msgstr ":mod:`ssl`::ref:`SSL/TLS 安全性注意事項 `" #: ../../library/security_warnings.rst:28 msgid "" ":mod:`subprocess`: :ref:`Subprocess security considerations `" -msgstr "" +msgstr ":mod:`subprocess`::ref:`子行程安全性注意事項 `" #: ../../library/security_warnings.rst:30 msgid "" ":mod:`tempfile`: :ref:`mktemp is deprecated due to vulnerability to race " "conditions `" msgstr "" +":mod:`tempfile`::ref:`mktemp 由於存在競爭條件 (race condition) 漏洞而被棄用 " +"`" #: ../../library/security_warnings.rst:32 msgid ":mod:`xml`: :ref:`XML vulnerabilities `" -msgstr "" +msgstr ":mod:`xml`::ref:`XML 漏洞 `" #: ../../library/security_warnings.rst:33 msgid "" ":mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume " "exhaustion `" msgstr "" +":mod:`zipfile`::ref:`惡意準備的 .zip 檔案可能會導致硬碟空間耗盡 `" #: ../../library/security_warnings.rst:36 msgid "" @@ -111,7 +125,10 @@ msgid "" "potentially unsafe path to :data:`sys.path` such as the current directory, " "the script's directory or an empty string." msgstr "" +":option:`-I` 命令列選項可用於在隔離模式下運行 Python。若其無法使用,可以改" +"用 :option:`-P` 選項或 :envvar:`PYTHONSAFEPATH` 環境變數,避免 :data:`sys." +"path` 新增潛在的不安全路徑,例如當前目錄、腳本的目錄或空字串。" #: ../../library/security_warnings.rst:3 msgid "security considerations" -msgstr "security considerations(安全性考量)" +msgstr "security considerations(安全性注意事項)" From eda409f3776366c597c84ab0972e194feb53aebd Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 30 Aug 2023 01:23:48 +0800 Subject: [PATCH 063/105] feat: translate `c-api/list.po` (#617) --- c-api/list.po | 53 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/c-api/list.po b/c-api/list.po index b5fb0dd15f..ed430f77a6 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -1,16 +1,16 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Nkeys Syu , 2016 +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2023-03-03 20:35+0800\n" -"Last-Translator: Nkeys Syu \n" +"PO-Revision-Date: 2023-08-24 00:55+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -26,20 +26,22 @@ msgstr "List(串列)物件" #: ../../c-api/list.rst:13 msgid "This subtype of :c:type:`PyObject` represents a Python list object." -msgstr "" +msgstr ":c:type:`PyObject` 的這個子型別表示 Python 的 list(串列)物件。" #: ../../c-api/list.rst:18 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python list type. " "This is the same object as :class:`list` in the Python layer." msgstr "" +"此 :c:type:`PyTypeObject` 實例表示 Python 的 list 型別。這與 Python 層中的 :" +"class:`list` 是同一個物件。" #: ../../c-api/list.rst:24 msgid "" "Return true if *p* is a list object or an instance of a subtype of the list " "type. This function always succeeds." msgstr "" -"如果 *p* 是一個 list 物件或者是 list 型別的子型別的實例,就回傳 true。這個函" +"如果 *p* 是一個 list 物件或者是 list 型別之子型別的實例,就回傳 true。這個函" "式永遠會成功執行。" #: ../../c-api/list.rst:30 @@ -52,7 +54,7 @@ msgstr "" #: ../../c-api/list.rst:36 msgid "Return a new list of length *len* on success, or ``NULL`` on failure." -msgstr "" +msgstr "成功時回傳長度為 *len* 的新串列,失敗時回傳 ``NULL``。" #: ../../c-api/list.rst:40 msgid "" @@ -61,12 +63,16 @@ msgid "" "`PySequence_SetItem` or expose the object to Python code before setting all " "items to a real object with :c:func:`PyList_SetItem`." msgstr "" +"如果 *len* 大於零,則回傳的串列物件之項目將被設定為 ``NULL``。因此,在使用 :" +"c:func:`PyList_SetItem` 來將所有項目設定為一個真實物件前,你無法使用像是 :c:" +"func:`PySequence_SetItem` 的使用抽象 API 函式,也不能將物件暴露 (expose) 給 " +"Python 程式碼。" #: ../../c-api/list.rst:50 msgid "" "Return the length of the list object in *list*; this is equivalent to " "``len(list)`` on a list object." -msgstr "" +msgstr "回傳 *list* 串列物件的長度;這相當於串列物件的 ``len(list)``。" #: ../../c-api/list.rst:56 msgid "Similar to :c:func:`PyList_Size`, but without error checking." @@ -79,10 +85,13 @@ msgid "" "supported. If *index* is out of bounds (<0 or >=len(list)), return ``NULL`` " "and set an :exc:`IndexError` exception." msgstr "" +"回傳 *list* 指向的串列中位於 *index* 位置的物件。該位置不可為負數;並不支援從" +"串列尾末開始索引。如果 *index* 超出邊界範圍(<0 或 >=len(list))則回傳 " +"``NULL`` 並設定 :exc:`IndexError` 例外。" #: ../../c-api/list.rst:69 msgid "Similar to :c:func:`PyList_GetItem`, but without error checking." -msgstr "" +msgstr "與 :c:func:`PyList_GetItem` 類似,但沒有錯誤檢查。" #: ../../c-api/list.rst:74 msgid "" @@ -90,18 +99,23 @@ msgid "" "If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` " "exception." msgstr "" +"將串列中索引 *index* 處的項目設定為 *item*。成功時回傳 ``0``。如果 *index* 超" +"出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。" #: ../../c-api/list.rst:80 msgid "" "This function \"steals\" a reference to *item* and discards a reference to " "an item already in the list at the affected position." msgstr "" +"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。" #: ../../c-api/list.rst:86 msgid "" "Macro form of :c:func:`PyList_SetItem` without error checking. This is " "normally only used to fill in new lists where there is no previous content." msgstr "" +":c:func:`PyList_SetItem` 的巨集形式,沒有錯誤檢查。這通常僅用於填充沒有已存在" +"內容的新串列。" #: ../../c-api/list.rst:91 msgid "" @@ -109,6 +123,9 @@ msgid "" "`PyList_SetItem`, does *not* discard a reference to any item that is being " "replaced; any reference in *list* at position *i* will be leaked." msgstr "" +"該巨集「竊取」對 *item* 的參照,並且與 :c:func:`PyList_SetItem` 不同的是,它" +"\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* 中位置 *i* 的任何參照都將被洩" +"漏 (leak)。" #: ../../c-api/list.rst:99 msgid "" @@ -116,6 +133,9 @@ msgid "" "``0`` if successful; return ``-1`` and set an exception if unsuccessful. " "Analogous to ``list.insert(index, item)``." msgstr "" +"將項目 *item* 插入串列 *list* 中索引 *index* 的位置之前。如果成功則回傳 " +"``0``;如果失敗則回傳 ``-1`` 並設定例外。類似於 ``list.insert(index, " +"item)``。" #: ../../c-api/list.rst:106 msgid "" @@ -123,6 +143,8 @@ msgid "" "successful; return ``-1`` and set an exception if unsuccessful. Analogous " "to ``list.append(item)``." msgstr "" +"將物件 *item* 附加到串列 *list* 的最後面。如果成功則回傳 ``0``;如果不成功," +"則回傳 ``-1`` 並設定例外。類似於 ``list.append(item)``。" #: ../../c-api/list.rst:113 msgid "" @@ -131,6 +153,9 @@ msgid "" "Analogous to ``list[low:high]``. Indexing from the end of the list is not " "supported." msgstr "" +"回傳 *list* 中的物件串列,其中包含 *low* 和 *high* *之間*\\ 的物件。如果沒有" +"成功則回傳 ``NULL`` 並設定例外。類似於 ``list[low:high]``。不支援從串列尾末開" +"始索引。" #: ../../c-api/list.rst:120 msgid "" @@ -140,24 +165,34 @@ msgid "" "Return ``0`` on success, ``-1`` on failure. Indexing from the end of the " "list is not supported." msgstr "" +"將 *low* 和 *high* 之間的 *list* 切片設定為 *itemlist* 的內容。類似於 " +"``list[low:high] = itemlist``。*itemlist* 可能為 ``NULL``,表示分配一個空串列" +"(切片刪除)。成功時回傳 ``0``,失敗時則回傳 ``-1``。不支援從串列尾末開始索" +"引。" #: ../../c-api/list.rst:129 msgid "" "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is equivalent to ``list.sort()``." msgstr "" +"對 *list* 的項目進行原地 (in place) 排序。成功時回傳 ``0``,失敗時回傳 " +"``-1``。這相當於 ``list.sort()``。" #: ../../c-api/list.rst:135 msgid "" "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is the equivalent of ``list.reverse()``." msgstr "" +"原地反轉 *list* 的項目。成功時回傳 ``0``,失敗時回傳 ``-1``。這相當於 ``list." +"reverse()``。" #: ../../c-api/list.rst:143 msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." msgstr "" +"回傳一個新的 tuple(元組)物件,其中包含 *list* 的內容;相當於 " +"``tuple(list)``。" #: ../../c-api/list.rst:8 msgid "object" From 639b34d5a88eb8adfcf32fe6f815b7509eafd322 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 30 Aug 2023 02:22:15 +0800 Subject: [PATCH 064/105] translate the repeated strings about webassembly (#634) --- library/cgi.po | 2 ++ library/compileall.po | 2 ++ library/crypt.po | 2 ++ library/ensurepip.po | 2 ++ library/fcntl.po | 2 ++ library/getpass.po | 2 ++ library/grp.po | 2 ++ library/http.client.po | 2 ++ library/http.server.po | 2 ++ library/imaplib.po | 2 ++ library/mmap.po | 2 ++ library/multiprocessing.po | 2 ++ library/nis.po | 2 ++ library/nntplib.po | 2 ++ library/poplib.po | 2 ++ library/resource.po | 2 ++ library/select.po | 2 ++ library/selectors.po | 2 ++ library/smtplib.po | 2 ++ library/socket.po | 2 ++ library/socketserver.po | 2 ++ library/spwd.po | 2 ++ library/ssl.po | 2 ++ library/subprocess.po | 2 ++ library/syslog.po | 2 ++ library/telnetlib.po | 2 ++ library/threading.po | 2 ++ library/urllib.request.po | 2 ++ library/venv.po | 2 ++ library/webbrowser.po | 2 ++ library/xmlrpc.client.po | 2 ++ library/xmlrpc.server.po | 2 ++ library/zoneinfo.po | 2 ++ 33 files changed, 66 insertions(+) diff --git a/library/cgi.po b/library/cgi.po index 1f17c68dfa..888e32feb2 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -72,6 +72,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/cgi.rst:43 msgid "Introduction" diff --git a/library/compileall.po b/library/compileall.po index de1910b149..705cfc98f6 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -45,6 +45,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/compileall.rst:20 msgid "Command-line use" diff --git a/library/crypt.po b/library/crypt.po index cf2b2a88d2..b8b1c2535c 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -65,6 +65,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/crypt.rst:45 msgid "Hashing Methods" diff --git a/library/ensurepip.po b/library/ensurepip.po index 7bb297f5c4..095fea9c59 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -76,6 +76,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/ensurepip.rst:44 msgid "Command line interface" diff --git a/library/fcntl.po b/library/fcntl.po index 5638093bd0..2a60f76aa3 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -40,6 +40,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/fcntl.rst:23 msgid "" diff --git a/library/getpass.po b/library/getpass.po index 0071e94f7d..828e2edc0d 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -37,6 +37,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/getpass.rst:17 msgid "The :mod:`getpass` module provides two functions:" diff --git a/library/grp.po b/library/grp.po index 2946fffafe..a216d5d66f 100644 --- a/library/grp.po +++ b/library/grp.po @@ -38,6 +38,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/grp.rst:15 msgid "" diff --git a/library/http.client.po b/library/http.client.po index 145e6f5ac7..93bb6fe069 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -55,6 +55,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/http.client.rst:33 msgid "The module provides the following classes:" diff --git a/library/http.server.po b/library/http.server.po index 006943c8ba..1a5ec94aa5 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -46,6 +46,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/http.server.rst:27 msgid "" diff --git a/library/imaplib.po b/library/imaplib.po index c4cd78ee53..1b58e8469d 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -45,6 +45,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/imaplib.rst:31 msgid "" diff --git a/library/mmap.po b/library/mmap.po index 9350ce99a5..a4d3c14a62 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -32,6 +32,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/mmap.rst:11 msgid "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 9bdd32f856..df80d4e10b 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -36,6 +36,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/multiprocessing.rst:14 msgid "Introduction" diff --git a/library/nis.po b/library/nis.po index 91391ed1ce..03a190b32b 100644 --- a/library/nis.po +++ b/library/nis.po @@ -51,6 +51,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/nis.rst:26 msgid "The :mod:`nis` module defines the following functions:" diff --git a/library/nntplib.po b/library/nntplib.po index 97c6d8e357..a82790085a 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -48,6 +48,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/nntplib.rst:43 msgid "" diff --git a/library/poplib.po b/library/poplib.po index eccf559fde..01d018a090 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -61,6 +61,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/poplib.rst:33 msgid "The :mod:`poplib` module provides two classes:" diff --git a/library/resource.po b/library/resource.po index 33d3fbd3b1..9b0e297da0 100644 --- a/library/resource.po +++ b/library/resource.po @@ -38,6 +38,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/resource.rst:18 msgid "" diff --git a/library/select.po b/library/select.po index d8d03c432e..42b459b288 100644 --- a/library/select.po +++ b/library/select.po @@ -51,6 +51,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/select.rst:27 msgid "The module defines the following:" diff --git a/library/selectors.po b/library/selectors.po index e94ab6b435..71fd2b0f0f 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -80,6 +80,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/selectors.rst:44 msgid "Classes" diff --git a/library/smtplib.po b/library/smtplib.po index 90f0ed257d..f0c102718e 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -44,6 +44,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/smtplib.rst:26 msgid "" diff --git a/library/socket.po b/library/socket.po index ab9e6f8da9..7875ed07cd 100644 --- a/library/socket.po +++ b/library/socket.po @@ -49,6 +49,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/socket.rst:24 msgid "" diff --git a/library/socketserver.po b/library/socketserver.po index 839a184072..6502379140 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -42,6 +42,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/socketserver.rst:15 msgid "There are four basic concrete server classes:" diff --git a/library/spwd.po b/library/spwd.po index 7d481ba339..b1813fef85 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -47,6 +47,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/spwd.rst:20 msgid "" diff --git a/library/ssl.po b/library/ssl.po index 428b3e00d5..8dfb102e76 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -61,6 +61,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/ssl.rst:38 msgid "" diff --git a/library/subprocess.po b/library/subprocess.po index 3aaa6cf07c..abe2ae5d16 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -53,6 +53,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/subprocess.rst:31 msgid "Using the :mod:`subprocess` Module" diff --git a/library/syslog.po b/library/syslog.po index 2791fb254d..40ab46dd77 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -46,6 +46,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/syslog.rst:20 msgid "The module defines the following functions:" diff --git a/library/telnetlib.po b/library/telnetlib.po index e8471c9f5a..493d92cb5f 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -64,6 +64,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/telnetlib.rst:37 msgid "" diff --git a/library/threading.po b/library/threading.po index 272daaae9a..992f2849f1 100644 --- a/library/threading.po +++ b/library/threading.po @@ -84,6 +84,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/threading.rst:50 msgid "This module defines the following functions:" diff --git a/library/urllib.request.po b/library/urllib.request.po index 1fe64855ad..8bf1e09252 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -56,6 +56,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/urllib.request.rst:26 msgid "The :mod:`urllib.request` module defines the following functions:" diff --git a/library/venv.po b/library/venv.po index 24fac4e9c1..9b857481d1 100644 --- a/library/venv.po +++ b/library/venv.po @@ -66,6 +66,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/venv.rst:43 msgid "Creating virtual environments" diff --git a/library/webbrowser.po b/library/webbrowser.po index 46a75a1dfe..3697a34d49 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -79,6 +79,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/webbrowser.rst:46 msgid "The following exception is defined:" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index e024f76feb..c2f756d473 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -58,6 +58,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/xmlrpc.client.rst:41 msgid "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index de5a15e51f..223dcb1992 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -51,6 +51,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/xmlrpc.server.rst:32 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index b35b8b78e5..6f9431e9f3 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -64,6 +64,8 @@ msgid "" "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " "more information." msgstr "" +"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" +"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" #: ../../library/zoneinfo.rst:35 msgid "Using ``ZoneInfo``" From 9a490ab382fca4d0a20fc61c355fd93f32cf1e02 Mon Sep 17 00:00:00 2001 From: minghx Date: Thu, 31 Aug 2023 02:16:43 +0000 Subject: [PATCH 065/105] Refine translation of library/calendar --- library/calendar.po | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/library/calendar.po b/library/calendar.po index 772b019861..ebb171daf9 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -293,11 +293,11 @@ msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用 #: ../../library/calendar.rst:256 msgid "" "A list of CSS classes used for each weekday. The default class list is::" -msgstr "一週每一天使用的 CSS 類別的串列。預設的串列內容為: ::" +msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" #: ../../library/calendar.rst:260 msgid "more styles can be added for each day::" -msgstr "可以在每一天增加更多樣式: ::" +msgstr "可以針對每一天增加更多樣式: ::" #: ../../library/calendar.rst:264 msgid "Note that the length of this list must be seven items." @@ -305,7 +305,7 @@ msgstr "注意這個串列的長度必須是七個項目。" #: ../../library/calendar.rst:269 msgid "The CSS class for a weekday occurring in the previous or coming month." -msgstr "前一個或下一個月份的一週每一天的 CSS 類別。" +msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" #: ../../library/calendar.rst:276 msgid "" @@ -320,7 +320,7 @@ msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." msgstr "" -"月份標題的 CSS 類別 (:meth:`formatmonthname` 會用到),預設值是 " +"月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" #: ../../library/calendar.rst:292 @@ -328,7 +328,7 @@ msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." msgstr "" -"整個月份表格的 CSS 類別 (:meth:`formatmonth` 會用到),預設值是 " +"整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" #: ../../library/calendar.rst:300 @@ -336,14 +336,15 @@ msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -"整年表格的 CSS 類別(:meth:`formatyear` 會用到),預設值是 ``\"year\"``。" +"整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" #: ../../library/calendar.rst:308 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -"整年表格標題的 CSS 類別(:meth:`formatyear` 會用到),預設值是 ``\"year\"``。" +"整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " +"``\"year\"``。" #: ../../library/calendar.rst:314 msgid "" @@ -383,8 +384,8 @@ msgid "" "thread-safe." msgstr "" "這兩個類別的建構函式、:meth:`formatweekday` 及 :meth:`formatmonthname` 方法會" -"把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程的設" -"定,它們不是執行緒安全的。" +"把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " +"(process-wide) 的設定,它們不是執行緒安全的。" #: ../../library/calendar.rst:350 msgid "For simple text calendars this module provides the following functions." @@ -414,7 +415,7 @@ msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." -msgstr "回傳從 *y1* 到 *y2* (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" +msgstr "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" #: ../../library/calendar.rst:378 msgid "This function works for ranges spanning a century change." @@ -432,7 +433,7 @@ msgstr "" msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." -msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的寬度即字元數。" +msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" #: ../../library/calendar.rst:395 msgid "" @@ -446,8 +447,8 @@ msgid "" "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" -"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。除非在 :" -"func:`setfirstweekday` 有設定,每一週以週一開始。" +"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以" +"週一開始,除非有使用 :func:`setfirstweekday` 改變設定。" #: ../../library/calendar.rst:408 msgid "Prints a month's calendar as returned by :func:`month`." From 495340f1d6a17522c46abef1de7c22875c4add19 Mon Sep 17 00:00:00 2001 From: Steven Hsu Date: Thu, 31 Aug 2023 13:04:43 +0800 Subject: [PATCH 066/105] Update faq/design.po (#636) Sync with 3.12 --- faq/design.po | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/faq/design.po b/faq/design.po index 235df21366..6fa942e574 100644 --- a/faq/design.po +++ b/faq/design.po @@ -4,13 +4,15 @@ # # Translators: # Ching-Lung Chuang, 2015 +# SiriusKoan, 2022 +# Steven Hsu , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-21 00:03+0000\n" -"PO-Revision-Date: 2023-02-18 13:10+0800\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-08-31 11:34+0800\n" +"Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -18,7 +20,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.2.2\n" +"X-Generator: Poedit 3.3.2\n" "X-Poedit-Bookmarks: -1,-1,-1,-1,-1,93,25,-1,-1,-1\n" #: ../../faq/design.rst:3 @@ -1034,8 +1036,8 @@ msgstr "" "就像介面規範一樣,一個適當的測試規則在建造大型又複雜的 Python 應用程式時可以" "幫上忙。事實上,他可能可以有更好的表現,因為介面規範無法測試程式的特定屬性。" "舉例來說,:meth:`!list.append` 方法應該要在某個內部的串列最後面加上新的元素," -"而介面規範沒辦法測試你的 :meth:`!list.append` 是不是真的有正確的實作,但這在測" -"試套件裡是件很簡單的事。" +"而介面規範沒辦法測試你的 :meth:`!list.append` 是不是真的有正確的實作,但這在" +"測試套件裡是件很簡單的事。" #: ../../faq/design.rst:592 msgid "" @@ -1229,6 +1231,9 @@ msgid "" "such as using a 'leading dot', have been rejected in favour of explicitness " "(see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." msgstr "" +"類似的提案包括引入語法以進一步減少程式碼量,例如使用「前導點 (leading " +"dot)」,但這些提案已被捨棄,以維持程式的明確性(參閱 https://mail.python.org/" +"pipermail/python-ideas/2016-May/040070.html)。" #: ../../faq/design.rst:715 msgid "Why don't generators support the with statement?" From af9f3ef6e987a2942f9cc6ea4f50ef24972683e9 Mon Sep 17 00:00:00 2001 From: Shen-KuanLing <44127801+Shen-KuanLing@users.noreply.github.com> Date: Tue, 5 Sep 2023 00:12:59 +0800 Subject: [PATCH 067/105] Add pre-commit with powrap (#608) * feat: add pre-commit to format po files * feat: use powrap native pre-commit hook * PR reviewer suggestions * chore(readme): add installation cmd for pre-commit --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- .pre-commit-config.yaml | 12 ++++++++++++ README.rst | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..7cf6db96a6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +# Install the pre-commit hooks below with +# 'pre-commit install' + +# Auto-update the version of the hooks with +# 'pre-commit autoupdate' + +repos: +- repo: https://git.afpy.org/AFPy/powrap + # there's no release tag in repo, use the latest commit hash id instead + rev: a34a9fed116d24562fbe4bb8d456ade85f056c36 + hooks: + - id: powrap \ No newline at end of file diff --git a/README.rst b/README.rst index 5725a94190..e6454d97ff 100644 --- a/README.rst +++ b/README.rst @@ -89,6 +89,11 @@ the PSF for inclusion in the documentation. brew install gettext brew link gettext --force +- 安裝 pre-commit 自動在 commit 時檢查 ``.po`` 檔格式。 +.. code-block:: bash + + pip install pre-commit + pre-commit install 在進行任何動作以前,你必須在 GitHub 上 fork 此專案(按下右上角的 ``Fork`` 按鈕),這樣會把整個專案複製一份到你的 GitHub 帳號底下,你可以對這個 fork From d2f1a53449b64b7bc920e02316bc61e610ca8241 Mon Sep 17 00:00:00 2001 From: Leo Wang Date: Tue, 5 Sep 2023 09:33:47 +0800 Subject: [PATCH 068/105] Translate `library/re.po` intro part (#635) * Translate library/re.po intro part * Update re.po according to suggestion * Update string literal translation in library/re.po --------- Co-authored-by: Leo Wang --- library/re.po | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/library/re.po b/library/re.po index 66510021f6..6474df8f64 100644 --- a/library/re.po +++ b/library/re.po @@ -3,6 +3,7 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Leo Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" @@ -32,6 +33,7 @@ msgid "" "This module provides regular expression matching operations similar to those " "found in Perl." msgstr "" +"此模組提供類似於 Perl 中正規表示式的配對操作。" #: ../../library/re.rst:17 msgid "" @@ -42,6 +44,10 @@ msgid "" "substitution, the replacement string must be of the same type as both the " "pattern and the search string." msgstr "" +"被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-bit " +"字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是,你不能用 " +"byte 模式配對 Unicode 字串,反之亦然;同樣地,替換時,用來替換的字串必須與模式和搜尋" +"字串是相同的型別 (type)。" #: ../../library/re.rst:24 msgid "" @@ -57,6 +63,13 @@ msgid "" "future this will become a :exc:`SyntaxError`. This behaviour will happen " "even if it is a valid escape sequence for a regular expression." msgstr "" +"正規表示式使用反斜線字元 (``'\\'``) 表示特別的形式,或是使用特殊字元而不調用" +"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了一樣的目的使用同一個字元的" +"目的相衝突;舉例來說,為了配對一個反斜線文字,一個人可能需要寫 ``'\\\\\\\\'`` 當作" +"模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通的 Python 字串文本中" +"必須表示為 ``\\\\``。另外,請注意在 Python 的字串文本中使用反斜線的任何無效跳脫序列" +"目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變成一個 :exc:`SyntaxError`。" +"儘管它對正規表示式是一個有效的跳脫序列,這種行為也會發生。" #: ../../library/re.rst:36 msgid "" @@ -67,6 +80,10 @@ msgid "" "a newline. Usually patterns will be expressed in Python code using this raw " "string notation." msgstr "" +"解決方法是對正規表示式模式使用 Python 的原始字串符號;反斜線在一個以 ``'r'`` 為前綴" +"的字串文本中不會被用任何特別的方式處理。所以 ``r\"\\n\"`` 是一個兩個字元的字串,包含" +" ``'\\'`` 和 ``'n'``,同時 ``\"\\n\"`` 是一個單個字元的字串,包含一個換行符號。通常" +"模式在 Python 程式中會使用這個原始字串符號表示。" #: ../../library/re.rst:43 msgid "" @@ -75,6 +92,9 @@ msgid "" "expressions `. The functions are shortcuts that don't require " "you to compile a regex object first, but miss some fine-tuning parameters." msgstr "" +"請務必注意到大部分的正規表示式操作是可以在模組層級的函式和 :ref:`" +"compiled regular expressions ` 中的方法使用的。這些函式是個捷徑" +"且讓你不需要先編譯一個正規表示式物件,但是會缺少一些微調參數。" #: ../../library/re.rst:51 msgid "" @@ -82,6 +102,8 @@ msgid "" "an API compatible with the standard library :mod:`re` module, but offers " "additional functionality and a more thorough Unicode support." msgstr "" +"第三方的 `regex `_ 模組,有著和標準函式庫" +" :mod:`re` 模組相容的 API,但是提供額外的功能以及更完整的 Unicode 支援。" #: ../../library/re.rst:59 msgid "Regular Expression Syntax" From dec567da4a0d0a5f1c8f075d15c061882536c7a7 Mon Sep 17 00:00:00 2001 From: mindihx Date: Tue, 5 Sep 2023 16:34:08 +0800 Subject: [PATCH 069/105] Translate library/enum part 1/2 (#644) * Translate library/enum part 1/2 * Refine translation of library/enum --- library/enum.po | 166 +++++++++++++++++++++++++++++++----------------- 1 file changed, 106 insertions(+), 60 deletions(-) diff --git a/library/enum.po b/library/enum.po index 84d1026bc1..74ea042065 100644 --- a/library/enum.po +++ b/library/enum.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-23 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 16:01+0000\n" +"PO-Revision-Date: 2023-09-04 13:48+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/enum.rst:2 msgid ":mod:`enum` --- Support for enumerations" -msgstr "" +msgstr ":mod:`enum` --- 對列舉的支援" #: ../../library/enum.rst:14 msgid "**Source code:** :source:`Lib/enum.py`" @@ -30,47 +30,47 @@ msgstr "**原始碼:**\\ :source:`Lib/enum.py`" msgid "" "This page contains the API reference information. For tutorial information " "and discussion of more advanced topics, see" -msgstr "" +msgstr "本頁包含 API 的參考資訊。關於教學資訊及更多進階主題的討論請參考" #: ../../library/enum.rst:21 msgid ":ref:`Basic Tutorial `" -msgstr "" +msgstr ":ref:`基本教學 `" #: ../../library/enum.rst:22 msgid ":ref:`Advanced Tutorial `" -msgstr "" +msgstr ":ref:`進階教學 `" #: ../../library/enum.rst:23 msgid ":ref:`Enum Cookbook `" -msgstr "" +msgstr ":ref:`列舉指南 `" #: ../../library/enum.rst:27 msgid "An enumeration:" -msgstr "" +msgstr "列舉:" #: ../../library/enum.rst:29 msgid "is a set of symbolic names (members) bound to unique values" -msgstr "" +msgstr "是一組綁定唯一值的代表名稱(成員)" #: ../../library/enum.rst:30 msgid "" "can be iterated over to return its canonical (i.e. non-alias) members in " "definition order" -msgstr "" +msgstr "可以用疊代的方式以定義的順序回傳其正式 (canonical)(即非別名)成員" #: ../../library/enum.rst:32 msgid "uses *call* syntax to return members by value" -msgstr "" +msgstr "使用 *call* 語法來透過值回傳成員" #: ../../library/enum.rst:33 msgid "uses *index* syntax to return members by name" -msgstr "" +msgstr "使用 *index* 語法來透過名稱回傳成員" #: ../../library/enum.rst:35 msgid "" "Enumerations are created either by using :keyword:`class` syntax, or by " "using function-call syntax::" -msgstr "" +msgstr "列舉透過 :keyword:`class` 語法或函式呼叫的語法來建立: ::" #: ../../library/enum.rst:49 msgid "" @@ -78,26 +78,32 @@ msgid "" "not normal Python classes. See :ref:`How are Enums different? ` for more details." msgstr "" +"雖然我們可以用 :keyword:`class` 語法來建立列舉,列舉並不是標準的 Python 類" +"別。參考\\ :ref:`列舉有何差異 `\\ 以取得更多細節。" #: ../../library/enum.rst:53 msgid "Nomenclature" -msgstr "" +msgstr "命名方式" #: ../../library/enum.rst:55 msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" -msgstr "" +msgstr ":class:`!Color` 類別是一個\\ *列舉*\\ (或 *enum*)" #: ../../library/enum.rst:56 msgid "" "The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are " "*enumeration members* (or *members*) and are functionally constants." msgstr "" +":attr:`!Color.RED`、:attr:`!Color.GREEN` 等屬性是\\ *列舉成員*\\ (或\\ *成員" +"*),並且使用上可以看作常數。" #: ../../library/enum.rst:58 msgid "" "The enum members have *names* and *values* (the name of :attr:`!Color.RED` " "is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" msgstr "" +"列舉成員有\\ *名稱*\\ 和\\ *值*\\ (:attr:`!Color.RED` 的名稱是 ``RED``,:" +"attr:`!Color.BLUE` 的值是 ``3`` 諸如此類)" #: ../../library/enum.rst:65 msgid "Module Contents" @@ -109,7 +115,7 @@ msgstr ":class:`EnumType`" #: ../../library/enum.rst:69 msgid "The ``type`` for Enum and its subclasses." -msgstr "" +msgstr "Enum 及其子類別的 ``type``。" #: ../../library/enum.rst:71 msgid ":class:`Enum`" @@ -117,7 +123,7 @@ msgstr ":class:`Enum`" #: ../../library/enum.rst:73 msgid "Base class for creating enumerated constants." -msgstr "" +msgstr "用來建立列舉常數的基礎類別。" #: ../../library/enum.rst:75 msgid ":class:`IntEnum`" @@ -128,6 +134,8 @@ msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`int`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,同時也是 :class:`int` 的子類別。(`備註 " +"`_)" #: ../../library/enum.rst:80 msgid ":class:`StrEnum`" @@ -138,6 +146,8 @@ msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`str`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,同時也是 :class:`str` 的子類別。(`備註 " +"`_)" #: ../../library/enum.rst:85 msgid ":class:`Flag`" @@ -148,6 +158,8 @@ msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operations without losing their :class:`Flag` membership." msgstr "" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`Flag` 的成員資格。" #: ../../library/enum.rst:90 msgid ":class:`IntFlag`" @@ -159,6 +171,9 @@ msgid "" "bitwise operators without losing their :class:`IntFlag` membership. :class:" "`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" msgstr "" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`IntFlag` 的成員資格。:class:`IntFlag` 的成員也是 :class:`int` 的子類別。(`" +"備註 `_)" #: ../../library/enum.rst:96 msgid ":class:`ReprEnum`" @@ -169,6 +184,8 @@ msgid "" "Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep " "the :class:`str() ` of the mixed-in type." msgstr "" +"由 :class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag` 所使用來保留這些混" +"合類型的 :class:`str() `。" #: ../../library/enum.rst:101 msgid ":class:`EnumCheck`" @@ -180,6 +197,8 @@ msgid "" "``UNIQUE``, for use with :func:`verify` to ensure various constraints are " "met by a given enumeration." msgstr "" +"一個有 ``CONTINUOUS``、``NAMED_FLAGS`` 及 ``UNIQUE`` 這些值的列舉,和 :func:" +"`verify` 一起使用來確保給定的列舉符合多種限制。" #: ../../library/enum.rst:107 msgid ":class:`FlagBoundary`" @@ -191,6 +210,8 @@ msgid "" "``KEEP`` which allows for more fine-grained control over how invalid values " "are dealt with in an enumeration." msgstr "" +"一個有 ``STRICT``、``CONFORM``、``EJECT`` 及 ``KEEP`` 這些值的列舉,允許列舉" +"對如何處理非法值做更細微的控制。" #: ../../library/enum.rst:113 msgid ":class:`auto`" @@ -202,6 +223,8 @@ msgid "" "`StrEnum` defaults to the lower-cased version of the member name, while " "other Enums default to 1 and increase from there." msgstr "" +"列舉成員的實例會被取代成合適的值。:class:`StrEnum` 預設是小寫版本的成員名稱," +"其它列舉則預設是 1 且往後遞增。" #: ../../library/enum.rst:119 msgid ":func:`~enum.property`" @@ -213,6 +236,8 @@ msgid "" "member names. The ``value`` and ``name`` attributes are implemented this " "way." msgstr "" +"允許 :class:`Enum` 成員擁有屬性且不會與成員名稱有衝突。``value`` 及 ``name`` " +"屬性是用這個方式來實作。" #: ../../library/enum.rst:125 msgid ":func:`unique`" @@ -221,7 +246,7 @@ msgstr ":func:`unique`" #: ../../library/enum.rst:127 msgid "" "Enum class decorator that ensures only one name is bound to any one value." -msgstr "" +msgstr "Enum 類別的裝飾器,用來確保任何值只有綁定到一個名稱上。" #: ../../library/enum.rst:129 msgid ":func:`verify`" @@ -231,7 +256,7 @@ msgstr ":func:`verify`" msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." -msgstr "" +msgstr "Enum 類別的裝飾器,用來檢查列舉上使用者所選的限制。" #: ../../library/enum.rst:134 msgid ":func:`member`" @@ -239,7 +264,7 @@ msgstr ":func:`member`" #: ../../library/enum.rst:136 msgid "Make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "讓 ``obj`` 變成成員。可以當作裝飾器使用。" #: ../../library/enum.rst:138 msgid ":func:`nonmember`" @@ -247,7 +272,7 @@ msgstr ":func:`nonmember`" #: ../../library/enum.rst:140 msgid "Do not make ``obj`` a member. Can be used as a decorator." -msgstr "" +msgstr "不讓 ``obj`` 變成成員。可以當作裝飾器使用。" #: ../../library/enum.rst:142 msgid ":func:`global_enum`" @@ -259,6 +284,8 @@ msgid "" "members as belonging to the module instead of its class, and export the enum " "members to the global namespace." msgstr "" +"修改列舉上的 :class:`str() ` 及 :func:`repr` ,讓成員顯示為屬於模組而不" +"是類別,並將該列舉成員匯出到全域命名空間。" #: ../../library/enum.rst:148 msgid ":func:`show_flag_values`" @@ -266,7 +293,7 @@ msgstr ":func:`show_flag_values`" #: ../../library/enum.rst:150 msgid "Return a list of all power-of-two integers contained in a flag." -msgstr "" +msgstr "回傳旗標 (flag) 裡包含的所有 2 的次方的整數串列。" #: ../../library/enum.rst:153 msgid "``Flag``, ``IntFlag``, ``auto``" @@ -282,7 +309,7 @@ msgstr "" #: ../../library/enum.rst:159 msgid "Data Types" -msgstr "" +msgstr "資料型別" #: ../../library/enum.rst:164 msgid "" @@ -290,6 +317,8 @@ msgid "" "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" +"*EnumType* 是\\ *列舉*\\ 的 :term:`metaclass`。*EnumType* 可以有子類別 -- 細" +"節請參考 :ref:`建立 EnumType 的子類別 `。" #: ../../library/enum.rst:168 msgid "" @@ -298,14 +327,17 @@ msgid "" "*enum*, as well as creating the enum members, properly handling duplicates, " "providing iteration over the enum class, etc." msgstr "" +"*EnumType* 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!__repr__`、:meth:`!" +"__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成員," +"並正確處理重複,提供列舉類別的疊代等等。" #: ../../library/enum.rst:175 msgid "This method is called in two different ways:" -msgstr "" +msgstr "這個方法可以用兩種不同的方式呼叫:" #: ../../library/enum.rst:177 msgid "to look up an existing member:" -msgstr "" +msgstr "查詢已存在的成員:" #: ../../library/enum.rst:0 msgid "cls" @@ -313,78 +345,78 @@ msgstr "cls" #: ../../library/enum.rst:179 ../../library/enum.rst:185 msgid "The enum class being called." -msgstr "" +msgstr "所呼叫的列舉類別。" #: ../../library/enum.rst:0 msgid "value" -msgstr "" +msgstr "value" #: ../../library/enum.rst:180 msgid "The value to lookup." -msgstr "" +msgstr "要查詢的值。" #: ../../library/enum.rst:182 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" -msgstr "" +msgstr "使用 ``cls`` 列舉來建立新列舉(只有在現有列舉沒有任何成員時)" #: ../../library/enum.rst:186 msgid "The name of the new Enum to create." -msgstr "" +msgstr "要建立的新列舉的名稱。" #: ../../library/enum.rst:0 msgid "names" -msgstr "" +msgstr "names" #: ../../library/enum.rst:187 msgid "The names/values of the members for the new Enum." -msgstr "" +msgstr "新列舉的成員的名稱/值。" #: ../../library/enum.rst:0 msgid "module" -msgstr "模組" +msgstr "module" #: ../../library/enum.rst:188 msgid "The name of the module the new Enum is created in." -msgstr "" +msgstr "新列舉要建立在哪個模組名稱下。" #: ../../library/enum.rst:0 msgid "qualname" -msgstr "" +msgstr "qualname" #: ../../library/enum.rst:189 msgid "The actual location in the module where this Enum can be found." -msgstr "" +msgstr "這個列舉在模組裡實際上的位置。" #: ../../library/enum.rst:0 msgid "type" -msgstr "" +msgstr "type" #: ../../library/enum.rst:190 msgid "A mix-in type for the new Enum." -msgstr "" +msgstr "新列舉的混合類型。" #: ../../library/enum.rst:0 msgid "start" -msgstr "" +msgstr "start" #: ../../library/enum.rst:191 msgid "The first integer value for the Enum (used by :class:`auto`)." -msgstr "" +msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" #: ../../library/enum.rst:0 msgid "boundary" -msgstr "" +msgstr "boundary" #: ../../library/enum.rst:192 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "" +msgstr "在位元操作時怎麼處理不在範圍內的值(只有 :class:`Flag` 會用到)" #: ../../library/enum.rst:196 msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "" +msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" #: ../../library/enum.rst:204 msgid "" @@ -392,50 +424,55 @@ msgid "" "members; until then, a ``TypeError`` will be raised if a non-Enum-member is " "used in a containment check." msgstr "" +"在 Python 3.12 中這可以檢查成員的值,而不只是檢查成員;在此之前,如果用非列舉" +"成員做屬於檢查會引發 ``TypeError``。" #: ../../library/enum.rst:210 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" msgstr "" +"回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" +"員名稱: ::" #: ../../library/enum.rst:218 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" -msgstr "" +msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" #: ../../library/enum.rst:225 msgid "Returns each member in *cls* in definition order::" -msgstr "" +msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" #: ../../library/enum.rst:232 msgid "Returns the number of member in *cls*::" -msgstr "" +msgstr "回傳 *cls* 的成員數量: ::" #: ../../library/enum.rst:239 msgid "Returns each member in *cls* in reverse definition order::" -msgstr "" +msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" #: ../../library/enum.rst:246 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" +"在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" #: ../../library/enum.rst:251 msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "" +msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" #: ../../library/enum.rst:255 msgid "The name used to define the ``Enum`` member::" -msgstr "" +msgstr "用來定義 ``Enum`` 成員的名稱: ::" #: ../../library/enum.rst:262 msgid "The value given to the ``Enum`` member::" -msgstr "" +msgstr "``Enum`` 成員給定的值: ::" #: ../../library/enum.rst:267 msgid "Enum member values" -msgstr "" +msgstr "列舉成員的值" #: ../../library/enum.rst:269 msgid "" @@ -443,12 +480,15 @@ msgid "" "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" +"成員的值可以是任何值::class:`int`、:class:`str` 等等。如果實際使用什麼值並不" +"重要,你可以使用 :class:`auto` 實例,它會為你選擇適合的值。更多細節請參考 :" +"class:`auto`。" #: ../../library/enum.rst:276 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." -msgstr "" +msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" #: ../../library/enum.rst:279 msgid "" @@ -456,58 +496,64 @@ msgid "" "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" +"``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" +"例請參考 :ref:`TimePeriod `。" #: ../../library/enum.rst:285 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" msgstr "" +"回傳 ``['__class__', '__doc__', '__module__', 'name', 'value']`` 及任何 " +"*self.__class__* 上定義的公開方法: ::" #: ../../library/enum.rst:0 msgid "name" -msgstr "" +msgstr "name" #: ../../library/enum.rst:306 msgid "The name of the member being defined (e.g. 'RED')." -msgstr "" +msgstr "定義的成員名稱(例如 'RED')。" #: ../../library/enum.rst:307 msgid "The start value for the Enum; the default is 1." -msgstr "" +msgstr "列舉的開始值,預設為 1。" #: ../../library/enum.rst:0 msgid "count" -msgstr "" +msgstr "count" #: ../../library/enum.rst:308 msgid "The number of members currently defined, not including this one." -msgstr "" +msgstr "已定義的成員數量,不包含目前這一個。" #: ../../library/enum.rst:0 msgid "last_values" -msgstr "" +msgstr "last_values" #: ../../library/enum.rst:309 msgid "A list of the previous values." -msgstr "" +msgstr "一個之前值的串列。" #: ../../library/enum.rst:311 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" -msgstr "" +msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" #: ../../library/enum.rst:327 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." -msgstr "" +msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" #: ../../library/enum.rst:332 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" +"一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" +"寫以實作客製化的搜尋行為: ::" #: ../../library/enum.rst:354 msgid "" From c1041f640e121824c13080fe24c6b83c6e4c159e Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Tue, 5 Sep 2023 16:47:56 +0800 Subject: [PATCH 070/105] Translate `howto/instrumentation.po` (#589) * translate `howto/instrumentation.po` * Apply suggestions from code review Co-authored-by: cschan <45995789+cschan1828@users.noreply.github.com> --------- Co-authored-by: cschan <45995789+cschan1828@users.noreply.github.com> --- howto/instrumentation.po | 122 ++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 34 deletions(-) diff --git a/howto/instrumentation.po b/howto/instrumentation.po index d5e62b6a96..29a7b4d68f 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -1,12 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. +# +# Translators: +# Matt Wang msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: 2018-07-15 18:56+0800\n" +"PO-Revision-Date: 2023-08-17 22:17+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -14,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../howto/instrumentation.rst:7 msgid "Instrumenting CPython with DTrace and SystemTap" -msgstr "" +msgstr "使用 DTrace 和 SystemTap 檢測 CPython" #: ../../howto/instrumentation.rst:0 msgid "author" @@ -37,18 +41,21 @@ msgid "" "what the processes on a computer system are doing. They both use domain-" "specific languages allowing a user to write scripts which:" msgstr "" +"DTrace 和 SystemTap 都是監測工具,各自都提供了一種檢查電腦系統之行程 " +"(process) 正在執行什麼操作的方法。它們都使用了領域限定 (domain-specific) 的語" +"言,允許使用者編寫以下腳本:" #: ../../howto/instrumentation.rst:16 msgid "filter which processes are to be observed" -msgstr "" +msgstr "過濾要觀察的行程" #: ../../howto/instrumentation.rst:17 msgid "gather data from the processes of interest" -msgstr "" +msgstr "收集來自感興趣之行程的資料" #: ../../howto/instrumentation.rst:18 msgid "generate reports on the data" -msgstr "" +msgstr "以這些資料產生報告" #: ../../howto/instrumentation.rst:20 msgid "" @@ -56,6 +63,9 @@ msgid "" "as \"probes\", that can be observed by a DTrace or SystemTap script, making " "it easier to monitor what the CPython processes on a system are doing." msgstr "" +"從 Python 3.6 開始,CPython 可以使用嵌入式「標記 (marker)」(也稱為「探針 " +"(probe)」)建置,可以透過 DTrace 或 SystemTap 腳本進行觀察,從而更輕鬆地監視" +"系統之 CPython 行程正在執行的操作。" #: ../../howto/instrumentation.rst:27 msgid "" @@ -64,10 +74,12 @@ msgid "" "DTrace scripts can stop working or work incorrectly without warning when " "changing CPython versions." msgstr "" +"DTrace 標記是 CPython 直譯器的實作細節。不保證 CPython 版本之間的探針相容性。" +"更改 CPython 版本時,DTrace 腳本可能會停止運作或錯誤地運作,而不會發出警告。" #: ../../howto/instrumentation.rst:34 msgid "Enabling the static markers" -msgstr "" +msgstr "啟用靜態標記" #: ../../howto/instrumentation.rst:36 msgid "" @@ -75,23 +87,23 @@ msgid "" "CPython with the embedded markers for SystemTap, the SystemTap development " "tools must be installed." msgstr "" +"macOS 內建了對 DTrace 的支援。在 Linux 上,為了建置帶有 SystemTap 嵌入標記的 " +"CPython,必須安裝 SystemTap 開發工具。" #: ../../howto/instrumentation.rst:40 msgid "On a Linux machine, this can be done via::" -msgstr "" +msgstr "在 Linux 機器上,這可以透過以下方式完成: ::" #: ../../howto/instrumentation.rst:44 msgid "or::" -msgstr "" -"或是:\n" -"\n" -"::" +msgstr "或是: ::" #: ../../howto/instrumentation.rst:49 msgid "" "CPython must then be :option:`configured with the --with-dtrace option <--" "with-dtrace>`:" msgstr "" +"然後 CPython 必須使用\\ :option:`配置 --with-dtrace 選項 <--with-dtrace>`:" #: ../../howto/instrumentation.rst:56 msgid "" @@ -99,12 +111,16 @@ msgid "" "in the background and listing all probes made available by the Python " "provider::" msgstr "" +"在 macOS 上,你可以透過在後台運行 Python 行程並列出 Python 發布者 (provider) " +"所提供的所有可用探針,以列出可用的 DTrace 探針: ::" #: ../../howto/instrumentation.rst:73 msgid "" "On Linux, you can verify if the SystemTap static markers are present in the " "built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" +"在 Linux 上,你可以透過查看二進位建置檔案中是否包含 \".note.stapsdt\" 部分來" +"驗證 SystemTap 靜態標記是否存在。" #: ../../howto/instrumentation.rst:81 msgid "" @@ -112,10 +128,12 @@ msgid "" "shared` configure option), you need to look instead within the shared " "library. For example::" msgstr "" +"如果你已將 Python 建置為共享函式庫(使用 :option:`--enable-shared` 配置選" +"項),則需要在共享函式庫中查找。例如: ::" #: ../../howto/instrumentation.rst:88 msgid "Sufficiently modern readelf can print the metadata::" -msgstr "" +msgstr "足夠現代化的 readelf 可以印出元資料 (metadata): ::" #: ../../howto/instrumentation.rst:125 msgid "" @@ -123,10 +141,12 @@ msgid "" "patch strategically placed machine code instructions to enable the tracing " "hooks used by a SystemTap script." msgstr "" +"上述元資料包含 SystemTap 的資訊,描述了它如何修補策略性放置的機器碼指令以啟" +"用 SystemTap 腳本使用的追蹤 hook。" #: ../../howto/instrumentation.rst:131 msgid "Static DTrace probes" -msgstr "" +msgstr "靜態 DTrace 探針" #: ../../howto/instrumentation.rst:133 msgid "" @@ -135,18 +155,20 @@ msgid "" "function called \"start\". In other words, import-time function invocations " "are not going to be listed:" msgstr "" +"以下範例示範 DTrace 腳本可用於顯示 Python 腳本的呼叫/回傳階層結構,僅在名為 " +"\"start\" 的函式的呼叫內進行追蹤。換句話說,引入時的函式呼叫不會被列出:" #: ../../howto/instrumentation.rst:172 ../../howto/instrumentation.rst:230 msgid "It can be invoked like this::" -msgstr "" +msgstr "可以這樣呼叫: ::" #: ../../howto/instrumentation.rst:176 ../../howto/instrumentation.rst:236 msgid "The output looks like this:" -msgstr "" +msgstr "輸出如下所示:" #: ../../howto/instrumentation.rst:201 msgid "Static SystemTap markers" -msgstr "" +msgstr "靜態 SystemTap 標記" #: ../../howto/instrumentation.rst:203 msgid "" @@ -154,33 +176,35 @@ msgid "" "markers directly. This requires you to explicitly state the binary file " "containing them." msgstr "" +"使用 SystemTap 整合的低階方法是直接使用靜態標記。這會需要你明確聲明包含它們的" +"二進位檔案。" #: ../../howto/instrumentation.rst:207 msgid "" "For example, this SystemTap script can be used to show the call/return " "hierarchy of a Python script:" -msgstr "" +msgstr "例如,此 SystemTap 腳本可用於顯示 Python 腳本的呼叫/回傳階層結構:" #: ../../howto/instrumentation.rst:247 msgid "where the columns are:" -msgstr "" +msgstr "其中的行 (column) 是:" #: ../../howto/instrumentation.rst:249 msgid "time in microseconds since start of script" -msgstr "" +msgstr "自腳本開始以來的時間(以微秒為單位)" #: ../../howto/instrumentation.rst:251 msgid "name of executable" -msgstr "" +msgstr "可執行檔案的名稱" #: ../../howto/instrumentation.rst:253 msgid "PID of process" -msgstr "" +msgstr "行程的 PID" #: ../../howto/instrumentation.rst:255 msgid "" "and the remainder indicates the call/return hierarchy as the script executes." -msgstr "" +msgstr "其餘部分表示腳本執行時的呼叫/回傳階層結構。" #: ../../howto/instrumentation.rst:257 msgid "" @@ -188,24 +212,28 @@ msgid "" "within the libpython shared library, and the probe's dotted path needs to " "reflect this. For example, this line from the above example:" msgstr "" +"對於以 :option:`--enable-shared` 建置的 CPython,標記被包含在 libpython 共享" +"函式庫中,並且探針的帶點路徑 (dotted path) 需要反映這一點。例如,上面範例中的" +"這一列:" #: ../../howto/instrumentation.rst:265 msgid "should instead read:" -msgstr "" +msgstr "應該改為讀取:" #: ../../howto/instrumentation.rst:271 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" -msgstr "" +msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 `)" #: ../../howto/instrumentation.rst:275 msgid "Available static markers" -msgstr "" +msgstr "可用的靜態標記" #: ../../howto/instrumentation.rst:279 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" +"該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:282 msgid "" @@ -213,22 +241,26 @@ msgid "" "tracing script as positional arguments, which must be accessed using " "``$arg1``, ``$arg2``, ``$arg3``:" msgstr "" +"檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、" +"``$arg2``、``$arg3`` 來存取:" #: ../../howto/instrumentation.rst:286 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" +"``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取" #: ../../howto/instrumentation.rst:288 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" +"``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取" #: ../../howto/instrumentation.rst:291 msgid "``$arg3`` : ``int`` line number" -msgstr "" +msgstr "``$arg3`` : ``int`` 列號" #: ../../howto/instrumentation.rst:295 msgid "" @@ -236,10 +268,12 @@ msgid "" "that execution of a Python function has ended (either via ``return``, or via " "an exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" +"該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 " +"``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:299 msgid "The arguments are the same as for :c:func:`!function__entry`" -msgstr "" +msgstr "引數與 :c:func:`!function__entry` 相同" #: ../../howto/instrumentation.rst:303 msgid "" @@ -247,34 +281,40 @@ msgid "" "equivalent of line-by-line tracing with a Python profiler. It is not " "triggered within C functions." msgstr "" +"該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不" +"在 C 函式內觸發。" #: ../../howto/instrumentation.rst:307 msgid "The arguments are the same as for :c:func:`!function__entry`." -msgstr "" +msgstr "引數與 :c:func:`!function__entry` 相同。" #: ../../howto/instrumentation.rst:311 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." msgstr "" +"當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃" +"描的一代 (generation),如 :func:`gc.collect()`。" #: ../../howto/instrumentation.rst:316 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." -msgstr "" +msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。" #: ../../howto/instrumentation.rst:321 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." -msgstr "" +msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。" #: ../../howto/instrumentation.rst:328 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." msgstr "" +"在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱," +"``arg1`` 代表模組是否已成功載入。" #: ../../howto/instrumentation.rst:337 msgid "" @@ -282,10 +322,12 @@ msgid "" "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " "tuple object." msgstr "" +"當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串" +"形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。" #: ../../howto/instrumentation.rst:345 msgid "SystemTap Tapsets" -msgstr "" +msgstr "SystemTap Tapsets" #: ../../howto/instrumentation.rst:347 msgid "" @@ -293,22 +335,28 @@ msgid "" "\"tapset\": SystemTap's equivalent of a library, which hides some of the " "lower-level details of the static markers." msgstr "" +"使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫," +"它隱藏了靜態標記的一些低階詳細資訊。" #: ../../howto/instrumentation.rst:351 msgid "Here is a tapset file, based on a non-shared build of CPython:" -msgstr "" +msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:" #: ../../howto/instrumentation.rst:374 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" msgstr "" +"如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/" +"tapset``),則這些額外的探測點將可被使用:" #: ../../howto/instrumentation.rst:380 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." msgstr "" +"該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸" +"發。" #: ../../howto/instrumentation.rst:385 msgid "" @@ -317,6 +365,8 @@ msgid "" "``return``, or via an exception). It is only triggered for pure-Python " "(bytecode) functions." msgstr "" +"這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束" +"(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。" #: ../../howto/instrumentation.rst:392 msgid "Examples" @@ -328,6 +378,8 @@ msgid "" "example given above of tracing the Python function-call hierarchy, without " "needing to directly name the static markers:" msgstr "" +"此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼" +"叫階層結構的範例,而無需直接命名靜態標記:" #: ../../howto/instrumentation.rst:412 msgid "" @@ -335,3 +387,5 @@ msgid "" "running CPython code, showing the top 20 most frequently entered bytecode " "frames, each second, across the whole system:" msgstr "" +"以下腳本使用上面的 tapset 來提供所有正在運行之 CPython 程式碼的近乎最高層視" +"角,顯示整個系統中每秒最常被進入的 20 個位元組碼幀 (bytecode frame):" From d444dc196869c68a870305d6e19bd61a78a59989 Mon Sep 17 00:00:00 2001 From: Jay <74105438+weijay0804@users.noreply.github.com> Date: Thu, 7 Sep 2023 00:51:34 +0800 Subject: [PATCH 071/105] Pycon sprints (#645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 翻譯#: ../../library/logging.rst:21 * ../../library/logging.rst:25 * 翻譯 #: ../../library/os.rst:11 * 翻譯 #: ../../library/logging.rst:28 * translate library/os.po #: ../../library/os.rst:31 * #: ../../library/os.rst:19 * ../../library/logging.rst:2.16.25 * translate library/os.po #: ../../library/logging.rst:321 ../../library/logging.rst:326 * #: ../../library/os.rst:19 * translate library/os.po #: ../../library/logging.rst:321 ../../library/logging.rst:326 library/logger.po #: ../../library/logging.rst:31 * small fixes * fix: 修改格式 * fix: 修改專有名詞翻譯 * Update os.po * Update library/logging.po Co-authored-by: Jay <74105438+weijay0804@users.noreply.github.com> * Update library/logging.po Co-authored-by: Jay <74105438+weijay0804@users.noreply.github.com> * Update library/os.po --------- Co-authored-by: kuoJac <11030115@fhsh.tp.edu.tw> Co-authored-by: Kiki Yang Co-authored-by: ddays Co-authored-by: Liam Lin Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> Co-authored-by: Wei-Hsiang (Matt) Wang --- library/logging.po | 21 ++++++++++++++------- library/os.po | 15 +++++++++++---- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/library/logging.po b/library/logging.po index f2ebe0de95..a01a4bd182 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 16:05+0000\n" +"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,10 +18,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/logging.rst:2 msgid ":mod:`logging` --- Logging facility for Python" -msgstr "" +msgstr ":mod:`logging` --- Python 的日誌記錄工具" #: ../../library/logging.rst:10 msgid "**Source code:** :source:`Lib/logging/__init__.py`" @@ -31,7 +32,7 @@ msgstr "**原始碼:**\\ :source:`Lib/logging/__init__.py`" msgid "" "This page contains the API reference information. For tutorial information " "and discussion of more advanced topics, see" -msgstr "" +msgstr "此頁面包含 API 參考訊息。有關教學流程和更進階的主題討論,請參閱" #: ../../library/logging.rst:19 msgid ":ref:`Basic Tutorial `" @@ -43,13 +44,15 @@ msgstr ":ref:`進階教學 `" #: ../../library/logging.rst:21 msgid ":ref:`Logging Cookbook `" -msgstr "" +msgstr ":ref:`日誌記錄手冊 `" #: ../../library/logging.rst:25 msgid "" "This module defines functions and classes which implement a flexible event " "logging system for applications and libraries." msgstr "" +"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系" +"統。" #: ../../library/logging.rst:28 msgid "" @@ -58,6 +61,10 @@ msgid "" "application log can include your own messages integrated with messages from " "third-party modules." msgstr "" +"由標準函式庫模組提供的日誌記錄 API 的主要好處是," +"所有的 Python 模組都能參與日誌記錄," +"因此您的應用程式日誌可以包含您自己的訊息," +"並與來自第三方模組的訊息整合在一起。" #: ../../library/logging.rst:33 msgid "The simplest example:" @@ -422,11 +429,11 @@ msgstr "" #: ../../library/logging.rst:321 msgid "Adds the specified filter *filter* to this logger." -msgstr "" +msgstr "在該 logger 內增加指定的 filter *filter*。" #: ../../library/logging.rst:326 msgid "Removes the specified filter *filter* from this logger." -msgstr "" +msgstr "在該 logger 內移除指定的 filter *filter*。" #: ../../library/logging.rst:331 msgid "" diff --git a/library/os.po b/library/os.po index c321c7d755..bfc519c83b 100644 --- a/library/os.po +++ b/library/os.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" -"PO-Revision-Date: 2022-10-16 08:11+0800\n" +"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/os.rst:2 msgid ":mod:`os` --- Miscellaneous operating system interfaces" @@ -37,10 +37,15 @@ msgid "" "mod:`tempfile` module, and for high-level file and directory handling see " "the :mod:`shutil` module." msgstr "" +"該模組提供了一種便利的方式來操作與作業系統相關的功能。如果你想讀取或寫入檔" +"案,請參閱 :func:`open` ,如果你想操作檔案路徑,請參閱 :mod:`os.path` 模組," +"如果你想透過命令列查看所有檔案中的所有內容,請查看 :mod:`fileinput` 模組。要" +"建立臨時檔案和目錄,請參閱 :mod:`tempfile` 模組,要操作高級檔案和目錄,請參" +"閱 :mod:`shutil` 模組。" #: ../../library/os.rst:19 msgid "Notes on the availability of these functions:" -msgstr "" +msgstr "關於這些功能的可用性說明:" #: ../../library/os.rst:21 msgid "" @@ -64,6 +69,8 @@ msgid "" "objects, and result in an object of the same type, if a path or file name is " "returned." msgstr "" +"所有接受檔案路徑和檔案名稱的函式皆接受位元組 (bytes) 和字串物件 (string " +"objects),且如果回傳檔案路徑或檔案名稱,則會產出相同型別的物件。" #: ../../library/os.rst:35 msgid "" From 09d513636a8b1fa3f1fec5f4fe26ec1ac33b4363 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Sun, 10 Sep 2023 21:27:58 +0800 Subject: [PATCH 072/105] Translate library/typing.po from 'Intro' to 'Type Alias' (#646) * Nearly Finish in Intro Section * Finish Translate from 'Intro' to 'Type Alias' * Update with Syntax Error * Fix with Reviewer's Comment * Fix with Reviewer's Comment @ rst:162 * Fix with Reviewer's Comment @ rst:117 * Updated with Reviewer's comment --- library/typing.po | 118 ++++++++++++++++++++++++++++++---------------- 1 file changed, 77 insertions(+), 41 deletions(-) diff --git a/library/typing.po b/library/typing.po index 88e5ca116c..3d666e2c27 100644 --- a/library/typing.po +++ b/library/typing.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-27 00:19+0000\n" -"PO-Revision-Date: 2018-05-23 16:14+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-09-05 14:49+0800\n" +"Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.1\n" #: ../../library/typing.rst:3 msgid ":mod:`typing` --- Support for type hints" -msgstr "" +msgstr ":mod:`typing` --- 支援型別提示" #: ../../library/typing.rst:16 msgid "**Source code:** :source:`Lib/typing.py`" @@ -32,6 +33,8 @@ msgid "" "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" +"Python 執行環境不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" +"型別檢查器、IDE、linter 等。" #: ../../library/typing.rst:26 msgid "" @@ -39,11 +42,13 @@ msgid "" "specification of the typing system, see :pep:`484`. For a simplified " "introduction to type hints, see :pep:`483`." msgstr "" +"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格" +",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" #: ../../library/typing.rst:31 msgid "" "The function below takes and returns a string and is annotated as follows::" -msgstr "" +msgstr "以下函式接受及回傳都是使用字串,且註解方式如下: ::" #: ../../library/typing.rst:36 msgid "" @@ -51,6 +56,8 @@ msgid "" "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" +"在函式 ``greeting`` 當中,引數 ``name`` 的型別應為 :class:`str` 且回傳的型別" +"也是 :class:`str`。該引數也可以接受其子型別。" #: ../../library/typing.rst:40 msgid "" @@ -58,28 +65,37 @@ msgid "" "`typing_extensions `_ package " "provides backports of these new features to older versions of Python." msgstr "" +"新功能會頻繁的新增至 ``typing`` 模組中。`typing_extensions `_ 套件為這些新功能提供了 backport(向後移植的)版" +"本,提供給舊版本的 Python 使用。" #: ../../library/typing.rst:44 msgid "" "For a summary of deprecated features and a deprecation timeline, please see " "`Deprecation Timeline of Major Features`_." msgstr "" +"棄用功能及其棄用時間線的簡介,請看\\ `Deprecation Timeline of Major " +"Features`_ \\。" #: ../../library/typing.rst:50 msgid "" "`\"Typing cheat sheet\" `_" msgstr "" +"`\"型別小抄 (Typing cheat sheet)\" `_" #: ../../library/typing.rst:50 msgid "A quick overview of type hints (hosted at the mypy docs)" -msgstr "" +msgstr "型別提示的快速預覽(發布於 mypy 的文件中)" #: ../../library/typing.rst:55 msgid "" "\"Type System Reference\" section of `the mypy docs `_" msgstr "" +"`mypy 文件 `_\\ 的 \"型別系" +"統參考資料 (Type System Reference)\" 章節" #: ../../library/typing.rst:53 msgid "" @@ -87,21 +103,27 @@ msgid "" "broadly apply to most Python type checkers. (Some parts may still be " "specific to mypy.)" msgstr "" +"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) " +"應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" #: ../../library/typing.rst:59 msgid "" "`\"Static Typing with Python\" `_" msgstr "" +"`\"Python 的靜態型別 (Static Typing)\" `_" #: ../../library/typing.rst:58 msgid "" "Type-checker-agnostic documentation written by the community detailing type " "system features, useful typing related tools and typing best practices." msgstr "" +"由社群編寫的跨平台型別檢查器文件 (type-checker-agnostic) 詳細描述加註型別系統" +"的功能、實用的加註型別衍伸工具、以及加註型別的最佳實踐 (best practice)。" #: ../../library/typing.rst:65 msgid "Relevant PEPs" -msgstr "" +msgstr "相關的 PEPs" #: ../../library/typing.rst:67 msgid "" @@ -109,91 +131,103 @@ msgid "" "number of PEPs have modified and enhanced Python's framework for type " "annotations:" msgstr "" +"自從 :pep:`484` 及 :pep:`483` 對於型別提示的基礎引入,多個 PEPs 針對型別註釋" +"的 Python 框架進行修訂及加強:" #: ../../library/typing.rst:77 msgid ":pep:`526`: Syntax for Variable Annotations" -msgstr "" +msgstr ":pep:`526`:變數註釋的語法" #: ../../library/typing.rst:77 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" -msgstr "" +msgstr "*引入*\\ 在定義函式之外的變數註釋語法,以及 :data:`ClassVar`" #: ../../library/typing.rst:80 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" +":pep:`544`: 協定:建構式子型別 (Structural Subtyping) (靜態鴨子型別," +"Static Duck Typing)" #: ../../library/typing.rst:80 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" +"*引入* :class:`Protocol` 以及 :func:`@runtime_checkable` " +"裝飾器 (decorator)" #: ../../library/typing.rst:83 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" +":pep:`585`:基礎彙集 (collection) 中的型別提示泛型 (Type Hinting Generics In " +"Standard Collections)" #: ../../library/typing.rst:83 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" +"*引入* :class:`types.GenericAlias` 以及使用基礎函式庫類別 :ref:`generic " +"types` 的能力" #: ../../library/typing.rst:85 msgid ":pep:`586`: Literal Types" -msgstr "" +msgstr ":pep:`586`:文字型別" #: ../../library/typing.rst:86 msgid "*Introducing* :data:`Literal`" -msgstr "" +msgstr "*引入* :data:`Literal`" #: ../../library/typing.rst:87 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" -msgstr "" +msgstr ":pep:`589`:TypedDict:含有一組固定 (fixed) 鍵值的型別提示字典" #: ../../library/typing.rst:88 msgid "*Introducing* :class:`TypedDict`" -msgstr "" +msgstr "*引入* :class:`TypedDict`" #: ../../library/typing.rst:89 msgid ":pep:`591`: Adding a final qualifier to typing" -msgstr "" +msgstr ":pep:`591`:為型別新增一個最終限定符 (final qualifier)" #: ../../library/typing.rst:90 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" -msgstr "" +msgstr "*引入* :data:`Final` 以及 :func:`@final` 裝飾器" #: ../../library/typing.rst:91 msgid ":pep:`593`: Flexible function and variable annotations" -msgstr "" +msgstr ":pep:`593`:彈性函式及變數註釋" #: ../../library/typing.rst:92 msgid "*Introducing* :data:`Annotated`" -msgstr "" +msgstr "*引入* :data:`Annotated`" #: ../../library/typing.rst:95 msgid ":pep:`604`: Allow writing union types as ``X | Y``" -msgstr "" +msgstr ":pep:`604`:允許寫入聯集型別 (union type) 為 ``X | Y``" #: ../../library/typing.rst:94 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" +"*引入* :data:`types.UnionType` 以及使用 binary-or 運算子 ``|`` 以表示\\ :ref:" +"`型別聯合 `\\ 的能力" #: ../../library/typing.rst:97 msgid ":pep:`612`: Parameter Specification Variables" -msgstr "" +msgstr ":pep:`612`:參數規格變數 (Parameter Specification Variable)" #: ../../library/typing.rst:98 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" -msgstr "" +msgstr "*引入* :class:`ParamSpec` 及 :data:`Concatenate`" #: ../../library/typing.rst:99 msgid ":pep:`613`: Explicit Type Aliases" -msgstr "" +msgstr ":pep:`613`:顯式型別別名 (Explicit Type Alias)" #: ../../library/typing.rst:100 msgid "*Introducing* :data:`TypeAlias`" @@ -201,7 +235,7 @@ msgstr "*引入* :data:`TypeAlias`" #: ../../library/typing.rst:101 msgid ":pep:`646`: Variadic Generics" -msgstr "" +msgstr ":pep:`646`:可變參數泛型 (Variadic Generic)" #: ../../library/typing.rst:102 msgid "*Introducing* :data:`TypeVarTuple`" @@ -209,7 +243,7 @@ msgstr "*引入* :data:`TypeVarTuple`" #: ../../library/typing.rst:103 msgid ":pep:`647`: User-Defined Type Guards" -msgstr "" +msgstr ":pep:`647`:使用者定義的型別防護 (Type Guard)" #: ../../library/typing.rst:104 msgid "*Introducing* :data:`TypeGuard`" @@ -219,7 +253,7 @@ msgstr "*引入* :data:`TypeGuard`" msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" -msgstr "" +msgstr ":pep:`655`:標記個別的 TypedDict 物件為必需的或可能遺失的" #: ../../library/typing.rst:106 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" @@ -227,7 +261,7 @@ msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" #: ../../library/typing.rst:107 msgid ":pep:`673`: Self type" -msgstr "" +msgstr ":pep:`673`:Self 型別" #: ../../library/typing.rst:108 msgid "*Introducing* :data:`Self`" @@ -235,7 +269,7 @@ msgstr "*引入* :data:`Self`" #: ../../library/typing.rst:109 msgid ":pep:`675`: Arbitrary Literal String Type" -msgstr "" +msgstr ":pep:`675`:任意的文本字串型別 (Arbitrary Literal String Type)" #: ../../library/typing.rst:110 msgid "*Introducing* :data:`LiteralString`" @@ -243,7 +277,7 @@ msgstr "*引入* :data:`LiteralString`" #: ../../library/typing.rst:111 msgid ":pep:`681`: Data Class Transforms" -msgstr "" +msgstr ":pep:`681`:資料類別轉換" #: ../../library/typing.rst:112 msgid "" @@ -252,27 +286,28 @@ msgstr "*引入* :func:`@dataclass_transform` 裝飾器" #: ../../library/typing.rst:114 msgid ":pep:`692`: Using ``TypedDict`` for more precise ``**kwargs`` typing" -msgstr "" +msgstr ":pep:`692`:為更精準的 ``**kwargs`` 型別使用 ``TypedDict``" #: ../../library/typing.rst:114 msgid "" "*Introducing* a new way of typing ``**kwargs`` with :data:`Unpack` and :data:" "`TypedDict`" msgstr "" +"*引入* 型別 ``**kwargs`` 的新方式 :data:`Unpack` 以及 :data:`TypedDict`" #: ../../library/typing.rst:116 msgid ":pep:`695`: Type Parameter Syntax" -msgstr "" +msgstr ":pep:`695`:型別參數語法" #: ../../library/typing.rst:117 msgid "" "*Introducing* builtin syntax for creating generic functions, classes, and " "type aliases." -msgstr "" +msgstr "*引入*\\ 建立泛型函式、類別、型別別名的內建語法。" #: ../../library/typing.rst:119 msgid ":pep:`698`: Adding an override decorator to typing" -msgstr "" +msgstr ":pep:`698`:為型別新增可覆寫的裝飾器" #: ../../library/typing.rst:119 msgid "*Introducing* the :func:`@override` decorator" @@ -280,7 +315,7 @@ msgstr "*引入* :func:`@override` 裝飾器" #: ../../library/typing.rst:129 msgid "Type aliases" -msgstr "" +msgstr "型別別名" #: ../../library/typing.rst:131 msgid "" @@ -288,24 +323,33 @@ msgid "" "an instance of :class:`TypeAliasType`. In this example, ``Vector`` and " "``list[float]`` will be treated equivalently by static type checkers::" msgstr "" +"一個型別別名被定義來使用 :keyword:`type` 陳述式,其建立了 :class:" +"`TypeAliasType` 的實例。在這個範例中,``Vector`` 及 ``list[float]`` 會被當作" +"和靜態型別檢查器一樣同等對待: ::" #: ../../library/typing.rst:144 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" +"型別別名對於簡化複雜的型別簽名 (complex type signature) 非常好用。舉例來" +"說: ::" #: ../../library/typing.rst:162 msgid "" "The :keyword:`type` statement is new in Python 3.12. For backwards " "compatibility, type aliases can also be created through simple assignment::" msgstr "" +":keyword:`type` 陳述式是 Python 3.12 的新功能。為了向後相容性,型別別名可以透" +"過簡單的賦值來建立: ::" #: ../../library/typing.rst:167 msgid "" "Or marked with :data:`TypeAlias` to make it explicit that this is a type " "alias, not a normal variable assignment::" msgstr "" +"或是用 :data:`TypeAlias` 標記,讓它明確的表示這是一個型別別名,而非一般的變數" +"賦值: ::" #: ../../library/typing.rst:177 msgid "NewType" @@ -407,9 +451,9 @@ msgstr "" #: ../../library/typing.rst:254 ../../library/typing.rst:2679 msgid "For example:" -msgstr "舉例來說" +msgstr "舉例來說:" -#: ../../library/typing.rst:272 +#: ../../library/typing.rst:272 ../../library/typing.rst:995 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 " @@ -992,14 +1036,6 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:995 -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, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " -"type must be a single type." -msgstr "" - #: ../../library/typing.rst:1000 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " From 6a0b70f6c024f6b0b53a638869bc1c9d0152e032 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:46:18 +0800 Subject: [PATCH 073/105] Update Translation of CSV Module from rst:286 to rst:370 (#639) * Translate from rst:286 to rst:370 * Update with Reviewer's Comment * update with TYPO!! * Update Term @ rst:300 --- library/csv.po | 216 ++++++++++++++++++++++++++----------------------- 1 file changed, 116 insertions(+), 100 deletions(-) diff --git a/library/csv.po b/library/csv.po index e4ecefd84c..fa84384b89 100644 --- a/library/csv.po +++ b/library/csv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2018-05-23 14:42+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2023-09-10 10:26+0800\n" +"Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: 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.3.2\n" #: ../../library/csv.rst:2 msgid ":mod:`csv` --- CSV File Reading and Writing" @@ -39,13 +40,12 @@ msgid "" "single module which can efficiently manipulate such data, hiding the details " "of reading and writing the data from the programmer." msgstr "" -"所謂的 CSV (Comma Separated Values) 檔案格式是試算表及資料庫中最常見的" -"匯入、匯出檔案格式。在嘗試以 :rfc:`4180` 中的標準化方式來描述格式之前," -"CSV 格式已經使用了許多年。由於缺少一個完善定義的標準,意味著各個不同的" -"應用程式會在資料產生及銷毀時有微妙的差別。這些不同之處使得從不同資料來源" -"處理 CSV 檔案時會非常擾人。儘管如此,雖然分隔符號和引號字元有所不同,整體的" -"格式非常相似,可以寫個單一模組來高效率的操作這樣的資料,讓程式設計師可以隱藏" -"讀取及寫入資料的細節。" +"所謂的 CSV (Comma Separated Values) 檔案格式是試算表及資料庫中最常見的匯入、" +"匯出檔案格式。在嘗試以 :rfc:`4180` 中的標準化方式來描述格式之前,CSV 格式已經" +"使用了許多年。由於缺少一個完善定義的標準,意味著各個不同的應用程式會在資料產" +"生及銷毀時有微妙的差別。這些不同之處使得從不同資料來源處理 CSV 檔案時會非常擾" +"人。儘管如此,雖然分隔符號和引號字元有所不同,整體的格式非常相似,可以寫個單" +"一模組來高效率的操作這樣的資料,讓程式設計師可以隱藏讀取及寫入資料的細節。" #: ../../library/csv.rst:28 msgid "" @@ -56,11 +56,10 @@ msgid "" "Excel. Programmers can also describe the CSV formats understood by other " "applications or define their own special-purpose CSV formats." msgstr "" -":mod:`csv` 模組實作透過 class 去讀取、寫入 CSV 格式的表格資料。" -"它讓程式設計師可以說出:「以 Excel 為首選並寫入該種格式的資料」或是" -"「從 Excel 產生的檔案來讀取資料」,且無需知道這是 Excel 所使用的 " -"CSV 格式等精確的細節。程式設計師也可以描述其他應用程式所理解的 CSV 格式" -"或他們自行定義具有特殊意義的 CSV 格式。" +":mod:`csv` 模組實作透過 class 去讀取、寫入 CSV 格式的表格資料。它讓程式設計師" +"可以說出:「以 Excel 為首選並寫入該種格式的資料」或是「從 Excel 產生的檔案來" +"讀取資料」,且無需知道這是 Excel 所使用的 CSV 格式等精確的細節。程式設計師也" +"可以描述其他應用程式所理解的 CSV 格式或他們自行定義具有特殊意義的 CSV 格式。" #: ../../library/csv.rst:35 msgid "" @@ -68,9 +67,9 @@ msgid "" "write sequences. Programmers can also read and write data in dictionary " "form using the :class:`DictReader` and :class:`DictWriter` classes." msgstr "" -":mod:`csv` 模組的 :class:`reader` 及 :class:`writer` 物件可以讀取" -"及寫入序列。程式設計師也可以透過 :class:`DictReader` 及 :class:`DictWriter`" -" class(類別)使用 dictionary (字典)讀取及寫入資料。" +":mod:`csv` 模組的 :class:`reader` 及 :class:`writer` 物件可以讀取及寫入序列。" +"程式設計師也可以透過 :class:`DictReader` 及 :class:`DictWriter` class(類別)" +"使用 dictionary (字典)讀取及寫入資料。" #: ../../library/csv.rst:41 msgid ":pep:`305` - CSV File API" @@ -103,18 +102,16 @@ msgid "" "in the current dialect. For full details about the dialect and formatting " "parameters, see section :ref:`csv-fmt-params`." msgstr "" -"回傳一個讀取器物件 (reader object) 並在指定的 *csvfile* 中逐行疊代 (iterate)," -"*csvfile* 可以成為任何物件並支援 :term:`iterator` 協定,每次呼叫 " -":meth:`!__next__` method(方法)時皆會回傳一個字串," -":term:`檔案物件 (file object) ` 及串列物件 (list object) " -"皆適用。如果 *csvfile* 是個檔案物件,則需開啟時使用 ``newline=''``。" -" [1]_ *dialect* 為一個可選填的參數,可以用為特定的 CSV dialect(方言)" -" 定義一組參數。它可能為 :class:`Dialect` 的一個子類別 (subclass) 的實例" -"或是由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。" -"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中覆寫 (override) " -"個別的格式化參數 (formatting parameter)。關於 dialect 及格式化參數的完整" -"說明,請見段落 :ref:`csv-fmt-params`。" - +"回傳一個讀取器物件 (reader object) 並在指定的 *csvfile* 中逐行疊代 " +"(iterate),*csvfile* 可以成為任何物件並支援 :term:`iterator` 協定,每次呼叫 :" +"meth:`!__next__` method(方法)時皆會回傳一個字串,:term:`檔案物件 (file " +"object) ` 及串列物件 (list object) 皆適用。如果 *csvfile* 是個檔" +"案物件,則需開啟時使用 ``newline=''``。 [1]_ *dialect* 為一個可選填的參數,可" +"以用為特定的 CSV dialect(方言) 定義一組參數。它可能為 :class:`Dialect` 的一" +"個子類別 (subclass) 的實例或是由 :func:`list_dialects` 函式回傳的多個字串中的" +"其中之一。另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中覆寫 " +"(override) 個別的格式化參數 (formatting parameter)。關於 dialect 及格式化參數" +"的完整說明,請見段落 :ref:`csv-fmt-params`。" #: ../../library/csv.rst:71 msgid "" @@ -124,14 +121,13 @@ msgid "" "into floats)." msgstr "" "從 CSV 檔案讀取的每一列會回傳為一個字串列表。除非格式選項 " -"``QUOTE_NONNUMERIC`` 有被指定(在這個情況之下,沒有引號的欄位" -"都會被轉換成浮點數),否則不會進行自動資料型別轉換。" +"``QUOTE_NONNUMERIC`` 有被指定(在這個情況之下,沒有引號的欄位都會被轉換成浮點" +"數),否則不會進行自動資料型別轉換。" #: ../../library/csv.rst:75 ../../library/csv.rst:105 ../../library/csv.rst:178 #: ../../library/csv.rst:216 msgid "A short usage example::" -msgstr "" -"一個簡短的用法範例: ::" +msgstr "一個簡短的用法範例: ::" #: ../../library/csv.rst:88 msgid "" @@ -153,18 +149,17 @@ msgid "" "stringified with :func:`str` before being written." msgstr "" "回傳一個寫入器物件 (writer object),其負責在給定的類檔案物件 (file-like " -"object) 上將使用者的資料轉換為分隔字串 (delimited string)。*csvfile* 可以為" -"具有 :func:`write` method 的任何物件。若 *csvfile* 為一個檔案物件,它應該使用" -" ``newline=''`` 開啟 [1]_ 。*dialect* 為一個可選填的參數,可以用為特定的" -" CSV dialect 定義一組參數。它可能為 :class:`Dialect` 的一個子類別的實例" -"或是由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。" -"另一個可選填的關鍵字引數 *fmtparams* 可以在這個 dialect 中覆寫" -"個別的格式化參數。關於 dialect 及格式化參數的完整說明,請見段落" -" :ref:`csv-fmt-params`。為了更容易與有實作 DB API 的模組互相接合," -":const:`None` 值會被寫成空字串。雖然這不是一個可逆的變換,這使得" -"dump (傾印) SQL NULL 資料值到 CSV 檔案上就無需讓 ``cursor.fetch*`` " -"呼叫回傳的資料進行預處理 (preprocessing)。其餘非字串的資料則會在寫入之前" -"用 :func:`str` 函式進行字串化 (stringify)。" +"object) 上將使用者的資料轉換為分隔字串 (delimited string)。*csvfile* 可以為具" +"有 :func:`write` method 的任何物件。若 *csvfile* 為一個檔案物件,它應該使用 " +"``newline=''`` 開啟 [1]_ 。*dialect* 為一個可選填的參數,可以用為特定的 CSV " +"dialect 定義一組參數。它可能為 :class:`Dialect` 的一個子類別的實例或是由 :" +"func:`list_dialects` 函式回傳的多個字串中的其中之一。另一個可選填的關鍵字引" +"數 *fmtparams* 可以在這個 dialect 中覆寫個別的格式化參數。關於 dialect 及格式" +"化參數的完整說明,請見段落 :ref:`csv-fmt-params`。為了更容易與有實作 DB API " +"的模組互相接合,:const:`None` 值會被寫成空字串。雖然這不是一個可逆的變換,這" +"使得dump (傾印) SQL NULL 資料值到 CSV 檔案上就無需讓 ``cursor.fetch*`` 呼叫" +"回傳的資料進行預處理 (preprocessing)。其餘非字串的資料則會在寫入之前用 :func:" +"`str` 函式進行字串化 (stringify)。" #: ../../library/csv.rst:117 msgid "" @@ -175,17 +170,17 @@ msgid "" "parameters, see section :ref:`csv-fmt-params`." msgstr "" "將 *dialect* 與 *name* 進行關聯 (associate)。*name* 必須為字串。這個 dialect " -"可以透過傳遞 :class:`Dialect` 的子類別進行指定;或是關鍵字引數 " -"*fmtparams*;或是以上兩者皆是,並透過關鍵字引數來覆寫 dialect 的參數。" -"關於 dialect 及格式化參數的完整說明,請見段落 :ref:`csv-fmt-params`。" +"可以透過傳遞 :class:`Dialect` 的子類別進行指定;或是關鍵字引數 *fmtparams*;" +"或是以上兩者皆是,並透過關鍵字引數來覆寫 dialect 的參數。關於 dialect 及格式" +"化參數的完整說明,請見段落 :ref:`csv-fmt-params`。" #: ../../library/csv.rst:126 msgid "" "Delete the dialect associated with *name* from the dialect registry. An :" "exc:`Error` is raised if *name* is not a registered dialect name." msgstr "" -"從 dialect 註冊表 (registry) 中,刪除與 *name* 關聯的 dialect。若 *name* 如" -"果不是註冊的 dialect 名稱,則會產生一個 :exc:`Error`。" +"從 dialect 註冊表 (registry) 中,刪除與 *name* 關聯的 dialect。若 *name* 如果" +"不是註冊的 dialect 名稱,則會產生一個 :exc:`Error`。" #: ../../library/csv.rst:132 msgid "" @@ -193,9 +188,9 @@ msgid "" "*name* is not a registered dialect name. This function returns an " "immutable :class:`Dialect`." msgstr "" -"回傳一個與 *name* 關聯的 dialect。若 *name* 如果不是註冊的 dialect 名稱" -",則會產生一個 :exc:`Error`。這個函式會回傳一個 immutable (不可變物件) " -":class:`Dialect`。" +"回傳一個與 *name* 關聯的 dialect。若 *name* 如果不是註冊的 dialect 名稱,則會" +"產生一個 :exc:`Error`。這個函式會回傳一個 immutable (不可變物件) :class:" +"`Dialect`。" #: ../../library/csv.rst:138 msgid "Return the names of all registered dialects." @@ -206,8 +201,8 @@ msgid "" "Returns the current maximum field size allowed by the parser. If *new_limit* " "is given, this becomes the new limit." msgstr "" -"回傳當前的剖析器 (parser) 允許的最大字串大小。如果 *new_limit* 被給定," -"則會變成新的最大字串大小。" +"回傳當前的剖析器 (parser) 允許的最大字串大小。如果 *new_limit* 被給定,則會變" +"成新的最大字串大小。" #: ../../library/csv.rst:147 msgid "The :mod:`csv` module defines the following classes:" @@ -219,8 +214,8 @@ msgid "" "information in each row to a :class:`dict` whose keys are given by the " "optional *fieldnames* parameter." msgstr "" -"建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映)" -" 到 :class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" +"建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映) 到 :" +"class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" #: ../../library/csv.rst:156 msgid "" @@ -229,9 +224,9 @@ msgid "" "fieldnames. Regardless of how the fieldnames are determined, the dictionary " "preserves their original ordering." msgstr "" -"參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了," -"檔案 *f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary" -"都會保留原始的排序。" +"參數 *fieldnames* 是一個 :term:`sequence`。如果 *fieldnames* 被省略了,檔案 " +"*f* 中第一列的值會被當作欄位標題。不管欄位標題是如何決定的,dictionary都會保" +"留原始的排序。" #: ../../library/csv.rst:161 msgid "" @@ -241,16 +236,15 @@ msgid "" "values are filled-in with the value of *restval* (which defaults to " "``None``)." msgstr "" -"如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 ``None``)" -"特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中的欄位比" -"欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。" +"如果一列資料中的欄位比欄位標題還多,其餘的資料及以 *restkey* (預設為 " +"``None``)特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中" +"的欄位比欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。" #: ../../library/csv.rst:167 msgid "" "All other optional or keyword arguments are passed to the underlying :class:" "`reader` instance." -msgstr "" -"所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" +msgstr "所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" #: ../../library/csv.rst:170 ../../library/csv.rst:214 msgid "" @@ -282,15 +276,15 @@ msgid "" "other optional or keyword arguments are passed to the underlying :class:" "`writer` instance." msgstr "" -"建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列上。" -"參數 *fieldnames* 是一個鍵值的 :mod:`sequence ` 且可以" -"辨識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。" -"如果 dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值" -"。如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* " -"中不存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定" -"為 ``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``," -"dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞" -"至下層的 :class:`writer` 實例。" +"建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列" +"上。參數 *fieldnames* 是一個鍵值的 :mod:`sequence ` 且可以辨" +"識 dictionary 中傳遞至 :meth:`writerow` method 寫入至檔案 *f* 中的值。如果 " +"dictionary 中缺少了 *fieldnames* 的鍵值,則會寫入選填的參數 *restval* 的值。" +"如果傳遞至 :meth:`writerow` method 的 dictionary 包含了一個 *fieldnames* 中不" +"存在的鍵值,選填的參數 *extrasaction* 可以指出該執行的動作。如果它被設定為 " +"``'raise'``,預設會觸發 :exc:`ValueError`。如果它被設定為 ``'ignore'``," +"dictionary 中額外的值會被忽略。其他選填的引數或關鍵字引數皆會傳遞至下層的 :" +"class:`writer` 實例。" #: ../../library/csv.rst:211 msgid "" @@ -309,9 +303,9 @@ msgid "" "`reader` and :class:`writer` instances behave." msgstr "" "類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、" -"空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出" -"有巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 " -":class:`writer` 的實例該如何表示。" +"空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出有" +"巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 :class:" +"`writer` 的實例該如何表示。" #: ../../library/csv.rst:238 msgid "" @@ -319,17 +313,17 @@ msgid "" "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" -"所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且" -"它們可以透過特定 :class:`reader` 及 :class:`writer` 類別的" -"初始器 (initializer, ``__init__``) 函式進行註冊,就像這樣: ::" +"所有可用的 :class:`Dialect` 名稱會透過 :func:`list_dialects` 回傳,且它們可以" +"透過特定 :class:`reader` 及 :class:`writer` 類別的初始器 (initializer, " +"``__init__``) 函式進行註冊,就像這樣: ::" #: ../../library/csv.rst:251 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." msgstr "" -"類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的" -" dialect 名稱為 ``'excel'``。" +"類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的 " +"dialect 名稱為 ``'excel'``。" #: ../../library/csv.rst:257 msgid "" @@ -337,8 +331,8 @@ msgid "" "generated TAB-delimited file. It is registered with the dialect name " "``'excel-tab'``." msgstr "" -"類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案" -"的慣用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。" +"類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案的慣" +"用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。" #: ../../library/csv.rst:263 msgid "" @@ -346,9 +340,9 @@ msgid "" "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " "quoting all fields. It is registered with the dialect name ``'unix'``." msgstr "" -"類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性," -"換句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的" -" dialect 名稱為 ``'unix'``。" +"類別 :class:`unix_dialect` 定義了透過 UNIX 系統產生的 CSV 檔案的慣用屬性,換" +"句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的 " +"dialect 名稱為 ``'unix'``。" #: ../../library/csv.rst:272 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." @@ -364,9 +358,9 @@ msgid "" "the parameters found. If the optional *delimiters* parameter is given, it " "is interpreted as a string containing possible valid delimiter characters." msgstr "" -"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參數。" -"如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、" -"有效的分隔字符。" +"分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參" +"數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分" +"隔字符。" #: ../../library/csv.rst:286 msgid "" @@ -375,40 +369,48 @@ msgid "" "each column, one of two key criteria will be considered to estimate if the " "sample contains a header:" msgstr "" +"如果第一列的文字顯示將作為一系列的欄位標題,會分析 sample 文字(假定他是 CSV " +"格式)並回傳 :const:`True`。檢查每一欄時,會考慮是否滿足兩個關鍵標準其中之" +"一,判斷 sample 是否包含標題:" #: ../../library/csv.rst:291 msgid "the second through n-th rows contain numeric values" -msgstr "" +msgstr "第二列至第 n 列包含數字" #: ../../library/csv.rst:292 msgid "" "the second through n-th rows contain strings where at least one value's " "length differs from that of the putative header of that column." msgstr "" +"第二列到第 n 列包含的字串中至少有一個值的長度與該行的假定標題的長度不同。" #: ../../library/csv.rst:295 msgid "" "Twenty rows after the first row are sampled; if more than half of columns + " "rows meet the criteria, :const:`True` is returned." msgstr "" +"對第一列之後的二十個列進行採樣;如果超過一半的行及列滿足條件,則返回 :const:" +"`True`。" #: ../../library/csv.rst:300 msgid "" "This method is a rough heuristic and may produce both false positives and " "negatives." msgstr "" +"此方法是一個粗略的啟發,可能會產生偽陽性及偽陰性 (false positives and " +"negatives)。" #: ../../library/csv.rst:303 msgid "An example for :class:`Sniffer` use::" -msgstr "" +msgstr "一個 :class:`Sniffer` 的使用範例: ::" #: ../../library/csv.rst:312 msgid "The :mod:`csv` module defines the following constants:" -msgstr "" +msgstr ":mod:`csv` 模組定義了以下常數:" #: ../../library/csv.rst:316 msgid "Instructs :class:`writer` objects to quote all fields." -msgstr "" +msgstr "引導 :class:`writer` 物件引用所有欄位。" #: ../../library/csv.rst:321 msgid "" @@ -416,16 +418,18 @@ msgid "" "special characters such as *delimiter*, *quotechar* or any of the characters " "in *lineterminator*." msgstr "" +"引導 :class:`writer` 物件只引用包含特殊字元的欄位,例如:*分隔符號*、*引號*、" +"或是 *分行符號* 的其他字元。" #: ../../library/csv.rst:328 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." -msgstr "" +msgstr "引導 :class:`writer` 物件引用所有非數字的欄位。" #: ../../library/csv.rst:330 msgid "" "Instructs :class:`reader` objects to convert all non-quoted fields to type " "*float*." -msgstr "" +msgstr "引導 :class:`reader` 物件轉換所有非引用的欄位為 *float*。" #: ../../library/csv.rst:335 msgid "" @@ -434,12 +438,15 @@ msgid "" "character. If *escapechar* is not set, the writer will raise :exc:`Error` " "if any characters that require escaping are encountered." msgstr "" +"引導 :class:`writer` 物件不得引用欄位。當前的 *分隔符號* 出現在輸出資料時,在" +"他之前的字元是當前的\\*逸出字元 (escape character)*。如果沒有設定\\*逸出字元" +"*\\,若遇到任何字元需要逸出,寫入器則會引發 :exc:`Error` 。" #: ../../library/csv.rst:340 msgid "" "Instructs :class:`reader` objects to perform no special processing of quote " "characters." -msgstr "" +msgstr "引導 :class:`reader` 物件不對引號進行特別處理。" #: ../../library/csv.rst:344 msgid "" @@ -447,12 +454,16 @@ msgid "" "``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " "value is ``None`` an empty (unquoted) string is written." msgstr "" +"引導 :class:`writer` 物件引用所有非 ``None`` 的欄位。這與 :data:`QUOTE_ALL` " +"相似,除非如果欄位值為 ``None``,該欄位則被寫成空(沒有引號)字串。" #: ../../library/csv.rst:348 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) field as " "None and to otherwise behave as :data:`QUOTE_ALL`." msgstr "" +"引導 :class:`reader` 物件將空(沒有引號)欄位直譯 (interpret) 為 None,否則會" +"和 :data:`QUOTE_ALL` 有相同的表現方式。" #: ../../library/csv.rst:353 msgid "" @@ -460,24 +471,29 @@ msgid "" "are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " "field value is ``None`` an empty (unquoted) string is written." msgstr "" +"引導 :class:`writer` 物件永遠在字串的欄位前後放置引號。這與 :data:" +"`QUOTE_NONNUMERIC` 相似,除非如果欄位值為 ``None``,該欄位則被寫成空(沒有引" +"號)字串。" #: ../../library/csv.rst:357 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) string as " "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" +"引導 :class:`reader` 物件將空(沒有引號)字串直譯為 ``None``,否則會和 :data:" +"`QUOTE_ALL` 有相同的表現方式。" #: ../../library/csv.rst:360 msgid "The :mod:`csv` module defines the following exception:" -msgstr "" +msgstr ":mod:`csv` 模組定義下列例外:" #: ../../library/csv.rst:365 msgid "Raised by any of the functions when an error is detected." -msgstr "" +msgstr "當偵測到錯誤時,任何函式都可以引發。" #: ../../library/csv.rst:370 msgid "Dialects and Formatting Parameters" -msgstr "" +msgstr "Dialect 與格式參數" #: ../../library/csv.rst:372 msgid "" From 61d570a8a994f4f4b630e340fc9721d32be145ad Mon Sep 17 00:00:00 2001 From: Payon Date: Thu, 14 Sep 2023 11:16:48 +0800 Subject: [PATCH 074/105] Translate mock from rst:212 to rst:369 (#647) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mock 翻譯 translate from 212 to 248 * docs: mock 翻譯 translate from 254 to 369 * docs: mock 翻譯 remove comment * docs: mock 翻譯 修正用詞 * docs: mock 翻譯 根據review修正 * docs: mock 翻譯 根據review修正 --- library/unittest.mock.po | 73 ++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 35249ae1b7..8067ed10cc 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-08-29 15:33+0800\n" +"PO-Revision-Date: 2023-09-09 23:07+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -198,9 +198,9 @@ msgid "" msgstr "" "為了確保測試中的 mock 物件與它們要替換的物件具有相同的 api,你可以使用\\ :" "ref:`自動規格 `\\ 。自動規格(auto-speccing)可以通過 patch " -"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 " -"mock 物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構" -"函式)都具有與真實物件相同的呼叫簽名(call signature)。" +"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 mock " +"物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構函" +"式)都具有與真實物件相同的呼叫簽名(call signature)。" #: ../../library/unittest.mock.rst:178 msgid "" @@ -229,6 +229,10 @@ msgid "" "attribute will always return the same mock. Mocks record how you use them, " "allowing you to make assertions about what your code has done to them." msgstr "" +":class:`Mock` 是一個彈性的的 mock 物件,旨在代替程式碼中 stubs 和 test " +"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性建立為新" +"的 mock [#]_。存取相同的屬性將永遠回傳相同的 mock。Mock 記錄了你如何使用它" +"們,允許你判定你的程式碼對 mock 的行為。" #: ../../library/unittest.mock.rst:218 msgid "" @@ -237,6 +241,9 @@ msgid "" "when you are mocking out objects that aren't callable: :class:" "`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" +":class:`MagicMock` 是 :class:`Mock` 的子類別,其中所有魔術方法均已預先建立並" +"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用::class:" +"`NonCallableMock` 和 :class:`NonCallableMagicMock`" #: ../../library/unittest.mock.rst:223 msgid "" @@ -245,12 +252,17 @@ msgid "" "will create a :class:`MagicMock` for you. You can specify an alternative " "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" +":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" +"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使" +"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:231 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" +"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 " +"Mock 物件的行為:" #: ../../library/unittest.mock.rst:234 msgid "" @@ -260,6 +272,10 @@ msgid "" "(excluding unsupported magic attributes and methods). Accessing any " "attribute not in this list will raise an :exc:`AttributeError`." msgstr "" +"*spec*:這可以是字串的 list(串列),也可以是充當 mock 物件規格的現有物件(類" +"別或實例)。如果傳入一個物件,則通過對該物件呼叫 dir 來形成字串的串列(不包括" +"不支援的魔術屬性和方法)。存取不在此串列中的任何屬性都會引發 :exc:" +"`AttributeError`\\ 。" #: ../../library/unittest.mock.rst:240 msgid "" @@ -267,6 +283,9 @@ msgid "" "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" +"如果 *spec* 是一個物件(而不是一個字串的串列),那麼 :attr:`~instance." +"__class__` 會回傳 spec 物件的類別。這允許 mocks 通過 :func:`isinstance` 測" +"試。" #: ../../library/unittest.mock.rst:244 msgid "" @@ -274,6 +293,9 @@ msgid "" "get an attribute on the mock that isn't on the object passed as *spec_set* " "will raise an :exc:`AttributeError`." msgstr "" +"*spec_set*:*spec* 的一個更嚴格的變體。如果使用 *spec_set*,在 mock 上嘗試 " +"*set* 或取得不在傳遞給 *spec_set* 的物件上的屬性將會引發 :exc:" +"`AttributeError`。" #: ../../library/unittest.mock.rst:248 msgid "" @@ -283,22 +305,29 @@ msgid "" "arguments as the mock, and unless it returns :data:`DEFAULT`, the return " "value of this function is used as the return value." msgstr "" +"*side_effect*:每當呼叫 Mock 時要呼叫的函式,參見 :attr:`~Mock.side_effect` " +"屬性,用於引發例外或動態變更回傳值。該函式使用與 mock 相同的引數呼叫,且除非" +"它回傳 :data:`DEFAULT`,否則此函式的回傳值將用作回傳值。" #: ../../library/unittest.mock.rst:254 msgid "" "Alternatively *side_effect* can be an exception class or instance. In this " "case the exception will be raised when the mock is called." msgstr "" +"*side_effect* 也可以是一個例外的類別或實例。在這種情況下,當呼叫 mock 時,該" +"例外將被引發。" #: ../../library/unittest.mock.rst:257 msgid "" "If *side_effect* is an iterable then each call to the mock will return the " "next value from the iterable." msgstr "" +"如果 *side_effect* 是一個可疊代物件,那麼對 mock 的每次呼叫將回傳可疊代物件中" +"的下一個值。" #: ../../library/unittest.mock.rst:260 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "" +msgstr "*side_effect* 可以通過將其設置為 ``None`` 來清除。" #: ../../library/unittest.mock.rst:262 msgid "" @@ -306,6 +335,8 @@ msgid "" "is a new Mock (created on first access). See the :attr:`return_value` " "attribute." msgstr "" +"*return_value*:當呼叫 mock 時回傳的值。預設情況下,這是一個新的 Mock(在首次" +"存取時建立)。參見 :attr:`return_value` 屬性。" #: ../../library/unittest.mock.rst:266 msgid "" @@ -314,6 +345,9 @@ msgid "" "`AttributeError`. Passing ``unsafe=True`` will allow access to these " "attributes." msgstr "" +"*unsafe*:預設情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 " +"*assrt* 開頭的屬性將引發 :exc:`AttributeError`。如果傳遞 ``unsafe=True``\\ ," +"將會允許存取這些屬性。" #: ../../library/unittest.mock.rst:273 msgid "" @@ -324,18 +358,26 @@ msgid "" "to access an attribute that doesn't exist will raise an :exc:" "`AttributeError`)." msgstr "" +"*wraps*:被 mock 物件包裝的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將" +"通過被包裝的物件(回傳真實結果)。存取 mock 的屬性將會回傳一個 Mock 物件,該" +"物件包裝了被包裝物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:" +"`AttributeError`\\ )。" #: ../../library/unittest.mock.rst:280 msgid "" "If the mock has an explicit *return_value* set then calls are not passed to " "the wrapped object and the *return_value* is returned instead." msgstr "" +"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裝的物件," +"而是回傳已設定好的 *return_value*。" #: ../../library/unittest.mock.rst:283 msgid "" "*name*: If the mock has a name then it will be used in the repr of the mock. " "This can be useful for debugging. The name is propagated to child mocks." msgstr "" +"*name*:如果 mock 有一個名稱,那麼它會被用於 mock 的 repr。這對於除錯很有用。" +"此名稱將被傳播到子 mocks。" #: ../../library/unittest.mock.rst:287 msgid "" @@ -343,30 +385,32 @@ msgid "" "used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" +"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在建立 mock 之後用" +"於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。" #: ../../library/unittest.mock.rst:293 msgid "Assert that the mock was called at least once." -msgstr "" +msgstr "確認 mock 至少被呼叫一次。" #: ../../library/unittest.mock.rst:304 msgid "Assert that the mock was called exactly once." -msgstr "" +msgstr "確認 mock 只被呼叫一次。" #: ../../library/unittest.mock.rst:322 msgid "" "This method is a convenient way of asserting that the last call has been " "made in a particular way:" -msgstr "" +msgstr "這個方法是一個便利的方式,用來斷言最後一次呼叫是以特定方式進行的:" #: ../../library/unittest.mock.rst:332 msgid "" "Assert that the mock was called exactly once and that call was with the " "specified arguments." -msgstr "" +msgstr "確認 mock 只被呼叫一次,且該次呼叫使用了指定的引數。" #: ../../library/unittest.mock.rst:347 msgid "assert the mock has been called with the specified arguments." -msgstr "" +msgstr "斷言 mock 已經被使用指定的引數呼叫。" #: ../../library/unittest.mock.rst:349 msgid "" @@ -375,24 +419,33 @@ msgid "" "the call is the most recent one, and in the case of :meth:" "`assert_called_once_with` it must also be the only call." msgstr "" +"這個斷言在 mock 曾經被呼叫過時通過,不同於 :meth:`assert_called_with` 和 :" +"meth:`assert_called_once_with`,他們針對的是最近的一次的呼叫,而且對於 :meth:" +"`assert_called_once_with`,最近一次的呼叫還必須也是唯一一次的呼叫。" #: ../../library/unittest.mock.rst:362 msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" +"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" +"呼叫。" #: ../../library/unittest.mock.rst:365 msgid "" "If *any_order* is false then the calls must be sequential. There can be " "extra calls before or after the specified calls." msgstr "" +"如果 *any_order* 為 false,那麼這些呼叫必須按照順序。在指定的呼叫之前或之後可" +"以有額外的呼叫。" #: ../../library/unittest.mock.rst:369 msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" +"如果 *any_order* 為 true,那麼這些呼叫可以以任何順序出現,但它們必須全部出現" +"在 :attr:`mock_calls` 中。" #: ../../library/unittest.mock.rst:384 msgid "Assert the mock was never called." From 4ae10097c101120d8ca273efc7791534d7232aae Mon Sep 17 00:00:00 2001 From: timmy0123 <48618505+timmy0123@users.noreply.github.com> Date: Sat, 16 Sep 2023 14:21:51 +0800 Subject: [PATCH 075/105] making on ssl (#655) * making on ssl * Update library/ssl.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/ssl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl.po b/library/ssl.po index 8dfb102e76..49ce25d5d1 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -90,7 +90,7 @@ msgstr "" #: ../../library/ssl.rst:53 msgid "Updated to support linking with OpenSSL 1.1.0" -msgstr "" +msgstr "更新以支援與 OpenSSL 1.1.0 進行連結" #: ../../library/ssl.rst:58 msgid "" From 5ee5eee64a88d68588121acb7d2aac959446256b Mon Sep 17 00:00:00 2001 From: "Jian An, Lin" <76777822+jianan1104@users.noreply.github.com> Date: Sat, 16 Sep 2023 15:18:04 +0800 Subject: [PATCH 076/105] feat(lib/re.po) translate `re` library (#657) * feat(lib/re.po) translate libary * Update library/re.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Lin Jian An Co-authored-by: Wei-Hsiang (Matt) Wang --- library/re.po | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/library/re.po b/library/re.po index 6474df8f64..9a3cea8d64 100644 --- a/library/re.po +++ b/library/re.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-27 00:04+0000\n" -"PO-Revision-Date: 2023-05-20 13:44+0800\n" +"PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.3.1\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/re.rst:2 msgid ":mod:`re` --- Regular expression operations" @@ -32,8 +32,7 @@ msgstr "**原始碼:**\\ :source:`Lib/re/`" msgid "" "This module provides regular expression matching operations similar to those " "found in Perl." -msgstr "" -"此模組提供類似於 Perl 中正規表示式的配對操作。" +msgstr "此模組提供類似於 Perl 中正規表示式的配對操作。" #: ../../library/re.rst:17 msgid "" @@ -44,10 +43,10 @@ msgid "" "substitution, the replacement string must be of the same type as both the " "pattern and the search string." msgstr "" -"被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-bit " -"字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是,你不能用 " -"byte 模式配對 Unicode 字串,反之亦然;同樣地,替換時,用來替換的字串必須與模式和搜尋" -"字串是相同的型別 (type)。" +"被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-" +"bit 字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是," +"你不能用 byte 模式配對 Unicode 字串,反之亦然;同樣地,替換時,用來替換的字串" +"必須與模式和搜尋字串是相同的型別 (type)。" #: ../../library/re.rst:24 msgid "" @@ -64,12 +63,13 @@ msgid "" "even if it is a valid escape sequence for a regular expression." msgstr "" "正規表示式使用反斜線字元 (``'\\'``) 表示特別的形式,或是使用特殊字元而不調用" -"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了一樣的目的使用同一個字元的" -"目的相衝突;舉例來說,為了配對一個反斜線文字,一個人可能需要寫 ``'\\\\\\\\'`` 當作" -"模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通的 Python 字串文本中" -"必須表示為 ``\\\\``。另外,請注意在 Python 的字串文本中使用反斜線的任何無效跳脫序列" -"目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變成一個 :exc:`SyntaxError`。" -"儘管它對正規表示式是一個有效的跳脫序列,這種行為也會發生。" +"它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了一樣的目的使用同一個" +"字元的目的相衝突;舉例來說,為了配對一個反斜線文字,一個人可能需要寫 ``'\\\\" +"\\\\'`` 當作模式字串,因為正規表示式必須是 ``\\\\``,而且每個反斜線在一個普通" +"的 Python 字串文本中必須表示為 ``\\\\``。另外,請注意在 Python 的字串文本中使" +"用反斜線的任何無效跳脫序列目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變" +"成一個 :exc:`SyntaxError`。儘管它對正規表示式是一個有效的跳脫序列,這種行為也" +"會發生。" #: ../../library/re.rst:36 msgid "" @@ -80,10 +80,10 @@ msgid "" "a newline. Usually patterns will be expressed in Python code using this raw " "string notation." msgstr "" -"解決方法是對正規表示式模式使用 Python 的原始字串符號;反斜線在一個以 ``'r'`` 為前綴" -"的字串文本中不會被用任何特別的方式處理。所以 ``r\"\\n\"`` 是一個兩個字元的字串,包含" -" ``'\\'`` 和 ``'n'``,同時 ``\"\\n\"`` 是一個單個字元的字串,包含一個換行符號。通常" -"模式在 Python 程式中會使用這個原始字串符號表示。" +"解決方法是對正規表示式模式使用 Python 的原始字串符號;反斜線在一個以 ``'r'`` " +"為前綴的字串文本中不會被用任何特別的方式處理。所以 ``r\"\\n\"`` 是一個兩個字" +"元的字串,包含 ``'\\'`` 和 ``'n'``,同時 ``\"\\n\"`` 是一個單個字元的字串,包" +"含一個換行符號。通常模式在 Python 程式中會使用這個原始字串符號表示。" #: ../../library/re.rst:43 msgid "" @@ -92,9 +92,9 @@ msgid "" "expressions `. The functions are shortcuts that don't require " "you to compile a regex object first, but miss some fine-tuning parameters." msgstr "" -"請務必注意到大部分的正規表示式操作是可以在模組層級的函式和 :ref:`" -"compiled regular expressions ` 中的方法使用的。這些函式是個捷徑" -"且讓你不需要先編譯一個正規表示式物件,但是會缺少一些微調參數。" +"請務必注意到大部分的正規表示式操作是可以在模組層級的函式和 :ref:`compiled " +"regular expressions ` 中的方法使用的。這些函式是個捷徑且讓你不需" +"要先編譯一個正規表示式物件,但是會缺少一些微調參數。" #: ../../library/re.rst:51 msgid "" @@ -102,12 +102,12 @@ msgid "" "an API compatible with the standard library :mod:`re` module, but offers " "additional functionality and a more thorough Unicode support." msgstr "" -"第三方的 `regex `_ 模組,有著和標準函式庫" -" :mod:`re` 模組相容的 API,但是提供額外的功能以及更完整的 Unicode 支援。" +"第三方的 `regex `_ 模組,有著和標準函式庫 :" +"mod:`re` 模組相容的 API,但是提供額外的功能以及更完整的 Unicode 支援。" #: ../../library/re.rst:59 msgid "Regular Expression Syntax" -msgstr "" +msgstr "正規表示式語法" #: ../../library/re.rst:61 msgid "" From 63090108f5ce13f2b28a79a8a8ec5540b2a147d1 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Mon, 18 Sep 2023 12:04:55 +0800 Subject: [PATCH 077/105] Translate `library/timeit.po` (#650) * feat: translate `library/timeit.po` * chore: update based on review comments --- library/timeit.po | 130 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 103 insertions(+), 27 deletions(-) diff --git a/library/timeit.po b/library/timeit.po index 3682b031a4..e750ba6a16 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -1,15 +1,16 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-27 18:15+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" -"Last-Translator: Adrian Liaw \n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -35,6 +36,11 @@ msgid "" "execution times. See also Tim Peters' introduction to the \"Algorithms\" " "chapter in the second edition of *Python Cookbook*, published by O'Reilly." msgstr "" +"該模組提供了一種對少量 Python 程式碼進行計時的簡單方法。它有一個\\ :ref:" +"`timeit-command-line-interface`\\ 和一個\\ :ref:`可呼叫介面 `,它避免了許多測量執行時間的常見陷阱。另請參閱由 O'Reilly 出版的 " +"*Python 錦囊妙計 (Python Cookbook)* 第二版中 Tim Peters 所寫的「演算法」章節" +"的介紹。" #: ../../library/timeit.rst:23 msgid "Basic Examples" @@ -45,14 +51,16 @@ msgid "" "The following example shows how the :ref:`timeit-command-line-interface` can " "be used to compare three different expressions:" msgstr "" +"以下範例展示了如何使用\\ :ref:`timeit-command-line-interface`\\ 來比較三個不" +"同的運算式:" #: ../../library/timeit.rst:37 msgid "This can be achieved from the :ref:`python-interface` with::" -msgstr "" +msgstr "這可以透過 :ref:`python-interface`\\ 來實現: ::" #: ../../library/timeit.rst:47 msgid "A callable can also be passed from the :ref:`python-interface`::" -msgstr "" +msgstr "也可以在 :ref:`python-interface`\\ 傳遞可呼叫物件: ::" #: ../../library/timeit.rst:52 msgid "" @@ -60,14 +68,16 @@ msgid "" "repetitions only when the command-line interface is used. In the :ref:" "`timeit-examples` section you can find more advanced examples." msgstr "" +"但請注意,僅當使用命令列界面時 :func:`.timeit` 才會自動確定重複次數。在\\ :" +"ref:`timeit-examples`\\ 章節中有更進階的範例。" #: ../../library/timeit.rst:60 msgid "Python Interface" -msgstr "" +msgstr "Python 介面" #: ../../library/timeit.rst:62 msgid "The module defines three convenience functions and a public class:" -msgstr "" +msgstr "該模組定義了三個便利函式和一個公開類別:" #: ../../library/timeit.rst:67 msgid "" @@ -76,6 +86,9 @@ msgid "" "executions. The optional *globals* argument specifies a namespace in which " "to execute the code." msgstr "" +"使用給定的陳述式、*setup* 程式碼和 *timer* 函式建立一個 :class:`Timer` 實例," +"並執行其 :meth:`.timeit` 方法 *number* 次。可選的 *globals* 引數指定會在其中" +"執行程式碼的命名空間。" #: ../../library/timeit.rst:72 ../../library/timeit.rst:83 #: ../../library/timeit.rst:122 @@ -89,24 +102,29 @@ msgid "" "count and *number* executions. The optional *globals* argument specifies a " "namespace in which to execute the code." msgstr "" +"使用給定的陳述式、*setup* 程式碼和 *timer* 函式建立一個 :class:`Timer` 實例," +"並使用給定的 *repeat* 計數和 *number* 來運行其 :meth:`.repeat` 方法。可選的 " +"*globals* 引數指定會在其中執行程式碼的命名空間。" #: ../../library/timeit.rst:86 ../../library/timeit.rst:183 msgid "Default value of *repeat* changed from 3 to 5." -msgstr "" +msgstr "*repeat* 的預設值從 3 更改為 5。" #: ../../library/timeit.rst:92 msgid "" "The default timer, which is always time.perf_counter(), returns float " "seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." msgstr "" +"預設計時器始終為 time.perf_counter(),會回傳浮點秒數。另一種方法是 time." +"perf_counter_ns,會回傳整數奈秒。" #: ../../library/timeit.rst:95 msgid ":func:`time.perf_counter` is now the default timer." -msgstr "" +msgstr ":func:`time.perf_counter` 現在是預設計時器。" #: ../../library/timeit.rst:101 msgid "Class for timing execution speed of small code snippets." -msgstr "" +msgstr "用於計時小程式碼片段執行速度的類別。" #: ../../library/timeit.rst:103 msgid "" @@ -118,6 +136,11 @@ msgid "" "will by default be executed within timeit's namespace; this behavior can be " "controlled by passing a namespace to *globals*." msgstr "" +"建構函式接受一個要計時的陳述式、一個用於設定的附加陳述式和一個計時器函式。兩" +"個陳述式都預設為 ``'pass'``;計時器函式會與平台相依(請參閱模組文件字串 (doc " +"string))。*stmt* 和 *setup* 還可以包含由 ``;`` 或換行符號分隔的多個陳述式," +"只要它們不包含多行字串文字即可。預設情況下,該陳述式將在 timeit 的命名空間內" +"執行;可以透過將命名空間傳遞給 *globals* 來控制此行為。" #: ../../library/timeit.rst:111 msgid "" @@ -125,12 +148,14 @@ msgid "" "timeit` method. The :meth:`.repeat` and :meth:`.autorange` methods are " "convenience methods to call :meth:`.timeit` multiple times." msgstr "" +"要測量第一個陳述式的執行時間,請使用 :meth:`.timeit` 方法。:meth:`.repeat` " +"和 :meth:`.autorange` 方法是多次呼叫 :meth:`.timeit` 的便捷方法。" #: ../../library/timeit.rst:115 msgid "" "The execution time of *setup* is excluded from the overall timed execution " "run." -msgstr "" +msgstr "*setup* 的執行時間不包含在總體運行計時中。" #: ../../library/timeit.rst:117 msgid "" @@ -139,6 +164,9 @@ msgid "" "will then be executed by :meth:`.timeit`. Note that the timing overhead is " "a little larger in this case because of the extra function calls." msgstr "" +"*stmt* 和 *setup* 參數還可以接受無需引數即可呼叫的物件。這會把對它們的呼叫嵌" +"入到計時器函式中,然後由 :meth:`.timeit` 去執行。請注意,在這種情況下,因有額" +"外的函式呼叫,時間開銷 (timing overhead) 會稍大一些。" #: ../../library/timeit.rst:127 msgid "" @@ -149,6 +177,9 @@ msgid "" "million. The main statement, the setup statement and the timer function to " "be used are passed to the constructor." msgstr "" +"主陳述式執行 *number* 次的時間。這將執行一次設定陳述式,然後回傳多次執行主陳" +"述式所需的時間。預設計時器以浮點形式回傳秒數,引數是迴圈的次數,預設為一百萬" +"次。要使用的主陳述式、設定陳述式和計時器函式會被傳遞給建構函式。" #: ../../library/timeit.rst:136 msgid "" @@ -159,10 +190,14 @@ msgid "" "so, GC can be re-enabled as the first statement in the *setup* string. For " "example::" msgstr "" +"預設情況下 :meth:`.timeit` 在計時期間會暫時關閉\\ :term:`垃圾回收 `。這種方法的優點是它使獨立時序更具可比較性,缺點是 GC 可能是被測" +"函式性能的重要組成部分。如果是這樣,可以將 GC 作為 *setup* 字串中的第一個陳述" +"式以重新啟用。例如: ::" #: ../../library/timeit.rst:148 msgid "Automatically determine how many times to call :meth:`.timeit`." -msgstr "" +msgstr "自動決定呼叫 :meth:`.timeit` 次數。" #: ../../library/timeit.rst:150 msgid "" @@ -172,16 +207,21 @@ msgid "" "numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " "at least 0.2 second." msgstr "" +"這是一個便捷函式,它重複呼叫 :meth:`.timeit` 以使得總時間 >= 0.2 秒,再回傳最" +"終結果(迴圈數、該迴圈數所花費的時間)。它以 1、2、5、10、20、50... 的順序遞" +"增數字來呼叫 :meth:`.timeit` 直到所用時間至少為 0.2 秒。" #: ../../library/timeit.rst:156 msgid "" "If *callback* is given and is not ``None``, it will be called after each " "trial with two arguments: ``callback(number, time_taken)``." msgstr "" +"如果有給定 *callback* 且不是 ``None``,則每次試驗後都會使用兩個引數來呼叫它:" +"``callback(number, time_taken)``。" #: ../../library/timeit.rst:164 msgid "Call :meth:`.timeit` a few times." -msgstr "" +msgstr "呼叫 :meth:`.timeit` 數次。" #: ../../library/timeit.rst:166 msgid "" @@ -190,6 +230,9 @@ msgid "" "call :meth:`.timeit`. The second argument specifies the *number* argument " "for :meth:`.timeit`." msgstr "" +"這是一個方便的函式,它會重複呼叫 :meth:`.timeit` 並回傳結果列表。第一個引數指" +"定呼叫 :meth:`.timeit` 的次數,第二個引數指定 :meth:`.timeit` 的 *number* 引" +"數。" #: ../../library/timeit.rst:173 msgid "" @@ -202,14 +245,19 @@ msgid "" "only number you should be interested in. After that, you should look at the " "entire vector and apply common sense rather than statistics." msgstr "" +"人們很容易根據結果向量來計算出平均值和標準差並將其作為依歸,然而這並不是很有" +"用。在典型情況下,最低值給出了機器運行給定程式碼片段的速度的下限;結果向量中" +"較高的值通常不是由 Python 速度的變化所引起,而是由干擾計時精度的其他行程造成" +"的。因此,結果中的 :func:`min` 可能是你應該感興趣的唯一數字。在解讀該數據後," +"你應該查看整個向量並以常識判讀而非單純仰賴統計資訊。" #: ../../library/timeit.rst:189 msgid "Helper to print a traceback from the timed code." -msgstr "" +msgstr "從計時程式碼印出回溯 (traceback) 的輔助函式。" #: ../../library/timeit.rst:191 msgid "Typical use::" -msgstr "" +msgstr "典型用法: ::" #: ../../library/timeit.rst:199 msgid "" @@ -217,51 +265,56 @@ msgid "" "compiled template will be displayed. The optional *file* argument directs " "where the traceback is sent; it defaults to :data:`sys.stderr`." msgstr "" +"相對於標準回溯的優點是,已編譯模板中的原始程式碼會被顯示出來。可選的 *file* " +"引數指定回溯的發送位置;它預設為 :data:`sys.stderr`。" #: ../../library/timeit.rst:207 msgid "Command-Line Interface" -msgstr "命令執行列介面" +msgstr "命令列介面" #: ../../library/timeit.rst:209 msgid "" "When called as a program from the command line, the following form is used::" -msgstr "" +msgstr "當從命令列作為程式呼叫時,請使用以下形式: ::" #: ../../library/timeit.rst:213 msgid "Where the following options are understood:" -msgstr "" +msgstr "其中之以下選項:" #: ../../library/timeit.rst:219 msgid "how many times to execute 'statement'" -msgstr "" +msgstr "執行 'statement' 多少次" #: ../../library/timeit.rst:223 msgid "how many times to repeat the timer (default 5)" -msgstr "" +msgstr "計時器重複多少次(預設 5)" #: ../../library/timeit.rst:227 msgid "statement to be executed once initially (default ``pass``)" -msgstr "" +msgstr "會在一開始執行一次的陳述式(預設為 ``pass``)" #: ../../library/timeit.rst:231 msgid "" "measure process time, not wallclock time, using :func:`time.process_time` " "instead of :func:`time.perf_counter`, which is the default" msgstr "" +"若要測量行程時間 (process time) 而非掛鐘時間 (wallclock time),請使用 :func:" +"`time.process_time` 而不是預設的 :func:`time.perf_counter`" #: ../../library/timeit.rst:238 msgid "" "specify a time unit for timer output; can select ``nsec``, ``usec``, " "``msec``, or ``sec``" msgstr "" +"指定定時器輸出的時間單位;可以選擇 ``nsec``、``usec``、``msec`` 或 ``sec``" #: ../../library/timeit.rst:244 msgid "print raw timing results; repeat for more digits precision" -msgstr "" +msgstr "印出原始計時結果;重複執行以獲得更高的數字精度" #: ../../library/timeit.rst:248 msgid "print a short usage message and exit" -msgstr "" +msgstr "印出一條簡短的使用訊息並退出" #: ../../library/timeit.rst:250 msgid "" @@ -270,6 +323,9 @@ msgid "" "quotes and using leading spaces. Multiple :option:`-s` options are treated " "similarly." msgstr "" +"可以透過將每一列陳述式指定為單獨引數來給定多列陳述式;可透過將引數括在引號中" +"並使用前導空格以實現縮進列 (indented lines)。多個 :option:`-s` 選項的作用類" +"似。" #: ../../library/timeit.rst:255 msgid "" @@ -277,6 +333,8 @@ msgid "" "trying increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until " "the total time is at least 0.2 seconds." msgstr "" +"如果沒有給定 :option:`-n`,則透過嘗試從序列 1, 2, 5, 10, 20, 50, ... 中增加數" +"字來計算合適的迴圈次數,直到總時間至少為 0.2 秒。" #: ../../library/timeit.rst:259 msgid "" @@ -287,6 +345,10 @@ msgid "" "probably enough in most cases. You can use :func:`time.process_time` to " "measure CPU time." msgstr "" +":func:`default_timer` 測量可能會受到同一台機器上運行的其他程式的影響,因此," +"當需要精確計時時,最好的做法是重複計時幾次並使用最佳時間。:option:`-r` 選項對" +"此很有用;在大多數情況下,預設的重複 5 次可能就足夠了。你可以使用 :func:" +"`time.process_time` 來測量 CPU 時間。" #: ../../library/timeit.rst:267 msgid "" @@ -295,6 +357,9 @@ msgid "" "it. The baseline overhead can be measured by invoking the program without " "arguments, and it might differ between Python versions." msgstr "" +"執行 pass 陳述式會產生一定的基本開銷。這裡的程式碼並不試圖隱藏它,但你應該意" +"識到它的存在。可以透過不帶引數呼叫程式來測量這個基本開銷,且不同 Python 版本" +"之間的基本開銷可能有所不同。" #: ../../library/timeit.rst:276 msgid "Examples" @@ -304,7 +369,7 @@ msgstr "範例" msgid "" "It is possible to provide a setup statement that is executed only once at " "the beginning:" -msgstr "" +msgstr "可以提供一個僅會在開始時執行一次的設定陳述式:" #: ../../library/timeit.rst:287 msgid "" @@ -315,10 +380,14 @@ msgid "" "within the best repetition of the timing loop. That is, the time the fastest " "repetition took divided by the loop count." msgstr "" +"輸出中包含三個欄位。迴圈計數,它告訴你每次計時迴圈內重複運行陳述式主體的次" +"數。重複計數(「最好的 5 次」)告訴你計時迴圈重複了多少次。以及最後陳述式主體" +"在計時迴圈的最佳的幾次重複執行內平均花費的時間。也就是說,最快的幾次重複執行" +"所花費的總時間除以迴圈計數。" #: ../../library/timeit.rst:302 msgid "The same can be done using the :class:`Timer` class and its methods::" -msgstr "" +msgstr "同樣可以使用 :class:`Timer` 類別及其方法來完成: ::" #: ../../library/timeit.rst:312 msgid "" @@ -326,12 +395,17 @@ msgid "" "lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" "keyword:`except` to test for missing and present object attributes:" msgstr "" +"以下範例展示如何對包含多行的運算式進行計時。這裡我們使用 :func:`hasattr` 與 :" +"keyword:`try`/:keyword:`except` 來測試缺失和存在之物件屬性並比較其花費 " +"(cost):" #: ../../library/timeit.rst:358 msgid "" "To give the :mod:`timeit` module access to functions you define, you can " "pass a *setup* parameter which contains an import statement::" msgstr "" +"要讓 :mod:`timeit` 模組存取你定義的函式,你可以傳遞一個包含 import 陳述式的 " +"*setup* 參數: ::" #: ../../library/timeit.rst:369 msgid "" @@ -339,11 +413,13 @@ msgid "" "will cause the code to be executed within your current global namespace. " "This can be more convenient than individually specifying imports::" msgstr "" +"另一種選擇是將 :func:`globals` 傳遞給 *globals* 參數,這將導致程式碼在當前的" +"全域命名空間中執行,這比單獨指定 import 更方便: ::" #: ../../library/timeit.rst:9 msgid "Benchmarking" -msgstr "" +msgstr "基準量測 (Benchmarking)" #: ../../library/timeit.rst:9 msgid "Performance" -msgstr "" +msgstr "性能表現" From c5d2c8ff3643607a8fa98db111d3a550ee1a6760 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:11:28 +0000 Subject: [PATCH 078/105] Sync with CPython 3.12 (#625) * sync with cpython f90099c3 * sync with cpython 7c7b2bfb * sync with cpython cdca4af6 * sync with cpython 036dd695 * sync with cpython 320d3982 * sync with cpython 8c3793a5 * sync with cpython 4dc07d2b * sync with cpython dcaacd90 * sync with cpython e0f60808 * sync with cpython 88ff02e3 * sync with cpython 495ba703 * sync with cpython ce370956 * sync with cpython af83d1e8 * sync with cpython af83d1e8 * sync with cpython 21f4e6d6 * sync with cpython 5b38bdea * sync with cpython 35c633d2 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/dict.po | 92 +- c-api/mapping.po | 61 +- c-api/object.po | 39 +- c-api/stable.po | 10 +- c-api/typeobj.po | 4 +- faq/gui.po | 35 +- howto/enum.po | 364 ++++--- howto/logging-cookbook.po | 462 ++++---- library/ast.po | 329 +++--- library/calendar.po | 284 +++-- library/configparser.po | 146 +-- library/datetime.po | 1148 ++++++++++---------- library/dis.po | 385 +++---- library/idle.po | 4 +- library/importlib.po | 429 +++++--- library/importlib.resources.abc.po | 55 +- library/importlib.resources.po | 74 +- library/inspect.po | 6 +- library/io.po | 356 ++++--- library/itertools.po | 4 +- library/multiprocessing.po | 4 +- library/os.po | 1568 ++++++++++++++-------------- library/pickle.po | 249 ++--- library/socket.po | 8 +- library/sqlite3.po | 4 +- library/sys.monitoring.po | 540 ++++++++++ library/sys.po | 30 +- library/threading.po | 32 +- library/tkinter.po | 4 +- library/traceback.po | 159 +-- library/turtle.po | 10 +- library/typing.po | 1503 +++++++++++++++----------- library/unittest.mock-examples.po | 272 ++--- library/unittest.po | 6 +- library/uuid.po | 193 ++-- library/zipapp.po | 34 +- reference/datamodel.po | 936 ++++++++--------- sphinx.po | 6 +- tutorial/appendix.po | 22 +- tutorial/classes.po | 8 +- using/configure.po | 599 ++++++----- whatsnew/3.12.po | 1337 +++++++++++++----------- 42 files changed, 6583 insertions(+), 5228 deletions(-) create mode 100644 library/sys.monitoring.po diff --git a/c-api/dict.po b/c-api/dict.po index 5f484c64d1..f2083a7490 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -87,15 +87,14 @@ msgid "" "to *val*." msgstr "" -#: ../../c-api/dict.rst:75 +#: ../../c-api/dict.rst:73 msgid "" -"Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is " -"created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " -"``-1`` on failure. This function *does not* steal a reference to *val*." +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:83 +#: ../../c-api/dict.rst:80 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be :term:" "`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " @@ -103,47 +102,47 @@ msgid "" "failure." msgstr "" -#: ../../c-api/dict.rst:91 +#: ../../c-api/dict.rst:88 msgid "" -"Remove the entry in dictionary *p* which has a key specified by the UTF-8 " -"encoded bytes string *key*. If *key* is not in the dictionary, :exc:" -"`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:99 +#: ../../c-api/dict.rst:95 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:104 +#: ../../c-api/dict.rst:100 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:108 +#: ../../c-api/dict.rst:104 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:115 +#: ../../c-api/dict.rst:111 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:123 +#: ../../c-api/dict.rst:119 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:129 +#: ../../c-api/dict.rst:125 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -151,7 +150,7 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:138 +#: ../../c-api/dict.rst:134 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -161,29 +160,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:148 +#: ../../c-api/dict.rst:144 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:153 +#: ../../c-api/dict.rst:149 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:158 +#: ../../c-api/dict.rst:154 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:166 +#: ../../c-api/dict.rst:162 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:172 +#: ../../c-api/dict.rst:168 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -197,21 +196,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:183 +#: ../../c-api/dict.rst:179 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:193 +#: ../../c-api/dict.rst:189 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:218 +#: ../../c-api/dict.rst:214 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -221,7 +220,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:228 +#: ../../c-api/dict.rst:224 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -230,7 +229,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:237 +#: ../../c-api/dict.rst:233 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -239,7 +238,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:251 +#: ../../c-api/dict.rst:247 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -247,21 +246,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:260 +#: ../../c-api/dict.rst:256 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: ../../c-api/dict.rst:268 +#: ../../c-api/dict.rst:264 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:276 +#: ../../c-api/dict.rst:272 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -269,7 +268,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:285 +#: ../../c-api/dict.rst:281 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -277,11 +276,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:289 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:295 +#: ../../c-api/dict.rst:291 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -290,7 +289,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:301 +#: ../../c-api/dict.rst:297 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -298,14 +297,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:307 +#: ../../c-api/dict.rst:303 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: ../../c-api/dict.rst:311 +#: ../../c-api/dict.rst:307 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -314,20 +313,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:317 +#: ../../c-api/dict.rst:313 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: ../../c-api/dict.rst:320 +#: ../../c-api/dict.rst:316 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/dict.rst:324 +#: ../../c-api/dict.rst:320 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -344,14 +343,13 @@ msgstr "object(物件)" msgid "dictionary" msgstr "dictionary(字典)" -#: ../../c-api/dict.rst:73 -msgid "PyUnicode_FromString()" -msgstr "PyUnicode_FromString()" - -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "len" msgstr "len" + +#~ msgid "PyUnicode_FromString()" +#~ msgstr "PyUnicode_FromString()" diff --git a/c-api/mapping.po b/c-api/mapping.po index cdfeb15ebe..b1d0f462d8 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -45,33 +45,30 @@ msgstr "" #: ../../c-api/mapping.rst:31 msgid "" -"Return element of *o* corresponding to the string *key* or ``NULL`` on " -"failure. This is the equivalent of the Python expression ``o[key]``. See " -"also :c:func:`PyObject_GetItem`." +"This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/mapping.rst:38 msgid "" -"Map the string *key* to the value *v* in object *o*. Returns ``-1`` on " -"failure. This is the equivalent of the Python statement ``o[key] = v``. See " -"also :c:func:`PyObject_SetItem`. This function *does not* steal a reference " -"to *v*." +"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:46 -msgid "" -"Remove the mapping for the object *key* from the object *o*. Return ``-1`` " -"on failure. This is equivalent to the Python statement ``del o[key]``. This " -"is an alias of :c:func:`PyObject_DelItem`." +#: ../../c-api/mapping.rst:45 +msgid "This is an alias of :c:func:`PyObject_DelItem`." msgstr "" -#: ../../c-api/mapping.rst:53 +#: ../../c-api/mapping.rst:50 msgid "" -"Remove the mapping for the string *key* from the object *o*. Return ``-1`` " -"on failure. This is equivalent to the Python statement ``del o[key]``." +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:59 ../../c-api/mapping.rst:70 +#: ../../c-api/mapping.rst:57 msgid "" "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " "This is equivalent to the Python expression ``key in o``. This function " @@ -80,37 +77,43 @@ msgstr "" #: ../../c-api/mapping.rst:63 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method will get suppressed. To get error reporting use :c:func:" +"Exceptions which occur when this calls :meth:`~object.__getitem__` method " +"are silently ignored. For proper error handling, use :c:func:" "`PyObject_GetItem()` instead." msgstr "" -#: ../../c-api/mapping.rst:74 +#: ../../c-api/mapping.rst:70 +msgid "" +"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/mapping.rst:76 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method and creating a temporary string object will get " -"suppressed. To get error reporting use :c:func:`PyMapping_GetItemString()` " -"instead." +"Exceptions that occur when this calls :meth:`~object.__getitem__` method or " +"while creating the temporary :class:`str` object are silently ignored. For " +"proper error handling, use :c:func:`PyMapping_GetItemString` instead." msgstr "" -#: ../../c-api/mapping.rst:81 +#: ../../c-api/mapping.rst:84 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:84 ../../c-api/mapping.rst:93 -#: ../../c-api/mapping.rst:102 +#: ../../c-api/mapping.rst:87 ../../c-api/mapping.rst:96 +#: ../../c-api/mapping.rst:105 msgid "Previously, the function returned a list or a tuple." msgstr "" -#: ../../c-api/mapping.rst:90 +#: ../../c-api/mapping.rst:93 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:99 +#: ../../c-api/mapping.rst:102 msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." diff --git a/c-api/object.po b/c-api/object.po index 26c27baa4c..87c4863fc6 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -43,7 +43,7 @@ msgid "" "the object is written instead of the :func:`repr`." msgstr "" -#: ../../c-api/object.rst:32 ../../c-api/object.rst:45 +#: ../../c-api/object.rst:32 msgid "" "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " "This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " @@ -57,6 +57,13 @@ msgid "" "handling, use :c:func:`PyObject_GetAttr` instead." msgstr "" +#: ../../c-api/object.rst:45 +msgid "" +"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:51 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" @@ -74,9 +81,9 @@ msgstr "" #: ../../c-api/object.rst:66 msgid "" -"Retrieve an attribute named *attr_name* from object *o*. Returns the " -"attribute value on success, or ``NULL`` on failure. This is the equivalent " -"of the Python expression ``o.attr_name``." +"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/object.rst:73 @@ -89,7 +96,7 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:83 ../../c-api/object.rst:95 +#: ../../c-api/object.rst:83 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " @@ -103,13 +110,20 @@ msgid "" "plans to remove it." msgstr "" -#: ../../c-api/object.rst:100 +#: ../../c-api/object.rst:95 +msgid "" +"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/object.rst:99 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: ../../c-api/object.rst:106 +#: ../../c-api/object.rst:105 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -121,12 +135,19 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:118 ../../c-api/object.rst:124 +#: ../../c-api/object.rst:117 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" +#: ../../c-api/object.rst:123 +msgid "" +"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:130 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " diff --git a/c-api/stable.po b/c-api/stable.po index 59f5a6d71c..ea5b0c5350 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,7 +48,7 @@ msgstr "" "行,反之亦然,但 3.9.x 和 3.10.x 就需要分別編譯。" #: ../../c-api/stable.rst:21 -msgid "There are two tiers of C API with different stability exepectations:" +msgid "There are two tiers of C API with different stability expectations:" msgstr "" #: ../../c-api/stable.rst:23 @@ -147,9 +147,9 @@ msgid "" "the specified one onward, and can use Limited API introduced up to that " "version." msgstr "" -"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:macro:" -"`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 Python 3 版" -"本一起使用,並且可以使用過去版本有引入的受限 API。" +"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:" +"macro:`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 " +"Python 3 版本一起使用,並且可以使用過去版本有引入的受限 API。" #: ../../c-api/stable.rst:83 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 7b0d0db989..1c052f1ed6 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+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-" @@ -2610,7 +2610,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1730 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" -"`PyType_GetDict` to retreive the dictionary for an arbitrary type." +"`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" #: ../../c-api/typeobj.rst:1736 diff --git a/faq/gui.po b/faq/gui.po index d22809b8e0..8526ae7277 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-09-05 00:04+0000\n" "PO-Revision-Date: 2022-07-02 17:41+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,11 +86,11 @@ msgstr "" #: ../../faq/gui.rst:45 msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " -"point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" -"`TK_LIBRARY` environment variables." +"point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" +"TK_LIBRARY` environment variables." msgstr "" "將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) " -"使用 :envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" +"使用 :envvar:`!TCL_LIBRARY` 和 :envvar:`!TK_LIBRARY` 環境變數來指向該函式庫。" #: ../../faq/gui.rst:49 msgid "" @@ -105,12 +105,12 @@ msgstr "" #: ../../faq/gui.rst:54 msgid "" -"Build Tix with SAM enabled, perform the appropriate call to :c:func:" -"`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " +"Build Tix with SAM enabled, perform the appropriate call to :c:func:`!" +"Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "with libtclsam and libtksam (you might include the Tix libraries as well)." msgstr "" "請在 SAM 被啟用的情況下建置 Tix,對 Python 的 :file:`Modules/tkappinit.c` 中" -"的 :c:func:`Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" +"的 :c:func:`!Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" "結(你可能也會 include Tix 函式庫)。" #: ../../faq/gui.rst:61 @@ -121,14 +121,14 @@ msgstr "是否可以在等待 I/O 時處理 Tk 事件?" msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " -"Xt's :c:func:`XtAddInput()` call, which allows you to register a callback " +"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " "function which will be called from the Tk mainloop when I/O is possible on a " "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" "在 Windows 以外的平台上是可以的,你甚至不需要執行緒!但是,你必須稍微調整你" -"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`XtAddInput()` 的函式呼叫,它能讓" -"你記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上" -"可進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" +"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`!XtAddInput` 的函式呼叫,它能讓你" +"記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上可" +"進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" "handlers`。" #: ../../faq/gui.rst:71 @@ -137,14 +137,15 @@ msgstr "我無法讓鍵繫結 (key binding) 在 Tkinter 中作用:為什麼? #: ../../faq/gui.rst:73 msgid "" -"An often-heard complaint is that event handlers bound to events with the :" -"meth:`bind` method don't get handled even when the appropriate key is " -"pressed." +"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " +"the appropriate key is pressed." msgstr "" -"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經繫結到帶有 :meth:" -"`bind` method 的事件,但在按下相應的鍵時,該事件也沒有被處理。" +"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經\\ :ref:`繫結" +"`\\ 到帶有 :meth:`!bind` method 的事件,但在按下相應的鍵" +"時,該事件也沒有被處理。" -#: ../../faq/gui.rst:76 +#: ../../faq/gui.rst:77 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " diff --git a/howto/enum.po b/howto/enum.po index 2c8f289c56..b8dfcac179 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -323,33 +323,41 @@ msgstr "" #: ../../howto/enum.rst:429 msgid "" -"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " -"then any value(s) given to the enum member will be passed into those " -"methods. See `Planet`_ for an example." +"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__`, " +"any value(s) given to the enum member will be passed into those methods. See " +"`Planet`_ for an example." msgstr "" #: ../../howto/enum.rst:435 +msgid "" +"The :meth:`__new__` method, if defined, is used during creation of the Enum " +"members; it is then replaced by Enum's :meth:`__new__` which is used after " +"class creation for lookup of existing members. See :ref:`new-vs-init` for " +"more details." +msgstr "" + +#: ../../howto/enum.rst:442 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:437 +#: ../../howto/enum.rst:444 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:444 +#: ../../howto/enum.rst:451 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:454 +#: ../../howto/enum.rst:461 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:472 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -357,78 +365,78 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:474 +#: ../../howto/enum.rst:481 msgid "Dataclass support" msgstr "" -#: ../../howto/enum.rst:476 +#: ../../howto/enum.rst:483 msgid "" "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:492 +#: ../../howto/enum.rst:499 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:495 +#: ../../howto/enum.rst:502 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:501 +#: ../../howto/enum.rst:508 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:503 +#: ../../howto/enum.rst:510 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:517 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:516 +#: ../../howto/enum.rst:523 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:519 +#: ../../howto/enum.rst:526 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:528 +#: ../../howto/enum.rst:535 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:533 +#: ../../howto/enum.rst:540 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:542 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:545 +#: ../../howto/enum.rst:552 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:548 +#: ../../howto/enum.rst:555 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -440,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:564 +#: ../../howto/enum.rst:571 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:568 +#: ../../howto/enum.rst:575 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -456,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:578 +#: ../../howto/enum.rst:585 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:582 +#: ../../howto/enum.rst:589 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -471,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:596 msgid "The complete signature is::" msgstr "" @@ -479,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:601 +#: ../../howto/enum.rst:608 msgid "What the new enum class will record as its name." msgstr "" @@ -487,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:603 +#: ../../howto/enum.rst:610 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:608 +#: ../../howto/enum.rst:615 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:612 +#: ../../howto/enum.rst:619 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:616 +#: ../../howto/enum.rst:623 msgid "or a mapping::" msgstr "" @@ -509,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:620 +#: ../../howto/enum.rst:627 msgid "name of module where new enum class can be found." msgstr "" @@ -517,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:622 +#: ../../howto/enum.rst:629 msgid "where in module new enum class can be found." msgstr "" @@ -525,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:624 +#: ../../howto/enum.rst:631 msgid "type to mix in to new enum class." msgstr "" @@ -533,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:626 +#: ../../howto/enum.rst:633 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:628 +#: ../../howto/enum.rst:635 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:640 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:643 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:645 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -557,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:659 +#: ../../howto/enum.rst:666 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:672 +#: ../../howto/enum.rst:679 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:683 +#: ../../howto/enum.rst:690 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:685 +#: ../../howto/enum.rst:692 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -580,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:694 +#: ../../howto/enum.rst:701 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:696 +#: ../../howto/enum.rst:703 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -594,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:711 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:707 +#: ../../howto/enum.rst:714 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:714 +#: ../../howto/enum.rst:721 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:730 +#: ../../howto/enum.rst:737 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:747 +#: ../../howto/enum.rst:754 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:752 +#: ../../howto/enum.rst:759 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:760 +#: ../../howto/enum.rst:767 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:771 +#: ../../howto/enum.rst:778 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:777 +#: ../../howto/enum.rst:784 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:786 +#: ../../howto/enum.rst:793 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:788 +#: ../../howto/enum.rst:795 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -657,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:797 +#: ../../howto/enum.rst:804 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:811 +#: ../../howto/enum.rst:818 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:823 +#: ../../howto/enum.rst:830 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:837 +#: ../../howto/enum.rst:844 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:847 +#: ../../howto/enum.rst:854 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -690,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:857 +#: ../../howto/enum.rst:864 msgid "Others" msgstr "" -#: ../../howto/enum.rst:859 +#: ../../howto/enum.rst:866 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:865 +#: ../../howto/enum.rst:872 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:868 +#: ../../howto/enum.rst:875 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:870 +#: ../../howto/enum.rst:877 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:873 +#: ../../howto/enum.rst:880 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:876 +#: ../../howto/enum.rst:883 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -733,163 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:887 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:883 +#: ../../howto/enum.rst:890 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:892 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:888 +#: ../../howto/enum.rst:895 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:900 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:899 +#: ../../howto/enum.rst:908 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:910 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:905 +#: ../../howto/enum.rst:914 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:932 +#: ../../howto/enum.rst:941 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly." +msgstr "" + +#: ../../howto/enum.rst:946 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:949 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:937 +#: ../../howto/enum.rst:951 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:940 +#: ../../howto/enum.rst:954 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:960 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:948 +#: ../../howto/enum.rst:962 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:963 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:965 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:953 +#: ../../howto/enum.rst:967 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:956 +#: ../../howto/enum.rst:970 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:958 +#: ../../howto/enum.rst:972 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:964 +#: ../../howto/enum.rst:978 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:981 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:984 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:971 +#: ../../howto/enum.rst:985 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:973 +#: ../../howto/enum.rst:987 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:991 +#: ../../howto/enum.rst:1005 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:996 +#: ../../howto/enum.rst:1010 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:998 +#: ../../howto/enum.rst:1012 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1019 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1007 +#: ../../howto/enum.rst:1021 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -899,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1018 +#: ../../howto/enum.rst:1032 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1020 +#: ../../howto/enum.rst:1034 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1046 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1048 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -923,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1043 +#: ../../howto/enum.rst:1057 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1061 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1063 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1060 +#: ../../howto/enum.rst:1074 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1076 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1080 +#: ../../howto/enum.rst:1094 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1082 +#: ../../howto/enum.rst:1096 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1093 +#: ../../howto/enum.rst:1107 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1109 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1110 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1097 +#: ../../howto/enum.rst:1111 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1116 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1125 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1130 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1127 +#: ../../howto/enum.rst:1141 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1147 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1156 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1145 +#: ../../howto/enum.rst:1159 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1146 +#: ../../howto/enum.rst:1160 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1161 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1163 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1164 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1153 +#: ../../howto/enum.rst:1167 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1175 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1177 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1182 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1184 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1064,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1179 +#: ../../howto/enum.rst:1193 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1195 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1077,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1201 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1203 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1090,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1209 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1211 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1217 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1205 +#: ../../howto/enum.rst:1219 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1225 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1221 +#: ../../howto/enum.rst:1235 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1224 +#: ../../howto/enum.rst:1238 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1128,149 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1231 +#: ../../howto/enum.rst:1245 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1233 +#: ../../howto/enum.rst:1247 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1236 +#: ../../howto/enum.rst:1250 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1252 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1253 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1242 +#: ../../howto/enum.rst:1256 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1262 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1264 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1276 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1278 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1274 +#: ../../howto/enum.rst:1288 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1290 +#: ../../howto/enum.rst:1304 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1292 +#: ../../howto/enum.rst:1306 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1318 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1320 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1337 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1333 +#: ../../howto/enum.rst:1347 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1352 +#: ../../howto/enum.rst:1366 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1358 +#: ../../howto/enum.rst:1372 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly -- e.g.::" +msgstr "" + +#: ../../howto/enum.rst:1379 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1360 +#: ../../howto/enum.rst:1381 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1394 +#: ../../howto/enum.rst:1415 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1396 +#: ../../howto/enum.rst:1417 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1421 +#: ../../howto/enum.rst:1442 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1427 +#: ../../howto/enum.rst:1448 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1429 +#: ../../howto/enum.rst:1450 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1458 +#: ../../howto/enum.rst:1479 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1460 +#: ../../howto/enum.rst:1481 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1479 +#: ../../howto/enum.rst:1500 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1502 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index aff058ea1a..31e89a4211 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-31 00:03+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-" @@ -357,9 +357,9 @@ msgstr "" msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " -"overriding the :meth:`~handlers.SocketHandler.makePickle` method and " -"implementing your alternative there, as well as adapting the above script to " -"use your alternative serialization." +"overriding the :meth:`~SocketHandler.makePickle` method and implementing " +"your alternative there, as well as adapting the above script to use your " +"alternative serialization." msgstr "" #: ../../howto/logging-cookbook.rst:770 @@ -509,11 +509,11 @@ msgid "" "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:841 +#: ../../howto/logging-cookbook.rst:843 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:843 +#: ../../howto/logging-cookbook.rst:845 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -529,11 +529,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:858 +#: ../../howto/logging-cookbook.rst:860 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:860 +#: ../../howto/logging-cookbook.rst:862 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -544,7 +544,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:868 +#: ../../howto/logging-cookbook.rst:870 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -555,7 +555,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:884 +#: ../../howto/logging-cookbook.rst:886 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -568,7 +568,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:893 +#: ../../howto/logging-cookbook.rst:895 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -579,21 +579,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:909 +#: ../../howto/logging-cookbook.rst:911 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:914 +#: ../../howto/logging-cookbook.rst:916 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." msgstr "" -#: ../../howto/logging-cookbook.rst:918 +#: ../../howto/logging-cookbook.rst:920 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:920 +#: ../../howto/logging-cookbook.rst:922 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -602,11 +602,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:929 +#: ../../howto/logging-cookbook.rst:931 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:931 +#: ../../howto/logging-cookbook.rst:933 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -615,7 +615,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:936 +#: ../../howto/logging-cookbook.rst:938 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -627,15 +627,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:982 +#: ../../howto/logging-cookbook.rst:984 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:1000 +#: ../../howto/logging-cookbook.rst:1002 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:1002 +#: ../../howto/logging-cookbook.rst:1004 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -645,7 +645,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1008 +#: ../../howto/logging-cookbook.rst:1010 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -656,18 +656,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:1015 +#: ../../howto/logging-cookbook.rst:1017 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1031 +#: ../../howto/logging-cookbook.rst:1033 msgid "" "We can simulate the multiple web applications by means of two simple " "classes, ``Request`` and ``WebApp``. These simulate how real threaded web " "applications work - each request is handled by a thread:" msgstr "" -#: ../../howto/logging-cookbook.rst:1175 +#: ../../howto/logging-cookbook.rst:1177 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -678,11 +678,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:1222 +#: ../../howto/logging-cookbook.rst:1224 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1224 +#: ../../howto/logging-cookbook.rst:1226 msgid "" "Each :class:`~Handler` has its own chain of filters. If you want to add " "contextual information to a :class:`LogRecord` without leaking it to other " @@ -690,11 +690,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:1251 +#: ../../howto/logging-cookbook.rst:1253 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1253 +#: ../../howto/logging-cookbook.rst:1255 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -710,7 +710,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1266 +#: ../../howto/logging-cookbook.rst:1268 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -721,7 +721,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:1276 +#: ../../howto/logging-cookbook.rst:1278 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -736,13 +736,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1392 +#: ../../howto/logging-cookbook.rst:1394 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1487 +#: ../../howto/logging-cookbook.rst:1489 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -752,34 +752,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1494 +#: ../../howto/logging-cookbook.rst:1496 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1496 +#: ../../howto/logging-cookbook.rst:1498 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: ../../howto/logging-cookbook.rst:1504 +#: ../../howto/logging-cookbook.rst:1506 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1510 +#: ../../howto/logging-cookbook.rst:1512 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1521 +#: ../../howto/logging-cookbook.rst:1523 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1528 +#: ../../howto/logging-cookbook.rst:1530 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1530 +#: ../../howto/logging-cookbook.rst:1532 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -791,27 +791,26 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1540 +#: ../../howto/logging-cookbook.rst:1542 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1545 +#: ../../howto/logging-cookbook.rst:1547 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " "and when that many files have been created, rotate the files so that the " "number of files and the size of the files both remain bounded. For this " -"usage pattern, the logging package provides a :class:`~handlers." -"RotatingFileHandler`::" +"usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1577 +#: ../../howto/logging-cookbook.rst:1579 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1589 +#: ../../howto/logging-cookbook.rst:1591 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -819,17 +818,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1594 +#: ../../howto/logging-cookbook.rst:1596 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: ../../howto/logging-cookbook.rst:1600 +#: ../../howto/logging-cookbook.rst:1604 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1602 +#: ../../howto/logging-cookbook.rst:1606 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -838,7 +837,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1608 +#: ../../howto/logging-cookbook.rst:1612 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -851,14 +850,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1642 +#: ../../howto/logging-cookbook.rst:1646 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: ../../howto/logging-cookbook.rst:1650 +#: ../../howto/logging-cookbook.rst:1654 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -874,7 +873,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1663 +#: ../../howto/logging-cookbook.rst:1667 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -883,7 +882,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1687 +#: ../../howto/logging-cookbook.rst:1691 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -894,21 +893,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1695 +#: ../../howto/logging-cookbook.rst:1699 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: ../../howto/logging-cookbook.rst:1717 +#: ../../howto/logging-cookbook.rst:1721 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: ../../howto/logging-cookbook.rst:1721 +#: ../../howto/logging-cookbook.rst:1725 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -919,23 +918,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1729 +#: ../../howto/logging-cookbook.rst:1733 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1760 +#: ../../howto/logging-cookbook.rst:1764 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1769 +#: ../../howto/logging-cookbook.rst:1773 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1771 +#: ../../howto/logging-cookbook.rst:1775 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -946,13 +945,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1778 +#: ../../howto/logging-cookbook.rst:1782 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1781 +#: ../../howto/logging-cookbook.rst:1785 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -961,27 +960,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1787 +#: ../../howto/logging-cookbook.rst:1791 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1790 +#: ../../howto/logging-cookbook.rst:1794 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1793 +#: ../../howto/logging-cookbook.rst:1797 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1797 +#: ../../howto/logging-cookbook.rst:1801 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -989,7 +988,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1802 +#: ../../howto/logging-cookbook.rst:1806 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -998,7 +997,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1810 +#: ../../howto/logging-cookbook.rst:1814 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -1008,7 +1007,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1816 +#: ../../howto/logging-cookbook.rst:1820 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -1018,7 +1017,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1823 +#: ../../howto/logging-cookbook.rst:1827 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -1026,7 +1025,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1836 +#: ../../howto/logging-cookbook.rst:1840 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -1036,70 +1035,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1847 +#: ../../howto/logging-cookbook.rst:1852 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1849 +#: ../../howto/logging-cookbook.rst:1854 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1868 +#: ../../howto/logging-cookbook.rst:1873 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1886 +#: ../../howto/logging-cookbook.rst:1891 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1888 +#: ../../howto/logging-cookbook.rst:1893 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1915 +#: ../../howto/logging-cookbook.rst:1920 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1922 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1921 +#: ../../howto/logging-cookbook.rst:1928 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1923 +#: ../../howto/logging-cookbook.rst:1930 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1986 +#: ../../howto/logging-cookbook.rst:1993 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1988 +#: ../../howto/logging-cookbook.rst:1995 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2019 +#: ../../howto/logging-cookbook.rst:2026 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2032 +#: ../../howto/logging-cookbook.rst:2039 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2034 +#: ../../howto/logging-cookbook.rst:2041 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1141,7 +1140,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2039 +#: ../../howto/logging-cookbook.rst:2046 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1154,17 +1153,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2049 +#: ../../howto/logging-cookbook.rst:2056 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2261 +#: ../../howto/logging-cookbook.rst:2268 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2263 +#: ../../howto/logging-cookbook.rst:2270 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1173,7 +1172,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2269 +#: ../../howto/logging-cookbook.rst:2276 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1181,7 +1180,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2275 +#: ../../howto/logging-cookbook.rst:2282 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1190,33 +1189,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2281 +#: ../../howto/logging-cookbook.rst:2288 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2287 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2290 +#: ../../howto/logging-cookbook.rst:2297 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2294 +#: ../../howto/logging-cookbook.rst:2301 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2298 +#: ../../howto/logging-cookbook.rst:2305 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1225,11 +1224,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2305 +#: ../../howto/logging-cookbook.rst:2312 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2307 +#: ../../howto/logging-cookbook.rst:2314 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1241,31 +1240,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2331 +#: ../../howto/logging-cookbook.rst:2338 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2337 ../../howto/logging-cookbook.rst:2379 +#: ../../howto/logging-cookbook.rst:2344 ../../howto/logging-cookbook.rst:2386 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2340 +#: ../../howto/logging-cookbook.rst:2347 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2373 +#: ../../howto/logging-cookbook.rst:2380 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2388 +#: ../../howto/logging-cookbook.rst:2395 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2390 +#: ../../howto/logging-cookbook.rst:2397 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1275,24 +1274,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2404 +#: ../../howto/logging-cookbook.rst:2411 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2437 +#: ../../howto/logging-cookbook.rst:2444 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2484 +#: ../../howto/logging-cookbook.rst:2491 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2494 +#: ../../howto/logging-cookbook.rst:2501 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1301,17 +1300,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2500 +#: ../../howto/logging-cookbook.rst:2507 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2512 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2509 +#: ../../howto/logging-cookbook.rst:2516 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1319,25 +1318,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2521 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2518 +#: ../../howto/logging-cookbook.rst:2525 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2528 +#: ../../howto/logging-cookbook.rst:2535 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2530 +#: ../../howto/logging-cookbook.rst:2537 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1348,7 +1347,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2537 +#: ../../howto/logging-cookbook.rst:2544 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1363,7 +1362,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2556 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1371,7 +1370,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2560 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1379,11 +1378,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2560 +#: ../../howto/logging-cookbook.rst:2567 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2562 +#: ../../howto/logging-cookbook.rst:2569 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1398,17 +1397,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2573 +#: ../../howto/logging-cookbook.rst:2580 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2578 +#: ../../howto/logging-cookbook.rst:2585 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2580 +#: ../../howto/logging-cookbook.rst:2587 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1418,7 +1417,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2605 +#: ../../howto/logging-cookbook.rst:2612 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1429,17 +1428,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2613 +#: ../../howto/logging-cookbook.rst:2620 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2627 +#: ../../howto/logging-cookbook.rst:2634 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2634 +#: ../../howto/logging-cookbook.rst:2641 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1451,11 +1450,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2648 +#: ../../howto/logging-cookbook.rst:2655 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2650 +#: ../../howto/logging-cookbook.rst:2657 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1470,22 +1469,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2703 +#: ../../howto/logging-cookbook.rst:2710 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:2718 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2713 +#: ../../howto/logging-cookbook.rst:2720 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2715 +#: ../../howto/logging-cookbook.rst:2722 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1495,7 +1494,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2722 +#: ../../howto/logging-cookbook.rst:2729 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1504,11 +1503,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2731 +#: ../../howto/logging-cookbook.rst:2738 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2733 +#: ../../howto/logging-cookbook.rst:2740 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1516,22 +1515,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2774 +#: ../../howto/logging-cookbook.rst:2781 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2781 +#: ../../howto/logging-cookbook.rst:2788 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2788 +#: ../../howto/logging-cookbook.rst:2795 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2790 +#: ../../howto/logging-cookbook.rst:2797 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1548,24 +1547,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2832 +#: ../../howto/logging-cookbook.rst:2839 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2834 +#: ../../howto/logging-cookbook.rst:2841 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2842 +#: ../../howto/logging-cookbook.rst:2849 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2844 +#: ../../howto/logging-cookbook.rst:2851 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1575,7 +1574,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2851 +#: ../../howto/logging-cookbook.rst:2858 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1588,7 +1587,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2861 +#: ../../howto/logging-cookbook.rst:2868 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1597,7 +1596,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2867 +#: ../../howto/logging-cookbook.rst:2874 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1609,30 +1608,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2875 +#: ../../howto/logging-cookbook.rst:2882 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2938 +#: ../../howto/logging-cookbook.rst:2945 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2968 +#: ../../howto/logging-cookbook.rst:2975 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2972 +#: ../../howto/logging-cookbook.rst:2979 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2982 +#: ../../howto/logging-cookbook.rst:2989 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2984 +#: ../../howto/logging-cookbook.rst:2991 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1643,7 +1642,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3056 +#: ../../howto/logging-cookbook.rst:3063 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1651,17 +1650,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3064 +#: ../../howto/logging-cookbook.rst:3071 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3066 +#: ../../howto/logging-cookbook.rst:3073 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3075 +#: ../../howto/logging-cookbook.rst:3082 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1669,21 +1668,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3118 +#: ../../howto/logging-cookbook.rst:3125 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3125 +#: ../../howto/logging-cookbook.rst:3132 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3132 +#: ../../howto/logging-cookbook.rst:3139 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3134 +#: ../../howto/logging-cookbook.rst:3141 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1693,7 +1692,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3167 +#: ../../howto/logging-cookbook.rst:3174 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1702,13 +1701,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3173 +#: ../../howto/logging-cookbook.rst:3180 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3191 +#: ../../howto/logging-cookbook.rst:3198 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1721,56 +1720,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3201 +#: ../../howto/logging-cookbook.rst:3208 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3212 +#: ../../howto/logging-cookbook.rst:3219 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3220 +#: ../../howto/logging-cookbook.rst:3227 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3230 +#: ../../howto/logging-cookbook.rst:3237 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3232 +#: ../../howto/logging-cookbook.rst:3239 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3240 +#: ../../howto/logging-cookbook.rst:3247 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3242 +#: ../../howto/logging-cookbook.rst:3249 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3244 +#: ../../howto/logging-cookbook.rst:3251 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3245 +#: ../../howto/logging-cookbook.rst:3252 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3247 +#: ../../howto/logging-cookbook.rst:3254 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3249 +#: ../../howto/logging-cookbook.rst:3256 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1781,53 +1780,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3298 +#: ../../howto/logging-cookbook.rst:3305 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3311 +#: ../../howto/logging-cookbook.rst:3318 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3332 +#: ../../howto/logging-cookbook.rst:3339 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3353 +#: ../../howto/logging-cookbook.rst:3360 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3366 +#: ../../howto/logging-cookbook.rst:3373 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3369 +#: ../../howto/logging-cookbook.rst:3376 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3386 +#: ../../howto/logging-cookbook.rst:3393 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3394 +#: ../../howto/logging-cookbook.rst:3401 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3400 +#: ../../howto/logging-cookbook.rst:3407 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3402 +#: ../../howto/logging-cookbook.rst:3409 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1835,7 +1834,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3408 +#: ../../howto/logging-cookbook.rst:3415 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1845,14 +1844,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3422 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3419 +#: ../../howto/logging-cookbook.rst:3426 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1860,11 +1859,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3633 +#: ../../howto/logging-cookbook.rst:3640 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3635 +#: ../../howto/logging-cookbook.rst:3642 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -1874,14 +1873,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3642 +#: ../../howto/logging-cookbook.rst:3649 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3708 +#: ../../howto/logging-cookbook.rst:3715 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1890,11 +1889,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3722 +#: ../../howto/logging-cookbook.rst:3729 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3724 +#: ../../howto/logging-cookbook.rst:3731 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1902,17 +1901,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3764 +#: ../../howto/logging-cookbook.rst:3771 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3771 +#: ../../howto/logging-cookbook.rst:3778 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3781 +#: ../../howto/logging-cookbook.rst:3788 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1920,25 +1919,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3794 +#: ../../howto/logging-cookbook.rst:3801 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3798 +#: ../../howto/logging-cookbook.rst:3805 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3807 +#: ../../howto/logging-cookbook.rst:3814 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3825 +#: ../../howto/logging-cookbook.rst:3832 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -1948,17 +1947,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3850 +#: ../../howto/logging-cookbook.rst:3857 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3866 +#: ../../howto/logging-cookbook.rst:3873 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3868 +#: ../../howto/logging-cookbook.rst:3875 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1966,11 +1965,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3874 +#: ../../howto/logging-cookbook.rst:3881 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3876 +#: ../../howto/logging-cookbook.rst:3883 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1978,32 +1977,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3881 +#: ../../howto/logging-cookbook.rst:3888 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3884 +#: ../../howto/logging-cookbook.rst:3891 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3887 +#: ../../howto/logging-cookbook.rst:3894 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3891 +#: ../../howto/logging-cookbook.rst:3898 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3894 +#: ../../howto/logging-cookbook.rst:3901 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -2012,7 +2011,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3900 +#: ../../howto/logging-cookbook.rst:3907 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -2022,17 +2021,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3914 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3911 +#: ../../howto/logging-cookbook.rst:3918 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3913 +#: ../../howto/logging-cookbook.rst:3920 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -2043,12 +2042,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3922 +#: ../../howto/logging-cookbook.rst:3929 msgid "" -"Adding handlers other than :class:`NullHandler` to a logger in a library" +"Adding handlers other than :class:`~logging.NullHandler` to a logger in a " +"library" msgstr "" -#: ../../howto/logging-cookbook.rst:3924 +#: ../../howto/logging-cookbook.rst:3931 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2056,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3930 +#: ../../howto/logging-cookbook.rst:3937 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3932 +#: ../../howto/logging-cookbook.rst:3939 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -2071,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3943 +#: ../../howto/logging-cookbook.rst:3950 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3956 +#: ../../howto/logging-cookbook.rst:3963 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3958 +#: ../../howto/logging-cookbook.rst:3965 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/ast.po b/library/ast.po index 3d3224d116..e021b7c35f 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -420,8 +420,8 @@ msgstr "" #: ../../library/ast.rst:588 msgid "" -"``keywords`` holds a list of :class:`keyword` objects representing arguments " -"passed by keyword." +"``keywords`` holds a list of :class:`.keyword` objects representing " +"arguments passed by keyword." msgstr "" #: ../../library/ast.rst:591 @@ -458,11 +458,11 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: ../../library/ast.rst:668 +#: ../../library/ast.rst:669 msgid "Subscripting" msgstr "" -#: ../../library/ast.rst:672 +#: ../../library/ast.rst:673 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -470,29 +470,29 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: ../../library/ast.rst:696 +#: ../../library/ast.rst:697 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: ../../library/ast.rst:713 +#: ../../library/ast.rst:714 msgid "Comprehensions" msgstr "" -#: ../../library/ast.rst:720 +#: ../../library/ast.rst:721 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: ../../library/ast.rst:724 +#: ../../library/ast.rst:725 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: ../../library/ast.rst:766 +#: ../../library/ast.rst:767 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -500,36 +500,36 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: ../../library/ast.rst:771 +#: ../../library/ast.rst:772 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: ../../library/ast.rst:840 +#: ../../library/ast.rst:841 msgid "Statements" msgstr "" -#: ../../library/ast.rst:844 +#: ../../library/ast.rst:845 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: ../../library/ast.rst:846 +#: ../../library/ast.rst:847 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: ../../library/ast.rst:852 ../../library/ast.rst:1159 -#: ../../library/ast.rst:1363 ../../library/ast.rst:1862 +#: ../../library/ast.rst:853 ../../library/ast.rst:1161 +#: ../../library/ast.rst:1366 ../../library/ast.rst:1891 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: ../../library/ast.rst:882 +#: ../../library/ast.rst:883 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " @@ -539,7 +539,7 @@ msgid "" "appear in between parenthesis and are hence pure names and not expressions." msgstr "" -#: ../../library/ast.rst:937 +#: ../../library/ast.rst:938 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -547,36 +547,36 @@ msgid "" "value for 1." msgstr "" -#: ../../library/ast.rst:942 +#: ../../library/ast.rst:943 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: ../../library/ast.rst:959 +#: ../../library/ast.rst:960 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: ../../library/ast.rst:976 +#: ../../library/ast.rst:977 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: ../../library/ast.rst:992 +#: ../../library/ast.rst:993 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: ../../library/ast.rst:1010 +#: ../../library/ast.rst:1011 msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:1023 +#: ../../library/ast.rst:1024 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" @@ -584,21 +584,21 @@ msgid "" "type alias." msgstr "" -#: ../../library/ast.rst:1040 +#: ../../library/ast.rst:1042 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:1044 +#: ../../library/ast.rst:1046 msgid "Imports" msgstr "" -#: ../../library/ast.rst:1048 +#: ../../library/ast.rst:1050 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:1065 +#: ../../library/ast.rst:1067 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -606,36 +606,36 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:1087 +#: ../../library/ast.rst:1089 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:1104 +#: ../../library/ast.rst:1106 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:1107 +#: ../../library/ast.rst:1109 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:1112 +#: ../../library/ast.rst:1114 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:1115 +#: ../../library/ast.rst:1117 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1150 +#: ../../library/ast.rst:1152 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -645,30 +645,30 @@ msgid "" "via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1185 +#: ../../library/ast.rst:1187 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1212 +#: ../../library/ast.rst:1214 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1247 +#: ../../library/ast.rst:1249 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1293 +#: ../../library/ast.rst:1295 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: ../../library/ast.rst:1324 +#: ../../library/ast.rst:1327 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -676,14 +676,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1358 +#: ../../library/ast.rst:1361 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1368 +#: ../../library/ast.rst:1371 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -691,18 +691,18 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1401 +#: ../../library/ast.rst:1404 msgid "Pattern matching" msgstr "" -#: ../../library/ast.rst:1406 +#: ../../library/ast.rst:1409 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: ../../library/ast.rst:1412 +#: ../../library/ast.rst:1417 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -710,19 +710,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: ../../library/ast.rst:1417 +#: ../../library/ast.rst:1422 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: ../../library/ast.rst:1420 +#: ../../library/ast.rst:1425 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: ../../library/ast.rst:1463 +#: ../../library/ast.rst:1470 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -730,14 +730,14 @@ msgid "" "equal to the evaluated value." msgstr "" -#: ../../library/ast.rst:1490 +#: ../../library/ast.rst:1499 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: ../../library/ast.rst:1515 +#: ../../library/ast.rst:1526 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -745,7 +745,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: ../../library/ast.rst:1546 +#: ../../library/ast.rst:1559 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -753,7 +753,7 @@ msgid "" "successful." msgstr "" -#: ../../library/ast.rst:1586 +#: ../../library/ast.rst:1601 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -762,7 +762,7 @@ msgid "" "statement documentation." msgstr "" -#: ../../library/ast.rst:1592 +#: ../../library/ast.rst:1607 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -771,7 +771,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: ../../library/ast.rst:1632 +#: ../../library/ast.rst:1649 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -782,21 +782,21 @@ msgid "" "pattern)." msgstr "" -#: ../../library/ast.rst:1639 +#: ../../library/ast.rst:1656 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: ../../library/ast.rst:1643 +#: ../../library/ast.rst:1660 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: ../../library/ast.rst:1696 +#: ../../library/ast.rst:1715 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -804,14 +804,14 @@ msgid "" "and will always succeed." msgstr "" -#: ../../library/ast.rst:1701 +#: ../../library/ast.rst:1720 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: ../../library/ast.rst:1737 +#: ../../library/ast.rst:1758 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -820,184 +820,189 @@ msgid "" "matched against the subject." msgstr "" -#: ../../library/ast.rst:1770 +#: ../../library/ast.rst:1793 msgid "Type parameters" msgstr "" -#: ../../library/ast.rst:1772 +#: ../../library/ast.rst:1795 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" -#: ../../library/ast.rst:1777 +#: ../../library/ast.rst:1800 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" "`Tuple`, it represents constraints; otherwise it represents the bound." msgstr "" -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1825 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " "specification." msgstr "" -#: ../../library/ast.rst:1823 +#: ../../library/ast.rst:1850 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " "tuple." msgstr "" -#: ../../library/ast.rst:1846 +#: ../../library/ast.rst:1875 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1850 +#: ../../library/ast.rst:1879 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1852 +#: ../../library/ast.rst:1881 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1853 +#: ../../library/ast.rst:1882 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1854 +#: ../../library/ast.rst:1883 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1855 +#: ../../library/ast.rst:1884 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1857 +#: ../../library/ast.rst:1886 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1858 ../../library/ast.rst:2033 +#: ../../library/ast.rst:1887 ../../library/ast.rst:2065 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" -#: ../../library/ast.rst:1867 +#: ../../library/ast.rst:1893 ../../library/ast.rst:2094 +#: ../../library/ast.rst:2105 +msgid "Added ``type_params``." +msgstr "" + +#: ../../library/ast.rst:1899 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1891 +#: ../../library/ast.rst:1923 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1893 +#: ../../library/ast.rst:1925 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1894 +#: ../../library/ast.rst:1926 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1896 +#: ../../library/ast.rst:1928 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1898 +#: ../../library/ast.rst:1930 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1905 +#: ../../library/ast.rst:1937 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1911 +#: ../../library/ast.rst:1943 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1956 +#: ../../library/ast.rst:1988 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1971 +#: ../../library/ast.rst:2003 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1996 +#: ../../library/ast.rst:2028 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:2023 +#: ../../library/ast.rst:2055 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:2025 +#: ../../library/ast.rst:2057 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:2026 +#: ../../library/ast.rst:2058 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:2027 +#: ../../library/ast.rst:2059 msgid "" -"``keywords`` is a list of :class:`keyword` nodes, principally for " +"``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:2030 +#: ../../library/ast.rst:2062 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:2032 +#: ../../library/ast.rst:2064 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2098 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:2067 +#: ../../library/ast.rst:2102 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2073 +#: ../../library/ast.rst:2111 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2107 +#: ../../library/ast.rst:2145 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2112 +#: ../../library/ast.rst:2150 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -1006,23 +1011,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:2120 +#: ../../library/ast.rst:2158 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:2122 +#: ../../library/ast.rst:2160 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:2127 +#: ../../library/ast.rst:2165 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:2130 +#: ../../library/ast.rst:2168 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -1035,14 +1040,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:2140 +#: ../../library/ast.rst:2178 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:2144 +#: ../../library/ast.rst:2182 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -1051,12 +1056,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:2151 +#: ../../library/ast.rst:2189 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:2154 +#: ../../library/ast.rst:2192 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1066,45 +1071,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:2161 +#: ../../library/ast.rst:2199 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:2165 +#: ../../library/ast.rst:2203 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2169 +#: ../../library/ast.rst:2207 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:2175 +#: ../../library/ast.rst:2213 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:2180 +#: ../../library/ast.rst:2218 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:2185 +#: ../../library/ast.rst:2223 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:2193 +#: ../../library/ast.rst:2231 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1112,14 +1117,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:2198 +#: ../../library/ast.rst:2236 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2203 +#: ../../library/ast.rst:2241 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1131,31 +1136,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:2251 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2216 +#: ../../library/ast.rst:2254 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2220 +#: ../../library/ast.rst:2258 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2223 +#: ../../library/ast.rst:2261 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2226 +#: ../../library/ast.rst:2264 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2232 +#: ../../library/ast.rst:2270 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1163,24 +1168,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2238 +#: ../../library/ast.rst:2276 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2244 +#: ../../library/ast.rst:2282 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2248 +#: ../../library/ast.rst:2286 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2256 +#: ../../library/ast.rst:2294 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1189,77 +1194,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2265 +#: ../../library/ast.rst:2303 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2272 +#: ../../library/ast.rst:2310 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2279 +#: ../../library/ast.rst:2317 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2285 +#: ../../library/ast.rst:2323 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2291 +#: ../../library/ast.rst:2329 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2298 +#: ../../library/ast.rst:2336 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2302 +#: ../../library/ast.rst:2340 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2307 +#: ../../library/ast.rst:2345 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2313 +#: ../../library/ast.rst:2351 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2315 +#: ../../library/ast.rst:2353 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2319 +#: ../../library/ast.rst:2357 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2325 +#: ../../library/ast.rst:2363 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1267,13 +1272,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2333 +#: ../../library/ast.rst:2371 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2336 +#: ../../library/ast.rst:2374 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1282,27 +1287,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2342 +#: ../../library/ast.rst:2380 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2354 +#: ../../library/ast.rst:2392 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2358 +#: ../../library/ast.rst:2396 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2362 +#: ../../library/ast.rst:2400 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1310,11 +1315,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2370 +#: ../../library/ast.rst:2408 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2415 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1325,7 +1330,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2385 +#: ../../library/ast.rst:2423 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1335,87 +1340,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2392 +#: ../../library/ast.rst:2430 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2399 +#: ../../library/ast.rst:2437 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2401 +#: ../../library/ast.rst:2439 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2406 +#: ../../library/ast.rst:2444 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2413 +#: ../../library/ast.rst:2451 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2418 +#: ../../library/ast.rst:2456 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2427 +#: ../../library/ast.rst:2465 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2431 +#: ../../library/ast.rst:2469 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2438 +#: ../../library/ast.rst:2476 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2444 +#: ../../library/ast.rst:2482 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2449 +#: ../../library/ast.rst:2487 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2454 +#: ../../library/ast.rst:2492 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2458 +#: ../../library/ast.rst:2496 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2463 +#: ../../library/ast.rst:2501 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2465 +#: ../../library/ast.rst:2503 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2471 +#: ../../library/ast.rst:2509 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2474 +#: ../../library/ast.rst:2512 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1423,21 +1428,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2479 +#: ../../library/ast.rst:2517 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2483 +#: ../../library/ast.rst:2521 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2488 +#: ../../library/ast.rst:2526 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/calendar.po b/library/calendar.po index 51a147d790..fc1ca1cc53 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -55,21 +55,11 @@ msgstr "" "這個模組定義的函式和類別使用理想化的日曆,也就是公曆 (Gregorian calendar) 無" "限往前後兩個方向延伸。這符合 Dershowitz 和 Reingold 在「Calendrical " "Calculations」這本書定義的「逆推公曆」(proleptic Gregorian),是做所有計算的基" -"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 年,-1" -" 年是公元前 2 年依此類推。" +"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 " +"年,-1 年是公元前 2 年依此類推。" #: ../../library/calendar.rst:33 msgid "" -"Enumeration defining the days of the week as integer constants, from 0 to 6." -msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" - -#: ../../library/calendar.rst:54 -msgid "" -"Enumeration defining months of the year as integer constants, from 1 to 12." -msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" - -#: ../../library/calendar.rst:85 -msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." @@ -77,7 +67,7 @@ msgstr "" "建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" "const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" -#: ../../library/calendar.rst:88 +#: ../../library/calendar.rst:36 msgid "" "A :class:`Calendar` object provides several methods that can be used for " "preparing the calendar data for formatting. This class doesn't do any " @@ -86,11 +76,11 @@ msgstr "" ":class:`Calendar` 物件提供一些方法來為日曆資料的格式化做準備。這個類別本身不" "做任何格式化,這是子類別的工作。" -#: ../../library/calendar.rst:93 +#: ../../library/calendar.rst:41 msgid ":class:`Calendar` instances have the following methods:" msgstr ":class:`Calendar` 實例有以下方法:" -#: ../../library/calendar.rst:97 +#: ../../library/calendar.rst:45 msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" @@ -99,7 +89,7 @@ msgstr "" "回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" "`firstweekday` 屬性的值一樣。" -#: ../../library/calendar.rst:104 +#: ../../library/calendar.rst:52 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -109,7 +99,7 @@ msgstr "" "回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" "期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" -#: ../../library/calendar.rst:112 +#: ../../library/calendar.rst:60 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -120,7 +110,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" "之外的日期數字會是 ``0``。" -#: ../../library/calendar.rst:120 +#: ../../library/calendar.rst:68 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -131,7 +121,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" "幾的數字組成的元組。" -#: ../../library/calendar.rst:128 +#: ../../library/calendar.rst:76 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -142,7 +132,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" "元組。" -#: ../../library/calendar.rst:138 +#: ../../library/calendar.rst:86 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -153,7 +143,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" "數字組成的元組。" -#: ../../library/calendar.rst:148 +#: ../../library/calendar.rst:96 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." @@ -161,7 +151,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" "class:`datetime.date` 物件。" -#: ../../library/calendar.rst:154 +#: ../../library/calendar.rst:102 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -169,7 +159,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字及代表週幾的數字組成的元組。" -#: ../../library/calendar.rst:161 +#: ../../library/calendar.rst:109 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -177,7 +167,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字。" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:115 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -188,7 +178,7 @@ msgstr "" "*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" "一天則是一個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:123 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " @@ -197,7 +187,7 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:182 +#: ../../library/calendar.rst:130 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " @@ -206,15 +196,15 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:189 +#: ../../library/calendar.rst:137 msgid "This class can be used to generate plain text calendars." msgstr "這個類別用來產生純文字的日曆。" -#: ../../library/calendar.rst:191 +#: ../../library/calendar.rst:139 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:195 +#: ../../library/calendar.rst:143 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -226,11 +216,11 @@ msgstr "" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" -#: ../../library/calendar.rst:204 +#: ../../library/calendar.rst:152 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" -#: ../../library/calendar.rst:209 +#: ../../library/calendar.rst:157 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -244,20 +234,20 @@ msgstr "" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" "的年份會依據平台而不同。" -#: ../../library/calendar.rst:219 +#: ../../library/calendar.rst:167 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:172 msgid "This class can be used to generate HTML calendars." msgstr "這個類別用來產生 HTML 日曆。" -#: ../../library/calendar.rst:227 +#: ../../library/calendar.rst:175 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:231 +#: ../../library/calendar.rst:179 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -265,14 +255,14 @@ msgstr "" "以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:238 +#: ../../library/calendar.rst:186 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" "以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" -#: ../../library/calendar.rst:244 +#: ../../library/calendar.rst:192 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -284,30 +274,30 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:251 +#: ../../library/calendar.rst:199 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:256 +#: ../../library/calendar.rst:204 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:260 +#: ../../library/calendar.rst:208 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:264 +#: ../../library/calendar.rst:212 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:217 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:276 +#: ../../library/calendar.rst:224 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -315,7 +305,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:284 +#: ../../library/calendar.rst:232 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -323,7 +313,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:292 +#: ../../library/calendar.rst:240 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -331,14 +321,14 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:300 +#: ../../library/calendar.rst:248 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:308 +#: ../../library/calendar.rst:256 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." @@ -346,7 +336,7 @@ msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:314 +#: ../../library/calendar.rst:262 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -356,11 +346,11 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:320 +#: ../../library/calendar.rst:268 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:332 +#: ../../library/calendar.rst:280 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -368,7 +358,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:338 +#: ../../library/calendar.rst:286 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -376,7 +366,7 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:344 +#: ../../library/calendar.rst:292 msgid "" "The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -387,11 +377,11 @@ msgstr "" "把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:350 +#: ../../library/calendar.rst:298 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:354 +#: ../../library/calendar.rst:302 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -402,26 +392,27 @@ msgstr "" "`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" "`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:365 +#: ../../library/calendar.rst:313 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:370 +#: ../../library/calendar.rst:318 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:375 +#: ../../library/calendar.rst:323 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." -msgstr "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" +msgstr "" +"回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:326 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:383 +#: ../../library/calendar.rst:331 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -429,32 +420,32 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:389 +#: ../../library/calendar.rst:337 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:395 +#: ../../library/calendar.rst:343 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:401 +#: ../../library/calendar.rst:349 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" -"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以" -"週一開始,除非有使用 :func:`setfirstweekday` 改變設定。" +"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" +"一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:408 +#: ../../library/calendar.rst:356 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:413 +#: ../../library/calendar.rst:361 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`formatmonth` of the :class:`TextCalendar` class." @@ -462,12 +453,12 @@ msgstr "" "以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatmonth`。" -#: ../../library/calendar.rst:419 +#: ../../library/calendar.rst:367 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:424 +#: ../../library/calendar.rst:372 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`formatyear` of the :class:`TextCalendar` class." @@ -475,7 +466,7 @@ msgstr "" "以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatyear`。" -#: ../../library/calendar.rst:430 +#: ../../library/calendar.rst:378 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -487,21 +478,34 @@ msgstr "" "gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" "碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" -#: ../../library/calendar.rst:437 +#: ../../library/calendar.rst:385 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:441 +#: ../../library/calendar.rst:389 msgid "An array that represents the days of the week in the current locale." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:446 +#: ../../library/calendar.rst:394 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:451 +#: ../../library/calendar.rst:405 +msgid "" +"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " +"is ``6``." +msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" + +#: ../../library/calendar.rst:413 +msgid "" +"Enumeration defining days of the week as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`MONDAY` through :" +"data:`SUNDAY`." +msgstr "" + +#: ../../library/calendar.rst:422 msgid "" "An array that represents the months of the year in the current locale. This " "follows normal convention of January being month number 1, so it has a " @@ -510,7 +514,7 @@ msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:458 +#: ../../library/calendar.rst:429 msgid "" "An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " @@ -519,49 +523,153 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:470 +#: ../../library/calendar.rst:447 msgid "" -"Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." -msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" +"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " +"``DECEMBER`` is ``12``." +msgstr "" +"一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:473 +#: ../../library/calendar.rst:455 +msgid "" +"Enumeration defining months of the year as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`JANUARY` " +"through :data:`DECEMBER`." +msgstr "" + +#: ../../library/calendar.rst:462 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr "" -#: ../../library/calendar.rst:477 +#: ../../library/calendar.rst:466 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" -#: ../../library/calendar.rst:482 +#: ../../library/calendar.rst:471 msgid "The invalid month number." msgstr "" -#: ../../library/calendar.rst:487 +#: ../../library/calendar.rst:476 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" -#: ../../library/calendar.rst:492 +#: ../../library/calendar.rst:481 msgid "The invalid weekday number." msgstr "" -#: ../../library/calendar.rst:499 +#: ../../library/calendar.rst:488 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:498 +#: ../../library/calendar.rst:487 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:501 +#: ../../library/calendar.rst:490 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:502 +#: ../../library/calendar.rst:491 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" + +#: ../../library/calendar.rst:497 +msgid "Command-Line Usage" +msgstr "" + +#: ../../library/calendar.rst:501 +msgid "" +"The :mod:`calendar` module can be executed as a script from the command line " +"to interactively print a calendar." +msgstr "" + +#: ../../library/calendar.rst:511 +msgid "For example, to print a calendar for the year 2000:" +msgstr "" + +#: ../../library/calendar.rst:554 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/calendar.rst:561 +msgid "Show the help message and exit." +msgstr "" + +#: ../../library/calendar.rst:566 +msgid "The locale to use for month and weekday names. Defaults to English." +msgstr "" + +#: ../../library/calendar.rst:572 +msgid "" +"The encoding to use for output. :option:`--encoding` is required if :option:" +"`--locale` is set." +msgstr "" + +#: ../../library/calendar.rst:578 +msgid "Print the calendar to the terminal as text, or as an HTML document." +msgstr "" + +#: ../../library/calendar.rst:584 +msgid "" +"The year to print the calendar for. Must be a number between 1 and 9999. " +"Defaults to the current year." +msgstr "" + +#: ../../library/calendar.rst:591 +msgid "" +"The month of the specified :option:`year` to print the calendar for. Must be " +"a number between 1 and 12, and may only be used in text mode. Defaults to " +"printing a calendar for the full year." +msgstr "" + +#: ../../library/calendar.rst:597 +msgid "*Text-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:601 +msgid "" +"The width of the date column in terminal columns. The date is printed " +"centred in the column. Any value lower than 2 is ignored. Defaults to 2." +msgstr "" + +#: ../../library/calendar.rst:609 +msgid "" +"The number of lines for each week in terminal rows. The date is printed top-" +"aligned. Any value lower than 1 is ignored. Defaults to 1." +msgstr "" + +#: ../../library/calendar.rst:617 +msgid "" +"The space between months in columns. Any value lower than 2 is ignored. " +"Defaults to 6." +msgstr "" + +#: ../../library/calendar.rst:624 +msgid "The number of months printed per row. Defaults to 3." +msgstr "" + +#: ../../library/calendar.rst:628 +msgid "*HTML-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:632 +msgid "" +"The path of a CSS stylesheet to use for the calendar. This must either be " +"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." +msgstr "" + +#~ msgid "" +#~ "Enumeration defining the days of the week as integer constants, from 0 to " +#~ "6." +#~ msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" + +#~ msgid "" +#~ "Enumeration defining months of the year as integer constants, from 1 to " +#~ "12." +#~ msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" diff --git a/library/configparser.po b/library/configparser.po index e7185179f7..1fd52352d6 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -713,10 +713,12 @@ msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " "(normally named ``\"DEFAULT\"``). This value can be retrieved and changed " -"on runtime using the ``default_section`` instance attribute." +"at runtime using the ``default_section`` instance attribute. This won't re-" +"evaluate an already parsed config file, but will be used when writing parsed " +"settings to a new config file." msgstr "" -#: ../../library/configparser.rst:941 +#: ../../library/configparser.rst:943 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -725,7 +727,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:949 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -734,7 +736,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:953 +#: ../../library/configparser.rst:955 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -743,44 +745,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:959 +#: ../../library/configparser.rst:961 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:962 +#: ../../library/configparser.rst:964 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:967 +#: ../../library/configparser.rst:969 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:970 +#: ../../library/configparser.rst:972 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:975 ../../library/configparser.rst:1238 +#: ../../library/configparser.rst:977 ../../library/configparser.rst:1240 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:981 +#: ../../library/configparser.rst:983 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:986 +#: ../../library/configparser.rst:988 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:992 +#: ../../library/configparser.rst:994 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -788,34 +790,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:997 +#: ../../library/configparser.rst:999 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1003 +#: ../../library/configparser.rst:1005 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1009 +#: ../../library/configparser.rst:1011 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1014 +#: ../../library/configparser.rst:1016 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1021 +#: ../../library/configparser.rst:1023 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1024 +#: ../../library/configparser.rst:1026 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -826,7 +828,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1033 +#: ../../library/configparser.rst:1035 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -834,49 +836,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1046 +#: ../../library/configparser.rst:1048 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1050 +#: ../../library/configparser.rst:1052 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1053 +#: ../../library/configparser.rst:1055 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1059 +#: ../../library/configparser.rst:1061 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1062 +#: ../../library/configparser.rst:1064 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1066 +#: ../../library/configparser.rst:1068 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1071 +#: ../../library/configparser.rst:1073 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:1075 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1082 +#: ../../library/configparser.rst:1084 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -885,17 +887,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1088 +#: ../../library/configparser.rst:1090 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1091 +#: ../../library/configparser.rst:1093 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1098 +#: ../../library/configparser.rst:1100 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -904,35 +906,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1104 +#: ../../library/configparser.rst:1106 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1108 +#: ../../library/configparser.rst:1110 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1116 +#: ../../library/configparser.rst:1118 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1123 +#: ../../library/configparser.rst:1125 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1130 +#: ../../library/configparser.rst:1132 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -944,34 +946,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1143 +#: ../../library/configparser.rst:1145 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1146 +#: ../../library/configparser.rst:1148 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1150 +#: ../../library/configparser.rst:1152 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1158 +#: ../../library/configparser.rst:1160 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1165 +#: ../../library/configparser.rst:1167 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -980,27 +982,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1173 +#: ../../library/configparser.rst:1175 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1181 +#: ../../library/configparser.rst:1183 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1189 +#: ../../library/configparser.rst:1191 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1195 +#: ../../library/configparser.rst:1197 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1009,7 +1011,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1201 +#: ../../library/configparser.rst:1203 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1017,24 +1019,24 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1209 +#: ../../library/configparser.rst:1211 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1215 +#: ../../library/configparser.rst:1217 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1223 +#: ../../library/configparser.rst:1225 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1233 +#: ../../library/configparser.rst:1235 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1042,27 +1044,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1243 +#: ../../library/configparser.rst:1245 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1250 +#: ../../library/configparser.rst:1252 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1254 +#: ../../library/configparser.rst:1256 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1260 +#: ../../library/configparser.rst:1262 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1072,7 +1074,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1267 +#: ../../library/configparser.rst:1269 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1080,32 +1082,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1274 +#: ../../library/configparser.rst:1276 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1278 +#: ../../library/configparser.rst:1280 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1283 +#: ../../library/configparser.rst:1285 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1288 +#: ../../library/configparser.rst:1290 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1292 +#: ../../library/configparser.rst:1294 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1299 +#: ../../library/configparser.rst:1301 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1113,58 +1115,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1307 +#: ../../library/configparser.rst:1309 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1313 +#: ../../library/configparser.rst:1315 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1319 +#: ../../library/configparser.rst:1321 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1326 +#: ../../library/configparser.rst:1328 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1334 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1338 +#: ../../library/configparser.rst:1340 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1344 +#: ../../library/configparser.rst:1346 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1346 +#: ../../library/configparser.rst:1348 msgid "" "The ``filename`` attribute and :meth:`__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1351 +#: ../../library/configparser.rst:1353 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1352 +#: ../../library/configparser.rst:1354 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/datetime.po b/library/datetime.po index a61def35c8..d185585c26 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,7 +66,7 @@ msgstr ":mod:`zoneinfo` 模組" msgid "Concrete time zones representing the IANA time zone database." msgstr "" -#: ../../library/datetime.rst:37 +#: ../../library/datetime.rst:38 msgid "Package `dateutil `_" msgstr "" @@ -74,17 +74,27 @@ msgstr "" msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:43 +#: ../../library/datetime.rst:41 +msgid "Package `DateType `_" +msgstr "" + +#: ../../library/datetime.rst:41 +msgid "" +"Third-party library that introduces distinct static types to e.g. allow " +"static type checkers to differentiate between naive and aware datetimes." +msgstr "" + +#: ../../library/datetime.rst:47 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:45 +#: ../../library/datetime.rst:49 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:48 +#: ../../library/datetime.rst:52 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -93,7 +103,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:54 +#: ../../library/datetime.rst:58 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -104,7 +114,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:61 +#: ../../library/datetime.rst:65 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -114,7 +124,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:67 +#: ../../library/datetime.rst:71 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -125,42 +135,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:76 +#: ../../library/datetime.rst:80 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:78 +#: ../../library/datetime.rst:82 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:82 +#: ../../library/datetime.rst:86 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:88 +#: ../../library/datetime.rst:92 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:93 +#: ../../library/datetime.rst:97 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:98 +#: ../../library/datetime.rst:102 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:103 +#: ../../library/datetime.rst:107 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:111 +#: ../../library/datetime.rst:115 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -168,14 +178,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:120 +#: ../../library/datetime.rst:124 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:128 +#: ../../library/datetime.rst:132 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -183,7 +193,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:135 +#: ../../library/datetime.rst:139 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -191,158 +201,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:143 +#: ../../library/datetime.rst:147 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:148 ../../library/datetime.rst:166 +#: ../../library/datetime.rst:152 ../../library/datetime.rst:170 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:150 +#: ../../library/datetime.rst:154 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:161 +#: ../../library/datetime.rst:165 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:167 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:171 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:169 +#: ../../library/datetime.rst:173 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:176 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:178 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:180 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:178 +#: ../../library/datetime.rst:182 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:180 +#: ../../library/datetime.rst:184 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:185 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:183 +#: ../../library/datetime.rst:187 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:189 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:191 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:188 +#: ../../library/datetime.rst:192 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:190 +#: ../../library/datetime.rst:194 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:196 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:198 +#: ../../library/datetime.rst:202 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:200 +#: ../../library/datetime.rst:204 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:205 +#: ../../library/datetime.rst:209 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:212 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:211 +#: ../../library/datetime.rst:215 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:216 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:213 +#: ../../library/datetime.rst:217 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:214 +#: ../../library/datetime.rst:218 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:220 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:223 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:220 +#: ../../library/datetime.rst:224 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:221 +#: ../../library/datetime.rst:225 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:223 +#: ../../library/datetime.rst:227 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:241 +#: ../../library/datetime.rst:245 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -351,281 +361,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:248 +#: ../../library/datetime.rst:252 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:251 +#: ../../library/datetime.rst:255 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:260 ../../library/datetime.rst:556 -#: ../../library/datetime.rst:1069 ../../library/datetime.rst:1688 -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:264 ../../library/datetime.rst:560 +#: ../../library/datetime.rst:1073 ../../library/datetime.rst:1692 +#: ../../library/datetime.rst:2294 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:264 +#: ../../library/datetime.rst:268 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:269 +#: ../../library/datetime.rst:273 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:279 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:278 +#: ../../library/datetime.rst:282 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:281 ../../library/datetime.rst:574 -#: ../../library/datetime.rst:1089 ../../library/datetime.rst:1708 +#: ../../library/datetime.rst:285 ../../library/datetime.rst:578 +#: ../../library/datetime.rst:1093 ../../library/datetime.rst:1712 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Value" msgstr "" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:293 ../../library/datetime.rst:591 -#: ../../library/datetime.rst:1142 +#: ../../library/datetime.rst:297 ../../library/datetime.rst:595 +#: ../../library/datetime.rst:1146 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Result" msgstr "" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:315 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:359 ../../library/datetime.rst:608 -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:363 ../../library/datetime.rst:612 +#: ../../library/datetime.rst:2525 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:362 +#: ../../library/datetime.rst:366 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:365 +#: ../../library/datetime.rst:369 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:368 +#: ../../library/datetime.rst:372 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:375 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:374 +#: ../../library/datetime.rst:378 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:384 +#: ../../library/datetime.rst:388 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:392 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:392 +#: ../../library/datetime.rst:396 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -633,119 +643,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:403 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:401 +#: ../../library/datetime.rst:405 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:412 +#: ../../library/datetime.rst:416 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:423 +#: ../../library/datetime.rst:427 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:426 ../../library/datetime.rst:637 -#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:430 ../../library/datetime.rst:641 +#: ../../library/datetime.rst:1220 ../../library/datetime.rst:1820 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:434 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:434 +#: ../../library/datetime.rst:438 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:440 +#: ../../library/datetime.rst:444 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:442 +#: ../../library/datetime.rst:446 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:454 +#: ../../library/datetime.rst:458 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:473 +#: ../../library/datetime.rst:477 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:479 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:479 +#: ../../library/datetime.rst:483 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:484 +#: ../../library/datetime.rst:488 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:487 +#: ../../library/datetime.rst:491 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:488 +#: ../../library/datetime.rst:492 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:489 +#: ../../library/datetime.rst:493 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:491 ../../library/datetime.rst:852 +#: ../../library/datetime.rst:495 ../../library/datetime.rst:856 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:494 ../../library/datetime.rst:857 +#: ../../library/datetime.rst:498 ../../library/datetime.rst:861 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:498 +#: ../../library/datetime.rst:502 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:504 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:504 +#: ../../library/datetime.rst:508 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:507 +#: ../../library/datetime.rst:511 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -755,7 +765,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:514 +#: ../../library/datetime.rst:518 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -763,96 +773,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:523 +#: ../../library/datetime.rst:527 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:526 +#: ../../library/datetime.rst:530 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:533 +#: ../../library/datetime.rst:537 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:545 +#: ../../library/datetime.rst:549 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:550 +#: ../../library/datetime.rst:554 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:560 +#: ../../library/datetime.rst:564 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:565 +#: ../../library/datetime.rst:569 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:570 +#: ../../library/datetime.rst:574 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:578 ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:582 ../../library/datetime.rst:1097 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 +#: ../../library/datetime.rst:587 ../../library/datetime.rst:1102 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 +#: ../../library/datetime.rst:592 ../../library/datetime.rst:1107 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:602 +#: ../../library/datetime.rst:606 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:602 ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:606 ../../library/datetime.rst:1155 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:611 +#: ../../library/datetime.rst:615 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -861,17 +871,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:618 +#: ../../library/datetime.rst:622 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:621 +#: ../../library/datetime.rst:625 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:625 +#: ../../library/datetime.rst:629 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -884,56 +894,56 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:635 +#: ../../library/datetime.rst:639 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:641 +#: ../../library/datetime.rst:645 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:644 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:648 ../../library/datetime.rst:1863 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1329 +#: ../../library/datetime.rst:658 ../../library/datetime.rst:1333 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:656 +#: ../../library/datetime.rst:660 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:658 ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:662 ../../library/datetime.rst:1335 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:662 +#: ../../library/datetime.rst:666 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:668 +#: ../../library/datetime.rst:672 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:675 +#: ../../library/datetime.rst:679 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -942,25 +952,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:682 +#: ../../library/datetime.rst:686 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:689 +#: ../../library/datetime.rst:693 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:692 +#: ../../library/datetime.rst:696 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:694 +#: ../../library/datetime.rst:698 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -969,17 +979,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:699 +#: ../../library/datetime.rst:703 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:708 +#: ../../library/datetime.rst:712 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:717 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -987,29 +997,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:721 +#: ../../library/datetime.rst:725 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:726 +#: ../../library/datetime.rst:730 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:732 ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:736 ../../library/datetime.rst:1519 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:736 +#: ../../library/datetime.rst:740 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:743 +#: ../../library/datetime.rst:747 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1017,7 +1027,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:750 +#: ../../library/datetime.rst:754 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1447,7 +1457,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1167 +#: ../../library/datetime.rst:1171 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1455,14 +1465,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1172 +#: ../../library/datetime.rst:1176 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1176 +#: ../../library/datetime.rst:1180 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1470,7 +1480,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:1185 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1479,20 +1489,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1187 +#: ../../library/datetime.rst:1191 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1194 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1194 +#: ../../library/datetime.rst:1198 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1502,13 +1512,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1200 +#: ../../library/datetime.rst:1204 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:1210 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1521,27 +1531,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1220 +#: ../../library/datetime.rst:1224 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1229 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1228 ../../library/datetime.rst:1237 +#: ../../library/datetime.rst:1232 ../../library/datetime.rst:1241 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1238 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1245 +#: ../../library/datetime.rst:1249 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1549,21 +1559,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1256 +#: ../../library/datetime.rst:1260 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1264 +#: ../../library/datetime.rst:1268 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1571,7 +1581,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1269 +#: ../../library/datetime.rst:1273 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1580,7 +1590,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1275 +#: ../../library/datetime.rst:1279 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1588,56 +1598,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1280 +#: ../../library/datetime.rst:1284 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1296 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1295 +#: ../../library/datetime.rst:1299 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1302 +#: ../../library/datetime.rst:1306 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1899 -#: ../../library/datetime.rst:2005 ../../library/datetime.rst:2250 -#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:1310 ../../library/datetime.rst:1903 +#: ../../library/datetime.rst:2009 ../../library/datetime.rst:2254 +#: ../../library/datetime.rst:2266 ../../library/datetime.rst:2578 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1312 +#: ../../library/datetime.rst:1316 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1316 ../../library/datetime.rst:1909 -#: ../../library/datetime.rst:2059 +#: ../../library/datetime.rst:1320 ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:2063 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1322 +#: ../../library/datetime.rst:1326 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1337 +#: ../../library/datetime.rst:1341 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1647,14 +1657,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1348 +#: ../../library/datetime.rst:1352 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1356 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1663,7 +1673,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1361 +#: ../../library/datetime.rst:1365 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1673,20 +1683,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1370 +#: ../../library/datetime.rst:1374 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1375 +#: ../../library/datetime.rst:1379 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1379 +#: ../../library/datetime.rst:1383 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1696,18 +1706,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1386 +#: ../../library/datetime.rst:1390 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1393 +#: ../../library/datetime.rst:1397 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1399 +#: ../../library/datetime.rst:1403 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1715,49 +1725,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1407 +#: ../../library/datetime.rst:1411 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1417 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1423 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1426 +#: ../../library/datetime.rst:1430 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1436 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1434 +#: ../../library/datetime.rst:1438 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1435 +#: ../../library/datetime.rst:1439 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1441 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1440 +#: ../../library/datetime.rst:1444 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1765,99 +1775,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1446 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1452 +#: ../../library/datetime.rst:1456 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 +#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1853 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1486 ../../library/datetime.rst:1859 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1484 +#: ../../library/datetime.rst:1488 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1494 ../../library/datetime.rst:1870 +#: ../../library/datetime.rst:1498 ../../library/datetime.rst:1874 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1504 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1506 +#: ../../library/datetime.rst:1510 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1512 +#: ../../library/datetime.rst:1516 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1519 +#: ../../library/datetime.rst:1523 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1526 +#: ../../library/datetime.rst:1530 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1533 +#: ../../library/datetime.rst:1537 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1865,70 +1875,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1540 +#: ../../library/datetime.rst:1544 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1542 +#: ../../library/datetime.rst:1546 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1595 +#: ../../library/datetime.rst:1599 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1642 +#: ../../library/datetime.rst:1646 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:1672 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:1674 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1675 +#: ../../library/datetime.rst:1679 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1685 +#: ../../library/datetime.rst:1689 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1693 +#: ../../library/datetime.rst:1697 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1698 +#: ../../library/datetime.rst:1702 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1703 +#: ../../library/datetime.rst:1707 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1732 +#: ../../library/datetime.rst:1736 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1750 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1937,7 +1947,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1752 +#: ../../library/datetime.rst:1756 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1951,18 +1961,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1762 +#: ../../library/datetime.rst:1766 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1766 +#: ../../library/datetime.rst:1770 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1768 +#: ../../library/datetime.rst:1772 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1970,35 +1980,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1783 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1783 +#: ../../library/datetime.rst:1787 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1785 +#: ../../library/datetime.rst:1789 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1811 +#: ../../library/datetime.rst:1815 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1825 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2006,46 +2016,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1836 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1838 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1839 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1840 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1841 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1857 +#: ../../library/datetime.rst:1861 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1876 +#: ../../library/datetime.rst:1880 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:1885 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1891 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2142 +#: ../../library/datetime.rst:2146 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2315,7 +2325,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2156 +#: ../../library/datetime.rst:2160 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2324,7 +2334,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2175 +#: ../../library/datetime.rst:2179 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2339,13 +2349,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2201 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2204 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2355,28 +2365,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2214 +#: ../../library/datetime.rst:2218 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2213 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2217 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2224 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2221 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2385,24 +2395,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2227 +#: ../../library/datetime.rst:2231 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2233 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2237 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2244 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2410,25 +2420,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2245 +#: ../../library/datetime.rst:2249 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2256 ../../library/datetime.rst:2267 +#: ../../library/datetime.rst:2260 ../../library/datetime.rst:2271 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2259 +#: ../../library/datetime.rst:2263 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2270 +#: ../../library/datetime.rst:2274 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2437,144 +2447,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2276 +#: ../../library/datetime.rst:2280 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2291 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2298 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2303 +#: ../../library/datetime.rst:2307 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2309 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2313 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2332 +#: ../../library/datetime.rst:2336 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2338 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2346 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2586,11 +2596,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "Weekday as locale's full name." msgstr "" @@ -2602,42 +2612,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2375 -#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2384 -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2393 -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2366 ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2382 ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2391 ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2415 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "Month as locale's abbreviated name." msgstr "" @@ -2649,11 +2659,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "Month as locale's full name." msgstr "" @@ -2665,67 +2675,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2391 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2385 ../../library/datetime.rst:2455 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2737,128 +2747,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2400 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2576 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2408 -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2412 +#: ../../library/datetime.rst:2469 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:2412 ../../library/datetime.rst:2604 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2870,11 +2880,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "Locale's appropriate date representation." msgstr "" @@ -2890,11 +2900,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "Locale's appropriate time representation." msgstr "" @@ -2906,83 +2916,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2469 ../../library/datetime.rst:2590 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2991,7 +3001,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2480 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -3001,37 +3011,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2486 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2489 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2495 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2499 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2499 +#: ../../library/datetime.rst:2503 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2507 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3039,7 +3049,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2511 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3051,7 +3061,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2515 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3060,7 +3070,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2519 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3069,7 +3079,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2528 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3077,37 +3087,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2534 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:2537 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2537 +#: ../../library/datetime.rst:2541 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2542 +#: ../../library/datetime.rst:2546 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2550 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2554 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3115,17 +3125,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2561 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2560 +#: ../../library/datetime.rst:2564 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2563 +#: ../../library/datetime.rst:2567 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3139,7 +3149,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2581 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3147,53 +3157,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2589 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2593 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2597 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2595 +#: ../../library/datetime.rst:2599 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2600 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2602 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2606 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2608 +#: ../../library/datetime.rst:2612 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2617 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3201,22 +3211,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2623 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2624 +#: ../../library/datetime.rst:2628 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2629 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2631 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3225,23 +3235,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2633 +#: ../../library/datetime.rst:2637 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2641 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dis.po b/library/dis.po index a3c151150f..a8f051c8cc 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-31 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,13 +69,13 @@ msgid "" msgstr "" #: ../../library/dis.rst:46 -msgid "Example: Given the function :func:`myfunc`::" +msgid "Example: Given the function :func:`!myfunc`::" msgstr "" #: ../../library/dis.rst:51 msgid "" -"the following command can be used to display the disassembly of :func:" -"`myfunc`:" +"the following command can be used to display the disassembly of :func:`!" +"myfunc`:" msgstr "" #: ../../library/dis.rst:64 @@ -556,9 +556,9 @@ msgstr "" #: ../../library/dis.rst:546 ../../library/dis.rst:554 #: ../../library/dis.rst:566 ../../library/dis.rst:654 #: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:904 -#: ../../library/dis.rst:1003 ../../library/dis.rst:1015 -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:894 ../../library/dis.rst:905 +#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 +#: ../../library/dis.rst:1029 msgid "Implements::" msgstr "" @@ -756,7 +756,7 @@ msgstr "" #: ../../library/dis.rst:796 msgid "" -"Pushes :func:`builtins.__build_class__` onto the stack. It is later called " +"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" @@ -797,7 +797,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1465 +#: ../../library/dis.rst:846 ../../library/dis.rst:1467 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -806,14 +806,15 @@ msgstr "" #: ../../library/dis.rst:853 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " -"attribute :attr:`co_names` of the code object. The compiler tries to use :" -"opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." +"attribute :attr:`!co_names` of the :ref:`code object `. The " +"compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if " +"possible." msgstr "" #: ../../library/dis.rst:860 msgid "" -"Implements ``del name``, where *namei* is the index into :attr:`co_names` " -"attribute of the code object." +"Implements ``del name``, where *namei* is the index into :attr:`!co_names` " +"attribute of the :ref:`code object `." msgstr "" #: ../../library/dis.rst:866 @@ -850,39 +851,43 @@ msgid "" msgstr "" #: ../../library/dis.rst:900 -msgid "where *namei* is the index of name in :attr:`co_names`." +msgid "" +"where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:909 -msgid "where *namei* is the index of name into :attr:`co_names`." +#: ../../library/dis.rst:910 +msgid "" +"where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:914 +#: ../../library/dis.rst:916 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:919 +#: ../../library/dis.rst:921 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:924 +#: ../../library/dis.rst:926 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:929 +#: ../../library/dis.rst:931 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:935 +#: ../../library/dis.rst:937 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:944 +#: ../../library/dis.rst:946 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -891,69 +896,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:955 +#: ../../library/dis.rst:957 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:965 +#: ../../library/dis.rst:967 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:970 +#: ../../library/dis.rst:972 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:975 +#: ../../library/dis.rst:977 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:981 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:986 +#: ../../library/dis.rst:988 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:995 +#: ../../library/dis.rst:997 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1008 +#: ../../library/dis.rst:1010 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1020 +#: ../../library/dis.rst:1022 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1034 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1039 +#: ../../library/dis.rst:1041 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1046 +#: ../../library/dis.rst:1048 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1051 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -964,13 +969,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1057 +#: ../../library/dis.rst:1059 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1064 +#: ../../library/dis.rst:1066 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -980,33 +985,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1071 +#: ../../library/dis.rst:1073 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1074 +#: ../../library/dis.rst:1076 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1082 +#: ../../library/dis.rst:1084 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1090 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1097 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1102 +#: ../../library/dis.rst:1104 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1015,68 +1020,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1110 +#: ../../library/dis.rst:1112 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1117 +#: ../../library/dis.rst:1119 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1122 +#: ../../library/dis.rst:1124 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1129 +#: ../../library/dis.rst:1131 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1136 +#: ../../library/dis.rst:1138 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1139 ../../library/dis.rst:1152 +#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1144 ../../library/dis.rst:1157 -#: ../../library/dis.rst:1170 ../../library/dis.rst:1184 +#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 +#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1149 +#: ../../library/dis.rst:1151 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1162 +#: ../../library/dis.rst:1164 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1165 ../../library/dis.rst:1179 +#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1176 +#: ../../library/dis.rst:1178 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 +#: ../../library/dis.rst:1191 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1084,83 +1089,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1194 +#: ../../library/dis.rst:1196 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1201 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1203 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1207 +#: ../../library/dis.rst:1209 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1211 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1215 +#: ../../library/dis.rst:1217 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1225 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1233 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1236 +#: ../../library/dis.rst:1238 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1241 +#: ../../library/dis.rst:1243 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1249 +#: ../../library/dis.rst:1251 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1252 +#: ../../library/dis.rst:1254 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1255 ../../library/dis.rst:1264 -#: ../../library/dis.rst:1286 ../../library/dis.rst:1297 +#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 +#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1263 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1270 +#: ../../library/dis.rst:1272 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1170,94 +1175,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1285 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1292 +#: ../../library/dis.rst:1294 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1305 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1312 +#: ../../library/dis.rst:1314 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1317 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1318 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1319 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1323 +#: ../../library/dis.rst:1325 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1328 +#: ../../library/dis.rst:1330 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1329 ../../library/dis.rst:1335 +#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1332 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1338 +#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1333 +#: ../../library/dis.rst:1335 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1338 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1337 +#: ../../library/dis.rst:1339 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1342 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1343 +#: ../../library/dis.rst:1345 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1354 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1269,70 +1274,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1369 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1378 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1385 +#: ../../library/dis.rst:1387 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:1390 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1392 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1393 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1394 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1395 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1397 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1398 +#: ../../library/dis.rst:1400 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1408 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1414 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1421 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1424 +#: ../../library/dis.rst:1426 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1340,54 +1345,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1432 +#: ../../library/dis.rst:1434 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1438 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1437 +#: ../../library/dis.rst:1439 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1441 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1443 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1445 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1446 +#: ../../library/dis.rst:1448 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1454 +#: ../../library/dis.rst:1456 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1460 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1395,258 +1400,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1472 +#: ../../library/dis.rst:1474 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1476 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1478 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1480 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1481 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1482 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1487 +#: ../../library/dis.rst:1489 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1498 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1499 +#: ../../library/dis.rst:1501 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1508 +#: ../../library/dis.rst:1510 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1512 +#: ../../library/dis.rst:1514 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1515 +#: ../../library/dis.rst:1517 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1521 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1527 +#: ../../library/dis.rst:1529 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1531 ../../library/dis.rst:1581 +#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Description" msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1538 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1577 +#: ../../library/dis.rst:1579 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1608 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1610 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1615 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1620 +#: ../../library/dis.rst:1622 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1655,75 +1660,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1629 +#: ../../library/dis.rst:1631 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1633 +#: ../../library/dis.rst:1635 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1642 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1648 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1653 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1660 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1662 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1665 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1669 +#: ../../library/dis.rst:1671 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1674 +#: ../../library/dis.rst:1676 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1681 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1686 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1691 +#: ../../library/dis.rst:1693 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1696 +#: ../../library/dis.rst:1698 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1731,34 +1736,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1704 +#: ../../library/dis.rst:1706 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1709 +#: ../../library/dis.rst:1711 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1714 +#: ../../library/dis.rst:1716 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1719 +#: ../../library/dis.rst:1721 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1724 +#: ../../library/dis.rst:1726 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1730 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "slice" msgstr "slice(切片)" diff --git a/library/idle.po b/library/idle.po index 2686b61b6a..521bc73b78 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -922,7 +922,7 @@ msgstr "" msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " -"newline removed. If ``[x] Regular expresion`` is checked, the target is " +"newline removed. If ``[x] Regular expression`` is checked, the target is " "interpreted according to the Python re module." msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 9ebc47b3d0..ae8037bd2d 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+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-" @@ -728,7 +728,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:989 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 msgid "Returns :attr:`path`." msgstr "" @@ -855,58 +855,231 @@ msgid "" msgstr "" #: ../../library/importlib.rst:650 -msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:652 +msgid "" +"An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" #: ../../library/importlib.rst:655 +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 " +"lives next to the ``__init__.py`` file of the package. The purpose of this " +"class is to help abstract out the accessing of such data files so that it " +"does not matter if the package and its data file(s) are stored in a e.g. zip " +"file versus on the file system." +msgstr "" + +#: ../../library/importlib.rst:663 +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 " +"means that no subdirectory paths should be included in the *resource* " +"argument. This is because the location of the package the reader is for, " +"acts as the \"directory\". Hence the metaphor for directories and file names " +"is packages and resources, respectively. This is also why instances of this " +"class are expected to directly correlate to a specific package (instead of " +"potentially representing multiple packages or a module)." +msgstr "" + +#: ../../library/importlib.rst:674 +msgid "" +"Loaders that wish to support resource reading are expected to provide a " +"method called ``get_resource_reader(fullname)`` which returns an object " +"implementing this ABC's interface. If the module specified by fullname is " +"not a package, this method should return :const:`None`. An object compatible " +"with this ABC should only be returned when the specified module is a package." +msgstr "" + +#: ../../library/importlib.rst:685 ../../library/importlib.rst:795 +msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." +msgstr "" + +#: ../../library/importlib.rst:688 +msgid "" +"Returns an opened, :term:`file-like object` for binary reading of the " +"*resource*." +msgstr "" + +#: ../../library/importlib.rst:691 +msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." +msgstr "" + +#: ../../library/importlib.rst:696 +msgid "Returns the file system path to the *resource*." +msgstr "" + +#: ../../library/importlib.rst:698 +msgid "" +"If the resource does not concretely exist on the file system, raise :exc:" +"`FileNotFoundError`." +msgstr "" + +#: ../../library/importlib.rst:703 +msgid "" +"Returns ``True`` if the named *name* is considered a resource. :exc:" +"`FileNotFoundError` is raised if *name* does not exist." +msgstr "" + +#: ../../library/importlib.rst:708 +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 " +"actual resources, e.g. it is acceptable to return names for which :meth:" +"`is_resource` would be false." +msgstr "" + +#: ../../library/importlib.rst:714 +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-" +"resource names would be useful. For instance, returning subdirectory names " +"is allowed so that when it is known that the package and resources are " +"stored on the file system then those subdirectory names can be used directly." +msgstr "" + +#: ../../library/importlib.rst:722 +msgid "The abstract method returns an iterable of no items." +msgstr "" + +#: ../../library/importlib.rst:727 +msgid "" +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." +msgstr "" + +#: ../../library/importlib.rst:730 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.rst:737 +msgid "Use :class:`importlib.resources.abc.Traversable` instead." +msgstr "" + +#: ../../library/importlib.rst:740 +msgid "Abstract. The base name of this object without any parent references." +msgstr "" + +#: ../../library/importlib.rst:744 +msgid "Yield ``Traversable`` objects in ``self``." +msgstr "" + +#: ../../library/importlib.rst:748 +msgid "Return ``True`` if ``self`` is a directory." +msgstr "" + +#: ../../library/importlib.rst:752 +msgid "Return ``True`` if ``self`` is a file." +msgstr "" + +#: ../../library/importlib.rst:756 +msgid "Return Traversable child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:760 +msgid "Return ``Traversable`` child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:764 +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:767 +msgid "" +"When opening as text, accepts encoding parameters such as those accepted by :" +"attr:`io.TextIOWrapper`." +msgstr "" + +#: ../../library/importlib.rst:772 +msgid "Read contents of ``self`` as bytes." +msgstr "" + +#: ../../library/importlib.rst:776 +msgid "Read contents of ``self`` as text." +msgstr "" + +#: ../../library/importlib.rst:781 +msgid "" +"An abstract base class for resource readers capable of serving the :meth:" +"`importlib.resources.files` interface. Subclasses :class:`importlib." +"resources.abc.ResourceReader` and provides concrete implementations of the :" +"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " +"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " +"also supplies ResourceReader." +msgstr "" + +#: ../../library/importlib.rst:788 +msgid "" +"Loaders that wish to support resource reading are expected to implement this " +"interface." +msgstr "" + +#: ../../library/importlib.rst:798 +msgid "" +"Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " +"package." +msgstr "" + +#: ../../library/importlib.rst:804 +msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgstr "" + +#: ../../library/importlib.rst:809 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:659 +#: ../../library/importlib.rst:813 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:664 +#: ../../library/importlib.rst:818 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:671 +#: ../../library/importlib.rst:825 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:676 ../../library/importlib.rst:686 +#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:681 +#: ../../library/importlib.rst:835 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:845 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:850 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:855 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:862 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -915,57 +1088,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:873 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:724 ../../library/importlib.rst:738 -#: ../../library/importlib.rst:751 ../../library/importlib.rst:766 +#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 +#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:881 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:734 +#: ../../library/importlib.rst:888 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:741 +#: ../../library/importlib.rst:895 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:902 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:910 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:763 +#: ../../library/importlib.rst:917 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:771 +#: ../../library/importlib.rst:925 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -979,43 +1152,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:939 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:792 +#: ../../library/importlib.rst:946 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:797 +#: ../../library/importlib.rst:951 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:800 +#: ../../library/importlib.rst:954 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:807 +#: ../../library/importlib.rst:961 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:810 +#: ../../library/importlib.rst:964 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:967 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. " @@ -1023,7 +1196,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:972 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 " @@ -1036,166 +1209,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:986 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:836 +#: ../../library/importlib.rst:990 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:842 +#: ../../library/importlib.rst:996 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:846 +#: ../../library/importlib.rst:1000 msgid "" "A class method which returns a closure for use on :data:`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:851 +#: ../../library/importlib.rst:1005 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:857 +#: ../../library/importlib.rst:1011 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:865 +#: ../../library/importlib.rst:1019 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:869 +#: ../../library/importlib.rst:1023 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:1027 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:877 +#: ../../library/importlib.rst:1031 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:1035 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:885 ../../library/importlib.rst:928 +#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 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:890 ../../library/importlib.rst:933 +#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:1049 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:898 +#: ../../library/importlib.rst:1052 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:907 +#: ../../library/importlib.rst:1061 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:1065 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:915 +#: ../../library/importlib.rst:1069 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:919 +#: ../../library/importlib.rst:1073 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:923 +#: ../../library/importlib.rst:1077 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:938 +#: ../../library/importlib.rst:1092 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:941 +#: ../../library/importlib.rst:1095 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:944 +#: ../../library/importlib.rst:1098 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:1104 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:955 +#: ../../library/importlib.rst:1109 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:959 +#: ../../library/importlib.rst:1113 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:1117 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:970 +#: ../../library/importlib.rst:1124 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:976 +#: ../../library/importlib.rst:1130 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:1135 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:985 +#: ../../library/importlib.rst:1139 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:1150 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1168 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1208,31 +1381,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1182 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1184 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1189 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:1191 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1042 +#: ../../library/importlib.rst:1196 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1198 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1241,11 +1414,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1206 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1208 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1255,66 +1428,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1217 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1223 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1225 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1231 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1233 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:1245 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1097 +#: ../../library/importlib.rst:1251 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1101 +#: ../../library/importlib.rst:1255 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1106 +#: ../../library/importlib.rst:1260 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:1113 +#: ../../library/importlib.rst:1267 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 " @@ -1324,7 +1497,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:1274 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1337,7 +1510,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1284 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 " @@ -1346,18 +1519,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1138 +#: ../../library/importlib.rst:1292 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1142 ../../library/importlib.rst:1158 -#: ../../library/importlib.rst:1247 +#: ../../library/importlib.rst:1296 ../../library/importlib.rst:1312 +#: ../../library/importlib.rst:1401 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1148 +#: ../../library/importlib.rst:1302 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." @@ -1367,25 +1540,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1163 +#: ../../library/importlib.rst:1317 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:1171 +#: ../../library/importlib.rst:1325 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1173 +#: ../../library/importlib.rst:1327 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:1178 +#: ../../library/importlib.rst:1332 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:" @@ -1393,13 +1566,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1340 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1347 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1409,30 +1582,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1200 +#: ../../library/importlib.rst:1354 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1203 +#: ../../library/importlib.rst:1357 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1207 +#: ../../library/importlib.rst:1361 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:1214 +#: ../../library/importlib.rst:1368 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1371 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1440,14 +1613,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1376 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:1230 +#: ../../library/importlib.rst:1384 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 " @@ -1456,7 +1629,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1394 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 " @@ -1464,14 +1637,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1252 +#: ../../library/importlib.rst:1406 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:1260 +#: ../../library/importlib.rst:1414 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1480,33 +1653,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1421 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1271 +#: ../../library/importlib.rst:1425 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " -"mulitple interpreters (or per-interpreter GIL)." +"multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1430 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1438 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1287 +#: ../../library/importlib.rst:1441 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 " @@ -1519,7 +1692,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:1452 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 " @@ -1528,70 +1701,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1460 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:1313 +#: ../../library/importlib.rst:1467 msgid "" "A class 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:1326 +#: ../../library/importlib.rst:1480 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1483 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1485 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1494 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1496 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:1345 +#: ../../library/importlib.rst:1499 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1368 +#: ../../library/importlib.rst:1522 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1370 +#: ../../library/importlib.rst:1524 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1541 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1389 +#: ../../library/importlib.rst:1543 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1411 +#: ../../library/importlib.rst:1565 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1567 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1605,11 +1778,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1599 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1601 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/importlib.resources.abc.po b/library/importlib.resources.abc.po index c600f6586d..31ba47eca2 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,38 +65,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.resources.abc.rst:50 -#: ../../library/importlib.resources.abc.rst:160 +#: ../../library/importlib.resources.abc.rst:48 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.resources.abc.rst:53 +#: ../../library/importlib.resources.abc.rst:51 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:56 +#: ../../library/importlib.resources.abc.rst:54 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:61 +#: ../../library/importlib.resources.abc.rst:59 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:63 +#: ../../library/importlib.resources.abc.rst:61 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:68 +#: ../../library/importlib.resources.abc.rst:66 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:73 +#: ../../library/importlib.resources.abc.rst:71 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 " @@ -104,7 +103,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:79 +#: ../../library/importlib.resources.abc.rst:77 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-" @@ -113,68 +112,64 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:87 +#: ../../library/importlib.resources.abc.rst:85 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:92 +#: ../../library/importlib.resources.abc.rst:90 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:95 +#: ../../library/importlib.resources.abc.rst:93 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:102 -msgid "Use :class:`importlib.resources.abc.Traversable` instead." -msgstr "" - -#: ../../library/importlib.resources.abc.rst:105 +#: ../../library/importlib.resources.abc.rst:98 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:109 +#: ../../library/importlib.resources.abc.rst:102 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:113 +#: ../../library/importlib.resources.abc.rst:106 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:117 +#: ../../library/importlib.resources.abc.rst:110 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:121 -#: ../../library/importlib.resources.abc.rst:125 +#: ../../library/importlib.resources.abc.rst:114 +#: ../../library/importlib.resources.abc.rst:118 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:129 +#: ../../library/importlib.resources.abc.rst:122 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.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:125 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:130 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:141 +#: ../../library/importlib.resources.abc.rst:134 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:146 +#: ../../library/importlib.resources.abc.rst:139 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " @@ -183,13 +178,13 @@ msgid "" "TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" -#: ../../library/importlib.resources.abc.rst:153 +#: ../../library/importlib.resources.abc.rst:146 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:163 +#: ../../library/importlib.resources.abc.rst:151 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 0ea74a8221..927b9c1463 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -116,28 +116,32 @@ msgstr "" #: ../../library/importlib.resources.rst:84 msgid "" "Given a :class:`~importlib.resources.abc.Traversable` object representing a " -"file, typically from :func:`importlib.resources.files`, return a context " -"manager for use in a :keyword:`with` statement. The context manager provides " -"a :class:`pathlib.Path` object." +"file or directory, typically from :func:`importlib.resources.files`, return " +"a context manager for use in a :keyword:`with` statement. The context " +"manager provides a :class:`pathlib.Path` object." msgstr "" #: ../../library/importlib.resources.rst:89 msgid "" -"Exiting the context manager cleans up any temporary file created when the " -"resource was extracted from e.g. a zip file." +"Exiting the context manager cleans up any temporary file or directory " +"created when the resource was extracted from e.g. a zip file." msgstr "" #: ../../library/importlib.resources.rst:92 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " -"insufficient and an actual file on the file system is required." +"insufficient and an actual file or directory on the file system is required." +msgstr "" + +#: ../../library/importlib.resources.rst:98 +msgid "Added support for ``traversable`` representing a directory." msgstr "" -#: ../../library/importlib.resources.rst:100 +#: ../../library/importlib.resources.rst:103 msgid "Deprecated functions" msgstr "已棄用函式" -#: ../../library/importlib.resources.rst:102 +#: ../../library/importlib.resources.rst:105 msgid "" "An older, deprecated set of functions is still available, but is scheduled " "for removal in a future version of Python. The main drawback of these " @@ -145,7 +149,7 @@ msgid "" "are located directly within a *package*." msgstr "" -#: ../../library/importlib.resources.rst:109 +#: ../../library/importlib.resources.rst:112 msgid "" "Whenever a function accepts a ``Package`` argument, you can pass in either " "a :class:`module object ` or a module name as a string. " @@ -153,25 +157,25 @@ msgid "" "submodule_search_locations`` is not ``None``." msgstr "" -#: ../../library/importlib.resources.rst:114 +#: ../../library/importlib.resources.rst:117 msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." msgstr "" -#: ../../library/importlib.resources.rst:121 +#: ../../library/importlib.resources.rst:124 msgid "" "For *resource* arguments of the functions below, you can pass in the name of " "a resource as a string or a :class:`path-like object `." msgstr "" -#: ../../library/importlib.resources.rst:125 +#: ../../library/importlib.resources.rst:128 msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.resources.rst:130 +#: ../../library/importlib.resources.rst:133 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.resources.rst:132 +#: ../../library/importlib.resources.rst:135 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 " @@ -180,22 +184,22 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:140 -#: ../../library/importlib.resources.rst:161 -#: ../../library/importlib.resources.rst:179 -#: ../../library/importlib.resources.rst:198 -#: ../../library/importlib.resources.rst:234 -#: ../../library/importlib.resources.rst:250 +#: ../../library/importlib.resources.rst:143 +#: ../../library/importlib.resources.rst:164 +#: ../../library/importlib.resources.rst:182 +#: ../../library/importlib.resources.rst:201 +#: ../../library/importlib.resources.rst:237 +#: ../../library/importlib.resources.rst:253 msgid "Calls to this function can be replaced by::" msgstr "" -#: ../../library/importlib.resources.rst:147 +#: ../../library/importlib.resources.rst:150 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:150 +#: ../../library/importlib.resources.rst:153 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 " @@ -204,18 +208,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.resources.rst:156 +#: ../../library/importlib.resources.rst:159 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.resources.rst:168 +#: ../../library/importlib.resources.rst:171 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.resources.rst:171 +#: ../../library/importlib.resources.rst:174 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 " @@ -224,13 +228,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.resources.rst:186 +#: ../../library/importlib.resources.rst:189 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.resources.rst:189 +#: ../../library/importlib.resources.rst:192 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 " @@ -240,20 +244,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.resources.rst:205 +#: ../../library/importlib.resources.rst:208 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.resources.rst:209 +#: ../../library/importlib.resources.rst:212 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.resources.rst:212 +#: ../../library/importlib.resources.rst:215 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 " @@ -261,11 +265,11 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.resources.rst:219 +#: ../../library/importlib.resources.rst:222 msgid "Calls to this function can be replaced using :func:`as_file`::" msgstr "" -#: ../../library/importlib.resources.rst:226 +#: ../../library/importlib.resources.rst:229 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. This function does not consider directories to be " @@ -273,14 +277,14 @@ msgid "" "the ``Package`` requirements." msgstr "" -#: ../../library/importlib.resources.rst:241 +#: ../../library/importlib.resources.rst:244 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.resources.rst:245 +#: ../../library/importlib.resources.rst:248 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." diff --git a/library/inspect.po b/library/inspect.po index 3a1d2173e9..65cac3464a 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-06 16:53+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1027,8 +1027,8 @@ msgstr "" #: ../../library/inspect.rst:733 msgid "" -"Create a new Signature instance based on the instance replace was invoked " -"on. It is possible to pass different ``parameters`` and/or " +"Create a new Signature instance based on the instance :meth:`replace` was " +"invoked on. It is possible to pass different ``parameters`` and/or " "``return_annotation`` to override the corresponding properties of the base " "signature. To remove return_annotation from the copied Signature, pass in :" "attr:`Signature.empty`." diff --git a/library/io.po b/library/io.po index 4c42b73fc0..fba54e7c27 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-08-30 00:04+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1139 +#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1149 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1127 +#: ../../library/io.rst:72 ../../library/io.rst:1137 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -665,54 +665,51 @@ msgstr "" #: ../../library/io.rst:408 msgid "" -"Change the stream position to the given byte *offset*. *offset* is " -"interpreted relative to the position indicated by *whence*. The default " -"value for *whence* is :data:`!SEEK_SET`. Values for *whence* are:" +"Change the stream position to the given byte *offset*, interpreted relative " +"to the position indicated by *whence*, and return the new absolute position. " +"Values for *whence* are:" msgstr "" -#: ../../library/io.rst:412 +#: ../../library/io.rst:413 msgid "" -":data:`!SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " +":data:`os.SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" -#: ../../library/io.rst:414 +#: ../../library/io.rst:415 msgid "" -":data:`!SEEK_CUR` or ``1`` -- current stream position; *offset* may be " +":data:`os.SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" -#: ../../library/io.rst:416 +#: ../../library/io.rst:417 msgid "" -":data:`!SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" -msgstr "" - -#: ../../library/io.rst:419 -msgid "Return the new absolute position." +":data:`os.SEEK_END` or ``2`` -- end of the stream; *offset* is usually " +"negative" msgstr "" -#: ../../library/io.rst:421 ../../library/io.rst:931 +#: ../../library/io.rst:420 ../../library/io.rst:930 msgid "The :data:`!SEEK_*` constants." msgstr "" -#: ../../library/io.rst:424 +#: ../../library/io.rst:423 msgid "" "Some operating systems could support additional values, like :const:`os." "SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " "depend on it being open in text or binary mode." msgstr "" -#: ../../library/io.rst:431 +#: ../../library/io.rst:430 msgid "" "Return ``True`` if the stream supports random access. If ``False``, :meth:" "`seek`, :meth:`tell` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:436 +#: ../../library/io.rst:435 msgid "Return the current stream position." msgstr "" -#: ../../library/io.rst:440 +#: ../../library/io.rst:439 msgid "" "Resize the stream to the given *size* in bytes (or the current position if " "*size* is not specified). The current stream position isn't changed. This " @@ -721,34 +718,34 @@ msgid "" "additional bytes are zero-filled). The new file size is returned." msgstr "" -#: ../../library/io.rst:447 +#: ../../library/io.rst:446 msgid "Windows will now zero-fill files when extending." msgstr "" -#: ../../library/io.rst:452 +#: ../../library/io.rst:451 msgid "" "Return ``True`` if the stream supports writing. If ``False``, :meth:`!" "write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:457 +#: ../../library/io.rst:456 msgid "" "Write a list of lines to the stream. Line separators are not added, so it " "is usual for each of the lines provided to have a line separator at the end." msgstr "" -#: ../../library/io.rst:463 +#: ../../library/io.rst:462 msgid "" "Prepare for object destruction. :class:`IOBase` provides a default " "implementation of this method that calls the instance's :meth:`~IOBase." "close` method." msgstr "" -#: ../../library/io.rst:470 +#: ../../library/io.rst:469 msgid "Base class for raw binary streams. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:472 +#: ../../library/io.rst:471 msgid "" "Raw binary streams typically provide low-level access to an underlying OS " "device or API, and do not try to encapsulate it in high-level primitives " @@ -756,13 +753,13 @@ msgid "" "text streams, described later in this page)." msgstr "" -#: ../../library/io.rst:477 +#: ../../library/io.rst:476 msgid "" ":class:`RawIOBase` provides these methods in addition to those from :class:" "`IOBase`:" msgstr "" -#: ../../library/io.rst:482 +#: ../../library/io.rst:481 msgid "" "Read up to *size* bytes from the object and return them. As a convenience, " "if *size* is unspecified or -1, all bytes until EOF are returned. Otherwise, " @@ -770,25 +767,25 @@ msgid "" "if the operating system call returns fewer than *size* bytes." msgstr "" -#: ../../library/io.rst:487 +#: ../../library/io.rst:486 msgid "" "If 0 bytes are returned, and *size* was not 0, this indicates end of file. " "If the object is in non-blocking mode and no bytes are available, ``None`` " "is returned." msgstr "" -#: ../../library/io.rst:491 +#: ../../library/io.rst:490 msgid "" "The default implementation defers to :meth:`readall` and :meth:`readinto`." msgstr "" -#: ../../library/io.rst:496 +#: ../../library/io.rst:495 msgid "" "Read and return all the bytes from the stream until EOF, using multiple " "calls to the stream if necessary." msgstr "" -#: ../../library/io.rst:501 +#: ../../library/io.rst:500 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and " "return the number of bytes read. For example, *b* might be a :class:" @@ -796,7 +793,7 @@ msgid "" "available, ``None`` is returned." msgstr "" -#: ../../library/io.rst:509 +#: ../../library/io.rst:508 msgid "" "Write the given :term:`bytes-like object`, *b*, to the underlying raw " "stream, and return the number of bytes written. This can be less than the " @@ -807,13 +804,13 @@ msgid "" "the implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:522 +#: ../../library/io.rst:521 msgid "" "Base class for binary streams that support some kind of buffering. It " "inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:525 +#: ../../library/io.rst:524 msgid "" "The main difference with :class:`RawIOBase` is that methods :meth:`read`, :" "meth:`readinto` and :meth:`write` will try (respectively) to read as much " @@ -821,7 +818,7 @@ msgid "" "perhaps more than one system call." msgstr "" -#: ../../library/io.rst:530 +#: ../../library/io.rst:529 msgid "" "In addition, those methods can raise :exc:`BlockingIOError` if the " "underlying raw stream is in non-blocking mode and cannot take or give enough " @@ -829,55 +826,55 @@ msgid "" "``None``." msgstr "" -#: ../../library/io.rst:535 +#: ../../library/io.rst:534 msgid "" "Besides, the :meth:`read` method does not have a default implementation that " "defers to :meth:`readinto`." msgstr "" -#: ../../library/io.rst:538 +#: ../../library/io.rst:537 msgid "" "A typical :class:`BufferedIOBase` implementation should not inherit from a :" "class:`RawIOBase` implementation, but wrap one, like :class:`BufferedWriter` " "and :class:`BufferedReader` do." msgstr "" -#: ../../library/io.rst:542 +#: ../../library/io.rst:541 msgid "" ":class:`BufferedIOBase` provides or overrides these data attributes and " "methods in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:547 +#: ../../library/io.rst:546 msgid "" "The underlying raw stream (a :class:`RawIOBase` instance) that :class:" "`BufferedIOBase` deals with. This is not part of the :class:" "`BufferedIOBase` API and may not exist on some implementations." msgstr "" -#: ../../library/io.rst:553 +#: ../../library/io.rst:552 msgid "Separate the underlying raw stream from the buffer and return it." msgstr "" -#: ../../library/io.rst:555 +#: ../../library/io.rst:554 msgid "" "After the raw stream has been detached, the buffer is in an unusable state." msgstr "" -#: ../../library/io.rst:558 +#: ../../library/io.rst:557 msgid "" "Some buffers, like :class:`BytesIO`, do not have the concept of a single raw " "stream to return from this method. They raise :exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:566 +#: ../../library/io.rst:565 msgid "" "Read and return up to *size* bytes. If the argument is omitted, ``None``, " "or negative, data is read and returned until EOF is reached. An empty :" "class:`bytes` object is returned if the stream is already at EOF." msgstr "" -#: ../../library/io.rst:570 +#: ../../library/io.rst:569 msgid "" "If the argument is positive, and the underlying raw stream is not " "interactive, multiple raw reads may be issued to satisfy the byte count " @@ -886,13 +883,13 @@ msgid "" "imminent." msgstr "" -#: ../../library/io.rst:576 ../../library/io.rst:599 ../../library/io.rst:609 +#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608 msgid "" "A :exc:`BlockingIOError` is raised if the underlying raw stream is in non " "blocking-mode, and has no data available at the moment." msgstr "" -#: ../../library/io.rst:581 +#: ../../library/io.rst:580 msgid "" "Read and return up to *size* bytes, with at most one call to the underlying " "raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) " @@ -900,26 +897,26 @@ msgid "" "top of a :class:`BufferedIOBase` object." msgstr "" -#: ../../library/io.rst:587 +#: ../../library/io.rst:586 msgid "" "If *size* is ``-1`` (the default), an arbitrary number of bytes are returned " "(more than zero unless EOF is reached)." msgstr "" -#: ../../library/io.rst:592 +#: ../../library/io.rst:591 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and " "return the number of bytes read. For example, *b* might be a :class:" "`bytearray`." msgstr "" -#: ../../library/io.rst:596 +#: ../../library/io.rst:595 msgid "" "Like :meth:`read`, multiple reads may be issued to the underlying raw " "stream, unless the latter is interactive." msgstr "" -#: ../../library/io.rst:604 +#: ../../library/io.rst:603 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, " "using at most one call to the underlying raw stream's :meth:`~RawIOBase." @@ -927,7 +924,7 @@ msgid "" "read." msgstr "" -#: ../../library/io.rst:616 +#: ../../library/io.rst:615 msgid "" "Write the given :term:`bytes-like object`, *b*, and return the number of " "bytes written (always equal to the length of *b* in bytes, since if the " @@ -936,41 +933,41 @@ msgid "" "or held in a buffer for performance and latency reasons." msgstr "" -#: ../../library/io.rst:623 +#: ../../library/io.rst:622 msgid "" "When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data " "needed to be written to the raw stream but it couldn't accept all the data " "without blocking." msgstr "" -#: ../../library/io.rst:627 +#: ../../library/io.rst:626 msgid "" "The caller may release or mutate *b* after this method returns, so the " "implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:632 +#: ../../library/io.rst:631 msgid "Raw File I/O" msgstr "" -#: ../../library/io.rst:636 +#: ../../library/io.rst:635 msgid "" "A raw binary stream representing an OS-level file containing bytes data. It " "inherits :class:`RawIOBase`." msgstr "" -#: ../../library/io.rst:639 +#: ../../library/io.rst:638 msgid "The *name* can be one of two things:" msgstr "" -#: ../../library/io.rst:641 +#: ../../library/io.rst:640 msgid "" "a character string or :class:`bytes` object representing the path to the " "file which will be opened. In this case closefd must be ``True`` (the " "default) otherwise an error will be raised." msgstr "" -#: ../../library/io.rst:644 +#: ../../library/io.rst:643 msgid "" "an integer representing the number of an existing OS-level file descriptor " "to which the resulting :class:`FileIO` object will give access. When the " @@ -978,7 +975,7 @@ msgid "" "set to ``False``." msgstr "" -#: ../../library/io.rst:649 +#: ../../library/io.rst:648 msgid "" "The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading " "(default), writing, exclusive creation or appending. The file will be " @@ -989,14 +986,14 @@ msgid "" "``'+'`` to the mode to allow simultaneous reading and writing." msgstr "" -#: ../../library/io.rst:657 +#: ../../library/io.rst:656 msgid "" "The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" "`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " "will only make one system call." msgstr "" -#: ../../library/io.rst:661 +#: ../../library/io.rst:660 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 " @@ -1005,372 +1002,372 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:667 +#: ../../library/io.rst:666 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:669 +#: ../../library/io.rst:668 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:672 +#: ../../library/io.rst:671 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:676 +#: ../../library/io.rst:675 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:679 +#: ../../library/io.rst:678 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:684 +#: ../../library/io.rst:683 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:688 +#: ../../library/io.rst:687 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:693 +#: ../../library/io.rst:692 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:695 +#: ../../library/io.rst:694 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:700 +#: ../../library/io.rst:699 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:704 +#: ../../library/io.rst:703 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:707 +#: ../../library/io.rst:706 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:712 +#: ../../library/io.rst:711 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:723 +#: ../../library/io.rst:722 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:730 +#: ../../library/io.rst:729 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:735 +#: ../../library/io.rst:734 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:737 ../../library/io.rst:780 +#: ../../library/io.rst:736 ../../library/io.rst:779 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:742 +#: ../../library/io.rst:741 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:748 +#: ../../library/io.rst:747 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:752 +#: ../../library/io.rst:751 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:756 +#: ../../library/io.rst:755 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:760 +#: ../../library/io.rst:759 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:765 +#: ../../library/io.rst:764 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:771 +#: ../../library/io.rst:770 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:776 +#: ../../library/io.rst:775 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:786 +#: ../../library/io.rst:785 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:790 +#: ../../library/io.rst:789 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:794 +#: ../../library/io.rst:793 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:795 +#: ../../library/io.rst:794 msgid "when :meth:`flush` is called;" msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:795 msgid "" "when a :meth:`~IOBase.seek` is requested (for :class:`BufferedRandom` " "objects);" msgstr "" -#: ../../library/io.rst:797 +#: ../../library/io.rst:796 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:799 +#: ../../library/io.rst:798 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:803 +#: ../../library/io.rst:802 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:808 +#: ../../library/io.rst:807 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:813 +#: ../../library/io.rst:812 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:821 +#: ../../library/io.rst:820 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:825 +#: ../../library/io.rst:824 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:829 +#: ../../library/io.rst:828 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" "class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" "`~IOBase.tell` are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:836 +#: ../../library/io.rst:835 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:840 +#: ../../library/io.rst:839 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:844 +#: ../../library/io.rst:843 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:850 +#: ../../library/io.rst:849 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:860 +#: ../../library/io.rst:859 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:863 +#: ../../library/io.rst:862 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:868 +#: ../../library/io.rst:867 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:873 +#: ../../library/io.rst:872 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:877 +#: ../../library/io.rst:876 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:883 +#: ../../library/io.rst:882 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:889 +#: ../../library/io.rst:888 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:892 +#: ../../library/io.rst:891 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:895 +#: ../../library/io.rst:894 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:903 +#: ../../library/io.rst:902 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:908 +#: ../../library/io.rst:907 msgid "" "Read until newline or EOF and return a single :class:`str`. If the stream " "is already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:911 +#: ../../library/io.rst:910 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:915 +#: ../../library/io.rst:914 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " "*whence* parameter. The default value for *whence* is :data:`!SEEK_SET`." msgstr "" -#: ../../library/io.rst:919 +#: ../../library/io.rst:918 msgid "" ":data:`!SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:923 +#: ../../library/io.rst:922 msgid "" ":data:`!SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:926 +#: ../../library/io.rst:925 msgid "" ":data:`!SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:929 +#: ../../library/io.rst:928 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:936 +#: ../../library/io.rst:935 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:942 +#: ../../library/io.rst:941 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:949 +#: ../../library/io.rst:948 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:953 +#: ../../library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getencoding()`. " @@ -1378,7 +1375,7 @@ msgid "" "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: ../../library/io.rst:958 +#: ../../library/io.rst:957 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1393,13 +1390,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:974 +#: ../../library/io.rst:973 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:977 +#: ../../library/io.rst:976 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1411,7 +1408,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:986 +#: ../../library/io.rst:985 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1420,13 +1417,13 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:992 +#: ../../library/io.rst:991 msgid "" "If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " "call to write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:995 +#: ../../library/io.rst:994 msgid "" "If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " "guaranteed not to be buffered: any data written on the :class:" @@ -1434,11 +1431,11 @@ msgid "" "*buffer*." msgstr "" -#: ../../library/io.rst:999 +#: ../../library/io.rst:998 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:1002 +#: ../../library/io.rst:1001 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1446,97 +1443,108 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:1008 +#: ../../library/io.rst:1007 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: ../../library/io.rst:1011 +#: ../../library/io.rst:1010 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1016 +#: ../../library/io.rst:1015 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:1020 +#: ../../library/io.rst:1019 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:1028 +#: ../../library/io.rst:1027 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:1031 +#: ../../library/io.rst:1030 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:1035 +#: ../../library/io.rst:1034 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:1039 +#: ../../library/io.rst:1038 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:1044 +#: ../../library/io.rst:1043 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1048 msgid "" "Set the stream position. Return the new stream position as an :class:`int`." msgstr "" -#: ../../library/io.rst:1052 +#: ../../library/io.rst:1051 msgid "" "Four operations are supported, given by the following argument combinations:" msgstr "" -#: ../../library/io.rst:1055 +#: ../../library/io.rst:1054 msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." msgstr "" -#: ../../library/io.rst:1056 +#: ../../library/io.rst:1055 msgid "" "``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " -"be** a number returned by :meth:`!tell`." +"be** a number returned by :meth:`tell`." msgstr "" -#: ../../library/io.rst:1058 +#: ../../library/io.rst:1057 msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." msgstr "" -#: ../../library/io.rst:1059 +#: ../../library/io.rst:1058 msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." msgstr "" -#: ../../library/io.rst:1061 +#: ../../library/io.rst:1060 msgid "Any other argument combinations are invalid, and may raise exceptions." msgstr "" -#: ../../library/io.rst:1066 +#: ../../library/io.rst:1065 +msgid ":data:`os.SEEK_SET`, :data:`os.SEEK_CUR`, and :data:`os.SEEK_END`." +msgstr "" + +#: ../../library/io.rst:1069 +msgid "" +"Return the stream position as an opaque number. The return value of :meth:`!" +"tell` can be given as input to :meth:`seek`, to restore a previous stream " +"position." +msgstr "" + +#: ../../library/io.rst:1076 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1069 +#: ../../library/io.rst:1079 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1072 +#: ../../library/io.rst:1082 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1548,50 +1556,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1081 +#: ../../library/io.rst:1091 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1085 +#: ../../library/io.rst:1095 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1090 +#: ../../library/io.rst:1100 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1094 +#: ../../library/io.rst:1104 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1116 +#: ../../library/io.rst:1126 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1121 +#: ../../library/io.rst:1131 msgid "Performance" msgstr "" -#: ../../library/io.rst:1123 +#: ../../library/io.rst:1133 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1129 +#: ../../library/io.rst:1139 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1604,7 +1612,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1141 +#: ../../library/io.rst:1151 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1614,24 +1622,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1148 +#: ../../library/io.rst:1158 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1152 +#: ../../library/io.rst:1162 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1154 +#: ../../library/io.rst:1164 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1157 +#: ../../library/io.rst:1167 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1639,15 +1647,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1162 +#: ../../library/io.rst:1172 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1165 +#: ../../library/io.rst:1175 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1167 +#: ../../library/io.rst:1177 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1658,7 +1666,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1175 +#: ../../library/io.rst:1185 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1674,14 +1682,14 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1111 +#: ../../library/io.rst:970 ../../library/io.rst:1121 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/io.rst:971 +#: ../../library/io.rst:970 msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1111 +#: ../../library/io.rst:1121 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/itertools.po b/library/itertools.po index 91e47042bf..1bae04ba61 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-13 00:03+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-" @@ -889,6 +889,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1025 +#: ../../library/itertools.rst:1022 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index df80d4e10b..2d6e9bd948 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+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-" @@ -3289,7 +3289,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2990 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 " +"interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" diff --git a/library/os.po b/library/os.po index bfc519c83b..e7c91a433e 100644 --- a/library/os.po +++ b/library/os.po @@ -302,32 +302,32 @@ msgstr "" #: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 #: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 #: ../../library/os.rst:1345 ../../library/os.rst:1371 -#: ../../library/os.rst:1608 ../../library/os.rst:1647 -#: ../../library/os.rst:1656 ../../library/os.rst:2020 -#: ../../library/os.rst:2109 ../../library/os.rst:2149 -#: ../../library/os.rst:2429 ../../library/os.rst:2451 -#: ../../library/os.rst:4035 ../../library/os.rst:4042 -#: ../../library/os.rst:4049 ../../library/os.rst:4056 -#: ../../library/os.rst:4063 ../../library/os.rst:4070 -#: ../../library/os.rst:4077 ../../library/os.rst:4085 -#: ../../library/os.rst:4093 ../../library/os.rst:4100 -#: ../../library/os.rst:4107 ../../library/os.rst:4116 -#: ../../library/os.rst:4124 ../../library/os.rst:4132 -#: ../../library/os.rst:4139 ../../library/os.rst:4146 -#: ../../library/os.rst:4167 ../../library/os.rst:4184 -#: ../../library/os.rst:4224 ../../library/os.rst:4231 -#: ../../library/os.rst:4261 ../../library/os.rst:4388 -#: ../../library/os.rst:4437 ../../library/os.rst:4674 -#: ../../library/os.rst:4708 ../../library/os.rst:4766 -#: ../../library/os.rst:4780 ../../library/os.rst:4797 -#: ../../library/os.rst:4812 ../../library/os.rst:4823 -#: ../../library/os.rst:4835 ../../library/os.rst:4848 -#: ../../library/os.rst:4857 ../../library/os.rst:4867 -#: ../../library/os.rst:4880 ../../library/os.rst:4931 -#: ../../library/os.rst:4942 ../../library/os.rst:4954 -#: ../../library/os.rst:4961 ../../library/os.rst:4970 -#: ../../library/os.rst:4979 ../../library/os.rst:4988 -#: ../../library/os.rst:4997 +#: ../../library/os.rst:1608 ../../library/os.rst:1628 +#: ../../library/os.rst:1637 ../../library/os.rst:2021 +#: ../../library/os.rst:2110 ../../library/os.rst:2150 +#: ../../library/os.rst:2430 ../../library/os.rst:2452 +#: ../../library/os.rst:4036 ../../library/os.rst:4043 +#: ../../library/os.rst:4050 ../../library/os.rst:4057 +#: ../../library/os.rst:4064 ../../library/os.rst:4071 +#: ../../library/os.rst:4078 ../../library/os.rst:4086 +#: ../../library/os.rst:4094 ../../library/os.rst:4101 +#: ../../library/os.rst:4108 ../../library/os.rst:4117 +#: ../../library/os.rst:4125 ../../library/os.rst:4133 +#: ../../library/os.rst:4140 ../../library/os.rst:4147 +#: ../../library/os.rst:4168 ../../library/os.rst:4185 +#: ../../library/os.rst:4225 ../../library/os.rst:4232 +#: ../../library/os.rst:4262 ../../library/os.rst:4389 +#: ../../library/os.rst:4438 ../../library/os.rst:4675 +#: ../../library/os.rst:4709 ../../library/os.rst:4767 +#: ../../library/os.rst:4781 ../../library/os.rst:4798 +#: ../../library/os.rst:4813 ../../library/os.rst:4824 +#: ../../library/os.rst:4836 ../../library/os.rst:4849 +#: ../../library/os.rst:4858 ../../library/os.rst:4868 +#: ../../library/os.rst:4881 ../../library/os.rst:4932 +#: ../../library/os.rst:4943 ../../library/os.rst:4955 +#: ../../library/os.rst:4962 ../../library/os.rst:4971 +#: ../../library/os.rst:4980 ../../library/os.rst:4989 +#: ../../library/os.rst:4998 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -484,11 +484,11 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1357 -#: ../../library/os.rst:1628 ../../library/os.rst:1796 -#: ../../library/os.rst:2529 ../../library/os.rst:3374 -#: ../../library/os.rst:3411 ../../library/os.rst:4027 -#: ../../library/os.rst:4525 ../../library/os.rst:4536 -#: ../../library/os.rst:4653 +#: ../../library/os.rst:1649 ../../library/os.rst:1797 +#: ../../library/os.rst:2530 ../../library/os.rst:3375 +#: ../../library/os.rst:3412 ../../library/os.rst:4028 +#: ../../library/os.rst:4526 ../../library/os.rst:4537 +#: ../../library/os.rst:4654 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -513,15 +513,15 @@ msgstr "" #: ../../library/os.rst:1074 ../../library/os.rst:1138 #: ../../library/os.rst:1150 ../../library/os.rst:1396 #: ../../library/os.rst:1411 ../../library/os.rst:1424 -#: ../../library/os.rst:1493 ../../library/os.rst:1707 -#: ../../library/os.rst:1734 ../../library/os.rst:1769 -#: ../../library/os.rst:2092 ../../library/os.rst:2123 -#: ../../library/os.rst:2164 ../../library/os.rst:2177 -#: ../../library/os.rst:2495 ../../library/os.rst:2507 -#: ../../library/os.rst:3240 ../../library/os.rst:3397 -#: ../../library/os.rst:3630 ../../library/os.rst:5143 -#: ../../library/os.rst:5152 ../../library/os.rst:5173 -#: ../../library/os.rst:5183 ../../library/os.rst:5192 +#: ../../library/os.rst:1493 ../../library/os.rst:1708 +#: ../../library/os.rst:1735 ../../library/os.rst:1770 +#: ../../library/os.rst:2093 ../../library/os.rst:2124 +#: ../../library/os.rst:2165 ../../library/os.rst:2178 +#: ../../library/os.rst:2496 ../../library/os.rst:2508 +#: ../../library/os.rst:3241 ../../library/os.rst:3398 +#: ../../library/os.rst:3631 ../../library/os.rst:5144 +#: ../../library/os.rst:5153 ../../library/os.rst:5174 +#: ../../library/os.rst:5184 ../../library/os.rst:5193 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -593,10 +593,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3992 -#: ../../library/os.rst:4208 ../../library/os.rst:4506 -#: ../../library/os.rst:4630 ../../library/os.rst:4746 -#: ../../library/os.rst:4915 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 +#: ../../library/os.rst:4209 ../../library/os.rst:4507 +#: ../../library/os.rst:4631 ../../library/os.rst:4747 +#: ../../library/os.rst:4916 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +894,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4655 +#: ../../library/os.rst:789 ../../library/os.rst:4656 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1123,8 +1123,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1002 ../../library/os.rst:2068 -#: ../../library/os.rst:2162 +#: ../../library/os.rst:1002 ../../library/os.rst:2069 +#: ../../library/os.rst:2163 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1133,9 +1133,9 @@ msgstr "" "` ``os.chmod``。" #: ../../library/os.rst:1006 ../../library/os.rst:1021 -#: ../../library/os.rst:1112 ../../library/os.rst:1630 -#: ../../library/os.rst:2065 ../../library/os.rst:2094 -#: ../../library/os.rst:3376 +#: ../../library/os.rst:1112 ../../library/os.rst:1651 +#: ../../library/os.rst:2066 ../../library/os.rst:2095 +#: ../../library/os.rst:3377 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1148,8 +1148,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1017 ../../library/os.rst:2090 -#: ../../library/os.rst:2175 +#: ../../library/os.rst:1017 ../../library/os.rst:2091 +#: ../../library/os.rst:2176 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1178,7 +1178,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1046 ../../library/os.rst:2487 +#: ../../library/os.rst:1046 ../../library/os.rst:2488 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 " @@ -1200,7 +1200,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1065 ../../library/os.rst:2322 +#: ../../library/os.rst:1065 ../../library/os.rst:2323 msgid "The :func:`.stat` function." msgstr "" @@ -1240,7 +1240,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3415 +#: ../../library/os.rst:1099 ../../library/os.rst:3416 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1255,11 +1255,11 @@ msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1115 ../../library/os.rst:1633 +#: ../../library/os.rst:1115 ../../library/os.rst:1654 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1119 ../../library/os.rst:1637 +#: ../../library/os.rst:1119 ../../library/os.rst:1658 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" @@ -1437,35 +1437,35 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1254 ../../library/os.rst:2363 -#: ../../library/os.rst:2431 ../../library/os.rst:2453 -#: ../../library/os.rst:2534 ../../library/os.rst:2565 +#: ../../library/os.rst:1254 ../../library/os.rst:2364 +#: ../../library/os.rst:2432 ../../library/os.rst:2454 +#: ../../library/os.rst:2535 ../../library/os.rst:2566 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1751 ../../library/os.rst:4748 +#: ../../library/os.rst:1752 ../../library/os.rst:4749 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:1262 ../../library/os.rst:1962 -#: ../../library/os.rst:1994 ../../library/os.rst:2025 -#: ../../library/os.rst:2074 ../../library/os.rst:2111 -#: ../../library/os.rst:2151 ../../library/os.rst:2166 -#: ../../library/os.rst:2179 ../../library/os.rst:2238 -#: ../../library/os.rst:2330 ../../library/os.rst:2366 -#: ../../library/os.rst:2407 ../../library/os.rst:2434 -#: ../../library/os.rst:2456 ../../library/os.rst:2497 -#: ../../library/os.rst:2568 ../../library/os.rst:2587 -#: ../../library/os.rst:2675 ../../library/os.rst:2965 -#: ../../library/os.rst:3254 ../../library/os.rst:3418 -#: ../../library/os.rst:3434 ../../library/os.rst:3474 -#: ../../library/os.rst:3573 ../../library/os.rst:3634 -#: ../../library/os.rst:3818 ../../library/os.rst:3998 -#: ../../library/os.rst:4513 +#: ../../library/os.rst:1262 ../../library/os.rst:1963 +#: ../../library/os.rst:1995 ../../library/os.rst:2026 +#: ../../library/os.rst:2075 ../../library/os.rst:2112 +#: ../../library/os.rst:2152 ../../library/os.rst:2167 +#: ../../library/os.rst:2180 ../../library/os.rst:2239 +#: ../../library/os.rst:2331 ../../library/os.rst:2367 +#: ../../library/os.rst:2408 ../../library/os.rst:2435 +#: ../../library/os.rst:2457 ../../library/os.rst:2498 +#: ../../library/os.rst:2569 ../../library/os.rst:2588 +#: ../../library/os.rst:2676 ../../library/os.rst:2966 +#: ../../library/os.rst:3255 ../../library/os.rst:3419 +#: ../../library/os.rst:3435 ../../library/os.rst:3475 +#: ../../library/os.rst:3574 ../../library/os.rst:3635 +#: ../../library/os.rst:3819 ../../library/os.rst:3999 +#: ../../library/os.rst:4514 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -1605,14 +1605,14 @@ msgstr ":data:`RWF_HIPRI`" msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1442 ../../library/os.rst:1701 +#: ../../library/os.rst:1442 ../../library/os.rst:1702 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:1445 ../../library/os.rst:1515 -#: ../../library/os.rst:1704 ../../library/os.rst:1766 +#: ../../library/os.rst:1705 ../../library/os.rst:1767 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." @@ -1674,7 +1674,7 @@ msgid "" "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1491 ../../library/os.rst:1741 +#: ../../library/os.rst:1491 ../../library/os.rst:1742 msgid "Return the number of bytes actually written." msgstr "" @@ -1805,31 +1805,31 @@ msgstr "" msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1623 -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:1626 -msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." -msgstr "" -"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" - -#: ../../library/os.rst:1644 +#: ../../library/os.rst:1625 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1653 +#: ../../library/os.rst:1634 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1663 +#: ../../library/os.rst:1644 +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:1647 +msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." +msgstr "" +"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" + +#: ../../library/os.rst:1664 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1841,7 +1841,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1672 +#: ../../library/os.rst:1673 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 " @@ -1849,7 +1849,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1677 +#: ../../library/os.rst:1678 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, " @@ -1858,11 +1858,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1683 +#: ../../library/os.rst:1684 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1696 +#: ../../library/os.rst:1697 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1870,34 +1870,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1714 +#: ../../library/os.rst:1715 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:1717 ../../library/os.rst:1725 +#: ../../library/os.rst:1718 ../../library/os.rst:1726 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1722 +#: ../../library/os.rst:1723 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:1730 +#: ../../library/os.rst:1731 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:1739 +#: ../../library/os.rst:1740 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1745 +#: ../../library/os.rst:1746 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 " @@ -1906,7 +1906,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1759 +#: ../../library/os.rst:1760 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1914,70 +1914,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1764 +#: ../../library/os.rst:1765 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1777 +#: ../../library/os.rst:1778 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1783 +#: ../../library/os.rst:1784 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1786 +#: ../../library/os.rst:1787 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1789 +#: ../../library/os.rst:1790 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1792 +#: ../../library/os.rst:1793 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:1800 +#: ../../library/os.rst:1801 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1804 +#: ../../library/os.rst:1805 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1808 +#: ../../library/os.rst:1809 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1814 +#: ../../library/os.rst:1815 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1818 +#: ../../library/os.rst:1819 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:1822 +#: ../../library/os.rst:1823 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:1825 +#: ../../library/os.rst:1826 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, " @@ -1988,46 +1988,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1833 +#: ../../library/os.rst:1834 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1838 +#: ../../library/os.rst:1839 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1842 +#: ../../library/os.rst:1843 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1847 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1848 ../../library/os.rst:1854 -#: ../../library/os.rst:3923 ../../library/os.rst:4548 -#: ../../library/os.rst:4593 +#: ../../library/os.rst:1849 ../../library/os.rst:1855 +#: ../../library/os.rst:3924 ../../library/os.rst:4549 +#: ../../library/os.rst:4594 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1853 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1860 +#: ../../library/os.rst:1861 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1862 +#: ../../library/os.rst:1863 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1867 +#: ../../library/os.rst:1868 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. " @@ -2038,7 +2038,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1875 +#: ../../library/os.rst:1876 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 " @@ -2046,13 +2046,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1881 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:1885 +#: ../../library/os.rst:1886 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 " @@ -2063,14 +2063,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1893 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:1898 +#: ../../library/os.rst:1899 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 " @@ -2079,14 +2079,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1904 +#: ../../library/os.rst:1905 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:1912 +#: ../../library/os.rst:1913 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 " @@ -2098,13 +2098,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1921 +#: ../../library/os.rst:1922 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1924 +#: ../../library/os.rst:1925 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2113,7 +2113,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1932 +#: ../../library/os.rst:1933 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 " @@ -2122,117 +2122,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1943 +#: ../../library/os.rst:1944 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1955 +#: ../../library/os.rst:1956 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:1959 +#: ../../library/os.rst:1960 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:1972 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:1980 +#: ../../library/os.rst:1981 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:1983 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:1985 +#: ../../library/os.rst:1986 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1988 ../../library/os.rst:2121 +#: ../../library/os.rst:1989 ../../library/os.rst:2122 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1990 +#: ../../library/os.rst:1991 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2001 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:2003 +#: ../../library/os.rst:2004 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:2004 +#: ../../library/os.rst:2005 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2006 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2007 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2008 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:2008 +#: ../../library/os.rst:2009 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:2009 +#: ../../library/os.rst:2010 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2011 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:2011 +#: ../../library/os.rst:2012 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2013 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2014 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:2014 +#: ../../library/os.rst:2015 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:2016 +#: ../../library/os.rst:2017 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2018 ../../library/os.rst:2147 +#: ../../library/os.rst:2019 ../../library/os.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2240,164 +2240,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:2022 +#: ../../library/os.rst:2023 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:2031 +#: ../../library/os.rst:2032 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:2035 +#: ../../library/os.rst:2036 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:2036 +#: ../../library/os.rst:2037 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:2037 +#: ../../library/os.rst:2038 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:2038 +#: ../../library/os.rst:2039 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:2039 +#: ../../library/os.rst:2040 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2041 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2041 +#: ../../library/os.rst:2042 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2042 +#: ../../library/os.rst:2043 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2043 +#: ../../library/os.rst:2044 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2045 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2045 +#: ../../library/os.rst:2046 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2046 +#: ../../library/os.rst:2047 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2047 +#: ../../library/os.rst:2048 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2048 +#: ../../library/os.rst:2049 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2049 +#: ../../library/os.rst:2050 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2050 +#: ../../library/os.rst:2051 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2051 +#: ../../library/os.rst:2052 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2052 +#: ../../library/os.rst:2053 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2053 +#: ../../library/os.rst:2054 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2055 ../../library/os.rst:2083 -#: ../../library/os.rst:3464 +#: ../../library/os.rst:2056 ../../library/os.rst:2084 +#: ../../library/os.rst:3465 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:2061 +#: ../../library/os.rst:2062 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:2070 ../../library/os.rst:2097 +#: ../../library/os.rst:2071 ../../library/os.rst:2098 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2080 +#: ../../library/os.rst:2081 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:2087 +#: ../../library/os.rst:2088 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2101 +#: ../../library/os.rst:2102 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2107 +#: ../../library/os.rst:2108 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2118 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:2128 +#: ../../library/os.rst:2129 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2133 +#: ../../library/os.rst:2134 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2135 +#: ../../library/os.rst:2136 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:2143 +#: ../../library/os.rst:2144 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:2157 +#: ../../library/os.rst:2158 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` " @@ -2405,25 +2405,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2172 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:2185 +#: ../../library/os.rst:2186 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2187 +#: ../../library/os.rst:2188 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:2191 +#: ../../library/os.rst:2192 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2431,24 +2431,24 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2193 +#: ../../library/os.rst:2194 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2195 +#: ../../library/os.rst:2196 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2198 +#: ../../library/os.rst:2199 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:2201 ../../library/os.rst:2619 -#: ../../library/os.rst:2656 ../../library/os.rst:3386 +#: ../../library/os.rst:2202 ../../library/os.rst:2620 +#: ../../library/os.rst:2657 ../../library/os.rst:3387 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2207 +#: ../../library/os.rst:2208 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 " @@ -2457,7 +2457,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2213 +#: ../../library/os.rst:2214 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2465,42 +2465,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2218 ../../library/os.rst:2704 +#: ../../library/os.rst:2219 ../../library/os.rst:2705 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2221 +#: ../../library/os.rst:2222 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2224 +#: ../../library/os.rst:2225 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2228 +#: ../../library/os.rst:2229 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:2232 +#: ../../library/os.rst:2233 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2235 ../../library/os.rst:3245 +#: ../../library/os.rst:2236 ../../library/os.rst:3246 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2244 +#: ../../library/os.rst:2245 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2247 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2508,27 +2508,27 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2251 +#: ../../library/os.rst:2252 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2254 +#: ../../library/os.rst:2255 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2256 ../../library/os.rst:2280 -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2257 ../../library/os.rst:2281 +#: ../../library/os.rst:2301 msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:2263 +#: ../../library/os.rst:2264 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2266 +#: ../../library/os.rst:2267 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2536,19 +2536,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2272 +#: ../../library/os.rst:2273 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2275 +#: ../../library/os.rst:2276 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2278 +#: ../../library/os.rst:2279 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2556,11 +2556,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2288 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2289 +#: ../../library/os.rst:2290 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2569,53 +2569,53 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2296 +#: ../../library/os.rst:2297 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2298 +#: ../../library/os.rst:2299 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2307 +#: ../../library/os.rst:2308 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:2311 +#: ../../library/os.rst:2312 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2314 +#: ../../library/os.rst:2315 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2317 ../../library/os.rst:2355 -#: ../../library/os.rst:2420 ../../library/os.rst:2448 -#: ../../library/os.rst:2522 +#: ../../library/os.rst:2318 ../../library/os.rst:2356 +#: ../../library/os.rst:2421 ../../library/os.rst:2449 +#: ../../library/os.rst:2523 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2324 ../../library/os.rst:2531 -#: ../../library/os.rst:3379 +#: ../../library/os.rst:2325 ../../library/os.rst:2532 +#: ../../library/os.rst:3380 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2327 +#: ../../library/os.rst:2328 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2333 +#: ../../library/os.rst:2334 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2623,18 +2623,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2342 +#: ../../library/os.rst:2343 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2344 +#: ../../library/os.rst:2345 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:2349 +#: ../../library/os.rst:2350 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 " @@ -2643,13 +2643,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2358 +#: ../../library/os.rst:2359 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2361 ../../library/os.rst:2395 +#: ../../library/os.rst:2362 ../../library/os.rst:2396 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2657,13 +2657,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2377 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2379 +#: ../../library/os.rst:2380 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2672,27 +2672,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2385 +#: ../../library/os.rst:2386 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2391 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2393 +#: ../../library/os.rst:2394 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2397 +#: ../../library/os.rst:2398 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2402 +#: ../../library/os.rst:2403 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 " @@ -2700,19 +2700,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2411 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2417 +#: ../../library/os.rst:2418 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:2423 +#: ../../library/os.rst:2424 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 " @@ -2722,7 +2722,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2441 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 " @@ -2733,23 +2733,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2462 +#: ../../library/os.rst:2463 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2468 +#: ../../library/os.rst:2469 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2474 +#: ../../library/os.rst:2475 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2479 +#: ../../library/os.rst:2480 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2760,20 +2760,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2492 ../../library/os.rst:3238 -#: ../../library/os.rst:3407 +#: ../../library/os.rst:2493 ../../library/os.rst:3239 +#: ../../library/os.rst:3408 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2504 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:2512 +#: ../../library/os.rst:2513 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 " @@ -2781,7 +2781,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2517 +#: ../../library/os.rst:2518 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 " @@ -2789,42 +2789,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2526 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:2537 +#: ../../library/os.rst:2538 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2540 +#: ../../library/os.rst:2541 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2543 +#: ../../library/os.rst:2544 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:2550 +#: ../../library/os.rst:2551 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2554 ../../library/os.rst:2667 -#: ../../library/os.rst:3358 +#: ../../library/os.rst:2555 ../../library/os.rst:2668 +#: ../../library/os.rst:3359 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2557 +#: ../../library/os.rst:2558 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 " @@ -2832,12 +2832,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2562 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2563 ../../library/os.rst:2585 -#: ../../library/os.rst:3429 +#: ../../library/os.rst:2564 ../../library/os.rst:2586 +#: ../../library/os.rst:3430 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2845,7 +2845,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2577 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2857,20 +2857,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2593 +#: ../../library/os.rst:2594 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:2596 +#: ../../library/os.rst:2597 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2601 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 " @@ -2882,20 +2882,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2609 ../../library/os.rst:2649 +#: ../../library/os.rst:2610 ../../library/os.rst:2650 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:2612 +#: ../../library/os.rst:2613 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2614 ../../library/os.rst:2635 -#: ../../library/os.rst:2652 +#: ../../library/os.rst:2615 ../../library/os.rst:2636 +#: ../../library/os.rst:2653 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2903,11 +2903,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2616 +#: ../../library/os.rst:2617 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2626 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2916,17 +2916,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2632 +#: ../../library/os.rst:2633 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:2637 +#: ../../library/os.rst:2638 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2643 +#: ../../library/os.rst:2644 msgid "" "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 " @@ -2935,7 +2935,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2662 +#: ../../library/os.rst:2663 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2943,7 +2943,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2670 +#: ../../library/os.rst:2671 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2951,11 +2951,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2672 ../../library/os.rst:3431 +#: ../../library/os.rst:2673 ../../library/os.rst:3432 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2681 +#: ../../library/os.rst:2682 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2965,7 +2965,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2689 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2977,7 +2977,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2698 +#: ../../library/os.rst:2699 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 " @@ -2986,31 +2986,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2707 +#: ../../library/os.rst:2708 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2709 +#: ../../library/os.rst:2710 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2714 +#: ../../library/os.rst:2715 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2716 +#: ../../library/os.rst:2717 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:2723 +#: ../../library/os.rst:2724 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 " @@ -3018,7 +3018,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2735 +#: ../../library/os.rst:2736 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -3029,7 +3029,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2747 +#: ../../library/os.rst:2748 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -3037,28 +3037,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2753 +#: ../../library/os.rst:2754 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2755 +#: ../../library/os.rst:2756 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2762 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2764 +#: ../../library/os.rst:2765 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:2768 +#: ../../library/os.rst:2769 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 " @@ -3066,7 +3066,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2774 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 " @@ -3074,29 +3074,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2779 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2781 +#: ../../library/os.rst:2782 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2785 +#: ../../library/os.rst:2786 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2788 +#: ../../library/os.rst:2789 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:2794 +#: ../../library/os.rst:2795 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 " @@ -3106,51 +3106,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2802 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:2807 +#: ../../library/os.rst:2808 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2809 +#: ../../library/os.rst:2810 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:2813 +#: ../../library/os.rst:2814 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:2819 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:2822 +#: ../../library/os.rst:2823 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:2826 +#: ../../library/os.rst:2827 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:2830 +#: ../../library/os.rst:2831 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 " @@ -3160,46 +3160,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2837 ../../library/os.rst:2867 +#: ../../library/os.rst:2838 ../../library/os.rst:2868 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2842 +#: ../../library/os.rst:2843 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:2846 +#: ../../library/os.rst:2847 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:2850 +#: ../../library/os.rst:2851 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:2855 +#: ../../library/os.rst:2856 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:2859 +#: ../../library/os.rst:2860 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:2862 +#: ../../library/os.rst:2863 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 " @@ -3207,48 +3207,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2873 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2876 +#: ../../library/os.rst:2877 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2883 +#: ../../library/os.rst:2884 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:2887 +#: ../../library/os.rst:2888 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:2892 +#: ../../library/os.rst:2893 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:2896 +#: ../../library/os.rst:2897 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:2900 +#: ../../library/os.rst:2901 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3256,13 +3256,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2908 +#: ../../library/os.rst:2909 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2912 +#: ../../library/os.rst:2913 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3270,7 +3270,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2922 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 " @@ -3279,21 +3279,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2927 +#: ../../library/os.rst:2928 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2930 ../../library/os.rst:3797 -#: ../../library/os.rst:3813 ../../library/os.rst:3829 -#: ../../library/os.rst:3849 +#: ../../library/os.rst:2931 ../../library/os.rst:3798 +#: ../../library/os.rst:3814 ../../library/os.rst:3830 +#: ../../library/os.rst:3850 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2933 +#: ../../library/os.rst:2934 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3307,24 +3307,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2946 ../../library/os.rst:3717 +#: ../../library/os.rst:2947 ../../library/os.rst:3718 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2959 +#: ../../library/os.rst:2960 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:2962 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2968 +#: ../../library/os.rst:2969 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3334,122 +3334,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2979 +#: ../../library/os.rst:2980 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2983 +#: ../../library/os.rst:2984 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2987 +#: ../../library/os.rst:2988 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:2992 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2994 +#: ../../library/os.rst:2995 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:2996 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:3001 +#: ../../library/os.rst:3002 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:3006 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3009 +#: ../../library/os.rst:3010 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3014 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3018 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:3021 +#: ../../library/os.rst:3022 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3025 +#: ../../library/os.rst:3026 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3030 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3033 +#: ../../library/os.rst:3034 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3035 +#: ../../library/os.rst:3036 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3042 +#: ../../library/os.rst:3043 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3046 +#: ../../library/os.rst:3047 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3051 +#: ../../library/os.rst:3052 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3055 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3061 +#: ../../library/os.rst:3062 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3065 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3069 +#: ../../library/os.rst:3070 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3077 +#: ../../library/os.rst:3078 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3459,7 +3459,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3084 +#: ../../library/os.rst:3085 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3472,74 +3472,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3095 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3099 +#: ../../library/os.rst:3100 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:3104 +#: ../../library/os.rst:3105 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:3109 +#: ../../library/os.rst:3110 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3113 +#: ../../library/os.rst:3114 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3115 +#: ../../library/os.rst:3116 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:3120 +#: ../../library/os.rst:3121 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3122 +#: ../../library/os.rst:3123 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3128 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3130 +#: ../../library/os.rst:3131 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3134 +#: ../../library/os.rst:3135 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3138 +#: ../../library/os.rst:3139 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3142 +#: ../../library/os.rst:3143 msgid "File type." msgstr "" -#: ../../library/os.rst:3144 +#: ../../library/os.rst:3145 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3149 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3547,7 +3547,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3156 +#: ../../library/os.rst:3157 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3555,14 +3555,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3161 +#: ../../library/os.rst:3162 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3166 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 " @@ -3574,59 +3574,59 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3175 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:3178 +#: ../../library/os.rst:3179 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" -#: ../../library/os.rst:3181 +#: ../../library/os.rst:3182 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3185 +#: ../../library/os.rst:3186 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3188 +#: ../../library/os.rst:3189 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3191 +#: ../../library/os.rst:3192 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:3196 +#: ../../library/os.rst:3197 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3202 +#: ../../library/os.rst:3203 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3208 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3211 +#: ../../library/os.rst:3212 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: ../../library/os.rst:3217 +#: ../../library/os.rst:3218 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 " @@ -3636,7 +3636,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3224 +#: ../../library/os.rst:3225 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-" @@ -3644,7 +3644,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3229 +#: ../../library/os.rst:3230 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3657,11 +3657,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3242 +#: ../../library/os.rst:3243 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3249 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3669,11 +3669,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3258 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:3263 +#: ../../library/os.rst:3264 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3685,7 +3685,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3274 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 " @@ -3693,13 +3693,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3280 +#: ../../library/os.rst:3281 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3288 +#: ../../library/os.rst:3289 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3708,19 +3708,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3295 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3299 +#: ../../library/os.rst:3300 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3307 +#: ../../library/os.rst:3308 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 " @@ -3729,7 +3729,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3314 +#: ../../library/os.rst:3315 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3738,7 +3738,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3328 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3751,7 +3751,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3337 +#: ../../library/os.rst:3338 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3760,11 +3760,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3350 +#: ../../library/os.rst:3351 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3352 +#: ../../library/os.rst:3353 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 " @@ -3774,7 +3774,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3363 +#: ../../library/os.rst:3364 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3782,12 +3782,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3369 +#: ../../library/os.rst:3370 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3372 +#: ../../library/os.rst:3373 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3795,27 +3795,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3382 +#: ../../library/os.rst:3383 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3389 +#: ../../library/os.rst:3390 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3395 +#: ../../library/os.rst:3396 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3405 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3410 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3823,46 +3823,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3424 +#: ../../library/os.rst:3425 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:3440 +#: ../../library/os.rst:3441 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3442 +#: ../../library/os.rst:3443 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:3445 +#: ../../library/os.rst:3446 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:3448 +#: ../../library/os.rst:3449 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:3451 +#: ../../library/os.rst:3452 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:3455 +#: ../../library/os.rst:3456 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3457 +#: ../../library/os.rst:3458 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 " @@ -3872,7 +3872,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3469 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3880,13 +3880,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3471 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3484 +#: ../../library/os.rst:3485 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* " @@ -3894,7 +3894,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3490 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3908,7 +3908,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3500 +#: ../../library/os.rst:3501 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 " @@ -3919,7 +3919,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3508 +#: ../../library/os.rst:3509 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3932,7 +3932,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3517 +#: ../../library/os.rst:3518 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 " @@ -3942,42 +3942,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3523 +#: ../../library/os.rst:3524 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:3529 +#: ../../library/os.rst:3530 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:3535 +#: ../../library/os.rst:3536 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:3539 ../../library/os.rst:3600 +#: ../../library/os.rst:3540 ../../library/os.rst:3601 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:3552 +#: ../../library/os.rst:3553 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:3567 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3985,25 +3985,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3569 +#: ../../library/os.rst:3570 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:3583 +#: ../../library/os.rst:3584 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:3586 +#: ../../library/os.rst:3587 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:3589 +#: ../../library/os.rst:3590 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4011,20 +4011,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3596 +#: ../../library/os.rst:3597 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:3613 +#: ../../library/os.rst:3614 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:3628 +#: ../../library/os.rst:3629 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4032,11 +4032,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3637 +#: ../../library/os.rst:3638 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3643 +#: ../../library/os.rst:3644 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 " @@ -4044,7 +4044,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3649 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/" @@ -4054,23 +4054,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3655 +#: ../../library/os.rst:3656 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3678 +#: ../../library/os.rst:3679 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3680 +#: ../../library/os.rst:3681 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3682 +#: ../../library/os.rst:3683 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3689 +#: ../../library/os.rst:3690 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." @@ -4079,7 +4079,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3696 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 " @@ -4087,87 +4087,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3701 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3703 +#: ../../library/os.rst:3704 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:3706 +#: ../../library/os.rst:3707 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:3710 +#: ../../library/os.rst:3711 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3713 +#: ../../library/os.rst:3714 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:3734 +#: ../../library/os.rst:3735 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3740 +#: ../../library/os.rst:3741 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:3743 ../../library/os.rst:3752 -#: ../../library/os.rst:3760 ../../library/os.rst:3769 +#: ../../library/os.rst:3744 ../../library/os.rst:3753 +#: ../../library/os.rst:3761 ../../library/os.rst:3770 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3749 +#: ../../library/os.rst:3750 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:3758 +#: ../../library/os.rst:3759 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3766 +#: ../../library/os.rst:3767 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3775 +#: ../../library/os.rst:3776 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:3778 +#: ../../library/os.rst:3779 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3784 +#: ../../library/os.rst:3785 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3792 +#: ../../library/os.rst:3793 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4175,7 +4175,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3800 +#: ../../library/os.rst:3801 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4183,12 +4183,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3802 ../../library/os.rst:3834 -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3803 ../../library/os.rst:3835 +#: ../../library/os.rst:3860 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3809 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4196,14 +4196,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3816 +#: ../../library/os.rst:3817 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3824 +#: ../../library/os.rst:3825 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4211,7 +4211,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3832 +#: ../../library/os.rst:3833 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4219,7 +4219,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3841 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4231,13 +4231,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3854 +#: ../../library/os.rst:3855 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:3857 +#: ../../library/os.rst:3858 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4245,33 +4245,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3865 +#: ../../library/os.rst:3866 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3871 +#: ../../library/os.rst:3872 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:3877 +#: ../../library/os.rst:3878 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:3884 +#: ../../library/os.rst:3885 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:3887 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3888 +#: ../../library/os.rst:3889 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 " @@ -4282,7 +4282,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:3900 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 " @@ -4291,31 +4291,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3908 +#: ../../library/os.rst:3909 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3911 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:3914 +#: ../../library/os.rst:3915 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3917 +#: ../../library/os.rst:3918 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3921 +#: ../../library/os.rst:3922 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4323,7 +4323,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3926 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4331,14 +4331,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3933 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:3947 +#: ../../library/os.rst:3948 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 " @@ -4346,7 +4346,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3953 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 " @@ -4354,7 +4354,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3959 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4367,7 +4367,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3967 +#: ../../library/os.rst:3968 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4381,7 +4381,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3978 +#: ../../library/os.rst:3979 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 " @@ -4391,7 +4391,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 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 " @@ -4400,7 +4400,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3991 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4408,25 +4408,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3995 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:4004 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4009 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4011 +#: ../../library/os.rst:4012 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 " @@ -4434,125 +4434,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4018 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:4024 +#: ../../library/os.rst:4025 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4033 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4041 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4047 +#: ../../library/os.rst:4048 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4055 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4062 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4069 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4075 +#: ../../library/os.rst:4076 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4082 +#: ../../library/os.rst:4083 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:4090 +#: ../../library/os.rst:4091 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:4098 +#: ../../library/os.rst:4099 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4105 +#: ../../library/os.rst:4106 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4113 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:4121 +#: ../../library/os.rst:4122 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4129 +#: ../../library/os.rst:4130 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:4137 +#: ../../library/os.rst:4138 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4144 +#: ../../library/os.rst:4145 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4151 +#: ../../library/os.rst:4152 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:4154 +#: ../../library/os.rst:4155 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4157 +#: ../../library/os.rst:4158 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4159 +#: ../../library/os.rst:4160 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4166 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:4172 +#: ../../library/os.rst:4173 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, " @@ -4561,24 +4561,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4179 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4181 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4193 +#: ../../library/os.rst:4194 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:4196 +#: ../../library/os.rst:4197 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4589,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4205 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4206 +#: ../../library/os.rst:4207 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4601,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4211 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4221 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4222 +#: ../../library/os.rst:4223 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4617,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4229 +#: ../../library/os.rst:4230 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4236 +#: ../../library/os.rst:4237 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4240 +#: ../../library/os.rst:4241 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4243 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4248 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4645,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4252 +#: ../../library/os.rst:4253 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4258 +#: ../../library/os.rst:4259 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4267 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 " @@ -4665,7 +4665,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4274 +#: ../../library/os.rst:4275 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4677,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4284 +#: ../../library/os.rst:4285 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:4289 +#: ../../library/os.rst:4290 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:4293 +#: ../../library/os.rst:4294 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4296 +#: ../../library/os.rst:4297 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4300 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4309 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4310 +#: ../../library/os.rst:4311 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4312 +#: ../../library/os.rst:4313 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4315 +#: ../../library/os.rst:4316 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:4319 +#: ../../library/os.rst:4320 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 " @@ -4739,31 +4739,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4327 +#: ../../library/os.rst:4328 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4329 +#: ../../library/os.rst:4330 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4333 +#: ../../library/os.rst:4334 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4336 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4339 +#: ../../library/os.rst:4340 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4341 +#: ../../library/os.rst:4342 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4343 +#: ../../library/os.rst:4344 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4772,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4349 +#: ../../library/os.rst:4350 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 " @@ -4781,7 +4781,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4356 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 " @@ -4792,7 +4792,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4800,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4368 +#: ../../library/os.rst:4369 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 " @@ -4808,14 +4808,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4374 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4377 +#: ../../library/os.rst:4378 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4825,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4384 ../../library/os.rst:4400 +#: ../../library/os.rst:4385 ../../library/os.rst:4401 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4833,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4394 +#: ../../library/os.rst:4395 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4396 +#: ../../library/os.rst:4397 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:4404 +#: ../../library/os.rst:4405 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4406 +#: ../../library/os.rst:4407 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4413 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:4417 +#: ../../library/os.rst:4418 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4419 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4421 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4423 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:4426 +#: ../../library/os.rst:4427 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:4431 +#: ../../library/os.rst:4432 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:4435 +#: ../../library/os.rst:4436 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4451 +#: ../../library/os.rst:4452 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4454 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4910,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4458 +#: ../../library/os.rst:4459 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 " @@ -4919,13 +4919,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4465 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:4467 +#: ../../library/os.rst:4468 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4937,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4476 +#: ../../library/os.rst:4477 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4950,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4486 +#: ../../library/os.rst:4487 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 " @@ -4962,13 +4962,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4496 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4505 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +4976,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4508 +#: ../../library/os.rst:4509 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +4984,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4520 +#: ../../library/os.rst:4521 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +4992,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4531 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5001,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4542 +#: ../../library/os.rst:4543 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5011,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4554 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4556 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5023,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4561 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 " @@ -5031,28 +5031,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4565 +#: ../../library/os.rst:4566 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:4569 +#: ../../library/os.rst:4570 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:4573 +#: ../../library/os.rst:4574 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:4577 +#: ../../library/os.rst:4578 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 " @@ -5063,14 +5063,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4585 +#: ../../library/os.rst:4586 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:4589 +#: ../../library/os.rst:4590 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5078,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4591 +#: ../../library/os.rst:4592 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5086,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4595 +#: ../../library/os.rst:4596 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4603 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 " @@ -5103,13 +5103,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4611 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:4613 +#: ../../library/os.rst:4614 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 :" @@ -5118,7 +5118,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4619 +#: ../../library/os.rst:4620 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5126,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4624 +#: ../../library/os.rst:4625 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:4628 +#: ../../library/os.rst:4629 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4635 +#: ../../library/os.rst:4636 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4639 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4640 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4641 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4642 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4643 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4644 +#: ../../library/os.rst:4645 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:4648 +#: ../../library/os.rst:4649 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5183,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4662 +#: ../../library/os.rst:4663 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5192,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4669 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4671 ../../library/os.rst:4743 +#: ../../library/os.rst:4672 ../../library/os.rst:4744 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4678 +#: ../../library/os.rst:4679 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4686 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4688 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4694 +#: ../../library/os.rst:4695 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4698 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4699 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4700 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4701 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4702 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4703 +#: ../../library/os.rst:4704 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4715 +#: ../../library/os.rst:4716 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4717 +#: ../../library/os.rst:4718 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 " @@ -5277,7 +5277,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 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 " @@ -5287,7 +5287,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4730 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5296,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4735 +#: ../../library/os.rst:4736 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 " @@ -5308,7 +5308,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4756 +#: ../../library/os.rst:4757 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 " @@ -5317,13 +5317,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4763 ../../library/os.rst:4777 +#: ../../library/os.rst:4764 ../../library/os.rst:4778 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4771 +#: ../../library/os.rst:4772 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5332,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4788 +#: ../../library/os.rst:4789 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4791 +#: ../../library/os.rst:4792 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4793 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4794 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4795 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4799 +#: ../../library/os.rst:4800 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4802 +#: ../../library/os.rst:4803 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4808 +#: ../../library/os.rst:4809 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4817 +#: ../../library/os.rst:4818 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4821 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4830 +#: ../../library/os.rst:4831 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4833 ../../library/os.rst:4865 +#: ../../library/os.rst:4834 ../../library/os.rst:4866 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4843 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4846 +#: ../../library/os.rst:4847 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:4854 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4863 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:4878 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4885 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4890 +#: ../../library/os.rst:4891 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4892 +#: ../../library/os.rst:4893 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4895 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:4897 +#: ../../library/os.rst:4898 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 " @@ -5451,15 +5451,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4902 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4903 +#: ../../library/os.rst:4904 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4906 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 " @@ -5467,217 +5467,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4912 +#: ../../library/os.rst:4913 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4920 +#: ../../library/os.rst:4921 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:4926 +#: ../../library/os.rst:4927 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4929 ../../library/os.rst:4995 +#: ../../library/os.rst:4930 ../../library/os.rst:4996 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4937 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4940 +#: ../../library/os.rst:4941 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4947 +#: ../../library/os.rst:4948 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4950 +#: ../../library/os.rst:4951 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:4958 +#: ../../library/os.rst:4959 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4966 +#: ../../library/os.rst:4967 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:4975 +#: ../../library/os.rst:4976 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4977 +#: ../../library/os.rst:4978 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4984 +#: ../../library/os.rst:4985 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4987 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:4994 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5001 +#: ../../library/os.rst:5002 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5003 +#: ../../library/os.rst:5004 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:5009 +#: ../../library/os.rst:5010 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5014 +#: ../../library/os.rst:5015 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5018 +#: ../../library/os.rst:5019 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5024 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5027 +#: ../../library/os.rst:5028 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5031 +#: ../../library/os.rst:5032 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5035 +#: ../../library/os.rst:5036 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5039 +#: ../../library/os.rst:5040 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:5046 +#: ../../library/os.rst:5047 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:5050 +#: ../../library/os.rst:5051 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5054 +#: ../../library/os.rst:5055 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5059 +#: ../../library/os.rst:5060 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5065 +#: ../../library/os.rst:5066 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5071 +#: ../../library/os.rst:5072 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:5078 +#: ../../library/os.rst:5079 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:5085 +#: ../../library/os.rst:5086 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:5091 +#: ../../library/os.rst:5092 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:5097 +#: ../../library/os.rst:5098 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:5103 +#: ../../library/os.rst:5104 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5108 +#: ../../library/os.rst:5109 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:5115 +#: ../../library/os.rst:5116 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:5122 +#: ../../library/os.rst:5123 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5128 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 " @@ -5688,13 +5688,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5135 +#: ../../library/os.rst:5136 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5138 +#: ../../library/os.rst:5139 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 " @@ -5702,33 +5702,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5148 +#: ../../library/os.rst:5149 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:5157 +#: ../../library/os.rst:5158 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:5159 +#: ../../library/os.rst:5160 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:5169 +#: ../../library/os.rst:5170 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:5178 +#: ../../library/os.rst:5179 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5737,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5188 +#: ../../library/os.rst:5189 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:5194 +#: ../../library/os.rst:5195 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5197 +#: ../../library/os.rst:5198 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5200 +#: ../../library/os.rst:5201 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5206 +#: ../../library/os.rst:5207 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:5214 +#: ../../library/os.rst:5215 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:5223 +#: ../../library/os.rst:5224 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5783,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5234 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5791,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5242 +#: ../../library/os.rst:5243 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:5250 +#: ../../library/os.rst:5251 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:5257 +#: ../../library/os.rst:5258 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:5264 +#: ../../library/os.rst:5265 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 " @@ -5820,36 +5820,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5274 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:5284 +#: ../../library/os.rst:5285 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:5292 +#: ../../library/os.rst:5293 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5297 +#: ../../library/os.rst:5298 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5300 +#: ../../library/os.rst:5301 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5303 +#: ../../library/os.rst:5304 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5857,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5308 +#: ../../library/os.rst:5309 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5312 +#: ../../library/os.rst:5313 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5315 +#: ../../library/os.rst:5316 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5321 +#: ../../library/os.rst:5322 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5324 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:5327 +#: ../../library/os.rst:5328 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5896,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5334 +#: ../../library/os.rst:5335 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:5338 +#: ../../library/os.rst:5339 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5341 +#: ../../library/os.rst:5342 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:5345 +#: ../../library/os.rst:5346 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5349 +#: ../../library/os.rst:5350 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:5353 +#: ../../library/os.rst:5354 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:5359 +#: ../../library/os.rst:5360 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5365 +#: ../../library/os.rst:5366 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:5369 +#: ../../library/os.rst:5370 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:5376 +#: ../../library/os.rst:5377 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +5968,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "process" msgstr "process" @@ -6008,11 +6008,11 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2574 +#: ../../library/os.rst:796 ../../library/os.rst:2575 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1338 ../../library/os.rst:2944 +#: ../../library/os.rst:1338 ../../library/os.rst:2945 msgid "module" msgstr "module(模組)" @@ -6020,82 +6020,82 @@ msgstr "module(模組)" msgid "pty" msgstr "pty" -#: ../../library/os.rst:1978 ../../library/os.rst:2372 -#: ../../library/os.rst:2574 ../../library/os.rst:3480 -#: ../../library/os.rst:3579 +#: ../../library/os.rst:1979 ../../library/os.rst:2373 +#: ../../library/os.rst:2575 ../../library/os.rst:3481 +#: ../../library/os.rst:3580 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1978 +#: ../../library/os.rst:1979 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2944 +#: ../../library/os.rst:2945 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "walking" msgstr "" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "killing" msgstr "" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5203 ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5240 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5203 ../../library/os.rst:5211 -#: ../../library/os.rst:5219 ../../library/os.rst:5230 -#: ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5212 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5240 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5211 +#: ../../library/os.rst:5212 msgid ".." msgstr ".." -#: ../../library/os.rst:5219 ../../library/os.rst:5230 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pickle.po b/library/pickle.po index dfb9a4f3f5..d0cd1ef02a 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+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-" @@ -666,39 +666,41 @@ msgid "The following types can be pickled:" msgstr "" #: ../../library/pickle.rst:497 -msgid "``None``, ``True``, and ``False``;" -msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" +msgid "" +"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and " +"``NotImplemented``);" +msgstr "" -#: ../../library/pickle.rst:499 +#: ../../library/pickle.rst:500 msgid "integers, floating-point numbers, complex numbers;" msgstr "" -#: ../../library/pickle.rst:501 +#: ../../library/pickle.rst:502 msgid "strings, bytes, bytearrays;" msgstr "" -#: ../../library/pickle.rst:503 +#: ../../library/pickle.rst:504 msgid "" "tuples, lists, sets, and dictionaries containing only picklable objects;" msgstr "" -#: ../../library/pickle.rst:505 +#: ../../library/pickle.rst:506 msgid "" "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 +#: ../../library/pickle.rst:509 msgid "classes accessible from the top level of a module;" msgstr "" -#: ../../library/pickle.rst:510 +#: ../../library/pickle.rst:511 msgid "" "instances of such classes whose the result of calling :meth:`__getstate__` " "is picklable (see section :ref:`pickle-inst` for details)." msgstr "" -#: ../../library/pickle.rst:513 +#: ../../library/pickle.rst:514 msgid "" "Attempts to pickle unpicklable objects will raise the :exc:`PicklingError` " "exception; when this happens, an unspecified number of bytes may have " @@ -708,7 +710,7 @@ msgid "" "limit with :func:`sys.setrecursionlimit`." msgstr "" -#: ../../library/pickle.rst:520 +#: ../../library/pickle.rst:521 msgid "" "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 " @@ -719,7 +721,7 @@ msgid "" "exception will be raised. [#]_" msgstr "" -#: ../../library/pickle.rst:527 +#: ../../library/pickle.rst:528 msgid "" "Similarly, classes are pickled by fully qualified name, so the same " "restrictions in the unpickling environment apply. Note that none of the " @@ -727,13 +729,13 @@ msgid "" "attribute ``attr`` is not restored in the unpickling environment::" msgstr "" -#: ../../library/pickle.rst:537 +#: ../../library/pickle.rst:538 msgid "" "These restrictions are why picklable functions and classes must be defined " "at the top level of a module." msgstr "" -#: ../../library/pickle.rst:540 +#: ../../library/pickle.rst:541 msgid "" "Similarly, when class instances are pickled, their class's code and data are " "not pickled along with them. Only the instance data are pickled. This is " @@ -745,17 +747,17 @@ msgid "" "method." msgstr "" -#: ../../library/pickle.rst:552 +#: ../../library/pickle.rst:553 msgid "Pickling Class Instances" msgstr "" -#: ../../library/pickle.rst:556 +#: ../../library/pickle.rst:557 msgid "" "In this section, we describe the general mechanisms available to you to " "define, customize, and control how class instances are pickled and unpickled." msgstr "" -#: ../../library/pickle.rst:559 +#: ../../library/pickle.rst:560 msgid "" "In most cases, no additional code is needed to make instances picklable. By " "default, pickle will retrieve the class and the attributes of an instance " @@ -765,13 +767,13 @@ msgid "" "following code shows an implementation of this behaviour::" msgstr "" -#: ../../library/pickle.rst:574 +#: ../../library/pickle.rst:575 msgid "" "Classes can alter the default behaviour by providing one or several special " "methods:" msgstr "" -#: ../../library/pickle.rst:579 +#: ../../library/pickle.rst:580 msgid "" "In protocols 2 and newer, classes that implements the :meth:" "`__getnewargs_ex__` method can dictate the values passed to the :meth:" @@ -781,37 +783,37 @@ msgid "" "passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:587 +#: ../../library/pickle.rst:588 msgid "" "You should implement this method if the :meth:`__new__` method of your class " "requires keyword-only arguments. Otherwise, it is recommended for " "compatibility to implement :meth:`__getnewargs__`." msgstr "" -#: ../../library/pickle.rst:591 +#: ../../library/pickle.rst:592 msgid ":meth:`__getnewargs_ex__` is now used in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:597 +#: ../../library/pickle.rst:598 msgid "" "This method serves a similar purpose as :meth:`__getnewargs_ex__`, but " "supports only positional arguments. It must return a tuple of arguments " "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:601 +#: ../../library/pickle.rst:602 msgid "" ":meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is " "defined." msgstr "" -#: ../../library/pickle.rst:604 +#: ../../library/pickle.rst:605 msgid "" "Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" "`__getnewargs_ex__` in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:611 +#: ../../library/pickle.rst:612 msgid "" "Classes can further influence how their instances are pickled by overriding " "the method :meth:`__getstate__`. It is called and the returned object is " @@ -819,19 +821,19 @@ msgid "" "are several cases:" msgstr "" -#: ../../library/pickle.rst:616 +#: ../../library/pickle.rst:617 msgid "" "For a class that has no instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``None``." msgstr "" -#: ../../library/pickle.rst:619 +#: ../../library/pickle.rst:620 msgid "" "For a class that has an instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``self.__dict__``." msgstr "" -#: ../../library/pickle.rst:622 +#: ../../library/pickle.rst:623 msgid "" "For a class that has an instance :attr:`~object.__dict__` and :attr:`~object." "__slots__`, the default state is a tuple consisting of two dictionaries: " @@ -839,7 +841,7 @@ msgid "" "slots that have a value are included in the latter." msgstr "" -#: ../../library/pickle.rst:628 +#: ../../library/pickle.rst:629 msgid "" "For a class that has :attr:`~object.__slots__` and no instance :attr:" "`~object.__dict__`, the default state is a tuple whose first item is " @@ -847,13 +849,13 @@ msgid "" "values described in the previous bullet." msgstr "" -#: ../../library/pickle.rst:633 +#: ../../library/pickle.rst:634 msgid "" "Added the default implementation of the ``__getstate__()`` method in the :" "class:`object` class." msgstr "" -#: ../../library/pickle.rst:640 +#: ../../library/pickle.rst:641 msgid "" "Upon unpickling, if the class defines :meth:`__setstate__`, it is called " "with the unpickled state. In that case, there is no requirement for the " @@ -861,19 +863,19 @@ msgid "" "dictionary and its items are assigned to the new instance's dictionary." msgstr "" -#: ../../library/pickle.rst:647 +#: ../../library/pickle.rst:648 msgid "" "If :meth:`__getstate__` returns a false value, the :meth:`__setstate__` " "method will not be called upon unpickling." msgstr "" -#: ../../library/pickle.rst:651 +#: ../../library/pickle.rst:652 msgid "" "Refer to the section :ref:`pickle-state` for more information about how to " "use the methods :meth:`__getstate__` and :meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:656 +#: ../../library/pickle.rst:657 msgid "" "At unpickling time, some methods like :meth:`__getattr__`, :meth:" "`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. " @@ -882,7 +884,7 @@ msgid "" "`__init__` is not called when unpickling an instance." msgstr "" -#: ../../library/pickle.rst:665 +#: ../../library/pickle.rst:666 msgid "" "As we shall see, pickle does not use directly the methods described above. " "In fact, these methods are part of the copy protocol which implements the :" @@ -891,7 +893,7 @@ msgid "" "objects. [#]_" msgstr "" -#: ../../library/pickle.rst:671 +#: ../../library/pickle.rst:672 msgid "" "Although powerful, implementing :meth:`__reduce__` directly in your classes " "is error prone. For this reason, class designers should use the high-level " @@ -901,14 +903,14 @@ msgid "" "pickling or both." msgstr "" -#: ../../library/pickle.rst:680 +#: ../../library/pickle.rst:681 msgid "" "The interface is currently defined as follows. The :meth:`__reduce__` " "method takes no argument and shall return either a string or preferably a " "tuple (the returned object is often referred to as the \"reduce value\")." msgstr "" -#: ../../library/pickle.rst:684 +#: ../../library/pickle.rst:685 msgid "" "If a string is returned, the string should be interpreted as the name of a " "global variable. It should be the object's local name relative to its " @@ -916,26 +918,26 @@ msgid "" "object's module. This behaviour is typically useful for singletons." msgstr "" -#: ../../library/pickle.rst:689 +#: ../../library/pickle.rst:690 msgid "" "When a tuple is returned, it must be between two and six items long. " "Optional items can either be omitted, or ``None`` can be provided as their " "value. The semantics of each item are in order:" msgstr "" -#: ../../library/pickle.rst:695 +#: ../../library/pickle.rst:696 msgid "" "A callable object that will be called to create the initial version of the " "object." msgstr "" -#: ../../library/pickle.rst:698 +#: ../../library/pickle.rst:699 msgid "" "A tuple of arguments for the callable object. An empty tuple must be given " "if the callable does not accept any argument." msgstr "" -#: ../../library/pickle.rst:701 +#: ../../library/pickle.rst:702 msgid "" "Optionally, the object's state, which will be passed to the object's :meth:" "`__setstate__` method as previously described. If the object has no such " @@ -943,7 +945,7 @@ msgid "" "object's :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/pickle.rst:706 +#: ../../library/pickle.rst:707 msgid "" "Optionally, an iterator (and not a sequence) yielding successive items. " "These items will be appended to the object either using ``obj.append(item)`` " @@ -955,7 +957,7 @@ msgid "" "must be supported.)" msgstr "" -#: ../../library/pickle.rst:715 +#: ../../library/pickle.rst:716 msgid "" "Optionally, an iterator (not a sequence) yielding successive key-value " "pairs. These items will be stored to the object using ``obj[key] = " @@ -963,7 +965,7 @@ msgid "" "by other classes as long as they implement :meth:`__setitem__`." msgstr "" -#: ../../library/pickle.rst:720 +#: ../../library/pickle.rst:721 msgid "" "Optionally, a callable with a ``(obj, state)`` signature. This callable " "allows the user to programmatically control the state-updating behavior of a " @@ -972,11 +974,11 @@ msgid "" "meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:726 +#: ../../library/pickle.rst:727 msgid "The optional sixth tuple item, ``(obj, state)``, was added." msgstr "" -#: ../../library/pickle.rst:732 +#: ../../library/pickle.rst:733 msgid "" "Alternatively, a :meth:`__reduce_ex__` method may be defined. The only " "difference is this method should take a single integer argument, the " @@ -986,11 +988,11 @@ msgid "" "provide backwards-compatible reduce values for older Python releases." msgstr "" -#: ../../library/pickle.rst:744 +#: ../../library/pickle.rst:745 msgid "Persistence of External Objects" msgstr "" -#: ../../library/pickle.rst:750 +#: ../../library/pickle.rst:751 msgid "" "For the benefit of object persistence, the :mod:`pickle` module supports the " "notion of a reference to an object outside the pickled data stream. Such " @@ -999,7 +1001,7 @@ msgid "" "(for any newer protocol)." msgstr "" -#: ../../library/pickle.rst:756 +#: ../../library/pickle.rst:757 msgid "" "The resolution of such persistent IDs is not defined by the :mod:`pickle` " "module; it will delegate this resolution to the user-defined methods on the " @@ -1007,7 +1009,7 @@ msgid "" "persistent_load` respectively." msgstr "" -#: ../../library/pickle.rst:761 +#: ../../library/pickle.rst:762 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1018,67 +1020,67 @@ msgid "" "persistent ID." msgstr "" -#: ../../library/pickle.rst:768 +#: ../../library/pickle.rst:769 msgid "" "To unpickle external objects, the unpickler must have a custom :meth:" "`~Unpickler.persistent_load` method that takes a persistent ID object and " "returns the referenced object." msgstr "" -#: ../../library/pickle.rst:772 +#: ../../library/pickle.rst:773 msgid "" "Here is a comprehensive example presenting how persistent ID can be used to " "pickle external objects by reference." msgstr "" -#: ../../library/pickle.rst:780 +#: ../../library/pickle.rst:781 msgid "Dispatch Tables" msgstr "" -#: ../../library/pickle.rst:782 +#: ../../library/pickle.rst:783 msgid "" "If one wants to customize pickling of some classes without disturbing any " "other code which depends on pickling, then one can create a pickler with a " "private dispatch table." msgstr "" -#: ../../library/pickle.rst:786 +#: ../../library/pickle.rst:787 msgid "" "The global dispatch table managed by the :mod:`copyreg` module is available " "as :data:`copyreg.dispatch_table`. Therefore, one may choose to use a " "modified copy of :data:`copyreg.dispatch_table` as a private dispatch table." msgstr "" -#: ../../library/pickle.rst:791 +#: ../../library/pickle.rst:792 msgid "For example ::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/pickle.rst:798 +#: ../../library/pickle.rst:799 msgid "" "creates an instance of :class:`pickle.Pickler` with a private dispatch table " "which handles the ``SomeClass`` class specially. Alternatively, the code ::" msgstr "" -#: ../../library/pickle.rst:808 +#: ../../library/pickle.rst:809 msgid "" "does the same but all instances of ``MyPickler`` will by default share the " "private dispatch table. On the other hand, the code ::" msgstr "" -#: ../../library/pickle.rst:815 +#: ../../library/pickle.rst:816 msgid "" "modifies the global dispatch table shared by all users of the :mod:`copyreg` " "module." msgstr "" -#: ../../library/pickle.rst:820 +#: ../../library/pickle.rst:821 msgid "Handling Stateful Objects" msgstr "" -#: ../../library/pickle.rst:826 +#: ../../library/pickle.rst:827 msgid "" "Here's an example that shows how to modify pickling behavior for a class. " "The :class:`TextReader` class opens a text file, and returns the line number " @@ -1090,15 +1092,15 @@ msgid "" "behavior. ::" msgstr "" -#: ../../library/pickle.rst:872 +#: ../../library/pickle.rst:873 msgid "A sample usage might be something like this::" msgstr "" -#: ../../library/pickle.rst:886 +#: ../../library/pickle.rst:887 msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "" -#: ../../library/pickle.rst:890 +#: ../../library/pickle.rst:891 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1106,7 +1108,7 @@ msgid "" "classes." msgstr "" -#: ../../library/pickle.rst:895 +#: ../../library/pickle.rst:896 msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " @@ -1115,14 +1117,14 @@ msgid "" "behavior." msgstr "" -#: ../../library/pickle.rst:900 +#: ../../library/pickle.rst:901 msgid "" "If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler." "reducer_override` are defined, then :meth:`~Pickler.reducer_override` method " "takes priority." msgstr "" -#: ../../library/pickle.rst:905 +#: ../../library/pickle.rst:906 msgid "" "For performance reasons, :meth:`~Pickler.reducer_override` may not be called " "for the following objects: ``None``, ``True``, ``False``, and exact " @@ -1131,17 +1133,17 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/pickle.rst:911 +#: ../../library/pickle.rst:912 msgid "" "Here is a simple example where we allow pickling and reconstructing a given " "class::" msgstr "" -#: ../../library/pickle.rst:946 +#: ../../library/pickle.rst:947 msgid "Out-of-band Buffers" msgstr "" -#: ../../library/pickle.rst:950 +#: ../../library/pickle.rst:951 msgid "" "In some contexts, the :mod:`pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " @@ -1151,7 +1153,7 @@ msgid "" "involves copying data to and from the pickle stream." msgstr "" -#: ../../library/pickle.rst:957 +#: ../../library/pickle.rst:958 msgid "" "This constraint can be eschewed if both the *provider* (the implementation " "of the object types to be transferred) and the *consumer* (the " @@ -1159,11 +1161,11 @@ msgid "" "transfer facilities provided by pickle protocol 5 and higher." msgstr "" -#: ../../library/pickle.rst:963 +#: ../../library/pickle.rst:964 msgid "Provider API" msgstr "" -#: ../../library/pickle.rst:965 +#: ../../library/pickle.rst:966 msgid "" "The large data objects to be pickled must implement a :meth:`__reduce_ex__` " "method specialized for protocol 5 and higher, which returns a :class:" @@ -1171,7 +1173,7 @@ msgid "" "large data." msgstr "" -#: ../../library/pickle.rst:970 +#: ../../library/pickle.rst:971 msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " @@ -1180,17 +1182,17 @@ msgid "" "themselves." msgstr "" -#: ../../library/pickle.rst:977 +#: ../../library/pickle.rst:978 msgid "Consumer API" msgstr "" -#: ../../library/pickle.rst:979 +#: ../../library/pickle.rst:980 msgid "" "A communications system can enable custom handling of the :class:" "`PickleBuffer` objects generated when serializing an object graph." msgstr "" -#: ../../library/pickle.rst:982 +#: ../../library/pickle.rst:983 msgid "" "On the sending side, it needs to pass a *buffer_callback* argument to :class:" "`Pickler` (or to the :func:`dump` or :func:`dumps` function), which will be " @@ -1199,7 +1201,7 @@ msgid "" "copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -#: ../../library/pickle.rst:989 +#: ../../library/pickle.rst:990 msgid "" "On the receiving side, it needs to pass a *buffers* argument to :class:" "`Unpickler` (or to the :func:`load` or :func:`loads` function), which is an " @@ -1210,7 +1212,7 @@ msgid "" "`PickleBuffer` objects." msgstr "" -#: ../../library/pickle.rst:997 +#: ../../library/pickle.rst:998 msgid "" "Between the sending side and the receiving side, the communications system " "is free to implement its own transfer mechanism for out-of-band buffers. " @@ -1218,36 +1220,36 @@ msgid "" "dependent compression." msgstr "" -#: ../../library/pickle.rst:1003 +#: ../../library/pickle.rst:1004 msgid "Example" msgstr "範例" -#: ../../library/pickle.rst:1005 +#: ../../library/pickle.rst:1006 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -#: ../../library/pickle.rst:1029 +#: ../../library/pickle.rst:1030 msgid "" "The reconstructor (the ``_reconstruct`` class method) returns the buffer's " "providing object if it has the right type. This is an easy way to simulate " "zero-copy behaviour on this toy example." msgstr "" -#: ../../library/pickle.rst:1033 +#: ../../library/pickle.rst:1034 msgid "" "On the consumer side, we can pickle those objects the usual way, which when " "unserialized will give us a copy of the original object::" msgstr "" -#: ../../library/pickle.rst:1042 +#: ../../library/pickle.rst:1043 msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" msgstr "" -#: ../../library/pickle.rst:1052 +#: ../../library/pickle.rst:1053 msgid "" "This example is limited by the fact that :class:`bytearray` allocates its " "own memory: you cannot create a :class:`bytearray` instance that is backed " @@ -1257,15 +1259,15 @@ msgid "" "processes or systems." msgstr "" -#: ../../library/pickle.rst:1059 +#: ../../library/pickle.rst:1060 msgid ":pep:`574` -- Pickle protocol 5 with out-of-band data" msgstr "" -#: ../../library/pickle.rst:1065 +#: ../../library/pickle.rst:1066 msgid "Restricting Globals" msgstr "" -#: ../../library/pickle.rst:1070 +#: ../../library/pickle.rst:1071 msgid "" "By default, unpickling will import any class or function that it finds in " "the pickle data. For many applications, this behaviour is unacceptable as " @@ -1273,7 +1275,7 @@ msgid "" "what this hand-crafted pickle data stream does when loaded::" msgstr "" -#: ../../library/pickle.rst:1080 +#: ../../library/pickle.rst:1081 msgid "" "In this example, the unpickler imports the :func:`os.system` function and " "then apply the string argument \"echo hello world\". Although this example " @@ -1281,7 +1283,7 @@ msgid "" "system." msgstr "" -#: ../../library/pickle.rst:1084 +#: ../../library/pickle.rst:1085 msgid "" "For this reason, you may want to control what gets unpickled by customizing :" "meth:`Unpickler.find_class`. Unlike its name suggests, :meth:`Unpickler." @@ -1290,17 +1292,17 @@ msgid "" "restrict them to a safe subset." msgstr "" -#: ../../library/pickle.rst:1090 +#: ../../library/pickle.rst:1091 msgid "" "Here is an example of an unpickler allowing only few safe classes from the :" "mod:`builtins` module to be loaded::" msgstr "" -#: ../../library/pickle.rst:1119 +#: ../../library/pickle.rst:1120 msgid "A sample usage of our unpickler working as intended::" msgstr "" -#: ../../library/pickle.rst:1138 +#: ../../library/pickle.rst:1139 msgid "" "As our examples shows, you have to be careful with what you allow to be " "unpickled. Therefore if security is a concern, you may want to consider " @@ -1308,97 +1310,97 @@ msgid "" "party solutions." msgstr "" -#: ../../library/pickle.rst:1145 +#: ../../library/pickle.rst:1146 msgid "Performance" msgstr "" -#: ../../library/pickle.rst:1147 +#: ../../library/pickle.rst:1148 msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " "Also, the :mod:`pickle` module has a transparent optimizer written in C." msgstr "" -#: ../../library/pickle.rst:1155 +#: ../../library/pickle.rst:1156 msgid "Examples" msgstr "範例" -#: ../../library/pickle.rst:1157 +#: ../../library/pickle.rst:1158 msgid "" "For the simplest code, use the :func:`dump` and :func:`load` functions. ::" msgstr "" -#: ../../library/pickle.rst:1173 +#: ../../library/pickle.rst:1174 msgid "The following example reads the resulting pickled data. ::" msgstr "" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Module :mod:`copyreg`" msgstr ":mod:`copyreg` 模組" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Pickle interface constructor registration for extension types." msgstr "" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Module :mod:`pickletools`" msgstr ":mod:`pickletools` 模組" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Tools for working with and analyzing pickled data." msgstr "" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Indexed databases of objects; uses :mod:`pickle`." msgstr "" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Module :mod:`copy`" msgstr ":mod:`copy` 模組" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Shallow and deep object copying." msgstr "" -#: ../../library/pickle.rst:1201 +#: ../../library/pickle.rst:1202 msgid "Module :mod:`marshal`" msgstr ":mod:`marshal` 模組" -#: ../../library/pickle.rst:1202 +#: ../../library/pickle.rst:1203 msgid "High-performance serialization of built-in types." msgstr "" -#: ../../library/pickle.rst:1206 +#: ../../library/pickle.rst:1207 msgid "Footnotes" msgstr "註解" -#: ../../library/pickle.rst:1207 +#: ../../library/pickle.rst:1208 msgid "Don't confuse this with the :mod:`marshal` module" msgstr "" -#: ../../library/pickle.rst:1209 +#: ../../library/pickle.rst:1210 msgid "" "This is why :keyword:`lambda` functions cannot be pickled: all :keyword:`!" "lambda` functions share the same name: ````." msgstr "" -#: ../../library/pickle.rst:1212 +#: ../../library/pickle.rst:1213 msgid "" "The exception raised will likely be an :exc:`ImportError` or an :exc:" "`AttributeError` but it could be something else." msgstr "" -#: ../../library/pickle.rst:1215 +#: ../../library/pickle.rst:1216 msgid "" "The :mod:`copy` module uses this protocol for shallow and deep copying " "operations." msgstr "" -#: ../../library/pickle.rst:1218 +#: ../../library/pickle.rst:1219 msgid "" "The limitation on alphanumeric characters is due to the fact that persistent " "IDs in protocol 0 are delimited by the newline character. Therefore if any " @@ -1438,30 +1440,33 @@ msgstr "pickling" msgid "External Data Representation" msgstr "External Data Representation(外部資料表示法)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "copy" msgstr "copy(複製)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_id (pickle protocol)" msgstr "persistent_id(pickle 協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_load (pickle protocol)" msgstr "persistent_load(pickle 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__getstate__() (copy protocol)" msgstr "__getstate__()(copy 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__setstate__() (copy protocol)" msgstr "__setstate__()(copy 協定)" -#: ../../library/pickle.rst:1067 +#: ../../library/pickle.rst:1068 msgid "find_class() (pickle protocol)" msgstr "find_class()(pickle 協定)" + +#~ msgid "``None``, ``True``, and ``False``;" +#~ msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" diff --git a/library/socket.po b/library/socket.po index 7875ed07cd..6ef99f085a 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -1187,8 +1187,8 @@ msgstr ":ref:`適用 `:非 WASI。" #: ../../library/socket.rst:981 msgid "" -"Translate a host name to IPv4 address format, extended interface. Return a " -"triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " +"Translate a host name to IPv4 address format, extended interface. Return a 3-" +"tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " "primary host name, *aliaslist* is a (possibly empty) list of alternative " "host names for the same address, and *ipaddrlist* is a list of IPv4 " "addresses for the same interface on the same host (often but not always a " @@ -1218,7 +1218,7 @@ msgstr "" #: ../../library/socket.rst:1010 msgid "" -"Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " +"Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " "(possibly empty) list of alternative host names for the same address, and " "*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " diff --git a/library/sqlite3.po b/library/sqlite3.po index 0e6a2ccf5f..cacf25b635 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+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-" @@ -1479,7 +1479,7 @@ msgstr "" #: ../../library/sqlite3.rst:1548 msgid "" -"If *sql* contains more than one SQL statement, or is not a DML statment." +"If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" #: ../../library/sqlite3.rst:1565 diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po new file mode 100644 index 0000000000..58353e1ae7 --- /dev/null +++ b/library/sys.monitoring.po @@ -0,0 +1,540 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/sys.monitoring.rst:2 +msgid ":mod:`sys.monitoring` --- Execution event monitoring" +msgstr "" + +#: ../../library/sys.monitoring.rst:11 +msgid "" +"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +"independent module, so there is no need to ``import sys.monitoring``, simply " +"``import sys`` and then use ``sys.monitoring``." +msgstr "" + +#: ../../library/sys.monitoring.rst:17 +msgid "" +"This namespace provides access to the functions and constants necessary to " +"activate and control event monitoring." +msgstr "" + +#: ../../library/sys.monitoring.rst:20 +msgid "" +"As programs execute, events occur that might be of interest to tools that " +"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"receive callbacks when events of interest occur." +msgstr "" + +#: ../../library/sys.monitoring.rst:24 +msgid "The monitoring API consists of three components:" +msgstr "" + +#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 +msgid "Events" +msgstr "" + +#: ../../library/sys.monitoring.rst:28 +msgid "Callbacks" +msgstr "" + +#: ../../library/sys.monitoring.rst:33 +msgid "" +"A tool identifier is an integer and associated name. Tool identifiers are " +"used to discourage tools from interfering with each other and to allow " +"multiple tools to operate at the same time. Currently tools are completely " +"independent and cannot be used to monitor each other. This restriction may " +"be lifted in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:39 +msgid "" +"Before registering or activating events, a tool should choose an identifier. " +"Identifiers are integers in the range 0 to 5." +msgstr "" + +#: ../../library/sys.monitoring.rst:43 +msgid "Registering and using tools" +msgstr "" + +#: ../../library/sys.monitoring.rst:47 +msgid "" +"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " +"inclusive. Raises a ``ValueError`` if ``id`` is in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:53 +msgid "Should be called once a tool no longer requires ``id``." +msgstr "" + +#: ../../library/sys.monitoring.rst:57 +msgid "" +"Returns the name of the tool if ``id`` is in use, otherwise it returns " +"``None``. ``id`` must be in the range 0 to 5 inclusive." +msgstr "" + +#: ../../library/sys.monitoring.rst:61 +msgid "" +"All IDs are treated the same by the VM with regard to events, but the " +"following IDs are pre-defined to make co-operation of tools easier::" +msgstr "" + +#: ../../library/sys.monitoring.rst:69 +msgid "" +"There is no obligation to set an ID, nor is there anything preventing a tool " +"from using an ID even it is already in use. However, tools are encouraged to " +"use a unique ID and respect other tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:76 +msgid "The following events are supported:" +msgstr "" + +#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 +msgid "BRANCH" +msgstr "" + +#: ../../library/sys.monitoring.rst:79 +msgid "A conditional branch is taken (or not)." +msgstr "" + +#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 +msgid "CALL" +msgstr "" + +#: ../../library/sys.monitoring.rst:81 +msgid "A call in Python code (event occurs before the call)." +msgstr "" + +#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 +msgid "C_RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:83 +msgid "" +"Exception raised from any callable, except Python functions (event occurs " +"after the exit)." +msgstr "" + +#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 +msgid "C_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:85 +msgid "" +"Return from any callable, except Python functions (event occurs after the " +"return)." +msgstr "" + +#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 +msgid "EXCEPTION_HANDLED" +msgstr "" + +#: ../../library/sys.monitoring.rst:87 +msgid "An exception is handled." +msgstr "" + +#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 +msgid "INSTRUCTION" +msgstr "" + +#: ../../library/sys.monitoring.rst:89 +msgid "A VM instruction is about to be executed." +msgstr "" + +#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 +msgid "JUMP" +msgstr "" + +#: ../../library/sys.monitoring.rst:91 +msgid "An unconditional jump in the control flow graph is made." +msgstr "" + +#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 +msgid "LINE" +msgstr "" + +#: ../../library/sys.monitoring.rst:93 +msgid "" +"An instruction is about to be executed that has a different line number from " +"the preceding instruction." +msgstr "" + +#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 +msgid "PY_RESUME" +msgstr "" + +#: ../../library/sys.monitoring.rst:95 +msgid "" +"Resumption of a Python function (for generator and coroutine functions), " +"except for throw() calls." +msgstr "" + +#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 +msgid "PY_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:97 +msgid "" +"Return from a Python function (occurs immediately before the return, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 +msgid "PY_START" +msgstr "" + +#: ../../library/sys.monitoring.rst:99 +msgid "" +"Start of a Python function (occurs immediately after the call, the callee's " +"frame will be on the stack)" +msgstr "" + +#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 +msgid "PY_THROW" +msgstr "" + +#: ../../library/sys.monitoring.rst:101 +msgid "A Python function is resumed by a throw() call." +msgstr "" + +#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 +msgid "PY_UNWIND" +msgstr "" + +#: ../../library/sys.monitoring.rst:103 +msgid "Exit from a Python function during exception unwinding." +msgstr "" + +#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 +msgid "PY_YIELD" +msgstr "" + +#: ../../library/sys.monitoring.rst:105 +msgid "" +"Yield from a Python function (occurs immediately before the yield, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 +msgid "RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:107 +msgid "" +"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:108 +msgid "RERAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:109 +msgid "" +"An exception is re-raised, for example at the end of a ``finally`` block." +msgstr "" + +#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 +msgid "STOP_ITERATION" +msgstr "" + +#: ../../library/sys.monitoring.rst:111 +msgid "" +"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +msgstr "" + +#: ../../library/sys.monitoring.rst:113 +msgid "More events may be added in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:115 +msgid "" +"These events are attributes of the :mod:`!sys.monitoring.events` namespace. " +"Each event is represented as a power-of-2 integer constant. To define a set " +"of events, simply bitwise or the individual events together. For example, to " +"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " +"``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:121 +msgid "Events are divided into three groups:" +msgstr "" + +#: ../../library/sys.monitoring.rst:124 +msgid "Local events" +msgstr "" + +#: ../../library/sys.monitoring.rst:126 +msgid "" +"Local events are associated with normal execution of the program and happen " +"at clearly defined locations. All local events can be disabled. The local " +"events are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:142 +msgid "Ancillary events" +msgstr "" + +#: ../../library/sys.monitoring.rst:144 +msgid "" +"Ancillary events can be monitored like other events, but are controlled by " +"another event:" +msgstr "" + +#: ../../library/sys.monitoring.rst:150 +msgid "" +"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " +"corresponding ``CALL`` event is being monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:155 +msgid "Other events" +msgstr "" + +#: ../../library/sys.monitoring.rst:157 +msgid "" +"Other events are not necessarily tied to a specific location in the program " +"and cannot be individually disabled." +msgstr "" + +#: ../../library/sys.monitoring.rst:160 +msgid "The other events that can be monitored are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:169 +msgid "The STOP_ITERATION event" +msgstr "" + +#: ../../library/sys.monitoring.rst:171 +msgid "" +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " +"``StopIteration`` exception is raised when returning a value from a " +"generator or coroutine. However, this is a very inefficient way to return a " +"value, so some Python implementations, notably CPython 3.12+, do not raise " +"an exception unless it would be visible to other code." +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid "" +"To allow tools to monitor for real exceptions without slowing down " +"generators and coroutines, the ``STOP_ITERATION`` event is provided. " +"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +msgstr "" + +#: ../../library/sys.monitoring.rst:183 +msgid "Turning events on and off" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 +msgid "" +"In order to monitor an event, it must be turned on and a callback " +"registered. Events can be turned on or off by setting the events either " +"globally or for a particular code object." +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid "Setting events globally" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 +msgid "" +"Events can be controlled globally by modifying the set of events being " +"monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:197 +msgid "Returns the ``int`` representing all the active events." +msgstr "" + +#: ../../library/sys.monitoring.rst:201 +msgid "" +"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " +"if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:204 +msgid "No events are active by default." +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid "Per code object events" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid "Events can also be controlled on a per code object basis." +msgstr "" + +#: ../../library/sys.monitoring.rst:213 +msgid "Returns all the local events for ``code``" +msgstr "" + +#: ../../library/sys.monitoring.rst:217 +msgid "" +"Activates all the local events for ``code`` which are set in ``event_set``. " +"Raises a ``ValueError`` if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:220 +msgid "" +"Local events add to global events, but do not mask them. In other words, all " +"global events will trigger for a code object, regardless of the local events." +msgstr "" + +#: ../../library/sys.monitoring.rst:226 +msgid "Disabling events" +msgstr "" + +#: ../../library/sys.monitoring.rst:228 +msgid "" +"Local events can be disabled for a specific code location by returning ``sys." +"monitoring.DISABLE`` from a callback function. This does not change which " +"events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:232 +msgid "" +"Disabling events for specific locations is very important for high " +"performance monitoring. For example, a program can be run under a debugger " +"with no overhead if the debugger disables all monitoring except for a few " +"breakpoints." +msgstr "" + +#: ../../library/sys.monitoring.rst:239 +msgid "Registering callback functions" +msgstr "" + +#: ../../library/sys.monitoring.rst:241 +msgid "To register a callable for events call" +msgstr "" + +#: ../../library/sys.monitoring.rst:245 +msgid "" +"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +msgstr "" + +#: ../../library/sys.monitoring.rst:247 +msgid "" +"If another callback was registered for the given ``tool_id`` and ``event``, " +"it is unregistered and returned. Otherwise ``register_callback`` returns " +"``None``." +msgstr "" + +#: ../../library/sys.monitoring.rst:252 +msgid "" +"Functions can be unregistered by calling ``sys.monitoring." +"register_callback(tool_id, event, None)``." +msgstr "" + +#: ../../library/sys.monitoring.rst:255 +msgid "Callback functions can be registered and unregistered at any time." +msgstr "" + +#: ../../library/sys.monitoring.rst:257 +msgid "" +"Registering or unregistering a callback function will generate a ``sys." +"audit`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:261 +msgid "Callback function arguments" +msgstr "" + +#: ../../library/sys.monitoring.rst:263 +msgid "" +"When an active event occurs, the registered callback function is called. " +"Different events will provide the callback function with different " +"arguments, as follows:" +msgstr "" + +#: ../../library/sys.monitoring.rst:266 +msgid "``PY_START`` and ``PY_RESUME``::" +msgstr "" + +#: ../../library/sys.monitoring.rst:270 +msgid "``PY_RETURN`` and ``PY_YIELD``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:272 +msgid "" +"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " +"Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:274 +msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:276 +msgid "" +"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " +"object | MISSING) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:278 +msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." +msgstr "" + +#: ../../library/sys.monitoring.rst:280 +msgid "" +"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " +"and ``STOP_ITERATION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:282 +msgid "" +"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:284 +msgid "``LINE``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:286 +msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:288 +msgid "``BRANCH`` and ``JUMP``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:290 +msgid "" +"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:292 +msgid "" +"Note that the ``destination_offset`` is where the code will next execute. " +"For an untaken branch this will be the offset of the instruction following " +"the branch." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 +msgid "``INSTRUCTION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:298 +msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +msgstr "" diff --git a/library/sys.po b/library/sys.po index bf8dcc3cde..0b47041954 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -471,13 +471,13 @@ msgstr "" #: ../../library/sys.rst:381 msgid "" -"When an exception is raised and uncaught, the interpreter calls ``sys." -"excepthook`` with three arguments, the exception class, exception instance, " -"and a traceback object. In an interactive session this happens just before " -"control is returned to the prompt; in a Python program this happens just " -"before the program exits. The handling of such top-level exceptions can be " -"customized by assigning another three-argument function to ``sys." -"excepthook``." +"When an exception other than :exc:`SystemExit` is raised and uncaught, the " +"interpreter calls ``sys.excepthook`` with three arguments, the exception " +"class, exception instance, and a traceback object. In an interactive " +"session this happens just before control is returned to the prompt; in a " +"Python program this happens just before the program exits. The handling of " +"such top-level exceptions can be customized by assigning another three-" +"argument function to ``sys.excepthook``." msgstr "" #: ../../library/sys.rst:388 @@ -2532,25 +2532,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1958 +#: ../../library/sys.rst:1959 +msgid "" +"Namespace containing functions and constants for register callbacks and " +"controlling monitoring events. See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../library/sys.rst:1965 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1974 +#: ../../library/sys.rst:1981 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1982 +#: ../../library/sys.rst:1989 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1983 +#: ../../library/sys.rst:1990 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" diff --git a/library/threading.po b/library/threading.po index 992f2849f1..2d8aba54e4 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+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-" @@ -346,7 +346,7 @@ msgstr "" #: ../../library/threading.rst:274 msgid "" "For more details and extensive examples, see the documentation string of " -"the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." +"the :mod:`!_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" #: ../../library/threading.rst:281 @@ -359,8 +359,8 @@ msgid "" "thread of control. There are two ways to specify the activity: by passing a " "callable object to the constructor, or by overriding the :meth:`~Thread.run` " "method in a subclass. No other methods (except for the constructor) should " -"be overridden in a subclass. In other words, *only* override the :meth:" -"`~Thread.__init__` and :meth:`~Thread.run` methods of this class." +"be overridden in a subclass. In other words, *only* override the " +"``__init__()`` and :meth:`~Thread.run` methods of this class." msgstr "" #: ../../library/threading.rst:290 @@ -440,8 +440,8 @@ msgstr "" #: ../../library/threading.rst:339 msgid "" -"*group* should be ``None``; reserved for future extension when a :class:" -"`ThreadGroup` class is implemented." +"*group* should be ``None``; reserved for future extension when a :class:`!" +"ThreadGroup` class is implemented." msgstr "" #: ../../library/threading.rst:342 @@ -1282,11 +1282,11 @@ msgstr "" #: ../../library/threading.rst:1012 msgid "" -"Timers are started, as with threads, by calling their :meth:`~Timer.start` " -"method. The timer can be stopped (before its action has begun) by calling " -"the :meth:`~Timer.cancel` method. The interval the timer will wait before " -"executing its action may not be exactly the same as the interval specified " -"by the user." +"Timers are started, as with threads, by calling their :meth:`Timer.start " +"` method. The timer can be stopped (before its action has " +"begun) by calling the :meth:`~Timer.cancel` method. The interval the timer " +"will wait before executing its action may not be exactly the same as the " +"interval specified by the user." msgstr "" #: ../../library/threading.rst:1018 @@ -1426,11 +1426,11 @@ msgstr "" #: ../../library/threading.rst:1150 msgid "" -"All of the objects provided by this module that have :meth:`acquire` and :" -"meth:`release` methods can be used as context managers for a :keyword:`with` " -"statement. The :meth:`acquire` method will be called when the block is " -"entered, and :meth:`release` will be called when the block is exited. " -"Hence, the following snippet::" +"All of the objects provided by this module that have ``acquire`` and " +"``release`` methods can be used as context managers for a :keyword:`with` " +"statement. The ``acquire`` method will be called when the block is entered, " +"and ``release`` will be called when the block is exited. Hence, the " +"following snippet::" msgstr "" #: ../../library/threading.rst:1159 diff --git a/library/tkinter.po b/library/tkinter.po index 30c7155ee1..8b8ad0bd3e 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -650,7 +650,7 @@ msgstr "" msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " -"commands in the Tcl interpreter attached to your applicaton's :class:`Tk` " +"commands in the Tcl interpreter attached to your application's :class:`Tk` " "instance." msgstr "" diff --git a/library/traceback.po b/library/traceback.po index 775bdb77a3..98b2965651 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-14 00:03+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-" @@ -117,7 +117,7 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:73 ../../library/traceback.rst:165 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:168 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" @@ -183,11 +183,11 @@ msgstr "" msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " -"ending in a newline. Normally, the list contains a single string; however, " -"for :exc:`SyntaxError` exceptions, it contains several lines that (when " -"printed) display detailed information about where the syntax error occurred. " -"The message indicating which exception occurred is the always last string in " -"the list." +"ending in a newline. The list contains the exception's message, which is " +"normally a single string; however, for :exc:`SyntaxError` exceptions, it " +"contains several lines that (when printed) display detailed information " +"about where the syntax error occurred. Following the message, the list " +"contains the exception's :attr:`notes `." msgstr "" #: ../../library/traceback.rst:148 @@ -197,7 +197,11 @@ msgid "" "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:159 +#: ../../library/traceback.rst:156 +msgid "The returned list now includes any notes attached to the exception." +msgstr "" + +#: ../../library/traceback.rst:162 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +210,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:168 +#: ../../library/traceback.rst:171 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:178 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:181 +#: ../../library/traceback.rst:184 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:186 +#: ../../library/traceback.rst:189 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:190 +#: ../../library/traceback.rst:193 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:197 +#: ../../library/traceback.rst:200 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:205 +#: ../../library/traceback.rst:208 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:210 +#: ../../library/traceback.rst:213 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:213 +#: ../../library/traceback.rst:216 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:217 +#: ../../library/traceback.rst:220 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:222 ../../library/traceback.rst:310 +#: ../../library/traceback.rst:225 ../../library/traceback.rst:319 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:228 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,12 +277,12 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:230 ../../library/traceback.rst:313 +#: ../../library/traceback.rst:233 ../../library/traceback.rst:322 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:232 +#: ../../library/traceback.rst:235 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -287,140 +291,139 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:241 +msgid "Added the *compact* parameter." +msgstr "新增 *compact* 參數。" + +#: ../../library/traceback.rst:244 +msgid "Added the *max_group_width* and *max_group_depth* parameters." +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" + +#: ../../library/traceback.rst:249 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:253 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:257 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:265 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:269 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:277 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:281 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:285 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:289 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:293 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:300 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:295 +#: ../../library/traceback.rst:304 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:299 +#: ../../library/traceback.rst:308 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:306 +#: ../../library/traceback.rst:315 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:317 +#: ../../library/traceback.rst:326 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:333 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:326 +#: ../../library/traceback.rst:335 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:338 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:333 ../../library/traceback.rst:347 -msgid "" -"The message indicating which exception occurred is always the last string in " -"the output." -msgstr "" - -#: ../../library/traceback.rst:338 +#: ../../library/traceback.rst:344 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:346 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:342 +#: ../../library/traceback.rst:348 msgid "" -"Normally, the generator emits a single string; however, for :exc:" -"`SyntaxError` exceptions, it emits several lines that (when printed) display " -"detailed information about where the syntax error occurred." +"The generator emits the exception's message followed by its notes (if it has " +"any). The exception message is normally a single string; however, for :exc:" +"`SyntaxError` exceptions, it consists of several lines that (when printed) " +"display detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:350 -msgid "Added the *compact* parameter." -msgstr "新增 *compact* 參數。" - -#: ../../library/traceback.rst:353 -msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" +#: ../../library/traceback.rst:354 +msgid "The exception's notes are now included in the output." +msgstr "" -#: ../../library/traceback.rst:358 +#: ../../library/traceback.rst:360 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:362 +#: ../../library/traceback.rst:364 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:370 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:372 +#: ../../library/traceback.rst:374 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -430,20 +433,20 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:382 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:388 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:392 +#: ../../library/traceback.rst:394 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -451,18 +454,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:397 +#: ../../library/traceback.rst:399 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:401 +#: ../../library/traceback.rst:403 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:406 +#: ../../library/traceback.rst:408 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -470,16 +473,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:415 +#: ../../library/traceback.rst:417 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:421 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:423 +#: ../../library/traceback.rst:425 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -492,11 +495,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:436 +#: ../../library/traceback.rst:438 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:438 +#: ../../library/traceback.rst:440 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -504,23 +507,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:460 +#: ../../library/traceback.rst:462 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:495 +#: ../../library/traceback.rst:497 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:539 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:563 +#: ../../library/traceback.rst:565 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/library/turtle.po b/library/turtle.po index 6cba6b1450..718deff5da 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2023-09-15 00:03+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-" @@ -2117,7 +2117,7 @@ msgstr "" #: ../../library/turtle.rst:2332 msgid "" -"a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" +"a :class:`!tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" @@ -2134,7 +2134,7 @@ msgid "" msgstr "" #: ../../library/turtle.rst:2347 -msgid "a :class:`tkinter.Canvas`" +msgid "a :class:`!tkinter.Canvas`" msgstr "" #: ../../library/turtle.rst:2349 @@ -2280,7 +2280,7 @@ msgstr "" msgid "" "``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " "automatically create a drawing surface - a *canvas* will need to be provided " -"or created for it. The *canvas* can be a :class:`tkinter.Canvas`, :class:" +"or created for it. The *canvas* can be a :class:`!tkinter.Canvas`, :class:" "`ScrolledCanvas` or :class:`TurtleScreen`." msgstr "" @@ -2290,7 +2290,7 @@ msgid "" "`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " "additional methods ` for managing its appearance (including " "size and title) and behaviour. ``TurtleScreen``'s constructor needs a :class:" -"`tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." +"`!tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." msgstr "" #: ../../library/turtle.rst:2442 diff --git a/library/typing.po b/library/typing.po index 3d666e2c27..5a8c520a50 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:19+0000\n" +"POT-Creation-Date: 2023-09-11 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgid "" "specification of the typing system, see :pep:`484`. For a simplified " "introduction to type hints, see :pep:`483`." msgstr "" -"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格" -",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" +"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格,請看 :" +"pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" #: ../../library/typing.rst:31 msgid "" @@ -103,8 +103,8 @@ msgid "" "broadly apply to most Python type checkers. (Some parts may still be " "specific to mypy.)" msgstr "" -"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) " -"應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" +"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) 應該在" +"多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" #: ../../library/typing.rst:59 msgid "" @@ -437,11 +437,11 @@ msgid "" "Python 3.9." msgstr "" -#: ../../library/typing.rst:249 -msgid "Callable" +#: ../../library/typing.rst:264 +msgid "Annotating callable objects" msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:266 msgid "" "Functions -- or other :term:`callable` objects -- can be annotated using :" "class:`collections.abc.Callable` or :data:`typing.Callable`. " @@ -449,11 +449,12 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2679 +#: ../../library/typing.rst:271 ../../library/typing.rst:2873 +#: ../../library/typing.rst:3015 msgid "For example:" msgstr "舉例來說:" -#: ../../library/typing.rst:272 ../../library/typing.rst:995 +#: ../../library/typing.rst:289 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 " @@ -461,7 +462,22 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:1008 +#: ../../library/typing.rst:294 +msgid "" +"If a literal ellipsis ``...`` is given as the argument list, it indicates " +"that a callable with any arbitrary parameter list would be acceptable:" +msgstr "" + +#: ../../library/typing.rst:306 +msgid "" +"``Callable`` cannot express complex signatures such as functions that take a " +"variadic number of arguments, :func:`overloaded functions `, or " +"functions that have keyword-only parameters. However, these signatures can " +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" +msgstr "" + +#: ../../library/typing.rst:333 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -472,46 +488,54 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:1020 +#: ../../library/typing.rst:341 ../../library/typing.rst:3544 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:346 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:295 +#: ../../library/typing.rst:352 msgid "Generics" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:354 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:371 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:379 +msgid "Or by using the :class:`TypeVar` factory directly::" +msgstr "" + +#: ../../library/typing.rst:389 +msgid "Syntactic support for generics is new in Python 3.12." +msgstr "" + +#: ../../library/typing.rst:395 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:397 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:347 +#: ../../library/typing.rst:412 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -519,7 +543,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:418 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -527,7 +551,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:369 +#: ../../library/typing.rst:434 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -535,11 +559,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:392 +#: ../../library/typing.rst:457 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:459 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -547,85 +571,104 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:469 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:485 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:432 +#: ../../library/typing.rst:497 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:438 +#: ../../library/typing.rst:503 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:505 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " "single :class:`type variable ` ``T`` . This also makes ``T`` valid " "as a type within the class body." msgstr "" -#: ../../library/typing.rst:470 +#: ../../library/typing.rst:532 msgid "" "Generic classes implicitly inherit from :class:`Generic`. For compatibility " "with Python 3.11 and lower, it is also possible to inherit explicitly from :" "class:`Generic` to indicate a generic class::" msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:543 +msgid "" +"Generic classes have :meth:`~object.__class_getitem__` methods, meaning they " +"can be parameterised at runtime (e.g. ``LoggedVar[int]`` below)::" +msgstr "" + +#: ../../library/typing.rst:552 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:491 +#: ../../library/typing.rst:567 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:502 -msgid "You can use multiple inheritance with :class:`Generic`::" +#: ../../library/typing.rst:581 +msgid "Generic classes can also inherit from other classes::" msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:588 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:595 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:524 +#: ../../library/typing.rst:597 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:535 +#: ../../library/typing.rst:608 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:623 +msgid "" +"For backward compatibility, generic type aliases can also be created through " +"a simple assignment::" +msgstr "為了向後相容性,泛型型別別名可以透過簡單的賦值來建立: ::" + +#: ../../library/typing.rst:632 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:635 +msgid "" +"Syntactic support for generics and type aliases is new in version 3.12. " +"Previously, generic classes had to explicitly inherit from :class:`Generic` " +"or contain a type variable in one of their bases." +msgstr "" + +#: ../../library/typing.rst:640 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``[**P]``. The behavior is " @@ -635,26 +678,35 @@ msgid "" "a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:651 msgid "" "Classes generic over a :class:`ParamSpec` can also be created using explicit " "inheritance from :class:`Generic`. In this case, ``**`` is not used::" msgstr "" -#: ../../library/typing.rst:583 +#: ../../library/typing.rst:661 +msgid "" +"Another difference between :class:`TypeVar` and :class:`ParamSpec` is that 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, so the following are equivalent::" +msgstr "" + +#: ../../library/typing.rst:674 msgid "" "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:587 +#: ../../library/typing.rst:678 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:682 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -662,24 +714,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:689 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:691 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:604 +#: ../../library/typing.rst:695 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:622 +#: ../../library/typing.rst:713 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -688,19 +740,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:719 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:732 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:644 +#: ../../library/typing.rst:735 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, " @@ -708,7 +760,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:740 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 " @@ -716,24 +768,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:762 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:676 +#: ../../library/typing.rst:767 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:769 msgid "" "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:682 +#: ../../library/typing.rst:773 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -742,7 +794,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:786 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 " @@ -751,85 +803,92 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:711 +#: ../../library/typing.rst:802 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:716 +#: ../../library/typing.rst:807 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:809 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:812 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:815 msgid "Special types" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:817 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:822 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:824 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:825 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:736 +#: ../../library/typing.rst:827 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:743 +#: ../../library/typing.rst:834 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:836 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:749 +#: ../../library/typing.rst:840 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:752 ../../library/typing.rst:828 -#: ../../library/typing.rst:848 ../../library/typing.rst:894 -#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 -#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 +#: ../../library/typing.rst:843 ../../library/typing.rst:934 +#: ../../library/typing.rst:954 ../../library/typing.rst:1011 +#: ../../library/typing.rst:1180 ../../library/typing.rst:1237 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2813 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:852 +msgid "" +"Note that, despite its name, ``AnyStr`` has nothing to do with the :class:" +"`Any` type, nor does it mean \"any string\". In particular, ``AnyStr`` and " +"``str | bytes`` are different from each other and have different use cases::" +msgstr "" + +#: ../../library/typing.rst:869 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:871 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -837,14 +896,14 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:877 ../../library/typing.rst:1957 msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:893 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -852,33 +911,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:898 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:904 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:907 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:821 +#: ../../library/typing.rst:927 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:826 +#: ../../library/typing.rst:932 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:941 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -886,126 +945,142 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:952 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:968 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:870 -msgid "In general if something currently follows the pattern of::" -msgstr "" - -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:980 msgid "" -"You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " -"have ``Foo`` as the return type and not ``SubclassOfFoo``." +"In general, if something returns ``self``, as in the above examples, you " +"should use ``Self`` as the return annotation. If ``Foo.return_self`` was " +"annotated as returning ``\"Foo\"``, then the type checker would infer the " +"object returned from ``SubclassOfFoo.return_self`` as being of type ``Foo`` " +"rather than ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:986 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:988 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:990 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:992 +msgid "" +"You should not use ``Self`` as the return annotation if the method is not " +"guaranteed to return an instance of a subclass when the class is subclassed::" +msgstr "" + +#: ../../library/typing.rst:1003 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:1009 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:1017 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:1037 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:1041 +msgid "" +":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " +"which creates instances of :class:`TypeAliasType` and which natively " +"supports forward references. Note that while :data:`TypeAlias` and :class:" +"`TypeAliasType` serve similar purposes and have similar names, they are " +"distinct and the latter is not the type of the former. Removal of :data:" +"`TypeAlias` is not currently planned, but users are encouraged to migrate " +"to :keyword:`type` statements." +msgstr "" + +#: ../../library/typing.rst:1052 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:1054 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:932 +#: ../../library/typing.rst:1059 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:934 +#: ../../library/typing.rst:1061 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:936 +#: ../../library/typing.rst:1063 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:1065 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:1069 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:1073 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:1077 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:1081 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:1083 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:958 +#: ../../library/typing.rst:1085 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:1088 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:967 +#: ../../library/typing.rst:1094 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1096 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 " @@ -1013,56 +1088,24 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:1104 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:984 +#: ../../library/typing.rst:1111 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:990 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:992 -msgid "" -"``Callable[[int], str]`` signifies a function that takes a single parameter " -"of type :class:`int` and returns a :class:`str`." -msgstr "" - -#: ../../library/typing.rst:1000 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." -msgstr "" - -#: ../../library/typing.rst:1016 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1025 -msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " -"examples of usage with ``Callable``." -msgstr "" - -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1117 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1119 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -1073,7 +1116,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1128 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1084,34 +1127,38 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1082 -msgid ":class:`ParamSpec` and :class:`Callable`." -msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" +#: ../../library/typing.rst:1169 +msgid ":class:`ParamSpec`" +msgstr ":class:`ParamSpec`。" + +#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +msgid ":ref:`annotating-callables`" +msgstr ":ref:`annotating-callables`" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1174 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1176 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1192 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:1110 +#: ../../library/typing.rst:1198 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1119,22 +1166,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1118 +#: ../../library/typing.rst:1206 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1208 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:1128 +#: ../../library/typing.rst:1216 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1218 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 " @@ -1142,27 +1189,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1144 +#: ../../library/typing.rst:1232 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1234 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1255 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1257 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1170,21 +1217,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1264 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1267 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1273 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1275 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1192,7 +1239,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1280 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1201,7 +1248,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1198 +#: ../../library/typing.rst:1286 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1211,7 +1258,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1293 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1219,108 +1266,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1301 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1226 +#: ../../library/typing.rst:1314 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1316 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1318 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1327 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1331 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1334 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1341 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1348 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1354 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1368 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1372 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1376 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1379 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1392 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1406 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1407 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1325 +#: ../../library/typing.rst:1414 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1416 msgid "" "``TypeGuard`` can be 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:1331 +#: ../../library/typing.rst:1420 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 " @@ -1329,44 +1376,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1435 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:1350 +#: ../../library/typing.rst:1439 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1442 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1443 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1460 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:1375 +#: ../../library/typing.rst:1464 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:1381 +#: ../../library/typing.rst:1470 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]`` " @@ -1375,24 +1422,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1476 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1483 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1485 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1494 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1400,42 +1447,92 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1422 -msgid "Building generic types" +#: ../../library/typing.rst:1508 +msgid "" +"``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " +"``**kwargs`` in a function signature::" +msgstr "" + +#: ../../library/typing.rst:1521 +msgid "" +"See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." +msgstr "" + +#: ../../library/typing.rst:1526 +msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1528 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1532 +msgid "" +"These objects can be created through special syntax (:ref:`type parameter " +"lists ` and the :keyword:`type` statement). For compatibility " +"with Python 3.11 and earlier, they can also be created without the dedicated " +"syntax, as documented below." +msgstr "" + +#: ../../library/typing.rst:1539 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1541 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1441 +#: ../../library/typing.rst:1549 +msgid "" +"Such a class implicitly inherits from ``Generic``. The runtime semantics of " +"this syntax are discussed in the :ref:`Language Reference `." +msgstr "" + +#: ../../library/typing.rst:1553 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1454 +#: ../../library/typing.rst:1561 +msgid "" +"Here the brackets after the function name indicate a :ref:`generic function " +"`." +msgstr "" + +#: ../../library/typing.rst:1564 +msgid "" +"For backwards compatibility, generic classes can also be declared by " +"explicitly inheriting from ``Generic``. In this case, the type parameters " +"must be declared separately::" +msgstr "" + +#: ../../library/typing.rst:1579 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 -#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 -#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 -msgid "Usage::" +#: ../../library/typing.rst:1581 +msgid "" +"The preferred way to construct a type variable is via the dedicated syntax " +"for :ref:`generic functions `, :ref:`generic classes " +"`, and :ref:`generic type aliases `::" +msgstr "" + +#: ../../library/typing.rst:1589 +msgid "" +"This syntax can also be used to create bound and constrained type variables::" +msgstr "" + +#: ../../library/typing.rst:1599 +msgid "" +"However, if desired, reusable type variables can also be constructed " +"manually, like so::" msgstr "" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1605 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 " @@ -1443,13 +1540,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1626 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1629 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1459,56 +1556,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1637 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1652 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1664 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1675 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1679 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1532 -msgid "Whether the type var has been marked as covariant." +#: ../../library/typing.rst:1683 +msgid "Whether the type var has been explicitly marked as covariant." +msgstr "" + +#: ../../library/typing.rst:1687 +msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1536 -msgid "Whether the type var has been marked as contravariant." +#: ../../library/typing.rst:1691 +msgid "" +"Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1697 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1701 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " +"when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1707 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1711 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " +"not when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1717 +msgid "" +"Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " +"was added." +msgstr "" + +#: ../../library/typing.rst:1723 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1559 +#: ../../library/typing.rst:1726 +msgid "" +"Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" +msgstr "" + +#: ../../library/typing.rst:1732 +msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" +msgstr "" + +#: ../../library/typing.rst:1740 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1516,7 +1649,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1762 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1526,36 +1659,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1770 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1777 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1785 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1801 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1808 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1818 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1564,21 +1697,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1825 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1829 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1835 +msgid "" +"Type variable tuples can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1840 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1843 +msgid "" +"In :ref:`type parameter lists `, parameter specifications can " +"be declared with two asterisks (``**``)::" +msgstr "" + +#: ../../library/typing.rst:1848 +msgid "" +"For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " +"also be created as follows::" +msgstr "" + +#: ../../library/typing.rst:1853 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1588,7 +1739,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1860 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 " @@ -1596,27 +1747,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1880 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:1700 +#: ../../library/typing.rst:1884 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:1702 +#: ../../library/typing.rst:1886 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:1709 +#: ../../library/typing.rst:1893 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1629,11 +1780,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1905 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1907 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1642,17 +1793,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1917 +msgid "" +"Parameter specifications can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1921 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1738 -msgid ":class:`Callable` and :class:`Concatenate`." -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +#: ../../library/typing.rst:1927 +msgid ":data:`Concatenate`" +msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1933 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1660,45 +1817,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1938 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1955 +msgid "The type of type aliases created through the :keyword:`type` statement." +msgstr "" + +#: ../../library/typing.rst:1969 +msgid "The name of the type alias:" +msgstr "" + +#: ../../library/typing.rst:1979 +msgid "The module in which the type alias was defined::" +msgstr "" + +#: ../../library/typing.rst:1987 +msgid "" +"The type parameters of the type alias, or an empty tuple if the alias is not " +"generic:" +msgstr "" + +#: ../../library/typing.rst:2001 +msgid "" +"The type alias's value. This is :ref:`lazily evaluated `, " +"so names used in the definition of the alias are not resolved until the " +"``__value__`` attribute is accessed:" +msgstr "" + +#: ../../library/typing.rst:2019 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:2021 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:2027 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 +#: ../../library/typing.rst:3055 +msgid "Usage::" +msgstr "" + +#: ../../library/typing.rst:2035 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:2039 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:2048 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:2050 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 " @@ -1707,83 +1894,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:2056 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:2066 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:2072 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:2082 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:2085 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:2088 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:2092 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:2096 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:2101 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:2103 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:2113 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:2117 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:2121 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:2125 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:2130 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:2132 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:2138 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:2150 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1791,15 +1978,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:2155 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:2161 +msgid "" +"In code that needs to be compatible with Python 3.11 or older, generic " +"Protocols can be written as follows::" +msgstr "" + +#: ../../library/typing.rst:2174 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:2176 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 " @@ -1808,7 +2001,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:2196 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1819,7 +2012,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:2207 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1827,13 +2020,32 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:2215 +msgid "" +"The internal implementation of :func:`isinstance` checks against runtime-" +"checkable protocols now uses :func:`inspect.getattr_static` to look up " +"attributes (previously, :func:`hasattr` was used). As a result, some objects " +"which used to be considered instances of a runtime-checkable protocol may no " +"longer be considered instances of that protocol on Python 3.12+, and vice " +"versa. Most users are unlikely to be affected by this change." +msgstr "" + +#: ../../library/typing.rst:2224 +msgid "" +"The members of a runtime-checkable protocol are now considered \"frozen\" at " +"runtime as soon as the class has been created. Monkey-patching attributes " +"onto a runtime-checkable protocol will still work, but will have no impact " +"on :func:`isinstance` checks comparing objects to the protocol. See :ref:" +"`\"What's new in Python 3.12\" ` for more details." +msgstr "" + +#: ../../library/typing.rst:2235 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:2238 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 " @@ -1841,53 +2053,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2254 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:1973 +#: ../../library/typing.rst:2258 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:2262 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:2269 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2270 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::" msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2282 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2293 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2296 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2306 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 " @@ -1895,61 +2107,67 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2311 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2326 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:2048 +#: ../../library/typing.rst:2333 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2341 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2074 -msgid "A ``TypedDict`` can be generic:" +#: ../../library/typing.rst:2356 +msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2362 +msgid "" +"To create a generic ``TypedDict`` that is compatible with Python 3.11 or " +"lower, inherit from :class:`Generic` explicitly:" +msgstr "" + +#: ../../library/typing.rst:2373 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:2090 +#: ../../library/typing.rst:2379 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2401 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2404 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2407 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1958,133 +2176,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2430 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2434 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2438 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2442 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2444 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2449 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2454 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2458 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2462 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2466 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2472 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2476 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2480 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2486 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:2203 +#: ../../library/typing.rst:2492 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2496 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2498 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:2216 +#: ../../library/typing.rst:2505 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2507 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2510 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2517 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2531 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2533 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2544 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2549 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2094,59 +2312,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2557 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2560 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2568 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2570 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2576 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2579 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2584 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2589 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2601 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2604 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2155,19 +2373,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2611 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2625 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2634 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2645 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2783 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2372,32 +2603,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2790 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2798 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2800 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2807 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2809 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2540 +#: ../../library/typing.rst:2834 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2407,11 +2638,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2845 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2847 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2419,48 +2650,79 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2853 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2857 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2859 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2865 +msgid "" +"Decorator to indicate that a method in a subclass is intended to override a " +"method or attribute in a superclass." +msgstr "" + +#: ../../library/typing.rst:2868 +msgid "" +"Type checkers should emit an error if a method decorated with ``@override`` " +"does not, in fact, override anything. This helps prevent bugs that may occur " +"when a base class is changed without an equivalent change to a child class." +msgstr "" + +#: ../../library/typing.rst:2890 +msgid "There is no runtime checking of this property." +msgstr "" + +#: ../../library/typing.rst:2892 +msgid "" +"The decorator will attempt to set an ``__override__`` attribute to ``True`` " +"on the decorated object. Thus, a check like ``if getattr(obj, " +"\"__override__\", False)`` can be used at runtime to determine whether an " +"object ``obj`` has been marked as an override. If the decorated object does " +"not support setting attributes, the decorator returns the object unchanged " +"without raising an exception." +msgstr "" + +#: ../../library/typing.rst:2899 +msgid "See :pep:`698` for more details." +msgstr "更多細節請見 :pep:`698`。" + +#: ../../library/typing.rst:2906 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2908 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:2583 +#: ../../library/typing.rst:2919 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2923 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2927 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2930 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2469,21 +2731,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2936 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:2617 +#: ../../library/typing.rst:2953 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:2622 +#: ../../library/typing.rst:2958 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2491,20 +2753,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2962 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2633 +#: ../../library/typing.rst:2969 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2972 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2512,17 +2774,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 +#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2993 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2996 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2530,40 +2792,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:3013 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:3034 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:3036 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:3041 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:2712 +#: ../../library/typing.rst:3048 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:3052 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2727 +#: ../../library/typing.rst:3063 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2571,7 +2833,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:3070 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2579,11 +2841,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:3082 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:3084 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2592,7 +2854,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:3091 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2600,7 +2862,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:3096 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2608,176 +2870,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:2765 -msgid "Aliases to built-in types" +#: ../../library/typing.rst:3101 +msgid "" +"Type checkers are encouraged to flag uses of the deprecated types if the " +"program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:3107 +msgid "Aliases to built-in types" +msgstr "內建型別的別名" + +#: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`dict`." -msgstr "" +msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:3113 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 +#: ../../library/typing.rst:3117 ../../library/typing.rst:3359 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:3122 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:3128 msgid "Deprecated alias to :class:`list`." -msgstr "" +msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:3130 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:3134 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:3142 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:3148 msgid "Deprecated alias to :class:`builtins.set `." -msgstr "" +msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:3150 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:3154 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`builtins.frozenset `." -msgstr "" +msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:3162 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:3169 msgid "Deprecated alias for :class:`tuple`." -msgstr "" +msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:3171 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:3174 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:3180 msgid "Deprecated alias to :class:`type`." -msgstr "" +msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:3182 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:3187 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:3194 msgid "Aliases to types in :mod:`collections`" -msgstr "" +msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:3198 msgid "Deprecated alias to :class:`collections.defaultdict`." -msgstr "" +msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:3202 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:3208 msgid "Deprecated alias to :class:`collections.OrderedDict`." -msgstr "" +msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:3212 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:3218 msgid "Deprecated alias to :class:`collections.ChainMap`." -msgstr "" +msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.Counter`." -msgstr "" +msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:3234 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:3240 msgid "Deprecated alias to :class:`collections.deque`." -msgstr "" +msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:3245 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:3252 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:3257 +msgid "" +"The ``typing.io`` namespace is deprecated and will be removed. These types " +"should be directly imported from ``typing`` instead." +msgstr "" + +#: ../../library/typing.rst:3261 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:3264 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2785,367 +3059,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:3273 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:3279 msgid "Deprecated alias for :class:`str`." -msgstr "" +msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:3281 msgid "" "``Text`` 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:2941 +#: ../../library/typing.rst:3285 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:2949 +#: ../../library/typing.rst:3293 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3303 msgid "Aliases to container ABCs in :mod:`collections.abc`" -msgstr "" +msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:3307 msgid "Deprecated alias to :class:`collections.abc.Set`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:3309 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:3315 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:3319 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:3323 msgid "Deprecated alias to :class:`collections.abc.Collection`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:3327 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:3333 msgid "Deprecated alias to :class:`collections.abc.Container`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:3335 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3341 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3343 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3349 msgid "Deprecated alias to :class:`collections.abc.KeysView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3351 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3357 msgid "Deprecated alias to :class:`collections.abc.Mapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.MappingView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3380 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3387 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3389 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3396 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3398 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3404 msgid "Deprecated alias to :class:`collections.abc.Sequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3406 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3412 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3414 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3077 +#: ../../library/typing.rst:3421 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3427 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3438 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 +#: ../../library/typing.rst:3444 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3446 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3455 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:3115 +#: ../../library/typing.rst:3459 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3467 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3477 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3484 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3488 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3494 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3504 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3164 +#: ../../library/typing.rst:3508 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3515 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Iterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3521 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3527 msgid "Deprecated alias to :class:`collections.abc.Iterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3191 -msgid "Deprecated alias to :class:`collections.abc.Generator`." +#: ../../library/typing.rst:3535 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "棄用 :class:`collections.abc.Callable` 的別名。" + +#: ../../library/typing.rst:3537 +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3540 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3550 +msgid "Deprecated alias to :class:`collections.abc.Generator`." +msgstr "棄用 :class:`collections.abc.Generator` 的別名。" + +#: ../../library/typing.rst:3552 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3561 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:3206 +#: ../../library/typing.rst:3565 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3573 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3581 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3228 -msgid "Alias to :class:`collections.abc.Hashable`." -msgstr "" +#: ../../library/typing.rst:3587 +msgid "Deprecated alias to :class:`collections.abc.Hashable`." +msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" + +#: ../../library/typing.rst:3589 +msgid "Use :class:`collections.abc.Hashable` directly instead." +msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3232 +#: ../../library/typing.rst:3594 msgid "Deprecated alias to :class:`collections.abc.Reversible`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 -msgid "Alias to :class:`collections.abc.Sized`." -msgstr "" +#: ../../library/typing.rst:3602 +msgid "Deprecated alias to :class:`collections.abc.Sized`." +msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3604 +msgid "Use :class:`collections.abc.Sized` directly instead." +msgstr "改為直接使用 :class:`collections.abc.Sized`。" + +#: ../../library/typing.rst:3610 msgid "Aliases to :mod:`contextlib` ABCs" -msgstr "" +msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3614 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3619 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3626 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3631 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3637 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3639 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3153,74 +3451,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3646 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3647 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3648 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3649 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3650 msgid "``typing.io`` and ``typing.re`` submodules" -msgstr "" +msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3651 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3652 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3653 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3654 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 +#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 -msgid "Undecided" +#: ../../library/typing.rst:3656 +msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3657 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3287 -msgid "``typing.ByteString``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3658 +msgid ":class:`typing.ByteString`" +msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3660 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3661 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3289 -msgid "``typing.Text``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3662 +msgid ":data:`typing.Text`" +msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3663 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 +#: ../../library/typing.rst:3672 +msgid "Undecided" +msgstr "" + +#: ../../library/typing.rst:3665 msgid ":gh:`92332`" msgstr ":gh:`92332`" + +#: ../../library/typing.rst:3666 +msgid ":class:`typing.Hashable` and :class:`typing.Sized`" +msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" + +#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +msgid "3.12" +msgstr "" + +#: ../../library/typing.rst:3669 +msgid ":gh:`94309`" +msgstr ":gh:`94309`" + +#: ../../library/typing.rst:3670 +msgid ":data:`typing.TypeAlias`" +msgstr ":data:`typing.TypeAlias`" + +#: ../../library/typing.rst:3673 +msgid ":pep:`695`" +msgstr ":pep:`695`" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 926c4d8e5e..badb5f9e01 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -310,18 +310,29 @@ msgid "" "*spec_set* instead of *spec*." msgstr "" -#: ../../library/unittest.mock-examples.rst:365 +#: ../../library/unittest.mock-examples.rst:364 +msgid "Using side_effect to return per file content" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:366 +msgid "" +":func:`mock_open` is used to patch :func:`open` method. :attr:`~Mock." +"side_effect` can be used to return a new Mock object per call. This can be " +"used to return different contents per file stored in a dictionary::" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:389 msgid "Patch Decorators" msgstr "" -#: ../../library/unittest.mock-examples.rst:369 +#: ../../library/unittest.mock-examples.rst:393 msgid "" "With :func:`patch` it matters that you patch objects in the namespace where " "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:374 +#: ../../library/unittest.mock-examples.rst:398 msgid "" "A common need in tests is to patch a class attribute or a module attribute, " "for example patching a builtin or patching a class in a module to test that " @@ -330,7 +341,7 @@ msgid "" "tests and cause hard to diagnose problems." msgstr "" -#: ../../library/unittest.mock-examples.rst:380 +#: ../../library/unittest.mock-examples.rst:404 msgid "" "mock provides three convenient decorators for this: :func:`patch`, :func:" "`patch.object` and :func:`patch.dict`. ``patch`` takes a single string, of " @@ -341,37 +352,37 @@ msgid "" "to patch it with." msgstr "" -#: ../../library/unittest.mock-examples.rst:388 +#: ../../library/unittest.mock-examples.rst:412 msgid "``patch.object``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:405 +#: ../../library/unittest.mock-examples.rst:429 msgid "" "If you are patching a module (including :mod:`builtins`) then use :func:" "`patch` instead of :func:`patch.object`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:415 +#: ../../library/unittest.mock-examples.rst:439 msgid "" "The module name can be 'dotted', in the form ``package.module`` if needed::" msgstr "" -#: ../../library/unittest.mock-examples.rst:424 +#: ../../library/unittest.mock-examples.rst:448 msgid "A nice pattern is to actually decorate test methods themselves:" msgstr "" -#: ../../library/unittest.mock-examples.rst:435 +#: ../../library/unittest.mock-examples.rst:459 msgid "" "If you want to patch with a Mock, you can use :func:`patch` with only one " "argument (or :func:`patch.object` with two arguments). The mock will be " "created for you and passed into the test function / method:" msgstr "" -#: ../../library/unittest.mock-examples.rst:447 +#: ../../library/unittest.mock-examples.rst:471 msgid "You can stack up multiple patch decorators using this pattern::" msgstr "" -#: ../../library/unittest.mock-examples.rst:458 +#: ../../library/unittest.mock-examples.rst:482 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " @@ -379,45 +390,45 @@ msgid "" "above the mock for ``test_module.ClassName2`` is passed in first." msgstr "" -#: ../../library/unittest.mock-examples.rst:463 +#: ../../library/unittest.mock-examples.rst:487 msgid "" "There is also :func:`patch.dict` for setting values in a dictionary just " "during a scope and restoring the dictionary to its original state when the " "test ends:" msgstr "" -#: ../../library/unittest.mock-examples.rst:474 +#: ../../library/unittest.mock-examples.rst:498 msgid "" "``patch``, ``patch.object`` and ``patch.dict`` can all be used as context " "managers." msgstr "" -#: ../../library/unittest.mock-examples.rst:476 +#: ../../library/unittest.mock-examples.rst:500 msgid "" "Where you use :func:`patch` to create a mock for you, you can get a " "reference to the mock using the \"as\" form of the with statement:" msgstr "" -#: ../../library/unittest.mock-examples.rst:491 +#: ../../library/unittest.mock-examples.rst:515 msgid "" "As an alternative ``patch``, ``patch.object`` and ``patch.dict`` can be used " "as class decorators. When used in this way it is the same as applying the " "decorator individually to every method whose name starts with \"test\"." msgstr "" -#: ../../library/unittest.mock-examples.rst:499 +#: ../../library/unittest.mock-examples.rst:523 msgid "Further Examples" msgstr "" -#: ../../library/unittest.mock-examples.rst:502 +#: ../../library/unittest.mock-examples.rst:526 msgid "Here are some more examples for some slightly more advanced scenarios." msgstr "" -#: ../../library/unittest.mock-examples.rst:506 +#: ../../library/unittest.mock-examples.rst:530 msgid "Mocking chained calls" msgstr "" -#: ../../library/unittest.mock-examples.rst:508 +#: ../../library/unittest.mock-examples.rst:532 msgid "" "Mocking chained calls is actually straightforward with mock once you " "understand the :attr:`~Mock.return_value` attribute. When a mock is called " @@ -425,31 +436,31 @@ msgid "" "called, a new :class:`Mock` is created." msgstr "" -#: ../../library/unittest.mock-examples.rst:513 +#: ../../library/unittest.mock-examples.rst:537 msgid "" "This means that you can see how the object returned from a call to a mocked " "object has been used by interrogating the ``return_value`` mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:521 +#: ../../library/unittest.mock-examples.rst:545 msgid "" "From here it is a simple step to configure and then make assertions about " "chained calls. Of course another alternative is writing your code in a more " "testable way in the first place..." msgstr "" -#: ../../library/unittest.mock-examples.rst:525 +#: ../../library/unittest.mock-examples.rst:549 msgid "So, suppose we have some code that looks a little bit like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:534 +#: ../../library/unittest.mock-examples.rst:558 msgid "" "Assuming that ``BackendProvider`` is already well tested, how do we test " "``method()``? Specifically, we want to test that the code section ``# more " "code`` uses the response object in the correct way." msgstr "" -#: ../../library/unittest.mock-examples.rst:538 +#: ../../library/unittest.mock-examples.rst:562 msgid "" "As this chain of calls is made from an instance attribute we can monkey " "patch the ``backend`` attribute on a ``Something`` instance. In this " @@ -459,26 +470,26 @@ msgid "" "response object uses the builtin :func:`open` as its ``spec``." msgstr "" -#: ../../library/unittest.mock-examples.rst:545 +#: ../../library/unittest.mock-examples.rst:569 msgid "" "To do this we create a mock instance as our mock backend and create a mock " "response object for it. To set the response as the return value for that " "final ``start_call`` we could do this::" msgstr "" -#: ../../library/unittest.mock-examples.rst:551 +#: ../../library/unittest.mock-examples.rst:575 msgid "" "We can do that in a slightly nicer way using the :meth:`~Mock." "configure_mock` method to directly set the return value for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:560 +#: ../../library/unittest.mock-examples.rst:584 msgid "" "With these we monkey patch the \"mock backend\" in place and can make the " "real call::" msgstr "" -#: ../../library/unittest.mock-examples.rst:566 +#: ../../library/unittest.mock-examples.rst:590 msgid "" "Using :attr:`~Mock.mock_calls` we can check the chained call with a single " "assert. A chained call is several calls in one line of code, so there will " @@ -486,42 +497,42 @@ msgid "" "create this list of calls for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:577 +#: ../../library/unittest.mock-examples.rst:601 msgid "Partial mocking" msgstr "" -#: ../../library/unittest.mock-examples.rst:579 +#: ../../library/unittest.mock-examples.rst:603 msgid "" "In some tests I wanted to mock out a call to :meth:`datetime.date.today` to " "return a known date, but I didn't want to prevent the code under test from " "creating new date objects. Unfortunately :class:`datetime.date` is written " -"in C, and so I couldn't just monkey-patch out the static :meth:`date.today` " -"method." +"in C, and so I couldn't just monkey-patch out the static :meth:`datetime." +"date.today` method." msgstr "" -#: ../../library/unittest.mock-examples.rst:584 +#: ../../library/unittest.mock-examples.rst:608 msgid "" "I found a simple way of doing this that involved effectively wrapping the " "date class with a mock, but passing through calls to the constructor to the " "real class (and returning real instances)." msgstr "" -#: ../../library/unittest.mock-examples.rst:588 +#: ../../library/unittest.mock-examples.rst:612 msgid "" "The :func:`patch decorator ` is used here to mock out the ``date`` " -"class in the module under test. The :attr:`side_effect` attribute on the " -"mock date class is then set to a lambda function that returns a real date. " -"When the mock date class is called a real date will be constructed and " +"class in the module under test. The :attr:`~Mock.side_effect` attribute on " +"the mock date class is then set to a lambda function that returns a real " +"date. When the mock date class is called a real date will be constructed and " "returned by ``side_effect``. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:602 +#: ../../library/unittest.mock-examples.rst:626 msgid "" "Note that we don't patch :class:`datetime.date` globally, we patch ``date`` " "in the module that *uses* it. See :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:605 +#: ../../library/unittest.mock-examples.rst:629 msgid "" "When ``date.today()`` is called a known date is returned, but calls to the " "``date(...)`` constructor still return normal dates. Without this you can " @@ -529,30 +540,30 @@ msgid "" "algorithm as the code under test, which is a classic testing anti-pattern." msgstr "" -#: ../../library/unittest.mock-examples.rst:610 +#: ../../library/unittest.mock-examples.rst:634 msgid "" "Calls to the date constructor are recorded in the ``mock_date`` attributes " "(``call_count`` and friends) which may also be useful for your tests." msgstr "" -#: ../../library/unittest.mock-examples.rst:613 +#: ../../library/unittest.mock-examples.rst:637 msgid "" "An alternative way of dealing with mocking dates, or other builtin classes, " "is discussed in `this blog entry `_." msgstr "" -#: ../../library/unittest.mock-examples.rst:619 +#: ../../library/unittest.mock-examples.rst:643 msgid "Mocking a Generator Method" msgstr "" -#: ../../library/unittest.mock-examples.rst:621 +#: ../../library/unittest.mock-examples.rst:645 msgid "" "A Python generator is a function or method that uses the :keyword:`yield` " "statement to return a series of values when iterated over [#]_." msgstr "" -#: ../../library/unittest.mock-examples.rst:624 +#: ../../library/unittest.mock-examples.rst:648 msgid "" "A generator method / function is called to return the generator object. It " "is the generator object that is then iterated over. The protocol method for " @@ -560,23 +571,23 @@ msgid "" "`MagicMock`." msgstr "" -#: ../../library/unittest.mock-examples.rst:629 +#: ../../library/unittest.mock-examples.rst:653 msgid "" "Here's an example class with an \"iter\" method implemented as a generator:" msgstr "" -#: ../../library/unittest.mock-examples.rst:641 +#: ../../library/unittest.mock-examples.rst:665 msgid "How would we mock this class, and in particular its \"iter\" method?" msgstr "" -#: ../../library/unittest.mock-examples.rst:643 +#: ../../library/unittest.mock-examples.rst:667 msgid "" "To configure the values returned from the iteration (implicit in the call " "to :class:`list`), we need to configure the object returned by the call to " "``foo.iter()``." msgstr "" -#: ../../library/unittest.mock-examples.rst:651 +#: ../../library/unittest.mock-examples.rst:675 msgid "" "There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned " @@ -585,11 +596,11 @@ msgid "" "com/generators/>`_." msgstr "" -#: ../../library/unittest.mock-examples.rst:659 +#: ../../library/unittest.mock-examples.rst:683 msgid "Applying the same patch to every test method" msgstr "" -#: ../../library/unittest.mock-examples.rst:661 +#: ../../library/unittest.mock-examples.rst:685 msgid "" "If you want several patches in place for multiple test methods the obvious " "way is to apply the patch decorators to every method. This can feel like " @@ -599,14 +610,14 @@ msgid "" "start with ``test``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:685 +#: ../../library/unittest.mock-examples.rst:709 msgid "" "An alternative way of managing patches is to use the :ref:`start-and-stop`. " "These allow you to move the patching into your ``setUp`` and ``tearDown`` " "methods. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:702 +#: ../../library/unittest.mock-examples.rst:726 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -614,11 +625,11 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: ../../library/unittest.mock-examples.rst:720 +#: ../../library/unittest.mock-examples.rst:744 msgid "Mocking Unbound Methods" msgstr "" -#: ../../library/unittest.mock-examples.rst:722 +#: ../../library/unittest.mock-examples.rst:746 msgid "" "Whilst writing tests today I needed to patch an *unbound method* (patching " "the method on the class rather than on the instance). I needed self to be " @@ -632,7 +643,7 @@ msgid "" "becomes a nuisance." msgstr "" -#: ../../library/unittest.mock-examples.rst:733 +#: ../../library/unittest.mock-examples.rst:757 msgid "" "If you pass ``autospec=True`` to patch then it does the patching with a " "*real* function object. This function object has the same signature as the " @@ -644,30 +655,30 @@ msgid "" "exactly what I wanted:" msgstr "" -#: ../../library/unittest.mock-examples.rst:754 +#: ../../library/unittest.mock-examples.rst:778 msgid "" "If we don't use ``autospec=True`` then the unbound method is patched out " "with a Mock instance instead, and isn't called with ``self``." msgstr "" -#: ../../library/unittest.mock-examples.rst:759 +#: ../../library/unittest.mock-examples.rst:783 msgid "Checking multiple calls with mock" msgstr "" -#: ../../library/unittest.mock-examples.rst:761 +#: ../../library/unittest.mock-examples.rst:785 msgid "" "mock has a nice API for making assertions about how your mock objects are " "used." msgstr "" -#: ../../library/unittest.mock-examples.rst:768 +#: ../../library/unittest.mock-examples.rst:792 msgid "" -"If your mock is only being called once you can use the :meth:" -"`assert_called_once_with` method that also asserts that the :attr:" -"`call_count` is one." +"If your mock is only being called once you can use the :meth:`~Mock." +"assert_called_once_with` method that also asserts that the :attr:`~Mock." +"call_count` is one." msgstr "" -#: ../../library/unittest.mock-examples.rst:779 +#: ../../library/unittest.mock-examples.rst:803 msgid "" "Both ``assert_called_with`` and ``assert_called_once_with`` make assertions " "about the *most recent* call. If your mock is going to be called several " @@ -675,7 +686,7 @@ msgid "" "attr:`~Mock.call_args_list`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:791 +#: ../../library/unittest.mock-examples.rst:815 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -683,11 +694,11 @@ msgid "" "``call_args_list``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:801 +#: ../../library/unittest.mock-examples.rst:825 msgid "Coping with mutable arguments" msgstr "" -#: ../../library/unittest.mock-examples.rst:803 +#: ../../library/unittest.mock-examples.rst:827 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -696,57 +707,58 @@ msgid "" "when the mock was called." msgstr "" -#: ../../library/unittest.mock-examples.rst:808 +#: ../../library/unittest.mock-examples.rst:832 msgid "" "Here's some example code that shows the problem. Imagine the following " "functions defined in 'mymodule'::" msgstr "" -#: ../../library/unittest.mock-examples.rst:819 +#: ../../library/unittest.mock-examples.rst:843 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" -#: ../../library/unittest.mock-examples.rst:834 +#: ../../library/unittest.mock-examples.rst:858 msgid "" "One possibility would be for mock to copy the arguments you pass in. This " "could then cause problems if you do assertions that rely on object identity " "for equality." msgstr "" -#: ../../library/unittest.mock-examples.rst:838 +#: ../../library/unittest.mock-examples.rst:862 msgid "" -"Here's one solution that uses the :attr:`side_effect` functionality. If you " -"provide a ``side_effect`` function for a mock then ``side_effect`` will be " -"called with the same args as the mock. This gives us an opportunity to copy " -"the arguments and store them for later assertions. In this example I'm using " -"*another* mock to store the arguments so that I can use the mock methods for " -"doing the assertion. Again a helper function sets this up for me. ::" +"Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " +"If you provide a ``side_effect`` function for a mock then ``side_effect`` " +"will be called with the same args as the mock. This gives us an opportunity " +"to copy the arguments and store them for later assertions. In this example " +"I'm using *another* mock to store the arguments so that I can use the mock " +"methods for doing the assertion. Again a helper function sets this up for " +"me. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:867 +#: ../../library/unittest.mock-examples.rst:891 msgid "" "``copy_call_args`` is called with the mock that will be called. It returns a " "new mock that we do the assertion on. The ``side_effect`` function makes a " "copy of the args and calls our ``new_mock`` with the copy." msgstr "" -#: ../../library/unittest.mock-examples.rst:873 +#: ../../library/unittest.mock-examples.rst:897 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " "checking inside a ``side_effect`` function." msgstr "" -#: ../../library/unittest.mock-examples.rst:887 +#: ../../library/unittest.mock-examples.rst:911 msgid "" "An alternative approach is to create a subclass of :class:`Mock` or :class:" "`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments. Here's " "an example implementation:" msgstr "" -#: ../../library/unittest.mock-examples.rst:911 +#: ../../library/unittest.mock-examples.rst:935 msgid "" "When you subclass ``Mock`` or ``MagicMock`` all dynamically created " "attributes, and the ``return_value`` will use your subclass automatically. " @@ -754,18 +766,18 @@ msgid "" "``CopyingMock``." msgstr "" -#: ../../library/unittest.mock-examples.rst:917 +#: ../../library/unittest.mock-examples.rst:941 msgid "Nesting Patches" msgstr "" -#: ../../library/unittest.mock-examples.rst:919 +#: ../../library/unittest.mock-examples.rst:943 msgid "" "Using patch as a context manager is nice, but if you do multiple patches you " "can end up with nested with statements indenting further and further to the " "right::" msgstr "" -#: ../../library/unittest.mock-examples.rst:937 +#: ../../library/unittest.mock-examples.rst:961 msgid "" "With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can " "achieve the same effect without the nested indentation. A simple helper " @@ -773,74 +785,74 @@ msgid "" "mock for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:965 +#: ../../library/unittest.mock-examples.rst:989 msgid "Mocking a dictionary with MagicMock" msgstr "" -#: ../../library/unittest.mock-examples.rst:967 +#: ../../library/unittest.mock-examples.rst:991 msgid "" "You may want to mock a dictionary, or other container object, recording all " "access to it whilst having it still behave like a dictionary." msgstr "" -#: ../../library/unittest.mock-examples.rst:970 +#: ../../library/unittest.mock-examples.rst:994 msgid "" "We can do this with :class:`MagicMock`, which will behave like a dictionary, " "and using :data:`~Mock.side_effect` to delegate dictionary access to a real " "underlying dictionary that is under our control." msgstr "" -#: ../../library/unittest.mock-examples.rst:974 +#: ../../library/unittest.mock-examples.rst:998 msgid "" -"When the :meth:`__getitem__` and :meth:`__setitem__` methods of our " -"``MagicMock`` are called (normal dictionary access) then ``side_effect`` is " -"called with the key (and in the case of ``__setitem__`` the value too). We " -"can also control what is returned." +"When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " +"of our ``MagicMock`` are called (normal dictionary access) then " +"``side_effect`` is called with the key (and in the case of ``__setitem__`` " +"the value too). We can also control what is returned." msgstr "" -#: ../../library/unittest.mock-examples.rst:978 +#: ../../library/unittest.mock-examples.rst:1003 msgid "" "After the ``MagicMock`` has been used we can use attributes like :data:" "`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" -#: ../../library/unittest.mock-examples.rst:994 +#: ../../library/unittest.mock-examples.rst:1019 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1001 +#: ../../library/unittest.mock-examples.rst:1026 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " "dictionary magic methods available:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1009 +#: ../../library/unittest.mock-examples.rst:1034 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " "if you try to access a key that doesn't exist." msgstr "" -#: ../../library/unittest.mock-examples.rst:1028 +#: ../../library/unittest.mock-examples.rst:1053 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1040 +#: ../../library/unittest.mock-examples.rst:1065 msgid "Mock subclasses and their attributes" msgstr "" -#: ../../library/unittest.mock-examples.rst:1042 +#: ../../library/unittest.mock-examples.rst:1067 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1058 +#: ../../library/unittest.mock-examples.rst:1083 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -850,7 +862,7 @@ msgid "" "mock of instances of your subclass." msgstr "" -#: ../../library/unittest.mock-examples.rst:1074 +#: ../../library/unittest.mock-examples.rst:1099 msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " @@ -858,7 +870,7 @@ msgid "" "html>`_. Having this applied to attributes too actually causes errors." msgstr "" -#: ../../library/unittest.mock-examples.rst:1080 +#: ../../library/unittest.mock-examples.rst:1105 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -867,25 +879,25 @@ msgid "" "are then passed onto the mock constructor:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1097 +#: ../../library/unittest.mock-examples.rst:1122 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " "methods." msgstr "" -#: ../../library/unittest.mock-examples.rst:1103 +#: ../../library/unittest.mock-examples.rst:1128 msgid "Mocking imports with patch.dict" msgstr "" -#: ../../library/unittest.mock-examples.rst:1105 +#: ../../library/unittest.mock-examples.rst:1130 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " "object from the module namespace that we can patch out." msgstr "" -#: ../../library/unittest.mock-examples.rst:1109 +#: ../../library/unittest.mock-examples.rst:1134 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -895,7 +907,7 @@ msgid "" "attribute and only do the import on first use)." msgstr "" -#: ../../library/unittest.mock-examples.rst:1116 +#: ../../library/unittest.mock-examples.rst:1141 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -905,7 +917,7 @@ msgid "" "back. This need not be the case however." msgstr "" -#: ../../library/unittest.mock-examples.rst:1123 +#: ../../library/unittest.mock-examples.rst:1148 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -914,29 +926,29 @@ msgid "" "whatever was there previously will be restored safely." msgstr "" -#: ../../library/unittest.mock-examples.rst:1129 +#: ../../library/unittest.mock-examples.rst:1154 msgid "Here's an example that mocks out the 'fooble' module." msgstr "" -#: ../../library/unittest.mock-examples.rst:1141 +#: ../../library/unittest.mock-examples.rst:1166 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." msgstr "" -#: ../../library/unittest.mock-examples.rst:1144 +#: ../../library/unittest.mock-examples.rst:1169 msgid "This also works for the ``from module import name`` form:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1154 +#: ../../library/unittest.mock-examples.rst:1179 msgid "With slightly more work you can also mock package imports:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1167 +#: ../../library/unittest.mock-examples.rst:1192 msgid "Tracking order of calls and less verbose call assertions" msgstr "" -#: ../../library/unittest.mock-examples.rst:1169 +#: ../../library/unittest.mock-examples.rst:1194 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -944,7 +956,7 @@ msgid "" "however we can use :attr:`~Mock.mock_calls` to achieve the same effect." msgstr "" -#: ../../library/unittest.mock-examples.rst:1174 +#: ../../library/unittest.mock-examples.rst:1199 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -952,20 +964,20 @@ msgid "" "recorded, in order, in the ``mock_calls`` of the parent:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1191 +#: ../../library/unittest.mock-examples.rst:1216 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1198 +#: ../../library/unittest.mock-examples.rst:1223 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:1217 +#: ../../library/unittest.mock-examples.rst:1242 msgid "" "If many calls have been made, but you're only interested in a particular " "sequence of them then an alternative is to use the :meth:`~Mock." @@ -974,13 +986,13 @@ msgid "" "mock_calls` then the assert succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1231 +#: ../../library/unittest.mock-examples.rst:1256 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1234 +#: ../../library/unittest.mock-examples.rst:1259 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -988,17 +1000,17 @@ msgid "" "``assert_has_calls``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1246 +#: ../../library/unittest.mock-examples.rst:1271 msgid "More complex argument matching" msgstr "" -#: ../../library/unittest.mock-examples.rst:1248 +#: ../../library/unittest.mock-examples.rst:1273 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." msgstr "" -#: ../../library/unittest.mock-examples.rst:1251 +#: ../../library/unittest.mock-examples.rst:1276 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1008,28 +1020,28 @@ msgid "" "attributes for us." msgstr "" -#: ../../library/unittest.mock-examples.rst:1258 +#: ../../library/unittest.mock-examples.rst:1283 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1273 +#: ../../library/unittest.mock-examples.rst:1298 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1285 +#: ../../library/unittest.mock-examples.rst:1310 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1296 +#: ../../library/unittest.mock-examples.rst:1321 msgid "Putting all this together:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1301 +#: ../../library/unittest.mock-examples.rst:1326 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1039,13 +1051,13 @@ msgid "" "raised:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1314 +#: ../../library/unittest.mock-examples.rst:1339 msgid "" "With a bit of tweaking you could have the comparison function raise the :exc:" "`AssertionError` directly and provide a more useful failure message." msgstr "" -#: ../../library/unittest.mock-examples.rst:1317 +#: ../../library/unittest.mock-examples.rst:1342 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " diff --git a/library/unittest.po b/library/unittest.po index daf13a07ff..4d7ca66c6a 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2426,8 +2426,8 @@ msgstr "" #: ../../library/unittest.rst:2020 msgid "" -"A list containing 2-tuples of :class:`TestCase` instances and floats " -"representing the elapsed time of each test which was run." +"A list containing 2-tuples of test case names and floats representing the " +"elapsed time of each test which was run." msgstr "" #: ../../library/unittest.rst:2027 diff --git a/library/uuid.po b/library/uuid.po index f2b28e52d6..9048e97b5b 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,13 +53,14 @@ msgid "" "Depending on support from the underlying platform, :func:`uuid1` may or may " "not return a \"safe\" UUID. A safe UUID is one which is generated using " "synchronization methods that ensure no two processes can obtain the same " -"UUID. All instances of :class:`UUID` have an :attr:`is_safe` attribute " -"which relays any information about the UUID's safety, using this enumeration:" +"UUID. All instances of :class:`UUID` have an :attr:`~UUID.is_safe` " +"attribute which relays any information about the UUID's safety, using this " +"enumeration:" msgstr "" "根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」" "UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程獲取到相同的 " -"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`is_safe` 屬性,該屬性使用下面" -"這個列舉來傳遞有關 UUID 安全性的任何資訊:" +"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`~UUID.is_safe` 屬性,該屬性使" +"用下面這個列舉來傳遞有關 UUID 安全性的任何資訊:" #: ../../library/uuid.rst:34 msgid "The UUID was generated by the platform in a multiprocessing-safe way." @@ -154,83 +155,51 @@ msgstr "" "UUID 以 6 個整數欄位所組成的元組表示,也可以看作有 6 個個別屬性和 2 個衍生屬" "性:" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:100 msgid "Field" msgstr "欄位" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:101 msgid "Meaning" msgstr "意義" -#: ../../library/uuid.rst:101 -msgid ":attr:`time_low`" -msgstr ":attr:`time_low`" - -#: ../../library/uuid.rst:101 -msgid "the first 32 bits of the UUID" -msgstr "UUID 的前 32 位元" - -#: ../../library/uuid.rst:103 -msgid ":attr:`time_mid`" -msgstr ":attr:`time_mid`" - -#: ../../library/uuid.rst:103 ../../library/uuid.rst:105 -msgid "the next 16 bits of the UUID" -msgstr "UUID 接下來的 16 位元" - -#: ../../library/uuid.rst:105 -msgid ":attr:`time_hi_version`" -msgstr ":attr:`time_hi_version`" - -#: ../../library/uuid.rst:107 -msgid ":attr:`clock_seq_hi_variant`" -msgstr ":attr:`clock_seq_hi_variant`" +#: ../../library/uuid.rst:104 +msgid "The first 32 bits of the UUID." +msgstr "UUID 的前 32 位元。" -#: ../../library/uuid.rst:107 ../../library/uuid.rst:109 -msgid "the next 8 bits of the UUID" -msgstr "UUID 接下來的 8 位元" +#: ../../library/uuid.rst:107 ../../library/uuid.rst:110 +msgid "The next 16 bits of the UUID." +msgstr "UUID 接下來的 16 位元。" -#: ../../library/uuid.rst:109 -msgid ":attr:`clock_seq_low`" -msgstr ":attr:`clock_seq_low`" +#: ../../library/uuid.rst:113 ../../library/uuid.rst:116 +msgid "The next 8 bits of the UUID." +msgstr "UUID 接下來的 8 位元。" -#: ../../library/uuid.rst:111 -msgid ":attr:`node`" -msgstr ":attr:`node`" +#: ../../library/uuid.rst:119 +msgid "The last 48 bits of the UUID." +msgstr "UUID 最後的 48 位元。" -#: ../../library/uuid.rst:111 -msgid "the last 48 bits of the UUID" -msgstr "UUID 最後的 48 位元" +#: ../../library/uuid.rst:122 +msgid "The 60-bit timestamp." +msgstr "60 位元的時間戳。" -#: ../../library/uuid.rst:113 -msgid ":attr:`time`" -msgstr ":attr:`time`" +#: ../../library/uuid.rst:125 +msgid "The 14-bit sequence number." +msgstr "14 位元的序列號。" -#: ../../library/uuid.rst:113 -msgid "the 60-bit timestamp" -msgstr "60 位元的時間戳" - -#: ../../library/uuid.rst:115 -msgid ":attr:`clock_seq`" -msgstr ":attr:`clock_seq`" - -#: ../../library/uuid.rst:115 -msgid "the 14-bit sequence number" -msgstr "14 位元的序列號" - -#: ../../library/uuid.rst:121 +#: ../../library/uuid.rst:130 msgid "The UUID as a 32-character lowercase hexadecimal string." msgstr "UUID 以 32 個小寫十六進位字元組成的字串表示。" -#: ../../library/uuid.rst:126 +#: ../../library/uuid.rst:135 msgid "The UUID as a 128-bit integer." msgstr "UUID 以 128 位元的整數表示。" -#: ../../library/uuid.rst:131 +#: ../../library/uuid.rst:140 msgid "The UUID as a URN as specified in :rfc:`4122`." msgstr "UUID 以 :rfc:`4122` 中指定的 URN 形式表示。" -#: ../../library/uuid.rst:136 +#: ../../library/uuid.rst:145 msgid "" "The UUID variant, which determines the internal layout of the UUID. This " "will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :" @@ -240,23 +209,23 @@ msgstr "" "`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個" "常數。" -#: ../../library/uuid.rst:143 +#: ../../library/uuid.rst:152 msgid "" "The UUID version number (1 through 5, meaningful only when the variant is :" "const:`RFC_4122`)." msgstr "UUID 的版本號(1 到 5,只有當變體是 :const:`RFC_4122` 時才有意義)。" -#: ../../library/uuid.rst:148 +#: ../../library/uuid.rst:157 msgid "" "An enumeration of :class:`SafeUUID` which indicates whether the platform " "generated the UUID in a multiprocessing-safe way." msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。" -#: ../../library/uuid.rst:153 +#: ../../library/uuid.rst:162 msgid "The :mod:`uuid` module defines the following functions:" msgstr ":mod:`uuid` 模組定義了以下函式:" -#: ../../library/uuid.rst:158 +#: ../../library/uuid.rst:167 msgid "" "Get the hardware address as a 48-bit positive integer. The first time this " "runs, it may launch a separate program, which could be quite slow. If all " @@ -277,7 +246,7 @@ msgstr "" "*),而不是本地管理 (locally administered) 的 MAC 位址,除此之外不保證任何選" "擇的順序。" -#: ../../library/uuid.rst:168 +#: ../../library/uuid.rst:177 msgid "" "Universally administered MAC addresses are preferred over locally " "administered MAC addresses, since the former are guaranteed to be globally " @@ -286,7 +255,7 @@ msgstr "" "通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者" "不是。" -#: ../../library/uuid.rst:178 +#: ../../library/uuid.rst:187 msgid "" "Generate a UUID from a host ID, sequence number, and the current time. If " "*node* is not given, :func:`getnode` is used to obtain the hardware address. " @@ -297,7 +266,7 @@ msgstr "" "`getnode` 獲取硬體位址。如果給定 *clock_seq*,會將其用作序列號;否則將使用一" "個隨機 14 位元的序列號。" -#: ../../library/uuid.rst:188 +#: ../../library/uuid.rst:197 msgid "" "Generate a UUID based on the MD5 hash of a namespace identifier (which is a " "UUID) and a name (which is a :class:`bytes` object or a string that will be " @@ -306,11 +275,11 @@ msgstr "" "基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一個 :class:" "`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" -#: ../../library/uuid.rst:197 +#: ../../library/uuid.rst:206 msgid "Generate a random UUID." msgstr "生成一個隨機的 UUID。" -#: ../../library/uuid.rst:204 +#: ../../library/uuid.rst:213 msgid "" "Generate a UUID based on the SHA-1 hash of a namespace identifier (which is " "a UUID) and a name (which is a :class:`bytes` object or a string that will " @@ -319,7 +288,7 @@ msgstr "" "基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " "編碼的字串)的 SHA-1 hash 來生成 UUID。" -#: ../../library/uuid.rst:210 +#: ../../library/uuid.rst:219 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." @@ -327,7 +296,7 @@ msgstr "" ":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" "碼。" -#: ../../library/uuid.rst:216 +#: ../../library/uuid.rst:225 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." @@ -335,50 +304,50 @@ msgstr "" "當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain " "name)。" -#: ../../library/uuid.rst:222 +#: ../../library/uuid.rst:231 msgid "When this namespace is specified, the *name* string is a URL." msgstr "當指定這個命名空間時,*name* 字串是一個 URL。" -#: ../../library/uuid.rst:227 +#: ../../library/uuid.rst:236 msgid "When this namespace is specified, the *name* string is an ISO OID." msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。" -#: ../../library/uuid.rst:232 +#: ../../library/uuid.rst:241 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" -#: ../../library/uuid.rst:235 +#: ../../library/uuid.rst:244 msgid "" "The :mod:`uuid` module defines the following constants for the possible " -"values of the :attr:`variant` attribute:" -msgstr ":mod:`uuid` 模組為 :attr:`variant` 屬性的可能值定義了以下常數:" +"values of the :attr:`~UUID.variant` attribute:" +msgstr ":mod:`uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:" -#: ../../library/uuid.rst:241 +#: ../../library/uuid.rst:250 msgid "Reserved for NCS compatibility." msgstr "保留供 NCS 相容性使用。" -#: ../../library/uuid.rst:246 +#: ../../library/uuid.rst:255 msgid "Specifies the UUID layout given in :rfc:`4122`." msgstr "使用在 :rfc:`4122` 中給定的 UUID 佈局。" -#: ../../library/uuid.rst:251 +#: ../../library/uuid.rst:260 msgid "Reserved for Microsoft compatibility." msgstr "保留供 Microsoft 相容性使用。" -#: ../../library/uuid.rst:256 +#: ../../library/uuid.rst:265 msgid "Reserved for future definition." msgstr "保留供未來定義使用。" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" ":rfc:`4122` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命" "名空間" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." @@ -386,30 +355,30 @@ msgstr "" "這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的" "內部格式和生成 UUID 的方法。" -#: ../../library/uuid.rst:269 +#: ../../library/uuid.rst:278 msgid "Command-Line Usage" msgstr "命令列的用法" -#: ../../library/uuid.rst:273 +#: ../../library/uuid.rst:282 msgid "" "The :mod:`uuid` module can be executed as a script from the command line." msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" -#: ../../library/uuid.rst:279 +#: ../../library/uuid.rst:288 msgid "The following options are accepted:" msgstr "可以接受以下選項:" -#: ../../library/uuid.rst:285 +#: ../../library/uuid.rst:294 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/uuid.rst:290 +#: ../../library/uuid.rst:299 msgid "" "Specify the function name to use to generate the uuid. By default :func:" "`uuid4` is used." msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" -#: ../../library/uuid.rst:296 +#: ../../library/uuid.rst:305 msgid "" "The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known " "predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, " @@ -420,49 +389,73 @@ msgstr "" "空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" "`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:303 +#: ../../library/uuid.rst:312 msgid "" "The name used as part of generating the uuid. Only required for :func:" "`uuid3` / :func:`uuid5` functions." msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:310 +#: ../../library/uuid.rst:319 msgid "Example" msgstr "範例" -#: ../../library/uuid.rst:312 +#: ../../library/uuid.rst:321 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" "以下是一些 :mod:`uuid` 模組的典型使用範例:\n" "\n" "::" -#: ../../library/uuid.rst:351 +#: ../../library/uuid.rst:360 msgid "Command-Line Example" msgstr "命令列的範例" -#: ../../library/uuid.rst:353 +#: ../../library/uuid.rst:362 msgid "" "Here are some examples of typical usage of the :mod:`uuid` command line " "interface:" msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" -#: ../../library/uuid.rst:173 +#: ../../library/uuid.rst:182 msgid "getnode" msgstr "getnode" -#: ../../library/uuid.rst:183 +#: ../../library/uuid.rst:192 msgid "uuid1" msgstr "uuid1" -#: ../../library/uuid.rst:192 +#: ../../library/uuid.rst:201 msgid "uuid3" msgstr "uuid3" -#: ../../library/uuid.rst:199 +#: ../../library/uuid.rst:208 msgid "uuid4" msgstr "uuid4" -#: ../../library/uuid.rst:208 +#: ../../library/uuid.rst:217 msgid "uuid5" msgstr "uuid5" + +#~ msgid ":attr:`time_low`" +#~ msgstr ":attr:`time_low`" + +#~ msgid ":attr:`time_mid`" +#~ msgstr ":attr:`time_mid`" + +#~ msgid ":attr:`time_hi_version`" +#~ msgstr ":attr:`time_hi_version`" + +#~ msgid ":attr:`clock_seq_hi_variant`" +#~ msgstr ":attr:`clock_seq_hi_variant`" + +#~ msgid ":attr:`clock_seq_low`" +#~ msgstr ":attr:`clock_seq_low`" + +#~ msgid ":attr:`node`" +#~ msgstr ":attr:`node`" + +#~ msgid ":attr:`time`" +#~ msgstr ":attr:`time`" + +#~ msgid ":attr:`clock_seq`" +#~ msgstr ":attr:`clock_seq`" diff --git a/library/zipapp.po b/library/zipapp.po index 8d2d45893f..ca5c1d6912 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-13 00:03+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-" @@ -357,25 +357,17 @@ msgid "" msgstr "" #: ../../library/zipapp.rst:284 -msgid "" -"Optionally, delete the ``.dist-info`` directories created by pip in the " -"``myapp`` directory. These hold metadata for pip to manage the packages, and " -"as you won't be making any further use of pip they aren't required - " -"although it won't do any harm if you leave them." -msgstr "" - -#: ../../library/zipapp.rst:289 msgid "Package the application using:" msgstr "" -#: ../../library/zipapp.rst:295 +#: ../../library/zipapp.rst:290 msgid "" "This will produce a standalone executable, which can be run on any machine " "with the appropriate interpreter available. See :ref:`zipapp-specifying-the-" "interpreter` for details. It can be shipped to users as a single file." msgstr "" -#: ../../library/zipapp.rst:299 +#: ../../library/zipapp.rst:294 msgid "" "On Unix, the ``myapp.pyz`` file is executable as it stands. You can rename " "the file to remove the ``.pyz`` extension if you prefer a \"plain\" command " @@ -384,11 +376,11 @@ msgid "" "extensions when installed." msgstr "" -#: ../../library/zipapp.rst:307 +#: ../../library/zipapp.rst:302 msgid "Caveats" msgstr "" -#: ../../library/zipapp.rst:309 +#: ../../library/zipapp.rst:304 msgid "" "If your application depends on a package that includes a C extension, that " "package cannot be run from a zip file (this is an OS limitation, as " @@ -402,11 +394,11 @@ msgid "" "based on the user's machine)." msgstr "" -#: ../../library/zipapp.rst:321 +#: ../../library/zipapp.rst:316 msgid "The Python Zip Application Archive Format" msgstr "" -#: ../../library/zipapp.rst:323 +#: ../../library/zipapp.rst:318 msgid "" "Python has been able to execute zip files which contain a ``__main__.py`` " "file since version 2.6. In order to be executed by Python, an application " @@ -417,18 +409,18 @@ msgid "" "the zip file." msgstr "" -#: ../../library/zipapp.rst:330 +#: ../../library/zipapp.rst:325 msgid "" "The zip file format allows arbitrary data to be prepended to a zip file. " "The zip application format uses this ability to prepend a standard POSIX " "\"shebang\" line to the file (``#!/path/to/interpreter``)." msgstr "" -#: ../../library/zipapp.rst:334 +#: ../../library/zipapp.rst:329 msgid "Formally, the Python zip application format is therefore:" msgstr "" -#: ../../library/zipapp.rst:336 +#: ../../library/zipapp.rst:331 msgid "" "An optional shebang line, containing the characters ``b'#!'`` followed by an " "interpreter name, and then a newline (``b'\\n'``) character. The " @@ -438,7 +430,7 @@ msgid "" "POSIX." msgstr "" -#: ../../library/zipapp.rst:341 +#: ../../library/zipapp.rst:336 msgid "" "Standard zipfile data, as generated by the :mod:`zipfile` module. The " "zipfile content *must* include a file called ``__main__.py`` (which must be " @@ -446,13 +438,13 @@ msgid "" "zipfile data can be compressed or uncompressed." msgstr "" -#: ../../library/zipapp.rst:346 +#: ../../library/zipapp.rst:341 msgid "" "If an application archive has a shebang line, it may have the executable bit " "set on POSIX systems, to allow it to be executed directly." msgstr "" -#: ../../library/zipapp.rst:349 +#: ../../library/zipapp.rst:344 msgid "" "There is no requirement that the tools in this module are used to create " "application archives - the module is a convenience, but archives in the " diff --git a/reference/datamodel.po b/reference/datamodel.po index 45236e1665..984e121885 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+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-" @@ -1187,7 +1187,7 @@ msgstr "" msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1078 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1104 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1110 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1116 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1118 +#: ../../reference/datamodel.rst:1120 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1123 +#: ../../reference/datamodel.rst:1125 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1128 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1134 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1135 +#: ../../reference/datamodel.rst:1137 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1136 +#: ../../reference/datamodel.rst:1138 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1137 +#: ../../reference/datamodel.rst:1139 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1140 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1143 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1147 +#: ../../reference/datamodel.rst:1149 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,17 +1307,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1160 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1164 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1175 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1328,7 +1328,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1183 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1336,7 +1336,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1190 +#: ../../reference/datamodel.rst:1192 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1344,7 +1344,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1197 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1352,7 +1352,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1202 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1360,11 +1360,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1205 +#: ../../reference/datamodel.rst:1207 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1209 +#: ../../reference/datamodel.rst:1211 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1372,22 +1372,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1217 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1223 +#: ../../reference/datamodel.rst:1225 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1238 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1242 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1397,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1248 +#: ../../reference/datamodel.rst:1250 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:1255 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1265 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1421,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1274 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1429,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1280 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1284 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1288 +#: ../../reference/datamodel.rst:1290 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1294 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1303 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1311 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1473,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1318 +#: ../../reference/datamodel.rst:1320 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1322 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1488,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1332 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1334 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1501,11 +1501,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1342 +#: ../../reference/datamodel.rst:1344 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1348 +#: ../../reference/datamodel.rst:1350 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1519,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1359 +#: ../../reference/datamodel.rst:1361 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1528,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1367 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1538,11 +1538,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1378 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1384 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1552,7 +1552,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1391 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1560,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1396 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1569,13 +1569,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1402 +#: ../../reference/datamodel.rst:1404 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1583,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:1413 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1593,7 +1593,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1420 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1601,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1433 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1610,7 +1610,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1439 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1620,20 +1620,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:1446 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1451 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1454 +#: ../../reference/datamodel.rst:1456 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1644,18 +1644,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1466 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1468 +#: ../../reference/datamodel.rst:1470 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1474 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1664,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1478 +#: ../../reference/datamodel.rst:1480 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1675,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1493 +#: ../../reference/datamodel.rst:1495 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1687,13 +1687,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1502 +#: ../../reference/datamodel.rst:1504 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1513 +#: ../../reference/datamodel.rst:1515 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1701,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1518 +#: ../../reference/datamodel.rst:1520 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1522 +#: ../../reference/datamodel.rst:1524 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1532 +#: ../../reference/datamodel.rst:1534 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1545 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1732,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1553 +#: ../../reference/datamodel.rst:1555 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1557 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1559 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1561 +#: ../../reference/datamodel.rst:1563 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1579 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1666 +#: ../../reference/datamodel.rst:1668 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1872,7 +1872,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1677 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1880,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1682 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1888,22 +1888,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1687 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1691 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:1693 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1701 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1912,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1712 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1714 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1720 +#: ../../reference/datamodel.rst:1722 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1933,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1946,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1742 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1958,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1753 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1757 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +1973,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1759 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1764 +#: ../../reference/datamodel.rst:1766 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1770 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1772 +#: ../../reference/datamodel.rst:1774 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2001,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:1776 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1783 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1784 +#: ../../reference/datamodel.rst:1786 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2023,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1788 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1795 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1800 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1807 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2051,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1816 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1820 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1838 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2073,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1843 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1844 +#: ../../reference/datamodel.rst:1846 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1849 +#: ../../reference/datamodel.rst:1851 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:1852 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1856 +#: ../../reference/datamodel.rst:1858 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1860 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2103,7 +2103,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1868 +#: ../../reference/datamodel.rst:1870 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2112,13 +2112,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1876 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1879 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,25 +2128,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1888 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1891 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1895 +#: ../../reference/datamodel.rst:1897 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1898 +#: ../../reference/datamodel.rst:1900 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2157,11 +2157,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1909 +#: ../../reference/datamodel.rst:1911 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1911 +#: ../../reference/datamodel.rst:1913 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2170,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1917 +#: ../../reference/datamodel.rst:1919 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2178,7 +2178,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1924 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2186,54 +2186,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1927 +#: ../../reference/datamodel.rst:1929 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1932 +#: ../../reference/datamodel.rst:1934 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1933 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1936 +#: ../../reference/datamodel.rst:1938 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1937 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1940 +#: ../../reference/datamodel.rst:1942 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1939 +#: ../../reference/datamodel.rst:1941 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1946 +#: ../../reference/datamodel.rst:1948 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:1945 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1980 +#: ../../reference/datamodel.rst:1982 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2250,7 +2250,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1994 +#: ../../reference/datamodel.rst:1996 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2259,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2002 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2009 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2009 +#: ../../reference/datamodel.rst:2011 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2013 +#: ../../reference/datamodel.rst:2015 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2020 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2290,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2027 +#: ../../reference/datamodel.rst:2029 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2031 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2033 +#: ../../reference/datamodel.rst:2035 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2310,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2040 +#: ../../reference/datamodel.rst:2042 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2318,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2048 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2326,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2054 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2335,7 +2335,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2058 +#: ../../reference/datamodel.rst:2060 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2344,7 +2344,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2065 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2352,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2070 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2072 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2364,13 +2364,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2077 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2080 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2378,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2086 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2094 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2096 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2399,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2105 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2109 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2414,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2123 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2128 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2428,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2136 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2141 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2147 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2156 +#: ../../reference/datamodel.rst:2158 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2166 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2173 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2177 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2470,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2189 +#: ../../reference/datamodel.rst:2191 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2196 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2195 +#: ../../reference/datamodel.rst:2197 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2198 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2199 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2200 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2204 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2208 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2516,59 +2516,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2222 +#: ../../reference/datamodel.rst:2224 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2223 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2226 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2227 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2231 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2235 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2237 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2238 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2240 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2243 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2577,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2253 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2258 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2593,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2267 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2272 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2271 +#: ../../reference/datamodel.rst:2273 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2277 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2282 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2620,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2288 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2629,11 +2629,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2297 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2304 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2641,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2309 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2652,7 +2652,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2319 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2661,39 +2661,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2325 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2329 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2331 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2333 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2336 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2340 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2701,19 +2701,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2347 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2348 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2350 +#: ../../reference/datamodel.rst:2352 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2352 +#: ../../reference/datamodel.rst:2354 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2721,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2361 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2361 +#: ../../reference/datamodel.rst:2363 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2739,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2371 +#: ../../reference/datamodel.rst:2373 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2378 +#: ../../reference/datamodel.rst:2380 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2383 +#: ../../reference/datamodel.rst:2385 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2761,11 +2761,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2396 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2391 +#: ../../reference/datamodel.rst:2393 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2774,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2399 +#: ../../reference/datamodel.rst:2401 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2403 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2786,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2420 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2425 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2428 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2432 +#: ../../reference/datamodel.rst:2434 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2436 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2440 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2853,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:2446 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2861,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2456 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2456 +#: ../../reference/datamodel.rst:2458 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2875,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2463 +#: ../../reference/datamodel.rst:2465 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2493 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2892,40 +2892,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2512 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2537 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2536 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2542 +#: ../../reference/datamodel.rst:2544 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:2551 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2556 +#: ../../reference/datamodel.rst:2558 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2560 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2961,7 +2961,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2600 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2969,7 +2969,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2605 +#: ../../reference/datamodel.rst:2607 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -2978,7 +2978,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2614 +#: ../../reference/datamodel.rst:2616 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2988,20 +2988,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2630 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2634 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2638 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2641 +#: ../../reference/datamodel.rst:2643 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3014,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2653 +#: ../../reference/datamodel.rst:2655 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2658 +#: ../../reference/datamodel.rst:2660 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2668 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3036,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2675 +#: ../../reference/datamodel.rst:2677 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3045,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2686 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2690 +#: ../../reference/datamodel.rst:2692 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3059,14 +3059,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2700 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2702 +#: ../../reference/datamodel.rst:2704 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3075,7 +3075,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2709 +#: ../../reference/datamodel.rst:2711 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3083,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2718 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2722 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3098,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2729 +#: ../../reference/datamodel.rst:2731 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2733 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3110,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2757 +#: ../../reference/datamodel.rst:2759 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3124,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2770 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2793 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3143,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2805 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2810 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3158,7 +3158,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2831 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3174,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2852 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2865 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2870 +#: ../../reference/datamodel.rst:2872 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3195,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2878 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2890 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3211,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2896 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2899 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2906 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2908 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3235,32 +3235,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:2919 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2922 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2925 +#: ../../reference/datamodel.rst:2927 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2934 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2938 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3268,27 +3268,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2940 +#: ../../reference/datamodel.rst:2942 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2954 +#: ../../reference/datamodel.rst:2956 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2958 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3296,7 +3296,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2963 +#: ../../reference/datamodel.rst:2965 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3305,7 +3305,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2971 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3315,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2981 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:2982 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2988 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:2990 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3335,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:2995 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3000 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3351,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3009 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3360,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3023 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3024 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3029 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3029 +#: ../../reference/datamodel.rst:3031 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3389,7 +3389,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3046 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3398,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3060 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3069 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3095 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3421,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3106 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3110 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3112 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3116 +#: ../../reference/datamodel.rst:3118 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3124 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3128 +#: ../../reference/datamodel.rst:3130 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3458,15 +3458,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3136 +#: ../../reference/datamodel.rst:3138 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3142 +#: ../../reference/datamodel.rst:3144 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:3146 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,18 +3477,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3152 +#: ../../reference/datamodel.rst:3154 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3156 +#: ../../reference/datamodel.rst:3158 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3162 +#: ../../reference/datamodel.rst:3164 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3499,7 +3499,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3173 +#: ../../reference/datamodel.rst:3175 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3510,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3184 +#: ../../reference/datamodel.rst:3186 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3191 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3526,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3197 +#: ../../reference/datamodel.rst:3199 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3203 +#: ../../reference/datamodel.rst:3205 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3207 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:3210 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3214 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3216 +#: ../../reference/datamodel.rst:3218 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3219 +#: ../../reference/datamodel.rst:3221 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3238 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3241 +#: ../../reference/datamodel.rst:3243 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3249 +#: ../../reference/datamodel.rst:3251 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3253 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3254 +#: ../../reference/datamodel.rst:3256 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3258 +#: ../../reference/datamodel.rst:3260 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3263 +#: ../../reference/datamodel.rst:3265 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3266 +#: ../../reference/datamodel.rst:3268 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3279 +#: ../../reference/datamodel.rst:3281 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3280 +#: ../../reference/datamodel.rst:3282 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3284 +#: ../../reference/datamodel.rst:3286 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3626,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3290 +#: ../../reference/datamodel.rst:3292 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3634,7 +3634,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3296 +#: ../../reference/datamodel.rst:3298 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3655,9 +3655,9 @@ msgstr "" #: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 #: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 #: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 -#: ../../reference/datamodel.rst:1042 ../../reference/datamodel.rst:1100 -#: ../../reference/datamodel.rst:1160 ../../reference/datamodel.rst:1225 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1048 ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2626 msgid "object" msgstr "object(物件)" @@ -3668,13 +3668,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1290 -#: ../../reference/datamodel.rst:1530 ../../reference/datamodel.rst:1535 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2166 -#: ../../reference/datamodel.rst:2594 ../../reference/datamodel.rst:2752 -#: ../../reference/datamodel.rst:2787 ../../reference/datamodel.rst:2801 -#: ../../reference/datamodel.rst:2848 ../../reference/datamodel.rst:2858 -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1532 ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2596 ../../reference/datamodel.rst:2754 +#: ../../reference/datamodel.rst:2789 ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2850 ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2888 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3683,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "type" msgstr "type(型別)" @@ -3807,12 +3807,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2860 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2596 msgid "len" msgstr "len" @@ -3845,8 +3845,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1505 -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1537 msgid "string" msgstr "string(字串)" @@ -3882,7 +3882,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1530 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1532 msgid "bytes" msgstr "bytes(位元組)" @@ -3904,8 +3904,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 -#: ../../reference/datamodel.rst:1257 ../../reference/datamodel.rst:1426 -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:1259 ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:2915 msgid "statement" msgstr "statement(陳述式)" @@ -3942,7 +3942,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "dictionary" msgstr "dictionary(字典)" @@ -3965,7 +3965,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2549 msgid "call" msgstr "call(呼叫)" @@ -4065,7 +4065,7 @@ msgstr "__name__ (方法屬性)" msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1102 msgid "generator" msgstr "generator(產生器)" @@ -4073,7 +4073,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3102 msgid "coroutine" msgstr "coroutine(協程)" @@ -4118,8 +4118,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 -#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1409 -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:2279 msgid "class" msgstr "class(類別)" @@ -4129,7 +4129,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:2549 msgid "instance" msgstr "instance(實例)" @@ -4225,371 +4225,371 @@ msgstr "internal type(內部型別)" msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1116 +#: ../../reference/datamodel.rst:1118 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1160 +#: ../../reference/datamodel.rst:1162 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1275 +#: ../../reference/datamodel.rst:1277 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1290 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1292 ../../reference/datamodel.rst:2626 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1411 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1576 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2232 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2255 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2279 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:2596 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 +#: ../../reference/datamodel.rst:2803 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2850 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2888 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/sphinx.po b/sphinx.po index 443deb3bf7..3172c142e8 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,6 +244,10 @@ msgstr "Python 的沿革與授權" msgid "Copyright" msgstr "版權" +#: ../../tools/templates/indexcontent.html:65 +msgid "Download the documentation" +msgstr "下載說明文件" + #: ../../tools/templates/indexsidebar.html:1 msgid "Download" msgstr "下載" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 7ee36c62e6..3ac06d2f35 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -163,14 +163,14 @@ msgstr "客製化模組" #: ../../tutorial/appendix.rst:104 msgid "" -"Python provides two hooks to let you customize it: :mod:`sitecustomize` and :" -"mod:`usercustomize`. To see how it works, you need first to find the " +"Python provides two hooks to let you customize it: :index:`sitecustomize` " +"and :index:`usercustomize`. To see how it works, you need first to find the " "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" -"Python 提供了兩個鉤子(hook)讓你可以將它客製化: :mod:`sitecustomize` 和 :" -"mod:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages 的" -"位置。啟動 Python 並運行這段程式碼:\n" +"Python 提供了兩個鉤子 (hook) 讓你可以將它客製化: :index:`sitecustomize` 和 :" +"index:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages " +"的位置。啟動 Python 並運行這段程式碼:\n" "\n" "::" @@ -187,14 +187,14 @@ msgstr "" #: ../../tutorial/appendix.rst:116 msgid "" -":mod:`sitecustomize` works in the same way, but is typically created by an " +":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " -"imported before :mod:`usercustomize`. See the documentation of the :mod:" +"imported before :index:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" -":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" -"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :" -"mod:`site` 模組的文件。" +":index:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" +"packages 目錄下創建,並在 :index:`usercustomize` 之前 import 。更多細節請參" +"閱 :mod:`site` 模組的文件。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" diff --git a/tutorial/classes.po b/tutorial/classes.po index c7e6db0e8f..a00a286b46 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-09-02 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -475,13 +475,13 @@ msgid "" "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " "returning an integer and a function object, respectively. Class attributes " "can also be assigned to, so you can change the value of ``MyClass.i`` by " -"assignment. :attr:`__doc__` is also a valid attribute, returning the " +"assignment. :attr:`!__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" "一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " -"``MyClass.i`` 的值。:attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的" -"說明字串 (docstring):``\"A simple example class\"``。" +"``MyClass.i`` 的值。:attr:`!__doc__` 也是一個有效的屬性,會回傳屬於該 class " +"的說明字串 (docstring):``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" diff --git a/using/configure.po b/using/configure.po index 27dd931962..f461e35107 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -64,7 +64,7 @@ msgstr "" #: ../../using/configure.rst:29 msgid "OpenSSL 1.1.1 is now required." -msgstr "" +msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." @@ -78,7 +78,7 @@ msgstr "" #: ../../using/configure.rst:39 msgid "On Windows, Visual Studio 2015 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" #: ../../using/configure.rst:42 msgid "" @@ -86,63 +86,88 @@ msgid "" "platform support\"." msgstr "" +#: ../../using/configure.rst:47 +msgid "Generated files" +msgstr "產生的檔案" + #: ../../using/configure.rst:49 -msgid "Configure Options" +msgid "" +"To reduce build dependencies, Python source code contains multiple generated " +"files. Commands to regenerate all generated files::" msgstr "" -#: ../../using/configure.rst:51 +#: ../../using/configure.rst:57 +msgid "" +"The ``Makefile.pre.in`` file documents generated files, their inputs, and " +"tools used to regenerate them. Search for ``regen-*`` make targets." +msgstr "" + +#: ../../using/configure.rst:60 +msgid "" +"The ``make regen-configure`` command runs `tiran/cpython_autoconf `_ container for reproducible build; see " +"container ``entry.sh`` script. The container is optional, the following " +"command can be run locally, the generated files depend on autoconf and " +"aclocal versions::" +msgstr "" + +#: ../../using/configure.rst:72 +msgid "Configure Options" +msgstr "設定選項" + +#: ../../using/configure.rst:74 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:55 +#: ../../using/configure.rst:78 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "" -#: ../../using/configure.rst:58 +#: ../../using/configure.rst:81 msgid "General Options" -msgstr "" +msgstr "一般選項" -#: ../../using/configure.rst:62 +#: ../../using/configure.rst:85 msgid "" "Support loadable extensions in the :mod:`_sqlite` extension module (default " "is no)." msgstr "" -#: ../../using/configure.rst:65 +#: ../../using/configure.rst:88 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" -#: ../../using/configure.rst:72 +#: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "" -#: ../../using/configure.rst:77 +#: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:79 +#: ../../using/configure.rst:102 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:81 +#: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" -#: ../../using/configure.rst:83 +#: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" -#: ../../using/configure.rst:87 +#: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "" -#: ../../using/configure.rst:89 +#: ../../using/configure.rst:112 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -150,95 +175,95 @@ msgid "" "executable)." msgstr "" -#: ../../using/configure.rst:94 +#: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "" -#: ../../using/configure.rst:100 +#: ../../using/configure.rst:123 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:127 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." msgstr "" -#: ../../using/configure.rst:112 +#: ../../using/configure.rst:135 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:115 +#: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" -#: ../../using/configure.rst:121 +#: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:123 +#: ../../using/configure.rst:146 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:125 +#: ../../using/configure.rst:148 msgid "``ndbm``;" -msgstr "" +msgstr "``ndbm``;" -#: ../../using/configure.rst:126 +#: ../../using/configure.rst:149 msgid "``gdbm``;" -msgstr "" +msgstr "``gdbm``;" -#: ../../using/configure.rst:127 +#: ../../using/configure.rst:150 msgid "``bdb``." -msgstr "" +msgstr "``bdb``." -#: ../../using/configure.rst:131 +#: ../../using/configure.rst:154 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:133 +#: ../../using/configure.rst:156 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." -msgstr "" +msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:135 +#: ../../using/configure.rst:158 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:139 +#: ../../using/configure.rst:162 msgid "Disable all freelists except the empty tuple singleton." msgstr "" -#: ../../using/configure.rst:145 +#: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." msgstr "" -#: ../../using/configure.rst:147 +#: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." -msgstr "" +msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:149 +#: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`\\ 。" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:178 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:158 +#: ../../using/configure.rst:181 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -246,201 +271,201 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:167 +#: ../../using/configure.rst:190 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:170 +#: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "" -#: ../../using/configure.rst:171 +#: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "" -#: ../../using/configure.rst:172 +#: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "" -#: ../../using/configure.rst:178 +#: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:180 +#: ../../using/configure.rst:203 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows. If that directory " "does not exist, results will be printed on stdout." msgstr "" -#: ../../using/configure.rst:184 +#: ../../using/configure.rst:207 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." -msgstr "" +msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:189 +#: ../../using/configure.rst:212 msgid "WebAssembly Options" -msgstr "" +msgstr "WebAssembly 選項" -#: ../../using/configure.rst:193 +#: ../../using/configure.rst:216 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:195 +#: ../../using/configure.rst:218 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:196 +#: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." msgstr "" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:227 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:211 +#: ../../using/configure.rst:234 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:217 +#: ../../using/configure.rst:240 msgid "Install Options" -msgstr "" +msgstr "安裝選項" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:244 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:224 -msgid "This value can be retrived at runtime using :data:`sys.prefix`." +#: ../../using/configure.rst:247 +msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "" -#: ../../using/configure.rst:226 +#: ../../using/configure.rst:249 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:231 +#: ../../using/configure.rst:254 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:233 -msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." +#: ../../using/configure.rst:256 +msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:260 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:244 +#: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:246 +#: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:248 +#: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:249 +#: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:255 +#: ../../using/configure.rst:278 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:257 +#: ../../using/configure.rst:280 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:286 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:266 +#: ../../using/configure.rst:289 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:269 +#: ../../using/configure.rst:292 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:275 +#: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:303 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:283 +#: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:289 +#: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:291 +#: ../../using/configure.rst:314 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:296 +#: ../../using/configure.rst:319 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:299 +#: ../../using/configure.rst:322 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:304 +#: ../../using/configure.rst:327 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:331 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:312 +#: ../../using/configure.rst:335 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -451,7 +476,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:320 +#: ../../using/configure.rst:343 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -459,101 +484,101 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:352 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:357 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:337 +#: ../../using/configure.rst:360 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:364 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:344 +#: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:350 +#: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:377 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:361 +#: ../../using/configure.rst:384 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:363 +#: ../../using/configure.rst:386 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:389 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:368 +#: ../../using/configure.rst:391 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:370 +#: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:371 +#: ../../using/configure.rst:394 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "新增 :func:`sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:396 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:375 +#: ../../using/configure.rst:398 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:400 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:379 +#: ../../using/configure.rst:402 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:380 +#: ../../using/configure.rst:403 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -561,45 +586,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:385 +#: ../../using/configure.rst:408 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:386 +#: ../../using/configure.rst:409 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:388 +#: ../../using/configure.rst:411 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:413 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:414 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:393 +#: ../../using/configure.rst:416 msgid "" "The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:419 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:399 +#: ../../using/configure.rst:422 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -607,320 +632,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:407 +#: ../../using/configure.rst:430 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:434 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:439 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:441 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:420 +#: ../../using/configure.rst:443 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:421 +#: ../../using/configure.rst:444 msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:422 +#: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:447 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:454 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:434 +#: ../../using/configure.rst:457 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:460 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:444 +#: ../../using/configure.rst:467 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:471 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:450 +#: ../../using/configure.rst:473 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:457 +#: ../../using/configure.rst:480 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:486 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:469 +#: ../../using/configure.rst:492 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:499 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:503 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:507 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:491 +#: ../../using/configure.rst:514 msgid "Libraries options" -msgstr "" +msgstr "函式庫選項" -#: ../../using/configure.rst:495 +#: ../../using/configure.rst:518 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:522 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:504 +#: ../../using/configure.rst:527 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:511 +#: ../../using/configure.rst:534 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:513 +#: ../../using/configure.rst:536 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "定義 ``WITH_EDITLINE`` 巨集。" -#: ../../using/configure.rst:519 +#: ../../using/configure.rst:542 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:544 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:550 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:554 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:558 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:564 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:566 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:567 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:546 +#: ../../using/configure.rst:569 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:552 +#: ../../using/configure.rst:575 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:579 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:581 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:559 +#: ../../using/configure.rst:582 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:583 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:587 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:569 +#: ../../using/configure.rst:592 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:571 +#: ../../using/configure.rst:594 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:595 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:596 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:597 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:598 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:576 +#: ../../using/configure.rst:599 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:605 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:584 +#: ../../using/configure.rst:607 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:585 +#: ../../using/configure.rst:608 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:586 +#: ../../using/configure.rst:609 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:611 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:617 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:621 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:600 +#: ../../using/configure.rst:623 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:605 +#: ../../using/configure.rst:628 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:611 +#: ../../using/configure.rst:634 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:639 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:619 +#: ../../using/configure.rst:642 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:621 +#: ../../using/configure.rst:644 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:622 +#: ../../using/configure.rst:645 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:646 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:624 +#: ../../using/configure.rst:647 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:648 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:649 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:627 +#: ../../using/configure.rst:650 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:651 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:655 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:660 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:639 +#: ../../using/configure.rst:662 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -928,95 +953,95 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:669 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:673 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:677 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:660 +#: ../../using/configure.rst:683 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:685 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:693 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:702 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:705 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:707 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:708 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:686 +#: ../../using/configure.rst:709 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:687 +#: ../../using/configure.rst:710 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:691 +#: ../../using/configure.rst:714 msgid "Main build steps" -msgstr "" +msgstr "主要建置步驟" -#: ../../using/configure.rst:693 +#: ../../using/configure.rst:716 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:717 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:718 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:720 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:723 msgid "Main Makefile targets" -msgstr "" +msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:725 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:726 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:728 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1024,53 +1049,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:732 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:735 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:713 +#: ../../using/configure.rst:736 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:716 +#: ../../using/configure.rst:739 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:740 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:744 msgid "C extensions" -msgstr "" +msgstr "C 擴充模組" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:746 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:758 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:745 +#: ../../using/configure.rst:768 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1078,303 +1103,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:749 +#: ../../using/configure.rst:772 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:776 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" -msgstr "" +msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:754 +#: ../../using/configure.rst:777 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." -msgstr "" +msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:756 +#: ../../using/configure.rst:779 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:762 +#: ../../using/configure.rst:785 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:764 +#: ../../using/configure.rst:787 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:791 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:795 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:801 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:781 ../../using/configure.rst:971 +#: ../../using/configure.rst:804 ../../using/configure.rst:994 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:791 +#: ../../using/configure.rst:814 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:793 +#: ../../using/configure.rst:816 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:821 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:825 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:827 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:808 +#: ../../using/configure.rst:831 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:810 +#: ../../using/configure.rst:833 msgid "Example: ``g++ -pthread``." -msgstr "" +msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:814 +#: ../../using/configure.rst:837 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:818 +#: ../../using/configure.rst:841 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:822 +#: ../../using/configure.rst:845 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:824 +#: ../../using/configure.rst:847 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:852 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:860 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:867 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:871 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:855 +#: ../../using/configure.rst:878 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:885 msgid "Base compiler flags." -msgstr "" +msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:866 +#: ../../using/configure.rst:889 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:893 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:899 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:901 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:905 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:907 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:912 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:893 +#: ../../using/configure.rst:916 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:922 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:924 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:930 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:936 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:916 +#: ../../using/configure.rst:939 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:945 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:947 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:951 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:932 +#: ../../using/configure.rst:955 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:957 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:961 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:963 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:948 +#: ../../using/configure.rst:971 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:975 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:977 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:961 +#: ../../using/configure.rst:984 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:968 +#: ../../using/configure.rst:991 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:1000 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:980 +#: ../../using/configure.rst:1003 msgid "Example: ``-lrt``." -msgstr "" +msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:1007 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:986 +#: ../../using/configure.rst:1009 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:1013 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:1015 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:996 +#: ../../using/configure.rst:1019 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1023 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1006 +#: ../../using/configure.rst:1029 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 20e10941bc..0d4fc1eb05 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -62,8 +62,8 @@ msgid "New grammar features:" msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 -msgid ":pep:`701`: Syntactic formalization of f-strings" -msgstr "" +msgid ":ref:`whatsnew312-pep701`" +msgstr ":ref:`whatsnew312-pep701`" #: ../../whatsnew/3.12.rst:73 msgid "Interpreter improvements:" @@ -71,55 +71,59 @@ msgstr "" #: ../../whatsnew/3.12.rst:75 msgid ":ref:`whatsnew312-pep684`" -msgstr "" +msgstr ":ref:`whatsnew312-pep684`" #: ../../whatsnew/3.12.rst:77 -msgid "New typing features:" -msgstr "新增型別特性:" +msgid ":ref:`whatsnew312-pep669`" +msgstr ":ref:`whatsnew312-pep669`" #: ../../whatsnew/3.12.rst:79 -msgid ":pep:`688`: Making the buffer protocol accessible in Python" -msgstr "" +msgid "New typing features:" +msgstr "新增型別特性:" #: ../../whatsnew/3.12.rst:81 +msgid ":ref:`whatsnew312-pep688`" +msgstr ":ref:`whatsnew312-pep688`" + +#: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep692`" msgstr ":ref:`whatsnew312-pep692`" -#: ../../whatsnew/3.12.rst:83 +#: ../../whatsnew/3.12.rst:85 msgid ":ref:`whatsnew312-pep695`" msgstr ":ref:`whatsnew312-pep695`" -#: ../../whatsnew/3.12.rst:85 -msgid ":pep:`698`: Override Decorator for Static Typing" -msgstr "" - #: ../../whatsnew/3.12.rst:87 +msgid ":ref:`whatsnew312-pep698`" +msgstr ":ref:`whatsnew312-pep698`" + +#: ../../whatsnew/3.12.rst:89 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.12.rst:89 +#: ../../whatsnew/3.12.rst:91 msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" -#: ../../whatsnew/3.12.rst:91 +#: ../../whatsnew/3.12.rst:93 msgid "" ":pep:`632`: Remove the ``distutils`` package. See `the migration guide " "`_ for advice on its " "replacement." msgstr "" -#: ../../whatsnew/3.12.rst:96 +#: ../../whatsnew/3.12.rst:98 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:98 +#: ../../whatsnew/3.12.rst:100 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:107 +#: ../../whatsnew/3.12.rst:109 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -128,14 +132,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:128 +#: ../../whatsnew/3.12.rst:130 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:138 +#: ../../whatsnew/3.12.rst:140 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -143,15 +147,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1652 +#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:154 +#: ../../whatsnew/3.12.rst:156 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:158 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -160,7 +164,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:161 +#: ../../whatsnew/3.12.rst:163 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -168,7 +172,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:170 +#: ../../whatsnew/3.12.rst:172 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -176,13 +180,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:178 +#: ../../whatsnew/3.12.rst:180 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:184 +#: ../../whatsnew/3.12.rst:186 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -191,7 +195,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:197 +#: ../../whatsnew/3.12.rst:199 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -200,11 +204,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:210 +#: ../../whatsnew/3.12.rst:212 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:214 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -213,7 +217,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:225 +#: ../../whatsnew/3.12.rst:227 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -221,25 +225,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:237 +#: ../../whatsnew/3.12.rst:239 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:244 +#: ../../whatsnew/3.12.rst:246 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:246 +#: ../../whatsnew/3.12.rst:248 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:250 +#: ../../whatsnew/3.12.rst:252 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -247,24 +251,31 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:255 +#: ../../whatsnew/3.12.rst:257 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:257 +#: ../../whatsnew/3.12.rst:259 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:261 +msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." +msgstr "" + +#: ../../whatsnew/3.12.rst:264 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:262 +#: ../../whatsnew/3.12.rst:267 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -274,22 +285,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:269 +#: ../../whatsnew/3.12.rst:274 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:272 +#: ../../whatsnew/3.12.rst:279 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:274 +#: ../../whatsnew/3.12.rst:281 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:278 +#: ../../whatsnew/3.12.rst:285 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -297,76 +308,92 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:287 +#: ../../whatsnew/3.12.rst:294 msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:296 msgid "" "Sub-interpreters may now be created with a unique GIL per interpreter. This " "allows Python programs to take full advantage of multiple CPU cores." msgstr "" -#: ../../whatsnew/3.12.rst:293 +#: ../../whatsnew/3.12.rst:300 msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " "interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:307 +#: ../../whatsnew/3.12.rst:314 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:310 +#: ../../whatsnew/3.12.rst:317 msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" msgstr "" -#: ../../whatsnew/3.12.rst:312 +#: ../../whatsnew/3.12.rst:319 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:315 +#: ../../whatsnew/3.12.rst:324 +msgid "PEP 669: Low impact monitoring for CPython" +msgstr "" + +#: ../../whatsnew/3.12.rst:326 +msgid "" +"CPython 3.12 now supports the ability to monitor calls, returns, lines, " +"exceptions and other events using instrumentation. This means that you only " +"pay for what you use, providing support for near-zero overhead debuggers and " +"coverage tools." +msgstr "" + +#: ../../whatsnew/3.12.rst:331 +msgid "See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../whatsnew/3.12.rst:335 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:317 +#: ../../whatsnew/3.12.rst:337 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:323 +#: ../../whatsnew/3.12.rst:343 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:325 +#: ../../whatsnew/3.12.rst:345 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:329 +#: ../../whatsnew/3.12.rst:349 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:340 +#: ../../whatsnew/3.12.rst:360 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:362 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:367 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:347 +#: ../../whatsnew/3.12.rst:369 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -375,51 +402,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:353 +#: ../../whatsnew/3.12.rst:375 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:371 +#: ../../whatsnew/3.12.rst:393 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:376 +#: ../../whatsnew/3.12.rst:398 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:378 +#: ../../whatsnew/3.12.rst:400 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:382 +#: ../../whatsnew/3.12.rst:404 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:395 +#: ../../whatsnew/3.12.rst:417 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:401 +#: ../../whatsnew/3.12.rst:423 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:405 +#: ../../whatsnew/3.12.rst:427 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:414 +#: ../../whatsnew/3.12.rst:436 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -427,7 +454,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:419 +#: ../../whatsnew/3.12.rst:441 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -437,7 +464,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:426 +#: ../../whatsnew/3.12.rst:448 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -446,21 +473,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:432 +#: ../../whatsnew/3.12.rst:454 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:434 +#: ../../whatsnew/3.12.rst:456 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:460 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:440 +#: ../../whatsnew/3.12.rst:462 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -471,7 +498,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:450 +#: ../../whatsnew/3.12.rst:472 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -481,32 +508,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:458 +#: ../../whatsnew/3.12.rst:480 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:484 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:465 +#: ../../whatsnew/3.12.rst:487 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:468 +#: ../../whatsnew/3.12.rst:490 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 +#: ../../whatsnew/3.12.rst:494 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -516,7 +543,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:479 +#: ../../whatsnew/3.12.rst:501 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -527,7 +554,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:488 +#: ../../whatsnew/3.12.rst:510 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -535,14 +562,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:516 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:520 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -552,28 +579,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:505 +#: ../../whatsnew/3.12.rst:527 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:508 +#: ../../whatsnew/3.12.rst:530 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:512 +#: ../../whatsnew/3.12.rst:534 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:538 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -581,33 +608,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:523 +#: ../../whatsnew/3.12.rst:545 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:525 +#: ../../whatsnew/3.12.rst:547 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:529 +#: ../../whatsnew/3.12.rst:551 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:532 +#: ../../whatsnew/3.12.rst:554 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:556 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:560 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:540 +#: ../../whatsnew/3.12.rst:562 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -615,7 +642,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:567 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -623,7 +650,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:550 +#: ../../whatsnew/3.12.rst:572 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -631,7 +658,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:555 +#: ../../whatsnew/3.12.rst:577 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -643,7 +670,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:564 +#: ../../whatsnew/3.12.rst:586 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -651,57 +678,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:570 +#: ../../whatsnew/3.12.rst:592 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:574 +#: ../../whatsnew/3.12.rst:596 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:577 +#: ../../whatsnew/3.12.rst:599 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:581 +#: ../../whatsnew/3.12.rst:603 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:608 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:610 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:614 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:594 +#: ../../whatsnew/3.12.rst:616 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:621 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:601 +#: ../../whatsnew/3.12.rst:623 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -710,35 +737,45 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:632 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:612 +#: ../../whatsnew/3.12.rst:634 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:638 +msgid "importlib.resources" +msgstr "" + +#: ../../whatsnew/3.12.rst:640 +msgid "" +":func:`importlib.resources.as_file` now supports resource directories. " +"(Contributed by Jason R. Coombs in :gh:`97930`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:644 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:618 +#: ../../whatsnew/3.12.rst:646 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:622 +#: ../../whatsnew/3.12.rst:650 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:626 +#: ../../whatsnew/3.12.rst:654 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -746,60 +783,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:660 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:662 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:639 +#: ../../whatsnew/3.12.rst:667 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:669 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:672 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:649 +#: ../../whatsnew/3.12.rst:677 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:679 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:655 +#: ../../whatsnew/3.12.rst:683 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:659 +#: ../../whatsnew/3.12.rst:687 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:663 +#: ../../whatsnew/3.12.rst:691 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -812,27 +849,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:702 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:676 +#: ../../whatsnew/3.12.rst:704 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:707 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:711 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:685 +#: ../../whatsnew/3.12.rst:713 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -840,14 +877,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:690 +#: ../../whatsnew/3.12.rst:718 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:694 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -855,13 +892,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:699 +#: ../../whatsnew/3.12.rst:727 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:730 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -869,38 +906,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:735 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:709 +#: ../../whatsnew/3.12.rst:737 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:715 +#: ../../whatsnew/3.12.rst:743 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:717 +#: ../../whatsnew/3.12.rst:745 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:748 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:724 +#: ../../whatsnew/3.12.rst:752 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:754 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -908,7 +945,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:760 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -916,14 +953,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:766 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:771 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -931,24 +968,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:776 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:782 ../../whatsnew/3.12.rst:1461 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:756 +#: ../../whatsnew/3.12.rst:784 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:787 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -956,36 +993,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:794 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:771 +#: ../../whatsnew/3.12.rst:799 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:777 +#: ../../whatsnew/3.12.rst:805 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:779 +#: ../../whatsnew/3.12.rst:807 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:812 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:786 +#: ../../whatsnew/3.12.rst:814 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -995,7 +1032,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:795 +#: ../../whatsnew/3.12.rst:823 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1004,14 +1041,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1019,27 +1056,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:839 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:841 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:815 +#: ../../whatsnew/3.12.rst:843 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:849 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:851 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1047,11 +1084,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 +#: ../../whatsnew/3.12.rst:857 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:831 +#: ../../whatsnew/3.12.rst:859 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1061,11 +1098,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:840 +#: ../../whatsnew/3.12.rst:868 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:870 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1073,22 +1110,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:848 +#: ../../whatsnew/3.12.rst:876 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:850 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:855 +#: ../../whatsnew/3.12.rst:883 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:885 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1101,7 +1138,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:896 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1109,13 +1146,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:918 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:893 +#: ../../whatsnew/3.12.rst:921 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1126,71 +1163,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:901 +#: ../../whatsnew/3.12.rst:929 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:905 +#: ../../whatsnew/3.12.rst:933 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 +#: ../../whatsnew/3.12.rst:937 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:911 +#: ../../whatsnew/3.12.rst:939 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:915 +#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:917 +#: ../../whatsnew/3.12.rst:945 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:961 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:936 +#: ../../whatsnew/3.12.rst:964 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:938 +#: ../../whatsnew/3.12.rst:966 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:943 +#: ../../whatsnew/3.12.rst:971 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:973 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:949 +#: ../../whatsnew/3.12.rst:977 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:953 +#: ../../whatsnew/3.12.rst:981 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1198,13 +1235,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:986 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:961 +#: ../../whatsnew/3.12.rst:989 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1212,18 +1249,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:994 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:1000 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:974 +#: ../../whatsnew/3.12.rst:1002 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1231,20 +1268,26 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:979 +#: ../../whatsnew/3.12.rst:1007 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:982 +#: ../../whatsnew/3.12.rst:1010 +msgid "" +"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:985 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1253,35 +1296,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:991 +#: ../../whatsnew/3.12.rst:1022 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:995 +#: ../../whatsnew/3.12.rst:1026 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:997 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1033 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1011 +#: ../../whatsnew/3.12.rst:1042 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1289,14 +1332,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1047 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" -"`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1020 +#: ../../whatsnew/3.12.rst:1051 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1306,7 +1349,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1059 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1315,25 +1358,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1034 +#: ../../whatsnew/3.12.rst:1065 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1049 +#: ../../whatsnew/3.12.rst:1080 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1038 +#: ../../whatsnew/3.12.rst:1069 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1075 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1343,28 +1386,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1082 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1055 +#: ../../whatsnew/3.12.rst:1086 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1090 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1093 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1372,7 +1415,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1098 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1380,14 +1423,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1103 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1108 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1396,7 +1439,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1113 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1405,156 +1448,156 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1089 +#: ../../whatsnew/3.12.rst:1120 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1091 +#: ../../whatsnew/3.12.rst:1122 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1094 +#: ../../whatsnew/3.12.rst:1125 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1127 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1097 +#: ../../whatsnew/3.12.rst:1128 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1129 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1130 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1100 +#: ../../whatsnew/3.12.rst:1131 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1132 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1133 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1134 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1135 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1136 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1106 +#: ../../whatsnew/3.12.rst:1137 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1138 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1139 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1109 +#: ../../whatsnew/3.12.rst:1140 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1141 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1142 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1112 +#: ../../whatsnew/3.12.rst:1143 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1144 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1145 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1116 +#: ../../whatsnew/3.12.rst:1147 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1149 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1151 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1153 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1154 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1155 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1156 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1157 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1158 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1159 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1160 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1161 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1164 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1166 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1562,39 +1605,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1176 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1177 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1178 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1148 +#: ../../whatsnew/3.12.rst:1179 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1150 +#: ../../whatsnew/3.12.rst:1181 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1184 msgid "" ":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " "and :meth:`asyncio.Task.cancel` (:gh:`90985`)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1188 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1602,47 +1645,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1165 +#: ../../whatsnew/3.12.rst:1196 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1199 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1200 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1201 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1172 +#: ../../whatsnew/3.12.rst:1203 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1205 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1175 +#: ../../whatsnew/3.12.rst:1206 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1208 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1210 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1650,7 +1693,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1661,52 +1704,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1193 +#: ../../whatsnew/3.12.rst:1224 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1229 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1202 +#: ../../whatsnew/3.12.rst:1233 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1205 +#: ../../whatsnew/3.12.rst:1236 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1239 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1242 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1214 +#: ../../whatsnew/3.12.rst:1245 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1217 +#: ../../whatsnew/3.12.rst:1248 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1714,31 +1757,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1223 +#: ../../whatsnew/3.12.rst:1254 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases using the C API (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:1227 +#: ../../whatsnew/3.12.rst:1258 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1260 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1232 +#: ../../whatsnew/3.12.rst:1263 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1265 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1267 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1750,57 +1793,73 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1281 +msgid "asynchat and asyncore" +msgstr "" + +#: ../../whatsnew/3.12.rst:1283 msgid "" -"``asynchat`` and ``asyncore``: These two modules have been removed according " -"to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" -"mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" +"These two modules have been removed according to the schedule in :pep:`594`, " +"having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " +"(Contributed by Nikita Sobolev in :gh:`96580`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1290 +msgid "configparser" msgstr "" -#: ../../whatsnew/3.12.rst:1255 +#: ../../whatsnew/3.12.rst:1292 msgid "" -":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " -"back in 3.2 have been removed per :gh:`89336`:" +"Several names deprecated in the :mod:`configparser` way back in 3.2 have " +"been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1303 +msgid "distutils" +msgstr "" + +#: ../../whatsnew/3.12.rst:1305 msgid "" -"``distutils``: Remove the ``distutils`` package. It was deprecated in Python " -"3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " +"Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " +"by :pep:`632` \"Deprecate distutils module\". For projects still using " "``distutils`` and cannot be updated to something else, the ``setuptools`` " "project can be installed: it still provides ``distutils``. (Contributed by " "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1271 +#: ../../whatsnew/3.12.rst:1312 +msgid "ensurepip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1314 msgid "" -":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " -"and stop installing setuptools in environments created by :mod:`venv`." +"Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " +"installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1808,7 +1867,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1818,228 +1877,253 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1330 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1333 +msgid "enum" +msgstr "" + +#: ../../whatsnew/3.12.rst:1335 msgid "" -":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " +"Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1293 +#: ../../whatsnew/3.12.rst:1340 +msgid "ftplib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1342 msgid "" -":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " +"Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1347 +msgid "gzip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1349 msgid "" -":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " +"Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " "extension if it was not present. (Contributed by Victor Stinner in :gh:" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1356 +msgid "hashlib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1358 msgid "" -":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." +"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " "OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " "of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1309 +#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +msgid "importlib" +msgstr "importlib" + +#: ../../whatsnew/3.12.rst:1367 msgid "" -":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " -"have now been completed:" +"Many previously deprecated cleanups in :mod:`importlib` have now been " +"completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1370 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1315 +#: ../../whatsnew/3.12.rst:1373 msgid "" -"``importlib.util.set_package`` has been removed. (Contributed by Brett " -"Cannon in :gh:`65961`.)" +"``importlib.util.set_package``, ``importlib.util.set_loader`` and " +"``importlib.util.module_for_loader`` have all been removed. (Contributed by " +"Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1318 +#: ../../whatsnew/3.12.rst:1377 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1380 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +msgid "imp" +msgstr "imp" + +#: ../../whatsnew/3.12.rst:1386 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1389 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1330 -msgid "imp" -msgstr "imp" - -#: ../../whatsnew/3.12.rst:1330 -msgid "importlib" -msgstr "importlib" - -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1394 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1394 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1395 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1395 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1396 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1396 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1397 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1397 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1398 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1398 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1399 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1399 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1400 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1400 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1401 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1401 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1402 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1402 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1403 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1403 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1406 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1421 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1423 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1425 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1426 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1427 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1428 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1430 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1432 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1374 +#: ../../whatsnew/3.12.rst:1437 +msgid "io" +msgstr "" + +#: ../../whatsnew/3.12.rst:1439 msgid "" -":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " +"Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." "open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." "open` is also a static method. (Contributed by Victor Stinner in :gh:" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1446 +msgid "locale" +msgstr "" + +#: ../../whatsnew/3.12.rst:1448 msgid "" -":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " -"Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " +"Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " +"3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1452 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2047,27 +2131,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1463 msgid "" -":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " -"deprecated in Python 3.10, are now removed:" +"The following undocumented :mod:`sqlite3` features, deprecated in Python " +"3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1466 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1467 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1469 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1472 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2075,22 +2159,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1477 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1408 -msgid ":mod:`ssl`:" +#: ../../whatsnew/3.12.rst:1480 +msgid "ssl" msgstr "" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1482 msgid "" -"Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " -"3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " -"by Victor Stinner in :gh:`94199`.)" +"Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " +"Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " +"(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1486 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2098,7 +2182,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1492 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2109,205 +2193,220 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1429 -msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1504 +msgid "Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1506 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1511 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1437 -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1439 -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1441 -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1517 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1512 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1512 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1513 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1514 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1515 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1516 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1517 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1517 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1518 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1444 -#: ../../whatsnew/3.12.rst:1445 ../../whatsnew/3.12.rst:1446 -#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:1448 -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1524 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1519 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1520 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1521 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1522 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1523 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1523 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1524 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1524 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1528 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1534 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1538 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1541 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1544 +msgid "webbrowser" +msgstr "" + +#: ../../whatsnew/3.12.rst:1546 msgid "" -":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" -"`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " -"Skipstone, Iceape, Firebird, and Firefox versions 35 and below (:gh:" -"`102871`)." +"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " +"Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1551 +msgid "xml.etree.ElementTree" +msgstr "" + +#: ../../whatsnew/3.12.rst:1553 msgid "" -":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " -"method of the pure Python implementation, deprecated in Python 3.10, use " -"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." -"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " -"(Contributed by Victor Stinner in :gh:`94383`.)" +"Remove the ``ElementTree.Element.copy()`` method of the pure Python " +"implementation, deprecated in Python 3.10, use the :func:`copy.copy` " +"function instead. The C implementation of :mod:`xml.etree.ElementTree` has " +"no ``copy()`` method, only a ``__copy__()`` method. (Contributed by Victor " +"Stinner in :gh:`94383`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1560 +msgid "zipimport" msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1562 msgid "" -":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " +"Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1568 +msgid "Others" +msgstr "" + +#: ../../whatsnew/3.12.rst:1570 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1575 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2317,21 +2416,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1499 ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1588 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1592 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1594 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2340,7 +2439,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2352,7 +2451,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1609 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2362,21 +2461,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1619 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1624 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2384,7 +2483,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1629 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2396,7 +2495,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1638 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2408,64 +2507,64 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1651 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1656 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" "pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" "strings and the tokens described in :pep:`701` are now produced instead: " -"``FSTRING_START``, ``FSRING_MIDDLE`` and ``FSTRING_END`` are now emitted for " -"f-string \"string\" parts in addition to the appropriate tokens for the " +"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " +"for f-string \"string\" parts in addition to the appropriate tokens for the " "tokenization in the expression components. For example for the f-string " "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1667 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1682 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1685 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1688 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1691 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1695 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1697 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2474,21 +2573,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1703 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1708 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1625 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2497,46 +2596,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1631 +#: ../../whatsnew/3.12.rst:1718 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1633 +#: ../../whatsnew/3.12.rst:1720 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1721 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1635 +#: ../../whatsnew/3.12.rst:1722 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1724 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1726 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1641 +#: ../../whatsnew/3.12.rst:1728 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1732 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1649 +#: ../../whatsnew/3.12.rst:1736 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1742 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2544,84 +2643,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1748 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1663 +#: ../../whatsnew/3.12.rst:1750 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1751 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1753 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1755 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1756 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1757 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1759 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1762 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1677 +#: ../../whatsnew/3.12.rst:1764 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1767 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1769 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1771 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1774 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1777 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1779 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2629,29 +2728,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1784 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1788 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1789 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1790 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1791 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1793 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2662,7 +2761,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1801 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2670,32 +2769,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1806 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1810 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1811 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:1812 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1814 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1818 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2703,14 +2802,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1824 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1828 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2719,28 +2818,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1834 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1838 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1843 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1847 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2750,14 +2849,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1855 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1859 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2765,71 +2864,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1864 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1781 +#: ../../whatsnew/3.12.rst:1868 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1871 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1785 +#: ../../whatsnew/3.12.rst:1872 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1873 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1787 +#: ../../whatsnew/3.12.rst:1874 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1875 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1876 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1877 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1878 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1879 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1795 +#: ../../whatsnew/3.12.rst:1882 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1794 +#: ../../whatsnew/3.12.rst:1881 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1797 +#: ../../whatsnew/3.12.rst:1884 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1799 +#: ../../whatsnew/3.12.rst:1886 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2837,27 +2936,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1892 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1813 +#: ../../whatsnew/3.12.rst:1900 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1816 +#: ../../whatsnew/3.12.rst:1903 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1907 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2866,7 +2965,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1827 +#: ../../whatsnew/3.12.rst:1914 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2874,13 +2973,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1832 +#: ../../whatsnew/3.12.rst:1919 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1923 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2889,7 +2988,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1929 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2898,13 +2997,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1848 +#: ../../whatsnew/3.12.rst:1935 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1939 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2918,7 +3017,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1951 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2926,7 +3025,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1869 +#: ../../whatsnew/3.12.rst:1956 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2934,7 +3033,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1961 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2942,7 +3041,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1966 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2950,25 +3049,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1971 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1887 +#: ../../whatsnew/3.12.rst:1974 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1975 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1976 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1978 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2976,14 +3075,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1983 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1987 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2992,17 +3091,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:1994 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1996 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1998 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3010,20 +3109,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:2003 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:2007 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:2010 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3031,14 +3130,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:2015 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:2019 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3049,15 +3148,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:2027 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:2028 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:2030 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3066,281 +3165,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:2040 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:2042 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:2051 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:2052 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2053 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:2054 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:2055 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:2057 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:2058 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:2059 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:2060 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:2061 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:2062 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:2065 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:2069 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:2072 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2075 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2078 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2080 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2082 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2085 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2000 +#: ../../whatsnew/3.12.rst:2087 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2001 +#: ../../whatsnew/3.12.rst:2088 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2089 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2090 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2092 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2095 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2100 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2016 +#: ../../whatsnew/3.12.rst:2103 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2021 +#: ../../whatsnew/3.12.rst:2108 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2111 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2114 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2122 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2127 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2129 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2130 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2131 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2132 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2133 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2134 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2135 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2136 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2137 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2139 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2142 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2145 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From d24c13843f1a225796c0590ae07ddb3843047471 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:33:17 +0000 Subject: [PATCH 079/105] Sync with CPython 3.12 (#664) * sync with cpython c06ac1b4 * fix: resolve fuzzy entries * sync with cpython dbbe0eeb * sync with cpython 27d5ea29 * sync with cpython 0102faf0 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- Makefile | 5 +- c-api/exceptions.po | 6 +- c-api/init_config.po | 2 +- c-api/intro.po | 231 +-- c-api/structures.po | 204 +-- c-api/type.po | 79 +- extending/windows.po | 4 +- howto/clinic.po | 2554 +-------------------------- howto/enum.po | 104 +- howto/instrumentation.po | 62 +- howto/logging-cookbook.po | 8 +- howto/logging.po | 4 +- howto/perf_profiling.po | 16 +- howto/urllib2.po | 43 +- library/__main__.po | 10 +- library/asyncio-llapi-index.po | 97 +- library/asyncio-protocol.po | 46 +- library/asyncio-task.po | 18 +- library/asyncio.po | 14 +- library/binascii.po | 56 +- library/cmdline.po | 226 +++ library/codecs.po | 994 +++++------ library/compileall.po | 120 +- library/concurrent.futures.po | 113 +- library/ctypes.po | 426 ++--- library/dataclasses.po | 140 +- library/devmode.po | 57 +- library/difflib.po | 26 +- library/dis.po | 669 +++---- library/ensurepip.po | 9 +- library/exceptions.po | 284 +-- library/functions.po | 4 +- library/gettext.po | 250 ++- library/gzip.po | 54 +- library/html.parser.po | 18 +- library/http.cookiejar.po | 13 +- library/http.server.po | 6 +- library/idle.po | 2 +- library/inspect.po | 86 +- library/json.po | 8 +- library/logging.po | 14 +- library/lzma.po | 67 +- library/multiprocessing.po | 1060 ++++++------ library/os.po | 596 ++++--- library/pickletools.po | 34 +- library/profile.po | 262 +-- library/py_compile.po | 23 +- library/re.po | 7 +- library/shutil.po | 167 +- library/site.po | 104 +- library/socket.po | 4 +- library/socketserver.po | 205 ++- library/sqlite3.po | 7 +- library/statistics.po | 387 +++-- library/symtable.po | 99 +- library/sys.monitoring.po | 4 +- library/sys.po | 8 +- library/sysconfig.po | 471 +++-- library/textwrap.po | 6 +- library/timeit.po | 4 +- library/tty.po | 12 +- library/typing.po | 552 +++--- library/urllib.error.po | 13 +- library/urllib.parse.po | 24 +- library/venv.po | 209 ++- library/weakref.po | 121 +- library/wsgiref.po | 87 +- library/xml.etree.elementtree.po | 198 +-- library/zipimport.po | 4 +- reference/compound_stmts.po | 378 ++-- reference/lexical_analysis.po | 54 +- tutorial/controlflow.po | 22 +- tutorial/floatingpoint.po | 6 +- tutorial/introduction.po | 20 +- using/cmdline.po | 131 +- using/configure.po | 103 +- using/unix.po | 25 +- using/windows.po | 72 +- whatsnew/2.0.po | 12 +- whatsnew/2.3.po | 6 +- whatsnew/2.6.po | 13 +- whatsnew/3.10.po | 30 +- whatsnew/3.11.po | 201 +-- whatsnew/3.12.po | 2792 ++++++++++++++++++------------ whatsnew/3.3.po | 17 +- whatsnew/3.4.po | 33 +- whatsnew/3.7.po | 4 +- whatsnew/3.8.po | 13 +- whatsnew/3.9.po | 773 ++++----- 89 files changed, 7549 insertions(+), 8973 deletions(-) create mode 100644 library/cmdline.po diff --git a/Makefile b/Makefile index 3f9c041ab0..4a097c90e9 100644 --- a/Makefile +++ b/Makefile @@ -105,10 +105,7 @@ endif mkdir -p "$$(dirname "$$PO")";\ if [ -f "$$PO" ];\ then\ - case "$$POT" in\ - *whatsnew*) msgmerge --lang=$(LANGUAGE) --backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\ - *) msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT" ;;\ - esac\ + msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT";\ else\ msgcat --lang=$(LANGUAGE) -o "$$PO" "$$POT";\ fi\ diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 5a9c81c291..023dd83533 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -809,8 +809,8 @@ msgstr "" msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " -"the exceptions that need to be raised. This list contains the the unhandled " -"part of *orig*, if any, as well as the exceptions that were raised from the :" +"the exceptions that need to be raised. This list contains the unhandled part " +"of *orig*, if any, as well as the exceptions that were raised from the :" "keyword:`!except*` clauses (so they have a different traceback from *orig*) " "and those that were reraised (and have the same traceback as *orig*). Return " "the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " diff --git a/c-api/init_config.po b/c-api/init_config.po index ef69a88c37..b1f04e9889 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -662,7 +662,7 @@ msgstr "" #: ../../c-api/init_config.rst:548 msgid "Command line arguments: :data:`sys.argv`." -msgstr "" +msgstr "命令列引數::data:`sys.argv`。" #: ../../c-api/init_config.rst:550 msgid "" diff --git a/c-api/intro.po b/c-api/intro.po index 0808d31558..c755198b70 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,10 +200,25 @@ msgstr "" "macro:`Py_RETURN_NONE`),其他是更通用的工具程式。以下並不一定是完整的列表。" #: ../../c-api/intro.rst:110 +msgid "" +"Declare an extension module ``PyInit`` initialization function. The function " +"return type is :c:expr:`PyObject*`. The macro declares any special linkage " +"declarations required by the platform, and for C++ declares the function as " +"``extern \"C\"``." +msgstr "" + +#: ../../c-api/intro.rst:115 +msgid "" +"The initialization function must be named :samp:`PyInit_{name}`, where " +"*name* is the name of the module, and should be the only non-\\ ``static`` " +"item defined in the module file. Example::" +msgstr "" + +#: ../../c-api/intro.rst:134 msgid "Return the absolute value of ``x``." msgstr "回傳 ``x`` 的絕對值。" -#: ../../c-api/intro.rst:116 +#: ../../c-api/intro.rst:140 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " "ignore it and decides to not inline the function." @@ -211,7 +226,7 @@ msgstr "" "要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" "定不嵌入該函式。" -#: ../../c-api/intro.rst:119 +#: ../../c-api/intro.rst:143 msgid "" "It can be used to inline performance critical static inline functions when " "building Python in debug mode with function inlining disabled. For example, " @@ -220,7 +235,7 @@ msgstr "" "在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" "式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" -#: ../../c-api/intro.rst:123 +#: ../../c-api/intro.rst:147 msgid "" "Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " "worse performances (due to increased code size for example). The compiler is " @@ -229,7 +244,7 @@ msgstr "" "盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" -#: ../../c-api/intro.rst:127 +#: ../../c-api/intro.rst:151 msgid "" "If Python is :ref:`built in debug mode ` (if the ``Py_DEBUG`` " "macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing." @@ -237,14 +252,14 @@ msgstr "" "如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 ``Py_DEBUG`` " "巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" -#: ../../c-api/intro.rst:130 +#: ../../c-api/intro.rst:154 msgid "It must be specified before the function return type. Usage::" msgstr "" "它必須在函式回傳型別之前被指定。用法:\n" "\n" "::" -#: ../../c-api/intro.rst:138 +#: ../../c-api/intro.rst:162 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " "255]. This macro returns ``c`` cast to an ``unsigned char``." @@ -252,25 +267,25 @@ msgstr "" "引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" "換為 ``unsigned char`` 並回傳。" -#: ../../c-api/intro.rst:143 +#: ../../c-api/intro.rst:167 msgid "" "Use this for deprecated declarations. The macro must be placed before the " "symbol name." msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" -#: ../../c-api/intro.rst:146 ../../c-api/intro.rst:232 -#: ../../c-api/intro.rst:250 +#: ../../c-api/intro.rst:170 ../../c-api/intro.rst:256 +#: ../../c-api/intro.rst:274 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/intro.rst:150 +#: ../../c-api/intro.rst:174 msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" -#: ../../c-api/intro.rst:155 +#: ../../c-api/intro.rst:179 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." @@ -278,19 +293,19 @@ msgstr "" "類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " "(請見 :c:member:`PyConfig.use_environment`)。" -#: ../../c-api/intro.rst:160 +#: ../../c-api/intro.rst:184 msgid "Return the maximum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" -#: ../../c-api/intro.rst:166 +#: ../../c-api/intro.rst:190 msgid "Return the size of a structure (``type``) ``member`` in bytes." msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" -#: ../../c-api/intro.rst:172 +#: ../../c-api/intro.rst:196 msgid "Return the minimum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" -#: ../../c-api/intro.rst:178 +#: ../../c-api/intro.rst:202 msgid "" "Disable inlining on a function. For example, it reduces the C stack " "consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" @@ -299,20 +314,20 @@ msgstr "" "禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" "很有用(請參閱 :issue:`33720`)。" -#: ../../c-api/intro.rst:182 +#: ../../c-api/intro.rst:206 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../c-api/intro.rst:190 +#: ../../c-api/intro.rst:214 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" "將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:197 +#: ../../c-api/intro.rst:221 msgid "" "Use this when you have a code path that cannot be reached by design. For " "example, in the ``default:`` clause in a ``switch`` statement for which all " @@ -323,7 +338,7 @@ msgstr "" "蓋了所有可能值的 ``switch`` 陳述式中的 ``default:`` 子句。在你可能想要呼叫 " "``assert(0)`` 或 ``abort()`` 的地方使用它。" -#: ../../c-api/intro.rst:202 +#: ../../c-api/intro.rst:226 msgid "" "In release mode, the macro helps the compiler to optimize the code, and " "avoids a warning about unreachable code. For example, the macro is " @@ -333,7 +348,7 @@ msgstr "" "程式碼的警告。例如該巨集是在發布模式下於 GCC 使用 " "``__builtin_unreachable()`` 來實作。" -#: ../../c-api/intro.rst:206 +#: ../../c-api/intro.rst:230 msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " "returns but that is not declared :c:macro:`_Py_NO_RETURN`." @@ -341,7 +356,7 @@ msgstr "" "``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" "`_Py_NO_RETURN` 的函式之呼叫後使用。" -#: ../../c-api/intro.rst:209 +#: ../../c-api/intro.rst:233 msgid "" "If a code path is very unlikely code but can be reached under exceptional " "case, this macro must not be used. For example, under low memory condition " @@ -353,7 +368,7 @@ msgstr "" "憶體條件下或系統呼叫回傳了超出預期範圍的值。在這種情況下,最好將錯誤回報給呼" "叫者。如果無法回報錯誤則可以使用 :c:func:`Py_FatalError`。" -#: ../../c-api/intro.rst:219 +#: ../../c-api/intro.rst:243 msgid "" "Use this for unused arguments in a function definition to silence compiler " "warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." @@ -361,7 +376,7 @@ msgstr "" "將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " "Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:226 +#: ../../c-api/intro.rst:250 msgid "" "Creates a variable with name ``name`` that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." @@ -369,7 +384,7 @@ msgstr "" "建立一個名為 ``name`` 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" "字串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:229 +#: ../../c-api/intro.rst:253 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -377,13 +392,13 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" "文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:244 +#: ../../c-api/intro.rst:268 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:247 +#: ../../c-api/intro.rst:271 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -391,11 +406,11 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" "字串下建置 Python。" -#: ../../c-api/intro.rst:262 +#: ../../c-api/intro.rst:286 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:266 +#: ../../c-api/intro.rst:290 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -418,7 +433,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:277 +#: ../../c-api/intro.rst:301 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -434,11 +449,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:288 +#: ../../c-api/intro.rst:312 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:290 +#: ../../c-api/intro.rst:314 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -461,7 +476,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。 (此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:307 +#: ../../c-api/intro.rst:331 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -489,7 +504,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:323 +#: ../../c-api/intro.rst:347 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -515,7 +530,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:339 +#: ../../c-api/intro.rst:363 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -531,7 +546,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:347 +#: ../../c-api/intro.rst:371 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -546,11 +561,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:358 +#: ../../c-api/intro.rst:382 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:360 +#: ../../c-api/intro.rst:384 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -575,7 +590,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:373 +#: ../../c-api/intro.rst:397 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -587,7 +602,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:383 +#: ../../c-api/intro.rst:407 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -604,7 +619,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:398 +#: ../../c-api/intro.rst:422 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -615,7 +630,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:427 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -627,7 +642,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:408 +#: ../../c-api/intro.rst:432 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -635,7 +650,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:411 +#: ../../c-api/intro.rst:435 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -650,7 +665,7 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:422 +#: ../../c-api/intro.rst:446 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -665,7 +680,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:452 +#: ../../c-api/intro.rst:476 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -683,7 +698,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:461 +#: ../../c-api/intro.rst:485 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -699,7 +714,7 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:473 +#: ../../c-api/intro.rst:497 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -710,11 +725,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:537 +#: ../../c-api/intro.rst:561 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:539 +#: ../../c-api/intro.rst:563 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -729,7 +744,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:549 +#: ../../c-api/intro.rst:573 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 " @@ -740,11 +755,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:558 +#: ../../c-api/intro.rst:582 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:560 +#: ../../c-api/intro.rst:584 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -756,7 +771,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:568 +#: ../../c-api/intro.rst:592 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 " @@ -778,7 +793,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:583 +#: ../../c-api/intro.rst:607 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 " @@ -797,7 +812,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:593 +#: ../../c-api/intro.rst:617 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -816,7 +831,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:605 +#: ../../c-api/intro.rst:629 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." @@ -836,7 +851,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊幀 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:640 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 " @@ -851,7 +866,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:625 +#: ../../c-api/intro.rst:649 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 " @@ -865,11 +880,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:640 +#: ../../c-api/intro.rst:664 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:692 +#: ../../c-api/intro.rst:716 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:" @@ -888,11 +903,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:730 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:708 +#: ../../c-api/intro.rst:732 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 " @@ -902,7 +917,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:721 +#: ../../c-api/intro.rst:745 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -913,7 +928,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:726 +#: ../../c-api/intro.rst:750 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 " @@ -925,7 +940,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:731 +#: ../../c-api/intro.rst:755 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -943,7 +958,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:740 +#: ../../c-api/intro.rst:764 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/" @@ -960,7 +975,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:779 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -977,7 +992,7 @@ msgstr "" "`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:" "`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:765 +#: ../../c-api/intro.rst:789 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -998,11 +1013,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:779 +#: ../../c-api/intro.rst:803 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:781 +#: ../../c-api/intro.rst:805 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 " @@ -1011,7 +1026,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:785 +#: ../../c-api/intro.rst:809 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 " @@ -1024,7 +1039,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:791 +#: ../../c-api/intro.rst:815 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1048,7 +1063,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:802 +#: ../../c-api/intro.rst:826 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1063,7 +1078,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:809 +#: ../../c-api/intro.rst:833 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1071,130 +1086,130 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_INCREF()" msgstr "Py_INCREF()" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_DECREF()" msgstr "Py_DECREF()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyList_SetItem()" msgstr "PyList_SetItem()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyTuple_SetItem()" msgstr "PyTuple_SetItem()" -#: ../../c-api/intro.rst:450 +#: ../../c-api/intro.rst:474 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PyList_GetItem()" msgstr "PyList_GetItem()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PySequence_GetItem()" msgstr "PySequence_GetItem()" -#: ../../c-api/intro.rst:499 +#: ../../c-api/intro.rst:523 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:531 ../../c-api/intro.rst:623 +#: ../../c-api/intro.rst:555 ../../c-api/intro.rst:647 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:566 +#: ../../c-api/intro.rst:590 msgid "PyErr_Occurred()" msgstr "PyErr_Occurred()" -#: ../../c-api/intro.rst:579 +#: ../../c-api/intro.rst:603 msgid "PyErr_SetString()" msgstr "PyErr_SetString()" -#: ../../c-api/intro.rst:579 ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 msgid "PyErr_Clear()" msgstr "PyErr_Clear()" -#: ../../c-api/intro.rst:603 +#: ../../c-api/intro.rst:627 msgid "exc_info() (in module sys)" msgstr "exc_info() (sys 模組中)" -#: ../../c-api/intro.rst:638 ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "PyErr_ExceptionMatches()" msgstr "PyErr_ExceptionMatches()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "Py_XDECREF()" msgstr "Py_XDECREF()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPrefix()" msgstr "Py_GetPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetExecPrefix()" msgstr "Py_GetExecPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetProgramFullPath()" msgstr "Py_GetProgramFullPath()" -#: ../../c-api/intro.rst:763 +#: ../../c-api/intro.rst:787 msgid "Py_IsInitialized()" msgstr "Py_IsInitialized()" diff --git a/c-api/structures.po b/c-api/structures.po index 5eb3082c9e..d4029f1aec 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+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-" @@ -414,41 +413,46 @@ msgstr "" #: ../../c-api/structures.rst:408 msgid "" "Structure which describes an attribute of a type which corresponds to a C " -"struct member. Its fields are, in order:" +"struct member. When defining a class, put a NULL-terminated array of these " +"structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" #: ../../c-api/structures.rst:413 +msgid "Its fields are, in order:" +msgstr "" + +#: ../../c-api/structures.rst:417 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:416 +#: ../../c-api/structures.rst:420 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:420 +#: ../../c-api/structures.rst:424 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:428 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:433 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:437 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:441 msgid "" "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " "both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" @@ -457,7 +461,7 @@ msgid "" "`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:450 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -466,11 +470,11 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:458 +#: ../../c-api/structures.rst:462 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:464 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " @@ -479,77 +483,77 @@ msgid "" "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:468 +#: ../../c-api/structures.rst:472 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:473 +#: ../../c-api/structures.rst:477 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:479 +#: ../../c-api/structures.rst:483 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:484 +#: ../../c-api/structures.rst:488 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:490 +#: ../../c-api/structures.rst:494 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:496 +#: ../../c-api/structures.rst:500 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:498 +#: ../../c-api/structures.rst:502 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:506 msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:506 +#: ../../c-api/structures.rst:510 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:515 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:519 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " "negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:520 +#: ../../c-api/structures.rst:524 msgid "" "This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:536 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -558,7 +562,7 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:543 +#: ../../c-api/structures.rst:547 msgid "" "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" "macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " @@ -567,11 +571,11 @@ msgid "" "names." msgstr "" -#: ../../c-api/structures.rst:552 +#: ../../c-api/structures.rst:556 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:554 +#: ../../c-api/structures.rst:558 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -580,147 +584,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:562 +#: ../../c-api/structures.rst:566 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:568 +#: ../../c-api/structures.rst:572 msgid ":c:expr:`char`" msgstr "" -#: ../../c-api/structures.rst:568 ../../c-api/structures.rst:569 -#: ../../c-api/structures.rst:570 ../../c-api/structures.rst:571 #: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 #: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 #: ../../c-api/structures.rst:576 ../../c-api/structures.rst:577 -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:578 ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:580 ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:582 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:573 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:574 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:571 +#: ../../c-api/structures.rst:575 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:576 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:577 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:578 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:579 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:580 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:581 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:582 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:583 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:579 ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:584 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:587 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:587 ../../c-api/structures.rst:588 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:588 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:589 +#: ../../c-api/structures.rst:593 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:594 +#: ../../c-api/structures.rst:598 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:596 +#: ../../c-api/structures.rst:600 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:598 +#: ../../c-api/structures.rst:602 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:624 +#: ../../c-api/structures.rst:628 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -728,69 +732,69 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:632 +#: ../../c-api/structures.rst:636 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:638 +#: ../../c-api/structures.rst:642 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:641 +#: ../../c-api/structures.rst:645 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:645 +#: ../../c-api/structures.rst:649 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:650 +#: ../../c-api/structures.rst:654 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:654 +#: ../../c-api/structures.rst:658 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:658 +#: ../../c-api/structures.rst:662 msgid "" "Optional C function to set or delete the attribute, if omitted the attribute " "is readonly." msgstr "" -#: ../../c-api/structures.rst:662 +#: ../../c-api/structures.rst:666 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:670 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:668 +#: ../../c-api/structures.rst:672 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:673 +#: ../../c-api/structures.rst:677 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:676 +#: ../../c-api/structures.rst:680 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:681 +#: ../../c-api/structures.rst:685 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." @@ -808,94 +812,94 @@ msgstr "classmethod" msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:538 +#: ../../c-api/structures.rst:542 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "structmember.h" msgstr "structmember.h" diff --git a/c-api/type.po b/c-api/type.po index a9f1005b76..124180d16e 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+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-" @@ -533,77 +532,81 @@ msgstr "" #: ../../c-api/type.rst:464 msgid "" -"The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" -"type:`PyType_Slot`:" +"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:467 -msgid ":c:member:`~PyTypeObject.tp_dict`" -msgstr ":c:member:`~PyTypeObject.tp_dict`" +#: ../../c-api/type.rst:466 +msgid "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +msgstr "" #: ../../c-api/type.rst:468 -msgid ":c:member:`~PyTypeObject.tp_mro`" -msgstr ":c:member:`~PyTypeObject.tp_mro`" - -#: ../../c-api/type.rst:469 -msgid ":c:member:`~PyTypeObject.tp_cache`" -msgstr ":c:member:`~PyTypeObject.tp_cache`" +msgid "" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +msgstr "" +":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT`)" #: ../../c-api/type.rst:470 -msgid ":c:member:`~PyTypeObject.tp_subclasses`" -msgstr ":c:member:`~PyTypeObject.tp_subclasses`" - -#: ../../c-api/type.rst:471 -msgid ":c:member:`~PyTypeObject.tp_weaklist`" -msgstr ":c:member:`~PyTypeObject.tp_weaklist`" - -#: ../../c-api/type.rst:472 -msgid ":c:member:`~PyTypeObject.tp_vectorcall`" -msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " +"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" +msgstr "" +":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef " +"` 中的 ``\"__vectorcalloffset__\"``)" -#: ../../c-api/type.rst:473 +#: ../../c-api/type.rst:474 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead)" +"If it is not possible to switch to a ``MANAGED`` flag (for example, for " +"vectorcall or to support Python older than 3.12), specify the offset in :c:" +"member:`Py_tp_members `. See :ref:`PyMemberDef " +"documentation ` for details." +msgstr "" + +#: ../../c-api/type.rst:480 +msgid "The following fields cannot be set at all when creating a heap type:" msgstr "" -#: ../../c-api/type.rst:475 +#: ../../c-api/type.rst:482 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_DICT` instead)" +":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." +"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" msgstr "" -#: ../../c-api/type.rst:477 +#: ../../c-api/type.rst:486 msgid "" -":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " -"`)" +"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." +"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." +"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/type.rst:480 +#: ../../c-api/type.rst:493 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:487 +#: ../../c-api/type.rst:500 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:489 +#: ../../c-api/type.rst:502 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:496 +#: ../../c-api/type.rst:509 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:499 +#: ../../c-api/type.rst:512 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/extending/windows.po b/extending/windows.po index 5e2c101fb5..24a09caf88 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -185,5 +185,5 @@ 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 " "the Project Settings dialog, Link tab, to specify *ignore default " -"libraries*. Add the correct :file:`msvcrtxx.lib` to the list of libraries." +"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." msgstr "" diff --git a/howto/clinic.po b/howto/clinic.po index 469e7f45c1..c039a32a4c 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-08 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 00:03+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-" @@ -18,2550 +18,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/clinic.rst:7 +#: ../../howto/clinic.rst:8 msgid "Argument Clinic How-To" -msgstr "" - -#: ../../howto/clinic.rst:0 -msgid "author" -msgstr "作者" - -#: ../../howto/clinic.rst:9 -msgid "Larry Hastings" -msgstr "Larry Hastings" - -#: ../../howto/clinic.rst:11 -msgid "**Source code:** :source:`Tools/clinic/clinic.py`." -msgstr "**原始碼:** :source:`Tools/clinic/clinic.py`。" - -#: ../../howto/clinic.rst:7 -msgid "Abstract" -msgstr "摘要" - -#: ../../howto/clinic.rst:15 -msgid "" -"Argument Clinic is a preprocessor for CPython C files. It was introduced in " -"Python 3.4 with :pep:`436`, in order to provide introspection signatures, " -"and to generate performant and tailor-made boilerplate code for argument " -"parsing in CPython builtins, module level functions, and class methods. This " -"document is divided in four major sections:" -msgstr "" - -#: ../../howto/clinic.rst:23 -msgid "" -":ref:`clinic-background` talks about the basic concepts and goals of " -"Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:25 -msgid "" -":ref:`clinic-reference` describes the command-line interface and Argument " -"Clinic terminology." -msgstr "" - -#: ../../howto/clinic.rst:27 -msgid "" -":ref:`clinic-tutorial` guides you through all the steps required to adapt an " -"existing C function to Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:29 -msgid ":ref:`clinic-howtos` details how to handle specific tasks." -msgstr "" - -#: ../../howto/clinic.rst:34 -msgid "" -"Argument Clinic is considered internal-only for CPython. Its use is not " -"supported for files outside CPython, and no guarantees are made regarding " -"backwards compatibility for future versions. In other words: if you " -"maintain an external C extension for CPython, you're welcome to experiment " -"with Argument Clinic in your own code. But the version of Argument Clinic " -"that ships with the next version of CPython *could* be totally incompatible " -"and break all your code." -msgstr "" - -#: ../../howto/clinic.rst:47 -msgid "Background" -msgstr "" - -#: ../../howto/clinic.rst:50 -msgid "Basic concepts" -msgstr "" - -#: ../../howto/clinic.rst:52 -msgid "" -"When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " -"via ``make clinic``, it will scan over the input files looking for :term:" -"`start lines `:" -msgstr "" - -#: ../../howto/clinic.rst:60 -msgid "When it finds one, it reads everything up to the :term:`end line`:" -msgstr "" - -#: ../../howto/clinic.rst:66 -msgid "" -"Everything in between these two lines is Argument Clinic :term:`input`. When " -"Argument Clinic parses input, it generates :term:`output`. The output is " -"rewritten into the C file immediately after the input, followed by a :term:" -"`checksum line`. All of these lines, including the :term:`start line` and :" -"term:`checksum line`, are collectively called an Argument Clinic :term:" -"`block`:" -msgstr "" - -#: ../../howto/clinic.rst:81 -msgid "" -"If you run Argument Clinic on the same file a second time, Argument Clinic " -"will discard the old :term:`output` and write out the new output with a " -"fresh :term:`checksum line`. If the :term:`input` hasn't changed, the output " -"won't change either." -msgstr "" - -#: ../../howto/clinic.rst:88 -msgid "" -"You should never modify the output of an Argument Clinic block, as any " -"change will be lost in future Argument Clinic runs; Argument Clinic will " -"detect an output checksum mismatch and regenerate the correct output. If you " -"are not happy with the generated output, you should instead change the input " -"until it produces the output you want." -msgstr "" - -#: ../../howto/clinic.rst:99 -msgid "Reference" -msgstr "" - -#: ../../howto/clinic.rst:105 -msgid "Terminology" -msgstr "" - -#: ../../howto/clinic.rst:108 -msgid "start line" -msgstr "" - -#: ../../howto/clinic.rst:110 -msgid "" -"The line ``/*[clinic input]``. This line marks the beginning of Argument " -"Clinic input. Note that the *start line* opens a C block comment." -msgstr "" - -#: ../../howto/clinic.rst:113 -msgid "end line" -msgstr "" - -#: ../../howto/clinic.rst:115 -msgid "" -"The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " -"of Argument Clinic :term:`input`, but at the same time marks the _start_ of " -"Argument Clinic :term:`output`, thus the text *\"clinic start start " -"generated code\"* Note that the *end line* closes the C block comment opened " -"by the *start line*." -msgstr "" - -#: ../../howto/clinic.rst:121 -msgid "checksum" -msgstr "" - -#: ../../howto/clinic.rst:123 -msgid "" -"A hash to distinguish unique :term:`inputs ` and :term:`outputs " -"`." -msgstr "" - -#: ../../howto/clinic.rst:125 -msgid "checksum line" -msgstr "" - -#: ../../howto/clinic.rst:127 -msgid "" -"A line that looks like ``/*[clinic end generated code: ...]*/``. The three " -"dots will be replaced by a :term:`checksum` generated from the :term:" -"`input`, and a :term:`checksum` generated from the :term:`output`. The " -"checksum line marks the end of Argument Clinic generated code, and is used " -"by Argument Clinic to determine if it needs to regenerate output." -msgstr "" - -#: ../../howto/clinic.rst:133 -msgid "input" -msgstr "" - -#: ../../howto/clinic.rst:135 -msgid "" -"The text between the :term:`start line` and the :term:`end line`. Note that " -"the start and end lines open and close a C block comment; the *input* is " -"thus a part of that same C block comment." -msgstr "" - -#: ../../howto/clinic.rst:138 -msgid "output" -msgstr "" - -#: ../../howto/clinic.rst:140 -msgid "The text between the :term:`end line` and the :term:`checksum line`." -msgstr "" - -#: ../../howto/clinic.rst:141 -msgid "block" -msgstr "" - -#: ../../howto/clinic.rst:143 -msgid "" -"All text from the :term:`start line` to the :term:`checksum line` " -"inclusively." -msgstr "" - -#: ../../howto/clinic.rst:149 -msgid "Command-line interface" -msgstr "" - -#: ../../howto/clinic.rst:151 -msgid "" -"The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " -"to process a single source file, like this:" -msgstr "" - -#: ../../howto/clinic.rst:158 -msgid "The CLI supports the following options:" -msgstr "" - -#: ../../howto/clinic.rst:165 -msgid "Print CLI usage." -msgstr "" - -#: ../../howto/clinic.rst:169 -msgid "Force output regeneration." -msgstr "" - -#: ../../howto/clinic.rst:173 -msgid "Redirect file output to OUTPUT" -msgstr "" - -#: ../../howto/clinic.rst:177 -msgid "Enable verbose mode." -msgstr "" - -#: ../../howto/clinic.rst:181 -msgid "Print a list of all supported converters and return converters." -msgstr "" - -#: ../../howto/clinic.rst:185 -msgid "Walk :option:`--srcdir` to run over all relevant files." -msgstr "" - -#: ../../howto/clinic.rst:189 -msgid "The directory tree to walk in :option:`--make` mode." -msgstr "" - -#: ../../howto/clinic.rst:193 -msgid "The list of files to process." -msgstr "" - -#: ../../howto/clinic.rst:199 -msgid "Classes for extending Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:205 -msgid "" -"The base class for all converters. See :ref:`clinic-howto-custom-converter` " -"for how to subclass this class." -msgstr "" - -#: ../../howto/clinic.rst:210 -msgid "" -"The C type to use for this variable. :attr:`!type` should be a Python string " -"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " -"string should end with ``' *'``." -msgstr "" - -#: ../../howto/clinic.rst:217 -msgid "" -"The Python default value for this parameter, as a Python value. Or the magic " -"value ``unspecified`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:222 -msgid "" -":attr:`!default` as it should appear in Python code, as a string. Or " -"``None`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:228 -msgid "" -":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " -"there is no default." -msgstr "" - -#: ../../howto/clinic.rst:234 -msgid "" -"The default value used to initialize the C variable when there is no " -"default, but not specifying a default may result in an \"uninitialized " -"variable\" warning. This can easily happen when using option groups—" -"although properly written code will never actually use this value, the " -"variable does get passed in to the impl, and the C compiler will complain " -"about the \"use\" of the uninitialized value. This value should always be a " -"non-empty string." -msgstr "" - -#: ../../howto/clinic.rst:246 -msgid "The name of the C converter function, as a string." -msgstr "" - -#: ../../howto/clinic.rst:250 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into the impl function." -msgstr "" - -#: ../../howto/clinic.rst:256 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." -msgstr "" - -#: ../../howto/clinic.rst:264 -msgid "Tutorial" -msgstr "" - -#: ../../howto/clinic.rst:266 -msgid "" -"The best way to get a sense of how Argument Clinic works is to convert a " -"function to work with it. Here, then, are the bare minimum steps you'd need " -"to follow to convert a function to work with Argument Clinic. Note that for " -"code you plan to check in to CPython, you really should take the conversion " -"farther, using some of the :ref:`advanced concepts ` you'll " -"see later on in the document, like :ref:`clinic-howto-return-converters` " -"and :ref:`clinic-howto-self-converter`. But we'll keep it simple for this " -"walkthrough so you can learn." -msgstr "" - -#: ../../howto/clinic.rst:277 -msgid "" -"First, make sure you're working with a freshly updated checkout of the " -"CPython trunk." -msgstr "" - -#: ../../howto/clinic.rst:280 -msgid "" -"Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For this tutorial, we'll be using :py:meth:`_pickle." -"Pickler.dump `." -msgstr "" - -#: ../../howto/clinic.rst:286 -msgid "" -"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " -"following format units...:" -msgstr "" - -#: ../../howto/clinic.rst:298 -msgid "" -"... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " -"choose a different function. (See :ref:`clinic-howto-advanced-converters` " -"for those scenarios.)" -msgstr "" - -#: ../../howto/clinic.rst:302 -msgid "" -"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " -"the same argument, or if the function uses something besides :c:func:`!" -"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " -"for conversion to Argument Clinic. Argument Clinic doesn't support generic " -"functions or polymorphic parameters." -msgstr "" - -#: ../../howto/clinic.rst:309 -msgid "" -"Next, add the following boilerplate above the function, creating our input " -"block::" -msgstr "" - -#: ../../howto/clinic.rst:315 -msgid "" -"Cut the docstring and paste it in between the ``[clinic]`` lines, removing " -"all the junk that makes it a properly quoted C string. When you're done you " -"should have just the text, based at the left margin, with no line wider than " -"80 characters. Argument Clinic will preserve indents inside the docstring." -msgstr "" - -#: ../../howto/clinic.rst:321 -msgid "" -"If the old docstring had a first line that looked like a function signature, " -"throw that line away; The docstring doesn't need it anymore --- when you " -"use :py:func:`help` on your builtin in the future, the first line will be " -"built automatically based on the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:326 -msgid "Example docstring summary line::" -msgstr "" - -#: ../../howto/clinic.rst:332 -msgid "" -"If your docstring doesn't have a \"summary\" line, Argument Clinic will " -"complain, so let's make sure it has one. The \"summary\" line should be a " -"paragraph consisting of a single 80-column line at the beginning of the " -"docstring. (See :pep:`257` regarding docstring conventions.)" -msgstr "" - -#: ../../howto/clinic.rst:338 -msgid "" -"Our example docstring consists solely of a summary line, so the sample code " -"doesn't have to change for this step." -msgstr "" - -#: ../../howto/clinic.rst:341 -msgid "" -"Now, above the docstring, enter the name of the function, followed by a " -"blank line. This should be the Python name of the function, and should be " -"the full dotted path to the function --- it should start with the name of " -"the module, include any sub-modules, and if the function is a method on a " -"class it should include the class name too." -msgstr "" - -#: ../../howto/clinic.rst:348 -msgid "" -"In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " -"class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" -"_pickle.Pickler.dump`::" -msgstr "" - -#: ../../howto/clinic.rst:358 -msgid "" -"If this is the first time that module or class has been used with Argument " -"Clinic in this C file, you must declare the module and/or class. Proper " -"Argument Clinic hygiene prefers declaring these in a separate block " -"somewhere near the top of the C file, in the same way that include files and " -"statics go at the top. In our sample code we'll just show the two blocks " -"next to each other." -msgstr "" - -#: ../../howto/clinic.rst:366 -msgid "" -"The name of the class and module should be the same as the one seen by " -"Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" -"`PyTypeObject` as appropriate." -msgstr "" - -#: ../../howto/clinic.rst:370 -msgid "" -"When you declare a class, you must also specify two aspects of its type in " -"C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`!PyTypeObject` for this class::" -msgstr "" - -#: ../../howto/clinic.rst:385 -msgid "" -"Declare each of the parameters to the function. Each parameter should get " -"its own line. All the parameter lines should be indented from the function " -"name and the docstring. The general form of these parameter lines is as " -"follows:" -msgstr "" - -#: ../../howto/clinic.rst:394 -msgid "If the parameter has a default value, add that after the converter:" -msgstr "" - -#: ../../howto/clinic.rst:401 -msgid "" -"Argument Clinic's support for \"default values\" is quite sophisticated; " -"see :ref:`clinic-howto-default-values` for more information." -msgstr "" - -#: ../../howto/clinic.rst:404 -msgid "Next, add a blank line below the parameters." -msgstr "" - -#: ../../howto/clinic.rst:406 -msgid "" -"What's a \"converter\"? It establishes both the type of the variable used in " -"C, and the method to convert the Python value into a C value at runtime. For " -"now you're going to use what's called a \"legacy converter\" --- a " -"convenience syntax intended to make porting old code into Argument Clinic " -"easier." -msgstr "" - -#: ../../howto/clinic.rst:413 -msgid "" -"For each parameter, copy the \"format unit\" for that parameter from the :c:" -"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " -"quoted string. The \"format unit\" is the formal name for the one-to-three " -"character substring of the *format* parameter that tells the argument " -"parsing function what the type of the variable is and how to convert it. For " -"more on format units please see :ref:`arg-parsing`." -msgstr "" - -#: ../../howto/clinic.rst:422 -msgid "" -"For multicharacter format units like ``z#``, use the entire two-or-three " -"character string." -msgstr "" - -#: ../../howto/clinic.rst:425 ../../howto/clinic.rst:460 -#: ../../howto/clinic.rst:488 ../../howto/clinic.rst:594 -#: ../../howto/clinic.rst:647 -msgid "Sample::" -msgstr "" - -#: ../../howto/clinic.rst:440 -msgid "" -"If your function has ``|`` in the format string, meaning some parameters " -"have default values, you can ignore it. Argument Clinic infers which " -"parameters are optional based on whether or not they have default values." -msgstr "" - -#: ../../howto/clinic.rst:445 -msgid "" -"If your function has ``$`` in the format string, meaning it takes keyword-" -"only arguments, specify ``*`` on a line by itself before the first keyword-" -"only argument, indented the same as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:450 -msgid "" -":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." -msgstr "" - -#: ../../howto/clinic.rst:452 -msgid "" -"Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " -"opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " -"are positional-only." -msgstr "" - -#: ../../howto/clinic.rst:456 -msgid "" -"To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " -"line by itself after the last positional-only parameter, indented the same " -"as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:476 -msgid "" -"It can be helpful to write a per-parameter docstring for each parameter. " -"Since per-parameter docstrings are optional, you can skip this step if you " -"prefer." -msgstr "" - -#: ../../howto/clinic.rst:480 -msgid "" -"Nevertheless, here's how to add a per-parameter docstring. The first line of " -"the per-parameter docstring must be indented further than the parameter " -"definition. The left margin of this first line establishes the left margin " -"for the whole per-parameter docstring; all the text you write will be " -"outdented by this amount. You can write as much text as you like, across " -"multiple lines if you wish." -msgstr "" - -#: ../../howto/clinic.rst:505 -msgid "" -"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " -"luck everything worked---your block now has output, and a :file:`.c.h` file " -"has been generated! Reload the file in your text editor to see the generated " -"code::" -msgstr "" - -#: ../../howto/clinic.rst:524 -msgid "" -"Obviously, if Argument Clinic didn't produce any output, it's because it " -"found an error in your input. Keep fixing your errors and retrying until " -"Argument Clinic processes your file without complaint." -msgstr "" - -#: ../../howto/clinic.rst:529 -msgid "" -"For readability, most of the glue code has been generated to a :file:`.c.h` " -"file. You'll need to include that in your original :file:`.c` file, " -"typically right after the clinic module block::" -msgstr "" - -#: ../../howto/clinic.rst:535 -msgid "" -"Double-check that the argument-parsing code Argument Clinic generated looks " -"basically the same as the existing code." -msgstr "" - -#: ../../howto/clinic.rst:538 -msgid "" -"First, ensure both places use the same argument-parsing function. The " -"existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" -"`PyArg_ParseTupleAndKeywords`; ensure that the code generated by Argument " -"Clinic calls the *exact* same function." -msgstr "" - -#: ../../howto/clinic.rst:544 -msgid "" -"Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" -"func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" -"written one in the existing function, up to the colon or semi-colon." -msgstr "" - -#: ../../howto/clinic.rst:549 -msgid "" -"Argument Clinic always generates its format strings with a ``:`` followed by " -"the name of the function. If the existing code's format string ends with ``;" -"``, to provide usage help, this change is harmless --- don't worry about it." -msgstr "" - -#: ../../howto/clinic.rst:554 -msgid "" -"Third, for parameters whose format units require two arguments, like a " -"length variable, an encoding string, or a pointer to a conversion function, " -"ensure that the second argument is *exactly* the same between the two " -"invocations." -msgstr "" - -#: ../../howto/clinic.rst:559 -msgid "" -"Fourth, inside the output portion of the block, you'll find a preprocessor " -"macro defining the appropriate static :c:type:`PyMethodDef` structure for " -"this builtin::" -msgstr "" - -#: ../../howto/clinic.rst:566 -msgid "" -"This static structure should be *exactly* the same as the existing static :c:" -"type:`!PyMethodDef` structure for this builtin." -msgstr "" - -#: ../../howto/clinic.rst:569 -msgid "" -"If any of these items differ in *any way*, adjust your Argument Clinic " -"function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " -"the same." -msgstr "" - -#: ../../howto/clinic.rst:573 -msgid "" -"Notice that the last line of its output is the declaration of your \"impl\" " -"function. This is where the builtin's implementation goes. Delete the " -"existing prototype of the function you're modifying, but leave the opening " -"curly brace. Now delete its argument parsing code and the declarations of " -"all the variables it dumps the arguments into. Notice how the Python " -"arguments are now arguments to this impl function; if the implementation " -"used different names for these variables, fix it." -msgstr "" - -#: ../../howto/clinic.rst:581 -msgid "" -"Let's reiterate, just because it's kind of weird. Your code should now look " -"like this::" -msgstr "" - -#: ../../howto/clinic.rst:590 -msgid "" -"Argument Clinic generated the checksum line and the function prototype just " -"above it. You should write the opening and closing curly braces for the " -"function, and the implementation inside." -msgstr "" - -#: ../../howto/clinic.rst:636 -msgid "" -"Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`!PyMethodDef` structure for this " -"function and replace it with a reference to the macro. If the builtin is at " -"module scope, this will probably be very near the end of the file; if the " -"builtin is a class method, this will probably be below but relatively near " -"to the implementation." -msgstr "" - -#: ../../howto/clinic.rst:643 -msgid "" -"Note that the body of the macro contains a trailing comma; when you replace " -"the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " -"add a comma to the end." -msgstr "" - -#: ../../howto/clinic.rst:655 -msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" -msgstr "" - -#: ../../howto/clinic.rst:659 -msgid "" -"If it does, you'll have to run ``make regen-global-objects`` to regenerate " -"the list of precompiled identifiers at this point." -msgstr "" - -#: ../../howto/clinic.rst:662 -msgid "" -"Finally, compile, then run the relevant portions of the regression-test " -"suite. This change should not introduce any new compile-time warnings or " -"errors, and there should be no externally visible change to Python's " -"behavior, except for one difference: :py:func:`inspect.signature` run on " -"your function should now provide a valid signature!" -msgstr "" - -#: ../../howto/clinic.rst:668 -msgid "" -"Congratulations, you've ported your first function to work with Argument " -"Clinic!" -msgstr "" - -#: ../../howto/clinic.rst:674 -msgid "How-to guides" -msgstr "" - -#: ../../howto/clinic.rst:678 -msgid "How to rename C functions and variables generated by Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:680 -msgid "" -"Argument Clinic automatically names the functions it generates for you. " -"Occasionally this may cause a problem, if the generated name collides with " -"the name of an existing C function. There's an easy solution: override the " -"names used for the C functions. Just add the keyword ``\"as\"`` to your " -"function declaration line, followed by the function name you wish to use. " -"Argument Clinic will use that function name for the base (generated) " -"function, then add ``\"_impl\"`` to the end and use that for the name of the " -"impl function." -msgstr "" - -#: ../../howto/clinic.rst:688 -msgid "" -"For example, if we wanted to rename the C function names generated for :py:" -"meth:`pickle.Pickler.dump`, it'd look like this::" -msgstr "" - -#: ../../howto/clinic.rst:696 -msgid "" -"The base function would now be named :c:func:`!pickler_dumper`, and the impl " -"function would now be named :c:func:`!pickler_dumper_impl`." -msgstr "" - -#: ../../howto/clinic.rst:700 -msgid "" -"Similarly, you may have a problem where you want to give a parameter a " -"specific Python name, but that name may be inconvenient in C. Argument " -"Clinic allows you to give a parameter different names in Python and in C, " -"using the same ``\"as\"`` syntax::" -msgstr "" - -#: ../../howto/clinic.rst:714 -msgid "" -"Here, the name used in Python (in the signature and the ``keywords`` array) " -"would be *file*, but the C variable would be named ``file_obj``." -msgstr "" - -#: ../../howto/clinic.rst:717 -msgid "You can use this to rename the *self* parameter too!" -msgstr "" - -#: ../../howto/clinic.rst:721 -msgid "How to convert functions using ``PyArg_UnpackTuple``" -msgstr "" - -#: ../../howto/clinic.rst:723 -msgid "" -"To convert a function parsing its arguments with :c:func:" -"`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the *type* argument to cast the type as " -"appropriate. All arguments should be marked positional-only (add a ``/`` on " -"a line by itself after the last argument)." -msgstr "" - -#: ../../howto/clinic.rst:729 -msgid "" -"Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " -"will change soon." -msgstr "" - -#: ../../howto/clinic.rst:734 -msgid "How to use optional groups" -msgstr "" - -#: ../../howto/clinic.rst:736 -msgid "" -"Some legacy functions have a tricky approach to parsing their arguments: " -"they count the number of positional arguments, then use a ``switch`` " -"statement to call one of several different :c:func:`PyArg_ParseTuple` calls " -"depending on how many positional arguments there are. (These functions " -"cannot accept keyword-only arguments.) This approach was used to simulate " -"optional arguments back before :c:func:`PyArg_ParseTupleAndKeywords` was " -"created." -msgstr "" - -#: ../../howto/clinic.rst:743 -msgid "" -"While functions using this approach can often be converted to use :c:func:`!" -"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " -"not always possible. Some of these legacy functions have behaviors :c:func:" -"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function :py:func:`range`, which has an optional " -"argument on the *left* side of its required argument! Another example is :py:" -"meth:`curses.window.addch`, which has a group of two arguments that must " -"always be specified together. (The arguments are called *x* and *y*; if you " -"call the function passing in *x*, you must also pass in *y* — and if you " -"don't pass in *x* you may not pass in *y* either.)" -msgstr "" - -#: ../../howto/clinic.rst:755 -msgid "" -"In any case, the goal of Argument Clinic is to support argument parsing for " -"all existing CPython builtins without changing their semantics. Therefore " -"Argument Clinic supports this alternate approach to parsing, using what are " -"called *optional groups*. Optional groups are groups of arguments that must " -"all be passed in together. They can be to the left or the right of the " -"required arguments. They can *only* be used with positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:763 -msgid "" -"Optional groups are *only* intended for use when converting functions that " -"make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " -"other approach for parsing arguments should *almost never* be converted to " -"Argument Clinic using optional groups. Functions using optional groups " -"currently cannot have accurate signatures in Python, because Python just " -"doesn't understand the concept. Please avoid using optional groups wherever " -"possible." -msgstr "" - -#: ../../howto/clinic.rst:772 -msgid "" -"To specify an optional group, add a ``[`` on a line by itself before the " -"parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how :py:meth:`curses.window.addch` " -"uses optional groups to make the first two parameters and the last parameter " -"optional::" -msgstr "" - -#: ../../howto/clinic.rst:801 -msgid "Notes:" -msgstr "註解:" - -#: ../../howto/clinic.rst:803 -msgid "" -"For every optional group, one additional parameter will be passed into the " -"impl function representing the group. The parameter will be an int named " -"``group_{direction}_{number}``, where ``{direction}`` is either ``right`` or " -"``left`` depending on whether the group is before or after the required " -"parameters, and ``{number}`` is a monotonically increasing number (starting " -"at 1) indicating how far away the group is from the required parameters. " -"When the impl is called, this parameter will be set to zero if this group " -"was unused, and set to non-zero if this group was used. (By used or unused, " -"I mean whether or not the parameters received arguments in this invocation.)" -msgstr "" - -#: ../../howto/clinic.rst:814 -msgid "" -"If there are no required arguments, the optional groups will behave as if " -"they're to the right of the required arguments." -msgstr "" - -#: ../../howto/clinic.rst:817 -msgid "" -"In the case of ambiguity, the argument parsing code favors parameters on the " -"left (before the required parameters)." -msgstr "" - -#: ../../howto/clinic.rst:820 -msgid "Optional groups can only contain positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:822 -msgid "" -"Optional groups are *only* intended for legacy code. Please do not use " -"optional groups for new code." -msgstr "" - -#: ../../howto/clinic.rst:827 -msgid "" -"How to use real Argument Clinic converters, instead of \"legacy converters\"" -msgstr "" - -#: ../../howto/clinic.rst:829 -msgid "" -"To save time, and to minimize how much you need to learn to achieve your " -"first port to Argument Clinic, the walkthrough above tells you to use " -"\"legacy converters\". \"Legacy converters\" are a convenience, designed " -"explicitly to make porting existing code to Argument Clinic easier. And to " -"be clear, their use is acceptable when porting code for Python 3.4." -msgstr "" - -#: ../../howto/clinic.rst:836 -msgid "" -"However, in the long term we probably want all our blocks to use Argument " -"Clinic's real syntax for converters. Why? A couple reasons:" -msgstr "" - -#: ../../howto/clinic.rst:840 -msgid "" -"The proper converters are far easier to read and clearer in their intent." -msgstr "" - -#: ../../howto/clinic.rst:841 -msgid "" -"There are some format units that are unsupported as \"legacy converters\", " -"because they require arguments, and the legacy converter syntax doesn't " -"support specifying arguments." -msgstr "" - -#: ../../howto/clinic.rst:844 -msgid "" -"In the future we may have a new argument parsing library that isn't " -"restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " -"won't be available to parameters using legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:848 -msgid "" -"Therefore, if you don't mind a little extra effort, please use the normal " -"converters instead of legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:851 -msgid "" -"In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " -"like a Python function call. However, if there are no explicit arguments to " -"the function (all functions take their default values), you may omit the " -"parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." -msgstr "" - -#: ../../howto/clinic.rst:857 -msgid "" -"All arguments to Argument Clinic converters are keyword-only. All Argument " -"Clinic converters accept the following arguments:" -msgstr "" - -#: ../../howto/clinic.rst:865 -msgid "*c_default*" -msgstr "*c_default*" - -#: ../../howto/clinic.rst:861 -msgid "" -"The default value for this parameter when defined in C. Specifically, this " -"will be the initializer for the variable declared in the \"parse " -"function\". See :ref:`the section on default values ` for " -"how to use this. Specified as a string." -msgstr "" - -#: ../../howto/clinic.rst:870 -msgid "*annotation*" -msgstr "*annotation*" - -#: ../../howto/clinic.rst:868 -msgid "" -"The annotation value for this parameter. Not currently supported, because :" -"pep:`8` mandates that the Python library may not use annotations." -msgstr "" - -#: ../../howto/clinic.rst:873 -msgid "*unused*" -msgstr "*unused*" - -#: ../../howto/clinic.rst:873 -msgid "" -"Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." -msgstr "" - -#: ../../howto/clinic.rst:875 -msgid "" -"In addition, some converters accept additional arguments. Here is a list of " -"these arguments, along with their meanings:" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "*accept*" -msgstr "*accept*" - -#: ../../howto/clinic.rst:879 -msgid "" -"A set of Python types (and possibly pseudo-types); this restricts the " -"allowable Python argument to values of these types. (This is not a general-" -"purpose facility; as a rule it only supports specific lists of types as " -"shown in the legacy converter table.)" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "To accept ``None``, add ``NoneType`` to this set." -msgstr "" - -#: ../../howto/clinic.rst:889 -msgid "*bitwise*" -msgstr "*bitwise*" - -#: ../../howto/clinic.rst:887 -msgid "" -"Only supported for unsigned integers. The native integer value of this " -"Python argument will be written to the parameter without any range checking, " -"even for negative values." -msgstr "" - -#: ../../howto/clinic.rst:894 -msgid "*converter*" -msgstr "*converter*" - -#: ../../howto/clinic.rst:892 -msgid "" -"Only supported by the ``object`` converter. Specifies the name of a :ref:`C " -"\"converter function\" ` to use to convert this object to a " -"native type." -msgstr "" - -#: ../../howto/clinic.rst:899 -msgid "*encoding*" -msgstr "*encoding*" - -#: ../../howto/clinic.rst:897 -msgid "" -"Only supported for strings. Specifies the encoding to use when converting " -"this string from a Python str (Unicode) value into a C ``char *`` value." -msgstr "" - -#: ../../howto/clinic.rst:903 -msgid "*subclass_of*" -msgstr "*subclass_of*" - -#: ../../howto/clinic.rst:902 -msgid "" -"Only supported for the ``object`` converter. Requires that the Python value " -"be a subclass of a Python type, as expressed in C." -msgstr "" - -#: ../../howto/clinic.rst:908 -msgid "*type*" -msgstr "" - -#: ../../howto/clinic.rst:906 -msgid "" -"Only supported for the ``object`` and ``self`` converters. Specifies the C " -"type that will be used to declare the variable. Default value is " -"``\"PyObject *\"``." -msgstr "" - -#: ../../howto/clinic.rst:914 -msgid "*zeroes*" -msgstr "*zeroes*" - -#: ../../howto/clinic.rst:911 -msgid "" -"Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " -"permitted inside the value. The length of the string will be passed in to " -"the impl function, just after the string parameter, as a parameter named " -"``_length``." -msgstr "" - -#: ../../howto/clinic.rst:916 -msgid "" -"Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " -"*format units*, with specific behavior. For example, currently you cannot " -"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " -"it's perfectly reasonable to think this would work, these semantics don't " -"map to any existing format unit. So Argument Clinic doesn't support it. " -"(Or, at least, not yet.)" -msgstr "" - -#: ../../howto/clinic.rst:924 -msgid "" -"Below is a table showing the mapping of legacy converters into real Argument " -"Clinic converters. On the left is the legacy converter, on the right is the " -"text you'd replace it with." -msgstr "" - -#: ../../howto/clinic.rst:929 -msgid "``'B'``" -msgstr "``'B'``" - -#: ../../howto/clinic.rst:929 -msgid "``unsigned_char(bitwise=True)``" -msgstr "``unsigned_char(bitwise=True)``" - -#: ../../howto/clinic.rst:930 -msgid "``'b'``" -msgstr "``'b'``" - -#: ../../howto/clinic.rst:930 -msgid "``unsigned_char``" -msgstr "``unsigned_char``" - -#: ../../howto/clinic.rst:931 -msgid "``'c'``" -msgstr "``'c'``" - -#: ../../howto/clinic.rst:931 -msgid "``char``" -msgstr "``char``" - -#: ../../howto/clinic.rst:932 -msgid "``'C'``" -msgstr "``'C'``" - -#: ../../howto/clinic.rst:932 -msgid "``int(accept={str})``" -msgstr "``int(accept={str})``" - -#: ../../howto/clinic.rst:933 -msgid "``'d'``" -msgstr "``'d'``" - -#: ../../howto/clinic.rst:933 -msgid "``double``" -msgstr "``double``" - -#: ../../howto/clinic.rst:934 -msgid "``'D'``" -msgstr "``'D'``" - -#: ../../howto/clinic.rst:934 -msgid "``Py_complex``" -msgstr "``Py_complex``" - -#: ../../howto/clinic.rst:935 -msgid "``'es'``" -msgstr "``'es'``" - -#: ../../howto/clinic.rst:935 -msgid "``str(encoding='name_of_encoding')``" -msgstr "``str(encoding='name_of_encoding')``" - -#: ../../howto/clinic.rst:936 -msgid "``'es#'``" -msgstr "``'es#'``" - -#: ../../howto/clinic.rst:936 -msgid "``str(encoding='name_of_encoding', zeroes=True)``" -msgstr "``str(encoding='name_of_encoding', zeroes=True)``" - -#: ../../howto/clinic.rst:937 -msgid "``'et'``" -msgstr "``'et'``" - -#: ../../howto/clinic.rst:937 -msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" - -#: ../../howto/clinic.rst:938 -msgid "``'et#'``" -msgstr "``'et#'``" - -#: ../../howto/clinic.rst:938 -msgid "" -"``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " -"zeroes=True)``" -msgstr "" - -#: ../../howto/clinic.rst:939 -msgid "``'f'``" -msgstr "``'f'``" - -#: ../../howto/clinic.rst:939 -msgid "``float``" -msgstr "``float``" - -#: ../../howto/clinic.rst:940 -msgid "``'h'``" -msgstr "``'h'``" - -#: ../../howto/clinic.rst:940 -msgid "``short``" -msgstr "``short``" - -#: ../../howto/clinic.rst:941 -msgid "``'H'``" -msgstr "``'H'``" - -#: ../../howto/clinic.rst:941 -msgid "``unsigned_short(bitwise=True)``" -msgstr "``unsigned_short(bitwise=True)``" - -#: ../../howto/clinic.rst:942 -msgid "``'i'``" -msgstr "``'i'``" - -#: ../../howto/clinic.rst:942 -msgid "``int``" -msgstr "``int``" - -#: ../../howto/clinic.rst:943 -msgid "``'I'``" -msgstr "``'I'``" - -#: ../../howto/clinic.rst:943 -msgid "``unsigned_int(bitwise=True)``" -msgstr "``unsigned_int(bitwise=True)``" - -#: ../../howto/clinic.rst:944 -msgid "``'k'``" -msgstr "``'k'``" - -#: ../../howto/clinic.rst:944 -msgid "``unsigned_long(bitwise=True)``" -msgstr "``unsigned_long(bitwise=True)``" - -#: ../../howto/clinic.rst:945 -msgid "``'K'``" -msgstr "``'K'``" - -#: ../../howto/clinic.rst:945 -msgid "``unsigned_long_long(bitwise=True)``" -msgstr "``unsigned_long_long(bitwise=True)``" - -#: ../../howto/clinic.rst:946 -msgid "``'l'``" -msgstr "``'l'``" - -#: ../../howto/clinic.rst:946 -msgid "``long``" -msgstr "``long``" - -#: ../../howto/clinic.rst:947 -msgid "``'L'``" -msgstr "``'L'``" - -#: ../../howto/clinic.rst:947 -msgid "``long long``" -msgstr "``long long``" - -#: ../../howto/clinic.rst:948 -msgid "``'n'``" -msgstr "``'n'``" - -#: ../../howto/clinic.rst:948 -msgid "``Py_ssize_t``" -msgstr "``Py_ssize_t``" - -#: ../../howto/clinic.rst:949 -msgid "``'O'``" -msgstr "``'O'``" - -#: ../../howto/clinic.rst:949 -msgid "``object``" -msgstr "``object``" - -#: ../../howto/clinic.rst:950 -msgid "``'O!'``" -msgstr "``'O!'``" - -#: ../../howto/clinic.rst:950 -msgid "``object(subclass_of='&PySomething_Type')``" -msgstr "``object(subclass_of='&PySomething_Type')``" - -#: ../../howto/clinic.rst:951 -msgid "``'O&'``" -msgstr "``'O&'``" - -#: ../../howto/clinic.rst:951 -msgid "``object(converter='name_of_c_function')``" -msgstr "``object(converter='name_of_c_function')``" - -#: ../../howto/clinic.rst:952 -msgid "``'p'``" -msgstr "``'p'``" - -#: ../../howto/clinic.rst:952 -msgid "``bool``" -msgstr "``bool``" - -#: ../../howto/clinic.rst:953 -msgid "``'S'``" -msgstr "``'S'``" - -#: ../../howto/clinic.rst:953 -msgid "``PyBytesObject``" -msgstr "``PyBytesObject``" - -#: ../../howto/clinic.rst:954 -msgid "``'s'``" -msgstr "``'s'``" - -#: ../../howto/clinic.rst:954 -msgid "``str``" -msgstr "``str``" - -#: ../../howto/clinic.rst:955 -msgid "``'s#'``" -msgstr "``'s#'``" - -#: ../../howto/clinic.rst:955 -msgid "``str(zeroes=True)``" -msgstr "``str(zeroes=True)``" - -#: ../../howto/clinic.rst:956 -msgid "``'s*'``" -msgstr "``'s*'``" - -#: ../../howto/clinic.rst:956 -msgid "``Py_buffer(accept={buffer, str})``" -msgstr "``Py_buffer(accept={buffer, str})``" - -#: ../../howto/clinic.rst:957 -msgid "``'U'``" -msgstr "``'U'``" - -#: ../../howto/clinic.rst:957 -msgid "``unicode``" -msgstr "``unicode``" - -#: ../../howto/clinic.rst:958 -msgid "``'u'``" -msgstr "``'u'``" - -#: ../../howto/clinic.rst:958 -msgid "``wchar_t``" -msgstr "``wchar_t``" - -#: ../../howto/clinic.rst:959 -msgid "``'u#'``" -msgstr "``'u#'``" - -#: ../../howto/clinic.rst:959 -msgid "``wchar_t(zeroes=True)``" -msgstr "``wchar_t(zeroes=True)``" - -#: ../../howto/clinic.rst:960 -msgid "``'w*'``" -msgstr "``'w*'``" - -#: ../../howto/clinic.rst:960 -msgid "``Py_buffer(accept={rwbuffer})``" -msgstr "``Py_buffer(accept={rwbuffer})``" - -#: ../../howto/clinic.rst:961 -msgid "``'Y'``" -msgstr "``'Y'``" - -#: ../../howto/clinic.rst:961 -msgid "``PyByteArrayObject``" -msgstr "``PyByteArrayObject``" - -#: ../../howto/clinic.rst:962 -msgid "``'y'``" -msgstr "``'y'``" - -#: ../../howto/clinic.rst:962 -msgid "``str(accept={bytes})``" -msgstr "``str(accept={bytes})``" - -#: ../../howto/clinic.rst:963 -msgid "``'y#'``" -msgstr "``'y#'``" - -#: ../../howto/clinic.rst:963 -msgid "``str(accept={robuffer}, zeroes=True)``" -msgstr "``str(accept={robuffer}, zeroes=True)``" - -#: ../../howto/clinic.rst:964 -msgid "``'y*'``" -msgstr "``'y*'``" - -#: ../../howto/clinic.rst:964 -msgid "``Py_buffer``" -msgstr "``Py_buffer``" - -#: ../../howto/clinic.rst:965 -msgid "``'Z'``" -msgstr "``'Z'``" - -#: ../../howto/clinic.rst:965 -msgid "``wchar_t(accept={str, NoneType})``" -msgstr "``wchar_t(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:966 -msgid "``'Z#'``" -msgstr "``'Z#'``" - -#: ../../howto/clinic.rst:966 -msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" -msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:967 -msgid "``'z'``" -msgstr "``'z'``" - -#: ../../howto/clinic.rst:967 -msgid "``str(accept={str, NoneType})``" -msgstr "``str(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:968 -msgid "``'z#'``" -msgstr "``'z#'``" - -#: ../../howto/clinic.rst:968 -msgid "``str(accept={str, NoneType}, zeroes=True)``" -msgstr "``str(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:969 -msgid "``'z*'``" -msgstr "``'z*'``" - -#: ../../howto/clinic.rst:969 -msgid "``Py_buffer(accept={buffer, str, NoneType})``" -msgstr "``Py_buffer(accept={buffer, str, NoneType})``" - -#: ../../howto/clinic.rst:972 -msgid "" -"As an example, here's our sample ``pickle.Pickler.dump`` using the proper " -"converter::" -msgstr "" - -#: ../../howto/clinic.rst:985 -msgid "" -"One advantage of real converters is that they're more flexible than legacy " -"converters. For example, the ``unsigned_int`` converter (and all the " -"``unsigned_`` converters) can be specified without ``bitwise=True``. Their " -"default behavior performs range checking on the value, and they won't accept " -"negative numbers. You just can't do that with a legacy converter!" -msgstr "" - -#: ../../howto/clinic.rst:991 -msgid "" -"Argument Clinic will show you all the converters it has available. For each " -"converter it'll show you all the parameters it accepts, along with the " -"default value for each parameter. Just run ``Tools/clinic/clinic.py --" -"converters`` to see the full list." -msgstr "" - -#: ../../howto/clinic.rst:998 -msgid "How to use the ``Py_buffer`` converter" -msgstr "" - -#: ../../howto/clinic.rst:1000 -msgid "" -"When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " -"or ``'z*'`` legacy converters), you *must* not call :c:func:" -"`PyBuffer_Release` on the provided buffer. Argument Clinic generates code " -"that does it for you (in the parsing function)." -msgstr "" - -#: ../../howto/clinic.rst:1009 -msgid "How to use advanced converters" -msgstr "" - -#: ../../howto/clinic.rst:1011 -msgid "" -"Remember those format units you skipped for your first time because they " -"were advanced? Here's how to handle those too." -msgstr "" - -#: ../../howto/clinic.rst:1014 -msgid "" -"The trick is, all those format units take arguments—either conversion " -"functions, or types, or strings specifying an encoding. (But \"legacy " -"converters\" don't support arguments. That's why we skipped them for your " -"first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either *converter* (for ``O&``), " -"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " -"start with ``e``)." -msgstr "" - -#: ../../howto/clinic.rst:1022 -msgid "" -"When using *subclass_of*, you may also want to use the other custom argument " -"for ``object()``: *type*, which lets you set the type actually used for the " -"parameter. For example, if you want to ensure that the object is a subclass " -"of :c:var:`PyUnicode_Type`, you probably want to use the converter " -"``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." -msgstr "" - -#: ../../howto/clinic.rst:1028 -msgid "" -"One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a :c:" -"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " -"what encoding string to pass to that call. But now this string must be " -"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " -"deliberate; it made supporting this format unit much easier, and may allow " -"for future optimizations. This restriction doesn't seem unreasonable; " -"CPython itself always passes in static hard-coded encoding strings for " -"parameters whose format units start with ``e``." -msgstr "" - -#: ../../howto/clinic.rst:1042 -msgid "How to assign default values to parameter" -msgstr "" - -#: ../../howto/clinic.rst:1044 -msgid "" -"Default values for parameters can be any of a number of values. At their " -"simplest, they can be string, int, or float literals:" -msgstr "" - -#: ../../howto/clinic.rst:1053 -msgid "They can also use any of Python's built-in constants:" -msgstr "" - -#: ../../howto/clinic.rst:1061 -msgid "" -"There's also special support for a default value of ``NULL``, and for simple " -"expressions, documented in the following sections." -msgstr "" - -#: ../../howto/clinic.rst:1066 -msgid "The ``NULL`` default value" -msgstr "" - -#: ../../howto/clinic.rst:1068 -msgid "" -"For string and object parameters, you can set them to ``None`` to indicate " -"that there's no default. However, that means the C variable will be " -"initialized to ``Py_None``. For convenience's sakes, there's a special " -"value called ``NULL`` for just this reason: from Python's perspective it " -"behaves like a default value of ``None``, but the C variable is initialized " -"with ``NULL``." -msgstr "" - -#: ../../howto/clinic.rst:1077 -msgid "Symbolic default values" -msgstr "" - -#: ../../howto/clinic.rst:1079 -msgid "" -"The default value you provide for a parameter can't be any arbitrary " -"expression. Currently the following are explicitly supported:" -msgstr "" - -#: ../../howto/clinic.rst:1082 -msgid "Numeric constants (integer and float)" -msgstr "" - -#: ../../howto/clinic.rst:1083 -msgid "String constants" -msgstr "" - -#: ../../howto/clinic.rst:1084 -msgid "``True``, ``False``, and ``None``" -msgstr "``True``、``False`` 和 ``None``" - -#: ../../howto/clinic.rst:1085 -msgid "" -"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " -"the name of the module" -msgstr "" - -#: ../../howto/clinic.rst:1088 -msgid "" -"(In the future, this may need to get even more elaborate, to allow full " -"expressions like ``CONSTANT - 1``.)" -msgstr "" - -#: ../../howto/clinic.rst:1093 -msgid "Expressions as default values" -msgstr "" - -#: ../../howto/clinic.rst:1095 -msgid "" -"The default value for a parameter can be more than just a literal value. It " -"can be an entire expression, using math operators and looking up attributes " -"on objects. However, this support isn't exactly simple, because of some non-" -"obvious semantics." -msgstr "" - -#: ../../howto/clinic.rst:1100 -msgid "Consider the following example:" -msgstr "" - -#: ../../howto/clinic.rst:1106 -msgid "" -":py:data:`sys.maxsize` can have different values on different platforms. " -"Therefore Argument Clinic can't simply evaluate that expression locally and " -"hard-code it in C. So it stores the default in such a way that it will get " -"evaluated at runtime, when the user asks for the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:1111 -msgid "" -"What namespace is available when the expression is evaluated? It's " -"evaluated in the context of the module the builtin came from. So, if your " -"module has an attribute called :py:attr:`!max_widgets`, you may simply use " -"it:" -msgstr "" - -#: ../../howto/clinic.rst:1119 -msgid "" -"If the symbol isn't found in the current module, it fails over to looking " -"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " -"for example. (Since you don't know in advance what modules the user will " -"load into their interpreter, it's best to restrict yourself to modules that " -"are preloaded by Python itself.)" -msgstr "" - -#: ../../howto/clinic.rst:1124 -msgid "" -"Evaluating default values only at runtime means Argument Clinic can't " -"compute the correct equivalent C default value. So you need to tell it " -"explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the *c_default* parameter to the converter:" -msgstr "" - -#: ../../howto/clinic.rst:1133 -msgid "" -"Another complication: Argument Clinic can't know in advance whether or not " -"the expression you supply is valid. It parses it to make sure it looks " -"legal, but it can't *actually* know. You must be very careful when using " -"expressions to specify values that are guaranteed to be valid at runtime!" -msgstr "" - -#: ../../howto/clinic.rst:1138 -msgid "" -"Finally, because expressions must be representable as static C values, there " -"are many restrictions on legal expressions. Here's a list of Python " -"features you're not permitted to use:" -msgstr "" - -#: ../../howto/clinic.rst:1142 -msgid "Function calls." -msgstr "" - -#: ../../howto/clinic.rst:1143 -msgid "Inline if statements (``3 if foo else 5``)." -msgstr "" - -#: ../../howto/clinic.rst:1144 -msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." -msgstr "" - -#: ../../howto/clinic.rst:1145 -msgid "List/set/dict comprehensions and generator expressions." -msgstr "" - -#: ../../howto/clinic.rst:1146 -msgid "Tuple/list/set/dict literals." -msgstr "" - -#: ../../howto/clinic.rst:1152 -msgid "How to use return converters" -msgstr "" - -#: ../../howto/clinic.rst:1154 -msgid "" -"By default, the impl function Argument Clinic generates for you returns :c:" -"type:`PyObject * `. But your C function often computes some C " -"type, then converts it into the :c:type:`!PyObject *` at the last moment. " -"Argument Clinic handles converting your inputs from Python types into native " -"C types—why not have it convert your return value from a native C type into " -"a Python type too?" -msgstr "" - -#: ../../howto/clinic.rst:1162 -msgid "" -"That's what a \"return converter\" does. It changes your impl function to " -"return some C type, then adds code to the generated (non-impl) function to " -"handle converting that value into the appropriate :c:type:`!PyObject *`." -msgstr "" - -#: ../../howto/clinic.rst:1166 -msgid "" -"The syntax for return converters is similar to that of parameter converters. " -"You specify the return converter like it was a return annotation on the " -"function itself, using ``->`` notation." -msgstr "" - -#: ../../howto/clinic.rst:1170 -msgid "For example:" -msgstr "" - -#: ../../howto/clinic.rst:1183 -msgid "" -"Return converters behave much the same as parameter converters; they take " -"arguments, the arguments are all keyword-only, and if you're not changing " -"any of the default arguments you can omit the parentheses." -msgstr "" - -#: ../../howto/clinic.rst:1187 -msgid "" -"(If you use both ``\"as\"`` *and* a return converter for your function, the " -"``\"as\"`` should come before the return converter.)" -msgstr "" - -#: ../../howto/clinic.rst:1190 -msgid "" -"There's one additional complication when using return converters: how do you " -"indicate an error has occurred? Normally, a function returns a valid (non-" -"``NULL``) pointer for success, and ``NULL`` for failure. But if you use an " -"integer return converter, all integers are valid. How can Argument Clinic " -"detect an error? Its solution: each return converter implicitly looks for a " -"special value that indicates an error. If you return that value, and an " -"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " -"generated code will propagate the error. Otherwise it will encode the value " -"you return like normal." -msgstr "" - -#: ../../howto/clinic.rst:1199 -msgid "Currently Argument Clinic supports only a few return converters:" -msgstr "" - -#: ../../howto/clinic.rst:1213 -msgid "" -"None of these take parameters. For all of these, return ``-1`` to indicate " -"error." -msgstr "" - -#: ../../howto/clinic.rst:1216 -msgid "" -"To see all the return converters Argument Clinic supports, along with their " -"parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " -"the full list." -msgstr "" - -#: ../../howto/clinic.rst:1222 -msgid "How to clone existing functions" -msgstr "" - -#: ../../howto/clinic.rst:1224 -msgid "" -"If you have a number of functions that look similar, you may be able to use " -"Clinic's \"clone\" feature. When you clone an existing function, you reuse:" -msgstr "" - -#: ../../howto/clinic.rst:1228 -msgid "its parameters, including" -msgstr "" - -#: ../../howto/clinic.rst:1230 -msgid "their names," -msgstr "" - -#: ../../howto/clinic.rst:1232 -msgid "their converters, with all parameters," -msgstr "" - -#: ../../howto/clinic.rst:1234 -msgid "their default values," -msgstr "" - -#: ../../howto/clinic.rst:1236 -msgid "their per-parameter docstrings," -msgstr "" - -#: ../../howto/clinic.rst:1238 -msgid "" -"their *kind* (whether they're positional only, positional or keyword, or " -"keyword only), and" -msgstr "" - -#: ../../howto/clinic.rst:1241 -msgid "its return converter." -msgstr "" - -#: ../../howto/clinic.rst:1243 -msgid "" -"The only thing not copied from the original function is its docstring; the " -"syntax allows you to specify a new docstring." -msgstr "" - -#: ../../howto/clinic.rst:1246 -msgid "Here's the syntax for cloning a function::" -msgstr "" - -#: ../../howto/clinic.rst:1254 -msgid "" -"(The functions can be in different modules or classes. I wrote ``module." -"class`` in the sample just to illustrate that you must use the full path to " -"*both* functions.)" -msgstr "" - -#: ../../howto/clinic.rst:1258 -msgid "" -"Sorry, there's no syntax for partially cloning a function, or cloning a " -"function then modifying it. Cloning is an all-or nothing proposition." -msgstr "" - -#: ../../howto/clinic.rst:1261 -msgid "" -"Also, the function you are cloning from must have been previously defined in " -"the current file." -msgstr "" - -#: ../../howto/clinic.rst:1266 -msgid "How to call Python code" -msgstr "" - -#: ../../howto/clinic.rst:1268 -msgid "" -"The rest of the advanced topics require you to write Python code which lives " -"inside your C file and modifies Argument Clinic's runtime state. This is " -"simple: you simply define a Python block." -msgstr "" - -#: ../../howto/clinic.rst:1272 -msgid "" -"A Python block uses different delimiter lines than an Argument Clinic " -"function block. It looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1279 -msgid "" -"All the code inside the Python block is executed at the time it's parsed. " -"All text written to stdout inside the block is redirected into the " -"\"output\" after the block." -msgstr "" - -#: ../../howto/clinic.rst:1283 -msgid "" -"As an example, here's a Python block that adds a static integer variable to " -"the C code::" -msgstr "" - -#: ../../howto/clinic.rst:1296 -msgid "How to use the \"self converter\"" -msgstr "" - -#: ../../howto/clinic.rst:1298 -msgid "" -"Argument Clinic automatically adds a \"self\" parameter for you using a " -"default converter. It automatically sets the ``type`` of this parameter to " -"the \"pointer to an instance\" you specified when you declared the type. " -"However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own *self* parameter as the first parameter in a " -"block, and ensure that its converter is an instance of :class:`!" -"self_converter` or a subclass thereof." -msgstr "" - -#: ../../howto/clinic.rst:1307 -msgid "" -"What's the point? This lets you override the type of ``self``, or give it a " -"different default name." -msgstr "" - -#: ../../howto/clinic.rst:1310 -msgid "" -"How do you specify the custom type you want to cast ``self`` to? If you only " -"have one or two functions with the same type for ``self``, you can directly " -"use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the *type* parameter::" -msgstr "" - -#: ../../howto/clinic.rst:1326 -msgid "" -"On the other hand, if you have a lot of functions that will use the same " -"type for ``self``, it's best to create your own converter, subclassing :" -"class:`!self_converter` but overwriting the :py:attr:`!type` member::" -msgstr "" - -#: ../../howto/clinic.rst:1348 -msgid "How to use the \"defining class\" converter" -msgstr "" - -#: ../../howto/clinic.rst:1350 -msgid "" -"Argument Clinic facilitates gaining access to the defining class of a " -"method. This is useful for :ref:`heap type ` methods that need " -"to fetch module level state. Use :c:func:`PyType_FromModuleAndSpec` to " -"associate a new heap type with a module. You can now use :c:func:" -"`PyType_GetModuleState` on the defining class to fetch the module state, for " -"example from a module method." -msgstr "" - -#: ../../howto/clinic.rst:1356 -msgid "" -"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " -"added to the clinic input::" -msgstr "" - -#: ../../howto/clinic.rst:1368 -msgid "" -"After running the Argument Clinic tool, the following function signature is " -"generated::" -msgstr "" - -#: ../../howto/clinic.rst:1378 -msgid "" -"The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " -"module state::" -msgstr "" - -#: ../../howto/clinic.rst:1384 -msgid "" -"Each method may only have one argument using this converter, and it must " -"appear after ``self``, or, if ``self`` is not used, as the first argument. " -"The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the :py:attr:`!__text_signature__`." -msgstr "" - -#: ../../howto/clinic.rst:1389 -msgid "" -"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " -"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " -"convention." -msgstr "" - -#: ../../howto/clinic.rst:1393 -msgid "" -"It is not possible to use ``defining_class`` with slot methods. In order to " -"fetch the module state from such methods, use :c:func:" -"`PyType_GetModuleByDef` to look up the module and then :c:func:" -"`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1408 -msgid "See also :pep:`573`." -msgstr "也請見 :pep:`573`\\ 。" - -#: ../../howto/clinic.rst:1414 -msgid "How to write a custom converter" -msgstr "" - -#: ../../howto/clinic.rst:1416 -msgid "" -"A converter is a Python class that inherits from :py:class:`CConverter`. The " -"main purpose of a custom converter, is for parameters parsed with the ``O&`` " -"format unit --- parsing such a parameter means calling a :c:func:" -"`PyArg_ParseTuple` \"converter function\"." -msgstr "" - -#: ../../howto/clinic.rst:1421 -msgid "" -"Your converter class should be named :samp:`{ConverterName}_converter`. By " -"following this convention, your converter class will be automatically " -"registered with Argument Clinic, with its *converter name* being the name of " -"your converter class with the ``_converter`` suffix stripped off." -msgstr "" - -#: ../../howto/clinic.rst:1426 -msgid "" -"Instead of subclassing :py:meth:`!CConverter.__init__`, write a :py:meth:`!" -"converter_init` method. :py:meth:`!converter_init` always accepts a *self* " -"parameter. After *self*, all additional parameters **must** be keyword-only. " -"Any arguments passed to the converter in Argument Clinic will be passed " -"along to your :py:meth:`!converter_init` method. See :py:class:`CConverter` " -"for a list of members you may wish to specify in your subclass." -msgstr "" - -#: ../../howto/clinic.rst:1435 -msgid "" -"Here's the simplest example of a custom converter, from :source:`Modules/" -"zlibmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1446 -msgid "" -"This block adds a converter named ``ssize_t`` to Argument Clinic. Parameters " -"declared as ``ssize_t`` will be declared with type :c:type:`Py_ssize_t`, and " -"will be parsed by the ``'O&'`` format unit, which will call the :c:func:`!" -"ssize_t_converter` converter C function. ``ssize_t`` variables automatically " -"support default values." -msgstr "" - -#: ../../howto/clinic.rst:1452 -msgid "" -"More sophisticated custom converters can insert custom C code to handle " -"initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string ``CConverter``." -msgstr "" - -#: ../../howto/clinic.rst:1459 -msgid "How to write a custom return converter" -msgstr "" +msgstr "Argument Clinic 指南" -#: ../../howto/clinic.rst:1461 +#: ../../howto/clinic.rst:13 msgid "" -"Writing a custom return converter is much like writing a custom converter. " -"Except it's somewhat simpler, because return converters are themselves much " -"simpler." +"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " +"`__." msgstr "" - -#: ../../howto/clinic.rst:1465 -msgid "" -"Return converters must subclass :py:class:`!CReturnConverter`. There are no " -"examples yet of custom return converters, because they are not widely used " -"yet. If you wish to write your own return converter, please read :source:" -"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" -"CReturnConverter` and all its subclasses." -msgstr "" - -#: ../../howto/clinic.rst:1474 -msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1476 -msgid "" -"To convert a function using :c:macro:`METH_O`, make sure the function's " -"single argument is using the ``object`` converter, and mark the arguments as " -"positional-only::" -msgstr "" - -#: ../../howto/clinic.rst:1488 -msgid "" -"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " -"arguments." -msgstr "" - -#: ../../howto/clinic.rst:1491 -msgid "" -"You can still use a self converter, a return converter, and specify a *type* " -"argument to the object converter for :c:macro:`METH_O`." -msgstr "" - -#: ../../howto/clinic.rst:1496 -msgid "How to convert ``tp_new`` and ``tp_init`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1498 -msgid "" -"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" -"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " -"``__init__`` as appropriate. Notes:" -msgstr "" - -#: ../../howto/clinic.rst:1502 -msgid "" -"The function name generated for ``__new__`` doesn't end in ``__new__`` like " -"it would by default. It's just the name of the class, converted into a " -"valid C identifier." -msgstr "" - -#: ../../howto/clinic.rst:1506 -msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." -msgstr "" - -#: ../../howto/clinic.rst:1508 -msgid "``__init__`` functions return ``int``, not ``PyObject *``." -msgstr "" - -#: ../../howto/clinic.rst:1510 -msgid "Use the docstring as the class docstring." -msgstr "" - -#: ../../howto/clinic.rst:1512 -msgid "" -"Although ``__new__`` and ``__init__`` functions must always accept both the " -"``args`` and ``kwargs`` objects, when converting you may specify any " -"signature for these functions that you like. (If your function doesn't " -"support keywords, the parsing function generated will throw an exception if " -"it receives any.)" -msgstr "" - -#: ../../howto/clinic.rst:1520 -msgid "How to change and redirect Clinic's output" -msgstr "" - -#: ../../howto/clinic.rst:1522 -msgid "" -"It can be inconvenient to have Clinic's output interspersed with your " -"conventional hand-edited C code. Luckily, Clinic is configurable: you can " -"buffer up its output for printing later (or earlier!), or write its output " -"to a separate file. You can also add a prefix or suffix to every line of " -"Clinic's generated output." -msgstr "" - -#: ../../howto/clinic.rst:1528 -msgid "" -"While changing Clinic's output in this manner can be a boon to readability, " -"it may result in Clinic code using types before they are defined, or your " -"code attempting to use Clinic-generated code before it is defined. These " -"problems can be easily solved by rearranging the declarations in your file, " -"or moving where Clinic's generated code goes. (This is why the default " -"behavior of Clinic is to output everything into the current block; while " -"many people consider this hampers readability, it will never require " -"rearranging your code to fix definition-before-use problems.)" -msgstr "" - -#: ../../howto/clinic.rst:1537 -msgid "Let's start with defining some terminology:" -msgstr "" - -#: ../../howto/clinic.rst:1564 -msgid "*field*" -msgstr "" - -#: ../../howto/clinic.rst:1540 -msgid "" -"A field, in this context, is a subsection of Clinic's output. For example, " -"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " -"``methoddef_define``. Clinic has seven different fields it can output per " -"function definition:" -msgstr "" - -#: ../../howto/clinic.rst:1555 -msgid "" -"All the names are of the form ``\"_\"``, where ``\"\"`` is the " -"semantic object represented (the parsing function, the impl function, the " -"docstring, or the methoddef structure) and ``\"\"`` represents what kind " -"of statement the field is. Field names that end in ``\"_prototype\"`` " -"represent forward declarations of that thing, without the actual body/data " -"of the thing; field names that end in ``\"_definition\"`` represent the " -"actual definition of the thing, with the body/data of the thing. " -"(``\"methoddef\"`` is special, it's the only one that ends with " -"``\"_define\"``, representing that it's a preprocessor #define.)" -msgstr "" - -#: ../../howto/clinic.rst:1598 -msgid "*destination*" -msgstr "" - -#: ../../howto/clinic.rst:1567 -msgid "" -"A destination is a place Clinic can write output to. There are five built-" -"in destinations:" -msgstr "" - -#: ../../howto/clinic.rst:1572 ../../howto/clinic.rst:1647 -#: ../../howto/clinic.rst:1725 -msgid "``block``" -msgstr "``block``" - -#: ../../howto/clinic.rst:1571 -msgid "" -"The default destination: printed in the output section of the current Clinic " -"block." -msgstr "" - -#: ../../howto/clinic.rst:1578 ../../howto/clinic.rst:1674 -#: ../../howto/clinic.rst:1728 -msgid "``buffer``" -msgstr "``buffer``" - -#: ../../howto/clinic.rst:1575 -msgid "" -"A text buffer where you can save text for later. Text sent here is appended " -"to the end of any existing text. It's an error to have any text left in the " -"buffer when Clinic finishes processing a file." -msgstr "" - -#: ../../howto/clinic.rst:1589 ../../howto/clinic.rst:1660 -#: ../../howto/clinic.rst:1754 -msgid "``file``" -msgstr "``file``" - -#: ../../howto/clinic.rst:1581 -msgid "" -"A separate \"clinic file\" that will be created automatically by Clinic. The " -"filename chosen for the file is ``{basename}.clinic{extension}``, where " -"``basename`` and ``extension`` were assigned the output from ``os.path." -"splitext()`` run on the current file. (Example: the ``file`` destination " -"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" -msgstr "" - -#: ../../howto/clinic.rst:1588 -msgid "" -"**Important: When using a** ``file`` **destination, you** *must check in* " -"**the generated file!**" -msgstr "" - -#: ../../howto/clinic.rst:1594 ../../howto/clinic.rst:1687 -#: ../../howto/clinic.rst:1758 -msgid "``two-pass``" -msgstr "``two-pass``" - -#: ../../howto/clinic.rst:1592 -msgid "" -"A buffer like ``buffer``. However, a two-pass buffer can only be dumped " -"once, and it prints out all text sent to it during all processing, even from " -"Clinic blocks *after* the dumping point." -msgstr "" - -#: ../../howto/clinic.rst:1598 ../../howto/clinic.rst:1721 -msgid "``suppress``" -msgstr "``suppress``" - -#: ../../howto/clinic.rst:1597 -msgid "The text is suppressed—thrown away." -msgstr "" - -#: ../../howto/clinic.rst:1600 -msgid "Clinic defines five new directives that let you reconfigure its output." -msgstr "" - -#: ../../howto/clinic.rst:1602 -msgid "The first new directive is ``dump``:" -msgstr "" - -#: ../../howto/clinic.rst:1608 -msgid "" -"This dumps the current contents of the named destination into the output of " -"the current block, and empties it. This only works with ``buffer`` and " -"``two-pass`` destinations." -msgstr "" - -#: ../../howto/clinic.rst:1612 -msgid "" -"The second new directive is ``output``. The most basic form of ``output`` " -"is like this:" -msgstr "" - -#: ../../howto/clinic.rst:1619 -msgid "" -"This tells Clinic to output *field* to *destination*. ``output`` also " -"supports a special meta-destination, called ``everything``, which tells " -"Clinic to output *all* fields to that *destination*." -msgstr "" - -#: ../../howto/clinic.rst:1623 -msgid "``output`` has a number of other functions:" -msgstr "" - -#: ../../howto/clinic.rst:1632 -msgid "" -"``output push`` and ``output pop`` allow you to push and pop configurations " -"on an internal configuration stack, so that you can temporarily modify the " -"output configuration, then easily restore the previous configuration. " -"Simply push before your change to save the current configuration, then pop " -"when you wish to restore the previous configuration." -msgstr "" - -#: ../../howto/clinic.rst:1639 -msgid "" -"``output preset`` sets Clinic's output to one of several built-in preset " -"configurations, as follows:" -msgstr "" - -#: ../../howto/clinic.rst:1643 -msgid "" -"Clinic's original starting configuration. Writes everything immediately " -"after the input block." -msgstr "" - -#: ../../howto/clinic.rst:1646 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write " -"everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1650 -msgid "" -"Designed to write everything to the \"clinic file\" that it can. You then " -"``#include`` this file near the top of your file. You may need to rearrange " -"your file to make this work, though usually this just means creating forward " -"declarations for various ``typedef`` and ``PyTypeObject`` definitions." -msgstr "" - -#: ../../howto/clinic.rst:1656 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " -"``impl_definition`` to ``block``, and write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1660 -msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." -msgstr "" - -#: ../../howto/clinic.rst:1663 -msgid "" -"Save up most of the output from Clinic, to be written into your file near " -"the end. For Python files implementing modules or builtin types, it's " -"recommended that you dump the buffer just above the static structures for " -"your module or builtin type; these are normally very near the end. Using " -"``buffer`` may require even more editing than ``file``, if your file has " -"static ``PyMethodDef`` arrays defined in the middle of the file." -msgstr "" - -#: ../../howto/clinic.rst:1672 -msgid "" -"Suppress the ``parser_prototype``, ``impl_prototype``, and " -"``docstring_prototype``, write the ``impl_definition`` to ``block``, and " -"write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1677 -msgid "" -"Similar to the ``buffer`` preset, but writes forward declarations to the " -"``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " -"the ``buffer`` preset, but may require less editing than ``buffer``. Dump " -"the ``two-pass`` buffer near the top of your file, and dump the ``buffer`` " -"near the end just like you would when using the ``buffer`` preset." -msgstr "" - -#: ../../howto/clinic.rst:1684 -msgid "" -"Suppresses the ``impl_prototype``, write the ``impl_definition`` to " -"``block``, write ``docstring_prototype``, ``methoddef_define``, and " -"``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." -msgstr "" - -#: ../../howto/clinic.rst:1698 -msgid "``partial-buffer``" -msgstr "``partial-buffer``" - -#: ../../howto/clinic.rst:1690 -msgid "" -"Similar to the ``buffer`` preset, but writes more things to ``block``, only " -"writing the really big chunks of generated code to ``buffer``. This avoids " -"the definition-before-use problem of ``buffer`` completely, at the small " -"cost of having slightly more stuff in the block's output. Dump the " -"``buffer`` near the end, just like you would when using the ``buffer`` " -"preset." -msgstr "" - -#: ../../howto/clinic.rst:1697 -msgid "" -"Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " -"``parser_definition`` to ``buffer``, write everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1700 -msgid "The third new directive is ``destination``:" -msgstr "" - -#: ../../howto/clinic.rst:1706 -msgid "This performs an operation on the destination named ``name``." -msgstr "" - -#: ../../howto/clinic.rst:1708 -msgid "There are two defined subcommands: ``new`` and ``clear``." -msgstr "" - -#: ../../howto/clinic.rst:1710 -msgid "The ``new`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1716 -msgid "" -"This creates a new destination with name ```` and type ````." -msgstr "" - -#: ../../howto/clinic.rst:1718 -msgid "There are five destination types:" -msgstr "" - -#: ../../howto/clinic.rst:1721 -msgid "Throws the text away." -msgstr "" - -#: ../../howto/clinic.rst:1724 -msgid "" -"Writes the text to the current block. This is what Clinic originally did." -msgstr "" - -#: ../../howto/clinic.rst:1728 -msgid "A simple text buffer, like the \"buffer\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1731 -msgid "" -"A text file. The file destination takes an extra argument, a template to " -"use for building the filename, like so:" -msgstr "" - -#: ../../howto/clinic.rst:1734 -msgid "destination new " -msgstr "" - -#: ../../howto/clinic.rst:1736 -msgid "" -"The template can use three strings internally that will be replaced by bits " -"of the filename:" -msgstr "" - -#: ../../howto/clinic.rst:1739 -msgid "{path}" -msgstr "{path}" - -#: ../../howto/clinic.rst:1740 -msgid "The full path to the file, including directory and full filename." -msgstr "" - -#: ../../howto/clinic.rst:1741 -msgid "{dirname}" -msgstr "{dirname}" - -#: ../../howto/clinic.rst:1742 -msgid "The name of the directory the file is in." -msgstr "" - -#: ../../howto/clinic.rst:1743 -msgid "{basename}" -msgstr "{basename}" - -#: ../../howto/clinic.rst:1744 -msgid "Just the name of the file, not including the directory." -msgstr "" - -#: ../../howto/clinic.rst:1746 -msgid "{basename_root}" -msgstr "{basename_root}" - -#: ../../howto/clinic.rst:1746 -msgid "" -"Basename with the extension clipped off (everything up to but not including " -"the last '.')." -msgstr "" - -#: ../../howto/clinic.rst:1750 -msgid "{basename_extension}" -msgstr "{basename_extension}" - -#: ../../howto/clinic.rst:1749 -msgid "" -"The last '.' and everything after it. If the basename does not contain a " -"period, this will be the empty string." -msgstr "" - -#: ../../howto/clinic.rst:1752 -msgid "" -"If there are no periods in the filename, {basename} and {filename} are the " -"same, and {extension} is empty. \"{basename}{extension}\" is always exactly " -"the same as \"{filename}\".\"" -msgstr "" - -#: ../../howto/clinic.rst:1757 -msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1760 -msgid "The ``clear`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1766 -msgid "" -"It removes all the accumulated text up to this point in the destination. (I " -"don't know what you'd need this for, but I thought maybe it'd be useful " -"while someone's experimenting.)" -msgstr "" - -#: ../../howto/clinic.rst:1770 -msgid "The fourth new directive is ``set``:" -msgstr "" - -#: ../../howto/clinic.rst:1777 -msgid "" -"``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " -"string that will be prepended to every line of Clinic's output; " -"``line_suffix`` is a string that will be appended to every line of Clinic's " -"output." -msgstr "" - -#: ../../howto/clinic.rst:1781 -msgid "Both of these support two format strings:" -msgstr "" - -#: ../../howto/clinic.rst:1784 -msgid "``{block comment start}``" -msgstr "``{block comment start}``" - -#: ../../howto/clinic.rst:1784 -msgid "" -"Turns into the string ``/*``, the start-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1787 -msgid "``{block comment end}``" -msgstr "``{block comment end}``" - -#: ../../howto/clinic.rst:1787 -msgid "" -"Turns into the string ``*/``, the end-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1789 -msgid "" -"The final new directive is one you shouldn't need to use directly, called " -"``preserve``:" -msgstr "" - -#: ../../howto/clinic.rst:1796 -msgid "" -"This tells Clinic that the current contents of the output should be kept, " -"unmodified. This is used internally by Clinic when dumping output into " -"``file`` files; wrapping it in a Clinic block lets Clinic use its existing " -"checksum functionality to ensure the file was not modified by hand before it " -"gets overwritten." -msgstr "" - -#: ../../howto/clinic.rst:1803 -msgid "How to use the ``#ifdef`` trick" -msgstr "" - -#: ../../howto/clinic.rst:1805 -msgid "" -"If you're converting a function that isn't available on all platforms, " -"there's a trick you can use to make life a little easier. The existing code " -"probably looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1816 -msgid "" -"And then in the ``PyMethodDef`` structure at the bottom the existing code " -"will have:" -msgstr "" - -#: ../../howto/clinic.rst:1825 -msgid "" -"In this scenario, you should enclose the body of your impl function inside " -"the ``#ifdef``, like so::" -msgstr "" - -#: ../../howto/clinic.rst:1839 -msgid "" -"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " -"replacing them with the macro Argument Clinic generated:" -msgstr "" - -#: ../../howto/clinic.rst:1846 -msgid "" -"(You can find the real name for this macro inside the generated code. Or you " -"can calculate it yourself: it's the name of your function as defined on the " -"first line of your block, but with periods changed to underscores, " -"uppercased, and ``\"_METHODDEF\"`` added to the end.)" -msgstr "" - -#: ../../howto/clinic.rst:1851 -msgid "" -"Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " -"``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" -msgstr "" - -#: ../../howto/clinic.rst:1854 -msgid "" -"Here's where Argument Clinic gets very clever. It actually detects that the " -"Argument Clinic block might be deactivated by the ``#ifdef``. When that " -"happens, it generates a little extra code that looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1862 -msgid "" -"That means the macro always works. If the function is defined, this turns " -"into the correct structure, including the trailing comma. If the function " -"is undefined, this turns into nothing." -msgstr "" - -#: ../../howto/clinic.rst:1866 -msgid "" -"However, this causes one ticklish problem: where should Argument Clinic put " -"this extra code when using the \"block\" output preset? It can't go in the " -"output block, because that could be deactivated by the ``#ifdef``. (That's " -"the whole point!)" -msgstr "" - -#: ../../howto/clinic.rst:1870 -msgid "" -"In this situation, Argument Clinic writes the extra code to the \"buffer\" " -"destination. This may mean that you get a complaint from Argument Clinic:" -msgstr "" - -#: ../../howto/clinic.rst:1878 -msgid "" -"When this happens, just open your file, find the ``dump buffer`` block that " -"Argument Clinic added to your file (it'll be at the very bottom), then move " -"it above the :c:type:`PyMethodDef` structure where that macro is used." -msgstr "" - -#: ../../howto/clinic.rst:1884 -msgid "How to use Argument Clinic in Python files" -msgstr "" - -#: ../../howto/clinic.rst:1886 -msgid "" -"It's actually possible to use Argument Clinic to preprocess Python files. " -"There's no point to using Argument Clinic blocks, of course, as the output " -"wouldn't make any sense to the Python interpreter. But using Argument " -"Clinic to run Python blocks lets you use Python as a Python preprocessor!" -msgstr "" - -#: ../../howto/clinic.rst:1891 -msgid "" -"Since Python comments are different from C comments, Argument Clinic blocks " -"embedded in Python files look slightly different. They look like this:" -msgstr "" - -#~ msgid "``type``" -#~ msgstr "``type``" - -#~ msgid "``default``" -#~ msgstr "``default``" - -#~ msgid "``py_default``" -#~ msgstr "``py_default``" - -#~ msgid "``c_ignored_default``" -#~ msgstr "``c_ignored_default``" - -#~ msgid "``impl_by_reference``" -#~ msgstr "``impl_by_reference``" - -#~ msgid "``parse_by_reference``" -#~ msgstr "``parse_by_reference``" - -#~ msgid "Py_buffer" -#~ msgstr "Py_buffer" +"Argument Clinic 操作方法已移至「`Python 開發人員指南 `__」。" diff --git a/howto/enum.po b/howto/enum.po index b8dfcac179..d581267153 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1030,44 +1030,44 @@ msgstr "" msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1162 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1164 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1165 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1166 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1167 +#: ../../howto/enum.rst:1168 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1175 +#: ../../howto/enum.rst:1176 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1182 +#: ../../howto/enum.rst:1183 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1185 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1194 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1204 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1209 +#: ../../howto/enum.rst:1210 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1212 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1217 +#: ../../howto/enum.rst:1218 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1219 +#: ../../howto/enum.rst:1220 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1225 +#: ../../howto/enum.rst:1226 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1235 +#: ../../howto/enum.rst:1236 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1239 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1247 +#: ../../howto/enum.rst:1248 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1252 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1253 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1254 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1256 +#: ../../howto/enum.rst:1257 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1263 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1276 +#: ../../howto/enum.rst:1277 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1278 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1288 +#: ../../howto/enum.rst:1289 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1305 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1307 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1318 +#: ../../howto/enum.rst:1319 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1320 +#: ../../howto/enum.rst:1321 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1337 +#: ../../howto/enum.rst:1338 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1347 +#: ../../howto/enum.rst:1348 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1366 +#: ../../howto/enum.rst:1367 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1372 +#: ../../howto/enum.rst:1373 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1379 +#: ../../howto/enum.rst:1380 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1382 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1415 +#: ../../howto/enum.rst:1416 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1417 +#: ../../howto/enum.rst:1418 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1442 +#: ../../howto/enum.rst:1443 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1448 +#: ../../howto/enum.rst:1449 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1450 +#: ../../howto/enum.rst:1451 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1479 +#: ../../howto/enum.rst:1480 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1482 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1500 +#: ../../howto/enum.rst:1501 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1502 +#: ../../howto/enum.rst:1503 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 29a7b4d68f..0850e3c94d 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-08-17 22:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,20 +193,20 @@ msgstr "其中的行 (column) 是:" msgid "time in microseconds since start of script" msgstr "自腳本開始以來的時間(以微秒為單位)" -#: ../../howto/instrumentation.rst:251 +#: ../../howto/instrumentation.rst:250 msgid "name of executable" msgstr "可執行檔案的名稱" -#: ../../howto/instrumentation.rst:253 +#: ../../howto/instrumentation.rst:251 msgid "PID of process" msgstr "行程的 PID" -#: ../../howto/instrumentation.rst:255 +#: ../../howto/instrumentation.rst:253 msgid "" "and the remainder indicates the call/return hierarchy as the script executes." msgstr "其餘部分表示腳本執行時的呼叫/回傳階層結構。" -#: ../../howto/instrumentation.rst:257 +#: ../../howto/instrumentation.rst:255 msgid "" "For a :option:`--enable-shared` build of CPython, the markers are contained " "within the libpython shared library, and the probe's dotted path needs to " @@ -216,26 +216,26 @@ msgstr "" "函式庫中,並且探針的帶點路徑 (dotted path) 需要反映這一點。例如,上面範例中的" "這一列:" -#: ../../howto/instrumentation.rst:265 +#: ../../howto/instrumentation.rst:263 msgid "should instead read:" msgstr "應該改為讀取:" -#: ../../howto/instrumentation.rst:271 +#: ../../howto/instrumentation.rst:269 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 `)" -#: ../../howto/instrumentation.rst:275 +#: ../../howto/instrumentation.rst:273 msgid "Available static markers" msgstr "可用的靜態標記" -#: ../../howto/instrumentation.rst:279 +#: ../../howto/instrumentation.rst:277 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" "該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:282 +#: ../../howto/instrumentation.rst:280 msgid "" "The filename, function name, and line number are provided back to the " "tracing script as positional arguments, which must be accessed using " @@ -244,25 +244,25 @@ msgstr "" "檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、" "``$arg2``、``$arg3`` 來存取:" -#: ../../howto/instrumentation.rst:286 +#: ../../howto/instrumentation.rst:284 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" "``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取" -#: ../../howto/instrumentation.rst:288 +#: ../../howto/instrumentation.rst:286 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" "``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取" -#: ../../howto/instrumentation.rst:291 +#: ../../howto/instrumentation.rst:289 msgid "``$arg3`` : ``int`` line number" msgstr "``$arg3`` : ``int`` 列號" -#: ../../howto/instrumentation.rst:295 +#: ../../howto/instrumentation.rst:293 msgid "" "This marker is the converse of :c:func:`!function__entry`, and indicates " "that execution of a Python function has ended (either via ``return``, or via " @@ -271,11 +271,11 @@ msgstr "" "該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 " "``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:299 +#: ../../howto/instrumentation.rst:297 msgid "The arguments are the same as for :c:func:`!function__entry`" msgstr "引數與 :c:func:`!function__entry` 相同" -#: ../../howto/instrumentation.rst:303 +#: ../../howto/instrumentation.rst:301 msgid "" "This marker indicates a Python line is about to be executed. It is the " "equivalent of line-by-line tracing with a Python profiler. It is not " @@ -284,11 +284,11 @@ msgstr "" "該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不" "在 C 函式內觸發。" -#: ../../howto/instrumentation.rst:307 +#: ../../howto/instrumentation.rst:305 msgid "The arguments are the same as for :c:func:`!function__entry`." msgstr "引數與 :c:func:`!function__entry` 相同。" -#: ../../howto/instrumentation.rst:311 +#: ../../howto/instrumentation.rst:309 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." @@ -296,19 +296,19 @@ msgstr "" "當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃" "描的一代 (generation),如 :func:`gc.collect()`。" -#: ../../howto/instrumentation.rst:316 +#: ../../howto/instrumentation.rst:314 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。" -#: ../../howto/instrumentation.rst:321 +#: ../../howto/instrumentation.rst:319 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。" -#: ../../howto/instrumentation.rst:328 +#: ../../howto/instrumentation.rst:326 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." @@ -316,7 +316,7 @@ msgstr "" "在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱," "``arg1`` 代表模組是否已成功載入。" -#: ../../howto/instrumentation.rst:337 +#: ../../howto/instrumentation.rst:335 msgid "" "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " @@ -325,11 +325,11 @@ msgstr "" "當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串" "形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。" -#: ../../howto/instrumentation.rst:345 +#: ../../howto/instrumentation.rst:343 msgid "SystemTap Tapsets" msgstr "SystemTap Tapsets" -#: ../../howto/instrumentation.rst:347 +#: ../../howto/instrumentation.rst:345 msgid "" "The higher-level way to use the SystemTap integration is to use a " "\"tapset\": SystemTap's equivalent of a library, which hides some of the " @@ -338,11 +338,11 @@ msgstr "" "使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫," "它隱藏了靜態標記的一些低階詳細資訊。" -#: ../../howto/instrumentation.rst:351 +#: ../../howto/instrumentation.rst:349 msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:" -#: ../../howto/instrumentation.rst:374 +#: ../../howto/instrumentation.rst:372 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" @@ -350,7 +350,7 @@ msgstr "" "如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/" "tapset``),則這些額外的探測點將可被使用:" -#: ../../howto/instrumentation.rst:380 +#: ../../howto/instrumentation.rst:378 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." @@ -358,7 +358,7 @@ msgstr "" "該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸" "發。" -#: ../../howto/instrumentation.rst:385 +#: ../../howto/instrumentation.rst:383 msgid "" "This probe point is the converse of ``python.function.return``, and " "indicates that execution of a Python function has ended (either via " @@ -368,11 +368,11 @@ msgstr "" "這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束" "(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:392 +#: ../../howto/instrumentation.rst:390 msgid "Examples" msgstr "範例" -#: ../../howto/instrumentation.rst:393 +#: ../../howto/instrumentation.rst:391 msgid "" "This SystemTap script uses the tapset above to more cleanly implement the " "example given above of tracing the Python function-call hierarchy, without " @@ -381,7 +381,7 @@ msgstr "" "此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼" "叫階層結構的範例,而無需直接命名靜態標記:" -#: ../../howto/instrumentation.rst:412 +#: ../../howto/instrumentation.rst:410 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently entered bytecode " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 31e89a4211..677327880d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -915,7 +915,7 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That's because the __ notation is just syntax " -"sugar for a constructor call to one of the XXXMessage classes." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" #: ../../howto/logging-cookbook.rst:1733 @@ -1446,8 +1446,8 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That’s because the __ notation is just syntax " -"sugar for a constructor call to one of the ``XXXMessage`` classes shown " -"above." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes " +"shown above." msgstr "" #: ../../howto/logging-cookbook.rst:2655 diff --git a/howto/logging.po b/howto/logging.po index 56e0345614..72076c0c96 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -1237,7 +1237,7 @@ msgstr "" msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " -"handlers could be found for logger XXX' message which can be displayed if " +"handlers could be found for logger *XXX*' message which can be displayed if " "the library user has not configured logging. See :ref:`library-config` for " "more information." msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 3fb4ec18fe..4964959d41 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -112,23 +112,23 @@ msgstr "" msgid "Example, using the environment variable::" msgstr "" -#: ../../howto/perf_profiling.rst:169 +#: ../../howto/perf_profiling.rst:168 msgid "Example, using the :option:`!-X` option::" msgstr "" -#: ../../howto/perf_profiling.rst:174 +#: ../../howto/perf_profiling.rst:173 msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" msgstr "" -#: ../../howto/perf_profiling.rst:186 +#: ../../howto/perf_profiling.rst:185 msgid "...then::" msgstr "" -#: ../../howto/perf_profiling.rst:193 +#: ../../howto/perf_profiling.rst:192 msgid "How to obtain the best results" msgstr "" -#: ../../howto/perf_profiling.rst:195 +#: ../../howto/perf_profiling.rst:194 msgid "" "For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" "pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " @@ -138,12 +138,12 @@ msgid "" "available." msgstr "" -#: ../../howto/perf_profiling.rst:202 +#: ../../howto/perf_profiling.rst:201 msgid "" "You can check if your system has been compiled with this flag by running::" msgstr "" -#: ../../howto/perf_profiling.rst:206 +#: ../../howto/perf_profiling.rst:205 msgid "" "If you don't see any output it means that your interpreter has not been " "compiled with frame pointers and therefore it may not be able to show Python " diff --git a/howto/urllib2.po b/howto/urllib2.po index 38983936ff..64aac1a827 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-23 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -226,15 +226,15 @@ msgstr "" #: ../../howto/urllib2.rst:197 msgid "" -"*urlopen* raises :exc:`URLError` when it cannot handle a response (though as " -"usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:" -"`TypeError` etc. may also be raised)." +"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " +"response (though as usual with Python APIs, built-in exceptions such as :exc:" +"`ValueError`, :exc:`TypeError` etc. may also be raised)." msgstr "" #: ../../howto/urllib2.rst:201 msgid "" -":exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific " -"case of HTTP URLs." +":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." +"URLError` raised in the specific case of HTTP URLs." msgstr "" #: ../../howto/urllib2.rst:204 @@ -268,9 +268,9 @@ msgid "" "request. The default handlers will handle some of these responses for you " "(for example, if the response is a \"redirection\" that requests the client " "fetch the document from a different URL, urllib will handle that for you). " -"For those it can't handle, urlopen will raise an :exc:`HTTPError`. Typical " -"errors include '404' (page not found), '403' (request forbidden), and " -"'401' (authentication required)." +"For those it can't handle, urlopen will raise an :exc:`~urllib.error." +"HTTPError`. Typical errors include '404' (page not found), '403' (request " +"forbidden), and '401' (authentication required)." msgstr "" #: ../../howto/urllib2.rst:235 @@ -280,8 +280,8 @@ msgstr "" #: ../../howto/urllib2.rst:237 msgid "" -"The :exc:`HTTPError` instance raised will have an integer 'code' attribute, " -"which corresponds to the error sent by the server." +"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " +"'code' attribute, which corresponds to the error sent by the server." msgstr "" #: ../../howto/urllib2.rst:241 @@ -305,10 +305,10 @@ msgstr "" #: ../../howto/urllib2.rst:319 msgid "" "When an error is raised the server responds by returning an HTTP error code " -"*and* an error page. You can use the :exc:`HTTPError` instance as a response " -"on the page returned. This means that as well as the code attribute, it also " -"has read, geturl, and info, methods as returned by the ``urllib.response`` " -"module::" +"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance " +"as a response on the page returned. This means that as well as the code " +"attribute, it also has read, geturl, and info, methods as returned by the " +"``urllib.response`` module::" msgstr "" #: ../../howto/urllib2.rst:339 @@ -317,8 +317,9 @@ msgstr "" #: ../../howto/urllib2.rst:341 msgid "" -"So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` " -"there are two basic approaches. I prefer the second approach." +"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" +"`~urllib.error.URLError` there are two basic approaches. I prefer the second " +"approach." msgstr "" #: ../../howto/urllib2.rst:345 @@ -328,7 +329,7 @@ msgstr "" #: ../../howto/urllib2.rst:367 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " -"will *also* catch an :exc:`HTTPError`." +"will *also* catch an :exc:`~urllib.error.HTTPError`." msgstr "" #: ../../howto/urllib2.rst:371 @@ -341,9 +342,9 @@ msgstr "" #: ../../howto/urllib2.rst:394 msgid "" -"The response returned by urlopen (or the :exc:`HTTPError` instance) has two " -"useful methods :meth:`info` and :meth:`geturl` and is defined in the module :" -"mod:`urllib.response`.." +"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " +"instance) has two useful methods :meth:`info` and :meth:`geturl` and is " +"defined in the module :mod:`urllib.response`.." msgstr "" #: ../../howto/urllib2.rst:398 diff --git a/library/__main__.po b/library/__main__.po index c369e52fc2..d5bf9aa3ad 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -254,10 +254,10 @@ msgstr "" #: ../../library/__main__.rst:241 msgid "" -"The contents of ``__main__.py`` typically isn't fenced with ``if __name__ == " -"'__main__'`` blocks. Instead, those files are kept short, functions to " -"execute from other modules. Those other modules can then be easily unit-" -"tested and are properly reusable." +"The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " +"== '__main__'`` block. Instead, those files are kept short and import " +"functions to execute from other modules. Those other modules can then be " +"easily unit-tested and are properly reusable." msgstr "" #: ../../library/__main__.rst:246 diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 7e8bd669a4..b073cb620a 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -1,15 +1,15 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: -# Matt Wang , 2022 +# Matt Wang , 2022-2023 # msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-07 00:17+0000\n" -"PO-Revision-Date: 2022-02-09 11:27+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"PO-Revision-Date: 2023-10-12 11:27+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -70,7 +70,7 @@ msgstr "範例" #: ../../library/asyncio-llapi-index.rst:33 msgid ":ref:`Using asyncio.get_running_loop() `." -msgstr ":ref:`使用 asyncio.get_running_loop() `\\ 。" +msgstr ":ref:`使用 asyncio.get_running_loop() `。" #: ../../library/asyncio-llapi-index.rst:37 msgid "Event Loop Methods" @@ -124,7 +124,7 @@ msgstr ":meth:`loop.is_running()`" #: ../../library/asyncio-llapi-index.rst:60 msgid "Return ``True`` if the event loop is running." -msgstr "如果事件迴圈正在執行則回傳 ``True``\\ 。" +msgstr "如果事件迴圈正在執行則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:62 msgid ":meth:`loop.is_closed()`" @@ -132,7 +132,7 @@ msgstr ":meth:`loop.is_closed()`" #: ../../library/asyncio-llapi-index.rst:63 msgid "Return ``True`` if the event loop is closed." -msgstr "如果事件迴圈已經被關閉則回傳 ``True``\\ ,。" +msgstr "如果事件迴圈已經被關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:65 msgid "``await`` :meth:`loop.shutdown_asyncgens`" @@ -275,7 +275,7 @@ msgstr "``await`` :meth:`loop.getaddrinfo`" #: ../../library/asyncio-llapi-index.rst:138 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." -msgstr "非同步版本的 :meth:`socket.getaddrinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getaddrinfo`。" #: ../../library/asyncio-llapi-index.rst:140 msgid "``await`` :meth:`loop.getnameinfo`" @@ -283,7 +283,7 @@ msgstr "``await`` :meth:`loop.getnameinfo`" #: ../../library/asyncio-llapi-index.rst:141 msgid "Asynchronous version of :meth:`socket.getnameinfo`." -msgstr "非同步版本的 :meth:`socket.getnameinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getnameinfo`。" #: ../../library/asyncio-llapi-index.rst:144 msgid "Networking and IPC" @@ -327,7 +327,7 @@ msgstr "``await`` :meth:`loop.connect_accepted_socket`" #: ../../library/asyncio-llapi-index.rst:162 msgid "Wrap a :class:`~socket.socket` into a ``(transport, protocol)`` pair." -msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:165 msgid "``await`` :meth:`loop.create_datagram_endpoint`" @@ -359,7 +359,7 @@ msgstr "``await`` :meth:`loop.connect_read_pipe`" #: ../../library/asyncio-llapi-index.rst:175 msgid "Wrap a read end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:177 msgid "``await`` :meth:`loop.connect_write_pipe`" @@ -367,7 +367,7 @@ msgstr "``await`` :meth:`loop.connect_write_pipe`" #: ../../library/asyncio-llapi-index.rst:178 msgid "Wrap a write end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:181 msgid "Sockets" @@ -412,7 +412,7 @@ msgstr "``await`` :meth:`loop.sock_sendall`" #: ../../library/asyncio-llapi-index.rst:199 msgid "Send data to the :class:`~socket.socket`." -msgstr "傳送資料到 :class:`~socket.socket`\\ 。" +msgstr "傳送資料到 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:201 msgid "``await`` :meth:`loop.sock_sendto`" @@ -428,7 +428,7 @@ msgstr "``await`` :meth:`loop.sock_connect`" #: ../../library/asyncio-llapi-index.rst:205 msgid "Connect the :class:`~socket.socket`." -msgstr "連接 :class:`~socket.socket`\\ 。" +msgstr "連接 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:207 msgid "``await`` :meth:`loop.sock_accept`" @@ -560,11 +560,11 @@ msgid "" "`." msgstr "" ":ref:`使用 asyncio.new_event_loop() 和 loop.run_forever() " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:273 msgid ":ref:`Using loop.call_later() `." -msgstr ":ref:`使用 loop.call_later() `\\ 。" +msgstr ":ref:`使用 loop.call_later() `。" #: ../../library/asyncio-llapi-index.rst:275 msgid "" @@ -572,7 +572,7 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 以實作\\ :ref:`一個 echo 客戶端 " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:278 msgid "" @@ -580,24 +580,23 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 來\\ :ref:`連接 socket " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:281 msgid "" ":ref:`Using add_reader() to watch an FD for read events " "`." msgstr "" -":ref:`使用 add_reader() 監控 FD 的讀取事件 `\\ 。" +":ref:`使用 add_reader() 監控 FD 的讀取事件 `。" #: ../../library/asyncio-llapi-index.rst:284 msgid ":ref:`Using loop.add_signal_handler() `." -msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +msgstr ":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:286 msgid ":ref:`Using loop.subprocess_exec() `." msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:290 msgid "Transports" @@ -621,7 +620,7 @@ msgstr ":meth:`transport.is_closing() `" #: ../../library/asyncio-llapi-index.rst:302 msgid "Return ``True`` if the transport is closing or is closed." -msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``\\ 。" +msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:304 msgid ":meth:`transport.get_extra_info() `" @@ -654,8 +653,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" msgstr "" "可以接收資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_read_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_read_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:319 msgid "Read Transports" @@ -667,7 +666,7 @@ msgstr ":meth:`transport.is_reading() `" #: ../../library/asyncio-llapi-index.rst:325 msgid "Return ``True`` if the transport is receiving." -msgstr "如果傳輸正在接收則回傳 ``True``\\ 。" +msgstr "如果傳輸正在接收則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:327 msgid ":meth:`transport.pause_reading() `" @@ -692,8 +691,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" msgstr "" "可以傳送資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_write_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_write_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:339 msgid "Write Transports" @@ -721,7 +720,7 @@ msgstr ":meth:`transport.can_write_eof() `" #: ../../library/asyncio-llapi-index.rst:351 msgid "Return :const:`True` if the transport supports sending EOF." -msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`\\ 。" +msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`。" #: ../../library/asyncio-llapi-index.rst:353 msgid ":meth:`transport.write_eof() `" @@ -830,8 +829,7 @@ msgstr "" msgid "" "Return the transport for the requested communication pipe (*stdin*, " "*stdout*, or *stderr*)." -msgstr "" -"回傳被請求用於通訊 pipe (*stdin*\\ 、\\ *stdout* 或 *stderr*)的傳輸。" +msgstr "回傳被請求用於通訊 pipe (*stdin*、*stdout* 或 *stderr*)的傳輸。" #: ../../library/asyncio-llapi-index.rst:403 msgid ":meth:`transport.get_returncode() `" @@ -989,40 +987,37 @@ msgid "Subprocess Protocols" msgstr "子行程協定" #: ../../library/asyncio-llapi-index.rst:487 -msgid "" -"``callback`` :meth:`pipe_data_received() `" -msgstr "" -"``callback`` :meth:`pipe_data_received() `" +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -#: ../../library/asyncio-llapi-index.rst:489 +#: ../../library/asyncio-llapi-index.rst:488 msgid "" "Called when the child process writes data into its *stdout* or *stderr* pipe." msgstr "在子行程向 *stdout* 或 *stderr* pipe 寫入資料時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:492 -msgid "" -"``callback`` :meth:`pipe_connection_lost() `" -msgstr "" -"``callback`` :meth:`pipe_connection_lost() `" +#: ../../library/asyncio-llapi-index.rst:491 +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -#: ../../library/asyncio-llapi-index.rst:494 +#: ../../library/asyncio-llapi-index.rst:492 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "在與子行程通訊的其中一個 pipes 關閉時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:497 +#: ../../library/asyncio-llapi-index.rst:495 msgid "" "``callback`` :meth:`process_exited() `" msgstr "" "``callback`` :meth:`process_exited() `" -#: ../../library/asyncio-llapi-index.rst:499 -msgid "Called when the child process has exited." -msgstr "在子行程退出後被呼叫。" +#: ../../library/asyncio-llapi-index.rst:497 +msgid "" +"Called when the child process has exited. It can be called before :meth:" +"`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." +"pipe_connection_lost` methods." +msgstr "" +"在子行程退出時呼叫。它可以在 :meth:`~SubprocessProtocol.pipe_data_received` " +"和 :meth:`~SubprocessProtocol.pipe_connection_lost` 方法之前呼叫。" #: ../../library/asyncio-llapi-index.rst:503 msgid "Event Loop Policies" @@ -1035,7 +1030,7 @@ msgid "" "` for more details." msgstr "" "Policy 是改變 :func:`asyncio.get_event_loop` 這類函式行為的一個低階機制。更多" -"細節請見 :ref:`Policy 相關段落 `\\ 。" +"細節請見 :ref:`Policy 相關段落 `。" #: ../../library/asyncio-llapi-index.rst:511 msgid "Accessing Policies" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 971caf4c1e..c9cf7bfefb 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -931,101 +931,107 @@ msgstr "" msgid "Called when the child process has exited." msgstr "" -#: ../../library/asyncio-protocol.rst:713 +#: ../../library/asyncio-protocol.rst:711 +msgid "" +"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" +"meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgstr "" + +#: ../../library/asyncio-protocol.rst:716 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-protocol.rst:718 +#: ../../library/asyncio-protocol.rst:721 msgid "TCP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:720 +#: ../../library/asyncio-protocol.rst:723 msgid "" "Create a TCP echo server using the :meth:`loop.create_server` method, send " "back received data, and close the connection::" msgstr "" -#: ../../library/asyncio-protocol.rst:761 +#: ../../library/asyncio-protocol.rst:764 msgid "" "The :ref:`TCP echo server using streams ` " "example uses the high-level :func:`asyncio.start_server` function." msgstr "" -#: ../../library/asyncio-protocol.rst:767 +#: ../../library/asyncio-protocol.rst:770 msgid "TCP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:769 +#: ../../library/asyncio-protocol.rst:772 msgid "" "A TCP echo client using the :meth:`loop.create_connection` method, sends " "data, and waits until the connection is closed::" msgstr "" -#: ../../library/asyncio-protocol.rst:817 +#: ../../library/asyncio-protocol.rst:820 msgid "" "The :ref:`TCP echo client using streams ` " "example uses the high-level :func:`asyncio.open_connection` function." msgstr "" -#: ../../library/asyncio-protocol.rst:824 +#: ../../library/asyncio-protocol.rst:827 msgid "UDP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:826 +#: ../../library/asyncio-protocol.rst:829 msgid "" "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " "sends back received data::" msgstr "" -#: ../../library/asyncio-protocol.rst:868 +#: ../../library/asyncio-protocol.rst:871 msgid "UDP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:870 +#: ../../library/asyncio-protocol.rst:873 msgid "" "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " "sends data and closes the transport when it receives the answer::" msgstr "" -#: ../../library/asyncio-protocol.rst:925 +#: ../../library/asyncio-protocol.rst:928 msgid "Connecting Existing Sockets" msgstr "" -#: ../../library/asyncio-protocol.rst:927 +#: ../../library/asyncio-protocol.rst:930 msgid "" "Wait until a socket receives data using the :meth:`loop.create_connection` " "method with a protocol::" msgstr "" -#: ../../library/asyncio-protocol.rst:981 +#: ../../library/asyncio-protocol.rst:984 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." "add_reader` method to register an FD." msgstr "" -#: ../../library/asyncio-protocol.rst:985 +#: ../../library/asyncio-protocol.rst:988 msgid "" "The :ref:`register an open socket to wait for data using streams " "` example uses high-level streams " "created by the :func:`open_connection` function in a coroutine." msgstr "" -#: ../../library/asyncio-protocol.rst:992 +#: ../../library/asyncio-protocol.rst:995 msgid "loop.subprocess_exec() and SubprocessProtocol" msgstr "" -#: ../../library/asyncio-protocol.rst:994 +#: ../../library/asyncio-protocol.rst:997 msgid "" "An example of a subprocess protocol used to get the output of a subprocess " "and to wait for the subprocess exit." msgstr "" -#: ../../library/asyncio-protocol.rst:997 +#: ../../library/asyncio-protocol.rst:1000 msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" -#: ../../library/asyncio-protocol.rst:1043 +#: ../../library/asyncio-protocol.rst:1060 msgid "" "See also the :ref:`same example ` " "written using high-level APIs." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 20eded89b3..6c96adc696 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+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-" @@ -305,7 +304,7 @@ msgstr "" #: ../../library/asyncio-task.rst:338 ../../library/asyncio-task.rst:472 #: ../../library/asyncio-task.rst:645 ../../library/asyncio-task.rst:703 -#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:772 +#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:769 #: ../../library/asyncio-task.rst:869 msgid "Example::" msgstr "" @@ -395,9 +394,8 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 -#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:767 -#: ../../library/asyncio-task.rst:797 ../../library/asyncio-task.rst:849 -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:849 ../../library/asyncio-task.rst:875 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -723,12 +721,16 @@ msgstr "" msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:789 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" +#: ../../library/asyncio-task.rst:797 +msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." +msgstr "引發 :exc:`TimeoutError` 而不是 :exc:`asyncio.TimeoutError`。" + #: ../../library/asyncio-task.rst:802 msgid "Waiting Primitives" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index b1deae96b2..c05bfecad4 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -21,15 +21,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0\n" -#: ../../library/asyncio.rst:78 +#: ../../library/asyncio.rst:80 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:90 +#: ../../library/asyncio.rst:92 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:101 +#: ../../library/asyncio.rst:103 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -127,7 +127,7 @@ msgstr "" "透過 async/await 語法來\\ :ref:`橋接 `\\ 基於回呼 (callback-" "based) 的函式庫與程式碼。" -#: ../../library/asyncio.rst:59 +#: ../../library/asyncio.rst:61 msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" msgstr "你能在 REPL 中對一個 ``asyncio`` 的並行情境 (context) 進行實驗:" @@ -144,10 +144,10 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/asyncio.rst:77 +#: ../../library/asyncio.rst:79 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:110 +#: ../../library/asyncio.rst:112 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/binascii.po b/library/binascii.po index 2a454d8619..8528897275 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -79,51 +79,51 @@ msgid "" "base64 data will raise :exc:`binascii.Error`." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:60 msgid "Valid base64:" msgstr "" -#: ../../library/binascii.rst:61 +#: ../../library/binascii.rst:62 msgid "Conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:62 +#: ../../library/binascii.rst:63 msgid "Contains only characters from the base64 alphabet." msgstr "" -#: ../../library/binascii.rst:63 +#: ../../library/binascii.rst:64 msgid "" "Contains no excess data after padding (including excess padding, newlines, " "etc.)." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:65 msgid "Does not start with a padding." msgstr "" -#: ../../library/binascii.rst:66 +#: ../../library/binascii.rst:67 msgid "Added the *strict_mode* parameter." msgstr "新增 *strict_mode* 參數。" -#: ../../library/binascii.rst:72 +#: ../../library/binascii.rst:73 msgid "" "Convert binary data to a line of ASCII characters in base64 coding. The " "return value is the converted line, including a newline char if *newline* is " "true. The output of this function conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:76 +#: ../../library/binascii.rst:77 msgid "Added the *newline* parameter." msgstr "新增 *newline* 參數。" -#: ../../library/binascii.rst:82 +#: ../../library/binascii.rst:83 msgid "" "Convert a block of quoted-printable data back to binary and return the " "binary data. More than one line may be passed at a time. If the optional " "argument *header* is present and true, underscores will be decoded as spaces." msgstr "" -#: ../../library/binascii.rst:89 +#: ../../library/binascii.rst:90 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -136,7 +136,7 @@ msgid "" "might corrupt the binary data stream." msgstr "" -#: ../../library/binascii.rst:102 +#: ../../library/binascii.rst:103 msgid "" "Compute a 16-bit CRC value of *data*, starting with *value* as the initial " "CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " @@ -144,7 +144,7 @@ msgid "" "used in the binhex4 format." msgstr "" -#: ../../library/binascii.rst:110 +#: ../../library/binascii.rst:111 msgid "" "Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " "initial CRC of *value*. The default initial CRC is zero. The algorithm is " @@ -153,24 +153,24 @@ msgid "" "algorithm. Use as follows::" msgstr "" -#: ../../library/binascii.rst:122 +#: ../../library/binascii.rst:123 msgid "The result is always unsigned." msgstr "" -#: ../../library/binascii.rst:128 +#: ../../library/binascii.rst:129 msgid "" "Return the hexadecimal representation of the binary *data*. Every byte of " "*data* is converted into the corresponding 2-digit hex representation. The " "returned bytes object is therefore twice as long as the length of *data*." msgstr "" -#: ../../library/binascii.rst:132 +#: ../../library/binascii.rst:133 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" -#: ../../library/binascii.rst:135 +#: ../../library/binascii.rst:136 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " @@ -178,11 +178,11 @@ msgid "" "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" -#: ../../library/binascii.rst:150 +#: ../../library/binascii.rst:151 msgid "The *sep* and *bytes_per_sep* parameters were added." msgstr "新增 *sep* 與 *bytes_per_sep* 參數。" -#: ../../library/binascii.rst:156 +#: ../../library/binascii.rst:157 msgid "" "Return the binary data represented by the hexadecimal string *hexstr*. This " "function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " @@ -190,45 +190,45 @@ msgid "" "an :exc:`Error` exception is raised." msgstr "" -#: ../../library/binascii.rst:161 +#: ../../library/binascii.rst:162 msgid "" "Similar functionality (accepting only text string arguments, but more " "liberal towards whitespace) is also accessible using the :meth:`bytes." "fromhex` class method." msgstr "" -#: ../../library/binascii.rst:167 +#: ../../library/binascii.rst:168 msgid "Exception raised on errors. These are usually programming errors." msgstr "" -#: ../../library/binascii.rst:172 +#: ../../library/binascii.rst:173 msgid "" "Exception raised on incomplete data. These are usually not programming " "errors, but may be handled by reading a little more data and trying again." msgstr "" -#: ../../library/binascii.rst:180 +#: ../../library/binascii.rst:181 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/binascii.rst:179 +#: ../../library/binascii.rst:180 msgid "" "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Module :mod:`uu`" msgstr ":mod:`uu` 模組" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Support for UU encoding used on Unix." msgstr "" -#: ../../library/binascii.rst:185 +#: ../../library/binascii.rst:186 msgid "Module :mod:`quopri`" msgstr ":mod:`quopri` 模組" -#: ../../library/binascii.rst:186 +#: ../../library/binascii.rst:187 msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" diff --git a/library/cmdline.po b/library/cmdline.po new file mode 100644 index 0000000000..5f894724f8 --- /dev/null +++ b/library/cmdline.po @@ -0,0 +1,226 @@ +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +# Translators: +# Matt Wang , 2023 +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"PO-Revision-Date: 2023-10-14 16:03+0800\n" +"Last-Translator: Matt Wang \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cmdline.rst:3 +msgid "Modules command-line interface (CLI)" +msgstr "模組命令列介面" + +#: ../../library/cmdline.rst:5 +msgid "The following modules have a command-line interface." +msgstr "以下模組具有命令列介面。" + +#: ../../library/cmdline.rst:7 +msgid ":ref:`ast `" +msgstr ":ref:`ast `" + +#: ../../library/cmdline.rst:8 +msgid ":ref:`asyncio `" +msgstr ":ref:`asyncio `" + +#: ../../library/cmdline.rst:9 +msgid ":mod:`base64`" +msgstr ":mod:`base64`" + +#: ../../library/cmdline.rst:10 +msgid ":ref:`calendar `" +msgstr ":ref:`calendar `" + +#: ../../library/cmdline.rst:11 +msgid ":mod:`code`" +msgstr ":mod:`code`" + +#: ../../library/cmdline.rst:12 +msgid ":ref:`compileall `" +msgstr ":ref:`compileall `" + +#: ../../library/cmdline.rst:13 +msgid ":mod:`cProfile`: see :ref:`profile `" +msgstr ":mod:`cProfile`: 請見 :ref:`profile `" + +#: ../../library/cmdline.rst:14 +msgid ":ref:`difflib `" +msgstr ":ref:`difflib `" + +#: ../../library/cmdline.rst:15 +msgid ":ref:`dis `" +msgstr ":ref:`dis `" + +#: ../../library/cmdline.rst:16 +msgid ":mod:`doctest`" +msgstr ":mod:`doctest`" + +#: ../../library/cmdline.rst:17 +msgid ":mod:`!encodings.rot_13`" +msgstr ":mod:`!encodings.rot_13`" + +#: ../../library/cmdline.rst:18 +msgid ":mod:`ensurepip`" +msgstr ":mod:`ensurepip`" + +#: ../../library/cmdline.rst:19 +msgid ":mod:`filecmp`" +msgstr ":mod:`filecmp`" + +#: ../../library/cmdline.rst:20 +msgid ":mod:`fileinput`" +msgstr ":mod:`fileinput`" + +#: ../../library/cmdline.rst:21 +msgid ":mod:`ftplib`" +msgstr ":mod:`ftplib`" + +#: ../../library/cmdline.rst:22 +msgid ":ref:`gzip `" +msgstr ":ref:`gzip `" + +#: ../../library/cmdline.rst:23 +msgid ":ref:`http.server `" +msgstr ":ref:`http.server `" + +#: ../../library/cmdline.rst:24 +msgid ":mod:`!idlelib`" +msgstr ":mod:`!idlelib`" + +#: ../../library/cmdline.rst:25 +msgid ":ref:`inspect `" +msgstr ":ref:`inspect `" + +#: ../../library/cmdline.rst:26 +msgid ":ref:`json.tool `" +msgstr ":ref:`json.tool `" + +#: ../../library/cmdline.rst:27 +msgid ":mod:`mimetypes`" +msgstr ":mod:`mimetypes`" + +#: ../../library/cmdline.rst:28 +msgid ":mod:`pdb`" +msgstr ":mod:`pdb`" + +#: ../../library/cmdline.rst:29 +msgid ":mod:`pickle`" +msgstr ":mod:`pickle`" + +#: ../../library/cmdline.rst:30 +msgid ":ref:`pickletools `" +msgstr ":ref:`pickletools `" + +#: ../../library/cmdline.rst:31 +msgid ":mod:`platform`" +msgstr ":mod:`platform`" + +#: ../../library/cmdline.rst:32 +msgid ":mod:`poplib`" +msgstr ":mod:`poplib`" + +#: ../../library/cmdline.rst:33 +msgid ":ref:`profile `" +msgstr ":ref:`profile `" + +#: ../../library/cmdline.rst:34 +msgid ":mod:`pstats`" +msgstr ":mod:`pstats`" + +#: ../../library/cmdline.rst:35 +msgid ":ref:`py_compile `" +msgstr ":ref:`py_compile `" + +#: ../../library/cmdline.rst:36 +msgid ":mod:`pyclbr`" +msgstr ":mod:`pyclbr`" + +#: ../../library/cmdline.rst:37 +msgid ":mod:`pydoc`" +msgstr ":mod:`pydoc`" + +#: ../../library/cmdline.rst:38 +msgid ":mod:`quopri`" +msgstr ":mod:`quopri`" + +#: ../../library/cmdline.rst:39 +msgid ":mod:`runpy`" +msgstr ":mod:`runpy`" + +#: ../../library/cmdline.rst:40 +msgid ":ref:`site `" +msgstr ":ref:`site `" + +#: ../../library/cmdline.rst:41 +msgid ":ref:`sqlite3 `" +msgstr ":ref:`sqlite3 `" + +#: ../../library/cmdline.rst:42 +msgid ":ref:`sysconfig `" +msgstr ":ref:`sysconfig `" + +#: ../../library/cmdline.rst:43 +msgid ":mod:`tabnanny`" +msgstr ":mod:`tabnanny`" + +#: ../../library/cmdline.rst:44 +msgid ":ref:`tarfile `" +msgstr ":ref:`tarfile `" + +#: ../../library/cmdline.rst:45 +msgid ":mod:`!this`" +msgstr ":mod:`!this`" + +#: ../../library/cmdline.rst:46 +msgid ":ref:`timeit `" +msgstr ":ref:`timeit `" + +#: ../../library/cmdline.rst:47 +msgid ":ref:`tokenize `" +msgstr ":ref:`tokenize `" + +#: ../../library/cmdline.rst:48 +msgid ":ref:`trace `" +msgstr ":ref:`trace `" + +#: ../../library/cmdline.rst:49 +msgid ":mod:`turtledemo`" +msgstr ":mod:`turtledemo`" + +#: ../../library/cmdline.rst:50 +msgid ":ref:`unittest `" +msgstr ":ref:`unittest `" + +#: ../../library/cmdline.rst:51 +msgid ":ref:`uuid `" +msgstr ":ref:`uuid `" + +#: ../../library/cmdline.rst:52 +msgid ":mod:`venv`" +msgstr ":mod:`venv`" + +#: ../../library/cmdline.rst:53 +msgid ":mod:`webbrowser`" +msgstr ":mod:`webbrowser`" + +#: ../../library/cmdline.rst:54 +msgid ":ref:`zipapp `" +msgstr ":ref:`zipapp `" + +#: ../../library/cmdline.rst:55 +msgid ":ref:`zipfile `" +msgstr ":ref:`zipfile `" + +#: ../../library/cmdline.rst:57 +msgid "See also the :ref:`Python command-line interface `." +msgstr "另請見 :ref:`Python 命令列介面 `。" diff --git a/library/codecs.po b/library/codecs.po index 80c52869c2..c619a48de8 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -363,14 +363,14 @@ msgid "" "encodings` codecs:" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 msgid "Value" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Meaning" msgstr "" @@ -412,16 +412,16 @@ msgstr "``'backslashreplace'``" #: ../../library/codecs.rst:346 msgid "" "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`." +"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" +"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " +"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 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 " @@ -429,92 +429,92 @@ msgid "" "data. (See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:368 +#: ../../library/codecs.rst:369 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " -"of Unicode code point with format ``&#num;`` Implemented in :func:" +"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 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:388 +#: ../../library/codecs.rst:390 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:391 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:393 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 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:393 +#: ../../library/codecs.rst:395 msgid "" "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:400 +#: ../../library/codecs.rst:402 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:405 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" -#: ../../library/codecs.rst:407 +#: ../../library/codecs.rst:409 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:410 +#: ../../library/codecs.rst:412 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:414 +#: ../../library/codecs.rst:416 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:419 +#: ../../library/codecs.rst:421 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:423 +#: ../../library/codecs.rst:425 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -529,97 +529,97 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:435 +#: ../../library/codecs.rst:437 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:440 +#: ../../library/codecs.rst:442 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:445 +#: ../../library/codecs.rst:447 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:447 +#: ../../library/codecs.rst:449 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:449 +#: ../../library/codecs.rst:451 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:454 +#: ../../library/codecs.rst:456 msgid "Implements the ``'strict'`` error handling." msgstr "" -#: ../../library/codecs.rst:456 +#: ../../library/codecs.rst:458 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:461 +#: ../../library/codecs.rst:463 msgid "Implements the ``'ignore'`` error handling." msgstr "" -#: ../../library/codecs.rst:463 +#: ../../library/codecs.rst:465 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" -#: ../../library/codecs.rst:469 +#: ../../library/codecs.rst:471 msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:471 +#: ../../library/codecs.rst:473 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" -#: ../../library/codecs.rst:477 +#: ../../library/codecs.rst:479 msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:479 +#: ../../library/codecs.rst:481 msgid "" "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``." +"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " +"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" -#: ../../library/codecs.rst:484 +#: ../../library/codecs.rst:487 msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:490 +#: ../../library/codecs.rst:493 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:493 +#: ../../library/codecs.rst:496 msgid "" "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;`` ." +"format :samp:`&#{num};` ." msgstr "" -#: ../../library/codecs.rst:500 +#: ../../library/codecs.rst:503 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:503 +#: ../../library/codecs.rst:506 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 " @@ -627,17 +627,17 @@ msgid "" "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" -#: ../../library/codecs.rst:514 +#: ../../library/codecs.rst:517 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:516 +#: ../../library/codecs.rst:519 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:522 +#: ../../library/codecs.rst:525 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:527 ../../library/codecs.rst:549 +#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:530 +#: ../../library/codecs.rst:533 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:534 +#: ../../library/codecs.rst:537 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:540 +#: ../../library/codecs.rst:543 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:545 +#: ../../library/codecs.rst:548 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:552 +#: ../../library/codecs.rst:555 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:556 +#: ../../library/codecs.rst:559 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:561 +#: ../../library/codecs.rst:564 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:563 +#: ../../library/codecs.rst:566 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:571 +#: ../../library/codecs.rst:574 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:580 +#: ../../library/codecs.rst:583 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:582 +#: ../../library/codecs.rst:585 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:589 +#: ../../library/codecs.rst:592 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:591 +#: ../../library/codecs.rst:594 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:595 +#: ../../library/codecs.rst:598 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:599 +#: ../../library/codecs.rst:602 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:607 +#: ../../library/codecs.rst:610 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:614 +#: ../../library/codecs.rst:617 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:621 +#: ../../library/codecs.rst:624 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 " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:630 +#: ../../library/codecs.rst:633 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:637 +#: ../../library/codecs.rst:640 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:639 +#: ../../library/codecs.rst:642 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:646 +#: ../../library/codecs.rst:649 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:648 +#: ../../library/codecs.rst:651 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:652 +#: ../../library/codecs.rst:655 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:656 +#: ../../library/codecs.rst:659 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 " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:664 +#: ../../library/codecs.rst:667 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:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:675 +#: ../../library/codecs.rst:678 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:680 +#: ../../library/codecs.rst:683 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. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:695 +#: ../../library/codecs.rst:698 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:700 +#: ../../library/codecs.rst:703 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:706 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:711 +#: ../../library/codecs.rst:714 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:713 +#: ../../library/codecs.rst:716 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:720 +#: ../../library/codecs.rst:723 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:722 +#: ../../library/codecs.rst:725 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:726 +#: ../../library/codecs.rst:729 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:729 +#: ../../library/codecs.rst:732 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:733 +#: ../../library/codecs.rst:736 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 " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:739 +#: ../../library/codecs.rst:742 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:744 +#: ../../library/codecs.rst:747 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:752 ../../library/codecs.rst:847 +#: ../../library/codecs.rst:755 ../../library/codecs.rst:850 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:754 +#: ../../library/codecs.rst:757 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:759 +#: ../../library/codecs.rst:762 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:766 +#: ../../library/codecs.rst:769 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:768 +#: ../../library/codecs.rst:771 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:775 +#: ../../library/codecs.rst:778 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:777 +#: ../../library/codecs.rst:780 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:781 +#: ../../library/codecs.rst:784 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:784 +#: ../../library/codecs.rst:787 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:788 +#: ../../library/codecs.rst:791 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 " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:792 +#: ../../library/codecs.rst:795 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:798 +#: ../../library/codecs.rst:801 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:800 +#: ../../library/codecs.rst:803 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:805 +#: ../../library/codecs.rst:808 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:812 +#: ../../library/codecs.rst:815 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:816 +#: ../../library/codecs.rst:819 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 " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:824 +#: ../../library/codecs.rst:827 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:826 +#: ../../library/codecs.rst:829 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:832 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:835 +#: ../../library/codecs.rst:838 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:841 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:841 +#: ../../library/codecs.rst:844 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:849 +#: ../../library/codecs.rst:852 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:853 +#: ../../library/codecs.rst:856 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:859 +#: ../../library/codecs.rst:862 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:861 +#: ../../library/codecs.rst:864 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:864 ../../library/codecs.rst:888 +#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 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:870 +#: ../../library/codecs.rst:873 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,24 +1089,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:875 +#: ../../library/codecs.rst:878 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:883 +#: ../../library/codecs.rst:886 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:885 +#: ../../library/codecs.rst:888 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:894 +#: ../../library/codecs.rst:897 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1114,17 +1114,17 @@ msgid "" "work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:899 +#: ../../library/codecs.rst:902 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:904 +#: ../../library/codecs.rst:907 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:909 +#: ../../library/codecs.rst:912 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:913 +#: ../../library/codecs.rst:916 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:921 +#: ../../library/codecs.rst:924 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:926 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:933 +#: ../../library/codecs.rst:936 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 " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:941 +#: ../../library/codecs.rst:944 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 " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:948 +#: ../../library/codecs.rst:951 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 " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:974 +#: ../../library/codecs.rst:977 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 " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Range" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:996 +#: ../../library/codecs.rst:999 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:1000 +#: ../../library/codecs.rst:1003 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1016 +#: ../../library/codecs.rst:1019 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 " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1029 +#: ../../library/codecs.rst:1032 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1031 +#: ../../library/codecs.rst:1034 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 " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:1044 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1052 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 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 " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1057 +#: ../../library/codecs.rst:1060 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1059 +#: ../../library/codecs.rst:1062 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:1062 +#: ../../library/codecs.rst:1065 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1067 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1069 +#: ../../library/codecs.rst:1072 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1071 ../../library/codecs.rst:1077 -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1088 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1073 ../../library/codecs.rst:1075 -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1136 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1103 -#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1156 -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1222 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1096 -#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1143 -#: ../../library/codecs.rst:1150 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1231 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1158 ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1095 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1092 ../../library/codecs.rst:1123 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1217 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1094 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1210 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1145 -#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1147 -#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1105 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1221 -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1264 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1130 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1129 ../../library/codecs.rst:1164 -#: ../../library/codecs.rst:1166 ../../library/codecs.rst:1168 -#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1188 -#: ../../library/codecs.rst:1193 ../../library/codecs.rst:1196 -#: ../../library/codecs.rst:1198 ../../library/codecs.rst:1266 -#: ../../library/codecs.rst:1269 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1131 ../../library/codecs.rst:1170 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1139 ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 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:1174 +#: ../../library/codecs.rst:1177 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1177 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1174 ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1179 ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 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:1206 +#: ../../library/codecs.rst:1209 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1240 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1246 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1245 ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../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 ../../library/codecs.rst:1289 -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1294 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1294 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 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:1300 +#: ../../library/codecs.rst:1303 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1305 +#: ../../library/codecs.rst:1308 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1307 +#: ../../library/codecs.rst:1310 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 " @@ -2305,272 +2305,272 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1318 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1317 +#: ../../library/codecs.rst:1320 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:1326 +#: ../../library/codecs.rst:1329 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1326 +#: ../../library/codecs.rst:1329 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 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." +"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " +"other code points. Existing backslashes are not escaped in any way. It is " +"used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 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:1374 +#: ../../library/codecs.rst:1378 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1381 +#: ../../library/codecs.rst:1385 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1383 +#: ../../library/codecs.rst:1387 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:1391 +#: ../../library/codecs.rst:1395 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1398 +#: ../../library/codecs.rst:1402 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid ":meth:`uu.encode` / :meth:`uu.decode`" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1431 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1430 +#: ../../library/codecs.rst:1434 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1443 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:1448 +#: ../../library/codecs.rst:1452 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1457 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1456 +#: ../../library/codecs.rst:1460 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1461 +#: ../../library/codecs.rst:1465 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1471 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2578,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1476 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1475 +#: ../../library/codecs.rst:1479 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." @@ -2598,7 +2598,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1486 +#: ../../library/codecs.rst:1490 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2615,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1499 +#: ../../library/codecs.rst:1503 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:1503 +#: ../../library/codecs.rst:1507 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2630,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1511 +#: ../../library/codecs.rst:1515 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1517 +#: ../../library/codecs.rst:1521 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1523 +#: ../../library/codecs.rst:1527 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1531 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1532 +#: ../../library/codecs.rst:1536 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1534 +#: ../../library/codecs.rst:1538 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1540 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1543 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1545 +#: ../../library/codecs.rst:1549 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1551 +#: ../../library/codecs.rst:1555 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 " @@ -2705,8 +2705,8 @@ msgstr "stackable(可堆疊)" msgid "strict" msgstr "strict" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 +#: ../../library/codecs.rst:387 msgid "error handler's name" msgstr "error handler's name(錯誤處理器名稱)" @@ -2738,7 +2738,7 @@ msgstr "replacement character(替代字元)" msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" @@ -2754,18 +2754,18 @@ msgstr "\\u" msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "xmlcharrefreplace" msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "namereplace" msgstr "namereplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "\\N" msgstr "\\N" -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:387 msgid "surrogatepass" msgstr "surrogatepass" diff --git a/library/compileall.po b/library/compileall.po index 705cfc98f6..8d7b047354 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,40 +48,40 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/compileall.rst:20 +#: ../../library/compileall.rst:22 msgid "Command-line use" msgstr "" -#: ../../library/compileall.rst:22 +#: ../../library/compileall.rst:24 msgid "" "This module can work as a script (using :program:`python -m compileall`) to " "compile Python sources." msgstr "" -#: ../../library/compileall.rst:30 +#: ../../library/compileall.rst:32 msgid "" "Positional arguments are files to compile or directories that contain source " "files, traversed recursively. If no argument is given, behave as if the " -"command line was ``-l ``." +"command line was :samp:`-l {}`." msgstr "" -#: ../../library/compileall.rst:36 +#: ../../library/compileall.rst:38 msgid "" "Do not recurse into subdirectories, only compile source code files directly " "contained in the named or implied directories." msgstr "" -#: ../../library/compileall.rst:41 +#: ../../library/compileall.rst:43 msgid "Force rebuild even if timestamps are up-to-date." msgstr "" -#: ../../library/compileall.rst:45 +#: ../../library/compileall.rst:47 msgid "" "Do not print the list of files compiled. If passed once, error messages will " "still be printed. If passed twice (``-qq``), all output is suppressed." msgstr "" -#: ../../library/compileall.rst:50 +#: ../../library/compileall.rst:52 msgid "" "Directory prepended to the path to each file being compiled. This will " "appear in compilation time tracebacks, and is also compiled in to the byte-" @@ -90,26 +90,26 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:59 +#: ../../library/compileall.rst:61 msgid "" "Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the " "``.pyc`` files. Cannot be combined with ``-d``." msgstr "" -#: ../../library/compileall.rst:65 +#: ../../library/compileall.rst:67 msgid "" "regex is used to search the full path to each file considered for " "compilation, and if the regex produces a match, the file is skipped." msgstr "" -#: ../../library/compileall.rst:70 +#: ../../library/compileall.rst:72 msgid "" "Read the file ``list`` and add each line that it contains to the list of " "files and directories to compile. If ``list`` is ``-``, read lines from " "``stdin``." msgstr "" -#: ../../library/compileall.rst:76 +#: ../../library/compileall.rst:78 msgid "" "Write the byte-code files to their legacy locations and names, which may " "overwrite byte-code files created by another version of Python. The default " @@ -117,7 +117,7 @@ msgid "" "byte-code files from multiple versions of Python to coexist." msgstr "" -#: ../../library/compileall.rst:83 +#: ../../library/compileall.rst:85 msgid "" "Control the maximum recursion level for subdirectories. If this is given, " "then ``-l`` option will not be taken into account. :program:`python -m " @@ -125,13 +125,13 @@ msgid "" " -l`." msgstr "" -#: ../../library/compileall.rst:90 +#: ../../library/compileall.rst:92 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " "used, then the result of :func:`os.cpu_count()` will be used." msgstr "" -#: ../../library/compileall.rst:96 +#: ../../library/compileall.rst:98 msgid "" "Control how the generated byte-code files are invalidated at runtime. The " "``timestamp`` value, means that ``.pyc`` files with the source timestamp and " @@ -144,53 +144,53 @@ msgid "" "the ``SOURCE_DATE_EPOCH`` environment variable is set." msgstr "" -#: ../../library/compileall.rst:109 +#: ../../library/compileall.rst:111 msgid "" "Compile with the given optimization level. May be used multiple times to " "compile for multiple levels at a time (for example, ``compileall -o 1 -o " "2``)." msgstr "" -#: ../../library/compileall.rst:115 +#: ../../library/compileall.rst:117 msgid "Ignore symlinks pointing outside the given directory." msgstr "" -#: ../../library/compileall.rst:119 +#: ../../library/compileall.rst:121 msgid "" "If two ``.pyc`` files with different optimization level have the same " "content, use hard links to consolidate duplicate files." msgstr "" -#: ../../library/compileall.rst:122 +#: ../../library/compileall.rst:124 msgid "Added the ``-i``, ``-b`` and ``-h`` options." msgstr "新增選項 ``-i``\\ 、\\ ``-b`` 與 ``-h``\\ 。" -#: ../../library/compileall.rst:125 +#: ../../library/compileall.rst:127 msgid "" "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " "to a multilevel value. ``-b`` will always produce a byte-code file ending " "in ``.pyc``, never ``.pyo``." msgstr "" -#: ../../library/compileall.rst:130 +#: ../../library/compileall.rst:132 msgid "Added the ``--invalidation-mode`` option." msgstr "新增選項 ``--invalidation-mode``\\ 。" -#: ../../library/compileall.rst:133 +#: ../../library/compileall.rst:135 msgid "" "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " "the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " "Added the possibility to specify the ``-o`` option multiple times." msgstr "" -#: ../../library/compileall.rst:140 +#: ../../library/compileall.rst:142 msgid "" "There is no command-line option to control the optimization level used by " "the :func:`compile` function, because the Python interpreter itself already " "provides the option: :program:`python -O -m compileall`." msgstr "" -#: ../../library/compileall.rst:144 +#: ../../library/compileall.rst:146 msgid "" "Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " @@ -198,24 +198,24 @@ msgid "" "that will be used at runtime." msgstr "" -#: ../../library/compileall.rst:150 +#: ../../library/compileall.rst:152 msgid "Public functions" msgstr "" -#: ../../library/compileall.rst:154 +#: ../../library/compileall.rst:156 msgid "" "Recursively descend the directory tree named by *dir*, compiling all :file:`." "py` files along the way. Return a true value if all the files compiled " "successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:158 +#: ../../library/compileall.rst:160 msgid "" "The *maxlevels* parameter is used to limit the depth of the recursion; it " "defaults to ``sys.getrecursionlimit()``." msgstr "" -#: ../../library/compileall.rst:161 +#: ../../library/compileall.rst:163 msgid "" "If *ddir* is given, it is prepended to the path to each file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -224,13 +224,13 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:167 +#: ../../library/compileall.rst:169 msgid "" "If *force* is true, modules are re-compiled even if the timestamps are up to " "date." msgstr "" -#: ../../library/compileall.rst:170 +#: ../../library/compileall.rst:172 msgid "" "If *rx* is given, its ``search`` method is called on the complete path to " "each file considered for compilation, and if it returns a true value, the " @@ -238,14 +238,14 @@ msgid "" "expression, given as a :ref:`re.Pattern ` object." msgstr "" -#: ../../library/compileall.rst:175 ../../library/compileall.rst:252 +#: ../../library/compileall.rst:177 ../../library/compileall.rst:254 msgid "" "If *quiet* is ``False`` or ``0`` (the default), the filenames and other " "information are printed to standard out. Set to ``1``, only errors are " "printed. Set to ``2``, all output is suppressed." msgstr "" -#: ../../library/compileall.rst:179 ../../library/compileall.rst:256 +#: ../../library/compileall.rst:181 ../../library/compileall.rst:258 msgid "" "If *legacy* is true, byte-code files are written to their legacy locations " "and names, which may overwrite byte-code files created by another version of " @@ -254,7 +254,7 @@ msgid "" "coexist." msgstr "" -#: ../../library/compileall.rst:185 ../../library/compileall.rst:262 +#: ../../library/compileall.rst:187 ../../library/compileall.rst:264 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " @@ -262,7 +262,7 @@ msgid "" "file in one call." msgstr "" -#: ../../library/compileall.rst:189 +#: ../../library/compileall.rst:191 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -272,79 +272,79 @@ msgid "" "`ValueError` will be raised." msgstr "" -#: ../../library/compileall.rst:196 ../../library/compileall.rst:266 +#: ../../library/compileall.rst:198 ../../library/compileall.rst:268 msgid "" "*invalidation_mode* should be a member of the :class:`py_compile." "PycInvalidationMode` enum and controls how the generated pycs are " "invalidated at runtime." msgstr "" -#: ../../library/compileall.rst:200 ../../library/compileall.rst:270 +#: ../../library/compileall.rst:202 ../../library/compileall.rst:272 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " "``str`` or :py:class:`os.PathLike`." msgstr "" -#: ../../library/compileall.rst:204 ../../library/compileall.rst:274 +#: ../../library/compileall.rst:206 ../../library/compileall.rst:276 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" -#: ../../library/compileall.rst:207 ../../library/compileall.rst:305 +#: ../../library/compileall.rst:209 ../../library/compileall.rst:307 msgid "Added the *legacy* and *optimize* parameter." msgstr "新增 *legacy* 與 *optimize* 參數。" -#: ../../library/compileall.rst:210 +#: ../../library/compileall.rst:212 msgid "Added the *workers* parameter." msgstr "新增 *workers* 參數。" -#: ../../library/compileall.rst:213 ../../library/compileall.rst:279 -#: ../../library/compileall.rst:308 +#: ../../library/compileall.rst:215 ../../library/compileall.rst:281 +#: ../../library/compileall.rst:310 msgid "*quiet* parameter was changed to a multilevel value." msgstr "" -#: ../../library/compileall.rst:216 ../../library/compileall.rst:282 -#: ../../library/compileall.rst:311 +#: ../../library/compileall.rst:218 ../../library/compileall.rst:284 +#: ../../library/compileall.rst:313 msgid "" "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " "matter what the value of *optimize* is." msgstr "" -#: ../../library/compileall.rst:220 +#: ../../library/compileall.rst:222 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/compileall.rst:223 ../../library/compileall.rst:286 -#: ../../library/compileall.rst:315 +#: ../../library/compileall.rst:225 ../../library/compileall.rst:288 +#: ../../library/compileall.rst:317 msgid "The *invalidation_mode* parameter was added." msgstr "新增 *invalidation_mode* 參數。" -#: ../../library/compileall.rst:226 ../../library/compileall.rst:289 -#: ../../library/compileall.rst:318 +#: ../../library/compileall.rst:228 ../../library/compileall.rst:291 +#: ../../library/compileall.rst:320 msgid "The *invalidation_mode* parameter's default value is updated to None." msgstr "" -#: ../../library/compileall.rst:229 +#: ../../library/compileall.rst:231 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" -#: ../../library/compileall.rst:232 +#: ../../library/compileall.rst:234 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" -#: ../../library/compileall.rst:238 +#: ../../library/compileall.rst:240 msgid "" "Compile the file with path *fullname*. Return a true value if the file " "compiled successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:241 +#: ../../library/compileall.rst:243 msgid "" "If *ddir* is given, it is prepended to the path to the file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -353,7 +353,7 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:247 +#: ../../library/compileall.rst:249 msgid "" "If *rx* is given, its ``search`` method is passed the full path name to the " "file being compiled, and if it returns a true value, the file is not " @@ -362,20 +362,20 @@ msgid "" "object." msgstr "" -#: ../../library/compileall.rst:292 +#: ../../library/compileall.rst:294 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments." msgstr "" -#: ../../library/compileall.rst:297 +#: ../../library/compileall.rst:299 msgid "" "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " "true value if all the files compiled successfully, and a false value " "otherwise." msgstr "" -#: ../../library/compileall.rst:300 +#: ../../library/compileall.rst:302 msgid "" "If *skip_curdir* is true (the default), the current directory is not " "included in the search. All other parameters are passed to the :func:" @@ -383,16 +383,16 @@ msgid "" "``maxlevels`` defaults to ``0``." msgstr "" -#: ../../library/compileall.rst:321 +#: ../../library/compileall.rst:323 msgid "" "To force a recompile of all the :file:`.py` files in the :file:`Lib/` " "subdirectory and all its subdirectories::" msgstr "" -#: ../../library/compileall.rst:338 +#: ../../library/compileall.rst:340 msgid "Module :mod:`py_compile`" msgstr ":mod:`py_compile` 模組" -#: ../../library/compileall.rst:339 +#: ../../library/compileall.rst:341 msgid "Byte-compile a single source file." msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 90ba3a62ab..d8c5ecccee 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -439,15 +439,24 @@ msgid "" msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:299 +#: ../../library/concurrent.futures.rst:296 +msgid "" +"On POSIX systems, if your application has multiple threads and the :mod:" +"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." +"fork` function called internally to spawn workers may raise a :exc:" +"`DeprecationWarning`. Pass a *mp_context* configured to use a different " +"start method. See the :func:`os.fork` documentation for further explanation." +msgstr "" + +#: ../../library/concurrent.futures.rst:307 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:337 +#: ../../library/concurrent.futures.rst:345 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:339 +#: ../../library/concurrent.futures.rst:347 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -455,7 +464,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:344 +#: ../../library/concurrent.futures.rst:352 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -464,7 +473,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:350 +#: ../../library/concurrent.futures.rst:358 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -474,22 +483,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫當前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:365 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:361 +#: ../../library/concurrent.futures.rst:369 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:366 +#: ../../library/concurrent.futures.rst:374 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:371 +#: ../../library/concurrent.futures.rst:379 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -501,19 +510,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:378 -#: ../../library/concurrent.futures.rst:392 +#: ../../library/concurrent.futures.rst:386 +#: ../../library/concurrent.futures.rst:400 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:381 +#: ../../library/concurrent.futures.rst:389 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:385 +#: ../../library/concurrent.futures.rst:393 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -525,11 +534,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:403 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:399 +#: ../../library/concurrent.futures.rst:407 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -538,7 +547,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:403 +#: ../../library/concurrent.futures.rst:411 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -550,19 +559,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:417 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:412 +#: ../../library/concurrent.futures.rst:420 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:425 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -571,7 +580,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:429 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -582,7 +591,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:426 +#: ../../library/concurrent.futures.rst:434 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -591,7 +600,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:430 +#: ../../library/concurrent.futures.rst:438 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -599,20 +608,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:436 +#: ../../library/concurrent.futures.rst:444 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:439 -#: ../../library/concurrent.futures.rst:452 +#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:460 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:442 -#: ../../library/concurrent.futures.rst:455 +#: ../../library/concurrent.futures.rst:450 +#: ../../library/concurrent.futures.rst:463 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -620,18 +629,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:449 +#: ../../library/concurrent.futures.rst:457 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:461 +#: ../../library/concurrent.futures.rst:469 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:473 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -647,7 +656,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:473 +#: ../../library/concurrent.futures.rst:481 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -656,33 +665,33 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:477 +#: ../../library/concurrent.futures.rst:485 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 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:" @@ -691,15 +700,15 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:508 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -719,36 +728,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:519 +#: ../../library/concurrent.futures.rst:527 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:525 +#: ../../library/concurrent.futures.rst:533 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:529 +#: ../../library/concurrent.futures.rst:537 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:534 +#: ../../library/concurrent.futures.rst:542 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:539 +#: ../../library/concurrent.futures.rst:547 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -757,13 +766,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:547 +#: ../../library/concurrent.futures.rst:555 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "當前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:556 +#: ../../library/concurrent.futures.rst:564 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " @@ -772,7 +781,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:" "`ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:566 +#: ../../library/concurrent.futures.rst:574 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/ctypes.po b/library/ctypes.po index 120a3fae5a..803aeb4d87 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2201 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2203 msgid "Fundamental data types" msgstr "" @@ -1245,7 +1245,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1976 +#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1977 msgid "The exact functionality is system dependent." msgstr "" @@ -1322,8 +1322,8 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1410 -#: ../../library/ctypes.rst:1421 ../../library/ctypes.rst:1438 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 +#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" @@ -1344,23 +1344,25 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:1405 -msgid ":exc:`WindowsError` used to be raised." +msgid "" +":exc:`WindowsError` used to be raised, which is now an alias of :exc:" +"`OSError`." msgstr "" -#: ../../library/ctypes.rst:1415 +#: ../../library/ctypes.rst:1416 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1423 +#: ../../library/ctypes.rst:1424 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1429 +#: ../../library/ctypes.rst:1430 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 " @@ -1368,11 +1370,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1434 +#: ../../library/ctypes.rst:1435 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1440 +#: ../../library/ctypes.rst:1441 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 " @@ -1382,7 +1384,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1447 +#: ../../library/ctypes.rst:1448 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 " @@ -1390,7 +1392,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1452 +#: ../../library/ctypes.rst:1453 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:" @@ -1400,14 +1402,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1459 +#: ../../library/ctypes.rst:1460 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:1463 +#: ../../library/ctypes.rst:1464 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 :" @@ -1416,7 +1418,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1470 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 " @@ -1426,29 +1428,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1476 +#: ../../library/ctypes.rst:1477 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1483 +#: ../../library/ctypes.rst:1484 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:1490 +#: ../../library/ctypes.rst:1491 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:1497 +#: ../../library/ctypes.rst:1498 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:1500 +#: ../../library/ctypes.rst:1501 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 " @@ -1457,21 +1459,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1513 +#: ../../library/ctypes.rst:1514 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1519 +#: ../../library/ctypes.rst:1520 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1524 +#: ../../library/ctypes.rst:1525 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1526 +#: ../../library/ctypes.rst:1527 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1479,13 +1481,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1534 +#: ../../library/ctypes.rst:1535 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:1537 +#: ../../library/ctypes.rst:1538 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -1493,39 +1495,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1543 +#: ../../library/ctypes.rst:1544 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:1547 +#: ../../library/ctypes.rst:1548 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1552 +#: ../../library/ctypes.rst:1553 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1558 +#: ../../library/ctypes.rst:1559 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1564 +#: ../../library/ctypes.rst:1565 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1571 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1573 +#: ../../library/ctypes.rst:1574 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1580 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:expr:" @@ -1533,21 +1535,21 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1584 +#: ../../library/ctypes.rst:1585 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1586 +#: ../../library/ctypes.rst:1587 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:1590 +#: ../../library/ctypes.rst:1591 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1556,14 +1558,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1593 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:1596 +#: ../../library/ctypes.rst:1597 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1572,18 +1574,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1598 +#: ../../library/ctypes.rst:1599 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:1605 +#: ../../library/ctypes.rst:1606 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1607 +#: ../../library/ctypes.rst:1608 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1592,29 +1594,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1616 +#: ../../library/ctypes.rst:1617 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1619 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1621 +#: ../../library/ctypes.rst:1622 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1627 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1630 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:expr:`int`, and the " @@ -1624,7 +1626,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1639 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1633,7 +1635,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1644 +#: ../../library/ctypes.rst:1645 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -1643,7 +1645,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1651 +#: ../../library/ctypes.rst:1652 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -1651,44 +1653,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1658 +#: ../../library/ctypes.rst:1659 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:1665 +#: ../../library/ctypes.rst:1666 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1668 +#: ../../library/ctypes.rst:1669 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:1672 +#: ../../library/ctypes.rst:1673 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:1676 +#: ../../library/ctypes.rst:1677 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:1683 +#: ../../library/ctypes.rst:1684 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1687 +#: ../../library/ctypes.rst:1688 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1697,7 +1699,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1689 +#: ../../library/ctypes.rst:1690 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 " @@ -1706,7 +1708,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1695 +#: ../../library/ctypes.rst:1696 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1715,18 +1717,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1697 +#: ../../library/ctypes.rst:1698 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:1703 +#: ../../library/ctypes.rst:1704 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1705 +#: ../../library/ctypes.rst:1706 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1737,7 +1739,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1717 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1746,20 +1748,20 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1726 +#: ../../library/ctypes.rst:1727 msgid "" "Windows only: The returned function prototype creates functions that use the " "``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:1734 +#: ../../library/ctypes.rst:1735 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:1737 +#: ../../library/ctypes.rst:1738 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 " @@ -1857,22 +1859,22 @@ msgstr "" msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1803 +#: ../../library/ctypes.rst:1804 msgid "" -"This example demonstrates how to wrap the Windows ``MessageBoxW`` function " -"so that it supports default parameters and named arguments. The C " +"The following 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:1814 ../../library/ctypes.rst:1837 +#: ../../library/ctypes.rst:1815 ../../library/ctypes.rst:1838 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1822 +#: ../../library/ctypes.rst:1823 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1828 +#: ../../library/ctypes.rst:1829 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1880,7 +1882,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1846 +#: ../../library/ctypes.rst:1847 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1888,7 +1890,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1852 msgid "" "Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -1897,7 +1899,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1864 +#: ../../library/ctypes.rst:1865 msgid "" "If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -1906,17 +1908,17 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1884 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1888 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1890 +#: ../../library/ctypes.rst:1891 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1924,30 +1926,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1896 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1902 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:1905 +#: ../../library/ctypes.rst:1906 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1909 +#: ../../library/ctypes.rst:1910 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:1915 +#: ../../library/ctypes.rst:1916 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* " @@ -1955,19 +1957,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1924 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1926 +#: ../../library/ctypes.rst:1927 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:1929 +#: ../../library/ctypes.rst:1930 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 " @@ -1976,7 +1978,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1935 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1984,19 +1986,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1940 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1943 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:1945 +#: ../../library/ctypes.rst:1946 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 " @@ -2005,7 +2007,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1951 +#: ../../library/ctypes.rst:1952 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2013,21 +2015,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1957 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:1963 +#: ../../library/ctypes.rst:1964 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:1971 +#: ../../library/ctypes.rst:1972 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 " @@ -2035,94 +2037,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1983 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:1986 +#: ../../library/ctypes.rst:1987 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:1993 +#: ../../library/ctypes.rst:1994 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:2000 +#: ../../library/ctypes.rst:2001 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:2006 +#: ../../library/ctypes.rst:2007 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2009 +#: ../../library/ctypes.rst:2010 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2013 +#: ../../library/ctypes.rst:2014 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:2016 +#: ../../library/ctypes.rst:2017 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2021 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:2027 +#: ../../library/ctypes.rst:2028 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:2034 +#: ../../library/ctypes.rst:2035 msgid "" "Create and return 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:2041 +#: ../../library/ctypes.rst:2042 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2044 +#: ../../library/ctypes.rst:2045 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:2050 +#: ../../library/ctypes.rst:2051 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 " @@ -2130,13 +2132,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2059 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:2061 +#: ../../library/ctypes.rst:2062 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2144,14 +2146,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2066 +#: ../../library/ctypes.rst:2067 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:2070 +#: ../../library/ctypes.rst:2071 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2159,20 +2161,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2075 +#: ../../library/ctypes.rst:2076 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:2081 +#: ../../library/ctypes.rst:2082 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:2085 +#: ../../library/ctypes.rst:2086 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2180,20 +2182,22 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2090 +#: ../../library/ctypes.rst:2091 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " -"creates an instance of OSError. If *code* is not specified, " +"creates an instance of :exc:`OSError`. If *code* is not specified, " "``GetLastError`` is called to determine the error code. If *descr* is not " "specified, :func:`FormatError` is called to get a textual description of the " "error." msgstr "" -#: ../../library/ctypes.rst:2096 -msgid "An instance of :exc:`WindowsError` used to be created." +#: ../../library/ctypes.rst:2097 +msgid "" +"An instance of :exc:`WindowsError` used to be created, which is now an alias " +"of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2102 +#: ../../library/ctypes.rst:2104 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 " @@ -2201,7 +2205,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2107 +#: ../../library/ctypes.rst:2109 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2209,11 +2213,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2113 +#: ../../library/ctypes.rst:2115 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2118 +#: ../../library/ctypes.rst:2120 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 " @@ -2223,13 +2227,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:2127 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:2130 +#: ../../library/ctypes.rst:2132 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2238,7 +2242,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2136 ../../library/ctypes.rst:2146 +#: ../../library/ctypes.rst:2138 ../../library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2246,7 +2250,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2140 +#: ../../library/ctypes.rst:2142 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2254,13 +2258,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2152 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2153 +#: ../../library/ctypes.rst:2155 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2268,13 +2272,13 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2155 +#: ../../library/ctypes.rst:2157 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2161 +#: ../../library/ctypes.rst:2163 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 " @@ -2282,25 +2286,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2166 +#: ../../library/ctypes.rst:2168 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:2172 +#: ../../library/ctypes.rst:2174 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:2176 +#: ../../library/ctypes.rst:2178 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2180 +#: ../../library/ctypes.rst:2182 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:" @@ -2308,13 +2312,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2187 +#: ../../library/ctypes.rst:2189 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2194 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. " @@ -2322,7 +2326,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2205 +#: ../../library/ctypes.rst:2207 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 " @@ -2331,11 +2335,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2211 +#: ../../library/ctypes.rst:2213 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2215 +#: ../../library/ctypes.rst:2217 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 " @@ -2343,7 +2347,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2220 +#: ../../library/ctypes.rst:2222 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2351,7 +2355,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2226 +#: ../../library/ctypes.rst:2228 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2361,7 +2365,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2234 +#: ../../library/ctypes.rst:2236 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 " @@ -2369,25 +2373,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2239 +#: ../../library/ctypes.rst:2241 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2243 +#: ../../library/ctypes.rst:2245 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2250 +#: ../../library/ctypes.rst:2252 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2257 +#: ../../library/ctypes.rst:2259 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2395,182 +2399,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2265 +#: ../../library/ctypes.rst:2267 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2271 +#: ../../library/ctypes.rst:2273 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2277 +#: ../../library/ctypes.rst:2279 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2285 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2290 +#: ../../library/ctypes.rst:2292 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2296 +#: ../../library/ctypes.rst:2298 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2302 +#: ../../library/ctypes.rst:2304 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2310 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2316 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2322 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2328 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2334 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2337 +#: ../../library/ctypes.rst:2339 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2346 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2351 +#: ../../library/ctypes.rst:2353 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2358 +#: ../../library/ctypes.rst:2360 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2365 +#: ../../library/ctypes.rst:2367 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2371 +#: ../../library/ctypes.rst:2373 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2377 +#: ../../library/ctypes.rst:2379 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2385 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2391 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2397 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2403 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2407 +#: ../../library/ctypes.rst:2409 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2413 +#: ../../library/ctypes.rst:2415 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:2420 +#: ../../library/ctypes.rst:2422 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2427 +#: ../../library/ctypes.rst:2429 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2434 +#: ../../library/ctypes.rst:2436 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:2440 +#: ../../library/ctypes.rst:2442 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2443 +#: ../../library/ctypes.rst:2445 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -2578,41 +2582,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2451 +#: ../../library/ctypes.rst:2453 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2456 +#: ../../library/ctypes.rst:2458 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2461 +#: ../../library/ctypes.rst:2463 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2467 +#: ../../library/ctypes.rst:2469 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2475 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2478 +#: ../../library/ctypes.rst:2480 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2480 +#: ../../library/ctypes.rst:2482 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2486 +#: ../../library/ctypes.rst:2488 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2488 +#: ../../library/ctypes.rst:2490 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:" @@ -2620,34 +2624,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2498 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:2500 +#: ../../library/ctypes.rst:2502 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:2504 +#: ../../library/ctypes.rst:2506 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:2507 +#: ../../library/ctypes.rst:2509 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:2517 +#: ../../library/ctypes.rst:2519 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, " @@ -2655,14 +2659,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2522 +#: ../../library/ctypes.rst:2524 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:2529 +#: ../../library/ctypes.rst:2531 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2670,14 +2674,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2537 +#: ../../library/ctypes.rst:2539 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:2541 +#: ../../library/ctypes.rst:2543 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 " @@ -2685,11 +2689,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2546 +#: ../../library/ctypes.rst:2548 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2559 +#: ../../library/ctypes.rst:2561 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 " @@ -2699,7 +2703,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2571 +#: ../../library/ctypes.rst:2573 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:" @@ -2707,7 +2711,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2576 +#: ../../library/ctypes.rst:2578 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2717,15 +2721,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2587 +#: ../../library/ctypes.rst:2589 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2591 +#: ../../library/ctypes.rst:2593 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2593 +#: ../../library/ctypes.rst:2595 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 " @@ -2735,34 +2739,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2603 +#: ../../library/ctypes.rst:2605 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:2610 +#: ../../library/ctypes.rst:2612 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2615 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2619 +#: ../../library/ctypes.rst:2621 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2623 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:2625 +#: ../../library/ctypes.rst:2627 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 :" @@ -2771,11 +2775,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2635 +#: ../../library/ctypes.rst:2637 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2639 +#: ../../library/ctypes.rst:2641 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/dataclasses.po b/library/dataclasses.po index 4bd6371f89..592d18ef66 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -565,12 +565,12 @@ msgstr "" msgid "``name``: The name of the field." msgstr "``name``:欄位的名稱。" -#: ../../library/dataclasses.rst:324 +#: ../../library/dataclasses.rst:323 #, fuzzy msgid "``type``: The type of the field." msgstr "``type``:欄位的型別。" -#: ../../library/dataclasses.rst:326 +#: ../../library/dataclasses.rst:324 #, fuzzy msgid "" "``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " @@ -580,14 +580,14 @@ msgstr "" "``default``、``default_factory``、``init``、``repr``、``hash``、``compare``、" "``metadata`` 和 ``kw_only`` 有與它們在 :func:`field` 函式中的含義和值相同。" -#: ../../library/dataclasses.rst:330 +#: ../../library/dataclasses.rst:328 #, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴。" -#: ../../library/dataclasses.rst:335 +#: ../../library/dataclasses.rst:333 #, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " @@ -599,7 +599,7 @@ msgstr "" "如果未傳遞資料類或其中一個實例,則引發 :exc:`TypeError`。不回傳 ``ClassVar`` " "或 ``InitVar`` 的偽欄位。" -#: ../../library/dataclasses.rst:342 +#: ../../library/dataclasses.rst:340 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a dict (by using the factory function " @@ -611,24 +611,24 @@ msgstr "" "為其欄位的字典,作為“名稱:值”對。資料類、字典、列表和元組被遞迴到。其他物件" "使用 :func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:348 +#: ../../library/dataclasses.rst:346 #, fuzzy msgid "Example of using :func:`asdict` on nested dataclasses::" msgstr "在嵌套資料類上使用 :func:`asdict` 的示例::" -#: ../../library/dataclasses.rst:365 ../../library/dataclasses.rst:385 +#: ../../library/dataclasses.rst:363 ../../library/dataclasses.rst:383 #, fuzzy msgid "To create a shallow copy, the following workaround may be used::" msgstr "要建立淺拷貝,可以使用以下解決方法:" -#: ../../library/dataclasses.rst:369 +#: ../../library/dataclasses.rst:367 #, fuzzy msgid "" ":func:`asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`asdict` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:374 +#: ../../library/dataclasses.rst:372 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a tuple (by using the factory function " @@ -640,19 +640,19 @@ msgstr "" "換為其欄位值的元組。資料類、字典、列表和元組被遞迴到。其他物件使用 :func:" "`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:380 +#: ../../library/dataclasses.rst:378 #, fuzzy msgid "Continuing from the previous example::" msgstr "從前面的例子繼續:" -#: ../../library/dataclasses.rst:389 +#: ../../library/dataclasses.rst:387 #, fuzzy msgid "" ":func:`astuple` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`astuple` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:394 +#: ../../library/dataclasses.rst:392 #, fuzzy msgid "" "Creates a new dataclass with name ``cls_name``, fields as defined in " @@ -671,13 +671,13 @@ msgstr "" "``order``、``unsafe_hash``、``frozen``、``match_args``、``kw_only`` 的值, " "``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中的含義相同。" -#: ../../library/dataclasses.rst:404 +#: ../../library/dataclasses.rst:402 msgid "" "If ``module`` is defined, the ``__module__`` attribute of the dataclass is " "set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:408 +#: ../../library/dataclasses.rst:406 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -689,12 +689,12 @@ msgstr "" "制都可以應用 :func:`dataclass` 函式將該類轉換為資料類。提供此功能是為了方便。" "例如::" -#: ../../library/dataclasses.rst:420 +#: ../../library/dataclasses.rst:418 #, fuzzy msgid "Is equivalent to::" msgstr "相當於::" -#: ../../library/dataclasses.rst:433 +#: ../../library/dataclasses.rst:431 #, fuzzy msgid "" "Creates a new object of the same type as ``obj``, replacing fields with " @@ -706,7 +706,7 @@ msgstr "" "``obj`` 不是資料類,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定欄" "位,則引發:exc:`TypeError`。" -#: ../../library/dataclasses.rst:438 +#: ../../library/dataclasses.rst:436 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " @@ -716,7 +716,7 @@ msgstr "" "新回傳的對像是通過呼叫資料類的 :meth:`__init__` 方法建立的。這確保 :meth:" "`__post_init__`(如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:442 +#: ../../library/dataclasses.rst:440 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " @@ -726,7 +726,7 @@ msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:446 +#: ../../library/dataclasses.rst:444 #, fuzzy msgid "" "It is an error for ``changes`` to contain any fields that are defined as " @@ -735,7 +735,7 @@ msgstr "" "``changes`` 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將" "引發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:450 +#: ../../library/dataclasses.rst:448 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" @@ -752,14 +752,14 @@ msgstr "" "造函式可能是明智的,或者可能是處理實例複製的自定義“replace()”(或類似命名的)" "方法。" -#: ../../library/dataclasses.rst:461 +#: ../../library/dataclasses.rst:459 #, fuzzy msgid "" "Return ``True`` if its parameter is a dataclass or an instance of one, " "otherwise return ``False``." msgstr "如果它的參數是一個資料類或一個實例,則回傳“True”,否則回傳“False”。" -#: ../../library/dataclasses.rst:464 +#: ../../library/dataclasses.rst:462 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -769,12 +769,12 @@ msgstr "" "如果你需要知道一個類是否是資料類的實例(而不是資料類本身),那麼新增一個進一" "步的檢查``not isinstance(obj, type)``::" -#: ../../library/dataclasses.rst:473 +#: ../../library/dataclasses.rst:471 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少預設值或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:477 +#: ../../library/dataclasses.rst:475 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -790,21 +790,21 @@ msgstr "" "例,名稱 _ 用於 :const: `KW_ONLY` 欄位。僅關鍵字欄位表示 :meth:`__init__` 參" "數,在實例化類時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:486 +#: ../../library/dataclasses.rst:484 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位::" -#: ../../library/dataclasses.rst:497 +#: ../../library/dataclasses.rst:495 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`KW_ONLY`." msgstr "在單個資料類中,指定多個型別為 KW_ONLY 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:504 +#: ../../library/dataclasses.rst:502 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -814,12 +814,12 @@ msgstr "" "當在使用 frozen=True 定義的資料類上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:511 +#: ../../library/dataclasses.rst:509 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:515 +#: ../../library/dataclasses.rst:513 #, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." @@ -834,7 +834,7 @@ msgstr "" "類中定義的順序傳遞給 :meth:`__post_init__` 。如果沒有生成 :meth:`__init__` 方" "法,那麼 :meth:`__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:522 +#: ../../library/dataclasses.rst:520 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -843,7 +843,7 @@ msgstr "" "在其他用途\\u200b\\u200b中,這允許初始化依賴於一個或多個其他欄位的欄位值。例" "如::" -#: ../../library/dataclasses.rst:534 +#: ../../library/dataclasses.rst:532 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :func:`dataclass` does not " @@ -855,7 +855,7 @@ msgstr "" "方法。如果基底類別有一個必須呼叫的 :meth:`__init__` 方法,通常在 :meth:" "`__post_init__` 方法中呼叫此方法::" -#: ../../library/dataclasses.rst:551 +#: ../../library/dataclasses.rst:549 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`~object." @@ -866,7 +866,7 @@ msgstr "" "但是請注意,通常不需要呼叫資料類生成的 :meth:`__init__` 方法,因為派生資料類" "將負責初始化作為資料類本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:553 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" @@ -876,12 +876,12 @@ msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`__post_init__` 的方" "法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:560 +#: ../../library/dataclasses.rst:558 #, fuzzy msgid "Class variables" msgstr "類變數" -#: ../../library/dataclasses.rst:562 +#: ../../library/dataclasses.rst:560 #, fuzzy msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " @@ -896,12 +896,12 @@ msgstr "" "一個欄位是一個“ClassVar”,它就被排除在考慮之外,並被資料類機制忽略。模組級 :" "func:`fields` 函式不會回傳此類 ``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:571 +#: ../../library/dataclasses.rst:569 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:573 +#: ../../library/dataclasses.rst:571 #, fuzzy msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " @@ -920,14 +920,14 @@ msgstr "" "meth:`__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。它們不被資料" "類使用。" -#: ../../library/dataclasses.rst:583 +#: ../../library/dataclasses.rst:581 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值::" -#: ../../library/dataclasses.rst:598 +#: ../../library/dataclasses.rst:596 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " @@ -936,12 +936,12 @@ msgstr "" "在這種情況下,:func:`fields` 將為 ``i`` 和 ``j`` 回傳 :class:`Field` 物件,但" "不會為 ``database`` 回傳。" -#: ../../library/dataclasses.rst:602 +#: ../../library/dataclasses.rst:600 #, fuzzy msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:604 +#: ../../library/dataclasses.rst:602 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -955,7 +955,7 @@ msgstr "" "meth:`__setattr__` 和 :meth:`__delattr__` 方法。這些方法在呼叫時會引發:exc:" "`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:608 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -965,12 +965,12 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" -#: ../../library/dataclasses.rst:615 +#: ../../library/dataclasses.rst:613 #, fuzzy msgid "Inheritance" msgstr "遺產" -#: ../../library/dataclasses.rst:617 +#: ../../library/dataclasses.rst:615 #, fuzzy msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " @@ -988,7 +988,7 @@ msgstr "" "增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄位映射。因為欄" "位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子::" -#: ../../library/dataclasses.rst:637 +#: ../../library/dataclasses.rst:635 #, fuzzy msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " @@ -997,18 +997,18 @@ msgstr "" "最終的欄位列表按順序為“x”、“y”、“z”。 ``x`` 的最終型別是 ``int``,如類 ``C`` " "中指定的那樣。" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:638 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "為 ``C`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:645 +#: ../../library/dataclasses.rst:643 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr ":meth:`__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:647 +#: ../../library/dataclasses.rst:645 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1020,7 +1020,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:653 +#: ../../library/dataclasses.rst:651 #, fuzzy msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " @@ -1029,13 +1029,13 @@ msgstr "" "在此示例中,``Base.y``、``Base.w`` 和``D.t`` 是僅限關鍵字的欄位,``Base.x`` " "和``D.z`` 是常規欄位: :" -#: ../../library/dataclasses.rst:668 +#: ../../library/dataclasses.rst:666 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "為 ``D`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:672 +#: ../../library/dataclasses.rst:670 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1045,19 +1045,19 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:674 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`~object.__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:681 +#: ../../library/dataclasses.rst:679 #, fuzzy msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:683 +#: ../../library/dataclasses.rst:681 #, fuzzy msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " @@ -1067,7 +1067,7 @@ msgstr "" "如果 :func:`field` 指定了 ``default_factory``,當需要該欄位的預設值時,它會以" "零參數呼叫。例如,要建立列表的新實例,請使用:" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:687 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1080,35 +1080,35 @@ msgstr "" "了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:`__init__ 中呼叫" "`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:696 +#: ../../library/dataclasses.rst:694 #, fuzzy msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:698 +#: ../../library/dataclasses.rst:696 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "Python 將預設成員變數值存儲在類屬性中。考慮這個例子,不使用資料類::" -#: ../../library/dataclasses.rst:713 +#: ../../library/dataclasses.rst:711 #, fuzzy msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "請注意,類“C”的兩個實例共享同一個類變數“x”,正如預期的那樣。" -#: ../../library/dataclasses.rst:716 +#: ../../library/dataclasses.rst:714 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類,*如果*此程式碼有效::" -#: ../../library/dataclasses.rst:724 +#: ../../library/dataclasses.rst:722 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼::" -#: ../../library/dataclasses.rst:735 +#: ../../library/dataclasses.rst:733 #, fuzzy msgid "" "This has the same issue as the original example using class ``C``. That is, " @@ -1128,14 +1128,14 @@ msgstr "" "`TypeError`。假設是如果一個值是不可散列的,那麼它就是可變的。這是一個部分解決" "方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:746 +#: ../../library/dataclasses.rst:744 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法:" -#: ../../library/dataclasses.rst:755 +#: ../../library/dataclasses.rst:753 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " @@ -1145,12 +1145,12 @@ msgstr "" "不再查找和禁止型別為“list”、“dict”或“set”的物件,現在不允許使用不可散列的對像" "作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:760 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:764 +#: ../../library/dataclasses.rst:762 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1159,7 +1159,7 @@ msgstr "" "指定為 :ref:`descriptor objects ` 作為預設值的欄位具有以下特殊行" "為:" -#: ../../library/dataclasses.rst:767 +#: ../../library/dataclasses.rst:765 #, fuzzy msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " @@ -1169,7 +1169,7 @@ msgstr "" "傳遞給資料類的“__init__”方法的欄位值被傳遞給描述器的“__set__”方法,而不是覆蓋" "描述器物件。" -#: ../../library/dataclasses.rst:770 +#: ../../library/dataclasses.rst:768 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " @@ -1179,7 +1179,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的“__get__”或“__set__”方法,而不是回傳" "或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:773 +#: ../../library/dataclasses.rst:771 #, fuzzy msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " @@ -1194,7 +1194,7 @@ msgstr "" "情況下,描述器回傳一個值,它將用作欄位的預設值。另一方面,如果描述器在這種情" "況下引發 :exc:`AttributeError`,則不會為該欄位提供預設值。" -#: ../../library/dataclasses.rst:808 +#: ../../library/dataclasses.rst:806 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/devmode.po b/library/devmode.po index afd4426b90..f5b9098f1f 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -134,54 +134,55 @@ msgstr "" #: ../../library/devmode.rst:61 msgid "" "Call :func:`faulthandler.enable` at Python startup to install handlers for " -"the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` " -"and :const:`SIGILL` signals to dump the Python traceback on a crash." +"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." +"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " +"dump the Python traceback on a crash." msgstr "" -#: ../../library/devmode.rst:65 +#: ../../library/devmode.rst:66 msgid "" "It behaves as if the :option:`-X faulthandler <-X>` command line option is " "used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " "``1``." msgstr "" -#: ../../library/devmode.rst:69 +#: ../../library/devmode.rst:70 msgid "" "Enable :ref:`asyncio debug mode `. For example, :mod:" "`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" -#: ../../library/devmode.rst:72 +#: ../../library/devmode.rst:73 msgid "" "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " "set to ``1``." msgstr "" -#: ../../library/devmode.rst:75 +#: ../../library/devmode.rst:76 msgid "" "Check the *encoding* and *errors* arguments for string encoding and decoding " "operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." "decode`." msgstr "" -#: ../../library/devmode.rst:79 +#: ../../library/devmode.rst:80 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings." msgstr "" -#: ../../library/devmode.rst:83 +#: ../../library/devmode.rst:84 msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:84 +#: ../../library/devmode.rst:85 msgid "" "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" -#: ../../library/devmode.rst:87 +#: ../../library/devmode.rst:88 msgid "" "The Python Development Mode does not enable the :mod:`tracemalloc` module by " "default, because the overhead cost (to performance and memory) would be too " @@ -192,63 +193,63 @@ msgid "" "allocated." msgstr "" -#: ../../library/devmode.rst:94 +#: ../../library/devmode.rst:95 msgid "" "The Python Development Mode does not prevent the :option:`-O` command line " "option from removing :keyword:`assert` statements nor from setting :const:" "`__debug__` to ``False``." msgstr "" -#: ../../library/devmode.rst:98 +#: ../../library/devmode.rst:99 msgid "" "The Python Development Mode can only be enabled at the Python startup. Its " "value can be read from :data:`sys.flags.dev_mode `." msgstr "" -#: ../../library/devmode.rst:101 +#: ../../library/devmode.rst:102 msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:104 +#: ../../library/devmode.rst:105 msgid "" "The *encoding* and *errors* arguments are now checked for string encoding " "and decoding operations." msgstr "" -#: ../../library/devmode.rst:110 +#: ../../library/devmode.rst:111 msgid "ResourceWarning Example" msgstr "ResourceWarning 範例" -#: ../../library/devmode.rst:112 +#: ../../library/devmode.rst:113 msgid "" "Example of a script counting the number of lines of the text file specified " "in the command line::" msgstr "" -#: ../../library/devmode.rst:126 +#: ../../library/devmode.rst:127 msgid "" "The script does not close the file explicitly. By default, Python does not " "emit any warning. Example using README.txt, which has 269 lines:" msgstr "" -#: ../../library/devmode.rst:134 +#: ../../library/devmode.rst:135 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " "warning:" msgstr "" -#: ../../library/devmode.rst:144 +#: ../../library/devmode.rst:145 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " "opened:" msgstr "" -#: ../../library/devmode.rst:159 +#: ../../library/devmode.rst:160 msgid "" "The fix is to close explicitly the file. Example using a context manager::" msgstr "" -#: ../../library/devmode.rst:167 +#: ../../library/devmode.rst:168 msgid "" "Not closing a resource explicitly can leave a resource open for way longer " "than expected; it can cause severe issues upon exiting Python. It is bad in " @@ -256,25 +257,25 @@ msgid "" "application more deterministic and more reliable." msgstr "" -#: ../../library/devmode.rst:174 +#: ../../library/devmode.rst:175 msgid "Bad file descriptor error example" msgstr "" -#: ../../library/devmode.rst:176 +#: ../../library/devmode.rst:177 msgid "Script displaying the first line of itself::" msgstr "" -#: ../../library/devmode.rst:189 +#: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" msgstr "" -#: ../../library/devmode.rst:196 +#: ../../library/devmode.rst:197 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " "file descriptor\" error when finalizing the file object:" msgstr "" -#: ../../library/devmode.rst:212 +#: ../../library/devmode.rst:213 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " "finalizer tries to close the file descriptor again, it fails with the ``Bad " @@ -283,7 +284,7 @@ msgid "" "`18748` for an example)." msgstr "" -#: ../../library/devmode.rst:218 +#: ../../library/devmode.rst:219 msgid "" "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " "with ``closefd=False``." diff --git a/library/difflib.po b/library/difflib.po index 2af26c0865..fd4440ff4a 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -655,8 +655,9 @@ msgstr "" msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" -"meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large " -"as :meth:`ratio`:" +"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher." +"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." +"ratio`:" msgstr "" #: ../../library/difflib.rst:588 @@ -669,28 +670,29 @@ msgstr "" #: ../../library/difflib.rst:596 msgid "" -":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " -"sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " -"sequences are close matches:" +":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " +"similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." +"ratio` value over 0.6 means the sequences are close matches:" msgstr "" #: ../../library/difflib.rst:603 msgid "" "If you're only interested in where the sequences match, :meth:" -"`get_matching_blocks` is handy:" +"`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" #: ../../library/difflib.rst:612 msgid "" -"Note that the last tuple returned by :meth:`get_matching_blocks` is always a " -"dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " -"tuple element (number of elements matched) is ``0``." +"Note that the last tuple returned by :meth:`~SequenceMatcher." +"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " +"the only case in which the last tuple element (number of elements matched) " +"is ``0``." msgstr "" #: ../../library/difflib.rst:616 msgid "" "If you want to know how to change the first sequence into the second, use :" -"meth:`get_opcodes`:" +"meth:`~SequenceMatcher.get_opcodes`:" msgstr "" #: ../../library/difflib.rst:627 @@ -778,7 +780,7 @@ msgstr "" msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " -"be obtained from the :meth:`~io.BaseIO.readlines` method of file-like " +"be obtained from the :meth:`~io.IOBase.readlines` method of file-like " "objects):" msgstr "" diff --git a/library/dis.po b/library/dis.po index a8f051c8cc..149873e707 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,32 +82,55 @@ msgstr "" msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:67 -msgid "Bytecode analysis" +#: ../../library/dis.rst:69 +msgid "Command-line interface" msgstr "" #: ../../library/dis.rst:71 +msgid "The :mod:`dis` module can be invoked as a script from the command line:" +msgstr "" + +#: ../../library/dis.rst:77 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/dis.rst:83 +msgid "Display usage and exit." +msgstr "" + +#: ../../library/dis.rst:85 +msgid "" +"If :file:`infile` is specified, its disassembled code will be written to " +"stdout. Otherwise, disassembly is performed on compiled source code recieved " +"from stdin." +msgstr "" + +#: ../../library/dis.rst:89 +msgid "Bytecode analysis" +msgstr "" + +#: ../../library/dis.rst:93 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:78 +#: ../../library/dis.rst:100 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:82 +#: ../../library/dis.rst:104 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:86 ../../library/dis.rst:274 +#: ../../library/dis.rst:108 ../../library/dis.rst:296 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -115,71 +138,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:91 +#: ../../library/dis.rst:113 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:95 +#: ../../library/dis.rst:117 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:98 +#: ../../library/dis.rst:120 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:103 +#: ../../library/dis.rst:125 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:108 +#: ../../library/dis.rst:130 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:112 +#: ../../library/dis.rst:134 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:116 +#: ../../library/dis.rst:138 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:121 +#: ../../library/dis.rst:143 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:124 ../../library/dis.rst:164 -#: ../../library/dis.rst:216 +#: ../../library/dis.rst:146 ../../library/dis.rst:186 +#: ../../library/dis.rst:238 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:127 ../../library/dis.rst:219 -#: ../../library/dis.rst:235 ../../library/dis.rst:262 -#: ../../library/dis.rst:283 +#: ../../library/dis.rst:149 ../../library/dis.rst:241 +#: ../../library/dis.rst:257 ../../library/dis.rst:284 +#: ../../library/dis.rst:305 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:152 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:146 +#: ../../library/dis.rst:168 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:148 +#: ../../library/dis.rst:170 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -187,39 +210,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:154 +#: ../../library/dis.rst:176 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:158 +#: ../../library/dis.rst:180 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:192 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:174 +#: ../../library/dis.rst:196 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:179 ../../library/dis.rst:210 -#: ../../library/dis.rst:232 ../../library/dis.rst:259 +#: ../../library/dis.rst:201 ../../library/dis.rst:232 +#: ../../library/dis.rst:254 ../../library/dis.rst:281 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:185 +#: ../../library/dis.rst:207 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -235,127 +258,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:198 ../../library/dis.rst:229 -#: ../../library/dis.rst:256 +#: ../../library/dis.rst:220 ../../library/dis.rst:251 +#: ../../library/dis.rst:278 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:201 +#: ../../library/dis.rst:223 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:204 +#: ../../library/dis.rst:226 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:229 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:213 +#: ../../library/dis.rst:235 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:225 +#: ../../library/dis.rst:247 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:242 +#: ../../library/dis.rst:264 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:245 +#: ../../library/dis.rst:267 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:246 +#: ../../library/dis.rst:268 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:269 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:248 +#: ../../library/dis.rst:270 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:249 +#: ../../library/dis.rst:271 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:250 +#: ../../library/dis.rst:272 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:251 +#: ../../library/dis.rst:273 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:253 +#: ../../library/dis.rst:275 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:290 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:293 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:279 +#: ../../library/dis.rst:301 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:289 +#: ../../library/dis.rst:311 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:315 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:296 +#: ../../library/dis.rst:318 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:303 +#: ../../library/dis.rst:325 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:309 +#: ../../library/dis.rst:331 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:333 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -363,118 +386,118 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:340 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:347 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:327 +#: ../../library/dis.rst:349 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:332 +#: ../../library/dis.rst:354 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:336 +#: ../../library/dis.rst:358 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:342 +#: ../../library/dis.rst:364 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:369 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:352 +#: ../../library/dis.rst:374 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:357 +#: ../../library/dis.rst:379 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:363 +#: ../../library/dis.rst:385 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:368 +#: ../../library/dis.rst:390 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:373 +#: ../../library/dis.rst:395 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:378 +#: ../../library/dis.rst:400 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:407 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:412 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:422 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:403 +#: ../../library/dis.rst:425 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:405 +#: ../../library/dis.rst:427 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:411 +#: ../../library/dis.rst:433 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:417 +#: ../../library/dis.rst:439 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:424 +#: ../../library/dis.rst:446 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:455 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:444 +#: ../../library/dis.rst:466 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:453 +#: ../../library/dis.rst:475 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -482,91 +505,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:458 +#: ../../library/dis.rst:480 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:462 +#: ../../library/dis.rst:484 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:469 +#: ../../library/dis.rst:491 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:471 +#: ../../library/dis.rst:493 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:477 +#: ../../library/dis.rst:499 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:482 +#: ../../library/dis.rst:504 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:487 +#: ../../library/dis.rst:509 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:492 +#: ../../library/dis.rst:514 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:497 +#: ../../library/dis.rst:519 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:503 +#: ../../library/dis.rst:525 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:505 +#: ../../library/dis.rst:527 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:508 +#: ../../library/dis.rst:530 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:515 +#: ../../library/dis.rst:537 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:527 ../../library/dis.rst:536 -#: ../../library/dis.rst:546 ../../library/dis.rst:554 -#: ../../library/dis.rst:566 ../../library/dis.rst:654 -#: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:905 -#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:549 ../../library/dis.rst:558 +#: ../../library/dis.rst:568 ../../library/dis.rst:576 +#: ../../library/dis.rst:588 ../../library/dis.rst:676 +#: ../../library/dis.rst:686 ../../library/dis.rst:696 +#: ../../library/dis.rst:916 ../../library/dis.rst:927 +#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 +#: ../../library/dis.rst:1051 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:577 +#: ../../library/dis.rst:599 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:581 +#: ../../library/dis.rst:603 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -574,39 +597,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:586 +#: ../../library/dis.rst:608 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:589 +#: ../../library/dis.rst:611 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:590 +#: ../../library/dis.rst:612 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:594 +#: ../../library/dis.rst:616 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:600 +#: ../../library/dis.rst:622 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:625 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:610 +#: ../../library/dis.rst:632 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:618 +#: ../../library/dis.rst:640 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -614,13 +637,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:625 ../../library/dis.rst:730 -#: ../../library/dis.rst:741 +#: ../../library/dis.rst:647 ../../library/dis.rst:752 +#: ../../library/dis.rst:763 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:631 +#: ../../library/dis.rst:653 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -628,35 +651,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:641 +#: ../../library/dis.rst:663 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:650 +#: ../../library/dis.rst:672 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:659 +#: ../../library/dis.rst:681 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:669 +#: ../../library/dis.rst:691 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:680 +#: ../../library/dis.rst:702 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:683 +#: ../../library/dis.rst:705 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:687 +#: ../../library/dis.rst:709 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -664,29 +687,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:695 +#: ../../library/dis.rst:717 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:700 +#: ../../library/dis.rst:722 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:707 +#: ../../library/dis.rst:729 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:731 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:712 +#: ../../library/dis.rst:734 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:718 +#: ../../library/dis.rst:740 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -694,39 +717,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:728 +#: ../../library/dis.rst:750 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:735 +#: ../../library/dis.rst:757 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:746 +#: ../../library/dis.rst:768 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:754 +#: ../../library/dis.rst:776 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:762 +#: ../../library/dis.rst:784 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:765 +#: ../../library/dis.rst:787 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -734,7 +757,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:774 +#: ../../library/dis.rst:796 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -742,25 +765,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:781 +#: ../../library/dis.rst:803 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:788 +#: ../../library/dis.rst:810 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:818 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:824 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -769,11 +792,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:835 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:842 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -781,7 +804,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:852 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -790,20 +813,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:862 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1467 +#: ../../library/dis.rst:868 ../../library/dis.rst:1489 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:853 +#: ../../library/dis.rst:875 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -811,19 +834,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:860 +#: ../../library/dis.rst:882 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:866 +#: ../../library/dis.rst:888 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:897 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -831,11 +854,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:880 +#: ../../library/dis.rst:902 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:904 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -844,50 +867,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:910 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:900 +#: ../../library/dis.rst:922 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:932 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:916 +#: ../../library/dis.rst:938 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:921 +#: ../../library/dis.rst:943 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:926 +#: ../../library/dis.rst:948 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:931 +#: ../../library/dis.rst:953 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:937 +#: ../../library/dis.rst:959 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:946 +#: ../../library/dis.rst:968 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -896,69 +919,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:957 +#: ../../library/dis.rst:979 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:989 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:972 +#: ../../library/dis.rst:994 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:999 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:981 +#: ../../library/dis.rst:1003 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:988 +#: ../../library/dis.rst:1010 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:997 +#: ../../library/dis.rst:1019 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1032 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1022 +#: ../../library/dis.rst:1044 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1034 +#: ../../library/dis.rst:1056 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1041 +#: ../../library/dis.rst:1063 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1070 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:1073 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -969,13 +992,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1059 +#: ../../library/dis.rst:1081 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1066 +#: ../../library/dis.rst:1088 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -985,33 +1008,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1095 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:1098 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1084 +#: ../../library/dis.rst:1106 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1090 +#: ../../library/dis.rst:1112 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1097 +#: ../../library/dis.rst:1119 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1126 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1020,68 +1043,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1124 +#: ../../library/dis.rst:1146 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1131 +#: ../../library/dis.rst:1153 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1138 +#: ../../library/dis.rst:1160 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 +#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 -#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 +#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1151 +#: ../../library/dis.rst:1173 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1164 +#: ../../library/dis.rst:1186 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:1200 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1191 +#: ../../library/dis.rst:1213 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1089,83 +1112,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1218 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1223 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1203 +#: ../../library/dis.rst:1225 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1231 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1211 +#: ../../library/dis.rst:1233 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1217 +#: ../../library/dis.rst:1239 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1238 +#: ../../library/dis.rst:1260 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1243 +#: ../../library/dis.rst:1265 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1251 +#: ../../library/dis.rst:1273 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1276 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 -#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 +#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 +#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:1285 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1272 +#: ../../library/dis.rst:1294 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1175,94 +1198,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1305 +#: ../../library/dis.rst:1327 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1336 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1339 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1340 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1319 +#: ../../library/dis.rst:1341 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1325 +#: ../../library/dis.rst:1347 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1352 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 +#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1354 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 +#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1357 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1338 +#: ../../library/dis.rst:1360 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1364 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1345 +#: ../../library/dis.rst:1367 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1274,70 +1297,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1369 +#: ../../library/dis.rst:1391 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1378 +#: ../../library/dis.rst:1400 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1409 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1412 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1414 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1415 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1416 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1417 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1419 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1408 +#: ../../library/dis.rst:1430 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1421 +#: ../../library/dis.rst:1443 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1426 +#: ../../library/dis.rst:1448 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1345,54 +1368,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1434 +#: ../../library/dis.rst:1456 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1460 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1461 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1463 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1467 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1400,258 +1423,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1496 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1498 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1502 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1481 +#: ../../library/dis.rst:1503 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1511 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1523 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1510 +#: ../../library/dis.rst:1532 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1536 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1517 +#: ../../library/dis.rst:1539 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1521 +#: ../../library/dis.rst:1543 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1529 +#: ../../library/dis.rst:1551 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Description" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1560 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 +#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1579 +#: ../../library/dis.rst:1601 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1610 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1630 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1632 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1615 +#: ../../library/dis.rst:1637 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1622 +#: ../../library/dis.rst:1644 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1660,75 +1683,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1631 +#: ../../library/dis.rst:1653 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1635 +#: ../../library/dis.rst:1657 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1664 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1648 +#: ../../library/dis.rst:1670 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1675 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1682 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1684 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1665 +#: ../../library/dis.rst:1687 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1693 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1676 +#: ../../library/dis.rst:1698 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1703 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1686 +#: ../../library/dis.rst:1708 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1715 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1720 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1736,34 +1759,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1706 +#: ../../library/dis.rst:1728 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1711 +#: ../../library/dis.rst:1733 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1716 +#: ../../library/dis.rst:1738 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1743 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1726 +#: ../../library/dis.rst:1748 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1752 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "slice" msgstr "slice(切片)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 095fea9c59..b2b3d46843 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -81,7 +81,7 @@ msgstr "" #: ../../library/ensurepip.rst:44 msgid "Command line interface" -msgstr "" +msgstr "命令列介面" #: ../../library/ensurepip.rst:46 msgid "" @@ -110,7 +110,7 @@ msgstr "" #: ../../library/ensurepip.rst:64 msgid "" -"``--root ``: Installs ``pip`` relative to the given root directory " +":samp:`--root {dir}`: Installs ``pip`` relative to the given root directory " "rather than the root of the currently active virtual environment (if any) or " "the default root for the current Python installation." msgstr "" @@ -215,7 +215,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." msgstr "" -"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip.bootstrap``。" +"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip." +"bootstrap``。" #: ../../library/ensurepip.rst:129 msgid "" diff --git a/library/exceptions.po b/library/exceptions.po index ffbb21c128..903b7da466 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -267,37 +267,43 @@ msgstr "" #: ../../library/exceptions.rst:223 msgid "" -"The :attr:`name` and :attr:`path` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the module " -"that was attempted to be imported and the path to any file which triggered " -"the exception, respectively." +"The optional *name* and *path* keyword-only arguments set the corresponding " +"attributes:" msgstr "" #: ../../library/exceptions.rst:228 +msgid "The name of the module that was attempted to be imported." +msgstr "" + +#: ../../library/exceptions.rst:232 +msgid "The path to any file which triggered the exception." +msgstr "" + +#: ../../library/exceptions.rst:234 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" -#: ../../library/exceptions.rst:233 +#: ../../library/exceptions.rst:239 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" "data:`sys.modules`." msgstr "" -#: ../../library/exceptions.rst:242 +#: ../../library/exceptions.rst:248 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " "integer, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:251 +#: ../../library/exceptions.rst:257 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "" -#: ../../library/exceptions.rst:258 +#: ../../library/exceptions.rst:264 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -306,7 +312,7 @@ msgid "" "the interpreter from exiting." msgstr "" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:272 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -315,7 +321,7 @@ msgid "" "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" -#: ../../library/exceptions.rst:276 +#: ../../library/exceptions.rst:282 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -326,25 +332,25 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" -#: ../../library/exceptions.rst:287 +#: ../../library/exceptions.rst:293 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " "the name that could not be found." msgstr "" -#: ../../library/exceptions.rst:291 +#: ../../library/exceptions.rst:297 msgid "" "The :attr:`name` attribute can be set using a keyword-only argument to the " "constructor. When set it represent the name of the variable that was " "attempted to be accessed." msgstr "" -#: ../../library/exceptions.rst:295 +#: ../../library/exceptions.rst:301 msgid "Added the :attr:`name` attribute." msgstr "新增 :attr:`name` 屬性。" -#: ../../library/exceptions.rst:301 +#: ../../library/exceptions.rst:307 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -352,28 +358,28 @@ msgid "" "developed to indicate that the real implementation still needs to be added." msgstr "" -#: ../../library/exceptions.rst:308 +#: ../../library/exceptions.rst:314 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -#: ../../library/exceptions.rst:314 +#: ../../library/exceptions.rst:320 msgid "" "``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " "though they have similar names and purposes. See :data:`NotImplemented` for " "details on when to use it." msgstr "" -#: ../../library/exceptions.rst:323 +#: ../../library/exceptions.rst:329 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " "full\" (not for illegal argument types or other incidental errors)." msgstr "" -#: ../../library/exceptions.rst:327 +#: ../../library/exceptions.rst:333 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -382,7 +388,7 @@ msgid "" "constructor arguments." msgstr "" -#: ../../library/exceptions.rst:333 +#: ../../library/exceptions.rst:339 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -391,18 +397,18 @@ msgid "" "subclassing." msgstr "" -#: ../../library/exceptions.rst:341 +#: ../../library/exceptions.rst:347 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "" -#: ../../library/exceptions.rst:345 +#: ../../library/exceptions.rst:351 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:355 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -410,14 +416,14 @@ msgid "" "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:363 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:371 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -426,14 +432,14 @@ msgid "" "the function." msgstr "" -#: ../../library/exceptions.rst:372 +#: ../../library/exceptions.rst:378 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:378 +#: ../../library/exceptions.rst:384 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -441,7 +447,7 @@ msgid "" "argument and attribute was added." msgstr "" -#: ../../library/exceptions.rst:387 +#: ../../library/exceptions.rst:393 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -451,18 +457,18 @@ msgid "" "in C, most floating point operations are not checked." msgstr "" -#: ../../library/exceptions.rst:397 +#: ../../library/exceptions.rst:403 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:407 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/exceptions.rst:407 +#: ../../library/exceptions.rst:413 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -470,65 +476,65 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: ../../library/exceptions.rst:415 +#: ../../library/exceptions.rst:421 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: ../../library/exceptions.rst:422 +#: ../../library/exceptions.rst:428 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:426 +#: ../../library/exceptions.rst:432 msgid "" "The exception object has a single attribute :attr:`value`, which is given as " "an argument when constructing the exception, and defaults to :const:`None`." msgstr "" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:436 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: ../../library/exceptions.rst:435 +#: ../../library/exceptions.rst:441 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: ../../library/exceptions.rst:439 +#: ../../library/exceptions.rst:445 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:443 +#: ../../library/exceptions.rst:449 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:447 +#: ../../library/exceptions.rst:453 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: ../../library/exceptions.rst:453 +#: ../../library/exceptions.rst:459 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:460 +#: ../../library/exceptions.rst:466 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -536,45 +542,45 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:472 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: ../../library/exceptions.rst:471 +#: ../../library/exceptions.rst:477 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:481 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:480 +#: ../../library/exceptions.rst:486 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:485 +#: ../../library/exceptions.rst:491 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:495 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:494 +#: ../../library/exceptions.rst:500 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:497 +#: ../../library/exceptions.rst:503 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -582,30 +588,30 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -#: ../../library/exceptions.rst:502 +#: ../../library/exceptions.rst:508 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:507 +#: ../../library/exceptions.rst:513 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:513 +#: ../../library/exceptions.rst:519 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:519 +#: ../../library/exceptions.rst:525 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:523 +#: ../../library/exceptions.rst:529 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -614,7 +620,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:532 +#: ../../library/exceptions.rst:538 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -628,7 +634,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:543 +#: ../../library/exceptions.rst:549 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -638,20 +644,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:552 +#: ../../library/exceptions.rst:558 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:564 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:561 +#: ../../library/exceptions.rst:567 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -659,7 +665,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:566 +#: ../../library/exceptions.rst:572 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -667,99 +673,99 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:573 +#: ../../library/exceptions.rst:579 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:580 +#: ../../library/exceptions.rst:586 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:589 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:589 +#: ../../library/exceptions.rst:595 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:599 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:597 +#: ../../library/exceptions.rst:603 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:601 +#: ../../library/exceptions.rst:607 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:605 +#: ../../library/exceptions.rst:611 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:610 +#: ../../library/exceptions.rst:616 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:622 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:622 +#: ../../library/exceptions.rst:628 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:628 +#: ../../library/exceptions.rst:634 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:635 +#: ../../library/exceptions.rst:641 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:640 +#: ../../library/exceptions.rst:646 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:655 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:653 +#: ../../library/exceptions.rst:659 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:661 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:666 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -767,36 +773,36 @@ msgid "" "const:`~errno.EINPROGRESS`." msgstr "" -#: ../../library/exceptions.rst:665 +#: ../../library/exceptions.rst:671 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:676 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:682 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:687 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:683 +#: ../../library/exceptions.rst:689 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:688 +#: ../../library/exceptions.rst:694 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -804,58 +810,58 @@ msgid "" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -#: ../../library/exceptions.rst:695 +#: ../../library/exceptions.rst:701 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" -#: ../../library/exceptions.rst:701 +#: ../../library/exceptions.rst:707 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" -#: ../../library/exceptions.rst:707 +#: ../../library/exceptions.rst:713 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:719 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" -#: ../../library/exceptions.rst:718 +#: ../../library/exceptions.rst:724 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" -#: ../../library/exceptions.rst:723 +#: ../../library/exceptions.rst:729 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:726 +#: ../../library/exceptions.rst:732 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:733 +#: ../../library/exceptions.rst:739 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" -#: ../../library/exceptions.rst:739 +#: ../../library/exceptions.rst:745 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -864,7 +870,7 @@ msgid "" "ENOTDIR`." msgstr "" -#: ../../library/exceptions.rst:747 +#: ../../library/exceptions.rst:753 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -872,131 +878,131 @@ msgid "" "ENOTCAPABLE`." msgstr "" -#: ../../library/exceptions.rst:752 +#: ../../library/exceptions.rst:758 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" -#: ../../library/exceptions.rst:758 +#: ../../library/exceptions.rst:764 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." msgstr "" -#: ../../library/exceptions.rst:763 +#: ../../library/exceptions.rst:769 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" -#: ../../library/exceptions.rst:766 +#: ../../library/exceptions.rst:772 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:772 +#: ../../library/exceptions.rst:778 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:778 +#: ../../library/exceptions.rst:784 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:780 +#: ../../library/exceptions.rst:786 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:791 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:790 +#: ../../library/exceptions.rst:796 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:795 +#: ../../library/exceptions.rst:801 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:798 +#: ../../library/exceptions.rst:804 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:802 ../../library/exceptions.rst:818 +#: ../../library/exceptions.rst:808 ../../library/exceptions.rst:824 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:813 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:811 +#: ../../library/exceptions.rst:817 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:815 ../../library/exceptions.rst:841 -#: ../../library/exceptions.rst:868 +#: ../../library/exceptions.rst:821 ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:874 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:823 +#: ../../library/exceptions.rst:829 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:834 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:833 +#: ../../library/exceptions.rst:839 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:839 +#: ../../library/exceptions.rst:845 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:853 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:852 +#: ../../library/exceptions.rst:858 msgid "Base class for warnings related to encodings." msgstr "" -#: ../../library/exceptions.rst:854 +#: ../../library/exceptions.rst:860 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../library/exceptions.rst:861 +#: ../../library/exceptions.rst:867 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:866 +#: ../../library/exceptions.rst:872 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:883 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:879 +#: ../../library/exceptions.rst:885 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1005,7 +1011,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:888 +#: ../../library/exceptions.rst:894 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1016,7 +1022,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:896 +#: ../../library/exceptions.rst:902 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1025,23 +1031,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:905 +#: ../../library/exceptions.rst:911 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:909 +#: ../../library/exceptions.rst:915 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:914 +#: ../../library/exceptions.rst:920 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: ../../library/exceptions.rst:917 +#: ../../library/exceptions.rst:923 msgid "" "The condition can be either a function that accepts an exception and returns " "true for those that should be in the subgroup, or it can be an exception " @@ -1049,7 +1055,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:922 +#: ../../library/exceptions.rst:928 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1057,34 +1063,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:933 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" -#: ../../library/exceptions.rst:933 +#: ../../library/exceptions.rst:939 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: ../../library/exceptions.rst:939 +#: ../../library/exceptions.rst:945 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:942 +#: ../../library/exceptions.rst:948 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:947 +#: ../../library/exceptions.rst:953 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1092,7 +1098,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:976 +#: ../../library/exceptions.rst:982 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1101,18 +1107,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:991 +#: ../../library/exceptions.rst:997 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:999 +#: ../../library/exceptions.rst:1005 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:1001 +#: ../../library/exceptions.rst:1007 msgid "The class hierarchy for built-in exceptions is:" msgstr "" @@ -1137,10 +1143,10 @@ msgstr "raise" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "errno" msgstr "errno" diff --git a/library/functions.po b/library/functions.po index e26b4be9d6..85c5c1ace1 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-07 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2167,7 +2167,7 @@ msgstr "" 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;``." +"character reference :samp:`&#{nnn};`." msgstr "" #: ../../library/functions.rst:1276 diff --git a/library/gettext.po b/library/gettext.po index 1b56ff954e..8933fb9e99 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -84,7 +84,7 @@ msgstr "" msgid "" "Return the localized translation of *message*, based on the current global " "domain, language, and locale directory. This function is usually aliased " -"as :func:`_` in the local namespace (see examples below)." +"as :func:`!_` in the local namespace (see examples below)." msgstr "" #: ../../library/gettext.rst:66 @@ -124,7 +124,7 @@ msgstr "" #: ../../library/gettext.rst:101 msgid "" -"Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, " +"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " "but this was deemed not useful and so it is currently unimplemented." msgstr "" @@ -144,7 +144,7 @@ msgid "" "gettext` defines a :class:`GNUTranslations` class which implements the " "parsing of GNU :file:`.mo` format files, and has methods for returning " "strings. Instances of this class can also install themselves in the built-in " -"namespace as the function :func:`_`." +"namespace as the function :func:`!_`." msgstr "" #: ../../library/gettext.rst:127 @@ -186,17 +186,15 @@ msgstr "" #: ../../library/gettext.rst:153 msgid "" -"Return a :class:`*Translations` instance based on the *domain*, *localedir*, " -"and *languages*, which are first passed to :func:`find` to get a list of the " +"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " +"*languages*, which are first passed to :func:`find` to get a list of the " "associated :file:`.mo` file paths. Instances with identical :file:`.mo` " "file names are cached. The actual class instantiated is *class_* if " "provided, otherwise :class:`GNUTranslations`. The class's constructor must " -"take a single :term:`file object` argument. If provided, *codeset* will " -"change the charset used to encode translated strings in the :meth:" -"`~NullTranslations.lgettext` and :meth:`~NullTranslations.lngettext` methods." +"take a single :term:`file object` argument." msgstr "" -#: ../../library/gettext.rst:163 +#: ../../library/gettext.rst:160 msgid "" "If multiple files are found, later files are used as fallbacks for earlier " "ones. To allow setting the fallback, :func:`copy.copy` is used to clone each " @@ -204,57 +202,57 @@ msgid "" "with the cache." msgstr "" -#: ../../library/gettext.rst:168 +#: ../../library/gettext.rst:165 msgid "" "If no :file:`.mo` file is found, this function raises :exc:`OSError` if " "*fallback* is false (which is the default), and returns a :class:" "`NullTranslations` instance if *fallback* is true." msgstr "" -#: ../../library/gettext.rst:172 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +#: ../../library/gettext.rst:169 +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:175 +#: ../../library/gettext.rst:172 msgid "*codeset* parameter is removed." msgstr "*codeset* 參數被移除。" -#: ../../library/gettext.rst:180 +#: ../../library/gettext.rst:177 msgid "" -"This installs the function :func:`_` in Python's builtins namespace, based " +"This installs the function :func:`!_` in Python's builtins namespace, based " "on *domain* and *localedir* which are passed to the function :func:" "`translation`." msgstr "" -#: ../../library/gettext.rst:183 +#: ../../library/gettext.rst:180 msgid "" "For the *names* parameter, please see the description of the translation " "object's :meth:`~NullTranslations.install` method." msgstr "" -#: ../../library/gettext.rst:186 +#: ../../library/gettext.rst:183 msgid "" "As seen below, you usually mark the strings in your application that are " -"candidates for translation, by wrapping them in a call to the :func:`_` " +"candidates for translation, by wrapping them in a call to the :func:`!_` " "function, like this::" msgstr "" -#: ../../library/gettext.rst:192 +#: ../../library/gettext.rst:189 msgid "" -"For convenience, you want the :func:`_` function to be installed in Python's " -"builtins namespace, so it is easily accessible in all modules of your " -"application." +"For convenience, you want the :func:`!_` function to be installed in " +"Python's builtins namespace, so it is easily accessible in all modules of " +"your application." msgstr "" -#: ../../library/gettext.rst:196 +#: ../../library/gettext.rst:193 msgid "*names* is now a keyword-only parameter." msgstr "" -#: ../../library/gettext.rst:200 +#: ../../library/gettext.rst:197 msgid "The :class:`NullTranslations` class" msgstr "" -#: ../../library/gettext.rst:202 +#: ../../library/gettext.rst:199 msgid "" "Translation classes are what actually implement the translation of original " "source file message strings to translated message strings. The base class " @@ -263,7 +261,7 @@ msgid "" "classes. Here are the methods of :class:`!NullTranslations`:" msgstr "" -#: ../../library/gettext.rst:211 +#: ../../library/gettext.rst:208 msgid "" "Takes an optional :term:`file object` *fp*, which is ignored by the base " "class. Initializes \"protected\" instance variables *_info* and *_charset* " @@ -272,7 +270,7 @@ msgid "" "not ``None``." msgstr "" -#: ../../library/gettext.rst:219 +#: ../../library/gettext.rst:216 msgid "" "No-op in the base class, this method takes file object *fp*, and reads the " "data from the file, initializing its message catalog. If you have an " @@ -280,86 +278,86 @@ msgid "" "parse your format." msgstr "" -#: ../../library/gettext.rst:227 +#: ../../library/gettext.rst:224 msgid "" "Add *fallback* as the fallback object for the current translation object. A " "translation object should consult the fallback if it cannot provide a " "translation for a given message." msgstr "" -#: ../../library/gettext.rst:234 +#: ../../library/gettext.rst:231 msgid "" "If a fallback has been set, forward :meth:`!gettext` to the fallback. " "Otherwise, return *message*. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:240 +#: ../../library/gettext.rst:237 msgid "" "If a fallback has been set, forward :meth:`!ngettext` to the fallback. " "Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " "Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:247 +#: ../../library/gettext.rst:244 msgid "" "If a fallback has been set, forward :meth:`pgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:255 +#: ../../library/gettext.rst:252 msgid "" "If a fallback has been set, forward :meth:`npgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:263 +#: ../../library/gettext.rst:260 msgid "" "Return the \"protected\" :attr:`_info` variable, a dictionary containing the " "metadata found in the message catalog file." msgstr "" -#: ../../library/gettext.rst:269 +#: ../../library/gettext.rst:266 msgid "Return the encoding of the message catalog file." msgstr "" -#: ../../library/gettext.rst:274 +#: ../../library/gettext.rst:271 msgid "" "This method installs :meth:`.gettext` into the built-in namespace, binding " "it to ``_``." msgstr "" -#: ../../library/gettext.rst:277 +#: ../../library/gettext.rst:274 msgid "" "If the *names* parameter is given, it must be a sequence containing the " "names of functions you want to install in the builtins namespace in addition " -"to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``, " -"``'pgettext'``, ``'npgettext'``, ``'lgettext'``, and ``'lngettext'``." +"to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, and ``'npgettext'``." msgstr "" -#: ../../library/gettext.rst:282 +#: ../../library/gettext.rst:279 msgid "" "Note that this is only one way, albeit the most convenient way, to make the :" -"func:`_` function available to your application. Because it affects the " +"func:`!_` function available to your application. Because it affects the " "entire application globally, and specifically the built-in namespace, " -"localized modules should never install :func:`_`. Instead, they should use " -"this code to make :func:`_` available to their module::" +"localized modules should never install :func:`!_`. Instead, they should use " +"this code to make :func:`!_` available to their module::" msgstr "" -#: ../../library/gettext.rst:292 +#: ../../library/gettext.rst:289 msgid "" -"This puts :func:`_` only in the module's global namespace and so only " +"This puts :func:`!_` only in the module's global namespace and so only " "affects calls within this module." msgstr "" -#: ../../library/gettext.rst:295 +#: ../../library/gettext.rst:292 msgid "Added ``'pgettext'`` and ``'npgettext'``." msgstr "新增 ``'pgettext'`` 與 ``'npgettext'``\\ 。" -#: ../../library/gettext.rst:300 +#: ../../library/gettext.rst:297 msgid "The :class:`GNUTranslations` class" msgstr "" -#: ../../library/gettext.rst:302 +#: ../../library/gettext.rst:299 msgid "" "The :mod:`gettext` module provides one additional class derived from :class:" "`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:" @@ -367,7 +365,7 @@ msgid "" "in both big-endian and little-endian format." msgstr "" -#: ../../library/gettext.rst:307 +#: ../../library/gettext.rst:304 msgid "" ":class:`GNUTranslations` parses optional metadata out of the translation " "catalog. It is convention with GNU :program:`gettext` to include metadata as " @@ -380,31 +378,31 @@ msgid "" "to Unicode using this encoding, else ASCII is assumed." msgstr "" -#: ../../library/gettext.rst:317 +#: ../../library/gettext.rst:314 msgid "" -"Since message ids are read as Unicode strings too, all :meth:`*gettext` " +"Since message ids are read as Unicode strings too, all ``*gettext()`` " "methods will assume message ids as Unicode strings, not byte strings." msgstr "" -#: ../../library/gettext.rst:320 +#: ../../library/gettext.rst:317 msgid "" "The entire set of key/value pairs are placed into a dictionary and set as " "the \"protected\" :attr:`_info` instance variable." msgstr "" -#: ../../library/gettext.rst:323 +#: ../../library/gettext.rst:320 msgid "" "If the :file:`.mo` file's magic number is invalid, the major version number " "is unexpected, or if other problems occur while reading the file, " "instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:329 +#: ../../library/gettext.rst:326 msgid "" "The following methods are overridden from the base class implementation:" msgstr "" -#: ../../library/gettext.rst:333 +#: ../../library/gettext.rst:330 msgid "" "Look up the *message* id in the catalog and return the corresponding message " "string, as a Unicode string. If there is no entry in the catalog for the " @@ -413,14 +411,14 @@ msgid "" "*message* id is returned." msgstr "" -#: ../../library/gettext.rst:342 +#: ../../library/gettext.rst:339 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use. The returned message string is a Unicode string." msgstr "" -#: ../../library/gettext.rst:346 +#: ../../library/gettext.rst:343 msgid "" "If the message id is not found in the catalog, and a fallback is specified, " "the request is forwarded to the fallback's :meth:`~NullTranslations." @@ -428,14 +426,14 @@ msgid "" "*plural* is returned in all other cases." msgstr "" -#: ../../library/gettext.rst:351 +#: ../../library/gettext.rst:348 msgid "Here is an example::" msgstr "" "以下是個範例:\n" "\n" "::" -#: ../../library/gettext.rst:363 +#: ../../library/gettext.rst:360 msgid "" "Look up the *context* and *message* id in the catalog and return the " "corresponding message string, as a Unicode string. If there is no entry in " @@ -444,14 +442,14 @@ msgid "" "Otherwise, the *message* id is returned." msgstr "" -#: ../../library/gettext.rst:374 +#: ../../library/gettext.rst:371 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use." msgstr "" -#: ../../library/gettext.rst:378 +#: ../../library/gettext.rst:375 msgid "" "If the message id for *context* is not found in the catalog, and a fallback " "is specified, the request is forwarded to the fallback's :meth:`npgettext` " @@ -459,45 +457,45 @@ msgid "" "returned in all other cases." msgstr "" -#: ../../library/gettext.rst:387 +#: ../../library/gettext.rst:384 msgid "Solaris message catalog support" msgstr "" -#: ../../library/gettext.rst:389 +#: ../../library/gettext.rst:386 msgid "" "The Solaris operating system defines its own binary :file:`.mo` file format, " "but since no documentation can be found on this format, it is not supported " "at this time." msgstr "" -#: ../../library/gettext.rst:395 +#: ../../library/gettext.rst:392 msgid "The Catalog constructor" msgstr "" -#: ../../library/gettext.rst:399 +#: ../../library/gettext.rst:396 msgid "" "GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" msgstr "" -#: ../../library/gettext.rst:407 +#: ../../library/gettext.rst:404 msgid "" -"For compatibility with this older module, the function :func:`Catalog` is an " -"alias for the :func:`translation` function described above." +"For compatibility with this older module, the function :func:`!Catalog` is " +"an alias for the :func:`translation` function described above." msgstr "" -#: ../../library/gettext.rst:410 +#: ../../library/gettext.rst:407 msgid "" "One difference between this module and Henstridge's: his catalog objects " "supported access through a mapping API, but this appears to be unused and so " "is not currently supported." msgstr "" -#: ../../library/gettext.rst:417 +#: ../../library/gettext.rst:414 msgid "Internationalizing your programs and modules" msgstr "" -#: ../../library/gettext.rst:419 +#: ../../library/gettext.rst:416 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -506,41 +504,41 @@ msgid "" "Python programs, you need to take the following steps:" msgstr "" -#: ../../library/gettext.rst:425 +#: ../../library/gettext.rst:422 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" -#: ../../library/gettext.rst:427 +#: ../../library/gettext.rst:424 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" -#: ../../library/gettext.rst:429 +#: ../../library/gettext.rst:426 msgid "create language-specific translations of the message catalogs" msgstr "" -#: ../../library/gettext.rst:431 +#: ../../library/gettext.rst:428 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" -#: ../../library/gettext.rst:433 +#: ../../library/gettext.rst:430 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " -"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_`. " -"For example::" +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " +"`. For example::" msgstr "" -#: ../../library/gettext.rst:442 +#: ../../library/gettext.rst:439 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " "not." msgstr "" -#: ../../library/gettext.rst:445 +#: ../../library/gettext.rst:442 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " @@ -553,7 +551,7 @@ msgid "" "utils>`__." msgstr "" -#: ../../library/gettext.rst:455 +#: ../../library/gettext.rst:452 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -566,7 +564,7 @@ msgid "" "GNU :program:`gettext` package to internationalize your Python applications.)" msgstr "" -#: ../../library/gettext.rst:467 +#: ../../library/gettext.rst:464 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -574,7 +572,7 @@ msgid "" "placeholder for the translated versions of these strings." msgstr "" -#: ../../library/gettext.rst:473 +#: ../../library/gettext.rst:470 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -585,25 +583,25 @@ msgid "" "processing at run-time." msgstr "" -#: ../../library/gettext.rst:482 +#: ../../library/gettext.rst:479 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" -#: ../../library/gettext.rst:488 +#: ../../library/gettext.rst:485 msgid "Localizing your module" msgstr "" -#: ../../library/gettext.rst:490 +#: ../../library/gettext.rst:487 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" "`gettext` API but instead the class-based API." msgstr "" -#: ../../library/gettext.rst:494 +#: ../../library/gettext.rst:491 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -611,143 +609,143 @@ msgid "" "your module::" msgstr "" -#: ../../library/gettext.rst:505 +#: ../../library/gettext.rst:502 msgid "Localizing your application" msgstr "" -#: ../../library/gettext.rst:507 +#: ../../library/gettext.rst:504 msgid "" -"If you are localizing your application, you can install the :func:`_` " +"If you are localizing your application, you can install the :func:`!_` " "function globally into the built-in namespace, usually in the main driver " "file of your application. This will let all your application-specific files " "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" -#: ../../library/gettext.rst:512 +#: ../../library/gettext.rst:509 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" msgstr "" -#: ../../library/gettext.rst:518 +#: ../../library/gettext.rst:515 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -#: ../../library/gettext.rst:526 +#: ../../library/gettext.rst:523 msgid "Changing languages on the fly" msgstr "" -#: ../../library/gettext.rst:528 +#: ../../library/gettext.rst:525 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " "explicitly, like so::" msgstr "" -#: ../../library/gettext.rst:549 +#: ../../library/gettext.rst:546 msgid "Deferred translations" msgstr "" -#: ../../library/gettext.rst:551 +#: ../../library/gettext.rst:548 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " "actual translation until later. A classic example is::" msgstr "" -#: ../../library/gettext.rst:564 +#: ../../library/gettext.rst:561 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " "printed." msgstr "" -#: ../../library/gettext.rst:568 +#: ../../library/gettext.rst:565 msgid "Here is one way you can handle this situation::" msgstr "" -#: ../../library/gettext.rst:584 +#: ../../library/gettext.rst:581 msgid "" -"This works because the dummy definition of :func:`_` simply returns the " +"This works because the dummy definition of :func:`!_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " -"definition of :func:`_` in the built-in namespace (until the :keyword:`del` " -"command). Take care, though if you have a previous definition of :func:`_` " +"definition of :func:`!_` in the built-in namespace (until the :keyword:`del` " +"command). Take care, though if you have a previous definition of :func:`!_` " "in the local namespace." msgstr "" -#: ../../library/gettext.rst:590 +#: ../../library/gettext.rst:587 msgid "" -"Note that the second use of :func:`_` will not identify \"a\" as being " +"Note that the second use of :func:`!_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" -#: ../../library/gettext.rst:594 +#: ../../library/gettext.rst:591 msgid "Another way to handle this is with the following example::" msgstr "" -#: ../../library/gettext.rst:608 +#: ../../library/gettext.rst:605 msgid "" -"In this case, you are marking translatable strings with the function :func:" -"`N_`, which won't conflict with any definition of :func:`_`. However, you " +"In this case, you are marking translatable strings with the function :func:`!" +"N_`, which won't conflict with any definition of :func:`!_`. However, you " "will need to teach your message extraction program to look for translatable " -"strings marked with :func:`N_`. :program:`xgettext`, :program:`pygettext`, " +"strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, " "``pybabel extract``, and :program:`xpot` all support this through the use of " -"the :option:`!-k` command-line switch. The choice of :func:`N_` here is " -"totally arbitrary; it could have just as easily been :func:" -"`MarkThisStringForTranslation`." +"the :option:`!-k` command-line switch. The choice of :func:`!N_` here is " +"totally arbitrary; it could have just as easily been :func:`!" +"MarkThisStringForTranslation`." msgstr "" -#: ../../library/gettext.rst:619 +#: ../../library/gettext.rst:616 msgid "Acknowledgements" msgstr "致謝" -#: ../../library/gettext.rst:621 +#: ../../library/gettext.rst:618 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " "module:" msgstr "" -#: ../../library/gettext.rst:624 +#: ../../library/gettext.rst:621 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:626 +#: ../../library/gettext.rst:623 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:628 +#: ../../library/gettext.rst:625 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:630 +#: ../../library/gettext.rst:627 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:632 +#: ../../library/gettext.rst:629 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:634 +#: ../../library/gettext.rst:631 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:636 +#: ../../library/gettext.rst:633 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:638 +#: ../../library/gettext.rst:635 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:641 +#: ../../library/gettext.rst:638 msgid "Footnotes" msgstr "註解" -#: ../../library/gettext.rst:642 +#: ../../library/gettext.rst:639 msgid "" "The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -758,7 +756,7 @@ msgid "" "your application." msgstr "" -#: ../../library/gettext.rst:650 +#: ../../library/gettext.rst:647 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" @@ -770,6 +768,6 @@ msgstr "_ (底線)" msgid "gettext" msgstr "gettext" -#: ../../library/gettext.rst:397 +#: ../../library/gettext.rst:394 msgid "GNOME" msgstr "GNOME" diff --git a/library/gzip.po b/library/gzip.po index 703b7bda25..b0564b3347 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -1,13 +1,13 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/gzip.rst:2 msgid ":mod:`gzip` --- Support for :program:`gzip` files" -msgstr "" +msgstr ":mod:`gzip` --- :program:`gzip` 檔案的支援" #: ../../library/gzip.rst:7 msgid "**Source code:** :source:`Lib/gzip.py`" @@ -54,7 +54,7 @@ msgstr "" #: ../../library/gzip.rst:26 msgid "The module defines the following items:" -msgstr "" +msgstr "此模組定義了以下項目:" #: ../../library/gzip.rst:31 msgid "" @@ -107,7 +107,7 @@ msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" #: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "接受\\ :term:`類路徑物件 `。" #: ../../library/gzip.rst:64 msgid "" @@ -192,7 +192,7 @@ msgstr "" #: ../../library/gzip.rst:118 msgid ":class:`GzipFile` also provides the following method and attribute:" -msgstr "" +msgstr ":class:`GzipFile` 也提供了以下的方法和屬性:" #: ../../library/gzip.rst:122 msgid "" @@ -243,7 +243,7 @@ msgstr "" #: ../../library/gzip.rst:159 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." -msgstr "" +msgstr ":meth:`io.BufferedIOBase.read1` 方法現在已有實作。" #: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." @@ -309,19 +309,19 @@ msgstr "用法範例" #: ../../library/gzip.rst:217 msgid "Example of how to read a compressed file::" -msgstr "" +msgstr "如何讀取壓縮檔案的範例: ::" #: ../../library/gzip.rst:223 msgid "Example of how to create a compressed GZIP file::" -msgstr "" +msgstr "如何建立一個壓縮的 GZIP 檔案的範例: ::" #: ../../library/gzip.rst:230 msgid "Example of how to GZIP compress an existing file::" -msgstr "" +msgstr "如何壓縮一個已存在的檔案的範例: ::" #: ../../library/gzip.rst:238 msgid "Example of how to GZIP compress a binary string::" -msgstr "" +msgstr "如何壓縮一個二進位字串的範例: ::" #: ../../library/gzip.rst:247 msgid "Module :mod:`zlib`" @@ -333,46 +333,46 @@ msgid "" "format." msgstr "" -#: ../../library/gzip.rst:254 +#: ../../library/gzip.rst:256 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/gzip.rst:256 +#: ../../library/gzip.rst:258 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:259 +#: ../../library/gzip.rst:261 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:263 +#: ../../library/gzip.rst:265 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:267 +#: ../../library/gzip.rst:269 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:273 msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +msgstr "如果未指定 *file*,則從 :data:`sys.stdin` 讀取。" -#: ../../library/gzip.rst:275 +#: ../../library/gzip.rst:277 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:279 +#: ../../library/gzip.rst:281 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:283 +#: ../../library/gzip.rst:285 msgid "Decompress the given file." -msgstr "" +msgstr "解壓縮指定的檔案。" -#: ../../library/gzip.rst:287 +#: ../../library/gzip.rst:289 msgid "Show the help message." -msgstr "" +msgstr "顯示幫助訊息。" diff --git a/library/html.parser.po b/library/html.parser.po index 6b2e17cfe4..3541d18e9f 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-18 00:10+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-04 22:54+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,15 +231,15 @@ msgstr "" #: ../../library/html.parser.rst:175 msgid "" "This method is called to process decimal and hexadecimal numeric character " -"references of the form ``&#NNN;`` and ``&#xNNN;``. For example, the decimal " -"equivalent for ``>`` is ``>``, whereas the hexadecimal is ``>``; " -"in this case the method will receive ``'62'`` or ``'x3E'``. This method is " -"never called if *convert_charrefs* is ``True``." +"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " +"the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " +"This method is never called if *convert_charrefs* is ``True``." msgstr "" -"呼叫此方法來處理 ``#NNN;`` 和 ``&#xNNN;`` 形式的十進位和十六進位數字字元參" -"照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>``;在這種" -"情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 *convert_charrefs* 為 " -"``True``,則永遠不會呼叫此方法。" +"呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" +"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " +"*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" #: ../../library/html.parser.rst:184 msgid "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 022fe9d2ee..ff0abea3da 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,7 +69,8 @@ msgstr "" #: ../../library/http.cookiejar.rst:46 msgid "" -"LoadError was made a subclass of :exc:`OSError` instead of :exc:`IOError`." +":exc:`LoadError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" #: ../../library/http.cookiejar.rst:51 @@ -630,10 +631,10 @@ msgid "" "cookie domain to be matched. For example, ``\"example.com\"`` matches a " "blocklist entry of ``\"example.com\"``, but ``\"www.example.com\"`` does " "not. Domains that do start with a dot are matched by more specific domains " -"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example.com" -"\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does not). " -"IP addresses are an exception, and must match exactly. For example, if " -"blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " +"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example." +"com\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does " +"not). IP addresses are an exception, and must match exactly. For example, " +"if blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " "192.168.1.2 is blocked, but 193.168.1.2 is not." msgstr "" diff --git a/library/http.server.po b/library/http.server.po index 1a5ec94aa5..c48bf130f8 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -265,8 +265,8 @@ msgid "" "attribute holds the default values for *message* and *explain* that will be " "used if no value is provided; for unknown codes the default value for both " "is the string ``???``. The body will be empty if the method is HEAD or the " -"response code is one of the following: ``1xx``, ``204 No Content``, ``205 " -"Reset Content``, ``304 Not Modified``." +"response code is one of the following: :samp:`1{xx}`, ``204 No Content``, " +"``205 Reset Content``, ``304 Not Modified``." msgstr "" #: ../../library/http.server.rst:223 diff --git a/library/idle.po b/library/idle.po index 521bc73b78..0046d297a0 100644 --- a/library/idle.po +++ b/library/idle.po @@ -1199,7 +1199,7 @@ msgstr "" #: ../../library/idle.rst:672 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" #: ../../library/idle.rst:688 msgid "If there are arguments:" diff --git a/library/inspect.po b/library/inspect.po index 65cac3464a..8f55ff930d 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 16:53+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1785,28 +1785,28 @@ msgstr "" msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1464 ../../library/inspect.rst:1479 -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1493 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1461 +#: ../../library/inspect.rst:1462 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1463 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1464 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1465 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1470 +#: ../../library/inspect.rst:1471 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 " @@ -1814,23 +1814,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1478 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1479 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1480 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1481 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1485 +#: ../../library/inspect.rst:1487 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1839,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1495 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1496 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1497 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1498 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1502 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:1505 +#: ../../library/inspect.rst:1508 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. " @@ -1870,14 +1870,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1513 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:1516 +#: ../../library/inspect.rst:1519 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 " @@ -1885,79 +1885,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1525 +#: ../../library/inspect.rst:1528 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1535 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1542 +#: ../../library/inspect.rst:1545 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1544 +#: ../../library/inspect.rst:1547 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1549 +#: ../../library/inspect.rst:1552 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1553 +#: ../../library/inspect.rst:1556 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:1558 +#: ../../library/inspect.rst:1561 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1562 +#: ../../library/inspect.rst:1565 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1566 +#: ../../library/inspect.rst:1569 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1573 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:1575 +#: ../../library/inspect.rst:1578 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:1583 +#: ../../library/inspect.rst:1586 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:1592 +#: ../../library/inspect.rst:1595 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:1599 +#: ../../library/inspect.rst:1602 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1965,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1607 +#: ../../library/inspect.rst:1610 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1611 +#: ../../library/inspect.rst:1614 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1618 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1642 +#: ../../library/inspect.rst:1645 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/inspect.rst:1644 +#: ../../library/inspect.rst:1647 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1649 +#: ../../library/inspect.rst:1652 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:1655 +#: ../../library/inspect.rst:1658 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/json.po b/library/json.po index 34790dc35c..f7702f267a 100644 --- a/library/json.po +++ b/library/json.po @@ -50,8 +50,8 @@ msgid "" "string may cause the decoder to consume considerable CPU and memory " "resources. Limiting the size of data to be parsed is recommended." msgstr "" -"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致" -"解碼器耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" +"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致解碼器" +"耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" #: ../../library/json.rst:26 msgid "" @@ -778,7 +778,7 @@ msgstr "" #: ../../library/json.rst:673 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" #: ../../library/json.rst:678 msgid "**Source code:** :source:`Lib/json/tool.py`" @@ -804,7 +804,7 @@ msgstr "" #: ../../library/json.rst:704 msgid "Command line options" -msgstr "" +msgstr "命令列選項" #: ../../library/json.rst:708 msgid "The JSON file to be validated or pretty-printed:" diff --git a/library/logging.po b/library/logging.po index a01a4bd182..b3823e886e 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,7 @@ msgid "" "This module defines functions and classes which implement a flexible event " "logging system for applications and libraries." msgstr "" -"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系" -"統。" +"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系統。" #: ../../library/logging.rst:28 msgid "" @@ -61,10 +60,9 @@ msgid "" "application log can include your own messages integrated with messages from " "third-party modules." msgstr "" -"由標準函式庫模組提供的日誌記錄 API 的主要好處是," -"所有的 Python 模組都能參與日誌記錄," -"因此您的應用程式日誌可以包含您自己的訊息," -"並與來自第三方模組的訊息整合在一起。" +"由標準函式庫模組提供的日誌記錄 API 的主要好處是,所有的 Python 模組都能參與日" +"誌記錄,因此您的應用程式日誌可以包含您自己的訊息,並與來自第三方模組的訊息整" +"合在一起。" #: ../../library/logging.rst:33 msgid "The simplest example:" @@ -1117,7 +1115,7 @@ msgstr "" msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " -"a placeholder of ``{msecs:03d}`` would format a millisecond value of ``4`` " +"a placeholder of ``{msecs:03.0f}`` would format a millisecond value of ``4`` " "as ``004``. Refer to the :meth:`str.format` documentation for full details " "on the options available to you." msgstr "" diff --git a/library/lzma.po b/library/lzma.po index 9ccd407592..245b87f7f2 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -475,15 +474,15 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:335 msgid "Compression filters:" msgstr "" -#: ../../library/lzma.rst:336 +#: ../../library/lzma.rst:337 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:338 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" @@ -493,100 +492,100 @@ msgstr "" msgid "Delta filter:" msgstr "" -#: ../../library/lzma.rst:340 +#: ../../library/lzma.rst:342 msgid ":const:`FILTER_DELTA`" msgstr ":const:`FILTER_DELTA`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:344 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: ../../library/lzma.rst:343 +#: ../../library/lzma.rst:346 msgid ":const:`FILTER_X86`" msgstr ":const:`FILTER_X86`" -#: ../../library/lzma.rst:344 +#: ../../library/lzma.rst:347 msgid ":const:`FILTER_IA64`" msgstr ":const:`FILTER_IA64`" -#: ../../library/lzma.rst:345 +#: ../../library/lzma.rst:348 msgid ":const:`FILTER_ARM`" msgstr ":const:`FILTER_ARM`" -#: ../../library/lzma.rst:346 +#: ../../library/lzma.rst:349 msgid ":const:`FILTER_ARMTHUMB`" msgstr ":const:`FILTER_ARMTHUMB`" -#: ../../library/lzma.rst:347 +#: ../../library/lzma.rst:350 msgid ":const:`FILTER_POWERPC`" msgstr ":const:`FILTER_POWERPC`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:351 msgid ":const:`FILTER_SPARC`" msgstr ":const:`FILTER_SPARC`" -#: ../../library/lzma.rst:350 +#: ../../library/lzma.rst:353 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: ../../library/lzma.rst:354 +#: ../../library/lzma.rst:357 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: ../../library/lzma.rst:357 +#: ../../library/lzma.rst:360 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: ../../library/lzma.rst:359 +#: ../../library/lzma.rst:362 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: ../../library/lzma.rst:361 +#: ../../library/lzma.rst:364 msgid "``lc``: Number of literal context bits." msgstr "" -#: ../../library/lzma.rst:362 +#: ../../library/lzma.rst:365 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: ../../library/lzma.rst:364 +#: ../../library/lzma.rst:367 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: ../../library/lzma.rst:365 +#: ../../library/lzma.rst:368 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: ../../library/lzma.rst:366 +#: ../../library/lzma.rst:369 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: ../../library/lzma.rst:368 +#: ../../library/lzma.rst:371 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: ../../library/lzma.rst:370 +#: ../../library/lzma.rst:373 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: ../../library/lzma.rst:373 +#: ../../library/lzma.rst:376 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -595,7 +594,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/lzma.rst:378 +#: ../../library/lzma.rst:381 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -605,30 +604,30 @@ msgid "" "data. The default is 0." msgstr "" -#: ../../library/lzma.rst:386 +#: ../../library/lzma.rst:389 msgid "Examples" msgstr "範例" -#: ../../library/lzma.rst:388 +#: ../../library/lzma.rst:391 msgid "Reading in a compressed file::" msgstr "" -#: ../../library/lzma.rst:394 +#: ../../library/lzma.rst:397 msgid "Creating a compressed file::" msgstr "" -#: ../../library/lzma.rst:401 +#: ../../library/lzma.rst:404 msgid "Compressing data in memory::" msgstr "" -#: ../../library/lzma.rst:407 +#: ../../library/lzma.rst:410 msgid "Incremental compression::" msgstr "" -#: ../../library/lzma.rst:418 +#: ../../library/lzma.rst:421 msgid "Writing compressed data to an already-open file::" msgstr "" -#: ../../library/lzma.rst:427 +#: ../../library/lzma.rst:430 msgid "Creating a compressed file using a custom filter chain::" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 2d6e9bd948..38134ab93d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -133,7 +133,7 @@ msgid "" "Available on POSIX and Windows platforms. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:132 +#: ../../library/multiprocessing.rst:138 msgid "*fork*" msgstr "" @@ -157,11 +157,19 @@ msgid "" "or :func:`set_start_method`." msgstr "" -#: ../../library/multiprocessing.rst:145 +#: ../../library/multiprocessing.rst:134 +msgid "" +"If Python is able to detect that your process has multiple threads, the :" +"func:`os.fork` function that this start method calls internally will raise " +"a :exc:`DeprecationWarning`. Use a different start method. See the :func:`os." +"fork` documentation for further explanation." +msgstr "" + +#: ../../library/multiprocessing.rst:151 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:135 +#: ../../library/multiprocessing.rst:141 msgid "" "When the program starts and selects the *forkserver* start method, a server " "process is spawned. From then on, whenever a new process is needed, the " @@ -171,27 +179,27 @@ msgid "" "for it to use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:143 +#: ../../library/multiprocessing.rst:149 msgid "" "Available on POSIX platforms which support passing file descriptors over " "Unix pipes such as Linux." msgstr "" -#: ../../library/multiprocessing.rst:149 +#: ../../library/multiprocessing.rst:155 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess as macOS system libraries may start threads. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:153 +#: ../../library/multiprocessing.rst:159 msgid "" "*spawn* added on all POSIX platforms, and *forkserver* added for some POSIX " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:159 +#: ../../library/multiprocessing.rst:165 msgid "" "On POSIX using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " @@ -206,25 +214,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:172 +#: ../../library/multiprocessing.rst:178 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:189 +#: ../../library/multiprocessing.rst:195 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:192 +#: ../../library/multiprocessing.rst:198 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:210 +#: ../../library/multiprocessing.rst:216 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -232,13 +240,13 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:215 +#: ../../library/multiprocessing.rst:221 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:221 +#: ../../library/multiprocessing.rst:227 msgid "" "The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used " "with \"frozen\" executables (i.e., binaries produced by packages like " @@ -246,41 +254,41 @@ msgid "" "method may work if code does not use threads." msgstr "" -#: ../../library/multiprocessing.rst:228 +#: ../../library/multiprocessing.rst:234 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:230 +#: ../../library/multiprocessing.rst:236 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:233 +#: ../../library/multiprocessing.rst:239 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:235 +#: ../../library/multiprocessing.rst:241 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:250 +#: ../../library/multiprocessing.rst:256 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:252 +#: ../../library/multiprocessing.rst:258 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:254 +#: ../../library/multiprocessing.rst:260 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:270 +#: ../../library/multiprocessing.rst:276 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -290,55 +298,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:280 +#: ../../library/multiprocessing.rst:286 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:282 +#: ../../library/multiprocessing.rst:288 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:301 +#: ../../library/multiprocessing.rst:307 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:306 +#: ../../library/multiprocessing.rst:312 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:308 +#: ../../library/multiprocessing.rst:314 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:312 +#: ../../library/multiprocessing.rst:318 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:315 +#: ../../library/multiprocessing.rst:321 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:317 +#: ../../library/multiprocessing.rst:323 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:338 ../../library/multiprocessing.rst:384 +#: ../../library/multiprocessing.rst:344 ../../library/multiprocessing.rst:390 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:343 +#: ../../library/multiprocessing.rst:349 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -346,25 +354,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:348 +#: ../../library/multiprocessing.rst:354 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:352 +#: ../../library/multiprocessing.rst:358 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:354 +#: ../../library/multiprocessing.rst:360 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:358 +#: ../../library/multiprocessing.rst:364 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -373,7 +381,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:389 +#: ../../library/multiprocessing.rst:395 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -381,31 +389,31 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:396 +#: ../../library/multiprocessing.rst:402 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:398 +#: ../../library/multiprocessing.rst:404 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:402 +#: ../../library/multiprocessing.rst:408 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/multiprocessing.rst:446 +#: ../../library/multiprocessing.rst:452 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:451 +#: ../../library/multiprocessing.rst:457 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -414,35 +422,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:474 +#: ../../library/multiprocessing.rst:480 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:486 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:482 +#: ../../library/multiprocessing.rst:488 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:487 +#: ../../library/multiprocessing.rst:493 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:492 +#: ../../library/multiprocessing.rst:498 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:496 +#: ../../library/multiprocessing.rst:502 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -456,29 +464,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:507 +#: ../../library/multiprocessing.rst:513 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:511 +#: ../../library/multiprocessing.rst:517 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:521 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:526 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:528 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -486,30 +494,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:527 +#: ../../library/multiprocessing.rst:533 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:530 +#: ../../library/multiprocessing.rst:536 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:548 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:544 +#: ../../library/multiprocessing.rst:550 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:555 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -519,23 +527,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:562 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:558 +#: ../../library/multiprocessing.rst:564 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:563 +#: ../../library/multiprocessing.rst:569 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:573 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -543,33 +551,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:580 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:576 +#: ../../library/multiprocessing.rst:582 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:581 +#: ../../library/multiprocessing.rst:587 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:590 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:586 +#: ../../library/multiprocessing.rst:592 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:589 +#: ../../library/multiprocessing.rst:595 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -578,92 +586,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:595 +#: ../../library/multiprocessing.rst:601 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:606 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:611 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:608 +#: ../../library/multiprocessing.rst:614 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:612 +#: ../../library/multiprocessing.rst:618 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:618 +#: ../../library/multiprocessing.rst:624 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:626 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:623 +#: ../../library/multiprocessing.rst:629 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:633 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:637 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:634 +#: ../../library/multiprocessing.rst:640 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:638 +#: ../../library/multiprocessing.rst:644 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On POSIX, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:646 +#: ../../library/multiprocessing.rst:652 msgid "" "Terminate the process. On POSIX this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:650 +#: ../../library/multiprocessing.rst:656 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:655 +#: ../../library/multiprocessing.rst:661 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -672,11 +680,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:663 +#: ../../library/multiprocessing.rst:669 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on POSIX." msgstr "" -#: ../../library/multiprocessing.rst:669 +#: ../../library/multiprocessing.rst:675 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -684,59 +692,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:677 +#: ../../library/multiprocessing.rst:683 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:681 +#: ../../library/multiprocessing.rst:687 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:702 +#: ../../library/multiprocessing.rst:708 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:712 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:709 +#: ../../library/multiprocessing.rst:715 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:714 +#: ../../library/multiprocessing.rst:720 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:718 +#: ../../library/multiprocessing.rst:724 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:721 +#: ../../library/multiprocessing.rst:727 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:723 +#: ../../library/multiprocessing.rst:729 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:727 +#: ../../library/multiprocessing.rst:733 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:730 +#: ../../library/multiprocessing.rst:736 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -746,7 +754,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:737 +#: ../../library/multiprocessing.rst:743 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -754,20 +762,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:742 +#: ../../library/multiprocessing.rst:748 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:747 +#: ../../library/multiprocessing.rst:753 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:754 +#: ../../library/multiprocessing.rst:760 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -776,14 +784,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:761 +#: ../../library/multiprocessing.rst:767 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:766 +#: ../../library/multiprocessing.rst:772 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -791,7 +799,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:773 +#: ../../library/multiprocessing.rst:779 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -799,7 +807,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:780 +#: ../../library/multiprocessing.rst:786 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1155 +#: ../../library/multiprocessing.rst:1161 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1164 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1163 +#: ../../library/multiprocessing.rst:1169 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1170 +#: ../../library/multiprocessing.rst:1176 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1174 +#: ../../library/multiprocessing.rst:1180 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1182 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1180 +#: ../../library/multiprocessing.rst:1186 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1182 +#: ../../library/multiprocessing.rst:1188 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1186 +#: ../../library/multiprocessing.rst:1192 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1191 +#: ../../library/multiprocessing.rst:1197 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1193 +#: ../../library/multiprocessing.rst:1199 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1316,7 +1324,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1200 +#: ../../library/multiprocessing.rst:1206 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1324,19 +1332,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1211 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1209 +#: ../../library/multiprocessing.rst:1215 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1222 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1344,45 +1352,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1222 +#: ../../library/multiprocessing.rst:1228 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1227 +#: ../../library/multiprocessing.rst:1233 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1231 +#: ../../library/multiprocessing.rst:1237 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1235 +#: ../../library/multiprocessing.rst:1241 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1240 +#: ../../library/multiprocessing.rst:1246 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1265 +#: ../../library/multiprocessing.rst:1271 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1269 +#: ../../library/multiprocessing.rst:1275 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1390,73 +1398,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1282 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1288 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1286 +#: ../../library/multiprocessing.rst:1292 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1290 +#: ../../library/multiprocessing.rst:1296 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1295 +#: ../../library/multiprocessing.rst:1301 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1307 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1304 -#: ../../library/multiprocessing.rst:1442 +#: ../../library/multiprocessing.rst:1310 +#: ../../library/multiprocessing.rst:1448 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1308 +#: ../../library/multiprocessing.rst:1314 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1313 +#: ../../library/multiprocessing.rst:1319 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1315 +#: ../../library/multiprocessing.rst:1321 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1318 -#: ../../library/multiprocessing.rst:1867 +#: ../../library/multiprocessing.rst:1324 +#: ../../library/multiprocessing.rst:1873 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1329 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1334 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1467,25 +1475,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1336 +#: ../../library/multiprocessing.rst:1342 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1340 +#: ../../library/multiprocessing.rst:1346 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1345 -#: ../../library/multiprocessing.rst:1396 +#: ../../library/multiprocessing.rst:1351 +#: ../../library/multiprocessing.rst:1402 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1353 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1493,14 +1501,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1352 +#: ../../library/multiprocessing.rst:1358 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1356 +#: ../../library/multiprocessing.rst:1362 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1514,19 +1522,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1371 +#: ../../library/multiprocessing.rst:1377 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1380 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1380 +#: ../../library/multiprocessing.rst:1386 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1535,20 +1543,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1392 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1390 +#: ../../library/multiprocessing.rst:1396 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1398 +#: ../../library/multiprocessing.rst:1404 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1561,7 +1569,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1408 +#: ../../library/multiprocessing.rst:1414 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1572,14 +1580,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1422 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1429 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1589,7 +1597,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1431 +#: ../../library/multiprocessing.rst:1437 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1598,17 +1606,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1440 +#: ../../library/multiprocessing.rst:1446 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1453 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1452 +#: ../../library/multiprocessing.rst:1458 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1617,13 +1625,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1464 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1463 +#: ../../library/multiprocessing.rst:1469 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1632,32 +1640,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1477 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1473 +#: ../../library/multiprocessing.rst:1479 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1478 +#: ../../library/multiprocessing.rst:1484 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1482 -#: ../../library/multiprocessing.rst:1569 +#: ../../library/multiprocessing.rst:1488 +#: ../../library/multiprocessing.rst:1575 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1486 +#: ../../library/multiprocessing.rst:1492 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1667,32 +1675,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1493 +#: ../../library/multiprocessing.rst:1499 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1499 +#: ../../library/multiprocessing.rst:1505 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1505 -#: ../../library/multiprocessing.rst:1595 -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1511 +#: ../../library/multiprocessing.rst:1601 +#: ../../library/multiprocessing.rst:1616 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1509 +#: ../../library/multiprocessing.rst:1515 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1512 +#: ../../library/multiprocessing.rst:1518 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1702,7 +1710,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1519 +#: ../../library/multiprocessing.rst:1525 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1712,28 +1720,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1532 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1534 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1533 +#: ../../library/multiprocessing.rst:1539 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1538 +#: ../../library/multiprocessing.rst:1544 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1544 +#: ../../library/multiprocessing.rst:1550 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1742,11 +1750,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1552 +#: ../../library/multiprocessing.rst:1558 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1554 +#: ../../library/multiprocessing.rst:1560 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1756,40 +1764,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1561 +#: ../../library/multiprocessing.rst:1567 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1567 +#: ../../library/multiprocessing.rst:1573 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1579 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1583 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1583 +#: ../../library/multiprocessing.rst:1589 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1587 -#: ../../library/multiprocessing.rst:1603 +#: ../../library/multiprocessing.rst:1593 +#: ../../library/multiprocessing.rst:1609 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1799,121 +1807,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1605 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1614 +#: ../../library/multiprocessing.rst:1620 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1625 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1623 +#: ../../library/multiprocessing.rst:1629 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1627 +#: ../../library/multiprocessing.rst:1633 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1636 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1634 +#: ../../library/multiprocessing.rst:1640 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1648 +#: ../../library/multiprocessing.rst:1654 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1692 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1699 +#: ../../library/multiprocessing.rst:1705 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1701 +#: ../../library/multiprocessing.rst:1707 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1922,7 +1930,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1710 +#: ../../library/multiprocessing.rst:1716 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1930,31 +1938,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1724 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:1724 +#: ../../library/multiprocessing.rst:1730 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1732 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:1729 +#: ../../library/multiprocessing.rst:1735 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:1732 +#: ../../library/multiprocessing.rst:1738 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`` " @@ -1962,19 +1970,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1743 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1746 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1749 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1982,54 +1990,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1754 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1753 +#: ../../library/multiprocessing.rst:1759 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:1758 +#: ../../library/multiprocessing.rst:1764 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:1767 +#: ../../library/multiprocessing.rst:1773 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1771 +#: ../../library/multiprocessing.rst:1777 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1779 +#: ../../library/multiprocessing.rst:1785 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:1782 +#: ../../library/multiprocessing.rst:1788 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1786 +#: ../../library/multiprocessing.rst:1792 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1795 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:1792 +#: ../../library/multiprocessing.rst:1798 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2037,14 +2045,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1804 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:1802 +#: ../../library/multiprocessing.rst:1808 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2055,7 +2063,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1817 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 " @@ -2065,22 +2073,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1818 +#: ../../library/multiprocessing.rst:1824 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:1822 +#: ../../library/multiprocessing.rst:1828 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1826 +#: ../../library/multiprocessing.rst:1832 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1834 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2088,173 +2096,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1840 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:1839 +#: ../../library/multiprocessing.rst:1845 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:1843 +#: ../../library/multiprocessing.rst:1849 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:1849 +#: ../../library/multiprocessing.rst:1855 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1862 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1861 +#: ../../library/multiprocessing.rst:1867 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1870 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:1872 +#: ../../library/multiprocessing.rst:1878 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1876 +#: ../../library/multiprocessing.rst:1882 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1880 +#: ../../library/multiprocessing.rst:1886 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1890 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1888 +#: ../../library/multiprocessing.rst:1894 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1892 +#: ../../library/multiprocessing.rst:1898 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1897 +#: ../../library/multiprocessing.rst:1903 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1901 +#: ../../library/multiprocessing.rst:1907 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1908 +#: ../../library/multiprocessing.rst:1914 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1913 +#: ../../library/multiprocessing.rst:1919 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1915 +#: ../../library/multiprocessing.rst:1921 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:1922 +#: ../../library/multiprocessing.rst:1928 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1924 +#: ../../library/multiprocessing.rst:1930 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:1927 +#: ../../library/multiprocessing.rst:1933 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:1944 +#: ../../library/multiprocessing.rst:1950 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1946 +#: ../../library/multiprocessing.rst:1952 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:1971 +#: ../../library/multiprocessing.rst:1977 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1979 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:1976 +#: ../../library/multiprocessing.rst:1982 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1988 +#: ../../library/multiprocessing.rst:1994 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2004 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2015 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2034 +#: ../../library/multiprocessing.rst:2040 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2036 +#: ../../library/multiprocessing.rst:2042 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:2040 +#: ../../library/multiprocessing.rst:2046 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2262,14 +2270,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2058 +#: ../../library/multiprocessing.rst:2064 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:2062 +#: ../../library/multiprocessing.rst:2068 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:" @@ -2277,11 +2285,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2078 +#: ../../library/multiprocessing.rst:2084 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2097 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 " @@ -2292,53 +2300,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2110 +#: ../../library/multiprocessing.rst:2116 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:2116 +#: ../../library/multiprocessing.rst:2122 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2130 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2134 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2132 +#: ../../library/multiprocessing.rst:2138 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2140 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2138 +#: ../../library/multiprocessing.rst:2144 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2142 +#: ../../library/multiprocessing.rst:2148 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2150 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:2148 +#: ../../library/multiprocessing.rst:2154 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 " @@ -2346,79 +2354,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2159 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2156 +#: ../../library/multiprocessing.rst:2162 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2172 +#: ../../library/multiprocessing.rst:2178 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2174 +#: ../../library/multiprocessing.rst:2180 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2184 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2182 +#: ../../library/multiprocessing.rst:2188 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2186 +#: ../../library/multiprocessing.rst:2192 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2194 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:2191 +#: ../../library/multiprocessing.rst:2197 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2202 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2201 +#: ../../library/multiprocessing.rst:2207 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:2206 +#: ../../library/multiprocessing.rst:2212 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:2210 +#: ../../library/multiprocessing.rst:2216 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:2213 -#: ../../library/multiprocessing.rst:2774 +#: ../../library/multiprocessing.rst:2219 +#: ../../library/multiprocessing.rst:2780 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2216 +#: ../../library/multiprocessing.rst:2222 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 " @@ -2426,7 +2434,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2221 +#: ../../library/multiprocessing.rst:2227 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2434,13 +2442,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2227 +#: ../../library/multiprocessing.rst:2233 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2231 +#: ../../library/multiprocessing.rst:2237 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 " @@ -2448,22 +2456,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2236 +#: ../../library/multiprocessing.rst:2242 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:2240 +#: ../../library/multiprocessing.rst:2246 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2249 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2254 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 " @@ -2474,7 +2482,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2258 +#: ../../library/multiprocessing.rst:2264 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 " @@ -2482,14 +2490,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2268 -#: ../../library/multiprocessing.rst:2299 +#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2305 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, " @@ -2497,60 +2505,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2273 -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2310 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:2277 -#: ../../library/multiprocessing.rst:2308 +#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2314 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2282 +#: ../../library/multiprocessing.rst:2288 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:2286 +#: ../../library/multiprocessing.rst:2292 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:2290 +#: ../../library/multiprocessing.rst:2296 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:2296 +#: ../../library/multiprocessing.rst:2302 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2319 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2321 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:2320 +#: ../../library/multiprocessing.rst:2326 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: " @@ -2558,65 +2566,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2327 +#: ../../library/multiprocessing.rst:2333 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:2333 +#: ../../library/multiprocessing.rst:2339 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:2337 +#: ../../library/multiprocessing.rst:2343 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2344 +#: ../../library/multiprocessing.rst:2350 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:2352 +#: ../../library/multiprocessing.rst:2358 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:2357 +#: ../../library/multiprocessing.rst:2363 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:2363 +#: ../../library/multiprocessing.rst:2369 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2366 +#: ../../library/multiprocessing.rst:2372 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:2374 +#: ../../library/multiprocessing.rst:2380 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2385 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2624,41 +2632,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2386 +#: ../../library/multiprocessing.rst:2392 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2396 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2394 +#: ../../library/multiprocessing.rst:2400 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2397 +#: ../../library/multiprocessing.rst:2403 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2407 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2428 +#: ../../library/multiprocessing.rst:2434 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2433 +#: ../../library/multiprocessing.rst:2439 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:2437 +#: ../../library/multiprocessing.rst:2443 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2667,46 +2675,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2446 +#: ../../library/multiprocessing.rst:2452 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2449 +#: ../../library/multiprocessing.rst:2455 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:2455 +#: ../../library/multiprocessing.rst:2461 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:2458 +#: ../../library/multiprocessing.rst:2464 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2469 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2466 +#: ../../library/multiprocessing.rst:2472 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:2470 -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2511 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 " @@ -2715,26 +2723,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2484 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2481 +#: ../../library/multiprocessing.rst:2487 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2486 +#: ../../library/multiprocessing.rst:2492 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:2490 +#: ../../library/multiprocessing.rst:2496 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 " @@ -2748,49 +2756,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2507 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:2513 +#: ../../library/multiprocessing.rst:2519 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:2520 +#: ../../library/multiprocessing.rst:2526 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:2524 +#: ../../library/multiprocessing.rst:2530 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2534 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2532 +#: ../../library/multiprocessing.rst:2538 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2535 +#: ../../library/multiprocessing.rst:2541 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:2542 +#: ../../library/multiprocessing.rst:2548 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 " @@ -2799,32 +2807,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2554 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2551 +#: ../../library/multiprocessing.rst:2557 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2558 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2553 +#: ../../library/multiprocessing.rst:2559 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2556 +#: ../../library/multiprocessing.rst:2562 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:2559 +#: ../../library/multiprocessing.rst:2565 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2832,7 +2840,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2565 +#: ../../library/multiprocessing.rst:2571 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 " @@ -2841,46 +2849,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2575 +#: ../../library/multiprocessing.rst:2581 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2583 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:2596 +#: ../../library/multiprocessing.rst:2602 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2613 +#: ../../library/multiprocessing.rst:2619 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2652 +#: ../../library/multiprocessing.rst:2658 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2654 +#: ../../library/multiprocessing.rst:2660 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:2657 +#: ../../library/multiprocessing.rst:2663 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2666 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2889,17 +2897,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2665 +#: ../../library/multiprocessing.rst:2671 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:2672 +#: ../../library/multiprocessing.rst:2678 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2680 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2907,7 +2915,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2680 +#: ../../library/multiprocessing.rst:2686 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 " @@ -2915,7 +2923,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2686 +#: ../../library/multiprocessing.rst:2692 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2926,17 +2934,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2694 +#: ../../library/multiprocessing.rst:2700 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2704 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2700 +#: ../../library/multiprocessing.rst:2706 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2944,27 +2952,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2707 +#: ../../library/multiprocessing.rst:2713 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2710 +#: ../../library/multiprocessing.rst:2716 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2714 +#: ../../library/multiprocessing.rst:2720 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:2721 +#: ../../library/multiprocessing.rst:2727 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 " @@ -2973,25 +2981,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2733 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2748 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2752 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2757 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:2756 +#: ../../library/multiprocessing.rst:2762 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2999,7 +3007,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2764 +#: ../../library/multiprocessing.rst:2770 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -3009,18 +3017,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2771 +#: ../../library/multiprocessing.rst:2777 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:2777 +#: ../../library/multiprocessing.rst:2783 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2781 +#: ../../library/multiprocessing.rst:2787 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 :" @@ -3030,7 +3038,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2794 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -3039,69 +3047,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2798 +#: ../../library/multiprocessing.rst:2804 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2806 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2805 +#: ../../library/multiprocessing.rst:2811 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2813 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2809 +#: ../../library/multiprocessing.rst:2815 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2811 +#: ../../library/multiprocessing.rst:2817 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2820 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:2818 +#: ../../library/multiprocessing.rst:2824 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2826 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2822 +#: ../../library/multiprocessing.rst:2828 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2830 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2833 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2829 +#: ../../library/multiprocessing.rst:2835 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2831 +#: ../../library/multiprocessing.rst:2837 msgid "" "On POSIX 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 " @@ -3112,11 +3120,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2839 +#: ../../library/multiprocessing.rst:2845 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2841 +#: ../../library/multiprocessing.rst:2847 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3126,11 +3134,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2849 +#: ../../library/multiprocessing.rst:2855 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2851 +#: ../../library/multiprocessing.rst:2857 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3138,18 +3146,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2863 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:2861 +#: ../../library/multiprocessing.rst:2867 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2869 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 " @@ -3158,7 +3166,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2875 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 " @@ -3167,21 +3175,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2881 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2895 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2892 +#: ../../library/multiprocessing.rst:2898 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2900 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3189,7 +3197,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2905 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 " @@ -3198,29 +3206,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2906 +#: ../../library/multiprocessing.rst:2912 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2918 +#: ../../library/multiprocessing.rst:2924 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2930 +#: ../../library/multiprocessing.rst:2936 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2932 +#: ../../library/multiprocessing.rst:2938 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2942 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:2942 +#: ../../library/multiprocessing.rst:2948 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3230,33 +3238,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2955 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:2961 +#: ../../library/multiprocessing.rst:2967 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2964 +#: ../../library/multiprocessing.rst:2970 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2972 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2975 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2977 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3264,11 +3272,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2976 +#: ../../library/multiprocessing.rst:2982 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2978 +#: ../../library/multiprocessing.rst:2984 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 " @@ -3276,66 +3284,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2989 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2988 +#: ../../library/multiprocessing.rst:2994 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2990 +#: ../../library/multiprocessing.rst:2996 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2994 +#: ../../library/multiprocessing.rst:3000 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3006 +#: ../../library/multiprocessing.rst:3012 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3020 +#: ../../library/multiprocessing.rst:3026 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3023 +#: ../../library/multiprocessing.rst:3029 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:3026 +#: ../../library/multiprocessing.rst:3032 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3033 +#: ../../library/multiprocessing.rst:3039 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3035 +#: ../../library/multiprocessing.rst:3041 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3047 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3047 +#: ../../library/multiprocessing.rst:3053 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.po b/library/os.po index e7c91a433e..2d9cdc7d82 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,8 +142,8 @@ msgid "" "On some systems, conversion using the file system encoding may fail. In this " "case, Python uses the :ref:`surrogateescape encoding error handler " "`, which means that undecodable bytes are replaced by a " -"Unicode character U+DCxx on decoding, and these are again translated to the " -"original byte on encoding." +"Unicode character U+DC\\ *xx* on decoding, and these are again translated to " +"the original byte on encoding." msgstr "" #: ../../library/os.rst:95 @@ -314,20 +314,19 @@ msgstr "" #: ../../library/os.rst:4108 ../../library/os.rst:4117 #: ../../library/os.rst:4125 ../../library/os.rst:4133 #: ../../library/os.rst:4140 ../../library/os.rst:4147 -#: ../../library/os.rst:4168 ../../library/os.rst:4185 -#: ../../library/os.rst:4225 ../../library/os.rst:4232 -#: ../../library/os.rst:4262 ../../library/os.rst:4389 -#: ../../library/os.rst:4438 ../../library/os.rst:4675 -#: ../../library/os.rst:4709 ../../library/os.rst:4767 -#: ../../library/os.rst:4781 ../../library/os.rst:4798 -#: ../../library/os.rst:4813 ../../library/os.rst:4824 -#: ../../library/os.rst:4836 ../../library/os.rst:4849 -#: ../../library/os.rst:4858 ../../library/os.rst:4868 -#: ../../library/os.rst:4881 ../../library/os.rst:4932 -#: ../../library/os.rst:4943 ../../library/os.rst:4955 -#: ../../library/os.rst:4962 ../../library/os.rst:4971 -#: ../../library/os.rst:4980 ../../library/os.rst:4989 -#: ../../library/os.rst:4998 +#: ../../library/os.rst:4213 ../../library/os.rst:4253 +#: ../../library/os.rst:4260 ../../library/os.rst:4290 +#: ../../library/os.rst:4417 ../../library/os.rst:4466 +#: ../../library/os.rst:4703 ../../library/os.rst:4737 +#: ../../library/os.rst:4795 ../../library/os.rst:4809 +#: ../../library/os.rst:4826 ../../library/os.rst:4841 +#: ../../library/os.rst:4852 ../../library/os.rst:4864 +#: ../../library/os.rst:4877 ../../library/os.rst:4886 +#: ../../library/os.rst:4896 ../../library/os.rst:4909 +#: ../../library/os.rst:4960 ../../library/os.rst:4971 +#: ../../library/os.rst:4983 ../../library/os.rst:4990 +#: ../../library/os.rst:4999 ../../library/os.rst:5008 +#: ../../library/os.rst:5017 ../../library/os.rst:5026 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -487,8 +486,8 @@ msgstr "" #: ../../library/os.rst:1649 ../../library/os.rst:1797 #: ../../library/os.rst:2530 ../../library/os.rst:3375 #: ../../library/os.rst:3412 ../../library/os.rst:4028 -#: ../../library/os.rst:4526 ../../library/os.rst:4537 -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4554 ../../library/os.rst:4565 +#: ../../library/os.rst:4682 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -519,9 +518,9 @@ msgstr "" #: ../../library/os.rst:2165 ../../library/os.rst:2178 #: ../../library/os.rst:2496 ../../library/os.rst:2508 #: ../../library/os.rst:3241 ../../library/os.rst:3398 -#: ../../library/os.rst:3631 ../../library/os.rst:5144 -#: ../../library/os.rst:5153 ../../library/os.rst:5174 -#: ../../library/os.rst:5184 ../../library/os.rst:5193 +#: ../../library/os.rst:3631 ../../library/os.rst:5174 +#: ../../library/os.rst:5183 ../../library/os.rst:5204 +#: ../../library/os.rst:5214 ../../library/os.rst:5223 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -594,9 +593,9 @@ msgid "" msgstr "" #: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 -#: ../../library/os.rst:4209 ../../library/os.rst:4507 -#: ../../library/os.rst:4631 ../../library/os.rst:4747 -#: ../../library/os.rst:4916 +#: ../../library/os.rst:4237 ../../library/os.rst:4535 +#: ../../library/os.rst:4659 ../../library/os.rst:4775 +#: ../../library/os.rst:4944 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +893,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4656 +#: ../../library/os.rst:789 ../../library/os.rst:4684 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1444,7 +1443,7 @@ msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1752 ../../library/os.rst:4749 +#: ../../library/os.rst:1752 ../../library/os.rst:4777 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 :" @@ -1465,7 +1464,7 @@ msgstr "" #: ../../library/os.rst:3435 ../../library/os.rst:3475 #: ../../library/os.rst:3574 ../../library/os.rst:3635 #: ../../library/os.rst:3819 ../../library/os.rst:3999 -#: ../../library/os.rst:4514 +#: ../../library/os.rst:4542 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2008,8 +2007,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1849 ../../library/os.rst:1855 -#: ../../library/os.rst:3924 ../../library/os.rst:4549 -#: ../../library/os.rst:4594 +#: ../../library/os.rst:3924 ../../library/os.rst:4577 +#: ../../library/os.rst:4622 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -4542,18 +4541,55 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4160 +#: ../../library/os.rst:4162 +msgid "" +"If you use TLS sockets in an application calling ``fork()``, see the warning " +"in the :mod:`ssl` documentation." +msgstr "" + +#: ../../library/os.rst:4165 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4166 -msgid "See :mod:`ssl` for applications that use the SSL module with fork()." +#: ../../library/os.rst:4169 +msgid "" +"If Python is able to detect that your process has multiple threads, :func:" +"`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" #: ../../library/os.rst:4173 msgid "" +"We chose to surface this as a warning, when detectable, to better inform " +"developers of a design problem that the POSIX platform specifically notes as " +"not supported. Even in code that *appears* to work, it has never been safe " +"to mix threading with :func:`os.fork` on POSIX platforms. The CPython " +"runtime itself has always made API calls that are not safe for use in the " +"child process when threads existed in the parent (such as ``malloc`` and " +"``free``)." +msgstr "" + +#: ../../library/os.rst:4182 +msgid "" +"Users of macOS or users of libc or malloc implementations other than those " +"typically found in glibc to date are among those already more likely to " +"experience deadlocks running such code." +msgstr "" + +#: ../../library/os.rst:4186 +msgid "" +"See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " +"this longstanding platform compatibility problem to developers." +msgstr "" + +#: ../../library/os.rst:4191 ../../library/os.rst:4433 +msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." +msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" + +#: ../../library/os.rst:4196 +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, " "the new child's process id in the parent, and *fd* is the file descriptor of " @@ -4561,24 +4597,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4179 +#: ../../library/os.rst:4202 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4204 +msgid "" +"If Python is able to detect that your process has multiple threads, this now " +"raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." +"fork`." +msgstr "" + +#: ../../library/os.rst:4209 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4222 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:4197 +#: ../../library/os.rst:4225 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4632,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4233 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4207 +#: ../../library/os.rst:4235 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4644,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4211 +#: ../../library/os.rst:4239 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4249 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4223 +#: ../../library/os.rst:4251 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4660,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4230 +#: ../../library/os.rst:4258 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4237 +#: ../../library/os.rst:4265 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4241 +#: ../../library/os.rst:4269 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4271 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4276 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4688,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4253 +#: ../../library/os.rst:4281 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4259 +#: ../../library/os.rst:4287 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4267 +#: ../../library/os.rst:4295 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 " @@ -4665,7 +4708,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4275 +#: ../../library/os.rst:4303 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4720,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4313 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:4290 +#: ../../library/os.rst:4318 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:4294 +#: ../../library/os.rst:4322 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4297 +#: ../../library/os.rst:4325 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4300 +#: ../../library/os.rst:4328 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4309 +#: ../../library/os.rst:4337 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4311 +#: ../../library/os.rst:4339 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4341 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4316 +#: ../../library/os.rst:4344 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:4320 +#: ../../library/os.rst:4348 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 " @@ -4739,31 +4782,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4356 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4330 +#: ../../library/os.rst:4358 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4334 +#: ../../library/os.rst:4362 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4336 +#: ../../library/os.rst:4364 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4340 +#: ../../library/os.rst:4368 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4370 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4344 +#: ../../library/os.rst:4372 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4815,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4378 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 " @@ -4781,7 +4824,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4384 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 " @@ -4792,7 +4835,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4392 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4843,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4369 +#: ../../library/os.rst:4397 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 " @@ -4808,14 +4851,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4374 +#: ../../library/os.rst:4402 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4406 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4868,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4385 ../../library/os.rst:4401 +#: ../../library/os.rst:4413 ../../library/os.rst:4429 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4876,72 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4395 +#: ../../library/os.rst:4423 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4397 +#: ../../library/os.rst:4425 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:4405 -msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." -msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" - -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4435 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4441 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:4418 +#: ../../library/os.rst:4446 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4419 +#: ../../library/os.rst:4447 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4421 +#: ../../library/os.rst:4449 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4423 +#: ../../library/os.rst:4451 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:4427 +#: ../../library/os.rst:4455 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:4432 +#: ../../library/os.rst:4460 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:4436 +#: ../../library/os.rst:4464 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4452 +#: ../../library/os.rst:4480 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4454 +#: ../../library/os.rst:4482 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4949,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4487 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 " @@ -4919,13 +4958,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4465 +#: ../../library/os.rst:4493 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:4468 +#: ../../library/os.rst:4496 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4976,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4477 +#: ../../library/os.rst:4505 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4989,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4487 +#: ../../library/os.rst:4515 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 " @@ -4962,13 +5001,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4496 +#: ../../library/os.rst:4524 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4533 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +5015,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4537 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +5023,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4549 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +5031,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4531 +#: ../../library/os.rst:4559 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5040,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4571 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5050,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4554 +#: ../../library/os.rst:4582 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4584 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5062,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4561 +#: ../../library/os.rst:4589 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 " @@ -5031,28 +5070,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4594 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:4570 +#: ../../library/os.rst:4598 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:4574 +#: ../../library/os.rst:4602 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:4578 +#: ../../library/os.rst:4606 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 " @@ -5063,14 +5102,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4614 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:4590 +#: ../../library/os.rst:4618 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5117,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4592 +#: ../../library/os.rst:4620 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5125,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4624 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4631 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 " @@ -5103,13 +5142,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4611 +#: ../../library/os.rst:4639 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:4614 +#: ../../library/os.rst:4642 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 :" @@ -5118,7 +5157,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4648 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5165,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4653 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:4629 +#: ../../library/os.rst:4657 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4664 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4667 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4668 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4669 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4670 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4671 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4673 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:4649 +#: ../../library/os.rst:4677 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5222,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4691 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5231,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4669 +#: ../../library/os.rst:4697 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4672 ../../library/os.rst:4744 +#: ../../library/os.rst:4700 ../../library/os.rst:4772 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4707 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4686 +#: ../../library/os.rst:4714 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4716 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4719 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4695 +#: ../../library/os.rst:4723 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4726 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4727 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4728 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4729 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4702 +#: ../../library/os.rst:4730 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4732 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4744 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4718 +#: ../../library/os.rst:4746 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 " @@ -5277,7 +5316,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4723 +#: ../../library/os.rst:4751 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 " @@ -5287,7 +5326,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4730 +#: ../../library/os.rst:4758 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5335,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4764 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 " @@ -5308,7 +5347,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4785 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 " @@ -5317,13 +5356,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4764 ../../library/os.rst:4778 +#: ../../library/os.rst:4792 ../../library/os.rst:4806 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:4800 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5371,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4789 +#: ../../library/os.rst:4817 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4820 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4821 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4822 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4795 +#: ../../library/os.rst:4823 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4828 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4803 +#: ../../library/os.rst:4831 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4809 +#: ../../library/os.rst:4837 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4818 +#: ../../library/os.rst:4846 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4849 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4831 +#: ../../library/os.rst:4859 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4834 ../../library/os.rst:4866 +#: ../../library/os.rst:4862 ../../library/os.rst:4894 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4843 +#: ../../library/os.rst:4871 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4847 +#: ../../library/os.rst:4875 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4854 +#: ../../library/os.rst:4882 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4891 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4906 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4885 +#: ../../library/os.rst:4913 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4919 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4893 +#: ../../library/os.rst:4921 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4923 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:4898 +#: ../../library/os.rst:4926 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 " @@ -5451,15 +5490,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4902 +#: ../../library/os.rst:4930 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4904 +#: ../../library/os.rst:4932 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4906 +#: ../../library/os.rst:4934 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 " @@ -5467,217 +5506,221 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4941 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4921 +#: ../../library/os.rst:4949 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:4927 +#: ../../library/os.rst:4955 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4930 ../../library/os.rst:4996 +#: ../../library/os.rst:4958 ../../library/os.rst:5024 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4937 +#: ../../library/os.rst:4965 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4941 +#: ../../library/os.rst:4969 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4948 +#: ../../library/os.rst:4976 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4979 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:4959 +#: ../../library/os.rst:4987 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4967 +#: ../../library/os.rst:4995 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:4976 +#: ../../library/os.rst:5004 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4978 +#: ../../library/os.rst:5006 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5013 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4987 +#: ../../library/os.rst:5015 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4994 +#: ../../library/os.rst:5022 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5002 +#: ../../library/os.rst:5030 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5032 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:5010 +#: ../../library/os.rst:5038 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5015 +#: ../../library/os.rst:5043 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5019 +#: ../../library/os.rst:5047 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5024 +#: ../../library/os.rst:5052 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5056 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5032 +#: ../../library/os.rst:5060 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5064 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5040 +#: ../../library/os.rst:5068 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:5047 +#: ../../library/os.rst:5075 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:5051 +#: ../../library/os.rst:5079 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5083 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5060 +#: ../../library/os.rst:5088 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5094 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5100 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:5079 +#: ../../library/os.rst:5107 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:5086 +#: ../../library/os.rst:5114 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:5092 +#: ../../library/os.rst:5120 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:5098 +#: ../../library/os.rst:5126 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:5104 +#: ../../library/os.rst:5132 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5109 +#: ../../library/os.rst:5137 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:5116 +#: ../../library/os.rst:5144 +msgid "Return the set of CPUs the process with PID *pid* is restricted to." +msgstr "" + +#: ../../library/os.rst:5146 msgid "" -"Return the set of CPUs the process with PID *pid* (or the current process if " -"zero) is restricted to." +"If *pid* is zero, return the set of CPUs the calling thread of the current " +"process is restricted to." msgstr "" -#: ../../library/os.rst:5123 +#: ../../library/os.rst:5153 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5128 +#: ../../library/os.rst:5158 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 " @@ -5688,13 +5731,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5136 +#: ../../library/os.rst:5166 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5139 +#: ../../library/os.rst:5169 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 " @@ -5702,33 +5745,34 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5149 +#: ../../library/os.rst:5179 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:5158 +#: ../../library/os.rst:5188 msgid "" -"Return the number of CPUs in the system. Returns ``None`` if undetermined." +"Return the number of logical CPUs in the system. Returns ``None`` if " +"undetermined." msgstr "" -#: ../../library/os.rst:5160 +#: ../../library/os.rst:5191 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))``" +"This number is not equivalent to the number of logical CPUs the current " +"process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " +"CPUs the calling thread of the current process is restricted to" msgstr "" -#: ../../library/os.rst:5170 +#: ../../library/os.rst:5200 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:5179 +#: ../../library/os.rst:5209 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5781,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5189 +#: ../../library/os.rst:5219 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:5195 +#: ../../library/os.rst:5225 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5198 +#: ../../library/os.rst:5228 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5201 +#: ../../library/os.rst:5231 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5207 +#: ../../library/os.rst:5237 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:5215 +#: ../../library/os.rst:5245 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:5224 +#: ../../library/os.rst:5254 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5827,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5234 +#: ../../library/os.rst:5264 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5835,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5243 +#: ../../library/os.rst:5273 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:5251 +#: ../../library/os.rst:5281 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:5258 +#: ../../library/os.rst:5288 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:5265 +#: ../../library/os.rst:5295 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 " @@ -5820,36 +5864,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5274 +#: ../../library/os.rst:5304 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:5285 +#: ../../library/os.rst:5315 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:5293 +#: ../../library/os.rst:5323 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5298 +#: ../../library/os.rst:5328 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5301 +#: ../../library/os.rst:5331 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5304 +#: ../../library/os.rst:5334 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5901,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5309 +#: ../../library/os.rst:5339 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5313 +#: ../../library/os.rst:5343 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5316 +#: ../../library/os.rst:5346 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5322 +#: ../../library/os.rst:5352 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5324 +#: ../../library/os.rst:5354 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:5328 +#: ../../library/os.rst:5358 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5940,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5335 +#: ../../library/os.rst:5365 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:5339 +#: ../../library/os.rst:5369 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5342 +#: ../../library/os.rst:5372 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:5346 +#: ../../library/os.rst:5376 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5350 +#: ../../library/os.rst:5380 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:5354 +#: ../../library/os.rst:5384 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:5360 +#: ../../library/os.rst:5390 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5366 +#: ../../library/os.rst:5396 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:5370 +#: ../../library/os.rst:5400 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:5377 +#: ../../library/os.rst:5407 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +6012,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "process" msgstr "process" @@ -6054,48 +6098,48 @@ msgstr "" msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "killing" msgstr "" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5204 ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5270 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5204 ../../library/os.rst:5212 -#: ../../library/os.rst:5220 ../../library/os.rst:5231 -#: ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5242 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 +#: ../../library/os.rst:5270 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5212 +#: ../../library/os.rst:5242 msgid ".." msgstr ".." -#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pickletools.po b/library/pickletools.po index a767c0487e..8281a8533b 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -36,11 +36,11 @@ msgid "" "the :mod:`pickletools` module relevant." msgstr "" -#: ../../library/pickletools.rst:21 +#: ../../library/pickletools.rst:23 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" -#: ../../library/pickletools.rst:25 +#: ../../library/pickletools.rst:27 msgid "" "When invoked from the command line, ``python -m pickletools`` will " "disassemble the contents of one or more pickle files. Note that if you want " @@ -50,42 +50,42 @@ msgid "" "pickletools`` is a safer option because it does not execute pickle bytecode." msgstr "" -#: ../../library/pickletools.rst:33 +#: ../../library/pickletools.rst:35 msgid "For example, with a tuple ``(1, 2)`` pickled in file ``x.pickle``:" msgstr "" -#: ../../library/pickletools.rst:50 +#: ../../library/pickletools.rst:52 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/pickletools.rst:56 +#: ../../library/pickletools.rst:58 msgid "Annotate each line with a short opcode description." msgstr "" -#: ../../library/pickletools.rst:60 +#: ../../library/pickletools.rst:62 msgid "Name of a file where the output should be written." msgstr "" -#: ../../library/pickletools.rst:64 +#: ../../library/pickletools.rst:66 msgid "The number of blanks by which to indent a new MARK level." msgstr "" -#: ../../library/pickletools.rst:68 +#: ../../library/pickletools.rst:70 msgid "" "When multiple objects are disassembled, preserve memo between disassemblies." msgstr "" -#: ../../library/pickletools.rst:73 +#: ../../library/pickletools.rst:75 msgid "" "When more than one pickle file are specified, print given preamble before " "each disassembly." msgstr "" -#: ../../library/pickletools.rst:79 +#: ../../library/pickletools.rst:81 msgid "Programmatic Interface" msgstr "" -#: ../../library/pickletools.rst:84 +#: ../../library/pickletools.rst:86 msgid "" "Outputs a symbolic disassembly of the pickle to the file-like object *out*, " "defaulting to ``sys.stdout``. *pickle* can be a string or a file-like " @@ -98,11 +98,11 @@ msgid "" "where annotation should start." msgstr "" -#: ../../library/pickletools.rst:95 +#: ../../library/pickletools.rst:97 msgid "The *annotate* argument." msgstr "*annotate* 引數。" -#: ../../library/pickletools.rst:100 +#: ../../library/pickletools.rst:102 msgid "" "Provides an :term:`iterator` over all of the opcodes in a pickle, returning " "a sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of " @@ -111,7 +111,7 @@ msgid "" "is located. *pickle* can be a string or a file-like object." msgstr "" -#: ../../library/pickletools.rst:108 +#: ../../library/pickletools.rst:110 msgid "" "Returns a new equivalent pickle string after eliminating unused ``PUT`` " "opcodes. The optimized pickle is shorter, takes less transmission time, " diff --git a/library/profile.po b/library/profile.po index 220591bbab..16a0def997 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -175,42 +175,42 @@ msgid "" "formats them in various ways." msgstr "" -#: ../../library/profile.rst:124 +#: ../../library/profile.rst:126 msgid "" "The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script " "to profile another script. For example::" msgstr "" -#: ../../library/profile.rst:129 +#: ../../library/profile.rst:131 msgid "``-o`` writes the profile results to a file instead of to stdout" msgstr "" -#: ../../library/profile.rst:131 +#: ../../library/profile.rst:133 msgid "" "``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to " "sort the output by. This only applies when ``-o`` is not supplied." msgstr "" -#: ../../library/profile.rst:134 +#: ../../library/profile.rst:136 msgid "``-m`` specifies that a module is being profiled instead of a script." msgstr "" -#: ../../library/profile.rst:136 +#: ../../library/profile.rst:138 msgid "Added the ``-m`` option to :mod:`cProfile`." msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" -#: ../../library/profile.rst:139 +#: ../../library/profile.rst:141 msgid "Added the ``-m`` option to :mod:`profile`." msgstr "新增 ``-m`` 選項到 :mod:`profile`。" -#: ../../library/profile.rst:142 +#: ../../library/profile.rst:144 msgid "" "The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of " "methods for manipulating and printing the data saved into a profile results " "file::" msgstr "" -#: ../../library/profile.rst:150 +#: ../../library/profile.rst:152 msgid "" "The :meth:`~pstats.Stats.strip_dirs` method removed the extraneous path from " "all the module names. The :meth:`~pstats.Stats.sort_stats` method sorted all " @@ -219,44 +219,44 @@ msgid "" "statistics. You might try the following sort calls::" msgstr "" -#: ../../library/profile.rst:159 +#: ../../library/profile.rst:161 msgid "" "The first call will actually sort the list by function name, and the second " "call will print out the statistics. The following are some interesting " "calls to experiment with::" msgstr "" -#: ../../library/profile.rst:165 +#: ../../library/profile.rst:167 msgid "" "This sorts the profile by cumulative time in a function, and then only " "prints the ten most significant lines. If you want to understand what " "algorithms are taking time, the above line is what you would use." msgstr "" -#: ../../library/profile.rst:169 +#: ../../library/profile.rst:171 msgid "" "If you were looking to see what functions were looping a lot, and taking a " "lot of time, you would do::" msgstr "" -#: ../../library/profile.rst:174 +#: ../../library/profile.rst:176 msgid "" "to sort according to time spent within each function, and then print the " "statistics for the top ten functions." msgstr "" -#: ../../library/profile.rst:177 +#: ../../library/profile.rst:179 msgid "You might also try::" msgstr "" -#: ../../library/profile.rst:181 +#: ../../library/profile.rst:183 msgid "" "This will sort all the statistics by file name, and then print out " "statistics for only the class init methods (since they are spelled with " "``__init__`` in them). As one final example, you could try::" msgstr "" -#: ../../library/profile.rst:187 +#: ../../library/profile.rst:189 msgid "" "This line sorts statistics with a primary key of time, and a secondary key " "of cumulative time, and then prints out some of the statistics. To be " @@ -265,46 +265,46 @@ msgid "" "list is printed." msgstr "" -#: ../../library/profile.rst:192 +#: ../../library/profile.rst:194 msgid "" "If you wondered what functions called the above functions, you could now " "(``p`` is still sorted according to the last criteria) do::" msgstr "" -#: ../../library/profile.rst:197 +#: ../../library/profile.rst:199 msgid "and you would get a list of callers for each of the listed functions." msgstr "" -#: ../../library/profile.rst:199 +#: ../../library/profile.rst:201 msgid "" "If you want more functionality, you're going to have to read the manual, or " "guess what the following functions do::" msgstr "" -#: ../../library/profile.rst:205 +#: ../../library/profile.rst:207 msgid "" "Invoked as a script, the :mod:`pstats` module is a statistics browser for " "reading and examining profile dumps. It has a simple line-oriented " "interface (implemented using :mod:`cmd`) and interactive help." msgstr "" -#: ../../library/profile.rst:210 +#: ../../library/profile.rst:212 msgid ":mod:`profile` and :mod:`cProfile` Module Reference" msgstr "" -#: ../../library/profile.rst:216 +#: ../../library/profile.rst:218 msgid "" "Both the :mod:`profile` and :mod:`cProfile` modules provide the following " "functions:" msgstr "" -#: ../../library/profile.rst:221 +#: ../../library/profile.rst:223 msgid "" "This function takes a single argument that can be passed to the :func:`exec` " "function, and an optional file name. In all cases this routine executes::" msgstr "" -#: ../../library/profile.rst:226 +#: ../../library/profile.rst:228 msgid "" "and gathers profiling statistics from the execution. If no file name is " "present, then this function automatically creates a :class:`~pstats.Stats` " @@ -313,24 +313,24 @@ msgid "" "how the results are sorted." msgstr "" -#: ../../library/profile.rst:234 +#: ../../library/profile.rst:236 msgid "" "This function is similar to :func:`run`, with added arguments to supply the " "globals and locals dictionaries for the *command* string. This routine " "executes::" msgstr "" -#: ../../library/profile.rst:240 +#: ../../library/profile.rst:242 msgid "and gathers profiling statistics as in the :func:`run` function above." msgstr "" -#: ../../library/profile.rst:244 +#: ../../library/profile.rst:246 msgid "" "This class is normally only used if more precise control over profiling is " "needed than what the :func:`cProfile.run` function provides." msgstr "" -#: ../../library/profile.rst:247 +#: ../../library/profile.rst:249 msgid "" "A custom timer can be supplied for measuring how long code takes to run via " "the *timer* argument. This must be a function that returns a single number " @@ -340,61 +340,61 @@ msgid "" "time unit would be ``.001``." msgstr "" -#: ../../library/profile.rst:254 +#: ../../library/profile.rst:256 msgid "" "Directly using the :class:`Profile` class allows formatting profile results " "without writing the profile data to a file::" msgstr "" -#: ../../library/profile.rst:269 +#: ../../library/profile.rst:271 msgid "" "The :class:`Profile` class can also be used as a context manager (supported " "only in :mod:`cProfile` module. see :ref:`typecontextmanager`)::" msgstr "" -#: ../../library/profile.rst:279 +#: ../../library/profile.rst:281 msgid "Added context manager support." msgstr "新增情境管理器的支援。" -#: ../../library/profile.rst:284 +#: ../../library/profile.rst:286 msgid "Start collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:288 +#: ../../library/profile.rst:290 msgid "Stop collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:292 +#: ../../library/profile.rst:294 msgid "" "Stop collecting profiling data and record the results internally as the " "current profile." msgstr "" -#: ../../library/profile.rst:297 +#: ../../library/profile.rst:299 msgid "" "Create a :class:`~pstats.Stats` object based on the current profile and " "print the results to stdout." msgstr "" -#: ../../library/profile.rst:302 +#: ../../library/profile.rst:304 msgid "Write the results of the current profile to *filename*." msgstr "" -#: ../../library/profile.rst:306 +#: ../../library/profile.rst:308 msgid "Profile the cmd via :func:`exec`." msgstr "" -#: ../../library/profile.rst:310 +#: ../../library/profile.rst:312 msgid "" "Profile the cmd via :func:`exec` with the specified global and local " "environment." msgstr "" -#: ../../library/profile.rst:315 +#: ../../library/profile.rst:317 msgid "Profile ``func(*args, **kwargs)``" msgstr "" -#: ../../library/profile.rst:317 +#: ../../library/profile.rst:319 msgid "" "Note that profiling will only work if the called command/function actually " "returns. If the interpreter is terminated (e.g. via a :func:`sys.exit` call " @@ -402,23 +402,23 @@ msgid "" "printed." msgstr "" -#: ../../library/profile.rst:325 +#: ../../library/profile.rst:327 msgid "The :class:`Stats` Class" msgstr "" -#: ../../library/profile.rst:327 +#: ../../library/profile.rst:329 msgid "" "Analysis of the profiler data is done using the :class:`~pstats.Stats` class." msgstr "" -#: ../../library/profile.rst:334 +#: ../../library/profile.rst:336 msgid "" "This class constructor creates an instance of a \"statistics object\" from a " "*filename* (or list of filenames) or from a :class:`Profile` instance. " "Output will be printed to the stream specified by *stream*." msgstr "" -#: ../../library/profile.rst:338 +#: ../../library/profile.rst:340 msgid "" "The file selected by the above constructor must have been created by the " "corresponding version of :mod:`profile` or :mod:`cProfile`. To be specific, " @@ -432,17 +432,17 @@ msgid "" "can be used." msgstr "" -#: ../../library/profile.rst:349 +#: ../../library/profile.rst:351 msgid "" "Instead of reading the profile data from a file, a :class:`cProfile.Profile` " "or :class:`profile.Profile` object can be used as the profile data source." msgstr "" -#: ../../library/profile.rst:352 +#: ../../library/profile.rst:354 msgid ":class:`Stats` objects have the following methods:" msgstr "" -#: ../../library/profile.rst:356 +#: ../../library/profile.rst:358 msgid "" "This method for the :class:`Stats` class removes all leading path " "information from file names. It is very useful in reducing the size of the " @@ -456,7 +456,7 @@ msgid "" "single entry." msgstr "" -#: ../../library/profile.rst:370 +#: ../../library/profile.rst:372 msgid "" "This method of the :class:`Stats` class accumulates additional profiling " "information into the current profiling object. Its arguments should refer " @@ -465,7 +465,7 @@ msgid "" "functions are automatically accumulated into single function statistics." msgstr "" -#: ../../library/profile.rst:380 +#: ../../library/profile.rst:382 msgid "" "Save the data loaded into the :class:`Stats` object to a file named " "*filename*. The file is created if it does not exist, and is overwritten if " @@ -473,7 +473,7 @@ msgid "" "the :class:`profile.Profile` and :class:`cProfile.Profile` classes." msgstr "" -#: ../../library/profile.rst:388 +#: ../../library/profile.rst:390 msgid "" "This method modifies the :class:`Stats` object by sorting it according to " "the supplied criteria. The argument can be either a string or a SortKey " @@ -483,7 +483,7 @@ msgid "" "prone." msgstr "" -#: ../../library/profile.rst:395 +#: ../../library/profile.rst:397 msgid "" "When more than one key is provided, then additional keys are used as " "secondary criteria when there is equality in all keys selected before them. " @@ -492,164 +492,164 @@ msgid "" "function names) by sorting by file name." msgstr "" -#: ../../library/profile.rst:401 +#: ../../library/profile.rst:403 msgid "" "For the string argument, abbreviations can be used for any key names, as " "long as the abbreviation is unambiguous." msgstr "" -#: ../../library/profile.rst:404 +#: ../../library/profile.rst:406 msgid "The following are the valid string and SortKey:" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid String Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid enum Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Meaning" msgstr "" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "``'calls'``" msgstr "``'calls'``" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "SortKey.CALLS" msgstr "SortKey.CALLS" -#: ../../library/profile.rst:409 ../../library/profile.rst:421 +#: ../../library/profile.rst:411 ../../library/profile.rst:423 msgid "call count" msgstr "" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "``'cumulative'``" msgstr "``'cumulative'``" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "SortKey.CUMULATIVE" msgstr "SortKey.CUMULATIVE" -#: ../../library/profile.rst:411 ../../library/profile.rst:413 +#: ../../library/profile.rst:413 ../../library/profile.rst:415 msgid "cumulative time" msgstr "" -#: ../../library/profile.rst:413 +#: ../../library/profile.rst:415 msgid "``'cumtime'``" msgstr "``'cumtime'``" -#: ../../library/profile.rst:413 ../../library/profile.rst:415 -#: ../../library/profile.rst:419 ../../library/profile.rst:421 -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:415 ../../library/profile.rst:417 +#: ../../library/profile.rst:421 ../../library/profile.rst:423 +#: ../../library/profile.rst:437 msgid "N/A" msgstr "N/A" -#: ../../library/profile.rst:415 +#: ../../library/profile.rst:417 msgid "``'file'``" msgstr "``'file'``" -#: ../../library/profile.rst:415 ../../library/profile.rst:417 -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:417 ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "file name" msgstr "file name(檔案名稱)" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "``'filename'``" msgstr "``'filename'``" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "SortKey.FILENAME" msgstr "SortKey.FILENAME" -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "``'module'``" msgstr "``'module'``" -#: ../../library/profile.rst:421 +#: ../../library/profile.rst:423 msgid "``'ncalls'``" msgstr "``'ncalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "``'pcalls'``" msgstr "``'pcalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "SortKey.PCALLS" msgstr "SortKey.PCALLS" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "primitive call count" msgstr "" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "SortKey.LINE" msgstr "SortKey.LINE" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "line number" msgstr "" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "``'name'``" msgstr "``'name'``" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "SortKey.NAME" msgstr "SortKey.NAME" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "function name" msgstr "" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "``'nfl'``" msgstr "``'nfl'``" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "SortKey.NFL" msgstr "SortKey.NFL" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "name/file/line" msgstr "" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "``'stdname'``" msgstr "``'stdname'``" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "SortKey.STDNAME" msgstr "SortKey.STDNAME" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "standard name" msgstr "" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "``'time'``" msgstr "``'time'``" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "SortKey.TIME" msgstr "SortKey.TIME" -#: ../../library/profile.rst:433 ../../library/profile.rst:435 +#: ../../library/profile.rst:435 ../../library/profile.rst:437 msgid "internal time" msgstr "" -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:437 msgid "``'tottime'``" msgstr "``'tottime'``" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:440 msgid "" "Note that all sorts on statistics are in descending order (placing most time " "consuming items first), where as name, file, and line number searches are in " @@ -663,7 +663,7 @@ msgid "" "SortKey.FILENAME, SortKey.LINE)``." msgstr "" -#: ../../library/profile.rst:449 +#: ../../library/profile.rst:451 msgid "" "For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, " "``1``, and ``2`` are permitted. They are interpreted as ``'stdname'``, " @@ -672,31 +672,31 @@ msgid "" "used, and additional arguments will be silently ignored." msgstr "" -#: ../../library/profile.rst:457 +#: ../../library/profile.rst:459 msgid "Added the SortKey enum." msgstr "" -#: ../../library/profile.rst:462 +#: ../../library/profile.rst:464 msgid "" "This method for the :class:`Stats` class reverses the ordering of the basic " "list within the object. Note that by default ascending vs descending order " "is properly selected based on the sort key of choice." msgstr "" -#: ../../library/profile.rst:472 +#: ../../library/profile.rst:474 msgid "" "This method for the :class:`Stats` class prints out a report as described in " "the :func:`profile.run` definition." msgstr "" -#: ../../library/profile.rst:475 +#: ../../library/profile.rst:477 msgid "" "The order of the printing is based on the last :meth:`~pstats.Stats." "sort_stats` operation done on the object (subject to caveats in :meth:" "`~pstats.Stats.add` and :meth:`~pstats.Stats.strip_dirs`)." msgstr "" -#: ../../library/profile.rst:480 +#: ../../library/profile.rst:482 msgid "" "The arguments provided (if any) can be used to limit the list down to the " "significant entries. Initially, the list is taken to be the complete set of " @@ -708,20 +708,20 @@ msgid "" "example::" msgstr "" -#: ../../library/profile.rst:491 +#: ../../library/profile.rst:493 msgid "" "would first limit the printing to first 10% of list, and then only print " "functions that were part of filename :file:`.\\*foo:`. In contrast, the " "command::" msgstr "" -#: ../../library/profile.rst:497 +#: ../../library/profile.rst:499 msgid "" "would limit the list to all functions having file names :file:`.\\*foo:`, " "and then proceed to only print the first 10% of them." msgstr "" -#: ../../library/profile.rst:503 +#: ../../library/profile.rst:505 msgid "" "This method for the :class:`Stats` class prints a list of all functions that " "called each function in the profiled database. The ordering is identical to " @@ -731,7 +731,7 @@ msgid "" "produced the stats:" msgstr "" -#: ../../library/profile.rst:510 +#: ../../library/profile.rst:512 msgid "" "With :mod:`profile`, a number is shown in parentheses after each caller to " "show how many times this specific call was made. For convenience, a second " @@ -739,14 +739,14 @@ msgid "" "at the right." msgstr "" -#: ../../library/profile.rst:515 +#: ../../library/profile.rst:517 msgid "" "With :mod:`cProfile`, each caller is preceded by three numbers: the number " "of times this specific call was made, and the total and cumulative times " "spent in the current function while it was invoked by this specific caller." msgstr "" -#: ../../library/profile.rst:523 +#: ../../library/profile.rst:525 msgid "" "This method for the :class:`Stats` class prints a list of all function that " "were called by the indicated function. Aside from this reversal of " @@ -754,7 +754,7 @@ msgid "" "are identical to the :meth:`~pstats.Stats.print_callers` method." msgstr "" -#: ../../library/profile.rst:531 +#: ../../library/profile.rst:533 msgid "" "This method returns an instance of StatsProfile, which contains a mapping of " "function names to instances of FunctionProfile. Each FunctionProfile " @@ -762,17 +762,17 @@ msgid "" "long the function took to run, how many times it was called, etc..." msgstr "" -#: ../../library/profile.rst:536 +#: ../../library/profile.rst:538 msgid "" "Added the following dataclasses: StatsProfile, FunctionProfile. Added the " "following function: get_stats_profile." msgstr "" -#: ../../library/profile.rst:543 +#: ../../library/profile.rst:545 msgid "What Is Deterministic Profiling?" msgstr "" -#: ../../library/profile.rst:545 +#: ../../library/profile.rst:547 msgid "" ":dfn:`Deterministic profiling` is meant to reflect the fact that all " "*function call*, *function return*, and *exception* events are monitored, " @@ -785,7 +785,7 @@ msgid "" "being spent." msgstr "" -#: ../../library/profile.rst:554 +#: ../../library/profile.rst:556 msgid "" "In Python, since there is an interpreter active during execution, the " "presence of instrumented code is not required in order to do deterministic " @@ -797,7 +797,7 @@ msgid "" "time statistics about the execution of a Python program." msgstr "" -#: ../../library/profile.rst:563 +#: ../../library/profile.rst:565 msgid "" "Call count statistics can be used to identify bugs in code (surprising " "counts), and to identify possible inline-expansion points (high call " @@ -809,11 +809,11 @@ msgid "" "compared to iterative implementations." msgstr "" -#: ../../library/profile.rst:576 +#: ../../library/profile.rst:578 msgid "Limitations" msgstr "限制" -#: ../../library/profile.rst:578 +#: ../../library/profile.rst:580 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -824,7 +824,7 @@ msgid "" "first error induces a second source of error." msgstr "" -#: ../../library/profile.rst:586 +#: ../../library/profile.rst:588 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -837,7 +837,7 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" -#: ../../library/profile.rst:596 +#: ../../library/profile.rst:598 msgid "" "The problem is more important with :mod:`profile` than with the lower-" "overhead :mod:`cProfile`. For this reason, :mod:`profile` provides a means " @@ -851,11 +851,11 @@ msgid "" "calibration." msgstr "" -#: ../../library/profile.rst:610 +#: ../../library/profile.rst:612 msgid "Calibration" msgstr "校正" -#: ../../library/profile.rst:612 +#: ../../library/profile.rst:614 msgid "" "The profiler of the :mod:`profile` module subtracts a constant from each " "event handling time to compensate for the overhead of calling the time " @@ -864,7 +864,7 @@ msgid "" "platform (see :ref:`profile-limitations`). ::" msgstr "" -#: ../../library/profile.rst:623 +#: ../../library/profile.rst:625 msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " @@ -874,48 +874,48 @@ msgid "" "4.04e-6." msgstr "" -#: ../../library/profile.rst:629 +#: ../../library/profile.rst:631 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -#: ../../library/profile.rst:633 +#: ../../library/profile.rst:635 msgid "" "When you have a consistent answer, there are three ways you can use it::" msgstr "" -#: ../../library/profile.rst:647 +#: ../../library/profile.rst:649 msgid "" "If you have a choice, you are better off choosing a smaller constant, and " "then your results will \"less often\" show up as negative in profile " "statistics." msgstr "" -#: ../../library/profile.rst:653 +#: ../../library/profile.rst:655 msgid "Using a custom timer" msgstr "" -#: ../../library/profile.rst:655 +#: ../../library/profile.rst:657 msgid "" "If you want to change how current time is determined (for example, to force " "use of wall-clock time or elapsed process time), pass the timing function " "you want to the :class:`Profile` class constructor::" msgstr "" -#: ../../library/profile.rst:661 +#: ../../library/profile.rst:663 msgid "" "The resulting profiler will then call ``your_time_func``. Depending on " "whether you are using :class:`profile.Profile` or :class:`cProfile.Profile`, " "``your_time_func``'s return value will be interpreted differently:" msgstr "" -#: ../../library/profile.rst:679 +#: ../../library/profile.rst:681 msgid ":class:`profile.Profile`" msgstr ":class:`profile.Profile`" -#: ../../library/profile.rst:666 +#: ../../library/profile.rst:668 msgid "" "``your_time_func`` should return a single number, or a list of numbers whose " "sum is the current time (like what :func:`os.times` returns). If the " @@ -924,7 +924,7 @@ msgid "" "routine." msgstr "" -#: ../../library/profile.rst:672 +#: ../../library/profile.rst:674 msgid "" "Be warned that you should calibrate the profiler class for the timer " "function that you choose (see :ref:`profile-calibration`). For most " @@ -936,11 +936,11 @@ msgid "" "along with the appropriate calibration constant." msgstr "" -#: ../../library/profile.rst:693 +#: ../../library/profile.rst:695 msgid ":class:`cProfile.Profile`" msgstr ":class:`cProfile.Profile`" -#: ../../library/profile.rst:682 +#: ../../library/profile.rst:684 msgid "" "``your_time_func`` should return a single number. If it returns integers, " "you can also invoke the class constructor with a second argument specifying " @@ -949,7 +949,7 @@ msgid "" "you would construct the :class:`Profile` instance as follows::" msgstr "" -#: ../../library/profile.rst:690 +#: ../../library/profile.rst:692 msgid "" "As the :class:`cProfile.Profile` class cannot be calibrated, custom timer " "functions should be used with care and should be as fast as possible. For " @@ -957,7 +957,7 @@ msgid "" "in the C source of the internal :mod:`_lsprof` module." msgstr "" -#: ../../library/profile.rst:695 +#: ../../library/profile.rst:697 msgid "" "Python 3.3 adds several new functions in :mod:`time` that can be used to " "make precise measurements of process or wall-clock time. For example, see :" diff --git a/library/py_compile.po b/library/py_compile.po index 9d9d843043..f13e31e720 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/py_compile.rst:2 msgid ":mod:`py_compile` --- Compile Python source files" -msgstr "" +msgstr ":mod:`py_compile` — 編譯 Python 來源檔案" #: ../../library/py_compile.rst:10 msgid "**Source code:** :source:`Lib/py_compile.py`" @@ -168,11 +167,11 @@ msgid "" "external to Python like a build system." msgstr "" -#: ../../library/py_compile.rst:130 +#: ../../library/py_compile.rst:131 msgid "Command-Line Interface" msgstr "" -#: ../../library/py_compile.rst:132 +#: ../../library/py_compile.rst:133 msgid "" "This module can be invoked as a script to compile several source files. The " "files named in *filenames* are compiled and the resulting bytecode is cached " @@ -181,29 +180,29 @@ msgid "" "status is nonzero if one of the files could not be compiled." msgstr "" -#: ../../library/py_compile.rst:144 +#: ../../library/py_compile.rst:145 msgid "" "Positional arguments are files to compile. If ``-`` is the only parameter, " "the list of files is taken from standard input." msgstr "" -#: ../../library/py_compile.rst:149 +#: ../../library/py_compile.rst:150 msgid "Suppress errors output." msgstr "" -#: ../../library/py_compile.rst:151 +#: ../../library/py_compile.rst:152 msgid "Added support for ``-``." msgstr "新增對 ``-`` 的支援。" -#: ../../library/py_compile.rst:154 +#: ../../library/py_compile.rst:155 msgid "Added support for :option:`-q`." msgstr "新增對 :option:`-q` 的支援。" -#: ../../library/py_compile.rst:160 +#: ../../library/py_compile.rst:161 msgid "Module :mod:`compileall`" msgstr ":mod:`compileall` 模組" -#: ../../library/py_compile.rst:161 +#: ../../library/py_compile.rst:162 msgid "Utilities to compile all Python source files in a directory tree." msgstr "" diff --git a/library/re.po b/library/re.po index 9a3cea8d64..30f305d70d 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -935,8 +935,9 @@ msgstr "" #: ../../library/re.rst:662 msgid "" -"The ``'\\N{name}'`` escape sequence has been added. As in string literals, " -"it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." +"The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " +"string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " +"DASH}'``)." msgstr "" #: ../../library/re.rst:670 diff --git a/library/shutil.po b/library/shutil.po index 9a21435530..252cdd980b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -617,18 +617,25 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:481 +#: ../../library/shutil.rst:479 +msgid "" +"On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " +"``PATHEXT`` will be preferred over executables without a matching extension. " +"This brings behavior closer to that of Python 3.11." +msgstr "" + +#: ../../library/shutil.rst:487 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:488 +#: ../../library/shutil.rst:494 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:490 +#: ../../library/shutil.rst:496 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -638,51 +645,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:498 +#: ../../library/shutil.rst:504 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:500 +#: ../../library/shutil.rst:506 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:508 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:506 +#: ../../library/shutil.rst:512 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:515 +#: ../../library/shutil.rst:521 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:523 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:523 +#: ../../library/shutil.rst:529 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:526 +#: ../../library/shutil.rst:532 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:541 +#: ../../library/shutil.rst:547 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:549 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 onexc callback to clear " @@ -690,25 +697,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:567 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:571 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:575 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:574 +#: ../../library/shutil.rst:580 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:576 +#: ../../library/shutil.rst:582 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 " @@ -717,14 +724,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:588 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:586 +#: ../../library/shutil.rst:592 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. " @@ -732,33 +739,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:592 +#: ../../library/shutil.rst:598 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:600 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:597 +#: ../../library/shutil.rst:603 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:600 +#: ../../library/shutil.rst:606 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:609 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:605 +#: ../../library/shutil.rst:611 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -766,7 +773,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:615 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -774,60 +781,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:621 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:619 +#: ../../library/shutil.rst:625 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:631 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:628 ../../library/shutil.rst:739 +#: ../../library/shutil.rst:634 ../../library/shutil.rst:745 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:630 +#: ../../library/shutil.rst:636 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:637 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:632 ../../library/shutil.rst:744 +#: ../../library/shutil.rst:638 ../../library/shutil.rst:750 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:633 ../../library/shutil.rst:745 +#: ../../library/shutil.rst:639 ../../library/shutil.rst:751 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:634 ../../library/shutil.rst:746 +#: ../../library/shutil.rst:640 ../../library/shutil.rst:752 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:636 +#: ../../library/shutil.rst:642 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:642 +#: ../../library/shutil.rst:648 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:644 +#: ../../library/shutil.rst:650 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 " @@ -836,7 +843,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:650 +#: ../../library/shutil.rst:656 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -845,37 +852,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:662 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:659 +#: ../../library/shutil.rst:665 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:662 +#: ../../library/shutil.rst:668 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:674 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:679 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:675 +#: ../../library/shutil.rst:681 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:678 +#: ../../library/shutil.rst:684 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -884,7 +891,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:691 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -894,7 +901,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:693 +#: ../../library/shutil.rst:699 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -902,7 +909,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:697 +#: ../../library/shutil.rst:703 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -910,138 +917,138 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:708 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:705 +#: ../../library/shutil.rst:711 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:716 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:714 +#: ../../library/shutil.rst:720 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:717 +#: ../../library/shutil.rst:723 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:718 +#: ../../library/shutil.rst:724 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:725 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:721 +#: ../../library/shutil.rst:727 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:730 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:730 +#: ../../library/shutil.rst:736 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:735 +#: ../../library/shutil.rst:741 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:741 +#: ../../library/shutil.rst:747 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:743 +#: ../../library/shutil.rst:749 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:748 +#: ../../library/shutil.rst:754 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:755 +#: ../../library/shutil.rst:761 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:757 +#: ../../library/shutil.rst:763 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:767 +#: ../../library/shutil.rst:773 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:785 +#: ../../library/shutil.rst:791 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:787 +#: ../../library/shutil.rst:793 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:801 +#: ../../library/shutil.rst:807 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:815 +#: ../../library/shutil.rst:821 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:825 +#: ../../library/shutil.rst:831 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:829 +#: ../../library/shutil.rst:835 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:831 +#: ../../library/shutil.rst:837 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:835 +#: ../../library/shutil.rst:841 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:839 +#: ../../library/shutil.rst:845 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 " @@ -1050,17 +1057,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:845 +#: ../../library/shutil.rst:851 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:847 +#: ../../library/shutil.rst:853 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:858 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/site.po b/library/site.po index 8e1b8bb8fc..df42298966 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -39,7 +39,7 @@ msgid "" "path and add a few builtins, unless :option:`-S` was used. In that case, " "this module can be safely imported with no automatic modifications to the " "module search path or additions to the builtins. To explicitly trigger the " -"usual site-specific additions, call the :func:`site.main` function." +"usual site-specific additions, call the :func:`main` function." msgstr "" #: ../../library/site.rst:24 @@ -128,43 +128,52 @@ msgid "" "because it is not mentioned in either path configuration file." msgstr "" -#: ../../library/site.rst:114 +#: ../../library/site.rst:113 +msgid ":mod:`sitecustomize`" +msgstr ":mod:`sitecustomize`" + +#: ../../library/site.rst:117 msgid "" "After these path manipulations, an attempt is made to import a module named :" "mod:`sitecustomize`, which can perform arbitrary site-specific " "customizations. It is typically created by a system administrator in the " "site-packages directory. If this import fails with an :exc:`ImportError` or " -"its subclass exception, and the exception's :attr:`name` attribute equals to " -"``'sitecustomize'``, it is silently ignored. If Python is started without " -"output streams available, as with :file:`pythonw.exe` on Windows (which is " -"used by default to start IDLE), attempted output from :mod:`sitecustomize` " -"is ignored. Any other exception causes a silent and perhaps mysterious " -"failure of the process." +"its subclass exception, and the exception's :attr:`~ImportError.name` " +"attribute equals to ``'sitecustomize'``, it is silently ignored. If Python " +"is started without output streams available, as with :file:`pythonw.exe` on " +"Windows (which is used by default to start IDLE), attempted output from :mod:" +"`sitecustomize` is ignored. Any other exception causes a silent and perhaps " +"mysterious failure of the process." msgstr "" -#: ../../library/site.rst:126 +#: ../../library/site.rst:129 +msgid ":mod:`usercustomize`" +msgstr ":mod:`usercustomize`" + +#: ../../library/site.rst:133 msgid "" "After this, an attempt is made to import a module named :mod:" "`usercustomize`, which can perform arbitrary user-specific customizations, " -"if :data:`ENABLE_USER_SITE` is true. This file is intended to be created in " -"the user site-packages directory (see below), which is part of ``sys.path`` " -"unless disabled by :option:`-s`. If this import fails with an :exc:" -"`ImportError` or its subclass exception, and the exception's :attr:`name` " -"attribute equals to ``'usercustomize'``, it is silently ignored." +"if :data:`~site.ENABLE_USER_SITE` is true. This file is intended to be " +"created in the user site-packages directory (see below), which is part of " +"``sys.path`` unless disabled by :option:`-s`. If this import fails with an :" +"exc:`ImportError` or its subclass exception, and the exception's :attr:" +"`~ImportError.name` attribute equals to ``'usercustomize'``, it is silently " +"ignored." msgstr "" -#: ../../library/site.rst:134 +#: ../../library/site.rst:141 msgid "" "Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` " "are empty, and the path manipulations are skipped; however the import of :" "mod:`sitecustomize` and :mod:`usercustomize` is still attempted." msgstr "" -#: ../../library/site.rst:142 +#: ../../library/site.rst:150 msgid "Readline configuration" msgstr "" -#: ../../library/site.rst:144 +#: ../../library/site.rst:152 msgid "" "On systems that support :mod:`readline`, this module will also import and " "configure the :mod:`rlcompleter` module, if Python is started in :ref:" @@ -176,19 +185,19 @@ msgid "" "`PYTHONSTARTUP` file." msgstr "" -#: ../../library/site.rst:153 +#: ../../library/site.rst:161 msgid "Activation of rlcompleter and history was made automatic." msgstr "" -#: ../../library/site.rst:158 +#: ../../library/site.rst:166 msgid "Module contents" msgstr "模組內容" -#: ../../library/site.rst:162 +#: ../../library/site.rst:170 msgid "A list of prefixes for site-packages directories." msgstr "" -#: ../../library/site.rst:167 +#: ../../library/site.rst:175 msgid "" "Flag showing the status of the user site-packages directory. ``True`` means " "that it is enabled and was added to ``sys.path``. ``False`` means that it " @@ -197,7 +206,7 @@ msgid "" "(mismatch between user or group id and effective id) or by an administrator." msgstr "" -#: ../../library/site.rst:177 +#: ../../library/site.rst:185 msgid "" "Path to the user site-packages for the running Python. Can be ``None`` if :" "func:`getusersitepackages` hasn't been called yet. Default value is :file:" @@ -208,46 +217,46 @@ msgid "" "file:`.pth` files in it will be processed." msgstr "" -#: ../../library/site.rst:188 +#: ../../library/site.rst:196 msgid "" "Path to the base directory for the user site-packages. Can be ``None`` if :" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." "local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" "` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " "Windows. This value is used to compute the installation directories for " -"scripts, data files, Python modules, etc. for the user installation scheme. " -"See also :envvar:`PYTHONUSERBASE`." +"scripts, data files, Python modules, etc. for the :ref:`user installation " +"scheme `. See also :envvar:`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:200 +#: ../../library/site.rst:208 msgid "" "Adds all the standard site-specific directories to the module search path. " "This function is called automatically when this module is imported, unless " "the Python interpreter was started with the :option:`-S` flag." msgstr "" -#: ../../library/site.rst:204 +#: ../../library/site.rst:212 msgid "This function used to be called unconditionally." msgstr "" -#: ../../library/site.rst:210 +#: ../../library/site.rst:218 msgid "" "Add a directory to sys.path and process its :file:`.pth` files. Typically " "used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." msgstr "" -#: ../../library/site.rst:216 +#: ../../library/site.rst:224 msgid "Return a list containing all global site-packages directories." msgstr "" -#: ../../library/site.rst:223 +#: ../../library/site.rst:231 msgid "" "Return the path of the user base directory, :data:`USER_BASE`. If it is not " "initialized yet, this function will also set it, respecting :envvar:" "`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:232 +#: ../../library/site.rst:240 msgid "" "Return the path of the user-specific site-packages directory, :data:" "`USER_SITE`. If it is not initialized yet, this function will also set it, " @@ -255,17 +264,17 @@ msgid "" "packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." msgstr "" -#: ../../library/site.rst:244 +#: ../../library/site.rst:252 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/site.rst:248 +#: ../../library/site.rst:256 msgid "" "The :mod:`site` module also provides a way to get the user directories from " "the command line:" msgstr "" -#: ../../library/site.rst:256 +#: ../../library/site.rst:264 msgid "" "If it is called without arguments, it will print the contents of :data:`sys." "path` on the standard output, followed by the value of :data:`USER_BASE` and " @@ -273,21 +282,21 @@ msgid "" "finally the value of :data:`ENABLE_USER_SITE`." msgstr "" -#: ../../library/site.rst:263 +#: ../../library/site.rst:271 msgid "Print the path to the user base directory." msgstr "" -#: ../../library/site.rst:267 +#: ../../library/site.rst:275 msgid "Print the path to the user site-packages directory." msgstr "" -#: ../../library/site.rst:269 +#: ../../library/site.rst:277 msgid "" "If both options are given, user base and user site will be printed (always " "in this order), separated by :data:`os.pathsep`." msgstr "" -#: ../../library/site.rst:272 +#: ../../library/site.rst:280 msgid "" "If any option is given, the script will exit with one of these values: ``0`` " "if the user site-packages directory is enabled, ``1`` if it was disabled by " @@ -295,16 +304,15 @@ msgid "" "administrator, and a value greater than 2 if there is an error." msgstr "" -#: ../../library/site.rst:279 +#: ../../library/site.rst:287 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" -#: ../../library/site.rst:280 +#: ../../library/site.rst:288 msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." msgstr "" -#: ../../library/site.rst:16 ../../library/site.rst:112 -#: ../../library/site.rst:124 +#: ../../library/site.rst:16 msgid "module" msgstr "module(模組)" @@ -351,11 +359,3 @@ msgstr "configuration(設定)" #: ../../library/site.rst:77 msgid "file" msgstr "file(檔案)" - -#: ../../library/site.rst:112 -msgid "sitecustomize" -msgstr "sitecustomize" - -#: ../../library/site.rst:124 -msgid "usercustomize" -msgstr "usercustomize" diff --git a/library/socket.po b/library/socket.po index 6ef99f085a..1c2482488b 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2313,7 +2313,7 @@ msgid "" "and IPv6. The server side will listen to the first address family available " "(it should listen to both instead). On most of IPv6-ready systems, IPv6 will " "take precedence and the server may not accept IPv4 traffic. The client side " -"will try to connect to the all addresses returned as a result of the name " +"will try to connect to all the addresses returned as a result of the name " "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" diff --git a/library/socketserver.po b/library/socketserver.po index 6502379140..b4a24654b3 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -152,41 +152,47 @@ msgid "" "available on POSIX platforms that support :func:`~os.fork`." msgstr "" -#: ../../library/socketserver.rst:119 +#: ../../library/socketserver.rst:121 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` waits until all child " -"processes complete, except if :attr:`socketserver.ForkingMixIn." -"block_on_close` attribute is false." +":meth:`ForkingMixIn.server_close ` waits until all " +"child processes complete, except if :attr:`block_on_close` attribute is " +"``False``." msgstr "" -#: ../../library/socketserver.rst:123 +#: ../../library/socketserver.rst:125 msgid "" -":meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon " -"threads complete, except if :attr:`socketserver.ThreadingMixIn." -"block_on_close` attribute is false. Use daemonic threads by setting :data:" -"`ThreadingMixIn.daemon_threads` to ``True`` to not wait until threads " -"complete." +":meth:`ThreadingMixIn.server_close ` waits until " +"all non-daemon threads complete, except if :attr:`block_on_close` attribute " +"is ``False``." msgstr "" -#: ../../library/socketserver.rst:132 +#: ../../library/socketserver.rst:131 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` and :meth:`socketserver." -"ThreadingMixIn.server_close` now waits until all child processes and non-" -"daemonic threads complete. Add a new :attr:`socketserver.ForkingMixIn." -"block_on_close` class attribute to opt-in for the pre-3.7 behaviour." +"For :class:`ThreadingMixIn` use daemonic threads by setting :data:" +"`ThreadingMixIn.daemon_threads ` to ``True`` to not wait " +"until threads complete." msgstr "" -#: ../../library/socketserver.rst:148 +#: ../../library/socketserver.rst:137 +msgid "" +":meth:`ForkingMixIn.server_close ` and :meth:" +"`ThreadingMixIn.server_close ` now waits until all " +"child processes and non-daemonic threads complete. Add a new :attr:" +"`ForkingMixIn.block_on_close ` class attribute to opt-in for " +"the pre-3.7 behaviour." +msgstr "" + +#: ../../library/socketserver.rst:153 msgid "These classes are pre-defined using the mix-in classes." msgstr "" -#: ../../library/socketserver.rst:150 +#: ../../library/socketserver.rst:155 msgid "" "The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes " "were added." msgstr "" -#: ../../library/socketserver.rst:154 +#: ../../library/socketserver.rst:159 msgid "" "To implement a service, you must derive a class from :class:" "`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " @@ -197,7 +203,7 @@ msgid "" "`DatagramRequestHandler`." msgstr "" -#: ../../library/socketserver.rst:162 +#: ../../library/socketserver.rst:167 msgid "" "Of course, you still have to use your head! For instance, it makes no sense " "to use a forking server if the service contains state in memory that can be " @@ -207,7 +213,7 @@ msgid "" "probably have to use locks to protect the integrity of the shared data." msgstr "" -#: ../../library/socketserver.rst:169 +#: ../../library/socketserver.rst:174 msgid "" "On the other hand, if you are building an HTTP server where all data is " "stored externally (for instance, in the file system), a synchronous class " @@ -217,7 +223,7 @@ msgid "" "appropriate." msgstr "" -#: ../../library/socketserver.rst:175 +#: ../../library/socketserver.rst:180 msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " @@ -226,7 +232,7 @@ msgid "" "`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:180 +#: ../../library/socketserver.rst:185 msgid "" "Another approach to handling multiple simultaneous requests in an " "environment that supports neither threads nor :func:`~os.fork` (or where " @@ -238,11 +244,11 @@ msgid "" "subprocesses cannot be used)." msgstr "" -#: ../../library/socketserver.rst:193 +#: ../../library/socketserver.rst:198 msgid "Server Objects" msgstr "" -#: ../../library/socketserver.rst:197 +#: ../../library/socketserver.rst:202 msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " @@ -250,14 +256,14 @@ msgid "" "`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" -#: ../../library/socketserver.rst:205 +#: ../../library/socketserver.rst:210 msgid "" "Return an integer file descriptor for the socket on which the server is " "listening. This function is most commonly passed to :mod:`selectors`, to " "allow monitoring multiple servers in the same process." msgstr "" -#: ../../library/socketserver.rst:212 +#: ../../library/socketserver.rst:217 msgid "" "Process a single request. This function calls the following methods in " "order: :meth:`get_request`, :meth:`verify_request`, and :meth:" @@ -268,7 +274,7 @@ msgid "" "`handle_request` will return." msgstr "" -#: ../../library/socketserver.rst:224 +#: ../../library/socketserver.rst:229 msgid "" "Handle requests until an explicit :meth:`shutdown` request. Poll for " "shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " @@ -278,41 +284,41 @@ msgid "" "clean up zombie child processes." msgstr "" -#: ../../library/socketserver.rst:232 +#: ../../library/socketserver.rst:237 msgid "Added ``service_actions`` call to the ``serve_forever`` method." msgstr "" -#: ../../library/socketserver.rst:238 +#: ../../library/socketserver.rst:243 msgid "" "This is called in the :meth:`serve_forever` loop. This method can be " "overridden by subclasses or mixin classes to perform actions specific to a " "given service, such as cleanup actions." msgstr "" -#: ../../library/socketserver.rst:246 +#: ../../library/socketserver.rst:251 msgid "" "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" "`shutdown` must be called while :meth:`serve_forever` is running in a " "different thread otherwise it will deadlock." msgstr "" -#: ../../library/socketserver.rst:253 +#: ../../library/socketserver.rst:258 msgid "Clean up the server. May be overridden." msgstr "" -#: ../../library/socketserver.rst:258 +#: ../../library/socketserver.rst:263 msgid "" "The family of protocols to which the server's socket belongs. Common " "examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." msgstr "" -#: ../../library/socketserver.rst:264 +#: ../../library/socketserver.rst:269 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:270 +#: ../../library/socketserver.rst:275 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -321,22 +327,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:279 +#: ../../library/socketserver.rst:284 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:282 +#: ../../library/socketserver.rst:287 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:288 +#: ../../library/socketserver.rst:293 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:294 +#: ../../library/socketserver.rst:299 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -345,40 +351,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:303 +#: ../../library/socketserver.rst:308 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:309 +#: ../../library/socketserver.rst:314 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:314 +#: ../../library/socketserver.rst:319 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:323 +#: ../../library/socketserver.rst:328 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:329 +#: ../../library/socketserver.rst:334 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:336 +#: ../../library/socketserver.rst:341 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -386,11 +392,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:341 +#: ../../library/socketserver.rst:346 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:348 +#: ../../library/socketserver.rst:353 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -399,7 +405,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:357 +#: ../../library/socketserver.rst:362 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -407,20 +413,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:369 +#: ../../library/socketserver.rst:374 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:376 +#: ../../library/socketserver.rst:381 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:382 +#: ../../library/socketserver.rst:387 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -428,17 +434,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:388 +#: ../../library/socketserver.rst:393 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:394 +#: ../../library/socketserver.rst:399 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:398 +#: ../../library/socketserver.rst:403 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -446,73 +452,94 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:407 +#: ../../library/socketserver.rst:412 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:413 +#: ../../library/socketserver.rst:418 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " -"available to it; the request is available as :attr:`self.request`; the " -"client address as :attr:`self.client_address`; and the server instance as :" -"attr:`self.server`, in case it needs access to per-server information." +"available to it; the request is available as :attr:`request`; the client " +"address as :attr:`client_address`; and the server instance as :attr:" +"`server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:419 +#: ../../library/socketserver.rst:424 msgid "" -"The type of :attr:`self.request` is different for datagram or stream " -"services. For stream services, :attr:`self.request` is a socket object; for " -"datagram services, :attr:`self.request` is a pair of string and socket." +"The type of :attr:`request` is different for datagram or stream services. " +"For stream services, :attr:`request` is a socket object; for datagram " +"services, :attr:`request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:426 +#: ../../library/socketserver.rst:431 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:434 +#: ../../library/socketserver.rst:438 +msgid "" +"The *new* :class:`socket.socket` object to be used to communicate with the " +"client." +msgstr "" + +#: ../../library/socketserver.rst:444 +msgid "Client address returned by :meth:`BaseServer.get_request`." +msgstr "" + +#: ../../library/socketserver.rst:449 +msgid ":class:`BaseServer` object used for handling the request." +msgstr "" + +#: ../../library/socketserver.rst:455 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " -"and provide :attr:`self.rfile` and :attr:`self.wfile` attributes. The :attr:" -"`self.rfile` and :attr:`self.wfile` attributes can be read or written, " -"respectively, to get the request data or return data to the client. The :" -"attr:`!rfile` attributes support the :class:`io.BufferedIOBase` readable " -"interface, and :attr:`!wfile` attributes support the :class:`!io." -"BufferedIOBase` writable interface." +"and provide :attr:`rfile` and :attr:`wfile` attributes." msgstr "" -#: ../../library/socketserver.rst:443 +#: ../../library/socketserver.rst:461 msgid "" -":attr:`StreamRequestHandler.wfile` also supports the :class:`io." -"BufferedIOBase` writable interface." +"A file object from which receives the request is read. Support the :class:" +"`io.BufferedIOBase` readable interface." msgstr "" -#: ../../library/socketserver.rst:449 +#: ../../library/socketserver.rst:466 +msgid "" +"A file object to which the reply is written. Support the :class:`io." +"BufferedIOBase` writable interface" +msgstr "" + +#: ../../library/socketserver.rst:470 +msgid "" +":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable " +"interface." +msgstr "" + +#: ../../library/socketserver.rst:476 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:452 +#: ../../library/socketserver.rst:479 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:454 ../../library/socketserver.rst:553 +#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:580 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:484 +#: ../../library/socketserver.rst:511 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:499 +#: ../../library/socketserver.rst:526 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -520,47 +547,47 @@ msgid "" "has been sent from the client in one ``sendall()`` call." msgstr "" -#: ../../library/socketserver.rst:505 ../../library/socketserver.rst:577 +#: ../../library/socketserver.rst:532 ../../library/socketserver.rst:604 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:526 ../../library/socketserver.rst:652 +#: ../../library/socketserver.rst:553 ../../library/socketserver.rst:679 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:528 +#: ../../library/socketserver.rst:555 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:538 +#: ../../library/socketserver.rst:565 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:551 +#: ../../library/socketserver.rst:578 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:596 +#: ../../library/socketserver.rst:623 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:600 +#: ../../library/socketserver.rst:627 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:602 +#: ../../library/socketserver.rst:629 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:605 +#: ../../library/socketserver.rst:632 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:663 +#: ../../library/socketserver.rst:690 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/sqlite3.po b/library/sqlite3.po index cacf25b635..af64d9d6f7 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2166,10 +2166,11 @@ msgid "" "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2410 +#: ../../library/sqlite3.rst:2409 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" #: ../../library/sqlite3.rst:2443 diff --git a/library/statistics.po b/library/statistics.po index 7c0597019a..40db5fa227 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-15 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,13 +28,13 @@ msgstr ":mod:`statistics` --- 數學統計函式" msgid "**Source code:** :source:`Lib/statistics.py`" msgstr "**原始碼:**\\ :source:`Lib/statistics.py`" -#: ../../library/statistics.rst:21 +#: ../../library/statistics.rst:22 msgid "" "This module provides functions for calculating mathematical statistics of " "numeric (:class:`~numbers.Real`-valued) data." msgstr "這個模組提供計算數值 (:class:`Real`-valued) 資料的數學統計函式。" -#: ../../library/statistics.rst:24 +#: ../../library/statistics.rst:25 msgid "" "The module is not intended to be a competitor to third-party libraries such " "as `NumPy `_, `SciPy `_, or " @@ -46,7 +46,7 @@ msgstr "" ">`_ 等第三方函式庫,或者像 Minitab、SAS 和 Matlab 等專門設計給專業統計學家的" "高階統計軟體互相競爭。此模組的目標在於繪圖和科學計算。" -#: ../../library/statistics.rst:30 +#: ../../library/statistics.rst:31 msgid "" "Unless explicitly noted, these functions support :class:`int`, :class:" "`float`, :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. " @@ -62,7 +62,7 @@ msgstr "" "輸入資料含有混合型別,你可以考慮使用 :func:`map` 來確保結果是一致的,例如:" "``map(float, input_data)``。" -#: ../../library/statistics.rst:38 +#: ../../library/statistics.rst:39 msgid "" "Some datasets use ``NaN`` (not a number) values to represent missing data. " "Since NaNs have unusual comparison semantics, they cause surprising or " @@ -78,186 +78,186 @@ msgstr "" "``median_grouped()``、 ``mode()``、 ``multimode()`` 以及 ``quantiles()``。在" "呼叫這些函數之前,應該先移除 NaN 值:" -#: ../../library/statistics.rst:68 +#: ../../library/statistics.rst:69 msgid "Averages and measures of central location" msgstr "平均值與中央位置量數" -#: ../../library/statistics.rst:70 +#: ../../library/statistics.rst:71 msgid "" "These functions calculate an average or typical value from a population or " "sample." msgstr "這些函式計算來自一個母體或樣本的平均值或代表值。" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid ":func:`mean`" msgstr ":func:`mean`" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid "Arithmetic mean (\"average\") of data." msgstr "資料的算術平均數(平均值)。" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid ":func:`fmean`" msgstr ":func:`fmean`" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid "Fast, floating point arithmetic mean, with optional weighting." msgstr "快速浮點數算數平均數,可調整權重。" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid ":func:`geometric_mean`" msgstr ":func:`geometric_mean`" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid "Geometric mean of data." msgstr "資料的幾何平均數。" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid ":func:`harmonic_mean`" msgstr ":func:`harmonic_mean`" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid "Harmonic mean of data." msgstr "資料的調和平均數。" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid ":func:`median`" msgstr ":func:`median`" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid "Median (middle value) of data." msgstr "資料的中位數(中間值)。" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid ":func:`median_low`" msgstr ":func:`median_low`" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid "Low median of data." msgstr "資料中較小的中位數。" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid ":func:`median_high`" msgstr ":func:`median_high`" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid "High median of data." msgstr "資料中較大的中位數。" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid ":func:`median_grouped`" msgstr ":func:`median_grouped`" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid "Median, or 50th percentile, of grouped data." msgstr "分組資料的中位數或 50% 處。" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid ":func:`mode`" msgstr ":func:`mode`" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid "Single mode (most common value) of discrete or nominal data." msgstr "" "離散 (discrete) 或名目 (nomial) 資料中的眾數(出現次數最多次的值),只回傳一" "個。" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid ":func:`multimode`" msgstr ":func:`multimode`" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid "List of modes (most common values) of discrete or nominal data." msgstr "離散或名目資料中的眾數(出現次數最多次的值)組成的 list。" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid ":func:`quantiles`" msgstr ":func:`quantiles`" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid "Divide data into intervals with equal probability." msgstr "將資料分成數個具有相等機率的區間,即分位數 (quantile)。" -#: ../../library/statistics.rst:88 +#: ../../library/statistics.rst:89 msgid "Measures of spread" msgstr "離度 (spread) 的測量" -#: ../../library/statistics.rst:90 +#: ../../library/statistics.rst:91 msgid "" "These functions calculate a measure of how much the population or sample " "tends to deviate from the typical or average values." msgstr "這些函式計算母體或樣本偏離平均值的程度。" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid ":func:`pstdev`" msgstr ":func:`pstdev`" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid "Population standard deviation of data." msgstr "資料的母體標準差。" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid ":func:`pvariance`" msgstr ":func:`pvariance`" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid "Population variance of data." msgstr "資料的母體變異數。" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid ":func:`stdev`" msgstr ":func:`stdev`" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid "Sample standard deviation of data." msgstr "資料的樣本標準差。" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid ":func:`variance`" msgstr ":func:`variance`" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid "Sample variance of data." msgstr "資料的樣本變異數。" -#: ../../library/statistics.rst:101 +#: ../../library/statistics.rst:102 msgid "Statistics for relations between two inputs" msgstr "兩個輸入之間的關係統計" -#: ../../library/statistics.rst:103 +#: ../../library/statistics.rst:104 msgid "" "These functions calculate statistics regarding relations between two inputs." msgstr "這些函式計算兩個輸入之間的關係統計數據。" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid ":func:`covariance`" msgstr ":func:`covariance`" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid "Sample covariance for two variables." msgstr "兩變數的樣本共變異數。" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid ":func:`correlation`" msgstr ":func:`correlation`" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid "Pearson and Spearman's correlation coefficients." msgstr "Pearson 與 Spearman 相關係數 (correlation coefficient)。" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid ":func:`linear_regression`" msgstr ":func:`linear_regression`" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid "Slope and intercept for simple linear regression." msgstr "簡單線性迴歸的斜率和截距。" -#: ../../library/statistics.rst:113 +#: ../../library/statistics.rst:114 msgid "Function details" msgstr "函式細節" -#: ../../library/statistics.rst:115 +#: ../../library/statistics.rst:116 msgid "" "Note: The functions do not require the data given to them to be sorted. " "However, for reading convenience, most of the examples show sorted sequences." @@ -265,13 +265,13 @@ msgstr "" "註:這些函數並不要求輸入的資料必須排序過。為了閱讀方便,大部份的範例仍已排序" "過。" -#: ../../library/statistics.rst:120 +#: ../../library/statistics.rst:121 msgid "" "Return the sample arithmetic mean of *data* which can be a sequence or " "iterable." msgstr "回傳 *data* 的樣本算數平均數,輸入可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:122 +#: ../../library/statistics.rst:123 msgid "" "The arithmetic mean is the sum of the data divided by the number of data " "points. It is commonly called \"the average\", although it is only one of " @@ -281,15 +281,15 @@ msgstr "" "算數平均數為資料總和除以資料點的數目。他通常被稱為「平均值」,儘管它只是眾多" "不同的數學平均值之一。它是衡量資料集中位置的一種指標。" -#: ../../library/statistics.rst:127 +#: ../../library/statistics.rst:128 msgid "If *data* is empty, :exc:`StatisticsError` will be raised." msgstr "若 *data* 為空,則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:129 +#: ../../library/statistics.rst:130 msgid "Some examples of use:" msgstr "使用範例:" -#: ../../library/statistics.rst:148 +#: ../../library/statistics.rst:149 msgid "" "The mean is strongly affected by `outliers `_ and is not necessarily a typical example of the data points. For " @@ -301,7 +301,7 @@ msgstr "" "低的\\ `集中趨勢 (central tendency) `_ 度量,請參考 :func:`median`。" -#: ../../library/statistics.rst:154 +#: ../../library/statistics.rst:155 msgid "" "The sample mean gives an unbiased estimate of the true population mean, so " "that when taken on average over all the possible samples, ``mean(sample)`` " @@ -314,11 +314,11 @@ msgstr "" "*data* 為整個母體而非單一樣本,則 ``mean(data)`` 等同於計算真實的母體平均數 " "μ。" -#: ../../library/statistics.rst:163 +#: ../../library/statistics.rst:164 msgid "Convert *data* to floats and compute the arithmetic mean." msgstr "將 *data* 轉換為浮點數並計算其算數平均數。" -#: ../../library/statistics.rst:165 +#: ../../library/statistics.rst:166 msgid "" "This runs faster than the :func:`mean` function and it always returns a :" "class:`float`. The *data* may be a sequence or iterable. If the input " @@ -328,7 +328,7 @@ msgstr "" "可以是一個 sequence 或者 iterable。如果輸入的資料為空,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:174 +#: ../../library/statistics.rst:175 msgid "" "Optional weighting is supported. For example, a professor assigns a grade " "for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at " @@ -337,7 +337,7 @@ msgstr "" "支援選擇性的加權。例如,一位教授以 20% 的比重計算小考分數,20% 的比重計算作業" "分數,30% 的比重計算期中考試分數,以及 30% 的比重計算期末考試分數:" -#: ../../library/statistics.rst:185 +#: ../../library/statistics.rst:186 msgid "" "If *weights* is supplied, it must be the same length as the *data* or a :exc:" "`ValueError` will be raised." @@ -345,15 +345,15 @@ msgstr "" "如果有提供 *weights*,它必須與 *data* 長度相同,否則將引發 :exc:" "`ValueError`。" -#: ../../library/statistics.rst:190 ../../library/statistics.rst:258 +#: ../../library/statistics.rst:191 ../../library/statistics.rst:259 msgid "Added support for *weights*." msgstr "新增 *weights* 的支援。" -#: ../../library/statistics.rst:196 +#: ../../library/statistics.rst:197 msgid "Convert *data* to floats and compute the geometric mean." msgstr "將 *data* 轉換成浮點數並計算其幾何平均數。" -#: ../../library/statistics.rst:198 +#: ../../library/statistics.rst:199 msgid "" "The geometric mean indicates the central tendency or typical value of the " "*data* using the product of the values (as opposed to the arithmetic mean " @@ -362,7 +362,7 @@ msgstr "" "幾何平均數使用數值的乘積(與之對照,算數平均數使用的是數值的和)來表示 " "*data* 的集中趨勢或典型值。" -#: ../../library/statistics.rst:202 +#: ../../library/statistics.rst:203 msgid "" "Raises a :exc:`StatisticsError` if the input dataset is empty, if it " "contains a zero, or if it contains a negative value. The *data* may be a " @@ -371,13 +371,13 @@ msgstr "" "若輸入的資料集為空、包含零、包含負值,則引發 :exc:`StatisticsError`。*data* " "可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:206 +#: ../../library/statistics.rst:207 msgid "" "No special efforts are made to achieve exact results. (However, this may " "change in the future.)" msgstr "目前沒有特別為了精確結果而特別多下什麼工夫。(然而,未來或許會有。)" -#: ../../library/statistics.rst:219 +#: ../../library/statistics.rst:220 msgid "" "Return the harmonic mean of *data*, a sequence or iterable of real-valued " "numbers. If *weights* is omitted or *None*, then equal weighting is assumed." @@ -385,7 +385,7 @@ msgstr "" "回傳 *data* 的調和平均數。*data* 可為實數 (real-valued) sequence 或者 " "iterable。如果省略 *weights* 或者 *weights* 為 *None*,則假設各權重相等。" -#: ../../library/statistics.rst:223 +#: ../../library/statistics.rst:224 msgid "" "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " "reciprocals of the data. For example, the harmonic mean of three values *a*, " @@ -396,7 +396,7 @@ msgstr "" "三個數 *a*,*b* 與 *c* 的調和平均數等於 ``3/(1/a + 1/b + 1/c)``。若其中一個值" "為零,結果將為零。" -#: ../../library/statistics.rst:228 +#: ../../library/statistics.rst:229 msgid "" "The harmonic mean is a type of average, a measure of the central location of " "the data. It is often appropriate when averaging ratios or rates, for " @@ -405,7 +405,7 @@ msgstr "" "調和平均數是一種平均數,是衡量資料中心位置的一種方法。它通常用於計算比率 " "(ratio) 或率 (rate) 的平均,例如速率(speed)。" -#: ../../library/statistics.rst:232 +#: ../../library/statistics.rst:233 msgid "" "Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. " "What is the average speed?" @@ -413,7 +413,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 10 公里,然後再以時速 60 公里的速率行駛 " "10 公里,求汽車的平均速率?" -#: ../../library/statistics.rst:240 +#: ../../library/statistics.rst:241 msgid "" "Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up " "to 60 km/hr for the remaining 30 km of the journey. What is the average " @@ -422,7 +422,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 5 公里,然後在交通順暢時,加速到時速 60 " "公里,以此速度行駛剩下的 30 公里。求汽車的平均速率?" -#: ../../library/statistics.rst:249 +#: ../../library/statistics.rst:250 msgid "" ":exc:`StatisticsError` is raised if *data* is empty, any element is less " "than zero, or if the weighted sum isn't positive." @@ -430,7 +430,7 @@ msgstr "" "若 *data* 為空、含有任何小於零的元素、或者加權總和不為正數,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:252 +#: ../../library/statistics.rst:253 msgid "" "The current algorithm has an early-out when it encounters a zero in the " "input. This means that the subsequent inputs are not tested for validity. " @@ -439,7 +439,7 @@ msgstr "" "目前的演算法設計為,若在輸入當中遇到零,則會提前退出。這意味著後續的輸入並未" "進行有效性檢查。(這種行為在未來可能會改變。)" -#: ../../library/statistics.rst:263 +#: ../../library/statistics.rst:264 msgid "" "Return the median (middle value) of numeric data, using the common \"mean of " "middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised. " @@ -448,7 +448,7 @@ msgstr "" "使用常見的「中間兩數取平均」方法回傳數值資料的中位數 (中間值)。若 *data* 為" "空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:267 +#: ../../library/statistics.rst:268 msgid "" "The median is a robust measure of central location and is less affected by " "the presence of outliers. When the number of data points is odd, the middle " @@ -457,13 +457,13 @@ msgstr "" "中位數是一種穩健的衡量資料中心位置的方法,較不易被離群值影響。當資料點數量為" "奇數時,會回傳中間的資料點:" -#: ../../library/statistics.rst:276 +#: ../../library/statistics.rst:277 msgid "" "When the number of data points is even, the median is interpolated by taking " "the average of the two middle values:" msgstr "當資料點數量為偶數時,中位數透過中間兩個值的平均數來插值計算:" -#: ../../library/statistics.rst:284 +#: ../../library/statistics.rst:285 msgid "" "This is suited for when your data is discrete, and you don't mind that the " "median may not be an actual data point." @@ -471,7 +471,7 @@ msgstr "" "若你的資料為離散資料,並且你不介意中位數可能並非真實的資料點,那這函式適合" "你。" -#: ../../library/statistics.rst:287 +#: ../../library/statistics.rst:288 msgid "" "If the data is ordinal (supports order operations) but not numeric (doesn't " "support addition), consider using :func:`median_low` or :func:`median_high` " @@ -480,7 +480,7 @@ msgstr "" "若你的資料為順序 (ordinal) 資料(支援排序操作)但並非數值型(不支援加法),可" "以考慮改用 :func:`median_low` 或是 :func:`median_high` 代替。" -#: ../../library/statistics.rst:293 +#: ../../library/statistics.rst:294 msgid "" "Return the low median of numeric data. If *data* is empty, :exc:" "`StatisticsError` is raised. *data* can be a sequence or iterable." @@ -488,7 +488,7 @@ msgstr "" "回傳數值型資料的低中位數 (low median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:296 +#: ../../library/statistics.rst:297 msgid "" "The low median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the smaller " @@ -497,7 +497,7 @@ msgstr "" "低中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較小的值。" -#: ../../library/statistics.rst:307 +#: ../../library/statistics.rst:308 msgid "" "Use the low median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -505,7 +505,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用低中位" "數。" -#: ../../library/statistics.rst:313 +#: ../../library/statistics.rst:314 msgid "" "Return the high median of data. If *data* is empty, :exc:`StatisticsError` " "is raised. *data* can be a sequence or iterable." @@ -513,7 +513,7 @@ msgstr "" "回傳數值型資料的高中位數 (high median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:316 +#: ../../library/statistics.rst:317 msgid "" "The high median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the larger of " @@ -522,7 +522,7 @@ msgstr "" "高中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較大的值。" -#: ../../library/statistics.rst:327 +#: ../../library/statistics.rst:328 msgid "" "Use the high median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -530,7 +530,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用高中位" "數。" -#: ../../library/statistics.rst:333 +#: ../../library/statistics.rst:334 msgid "" "Return the median of grouped continuous data, calculated as the 50th " "percentile, using interpolation. If *data* is empty, :exc:`StatisticsError` " @@ -540,7 +540,7 @@ msgstr "" "為空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 " "iterable。" -#: ../../library/statistics.rst:342 +#: ../../library/statistics.rst:343 msgid "" "In the following example, the data are rounded, so that each value " "represents the midpoint of data classes, e.g. 1 is the midpoint of the class " @@ -552,7 +552,7 @@ msgstr "" "0.5--1.5 的中點,2 是組 1.5--2.5 的中點,3 是組 2.5--3.5 的中點等。根據輸入的" "資料,中間值落在 3.5--4.5 的組別中,並使用內插法來估計它:" -#: ../../library/statistics.rst:353 +#: ../../library/statistics.rst:354 msgid "" "Optional argument *interval* represents the class interval, and defaults to " "1. Changing the class interval naturally will change the interpolation:" @@ -560,13 +560,13 @@ msgstr "" "選擇性引數 *interval* 表示組距 (class interval),預設值為 1。改變組距自然會改" "變內插值:" -#: ../../library/statistics.rst:363 +#: ../../library/statistics.rst:364 msgid "" "This function does not check whether the data points are at least *interval* " "apart." msgstr "此函式不檢查資料點是否至少間隔 *interval* 以上。" -#: ../../library/statistics.rst:368 +#: ../../library/statistics.rst:369 msgid "" "Under some circumstances, :func:`median_grouped` may coerce data points to " "floats. This behaviour is likely to change in the future." @@ -574,7 +574,7 @@ msgstr "" "在部份情況下,:func:`median_grouped` 可能會強制將資料點轉換為浮點數。這種行為" "在未來可能會改變。" -#: ../../library/statistics.rst:373 +#: ../../library/statistics.rst:374 msgid "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." @@ -582,7 +582,7 @@ msgstr "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." -#: ../../library/statistics.rst:376 +#: ../../library/statistics.rst:377 msgid "" "The `SSMEDIAN `_ function in the Gnome Gnumeric " @@ -593,7 +593,7 @@ msgstr "" "stable/gnumeric.html#gnumeric-function-SSMEDIAN>`_ 函式,包括\\ `這篇討論 " "`_。" -#: ../../library/statistics.rst:384 +#: ../../library/statistics.rst:385 msgid "" "Return the single most common data point from discrete or nominal *data*. " "The mode (when it exists) is the most typical value and serves as a measure " @@ -602,7 +602,7 @@ msgstr "" "回傳離散或名目 *data* 中出現次數最多次的值,只回傳一個。眾數(如果存在)是最" "典型的值,並用來衡量資料的中心位置。" -#: ../../library/statistics.rst:388 +#: ../../library/statistics.rst:389 msgid "" "If there are multiple modes with the same frequency, returns the first one " "encountered in the *data*. If the smallest or largest of those is desired " @@ -614,20 +614,20 @@ msgstr "" "``max(multimode(data))``。如果輸入的 *data* 為空,則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:393 +#: ../../library/statistics.rst:394 msgid "" "``mode`` assumes discrete data and returns a single value. This is the " "standard treatment of the mode as commonly taught in schools:" msgstr "" "``mode`` 假定為離散資料,並回傳單一的值。這也是一般學校教授的標準眾數定義:" -#: ../../library/statistics.rst:401 +#: ../../library/statistics.rst:402 msgid "" "The mode is unique in that it is the only statistic in this package that " "also applies to nominal (non-numeric) data:" msgstr "眾數特別之處在於它是此套件中唯一也適用於名目(非數值型)資料的統計量:" -#: ../../library/statistics.rst:409 +#: ../../library/statistics.rst:410 msgid "" "Now handles multimodal datasets by returning the first mode encountered. " "Formerly, it raised :exc:`StatisticsError` when more than one mode was found." @@ -635,7 +635,7 @@ msgstr "" "現在,遇到資料中有多個眾數時,會回傳第一個遇到的眾數。在以前,當找到大於一個" "眾數時,會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:417 +#: ../../library/statistics.rst:418 msgid "" "Return a list of the most frequently occurring values in the order they were " "first encountered in the *data*. Will return more than one result if there " @@ -645,7 +645,7 @@ msgstr "" "次出現的順序排列。如果有多個眾數,將會回傳所有結果。若 *data* 為空,則回傳空" "的 list:" -#: ../../library/statistics.rst:433 +#: ../../library/statistics.rst:434 msgid "" "Return the population standard deviation (the square root of the population " "variance). See :func:`pvariance` for arguments and other details." @@ -653,7 +653,7 @@ msgstr "" "回傳母體標準差(即母體變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`pvariance`。" -#: ../../library/statistics.rst:444 +#: ../../library/statistics.rst:445 msgid "" "Return the population variance of *data*, a non-empty sequence or iterable " "of real-valued numbers. Variance, or second moment about the mean, is a " @@ -665,7 +665,7 @@ msgstr "" "數,或者以平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變" "異數大表示資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:450 +#: ../../library/statistics.rst:451 msgid "" "If the optional second argument *mu* is given, it is typically the mean of " "the *data*. It can also be used to compute the second moment around a point " @@ -676,7 +676,7 @@ msgstr "" "算非以平均值為中心的第二動差。如果沒有傳入此引數或者引數為 `None` (預設" "值),則自動計算資料的算數平均數。" -#: ../../library/statistics.rst:455 +#: ../../library/statistics.rst:456 msgid "" "Use this function to calculate the variance from the entire population. To " "estimate the variance from a sample, the :func:`variance` function is " @@ -685,16 +685,16 @@ msgstr "" "使用此函式來計算整個母體的變異數。如果要從樣本估算變異數,:func:`variance` 通" "常是較好的選擇。" -#: ../../library/statistics.rst:459 +#: ../../library/statistics.rst:460 msgid "Raises :exc:`StatisticsError` if *data* is empty." msgstr "若 *data* 為空,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:461 ../../library/statistics.rst:531 -#: ../../library/statistics.rst:635 +#: ../../library/statistics.rst:462 ../../library/statistics.rst:532 +#: ../../library/statistics.rst:636 msgid "Examples:" msgstr "範例:" -#: ../../library/statistics.rst:469 +#: ../../library/statistics.rst:470 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *mu* to avoid recalculation:" @@ -702,11 +702,11 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:478 +#: ../../library/statistics.rst:479 msgid "Decimals and Fractions are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:492 +#: ../../library/statistics.rst:493 msgid "" "When called with the entire population, this gives the population variance " "σ². When called on a sample instead, this is the biased sample variance s², " @@ -715,7 +715,7 @@ msgstr "" "當在整個母體上呼叫此函式時,會回傳母體變異數 σ²。當在樣本上呼叫此函式時,會回" "傳有偏差的樣本變異數 s²,也就是具有 N 個自由度的變異數。" -#: ../../library/statistics.rst:496 +#: ../../library/statistics.rst:497 msgid "" "If you somehow know the true population mean μ, you may use this function to " "calculate the variance of a sample, giving the known population mean as the " @@ -727,7 +727,7 @@ msgstr "" "引數提供給此函式,用以計算樣本的變異數。只要資料點是母體的隨機樣本,結果將是" "母體變異數的不偏估計。" -#: ../../library/statistics.rst:505 +#: ../../library/statistics.rst:506 msgid "" "Return the sample standard deviation (the square root of the sample " "variance). See :func:`variance` for arguments and other details." @@ -735,7 +735,7 @@ msgstr "" "回傳樣本標準差(即樣本變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`variance`。" -#: ../../library/statistics.rst:516 +#: ../../library/statistics.rst:517 msgid "" "Return the sample variance of *data*, an iterable of at least two real-" "valued numbers. Variance, or second moment about the mean, is a measure of " @@ -747,7 +747,7 @@ msgstr "" "平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變異數大表示" "資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:522 +#: ../../library/statistics.rst:523 msgid "" "If the optional second argument *xbar* is given, it should be the mean of " "*data*. If it is missing or ``None`` (the default), the mean is " @@ -756,7 +756,7 @@ msgstr "" "若有傳入選擇性的第二個引數 *xbar*,它應該是 *data* 的平均值。如果沒有傳入或者" "為 ``None`` (預設值),則自動計算資料的平均值。" -#: ../../library/statistics.rst:526 +#: ../../library/statistics.rst:527 msgid "" "Use this function when your data is a sample from a population. To calculate " "the variance from the entire population, see :func:`pvariance`." @@ -764,11 +764,11 @@ msgstr "" "當你的資料是來自母體的樣本時,請使用此函式。若要從整個母體計算變異數,請參" "見 :func:`pvariance`。" -#: ../../library/statistics.rst:529 +#: ../../library/statistics.rst:530 msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." msgstr "若 *data* 內少於兩個值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:539 +#: ../../library/statistics.rst:540 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *xbar* to avoid recalculation:" @@ -776,7 +776,7 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:548 +#: ../../library/statistics.rst:549 msgid "" "This function does not attempt to verify that you have passed the actual " "mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or " @@ -785,11 +785,11 @@ msgstr "" "此函式不會驗證你傳入的 *xbar* 是否為實際的平均數。傳入任意的 *xbar* 會導致無" "效或不可能的結果。" -#: ../../library/statistics.rst:552 +#: ../../library/statistics.rst:553 msgid "Decimal and Fraction values are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:566 +#: ../../library/statistics.rst:567 msgid "" "This is the sample variance s² with Bessel's correction, also known as " "variance with N-1 degrees of freedom. Provided that the data points are " @@ -800,7 +800,7 @@ msgstr "" "為 N-1 的變異數。只要資料點具有代表性(例如:獨立且具有相同分布),結果應該會" "是對真實母體變異數的不偏估計。" -#: ../../library/statistics.rst:571 +#: ../../library/statistics.rst:572 msgid "" "If you somehow know the actual population mean μ you should pass it to the :" "func:`pvariance` function as the *mu* parameter to get the variance of a " @@ -809,7 +809,7 @@ msgstr "" "若你剛好知道真正的母體平均數 μ,你應該將其作為 *mu* 參數傳入 :func:" "`pvariance` 函式來計算樣本變異數。" -#: ../../library/statistics.rst:577 +#: ../../library/statistics.rst:578 msgid "" "Divide *data* into *n* continuous intervals with equal probability. Returns " "a list of ``n - 1`` cut points separating the intervals." @@ -817,7 +817,7 @@ msgstr "" "將 *data* 分成 *n* 個具有相等機率的連續區間。回傳一個包含 ``n - 1`` 個用於切" "分各區間的分隔點的 list。" -#: ../../library/statistics.rst:580 +#: ../../library/statistics.rst:581 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate " @@ -828,7 +828,7 @@ msgstr "" "分位數 (percentile),這將給出 99 個分隔點將 *data* 分成 100 個大小相等的組。" "如果 *n* 不是至少為 1,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:585 +#: ../../library/statistics.rst:586 msgid "" "The *data* can be any iterable containing sample data. For meaningful " "results, the number of data points in *data* should be larger than *n*. " @@ -837,7 +837,7 @@ msgstr "" "*data* 可以是包含樣本資料的任何 iterable。為了取得有意義的結果,*data* 中的資" "料點數量應大於 *n*。如果資料點少於兩個,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:589 +#: ../../library/statistics.rst:590 msgid "" "The cut points are linearly interpolated from the two nearest data points. " "For example, if a cut point falls one-third of the distance between two " @@ -846,7 +846,7 @@ msgstr "" "分隔點是從兩個最近的資料點線性內插值計算出來的。舉例來說,如果分隔點落在兩個" "樣本值 ``100`` 與 ``112`` 之間的距離三分之一處,則分隔點的值將為 ``104``。" -#: ../../library/statistics.rst:594 +#: ../../library/statistics.rst:595 msgid "" "The *method* for computing quantiles can be varied depending on whether the " "*data* includes or excludes the lowest and highest possible values from the " @@ -855,7 +855,7 @@ msgstr "" "計算分位數的 *method* 可以根據 *data* 是否包含或排除來自母體的最小與最大可能" "的值而改變。" -#: ../../library/statistics.rst:598 +#: ../../library/statistics.rst:599 msgid "" "The default *method* is \"exclusive\" and is used for data sampled from a " "population that can have more extreme values than found in the samples. The " @@ -869,7 +869,7 @@ msgstr "" "1)``。給定九個樣本資料,此方法將對資料排序且計算下列百分位數:10%、20%、30%、" "40%、50%、60%、70%、80%、90%。" -#: ../../library/statistics.rst:605 +#: ../../library/statistics.rst:606 msgid "" "Setting the *method* to \"inclusive\" is used for describing population data " "or for samples that are known to include the most extreme values from the " @@ -886,7 +886,7 @@ msgstr "" "給定十一個個樣本資料,此方法將對資料排序且計算下列百分位數:0%、10%、20%、" "30%、40%、50%、60%、70%、80%、90%、100%。" -#: ../../library/statistics.rst:629 +#: ../../library/statistics.rst:630 msgid "" "Return the sample covariance of two inputs *x* and *y*. Covariance is a " "measure of the joint variability of two inputs." @@ -894,14 +894,14 @@ msgstr "" "回傳兩輸入 *x* 與 *y* 的樣本共變異數 (sample covariance)。共變異數是衡量兩輸" "入的聯合變異性 (joint variability) 的指標。" -#: ../../library/statistics.rst:632 +#: ../../library/statistics.rst:633 msgid "" "Both inputs must be of the same length (no less than two), otherwise :exc:" "`StatisticsError` is raised." msgstr "" "兩輸入必須具有相同長度(至少兩個),否則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:653 +#: ../../library/statistics.rst:654 msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " @@ -912,7 +912,7 @@ msgstr "" "en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_。Pearson 相關係數 " "*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向。" -#: ../../library/statistics.rst:659 +#: ../../library/statistics.rst:660 msgid "" "If *method* is \"ranked\", computes `Spearman's rank correlation coefficient " "`_ " @@ -926,7 +926,7 @@ msgstr "" "則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " "relationship) 的強度。" -#: ../../library/statistics.rst:665 +#: ../../library/statistics.rst:666 msgid "" "Spearman's correlation coefficient is appropriate for ordinal data or for " "continuous data that doesn't meet the linear proportion requirement for " @@ -935,7 +935,7 @@ msgstr "" "Spearman 相關係數適用於順序型資料,或者不符合 Pearson 相關係數要求的線性比例" "關係的連續型 (continuous) 資料。" -#: ../../library/statistics.rst:669 +#: ../../library/statistics.rst:670 msgid "" "Both inputs must be of the same length (no less than two), and need not to " "be constant, otherwise :exc:`StatisticsError` is raised." @@ -943,7 +943,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且不須為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:672 +#: ../../library/statistics.rst:673 msgid "" "Example with `Kepler's laws of planetary motion `_:" @@ -951,11 +951,11 @@ msgstr "" "以 `Kepler 行星運動定律 `_\\ 為例:" -#: ../../library/statistics.rst:699 +#: ../../library/statistics.rst:700 msgid "Added support for Spearman's rank correlation coefficient." msgstr "新增了對 Spearman 等級相關係數的支援。" -#: ../../library/statistics.rst:704 +#: ../../library/statistics.rst:705 msgid "" "Return the slope and intercept of `simple linear regression `_ parameters estimated using " @@ -969,11 +969,11 @@ msgstr "" "迴歸描述自變數 (independent variable) *x* 與應變數 (dependent variable) *y* " "之間的關係,用以下的線性函式表示:" -#: ../../library/statistics.rst:710 +#: ../../library/statistics.rst:711 msgid "*y = slope \\* x + intercept + noise*" msgstr "*y = slope \\* x + intercept + noise*" -#: ../../library/statistics.rst:712 +#: ../../library/statistics.rst:713 msgid "" "where ``slope`` and ``intercept`` are the regression parameters that are " "estimated, and ``noise`` represents the variability of the data that was not " @@ -983,7 +983,7 @@ msgstr "" "其中 ``slope`` 和 ``intercept`` 是被估計的迴歸參數,而 ``noise`` 表示由線性迴" "歸未解釋的資料變異性(它等於應變數的預測值與實際值之差)。" -#: ../../library/statistics.rst:718 +#: ../../library/statistics.rst:719 msgid "" "Both inputs must be of the same length (no less than two), and the " "independent variable *x* cannot be constant; otherwise a :exc:" @@ -992,7 +992,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且自變數 *x* 不得為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:722 +#: ../../library/statistics.rst:723 msgid "" "For example, we can use the `release dates of the Monty Python films " "`_ to predict the " @@ -1003,7 +1003,7 @@ msgstr "" "wikipedia.org/wiki/Monty_Python#Films>`_\\ 來預測至 2019 年為止,假設他們保持" "固定的製作速度,應該會產生的 Monty Python 電影的累計數量。" -#: ../../library/statistics.rst:736 +#: ../../library/statistics.rst:737 msgid "" "If *proportional* is true, the independent variable *x* and the dependent " "variable *y* are assumed to be directly proportional. The data is fit to a " @@ -1014,31 +1014,38 @@ msgstr "" "資料座落在通過原點的一直線上。由於 *intercept* 始終為 0.0,因此線性函式可簡化" "如下:" -#: ../../library/statistics.rst:742 +#: ../../library/statistics.rst:743 msgid "*y = slope \\* x + noise*" msgstr "*y = slope \\* x + noise*" -#: ../../library/statistics.rst:746 +#: ../../library/statistics.rst:745 +msgid "" +"Continuing the example from :func:`correlation`, we look to see how well a " +"model based on major planets can predict the orbital distances for dwarf " +"planets:" +msgstr "" + +#: ../../library/statistics.rst:765 msgid "Added support for *proportional*." msgstr "新增 *proportional* 的支援。" -#: ../../library/statistics.rst:750 +#: ../../library/statistics.rst:769 msgid "Exceptions" msgstr "例外" -#: ../../library/statistics.rst:752 +#: ../../library/statistics.rst:771 msgid "A single exception is defined:" msgstr "定義了一個單一的例外:" -#: ../../library/statistics.rst:756 +#: ../../library/statistics.rst:775 msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." msgstr ":exc:`ValueError` 的子類別,用於和統計相關的例外。" -#: ../../library/statistics.rst:760 +#: ../../library/statistics.rst:779 msgid ":class:`NormalDist` objects" msgstr ":class:`NormalDist` 物件" -#: ../../library/statistics.rst:762 +#: ../../library/statistics.rst:781 msgid "" ":class:`NormalDist` is a tool for creating and manipulating normal " "distributions of a `random variable `_ 的常態分布的工" "具。它是一個將量測資料的平均數與標準差視為單一實體的類別。" -#: ../../library/statistics.rst:768 +#: ../../library/statistics.rst:787 msgid "" "Normal distributions arise from the `Central Limit Theorem `_ and have a wide range of " @@ -1058,7 +1065,7 @@ msgstr "" "常態分布源自於\\ `中央極限定理 (Central Limit Theorem) `_,在統計學中有著廣泛的應用。" -#: ../../library/statistics.rst:774 +#: ../../library/statistics.rst:793 msgid "" "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean " "`_ and *sigma* represents the " @@ -1068,11 +1075,11 @@ msgstr "" "en.wikipedia.org/wiki/Arithmetic_mean>`_\\ 而 *sigma* 代表\\ `標準差 " "`_。" -#: ../../library/statistics.rst:779 +#: ../../library/statistics.rst:798 msgid "If *sigma* is negative, raises :exc:`StatisticsError`." msgstr "若 *sigma* 為負值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:783 +#: ../../library/statistics.rst:802 msgid "" "A read-only property for the `arithmetic mean `_ of a normal distribution." @@ -1080,14 +1087,14 @@ msgstr "" "常態分布中的\\ `算數平均數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:789 +#: ../../library/statistics.rst:808 msgid "" "A read-only property for the `median `_ of a normal distribution." msgstr "" "常態分布中的\\ `中位數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:795 +#: ../../library/statistics.rst:814 msgid "" "A read-only property for the `mode `_ of a normal distribution." @@ -1095,7 +1102,7 @@ msgstr "" "常態分布中的\\ `眾數 `_\\ 唯" "讀屬性。" -#: ../../library/statistics.rst:801 +#: ../../library/statistics.rst:820 msgid "" "A read-only property for the `standard deviation `_ of a normal distribution." @@ -1103,7 +1110,7 @@ msgstr "" "常態分布中的\\ `標準差 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:807 +#: ../../library/statistics.rst:826 msgid "" "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard " @@ -1112,7 +1119,7 @@ msgstr "" "常態分布中的\\ `變異數 `_\\ 唯讀屬" "性。" -#: ../../library/statistics.rst:813 +#: ../../library/statistics.rst:832 msgid "" "Makes a normal distribution instance with *mu* and *sigma* parameters " "estimated from the *data* using :func:`fmean` and :func:`stdev`." @@ -1120,7 +1127,7 @@ msgstr "" "利用 :func:`fmean` 與 :func:`stdev` 函式,估計 *data* 的 *mu* 與 *sigma* 參" "數,建立一個常態分布的實例。" -#: ../../library/statistics.rst:816 +#: ../../library/statistics.rst:835 msgid "" "The *data* can be any :term:`iterable` and should consist of values that can " "be converted to type :class:`float`. If *data* does not contain at least " @@ -1132,7 +1139,7 @@ msgstr "" "若 *data* 沒有包含至少兩個以上的元素在內,則引發 :exc:`StatisticsError`,因為" "至少需要一個點來估計中央值且至少需要兩個點來估計分散情形。" -#: ../../library/statistics.rst:824 +#: ../../library/statistics.rst:843 msgid "" "Generates *n* random samples for a given mean and standard deviation. " "Returns a :class:`list` of :class:`float` values." @@ -1140,7 +1147,7 @@ msgstr "" "給定平均值與標準差,產生 *n* 個隨機樣本。回傳一個由 :class:`float` 組成的 :" "class:`list`。" -#: ../../library/statistics.rst:827 +#: ../../library/statistics.rst:846 msgid "" "If *seed* is given, creates a new instance of the underlying random number " "generator. This is useful for creating reproducible results, even in a " @@ -1149,7 +1156,7 @@ msgstr "" "若有給定 *seed*,則會建立一個以此為基礎的亂數產生器實例。這對於建立可重現的結" "果很有幫助,即使在多執行緒情境下也是如此。" -#: ../../library/statistics.rst:833 +#: ../../library/statistics.rst:852 msgid "" "Using a `probability density function (pdf) `_, compute the relative likelihood that a " @@ -1161,7 +1168,7 @@ msgstr "" "值 *x* 的相對概度 (relative likelihood)。數學上,它是比率 ``P(x <= X < " "x+dx) / dx`` 在 *dx* 趨近於零時的極限值。" -#: ../../library/statistics.rst:839 +#: ../../library/statistics.rst:858 msgid "" "The relative likelihood is computed as the probability of a sample occurring " "in a narrow range divided by the width of the range (hence the word " @@ -1171,7 +1178,7 @@ msgstr "" "相對概度是樣本出現在狹窄範圍的機率,除以該範圍的寬度(故稱為「密度」)計算而" "得。由於概度是相對於其它點,故其值可大於 ``1.0``。" -#: ../../library/statistics.rst:846 +#: ../../library/statistics.rst:865 msgid "" "Using a `cumulative distribution function (cdf) `_, compute the probability that a " @@ -1182,7 +1189,7 @@ msgstr "" "wikipedia.org/wiki/Cumulative_distribution_function>`_ 計算隨機變數 *X* 小於" "或等於 *x* 的機率。數學上,它記為 ``P(X <= x)``。" -#: ../../library/statistics.rst:853 +#: ../../library/statistics.rst:872 msgid "" "Compute the inverse cumulative distribution function, also known as the " "`quantile function `_ or " @@ -1196,7 +1203,7 @@ msgstr "" "org/web/20190203145224/https://www.statisticshowto.datasciencecentral.com/" "inverse-distribution-function/>`_ 函式。數學上記為 ``x : P(X <= x) = p``。" -#: ../../library/statistics.rst:859 +#: ../../library/statistics.rst:878 msgid "" "Finds the value *x* of the random variable *X* such that the probability of " "the variable being less than or equal to that value equals the given " @@ -1204,7 +1211,7 @@ msgid "" msgstr "" "找出一個值 *x*,使得隨機變數 *X* 小於或等於該值的機率等於給定的機率 *p*。" -#: ../../library/statistics.rst:865 +#: ../../library/statistics.rst:884 msgid "" "Measures the agreement between two normal probability distributions. Returns " "a value between 0.0 and 1.0 giving `the overlapping area for the two " @@ -1213,7 +1220,7 @@ msgstr "" "衡量兩常態分布之間的一致性。回傳一個介於 0.0 與 1.0 之間的值,表示\\ `兩機率" "密度函式的重疊區域 `_。" -#: ../../library/statistics.rst:872 +#: ../../library/statistics.rst:891 msgid "" "Divide the normal distribution into *n* continuous intervals with equal " "probability. Returns a list of (n - 1) cut points separating the intervals." @@ -1221,7 +1228,7 @@ msgstr "" "將常態分布分割成 *n* 個具有相等機率的連續區間。回傳一個 list,包含 (n-1) 個切" "割區間的分隔點。" -#: ../../library/statistics.rst:876 +#: ../../library/statistics.rst:895 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate the " @@ -1231,7 +1238,7 @@ msgstr "" "*n* 設定為 100 表示百分位數,這會產生 99 個分隔點,將常態分布切割成大小相等的" "群組。" -#: ../../library/statistics.rst:882 +#: ../../library/statistics.rst:901 msgid "" "Compute the `Standard Score `_ describing *x* in terms of the number of standard " @@ -1242,7 +1249,7 @@ msgstr "" "probability-and-statistics/z-score/>`_,用以描述在常態分布中,*x* 高出或低於" "平均數幾個標準差:``(x - mean) / stdev``。" -#: ../../library/statistics.rst:890 +#: ../../library/statistics.rst:909 msgid "" "Instances of :class:`NormalDist` support addition, subtraction, " "multiplication and division by a constant. These operations are used for " @@ -1251,14 +1258,14 @@ msgstr "" ":class:`NormalDist` 的實例支援對常數的加法、減法、乘法與除法。這些操作用於平" "移與縮放。例如:" -#: ../../library/statistics.rst:900 +#: ../../library/statistics.rst:919 msgid "" "Dividing a constant by an instance of :class:`NormalDist` is not supported " "because the result wouldn't be normally distributed." msgstr "" "不支援將常數除以 :class:`NormalDist` 的實例,因為結果將不符合常態分布。" -#: ../../library/statistics.rst:903 +#: ../../library/statistics.rst:922 msgid "" "Since normal distributions arise from additive effects of independent " "variables, it is possible to `add and subtract two independent normally " @@ -1271,19 +1278,19 @@ msgstr "" "Sum_of_normally_distributed_random_variables>`_,並且表示為 :class:" "`NormalDist` 的實例。例如:" -#: ../../library/statistics.rst:923 +#: ../../library/statistics.rst:942 msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:927 +#: ../../library/statistics.rst:946 msgid "Classic probability problems" msgstr "經典機率問題" -#: ../../library/statistics.rst:929 +#: ../../library/statistics.rst:948 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:931 +#: ../../library/statistics.rst:950 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1295,7 +1302,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:944 +#: ../../library/statistics.rst:963 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1303,11 +1310,11 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:956 +#: ../../library/statistics.rst:975 msgid "Monte Carlo inputs for simulations" msgstr "用於模擬的蒙地卡羅 (Monte Carlo) 輸入" -#: ../../library/statistics.rst:958 +#: ../../library/statistics.rst:977 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1317,11 +1324,11 @@ msgstr "" "樣本以進行\\ `蒙地卡羅模擬 `_:" -#: ../../library/statistics.rst:975 +#: ../../library/statistics.rst:994 msgid "Approximating binomial distributions" msgstr "近似二項分布" -#: ../../library/statistics.rst:977 +#: ../../library/statistics.rst:996 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1331,7 +1338,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:982 +#: ../../library/statistics.rst:1001 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1344,15 +1351,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1016 +#: ../../library/statistics.rst:1035 msgid "Naive bayesian classifier" msgstr "單純貝氏分類器 (Naive bayesian classifier)" -#: ../../library/statistics.rst:1018 +#: ../../library/statistics.rst:1037 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1020 +#: ../../library/statistics.rst:1039 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1363,7 +1370,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1025 +#: ../../library/statistics.rst:1044 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1372,13 +1379,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1038 +#: ../../library/statistics.rst:1057 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1047 +#: ../../library/statistics.rst:1066 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1389,7 +1396,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1062 +#: ../../library/statistics.rst:1081 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" -#: ../../library/statistics.rst:1073 +#: ../../library/statistics.rst:1092 msgid "Kernel density estimation" msgstr "核密度估計 (Kernel density estimation)" -#: ../../library/statistics.rst:1075 +#: ../../library/statistics.rst:1094 msgid "" "It is possible to estimate a continuous probability density function from a " "fixed number of discrete samples." msgstr "可以從固定數量的離散樣本估計出連續機率密度函式。" -#: ../../library/statistics.rst:1078 +#: ../../library/statistics.rst:1097 msgid "" "The basic idea is to smooth the data using `a kernel function such as a " "normal distribution, triangular distribution, or uniform distribution " @@ -1422,7 +1429,7 @@ msgstr "" "wikipedia.org/wiki/Kernel_(statistics)#Kernel_functions_in_common_use>`_\\ 來" "使資料更加平滑。平滑程度由單個參數 ``h`` 控制,代表核函數的變異數。" -#: ../../library/statistics.rst:1097 +#: ../../library/statistics.rst:1116 msgid "" "`Wikipedia has an example `_ where we can use the ``kde_normal()`` " @@ -1433,7 +1440,7 @@ msgstr "" "Kernel_density_estimation#Example>`_,我們可以使用 ``kde_normal()`` 這個錦囊" "妙計來生成並繪製從小樣本估計的機率密度函式:" -#: ../../library/statistics.rst:1109 +#: ../../library/statistics.rst:1128 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" msgstr "``xarr`` 和 ``yarr`` 中的點可用於繪製 PDF 圖:" diff --git a/library/symtable.po b/library/symtable.po index a1da8da3f2..deb26241d8 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,37 +63,56 @@ msgstr "" #: ../../library/symtable.rst:40 msgid "" "Return the type of the symbol table. Possible values are ``'class'``, " -"``'module'``, and ``'function'``." +"``'module'``, ``'function'``, ``'annotation'``, ``'TypeVar bound'``, ``'type " +"alias'``, and ``'type parameter'``. The latter four refer to different " +"flavors of :ref:`annotation scopes `." msgstr "" -"回傳符號表的種類。可能的值為 ``'class'``、``'module'`` 和 ``'function'``。" +"回傳符號表的種類。可能的值為 ``'class'``、``'module'``、``'function'``、" +"``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'``。後四個是指不同的\\ :ref:`註釋範圍 (annotation scopes) " +"`。" #: ../../library/symtable.rst:45 +msgid "" +"Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type " +"parameter'`` as possible return values." +msgstr "" +"新增了 ``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'`` 作為可能的回傳值。" + +#: ../../library/symtable.rst:51 msgid "Return the table's identifier." msgstr "回傳表的識別器。" -#: ../../library/symtable.rst:49 +#: ../../library/symtable.rst:55 msgid "" "Return the table's name. This is the name of the class if the table is for " "a class, the name of the function if the table is for a function, or " -"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``)." +"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). " +"For type parameter scopes (which are used for generic classes, functions, " +"and type aliases), it is the name of the underlying class, function, or type " +"alias. For type alias scopes, it is the name of the type alias. For :class:" +"`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." msgstr "" "回傳表的名稱。如果表用於類別,則這是類別的名稱;如果表用於函式,則這是函式的" "名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " -"``'module'``)。" +"``'module'``)。對於型別參數作用域(用於泛型類別、函式和型別別名),它是底層" +"類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對於 :" +"class:`~typing.TypeVar` 綁定範圍,它會是 ``TypeVar`` 的名稱。" -#: ../../library/symtable.rst:55 +#: ../../library/symtable.rst:65 msgid "Return the number of the first line in the block this table represents." msgstr "回傳此表所代表的區塊中第一行的編號。" -#: ../../library/symtable.rst:59 +#: ../../library/symtable.rst:69 msgid "Return ``True`` if the locals in this table can be optimized." msgstr "如果可以最佳化該表中的區域變數,則回傳 ``True``。" -#: ../../library/symtable.rst:63 +#: ../../library/symtable.rst:73 msgid "Return ``True`` if the block is a nested class or function." msgstr "如果區塊是巢狀類別或函式,則回傳 ``True``。" -#: ../../library/symtable.rst:67 +#: ../../library/symtable.rst:77 msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." @@ -101,7 +120,7 @@ msgstr "" "如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以通過 :meth:`get_children` " "獲得。" -#: ../../library/symtable.rst:72 +#: ../../library/symtable.rst:82 msgid "" "Return a view object containing the names of symbols in the table. See the :" "ref:`documentation of view objects `." @@ -109,97 +128,97 @@ msgstr "" "回傳包含表中符號之名稱的視圖物件 (view object)。請參閱\\ :ref:`視圖物件的文" "件 `。" -#: ../../library/symtable.rst:77 +#: ../../library/symtable.rst:87 msgid "Lookup *name* in the table and return a :class:`Symbol` instance." msgstr "在表中查找 *name* 並回傳一個 :class:`Symbol` 實例。" -#: ../../library/symtable.rst:81 +#: ../../library/symtable.rst:91 msgid "Return a list of :class:`Symbol` instances for names in the table." msgstr "回傳表中名稱的 :class:`Symbol` 實例串列。" -#: ../../library/symtable.rst:85 +#: ../../library/symtable.rst:95 msgid "Return a list of the nested symbol tables." msgstr "回傳巢狀符號表的串列。" -#: ../../library/symtable.rst:90 +#: ../../library/symtable.rst:100 msgid "" "A namespace for a function or method. This class inherits :class:" "`SymbolTable`." msgstr "一個函式或方法的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:95 +#: ../../library/symtable.rst:105 msgid "Return a tuple containing names of parameters to this function." msgstr "回傳一個包含此函式參數名稱的元組 (tuple)。" -#: ../../library/symtable.rst:99 +#: ../../library/symtable.rst:109 msgid "Return a tuple containing names of locals in this function." msgstr "回傳一個包含此函式中區域變數 (locals) 名稱的元組。" -#: ../../library/symtable.rst:103 +#: ../../library/symtable.rst:113 msgid "Return a tuple containing names of globals in this function." msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" -#: ../../library/symtable.rst:107 +#: ../../library/symtable.rst:117 msgid "Return a tuple containing names of nonlocals in this function." msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" -#: ../../library/symtable.rst:111 +#: ../../library/symtable.rst:121 msgid "Return a tuple containing names of free variables in this function." msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" -#: ../../library/symtable.rst:116 +#: ../../library/symtable.rst:126 msgid "A namespace of a class. This class inherits :class:`SymbolTable`." msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:120 +#: ../../library/symtable.rst:130 msgid "Return a tuple containing the names of methods declared in the class." msgstr "回傳一個包含類別中聲明的方法名稱的元組。" -#: ../../library/symtable.rst:125 +#: ../../library/symtable.rst:135 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" ":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" -#: ../../library/symtable.rst:130 +#: ../../library/symtable.rst:140 msgid "Return the symbol's name." msgstr "回傳符號的名稱。" -#: ../../library/symtable.rst:134 +#: ../../library/symtable.rst:144 msgid "Return ``True`` if the symbol is used in its block." msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" -#: ../../library/symtable.rst:138 +#: ../../library/symtable.rst:148 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" -#: ../../library/symtable.rst:142 +#: ../../library/symtable.rst:152 msgid "Return ``True`` if the symbol is a parameter." msgstr "如果符號是一個參數,則回傳 ``True``。" -#: ../../library/symtable.rst:146 +#: ../../library/symtable.rst:156 msgid "Return ``True`` if the symbol is global." msgstr "如果符號是全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:150 +#: ../../library/symtable.rst:160 msgid "Return ``True`` if the symbol is nonlocal." msgstr "如果符號是非區域的,則回傳 ``True``。" -#: ../../library/symtable.rst:154 +#: ../../library/symtable.rst:164 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:158 +#: ../../library/symtable.rst:168 msgid "Return ``True`` if the symbol is local to its block." msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" -#: ../../library/symtable.rst:162 +#: ../../library/symtable.rst:172 msgid "Return ``True`` if the symbol is annotated." msgstr "如果符號有被註釋,則回傳 ``True``。" -#: ../../library/symtable.rst:168 +#: ../../library/symtable.rst:178 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." @@ -207,28 +226,28 @@ msgstr "" "如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " "``True``。" -#: ../../library/symtable.rst:173 +#: ../../library/symtable.rst:183 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" -#: ../../library/symtable.rst:177 +#: ../../library/symtable.rst:187 msgid "Return ``True`` if name binding introduces new namespace." msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" -#: ../../library/symtable.rst:179 +#: ../../library/symtable.rst:189 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" -#: ../../library/symtable.rst:182 +#: ../../library/symtable.rst:192 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/symtable.rst:188 +#: ../../library/symtable.rst:198 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " @@ -237,11 +256,11 @@ msgstr "" "請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" "到其他物件,例如 int 或 list,而不會引入新的命名空間。" -#: ../../library/symtable.rst:194 +#: ../../library/symtable.rst:204 msgid "Return a list of namespaces bound to this name." msgstr "回傳綁定到該名稱的命名空間的串列。" -#: ../../library/symtable.rst:198 +#: ../../library/symtable.rst:208 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 58353e1ae7..00d44ff013 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -302,7 +302,7 @@ msgstr "" #: ../../library/sys.monitoring.rst:150 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " "event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " "corresponding ``CALL`` event is being monitored." msgstr "" diff --git a/library/sys.po b/library/sys.po index 0b47041954..93f7eb9d6e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,7 +966,7 @@ msgstr "" msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " -"module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." +"module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:759 ../../library/sys.rst:1447 @@ -1829,8 +1829,8 @@ msgid "" "enable a lazy resolving of symbols when importing a module, if called as " "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " -"values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :" -"const:`os.RTLD_LAZY`)." +"values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e." +"g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:1451 diff --git a/library/sysconfig.po b/library/sysconfig.po index ed92e796c6..0b9bffd1ea 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -34,227 +33,479 @@ msgid "" "variables relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:24 +#: ../../library/sysconfig.rst:25 msgid "Configuration variables" msgstr "" -#: ../../library/sysconfig.rst:26 +#: ../../library/sysconfig.rst:27 msgid "" "A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` " "header file that are necessary to build both the Python binary itself and " "third-party C extensions compiled using ``setuptools``." msgstr "" -#: ../../library/sysconfig.rst:30 +#: ../../library/sysconfig.rst:31 msgid "" ":mod:`sysconfig` puts all variables found in these files in a dictionary " "that can be accessed using :func:`get_config_vars` or :func:`get_config_var`." msgstr "" -#: ../../library/sysconfig.rst:33 +#: ../../library/sysconfig.rst:34 msgid "Notice that on Windows, it's a much smaller set." msgstr "" -#: ../../library/sysconfig.rst:37 +#: ../../library/sysconfig.rst:38 msgid "" "With no arguments, return a dictionary of all configuration variables " "relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:40 +#: ../../library/sysconfig.rst:41 msgid "" "With arguments, return a list of values that result from looking up each " "argument in the configuration variable dictionary." msgstr "" -#: ../../library/sysconfig.rst:43 +#: ../../library/sysconfig.rst:44 msgid "For each argument, if the value is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:48 +#: ../../library/sysconfig.rst:49 msgid "" "Return the value of a single variable *name*. Equivalent to " "``get_config_vars().get(name)``." msgstr "" -#: ../../library/sysconfig.rst:51 +#: ../../library/sysconfig.rst:52 msgid "If *name* is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:53 +#: ../../library/sysconfig.rst:54 msgid "Example of usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/sysconfig.rst:66 +#: ../../library/sysconfig.rst:68 msgid "Installation paths" msgstr "" -#: ../../library/sysconfig.rst:68 +#: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " "and on the installation options. These schemes are stored in :mod:" "`sysconfig` under unique identifiers based on the value returned by :const:" -"`os.name`." +"`os.name`. The schemes are used by package installers to determine where to " +"copy files to." msgstr "" -#: ../../library/sysconfig.rst:72 -msgid "" -"Every new component that is installed using :mod:`!distutils` or a Distutils-" -"based system will follow the same scheme to copy its file in the right " -"places." -msgstr "" - -#: ../../library/sysconfig.rst:76 +#: ../../library/sysconfig.rst:75 msgid "Python currently supports nine schemes:" msgstr "" -#: ../../library/sysconfig.rst:78 +#: ../../library/sysconfig.rst:77 msgid "" "*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the " "default scheme used when Python or a component is installed." msgstr "" -#: ../../library/sysconfig.rst:80 +#: ../../library/sysconfig.rst:79 msgid "" -"*posix_home*: scheme for POSIX platforms used when a *home* option is used " -"upon installation. This scheme is used when a component is installed " -"through Distutils with a specific home prefix." +"*posix_home*: scheme for POSIX platforms, when the *home* option is used. " +"This scheme defines paths located under a specific home prefix." msgstr "" -#: ../../library/sysconfig.rst:83 +#: ../../library/sysconfig.rst:81 msgid "" -"*posix_user*: scheme for POSIX platforms used when a component is installed " -"through Distutils and the *user* option is used. This scheme defines paths " -"located under the user home directory." +"*posix_user*: scheme for POSIX platforms, when the *user* option is used. " +"This scheme defines paths located under the user's home directory (:const:" +"`site.USER_BASE`)." msgstr "" -#: ../../library/sysconfig.rst:86 +#: ../../library/sysconfig.rst:84 msgid "" "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " "platforms; by default it is the same as *posix_prefix*." msgstr "" -#: ../../library/sysconfig.rst:88 -msgid "*nt*: scheme for NT platforms like Windows." +#: ../../library/sysconfig.rst:86 +msgid "" +"*nt*: scheme for Windows. This is the default scheme used when Python or a " +"component is installed." msgstr "" -#: ../../library/sysconfig.rst:89 -msgid "*nt_user*: scheme for NT platforms, when the *user* option is used." +#: ../../library/sysconfig.rst:88 +msgid "*nt_user*: scheme for Windows, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:90 +#: ../../library/sysconfig.rst:89 msgid "" -"*nt_venv*: scheme for :mod:`Python virtual environments ` on NT " -"platforms; by default it is the same as *nt*." +"*nt_venv*: scheme for :mod:`Python virtual environments ` on Windows; " +"by default it is the same as *nt*." msgstr "" -#: ../../library/sysconfig.rst:92 +#: ../../library/sysconfig.rst:91 msgid "" "*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending " "on the platform Python runs on." msgstr "" -#: ../../library/sysconfig.rst:94 +#: ../../library/sysconfig.rst:93 msgid "*osx_framework_user*: scheme for macOS, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:96 +#: ../../library/sysconfig.rst:95 msgid "" "Each scheme is itself composed of a series of paths and each path has a " "unique identifier. Python currently uses eight paths:" msgstr "" -#: ../../library/sysconfig.rst:99 +#: ../../library/sysconfig.rst:98 msgid "" "*stdlib*: directory containing the standard Python library files that are " "not platform-specific." msgstr "" -#: ../../library/sysconfig.rst:101 +#: ../../library/sysconfig.rst:100 msgid "" "*platstdlib*: directory containing the standard Python library files that " "are platform-specific." msgstr "" -#: ../../library/sysconfig.rst:103 +#: ../../library/sysconfig.rst:102 msgid "*platlib*: directory for site-specific, platform-specific files." msgstr "" -#: ../../library/sysconfig.rst:104 -msgid "*purelib*: directory for site-specific, non-platform-specific files." +#: ../../library/sysconfig.rst:103 +msgid "" +"*purelib*: directory for site-specific, non-platform-specific files ('pure' " +"Python)." msgstr "" -#: ../../library/sysconfig.rst:105 +#: ../../library/sysconfig.rst:104 msgid "" "*include*: directory for non-platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:107 +#: ../../library/sysconfig.rst:106 msgid "" "*platinclude*: directory for platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:109 +#: ../../library/sysconfig.rst:108 msgid "*scripts*: directory for script files." msgstr "" -#: ../../library/sysconfig.rst:110 +#: ../../library/sysconfig.rst:109 msgid "*data*: directory for data files." msgstr "" -#: ../../library/sysconfig.rst:112 -msgid ":mod:`sysconfig` provides some functions to determine these paths." +#: ../../library/sysconfig.rst:115 +msgid "User scheme" +msgstr "" + +#: ../../library/sysconfig.rst:117 +msgid "" +"This scheme is designed to be the most convenient solution for users that " +"don't have write permission to the global site-packages directory or don't " +"want to install into it." msgstr "" -#: ../../library/sysconfig.rst:116 +#: ../../library/sysconfig.rst:121 +msgid "" +"Files will be installed into subdirectories of :const:`site.USER_BASE` " +"(written as :file:`{userbase}` hereafter). This scheme installs pure Python " +"modules and extension modules in the same location (also known as :const:" +"`site.USER_SITE`)." +msgstr "" + +#: ../../library/sysconfig.rst:126 +msgid "``posix_user``" +msgstr "``posix_user``" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Path" +msgstr "" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Installation directory" +msgstr "" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:146 +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:247 +msgid "*stdlib*" +msgstr "*stdlib*" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:132 +msgid ":file:`{userbase}/lib/python{X.Y}`" +msgstr ":file:`{userbase}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:132 ../../library/sysconfig.rst:147 +#: ../../library/sysconfig.rst:162 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:232 ../../library/sysconfig.rst:248 +msgid "*platstdlib*" +msgstr "*platstdlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:148 +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:191 +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:249 +msgid "*platlib*" +msgstr "*platlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:134 +msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:134 ../../library/sysconfig.rst:149 +#: ../../library/sysconfig.rst:164 ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:234 ../../library/sysconfig.rst:250 +msgid "*purelib*" +msgstr "*purelib*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:150 +#: ../../library/sysconfig.rst:165 ../../library/sysconfig.rst:193 +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:251 +msgid "*include*" +msgstr "*include*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:165 +msgid ":file:`{userbase}/include/python{X.Y}`" +msgstr ":file:`{userbase}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:166 ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:237 ../../library/sysconfig.rst:253 +msgid "*scripts*" +msgstr "*scripts*" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:166 +msgid ":file:`{userbase}/bin`" +msgstr ":file:`{userbase}/bin`" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 ../../library/sysconfig.rst:196 +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid "*data*" +msgstr "*data*" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 +msgid ":file:`{userbase}`" +msgstr ":file:`{userbase}`" + +#: ../../library/sysconfig.rst:141 +msgid "``nt_user``" +msgstr "``nt_user``" + +#: ../../library/sysconfig.rst:146 ../../library/sysconfig.rst:147 +msgid ":file:`{userbase}\\\\Python{XY}`" +msgstr ":file:`{userbase}\\\\Python{XY}`" + +#: ../../library/sysconfig.rst:148 ../../library/sysconfig.rst:149 +msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" + +#: ../../library/sysconfig.rst:150 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Include`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include`" + +#: ../../library/sysconfig.rst:151 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" + +#: ../../library/sysconfig.rst:156 +msgid "``osx_framework_user``" +msgstr "``osx_framework_user``" + +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:162 +msgid ":file:`{userbase}/lib/python`" +msgstr ":file:`{userbase}/lib/python`" + +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:164 +msgid ":file:`{userbase}/lib/python/site-packages`" +msgstr ":file:`{userbase}/lib/python/site-packages`" + +#: ../../library/sysconfig.rst:174 +msgid "Home scheme" +msgstr "" + +#: ../../library/sysconfig.rst:176 +msgid "" +"The idea behind the \"home scheme\" is that you build and maintain a " +"personal stash of Python modules. This scheme's name is derived from the " +"idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " +"to make their home directory have a layout similar to :file:`/usr/` or :file:" +"`/usr/local/`. This scheme can be used by anyone, regardless of the " +"operating system they are installing for." +msgstr "" + +#: ../../library/sysconfig.rst:184 +msgid "``posix_home``" +msgstr "``posix_home``" + +#: ../../library/sysconfig.rst:189 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:191 ../../library/sysconfig.rst:192 +msgid ":file:`{home}/lib/python`" +msgstr ":file:`{home}/lib/python`" + +#: ../../library/sysconfig.rst:193 ../../library/sysconfig.rst:194 +msgid ":file:`{home}/include/python`" +msgstr ":file:`{home}/include/python`" + +#: ../../library/sysconfig.rst:194 ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:252 +msgid "*platinclude*" +msgstr "*platinclude*" + +#: ../../library/sysconfig.rst:195 +msgid ":file:`{home}/bin`" +msgstr ":file:`{home}/bin`" + +#: ../../library/sysconfig.rst:196 +msgid ":file:`{home}`" +msgstr ":file:`{home}`" + +#: ../../library/sysconfig.rst:203 +msgid "Prefix scheme" +msgstr "" + +#: ../../library/sysconfig.rst:205 +msgid "" +"The \"prefix scheme\" is useful when you wish to use one Python installation " +"to perform the build/install (i.e., to run the setup script), but install " +"modules into the third-party module directory of a different Python " +"installation (or something that looks like a different Python " +"installation). If this sounds a trifle unusual, it is---that's why the user " +"and home schemes come before. However, there are at least two known cases " +"where the prefix scheme will be useful." +msgstr "" + +#: ../../library/sysconfig.rst:212 +msgid "" +"First, consider that many Linux distributions put Python in :file:`/usr`, " +"rather than the more traditional :file:`/usr/local`. This is entirely " +"appropriate, since in those cases Python is part of \"the system\" rather " +"than a local add-on. However, if you are installing Python modules from " +"source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` " +"rather than :file:`/usr/lib/python2.{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:219 +msgid "" +"Another possibility is a network filesystem where the name used to write to " +"a remote directory is different from the name used to read it: for example, " +"the Python interpreter accessed as :file:`/usr/local/bin/python` might " +"search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules " +"would have to be installed to, say, :file:`/mnt/{@server}/export/lib/python2." +"{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:226 +msgid "``posix_prefix``" +msgstr "``posix_prefix``" + +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:232 +msgid ":file:`{prefix}/lib/python{X.Y}`" +msgstr ":file:`{prefix}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:234 +msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:236 +msgid ":file:`{prefix}/include/python{X.Y}`" +msgstr ":file:`{prefix}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:237 +msgid ":file:`{prefix}/bin`" +msgstr ":file:`{prefix}/bin`" + +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid ":file:`{prefix}`" +msgstr ":file:`{prefix}`" + +#: ../../library/sysconfig.rst:242 +msgid "``nt``" +msgstr "``nt``" + +#: ../../library/sysconfig.rst:247 ../../library/sysconfig.rst:248 +msgid ":file:`{prefix}\\\\Lib`" +msgstr ":file:`{prefix}\\\\Lib`" + +#: ../../library/sysconfig.rst:249 ../../library/sysconfig.rst:250 +msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" +msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" + +#: ../../library/sysconfig.rst:251 ../../library/sysconfig.rst:252 +msgid ":file:`{prefix}\\\\Include`" +msgstr ":file:`{prefix}\\\\Include`" + +#: ../../library/sysconfig.rst:253 +msgid ":file:`{prefix}\\\\Scripts`" +msgstr ":file:`{prefix}\\\\Scripts`" + +#: ../../library/sysconfig.rst:259 +msgid "Installation path functions" +msgstr "安裝路徑函式" + +#: ../../library/sysconfig.rst:261 +msgid "" +":mod:`sysconfig` provides some functions to determine these installation " +"paths." +msgstr "" + +#: ../../library/sysconfig.rst:265 msgid "" "Return a tuple containing all schemes currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:122 +#: ../../library/sysconfig.rst:271 msgid "Return the default scheme name for the current platform." msgstr "" -#: ../../library/sysconfig.rst:124 +#: ../../library/sysconfig.rst:273 msgid "" "This function was previously named ``_get_default_scheme()`` and considered " "an implementation detail." msgstr "" -#: ../../library/sysconfig.rst:128 +#: ../../library/sysconfig.rst:277 msgid "" "When Python runs from a virtual environment, the *venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:134 +#: ../../library/sysconfig.rst:283 msgid "" "Return a preferred scheme name for an installation layout specified by *key*." msgstr "" -#: ../../library/sysconfig.rst:136 +#: ../../library/sysconfig.rst:285 msgid "*key* must be either ``\"prefix\"``, ``\"home\"``, or ``\"user\"``." msgstr "" -#: ../../library/sysconfig.rst:138 +#: ../../library/sysconfig.rst:287 msgid "" "The return value is a scheme name listed in :func:`get_scheme_names`. It can " "be passed to :mod:`sysconfig` functions that take a *scheme* argument, such " "as :func:`get_paths`." msgstr "" -#: ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:293 msgid "" "When Python runs from a virtual environment and ``key=\"prefix\"``, the " "*venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:300 msgid "" "Return a dict containing preferred scheme names on the current platform. " "Python implementers and redistributors may add their preferred schemes to " @@ -264,109 +515,111 @@ msgid "" "mix with those by the other." msgstr "" -#: ../../library/sysconfig.rst:158 +#: ../../library/sysconfig.rst:307 msgid "" "End users should not use this function, but :func:`get_default_scheme` and :" "func:`get_preferred_scheme()` instead." msgstr "" -#: ../../library/sysconfig.rst:166 +#: ../../library/sysconfig.rst:315 msgid "" "Return a tuple containing all path names currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:172 +#: ../../library/sysconfig.rst:321 msgid "" "Return an installation path corresponding to the path *name*, from the " "install scheme named *scheme*." msgstr "" -#: ../../library/sysconfig.rst:175 +#: ../../library/sysconfig.rst:324 msgid "" "*name* has to be a value from the list returned by :func:`get_path_names`." msgstr "" -#: ../../library/sysconfig.rst:177 +#: ../../library/sysconfig.rst:326 msgid "" ":mod:`sysconfig` stores installation paths corresponding to each path name, " "for each platform, with variables to be expanded. For instance the *stdlib* " "path for the *nt* scheme is: ``{base}/Lib``." msgstr "" -#: ../../library/sysconfig.rst:181 +#: ../../library/sysconfig.rst:330 msgid "" ":func:`get_path` will use the variables returned by :func:`get_config_vars` " "to expand the path. All variables have default values for each platform so " "one may call this function and get the default value." msgstr "" -#: ../../library/sysconfig.rst:185 +#: ../../library/sysconfig.rst:334 msgid "" "If *scheme* is provided, it must be a value from the list returned by :func:" "`get_scheme_names`. Otherwise, the default scheme for the current platform " "is used." msgstr "" -#: ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:338 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary returned by :func:`get_config_vars`." msgstr "" -#: ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:341 msgid "" "If *expand* is set to ``False``, the path will not be expanded using the " "variables." msgstr "" -#: ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:344 msgid "If *name* is not found, raise a :exc:`KeyError`." -msgstr "" +msgstr "如果找不到 *name*,則引發 :exc:`KeyError`。" -#: ../../library/sysconfig.rst:200 +#: ../../library/sysconfig.rst:349 msgid "" "Return a dictionary containing all installation paths corresponding to an " "installation scheme. See :func:`get_path` for more information." msgstr "" -#: ../../library/sysconfig.rst:203 +#: ../../library/sysconfig.rst:352 msgid "" "If *scheme* is not provided, will use the default scheme for the current " "platform." msgstr "" -#: ../../library/sysconfig.rst:206 +#: ../../library/sysconfig.rst:355 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary used to expand the paths." msgstr "" -#: ../../library/sysconfig.rst:209 +#: ../../library/sysconfig.rst:358 msgid "If *expand* is set to false, the paths will not be expanded." msgstr "" -#: ../../library/sysconfig.rst:211 +#: ../../library/sysconfig.rst:360 msgid "" "If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:" "`KeyError`." msgstr "" -#: ../../library/sysconfig.rst:216 +#: ../../library/sysconfig.rst:365 msgid "Other functions" msgstr "其他函式" -#: ../../library/sysconfig.rst:220 +#: ../../library/sysconfig.rst:369 msgid "" "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " "``'%d.%d' % sys.version_info[:2]``." msgstr "" +"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % sys." +"version_info[:2]``。" -#: ../../library/sysconfig.rst:226 +#: ../../library/sysconfig.rst:375 msgid "Return a string that identifies the current platform." msgstr "" -#: ../../library/sysconfig.rst:228 +#: ../../library/sysconfig.rst:377 msgid "" "This is used mainly to distinguish platform-specific build directories and " "platform-specific built distributions. Typically includes the OS name and " @@ -375,99 +628,99 @@ msgid "" "version isn't particularly important." msgstr "" -#: ../../library/sysconfig.rst:234 +#: ../../library/sysconfig.rst:383 msgid "Examples of returned values:" msgstr "" -#: ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:385 msgid "linux-i586" msgstr "linux-i586" -#: ../../library/sysconfig.rst:237 +#: ../../library/sysconfig.rst:386 msgid "linux-alpha (?)" msgstr "linux-alpha (?)" -#: ../../library/sysconfig.rst:238 +#: ../../library/sysconfig.rst:387 msgid "solaris-2.6-sun4u" msgstr "solaris-2.6-sun4u" -#: ../../library/sysconfig.rst:240 +#: ../../library/sysconfig.rst:389 msgid "Windows will return one of:" msgstr "" -#: ../../library/sysconfig.rst:242 +#: ../../library/sysconfig.rst:391 msgid "win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" -#: ../../library/sysconfig.rst:243 +#: ../../library/sysconfig.rst:392 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:245 +#: ../../library/sysconfig.rst:394 msgid "macOS can return:" msgstr "" -#: ../../library/sysconfig.rst:247 +#: ../../library/sysconfig.rst:396 msgid "macosx-10.6-ppc" msgstr "macosx-10.6-ppc" -#: ../../library/sysconfig.rst:248 +#: ../../library/sysconfig.rst:397 msgid "macosx-10.4-ppc64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:249 +#: ../../library/sysconfig.rst:398 msgid "macosx-10.3-i386" msgstr "macosx-10.3-i386" -#: ../../library/sysconfig.rst:250 +#: ../../library/sysconfig.rst:399 msgid "macosx-10.4-fat" msgstr "macosx-10.4-fat" -#: ../../library/sysconfig.rst:252 +#: ../../library/sysconfig.rst:401 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:257 +#: ../../library/sysconfig.rst:406 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:264 +#: ../../library/sysconfig.rst:413 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:266 +#: ../../library/sysconfig.rst:415 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:268 +#: ../../library/sysconfig.rst:417 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:275 +#: ../../library/sysconfig.rst:424 msgid "Return the path of :file:`pyconfig.h`." -msgstr "" +msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:279 +#: ../../library/sysconfig.rst:428 msgid "Return the path of :file:`Makefile`." -msgstr "" +msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:283 +#: ../../library/sysconfig.rst:433 msgid "Using :mod:`sysconfig` as a script" -msgstr "" +msgstr "將 :mod:`sysconfig` 作為腳本使用" -#: ../../library/sysconfig.rst:285 +#: ../../library/sysconfig.rst:435 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:311 +#: ../../library/sysconfig.rst:461 msgid "" "This call will print in the standard output the information returned by :" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" diff --git a/library/textwrap.po b/library/textwrap.po index b3e2baf799..8bb1b9de67 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -253,8 +253,8 @@ msgid "" "However, the sentence detection algorithm is imperfect: it assumes that a " "sentence ending consists of a lowercase letter followed by one of ``'.'``, " "``'!'``, or ``'?'``, possibly followed by one of ``'\"'`` or ``\"'\"``, " -"followed by a space. One problem with this is algorithm is that it is " -"unable to detect the difference between \"Dr.\" in ::" +"followed by a space. One problem with this algorithm is that it is unable " +"to detect the difference between \"Dr.\" in ::" msgstr "" #: ../../library/textwrap.rst:246 diff --git a/library/timeit.po b/library/timeit.po index e750ba6a16..5320b6898d 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgid "" "the total time >= 0.2 second, returning the eventual (number of loops, time " "taken for that number of loops). It calls :meth:`.timeit` with increasing " "numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " -"at least 0.2 second." +"at least 0.2 seconds." msgstr "" "這是一個便捷函式,它重複呼叫 :meth:`.timeit` 以使得總時間 >= 0.2 秒,再回傳最" "終結果(迴圈數、該迴圈數所花費的時間)。它以 1、2、5、10、20、50... 的順序遞" diff --git a/library/tty.po b/library/tty.po index 1a933d2ef3..112a009880 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,7 +67,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:49 +#: ../../library/tty.rst:46 ../../library/tty.rst:57 +msgid "The return value is now the original tty attributes, instead of None." +msgstr "" + +#: ../../library/tty.rst:52 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -78,10 +82,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:57 +#: ../../library/tty.rst:63 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:58 +#: ../../library/tty.rst:64 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 5a8c520a50..59abe80c15 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-11 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2873 -#: ../../library/typing.rst:3015 +#: ../../library/typing.rst:271 ../../library/typing.rst:2888 +#: ../../library/typing.rst:3030 msgid "For example:" msgstr "舉例來說:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3544 +#: ../../library/typing.rst:341 ../../library/typing.rst:3559 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -870,7 +870,7 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 #: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2813 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1260,8 +1260,8 @@ msgstr "" #: ../../library/typing.rst:1293 msgid "" -"The responsibility of how to interpret the metadata lies with the the tool " -"or library encountering an ``Annotated`` annotation. A tool or library " +"The responsibility of how to interpret the metadata lies with the tool or " +"library encountering an ``Annotated`` annotation. A tool or library " "encountering an ``Annotated`` type can scan through the metadata elements to " "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" @@ -1864,7 +1864,7 @@ msgid "Typed version of :func:`collections.namedtuple`." msgstr "" #: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3055 +#: ../../library/typing.rst:3070 msgid "Usage::" msgstr "" @@ -2153,21 +2153,32 @@ msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2401 +#: ../../library/typing.rst:2395 +msgid "" +"This attribute reflects *only* the value of the ``total`` argument to the " +"current ``TypedDict`` class, not whether the class is semantically total. " +"For example, a ``TypedDict`` with ``__total__`` set to True may have keys " +"marked with :data:`NotRequired`, or it may inherit from another " +"``TypedDict`` with ``total=False``. Therefore, it is generally better to " +"use :attr:`__required_keys__` and :attr:`__optional_keys__` for " +"introspection." +msgstr "" + +#: ../../library/typing.rst:2408 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2411 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2414 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -2176,133 +2187,142 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2430 +#: ../../library/typing.rst:2439 +msgid "" +"If ``from __future__ import annotations`` is used or if annotations are " +"given as strings, annotations are not evaluated when the ``TypedDict`` is " +"defined. Therefore, the runtime introspection that ``__required_keys__`` and " +"``__optional_keys__`` rely on may not work properly, and the values of the " +"attributes may be incorrect." +msgstr "" + +#: ../../library/typing.rst:2445 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2434 +#: ../../library/typing.rst:2449 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2438 +#: ../../library/typing.rst:2453 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2442 +#: ../../library/typing.rst:2457 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2444 +#: ../../library/typing.rst:2459 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2464 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2469 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2472 +#: ../../library/typing.rst:2487 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2491 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2480 +#: ../../library/typing.rst:2495 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2501 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:2492 +#: ../../library/typing.rst:2507 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2511 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2513 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:2505 +#: ../../library/typing.rst:2520 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2522 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2510 +#: ../../library/typing.rst:2525 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2517 +#: ../../library/typing.rst:2532 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2546 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2548 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2559 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2564 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2312,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2557 +#: ../../library/typing.rst:2572 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2575 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2583 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2585 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2576 +#: ../../library/typing.rst:2591 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2579 +#: ../../library/typing.rst:2594 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2584 +#: ../../library/typing.rst:2599 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2589 +#: ../../library/typing.rst:2604 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2601 +#: ../../library/typing.rst:2616 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2619 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2373,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2611 +#: ../../library/typing.rst:2626 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2625 +#: ../../library/typing.rst:2640 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2634 +#: ../../library/typing.rst:2649 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2645 +#: ../../library/typing.rst:2660 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2783 +#: ../../library/typing.rst:2798 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2603,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2805 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2813 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2815 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2822 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2809 +#: ../../library/typing.rst:2824 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2849 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2638,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2860 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2862 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2650,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2853 +#: ../../library/typing.rst:2868 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2857 +#: ../../library/typing.rst:2872 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2859 +#: ../../library/typing.rst:2874 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2880 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2883 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2890 +#: ../../library/typing.rst:2905 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2907 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2691,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2914 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2921 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2908 +#: ../../library/typing.rst:2923 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:2919 +#: ../../library/typing.rst:2934 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2938 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2942 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2945 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2731,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2951 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:2953 +#: ../../library/typing.rst:2968 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:2958 +#: ../../library/typing.rst:2973 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2753,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2962 +#: ../../library/typing.rst:2977 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2969 +#: ../../library/typing.rst:2984 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2972 +#: ../../library/typing.rst:2987 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2774,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 +#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:3008 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2996 +#: ../../library/typing.rst:3011 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2792,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3028 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3049 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3051 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3041 +#: ../../library/typing.rst:3056 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:3048 +#: ../../library/typing.rst:3063 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3067 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3078 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2833,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3085 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2841,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3082 +#: ../../library/typing.rst:3097 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3099 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2854,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3106 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2862,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3111 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2870,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3116 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3107 +#: ../../library/typing.rst:3122 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3126 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3128 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3117 ../../library/typing.rst:3359 +#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3137 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3143 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3145 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3134 +#: ../../library/typing.rst:3149 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3142 +#: ../../library/typing.rst:3157 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3148 +#: ../../library/typing.rst:3163 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3165 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3169 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3175 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3162 +#: ../../library/typing.rst:3177 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3184 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3186 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3189 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3180 +#: ../../library/typing.rst:3195 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3197 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3187 +#: ../../library/typing.rst:3202 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3194 +#: ../../library/typing.rst:3209 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3198 +#: ../../library/typing.rst:3213 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3217 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3208 +#: ../../library/typing.rst:3223 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3227 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3233 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3238 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3229 +#: ../../library/typing.rst:3244 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3249 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3255 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3260 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3252 +#: ../../library/typing.rst:3267 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3257 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3276 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3279 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3059,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3287 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3273 +#: ../../library/typing.rst:3288 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3294 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3296 msgid "" "``Text`` 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:3285 +#: ../../library/typing.rst:3300 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:3293 +#: ../../library/typing.rst:3308 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3303 +#: ../../library/typing.rst:3318 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3322 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3324 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3315 +#: ../../library/typing.rst:3330 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3319 +#: ../../library/typing.rst:3334 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3323 +#: ../../library/typing.rst:3338 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3327 +#: ../../library/typing.rst:3342 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3333 +#: ../../library/typing.rst:3348 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3335 +#: ../../library/typing.rst:3350 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3341 +#: ../../library/typing.rst:3356 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3343 +#: ../../library/typing.rst:3358 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3349 +#: ../../library/typing.rst:3364 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3351 +#: ../../library/typing.rst:3366 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3357 +#: ../../library/typing.rst:3372 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3379 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3385 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3387 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3378 +#: ../../library/typing.rst:3393 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3380 +#: ../../library/typing.rst:3395 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3402 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3389 +#: ../../library/typing.rst:3404 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3396 +#: ../../library/typing.rst:3411 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3398 +#: ../../library/typing.rst:3413 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3419 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3406 +#: ../../library/typing.rst:3421 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3412 +#: ../../library/typing.rst:3427 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3414 +#: ../../library/typing.rst:3429 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3436 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3425 +#: ../../library/typing.rst:3440 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3442 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3438 +#: ../../library/typing.rst:3453 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3444 +#: ../../library/typing.rst:3459 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3446 +#: ../../library/typing.rst:3461 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3455 +#: ../../library/typing.rst:3470 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:3459 +#: ../../library/typing.rst:3474 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3467 +#: ../../library/typing.rst:3482 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3477 +#: ../../library/typing.rst:3492 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3484 +#: ../../library/typing.rst:3499 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3488 +#: ../../library/typing.rst:3503 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3494 +#: ../../library/typing.rst:3509 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3513 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3504 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3508 +#: ../../library/typing.rst:3523 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3515 +#: ../../library/typing.rst:3530 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3534 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3521 +#: ../../library/typing.rst:3536 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3527 +#: ../../library/typing.rst:3542 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3529 +#: ../../library/typing.rst:3544 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3535 +#: ../../library/typing.rst:3550 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3537 +#: ../../library/typing.rst:3552 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3540 +#: ../../library/typing.rst:3555 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3565 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3567 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3561 +#: ../../library/typing.rst:3576 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:3565 +#: ../../library/typing.rst:3580 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3573 +#: ../../library/typing.rst:3588 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3581 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3587 +#: ../../library/typing.rst:3602 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3589 +#: ../../library/typing.rst:3604 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3594 +#: ../../library/typing.rst:3609 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3611 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3617 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3619 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3610 +#: ../../library/typing.rst:3625 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3614 +#: ../../library/typing.rst:3629 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3634 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3626 +#: ../../library/typing.rst:3641 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3631 +#: ../../library/typing.rst:3646 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3637 +#: ../../library/typing.rst:3652 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3639 +#: ../../library/typing.rst:3654 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3451,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3661 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3647 +#: ../../library/typing.rst:3662 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3648 +#: ../../library/typing.rst:3663 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3649 +#: ../../library/typing.rst:3664 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3650 +#: ../../library/typing.rst:3665 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3651 +#: ../../library/typing.rst:3666 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3667 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3653 +#: ../../library/typing.rst:3668 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3669 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 +#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3671 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3657 +#: ../../library/typing.rst:3672 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3658 +#: ../../library/typing.rst:3673 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3660 +#: ../../library/typing.rst:3675 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3676 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3677 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3678 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 +#: ../../library/typing.rst:3687 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3680 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3681 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3684 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3670 +#: ../../library/typing.rst:3685 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3688 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/urllib.error.po b/library/urllib.error.po index 5f9fa4e6df..6a7e30dd7a 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,10 +60,11 @@ msgstr "此錯誤的原因。它可以是一個訊息字串或另一個例外實 #: ../../library/urllib.error.rst:29 msgid "" -":exc:`URLError` has been made a subclass of :exc:`OSError` instead of :exc:" -"`IOError`." +":exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" -":exc:`URLError` 已被設為 :exc:`OSError` 而不是 :exc:`IOError` 的子類別。" +":exc:`URLError` 過去是 :exc:`OSError` 的子類別,但現在為 :exc:`OSError` 的別" +"名。" #: ../../library/urllib.error.rst:36 msgid "" @@ -78,7 +79,7 @@ msgstr "" #: ../../library/urllib.error.rst:44 msgid "Contains the request URL. An alias for *filename* attribute." -msgstr "" +msgstr "包含請求 URL。*filename* 屬性的別名。" #: ../../library/urllib.error.rst:49 msgid "" @@ -105,7 +106,7 @@ msgstr "" #: ../../library/urllib.error.rst:68 msgid "A file-like object where the HTTP error body can be read from." -msgstr "" +msgstr "一個類檔案物件,可以從中讀取 HTTP 錯誤主體 (body)。" #: ../../library/urllib.error.rst:72 msgid "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 83389d4993..633427da03 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-06 00:19+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -705,11 +705,11 @@ msgstr "" #: ../../library/urllib.parse.rst:601 msgid "" -"Replace special characters in *string* using the ``%xx`` escape. Letters, " -"digits, and the characters ``'_.-~'`` are never quoted. By default, this " -"function is intended for quoting the path section of a URL. The optional " -"*safe* parameter specifies additional ASCII characters that should not be " -"quoted --- its default value is ``'/'``." +"Replace special characters in *string* using the :samp:`%{xx}` escape. " +"Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " +"this function is intended for quoting the path section of a URL. The " +"optional *safe* parameter specifies additional ASCII characters that should " +"not be quoted --- its default value is ``'/'``." msgstr "" #: ../../library/urllib.parse.rst:607 ../../library/urllib.parse.rst:653 @@ -767,10 +767,10 @@ msgstr "" #: ../../library/urllib.parse.rst:648 msgid "" -"Replace ``%xx`` escapes with their single-character equivalent. The optional " -"*encoding* and *errors* parameters specify how to decode percent-encoded " -"sequences into Unicode characters, as accepted by the :meth:`bytes.decode` " -"method." +"Replace :samp:`%{xx}` escapes with their single-character equivalent. The " +"optional *encoding* and *errors* parameters specify how to decode percent-" +"encoded sequences into Unicode characters, as accepted by the :meth:`bytes." +"decode` method." msgstr "" #: ../../library/urllib.parse.rst:655 @@ -804,8 +804,8 @@ msgstr "" #: ../../library/urllib.parse.rst:679 msgid "" -"Replace ``%xx`` escapes with their single-octet equivalent, and return a :" -"class:`bytes` object." +"Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " +"a :class:`bytes` object." msgstr "" #: ../../library/urllib.parse.rst:684 diff --git a/library/venv.po b/library/venv.po index 9b857481d1..65b4bad59c 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,10 +46,45 @@ msgid "" msgstr "" #: ../../library/venv.rst:33 +msgid "A virtual environment is (amongst other things):" +msgstr "" + +#: ../../library/venv.rst:35 +msgid "" +"Used to contain a specific Python interpreter and software libraries and " +"binaries which are needed to support a project (library or application). " +"These are by default isolated from software in other virtual environments " +"and Python interpreters and libraries installed in the operating system." +msgstr "" + +#: ../../library/venv.rst:40 +msgid "" +"Contained in a directory, conventionally either named ``venv`` or ``.venv`` " +"in the project directory, or under a container directory for lots of virtual " +"environments, such as ``~/.virtualenvs``." +msgstr "" + +#: ../../library/venv.rst:44 +msgid "Not checked into source control systems such as Git." +msgstr "" + +#: ../../library/venv.rst:46 +msgid "" +"Considered as disposable -- it should be simple to delete and recreate it " +"from scratch. You don't place any project code in the environment" +msgstr "" + +#: ../../library/venv.rst:49 +msgid "" +"Not considered as movable or copyable -- you just recreate the same " +"environment in the target location." +msgstr "" + +#: ../../library/venv.rst:52 msgid "See :pep:`405` for more background on Python virtual environments." msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" -#: ../../library/venv.rst:37 +#: ../../library/venv.rst:56 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:79 ../../library/venv.rst:83 +#: ../../library/venv.rst:98 ../../library/venv.rst:102 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:79 +#: ../../library/venv.rst:98 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:83 +#: ../../library/venv.rst:102 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:86 +#: ../../library/venv.rst:105 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:89 +#: ../../library/venv.rst:108 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:93 +#: ../../library/venv.rst:112 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -331,7 +366,7 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:99 +#: ../../library/venv.rst:118 msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, i.e. :" @@ -349,7 +384,7 @@ msgstr "" "(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :" "envvar:`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:108 +#: ../../library/venv.rst:127 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -361,7 +396,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:114 +#: ../../library/venv.rst:133 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -378,13 +413,13 @@ msgid "" msgstr "" "因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" "環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" -"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt`` " -"的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所" -"需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重" -"新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新" -"位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements." +"txt`` 的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝" +"環境所需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需" +"位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" +"該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:128 +#: ../../library/venv.rst:147 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -393,11 +428,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:136 +#: ../../library/venv.rst:155 msgid "API" msgstr "API" -#: ../../library/venv.rst:140 +#: ../../library/venv.rst:159 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -407,13 +442,13 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:148 +#: ../../library/venv.rst:167 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:151 +#: ../../library/venv.rst:170 msgid "" "``system_site_packages`` -- a Boolean value indicating that the system " "Python site-packages should be available to the environment (defaults to " @@ -422,7 +457,7 @@ msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:154 +#: ../../library/venv.rst:173 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." @@ -430,7 +465,7 @@ msgstr "" "``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目標目錄內所" "有存在的內容。" -#: ../../library/venv.rst:157 +#: ../../library/venv.rst:176 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." @@ -438,7 +473,7 @@ msgstr "" "``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建立符號連" "結而不是複製該檔案。" -#: ../../library/venv.rst:160 +#: ../../library/venv.rst:179 msgid "" "``upgrade`` -- a Boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " @@ -447,7 +482,7 @@ msgstr "" "``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現有的環境進" "行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:164 +#: ../../library/venv.rst:183 msgid "" "``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" @@ -456,7 +491,7 @@ msgstr "" "``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。" "當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:168 +#: ../../library/venv.rst:187 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -467,23 +502,23 @@ msgstr "" "為 ``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則當" "前目錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:173 +#: ../../library/venv.rst:192 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:175 ../../library/venv.rst:353 +#: ../../library/venv.rst:194 ../../library/venv.rst:372 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:178 ../../library/venv.rst:356 +#: ../../library/venv.rst:197 ../../library/venv.rst:375 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:181 ../../library/venv.rst:359 +#: ../../library/venv.rst:200 ../../library/venv.rst:378 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:184 +#: ../../library/venv.rst:203 msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." @@ -491,11 +526,11 @@ msgstr "" "第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 base " "class(基底類別)使用." -#: ../../library/venv.rst:187 +#: ../../library/venv.rst:206 msgid "The returned env-builder is an object which has a method, ``create``:" msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" -#: ../../library/venv.rst:191 +#: ../../library/venv.rst:210 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -506,7 +541,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:197 +#: ../../library/venv.rst:216 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -514,7 +549,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:231 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -523,7 +558,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:237 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -537,7 +572,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:244 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -545,81 +580,81 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:228 +#: ../../library/venv.rst:247 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:231 +#: ../../library/venv.rst:250 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:234 +#: ../../library/venv.rst:253 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:237 +#: ../../library/venv.rst:256 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " "created from another virtual environment." msgstr "" -#: ../../library/venv.rst:241 +#: ../../library/venv.rst:260 msgid "``inc_path`` - The include path for the virtual environment." msgstr "" -#: ../../library/venv.rst:243 +#: ../../library/venv.rst:262 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "" -#: ../../library/venv.rst:245 +#: ../../library/venv.rst:264 msgid "``bin_path`` - The script path for the virtual environment." msgstr "" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:266 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " "(see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:251 +#: ../../library/venv.rst:270 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" "`install_scripts`)." msgstr "" -#: ../../library/venv.rst:255 +#: ../../library/venv.rst:274 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " "environment." msgstr "" -#: ../../library/venv.rst:260 +#: ../../library/venv.rst:279 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "" -#: ../../library/venv.rst:264 +#: ../../library/venv.rst:283 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." msgstr "" -#: ../../library/venv.rst:271 +#: ../../library/venv.rst:290 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "" -#: ../../library/venv.rst:275 +#: ../../library/venv.rst:294 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -627,48 +662,48 @@ msgid "" "unless files with those names already exist." msgstr "" -#: ../../library/venv.rst:282 +#: ../../library/venv.rst:301 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "" -#: ../../library/venv.rst:287 +#: ../../library/venv.rst:306 msgid "" "Upgrades the core venv dependency packages (currently ``pip``) in the " "environment. This is done by shelling out to the ``pip`` executable in the " "environment." msgstr "" -#: ../../library/venv.rst:298 +#: ../../library/venv.rst:317 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:302 +#: ../../library/venv.rst:321 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " "running from a build in the source tree." msgstr "" -#: ../../library/venv.rst:307 +#: ../../library/venv.rst:326 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -#: ../../library/venv.rst:312 +#: ../../library/venv.rst:331 msgid "" "In addition, :class:`EnvBuilder` provides this utility method that can be " "called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " "assist in installing custom scripts into the virtual environment." msgstr "" -#: ../../library/venv.rst:318 +#: ../../library/venv.rst:337 msgid "" "*path* is the path to a directory that should contain subdirectories " "\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " @@ -677,64 +712,64 @@ msgid "" "placeholders:" msgstr "" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:343 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:346 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:349 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:352 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:336 +#: ../../library/venv.rst:355 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:339 +#: ../../library/venv.rst:358 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:342 +#: ../../library/venv.rst:361 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:348 +#: ../../library/venv.rst:367 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:363 +#: ../../library/venv.rst:382 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:365 +#: ../../library/venv.rst:384 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:576 +#: ../../library/venv.rst:595 msgid "" "This script is also available for download `online `_." diff --git a/library/weakref.po b/library/weakref.po index dcb2927e50..7dc80648fd 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,7 +160,7 @@ msgstr "" msgid "" "Exceptions raised by the callback will be noted on the standard error " "output, but cannot be propagated; they are handled in exactly the same way " -"as exceptions raised from an object's :meth:`__del__` method." +"as exceptions raised from an object's :meth:`~object.__del__` method." msgstr "" #: ../../library/weakref.rst:116 @@ -284,21 +284,20 @@ msgstr "" #: ../../library/weakref.rst:223 msgid "" ":class:`WeakValueDictionary` objects have an additional method that has the " -"same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary` " -"objects." +"same issues as the :meth:`WeakKeyDictionary.keyrefs` method." msgstr "" -#: ../../library/weakref.rst:230 +#: ../../library/weakref.rst:229 msgid "Return an iterable of the weak references to the values." msgstr "" -#: ../../library/weakref.rst:235 +#: ../../library/weakref.rst:234 msgid "" "Set class that keeps weak references to its elements. An element will be " "discarded when no strong reference to it exists any more." msgstr "" -#: ../../library/weakref.rst:241 +#: ../../library/weakref.rst:240 msgid "" "A custom :class:`ref` subclass which simulates a weak reference to a bound " "method (i.e., a method defined on a class and looked up on an instance). " @@ -307,13 +306,13 @@ msgid "" "method until either the object or the original function dies::" msgstr "" -#: ../../library/weakref.rst:265 +#: ../../library/weakref.rst:264 msgid "" "*callback* is the same as the parameter of the same name to the :func:`ref` " "function." msgstr "" -#: ../../library/weakref.rst:271 +#: ../../library/weakref.rst:270 msgid "" "Return a callable finalizer object which will be called when *obj* is " "garbage collected. Unlike an ordinary weak reference, a finalizer will " @@ -321,7 +320,7 @@ msgid "" "lifecycle management." msgstr "" -#: ../../library/weakref.rst:276 +#: ../../library/weakref.rst:275 msgid "" "A finalizer is considered *alive* until it is called (either explicitly or " "at garbage collection), and after that it is *dead*. Calling a live " @@ -329,58 +328,58 @@ msgid "" "calling a dead finalizer returns :const:`None`." msgstr "" -#: ../../library/weakref.rst:281 +#: ../../library/weakref.rst:280 msgid "" "Exceptions raised by finalizer callbacks during garbage collection will be " "shown on the standard error output, but cannot be propagated. They are " -"handled in the same way as exceptions raised from an object's :meth:" -"`__del__` method or a weak reference's callback." +"handled in the same way as exceptions raised from an object's :meth:`~object." +"__del__` method or a weak reference's callback." msgstr "" -#: ../../library/weakref.rst:287 +#: ../../library/weakref.rst:286 msgid "" "When the program exits, each remaining live finalizer is called unless its :" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" -#: ../../library/weakref.rst:291 +#: ../../library/weakref.rst:290 msgid "" "A finalizer will never invoke its callback during the later part of the :" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" -#: ../../library/weakref.rst:297 +#: ../../library/weakref.rst:296 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:303 +#: ../../library/weakref.rst:302 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:309 +#: ../../library/weakref.rst:308 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:314 +#: ../../library/weakref.rst:313 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" -#: ../../library/weakref.rst:318 +#: ../../library/weakref.rst:317 msgid "" "A writable boolean property which by default is true. When the program " "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" -#: ../../library/weakref.rst:325 +#: ../../library/weakref.rst:324 msgid "" "It is important to ensure that *func*, *args* and *kwargs* do not own any " "references to *obj*, either directly or indirectly, since otherwise *obj* " @@ -388,60 +387,60 @@ msgid "" "bound method of *obj*." msgstr "" -#: ../../library/weakref.rst:335 +#: ../../library/weakref.rst:334 msgid "The type object for weak references objects." msgstr "" -#: ../../library/weakref.rst:340 +#: ../../library/weakref.rst:339 msgid "The type object for proxies of objects which are not callable." msgstr "" -#: ../../library/weakref.rst:345 +#: ../../library/weakref.rst:344 msgid "The type object for proxies of callable objects." msgstr "" -#: ../../library/weakref.rst:350 +#: ../../library/weakref.rst:349 msgid "" "Sequence containing all the type objects for proxies. This can make it " "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid ":pep:`205` - Weak References" msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" -#: ../../library/weakref.rst:365 +#: ../../library/weakref.rst:364 msgid "Weak Reference Objects" msgstr "" -#: ../../library/weakref.rst:367 +#: ../../library/weakref.rst:366 msgid "" "Weak reference objects have no methods and no attributes besides :attr:`ref." "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" -#: ../../library/weakref.rst:381 +#: ../../library/weakref.rst:380 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" -#: ../../library/weakref.rst:388 +#: ../../library/weakref.rst:387 msgid "" "Testing that a weak reference object is still live should be done using the " "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" -#: ../../library/weakref.rst:401 +#: ../../library/weakref.rst:400 msgid "" "Using a separate test for \"liveness\" creates race conditions in threaded " "applications; another thread can cause a weak reference to become " @@ -449,7 +448,7 @@ msgid "" "safe in threaded applications as well as single-threaded applications." msgstr "" -#: ../../library/weakref.rst:406 +#: ../../library/weakref.rst:405 msgid "" "Specialized versions of :class:`ref` objects can be created through " "subclassing. This is used in the implementation of the :class:" @@ -459,18 +458,18 @@ msgid "" "to retrieve the referent." msgstr "" -#: ../../library/weakref.rst:412 +#: ../../library/weakref.rst:411 msgid "" "This example shows how a subclass of :class:`ref` can be used to store " "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" -#: ../../library/weakref.rst:439 +#: ../../library/weakref.rst:438 msgid "Example" msgstr "範例" -#: ../../library/weakref.rst:441 +#: ../../library/weakref.rst:440 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " @@ -478,103 +477,103 @@ msgid "" "objects can still be retrieved by ID if they do." msgstr "" -#: ../../library/weakref.rst:466 +#: ../../library/weakref.rst:465 msgid "Finalizer Objects" msgstr "" -#: ../../library/weakref.rst:468 +#: ../../library/weakref.rst:467 msgid "" "The main benefit of using :class:`finalize` is that it makes it simple to " "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" -#: ../../library/weakref.rst:482 +#: ../../library/weakref.rst:481 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" -#: ../../library/weakref.rst:498 +#: ../../library/weakref.rst:497 msgid "" "You can unregister a finalizer using its :meth:`~finalize.detach` method. " "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" -#: ../../library/weakref.rst:512 +#: ../../library/weakref.rst:511 msgid "" "Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a " "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" -#: ../../library/weakref.rst:527 -msgid "Comparing finalizers with :meth:`__del__` methods" +#: ../../library/weakref.rst:526 +msgid "Comparing finalizers with :meth:`~object.__del__` methods" msgstr "" -#: ../../library/weakref.rst:529 +#: ../../library/weakref.rst:528 msgid "" "Suppose we want to create a class whose instances represent temporary " "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" -#: ../../library/weakref.rst:533 +#: ../../library/weakref.rst:532 msgid "the object is garbage collected," msgstr "" -#: ../../library/weakref.rst:534 -msgid "the object's :meth:`remove` method is called, or" +#: ../../library/weakref.rst:533 +msgid "the object's :meth:`!remove` method is called, or" msgstr "" -#: ../../library/weakref.rst:535 +#: ../../library/weakref.rst:534 msgid "the program exits." msgstr "" -#: ../../library/weakref.rst:537 +#: ../../library/weakref.rst:536 msgid "" -"We might try to implement the class using a :meth:`__del__` method as " -"follows::" +"We might try to implement the class using a :meth:`~object.__del__` method " +"as follows::" msgstr "" -#: ../../library/weakref.rst:556 +#: ../../library/weakref.rst:555 msgid "" -"Starting with Python 3.4, :meth:`__del__` methods no longer prevent " +"Starting with Python 3.4, :meth:`~object.__del__` methods no longer prevent " "reference cycles from being garbage collected, and module globals are no " "longer forced to :const:`None` during :term:`interpreter shutdown`. So this " "code should work without any issues on CPython." msgstr "" -#: ../../library/weakref.rst:561 +#: ../../library/weakref.rst:560 msgid "" -"However, handling of :meth:`__del__` methods is notoriously implementation " -"specific, since it depends on internal details of the interpreter's garbage " -"collector implementation." +"However, handling of :meth:`~object.__del__` methods is notoriously " +"implementation specific, since it depends on internal details of the " +"interpreter's garbage collector implementation." msgstr "" -#: ../../library/weakref.rst:565 +#: ../../library/weakref.rst:564 msgid "" "A more robust alternative can be to define a finalizer which only references " "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" -#: ../../library/weakref.rst:581 +#: ../../library/weakref.rst:580 msgid "" "Defined like this, our finalizer only receives a reference to the details it " "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" -#: ../../library/weakref.rst:585 +#: ../../library/weakref.rst:584 msgid "" "The other advantage of weakref based finalizers is that they can be used to " "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" -#: ../../library/weakref.rst:597 +#: ../../library/weakref.rst:596 msgid "" "If you create a finalizer object in a daemonic thread just as the program " "exits then there is the possibility that the finalizer does not get called " diff --git a/library/wsgiref.po b/library/wsgiref.po index 4a32e3dffa..ff281215b8 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -33,8 +33,9 @@ msgid "" "interface makes it easy to use an application that supports WSGI with a " "number of different web servers." msgstr "" -"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁" -"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。" +"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 " +"Python 撰寫的網頁應用程式,擁有一個標準介面使得支援 WSGI 的應用程式可以與多個" +"不同的網頁伺服器運行。" #: ../../library/wsgiref.rst:19 msgid "" @@ -43,8 +44,9 @@ msgid "" "every detail of WSGI just to install a WSGI application or to write a web " "application using an existing framework." msgstr "" -"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程" -"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。" +"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不" +"需要為了安裝 WSGI 應用程式或是使用現有框架撰寫網頁應用程式而必須理解每個細" +"節。" #: ../../library/wsgiref.rst:24 msgid "" @@ -56,17 +58,18 @@ msgid "" "that checks WSGI servers and applications for conformance to the WSGI " "specification (:pep:`3333`)." msgstr "" -":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI " -"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程" -"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" +":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框" +"架,它提供操作 WSGI 環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類" +"別,提供用於示範 HTTP 伺服器的 WSGI 應用程式、靜態型別檢查、以及驗證 WSGI 伺" +"服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" #: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" -"參閱 `wsgi.readthedocs.io ` 更多 WSGI 相關資訊,以及教學連結" -"與其他資源。" +"參閱 `wsgi.readthedocs.io `_ 更多 WSGI 相關資" +"訊,以及教學連結與其他資源。" #: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" @@ -81,9 +84,10 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。" -"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:" -"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。 +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " +"WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." +"WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" #: ../../library/wsgiref.rst:56 msgid "" @@ -91,8 +95,8 @@ msgid "" "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" -"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\" 或 \"https\"" -" 的猜測。回傳值為一個字串。" +"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該" +"是 \"http\" 或 \"https\" 的猜測。回傳值為一個字串。" #: ../../library/wsgiref.rst:60 msgid "" @@ -102,9 +106,10 @@ msgid "" "a request is received via SSL. So, this function returns \"https\" if such " "a value is found, and \"http\" otherwise." msgstr "" -"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的" -"伺服器在通過 SSL 接收到請求時會包含 \"1\",\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函" -"式回傳 \"https\",否則回傳 \"http\"。 +"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例" +"如 FastCGI,通常提供這類協議的伺服器在通過 SSL 接收到請求時會包含 " +"\"1\",\"yes\",或 \"on\" 的 ``HTTPS`` 變數,因此,如果找到這樣的值,此函式回" +"傳 \"https\",否則回傳 \"http\"。" #: ../../library/wsgiref.rst:69 msgid "" @@ -113,8 +118,9 @@ msgid "" "If *include_query* is false, the query string is not included in the " "resulting URI." msgstr "" -"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串," -"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。" +"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請" +"求 URI,可選擇性的包含查詢字串,如果 *include_query* 設為 false,查詢字串不會" +"被包含在結果的 URI 中。" #: ../../library/wsgiref.rst:76 msgid "" @@ -122,8 +128,8 @@ msgid "" "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" -"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的" -"的基本 URI。" +"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結" +"果是請求地址的應用程式物件的的基本 URI。" #: ../../library/wsgiref.rst:83 msgid "" @@ -131,15 +137,15 @@ msgid "" "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" -"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如" -"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。" +"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典" +"會在適當時機被 *modified*;如果你需要保留原始完好無損的 ``PATH_INFO`` 或 " +"``SCRIPT_NAME`` 請使用副本。" #: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." -msgstr "" -"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" +msgstr "如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" #: ../../library/wsgiref.rst:89 msgid "" @@ -154,11 +160,13 @@ msgid "" "bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" -"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於" -"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``," -"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用" -"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``," -"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。" +"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" +"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" +"於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " +"\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" +"話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``,而 ``PATH_INFO`` 將" +"從 ``/bar/baz`` 變更為 ``/baz``。" #: ../../library/wsgiref.rst:100 msgid "" @@ -169,9 +177,10 @@ msgid "" "difference between URIs ending in ``/x`` from ones ending in ``/x/`` when " "using this routine to do object traversal." msgstr "" -"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片" -"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可" -"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" +"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 " +"``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片段通常是被忽略的,而且 " +"``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程" +"式進行物件遍歷時可以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" #: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." @@ -185,9 +194,10 @@ msgid "" "*`` variables. It only supplies default values, and does not replace any " "existing settings for these variables." msgstr "" -"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``" -"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代" -"現有的這些變數設定。" +"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、" +"``SERVER_PORT``、``REQUEST_METHOD``、``SCRIPT_NAME``、``PATH_INFO``,以及所" +"有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代現有的這些" +"變數設定。" #: ../../library/wsgiref.rst:118 msgid "" @@ -195,9 +205,8 @@ msgid "" "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" -"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為" -"所產生的數據是假的!" - +"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 " +"WSGI 伺服器或應用程式不應該使用它,因為所產生的數據是假的!" #: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 #: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index fbdf345c98..99998e7c40 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -37,7 +37,7 @@ msgid "This module will use a fast implementation whenever available." msgstr "" #: ../../library/xml.etree.elementtree.rst:19 -msgid "The :mod:`xml.etree.cElementTree` module is deprecated." +msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." msgstr "" #: ../../library/xml.etree.elementtree.rst:25 @@ -668,7 +668,7 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1473 +#: ../../library/xml.etree.elementtree.rst:1478 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" @@ -677,7 +677,7 @@ msgid "The *parser* argument." msgstr "*parser* 引數。" #: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1477 +#: ../../library/xml.etree.elementtree.rst:1482 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" @@ -743,7 +743,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:705 #: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1184 +#: ../../library/xml.etree.elementtree.rst:1189 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" @@ -851,7 +851,7 @@ msgstr "" msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:831 +#: ../../library/xml.etree.elementtree.rst:833 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\". " @@ -862,7 +862,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:843 +#: ../../library/xml.etree.elementtree.rst:845 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +873,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:851 +#: ../../library/xml.etree.elementtree.rst:853 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:856 +#: ../../library/xml.etree.elementtree.rst:858 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:863 +#: ../../library/xml.etree.elementtree.rst:865 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:867 +#: ../../library/xml.etree.elementtree.rst:872 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:870 +#: ../../library/xml.etree.elementtree.rst:875 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +902,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:878 +#: ../../library/xml.etree.elementtree.rst:883 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:885 +#: ../../library/xml.etree.elementtree.rst:890 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +919,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:897 +#: ../../library/xml.etree.elementtree.rst:902 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 " @@ -927,17 +927,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:907 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:905 +#: ../../library/xml.etree.elementtree.rst:910 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:915 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +946,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:916 +#: ../../library/xml.etree.elementtree.rst:921 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:926 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:927 +#: ../../library/xml.etree.elementtree.rst:932 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:929 +#: ../../library/xml.etree.elementtree.rst:934 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:939 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:940 +#: ../../library/xml.etree.elementtree.rst:945 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:946 +#: ../../library/xml.etree.elementtree.rst:951 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:948 +#: ../../library/xml.etree.elementtree.rst:953 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:958 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:960 +#: ../../library/xml.etree.elementtree.rst:965 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:968 +#: ../../library/xml.etree.elementtree.rst:973 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1007,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:977 +#: ../../library/xml.etree.elementtree.rst:982 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1016,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:986 +#: ../../library/xml.etree.elementtree.rst:991 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 " @@ -1027,13 +1027,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:997 +#: ../../library/xml.etree.elementtree.rst:1002 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:1003 +#: ../../library/xml.etree.elementtree.rst:1008 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 " @@ -1042,7 +1042,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1014 +#: ../../library/xml.etree.elementtree.rst:1019 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1050,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1025 +#: ../../library/xml.etree.elementtree.rst:1030 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:1033 +#: ../../library/xml.etree.elementtree.rst:1038 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:1039 +#: ../../library/xml.etree.elementtree.rst:1044 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:1043 +#: ../../library/xml.etree.elementtree.rst:1048 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:1048 +#: ../../library/xml.etree.elementtree.rst:1053 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1060 +#: ../../library/xml.etree.elementtree.rst:1065 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1063 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1096,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1069 +#: ../../library/xml.etree.elementtree.rst:1074 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 " @@ -1332,11 +1332,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1348 +#: ../../library/xml.etree.elementtree.rst:1353 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1358 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 " @@ -1347,24 +1347,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1361 +#: ../../library/xml.etree.elementtree.rst:1366 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1368 +#: ../../library/xml.etree.elementtree.rst:1373 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:1375 +#: ../../library/xml.etree.elementtree.rst:1380 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1377 +#: ../../library/xml.etree.elementtree.rst:1382 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 " @@ -1375,11 +1375,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1421 +#: ../../library/xml.etree.elementtree.rst:1426 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1425 +#: ../../library/xml.etree.elementtree.rst:1430 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 " @@ -1391,11 +1391,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1436 +#: ../../library/xml.etree.elementtree.rst:1441 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1440 +#: ../../library/xml.etree.elementtree.rst:1445 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1403,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1447 +#: ../../library/xml.etree.elementtree.rst:1452 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 " @@ -1412,25 +1412,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1453 +#: ../../library/xml.etree.elementtree.rst:1458 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1454 +#: ../../library/xml.etree.elementtree.rst:1459 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1460 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1457 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1464 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 " @@ -1439,7 +1439,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1467 +#: ../../library/xml.etree.elementtree.rst:1472 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 " @@ -1448,11 +1448,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:1487 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1486 +#: ../../library/xml.etree.elementtree.rst:1491 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 " @@ -1460,22 +1460,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1493 +#: ../../library/xml.etree.elementtree.rst:1498 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:1498 +#: ../../library/xml.etree.elementtree.rst:1503 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1501 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1502 +#: ../../library/xml.etree.elementtree.rst:1507 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/zipimport.po b/library/zipimport.po index 69cf62e1ff..cc7909b20e 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -159,7 +159,7 @@ msgid "" msgstr "" #: ../../library/zipimport.rst:115 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" #: ../../library/zipimport.rst:121 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index ceedd48bd8..2978dd7513 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -449,14 +449,14 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:525 -#: ../../reference/compound_stmts.rst:1534 -#: ../../reference/compound_stmts.rst:1575 +#: ../../reference/compound_stmts.rst:1536 +#: ../../reference/compound_stmts.rst:1577 msgid "The following code::" msgstr "" #: ../../reference/compound_stmts.rst:530 #: ../../reference/compound_stmts.rst:555 -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1582 msgid "is semantically equivalent to::" msgstr "" @@ -529,12 +529,12 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:624 -#: ../../reference/compound_stmts.rst:1179 +#: ../../reference/compound_stmts.rst:1181 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" #: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:1182 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" @@ -1290,7 +1290,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1159 -#: ../../reference/compound_stmts.rst:1850 +#: ../../reference/compound_stmts.rst:1852 msgid ":class:`list`" msgstr ":class:`list`" @@ -1303,7 +1303,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1162 -#: ../../reference/compound_stmts.rst:1853 +#: ../../reference/compound_stmts.rst:1855 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1327,33 +1327,33 @@ msgstr "``isinstance(, CLS)``" msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1172 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1174 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1175 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1177 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1190 +#: ../../reference/compound_stmts.rst:1192 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1205 +#: ../../reference/compound_stmts.rst:1207 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1224 +#: ../../reference/compound_stmts.rst:1226 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1362,13 +1362,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1230 +#: ../../reference/compound_stmts.rst:1232 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1236 +#: ../../reference/compound_stmts.rst:1238 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1379,28 +1379,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 -#: ../../reference/compound_stmts.rst:1433 +#: ../../reference/compound_stmts.rst:1249 +#: ../../reference/compound_stmts.rst:1435 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1252 +#: ../../reference/compound_stmts.rst:1254 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1254 +#: ../../reference/compound_stmts.rst:1256 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1259 +#: ../../reference/compound_stmts.rst:1261 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1410,12 +1410,12 @@ msgid "" "more." msgstr "" -#: ../../reference/compound_stmts.rst:1265 -#: ../../reference/compound_stmts.rst:1452 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1454 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1426,7 +1426,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1281 +#: ../../reference/compound_stmts.rst:1283 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1439,7 +1439,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1455,13 +1455,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1314 +#: ../../reference/compound_stmts.rst:1316 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1478,7 +1478,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1338 +#: ../../reference/compound_stmts.rst:1340 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1490,7 +1490,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1499,51 +1499,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1362 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1363 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1372 +#: ../../reference/compound_stmts.rst:1374 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1394 +#: ../../reference/compound_stmts.rst:1396 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1552,11 +1552,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1403 +#: ../../reference/compound_stmts.rst:1405 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1408 +#: ../../reference/compound_stmts.rst:1410 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1568,7 +1568,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1417 +#: ../../reference/compound_stmts.rst:1419 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1576,30 +1576,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1422 +#: ../../reference/compound_stmts.rst:1424 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1429 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1438 +#: ../../reference/compound_stmts.rst:1440 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1441 +#: ../../reference/compound_stmts.rst:1443 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1448 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1608,7 +1608,7 @@ msgid "" "classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1455 +#: ../../reference/compound_stmts.rst:1457 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1621,35 +1621,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1470 +#: ../../reference/compound_stmts.rst:1472 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1470 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1482 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1490 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1500 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1657,109 +1657,109 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1504 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1507 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1508 +#: ../../reference/compound_stmts.rst:1510 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1516 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1522 +#: ../../reference/compound_stmts.rst:1524 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1529 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1533 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1543 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1557 +#: ../../reference/compound_stmts.rst:1559 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:1561 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1567 +#: ../../reference/compound_stmts.rst:1569 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1574 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1599 +#: ../../reference/compound_stmts.rst:1601 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1603 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1615 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1629 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1646 +#: ../../reference/compound_stmts.rst:1648 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -1767,7 +1767,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1651 +#: ../../reference/compound_stmts.rst:1653 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -1779,36 +1779,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1660 +#: ../../reference/compound_stmts.rst:1662 msgid "" "Generic functions, classes, and type aliases have a :attr:`!__type_params__` " "attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1663 +#: ../../reference/compound_stmts.rst:1665 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1665 +#: ../../reference/compound_stmts.rst:1667 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1669 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1670 +#: ../../reference/compound_stmts.rst:1672 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1675 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -1820,7 +1820,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1682 +#: ../../reference/compound_stmts.rst:1684 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -1830,35 +1830,35 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1688 +#: ../../reference/compound_stmts.rst:1690 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1691 +#: ../../reference/compound_stmts.rst:1693 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1709 +#: ../../reference/compound_stmts.rst:1711 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1711 +#: ../../reference/compound_stmts.rst:1713 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1715 -#: ../../reference/compound_stmts.rst:1775 +#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1777 msgid "This syntax is equivalent to::" msgstr "" "語法大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1724 +#: ../../reference/compound_stmts.rst:1726 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -1867,47 +1867,47 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1730 +#: ../../reference/compound_stmts.rst:1732 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1734 +#: ../../reference/compound_stmts.rst:1736 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1743 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1763 +#: ../../reference/compound_stmts.rst:1765 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1771 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1771 +#: ../../reference/compound_stmts.rst:1773 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1785 +#: ../../reference/compound_stmts.rst:1787 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1789 +#: ../../reference/compound_stmts.rst:1791 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -1915,128 +1915,128 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1798 +#: ../../reference/compound_stmts.rst:1800 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1811 +#: ../../reference/compound_stmts.rst:1813 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1815 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1819 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1829 +#: ../../reference/compound_stmts.rst:1831 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1834 +#: ../../reference/compound_stmts.rst:1836 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1835 +#: ../../reference/compound_stmts.rst:1837 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1841 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1843 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1844 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1845 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1844 -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1865 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1848 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1850 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1849 +#: ../../reference/compound_stmts.rst:1851 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1851 +#: ../../reference/compound_stmts.rst:1853 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1852 +#: ../../reference/compound_stmts.rst:1854 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1855 +#: ../../reference/compound_stmts.rst:1857 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1858 +#: ../../reference/compound_stmts.rst:1860 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1860 +#: ../../reference/compound_stmts.rst:1862 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1861 +#: ../../reference/compound_stmts.rst:1863 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1864 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1865 +#: ../../reference/compound_stmts.rst:1867 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1870 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1874 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" @@ -2057,11 +2057,11 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:436 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1484 -#: ../../reference/compound_stmts.rst:1518 -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1520 +#: ../../reference/compound_stmts.rst:1565 msgid "statement" msgstr "statement(陳述式)" @@ -2109,7 +2109,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:407 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2122,9 +2122,9 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1376 msgid ": (colon)" msgstr ": (冒號)" @@ -2133,8 +2133,8 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2179,8 +2179,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:299 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "object" msgstr "object(物件)" @@ -2250,8 +2250,8 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:470 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid ", (comma)" msgstr ", (逗號)" @@ -2291,158 +2291,158 @@ msgstr "" msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1270 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1268 -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1299 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1426 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1426 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1484 +#: ../../reference/compound_stmts.rst:1486 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1520 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1565 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1619 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index a58e3375df..017a48a4ea 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -337,11 +337,11 @@ msgstr "" #: ../../reference/lexical_analysis.rst:307 msgid "*Lu* - uppercase letters" -msgstr "" +msgstr "*Lu* - 大寫字母" #: ../../reference/lexical_analysis.rst:308 msgid "*Ll* - lowercase letters" -msgstr "" +msgstr "*Ll* - 小寫字母" #: ../../reference/lexical_analysis.rst:309 msgid "*Lt* - titlecase letters" @@ -353,7 +353,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:311 msgid "*Lo* - other letters" -msgstr "" +msgstr "*Lo* - 其他字母" #: ../../reference/lexical_analysis.rst:312 msgid "*Nl* - letter numbers" @@ -369,7 +369,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:315 msgid "*Nd* - decimal numbers" -msgstr "" +msgstr "*Nd* - 十進位數字" #: ../../reference/lexical_analysis.rst:316 msgid "*Pc* - connector punctuations" @@ -401,7 +401,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:333 msgid "Keywords" -msgstr "" +msgstr "關鍵字" #: ../../reference/lexical_analysis.rst:339 msgid "" @@ -412,7 +412,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:357 msgid "Soft Keywords" -msgstr "" +msgstr "軟關鍵字" #: ../../reference/lexical_analysis.rst:363 msgid "" @@ -437,7 +437,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:375 msgid "``type`` is now a soft keyword." -msgstr "" +msgstr "``type`` 現在是軟關鍵字。" #: ../../reference/lexical_analysis.rst:384 msgid "Reserved classes of identifiers" @@ -657,7 +657,7 @@ msgstr "``\\'``" #: ../../reference/lexical_analysis.rst:567 msgid "Single quote (``'``)" -msgstr "" +msgstr "單引號 (``'``)" #: ../../reference/lexical_analysis.rst:569 msgid "``\\\"``" @@ -665,7 +665,7 @@ msgstr "``\\\"``" #: ../../reference/lexical_analysis.rst:569 msgid "Double quote (``\"``)" -msgstr "" +msgstr "雙引號 (``\"``)" #: ../../reference/lexical_analysis.rst:571 msgid "``\\a``" @@ -724,8 +724,8 @@ msgid "ASCII Vertical Tab (VT)" msgstr "" #: ../../reference/lexical_analysis.rst:585 -msgid "``\\ooo``" -msgstr "``\\ooo``" +msgid ":samp:`\\\\\\\\{ooo}`" +msgstr "" #: ../../reference/lexical_analysis.rst:585 msgid "Character with octal value *ooo*" @@ -736,8 +736,8 @@ msgid "(2,4)" msgstr "(2,4)" #: ../../reference/lexical_analysis.rst:588 -msgid "``\\xhh``" -msgstr "``\\xhh``" +msgid ":samp:`\\\\x{hh}`" +msgstr ":samp:`\\\\x{hh}`" #: ../../reference/lexical_analysis.rst:588 msgid "Character with hex value *hh*" @@ -752,8 +752,8 @@ msgid "Escape sequences only recognized in string literals are:" msgstr "" #: ../../reference/lexical_analysis.rst:596 -msgid "``\\N{name}``" -msgstr "``\\N{name}``" +msgid ":samp:`\\\\N\\\\{{name}\\\\}`" +msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" #: ../../reference/lexical_analysis.rst:596 msgid "Character named *name* in the Unicode database" @@ -764,8 +764,8 @@ msgid "\\(5)" msgstr "\\(5)" #: ../../reference/lexical_analysis.rst:599 -msgid "``\\uxxxx``" -msgstr "``\\uxxxx``" +msgid ":samp:`\\\\u{xxxx}`" +msgstr ":samp:`\\\\u{xxxx}`" #: ../../reference/lexical_analysis.rst:599 msgid "Character with 16-bit hex value *xxxx*" @@ -776,8 +776,8 @@ msgid "\\(6)" msgstr "\\(6)" #: ../../reference/lexical_analysis.rst:602 -msgid "``\\Uxxxxxxxx``" -msgstr "``\\Uxxxxxxxx``" +msgid ":samp:`\\\\U{xxxxxxxx}`" +msgstr ":samp:`\\\\U{xxxxxxxx}`" #: ../../reference/lexical_analysis.rst:602 msgid "Character with 32-bit hex value *xxxxxxxx*" @@ -974,7 +974,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:782 msgid "The equal sign ``'='``." -msgstr "" +msgstr "等號 ``'='``。" #: ../../reference/lexical_analysis.rst:785 msgid "" @@ -1608,3 +1608,15 @@ msgstr "operators(運算子)" #: ../../reference/lexical_analysis.rst:1015 msgid "delimiters" msgstr "delimiters(分隔符號)" + +#~ msgid "``\\ooo``" +#~ msgstr "``\\ooo``" + +#~ msgid "``\\xhh``" +#~ msgstr "``\\xhh``" + +#~ msgid "``\\N{name}``" +#~ msgstr "``\\N{name}``" + +#~ msgid "``\\uxxxx``" +#~ msgstr "``\\uxxxx``" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 70a87a9db4..bd3440f671 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -648,7 +648,7 @@ msgid "" "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" -"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"ref:`tut-classes`) The method :meth:`!append` shown in the example is " "defined for list objects; it adds a new element at the end of the list. In " "this example it is equivalent to ``result = result + [a]``, but more " "efficient." @@ -658,9 +658,9 @@ msgstr "" "``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," "並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" "有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" -"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`~list.append` " -"method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" -"於 ``result = result + [a]``,但更有效率。" +"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`!append` method 定" +"義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同於 " +"``result = result + [a]``,但更有效率。" #: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" @@ -1227,8 +1227,8 @@ msgstr "" #: ../../tutorial/controlflow.rst:1049 msgid "" -":term:`Annotations ` are stored in the :attr:" -"`__annotations__` attribute of the function as a dictionary and have no " +":term:`Annotations ` are stored in the :attr:`!" +"__annotations__` attribute of the function as a dictionary and have no " "effect on any other part of the function. Parameter annotations are defined " "by a colon after the parameter name, followed by an expression evaluating to " "the value of the annotation. Return annotations are defined by a literal ``-" @@ -1237,10 +1237,10 @@ msgid "" "a required argument, an optional argument, and the return value annotated::" msgstr "" ":term:`註釋 `\\ 以 dictionary(字典)的形式存放在函式" -"的 :attr:`__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的定" -"義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註釋" -"的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``->`` " -"文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" +"的 :attr:`!__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的" +"定義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註" +"釋的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``-" +">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" "值:\n" "\n" "::" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index fdd9c5324d..3b9786296a 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-06-22 14:43+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -220,8 +220,8 @@ msgstr "" #: ../../tutorial/floatingpoint.rst:139 msgid "" "Alternatively, the :func:`round` function can be used to compare rough " -"approximations::" -msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值: ::" +"approximations:" +msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值:" #: ../../tutorial/floatingpoint.rst:147 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index ee580ee041..9979da11cf 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-25 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "that a secondary prompt on a line by itself in an example means you must " "type a blank line; this is used to end a multi-line command." msgstr "" -"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,\\ :term:`>>>` 和 :" +"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,:term:`>>>` 和 :" "term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方" "的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現" "單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" @@ -264,8 +264,8 @@ msgid "" "at the end of the line. The following example::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:\\ ``\"\"\"...\"\"\"`` " -"或 ``'''...'''``\\ 。此時換行會被自動加入字串值中,但也可以在換行前加入 " -"``\\`` 來取消這個行為。在以下的例子中:\n" +"或 ``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` " +"來取消這個行為。在以下的例子中:\n" "\n" "::" @@ -590,7 +590,7 @@ msgstr "初探程式設計的前幾步" msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " -"`Fibonacci series `_ as " +"`Fibonacci series `_ as " "follows::" msgstr "" "當然,我們可以用 Python 來處理比 2 加 2 更複雜的工作。例如,我們可以印出\\ `" @@ -630,9 +630,8 @@ msgstr "" "行。在 Python 中如同 C 語言,任何非零的整數值為真 (true);零為假 (false)。條" "件可以是字串、list、甚至是任何序列型別;任何非零長度的序列為真,空的序列即為" "假。本例子使用的條件是個簡單的比較。標準的比較運算子 (comparison operators) " -"使用如同 C 語言一樣的符號:\\ ``<``\\ (小於)、\\ ``>``\\ (大於)、\\ " -"``==``\\ (等於)、\\ ``<=``\\ (小於等於)、\\ ``>=``\\ (大於等於)以及 ``!" -"=``\\ (不等於)。" +"使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" +"於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" #: ../../tutorial/introduction.rst:518 msgid "" @@ -688,9 +687,8 @@ msgid "" "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " "can use ``(-3)**2``." msgstr "" -"因為 ``**`` 擁有較 ``-`` 高的優先次序,\\ ``-3**2`` 會被解釋為 ``-(3**2)`` 並" -"得到 ``-9``\\ 。如果要避免這樣的優先順序以得到 ``9``,你可以使用 " -"``(-3)**2``\\ 。" +"因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" +"到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" #: ../../tutorial/introduction.rst:555 msgid "" diff --git a/using/cmdline.po b/using/cmdline.po index 06d0f4d366..4bc54baaa8 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 23:09+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -169,8 +169,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the current directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:109 @@ -259,8 +258,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the script's directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:167 @@ -378,8 +376,8 @@ msgstr "" #: ../../using/cmdline.rst:283 msgid "" -"Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" -"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all ``PYTHON*`` environment variables, e.g. :envvar:`PYTHONPATH` and :" +"envvar:`PYTHONHOME`, that might be set." msgstr "" #: ../../using/cmdline.rst:286 @@ -409,7 +407,7 @@ msgstr "" #: ../../using/cmdline.rst:305 msgid "" "In isolated mode :data:`sys.path` contains neither the script's directory " -"nor the user's site-packages directory. All :envvar:`PYTHON*` environment " +"nor the user's site-packages directory. All ``PYTHON*`` environment " "variables are ignored, too. Further restrictions may be imposed to prevent " "the user from injecting malicious code." msgstr "" @@ -476,10 +474,10 @@ msgstr "" #: ../../using/cmdline.rst:364 msgid "" "On previous versions of Python, this option turns on hash randomization, so " -"that the :meth:`__hash__` values of str and bytes objects are \"salted\" " -"with an unpredictable random value. Although they remain constant within an " -"individual Python process, they are not predictable between repeated " -"invocations of Python." +"that the :meth:`~object.__hash__` values of str and bytes objects are " +"\"salted\" with an unpredictable random value. Although they remain " +"constant within an individual Python process, they are not predictable " +"between repeated invocations of Python." msgstr "" #: ../../using/cmdline.rst:370 @@ -1061,7 +1059,8 @@ msgstr "" msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and installation paths for ``python -m pip install --user``." +"USER_SITE>` and :ref:`installation paths ` for " +"``python -m pip install --user``." msgstr "" #: ../../using/cmdline.rst:824 @@ -1081,12 +1080,12 @@ msgstr "" msgid "" "If this environment variable is set to a non-empty string, :func:" "`faulthandler.enable` is called at startup: install a handler for :const:" -"`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:" -"`SIGILL` signals to dump the Python traceback. This is equivalent to :" -"option:`-X` ``faulthandler`` option." +"`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:" +"`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python " +"traceback. This is equivalent to :option:`-X` ``faulthandler`` option." msgstr "" -#: ../../using/cmdline.rst:863 +#: ../../using/cmdline.rst:864 msgid "" "If this environment variable is set to a non-empty string, start tracing " "Python memory allocations using the :mod:`tracemalloc` module. The value of " @@ -1096,90 +1095,90 @@ msgid "" "is equivalent to setting the :option:`-X` ``tracemalloc`` option." msgstr "" -#: ../../using/cmdline.rst:876 +#: ../../using/cmdline.rst:877 msgid "" "If this environment variable is set to a non-empty string, Python will show " "how long each import takes. This is equivalent to setting the :option:`-X` " "``importtime`` option." msgstr "" -#: ../../using/cmdline.rst:885 +#: ../../using/cmdline.rst:886 msgid "" "If this environment variable is set to a non-empty string, enable the :ref:" "`debug mode ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:893 +#: ../../using/cmdline.rst:894 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:895 +#: ../../using/cmdline.rst:896 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:897 +#: ../../using/cmdline.rst:898 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:899 +#: ../../using/cmdline.rst:900 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:902 +#: ../../using/cmdline.rst:903 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:906 +#: ../../using/cmdline.rst:907 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:908 +#: ../../using/cmdline.rst:909 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:911 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:911 +#: ../../using/cmdline.rst:912 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:913 +#: ../../using/cmdline.rst:914 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:921 +#: ../../using/cmdline.rst:922 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:925 +#: ../../using/cmdline.rst:926 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:929 +#: ../../using/cmdline.rst:930 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:936 +#: ../../using/cmdline.rst:937 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1187,41 +1186,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:941 +#: ../../using/cmdline.rst:942 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:944 ../../using/cmdline.rst:958 +#: ../../using/cmdline.rst:945 ../../using/cmdline.rst:959 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:946 +#: ../../using/cmdline.rst:947 msgid "See :pep:`529` for more details." -msgstr "更多細節請見 :pep:`529`\\ 。" +msgstr "更多細節請見 :pep:`529`。" -#: ../../using/cmdline.rst:951 +#: ../../using/cmdline.rst:952 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:955 +#: ../../using/cmdline.rst:956 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:965 +#: ../../using/cmdline.rst:966 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:969 +#: ../../using/cmdline.rst:970 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1232,19 +1231,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:977 +#: ../../using/cmdline.rst:978 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:978 +#: ../../using/cmdline.rst:979 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:979 +#: ../../using/cmdline.rst:980 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:981 +#: ../../using/cmdline.rst:982 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1257,7 +1256,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:991 +#: ../../using/cmdline.rst:992 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1267,7 +1266,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:998 +#: ../../using/cmdline.rst:999 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1275,7 +1274,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:1003 +#: ../../using/cmdline.rst:1004 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1284,15 +1283,15 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1009 +#: ../../using/cmdline.rst:1010 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:1011 +#: ../../using/cmdline.rst:1012 msgid "See :pep:`538` for more details." -msgstr "更多細節請見 :pep:`538`\\ 。" +msgstr "更多細節請見 :pep:`538`。" -#: ../../using/cmdline.rst:1017 +#: ../../using/cmdline.rst:1018 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " @@ -1300,31 +1299,31 @@ msgid "" "setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1027 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1028 +#: ../../using/cmdline.rst:1029 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1030 +#: ../../using/cmdline.rst:1031 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1037 +#: ../../using/cmdline.rst:1038 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1040 +#: ../../using/cmdline.rst:1041 msgid "See :ref:`io-encoding-warning` for details." -msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" +msgstr "細節請見 :ref:`io-encoding-warning`。" -#: ../../using/cmdline.rst:1046 +#: ../../using/cmdline.rst:1047 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1333,38 +1332,38 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1056 +#: ../../using/cmdline.rst:1057 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it." msgstr "" -#: ../../using/cmdline.rst:1059 +#: ../../using/cmdline.rst:1060 msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" -#: ../../using/cmdline.rst:1061 +#: ../../using/cmdline.rst:1062 msgid "" "See also the :option:`-X perf <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" -#: ../../using/cmdline.rst:1068 +#: ../../using/cmdline.rst:1069 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1072 +#: ../../using/cmdline.rst:1073 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1075 ../../using/cmdline.rst:1082 +#: ../../using/cmdline.rst:1076 ../../using/cmdline.rst:1083 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1079 +#: ../../using/cmdline.rst:1080 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." diff --git a/using/configure.po b/using/configure.po index f461e35107..3ea12f723f 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../using/configure.rst:3 msgid "Configure Python" -msgstr "" +msgstr "配置 Python" #: ../../using/configure.rst:6 msgid "Build Requirements" @@ -46,7 +46,7 @@ msgstr "" #: ../../using/configure.rst:19 msgid "Support for threads." -msgstr "" +msgstr "thread 的支援。" #: ../../using/configure.rst:21 msgid "OpenSSL 1.1.1 or newer for the :mod:`ssl` and :mod:`hashlib` modules." @@ -54,7 +54,7 @@ msgstr "" #: ../../using/configure.rst:23 msgid "On Windows, Microsoft Visual Studio 2017 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" #: ../../using/configure.rst:25 msgid "" @@ -68,7 +68,7 @@ msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." -msgstr "" +msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" #: ../../using/configure.rst:35 msgid "" @@ -123,7 +123,7 @@ msgstr "" msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." -msgstr "" +msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" #: ../../using/configure.rst:81 msgid "General Options" @@ -131,8 +131,8 @@ msgstr "一般選項" #: ../../using/configure.rst:85 msgid "" -"Support loadable extensions in the :mod:`_sqlite` extension module (default " -"is no)." +"Support loadable extensions in the :mod:`!_sqlite` extension module (default " +"is no) of the :mod:`sqlite3` module." msgstr "" #: ../../using/configure.rst:88 @@ -140,12 +140,14 @@ msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" +"請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " +"方法。" #: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." -msgstr "" +msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" #: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." @@ -157,15 +159,15 @@ msgstr "" #: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." -msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" +msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" #: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." -msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" +msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" #: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." -msgstr "" +msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" #: ../../using/configure.rst:112 msgid "" @@ -174,12 +176,15 @@ msgid "" "wasm`` on WASI, and an empty string on other platforms (``python`` " "executable)." msgstr "" +"在 Windows 和 macOS 上預設的後綴是 ``.exe`` (``python.exe`` 執行檔)、在 " +"Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " +"``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" #: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." -msgstr "" +msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" #: ../../using/configure.rst:123 msgid "" @@ -193,10 +198,12 @@ msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" +"預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" +"zoneinfo``。" #: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." -msgstr "" +msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" #: ../../using/configure.rst:135 msgid "" @@ -206,7 +213,7 @@ msgstr "" #: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." -msgstr "" +msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" #: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" @@ -247,7 +254,7 @@ msgstr "" #: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." -msgstr "" +msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" #: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." @@ -255,7 +262,7 @@ msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" #: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." -msgstr "參閱 :data:`sys.platlibdir`\\ 。" +msgstr "參閱 :data:`sys.platlibdir`。" #: ../../using/configure.rst:178 msgid "" @@ -267,7 +274,7 @@ msgstr "" msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the :mod:`ensurepip." +"share/python-wheels/`` directory and don't install the :mod:`!ensurepip." "_bundled` package." msgstr "" @@ -279,15 +286,15 @@ msgstr "" #: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" -msgstr "" +msgstr "``check`` (預設)::program:`pkg-config` 是可選的" #: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" -msgstr "" +msgstr "``yes``::program:`pkg-config` 是必要的" #: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" -msgstr "" +msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" #: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." @@ -318,7 +325,7 @@ msgstr "" #: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." -msgstr "" +msgstr "``node``:對 NODERAWFS 和 pthread 支援。" #: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." @@ -346,7 +353,7 @@ msgstr "" #: ../../using/configure.rst:247 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" #: ../../using/configure.rst:249 msgid "" @@ -362,31 +369,33 @@ msgstr "" #: ../../using/configure.rst:256 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" #: ../../using/configure.rst:260 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" -"mod:`_testcapi` extension module (built and installed by default)." +"mod:`!_testcapi` extension module (built and installed by default)." msgstr "" #: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" -msgstr "" +msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" #: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" +"``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" +"令。" #: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" -msgstr "" +msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" #: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" -msgstr "" +msgstr "``no``:不要執行 ensurepip;" #: ../../using/configure.rst:278 msgid "Performance options" @@ -420,7 +429,7 @@ msgstr "" #: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." -msgstr "" +msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" #: ../../using/configure.rst:303 msgid "" @@ -430,7 +439,7 @@ msgstr "" #: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." -msgstr "" +msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" #: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." @@ -508,11 +517,11 @@ msgstr "" #: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." -msgstr "" +msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" #: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." -msgstr "" +msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" #: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." @@ -546,11 +555,11 @@ msgstr "" #: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." -msgstr "" +msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" #: ../../using/configure.rst:394 -msgid "Add :func:`sys.gettotalrefcount` function." -msgstr "新增 :func:`sys.gettotalrefcount` 函式。" +msgid "Add :func:`!sys.gettotalrefcount` function." +msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" #: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." @@ -614,7 +623,7 @@ msgstr "" #: ../../using/configure.rst:416 msgid "" -"The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " +"The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" @@ -655,8 +664,8 @@ msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" #: ../../using/configure.rst:444 -msgid "Add :func:`sys.getobjects` function." -msgstr "新增 :func:`sys.getobjects` 函式。" +msgid "Add :func:`!sys.getobjects` function." +msgstr "新增 :func:`!sys.getobjects` 函式。" #: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." @@ -739,7 +748,7 @@ msgstr "" #: ../../using/configure.rst:522 msgid "" -"Build the :mod:`pyexpat` module using an installed ``expat`` library " +"Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" @@ -1105,8 +1114,8 @@ msgstr "" #: ../../using/configure.rst:772 msgid "" -"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" -"`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " +"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" +"`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" @@ -1121,8 +1130,8 @@ msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" #: ../../using/configure.rst:779 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " -"built as a shared library, its ``PyInit_xxx()`` function is not exported, " -"causing an :exc:`ImportError` on import." +"built as a shared library, its :samp:`PyInit_{xxx}()` function is not " +"exported, causing an :exc:`ImportError` on import." msgstr "" #: ../../using/configure.rst:785 @@ -1146,8 +1155,8 @@ msgstr "" #: ../../using/configure.rst:801 msgid "" -"(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " -"headers in a nonstandard directory ````." +"(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " +"have headers in a nonstandard directory *include_dir*." msgstr "" #: ../../using/configure.rst:804 ../../using/configure.rst:994 @@ -1362,8 +1371,8 @@ msgstr "" #: ../../using/configure.rst:991 msgid "" -"Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " -"directory ````." +"Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " +"nonstandard directory *lib_dir*." msgstr "" #: ../../using/configure.rst:1000 diff --git a/using/unix.po b/using/unix.po index e52c5fd184..c60e6b9d4a 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,19 +69,19 @@ msgstr "對於 OpenSuse 用戶" #: ../../using/unix.rst:33 msgid "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" msgstr "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" #: ../../using/unix.rst:34 msgid "for Fedora users" msgstr "對於 Fedora 用戶" #: ../../using/unix.rst:35 -msgid "http://www.slackbook.org/html/package-management-making-packages.html" -msgstr "http://www.slackbook.org/html/package-management-making-packages.html" +msgid "https://slackbook.org/html/package-management-making-packages.html" +msgstr "https://slackbook.org/html/package-management-making-packages.html" #: ../../using/unix.rst:36 msgid "for Slackware users" @@ -296,14 +296,3 @@ msgid "" msgstr "" "OpenSSL 的修補釋出版 (patch releases) 具有向後相容的 ABI。你不需要重新編譯 " "Python 來更新 OpenSSL。使用一個新的版本來替代客製化 OpenSSL 安裝版就可以了。" - -#~ msgid "On OpenSolaris" -#~ msgstr "在 OpenSolaris 系統上" - -#~ msgid "" -#~ "You can get Python from `OpenCSW `_. Various " -#~ "versions of Python are available and can be installed with e.g. ``pkgutil " -#~ "-i python27``." -#~ msgstr "" -#~ "你可以從 `OpenCSW `_ 獲取、安裝及使用各種版本的 " -#~ "Python。比如 ``pkgutil -i python27``。" diff --git a/using/windows.po b/using/windows.po index a210a5b577..bd3c17e947 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-17 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -1461,8 +1461,8 @@ msgstr "" #: ../../using/windows.rst:890 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " -"not provably i386/32-bit\". To request a specific environment, use the new " -"``-V:`` argument with the complete tag." +"not provably i386/32-bit\". To request a specific environment, use the new :" +"samp:`-V:{TAG}` argument with the complete tag." msgstr "" #: ../../using/windows.rst:894 @@ -1957,19 +1957,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1193 +#: ../../using/windows.rst:1192 msgid "" -"Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." +"Add ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1195 +#: ../../using/windows.rst:1197 msgid "" -"Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " -"executable." +"Add :file:`python{XX}.zip` as a potential landmark when directly adjacent to " +"the executable." msgstr "" -#: ../../using/windows.rst:1201 +#: ../../using/windows.rst:1202 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1977,88 +1977,88 @@ msgid "" "explicitly added to :data:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1207 +#: ../../using/windows.rst:1208 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1209 +#: ../../using/windows.rst:1210 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:1213 +#: ../../using/windows.rst:1214 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1217 +#: ../../using/windows.rst:1218 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1219 +#: ../../using/windows.rst:1220 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:1223 +#: ../../using/windows.rst:1224 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1226 +#: ../../using/windows.rst:1227 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1227 +#: ../../using/windows.rst:1228 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1228 +#: ../../using/windows.rst:1229 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1230 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1233 +#: ../../using/windows.rst:1234 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1242 +#: ../../using/windows.rst:1243 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1243 +#: ../../using/windows.rst:1244 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1247 +#: ../../using/windows.rst:1248 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1249 +#: ../../using/windows.rst:1250 msgid "" "`cx_Freeze `_ wraps Python " "scripts into executable Windows programs (:file:`{*}.exe` files). When you " @@ -2066,11 +2066,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1256 +#: ../../using/windows.rst:1257 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1258 +#: ../../using/windows.rst:1259 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2078,48 +2078,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1263 +#: ../../using/windows.rst:1264 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1267 +#: ../../using/windows.rst:1268 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1269 +#: ../../using/windows.rst:1270 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1273 +#: ../../using/windows.rst:1274 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1275 +#: ../../using/windows.rst:1276 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:1279 +#: ../../using/windows.rst:1280 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1282 +#: ../../using/windows.rst:1283 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1286 +#: ../../using/windows.rst:1287 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 32d093ef5d..b0fba98274 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -212,11 +212,11 @@ msgstr "" #: ../../whatsnew/2.0.rst:155 msgid "" "In Python source code, Unicode strings are written as ``u\"string\"``. " -"Arbitrary Unicode characters can be written using a new escape sequence, " -"``\\uHHHH``, where *HHHH* is a 4-digit hexadecimal number from 0000 to " -"FFFF. The existing ``\\xHHHH`` escape sequence can also be used, and octal " -"escapes can be used for characters up to U+01FF, which is represented by " -"``\\777``." +"Arbitrary Unicode characters can be written using a new escape sequence, :" +"samp:`\\\\u{HHHH}`, where *HHHH* is a 4-digit hexadecimal number from 0000 " +"to FFFF. The existing :samp:`\\\\x{HH}` escape sequence can also be used, " +"and octal escapes can be used for characters up to U+01FF, which is " +"represented by ``\\777``." msgstr "" #: ../../whatsnew/2.0.rst:161 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index ea946a8f00..f542f4b572 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2069,8 +2069,8 @@ msgid "" "The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " "deprecated. Initialization functions for Python extension modules should now " "be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " -"core will generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` " -"macros." +"core will generally use the :c:macro:`!PyAPI_FUNC` and :c:macro:`!" +"PyAPI_DATA` macros." msgstr "" #: ../../whatsnew/2.3.rst:1894 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 736ee4d980..ac6200eaa8 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:128 msgid "" -"The 3xxx series of PEPs, which contains proposals for Python 3.0. :pep:" +"The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" "`3000` describes the development process for Python 3.0. Start with :pep:" "`3100` that describes the general goals for Python 3.0, and then explore the " "higher-numbered PEPS that propose specific features." @@ -2054,16 +2054,15 @@ msgstr "" #: ../../whatsnew/2.6.rst:1853 msgid "" -"A new data type in the :mod:`collections` module: :class:" -"`namedtuple(typename, fieldnames)` is a factory function that creates " -"subclasses of the standard tuple whose fields are accessible by name as well " -"as index. For example::" +"A new data type in the :mod:`collections` module: ``namedtuple(typename, " +"fieldnames)`` is a factory function that creates subclasses of the standard " +"tuple whose fields are accessible by name as well as index. For example::" msgstr "" #: ../../whatsnew/2.6.rst:1875 msgid "" "Several places in the standard library that returned tuples have been " -"modified to return :class:`namedtuple` instances. For example, the :meth:" +"modified to return :func:`namedtuple` instances. For example, the :meth:" "`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" "`digits`, and :attr:`exponent` fields." msgstr "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index e1f2db7479..1f2d4fac77 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1114,11 +1113,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:880 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " -"deleting the :const:`__debug__` constant. (Contributed by Dong-hee Na in :" +"deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" "issue:`45000`.)" msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" -"`NameError`)。(由 Dong-hee Na 在 :issue:`45000` 中貢獻。)" +"`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" #: ../../whatsnew/3.10.rst:883 msgid "" @@ -1241,7 +1240,7 @@ msgid "" "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" -"功能。 (Hai Shi在 :issue:`41842` 中貢獻。)" +"功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" #: ../../whatsnew/3.10.rst:947 msgid "collections.abc" @@ -1796,12 +1795,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:1256 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " -"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :" +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" "issue:`43106`.)" msgstr "" "為 macOS 新增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os." -"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:" -"`43106` 中貢獻。)" +"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1261 msgid "os.path" @@ -2447,13 +2446,13 @@ msgstr "" msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" -"`reversed`, :func:`bool` and :func:`float`. (Contributed by Dong-hee Na and " +"`reversed`, :func:`bool` and :func:`float`. (Contributed by Donghee Na and " "Jeroen Demeyer in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:" "`41873` and :issue:`41870`.)" msgstr "" "以下內建函式現在支援更快的 :pep:`590` vectorcall 呼叫慣例::func:`map`、:" -"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Dong-" -"hee Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" +"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Donghee " +"Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" #: ../../whatsnew/3.10.rst:1587 @@ -2907,13 +2906,12 @@ msgid "" "somewhat obsolete, little used, and not tested. It was originally scheduled " "to be removed in Python 3.6, but such removals were delayed until after " "Python 2.7 EOL. Existing users should copy whatever classes they use into " -"their code. (Contributed by Dong-hee Na and Terry J. Reedy in :issue:" -"`42299`.)" +"their code. (Contributed by Donghee Na and Terry J. Reedy in :issue:`42299`.)" msgstr "" "刪除了 ``formatter`` 模組,該模組在 Python 3.4 中已棄用。它有些過時、很少被使" "用,也沒有經過測試。它最初計劃在 Python 3.6 中刪除,但此類別的刪除被推遲到 " "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" -"(由 Dong-hee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" +"(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" #: ../../whatsnew/3.10.rst:1822 msgid "" @@ -3429,7 +3427,7 @@ msgid "" "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " -"Hai Shi在 :issue:`41832` 中貢獻。)" +"Hai Shi 在 :issue:`41832` 中貢獻。)" #: ../../whatsnew/3.10.rst:2087 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 8f1f96a9a8..32a6ae6486 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,12 +32,12 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" -"This article explains the new features in Python 3.11, compared to 3.10." -msgstr "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。" - -#: ../../whatsnew/3.11.rst:49 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +"This article explains the new features in Python 3.11, compared to 3.10. " +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." +msgstr "" +"此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。Python 3.11 於 2022 年 " +"10 月 24 日發布。完整細節請見 :ref:`changelog`。" #: ../../whatsnew/3.11.rst:55 msgid "Summary -- Release highlights" @@ -285,14 +284,15 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " "significantly updated. It now supports company/tag syntax as defined in :pep:" -"`514` using the ``-V:/`` argument instead of the limited ``-" -".``. This allows launching distributions other than " -"``PythonCore``, the one hosted on `python.org `_." +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" "Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" -"`514` 所定義的公司/標籤 (tag) 語法,可用 ``-V:/`` 引數來取代受" -"限的 ``-.``。這允許了 `python.org `_ 上" -"的 ``PythonCore`` 以外的發行版本發布。" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" @@ -307,21 +307,22 @@ msgstr "" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy ``-``, ``-.``, ``--" -"`` or ``-.-`` arguments, all existing " -"behaviour should be preserved from past versions, and only releases from " -"``PythonCore`` will be selected. However, the ``-64`` suffix now implies " -"\"not 32-bit\" (not necessarily x86-64), as there are multiple supported 64-" -"bit platforms. 32-bit runtimes are detected by checking the runtime's tag " -"for a ``-32`` suffix. All releases of Python since 3.5 have included this in " -"their 32-bit builds." -msgstr "" -"當使用遺留的 ``-``、``-.``、``--`` 或 " -"``-.-`` 引數時,所有過去版本的行為都應該保留下來,且只" -"有 ``PythonCore`` 中的發布版本會被選用。然而,``-64`` 後綴現在暗示了「非 32-" -"bit」(不用一定要是 x86-64),因為現在有多個支援 64-bit 的平台。32-bit 運行程" -"式會在檢查運行程式之標籤是否帶有 ``-32`` 後綴時被偵測出來。所有 Python 3.5 以" -"後發布版本的 32-bit 建置中都有這個行為。" +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " +"and only releases from ``PythonCore`` will be selected. However, the ``-64`` " +"suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " +"multiple supported 64-bit platforms. 32-bit runtimes are detected by " +"checking the runtime's tag for a ``-32`` suffix. All releases of Python " +"since 3.5 have included this in their 32-bit builds." +msgstr "" +"當使用遺留的 :samp:`-{}`、:samp:`-{}.{}`、:samp:`-" +"{}-{}` 或 :samp:`-{}.{}-{}` 引數時,所" +"有過去版本的行為都應該保留下來,且只有 ``PythonCore`` 中的發布版本會被選用。" +"然而,``-64`` 後綴現在暗示了「非 32-bit」(不用一定要是 x86-64),因為現在有" +"多個支援 64-bit 的平台。32-bit 運行程式會在檢查運行程式之標籤是否帶有 " +"``-32`` 後綴時被偵測出來。所有 Python 3.5 以後發布版本的 32-bit 建置中都有這" +"個行為。" #: ../../whatsnew/3.11.rst:244 msgid "New Features Related to Type Hints" @@ -669,12 +670,12 @@ msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" "class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " -"(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.)" +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" "定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." -"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " -"Na 於 :issue:`24234` 中所貢獻。)" +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -1331,11 +1332,11 @@ msgstr "os" #: ../../whatsnew/3.11.rst:898 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" "issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" -"的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" +"的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" #: ../../whatsnew/3.11.rst:906 msgid "pathlib" @@ -1648,14 +1649,15 @@ msgid "" "on `high-resolution timers `_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " -"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, Dong-" -"hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.)" +"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Dong-hee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" "`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1098 @@ -2043,10 +2045,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1306 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " -"time. (Contributed by Dong-hee Na in :issue:`44987`.)" +"time. (Contributed by Donghee Na in :issue:`44987`.)" msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" -"串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" +"串。(由 Donghee Na 在 :issue:`44987` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "Faster CPython" @@ -2324,8 +2326,8 @@ msgid "10%" msgstr "10%" #: ../../whatsnew/3.11.rst:1454 -msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" +msgid "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" +msgstr "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" #: ../../whatsnew/3.11.rst:1460 msgid "Subscript" @@ -2577,7 +2579,7 @@ msgid "" msgstr "" ":mod:`re` 的正則表達式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" -"行 `pyperformance正則表達式基準量測 `_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" @@ -3285,10 +3287,10 @@ msgstr "" msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " -"itself. (Contributed by Dong-hee Na in :issue:`42255`.)" +"itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" "issue:`42255`。)" #: ../../whatsnew/3.11.rst:1844 @@ -3727,14 +3729,14 @@ msgid "" "output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " "and the *codeset* parameter of :func:`!translation` and :func:`!install`, " "since they are only used for the :func:`!l*gettext` functions. (Contributed " -"by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" "刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" "func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" "bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" "meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" -"式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" +"式。 (由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:1989 msgid "Removed from the :mod:`inspect` module:" @@ -3785,10 +3787,10 @@ msgstr "" msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " -"Dong-hee Na in :issue:`35800`.)" +"Donghee Na in :issue:`35800`.)" msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" -"套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" +"套件 :mod:`!mailman` 使用。(由 Donghee Na 於 :issue:`35800` 貢獻。)" #: ../../whatsnew/3.11.rst:2014 msgid "" @@ -4062,12 +4064,12 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Dong-hee Na and Brett Holman in :issue:" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" "`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" "with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"html>`_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" #: ../../whatsnew/3.11.rst:2156 @@ -5146,102 +5148,3 @@ msgid "" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" - -#~ msgid "" -#~ "Added :meth:`object.__getstate__`, which provides the default " -#~ "implementation of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :" -#~ "mod:`pickle`\\ing instances of subclasses of builtin types :class:" -#~ "`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections." -#~ "OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, and :" -#~ "class:`datetime.tzinfo` now copies and pickles instance attributes " -#~ "implemented as :term:`slots <__slots__>`. (Contributed by Serhiy " -#~ "Storchaka in :issue:`26579`.)" -#~ msgstr "" -#~ "添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預" -#~ "設實作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:" -#~ "class:`collections.OrderedDict`、:class:`collections.deque`、:class:" -#~ "`weakref.WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:" -#~ "`pickle` 實例,現在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬" -#~ "性。 (由 Serhiy Storchaka 在 :issue:`26579` 中貢獻。)" - -#~ msgid ":c:func:`PyBuffer_CopyData`" -#~ msgstr ":c:func:`PyBuffer_CopyData`" - -#~ msgid ":c:func:`PySys_AddWarnOptionUnicode`" -#~ msgstr ":c:func:`PySys_AddWarnOptionUnicode`" - -#~ msgid ":c:func:`PySys_AddWarnOption`" -#~ msgstr ":c:func:`PySys_AddWarnOption`" - -#~ msgid ":c:func:`PySys_AddXOption`" -#~ msgstr ":c:func:`PySys_AddXOption`" - -#~ msgid ":c:func:`PySys_HasWarnOptions`" -#~ msgstr ":c:func:`PySys_HasWarnOptions`" - -#~ msgid ":c:func:`PySys_SetArgvEx`" -#~ msgstr ":c:func:`PySys_SetArgvEx`" - -#~ msgid ":c:func:`PySys_SetArgv`" -#~ msgstr ":c:func:`PySys_SetArgv`" - -#~ msgid ":c:func:`PySys_SetPath`" -#~ msgstr ":c:func:`PySys_SetPath`" - -#~ msgid ":c:func:`Py_SetPath`" -#~ msgstr ":c:func:`Py_SetPath`" - -#~ msgid ":c:func:`Py_SetProgramName`" -#~ msgstr ":c:func:`Py_SetProgramName`" - -#~ msgid ":c:func:`Py_SetPythonHome`" -#~ msgstr ":c:func:`Py_SetPythonHome`" - -#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" -#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" - -#~ msgid ":c:func:`_Py_SetProgramFullPath`" -#~ msgstr ":c:func:`_Py_SetProgramFullPath`" - -#~ msgid ":c:func:`PyUnicode_AS_DATA`" -#~ msgstr ":c:func:`PyUnicode_AS_DATA`" - -#~ msgid ":c:func:`PyUnicode_AS_UNICODE`" -#~ msgstr ":c:func:`PyUnicode_AS_UNICODE`" - -#~ msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" -#~ msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" - -#~ msgid ":c:func:`PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`PyUnicode_AsUnicode`" - -#~ msgid ":c:func:`PyUnicode_FromUnicode`" -#~ msgstr ":c:func:`PyUnicode_FromUnicode`" - -#~ msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GET_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GetSize`" -#~ msgstr ":c:func:`PyUnicode_GetSize`" - -#~ msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#~ msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" - -#~ msgid ":c:func:`_PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`_PyUnicode_AsUnicode`" - -#~ msgid ":c:macro:`PyUnicode_WCHAR_KIND`" -#~ msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" - -#~ msgid ":c:func:`PyUnicode_InternImmortal()`" -#~ msgstr ":c:func:`PyUnicode_InternImmortal()`" - -#~ msgid "" -#~ ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " -#~ "removed. (Contributed by Mark Shannon in :issue:`40222`.)" -#~ msgstr "" -#~ "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 " -#~ "Mark Shannon 於 :issue:`40222` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 0d4fc1eb05..caf6dee4a5 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,157 +21,339 @@ msgid "What's New In Python 3.12" msgstr "Python 3.12 有什麼新功能" #: ../../whatsnew/3.12.rst:0 -msgid "Release" -msgstr "發行版本" +msgid "Editor" +msgstr "編輯者" #: ../../whatsnew/3.12.rst:6 -msgid "|release|" -msgstr "|release|" +msgid "Adam Turner" +msgstr "Adam Turner" -#: ../../whatsnew/3.12.rst:0 -msgid "Date" -msgstr "日期" +#: ../../whatsnew/3.12.rst:48 +msgid "" +"This article explains the new features in Python 3.12, compared to 3.11. " +"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" +"`changelog `." +msgstr "" -#: ../../whatsnew/3.12.rst:7 -msgid "|today|" -msgstr "|today|" +#: ../../whatsnew/3.12.rst:54 +msgid ":pep:`693` -- Python 3.12 Release Schedule" +msgstr ":pep:`693` -- Python 3.12 發佈時程" + +#: ../../whatsnew/3.12.rst:57 +msgid "Summary -- Release highlights" +msgstr "發布重點摘要" -#: ../../whatsnew/3.12.rst:49 +#: ../../whatsnew/3.12.rst:62 msgid "" -"This article explains the new features in Python 3.12, compared to 3.11." -msgstr "此文章解釋了 Python 3.12 和 3.11 相比多了哪些新特性。" +"Python 3.12 is the latest stable release of the Python programming language, " +"with a mix of changes to the language and the standard library. The library " +"changes focus on cleaning up deprecated APIs, usability, and correctness. Of " +"note, the :mod:`!distutils` package has been removed from the standard " +"library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " +"number of improvements, and several modules have better performance." +msgstr "" -#: ../../whatsnew/3.12.rst:51 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +#: ../../whatsnew/3.12.rst:69 +msgid "" +"The language changes focus on usability, as :term:`f-strings ` " +"have had many limitations removed and 'Did you mean ...' suggestions " +"continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for using :term:" +"`generic types ` and :term:`type aliases ` with " +"static type checkers." +msgstr "" -#: ../../whatsnew/3.12.rst:55 +#: ../../whatsnew/3.12.rst:76 msgid "" -"Prerelease users should be aware that this document is currently in draft " -"form. It will be updated substantially as Python 3.12 moves towards release, " -"so it's worth checking back even after reading earlier versions." +"This article doesn't attempt to provide a complete specification of all new " +"features, but instead gives a convenient overview. For full details, you " +"should refer to the documentation, such as the :ref:`Library Reference " +"` and :ref:`Language Reference `. If you " +"want to understand the complete implementation and design rationale for a " +"change, refer to the PEP for a particular new feature; but note that PEPs " +"usually are not kept up-to-date once a feature has been fully implemented." msgstr "" -#: ../../whatsnew/3.12.rst:61 -msgid "Summary -- Release highlights" -msgstr "發布重點摘要" +#: ../../whatsnew/3.12.rst:90 +msgid "New syntax features:" +msgstr "" -#: ../../whatsnew/3.12.rst:69 +#: ../../whatsnew/3.12.rst:92 +msgid "" +":ref:`PEP 695 `, type parameter syntax and the :keyword:" +"`type` statement" +msgstr "" + +#: ../../whatsnew/3.12.rst:94 msgid "New grammar features:" msgstr "新增語法特性:" -#: ../../whatsnew/3.12.rst:71 -msgid ":ref:`whatsnew312-pep701`" -msgstr ":ref:`whatsnew312-pep701`" +#: ../../whatsnew/3.12.rst:96 +msgid "" +":ref:`PEP 701 `, :term:`f-strings ` in the " +"grammar" +msgstr "" -#: ../../whatsnew/3.12.rst:73 +#: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:75 -msgid ":ref:`whatsnew312-pep684`" -msgstr ":ref:`whatsnew312-pep684`" +#: ../../whatsnew/3.12.rst:100 +msgid "" +":ref:`PEP 684 `, a unique per-interpreter :term:`GIL " +"`" +msgstr "" -#: ../../whatsnew/3.12.rst:77 -msgid ":ref:`whatsnew312-pep669`" -msgstr ":ref:`whatsnew312-pep669`" +#: ../../whatsnew/3.12.rst:102 +msgid ":ref:`PEP 669 `, low impact monitoring" +msgstr "" -#: ../../whatsnew/3.12.rst:79 -msgid "New typing features:" -msgstr "新增型別特性:" +#: ../../whatsnew/3.12.rst:103 +msgid "" +"`Improved 'Did you mean ...' suggestions `_ for :" +"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +msgstr "" -#: ../../whatsnew/3.12.rst:81 -msgid ":ref:`whatsnew312-pep688`" -msgstr ":ref:`whatsnew312-pep688`" +#: ../../whatsnew/3.12.rst:106 +msgid "Python data model improvements:" +msgstr "" -#: ../../whatsnew/3.12.rst:83 -msgid ":ref:`whatsnew312-pep692`" -msgstr ":ref:`whatsnew312-pep692`" +#: ../../whatsnew/3.12.rst:108 +msgid "" +":ref:`PEP 688 `, using the :ref:`buffer protocol " +"` from Python" +msgstr "" -#: ../../whatsnew/3.12.rst:85 -msgid ":ref:`whatsnew312-pep695`" -msgstr ":ref:`whatsnew312-pep695`" +#: ../../whatsnew/3.12.rst:111 +msgid "Significant improvements in the standard library:" +msgstr "" -#: ../../whatsnew/3.12.rst:87 -msgid ":ref:`whatsnew312-pep698`" -msgstr ":ref:`whatsnew312-pep698`" +#: ../../whatsnew/3.12.rst:113 +msgid "The :class:`pathlib.Path` class now supports subclassing" +msgstr "" -#: ../../whatsnew/3.12.rst:89 -msgid "Important deprecations, removals or restrictions:" +#: ../../whatsnew/3.12.rst:114 +msgid "The :mod:`os` module received several improvements for Windows support" msgstr "" -#: ../../whatsnew/3.12.rst:91 -msgid ":pep:`623`: Remove wstr from Unicode" +#: ../../whatsnew/3.12.rst:115 +msgid "" +"A :ref:`command-line interface ` has been added to the :mod:" +"`sqlite3` module" msgstr "" -#: ../../whatsnew/3.12.rst:93 +#: ../../whatsnew/3.12.rst:117 msgid "" -":pep:`632`: Remove the ``distutils`` package. See `the migration guide " -"`_ for advice on its " -"replacement." +":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" msgstr "" -#: ../../whatsnew/3.12.rst:98 -msgid "Improved Error Messages" +#: ../../whatsnew/3.12.rst:119 +msgid "" +"The :mod:`asyncio` package has had a number of performance improvements, " +"with some benchmarks showing a 75% speed up." msgstr "" -#: ../../whatsnew/3.12.rst:100 +#: ../../whatsnew/3.12.rst:121 msgid "" -"Modules from the standard library are now potentially suggested as part of " -"the error messages displayed by the interpreter when a :exc:`NameError` is " -"raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." +"A :ref:`command-line interface ` has been added to the :mod:`uuid` " +"module" msgstr "" -#: ../../whatsnew/3.12.rst:109 +#: ../../whatsnew/3.12.rst:123 msgid "" -"Improve the error suggestion for :exc:`NameError` exceptions for instances. " -"Now if a :exc:`NameError` is raised in a method and the instance has an " -"attribute that's exactly equal to the name in the exception, the suggestion " -"will include ``self.`` instead of the closest match in the method " -"scope. Contributed by Pablo Galindo in :gh:`99139`." +"Due to the changes in :ref:`PEP 701 `, producing tokens " +"via the :mod:`tokenize` module is up to 64% faster." +msgstr "" + +#: ../../whatsnew/3.12.rst:126 +msgid "Security improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:130 +#: ../../whatsnew/3.12.rst:128 msgid "" -"Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" -"`98931`." +"Replace the builtin :mod:`hashlib` implementations of SHA1, SHA3, SHA2-384, " +"SHA2-512, and MD5 with formally verified code from the `HACL* `__ project. These builtin implementations " +"remain as fallbacks that are only used when OpenSSL does not provide them." +msgstr "" + +#: ../../whatsnew/3.12.rst:134 +msgid "C API improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:136 +msgid ":ref:`PEP 697 `, unstable C API tier" +msgstr "" + +#: ../../whatsnew/3.12.rst:137 +msgid ":ref:`PEP 683 `, immortal objects" msgstr "" -#: ../../whatsnew/3.12.rst:140 +#: ../../whatsnew/3.12.rst:139 +msgid "CPython implementation improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:141 +msgid ":ref:`PEP 709 `, comprehension inlining" +msgstr "" + +#: ../../whatsnew/3.12.rst:142 +msgid ":ref:`CPython support ` for the Linux ``perf`` profiler" +msgstr "" + +#: ../../whatsnew/3.12.rst:143 +msgid "Implement stack overflow protection on supported platforms" +msgstr "" + +#: ../../whatsnew/3.12.rst:145 +msgid "New typing features:" +msgstr "新增型別特性:" + +#: ../../whatsnew/3.12.rst:147 msgid "" -":exc:`ImportError` exceptions raised from failed ``from import " -"`` statements now include suggestions for the value of ```` " -"based on the available names in ````. Contributed by Pablo Galindo " -"in :gh:`91058`." +":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " +"annotate :term:`**kwargs `" +msgstr "" + +#: ../../whatsnew/3.12.rst:149 +msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" +msgstr "" + +#: ../../whatsnew/3.12.rst:151 +msgid "Important deprecations, removals or restrictions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:153 +msgid "" +":pep:`623`: Remove ``wstr`` from Unicode objects in Python's C API, reducing " +"the size of every :class:`str` object by at least 8 bytes." +msgstr "" + +#: ../../whatsnew/3.12.rst:156 +msgid "" +":pep:`632`: Remove the :mod:`!distutils` package. See `the migration guide " +"`_ for advice replacing " +"the APIs it provided. The third-party `Setuptools `__ package continues to " +"provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond." +msgstr "" + +#: ../../whatsnew/3.12.rst:163 +msgid "" +":gh:`95299`: Do not pre-install ``setuptools`` in virtual environments " +"created with :mod:`venv`. This means that ``distutils``, ``setuptools``, " +"``pkg_resources``, and ``easy_install`` will no longer available by default; " +"to access these run ``pip install setuptools`` in the :ref:`activated ` virtual environment." msgstr "" -#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:170 +msgid "" +"The :mod:`!asynchat`, :mod:`!asyncore`, and :mod:`!imp` modules have been " +"removed, along with several :class:`unittest.TestCase` `method aliases " +"`_." +msgstr "" + +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:181 +msgid "PEP 695: Type Parameter Syntax" +msgstr "" + +#: ../../whatsnew/3.12.rst:183 +msgid "" +"Generic classes and functions under :pep:`484` were declared using a verbose " +"syntax that left the scope of type parameters unclear and required explicit " +"declarations of variance." +msgstr "" + +#: ../../whatsnew/3.12.rst:187 +msgid "" +":pep:`695` introduces a new, more compact and explicit way to create :ref:" +"`generic classes ` and :ref:`functions `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:200 +msgid "" +"In addition, the PEP introduces a new way to declare :ref:`type aliases " +"` using the :keyword:`type` statement, which creates an " +"instance of :class:`~typing.TypeAliasType`::" +msgstr "" + +#: ../../whatsnew/3.12.rst:206 +msgid "Type aliases can also be :ref:`generic `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:210 +msgid "" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" +"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " +"parameters with bounds or constraints::" +msgstr "" + +#: ../../whatsnew/3.12.rst:219 +msgid "" +"The value of type aliases and the bound and constraints of type variables " +"created through this syntax are evaluated only on demand (see :ref:`lazy " +"evaluation `). This means type aliases are able to refer to " +"other types defined later in the file." +msgstr "" + +#: ../../whatsnew/3.12.rst:224 +msgid "" +"Type parameters declared through a type parameter list are visible within " +"the scope of the declaration and any nested scopes, but not in the outer " +"scope. For example, they can be used in the type annotations for the methods " +"of a generic class or in the class body. However, they cannot be used in the " +"module scope after the class is defined. See :ref:`type-params` for a " +"detailed description of the runtime semantics of type parameters." +msgstr "" + +#: ../../whatsnew/3.12.rst:231 +msgid "" +"In order to support these scoping semantics, a new kind of scope is " +"introduced, the :ref:`annotation scope `. Annotation " +"scopes behave for the most part like function scopes, but interact " +"differently with enclosing class scopes. In Python 3.13, :term:`annotations " +"` will also be evaluated in annotation scopes." +msgstr "" + +#: ../../whatsnew/3.12.rst:237 +msgid "See :pep:`695` for more details." +msgstr "詳情請見 :pep:`695`。" + +#: ../../whatsnew/3.12.rst:239 +msgid "" +"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " +"and others in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:245 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:158 +#: ../../whatsnew/3.12.rst:247 msgid "" -":pep:`701` lifts some restrictions on the usage of f-strings. Expression " -"components inside f-strings can now be any valid Python expression including " -"backslashes, unicode escaped sequences, multi-line expressions, comments and " -"strings reusing the same quote as the containing f-string. Let's cover these " -"in detail:" +":pep:`701` lifts some restrictions on the usage of :term:`f-strings `. Expression components inside f-strings can now be any valid Python " +"expression, including strings reusing the same quote as the containing f-" +"string, multi-line expressions, comments, backslashes, and unicode escape " +"sequences. Let's cover these in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:163 +#: ../../whatsnew/3.12.rst:253 msgid "" -"Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" +"Quote reuse: in Python 3.11, reusing the same quotes as the enclosing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " "available quotes (like using double quotes or triple quotes if the f-string " "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:172 +#: ../../whatsnew/3.12.rst:262 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -180,44 +361,43 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:180 +#: ../../whatsnew/3.12.rst:270 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:186 +#: ../../whatsnew/3.12.rst:276 msgid "" -"Multi-line expressions and comments: In Python 3.11, f-strings expressions " -"must be defined in a single line even if outside f-strings expressions could " -"span multiple lines (like literal lists being defined over multiple lines), " -"making them harder to read. In Python 3.12 you can now define expressions " -"spanning multiple lines and include comments on them:" +"Multi-line expressions and comments: In Python 3.11, f-string expressions " +"must be defined in a single line, even if the expression within the f-string " +"could normally span multiple lines (like literal lists being defined over " +"multiple lines), making them harder to read. In Python 3.12 you can now " +"define f-strings spanning multiple lines, and add inline comments:" msgstr "" -#: ../../whatsnew/3.12.rst:199 +#: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected unicode escaped " -"sequences (such as ``\\N{snowman}``) as these contain the ``\\N`` part that " -"previously could not be part of expression components of f-strings. Now, you " -"can define expressions like this:" +"couldn't contain any ``\\`` character. This also affected unicode :ref:" +"`escape sequences ` (such as ``\\N{snowman}``) as these " +"contain the ``\\N`` part that previously could not be part of expression " +"components of f-strings. Now, you can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:303 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:214 +#: ../../whatsnew/3.12.rst:305 msgid "" "As a positive side-effect of how this feature has been implemented (by " -"parsing f-strings with the PEG parser (see :pep:`617`), now error messages " -"for f-strings are more precise and include the exact location of the error. " -"For example, in Python 3.11, the following f-string raises a :exc:" -"`SyntaxError`:" +"parsing f-strings with :pep:`the PEG parser <617>`), now error messages for " +"f-strings are more precise and include the exact location of the error. For " +"example, in Python 3.11, the following f-string raises a :exc:`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:227 +#: ../../whatsnew/3.12.rst:318 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -225,82 +405,72 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:239 +#: ../../whatsnew/3.12.rst:330 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:246 -msgid "PEP 709: Comprehension inlining" +#: ../../whatsnew/3.12.rst:337 +msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:248 +#: ../../whatsnew/3.12.rst:339 msgid "" -"Dictionary, list, and set comprehensions are now inlined, rather than " -"creating a new single-use function object for each execution of the " -"comprehension. This speeds up execution of a comprehension by up to 2x." +":pep:`684` introduces a per-interpreter :term:`GIL `, so that sub-interpreters may now be created with a unique GIL per " +"interpreter. This allows Python programs to take full advantage of multiple " +"CPU cores. This is currently only available through the C-API, though a " +"Python API is :pep:`anticipated for 3.13 <554>`." msgstr "" -#: ../../whatsnew/3.12.rst:252 +#: ../../whatsnew/3.12.rst:345 msgid "" -"Comprehension iteration variables remain isolated; they don't overwrite a " -"variable of the same name in the outer scope, nor are they visible after the " -"comprehension. This isolation is now maintained via stack/locals " -"manipulation, not via separate function scope." -msgstr "" - -#: ../../whatsnew/3.12.rst:257 -msgid "Inlining does result in a few visible behavior changes:" +"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " +"interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:359 msgid "" -"There is no longer a separate frame for the comprehension in tracebacks, and " -"tracing/profiling no longer shows the comprehension as a function call." +"For further examples how to use the C-API for sub-interpreters with a per-" +"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:261 -msgid "" -"The :mod:`symtable` module will no longer produce child symbol tables for " -"each comprehension; instead, the comprehension's locals will be included in " -"the parent function's symbol table." -msgstr "" +#: ../../whatsnew/3.12.rst:362 +msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" +msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:264 -msgid "" -"Calling :func:`locals` inside a comprehension now includes variables from " -"outside the comprehension, and no longer includes the synthetic ``.0`` " -"variable for the comprehension \"argument\"." +#: ../../whatsnew/3.12.rst:367 +msgid "PEP 669: Low impact monitoring for CPython" msgstr "" -#: ../../whatsnew/3.12.rst:267 +#: ../../whatsnew/3.12.rst:369 msgid "" -"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " -"locals()]``) may see \"RuntimeError: dictionary changed size during " -"iteration\" when run under tracing (e.g. code coverage measurement). This is " -"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " -"error, first create a list of keys to iterate over: ``keys = list(locals()); " -"[k for k in keys]``." +":pep:`669` defines a new :mod:`API ` for profilers, " +"debuggers, and other tools to monitor events in CPython. It covers a wide " +"range of events, including calls, returns, lines, exceptions, jumps, and " +"more. This means that you only pay for what you use, providing support for " +"near-zero overhead debuggers and coverage tools. See :mod:`sys.monitoring` " +"for details." msgstr "" -#: ../../whatsnew/3.12.rst:274 -msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." +#: ../../whatsnew/3.12.rst:377 +msgid "(Contributed by Mark Shannon in :gh:`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:279 +#: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:384 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:285 +#: ../../whatsnew/3.12.rst:388 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -308,92 +478,134 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:294 -msgid "PEP 684: A Per-Interpreter GIL" +#: ../../whatsnew/3.12.rst:397 +msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:296 +#: ../../whatsnew/3.12.rst:399 msgid "" -"Sub-interpreters may now be created with a unique GIL per interpreter. This " -"allows Python programs to take full advantage of multiple CPU cores." +"Dictionary, list, and set comprehensions are now inlined, rather than " +"creating a new single-use function object for each execution of the " +"comprehension. This speeds up execution of a comprehension by up to two " +"times. See :pep:`709` for further details." msgstr "" -#: ../../whatsnew/3.12.rst:300 +#: ../../whatsnew/3.12.rst:404 msgid "" -"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " -"interpreter with its own GIL::" +"Comprehension iteration variables remain isolated and don't overwrite a " +"variable of the same name in the outer scope, nor are they visible after the " +"comprehension. Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:314 +#: ../../whatsnew/3.12.rst:408 msgid "" -"For further examples how to use the C-API for sub-interpreters with a per-" -"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +"There is no longer a separate frame for the comprehension in tracebacks, and " +"tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:317 -msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" +#: ../../whatsnew/3.12.rst:410 +msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." msgstr "" -#: ../../whatsnew/3.12.rst:319 -msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" -msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" +#: ../../whatsnew/3.12.rst:413 +msgid "" +"Calling :func:`locals` inside a comprehension now includes variables from " +"outside the comprehension, and no longer includes the synthetic ``.0`` " +"variable for the comprehension \"argument\"." +msgstr "" -#: ../../whatsnew/3.12.rst:324 -msgid "PEP 669: Low impact monitoring for CPython" +#: ../../whatsnew/3.12.rst:416 +msgid "" +"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " +"locals()]``) may see \"RuntimeError: dictionary changed size during " +"iteration\" when run under tracing (e.g. code coverage measurement). This is " +"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " +"error, first create a list of keys to iterate over: ``keys = list(locals()); " +"[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:326 +#: ../../whatsnew/3.12.rst:423 +msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:426 +msgid "Improved Error Messages" +msgstr "" + +#: ../../whatsnew/3.12.rst:428 msgid "" -"CPython 3.12 now supports the ability to monitor calls, returns, lines, " -"exceptions and other events using instrumentation. This means that you only " -"pay for what you use, providing support for near-zero overhead debuggers and " -"coverage tools." +"Modules from the standard library are now potentially suggested as part of " +"the error messages displayed by the interpreter when a :exc:`NameError` is " +"raised to the top level. (Contributed by Pablo Galindo in :gh:`98254`.)" msgstr "" -#: ../../whatsnew/3.12.rst:331 -msgid "See :mod:`sys.monitoring` for details." +#: ../../whatsnew/3.12.rst:437 +msgid "" +"Improve the error suggestion for :exc:`NameError` exceptions for instances. " +"Now if a :exc:`NameError` is raised in a method and the instance has an " +"attribute that's exactly equal to the name in the exception, the suggestion " +"will include ``self.`` instead of the closest match in the method " +"scope. (Contributed by Pablo Galindo in :gh:`99139`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:457 +msgid "" +"Improve the :exc:`SyntaxError` error message when the user types ``import x " +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" +"gh:`98931`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:467 +msgid "" +":exc:`ImportError` exceptions raised from failed ``from import " +"`` statements now include suggestions for the value of ```` " +"based on the available names in ````. (Contributed by Pablo Galindo " +"in :gh:`91058`.)" msgstr "" -#: ../../whatsnew/3.12.rst:335 +#: ../../whatsnew/3.12.rst:478 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:337 +#: ../../whatsnew/3.12.rst:480 msgid "" -"This section covers major changes affecting :pep:`484` type hints and the :" +"This section covers major changes affecting :pep:`type hints <484>` and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:343 +#: ../../whatsnew/3.12.rst:486 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:488 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:349 +#: ../../whatsnew/3.12.rst:492 msgid "" -"This PEP specifies a more precise way of typing ``**kwargs`` by relying on " +":pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:360 +#: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:362 +#: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:510 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:369 +#: ../../whatsnew/3.12.rst:512 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -402,138 +614,73 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:375 +#: ../../whatsnew/3.12.rst:518 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:393 -msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" - -#: ../../whatsnew/3.12.rst:398 -msgid "PEP 695: Type Parameter Syntax" -msgstr "" - -#: ../../whatsnew/3.12.rst:400 -msgid "" -"Generic classes and functions under :pep:`484` were declared using a verbose " -"syntax that left the scope of type parameters unclear and required explicit " -"declarations of variance." -msgstr "" - -#: ../../whatsnew/3.12.rst:404 -msgid "" -":pep:`695` introduces a new, more compact and explicit way to create :ref:" -"`generic classes ` and :ref:`functions `::" -msgstr "" - -#: ../../whatsnew/3.12.rst:417 -msgid "" -"In addition, the PEP introduces a new way to declare :ref:`type aliases " -"` using the :keyword:`type` statement, which creates an " -"instance of :class:`~typing.TypeAliasType`::" -msgstr "" - -#: ../../whatsnew/3.12.rst:423 -msgid "Type aliases can also be :ref:`generic `::" +#: ../../whatsnew/3.12.rst:536 +msgid "See :pep:`698` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:427 -msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" -"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " -"parameters with bounds or constraints::" -msgstr "" - -#: ../../whatsnew/3.12.rst:436 -msgid "" -"The value of type aliases and the bound and constraints of type variables " -"created through this syntax are evaluated only on demand (see :ref:`lazy-" -"evaluation`). This means type aliases are able to refer to other types " -"defined later in the file." -msgstr "" - -#: ../../whatsnew/3.12.rst:441 -msgid "" -"Type parameters declared through a type parameter list are visible within " -"the scope of the declaration and any nested scopes, but not in the outer " -"scope. For example, they can be used in the type annotations for the methods " -"of a generic class or in the class body. However, they cannot be used in the " -"module scope after the class is defined. See :ref:`type-params` for a " -"detailed description of the runtime semantics of type parameters." -msgstr "" - -#: ../../whatsnew/3.12.rst:448 -msgid "" -"In order to support these scoping semantics, a new kind of scope is " -"introduced, the :ref:`annotation scope `. Annotation " -"scopes behave for the most part like function scopes, but interact " -"differently with enclosing class scopes. In Python 3.13, :term:`annotations " -"` will also be evaluated in annotation scopes." -msgstr "" - -#: ../../whatsnew/3.12.rst:454 -msgid "See :pep:`695` for more details." -msgstr "詳情請見 :pep:`695`。" - -#: ../../whatsnew/3.12.rst:456 -msgid "" -"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " -"and others in :gh:`103764`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:538 +msgid "(Contributed by Steven Troxler in :gh:`101561`.)" +msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:460 +#: ../../whatsnew/3.12.rst:541 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:543 msgid "" -"Add :ref:`perf_profiling` through the new environment variable :envvar:" -"`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " -"well as the new :func:`sys.activate_stack_trampoline`, :func:`sys." -"deactivate_stack_trampoline`, and :func:`sys.is_stack_trampoline_active` " -"APIs. (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian " -"Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon " -"in :gh:`96123`.)" +"The parser now raises :exc:`SyntaxError` when parsing source code containing " +"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 -msgid "" -"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " -"have a new a *filter* argument that allows limiting tar features than may be " -"surprising or dangerous, such as creating files outside the destination " -"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.14, " -"the default will switch to ``'data'``. (Contributed by Petr Viktorin in :pep:" -"`706`.)" +#: ../../whatsnew/3.12.rst:546 +msgid "" +"A backslash-character pair that is not a valid escape sequence now generates " +"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " +"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " +"(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" +"exc:`SyntaxError` will eventually be raised, instead of :exc:" +"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:480 +#: ../../whatsnew/3.12.rst:555 msgid "" -":class:`types.MappingProxyType` instances are now hashable if the underlying " -"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" +"exc:`DeprecationWarning`. In a future Python version they will be eventually " +"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:484 +#: ../../whatsnew/3.12.rst:561 msgid "" -":class:`memoryview` now supports the half-float type (the \"e\" format " -"code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" +"Variables used in the target part of comprehensions that are not stored to " +"can now be used in assignment expressions (``:=``). For example, in ``[(b := " +"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " +"Note that assigning to variables stored to in the target part of " +"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " +"(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:487 +#: ../../whatsnew/3.12.rst:568 msgid "" -"The parser now raises :exc:`SyntaxError` when parsing source code containing " -"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" +"Exceptions raised in a class or type's ``__set_name__`` method are no longer " +"wrapped by a :exc:`RuntimeError`. Context information is added to the " +"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:490 +#: ../../whatsnew/3.12.rst:572 msgid "" -":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " -"when parsing source code containing null bytes. (Contributed by Pablo " -"Galindo in :gh:`96670`.)" +"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " +"and raises one other exception, that exception is no longer wrapped in an :" +"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " +"Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:577 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -543,98 +690,94 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:501 -msgid "" -"A backslash-character pair that is not a valid escape sequence now generates " -"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " -"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " -"(``\"\\d\"`` is an invalid escape sequence), use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``. In a future Python version, :" -"exc:`SyntaxError` will eventually be raised, instead of :exc:" -"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:510 -msgid "" -"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" -"exc:`DeprecationWarning`. In a future Python version they will be eventually " -"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:584 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:520 +#: ../../whatsnew/3.12.rst:588 msgid "" -"Variables used in the target part of comprehensions that are not stored to " -"can now be used in assignment expressions (``:=``). For example, in ``[(b := " -"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " -"Note that assigning to variables stored to in the target part of " -"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " -"(Contributed by Nikita Sobolev in :gh:`100581`.)" +":class:`memoryview` now supports the half-float type (the \"e\" format " +"code). (Contributed by Donghee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:527 +#: ../../whatsnew/3.12.rst:591 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:530 +#: ../../whatsnew/3.12.rst:594 msgid "" -":func:`sum` now uses Neumaier summation to improve accuracy when summing " -"floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" -"`100425`.)" +":func:`sum` now uses Neumaier summation to improve accuracy and " +"commutativity when summing floats or mixed ints and floats. (Contributed by " +"Raymond Hettinger in :gh:`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:598 msgid "" -"Exceptions raised in a typeobject's ``__set_name__`` method are no longer " -"wrapped by a :exc:`RuntimeError`. Context information is added to the " -"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" +":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " +"when parsing source code containing null bytes. (Contributed by Pablo " +"Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:602 msgid "" -"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in an :" -"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " -"Katriel in :gh:`103590`.)" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile extraction filters ` " +"for details. In Python 3.14, the default will switch to ``'data'``. " +"(Contributed by Petr Viktorin in :pep:`706`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:610 +msgid "" +":class:`types.MappingProxyType` instances are now hashable if the underlying " +"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:614 +msgid "" +"Add :ref:`support for the perf profiler ` through the new " +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" +"option:`-X perf <-X>`, as well as the new :func:`sys." +"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" +"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " +"Contributed by Pablo Galindo and Christian Heimes with contributions from " +"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:626 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:547 +#: ../../whatsnew/3.12.rst:628 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:551 +#: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:554 +#: ../../whatsnew/3.12.rst:635 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:556 +#: ../../whatsnew/3.12.rst:637 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:560 +#: ../../whatsnew/3.12.rst:641 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:562 +#: ../../whatsnew/3.12.rst:643 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -642,140 +785,134 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:567 +#: ../../whatsnew/3.12.rst:648 msgid "" -"Added :func:`asyncio.eager_task_factory` and :func:`asyncio." +"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " "eager task execution, making some use-cases 2x to 5x faster. (Contributed by " -"Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:572 +#: ../../whatsnew/3.12.rst:653 msgid "" -"On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " +"On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" -"`~asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:" -"`98024`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:577 -msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. It is recommended to not manually configure a child watcher as " -"the event loop now uses the best available child watcher for each platform (:" -"class:`~asyncio.PidfdChildWatcher` if supported and :class:`~asyncio." -"ThreadedChildWatcher` otherwise). (Contributed by Kumar Aditya in :gh:" -"`94597`.)" +"`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:658 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform (:" +"class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." +"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " +"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:664 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:596 +#: ../../whatsnew/3.12.rst:668 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " -"(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" +"(Contributed by Itamar Oren and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:671 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:603 +#: ../../whatsnew/3.12.rst:675 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:608 +#: ../../whatsnew/3.12.rst:680 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:682 msgid "" -"Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " -"Prince Roshan in :gh:`103636`.)" +"Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " +"the year and days of the week. (Contributed by Prince Roshan in :gh:" +"`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:614 +#: ../../whatsnew/3.12.rst:687 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:689 msgid "" -"Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings by :class:`~csv." +"Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " +"provide finer grained control of ``None`` and empty strings by :class:`csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:621 +#: ../../whatsnew/3.12.rst:694 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:623 +#: ../../whatsnew/3.12.rst:696 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" "`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " -"pseudo instructions. Use the new :data:`~dis.hasarg` collection instead. " +"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:704 +msgid "" +"Add the :data:`dis.hasexc` collection to signify instructions that set an " +"exception handler. (Contributed by Irit Katriel in :gh:`94216`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:708 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:710 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:638 +#: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" msgstr "" -#: ../../whatsnew/3.12.rst:640 +#: ../../whatsnew/3.12.rst:716 msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:720 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:646 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:650 +#: ../../whatsnew/3.12.rst:726 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " -"by Thomas Krennwallner in :issue:`35759`.)" +"by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:654 +#: ../../whatsnew/3.12.rst:730 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -783,60 +920,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:660 +#: ../../whatsnew/3.12.rst:736 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:662 +#: ../../whatsnew/3.12.rst:738 msgid "" -"Added :class:`itertools.batched()` for collecting into even-sized tuples " -"where the last batch may be shorter than the rest. (Contributed by Raymond " +"Add :class:`itertools.batched()` for collecting into even-sized tuples where " +"the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:667 +#: ../../whatsnew/3.12.rst:743 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:669 +#: ../../whatsnew/3.12.rst:745 msgid "" -"Added :func:`math.sumprod` for computing a sum of products. (Contributed by " +"Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:672 +#: ../../whatsnew/3.12.rst:748 msgid "" -"Extended :func:`math.nextafter` to include a *steps* argument for moving up " -"or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " +"Extend :func:`math.nextafter` to include a *steps* argument for moving up or " +"down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:677 +#: ../../whatsnew/3.12.rst:753 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:755 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:759 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:687 +#: ../../whatsnew/3.12.rst:763 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:691 +#: ../../whatsnew/3.12.rst:767 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -849,56 +986,56 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:778 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:780 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:711 +#: ../../whatsnew/3.12.rst:787 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:713 +#: ../../whatsnew/3.12.rst:789 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." +"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " -"override the :meth:`~pathlib.PurePath.with_segments` method to pass " +"override the :meth:`pathlib.PurePath.with_segments` method to pass " "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:718 +#: ../../whatsnew/3.12.rst:794 msgid "" -"Add :meth:`~pathlib.Path.walk` for walking the directory trees and " -"generating all file or directory names within them, similar to :func:`os." -"walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" +"Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " +"all file or directory names within them, similar to :func:`os.walk`. " +"(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:798 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " "consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" -"issue:`40358`.)" +"gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:727 +#: ../../whatsnew/3.12.rst:803 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -906,38 +1043,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:735 +#: ../../whatsnew/3.12.rst:811 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:737 +#: ../../whatsnew/3.12.rst:813 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:819 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:821 msgid "" -"Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" -"gh:`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" +"`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:824 msgid "" -"Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " +"Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:752 +#: ../../whatsnew/3.12.rst:828 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:830 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -945,7 +1082,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:760 +#: ../../whatsnew/3.12.rst:836 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -953,14 +1090,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:842 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:771 +#: ../../whatsnew/3.12.rst:847 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -968,61 +1105,68 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:776 +#: ../../whatsnew/3.12.rst:852 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:782 ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:860 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:863 msgid "" -"Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." -"Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " +"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." +"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " "control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:870 msgid "" -"Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." +"Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:799 +#: ../../whatsnew/3.12.rst:875 msgid "" -"Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." -"setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " -"a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." +"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " +"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:881 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:807 +#: ../../whatsnew/3.12.rst:883 msgid "" -"Extended :func:`statistics.correlation` to include as a ``ranked`` method " -"for computing the Spearman correlation of ranked data. (Contributed by " -"Raymond Hettinger in :gh:`95861`.)" +"Extend :func:`statistics.correlation` to include as a ``ranked`` method for " +"computing the Spearman correlation of ranked data. (Contributed by Raymond " +"Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:812 +#: ../../whatsnew/3.12.rst:888 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:814 +#: ../../whatsnew/3.12.rst:890 +msgid "" +"Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " +"` monitoring API. (Contributed by Mark Shannon in :gh:" +"`103082`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:894 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1032,7 +1176,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:903 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1041,14 +1185,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 +#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:833 +#: ../../whatsnew/3.12.rst:913 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1056,27 +1200,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:839 +#: ../../whatsnew/3.12.rst:919 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:841 +#: ../../whatsnew/3.12.rst:921 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:843 +#: ../../whatsnew/3.12.rst:923 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:849 +#: ../../whatsnew/3.12.rst:929 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:851 +#: ../../whatsnew/3.12.rst:931 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1084,11 +1228,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:937 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:859 +#: ../../whatsnew/3.12.rst:939 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1098,34 +1242,34 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:948 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:950 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " -"( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" "ref:`whatsnew312-porting-to-python312` for more information on the changes " "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:956 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:958 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:963 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:885 +#: ../../whatsnew/3.12.rst:965 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1138,7 +1282,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:896 +#: ../../whatsnew/3.12.rst:976 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1146,13 +1290,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:918 +#: ../../whatsnew/3.12.rst:998 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:1001 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1163,71 +1307,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:1009 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:1017 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:1019 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 +#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:1025 msgid "" -"Added ``--durations`` command line option, showing the N slowest test cases::" +"Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:961 -msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1041 +msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" +msgstr "" -#: ../../whatsnew/3.12.rst:964 +#: ../../whatsnew/3.12.rst:1044 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:1046 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:971 +#: ../../whatsnew/3.12.rst:1051 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:973 +#: ../../whatsnew/3.12.rst:1053 msgid "" -"Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " -"reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " -"(Contributed by Inada Naoki in :gh:`92536`.)" +"Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " +"object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " +"Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:977 +#: ../../whatsnew/3.12.rst:1057 msgid "" -"Added experimental support for using the BOLT binary optimizer in the build " +"Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " -"Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" +"Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:981 +#: ../../whatsnew/3.12.rst:1061 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1235,13 +1379,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:986 +#: ../../whatsnew/3.12.rst:1066 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " -"formatting. (Contributed by Itamar O in :gh:`103793`.)" +"formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:989 +#: ../../whatsnew/3.12.rst:1069 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1249,134 +1393,345 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:994 +#: ../../whatsnew/3.12.rst:1074 +msgid "" +"Speed up :func:`super` method calls and attribute loads via the new :opcode:" +"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " +"Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1080 +msgid "CPython bytecode changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:1082 +msgid "" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" +"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" +"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " +"by Ken Jin in :gh:`93429`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1087 +msgid "" +"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" +"`102859`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1090 +msgid "" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1093 +msgid "" +"Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " +"(Contributed by Mark Shannon in :gh:`94163`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1096 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " +"Shannon in :gh:`99005`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1099 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " +"in :gh:`101799`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1102 +msgid "" +"Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " +"in :gh:`90997`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1105 +msgid "" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" +"`103082`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1108 +msgid "" +"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " +"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1111 +msgid "" +"Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " +"Sweeney in :gh:`93143`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1114 +msgid "" +"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" +"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " +"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " +"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" +"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1120 +msgid "" +"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " +"and Vladimir Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1123 +msgid "" +"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" +"gh:`101632`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1126 +msgid "Demos and Tools" +msgstr "" + +#: ../../whatsnew/3.12.rst:1128 +msgid "" +"Remove the ``Tools/demo/`` directory which contained old demo scripts. A " +"copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1133 +msgid "" +"Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " +"can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1140 ../../whatsnew/3.12.rst:2219 +msgid "Deprecated" +msgstr "已棄用" + +#: ../../whatsnew/3.12.rst:1142 +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1147 +msgid "" +":mod:`ast`: The following :mod:`ast` features have been deprecated in " +"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " +"emitted at runtime when they are accessed or used, and will be removed in " +"Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + +#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../whatsnew/3.12.rst:1157 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +msgid ":mod:`asyncio`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1162 msgid "" -"Speed up :func:`super` method calls and attribute loads via the new :opcode:" -"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " -"Matveev in :gh:`103497`.)" +"The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" +"`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" +"`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1000 -msgid "CPython bytecode changes" +#: ../../whatsnew/3.12.rst:1168 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1174 msgid "" -"Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" -"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" -"`LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " -"by Ken Jin in :gh:`93429`.)" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1007 +#: ../../whatsnew/3.12.rst:1179 msgid "" -"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" -"`102859`.)" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1183 msgid "" -"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" -"gh:`92925`.)" +":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1188 msgid "" -"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " -"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." +"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " +"will be removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." +"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " +"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1196 msgid "" -"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" -"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " -"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " -"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" -"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1022 +#: ../../whatsnew/3.12.rst:1199 msgid "" -"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " -"and Vladimir Matveev in :gh:`103497`.)" +":mod:`importlib.abc`: Deprecated the following classes, scheduled for " +"removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1026 -msgid "Demos and Tools" +#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr ":class:`!importlib.abc.ResourceReader`" + +#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +msgid ":class:`!importlib.abc.Traversable`" +msgstr ":class:`!importlib.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr ":class:`!importlib.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1206 +msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1208 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr ":class:`importlib.resources.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1209 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr ":class:`importlib.resources.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1211 +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1213 msgid "" -"Remove the ``Tools/demo/`` directory which contained old demo scripts. A " -"copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" +":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " +"operations, which is undocumented, inefficient, historically buggy, and " +"inconsistent. This will be removed in 3.14 for a significant reduction in " +"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" +"`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1033 +#: ../../whatsnew/3.12.rst:1219 msgid "" -"Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " -"can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" +":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " +"start method will change to a safer one on Linux, BSDs, and other non-macOS " +"POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " +"Adding a runtime warning about this was deemed too disruptive as the " +"majority of code is not expected to care. Use the :func:`~multiprocessing." +"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " +"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " +"methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 -msgid "Deprecated" -msgstr "已棄用" +#: ../../whatsnew/3.12.rst:1229 +msgid "" +":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " +"are deprecated and will be removed in Python 3.14; use :func:`importlib.util." +"find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1042 +#: ../../whatsnew/3.12.rst:1234 msgid "" -":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " -"event loop policy now emits a :exc:`DeprecationWarning` if there is no " -"current event loop set and it decides to create one. (Contributed by Serhiy " -"Storchaka and Guido van Rossum in :gh:`100160`.)" +":mod:`pty`: The module has two undocumented ``master_open()`` and " +"``slave_open()`` functions that have been deprecated since Python 2 but only " +"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. " +"(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1047 +#: ../../whatsnew/3.12.rst:1239 +msgid ":mod:`os`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1241 msgid "" -":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " +"Windows are deprecated. In a future release, they will contain the last " +"metadata change time, consistent with other platforms. For now, they still " +"contain the creation time, which is also available in the new " +"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1247 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." -"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " -"will be removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." -"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " -"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +"On POSIX platforms, :func:`os.fork` can now raise a :exc:" +"`DeprecationWarning` when it can detect being called from a multithreaded " +"process. There has always been a fundamental incompatibility with the POSIX " +"platform when doing so. Even if such code *appeared* to work. We added the " +"warning to to raise awareness as issues encounted by code doing this are " +"becoming more frequent. See the :func:`os.fork` documentation for more " +"details along with `this discussion on fork being incompatible with threads " +"`_ for *why* we're now surfacing this " +"longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1257 msgid "" -":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." -"lstat` on Windows are deprecated. In a future release, they will contain the " -"last metadata change time, consistent with other platforms. For now, they " -"still contain the creation time, which is also available in the new " -"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" +"When this warning appears due to usage of :mod:`multiprocessing` or :mod:" +"`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " +"start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1065 +#: ../../whatsnew/3.12.rst:1261 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " -"Katriel in :gh:`102828`.)" +"and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " +"Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1264 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1266 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1075 +#: ../../whatsnew/3.12.rst:1272 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1386,402 +1741,355 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1279 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1283 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1287 +msgid ":mod:`typing`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1289 msgid "" -":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " -"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" -"gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" +"`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1292 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" +"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " +"Waygood in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1296 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " "Before, the Python implementation emitted :exc:`FutureWarning`, and the C " -"implementation emitted nothing." +"implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1302 msgid "" -"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" -"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " -"removed in a future version of Python. Use the single-arg versions of these " -"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " +"`, :meth:`generator throw() ` and :meth:" +"`async generator throw() ` are deprecated and may be removed in " +"a future version of Python. Use the single-arg versions of these functions " +"instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1308 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1313 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +"Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " +"will cease to be set or taken into consideration by the import system in " +"Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1317 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " "In the rare case that you really need the bitwise inversion of the " -"underlying ``int``, convert to int explicitly with ``~int(x)``. (Contributed " -"by Tim Hoffmann in :gh:`103487`.)" +"underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by " +"Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1323 +msgid "" +"Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" +"pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " +"therefore it will be removed in 3.14. (Contributed by Nikita Sobolev in :gh:" +"`101866`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1329 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1331 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1334 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1336 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1337 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1338 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1134 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1137 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1139 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1356 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1358 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1360 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1362 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1363 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1364 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1156 +#: ../../whatsnew/3.12.rst:1365 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1366 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1367 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1159 +#: ../../whatsnew/3.12.rst:1368 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1369 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1370 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1375 msgid "" -":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" -"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " -"(Contributed by Nikita Sobolev in :gh:`92248`.)" +"The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1378 msgid "" -":mod:`ast`: The following :mod:`ast` features have been deprecated in " -"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " -"emitted at runtime when they are accessed or used, and will be removed in " -"Python 3.14:" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1175 -msgid ":class:`!ast.Num`" -msgstr ":class:`!ast.Num`" - -#: ../../whatsnew/3.12.rst:1176 -msgid ":class:`!ast.Str`" -msgstr ":class:`!ast.Str`" +#: ../../whatsnew/3.12.rst:1381 +msgid ":mod:`ast`:" +msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1177 -msgid ":class:`!ast.Bytes`" -msgstr ":class:`!ast.Bytes`" +#: ../../whatsnew/3.12.rst:1391 +msgid ":class:`!asyncio.MultiLoopChildWatcher`" +msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1178 -msgid ":class:`!ast.NameConstant`" -msgstr ":class:`!ast.NameConstant`" +#: ../../whatsnew/3.12.rst:1392 +msgid ":class:`!asyncio.FastChildWatcher`" +msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1179 -msgid ":class:`!ast.Ellipsis`" -msgstr ":class:`!ast.Ellipsis`" +#: ../../whatsnew/3.12.rst:1393 +msgid ":class:`!asyncio.AbstractChildWatcher`" +msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1181 -msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1394 +msgid ":class:`!asyncio.SafeChildWatcher`" +msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1184 -msgid "" -":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " -"and :meth:`asyncio.Task.cancel` (:gh:`90985`)" -msgstr "" +#: ../../whatsnew/3.12.rst:1395 +msgid ":func:`!asyncio.set_child_watcher`" +msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1188 -msgid "" -":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " -"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1396 +msgid ":func:`!asyncio.get_child_watcher`," +msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1193 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1397 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1196 -msgid "" -":mod:`importlib.abc`: Deprecated the following classes, scheduled for " -"removal in Python 3.14:" -msgstr "" +#: ../../whatsnew/3.12.rst:1398 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1199 -msgid ":class:`!importlib.abc.ResourceReader`" -msgstr ":class:`!importlib.abc.ResourceReader`" +#: ../../whatsnew/3.12.rst:1400 +msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." +msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1200 -msgid ":class:`!importlib.abc.Traversable`" -msgstr ":class:`!importlib.abc.Traversable`" +#: ../../whatsnew/3.12.rst:1402 +msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." +msgstr "" -#: ../../whatsnew/3.12.rst:1201 -msgid ":class:`!importlib.abc.TraversableResources`" -msgstr ":class:`!importlib.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1404 +msgid ":mod:`importlib.abc`:" +msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1203 -msgid "Use :mod:`importlib.resources.abc` classes instead:" +#: ../../whatsnew/3.12.rst:1410 +msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1205 -msgid ":class:`importlib.resources.abc.Traversable`" -msgstr ":class:`importlib.resources.abc.Traversable`" - -#: ../../whatsnew/3.12.rst:1206 -msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr ":class:`importlib.resources.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1412 +msgid ":mod:`pkgutil`:" +msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1208 -msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1414 +msgid ":func:`!pkgutil.find_loader`" +msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1210 -msgid "" -":mod:`itertools`: The module had undocumented, inefficient, historically " -"buggy, and inconsistent support for copy, deepcopy, and pickle operations. " -"This will be removed in 3.14 for a significant reduction in code volume and " -"maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1415 +msgid ":func:`!pkgutil.get_loader`." +msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1216 -msgid "" -":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " -"change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " -"where ``'fork'`` is currently the default (:gh:`84559`). Adding a runtime " -"warning about this was deemed too disruptive as the majority of code is not " -"expected to care. Use the :func:`~multiprocessing.get_context` or :func:" -"`~multiprocessing.set_start_method` APIs to explicitly specify when your " -"code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." -msgstr "" +#: ../../whatsnew/3.12.rst:1417 +msgid ":mod:`pty`:" +msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1224 -msgid "" -":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " -"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " -"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1419 +msgid ":func:`!pty.master_open`" +msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1229 -msgid "" -":mod:`pty`: The module has two undocumented ``master_open()`` and " -"``slave_open()`` functions that have been deprecated since Python 2 but only " -"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." -msgstr "" +#: ../../whatsnew/3.12.rst:1420 +msgid ":func:`!pty.slave_open`" +msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1233 -msgid "" -":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"in 3.12, and will be removed in 3.14." +#: ../../whatsnew/3.12.rst:1422 +msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1236 -msgid "" -":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" +#: ../../whatsnew/3.12.rst:1424 +msgid ":mod:`typing`: :class:`!typing.ByteString`" +msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1426 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." -"etree.ElementTree.Element` is deprecated and will raise an exception in " -"Python 3.14." -msgstr "" - -#: ../../whatsnew/3.12.rst:1242 -msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API (:gh:`95388`)." -msgstr "" - -#: ../../whatsnew/3.12.rst:1245 -msgid "" -"``__package__`` and ``__cached__`` will cease to be set or taken into " -"consideration by the import system (:gh:`97879`)." +"etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1248 -msgid "" -"Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " -"planned to be removed in 3.12 but it only got a proper :exc:" -"`DeprecationWarning` in 3.12. May be removed in 3.14. (Contributed by Nikita " -"Sobolev in :gh:`101866`.)" +#: ../../whatsnew/3.12.rst:1428 +msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1254 -msgid "" -"Creating :c:data:`immutable types ` with mutable " -"bases using the C API (:gh:`95388`)" +#: ../../whatsnew/3.12.rst:1430 +msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1435 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1263 +#: ../../whatsnew/3.12.rst:1438 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1440 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1442 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1793,54 +2101,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1456 msgid "asynchat and asyncore" -msgstr "" +msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1458 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1465 msgid "configparser" -msgstr "" +msgstr "configparser" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1467 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1295 +#: ../../whatsnew/3.12.rst:1470 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1472 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1474 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1478 msgid "distutils" -msgstr "" +msgstr "distutils" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1480 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1849,17 +2157,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1487 msgid "ensurepip" -msgstr "" +msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1489 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1492 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1867,7 +2175,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1498 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1877,35 +2185,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1330 +#: ../../whatsnew/3.12.rst:1505 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1508 msgid "enum" -msgstr "" +msgstr "enum" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1510 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1515 msgid "ftplib" -msgstr "" +msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1517 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1522 msgid "gzip" -msgstr "" +msgstr "gzip" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1914,11 +2222,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1531 msgid "hashlib" -msgstr "" +msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1533 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1927,183 +2235,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1542 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1545 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1548 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1377 +#: ../../whatsnew/3.12.rst:1552 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1555 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1561 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1389 -msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" +#: ../../whatsnew/3.12.rst:1564 +msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1579 +msgid "``imp.load_source()``" +msgstr "``imp.load_source()``" + +#: ../../whatsnew/3.12.rst:1579 +msgid "*See below*" +msgstr "" + +#: ../../whatsnew/3.12.rst:1582 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1421 -msgid "Removed :mod:`!imp` functions and attributes with no replacements:" +#: ../../whatsnew/3.12.rst:1597 +msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1423 -msgid "undocumented functions:" +#: ../../whatsnew/3.12.rst:1599 +msgid "Undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1601 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1602 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1603 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1604 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1606 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1608 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1613 msgid "io" -msgstr "" +msgstr "io" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2112,18 +2428,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1622 msgid "locale" -msgstr "" +msgstr "locale" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1624 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1628 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2131,27 +2447,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1639 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1642 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1643 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1645 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1648 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2159,22 +2475,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1653 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1656 msgid "ssl" -msgstr "" +msgstr "ssl" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1658 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1662 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2182,7 +2498,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1668 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2193,189 +2509,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1504 -msgid "Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1680 +msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1684 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Method Name" -msgstr "" +msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1511 +#: ../../whatsnew/3.12.rst:1689 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1695 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1691 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1692 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1693 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1694 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1696 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 -#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 -#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1702 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1697 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1698 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1699 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1700 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1706 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1709 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1716 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1541 -msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1719 +msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" +msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1544 +#: ../../whatsnew/3.12.rst:1722 msgid "webbrowser" -msgstr "" +msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1724 msgid "" -"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1729 msgid "xml.etree.ElementTree" -msgstr "" +msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1553 +#: ../../whatsnew/3.12.rst:1731 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2384,29 +2700,30 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1738 msgid "zipimport" -msgstr "" +msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1740 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1568 +#: ../../whatsnew/3.12.rst:1746 msgid "Others" -msgstr "" +msgstr "其他" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1748 msgid "" -"Removed the ``suspicious`` rule from the documentation Makefile, and removed " -"``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" +"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" +"`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1753 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2416,21 +2733,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1764 ../../whatsnew/3.12.rst:2079 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1766 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1770 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1772 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2439,9 +2756,9 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1779 msgid "" -"Removed ``randrange()`` functionality deprecated since Python 3.10. " +"Remove ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " "Now, it raises a :exc:`TypeError`. Also, the exception raised for non-" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " @@ -2451,7 +2768,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1787 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2461,21 +2778,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1793 msgid "" -"Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " +"Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1797 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1802 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2483,7 +2800,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1807 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2492,10 +2809,10 @@ msgid "" "only a very small set of users might be affected. This change helps with " "interpreter isolation. Furthermore, :mod:`syslog` is a wrapper around " "process-global resources, which are best managed from the main interpreter. " -"(Contributed by Dong-hee Na in :gh:`99127`.)" +"(Contributed by Donghee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1816 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2507,14 +2824,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1829 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1834 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2526,231 +2843,231 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1845 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1857 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1860 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1863 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1866 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1869 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1873 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1875 msgid "" -"Python no longer uses ``setup.py`` to build shared C extension modules. " +"Python no longer uses :file:`setup.py` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " -"script. Extensions are built by ``Makefile``. Most extensions use ``pkg-" +"script. Extensions are built by :file:`Makefile`. Most extensions use ``pkg-" "config`` and fall back to manual detection. (Contributed by Christian Heimes " "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1881 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1886 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " -"policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " +"policy if the Clang compiler accepts the flag. (Contributed by Donghee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1890 msgid "" -"Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " -"options (default: ``-j0``) in ``make install``. Also merged the 3 " -"``compileall`` commands into a single command to build .pyc files for all " +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" +"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " +"3 ``compileall`` commands into a single command to build .pyc files for all " "optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1896 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1898 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1899 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1900 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1902 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1904 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1910 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1914 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1921 msgid "" -":pep:`697`: Introduced the :ref:`Unstable C API tier `, " +":pep:`697`: Introduce the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " "change in each minor release of CPython without deprecation warnings. Its " "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1927 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1750 +#: ../../whatsnew/3.12.rst:1929 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1930 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1753 +#: ../../whatsnew/3.12.rst:1932 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1934 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1935 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1936 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1759 +#: ../../whatsnew/3.12.rst:1938 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1762 +#: ../../whatsnew/3.12.rst:1941 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1943 msgid "" -":pep:`697`: Added API for extending types whose instance memory layout is " +":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1767 +#: ../../whatsnew/3.12.rst:1946 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1769 +#: ../../whatsnew/3.12.rst:1948 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1950 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1774 +#: ../../whatsnew/3.12.rst:1953 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1956 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1779 +#: ../../whatsnew/3.12.rst:1958 msgid "" -"Added the new :ref:`limited C API ` function :c:func:" +"Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" "`PyType_FromModuleAndSpec` using an additional metaclass argument. " "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1963 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1967 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1968 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1969 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1793 +#: ../../whatsnew/3.12.rst:1972 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2761,7 +3078,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1801 +#: ../../whatsnew/3.12.rst:1980 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2769,47 +3086,47 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1985 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1989 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1990 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1812 +#: ../../whatsnew/3.12.rst:1991 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr "" +msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1993 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1818 +#: ../../whatsnew/3.12.rst:1997 msgid "" -"Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " "functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:2003 msgid "" -"Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " -"sets the vectorcall field of a given :c:type:`PyFunctionObject`. " -"(Contributed by Andrew Frost in :gh:`92257`.)" +"Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " +"the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " +"Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1828 +#: ../../whatsnew/3.12.rst:2007 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2818,28 +3135,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1834 +#: ../../whatsnew/3.12.rst:2013 msgid "" -"Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " +"Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:2017 msgid "" -"Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " +"Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " -"code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" +"code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:2026 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2849,14 +3166,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:2034 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:2038 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2864,99 +3181,99 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:2043 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1868 +#: ../../whatsnew/3.12.rst:2049 msgid "" -":pep:`683`: Introduced Immortal Objects to Python which allows objects to " -"bypass reference counts and introduced changes to the C-API:" +":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " +"reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:2052 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:2053 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:2054 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:2055 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:2056 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:2057 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:2058 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:2059 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:2060 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:2063 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:2062 msgid "" -"objects that have been interned. This is now needed for refleak.py to " -"correctly track reference counts and allocated blocks" +"objects that have been interned. This is now needed for :file:`refleak.py` " +"to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:2065 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:2067 msgid "" -":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " -"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" -"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " -"info.) (Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" +"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " +"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " +"(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:2073 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:2081 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:2084 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:2088 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2965,7 +3282,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1914 +#: ../../whatsnew/3.12.rst:2095 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2973,13 +3290,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:2100 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:2104 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2988,7 +3305,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:2110 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2997,13 +3314,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:2116 msgid "" -"Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" +"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1939 +#: ../../whatsnew/3.12.rst:2120 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3017,7 +3334,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:2132 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3025,7 +3342,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:2137 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3033,7 +3350,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2142 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3041,7 +3358,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2147 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3049,25 +3366,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:2152 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:2155 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:2156 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2157 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:2159 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3075,14 +3392,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:2164 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2168 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3091,17 +3408,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2175 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2177 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2179 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3109,20 +3426,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2184 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2188 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2010 +#: ../../whatsnew/3.12.rst:2191 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3130,14 +3447,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2196 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2019 +#: ../../whatsnew/3.12.rst:2200 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3148,15 +3465,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2208 msgid ":c:func:`PyUnstable_Long_IsCompact`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2209 msgid ":c:func:`PyUnstable_Long_CompactValue`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2211 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3165,291 +3482,472 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2221 +msgid "" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:2226 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2251 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2255 msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases is deprecated and will be disabled in Python 3.14." +"Creating :c:data:`immutable types ` with mutable " +"bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2258 msgid "" -"The ``structmember.h`` header is deprecated, though it continues to be " +"The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:2075 +#: ../../whatsnew/3.12.rst:2261 msgid "" -"Its contents are now available just by including ``Python.h``, with a ``Py`` " -"prefix added if it was missing:" +"Its contents are now available just by including :file:`Python.h`, with a " +"``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2264 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" +"`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2080 +#: ../../whatsnew/3.12.rst:2266 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2082 +#: ../../whatsnew/3.12.rst:2268 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:2085 -msgid "Several items are not exposed from ``Python.h``:" +#: ../../whatsnew/3.12.rst:2271 +msgid "Several items are not exposed from :file:`Python.h`:" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2273 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2274 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2089 +#: ../../whatsnew/3.12.rst:2275 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2090 +#: ../../whatsnew/3.12.rst:2276 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2278 msgid "" -"In some configurations, ```` is not included from ``Python.h``. It " -"should be included manually when using ``offsetof()``." +"In some configurations, ```` is not included from :file:`Python." +"h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2281 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2286 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2103 +#: ../../whatsnew/3.12.rst:2289 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2108 +#: ../../whatsnew/3.12.rst:2294 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2111 +#: ../../whatsnew/3.12.rst:2297 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2114 +#: ../../whatsnew/3.12.rst:2300 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2122 +#: ../../whatsnew/3.12.rst:2308 +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2311 +msgid "Global configuration variables:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2336 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:2339 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2343 +msgid "Pending Removal in Python 3.15" +msgstr "" + +#: ../../whatsnew/3.12.rst:2345 +msgid "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2346 +msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2347 +msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2348 +msgid "Python initialization functions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2350 +msgid "" +":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2352 +msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2353 +msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2354 +msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2355 +msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2356 +msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2357 +msgid "" +":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable" +msgstr "" + +#: ../../whatsnew/3.12.rst:2363 +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" + +#: ../../whatsnew/3.12.rst:2366 +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" +msgstr "" + +#: ../../whatsnew/3.12.rst:2367 +msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2368 +msgid "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2369 +msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2370 +msgid "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2371 +msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2372 +msgid "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2373 +msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2374 +msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2375 +msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2376 +msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2377 +msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +msgstr "" + +#: ../../whatsnew/3.12.rst:2378 +msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2379 +msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" +msgstr "" + +#: ../../whatsnew/3.12.rst:2380 +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead" +msgstr "" + +#: ../../whatsnew/3.12.rst:2382 +msgid ":c:member:`!PyDictObject.ma_version_tag` member" +msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" + +#: ../../whatsnew/3.12.rst:2383 +msgid "Thread Local Storage (TLS) API:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2385 +msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2386 +msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2387 +msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2388 +msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2389 +msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2390 +msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" +msgstr "" + +#: ../../whatsnew/3.12.rst:2395 msgid "" -"Remove the ``token.h`` header file. There was never any public tokenizer C " -"API. The ``token.h`` header file was only designed to be used by Python " -"internals. (Contributed by Victor Stinner in :gh:`92651`.)" +"Remove the :file:`token.h` header file. There was never any public tokenizer " +"C API. The :file:`token.h` header file was only designed to be used by " +"Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2127 +#: ../../whatsnew/3.12.rst:2400 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2131 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2405 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2133 +#: ../../whatsnew/3.12.rst:2406 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2407 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2408 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2409 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2410 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2412 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2415 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2418 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" - -#~ msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -#~ msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" - -#~ msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#~ msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" - -#~ msgid "email" -#~ msgstr "email" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 7ba13abbd8..0914591a50 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2773,6 +2773,8 @@ msgid "" "(https://en.wikipedia.org/wiki/Socketcan), on Linux (https://lwn.net/" "Articles/253425)." msgstr "" +":class:`~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) " +"上的 PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" #: ../../whatsnew/3.3.rst:1892 msgid "" @@ -3072,12 +3074,12 @@ msgstr "其他新功能:" #: ../../whatsnew/3.3.rst:2069 msgid "" ":func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time." -"clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " +"clock_settime` functions with :samp:`CLOCK_{xxx}` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" ":func:`~time.clock_getres`、:func:`~time.clock_gettime` 和 :func:`~time." -"clock_settime` 函式帶有 ``CLOCK_xxx`` 常數。 (由 Victor Stinner 在 :issue:" -"`10278` 中貢獻。)" +"clock_settime` 函式帶有 :samp:`CLOCK_{xxx}` 常數。 (由 Victor Stinner 在 :" +"issue:`10278` 中貢獻。)" #: ../../whatsnew/3.3.rst:2073 msgid "" @@ -3943,10 +3945,3 @@ msgstr "yield" #: ../../whatsnew/3.3.rst:396 msgid "yield from (in What's New)" msgstr "yield from(在有什麼新功能中)" - -#~ msgid "" -#~ "The :class:`~socket.socket` class now supports the PF_CAN protocol family " -#~ "(https://en.wikipedia.org/wiki/Socketcan), on Linux ." -#~ msgstr "" -#~ "~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) 上的 " -#~ "PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a0e58c3027..2c35922a63 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -495,7 +495,8 @@ msgid "" "(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" "`17828` and :issue:`19619`.)" msgstr "" -"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:`19619` 中貢獻。)" +"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:" +"`19619` 中貢獻。)" #: ../../whatsnew/3.4.rst:381 msgid "PEP 451: A ModuleSpec Type for the Import System" @@ -1018,8 +1019,8 @@ msgid "" "(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" "`11816` and Claudiu Popa in :issue:`17916`.)" msgstr "" -"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 Claudiu " -"Popa 在 :issue:`17916` 中貢獻。)" +"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 " +"Claudiu Popa 在 :issue:`17916` 中貢獻。)" #: ../../whatsnew/3.4.rst:770 msgid "" @@ -2852,18 +2853,18 @@ msgid "" "find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " "by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." "PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" -"`importlib.abc.PathEntryFinder.find_spec`; all of the ``xxxLoader`` ABC " -"``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :meth:`!" -"importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc.FileLoader." -"load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) should no " -"longer be implemented, instead loaders should implement an ``exec_module`` " -"method (:meth:`importlib.abc.Loader.exec_module`, :meth:`importlib.abc." -"InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader.exec_module`) " -"and let the import system take care of the rest; and :meth:`!importlib.abc." -"Loader.module_repr`, :meth:`!importlib.util.module_for_loader`, :meth:`!" -"importlib.util.set_loader`, and :meth:`!importlib.util.set_package` are no " -"longer needed because their functions are now handled automatically by the " -"import system." +"`importlib.abc.PathEntryFinder.find_spec`; all of the :samp:`{xxx}Loader` " +"ABC ``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :" +"meth:`!importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc." +"FileLoader.load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) " +"should no longer be implemented, instead loaders should implement an " +"``exec_module`` method (:meth:`importlib.abc.Loader.exec_module`, :meth:" +"`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader." +"exec_module`) and let the import system take care of the rest; and :meth:`!" +"importlib.abc.Loader.module_repr`, :meth:`!importlib.util." +"module_for_loader`, :meth:`!importlib.util.set_loader`, and :meth:`!" +"importlib.util.set_package` are no longer needed because their functions are " +"now handled automatically by the import system." msgstr "" #: ../../whatsnew/3.4.rst:2104 diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 1c567304b2..29981b965a 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -2251,8 +2251,8 @@ msgid "" "(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:" "`32043`, and :issue:`32230`.)" msgstr "" -"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:" -"`32043` 和 :issue:`32230` 中貢獻。)" +"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:`32043` 和 :" +"issue:`32230` 中貢獻。)" #: ../../whatsnew/3.7.rst:1597 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 876384f4a2..40a1f64f79 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 00:03+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-" @@ -106,8 +106,8 @@ msgid "" "There is a new function parameter syntax ``/`` to indicate that some " "function parameters must be specified positionally and cannot be used as " "keyword arguments. This is the same notation shown by ``help()`` for C " -"functions annotated with Larry Hastings' :ref:`Argument Clinic ` tool." +"functions annotated with Larry Hastings' `Argument Clinic `__ tool." msgstr "" #: ../../whatsnew/3.8.rst:128 @@ -550,7 +550,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:407 msgid "" -"Added support of ``\\N{name}`` escapes in :mod:`regular expressions `::" +"Added support of :samp:`\\\\N\\\\{{name}\\\\}` escapes in :mod:`regular " +"expressions `::" msgstr "" #: ../../whatsnew/3.8.rst:414 @@ -1153,7 +1154,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:950 msgid "" -"(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " +"(Suggested by Raymond Hettinger, implemented by Donghee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" @@ -2191,7 +2192,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1715 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " -"has been deprecated. (Contributed by Dong-hee Na in :issue:`35283`.)" +"has been deprecated. (Contributed by Donghee Na in :issue:`35283`.)" msgstr "" #: ../../whatsnew/3.8.rst:1719 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 05e821457f..08cc7c79e0 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -33,83 +33,80 @@ msgstr "Łukasz Langa" #: ../../whatsnew/3.9.rst:45 msgid "" "This article explains the new features in Python 3.9, compared to 3.8. " -"Python 3.9 was released on October 5, 2020." +"Python 3.9 was released on October 5, 2020. For full details, see the :ref:" +"`changelog `." msgstr "" -#: ../../whatsnew/3.9.rst:48 -msgid "For full details, see the :ref:`changelog `." -msgstr "" - -#: ../../whatsnew/3.9.rst:52 +#: ../../whatsnew/3.9.rst:51 msgid ":pep:`596` - Python 3.9 Release Schedule" msgstr "" -#: ../../whatsnew/3.9.rst:56 +#: ../../whatsnew/3.9.rst:55 msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.9.rst:61 +#: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" msgstr "" -#: ../../whatsnew/3.9.rst:63 +#: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" msgstr "" -#: ../../whatsnew/3.9.rst:64 +#: ../../whatsnew/3.9.rst:63 msgid ":pep:`585`, type hinting generics in standard collections;" msgstr "" -#: ../../whatsnew/3.9.rst:65 +#: ../../whatsnew/3.9.rst:64 msgid ":pep:`614`, relaxed grammar restrictions on decorators." msgstr "" -#: ../../whatsnew/3.9.rst:67 +#: ../../whatsnew/3.9.rst:66 msgid "New built-in features:" msgstr "" -#: ../../whatsnew/3.9.rst:69 +#: ../../whatsnew/3.9.rst:68 msgid ":pep:`616`, string methods to remove prefixes and suffixes." msgstr "" -#: ../../whatsnew/3.9.rst:71 +#: ../../whatsnew/3.9.rst:70 msgid "New features in the standard library:" msgstr "" -#: ../../whatsnew/3.9.rst:73 +#: ../../whatsnew/3.9.rst:72 msgid ":pep:`593`, flexible function and variable annotations;" msgstr "" -#: ../../whatsnew/3.9.rst:74 +#: ../../whatsnew/3.9.rst:73 msgid "" ":func:`os.pidfd_open` added that allows process management without races and " "signals." msgstr "" -#: ../../whatsnew/3.9.rst:77 +#: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.9.rst:79 +#: ../../whatsnew/3.9.rst:78 msgid "" ":pep:`573`, fast access to module state from methods of C extension types;" msgstr "" -#: ../../whatsnew/3.9.rst:81 +#: ../../whatsnew/3.9.rst:80 msgid ":pep:`617`, CPython now uses a new parser based on PEG;" msgstr "" -#: ../../whatsnew/3.9.rst:82 +#: ../../whatsnew/3.9.rst:81 msgid "" "a number of Python builtins (range, tuple, set, frozenset, list, dict) are " "now sped up using :pep:`590` vectorcall;" msgstr "" -#: ../../whatsnew/3.9.rst:84 +#: ../../whatsnew/3.9.rst:83 msgid "garbage collection does not block on resurrected objects;" msgstr "" -#: ../../whatsnew/3.9.rst:85 +#: ../../whatsnew/3.9.rst:84 msgid "" "a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`, :mod:" "`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`, :mod:" @@ -118,7 +115,7 @@ msgid "" "489;" msgstr "" -#: ../../whatsnew/3.9.rst:90 +#: ../../whatsnew/3.9.rst:89 msgid "" "a number of standard library modules (:mod:`audioop`, :mod:`ast`, :mod:" "`grp`, :mod:`_hashlib`, :mod:`pwd`, :mod:`_posixsubprocess`, :mod:`random`, :" @@ -126,35 +123,35 @@ msgid "" "stable ABI defined by PEP 384." msgstr "" -#: ../../whatsnew/3.9.rst:95 +#: ../../whatsnew/3.9.rst:94 msgid "New library modules:" msgstr "" -#: ../../whatsnew/3.9.rst:97 +#: ../../whatsnew/3.9.rst:96 msgid "" ":pep:`615`, the IANA Time Zone Database is now present in the standard " "library in the :mod:`zoneinfo` module;" msgstr "" -#: ../../whatsnew/3.9.rst:99 +#: ../../whatsnew/3.9.rst:98 msgid "" "an implementation of a topological sort of a graph is now provided in the " "new :mod:`graphlib` module." msgstr "" -#: ../../whatsnew/3.9.rst:102 +#: ../../whatsnew/3.9.rst:101 msgid "Release process changes:" msgstr "" -#: ../../whatsnew/3.9.rst:104 +#: ../../whatsnew/3.9.rst:103 msgid ":pep:`602`, CPython adopts an annual release cycle." msgstr "" -#: ../../whatsnew/3.9.rst:108 +#: ../../whatsnew/3.9.rst:107 msgid "You should check for DeprecationWarning in your code" msgstr "" -#: ../../whatsnew/3.9.rst:110 +#: ../../whatsnew/3.9.rst:109 msgid "" "When Python 2.7 was still supported, a lot of functionality in Python 3 was " "kept for backward compatibility with Python 2.7. With the end of Python 2 " @@ -165,7 +162,7 @@ msgid "" "3.3, released in 2012." msgstr "" -#: ../../whatsnew/3.9.rst:118 +#: ../../whatsnew/3.9.rst:117 msgid "" "Test your application with the :option:`-W` ``default`` command-line option " "to see :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, or " @@ -174,14 +171,14 @@ msgid "" "code." msgstr "" -#: ../../whatsnew/3.9.rst:123 +#: ../../whatsnew/3.9.rst:122 msgid "" "Python 3.9 is the last version providing those Python 2 backward " "compatibility layers, to give more time to Python projects maintainers to " "organize the removal of the Python 2 support and add support for Python 3.9." msgstr "" -#: ../../whatsnew/3.9.rst:127 +#: ../../whatsnew/3.9.rst:126 msgid "" "Aliases to :ref:`Abstract Base Classes ` " "in the :mod:`collections` module, like ``collections.Mapping`` alias to :" @@ -189,52 +186,52 @@ msgid "" "compatibility. They will be removed from Python 3.10." msgstr "" -#: ../../whatsnew/3.9.rst:132 +#: ../../whatsnew/3.9.rst:131 msgid "" "More generally, try to run your tests in the :ref:`Python Development Mode " "` which helps to prepare your code to make it compatible with the " "next Python version." msgstr "" -#: ../../whatsnew/3.9.rst:136 +#: ../../whatsnew/3.9.rst:135 msgid "" "Note: a number of pre-existing deprecations were removed in this version of " "Python as well. Consult the :ref:`removed-in-python-39` section." msgstr "" -#: ../../whatsnew/3.9.rst:141 ../../whatsnew/3.9.rst:1274 +#: ../../whatsnew/3.9.rst:140 ../../whatsnew/3.9.rst:1273 msgid "New Features" msgstr "" -#: ../../whatsnew/3.9.rst:144 +#: ../../whatsnew/3.9.rst:143 msgid "Dictionary Merge & Update Operators" msgstr "" -#: ../../whatsnew/3.9.rst:146 +#: ../../whatsnew/3.9.rst:145 msgid "" "Merge (``|``) and update (``|=``) operators have been added to the built-in :" "class:`dict` class. Those complement the existing ``dict.update`` and " "``{**d1, **d2}`` methods of merging dictionaries." msgstr "" -#: ../../whatsnew/3.9.rst:150 ../../whatsnew/3.9.rst:283 +#: ../../whatsnew/3.9.rst:149 ../../whatsnew/3.9.rst:282 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.9.rst:159 +#: ../../whatsnew/3.9.rst:158 msgid "" "See :pep:`584` for a full description. (Contributed by Brandt Bucher in :" "issue:`36144`.)" msgstr "" -#: ../../whatsnew/3.9.rst:163 +#: ../../whatsnew/3.9.rst:162 msgid "New String Methods to Remove Prefixes and Suffixes" msgstr "" -#: ../../whatsnew/3.9.rst:165 +#: ../../whatsnew/3.9.rst:164 msgid "" ":meth:`str.removeprefix(prefix)` and :meth:`str." "removesuffix(suffix)` have been added to easily remove an " @@ -244,11 +241,11 @@ msgid "" "issue:`39939`.)" msgstr "" -#: ../../whatsnew/3.9.rst:173 +#: ../../whatsnew/3.9.rst:172 msgid "Type Hinting Generics in Standard Collections" msgstr "" -#: ../../whatsnew/3.9.rst:175 +#: ../../whatsnew/3.9.rst:174 msgid "" "In type annotations you can now use built-in collection types such as " "``list`` and ``dict`` as generic types instead of importing the " @@ -257,21 +254,21 @@ msgid "" "for example ``queue.Queue``." msgstr "" -#: ../../whatsnew/3.9.rst:181 ../../whatsnew/3.9.rst:1162 +#: ../../whatsnew/3.9.rst:180 ../../whatsnew/3.9.rst:1161 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.9.rst:189 +#: ../../whatsnew/3.9.rst:188 msgid "" "See :pep:`585` for more details. (Contributed by Guido van Rossum, Ethan " "Smith, and Batuhan Taşkaya in :issue:`39481`.)" msgstr "" -#: ../../whatsnew/3.9.rst:193 +#: ../../whatsnew/3.9.rst:192 msgid "New Parser" msgstr "" -#: ../../whatsnew/3.9.rst:195 +#: ../../whatsnew/3.9.rst:194 msgid "" "Python 3.9 uses a new parser, based on `PEG `_ instead of `LL(1) ` and in :ref:`debug build " "`, the *encoding* and *errors* arguments are now checked for " @@ -332,14 +329,14 @@ msgid "" "encode` and :meth:`bytes.decode`." msgstr "" -#: ../../whatsnew/3.9.rst:237 +#: ../../whatsnew/3.9.rst:236 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings. (Contributed by Victor Stinner in :issue:`37388`.)" msgstr "" -#: ../../whatsnew/3.9.rst:242 +#: ../../whatsnew/3.9.rst:241 msgid "" "``\"\".replace(\"\", s, n)`` now returns ``s`` instead of an empty string " "for all non-zero ``n``. It is now consistent with ``\"\".replace(\"\", " @@ -347,14 +344,14 @@ msgid "" "objects. (Contributed by Serhiy Storchaka in :issue:`28029`.)" msgstr "" -#: ../../whatsnew/3.9.rst:247 +#: ../../whatsnew/3.9.rst:246 msgid "" "Any valid expression can now be used as a :term:`decorator`. Previously, " "the grammar was much more restrictive. See :pep:`614` for details. " "(Contributed by Brandt Bucher in :issue:`39702`.)" msgstr "" -#: ../../whatsnew/3.9.rst:251 +#: ../../whatsnew/3.9.rst:250 msgid "" "Improved help for the :mod:`typing` module. Docstrings are now shown for all " "special forms and special generic aliases (like ``Union`` and ``List``). " @@ -363,7 +360,7 @@ msgid "" "Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:257 +#: ../../whatsnew/3.9.rst:256 msgid "" "Parallel running of :meth:`~agen.aclose` / :meth:`~agen.asend` / :meth:" "`~agen.athrow` is now prohibited, and ``ag_running`` now reflects the actual " @@ -371,7 +368,7 @@ msgid "" "issue:`30773`.)" msgstr "" -#: ../../whatsnew/3.9.rst:262 +#: ../../whatsnew/3.9.rst:261 msgid "" "Unexpected errors in calling the ``__iter__`` method are no longer masked by " "``TypeError`` in the :keyword:`in` operator and functions :func:`~operator." @@ -379,49 +376,49 @@ msgid "" "mod:`operator` module. (Contributed by Serhiy Storchaka in :issue:`40824`.)" msgstr "" -#: ../../whatsnew/3.9.rst:268 +#: ../../whatsnew/3.9.rst:267 msgid "" "Unparenthesized lambda expressions can no longer be the expression part in " "an ``if`` clause in comprehensions and generator expressions. See :issue:" "`41848` and :issue:`43755` for details." msgstr "" -#: ../../whatsnew/3.9.rst:274 +#: ../../whatsnew/3.9.rst:273 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.9.rst:277 +#: ../../whatsnew/3.9.rst:276 msgid "zoneinfo" msgstr "zoneinfo" -#: ../../whatsnew/3.9.rst:279 +#: ../../whatsnew/3.9.rst:278 msgid "" "The :mod:`zoneinfo` module brings support for the IANA time zone database to " "the standard library. It adds :class:`zoneinfo.ZoneInfo`, a concrete :class:" "`datetime.tzinfo` implementation backed by the system's time zone data." msgstr "" -#: ../../whatsnew/3.9.rst:303 +#: ../../whatsnew/3.9.rst:302 msgid "" "As a fall-back source of data for platforms that don't ship the IANA " "database, the |tzdata|_ module was released as a first-party package -- " "distributed via PyPI and maintained by the CPython core team." msgstr "" -#: ../../whatsnew/3.9.rst:312 +#: ../../whatsnew/3.9.rst:311 msgid "" ":pep:`615` -- Support for the IANA Time Zone Database in the Standard Library" msgstr "" -#: ../../whatsnew/3.9.rst:313 +#: ../../whatsnew/3.9.rst:312 msgid "PEP written and implemented by Paul Ganssle" msgstr "由 Paul Ganssle 撰寫 PEP 與實作" -#: ../../whatsnew/3.9.rst:317 +#: ../../whatsnew/3.9.rst:316 msgid "graphlib" msgstr "graphlib" -#: ../../whatsnew/3.9.rst:319 +#: ../../whatsnew/3.9.rst:318 msgid "" "A new module, :mod:`graphlib`, was added that contains the :class:`graphlib." "TopologicalSorter` class to offer functionality to perform topological " @@ -429,22 +426,22 @@ msgid "" "Hastings in :issue:`17005`.)" msgstr "" -#: ../../whatsnew/3.9.rst:326 +#: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.9.rst:329 +#: ../../whatsnew/3.9.rst:328 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.9.rst:331 +#: ../../whatsnew/3.9.rst:330 msgid "" "Added the *indent* option to :func:`~ast.dump` which allows it to produce a " "multiline indented output. (Contributed by Serhiy Storchaka in :issue:" "`37995`.)" msgstr "" -#: ../../whatsnew/3.9.rst:335 +#: ../../whatsnew/3.9.rst:334 msgid "" "Added :func:`ast.unparse` as a function in the :mod:`ast` module that can be " "used to unparse an :class:`ast.AST` object and produce a string with code " @@ -452,17 +449,17 @@ msgid "" "(Contributed by Pablo Galindo and Batuhan Taskaya in :issue:`38870`.)" msgstr "" -#: ../../whatsnew/3.9.rst:340 +#: ../../whatsnew/3.9.rst:339 msgid "" "Added docstrings to AST nodes that contains the ASDL signature used to " "construct that node. (Contributed by Batuhan Taskaya in :issue:`39638`.)" msgstr "" -#: ../../whatsnew/3.9.rst:344 +#: ../../whatsnew/3.9.rst:343 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.9.rst:346 +#: ../../whatsnew/3.9.rst:345 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -472,7 +469,7 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.9.rst:353 +#: ../../whatsnew/3.9.rst:352 msgid "" "Added a new :term:`coroutine` :meth:`~asyncio.loop." "shutdown_default_executor` that schedules a shutdown for the default " @@ -481,13 +478,13 @@ msgid "" "new :term:`coroutine`. (Contributed by Kyle Stanley in :issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:359 +#: ../../whatsnew/3.9.rst:358 msgid "" "Added :class:`asyncio.PidfdChildWatcher`, a Linux-specific child watcher " "implementation that polls process file descriptors. (:issue:`38692`)" msgstr "" -#: ../../whatsnew/3.9.rst:362 +#: ../../whatsnew/3.9.rst:361 msgid "" "Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used " "for running IO-bound functions in a separate thread to avoid blocking the " @@ -496,7 +493,7 @@ msgid "" "by Kyle Stanley and Yury Selivanov in :issue:`32309`.)" msgstr "" -#: ../../whatsnew/3.9.rst:368 +#: ../../whatsnew/3.9.rst:367 msgid "" "When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now " "wait until the cancellation is complete also in the case when *timeout* is " @@ -504,25 +501,25 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:373 +#: ../../whatsnew/3.9.rst:372 msgid "" ":mod:`asyncio` now raises :exc:`TyperError` when calling incompatible " "methods with an :class:`ssl.SSLSocket` socket. (Contributed by Ido Michael " "in :issue:`37404`.)" msgstr "" -#: ../../whatsnew/3.9.rst:378 +#: ../../whatsnew/3.9.rst:377 msgid "compileall" msgstr "compileall" -#: ../../whatsnew/3.9.rst:380 +#: ../../whatsnew/3.9.rst:379 msgid "" "Added new possibility to use hardlinks for duplicated ``.pyc`` files: " "*hardlink_dupes* parameter and --hardlink-dupes command line option. " "(Contributed by Lumír 'Frenzy' Balhar in :issue:`40495`.)" msgstr "" -#: ../../whatsnew/3.9.rst:383 +#: ../../whatsnew/3.9.rst:382 msgid "" "Added new options for path manipulation in resulting ``.pyc`` files: " "*stripdir*, *prependdir*, *limit_sl_dest* parameters and -s, -p, -e command " @@ -531,11 +528,11 @@ msgid "" "issue:`38112`.)" msgstr "" -#: ../../whatsnew/3.9.rst:388 +#: ../../whatsnew/3.9.rst:387 msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.9.rst:390 +#: ../../whatsnew/3.9.rst:389 msgid "" "Added a new *cancel_futures* parameter to :meth:`concurrent.futures.Executor." "shutdown` that cancels all pending futures which have not started running, " @@ -543,7 +540,7 @@ msgid "" "(Contributed by Kyle Stanley in :issue:`39349`.)" msgstr "" -#: ../../whatsnew/3.9.rst:396 +#: ../../whatsnew/3.9.rst:395 msgid "" "Removed daemon threads from :class:`~concurrent.futures.ThreadPoolExecutor` " "and :class:`~concurrent.futures.ProcessPoolExecutor`. This improves " @@ -551,7 +548,7 @@ msgid "" "processes. (Contributed by Kyle Stanley in :issue:`39812`.)" msgstr "" -#: ../../whatsnew/3.9.rst:401 +#: ../../whatsnew/3.9.rst:400 msgid "" "Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned " "on demand, only when there are no available idle workers to reuse. This " @@ -559,68 +556,68 @@ msgid "" "workers. (Contributed by Kyle Stanley in :issue:`39207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:407 +#: ../../whatsnew/3.9.rst:406 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.9.rst:409 +#: ../../whatsnew/3.9.rst:408 msgid "" "Added :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, :func:" "`curses.get_tabsize`, and :func:`curses.set_tabsize` functions. (Contributed " "by Anthony Sottile in :issue:`38312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:414 +#: ../../whatsnew/3.9.rst:413 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.9.rst:415 +#: ../../whatsnew/3.9.rst:414 msgid "" "The :meth:`~datetime.date.isocalendar()` of :class:`datetime.date` and :meth:" "`~datetime.datetime.isocalendar()` of :class:`datetime.datetime` methods now " "returns a :func:`~collections.namedtuple` instead of a :class:`tuple`. " -"(Contributed by Dong-hee Na in :issue:`24416`.)" +"(Contributed by Donghee Na in :issue:`24416`.)" msgstr "" -#: ../../whatsnew/3.9.rst:421 +#: ../../whatsnew/3.9.rst:420 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.9.rst:423 +#: ../../whatsnew/3.9.rst:422 msgid "" "The :command:`upload` command now creates SHA2-256 and Blake2b-256 hash " "digests. It skips MD5 on platforms that block MD5 digest. (Contributed by " "Christian Heimes in :issue:`40698`.)" msgstr "" -#: ../../whatsnew/3.9.rst:428 +#: ../../whatsnew/3.9.rst:427 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.9.rst:430 +#: ../../whatsnew/3.9.rst:429 msgid "" "Added constants :const:`~fcntl.F_OFD_GETLK`, :const:`~fcntl.F_OFD_SETLK` " -"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:" +"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Donghee Na in :issue:" "`38602`.)" msgstr "" -#: ../../whatsnew/3.9.rst:435 +#: ../../whatsnew/3.9.rst:434 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.9.rst:437 +#: ../../whatsnew/3.9.rst:436 msgid "" ":class:`~ftplib.FTP` and :class:`~ftplib.FTP_TLS` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:442 +#: ../../whatsnew/3.9.rst:441 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.9.rst:444 +#: ../../whatsnew/3.9.rst:443 msgid "" "When the garbage collector makes a collection in which some objects " "resurrect (they are reachable from outside the isolated cycles after the " @@ -629,24 +626,24 @@ msgid "" "issue:`38379`.)" msgstr "" -#: ../../whatsnew/3.9.rst:449 +#: ../../whatsnew/3.9.rst:448 msgid "" "Added a new function :func:`gc.is_finalized` to check if an object has been " "finalized by the garbage collector. (Contributed by Pablo Galindo in :issue:" "`39322`.)" msgstr "" -#: ../../whatsnew/3.9.rst:454 +#: ../../whatsnew/3.9.rst:453 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.9.rst:456 +#: ../../whatsnew/3.9.rst:455 msgid "" "The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF from OpenSSL " "when available. (Contributed by Christian Heimes in :issue:`37630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:460 +#: ../../whatsnew/3.9.rst:459 msgid "" "Builtin hash modules can now be disabled with ``./configure --without-" "builtin-hashlib-hashes`` or selectively enabled with e.g. ``./configure --" @@ -654,55 +651,55 @@ msgid "" "implementation. (Contributed by Christian Heimes in :issue:`40479`)" msgstr "" -#: ../../whatsnew/3.9.rst:468 +#: ../../whatsnew/3.9.rst:467 msgid "http" msgstr "http" -#: ../../whatsnew/3.9.rst:470 +#: ../../whatsnew/3.9.rst:469 msgid "" "HTTP status codes ``103 EARLY_HINTS``, ``418 IM_A_TEAPOT`` and ``425 " -"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Dong-hee " +"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Donghee " "Na in :issue:`39509` and Ross Rhodes in :issue:`39507`.)" msgstr "" -#: ../../whatsnew/3.9.rst:474 +#: ../../whatsnew/3.9.rst:473 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.9.rst:476 +#: ../../whatsnew/3.9.rst:475 msgid "" "Added option to toggle cursor blink off. (Contributed by Zackery Spytz in :" "issue:`4603`.)" msgstr "" -#: ../../whatsnew/3.9.rst:479 +#: ../../whatsnew/3.9.rst:478 msgid "" "Escape key now closes IDLE completion windows. (Contributed by Johnny " "Najera in :issue:`38944`.)" msgstr "" -#: ../../whatsnew/3.9.rst:482 +#: ../../whatsnew/3.9.rst:481 msgid "" "Added keywords to module name completion list. (Contributed by Terry J. " "Reedy in :issue:`37765`.)" msgstr "" -#: ../../whatsnew/3.9.rst:485 +#: ../../whatsnew/3.9.rst:484 msgid "New in 3.9 maintenance releases" msgstr "" -#: ../../whatsnew/3.9.rst:487 +#: ../../whatsnew/3.9.rst:486 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" "`43008`.)" msgstr "" -#: ../../whatsnew/3.9.rst:491 +#: ../../whatsnew/3.9.rst:490 msgid "The changes above have been backported to 3.8 maintenance releases." msgstr "" -#: ../../whatsnew/3.9.rst:493 +#: ../../whatsnew/3.9.rst:492 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -713,41 +710,41 @@ msgid "" "`33962`.)" msgstr "" -#: ../../whatsnew/3.9.rst:501 +#: ../../whatsnew/3.9.rst:500 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.9.rst:505 +#: ../../whatsnew/3.9.rst:504 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.9.rst:507 +#: ../../whatsnew/3.9.rst:506 msgid "" ":class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now have an optional " "*timeout* parameter for their constructors. Also, the :meth:`~imaplib.IMAP4." "open` method now has an optional *timeout* parameter with this change. The " "overridden methods of :class:`~imaplib.IMAP4_SSL` and :class:`~imaplib." -"IMAP4_stream` were applied to this change. (Contributed by Dong-hee Na in :" +"IMAP4_stream` were applied to this change. (Contributed by Donghee Na in :" "issue:`38615`.)" msgstr "" -#: ../../whatsnew/3.9.rst:514 +#: ../../whatsnew/3.9.rst:513 msgid "" ":meth:`imaplib.IMAP4.unselect` is added. :meth:`imaplib.IMAP4.unselect` " "frees server's resources associated with the selected mailbox and returns " "the server to the authenticated state. This command performs the same " "actions as :meth:`imaplib.IMAP4.close`, except that no messages are " "permanently removed from the currently selected mailbox. (Contributed by " -"Dong-hee Na in :issue:`40375`.)" +"Donghee Na in :issue:`40375`.)" msgstr "" -#: ../../whatsnew/3.9.rst:522 +#: ../../whatsnew/3.9.rst:521 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.9.rst:524 +#: ../../whatsnew/3.9.rst:523 msgid "" "To improve consistency with import statements, :func:`importlib.util." "resolve_name` now raises :exc:`ImportError` instead of :exc:`ValueError` for " @@ -755,47 +752,47 @@ msgid "" "`37444`.)" msgstr "" -#: ../../whatsnew/3.9.rst:529 +#: ../../whatsnew/3.9.rst:528 msgid "" "Import loaders which publish immutable module objects can now publish " "immutable packages in addition to individual modules. (Contributed by Dino " "Viehland in :issue:`39336`.)" msgstr "" -#: ../../whatsnew/3.9.rst:533 +#: ../../whatsnew/3.9.rst:532 msgid "" "Added :func:`importlib.resources.files` function with support for " "subdirectories in package data, matching backport in ``importlib_resources`` " "version 1.5. (Contributed by Jason R. Coombs in :issue:`39791`.)" msgstr "" -#: ../../whatsnew/3.9.rst:538 +#: ../../whatsnew/3.9.rst:537 msgid "" "Refreshed ``importlib.metadata`` from ``importlib_metadata`` version 1.6.1." msgstr "" -#: ../../whatsnew/3.9.rst:541 +#: ../../whatsnew/3.9.rst:540 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.9.rst:543 +#: ../../whatsnew/3.9.rst:542 msgid "" ":attr:`inspect.BoundArguments.arguments` is changed from ``OrderedDict`` to " "regular dict. (Contributed by Inada Naoki in :issue:`36350` and :issue:" "`39775`.)" msgstr "" -#: ../../whatsnew/3.9.rst:547 +#: ../../whatsnew/3.9.rst:546 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.9.rst:549 +#: ../../whatsnew/3.9.rst:548 msgid "" ":mod:`ipaddress` now supports IPv6 Scoped Addresses (IPv6 address with " "suffix ``%``)." msgstr "" -#: ../../whatsnew/3.9.rst:551 +#: ../../whatsnew/3.9.rst:550 msgid "" "Scoped IPv6 addresses can be parsed using :class:`ipaddress.IPv6Address`. If " "present, scope zone ID is available through the :attr:`~ipaddress." @@ -803,221 +800,221 @@ msgid "" "`34788`.)" msgstr "" -#: ../../whatsnew/3.9.rst:555 +#: ../../whatsnew/3.9.rst:554 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. (Contributed by Christian Heimes in :" "issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:560 +#: ../../whatsnew/3.9.rst:559 msgid "math" msgstr "math" -#: ../../whatsnew/3.9.rst:562 +#: ../../whatsnew/3.9.rst:561 msgid "" "Expanded the :func:`math.gcd` function to handle multiple arguments. " "Formerly, it only supported two arguments. (Contributed by Serhiy Storchaka " "in :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:566 +#: ../../whatsnew/3.9.rst:565 msgid "" "Added :func:`math.lcm`: return the least common multiple of specified " "arguments. (Contributed by Mark Dickinson, Ananthakrishnan and Serhiy " "Storchaka in :issue:`39479` and :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:570 +#: ../../whatsnew/3.9.rst:569 msgid "" "Added :func:`math.nextafter`: return the next floating-point value after *x* " "towards *y*. (Contributed by Victor Stinner in :issue:`39288`.)" msgstr "" -#: ../../whatsnew/3.9.rst:574 +#: ../../whatsnew/3.9.rst:573 msgid "" "Added :func:`math.ulp`: return the value of the least significant bit of a " "float. (Contributed by Victor Stinner in :issue:`39310`.)" msgstr "" -#: ../../whatsnew/3.9.rst:579 +#: ../../whatsnew/3.9.rst:578 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.9.rst:581 +#: ../../whatsnew/3.9.rst:580 msgid "" "The :class:`multiprocessing.SimpleQueue` class has a new :meth:" "`~multiprocessing.SimpleQueue.close` method to explicitly close the queue. " "(Contributed by Victor Stinner in :issue:`30966`.)" msgstr "" -#: ../../whatsnew/3.9.rst:587 +#: ../../whatsnew/3.9.rst:586 msgid "nntplib" msgstr "nntplib" -#: ../../whatsnew/3.9.rst:589 +#: ../../whatsnew/3.9.rst:588 msgid "" ":class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:594 +#: ../../whatsnew/3.9.rst:593 msgid "os" msgstr "os" -#: ../../whatsnew/3.9.rst:596 +#: ../../whatsnew/3.9.rst:595 msgid "" "Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for :attr:" -"`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" +"`si_code`. (Contributed by Donghee Na in :issue:`38493`.)" msgstr "" -#: ../../whatsnew/3.9.rst:599 +#: ../../whatsnew/3.9.rst:598 msgid "" "Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :const:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" -#: ../../whatsnew/3.9.rst:603 +#: ../../whatsnew/3.9.rst:602 msgid "" "The :func:`os.unsetenv` function is now also available on Windows. " "(Contributed by Victor Stinner in :issue:`39413`.)" msgstr "" -#: ../../whatsnew/3.9.rst:606 +#: ../../whatsnew/3.9.rst:605 msgid "" "The :func:`os.putenv` and :func:`os.unsetenv` functions are now always " "available. (Contributed by Victor Stinner in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:610 +#: ../../whatsnew/3.9.rst:609 msgid "" "Added :func:`os.waitstatus_to_exitcode` function: convert a wait status to " "an exit code. (Contributed by Victor Stinner in :issue:`40094`.)" msgstr "" -#: ../../whatsnew/3.9.rst:615 +#: ../../whatsnew/3.9.rst:614 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.9.rst:617 +#: ../../whatsnew/3.9.rst:616 msgid "" "Added :meth:`pathlib.Path.readlink()` which acts similarly to :func:`os." "readlink`. (Contributed by Girts Folkmanis in :issue:`30618`)" msgstr "" -#: ../../whatsnew/3.9.rst:622 +#: ../../whatsnew/3.9.rst:621 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.9.rst:624 +#: ../../whatsnew/3.9.rst:623 msgid "" "On Windows now :class:`~pdb.Pdb` supports ``~/.pdbrc``. (Contributed by Tim " "Hopper and Dan Lidral-Porter in :issue:`20523`.)" msgstr "" -#: ../../whatsnew/3.9.rst:628 +#: ../../whatsnew/3.9.rst:627 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.9.rst:630 +#: ../../whatsnew/3.9.rst:629 msgid "" ":class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:635 +#: ../../whatsnew/3.9.rst:634 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.9.rst:637 +#: ../../whatsnew/3.9.rst:636 msgid "" ":mod:`pprint` can now pretty-print :class:`types.SimpleNamespace`. " "(Contributed by Carl Bordum Hansen in :issue:`37376`.)" msgstr "" -#: ../../whatsnew/3.9.rst:641 +#: ../../whatsnew/3.9.rst:640 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.9.rst:643 +#: ../../whatsnew/3.9.rst:642 msgid "" "The documentation string is now shown not only for class, function, method " "etc, but for any object that has its own ``__doc__`` attribute. (Contributed " "by Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:648 +#: ../../whatsnew/3.9.rst:647 msgid "random" msgstr "random" -#: ../../whatsnew/3.9.rst:650 +#: ../../whatsnew/3.9.rst:649 msgid "" "Added a new :attr:`random.Random.randbytes` method: generate random bytes. " "(Contributed by Victor Stinner in :issue:`40286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:654 +#: ../../whatsnew/3.9.rst:653 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.9.rst:656 +#: ../../whatsnew/3.9.rst:655 msgid "" "Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to " "signals to a process using a file descriptor instead of a pid. (:issue:" "`38712`)" msgstr "" -#: ../../whatsnew/3.9.rst:660 +#: ../../whatsnew/3.9.rst:659 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.9.rst:662 +#: ../../whatsnew/3.9.rst:661 msgid "" ":class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:666 +#: ../../whatsnew/3.9.rst:665 msgid "" ":class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. " -"(Contributed by Dong-hee Na in :issue:`39329`.)" +"(Contributed by Donghee Na in :issue:`39329`.)" msgstr "" -#: ../../whatsnew/3.9.rst:670 +#: ../../whatsnew/3.9.rst:669 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.9.rst:672 +#: ../../whatsnew/3.9.rst:671 msgid "" "The :mod:`socket` module now exports the :const:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" -#: ../../whatsnew/3.9.rst:676 +#: ../../whatsnew/3.9.rst:675 msgid "" "The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" -#: ../../whatsnew/3.9.rst:679 +#: ../../whatsnew/3.9.rst:678 msgid "" "The socket module now has the :func:`socket.send_fds` and :func:`socket." "recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and " "Victor Stinner in :issue:`28724`.)" msgstr "" -#: ../../whatsnew/3.9.rst:685 +#: ../../whatsnew/3.9.rst:684 msgid "time" msgstr "time" -#: ../../whatsnew/3.9.rst:687 +#: ../../whatsnew/3.9.rst:686 msgid "" "On AIX, :func:`~time.thread_time` is now implemented with " "``thread_cputime()`` which has nanosecond resolution, rather than " @@ -1025,11 +1022,11 @@ msgid "" "milliseconds. (Contributed by Batuhan Taskaya in :issue:`40192`)" msgstr "" -#: ../../whatsnew/3.9.rst:693 +#: ../../whatsnew/3.9.rst:692 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.9.rst:695 +#: ../../whatsnew/3.9.rst:694 msgid "" "Added a new :data:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " @@ -1039,29 +1036,29 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:701 +#: ../../whatsnew/3.9.rst:700 msgid "" "Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" -#: ../../whatsnew/3.9.rst:706 +#: ../../whatsnew/3.9.rst:705 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.9.rst:708 +#: ../../whatsnew/3.9.rst:707 msgid "" "Added :func:`tracemalloc.reset_peak` to set the peak size of traced memory " "blocks to the current size, to measure the peak of specific pieces of code. " "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:713 ../../whatsnew/3.9.rst:1496 +#: ../../whatsnew/3.9.rst:712 ../../whatsnew/3.9.rst:1495 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.9.rst:715 +#: ../../whatsnew/3.9.rst:714 msgid "" ":pep:`593` introduced an :data:`typing.Annotated` type to decorate existing " "types with context-specific metadata and new ``include_extras`` parameter " @@ -1069,20 +1066,20 @@ msgid "" "(Contributed by Till Varoquaux and Konstantin Kashin.)" msgstr "" -#: ../../whatsnew/3.9.rst:721 +#: ../../whatsnew/3.9.rst:720 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.9.rst:723 +#: ../../whatsnew/3.9.rst:722 msgid "" "The Unicode database has been updated to version 13.0.0. (:issue:`39926`)." msgstr "" -#: ../../whatsnew/3.9.rst:726 +#: ../../whatsnew/3.9.rst:725 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.9.rst:728 +#: ../../whatsnew/3.9.rst:727 msgid "" "The activation scripts provided by :mod:`venv` now all specify their prompt " "customization consistently by always using the value specified by " @@ -1092,11 +1089,11 @@ msgid "" "Cannon in :issue:`37663`.)" msgstr "" -#: ../../whatsnew/3.9.rst:736 +#: ../../whatsnew/3.9.rst:735 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.9.rst:738 +#: ../../whatsnew/3.9.rst:737 msgid "" "White space characters within attributes are now preserved when serializing :" "mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized to " @@ -1104,32 +1101,32 @@ msgid "" "2.11 of XML spec. (Contributed by Mefistotelis in :issue:`39011`.)" msgstr "" -#: ../../whatsnew/3.9.rst:746 +#: ../../whatsnew/3.9.rst:745 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.9.rst:748 +#: ../../whatsnew/3.9.rst:747 msgid "" "Optimized the idiom for assignment a temporary variable in comprehensions. " "Now ``for y in [expr]`` in comprehensions is as fast as a simple assignment " "``y = expr``. For example:" msgstr "" -#: ../../whatsnew/3.9.rst:752 +#: ../../whatsnew/3.9.rst:751 msgid "sums = [s for s in [0] for x in data for s in [s + x]]" -msgstr "" +msgstr "sums = [s for s in [0] for x in data for s in [s + x]]" -#: ../../whatsnew/3.9.rst:754 +#: ../../whatsnew/3.9.rst:753 msgid "" "Unlike the ``:=`` operator this idiom does not leak a variable to the outer " "scope." msgstr "" -#: ../../whatsnew/3.9.rst:757 +#: ../../whatsnew/3.9.rst:756 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`32856` 中貢獻。)" -#: ../../whatsnew/3.9.rst:759 +#: ../../whatsnew/3.9.rst:758 msgid "" "Optimized signal handling in multithreaded applications. If a thread " "different than the main thread gets a signal, the bytecode evaluation loop " @@ -1138,42 +1135,42 @@ msgid "" "interpreter can handle signals." msgstr "" -#: ../../whatsnew/3.9.rst:765 +#: ../../whatsnew/3.9.rst:764 msgid "" "Previously, the bytecode evaluation loop was interrupted at each instruction " "until the main thread handles signals. (Contributed by Victor Stinner in :" "issue:`40010`.)" msgstr "" -#: ../../whatsnew/3.9.rst:769 +#: ../../whatsnew/3.9.rst:768 msgid "" "Optimized the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " "(Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor " "Stinner in :issue:`38061`.)" msgstr "" -#: ../../whatsnew/3.9.rst:773 +#: ../../whatsnew/3.9.rst:772 msgid "" ":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " "into :c:expr:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" msgstr "" -#: ../../whatsnew/3.9.rst:777 +#: ../../whatsnew/3.9.rst:776 msgid "" "A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :" "class:`frozenset`, :class:`list`, :class:`dict`) are now sped up by using :" -"pep:`590` vectorcall protocol. (Contributed by Dong-hee Na, Mark Shannon, " +"pep:`590` vectorcall protocol. (Contributed by Donghee Na, Mark Shannon, " "Jeroen Demeyer and Petr Viktorin in :issue:`37207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:782 +#: ../../whatsnew/3.9.rst:781 msgid "" "Optimized :func:`~set.difference_update` for the case when the other set is " "much larger than the base set. (Suggested by Evgeny Kapun with code " "contributed by Michele Orrù in :issue:`8425`.)" msgstr "" -#: ../../whatsnew/3.9.rst:786 +#: ../../whatsnew/3.9.rst:785 msgid "" "Python's small object allocator (``obmalloc.c``) now allows (no more than) " "one empty arena to remain available for immediate reuse, without returning " @@ -1182,26 +1179,26 @@ msgid "" "in :issue:`37257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:792 +#: ../../whatsnew/3.9.rst:791 msgid "" ":term:`floor division` of float operation now has a better performance. Also " "the message of :exc:`ZeroDivisionError` for this operation is updated. " -"(Contributed by Dong-hee Na in :issue:`39434`.)" +"(Contributed by Donghee Na in :issue:`39434`.)" msgstr "" -#: ../../whatsnew/3.9.rst:796 +#: ../../whatsnew/3.9.rst:795 msgid "" "Decoding short ASCII strings with UTF-8 and ascii codecs is now about 15% " "faster. (Contributed by Inada Naoki in :issue:`37348`.)" msgstr "" -#: ../../whatsnew/3.9.rst:799 +#: ../../whatsnew/3.9.rst:798 msgid "" "Here's a summary of performance improvements from Python 3.4 through Python " "3.9:" msgstr "" -#: ../../whatsnew/3.9.rst:846 +#: ../../whatsnew/3.9.rst:845 msgid "" "These results were generated from the variable access benchmark script at: " "``Tools/scripts/var_access_benchmark.py``. The benchmark script displays " @@ -1212,18 +1209,18 @@ msgid "" "python.org/downloads/macos/>`_." msgstr "" -#: ../../whatsnew/3.9.rst:856 +#: ../../whatsnew/3.9.rst:855 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.9.rst:858 +#: ../../whatsnew/3.9.rst:857 msgid "" "The distutils ``bdist_msi`` command is now deprecated, use ``bdist_wheel`` " "(wheel packages) instead. (Contributed by Hugo van Kemenade in :issue:" "`39586`.)" msgstr "" -#: ../../whatsnew/3.9.rst:862 +#: ../../whatsnew/3.9.rst:861 msgid "" "Currently :func:`math.factorial` accepts :class:`float` instances with non-" "negative integer values (like ``5.0``). It raises a :exc:`ValueError` for " @@ -1232,7 +1229,7 @@ msgid "" "Serhiy Storchaka in :issue:`37315`.)" msgstr "" -#: ../../whatsnew/3.9.rst:868 +#: ../../whatsnew/3.9.rst:867 msgid "" "The :mod:`parser` and :mod:`symbol` modules are deprecated and will be " "removed in future versions of Python. For the majority of use cases, users " @@ -1240,7 +1237,7 @@ msgid "" "stage, using the :mod:`ast` module." msgstr "" -#: ../../whatsnew/3.9.rst:873 +#: ../../whatsnew/3.9.rst:872 msgid "" "The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" "func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" @@ -1248,7 +1245,7 @@ msgid "" "and will be removed in Python 3.10 together with the old parser." msgstr "" -#: ../../whatsnew/3.9.rst:878 +#: ../../whatsnew/3.9.rst:877 msgid "" "Using :data:`NotImplemented` in a boolean context has been deprecated, as it " "is almost exclusively the result of incorrect rich comparator " @@ -1256,7 +1253,7 @@ msgid "" "Python. (Contributed by Josh Rosenberg in :issue:`35712`.)" msgstr "" -#: ../../whatsnew/3.9.rst:884 +#: ../../whatsnew/3.9.rst:883 msgid "" "The :mod:`random` module currently accepts any hashable type as a possible " "seed value. Unfortunately, some of those types are not guaranteed to have a " @@ -1265,7 +1262,7 @@ msgid "" "`bytes`, and :class:`bytearray`." msgstr "" -#: ../../whatsnew/3.9.rst:890 +#: ../../whatsnew/3.9.rst:889 msgid "" "Opening the :class:`~gzip.GzipFile` file for writing without specifying the " "*mode* argument is deprecated. In future Python versions it will always be " @@ -1274,39 +1271,39 @@ msgid "" "issue:`28286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:896 +#: ../../whatsnew/3.9.rst:895 msgid "" "Deprecated the ``split()`` method of :class:`_tkinter.TkappType` in favour " "of the ``splitlist()`` method which has more consistent and predicable " "behavior. (Contributed by Serhiy Storchaka in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.9.rst:901 +#: ../../whatsnew/3.9.rst:900 msgid "" "The explicit passing of coroutine objects to :func:`asyncio.wait` has been " "deprecated and will be removed in version 3.11. (Contributed by Yury " "Selivanov and Kyle Stanley in :issue:`34790`.)" msgstr "" -#: ../../whatsnew/3.9.rst:905 +#: ../../whatsnew/3.9.rst:904 msgid "" "binhex4 and hexbin4 standards are now deprecated. The :mod:`binhex` module " "and the following :mod:`binascii` functions are now deprecated:" msgstr "" -#: ../../whatsnew/3.9.rst:908 +#: ../../whatsnew/3.9.rst:907 msgid ":func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`" msgstr ":func:`~binascii.b2a_hqx`\\ 、\\ :func:`~binascii.a2b_hqx`" -#: ../../whatsnew/3.9.rst:909 +#: ../../whatsnew/3.9.rst:908 msgid ":func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`" msgstr ":func:`~binascii.rlecode_hqx`\\ 、\\ :func:`~binascii.rledecode_hqx`" -#: ../../whatsnew/3.9.rst:911 +#: ../../whatsnew/3.9.rst:910 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" msgstr "(由 Victor Stinner 在 :issue:`39353` 中貢獻。)" -#: ../../whatsnew/3.9.rst:913 +#: ../../whatsnew/3.9.rst:912 msgid "" ":mod:`ast` classes ``slice``, ``Index`` and ``ExtSlice`` are considered " "deprecated and will be removed in future Python versions. ``value`` itself " @@ -1315,7 +1312,7 @@ msgid "" "Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:919 +#: ../../whatsnew/3.9.rst:918 msgid "" ":mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore`` are " "considered deprecated and will be removed in future Python versions. They " @@ -1324,7 +1321,7 @@ msgid "" "`39969` and Serhiy Storchaka in :issue:`39988`.)" msgstr "" -#: ../../whatsnew/3.9.rst:926 +#: ../../whatsnew/3.9.rst:925 msgid "" "The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" @@ -1333,20 +1330,20 @@ msgid "" "in :issue:`39877`.)" msgstr "" -#: ../../whatsnew/3.9.rst:932 +#: ../../whatsnew/3.9.rst:931 msgid "" "Passing ``None`` as the first argument to the :func:`shlex.split` function " "has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.)" msgstr "" -#: ../../whatsnew/3.9.rst:935 +#: ../../whatsnew/3.9.rst:934 msgid "" ":func:`smtpd.MailmanProxy` is now deprecated as it is unusable without an " "external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" "`35800`.)" msgstr "" -#: ../../whatsnew/3.9.rst:938 +#: ../../whatsnew/3.9.rst:937 msgid "" "The :mod:`lib2to3` module now emits a :exc:`PendingDeprecationWarning`. " "Python 3.9 switched to a PEG parser (see :pep:`617`), and Python 3.10 may " @@ -1356,39 +1353,39 @@ msgid "" "`parso`_. (Contributed by Carl Meyer in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.9.rst:946 +#: ../../whatsnew/3.9.rst:945 msgid "" "The *random* parameter of :func:`random.shuffle` has been deprecated. " "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:955 ../../whatsnew/3.9.rst:1410 +#: ../../whatsnew/3.9.rst:954 ../../whatsnew/3.9.rst:1409 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.9.rst:957 +#: ../../whatsnew/3.9.rst:956 msgid "" "The erroneous version at :data:`unittest.mock.__version__` has been removed." msgstr "" -#: ../../whatsnew/3.9.rst:959 +#: ../../whatsnew/3.9.rst:958 msgid "" ":class:`nntplib.NNTP`: ``xpath()`` and ``xgtitle()`` methods have been " "removed. These methods are deprecated since Python 3.3. Generally, these " "extensions are not supported or not enabled by NNTP server administrators. " "For ``xgtitle()``, please use :meth:`nntplib.NNTP.descriptions` or :meth:" -"`nntplib.NNTP.description` instead. (Contributed by Dong-hee Na in :issue:" +"`nntplib.NNTP.description` instead. (Contributed by Donghee Na in :issue:" "`39366`.)" msgstr "" -#: ../../whatsnew/3.9.rst:966 +#: ../../whatsnew/3.9.rst:965 msgid "" ":class:`array.array`: ``tostring()`` and ``fromstring()`` methods have been " "removed. They were aliases to ``tobytes()`` and ``frombytes()``, deprecated " "since Python 3.2. (Contributed by Victor Stinner in :issue:`38916`.)" msgstr "" -#: ../../whatsnew/3.9.rst:971 +#: ../../whatsnew/3.9.rst:970 msgid "" "The undocumented ``sys.callstats()`` function has been removed. Since Python " "3.7, it was deprecated and always returned :const:`None`. It required a " @@ -1396,7 +1393,7 @@ msgid "" "3.7. (Contributed by Victor Stinner in :issue:`37414`.)" msgstr "" -#: ../../whatsnew/3.9.rst:976 +#: ../../whatsnew/3.9.rst:975 msgid "" "The ``sys.getcheckinterval()`` and ``sys.setcheckinterval()`` functions have " "been removed. They were deprecated since Python 3.2. Use :func:`sys." @@ -1404,21 +1401,21 @@ msgid "" "by Victor Stinner in :issue:`37392`.)" msgstr "" -#: ../../whatsnew/3.9.rst:981 +#: ../../whatsnew/3.9.rst:980 msgid "" "The C function ``PyImport_Cleanup()`` has been removed. It was documented " "as: \"Empty the module table. For internal use only.\" (Contributed by " "Victor Stinner in :issue:`36710`.)" msgstr "" -#: ../../whatsnew/3.9.rst:985 +#: ../../whatsnew/3.9.rst:984 msgid "" "``_dummy_thread`` and ``dummy_threading`` modules have been removed. These " "modules were deprecated since Python 3.7 which requires threading support. " "(Contributed by Victor Stinner in :issue:`37312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:989 +#: ../../whatsnew/3.9.rst:988 msgid "" "``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to " "``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open()` have " @@ -1426,14 +1423,14 @@ msgid "" "Stinner in :issue:`37320`.)" msgstr "" -#: ../../whatsnew/3.9.rst:994 +#: ../../whatsnew/3.9.rst:993 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " "has been removed. It was deprecated since Python 3.8. Use :meth:`~threading." -"Thread.is_alive()` instead. (Contributed by Dong-hee Na in :issue:`37804`.)" +"Thread.is_alive()` instead. (Contributed by Donghee Na in :issue:`37804`.)" msgstr "" -#: ../../whatsnew/3.9.rst:999 +#: ../../whatsnew/3.9.rst:998 msgid "" "Methods ``getchildren()`` and ``getiterator()`` of classes :class:`~xml." "etree.ElementTree.ElementTree` and :class:`~xml.etree.ElementTree.Element` " @@ -1443,7 +1440,7 @@ msgid "" "getiterator()``. (Contributed by Serhiy Storchaka in :issue:`36543`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1007 +#: ../../whatsnew/3.9.rst:1006 msgid "" "The old :mod:`plistlib` API has been removed, it was deprecated since Python " "3.4. Use the :func:`~plistlib.load`, :func:`~plistlib.loads`, :func:" @@ -1452,7 +1449,7 @@ msgid "" "are always used instead. (Contributed by Jon Janzen in :issue:`36409`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1013 +#: ../../whatsnew/3.9.rst:1012 msgid "" "The C function ``PyGen_NeedsFinalizing`` has been removed. It was not " "documented, tested, or used anywhere within CPython after the implementation " @@ -1460,7 +1457,7 @@ msgid "" "in :issue:`15088`)" msgstr "" -#: ../../whatsnew/3.9.rst:1018 +#: ../../whatsnew/3.9.rst:1017 msgid "" "``base64.encodestring()`` and ``base64.decodestring()``, aliases deprecated " "since Python 3.1, have been removed: use :func:`base64.encodebytes` and :" @@ -1468,14 +1465,14 @@ msgid "" "`39351`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1023 +#: ../../whatsnew/3.9.rst:1022 msgid "" "``fractions.gcd()`` function has been removed, it was deprecated since " "Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead. (Contributed by " "Victor Stinner in :issue:`39350`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1027 +#: ../../whatsnew/3.9.rst:1026 msgid "" "The *buffering* parameter of :class:`bz2.BZ2File` has been removed. Since " "Python 3.0, it was ignored and using it emitted a :exc:`DeprecationWarning`. " @@ -1483,7 +1480,7 @@ msgid "" "Victor Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1032 +#: ../../whatsnew/3.9.rst:1031 msgid "" "The *encoding* parameter of :func:`json.loads` has been removed. As of " "Python 3.1, it was deprecated and ignored; using it has emitted a :exc:" @@ -1491,7 +1488,7 @@ msgid "" "`39377`)" msgstr "" -#: ../../whatsnew/3.9.rst:1037 +#: ../../whatsnew/3.9.rst:1036 msgid "" "``with (await asyncio.lock):`` and ``with (yield from asyncio.lock):`` " "statements are not longer supported, use ``async with lock`` instead. The " @@ -1499,7 +1496,7 @@ msgid "" "(Contributed by Andrew Svetlov in :issue:`34793`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1042 +#: ../../whatsnew/3.9.rst:1041 msgid "" "The :func:`sys.getcounts` function, the ``-X showalloccount`` command line " "option and the ``show_alloc_count`` field of the C structure :c:type:" @@ -1508,7 +1505,7 @@ msgid "" "`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1048 +#: ../../whatsnew/3.9.rst:1047 msgid "" "The ``_field_types`` attribute of the :class:`typing.NamedTuple` class has " "been removed. It was deprecated since Python 3.8. Use the " @@ -1516,14 +1513,14 @@ msgid "" "issue:`40182`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1053 +#: ../../whatsnew/3.9.rst:1052 msgid "" "The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was " "deprecated since 2006, and only returning ``False`` when it's called. " "(Contributed by Batuhan Taskaya in :issue:`40208`)" msgstr "" -#: ../../whatsnew/3.9.rst:1057 +#: ../../whatsnew/3.9.rst:1056 msgid "" "The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` " "have been removed. They were deprecated since Python 3.7 and you can use :" @@ -1531,7 +1528,7 @@ msgid "" "(Contributed by Rémi Lapeyre in :issue:`40967`)" msgstr "" -#: ../../whatsnew/3.9.rst:1062 +#: ../../whatsnew/3.9.rst:1061 msgid "" "The ``unescape()`` method in the :class:`html.parser.HTMLParser` class has " "been removed (it was deprecated since Python 3.4). :func:`html.unescape` " @@ -1539,21 +1536,21 @@ msgid "" "unicode characters." msgstr "" -#: ../../whatsnew/3.9.rst:1069 ../../whatsnew/3.9.rst:1336 +#: ../../whatsnew/3.9.rst:1068 ../../whatsnew/3.9.rst:1335 msgid "Porting to Python 3.9" msgstr "" -#: ../../whatsnew/3.9.rst:1071 +#: ../../whatsnew/3.9.rst:1070 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.9.rst:1076 +#: ../../whatsnew/3.9.rst:1075 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.9.rst:1078 +#: ../../whatsnew/3.9.rst:1077 msgid "" ":func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:" "`ImportError` where it previously raised :exc:`ValueError`. Callers catching " @@ -1561,26 +1558,26 @@ msgid "" "versions will need to catch both using ``except (ImportError, ValueError):``." msgstr "" -#: ../../whatsnew/3.9.rst:1083 +#: ../../whatsnew/3.9.rst:1082 msgid "" "The :mod:`venv` activation scripts no longer special-case when " "``__VENV_PROMPT__`` is set to ``\"\"``." msgstr "" -#: ../../whatsnew/3.9.rst:1086 +#: ../../whatsnew/3.9.rst:1085 msgid "" "The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1090 +#: ../../whatsnew/3.9.rst:1089 msgid "" "The *compresslevel* parameter of :class:`bz2.BZ2File` became keyword-only, " "since the *buffering* parameter has been removed. (Contributed by Victor " "Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1094 +#: ../../whatsnew/3.9.rst:1093 msgid "" "Simplified AST for subscription. Simple indices will be represented by their " "value, extended slices will be represented as tuples. ``Index(value)`` will " @@ -1588,21 +1585,21 @@ msgid "" "Load())``. (Contributed by Serhiy Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1100 +#: ../../whatsnew/3.9.rst:1099 msgid "" "The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` " "environment variable when the :option:`-E` or :option:`-I` command line " "options are being used." msgstr "" -#: ../../whatsnew/3.9.rst:1104 +#: ../../whatsnew/3.9.rst:1103 msgid "" "The *encoding* parameter has been added to the classes :class:`ftplib.FTP` " "and :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default " "encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../whatsnew/3.9.rst:1108 +#: ../../whatsnew/3.9.rst:1107 msgid "" ":meth:`asyncio.loop.shutdown_default_executor` has been added to :class:" "`~asyncio.AbstractEventLoop`, meaning alternative event loops that inherit " @@ -1610,7 +1607,7 @@ msgid "" "issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1113 +#: ../../whatsnew/3.9.rst:1112 msgid "" "The constant values of future flags in the :mod:`__future__` module is " "updated in order to prevent collision with compiler flags. Previously " @@ -1618,7 +1615,7 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`39562`)" msgstr "" -#: ../../whatsnew/3.9.rst:1118 +#: ../../whatsnew/3.9.rst:1117 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of " "``Py_UNICODE``. This change doesn't affect to its behavior because " @@ -1626,7 +1623,7 @@ msgid "" "by Inada Naoki in :issue:`34538`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1123 +#: ../../whatsnew/3.9.rst:1122 msgid "" "The :func:`logging.getLogger` API now returns the root logger when passed " "the name ``'root'``, whereas previously it returned a non-root logger named " @@ -1636,7 +1633,7 @@ msgid "" "(Contributed by Vinay Sajip in :issue:`37742`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1130 +#: ../../whatsnew/3.9.rst:1129 msgid "" "Division handling of :class:`~pathlib.PurePath` now returns " "``NotImplemented`` instead of raising a :exc:`TypeError` when passed " @@ -1645,7 +1642,7 @@ msgid "" "mentioned types. (Contributed by Roger Aiudi in :issue:`34775`)." msgstr "" -#: ../../whatsnew/3.9.rst:1136 +#: ../../whatsnew/3.9.rst:1135 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. Leading zeros are ambiguous and " @@ -1655,7 +1652,7 @@ msgid "" "leading zeros. (Contributed by Christian Heimes in :issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:1144 +#: ../../whatsnew/3.9.rst:1143 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" "`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " @@ -1664,11 +1661,11 @@ msgid "" "in :issue:`37751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1152 +#: ../../whatsnew/3.9.rst:1151 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.9.rst:1154 +#: ../../whatsnew/3.9.rst:1153 msgid "" "Instances of :ref:`heap-allocated types ` (such as those created " "with :c:func:`PyType_FromSpec` and similar APIs) hold a reference to their " @@ -1679,7 +1676,7 @@ msgid "" "heap-allocated types visit the object's type." msgstr "" -#: ../../whatsnew/3.9.rst:1175 +#: ../../whatsnew/3.9.rst:1174 msgid "" "If your traverse function delegates to ``tp_traverse`` of its base class (or " "another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that " @@ -1687,19 +1684,19 @@ msgid "" "``tp_traverse``." msgstr "" -#: ../../whatsnew/3.9.rst:1180 +#: ../../whatsnew/3.9.rst:1179 msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1186 +#: ../../whatsnew/3.9.rst:1185 msgid "then add:" msgstr "" -#: ../../whatsnew/3.9.rst:1199 +#: ../../whatsnew/3.9.rst:1198 msgid "(See :issue:`35810` and :issue:`40217` for more information.)" msgstr "(更多資訊請見 :issue:`35810` 與 :issue:`40217`\\ 。)" -#: ../../whatsnew/3.9.rst:1201 +#: ../../whatsnew/3.9.rst:1200 msgid "" "The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, " "``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated. " @@ -1707,11 +1704,11 @@ msgid "" "issue:`29548`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1207 +#: ../../whatsnew/3.9.rst:1206 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.9.rst:1209 +#: ../../whatsnew/3.9.rst:1208 msgid "" "The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the :" "keyword:`assert` statement. Previously, the assert statement would not work " @@ -1719,37 +1716,37 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34880`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1214 +#: ../../whatsnew/3.9.rst:1213 msgid "" "The :opcode:`COMPARE_OP` opcode was split into four distinct instructions:" msgstr "" -#: ../../whatsnew/3.9.rst:1216 +#: ../../whatsnew/3.9.rst:1215 msgid "``COMPARE_OP`` for rich comparisons" msgstr "" -#: ../../whatsnew/3.9.rst:1217 +#: ../../whatsnew/3.9.rst:1216 msgid "``IS_OP`` for 'is' and 'is not' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1218 +#: ../../whatsnew/3.9.rst:1217 msgid "``CONTAINS_OP`` for 'in' and 'not in' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1219 +#: ../../whatsnew/3.9.rst:1218 msgid "" "``JUMP_IF_NOT_EXC_MATCH`` for checking exceptions in 'try-except' statements." msgstr "" -#: ../../whatsnew/3.9.rst:1222 +#: ../../whatsnew/3.9.rst:1221 msgid "(Contributed by Mark Shannon in :issue:`39156`.)" msgstr "(由 Mark Shannon 在 :issue:`39156` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1226 +#: ../../whatsnew/3.9.rst:1225 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1228 +#: ../../whatsnew/3.9.rst:1227 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " "platform-specific library directory, stored in the new :data:`sys." @@ -1758,26 +1755,26 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1234 +#: ../../whatsnew/3.9.rst:1233 msgid "" "The ``COUNT_ALLOCS`` special build macro has been removed. (Contributed by " "Victor Stinner in :issue:`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1237 +#: ../../whatsnew/3.9.rst:1236 msgid "" "On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` " "functions are now required to build Python. (Contributed by Victor Stinner " "in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1241 +#: ../../whatsnew/3.9.rst:1240 msgid "" "On non-Windows platforms, creating ``bdist_wininst`` installers is now " "officially unsupported. (See :issue:`10945` for more details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1244 +#: ../../whatsnew/3.9.rst:1243 msgid "" "When building Python on macOS from source, ``_tkinter`` now links with non-" "system Tcl and Tk frameworks if they are installed in ``/Library/" @@ -1788,13 +1785,13 @@ msgid "" "(Contributed by Ned Deily in :issue:`34956`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1253 +#: ../../whatsnew/3.9.rst:1252 msgid "" "Python can now be built for Windows 10 ARM64. (Contributed by Steve Dower " "in :issue:`33125`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1256 +#: ../../whatsnew/3.9.rst:1255 msgid "" "Some individual tests are now skipped when ``--pgo`` is used. The tests in " "question increased the PGO task time significantly and likely didn't help " @@ -1810,11 +1807,11 @@ msgid "" "details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1271 +#: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1276 +#: ../../whatsnew/3.9.rst:1275 msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " @@ -1823,20 +1820,20 @@ msgid "" "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1283 +#: ../../whatsnew/3.9.rst:1282 msgid "" "Added :c:func:`PyFrame_GetCode` function: get a frame code. Added :c:func:" "`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1287 +#: ../../whatsnew/3.9.rst:1286 msgid "" "Added :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1290 +#: ../../whatsnew/3.9.rst:1289 msgid "" "Added :c:func:`PyThreadState_GetInterpreter` and :c:func:" "`PyInterpreterState_Get` functions to get the interpreter. Added :c:func:" @@ -1846,7 +1843,7 @@ msgid "" "issue:`39947`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1298 +#: ../../whatsnew/3.9.rst:1297 msgid "" "Added a new public :c:func:`PyObject_CallNoArgs` function to the C API, " "which calls a callable Python object without any arguments. It is the most " @@ -1854,11 +1851,11 @@ msgid "" "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1303 ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1302 ../../whatsnew/3.9.rst:1420 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" -#: ../../whatsnew/3.9.rst:1305 +#: ../../whatsnew/3.9.rst:1304 msgid "" "Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` " "as regular functions for the limited API. Previously, there were defined as " @@ -1867,23 +1864,23 @@ msgid "" "the limited C API)." msgstr "" -#: ../../whatsnew/3.9.rst:1311 +#: ../../whatsnew/3.9.rst:1310 msgid "" "``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular \"opaque\" " "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1314 ../../whatsnew/3.9.rst:1448 +#: ../../whatsnew/3.9.rst:1313 ../../whatsnew/3.9.rst:1447 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "(由 Victor Stinner 在 38644 和 39542 中貢獻。)" -#: ../../whatsnew/3.9.rst:1316 +#: ../../whatsnew/3.9.rst:1315 msgid "" "The :c:func:`PyModule_AddType` function is added to help adding a type to a " -"module. (Contributed by Dong-hee Na in :issue:`40024`.)" +"module. (Contributed by Donghee Na in :issue:`40024`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1320 +#: ../../whatsnew/3.9.rst:1319 msgid "" "Added the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" "`PyObject_GC_IsFinalized` to the public API to allow to query if Python " @@ -1892,27 +1889,27 @@ msgid "" "issue:`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1326 +#: ../../whatsnew/3.9.rst:1325 msgid "" "Added :c:func:`_PyObject_FunctionStr` to get a user-friendly string " "representation of a function-like object. (Patch by Jeroen Demeyer in :issue:" "`37645`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1330 +#: ../../whatsnew/3.9.rst:1329 msgid "" "Added :c:func:`PyObject_CallOneArg` for calling an object with one " "positional argument (Patch by Jeroen Demeyer in :issue:`37483`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1338 +#: ../../whatsnew/3.9.rst:1337 msgid "" "``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory " "*tstate* parameter (``PyThreadState*``). (Contributed by Victor Stinner in :" "issue:`38500`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1342 +#: ../../whatsnew/3.9.rst:1341 msgid "" "Extension modules: :c:member:`~PyModuleDef.m_traverse`, :c:member:" "`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` functions of :c:" @@ -1924,12 +1921,12 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../whatsnew/3.9.rst:1351 +#: ../../whatsnew/3.9.rst:1350 msgid "" "Extension modules without module state (``m_size <= 0``) are not affected." msgstr "" -#: ../../whatsnew/3.9.rst:1353 +#: ../../whatsnew/3.9.rst:1352 msgid "" "If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function " "is now scheduled to be called from the subinterpreter, rather than being " @@ -1937,7 +1934,7 @@ msgid "" "of scheduled calls. (Contributed by Victor Stinner in :issue:`39984`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1359 +#: ../../whatsnew/3.9.rst:1358 msgid "" "The Windows registry is no longer used to initialize :data:`sys.path` when " "the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to " @@ -1945,21 +1942,21 @@ msgid "" "by Zackery Spytz in :issue:`8901`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1364 +#: ../../whatsnew/3.9.rst:1363 msgid "" "The global variable :c:data:`PyStructSequence_UnnamedField` is now a " "constant and refers to a constant string. (Contributed by Serhiy Storchaka " "in :issue:`38650`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1368 +#: ../../whatsnew/3.9.rst:1367 msgid "" "The :c:type:`PyGC_Head` structure is now opaque. It is only defined in the " "internal C API (``pycore_gc.h``). (Contributed by Victor Stinner in :issue:" "`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1372 +#: ../../whatsnew/3.9.rst:1371 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" "func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " @@ -1968,7 +1965,7 @@ msgid "" "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1379 +#: ../../whatsnew/3.9.rst:1378 msgid "" "The :c:func:`Py_FatalError` function is replaced with a macro which logs " "automatically the name of the current function, unless the " @@ -1976,22 +1973,22 @@ msgid "" "issue:`39882`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1384 +#: ../../whatsnew/3.9.rst:1383 msgid "" "The vectorcall protocol now requires that the caller passes only strings as " "keyword names. (See :issue:`37540` for more information.)" msgstr "" -#: ../../whatsnew/3.9.rst:1387 +#: ../../whatsnew/3.9.rst:1386 msgid "" "Implementation details of a number of macros and functions are now hidden:" msgstr "" -#: ../../whatsnew/3.9.rst:1389 +#: ../../whatsnew/3.9.rst:1388 msgid ":c:func:`PyObject_IS_GC` macro was converted to a function." msgstr "" -#: ../../whatsnew/3.9.rst:1391 +#: ../../whatsnew/3.9.rst:1390 msgid "" "The :c:func:`PyObject_NEW` macro becomes an alias to the :c:macro:" "`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an " @@ -1999,38 +1996,38 @@ msgid "" "directly the :c:member:`PyTypeObject.tp_basicsize` member." msgstr "" -#: ../../whatsnew/3.9.rst:1396 +#: ../../whatsnew/3.9.rst:1395 msgid "" ":c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " "the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " "member." msgstr "" -#: ../../whatsnew/3.9.rst:1400 +#: ../../whatsnew/3.9.rst:1399 msgid "" ":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " "accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." msgstr "" -#: ../../whatsnew/3.9.rst:1403 +#: ../../whatsnew/3.9.rst:1402 msgid "" ":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " "implementation details: removed the ``PyIndex_Check()`` macro. The macro " "accessed directly the :c:member:`PyTypeObject.tp_as_number` member." msgstr "" -#: ../../whatsnew/3.9.rst:1407 +#: ../../whatsnew/3.9.rst:1406 msgid "(See :issue:`40170` for more details.)" msgstr "(更多資訊請見 :issue:`40170`\\ 。)" -#: ../../whatsnew/3.9.rst:1412 +#: ../../whatsnew/3.9.rst:1411 msgid "" "Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1416 +#: ../../whatsnew/3.9.rst:1415 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2038,89 +2035,89 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1422 msgid "Excluded the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1424 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1427 +#: ../../whatsnew/3.9.rst:1426 msgid "``_Py_CheckRecursionLimit``" msgstr "``_Py_CheckRecursionLimit``" -#: ../../whatsnew/3.9.rst:1428 +#: ../../whatsnew/3.9.rst:1427 msgid "``_Py_NewReference()``" msgstr "``_Py_NewReference()``" -#: ../../whatsnew/3.9.rst:1429 +#: ../../whatsnew/3.9.rst:1428 msgid "``_Py_ForgetReference()``" msgstr "``_Py_ForgetReference()``" -#: ../../whatsnew/3.9.rst:1430 +#: ../../whatsnew/3.9.rst:1429 msgid "``_PyTraceMalloc_NewReference()``" msgstr "``_PyTraceMalloc_NewReference()``" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1430 msgid "``_Py_GetRefTotal()``" msgstr "``_Py_GetRefTotal()``" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1431 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1432 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "``PyTrash_UNWIND_LEVEL``" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1433 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "``Py_TRASHCAN_BEGIN_CONDITION``" -#: ../../whatsnew/3.9.rst:1435 +#: ../../whatsnew/3.9.rst:1434 msgid "``Py_TRASHCAN_BEGIN``" msgstr "``Py_TRASHCAN_BEGIN``" -#: ../../whatsnew/3.9.rst:1436 +#: ../../whatsnew/3.9.rst:1435 msgid "``Py_TRASHCAN_END``" msgstr "``Py_TRASHCAN_END``" -#: ../../whatsnew/3.9.rst:1437 +#: ../../whatsnew/3.9.rst:1436 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "``Py_TRASHCAN_SAFE_BEGIN``" -#: ../../whatsnew/3.9.rst:1438 +#: ../../whatsnew/3.9.rst:1437 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "``Py_TRASHCAN_SAFE_END``" -#: ../../whatsnew/3.9.rst:1440 +#: ../../whatsnew/3.9.rst:1439 msgid "Moved following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1442 +#: ../../whatsnew/3.9.rst:1441 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "``_PyDebug_PrintTotalRefs()``" -#: ../../whatsnew/3.9.rst:1443 +#: ../../whatsnew/3.9.rst:1442 msgid "``_Py_PrintReferences()``" msgstr "``_Py_PrintReferences()``" -#: ../../whatsnew/3.9.rst:1444 +#: ../../whatsnew/3.9.rst:1443 msgid "``_Py_PrintReferenceAddresses()``" msgstr "``_Py_PrintReferenceAddresses()``" -#: ../../whatsnew/3.9.rst:1445 +#: ../../whatsnew/3.9.rst:1444 msgid "``_Py_tracemalloc_config``" msgstr "``_Py_tracemalloc_config``" -#: ../../whatsnew/3.9.rst:1446 +#: ../../whatsnew/3.9.rst:1445 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1450 +#: ../../whatsnew/3.9.rst:1449 msgid "" "Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " @@ -2128,72 +2125,72 @@ msgid "" "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1455 +#: ../../whatsnew/3.9.rst:1454 msgid "" "Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1460 +#: ../../whatsnew/3.9.rst:1459 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "``PyAsyncGen_ClearFreeLists()``" -#: ../../whatsnew/3.9.rst:1461 +#: ../../whatsnew/3.9.rst:1460 msgid "``PyContext_ClearFreeList()``" msgstr "``PyContext_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1462 +#: ../../whatsnew/3.9.rst:1461 msgid "``PyDict_ClearFreeList()``" msgstr "``PyDict_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1463 +#: ../../whatsnew/3.9.rst:1462 msgid "``PyFloat_ClearFreeList()``" msgstr "``PyFloat_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1464 +#: ../../whatsnew/3.9.rst:1463 msgid "``PyFrame_ClearFreeList()``" msgstr "``PyFrame_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1465 +#: ../../whatsnew/3.9.rst:1464 msgid "``PyList_ClearFreeList()``" msgstr "``PyList_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1466 +#: ../../whatsnew/3.9.rst:1465 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1468 +#: ../../whatsnew/3.9.rst:1467 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1470 +#: ../../whatsnew/3.9.rst:1469 msgid "``PyTuple_ClearFreeList()``" msgstr "``PyTuple_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1471 +#: ../../whatsnew/3.9.rst:1470 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1474 +#: ../../whatsnew/3.9.rst:1473 msgid "" "Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1477 +#: ../../whatsnew/3.9.rst:1476 msgid "" "Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1482 +#: ../../whatsnew/3.9.rst:1481 msgid "" "Cleaned header files of interfaces defined but with no implementation. The " "public API symbols being removed are: " @@ -2206,26 +2203,26 @@ msgid "" "`39372`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1493 +#: ../../whatsnew/3.9.rst:1492 msgid "Notable changes in Python 3.9.1" msgstr "" -#: ../../whatsnew/3.9.rst:1498 +#: ../../whatsnew/3.9.rst:1497 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." msgstr "" -#: ../../whatsnew/3.9.rst:1501 +#: ../../whatsnew/3.9.rst:1500 msgid "``Literal`` now de-duplicates parameters." msgstr "" -#: ../../whatsnew/3.9.rst:1502 +#: ../../whatsnew/3.9.rst:1501 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "" -#: ../../whatsnew/3.9.rst:1503 +#: ../../whatsnew/3.9.rst:1502 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2233,7 +2230,7 @@ msgid "" "differentiating types." msgstr "" -#: ../../whatsnew/3.9.rst:1507 +#: ../../whatsnew/3.9.rst:1506 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2241,15 +2238,15 @@ msgid "" "error::" msgstr "" -#: ../../whatsnew/3.9.rst:1519 +#: ../../whatsnew/3.9.rst:1518 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1522 +#: ../../whatsnew/3.9.rst:1521 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" msgstr "" -#: ../../whatsnew/3.9.rst:1524 +#: ../../whatsnew/3.9.rst:1523 msgid "" "As of 3.9.1, Python now fully supports building and running on macOS 11.0 " "(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " @@ -2261,19 +2258,19 @@ msgid "" "version in use at runtime (\"weaklinking\")." msgstr "" -#: ../../whatsnew/3.9.rst:1533 +#: ../../whatsnew/3.9.rst:1532 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1536 +#: ../../whatsnew/3.9.rst:1535 msgid "Notable changes in Python 3.9.2" msgstr "" -#: ../../whatsnew/3.9.rst:1539 +#: ../../whatsnew/3.9.rst:1538 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.9.rst:1541 +#: ../../whatsnew/3.9.rst:1540 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2289,11 +2286,11 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1555 +#: ../../whatsnew/3.9.rst:1554 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.9.rst:1557 +#: ../../whatsnew/3.9.rst:1556 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -2304,15 +2301,3 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" - -#~ msgid "Release" -#~ msgstr "發行版本" - -#~ msgid "|release|" -#~ msgstr "|release|" - -#~ msgid "Date" -#~ msgstr "日期" - -#~ msgid "|today|" -#~ msgstr "|today|" From b4c1a8f108d07013488186464040943095c2c3d7 Mon Sep 17 00:00:00 2001 From: idkidkidkidkidkidkidkidk <57472359+idkidkidkidkidkidkidkidk@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:09:07 +0800 Subject: [PATCH 080/105] Translate rst:375 --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..f9815e9c69 100644 --- a/library/string.po +++ b/library/string.po @@ -469,7 +469,7 @@ msgstr "``'+'``" msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." -msgstr "" +msgstr "表示正數與負數均需使用符號。" #: ../../library/string.rst:378 msgid "``'-'``" From cb329130366735d1400913019af4dcb6dc573157 Mon Sep 17 00:00:00 2001 From: robinsonweng Date: Sun, 22 Oct 2023 11:14:15 +0800 Subject: [PATCH 081/105] translate library/string.po:rst:54 --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..ceea9a4d06 100644 --- a/library/string.po +++ b/library/string.po @@ -71,7 +71,7 @@ msgstr "" #: ../../library/string.rst:54 msgid "The string ``'01234567'``." -msgstr "" +msgstr "字串 ``'01234567'``。" #: ../../library/string.rst:59 msgid "" From c51ce38f8f9bc18208ac8fb009949858a9db1df1 Mon Sep 17 00:00:00 2001 From: calvin0310 Date: Sun, 22 Oct 2023 11:20:00 +0800 Subject: [PATCH 082/105] Translate rst:381 --- library/string.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..078c9caa14 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2018-05-23 16:11+0000\n" +"PO-Revision-Date: 2023-10-22 11:04+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.4\n" #: ../../library/string.rst:2 msgid ":mod:`string` --- Common string operations" @@ -489,7 +490,7 @@ msgstr "" msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." -msgstr "" +msgstr "表示正數應使用前導空格,負數應使用減號。" #: ../../library/string.rst:388 msgid "" From 4e9385a8be37fc2877a07cd4fe808ad5d8b4c713 Mon Sep 17 00:00:00 2001 From: HannahLo Date: Sun, 22 Oct 2023 12:10:36 +0800 Subject: [PATCH 083/105] Translate library/string.po rst:901 (#672) * translate rst:901 * word adjustment for template * fix translate of class --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 1be9264fb9..1a590d5a97 100644 --- a/library/string.po +++ b/library/string.po @@ -1105,7 +1105,7 @@ msgstr "" msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." -msgstr "" +msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:`ValueError`。" #: ../../library/string.rst:906 msgid "Helper functions" From 1dff59bdc1c4f7c883358ac8c7b08703ccc3b3a2 Mon Sep 17 00:00:00 2001 From: swchen1282 Date: Sun, 22 Oct 2023 14:02:02 +0800 Subject: [PATCH 084/105] working on string (rst187) (#680) --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 1a590d5a97..d2e52f1513 100644 --- a/library/string.po +++ b/library/string.po @@ -230,7 +230,7 @@ msgstr "" #: ../../library/string.rst:187 msgid "Format String Syntax" -msgstr "" +msgstr "格式化文字語法" #: ../../library/string.rst:189 msgid "" From 576b7ae1d6f7810de4839e8f11f78d7151d12b7f Mon Sep 17 00:00:00 2001 From: RitaLi117 <40754918+RitaLi117@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:02:27 +0800 Subject: [PATCH 085/105] Translate rst:21 (#678) Co-authored-by: Tsai Ying Li Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index d2e52f1513..c04cfb15fd 100644 --- a/library/string.po +++ b/library/string.po @@ -41,7 +41,7 @@ msgstr "" #: ../../library/string.rst:21 msgid "The constants defined in this module are:" -msgstr "" +msgstr "此模組中定義的常數為:" #: ../../library/string.rst:26 msgid "" From 36c3540ac020bfff6cc0297832681012041f728a Mon Sep 17 00:00:00 2001 From: Vina Chang Date: Sun, 22 Oct 2023 14:03:20 +0800 Subject: [PATCH 086/105] translate library/string.rst:478 & 481 (#675) * translate library/string.rst:478 & 481 * add space between chinese character and english character * Update library/string.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index c04cfb15fd..0b9e2cbfbb 100644 --- a/library/string.po +++ b/library/string.po @@ -648,7 +648,7 @@ msgstr "``'x'``" msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." -msgstr "" +msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" #: ../../library/string.rst:481 msgid "``'X'``" @@ -660,6 +660,8 @@ msgid "" "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " "upper-cased to ``'0X'`` as well." msgstr "" +"十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了" +"``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" #: ../../library/string.rst:486 ../../library/string.rst:570 msgid "``'n'``" From 49ed1684b6a9da7d6c473695ce124396f4697583 Mon Sep 17 00:00:00 2001 From: jason zheng <101104044@nccu.edu.tw> Date: Sun, 22 Oct 2023 14:05:24 +0800 Subject: [PATCH 087/105] Translate library/string rst:815 (#670) * Translate library/string rst:815 * Translate library/string rst:815 --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 0b9e2cbfbb..58167517ec 100644 --- a/library/string.po +++ b/library/string.po @@ -1002,7 +1002,7 @@ msgstr "" #: ../../library/string.rst:815 msgid ":class:`Template` instances also provide one public data attribute:" -msgstr "" +msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" #: ../../library/string.rst:819 msgid "" From a8db361d31df1591828c5018635348a016c5f2cd Mon Sep 17 00:00:00 2001 From: 0gien <147908325+0gien@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:05:51 +0800 Subject: [PATCH 088/105] Working on String. (#679) Co-authored-by: Zoe Huang Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 58167517ec..2553de93b8 100644 --- a/library/string.po +++ b/library/string.po @@ -460,7 +460,7 @@ msgstr "" msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" -msgstr "" +msgstr "*sign* 選項只適用於數字型別,並可為以下之一:" #: ../../library/string.rst:375 msgid "``'+'``" From 9fc86cfa67f45d8c2eba7b1f131bcb2a7022d857 Mon Sep 17 00:00:00 2001 From: mar120434 <38751052+mar120434@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:07:03 +0800 Subject: [PATCH 089/105] translate ./library/string.po rst:906 (#676) Co-authored-by: Josix --- library/string.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index 2553de93b8..9b48a0bba4 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-10-22 11:04+0800\n" +"PO-Revision-Date: 2023-10-22 11:42+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1111,7 +1111,7 @@ msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的 #: ../../library/string.rst:906 msgid "Helper functions" -msgstr "" +msgstr "輔助函式" #: ../../library/string.rst:910 msgid "" From ff93069f7f025f24fa52a437126fb66a76ca5349 Mon Sep 17 00:00:00 2001 From: Satty Date: Sun, 22 Oct 2023 14:07:33 +0800 Subject: [PATCH 090/105] Translate library/string.po rst:32 (#674) * [update] library/string.po rst:32 * update format * Update library/string.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Wei-Hsiang (Matt) Wang Co-authored-by: Josix --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 9b48a0bba4..928ee822a2 100644 --- a/library/string.po +++ b/library/string.po @@ -54,7 +54,7 @@ msgstr "" msgid "" "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " "locale-dependent and will not change." -msgstr "" +msgstr "小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" #: ../../library/string.rst:38 msgid "" From 1aa0d889d350c4d9c2111360e85122951ee83492 Mon Sep 17 00:00:00 2001 From: holisHsu <52438637+holisHsu@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:08:58 +0800 Subject: [PATCH 091/105] Translate rst:296, 298 (#668) --- library/string.po | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 928ee822a2..edd09d174a 100644 --- a/library/string.po +++ b/library/string.po @@ -355,7 +355,7 @@ msgstr "範例請見 :ref:`formatexamples`\\ 。" #: ../../library/string.rst:296 msgid "Format Specification Mini-Language" -msgstr "" +msgstr "格式規格 (Format Specification) 迷你語言" #: ../../library/string.rst:298 msgid "" @@ -365,6 +365,10 @@ msgid "" "to the built-in :func:`format` function. Each formattable type may define " "how the format specification is to be interpreted." msgstr "" +"“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" +"何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" +"傳遞給內建的 :fun:`format` 函式。每個可格式化型別 (formattable type) 可以定義" +"格式規格如何被直譯。" #: ../../library/string.rst:305 msgid "" From 149fc0ba0cf0ffe52af3c0995ce3bccf86a0e018 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sun, 22 Oct 2023 14:17:41 +0800 Subject: [PATCH 092/105] fix(library/string): typo --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index edd09d174a..8855b9722e 100644 --- a/library/string.po +++ b/library/string.po @@ -367,7 +367,7 @@ msgid "" msgstr "" "“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" -"傳遞給內建的 :fun:`format` 函式。每個可格式化型別 (formattable type) 可以定義" +"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定義" "格式規格如何被直譯。" #: ../../library/string.rst:305 From a4719a1e1605163e886fad5c3783bdac250f0db9 Mon Sep 17 00:00:00 2001 From: Song-Lin Tsai <55531306+Bradley-Tsai@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:57:23 +0800 Subject: [PATCH 093/105] Translate library/string.po rst, 2, 19, 26 (#677) * translate: rst: 2, 19, 26 * fix: change some terms * fix: change the translation of constant * Apply suggestions from code review --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index 8855b9722e..4f144dbb77 100644 --- a/library/string.po +++ b/library/string.po @@ -21,7 +21,7 @@ msgstr "" #: ../../library/string.rst:2 msgid ":mod:`string` --- Common string operations" -msgstr "" +msgstr ":mod:`string` --- 常見的字串操作" #: ../../library/string.rst:7 msgid "**Source code:** :source:`Lib/string.py`" @@ -37,7 +37,7 @@ msgstr ":ref:`string-methods`" #: ../../library/string.rst:19 msgid "String constants" -msgstr "" +msgstr "字串常數" #: ../../library/string.rst:21 msgid "The constants defined in this module are:" @@ -49,6 +49,7 @@ msgid "" "`ascii_uppercase` constants described below. This value is not locale-" "dependent." msgstr "" +"下文描述的 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常數的串接,該值不依賴於區域設定。" #: ../../library/string.rst:32 msgid "" From f24fd11929f41176367f42559c62b808e7468b2d Mon Sep 17 00:00:00 2001 From: Sylvia <137799667+sylviachangtw@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:56:24 +0800 Subject: [PATCH 094/105] translate rst:373 (#688) --- library/string.po | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/library/string.po b/library/string.po index 4f144dbb77..879d07e95a 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-10-22 11:42+0800\n" +"PO-Revision-Date: 2023-10-22 20:52+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -55,7 +55,8 @@ msgstr "" msgid "" "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " "locale-dependent and will not change." -msgstr "小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" +msgstr "" +"小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" #: ../../library/string.rst:38 msgid "" @@ -368,8 +369,8 @@ msgid "" msgstr "" "“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" -"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定義" -"格式規格如何被直譯。" +"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定" +"義格式規格如何被直譯。" #: ../../library/string.rst:305 msgid "" @@ -406,7 +407,7 @@ msgstr "" #: ../../library/string.rst:342 ../../library/string.rst:373 msgid "Option" -msgstr "" +msgstr "選項" #: ../../library/string.rst:342 ../../library/string.rst:373 #: ../../library/string.rst:456 ../../library/string.rst:467 @@ -1112,7 +1113,9 @@ msgstr "" msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." -msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:`ValueError`。" +msgstr "" +"當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:" +"`ValueError`。" #: ../../library/string.rst:906 msgid "Helper functions" From 2b560a6a05f93093fb54268418c2ad27f39f2931 Mon Sep 17 00:00:00 2001 From: Becca <61359625+Tzu-Han5667@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:57:28 +0800 Subject: [PATCH 095/105] Translate library/string.po rst:117 (#687) * 1022_meetup_library/string_rst117 * rst:117 v2 * rst:117 v3 --- library/string.po | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/string.po b/library/string.po index 879d07e95a..2b92fee6ae 100644 --- a/library/string.po +++ b/library/string.po @@ -150,6 +150,10 @@ msgid "" "by :meth:`vformat` to break the string into either literal text, or " "replacement fields." msgstr "" +"將 format_string 放入迴圈,並回傳一個可疊代物件,其元素為 " +"(*literal_text*, *field_name*, *format_spec*, *conversion*)。這會被" +" :meth:`vformat` 用於將字串裁切為字面文本或" +"替換欄位。" #: ../../library/string.rst:122 msgid "" From 7355970edb3bc44a3df37bbbdbec1e19d15c8a2c Mon Sep 17 00:00:00 2001 From: robinsonweng Date: Fri, 27 Oct 2023 13:58:37 +0900 Subject: [PATCH 096/105] Translate /libary/asyncio-runner.po from rst:6 to rst:13 (#685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translate /libary/asyncio-runner from rst:6 to rst:13, #683 * fix: Add the missing word '場景' * fix: Change Simplfiy Chinese word to Traditional Chinese & escape space for rst syntax in rst:13 * fix: Update translation for 'primitives' * fix: Note source 'Runners' * fix: Patch missing text --- library/asyncio-runner.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 682cea2052..3cb6c222b4 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -19,7 +19,7 @@ msgstr "" #: ../../library/asyncio-runner.rst:6 msgid "Runners" -msgstr "" +msgstr "Runners (執行器)" #: ../../library/asyncio-runner.rst:8 msgid "**Source code:** :source:`Lib/asyncio/runners.py`" @@ -29,12 +29,14 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncio/runners.py`" msgid "" "This section outlines high-level asyncio primitives to run asyncio code." msgstr "" +"這個章節概述用於執行 asyncio 程式碼的高階 asyncio 原始物件。" #: ../../library/asyncio-runner.rst:13 msgid "" "They are built on top of an :ref:`event loop ` with the " "aim to simplify async code usage for common wide-spread scenarios." msgstr "" +"他們是基於一個\\ :ref:`事件迴圈 `,目的是為了簡化常見且廣泛運用場景的非同步程式碼。" #: ../../library/asyncio-runner.rst:23 msgid "Running an asyncio Program" From eaccd60ee755daee77d4fe24707c1a2ec6059bfb Mon Sep 17 00:00:00 2001 From: HannahLo Date: Fri, 27 Oct 2023 15:42:25 +0800 Subject: [PATCH 097/105] Translate library/string.po rst:736, rst:738 (#684) * Translate rst:736, rst:738 * Add space between zh and en --------- Co-authored-by: hannahlo --- library/string.po | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 2b92fee6ae..89796f864a 100644 --- a/library/string.po +++ b/library/string.po @@ -915,7 +915,7 @@ msgstr "" #: ../../library/string.rst:736 msgid "Template strings" -msgstr "" +msgstr "樣板字串" #: ../../library/string.rst:738 msgid "" @@ -926,6 +926,12 @@ msgid "" "Python. As an example of a library built on template strings for i18n, see " "the `flufl.i18n `_ package." msgstr "" +"樣板字串提供如 :pep:`292` 所述更簡單的字串替換。" +"樣板字串的主要用例是國際化 (i18n)," +"因為在這種情況下,更簡單的語法和功能使得它" +"比其他 Python 內建字串格式化工具更容易翻譯。" +"基於樣板字串建構的 i18n 函式庫範例,請參閱 " +"`flufl.i18n `_ 套件。" #: ../../library/string.rst:748 msgid "" From 9264e885bab6a90f7065401b491cdf8e95d07012 Mon Sep 17 00:00:00 2001 From: Payon Date: Sun, 5 Nov 2023 17:49:13 +0800 Subject: [PATCH 098/105] Translate library/unittest.mock.po from rst:384 to 817 (#662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mock 翻譯 from rst:384 to 492 * docs: mock 翻譯 from rst:498 to 646 * Update library/unittest.mock.po * Update library/unittest.mock.po * docs: mock 翻譯 from rst:652 to 817 * fix: 修正member翻譯為成員 * Update library/unittest.mock.po Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * Update library/unittest.mock.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> Co-authored-by: Wei-Hsiang (Matt) Wang --- library/unittest.mock.po | 129 +++++++++++++++++++++++++++++++-------- 1 file changed, 103 insertions(+), 26 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 8067ed10cc..17cf967b7f 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-09 23:07+0800\n" +"PO-Revision-Date: 2023-10-10 21:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.3.2\n" +"X-Generator: Poedit 3.4\n" #: ../../library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" @@ -253,16 +253,16 @@ msgid "" "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" ":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" -"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使" -"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" +"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使用 :" +"func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:231 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" -"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 " -"Mock 物件的行為:" +"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 Mock " +"物件的行為:" #: ../../library/unittest.mock.rst:234 msgid "" @@ -428,8 +428,8 @@ msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" -"呼叫。" +"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列" +"中的呼叫。" #: ../../library/unittest.mock.rst:365 msgid "" @@ -449,15 +449,15 @@ msgstr "" #: ../../library/unittest.mock.rst:384 msgid "Assert the mock was never called." -msgstr "" +msgstr "斷言 mock 從未被呼叫。" #: ../../library/unittest.mock.rst:399 msgid "The reset_mock method resets all the call attributes on a mock object:" -msgstr "" +msgstr "reset_mock 方法重置 mock 物件上的所有呼叫屬性:" #: ../../library/unittest.mock.rst:409 msgid "Added two keyword-only arguments to the reset_mock function." -msgstr "" +msgstr "reset_mock 函式新增了兩個僅限關鍵字引數 (keyword-only arguments)。" #: ../../library/unittest.mock.rst:412 msgid "" @@ -468,20 +468,26 @@ msgid "" "`side_effect`, then pass the corresponding parameter as ``True``. Child " "mocks and the return value mock (if any) are reset as well." msgstr "" +"這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況下,:" +"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定的" +"任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應的" +"參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" #: ../../library/unittest.mock.rst:420 msgid "*return_value*, and :attr:`side_effect` are keyword-only arguments." -msgstr "" +msgstr "*return_value* 和 :attr:`side_effect` 是僅限關鍵字引數。" #: ../../library/unittest.mock.rst:426 msgid "" "Add a spec to a mock. *spec* can either be an object or a list of strings. " "Only attributes on the *spec* can be fetched as attributes from the mock." msgstr "" +"向 mock 增加一個規格 (spec)。*spec* 可以是一個物件或一個字串串列 (list of " +"strings)。只有在 *spec* 上的屬性才能作為 mock 的屬性被取得。" #: ../../library/unittest.mock.rst:430 msgid "If *spec_set* is true then only attributes on the spec can be set." -msgstr "" +msgstr "如果 *spec_set* 為 true,那麼只能設定在規格中的屬性。" #: ../../library/unittest.mock.rst:435 msgid "" @@ -489,26 +495,32 @@ msgid "" "Calls to the attached mock will be recorded in the :attr:`method_calls` and :" "attr:`mock_calls` attributes of this one." msgstr "" +"將一個 mock 作為這個 Mock 的屬性附加,取代它的名稱和上代 (parent)。對附加的 " +"mock 的呼叫將被記錄在這個 Mock 的 :attr:`method_calls` 和 :attr:`mock_calls` " +"屬性中。" #: ../../library/unittest.mock.rst:442 msgid "Set attributes on the mock through keyword arguments." -msgstr "" +msgstr "透過關鍵字引數在 mock 上設定屬性。" #: ../../library/unittest.mock.rst:444 msgid "" "Attributes plus return values and side effects can be set on child mocks " "using standard dot notation and unpacking a dictionary in the method call:" msgstr "" +"可以在使用 method(方法)呼叫時,使用標準點記法 (dot notation) 並將字典拆開," +"為 child mock 設定屬性、回傳值和 side effects:" #: ../../library/unittest.mock.rst:458 msgid "The same thing can be achieved in the constructor call to mocks:" -msgstr "" +msgstr "同樣的事情可以在 mock 的建構函式呼叫中實現:" #: ../../library/unittest.mock.rst:471 msgid "" ":meth:`configure_mock` exists to make it easier to do configuration after " "the mock has been created." msgstr "" +":meth:`configure_mock` 的存在是為了在 mock 被建立後更容易進行組態設定。" #: ../../library/unittest.mock.rst:477 msgid "" @@ -516,12 +528,14 @@ msgid "" "results. For mocks with a *spec* this includes all the permitted attributes " "for the mock." msgstr "" +":class:`Mock` 物件限制了 ``dir(some_mock)`` 僅顯示有用的結果。對於具有 " +"*spec* 的 mock,這包含所有被允許的 mock 屬性。" #: ../../library/unittest.mock.rst:481 msgid "" "See :data:`FILTER_DIR` for what this filtering does, and how to switch it " "off." -msgstr "" +msgstr "請參閱 :data:`FILTER_DIR` 以了解這種過濾行為的作用,以及如何關閉它。" #: ../../library/unittest.mock.rst:487 msgid "" @@ -529,40 +543,44 @@ msgid "" "mocks will be the same type as the parent. Subclasses of Mock may want to " "override this to customize the way child mocks are made." msgstr "" +"建立為了得到屬性和回傳值的 child mock。預設情況下,child mock 將與其上代是相" +"同的型別。Mock 的子類別可能會想要置換此行為,以自定義 child mock 的建立方式。" #: ../../library/unittest.mock.rst:492 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." -msgstr "" +msgstr "對於不可呼叫的 mock,將使用可呼叫的變體,而不是任何的自定義子類別。" #: ../../library/unittest.mock.rst:498 msgid "A boolean representing whether or not the mock object has been called:" -msgstr "" +msgstr "一個 boolean(布林),表述 mock 物件是否已經被呼叫:" #: ../../library/unittest.mock.rst:509 msgid "An integer telling you how many times the mock object has been called:" -msgstr "" +msgstr "一個整數,告訴你 mock 物件被呼叫的次數:" #: ../../library/unittest.mock.rst:521 msgid "Set this to configure the value returned by calling the mock:" -msgstr "" +msgstr "設定此值以配置呼叫 mock 時回傳的值:" #: ../../library/unittest.mock.rst:528 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" -msgstr "" +msgstr "預設的回傳值是一個 mock 物件,你也可以按照正常的方式配置它:" #: ../../library/unittest.mock.rst:537 msgid ":attr:`return_value` can also be set in the constructor:" -msgstr "" +msgstr ":attr:`return_value` 也可以在建構函式中設定:" #: ../../library/unittest.mock.rst:548 msgid "" "This can either be a function to be called when the mock is called, an " "iterable or an exception (class or instance) to be raised." msgstr "" +"這可以是一個在呼叫 mock 時要呼叫的函式、一個可疊代物件,或者要引發的例外(類" +"別或實例)。" #: ../../library/unittest.mock.rst:551 msgid "" @@ -572,6 +590,10 @@ msgid "" "returns :data:`DEFAULT` then the mock will return its normal value (from " "the :attr:`return_value`)." msgstr "" +"如果你傳遞一個函式,它將被呼叫,其引數與 mock 相同,且除非該函式回傳 :data:" +"`DEFAULT` 單例 (singleton),否則對 mock 的呼叫將回傳函式回傳的任何值。如果函" +"式回傳 :data:`DEFAULT`,那麼 mock 將回傳其正常的回傳值(從 :attr:" +"`return_value` 得到)。" #: ../../library/unittest.mock.rst:557 msgid "" @@ -580,30 +602,35 @@ msgid "" "to be raised, or a value to be returned from the call to the mock (:data:" "`DEFAULT` handling is identical to the function case)." msgstr "" +"如果你傳遞一個可疊代物件,它將被用於檢索一個疊代器,該疊代器必須在每次呼叫時" +"產出 (yield) 一個值。這個值可以是要引發的例外實例,或者是對 mock 呼叫時要回傳" +"的值(處理 :data:`DEFAULT` 的方式與函式的狀況相同)。" #: ../../library/unittest.mock.rst:562 msgid "" "An example of a mock that raises an exception (to test exception handling of " "an API):" -msgstr "" +msgstr "以下是一個引發例外的 mock 的範例(用於測試 API 的例外處理):" #: ../../library/unittest.mock.rst:572 msgid "Using :attr:`side_effect` to return a sequence of values:" -msgstr "" +msgstr "使用 :attr:`side_effect` 回傳一連串值的範例:" #: ../../library/unittest.mock.rst:579 msgid "Using a callable:" -msgstr "" +msgstr "使用可被呼叫物件的範例:" #: ../../library/unittest.mock.rst:589 msgid "" ":attr:`side_effect` can be set in the constructor. Here's an example that " "adds one to the value the mock is called with and returns it:" msgstr "" +":attr:`side_effect` 可以在建構函式中設定。以下是一個範例,它將 mock 被呼叫時" +"給的值加一並回傳:" #: ../../library/unittest.mock.rst:599 msgid "Setting :attr:`side_effect` to ``None`` clears it:" -msgstr "" +msgstr "將 :attr:`side_effect` 設定為 ``None`` 可以清除它:" #: ../../library/unittest.mock.rst:613 msgid "" @@ -614,6 +641,10 @@ msgid "" "second member, which can also be accessed through the ``kwargs`` property, " "is any keyword arguments (or an empty dictionary)." msgstr "" +"這會是 ``None``(如果 mock 尚未被呼叫),或是 mock 上次被呼叫時使用的引數。這" +"將以元組的形式呈現:第一個成員 (member),其可以通過 ``args`` 屬性訪問,是 " +"mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " +"``kwargs`` 屬性訪問,是所有關鍵字引數(或一個空字典)。" #: ../../library/unittest.mock.rst:646 msgid "" @@ -622,6 +653,10 @@ msgid "" "are tuples, so they can be unpacked to get at the individual arguments and " "make more complex assertions. See :ref:`calls as tuples `." msgstr "" +":attr:`call_args`,以及串列 :attr:`call_args_list`、:attr:`method_calls` 和 :" +"attr:`mock_calls` 的成員都是 :data:`call` 物件。這些都是元組,因此可以解包以" +"獲取各個引數並進行更複雜的斷言。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:652 msgid "Added ``args`` and ``kwargs`` properties." @@ -635,6 +670,9 @@ msgid "" "used for conveniently constructing lists of calls to compare with :attr:" "`call_args_list`." msgstr "" +"這是按順序列出所有呼叫 mock 物件的串列(因此串列的長度表示它被呼叫的次數)。" +"在任何呼叫發生之前,它會是一個空的串列。 :data:`call` 物件可用於方便地建構呼" +"叫的串列,以便與 :attr:`call_args_list` 進行比較。" #: ../../library/unittest.mock.rst:674 msgid "" @@ -642,12 +680,16 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`call_args_list` 的成員都是 :data:`call` 物件。這些物件可以被拆包為元" +"組,以取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:681 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" +"除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼降,以及*它們(這些方" +"法和屬性)*的方法和屬性:" #: ../../library/unittest.mock.rst:692 msgid "" @@ -655,12 +697,16 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" +"取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:699 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." msgstr "" +":attr:`mock_calls` 記錄了 *所有* 對 mock 物件的呼叫,包含其方法、魔術方法以及" +"回傳值 mock。" #: ../../library/unittest.mock.rst:717 msgid "" @@ -668,6 +714,8 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" +"取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:723 msgid "" @@ -675,6 +723,8 @@ msgid "" "made, the parameters of ancestor calls are not recorded and so will always " "compare equal:" msgstr "" +":attr:`mock_calls` 記錄的方式意味著在進行嵌套呼叫時,上代 (ancestor) 呼叫的參" +"數不會被記錄,因此在比較時它們將始終相等:" #: ../../library/unittest.mock.rst:737 msgid "" @@ -683,12 +733,17 @@ msgid "" "instead. This allows mock objects to pass :func:`isinstance` tests for the " "object they are replacing / masquerading as:" msgstr "" +"通常,物件的 :attr:`__class__` 屬性會回傳它的型別。但對於擁有 :attr:`spec` " +"的 mock 物件,``__class__`` 會回傳 spec 的類別。這允許 mock 物件通過對它們所" +"替代或偽裝的物件進行的 :func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:746 msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" +":attr:`__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" +"需要強制使用 spec:" #: ../../library/unittest.mock.rst:756 msgid "" @@ -696,18 +751,24 @@ msgid "" "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" +":class:`Mock` 的一個不可呼叫版本。建構函式參數的意義與 :class:`Mock` 相同,其" +"例外為 *return_value* 和 *side_effect* 在不可呼叫的 mock 上無意義。" #: ../../library/unittest.mock.rst:760 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" +"使用類別或實例作為 :attr:`spec` 或 :attr:`spec_set` 的 mock 物件能夠通過 :" +"func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:770 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" +":class:`Mock` 類別支援 mock 魔術方法。細節請參考\\ :ref:`魔術方法 `。" #: ../../library/unittest.mock.rst:773 msgid "" @@ -716,6 +777,9 @@ msgid "" "are passed to the constructor of the mock being created. The keyword " "arguments are for configuring attributes of the mock:" msgstr "" +"Mock類別和 :func:`patch` 裝飾器於組態時接受任意的關鍵字引數。對於 :func:" +"`patch` 裝飾器,這些關鍵字會傳遞給正在建立 mock 的建構函式。這些關鍵字引數用" +"於配置 mock 的屬性:" #: ../../library/unittest.mock.rst:784 msgid "" @@ -723,6 +787,8 @@ msgid "" "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" +"Child mock 的回傳值和 side effect 可以使用使用點記法進行設置。由於你無法直接" +"在呼叫中使用帶有點 (.) 的名稱,因此你必須建立一個字典並使用 ``**`` 解包:" #: ../../library/unittest.mock.rst:799 msgid "" @@ -731,6 +797,11 @@ msgid "" "mock. Therefore, it can match the actual call's arguments regardless of " "whether they were passed positionally or by name::" msgstr "" +"在匹配對 mock 的呼叫時,使用 *spec*(或 *spec_set*)建立的可呼叫 mock 將會內" +"省規格物件的簽名 (signature)。因此,它可以匹配實際呼叫的引數,無論它們是按位" +"置傳遞還是按名稱傳遞:\n" +"\n" +"::" #: ../../library/unittest.mock.rst:812 msgid "" @@ -739,10 +810,16 @@ msgid "" "assert_any_call`. When :ref:`auto-speccing`, it will also apply to method " "calls on the mock object." msgstr "" +"這適用於 :meth:`~Mock.assert_called_with`、:meth:`~Mock." +"assert_called_once_with`、:meth:`~Mock.assert_has_calls` 和 :meth:`~Mock." +"assert_any_call`。在使用 :ref:`auto-speccing` ,它還適用於 mock 物件的方法呼" +"叫。" #: ../../library/unittest.mock.rst:817 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" +"對於已經設置了規格(spec)和自動規格(autospec)的 mock 物件,新增簽名內省功" +"能。" #: ../../library/unittest.mock.rst:823 msgid "" From 3fa37c2f995768c283582dcb7369ccd896642943 Mon Sep 17 00:00:00 2001 From: mindihx Date: Sun, 5 Nov 2023 18:00:36 +0800 Subject: [PATCH 099/105] Translate library/enum part 2/2 (#652) --- library/enum.po | 181 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 130 insertions(+), 51 deletions(-) diff --git a/library/enum.po b/library/enum.po index 74ea042065..b6f514ad6a 100644 --- a/library/enum.po +++ b/library/enum.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-23 00:03+0000\n" -"PO-Revision-Date: 2023-09-04 13:48+0800\n" +"PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -412,7 +412,7 @@ msgstr "boundary" #: ../../library/enum.rst:192 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "在位元操作時怎麼處理不在範圍內的值(只有 :class:`Flag` 會用到)" +msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會用到)" #: ../../library/enum.rst:196 msgid "Returns ``True`` if member belongs to the ``cls``::" @@ -481,7 +481,7 @@ msgid "" "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" "成員的值可以是任何值::class:`int`、:class:`str` 等等。如果實際使用什麼值並不" -"重要,你可以使用 :class:`auto` 實例,它會為你選擇適合的值。更多細節請參考 :" +"重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" #: ../../library/enum.rst:276 @@ -560,24 +560,30 @@ msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" +"回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" +"覆寫: ::" #: ../../library/enum.rst:370 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" +"回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" +"寫: ::" #: ../../library/enum.rst:385 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" +"回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" +"傳值,但可以被覆寫: ::" #: ../../library/enum.rst:400 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." -msgstr "" +msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" #: ../../library/enum.rst:403 msgid "Added :ref:`enum-dataclass-support`" @@ -590,12 +596,14 @@ msgid "" "performed with an *IntEnum* member, the resulting value loses its " "enumeration status." msgstr "" +"*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" +"方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" #: ../../library/enum.rst:429 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." -msgstr "" +msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" #: ../../library/enum.rst:432 msgid "" @@ -603,6 +611,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" #: ../../library/enum.rst:439 msgid "" @@ -611,6 +622,8 @@ msgid "" "any string operation performed on or with a *StrEnum* member is not part of " "the enumeration." msgstr "" +"*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" +"地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" #: ../../library/enum.rst:445 msgid "" @@ -619,12 +632,15 @@ msgid "" "``isinstance(unknown, str)``), and in those locations you will need to use " "``str(StrEnum.member)``." msgstr "" +"stdlib 裡有些地方會檢查只能是 :class:`str` 而不是 :class:`str` 的子類別(也就" +"是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" +"你需要使用 ``str(StrEnum.member)``。" #: ../../library/enum.rst:452 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." -msgstr "" +msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" #: ../../library/enum.rst:457 msgid "" @@ -632,6 +648,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" #: ../../library/enum.rst:465 msgid "" @@ -639,94 +658,101 @@ msgid "" "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" +"*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " +"(*INVERT*);這些操作的結果會是列舉成員。" #: ../../library/enum.rst:471 msgid "Returns *True* if value is in self::" -msgstr "" +msgstr "如果 value 在 self 裡則回傳 *True*: ::" #: ../../library/enum.rst:492 msgid "Returns all contained non-alias members::" -msgstr "" +msgstr "回傳所有包含的非別名成員: ::" #: ../../library/enum.rst:501 msgid "Aliases are no longer returned during iteration." -msgstr "" +msgstr "疊代時不會再回傳別名。" #: ../../library/enum.rst:505 msgid "Returns number of members in flag::" -msgstr "" +msgstr "回傳旗標裡的成員數量: ::" #: ../../library/enum.rst:514 msgid "Returns *True* if any members in flag, *False* otherwise::" -msgstr "" +msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" #: ../../library/enum.rst:526 msgid "Returns current flag binary or'ed with other::" -msgstr "" +msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" #: ../../library/enum.rst:533 msgid "Returns current flag binary and'ed with other::" -msgstr "" +msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" #: ../../library/enum.rst:542 msgid "Returns current flag binary xor'ed with other::" -msgstr "" +msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" #: ../../library/enum.rst:551 msgid "Returns all the flags in *type(self)* that are not in self::" -msgstr "" +msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" #: ../../library/enum.rst:562 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" +"用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " +"和 :func:`oct`。" #: ../../library/enum.rst:567 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." -msgstr "" +msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" #: ../../library/enum.rst:570 msgid "The *repr()* of zero-valued flags has changed. It is now::" -msgstr "" +msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" #: ../../library/enum.rst:578 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" +"*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" +"方。" #: ../../library/enum.rst:592 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" -msgstr "" +msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" #: ../../library/enum.rst:598 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" -msgstr "" +msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" #: ../../library/enum.rst:600 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" -msgstr "" +msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" #: ../../library/enum.rst:601 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" -msgstr "" +msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" #: ../../library/enum.rst:603 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" -msgstr "" +msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" #: ../../library/enum.rst:610 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" +":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" #: ../../library/enum.rst:615 msgid "" @@ -734,6 +760,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" #: ../../library/enum.rst:619 msgid "" @@ -741,20 +770,24 @@ msgid "" "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" +":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" +"旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" #: ../../library/enum.rst:625 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" +":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" +"用混合資料類型的 :class:`str() `:" #: ../../library/enum.rst:628 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" -msgstr "" +msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" #: ../../library/enum.rst:629 msgid ":meth:`!str.__str__` for :class:`StrEnum`" -msgstr "" +msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" #: ../../library/enum.rst:631 msgid "" @@ -762,72 +795,82 @@ msgid "" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" +"繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" +"`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" #: ../../library/enum.rst:640 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" +"*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" +"制會產生 :exc:`ValueError`。" #: ../../library/enum.rst:645 msgid "Ensure that each value has only one name::" -msgstr "" +msgstr "確保每個值只有一個名稱: ::" #: ../../library/enum.rst:661 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" -msgstr "" +msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" #: ../../library/enum.rst:676 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" +"確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " +"產生時是很實用的: ::" #: ../../library/enum.rst:693 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." -msgstr "" +msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" #: ../../library/enum.rst:699 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." -msgstr "" +msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" #: ../../library/enum.rst:704 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" -msgstr "" +msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" #: ../../library/enum.rst:722 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" -msgstr "" +msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" #: ../../library/enum.rst:736 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." -msgstr "" +msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" #: ../../library/enum.rst:749 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" +"範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" +"為: ::" #: ../../library/enum.rst:766 msgid "Supported ``__dunder__`` names" -msgstr "" +msgstr "支援 ``__dunder__`` 名稱" #: ../../library/enum.rst:768 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" +":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" +"對映。只有在類別上可用。" #: ../../library/enum.rst:771 msgid "" @@ -835,25 +878,28 @@ msgid "" "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" +"如果指定了 :meth:`~object.__new__`,它必須建立並回傳列舉成員;適當地設定成員" +"的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" +"到。" #: ../../library/enum.rst:777 msgid "Supported ``_sunder_`` names" -msgstr "" +msgstr "支援 ``_sunder_`` 名稱" #: ../../library/enum.rst:779 msgid "``_name_`` -- name of the member" -msgstr "" +msgstr "``_name_`` -- 成員名稱" #: ../../library/enum.rst:780 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" -msgstr "" +msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" #: ../../library/enum.rst:782 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" -msgstr "" +msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" #: ../../library/enum.rst:784 msgid "" @@ -861,30 +907,37 @@ msgid "" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" +"``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" +"成成員,且在最後的類別上會被移除" #: ../../library/enum.rst:787 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" +"``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" +"別建立時移除)" #: ../../library/enum.rst:789 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" -msgstr "" +msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" #: ../../library/enum.rst:794 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" +"對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" #: ../../library/enum.rst:797 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" +"對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" +"一個看見的值是什麼。" #: ../../library/enum.rst:800 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" @@ -896,7 +949,7 @@ msgstr "``_ignore_``" #: ../../library/enum.rst:806 msgid "Utilities and Decorators" -msgstr "" +msgstr "通用項目與裝飾器" #: ../../library/enum.rst:810 msgid "" @@ -908,43 +961,51 @@ msgid "" "version of the member's name. Care must be taken if mixing *auto()* with " "manually specified values." msgstr "" +"*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 *Enum* 的 :meth:" +"`~Enum._generate_next_value_` 來取得合適的值。對 *Enum* 和 *IntEnum* 來說,合" +"適的值是最後一個值加一;對 *Flag* 和 *IntFlag* 來說,是第一個比最大值還大的 " +"2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" +"手動指定值的話要特別注意。" #: ../../library/enum.rst:818 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" -msgstr "" +msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" #: ../../library/enum.rst:820 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" -msgstr "" +msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" #: ../../library/enum.rst:821 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" +"``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" #: ../../library/enum.rst:822 msgid "used to create the ``SECOND`` enum member;" -msgstr "" +msgstr "被用來建立列舉成員 ``SECOND``;" #: ../../library/enum.rst:823 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" +"``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" +"舉成員 ``THREE``)" #: ../../library/enum.rst:828 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." -msgstr "" +msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" #: ../../library/enum.rst:831 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." -msgstr "" +msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" #: ../../library/enum.rst:834 msgid "" @@ -952,6 +1013,8 @@ msgid "" "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" +"在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" +"是不相容的類型就會失敗。" #: ../../library/enum.rst:840 msgid "" @@ -959,6 +1022,8 @@ msgid "" "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" +"和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" +"有相同名稱。" #: ../../library/enum.rst:844 msgid "" @@ -967,6 +1032,8 @@ msgid "" "and *Enum* subclasses can define members with the names ``value`` and " "``name``." msgstr "" +"*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " +"*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" #: ../../library/enum.rst:853 msgid "" @@ -974,6 +1041,9 @@ msgid "" "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" +"專門針對列舉的 :keyword:`class` 裝飾器。它搜尋列舉的 :attr:`~EnumType." +"__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" +"`ValueError` 並附上細節: ::" #: ../../library/enum.rst:871 msgid "" @@ -981,14 +1051,16 @@ msgid "" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" +"專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" +"定在裝飾的列舉上應該檢查什麼限制。" #: ../../library/enum.rst:879 msgid "A decorator for use in enums: its target will become a member." -msgstr "" +msgstr "列舉所使用的裝飾器:其目標會變成成員。" #: ../../library/enum.rst:885 msgid "A decorator for use in enums: its target will not become a member." -msgstr "" +msgstr "列舉所使用的裝飾器:其目標不會變成成員。" #: ../../library/enum.rst:891 msgid "" @@ -997,44 +1069,51 @@ msgid "" "only be used when the enum members are exported to the module global " "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" +"修改列舉的 :class:`str() ` 及 :func:`repr` 的裝飾器,讓成員顯示為屬於模" +"組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" +"考 :class:`re.RegexFlag`)。" #: ../../library/enum.rst:901 msgid "Return a list of all power-of-two integers contained in a flag *value*." -msgstr "" +msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" #: ../../library/enum.rst:908 msgid "Notes" -msgstr "" +msgstr "備註" #: ../../library/enum.rst:910 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" -msgstr "" +msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" #: ../../library/enum.rst:912 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" +"這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" +"制:" #: ../../library/enum.rst:915 msgid "``__str__`` uses the value and not the name of the enum member" -msgstr "" +msgstr "``__str__`` 使用值而不是列舉成員的名稱" #: ../../library/enum.rst:917 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" -msgstr "" +msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" #: ../../library/enum.rst:920 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" +"如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" +"己的基礎類別: ::" #: ../../library/enum.rst:927 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" -msgstr "" +msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" #~ msgid "The *start* parameter was added." #~ msgstr "新增 *start* 參數。" From 317d61fdbbf1d043569ab93d56bae2c9175b69b0 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:21:30 +0800 Subject: [PATCH 100/105] Sync with CPython 3.12 (#666) * sync with cpython 744f752f * sync with cpython 7de3c8b7 * sync with cpython 94525a7a * sync with cpython ae838afe * sync with cpython d3121357 * sync with cpython 41dfae8f * sync with cpython 727f8ee3 * sync with cpython f2f89bf1 * sync with cpython 9e73c71a * sync with cpython 38578dd6 * sync with cpython a4eb2e30 * sync with cpython 7cce26bc * sync with cpython 2398036e * sync with cpython f7ce4021 * sync with cpython e5b6744f * sync with cpython 1675c254 * sync with cpython 21c8fbf2 * sync with cpython 99f0dd88 * sync with cpython 1c84a480 * sync with cpython 1a95ad68 * sync with cpython 9c583f36 * sync with cpython e0c2bf46 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- bugs.po | 9 +- c-api/call.po | 178 ++-- c-api/exceptions.po | 723 ++++++++-------- c-api/memory.po | 68 +- c-api/set.po | 7 +- glossary.po | 46 +- howto/descriptor.po | 128 +-- howto/enum.po | 330 +++---- howto/regex.po | 444 +++++----- library/abc.po | 14 +- library/asyncio-eventloop.po | 619 +++++++------- library/asyncio.po | 14 +- library/bz2.po | 121 ++- library/codecs.po | 886 +++++++++---------- library/collections.abc.po | 24 +- library/collections.po | 22 +- library/contextlib.po | 35 +- library/difflib.po | 207 ++--- library/dis.po | 723 ++++++++-------- library/doctest.po | 583 +++++++------ library/email.compat32-message.po | 6 +- library/email.message.po | 6 +- library/enum.po | 229 +++-- library/fcntl.po | 33 +- library/functions.po | 24 +- library/getpass.po | 12 +- library/grp.po | 25 +- library/inspect.po | 374 ++++---- library/itertools.po | 6 +- library/locale.po | 71 +- library/logging.handlers.po | 286 ++++--- library/mailbox.po | 4 +- library/mmap.po | 10 +- library/multiprocessing.po | 7 +- library/operator.po | 26 +- library/posix.po | 38 +- library/pty.po | 34 +- library/pwd.po | 25 +- library/resource.po | 29 +- library/selectors.po | 6 +- library/socket.po | 619 +++++++------- library/sqlite3.po | 532 ++++++------ library/sys.monitoring.po | 474 ++++++----- library/sys.po | 848 +++++++++--------- library/syslog.po | 35 +- library/tempfile.po | 12 +- library/termios.po | 53 +- library/test.po | 463 +++++----- library/time.po | 583 +++++++------ library/tkinter.messagebox.po | 211 ++++- library/tty.po | 22 +- library/typing.po | 772 ++++++++--------- library/unittest.mock.po | 10 +- library/wsgiref.po | 18 +- library/xml.dom.pulldom.po | 4 +- library/xml.etree.elementtree.po | 468 +++++----- reference/compound_stmts.po | 41 +- reference/datamodel.po | 12 +- reference/expressions.po | 36 +- reference/import.po | 10 +- reference/introduction.po | 19 +- tutorial/introduction.po | 6 +- whatsnew/2.0.po | 8 +- whatsnew/2.2.po | 38 +- whatsnew/2.3.po | 10 +- whatsnew/2.5.po | 60 +- whatsnew/2.6.po | 78 +- whatsnew/2.7.po | 20 +- whatsnew/3.11.po | 8 +- whatsnew/3.12.po | 1325 +++++++++++++++-------------- whatsnew/3.3.po | 2 +- whatsnew/3.4.po | 6 +- whatsnew/3.5.po | 8 +- whatsnew/3.6.po | 6 +- whatsnew/3.7.po | 8 +- whatsnew/3.8.po | 12 +- whatsnew/3.9.po | 8 +- 77 files changed, 6867 insertions(+), 6410 deletions(-) diff --git a/bugs.po b/bugs.po index 1c81ad8567..4269ebaa0d 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:17+0000\n" +"POT-Creation-Date: 2023-11-05 09:50+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,9 +117,10 @@ msgstr "給有意成為 Python 說明文件貢獻者的綜合指南。" #: ../../bugs.rst:41 msgid "" -"`Documentation Translations `_" -msgstr "`說明文件翻譯 `_" +"`Documentation Translations `_" +msgstr "" +"`說明文件翻譯 `_" #: ../../bugs.rst:42 msgid "" diff --git a/c-api/call.po b/c-api/call.po index d125073afb..737b538f4d 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -166,8 +166,8 @@ msgid "" ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" -":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" -"置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的" +"位置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" #: ../../c-api/call.rst:94 msgid "*kwnames* is a tuple containing the names of the keyword arguments;" @@ -210,11 +210,11 @@ msgid "" "include a prepended *self* argument) very efficiently." msgstr "" "當可以以幾乎無代價的方式(無需佔據額外的記憶體)來達成,那麼會推薦呼叫者使" -"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結方" -"法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 *self* " -"引數)。" +"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結" +"方法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 " +"*self* 引數)。" -#: ../../c-api/call.rst:111 +#: ../../c-api/call.rst:113 msgid "" "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " @@ -223,7 +223,7 @@ msgstr "" "要呼叫一個實作了 vectorcall 的物件,請就像其他可呼叫物件一樣使用\\ :ref:`呼" "叫 API` 中的函式。:c:func:`PyObject_Vectorcall` 通常是最有效率的。" -#: ../../c-api/call.rst:118 +#: ../../c-api/call.rst:120 msgid "" "In CPython 3.8, the vectorcall API and related functions were available " "provisionally under names with a leading underscore: " @@ -242,11 +242,11 @@ msgstr "" "``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的新名" "稱的別名。" -#: ../../c-api/call.rst:130 +#: ../../c-api/call.rst:132 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/call.rst:132 +#: ../../c-api/call.rst:134 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" @@ -256,7 +256,7 @@ msgstr "" "使用 *tp_call* 的呼叫會使用 :c:func:`Py_EnterRecursiveCall` 和 :c:func:" "`Py_LeaveRecursiveCall`。" -#: ../../c-api/call.rst:137 +#: ../../c-api/call.rst:139 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " @@ -265,11 +265,11 @@ msgstr "" "為保證效率,這不適用於使用 vectorcall 的呼叫:被呼叫方在需要時應當使用 " "*Py_EnterRecursiveCall* 和 *Py_LeaveRecursiveCall*。" -#: ../../c-api/call.rst:143 +#: ../../c-api/call.rst:145 msgid "Vectorcall Support API" msgstr "Vectorcall 支援 API" -#: ../../c-api/call.rst:147 +#: ../../c-api/call.rst:149 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" @@ -278,13 +278,13 @@ msgstr "" "\n" "::" -#: ../../c-api/call.rst:153 +#: ../../c-api/call.rst:155 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "然而,應使用 ``PyVectorcall_NARGS`` 函式以便將來需要擴充。" -#: ../../c-api/call.rst:160 +#: ../../c-api/call.rst:162 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -295,7 +295,7 @@ msgstr "" "*NULL*。否則,回傳儲存在 *op* 中的 vectorcall 函式指標。這個函式不會引發例" "外。" -#: ../../c-api/call.rst:165 +#: ../../c-api/call.rst:167 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." @@ -303,7 +303,7 @@ msgstr "" "這大多在檢查 *op* 是否支援 vectorcall 時能派上用場,可以透過檢查 " "``PyVectorcall_Function(op) != NULL`` 來達成。" -#: ../../c-api/call.rst:172 +#: ../../c-api/call.rst:174 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." @@ -311,7 +311,7 @@ msgstr "" "呼叫 *callable* 的 :c:type:`vectorcallfunc`,其位置引數和關鍵字引數分別以 " "tuple 和 dict 格式給定。" -#: ../../c-api/call.rst:175 +#: ../../c-api/call.rst:177 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -319,14 +319,14 @@ msgid "" "not fall back to ``tp_call``." msgstr "" "這是一個專門函式,其目的是被放入 :c:member:`~PyTypeObject.tp_call` 擴充槽或是" -"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" -"並且它不會退回 (fall back) 使用 ``tp_call``。" +"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗" +"標並且它不會退回 (fall back) 使用 ``tp_call``。" -#: ../../c-api/call.rst:186 +#: ../../c-api/call.rst:188 msgid "Object Calling API" msgstr "物件呼叫 API" -#: ../../c-api/call.rst:188 +#: ../../c-api/call.rst:190 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -337,133 +337,133 @@ msgstr "" "的慣用形式 – 可以是 *tp_call* 或 vectorcall。為了儘可能減少轉換的進行,請選擇" "一個適合你所擁有資料格式的函式。" -#: ../../c-api/call.rst:194 +#: ../../c-api/call.rst:196 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "下表總結了可用的函式;請參閱各個說明文件以瞭解詳情。" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "Function" msgstr "函式" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "args" msgstr "args" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "kwargs" msgstr "kwargs" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:202 ../../c-api/call.rst:204 -#: ../../c-api/call.rst:206 ../../c-api/call.rst:208 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid "tuple" msgstr "tuple" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:224 msgid "dict/``NULL``" msgstr "dict/``NULL``" -#: ../../c-api/call.rst:202 +#: ../../c-api/call.rst:204 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" -#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:204 ../../c-api/call.rst:206 ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "---" msgstr "---" -#: ../../c-api/call.rst:204 +#: ../../c-api/call.rst:206 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:204 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:206 ../../c-api/call.rst:220 msgid "1 object" msgstr "一個物件" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid "tuple/``NULL``" msgstr "tuple/``NULL``" -#: ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 msgid "format" msgstr "format" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid "obj + ``char*``" msgstr "物件 + ``char*``" -#: ../../c-api/call.rst:212 +#: ../../c-api/call.rst:214 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 msgid "variadic" msgstr "可變引數" -#: ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "obj + name" msgstr "物件 + 名稱" -#: ../../c-api/call.rst:216 +#: ../../c-api/call.rst:218 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:218 +#: ../../c-api/call.rst:220 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:220 +#: ../../c-api/call.rst:222 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 ../../c-api/call.rst:224 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 ../../c-api/call.rst:226 msgid "vectorcall" msgstr "vectorcall" -#: ../../c-api/call.rst:222 +#: ../../c-api/call.rst:224 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid "arg + name" msgstr "引數 + 名稱" -#: ../../c-api/call.rst:230 +#: ../../c-api/call.rst:232 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." @@ -471,7 +471,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數及由" "字典 *kwargs* 所給定的關鍵字引數。" -#: ../../c-api/call.rst:233 +#: ../../c-api/call.rst:235 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." @@ -479,22 +479,22 @@ msgstr "" "*args* 必須不為 *NULL*;如果不需要引數,請使用一個空 tuple。如果不需要關鍵字" "引數,則 *kwargs* 可以為 *NULL*。" -#: ../../c-api/call.rst:236 ../../c-api/call.rst:248 ../../c-api/call.rst:259 -#: ../../c-api/call.rst:270 ../../c-api/call.rst:282 ../../c-api/call.rst:302 -#: ../../c-api/call.rst:321 ../../c-api/call.rst:335 ../../c-api/call.rst:344 -#: ../../c-api/call.rst:356 ../../c-api/call.rst:369 ../../c-api/call.rst:403 +#: ../../c-api/call.rst:238 ../../c-api/call.rst:250 ../../c-api/call.rst:261 +#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 ../../c-api/call.rst:304 +#: ../../c-api/call.rst:323 ../../c-api/call.rst:337 ../../c-api/call.rst:346 +#: ../../c-api/call.rst:358 ../../c-api/call.rst:371 ../../c-api/call.rst:405 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "成功時回傳結果,或在失敗時引發一個例外並回傳 *NULL*。" -#: ../../c-api/call.rst:239 +#: ../../c-api/call.rst:241 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "這等價於 Python 運算式 ``callable(*args, **kwargs)``。" -#: ../../c-api/call.rst:245 +#: ../../c-api/call.rst:247 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." @@ -502,7 +502,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並不附帶任何引數。這是不帶引數呼叫 " "Python 可呼叫物件的最有效方式。" -#: ../../c-api/call.rst:256 +#: ../../c-api/call.rst:258 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." @@ -510,7 +510,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並附帶正好一個位置引數 *arg* 而沒有關" "鍵字引數。" -#: ../../c-api/call.rst:267 +#: ../../c-api/call.rst:269 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." @@ -518,11 +518,11 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數。如" "果不需要傳入引數,則 *args* 可以為 *NULL*。" -#: ../../c-api/call.rst:273 ../../c-api/call.rst:285 +#: ../../c-api/call.rst:275 ../../c-api/call.rst:287 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "這等價於 Python 運算式 ``callable(*args)``。" -#: ../../c-api/call.rst:278 +#: ../../c-api/call.rst:280 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -533,7 +533,7 @@ msgstr "" "用 :c:func:`Py_BuildValue` 風格的格式字串來描述。格式可以為 *NULL*,表示沒有" "提供任何引數。" -#: ../../c-api/call.rst:287 +#: ../../c-api/call.rst:289 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." @@ -541,11 +541,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:290 +#: ../../c-api/call.rst:292 msgid "The type of *format* was changed from ``char *``." msgstr "這個 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:296 +#: ../../c-api/call.rst:298 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " @@ -554,17 +554,17 @@ msgstr "" "呼叫 *obj* 物件中名為 *name* 的 method 並附帶數量可變的 C 引數。這些 C 引數" "由 :c:func:`Py_BuildValue` 格式字串來描述,並應當生成一個 tuple。" -#: ../../c-api/call.rst:300 +#: ../../c-api/call.rst:302 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "格式可以為 *NULL*,表示沒有提供任何引數。" -#: ../../c-api/call.rst:305 +#: ../../c-api/call.rst:307 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:308 +#: ../../c-api/call.rst:310 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." @@ -572,11 +572,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:311 +#: ../../c-api/call.rst:313 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:317 +#: ../../c-api/call.rst:319 msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " @@ -585,13 +585,13 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` " "引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。" -#: ../../c-api/call.rst:324 +#: ../../c-api/call.rst:326 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:330 +#: ../../c-api/call.rst:332 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -602,7 +602,7 @@ msgstr "" "Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些" "引數是以位置在 *NULL* 後面、且數量可變的參數來提供。" -#: ../../c-api/call.rst:341 +#: ../../c-api/call.rst:343 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." @@ -610,7 +610,7 @@ msgstr "" "不附帶任何引數地呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 " "*name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:352 +#: ../../c-api/call.rst:354 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " @@ -619,7 +619,7 @@ msgstr "" "附帶一個位置引數 *arg* 地呼叫 Python 物件 *obj* 中的一個 method,其中 method " "名稱由 *name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:364 +#: ../../c-api/call.rst:366 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " @@ -629,7 +629,7 @@ msgstr "" "的相同。如果 *callable* 支援 vectorcall_,則它會直接呼叫存放在 *callable* 中" "的 vectorcall 函式。" -#: ../../c-api/call.rst:376 +#: ../../c-api/call.rst:378 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " @@ -638,7 +638,7 @@ msgstr "" "附帶與在 vectorcall_ 協定中傳入的相同位置引數來呼叫 *callable*,但會加上以字" "典 *kwdict* 格式傳入的關鍵字引數。*args* 陣列將只包含位置引數。" -#: ../../c-api/call.rst:380 +#: ../../c-api/call.rst:382 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -648,7 +648,7 @@ msgstr "" "無論內部使用了哪一種協定,都會需要進行引數的轉換。因此,此函式應該只有在呼叫" "方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。" -#: ../../c-api/call.rst:390 +#: ../../c-api/call.rst:392 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -666,19 +666,19 @@ msgstr "" "加上 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" "`PyObject_Vectorcall` 中一樣被傳入。" -#: ../../c-api/call.rst:399 +#: ../../c-api/call.rst:401 msgid "" "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " -"向量作為引數來呼叫 unbound method(未繫結方法)物件。" +"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 " +"*args* 向量作為引數來呼叫 unbound method(未繫結方法)物件。" -#: ../../c-api/call.rst:410 +#: ../../c-api/call.rst:412 msgid "Call Support API" msgstr "呼叫支援 API" -#: ../../c-api/call.rst:414 +#: ../../c-api/call.rst:416 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 023dd83533..5c6767c7db 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-31 00:03+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-" @@ -125,31 +125,40 @@ msgstr "" msgid "" "The function is called with a single argument *obj* that identifies the " "context in which the unraisable exception occurred. If possible, the repr of " -"*obj* will be printed in the warning message." +"*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " +"traceback is printed." msgstr "" -#: ../../c-api/exceptions.rst:92 +#: ../../c-api/exceptions.rst:93 msgid "An exception must be set when calling this function." msgstr "" -#: ../../c-api/exceptions.rst:96 +#: ../../c-api/exceptions.rst:95 +msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." +msgstr "" + +#: ../../c-api/exceptions.rst:98 +msgid "Use :func:`sys.unraisablehook`." +msgstr "" + +#: ../../c-api/exceptions.rst:104 msgid "" "Print the standard traceback display of ``exc`` to ``sys.stderr``, including " "chained exceptions and notes." msgstr "" -#: ../../c-api/exceptions.rst:102 +#: ../../c-api/exceptions.rst:110 msgid "Raising exceptions" msgstr "" -#: ../../c-api/exceptions.rst:104 +#: ../../c-api/exceptions.rst:112 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " "for use in a ``return`` statement." msgstr "" -#: ../../c-api/exceptions.rst:111 +#: ../../c-api/exceptions.rst:119 msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " @@ -158,13 +167,13 @@ msgid "" "error message; it is decoded from ``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:120 +#: ../../c-api/exceptions.rst:128 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: ../../c-api/exceptions.rst:126 +#: ../../c-api/exceptions.rst:134 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -172,31 +181,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:135 +#: ../../c-api/exceptions.rst:143 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/exceptions.rst:143 +#: ../../c-api/exceptions.rst:151 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:148 +#: ../../c-api/exceptions.rst:156 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: ../../c-api/exceptions.rst:155 +#: ../../c-api/exceptions.rst:163 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: ../../c-api/exceptions.rst:164 +#: ../../c-api/exceptions.rst:172 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -210,7 +219,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:178 +#: ../../c-api/exceptions.rst:186 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -218,21 +227,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:187 +#: ../../c-api/exceptions.rst:195 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: ../../c-api/exceptions.rst:196 +#: ../../c-api/exceptions.rst:204 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:203 +#: ../../c-api/exceptions.rst:211 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`!" @@ -245,19 +254,19 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 -#: ../../c-api/exceptions.rst:231 ../../c-api/exceptions.rst:241 -#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:259 +#: ../../c-api/exceptions.rst:220 ../../c-api/exceptions.rst:228 +#: ../../c-api/exceptions.rst:239 ../../c-api/exceptions.rst:249 +#: ../../c-api/exceptions.rst:257 ../../c-api/exceptions.rst:267 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:217 +#: ../../c-api/exceptions.rst:225 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:225 +#: ../../c-api/exceptions.rst:233 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " "that if *filename* is not ``NULL``, it is decoded from the filesystem " @@ -266,7 +275,7 @@ msgid "" "attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:236 +#: ../../c-api/exceptions.rst:244 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " "behavior that if *filename* is not ``NULL``, it is passed to the constructor " @@ -274,19 +283,19 @@ msgid "" "filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:246 +#: ../../c-api/exceptions.rst:254 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:256 +#: ../../c-api/exceptions.rst:264 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:264 +#: ../../c-api/exceptions.rst:272 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -294,13 +303,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:274 +#: ../../c-api/exceptions.rst:282 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:282 +#: ../../c-api/exceptions.rst:290 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -308,19 +317,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:292 +#: ../../c-api/exceptions.rst:300 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:300 +#: ../../c-api/exceptions.rst:308 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:306 +#: ../../c-api/exceptions.rst:314 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -328,11 +337,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:313 +#: ../../c-api/exceptions.rst:321 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:315 +#: ../../c-api/exceptions.rst:323 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -348,7 +357,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:330 +#: ../../c-api/exceptions.rst:338 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -358,7 +367,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:345 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -367,14 +376,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:343 +#: ../../c-api/exceptions.rst:351 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:350 +#: ../../c-api/exceptions.rst:358 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -382,31 +391,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:361 +#: ../../c-api/exceptions.rst:369 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:368 +#: ../../c-api/exceptions.rst:376 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:377 +#: ../../c-api/exceptions.rst:385 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:384 +#: ../../c-api/exceptions.rst:392 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:388 +#: ../../c-api/exceptions.rst:396 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -415,11 +424,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:394 +#: ../../c-api/exceptions.rst:402 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:398 +#: ../../c-api/exceptions.rst:406 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -427,14 +436,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:414 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:413 +#: ../../c-api/exceptions.rst:421 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -442,43 +451,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:421 +#: ../../c-api/exceptions.rst:429 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:424 +#: ../../c-api/exceptions.rst:432 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:427 ../../c-api/exceptions.rst:471 +#: ../../c-api/exceptions.rst:435 ../../c-api/exceptions.rst:479 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:437 +#: ../../c-api/exceptions.rst:445 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:453 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:450 +#: ../../c-api/exceptions.rst:458 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:459 +#: ../../c-api/exceptions.rst:467 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:461 +#: ../../c-api/exceptions.rst:469 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -487,17 +496,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:468 +#: ../../c-api/exceptions.rst:476 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:487 +#: ../../c-api/exceptions.rst:495 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:489 +#: ../../c-api/exceptions.rst:497 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -510,20 +519,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:503 +#: ../../c-api/exceptions.rst:511 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:512 +#: ../../c-api/exceptions.rst:520 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:515 +#: ../../c-api/exceptions.rst:523 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -533,14 +542,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:523 +#: ../../c-api/exceptions.rst:531 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:542 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -548,7 +557,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:541 +#: ../../c-api/exceptions.rst:549 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -556,14 +565,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:550 +#: ../../c-api/exceptions.rst:558 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:565 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -571,7 +580,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:566 +#: ../../c-api/exceptions.rst:574 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -581,7 +590,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:575 +#: ../../c-api/exceptions.rst:583 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -589,7 +598,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:585 +#: ../../c-api/exceptions.rst:593 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -599,7 +608,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:594 +#: ../../c-api/exceptions.rst:602 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -607,22 +616,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:601 +#: ../../c-api/exceptions.rst:609 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:609 +#: ../../c-api/exceptions.rst:617 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:619 +#: ../../c-api/exceptions.rst:627 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:621 +#: ../../c-api/exceptions.rst:629 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -630,7 +639,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:626 +#: ../../c-api/exceptions.rst:634 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -639,44 +648,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:632 +#: ../../c-api/exceptions.rst:640 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:635 +#: ../../c-api/exceptions.rst:643 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:639 +#: ../../c-api/exceptions.rst:647 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:650 +#: ../../c-api/exceptions.rst:658 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:654 ../../c-api/exceptions.rst:681 +#: ../../c-api/exceptions.rst:662 ../../c-api/exceptions.rst:689 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:672 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:676 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -684,27 +693,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:673 +#: ../../c-api/exceptions.rst:681 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:676 +#: ../../c-api/exceptions.rst:684 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:689 +#: ../../c-api/exceptions.rst:697 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:701 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -712,15 +721,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:698 +#: ../../c-api/exceptions.rst:706 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:703 +#: ../../c-api/exceptions.rst:711 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:707 +#: ../../c-api/exceptions.rst:715 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -729,7 +738,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:713 +#: ../../c-api/exceptions.rst:721 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -739,31 +748,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:722 +#: ../../c-api/exceptions.rst:730 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:738 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:734 +#: ../../c-api/exceptions.rst:742 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:741 +#: ../../c-api/exceptions.rst:749 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:747 +#: ../../c-api/exceptions.rst:755 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -771,41 +780,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:755 +#: ../../c-api/exceptions.rst:763 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:762 +#: ../../c-api/exceptions.rst:770 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:769 +#: ../../c-api/exceptions.rst:777 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:773 +#: ../../c-api/exceptions.rst:781 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:786 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:783 +#: ../../c-api/exceptions.rst:791 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:787 +#: ../../c-api/exceptions.rst:795 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -817,72 +826,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:801 +#: ../../c-api/exceptions.rst:809 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:803 +#: ../../c-api/exceptions.rst:811 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:807 +#: ../../c-api/exceptions.rst:815 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:822 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:820 +#: ../../c-api/exceptions.rst:828 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:826 +#: ../../c-api/exceptions.rst:834 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:834 +#: ../../c-api/exceptions.rst:842 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:841 +#: ../../c-api/exceptions.rst:849 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:857 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:856 +#: ../../c-api/exceptions.rst:864 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:862 +#: ../../c-api/exceptions.rst:870 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:877 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:879 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -892,44 +901,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:880 +#: ../../c-api/exceptions.rst:888 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:890 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:886 +#: ../../c-api/exceptions.rst:894 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:890 +#: ../../c-api/exceptions.rst:898 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:894 ../../c-api/exceptions.rst:902 +#: ../../c-api/exceptions.rst:902 ../../c-api/exceptions.rst:910 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:907 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:913 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -938,13 +947,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:921 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:924 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -952,30 +961,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:930 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:934 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:939 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:946 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:948 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -983,451 +992,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1187 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1005 -#: ../../c-api/exceptions.rst:1007 ../../c-api/exceptions.rst:1053 -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1011 ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1015 ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1073 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1118 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1447,58 +1456,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1120 +#: ../../c-api/exceptions.rst:1128 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1131 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1126 +#: ../../c-api/exceptions.rst:1134 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1144 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1146 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1151 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1146 ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1154 ../../c-api/exceptions.rst:1215 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1157 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1160 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1166 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1168 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1506,393 +1515,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1204 +#: ../../c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1210 +#: ../../c-api/exceptions.rst:1218 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:162 +#: ../../c-api/exceptions.rst:170 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/memory.po b/c-api/memory.po index 9a8b640b46..e2929793b8 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+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-" @@ -557,19 +557,19 @@ msgid "" "following fields:" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "user context passed as first argument" msgstr "" @@ -938,119 +938,119 @@ msgstr "" msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " -"\"arenas\" with a fixed size of 256 KiB. It falls back to :c:func:" -"`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than " -"512 bytes." +"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB " +"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:" +"`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:633 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:636 +#: ../../c-api/memory.rst:637 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:638 +#: ../../c-api/memory.rst:639 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:640 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:640 +#: ../../c-api/memory.rst:641 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:642 +#: ../../c-api/memory.rst:643 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:647 +#: ../../c-api/memory.rst:648 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:654 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:668 +#: ../../c-api/memory.rst:669 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:672 +#: ../../c-api/memory.rst:673 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:677 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:682 +#: ../../c-api/memory.rst:683 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:684 +#: ../../c-api/memory.rst:685 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:687 +#: ../../c-api/memory.rst:688 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:691 +#: ../../c-api/memory.rst:692 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:695 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:700 +#: ../../c-api/memory.rst:701 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:702 +#: ../../c-api/memory.rst:703 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:716 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:727 +#: ../../c-api/memory.rst:728 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1060,14 +1060,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:742 +#: ../../c-api/memory.rst:743 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:746 +#: ../../c-api/memory.rst:747 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/set.po b/c-api/set.po index b347ab2d3b..828de9f04b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+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-" @@ -182,7 +182,10 @@ msgid "" msgstr "" #: ../../c-api/set.rst:166 -msgid "Empty an existing set of all elements." +msgid "" +"Empty an existing set of all elements. Return ``0`` on success. Return " +"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:" +"`set` or its subtype." msgstr "" #: ../../c-api/set.rst:11 diff --git a/glossary.po b/glossary.po index e3237f4157..a1aa90ab1e 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -573,10 +573,12 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:250 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " -"by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." +"by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " +"See :pep:`343`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`。" +"`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" +"`343`。" #: ../../glossary.rst:253 msgid "context variable" @@ -1444,14 +1446,14 @@ msgid "" "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" -"meth:`__iter__` method or with a :meth:`__getitem__` method that implements :" -"term:`sequence` semantics." +"meth:`__iter__` method or with a :meth:`~object.__getitem__` method that " +"implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" "class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," "只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" -"列)語意的 :meth:`__getitem__` method,該物件就是可疊代物件。" +"列)語意的 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" #: ../../glossary.rst:651 msgid "" @@ -2398,31 +2400,33 @@ msgstr "sequence(序列)" #: ../../glossary.rst:1089 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`__getitem__` special method and defines a :meth:" -"`__len__` method that returns the length of the sequence. Some built-in " +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`__len__` method that returns the length of the sequence. Some built-in " "sequence types are :class:`list`, :class:`str`, :class:`tuple`, and :class:" -"`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` and :meth:" -"`__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`immutable` keys rather than integers." -msgstr "" -"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " -"method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" -"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`、:" -"class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:`dict` 也" -"支援 :meth:`__getitem__` 和 :meth:`__len__`,但它被視為對映 (mapping) 而不是" -"序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是整數。" +"`bytes`. Note that :class:`dict` also supports :meth:`~object.__getitem__` " +"and :meth:`__len__`, but is considered a mapping rather than a sequence " +"because the lookups use arbitrary :term:`immutable` keys rather than " +"integers." +msgstr "" +"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " +"special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" +"個 :meth:`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" +"`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:" +"`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`__len__`,但它被視為對映 " +"(mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是" +"整數。" #: ../../glossary.rst:1098 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`__getitem__` and :meth:" +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" "`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" "meth:`__reversed__`. Types that implement this expanded interface can be " "registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`,還增加" -"了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`__len__`," +"還增加了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" "`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " "被明確地註冊。" diff --git a/howto/descriptor.po b/howto/descriptor.po index 4b624d303c..d78cea245b 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-05 00:03+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-" @@ -689,11 +689,11 @@ msgid "" "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:948 +#: ../../howto/descriptor.rst:952 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:950 +#: ../../howto/descriptor.rst:954 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -701,36 +701,36 @@ msgid "" "\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:957 +#: ../../howto/descriptor.rst:961 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:959 +#: ../../howto/descriptor.rst:963 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:964 +#: ../../howto/descriptor.rst:968 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:988 +#: ../../howto/descriptor.rst:992 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1091 +#: ../../howto/descriptor.rst:1095 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1095 +#: ../../howto/descriptor.rst:1099 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -740,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1112 +#: ../../howto/descriptor.rst:1116 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1117 +#: ../../howto/descriptor.rst:1121 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1119 +#: ../../howto/descriptor.rst:1123 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1122 +#: ../../howto/descriptor.rst:1126 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -764,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1127 +#: ../../howto/descriptor.rst:1131 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1144 +#: ../../howto/descriptor.rst:1148 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -778,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1160 +#: ../../howto/descriptor.rst:1164 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1169 +#: ../../howto/descriptor.rst:1173 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1176 +#: ../../howto/descriptor.rst:1180 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1182 +#: ../../howto/descriptor.rst:1186 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1188 +#: ../../howto/descriptor.rst:1192 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1195 +#: ../../howto/descriptor.rst:1199 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1208 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1213 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1215 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1214 +#: ../../howto/descriptor.rst:1218 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -837,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1219 +#: ../../howto/descriptor.rst:1223 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1225 ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1229 ../../howto/descriptor.rst:1231 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1231 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1234 +#: ../../howto/descriptor.rst:1238 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1236 +#: ../../howto/descriptor.rst:1240 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -894,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1242 +#: ../../howto/descriptor.rst:1246 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1245 +#: ../../howto/descriptor.rst:1249 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -912,19 +912,19 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1254 +#: ../../howto/descriptor.rst:1258 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1271 +#: ../../howto/descriptor.rst:1275 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1291 +#: ../../howto/descriptor.rst:1295 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -932,18 +932,18 @@ msgid "" "``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1359 +#: ../../howto/descriptor.rst:1363 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1361 +#: ../../howto/descriptor.rst:1365 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1379 +#: ../../howto/descriptor.rst:1383 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -952,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1396 +#: ../../howto/descriptor.rst:1400 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1406 +#: ../../howto/descriptor.rst:1410 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1484 +#: ../../howto/descriptor.rst:1488 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -970,7 +970,7 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1502 +#: ../../howto/descriptor.rst:1506 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -979,30 +979,30 @@ msgid "" "``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1510 +#: ../../howto/descriptor.rst:1514 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1512 +#: ../../howto/descriptor.rst:1516 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1516 +#: ../../howto/descriptor.rst:1520 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1532 +#: ../../howto/descriptor.rst:1536 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1567 +#: ../../howto/descriptor.rst:1571 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -1010,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1572 +#: ../../howto/descriptor.rst:1576 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1575 +#: ../../howto/descriptor.rst:1579 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1597 +#: ../../howto/descriptor.rst:1601 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1032,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1642 +#: ../../howto/descriptor.rst:1646 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1658 +#: ../../howto/descriptor.rst:1662 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1693 +#: ../../howto/descriptor.rst:1697 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1707 +#: ../../howto/descriptor.rst:1711 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1728 +#: ../../howto/descriptor.rst:1732 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1740 +#: ../../howto/descriptor.rst:1744 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/howto/enum.po b/howto/enum.po index d581267153..18448fd07a 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -375,68 +375,68 @@ msgid "" "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:499 +#: ../../howto/enum.rst:500 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:503 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:508 +#: ../../howto/enum.rst:509 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:511 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:517 +#: ../../howto/enum.rst:518 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:523 +#: ../../howto/enum.rst:524 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:526 +#: ../../howto/enum.rst:527 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:537 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:540 +#: ../../howto/enum.rst:542 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:542 +#: ../../howto/enum.rst:544 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:552 +#: ../../howto/enum.rst:554 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:555 +#: ../../howto/enum.rst:557 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -448,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:571 +#: ../../howto/enum.rst:573 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:575 +#: ../../howto/enum.rst:577 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -464,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:585 +#: ../../howto/enum.rst:587 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:591 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -479,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:596 +#: ../../howto/enum.rst:598 msgid "The complete signature is::" msgstr "" @@ -487,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:608 +#: ../../howto/enum.rst:610 msgid "What the new enum class will record as its name." msgstr "" @@ -495,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:610 +#: ../../howto/enum.rst:612 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:615 +#: ../../howto/enum.rst:617 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:619 +#: ../../howto/enum.rst:621 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:623 +#: ../../howto/enum.rst:625 msgid "or a mapping::" msgstr "" @@ -517,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:627 +#: ../../howto/enum.rst:629 msgid "name of module where new enum class can be found." msgstr "" @@ -525,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:629 +#: ../../howto/enum.rst:631 msgid "where in module new enum class can be found." msgstr "" @@ -533,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:631 +#: ../../howto/enum.rst:633 msgid "type to mix in to new enum class." msgstr "" @@ -541,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:635 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:635 +#: ../../howto/enum.rst:637 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:640 +#: ../../howto/enum.rst:642 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:643 +#: ../../howto/enum.rst:645 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:645 +#: ../../howto/enum.rst:647 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -565,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:666 +#: ../../howto/enum.rst:668 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:679 +#: ../../howto/enum.rst:681 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:690 +#: ../../howto/enum.rst:692 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:692 +#: ../../howto/enum.rst:694 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -588,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:701 +#: ../../howto/enum.rst:703 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:703 +#: ../../howto/enum.rst:705 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -602,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:711 +#: ../../howto/enum.rst:713 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:714 +#: ../../howto/enum.rst:716 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:721 +#: ../../howto/enum.rst:723 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:737 +#: ../../howto/enum.rst:739 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:754 +#: ../../howto/enum.rst:756 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:759 +#: ../../howto/enum.rst:761 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:767 +#: ../../howto/enum.rst:769 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:778 +#: ../../howto/enum.rst:780 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:784 +#: ../../howto/enum.rst:786 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:793 +#: ../../howto/enum.rst:795 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:795 +#: ../../howto/enum.rst:797 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -665,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:804 +#: ../../howto/enum.rst:806 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:818 +#: ../../howto/enum.rst:820 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:830 +#: ../../howto/enum.rst:832 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:844 +#: ../../howto/enum.rst:846 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:856 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -698,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:864 +#: ../../howto/enum.rst:866 msgid "Others" msgstr "" -#: ../../howto/enum.rst:866 +#: ../../howto/enum.rst:868 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:872 +#: ../../howto/enum.rst:874 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:875 +#: ../../howto/enum.rst:877 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:877 +#: ../../howto/enum.rst:879 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:882 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:883 +#: ../../howto/enum.rst:885 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -741,169 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:889 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:892 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:892 +#: ../../howto/enum.rst:894 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:895 +#: ../../howto/enum.rst:897 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:900 +#: ../../howto/enum.rst:902 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:910 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:910 +#: ../../howto/enum.rst:912 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:916 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:941 +#: ../../howto/enum.rst:943 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:948 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:951 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:953 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:954 +#: ../../howto/enum.rst:956 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:960 +#: ../../howto/enum.rst:962 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:964 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:963 +#: ../../howto/enum.rst:965 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:965 +#: ../../howto/enum.rst:967 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:969 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:972 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:974 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:978 +#: ../../howto/enum.rst:980 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:983 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:984 +#: ../../howto/enum.rst:986 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:987 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:989 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1007 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1012 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1014 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1019 +#: ../../howto/enum.rst:1021 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1021 +#: ../../howto/enum.rst:1023 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -913,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1034 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1036 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1048 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1048 +#: ../../howto/enum.rst:1050 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -937,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1059 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1063 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1063 +#: ../../howto/enum.rst:1065 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1074 +#: ../../howto/enum.rst:1076 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1078 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1094 +#: ../../howto/enum.rst:1096 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1098 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1109 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1111 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1112 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1113 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1118 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1125 +#: ../../howto/enum.rst:1127 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1132 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1143 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1149 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1158 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1159 +#: ../../howto/enum.rst:1161 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1162 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1163 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1164 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1166 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1167 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1166 +#: ../../howto/enum.rst:1168 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1170 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1176 +#: ../../howto/enum.rst:1178 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1178 +#: ../../howto/enum.rst:1180 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1183 +#: ../../howto/enum.rst:1185 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1185 +#: ../../howto/enum.rst:1187 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1196 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1198 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1204 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1206 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1210 +#: ../../howto/enum.rst:1212 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1212 +#: ../../howto/enum.rst:1214 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1218 +#: ../../howto/enum.rst:1220 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1220 +#: ../../howto/enum.rst:1222 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1226 +#: ../../howto/enum.rst:1228 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1236 +#: ../../howto/enum.rst:1238 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1241 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1246 +#: ../../howto/enum.rst:1248 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1250 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1253 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1254 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1255 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1254 +#: ../../howto/enum.rst:1256 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1259 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1263 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1265 +#: ../../howto/enum.rst:1267 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1277 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1281 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1289 +#: ../../howto/enum.rst:1291 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1305 +#: ../../howto/enum.rst:1307 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1307 +#: ../../howto/enum.rst:1309 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1319 +#: ../../howto/enum.rst:1321 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1321 +#: ../../howto/enum.rst:1323 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1340 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1348 +#: ../../howto/enum.rst:1350 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1367 +#: ../../howto/enum.rst:1369 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1373 +#: ../../howto/enum.rst:1375 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1380 +#: ../../howto/enum.rst:1382 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1384 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1416 +#: ../../howto/enum.rst:1418 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1420 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1443 +#: ../../howto/enum.rst:1446 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1449 +#: ../../howto/enum.rst:1452 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1454 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1480 +#: ../../howto/enum.rst:1483 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1482 +#: ../../howto/enum.rst:1485 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1501 +#: ../../howto/enum.rst:1504 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1503 +#: ../../howto/enum.rst:1506 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/regex.po b/howto/regex.po index e9df685f6d..79836d436a 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -455,6 +455,12 @@ msgstr "" #: ../../howto/regex.rst:248 msgid "" +"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " +"example, ``a/{2}b`` will only match ``'a//b'``." +msgstr "" + +#: ../../howto/regex.rst:251 +msgid "" "Readers of a reductionist bent may notice that the three other quantifiers " "can all be expressed using this notation. ``{0,}`` is the same as ``*``, " "``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's " @@ -462,11 +468,11 @@ msgid "" "shorter and easier to read." msgstr "" -#: ../../howto/regex.rst:256 +#: ../../howto/regex.rst:259 msgid "Using Regular Expressions" msgstr "" -#: ../../howto/regex.rst:258 +#: ../../howto/regex.rst:261 msgid "" "Now that we've looked at some simple regular expressions, how do we actually " "use them in Python? The :mod:`re` module provides an interface to the " @@ -474,25 +480,25 @@ msgid "" "perform matches with them." msgstr "" -#: ../../howto/regex.rst:265 +#: ../../howto/regex.rst:268 msgid "Compiling Regular Expressions" msgstr "" -#: ../../howto/regex.rst:267 +#: ../../howto/regex.rst:270 msgid "" "Regular expressions are compiled into pattern objects, which have methods " "for various operations such as searching for pattern matches or performing " "string substitutions. ::" msgstr "" -#: ../../howto/regex.rst:276 +#: ../../howto/regex.rst:279 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " "various special features and syntax variations. We'll go over the available " "settings later, but for now a single example will do::" msgstr "" -#: ../../howto/regex.rst:282 +#: ../../howto/regex.rst:285 msgid "" "The RE is passed to :func:`re.compile` as a string. REs are handled as " "strings because regular expressions aren't part of the core Python language, " @@ -503,17 +509,17 @@ msgid "" "`socket` or :mod:`zlib` modules." msgstr "" -#: ../../howto/regex.rst:289 +#: ../../howto/regex.rst:292 msgid "" "Putting REs in strings keeps the Python language simpler, but has one " "disadvantage which is the topic of the next section." msgstr "" -#: ../../howto/regex.rst:296 +#: ../../howto/regex.rst:299 msgid "The Backslash Plague" msgstr "" -#: ../../howto/regex.rst:298 +#: ../../howto/regex.rst:301 msgid "" "As stated earlier, regular expressions use the backslash character " "(``'\\'``) to indicate special forms or to allow special characters to be " @@ -521,7 +527,7 @@ msgid "" "usage of the same character for the same purpose in string literals." msgstr "" -#: ../../howto/regex.rst:303 +#: ../../howto/regex.rst:306 msgid "" "Let's say you want to write a RE that matches the string ``\\section``, " "which might be found in a LaTeX file. To figure out what to write in the " @@ -533,39 +539,39 @@ msgid "" "*again*." msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Characters" msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Stage" msgstr "" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "``\\section``" msgstr "``\\section``" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "Text string to be matched" msgstr "" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "``\\\\section``" msgstr "``\\\\section``" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "Escaped backslash for :func:`re.compile`" msgstr "" -#: ../../howto/regex.rst:318 ../../howto/regex.rst:345 +#: ../../howto/regex.rst:321 ../../howto/regex.rst:348 msgid "``\"\\\\\\\\section\"``" msgstr "``\"\\\\\\\\section\"``" -#: ../../howto/regex.rst:318 +#: ../../howto/regex.rst:321 msgid "Escaped backslashes for a string literal" msgstr "" -#: ../../howto/regex.rst:321 +#: ../../howto/regex.rst:324 msgid "" "In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as " "the RE string, because the regular expression must be ``\\\\``, and each " @@ -574,7 +580,7 @@ msgid "" "repeated backslashes and makes the resulting strings difficult to understand." msgstr "" -#: ../../howto/regex.rst:327 +#: ../../howto/regex.rst:330 msgid "" "The solution is to use Python's raw string notation for regular expressions; " "backslashes are not handled in any special way in a string literal prefixed " @@ -584,7 +590,7 @@ msgid "" "raw string notation." msgstr "" -#: ../../howto/regex.rst:333 +#: ../../howto/regex.rst:336 msgid "" "In addition, special escape sequences that are valid in regular expressions, " "but not valid as Python string literals, now result in a :exc:" @@ -593,39 +599,39 @@ msgid "" "backslashes isn't used." msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Regular String" msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Raw string" msgstr "" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``\"ab*\"``" msgstr "``\"ab*\"``" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``r\"ab*\"``" msgstr "``r\"ab*\"``" -#: ../../howto/regex.rst:345 +#: ../../howto/regex.rst:348 msgid "``r\"\\\\section\"``" msgstr "``r\"\\\\section\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``\"\\\\w+\\\\s+\\\\1\"``" msgstr "``\"\\\\w+\\\\s+\\\\1\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``r\"\\w+\\s+\\1\"``" msgstr "``r\"\\w+\\s+\\1\"``" -#: ../../howto/regex.rst:352 +#: ../../howto/regex.rst:355 msgid "Performing Matches" msgstr "" -#: ../../howto/regex.rst:354 +#: ../../howto/regex.rst:357 msgid "" "Once you have an object representing a compiled regular expression, what do " "you do with it? Pattern objects have several methods and attributes. Only " @@ -633,51 +639,51 @@ msgid "" "for a complete listing." msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Method/Attribute" msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Purpose" msgstr "" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "``match()``" msgstr "``match()``" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "Determine if the RE matches at the beginning of the string." msgstr "" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "``search()``" msgstr "``search()``" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "Scan through a string, looking for any location where this RE matches." msgstr "" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "``findall()``" msgstr "``findall()``" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "Find all substrings where the RE matches, and returns them as a list." msgstr "" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "``finditer()``" msgstr "``finditer()``" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "" "Find all substrings where the RE matches, and returns them as an :term:" "`iterator`." msgstr "" -#: ../../howto/regex.rst:375 +#: ../../howto/regex.rst:378 msgid "" ":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if " "no match can be found. If they're successful, a :ref:`match object `, so you should store the result in a variable for later use. ::" msgstr "" -#: ../../howto/regex.rst:409 +#: ../../howto/regex.rst:412 msgid "" "Now you can query the :ref:`match object ` for information " "about the matching string. Match object instances also have several methods " "and attributes; the most important ones are:" msgstr "" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "``group()``" msgstr "``group()``" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "Return the string matched by the RE" msgstr "" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "``start()``" msgstr "``start()``" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "Return the starting position of the match" msgstr "" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "``end()``" msgstr "``end()``" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "Return the ending position of the match" msgstr "" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "``span()``" msgstr "``span()``" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "Return a tuple containing the (start, end) positions of the match" msgstr "" -#: ../../howto/regex.rst:426 +#: ../../howto/regex.rst:429 msgid "Trying these methods will soon clarify their meaning::" msgstr "" -#: ../../howto/regex.rst:435 +#: ../../howto/regex.rst:438 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -768,20 +774,20 @@ msgid "" "case. ::" msgstr "" -#: ../../howto/regex.rst:452 +#: ../../howto/regex.rst:455 msgid "" "In actual programs, the most common style is to store the :ref:`match object " "` in a variable, and then check if it was ``None``. This " "usually looks like::" msgstr "" -#: ../../howto/regex.rst:463 +#: ../../howto/regex.rst:466 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" msgstr "" -#: ../../howto/regex.rst:470 +#: ../../howto/regex.rst:473 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -790,7 +796,7 @@ msgid "" "`SyntaxError`. See :ref:`the-backslash-plague`." msgstr "" -#: ../../howto/regex.rst:476 +#: ../../howto/regex.rst:479 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " @@ -798,11 +804,11 @@ msgid "" "`iterator`::" msgstr "" -#: ../../howto/regex.rst:492 +#: ../../howto/regex.rst:495 msgid "Module-Level Functions" msgstr "" -#: ../../howto/regex.rst:494 +#: ../../howto/regex.rst:497 msgid "" "You don't have to create a pattern object and call its methods; the :mod:" "`re` module also provides top-level functions called :func:`~re.match`, :" @@ -812,7 +818,7 @@ msgid "" "``None`` or a :ref:`match object ` instance. ::" msgstr "" -#: ../../howto/regex.rst:506 +#: ../../howto/regex.rst:509 msgid "" "Under the hood, these functions simply create a pattern object for you and " "call the appropriate method on it. They also store the compiled object in a " @@ -820,7 +826,7 @@ msgid "" "again and again." msgstr "" -#: ../../howto/regex.rst:511 +#: ../../howto/regex.rst:514 msgid "" "Should you use these module-level functions, or should you get the pattern " "and call its methods yourself? If you're accessing a regex within a loop, " @@ -828,11 +834,11 @@ msgid "" "not much difference thanks to the internal cache." msgstr "" -#: ../../howto/regex.rst:519 +#: ../../howto/regex.rst:522 msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:523 +#: ../../howto/regex.rst:526 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -844,72 +850,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:531 +#: ../../howto/regex.rst:534 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:560 +#: ../../howto/regex.rst:563 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -925,13 +931,13 @@ msgid "" "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:578 +#: ../../howto/regex.rst:581 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:581 +#: ../../howto/regex.rst:584 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -950,13 +956,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:603 +#: ../../howto/regex.rst:606 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:606 +#: ../../howto/regex.rst:609 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -967,20 +973,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:619 +#: ../../howto/regex.rst:622 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:627 +#: ../../howto/regex.rst:630 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:636 +#: ../../howto/regex.rst:639 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -992,45 +998,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:645 +#: ../../howto/regex.rst:648 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:658 +#: ../../howto/regex.rst:661 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:664 +#: ../../howto/regex.rst:667 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:670 +#: ../../howto/regex.rst:673 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:672 +#: ../../howto/regex.rst:675 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:680 +#: ../../howto/regex.rst:683 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:682 +#: ../../howto/regex.rst:685 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:685 +#: ../../howto/regex.rst:688 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1042,11 +1048,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:701 +#: ../../howto/regex.rst:704 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:694 +#: ../../howto/regex.rst:697 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1056,17 +1062,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:700 +#: ../../howto/regex.rst:703 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:704 +#: ../../howto/regex.rst:707 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1074,37 +1080,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:708 +#: ../../howto/regex.rst:711 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:730 +#: ../../howto/regex.rst:733 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:719 +#: ../../howto/regex.rst:722 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:729 +#: ../../howto/regex.rst:732 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:736 +#: ../../howto/regex.rst:739 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:733 +#: ../../howto/regex.rst:736 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1113,19 +1119,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:774 +#: ../../howto/regex.rst:777 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:742 +#: ../../howto/regex.rst:745 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1133,13 +1139,13 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:747 +#: ../../howto/regex.rst:750 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:758 +#: ../../howto/regex.rst:761 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " @@ -1150,28 +1156,28 @@ msgid "" "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:772 +#: ../../howto/regex.rst:775 msgid "" "Second, inside a character class, where there's no use for this assertion, " "``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:779 +#: ../../howto/regex.rst:782 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:777 +#: ../../howto/regex.rst:780 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:782 +#: ../../howto/regex.rst:785 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:784 +#: ../../howto/regex.rst:787 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1180,14 +1186,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:797 +#: ../../howto/regex.rst:800 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:801 +#: ../../howto/regex.rst:804 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1197,7 +1203,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:812 +#: ../../howto/regex.rst:815 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1209,27 +1215,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:828 +#: ../../howto/regex.rst:831 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:841 +#: ../../howto/regex.rst:844 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:847 +#: ../../howto/regex.rst:850 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:853 +#: ../../howto/regex.rst:856 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1240,11 +1246,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:861 +#: ../../howto/regex.rst:864 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:867 +#: ../../howto/regex.rst:870 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1252,11 +1258,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:873 +#: ../../howto/regex.rst:876 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:875 +#: ../../howto/regex.rst:878 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1265,7 +1271,7 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:881 +#: ../../howto/regex.rst:884 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1276,7 +1282,7 @@ msgid "" "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:888 +#: ../../howto/regex.rst:891 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1287,20 +1293,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:896 +#: ../../howto/regex.rst:899 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:901 +#: ../../howto/regex.rst:904 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:904 +#: ../../howto/regex.rst:907 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1308,7 +1314,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:916 +#: ../../howto/regex.rst:919 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1321,13 +1327,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:925 +#: ../../howto/regex.rst:928 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:928 +#: ../../howto/regex.rst:931 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1339,26 +1345,26 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:943 +#: ../../howto/regex.rst:946 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:950 +#: ../../howto/regex.rst:953 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:961 +#: ../../howto/regex.rst:964 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:964 +#: ../../howto/regex.rst:967 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -1369,22 +1375,22 @@ msgid "" "P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:977 +#: ../../howto/regex.rst:980 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:979 +#: ../../howto/regex.rst:982 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:987 +#: ../../howto/regex.rst:990 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:983 +#: ../../howto/regex.rst:986 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1393,18 +1399,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:995 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:990 +#: ../../howto/regex.rst:993 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:994 +#: ../../howto/regex.rst:997 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1412,15 +1418,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:999 +#: ../../howto/regex.rst:1002 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:1004 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1003 +#: ../../howto/regex.rst:1006 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1430,24 +1436,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1010 +#: ../../howto/regex.rst:1013 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1013 +#: ../../howto/regex.rst:1016 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1017 +#: ../../howto/regex.rst:1020 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1022 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1458,18 +1464,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1027 +#: ../../howto/regex.rst:1030 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1029 +#: ../../howto/regex.rst:1032 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1033 +#: ../../howto/regex.rst:1036 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1477,11 +1483,11 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1038 +#: ../../howto/regex.rst:1041 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1040 +#: ../../howto/regex.rst:1043 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if " @@ -1491,61 +1497,61 @@ msgid "" "the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1047 +#: ../../howto/regex.rst:1050 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1051 +#: ../../howto/regex.rst:1054 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1055 +#: ../../howto/regex.rst:1058 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1060 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1077 +#: ../../howto/regex.rst:1080 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1079 +#: ../../howto/regex.rst:1082 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1555,7 +1561,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1090 +#: ../../howto/regex.rst:1093 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1563,7 +1569,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1095 +#: ../../howto/regex.rst:1098 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1572,7 +1578,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1107 +#: ../../howto/regex.rst:1110 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1580,17 +1586,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1119 +#: ../../howto/regex.rst:1122 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1131 +#: ../../howto/regex.rst:1134 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1133 +#: ../../howto/regex.rst:1136 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1598,40 +1604,40 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1140 +#: ../../howto/regex.rst:1143 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1144 +#: ../../howto/regex.rst:1147 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1148 +#: ../../howto/regex.rst:1151 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1157 +#: ../../howto/regex.rst:1160 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1166 +#: ../../howto/regex.rst:1169 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1173 +#: ../../howto/regex.rst:1176 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " @@ -1642,13 +1648,13 @@ msgid "" "string." msgstr "" -#: ../../howto/regex.rst:1180 +#: ../../howto/regex.rst:1183 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1187 +#: ../../howto/regex.rst:1190 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1660,7 +1666,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1204 +#: ../../howto/regex.rst:1207 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1669,13 +1675,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1210 +#: ../../howto/regex.rst:1213 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1222 +#: ../../howto/regex.rst:1225 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1685,11 +1691,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1230 +#: ../../howto/regex.rst:1233 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1232 +#: ../../howto/regex.rst:1235 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1697,11 +1703,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1238 +#: ../../howto/regex.rst:1241 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1240 +#: ../../howto/regex.rst:1243 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1713,7 +1719,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1248 +#: ../../howto/regex.rst:1251 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1726,7 +1732,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1257 +#: ../../howto/regex.rst:1260 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1735,17 +1741,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1263 +#: ../../howto/regex.rst:1266 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1268 +#: ../../howto/regex.rst:1271 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1270 +#: ../../howto/regex.rst:1273 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1755,13 +1761,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1281 +#: ../../howto/regex.rst:1284 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1289 +#: ../../howto/regex.rst:1292 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1773,18 +1779,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1298 +#: ../../howto/regex.rst:1301 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1304 +#: ../../howto/regex.rst:1307 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1306 +#: ../../howto/regex.rst:1309 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1793,7 +1799,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1320 +#: ../../howto/regex.rst:1323 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1803,7 +1809,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1327 +#: ../../howto/regex.rst:1330 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1812,7 +1818,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1336 +#: ../../howto/regex.rst:1339 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1822,11 +1828,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1344 +#: ../../howto/regex.rst:1347 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1346 +#: ../../howto/regex.rst:1349 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1834,14 +1840,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1351 +#: ../../howto/regex.rst:1354 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1355 +#: ../../howto/regex.rst:1358 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1852,15 +1858,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1372 +#: ../../howto/regex.rst:1375 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1378 +#: ../../howto/regex.rst:1381 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1380 +#: ../../howto/regex.rst:1383 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1868,7 +1874,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1385 +#: ../../howto/regex.rst:1388 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/library/abc.po b/library/abc.po index d6810e2883..36c2de8375 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,8 @@ msgid "" msgstr "" ":mod:`collections` 模組中有一些衍生自 ABC 的具體類別;當然這些類別還可以進一" "步衍生出其他類別。此外,:mod:`collections.abc` 子模組中有一些 ABC 可被用於測" -"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) ` 或它是否為對映 " -"(mapping)。" +"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) " +"` 或它是否為對映 (mapping)。" #: ../../library/abc.rst:27 msgid "" @@ -205,13 +205,13 @@ msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " "even though it does not define an :meth:`~iterator.__iter__` method (it uses " "the old-style iterable protocol, defined in terms of :meth:`__len__` and :" -"meth:`__getitem__`). Note that this will not make ``get_iterator`` " +"meth:`~object.__getitem__`). Note that this will not make ``get_iterator`` " "available as a method of ``Foo``, so it is provided separately." msgstr "" "最後,即使 ``Foo`` 沒有定義 :meth:`~iterator.__iter__` 方法(它使用了以 :" -"meth:`__len__` 和 :meth:`__getitem__` 所定義的舊式可疊代物件協定),最末一行" -"使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 ``get_iterator`` 成" -"為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" +"meth:`__len__` 和 :meth:`~object.__getitem__` 所定義的舊式可疊代物件協定)," +"最末一行使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 " +"``get_iterator`` 成為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" #: ../../library/abc.rst:163 msgid "The :mod:`abc` module also provides the following decorator:" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 372e08e38e..ff4ea8f2f0 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -258,8 +258,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1242 +#: ../../library/asyncio-eventloop.rst:1660 msgid "Example::" msgstr "" "範例:\n" @@ -540,8 +540,8 @@ msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1152 -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1172 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -652,7 +652,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:482 #: ../../library/asyncio-eventloop.rst:597 -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:825 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -667,7 +667,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:915 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -675,9 +675,9 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:738 -#: ../../library/asyncio-eventloop.rst:832 -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -695,18 +695,20 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:508 -#: ../../library/asyncio-eventloop.rst:750 +#: ../../library/asyncio-eventloop.rst:754 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" #: ../../library/asyncio-eventloop.rst:512 msgid "" -"The socket option :py:const:`~socket.TCP_NODELAY` is set by default for all " -"TCP connections." +"The socket option :ref:`socket.TCP_NODELAY ` is set " +"by default for all TCP connections." msgstr "" +"所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY ` " +"socket 選項。" #: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:842 +#: ../../library/asyncio-eventloop.rst:846 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" @@ -730,11 +732,11 @@ msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" #: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:658 -#: ../../library/asyncio-eventloop.rst:764 -#: ../../library/asyncio-eventloop.rst:799 -#: ../../library/asyncio-eventloop.rst:846 -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:931 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" @@ -765,15 +767,15 @@ msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:561 -#: ../../library/asyncio-eventloop.rst:681 -#: ../../library/asyncio-eventloop.rst:813 +#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:817 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" #: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:640 +#: ../../library/asyncio-eventloop.rst:642 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" @@ -804,8 +806,8 @@ msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not defined then " -"this capability is unsupported." +"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " +"is not defined then this capability is unsupported." msgstr "" #: ../../library/asyncio-eventloop.rst:587 @@ -836,115 +838,115 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:608 msgid "" -"The *reuse_address* parameter is no longer supported, as using :py:const:" -"`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " -"Explicitly passing ``reuse_address=True`` will raise an exception." +"The *reuse_address* parameter is no longer supported, as using :ref:`socket." +"SO_REUSEADDR ` poses a significant security concern " +"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:613 +#: ../../library/asyncio-eventloop.rst:614 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:618 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :py:const:`~sockets.SO_REUSEPORT` " -"is used instead, which specifically prevents processes with differing UIDs " -"from assigning sockets to the same socket address." +"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with " +"differing UIDs from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:625 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:628 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:637 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:639 msgid "" "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" "py:const:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:644 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:649 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 -#: ../../library/asyncio-eventloop.rst:790 -#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:1225 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:654 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:662 +#: ../../library/asyncio-eventloop.rst:664 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:674 +#: ../../library/asyncio-eventloop.rst:678 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:677 +#: ../../library/asyncio-eventloop.rst:681 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:683 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:688 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:691 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:690 +#: ../../library/asyncio-eventloop.rst:694 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -952,63 +954,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:702 +#: ../../library/asyncio-eventloop.rst:706 msgid "" "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:711 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:709 +#: ../../library/asyncio-eventloop.rst:713 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:714 +#: ../../library/asyncio-eventloop.rst:718 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:718 +#: ../../library/asyncio-eventloop.rst:722 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:725 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:728 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:733 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:734 +#: ../../library/asyncio-eventloop.rst:738 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:746 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1016,46 +1018,46 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:754 +#: ../../library/asyncio-eventloop.rst:758 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " -"connections." +"option :ref:`socket.TCP_NODELAY ` is set by default " +"for all TCP connections." msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" -"py:const:`~socket.TCP_NODELAY` socket 選項。" +"ref:`socket.TCP_NODELAY ` socket 選項。" -#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:772 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:783 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:782 +#: ../../library/asyncio-eventloop.rst:786 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:798 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1063,63 +1065,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:806 +#: ../../library/asyncio-eventloop.rst:810 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:808 +#: ../../library/asyncio-eventloop.rst:812 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 -#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:905 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:816 +#: ../../library/asyncio-eventloop.rst:820 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:829 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:832 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:840 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:854 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:859 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:858 +#: ../../library/asyncio-eventloop.rst:862 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:860 +#: ../../library/asyncio-eventloop.rst:864 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:862 -#: ../../library/asyncio-eventloop.rst:1107 +#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:1111 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1128,35 +1130,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:877 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:884 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:887 +#: ../../library/asyncio-eventloop.rst:891 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:893 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:893 +#: ../../library/asyncio-eventloop.rst:897 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1164,80 +1166,80 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:898 +#: ../../library/asyncio-eventloop.rst:902 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:907 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:911 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:913 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:936 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:936 +#: ../../library/asyncio-eventloop.rst:940 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:951 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:951 -#: ../../library/asyncio-eventloop.rst:1206 +#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:1212 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:960 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:959 +#: ../../library/asyncio-eventloop.rst:963 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:964 +#: ../../library/asyncio-eventloop.rst:968 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:966 +#: ../../library/asyncio-eventloop.rst:970 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1246,72 +1248,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:975 +#: ../../library/asyncio-eventloop.rst:979 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:978 +#: ../../library/asyncio-eventloop.rst:982 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 -#: ../../library/asyncio-eventloop.rst:994 -#: ../../library/asyncio-eventloop.rst:1005 -#: ../../library/asyncio-eventloop.rst:1017 -#: ../../library/asyncio-eventloop.rst:1032 -#: ../../library/asyncio-eventloop.rst:1047 -#: ../../library/asyncio-eventloop.rst:1057 -#: ../../library/asyncio-eventloop.rst:1083 -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:984 +#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1087 +#: ../../library/asyncio-eventloop.rst:1125 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:982 +#: ../../library/asyncio-eventloop.rst:986 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:989 +#: ../../library/asyncio-eventloop.rst:993 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:992 +#: ../../library/asyncio-eventloop.rst:996 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1004 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 +#: ../../library/asyncio-eventloop.rst:1007 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1011 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1019 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1027 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1026 +#: ../../library/asyncio-eventloop.rst:1030 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1320,34 +1322,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1034 -#: ../../library/asyncio-eventloop.rst:1085 +#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1089 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1041 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1049 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1057 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1055 +#: ../../library/asyncio-eventloop.rst:1059 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1059 +#: ../../library/asyncio-eventloop.rst:1063 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1355,19 +1357,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1072 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1078 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1077 +#: ../../library/asyncio-eventloop.rst:1081 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1375,57 +1377,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1096 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1101 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1100 +#: ../../library/asyncio-eventloop.rst:1104 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1102 +#: ../../library/asyncio-eventloop.rst:1106 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:1109 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1118 +#: ../../library/asyncio-eventloop.rst:1122 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1127 +#: ../../library/asyncio-eventloop.rst:1131 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1132 +#: ../../library/asyncio-eventloop.rst:1136 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:1140 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1142 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1433,67 +1435,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1146 +#: ../../library/asyncio-eventloop.rst:1150 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1154 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1159 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1161 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1161 -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1181 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1170 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1171 +#: ../../library/asyncio-eventloop.rst:1175 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1173 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:1191 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1196 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1202 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1204 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1501,46 +1503,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1215 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1220 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1222 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1223 +#: ../../library/asyncio-eventloop.rst:1229 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1227 +#: ../../library/asyncio-eventloop.rst:1233 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1231 +#: ../../library/asyncio-eventloop.rst:1237 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1239 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1284 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1548,17 +1550,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1289 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1291 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1288 +#: ../../library/asyncio-eventloop.rst:1294 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1566,32 +1568,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1297 +#: ../../library/asyncio-eventloop.rst:1303 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1307 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1307 +#: ../../library/asyncio-eventloop.rst:1313 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1309 +#: ../../library/asyncio-eventloop.rst:1315 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1319 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1321 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1600,171 +1602,182 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1329 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1335 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1340 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1347 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1343 +#: ../../library/asyncio-eventloop.rst:1349 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1353 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1354 +#: ../../library/asyncio-eventloop.rst:1360 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1357 +#: ../../library/asyncio-eventloop.rst:1363 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1364 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1365 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1360 +#: ../../library/asyncio-eventloop.rst:1366 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1367 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1368 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1369 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1364 +#: ../../library/asyncio-eventloop.rst:1370 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1375 +#: ../../library/asyncio-eventloop.rst:1381 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1379 +#: ../../library/asyncio-eventloop.rst:1385 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1381 +#: ../../library/asyncio-eventloop.rst:1387 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1393 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1397 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1402 +msgid "" +"This attribute can be used to set the minimum execution duration in seconds " +"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " +"are logged." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1406 +msgid "Default value is 100 milliseconds." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1410 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1400 +#: ../../library/asyncio-eventloop.rst:1414 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1416 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1437 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1439 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1440 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1443 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1772,85 +1785,85 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1453 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1456 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1458 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 -#: ../../library/asyncio-eventloop.rst:1455 -#: ../../library/asyncio-eventloop.rst:1465 +#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1481 msgid "a file-like object" msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1461 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe()`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1446 -#: ../../library/asyncio-eventloop.rst:1456 -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1462 +#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 -#: ../../library/asyncio-eventloop.rst:1458 -#: ../../library/asyncio-eventloop.rst:1468 +#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1450 -#: ../../library/asyncio-eventloop.rst:1460 -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1486 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1453 +#: ../../library/asyncio-eventloop.rst:1469 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1463 +#: ../../library/asyncio-eventloop.rst:1479 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1488 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1491 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1480 +#: ../../library/asyncio-eventloop.rst:1496 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1858,52 +1871,52 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1489 +#: ../../library/asyncio-eventloop.rst:1505 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1492 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1516 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1521 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1514 +#: ../../library/asyncio-eventloop.rst:1530 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1913,116 +1926,116 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1528 +#: ../../library/asyncio-eventloop.rst:1544 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1548 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1553 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1549 +#: ../../library/asyncio-eventloop.rst:1565 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1555 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1558 +#: ../../library/asyncio-eventloop.rst:1574 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1578 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1564 +#: ../../library/asyncio-eventloop.rst:1580 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1587 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1589 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1577 +#: ../../library/asyncio-eventloop.rst:1593 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1594 +#: ../../library/asyncio-eventloop.rst:1610 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1597 +#: ../../library/asyncio-eventloop.rst:1613 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1602 +#: ../../library/asyncio-eventloop.rst:1618 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1605 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1608 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" -"The server is closed asynchronously, use the :meth:`wait_closed` coroutine " -"to wait until the server is closed." +"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " +"to wait until the server is closed (and no more connections are active)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1613 +#: ../../library/asyncio-eventloop.rst:1630 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1619 +#: ../../library/asyncio-eventloop.rst:1636 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1621 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1641 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2031,98 +2044,100 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1652 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1639 +#: ../../library/asyncio-eventloop.rst:1656 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1661 +#: ../../library/asyncio-eventloop.rst:1678 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1667 -msgid "Wait until the :meth:`close` method completes." +#: ../../library/asyncio-eventloop.rst:1684 +msgid "" +"Wait until the :meth:`close` method completes and all active connections " +"have finished." msgstr "" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1674 +#: ../../library/asyncio-eventloop.rst:1692 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1702 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1686 +#: ../../library/asyncio-eventloop.rst:1704 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1707 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1713 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1715 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1730 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1717 +#: ../../library/asyncio-eventloop.rst:1735 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1719 +#: ../../library/asyncio-eventloop.rst:1737 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1741 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1729 +#: ../../library/asyncio-eventloop.rst:1747 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1731 +#: ../../library/asyncio-eventloop.rst:1749 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1737 +#: ../../library/asyncio-eventloop.rst:1755 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1757 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2130,71 +2145,71 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1749 +#: ../../library/asyncio-eventloop.rst:1767 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1751 +#: ../../library/asyncio-eventloop.rst:1769 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1793 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1800 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1784 +#: ../../library/asyncio-eventloop.rst:1802 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1812 +#: ../../library/asyncio-eventloop.rst:1830 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1837 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1821 +#: ../../library/asyncio-eventloop.rst:1839 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1859 +#: ../../library/asyncio-eventloop.rst:1877 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1863 +#: ../../library/asyncio-eventloop.rst:1881 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1871 +#: ../../library/asyncio-eventloop.rst:1889 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1873 +#: ../../library/asyncio-eventloop.rst:1891 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1875 +#: ../../library/asyncio-eventloop.rst:1893 msgid "" -"Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " -"the :meth:`loop.add_signal_handler` method::" +"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." +"SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index c05bfecad4..8aaf1d8947 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+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-" @@ -102,14 +102,14 @@ msgstr "" #: ../../library/asyncio.rst:48 msgid "" "create and manage :ref:`event loops `, which provide " -"asynchronous APIs for :meth:`networking `, running :meth:" -"`subprocesses `, handling :meth:`OS signals `, etc;" +"asynchronous APIs for :ref:`networking `, running :ref:" +"`subprocesses `, handling :ref:`OS signals " +"`, etc;" msgstr "" "建立與管理 :ref:`event loops(事件迴圈) `,它提供了能被" -"用於\\ :meth:`網路 `\\ 、執行\\ :meth:`子行程 `、處理\\ :meth:`作業系統訊號 `\\ 等" -"任務的非同步 API;" +"用於\\ :ref:`網路 `、執行\\ :ref:`子行程 " +"`、處理\\ :ref:`作業系統訊號 " +"`\\ 等任務的非同步 API;" #: ../../library/asyncio.rst:53 msgid "" diff --git a/library/bz2.po b/library/bz2.po index e031a1d32b..8fe1ff50cc 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -99,11 +99,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:125 +#: ../../library/bz2.rst:59 ../../library/bz2.rst:163 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:132 +#: ../../library/bz2.rst:62 ../../library/bz2.rst:170 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -153,7 +153,7 @@ msgid "" msgstr "" #: ../../library/bz2.rst:94 -msgid ":class:`BZ2File` also provides the following method:" +msgid ":class:`BZ2File` also provides the following methods:" msgstr "" #: ../../library/bz2.rst:98 @@ -171,99 +171,128 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/bz2.rst:110 -msgid "Support for the :keyword:`with` statement was added." +#: ../../library/bz2.rst:111 +msgid "Return the file descriptor for the underlying file." +msgstr "" + +#: ../../library/bz2.rst:117 +msgid "Return whether the file was opened for reading." +msgstr "" + +#: ../../library/bz2.rst:123 +msgid "Return whether the file supports seeking." +msgstr "" + +#: ../../library/bz2.rst:129 +msgid "Return whether the file was opened for writing." msgstr "" -#: ../../library/bz2.rst:113 +#: ../../library/bz2.rst:135 msgid "" -"The :meth:`fileno`, :meth:`readable`, :meth:`seekable`, :meth:`writable`, :" -"meth:`read1` and :meth:`readinto` methods were added." +"Read up to *size* uncompressed bytes, while trying to avoid making multiple " +"reads from the underlying stream. Reads up to a buffer's worth of data if " +"size is negative." msgstr "" -#: ../../library/bz2.rst:117 +#: ../../library/bz2.rst:139 +msgid "Returns ``b''`` if the file is at EOF." +msgstr "" + +#: ../../library/bz2.rst:145 +msgid "Read bytes into *b*." +msgstr "" + +#: ../../library/bz2.rst:147 +msgid "Returns the number of bytes read (0 for EOF)." +msgstr "" + +#: ../../library/bz2.rst:152 +msgid "Support for the :keyword:`with` statement was added." +msgstr "" + +#: ../../library/bz2.rst:155 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: ../../library/bz2.rst:121 +#: ../../library/bz2.rst:159 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: ../../library/bz2.rst:128 +#: ../../library/bz2.rst:166 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:135 +#: ../../library/bz2.rst:173 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:140 +#: ../../library/bz2.rst:178 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:142 +#: ../../library/bz2.rst:180 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:149 +#: ../../library/bz2.rst:187 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:153 +#: ../../library/bz2.rst:191 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:157 ../../library/bz2.rst:245 +#: ../../library/bz2.rst:195 ../../library/bz2.rst:283 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:162 +#: ../../library/bz2.rst:200 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:165 +#: ../../library/bz2.rst:203 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:171 +#: ../../library/bz2.rst:209 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:174 +#: ../../library/bz2.rst:212 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:179 +#: ../../library/bz2.rst:217 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:184 +#: ../../library/bz2.rst:222 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -271,7 +300,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:191 +#: ../../library/bz2.rst:229 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -279,7 +308,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:197 +#: ../../library/bz2.rst:235 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -288,99 +317,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:204 +#: ../../library/bz2.rst:242 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:209 +#: ../../library/bz2.rst:247 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:213 +#: ../../library/bz2.rst:251 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:218 +#: ../../library/bz2.rst:256 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:225 +#: ../../library/bz2.rst:263 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:227 +#: ../../library/bz2.rst:265 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:232 +#: ../../library/bz2.rst:270 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:239 +#: ../../library/bz2.rst:277 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:243 +#: ../../library/bz2.rst:281 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:248 +#: ../../library/bz2.rst:286 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:253 +#: ../../library/bz2.rst:291 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:255 +#: ../../library/bz2.rst:293 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:258 +#: ../../library/bz2.rst:296 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:260 +#: ../../library/bz2.rst:298 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:266 +#: ../../library/bz2.rst:304 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:268 +#: ../../library/bz2.rst:306 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:270 +#: ../../library/bz2.rst:308 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:288 +#: ../../library/bz2.rst:326 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:306 +#: ../../library/bz2.rst:344 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:310 +#: ../../library/bz2.rst:348 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/codecs.po b/library/codecs.po index c619a48de8..2ff557ff55 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-21 00:03+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-" @@ -369,8 +369,8 @@ msgid "Value" msgstr "" #: ../../library/codecs.rst:330 ../../library/codecs.rst:373 -#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Meaning" msgstr "" @@ -637,7 +637,7 @@ msgid "" "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:525 +#: ../../library/codecs.rst:527 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 +#: ../../library/codecs.rst:532 ../../library/codecs.rst:554 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:533 +#: ../../library/codecs.rst:535 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:537 +#: ../../library/codecs.rst:539 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:543 +#: ../../library/codecs.rst:545 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:548 +#: ../../library/codecs.rst:550 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:555 +#: ../../library/codecs.rst:557 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:559 +#: ../../library/codecs.rst:561 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:564 +#: ../../library/codecs.rst:566 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:566 +#: ../../library/codecs.rst:568 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:574 +#: ../../library/codecs.rst:576 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:583 +#: ../../library/codecs.rst:585 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:585 +#: ../../library/codecs.rst:587 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:592 +#: ../../library/codecs.rst:594 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:594 +#: ../../library/codecs.rst:596 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:598 +#: ../../library/codecs.rst:600 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:602 +#: ../../library/codecs.rst:604 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 " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:610 +#: ../../library/codecs.rst:612 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:617 +#: ../../library/codecs.rst:619 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:624 +#: ../../library/codecs.rst:626 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 " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:633 +#: ../../library/codecs.rst:635 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:640 +#: ../../library/codecs.rst:642 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:642 +#: ../../library/codecs.rst:644 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:649 +#: ../../library/codecs.rst:651 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:651 +#: ../../library/codecs.rst:653 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:655 +#: ../../library/codecs.rst:657 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:659 +#: ../../library/codecs.rst:661 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 " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:667 +#: ../../library/codecs.rst:669 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:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:678 +#: ../../library/codecs.rst:680 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:683 +#: ../../library/codecs.rst:685 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. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:698 +#: ../../library/codecs.rst:700 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:705 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:706 +#: ../../library/codecs.rst:708 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." +"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:714 +#: ../../library/codecs.rst:716 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:716 +#: ../../library/codecs.rst:718 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:723 +#: ../../library/codecs.rst:725 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:725 +#: ../../library/codecs.rst:727 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:729 +#: ../../library/codecs.rst:731 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:732 +#: ../../library/codecs.rst:734 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:736 +#: ../../library/codecs.rst:738 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 " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:744 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:747 +#: ../../library/codecs.rst:749 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:755 ../../library/codecs.rst:850 +#: ../../library/codecs.rst:757 ../../library/codecs.rst:852 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:757 +#: ../../library/codecs.rst:759 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:762 +#: ../../library/codecs.rst:764 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:769 +#: ../../library/codecs.rst:771 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:771 +#: ../../library/codecs.rst:773 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:778 +#: ../../library/codecs.rst:780 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:780 +#: ../../library/codecs.rst:782 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:784 +#: ../../library/codecs.rst:786 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:787 +#: ../../library/codecs.rst:789 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:791 +#: ../../library/codecs.rst:793 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 " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:795 +#: ../../library/codecs.rst:797 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:803 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:803 +#: ../../library/codecs.rst:805 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:808 +#: ../../library/codecs.rst:810 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:815 +#: ../../library/codecs.rst:817 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:819 +#: ../../library/codecs.rst:821 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 " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:827 +#: ../../library/codecs.rst:829 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:831 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:832 +#: ../../library/codecs.rst:834 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:840 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:841 +#: ../../library/codecs.rst:843 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:844 +#: ../../library/codecs.rst:846 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:852 +#: ../../library/codecs.rst:854 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:856 +#: ../../library/codecs.rst:858 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:862 +#: ../../library/codecs.rst:864 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:864 +#: ../../library/codecs.rst:866 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 +#: ../../library/codecs.rst:869 ../../library/codecs.rst:893 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:873 +#: ../../library/codecs.rst:875 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,42 +1089,42 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:878 +#: ../../library/codecs.rst:880 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:886 +#: ../../library/codecs.rst:888 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:888 +#: ../../library/codecs.rst:890 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:897 +#: ../../library/codecs.rst:899 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " -"conversion: *encode* and *decode* work on the frontend — the data visible to " -"code calling :meth:`read` and :meth:`write`, while *Reader* and *Writer* " -"work on the backend — the data in *stream*." +"conversion: *encode* and *decode* work on the frontend — the data visible to " +"code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " +"while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:905 +#: ../../library/codecs.rst:908 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:907 +#: ../../library/codecs.rst:910 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:912 +#: ../../library/codecs.rst:915 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:916 +#: ../../library/codecs.rst:919 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:924 +#: ../../library/codecs.rst:927 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:926 +#: ../../library/codecs.rst:929 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:939 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 " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:944 +#: ../../library/codecs.rst:947 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 " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:951 +#: ../../library/codecs.rst:954 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 " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:977 +#: ../../library/codecs.rst:980 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 " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Range" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1000 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1002 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:1003 +#: ../../library/codecs.rst:1006 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1019 +#: ../../library/codecs.rst:1022 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 " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1035 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1037 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 " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1044 +#: ../../library/codecs.rst:1047 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:1058 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 " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1063 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1065 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:1065 +#: ../../library/codecs.rst:1068 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1067 +#: ../../library/codecs.rst:1070 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1075 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1077 ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1091 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1079 ../../library/codecs.rst:1081 +#: ../../library/codecs.rst:1139 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 -#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1089 ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1225 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 -#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 -#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 -#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1102 +#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1156 ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1237 ../../library/codecs.rst:1265 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1096 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 -#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1096 ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1164 ../../library/codecs.rst:1221 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1095 +#: ../../library/codecs.rst:1098 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 -#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 -#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1133 ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1223 ../../library/codecs.rst:1258 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1216 ../../library/codecs.rst:1233 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 -#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1262 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1218 ../../library/codecs.rst:1255 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1109 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 -#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1160 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1267 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1117 ../../library/codecs.rst:1260 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1243 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1133 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 -#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 -#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 -#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1172 ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1191 ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1199 ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1204 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1278 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 -#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1137 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1241 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1145 ../../library/codecs.rst:1249 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 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:1177 +#: ../../library/codecs.rst:1180 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1180 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1180 ../../library/codecs.rst:1189 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1187 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 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:1209 +#: ../../library/codecs.rst:1212 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1212 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1243 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1249 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1251 ../../library/codecs.rst:1269 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 -#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 -#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1281 ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1285 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1289 ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1293 ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1297 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1300 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:1303 +#: ../../library/codecs.rst:1306 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1308 +#: ../../library/codecs.rst:1311 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1313 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 " @@ -2305,272 +2305,274 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1318 +#: ../../library/codecs.rst:1321 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1323 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:1329 +#: ../../library/codecs.rst:1332 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1329 +#: ../../library/codecs.rst:1332 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 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:1378 +#: ../../library/codecs.rst:1381 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1385 +#: ../../library/codecs.rst:1388 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1387 +#: ../../library/codecs.rst:1390 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:1395 +#: ../../library/codecs.rst:1398 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1402 +#: ../../library/codecs.rst:1405 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1420 -msgid ":meth:`uu.encode` / :meth:`uu.decode`" +#: ../../library/codecs.rst:1423 +#, fuzzy +msgid "" +":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1432 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1436 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1439 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1441 +#: ../../library/codecs.rst:1446 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1443 +#: ../../library/codecs.rst:1448 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:1452 +#: ../../library/codecs.rst:1457 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1457 +#: ../../library/codecs.rst:1462 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1460 +#: ../../library/codecs.rst:1465 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:1470 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1471 +#: ../../library/codecs.rst:1476 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2580,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1481 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1479 +#: ../../library/codecs.rst:1484 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." @@ -2598,7 +2600,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1490 +#: ../../library/codecs.rst:1495 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2617,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1503 +#: ../../library/codecs.rst:1508 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:1507 +#: ../../library/codecs.rst:1512 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2632,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1515 +#: ../../library/codecs.rst:1520 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1521 +#: ../../library/codecs.rst:1526 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1532 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1531 +#: ../../library/codecs.rst:1536 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1541 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1538 +#: ../../library/codecs.rst:1543 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1540 +#: ../../library/codecs.rst:1545 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1543 +#: ../../library/codecs.rst:1548 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1549 +#: ../../library/codecs.rst:1554 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1555 +#: ../../library/codecs.rst:1560 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/collections.abc.po b/library/collections.abc.po index 9c36761182..ac7a5b7e47 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -430,9 +430,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` " +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:200 @@ -463,9 +463,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` method. " +"The only reliable way to determine whether an object is :term:`iterable` is " +"to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:231 @@ -499,11 +499,11 @@ msgstr "" msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " -"underlying :meth:`__getitem__` method. Consequently, if :meth:`__getitem__` " -"is implemented with constant access speed, the mixin methods will have " -"linear performance; however, if the underlying method is linear (as it would " -"be with a linked list), the mixins will have quadratic performance and will " -"likely need to be overridden." +"underlying :meth:`~object.__getitem__` method. Consequently, if :meth:" +"`~object.__getitem__` is implemented with constant access speed, the mixin " +"methods will have linear performance; however, if the underlying method is " +"linear (as it would be with a linked list), the mixins will have quadratic " +"performance and will likely need to be overridden." msgstr "" #: ../../library/collections.abc.rst:272 diff --git a/library/collections.po b/library/collections.po index 78ac6d2647..8eef17b770 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -934,24 +934,24 @@ msgstr "" #: ../../library/collections.rst:746 msgid "" -"This method is called by the :meth:`__getitem__` method of the :class:`dict` " -"class when the requested key is not found; whatever it returns or raises is " -"then returned or raised by :meth:`__getitem__`." +"This method is called by the :meth:`~object.__getitem__` method of the :" +"class:`dict` class when the requested key is not found; whatever it returns " +"or raises is then returned or raised by :meth:`~object.__getitem__`." msgstr "" -"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`__getitem__` " -"方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:`__getitem__` 所傳" -"遞。" +"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`~object." +"__getitem__` 方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:" +"`~object.__getitem__` 所傳遞。" #: ../../library/collections.rst:750 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" -"meth:`__getitem__`. This means that :meth:`get` will, like normal " +"meth:`~object.__getitem__`. This means that :meth:`get` will, like normal " "dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" -"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`__getitem__` 以外的其他方法呼" -"叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設值,而非使" -"用 :attr:`default_factory`。" +"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`~object.__getitem__` 以外的其" +"他方法呼叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設" +"值,而非使用 :attr:`default_factory`。" #: ../../library/collections.rst:756 msgid ":class:`defaultdict` objects support the following instance variable:" diff --git a/library/contextlib.po b/library/contextlib.po index d304c5e28c..e31c9625e1 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,7 +64,8 @@ msgstr "" msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`with` statement context managers, without needing to " -"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods." +"create a class or separate :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods." msgstr "" #: ../../library/contextlib.rst:50 @@ -418,8 +419,8 @@ msgstr "" #: ../../library/contextlib.rst:518 msgid "" -"The :meth:`__enter__` method returns the :class:`ExitStack` instance, and " -"performs no additional operations." +"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " +"instance, and performs no additional operations." msgstr "" #: ../../library/contextlib.rst:521 @@ -457,9 +458,9 @@ msgstr "" #: ../../library/contextlib.rst:546 msgid "" -"Enters a new context manager and adds its :meth:`__exit__` method to the " -"callback stack. The return value is the result of the context manager's own :" -"meth:`__enter__` method." +"Enters a new context manager and adds its :meth:`~object.__exit__` method to " +"the callback stack. The return value is the result of the context manager's " +"own :meth:`~object.__enter__` method." msgstr "" #: ../../library/contextlib.rst:550 @@ -475,27 +476,29 @@ msgid "" msgstr "" #: ../../library/contextlib.rst:559 -msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." +msgid "" +"Adds a context manager's :meth:`~object.__exit__` method to the callback " +"stack." msgstr "" #: ../../library/contextlib.rst:561 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " -"an :meth:`__enter__` implementation with a context manager's own :meth:" -"`__exit__` method." +"an :meth:`~object.__enter__` implementation with a context manager's own :" +"meth:`~object.__exit__` method." msgstr "" #: ../../library/contextlib.rst:565 msgid "" "If passed an object that is not a context manager, this method assumes it is " -"a callback with the same signature as a context manager's :meth:`__exit__` " -"method and adds it directly to the callback stack." +"a callback with the same signature as a context manager's :meth:`~object." +"__exit__` method and adds it directly to the callback stack." msgstr "" #: ../../library/contextlib.rst:569 msgid "" "By returning true values, these callbacks can suppress exceptions the same " -"way context manager :meth:`__exit__` methods can." +"way context manager :meth:`~object.__exit__` methods can." msgstr "" #: ../../library/contextlib.rst:572 @@ -648,7 +651,7 @@ msgstr "" msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" -"meth:`__enter__` implementation fail." +"meth:`~object.__enter__` implementation fail." msgstr "" #: ../../library/contextlib.rst:719 @@ -741,8 +744,8 @@ msgstr "" msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" -"`__enter__`. If that value is needed, then it is still necessary to use an " -"explicit ``with`` statement." +"`~object.__enter__`. If that value is needed, then it is still necessary to " +"use an explicit ``with`` statement." msgstr "" #: ../../library/contextlib.rst:880 diff --git a/library/difflib.po b/library/difflib.po index fd4440ff4a..3fd67c4ee7 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-04 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,7 +72,7 @@ msgid "" "``False`` when creating the :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:384 +#: ../../library/difflib.rst:55 ../../library/difflib.rst:386 msgid "The *autojunk* parameter." msgstr "*autojunk* 參數。" @@ -92,7 +92,7 @@ msgstr "" msgid "Code" msgstr "" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:494 +#: ../../library/difflib.rst:69 ../../library/difflib.rst:496 msgid "Meaning" msgstr "" @@ -249,13 +249,13 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:165 ../../library/difflib.rst:294 +#: ../../library/difflib.rst:165 ../../library/difflib.rst:297 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" -#: ../../library/difflib.rst:168 ../../library/difflib.rst:297 +#: ../../library/difflib.rst:168 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -264,11 +264,11 @@ msgid "" "default to blanks." msgstr "" -#: ../../library/difflib.rst:191 ../../library/difflib.rst:318 +#: ../../library/difflib.rst:194 ../../library/difflib.rst:320 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "一個更詳盡的範例請見 :ref:`difflib-interface`\\ 。" -#: ../../library/difflib.rst:196 +#: ../../library/difflib.rst:199 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -276,37 +276,37 @@ msgid "" "strings)." msgstr "" -#: ../../library/difflib.rst:200 +#: ../../library/difflib.rst:203 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" -#: ../../library/difflib.rst:203 +#: ../../library/difflib.rst:206 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" -#: ../../library/difflib.rst:206 +#: ../../library/difflib.rst:209 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" -#: ../../library/difflib.rst:222 +#: ../../library/difflib.rst:225 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" -#: ../../library/difflib.rst:225 +#: ../../library/difflib.rst:228 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:228 +#: ../../library/difflib.rst:231 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -317,7 +317,7 @@ msgid "" "this usually works better than using this function." msgstr "" -#: ../../library/difflib.rst:236 +#: ../../library/difflib.rst:239 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -325,28 +325,28 @@ msgid "" "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" -#: ../../library/difflib.rst:257 +#: ../../library/difflib.rst:260 msgid "Return one of the two sequences that generated a delta." msgstr "" -#: ../../library/difflib.rst:259 +#: ../../library/difflib.rst:262 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" -#: ../../library/difflib.rst:263 +#: ../../library/difflib.rst:266 msgid "Example:" msgstr "範例:" -#: ../../library/difflib.rst:280 +#: ../../library/difflib.rst:283 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" -#: ../../library/difflib.rst:283 +#: ../../library/difflib.rst:286 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -354,7 +354,7 @@ msgid "" "set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:288 +#: ../../library/difflib.rst:291 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -363,14 +363,23 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:322 +#: ../../library/difflib.rst:300 +msgid "" +"The unified diff format normally has a header for filenames and modification " +"times. Any or all of these may be specified using strings for *fromfile*, " +"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " +"normally expressed in the ISO 8601 format. If not specified, the strings " +"default to blanks." +msgstr "" + +#: ../../library/difflib.rst:324 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" -#: ../../library/difflib.rst:327 +#: ../../library/difflib.rst:329 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -380,42 +389,42 @@ msgid "" "unknown/inconsistent encodings as *a* and *b*." msgstr "" -#: ../../library/difflib.rst:338 +#: ../../library/difflib.rst:340 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" -#: ../../library/difflib.rst:345 +#: ../../library/difflib.rst:347 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" -#: ../../library/difflib.rst:360 +#: ../../library/difflib.rst:362 msgid "SequenceMatcher Objects" msgstr "SequenceMatcher 物件" -#: ../../library/difflib.rst:362 +#: ../../library/difflib.rst:364 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:367 +#: ../../library/difflib.rst:369 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -424,26 +433,26 @@ msgid "" "ignored. For example, pass::" msgstr "" -#: ../../library/difflib.rst:375 +#: ../../library/difflib.rst:377 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" -#: ../../library/difflib.rst:378 +#: ../../library/difflib.rst:380 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -#: ../../library/difflib.rst:381 +#: ../../library/difflib.rst:383 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" -#: ../../library/difflib.rst:387 +#: ../../library/difflib.rst:389 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -453,19 +462,19 @@ msgid "" "`set_seqs` or :meth:`set_seq2`." msgstr "" -#: ../../library/difflib.rst:394 +#: ../../library/difflib.rst:396 msgid "The *bjunk* and *bpopular* attributes." msgstr "" -#: ../../library/difflib.rst:397 +#: ../../library/difflib.rst:399 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "" -#: ../../library/difflib.rst:401 +#: ../../library/difflib.rst:403 msgid "Set the two sequences to be compared." msgstr "" -#: ../../library/difflib.rst:403 +#: ../../library/difflib.rst:405 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -473,23 +482,23 @@ msgid "" "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -#: ../../library/difflib.rst:411 +#: ../../library/difflib.rst:413 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:417 +#: ../../library/difflib.rst:419 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:423 +#: ../../library/difflib.rst:425 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" -#: ../../library/difflib.rst:425 +#: ../../library/difflib.rst:427 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -501,7 +510,7 @@ msgid "" "that starts earliest in *b*." msgstr "" -#: ../../library/difflib.rst:438 +#: ../../library/difflib.rst:440 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -510,7 +519,7 @@ msgid "" "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -#: ../../library/difflib.rst:445 +#: ../../library/difflib.rst:447 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -518,26 +527,26 @@ msgid "" "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" -#: ../../library/difflib.rst:454 +#: ../../library/difflib.rst:456 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "" -#: ../../library/difflib.rst:456 +#: ../../library/difflib.rst:458 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:460 msgid "Added default arguments." msgstr "新增預設引數。" -#: ../../library/difflib.rst:464 +#: ../../library/difflib.rst:466 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" "j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -#: ../../library/difflib.rst:469 +#: ../../library/difflib.rst:471 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -546,7 +555,7 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" -#: ../../library/difflib.rst:486 +#: ../../library/difflib.rst:488 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -554,104 +563,104 @@ msgid "" "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -#: ../../library/difflib.rst:491 +#: ../../library/difflib.rst:493 msgid "The *tag* values are strings, with these meanings:" msgstr "" -#: ../../library/difflib.rst:494 +#: ../../library/difflib.rst:496 msgid "Value" msgstr "" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``'delete'``" msgstr "``'delete'``" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "``'insert'``" msgstr "``'insert'``" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``'equal'``" msgstr "``'equal'``" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:512 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/difflib.rst:527 +#: ../../library/difflib.rst:529 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" -#: ../../library/difflib.rst:529 +#: ../../library/difflib.rst:531 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -#: ../../library/difflib.rst:533 +#: ../../library/difflib.rst:535 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "" -#: ../../library/difflib.rst:538 +#: ../../library/difflib.rst:540 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" -#: ../../library/difflib.rst:541 +#: ../../library/difflib.rst:543 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" -#: ../../library/difflib.rst:545 +#: ../../library/difflib.rst:547 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" -#: ../../library/difflib.rst:552 +#: ../../library/difflib.rst:554 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" -#: ../../library/difflib.rst:563 +#: ../../library/difflib.rst:565 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" -#: ../../library/difflib.rst:568 +#: ../../library/difflib.rst:570 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "" -#: ../../library/difflib.rst:571 +#: ../../library/difflib.rst:573 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -660,28 +669,28 @@ msgid "" "ratio`:" msgstr "" -#: ../../library/difflib.rst:588 +#: ../../library/difflib.rst:590 msgid "SequenceMatcher Examples" msgstr "SequenceMatcher 範例" -#: ../../library/difflib.rst:590 +#: ../../library/difflib.rst:592 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" -#: ../../library/difflib.rst:596 +#: ../../library/difflib.rst:598 msgid "" ":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " "similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." "ratio` value over 0.6 means the sequences are close matches:" msgstr "" -#: ../../library/difflib.rst:603 +#: ../../library/difflib.rst:605 msgid "" "If you're only interested in where the sequences match, :meth:" "`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" -#: ../../library/difflib.rst:612 +#: ../../library/difflib.rst:614 msgid "" "Note that the last tuple returned by :meth:`~SequenceMatcher." "get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " @@ -689,29 +698,29 @@ msgid "" "is ``0``." msgstr "" -#: ../../library/difflib.rst:616 +#: ../../library/difflib.rst:618 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`~SequenceMatcher.get_opcodes`:" msgstr "" -#: ../../library/difflib.rst:627 +#: ../../library/difflib.rst:629 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" -#: ../../library/difflib.rst:631 +#: ../../library/difflib.rst:633 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:639 +#: ../../library/difflib.rst:641 msgid "Differ Objects" msgstr "" -#: ../../library/difflib.rst:641 +#: ../../library/difflib.rst:643 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -721,31 +730,31 @@ msgid "" "longer diff." msgstr "" -#: ../../library/difflib.rst:647 +#: ../../library/difflib.rst:649 msgid "The :class:`Differ` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:653 +#: ../../library/difflib.rst:655 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:656 +#: ../../library/difflib.rst:658 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" -#: ../../library/difflib.rst:660 +#: ../../library/difflib.rst:662 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" -#: ../../library/difflib.rst:664 +#: ../../library/difflib.rst:666 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -753,17 +762,17 @@ msgid "" "*isjunk* parameter for an explanation." msgstr "" -#: ../../library/difflib.rst:670 +#: ../../library/difflib.rst:672 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" -#: ../../library/difflib.rst:675 +#: ../../library/difflib.rst:677 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" -#: ../../library/difflib.rst:677 +#: ../../library/difflib.rst:679 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -772,11 +781,11 @@ msgid "" "IOBase.writelines` method of a file-like object." msgstr "" -#: ../../library/difflib.rst:688 +#: ../../library/difflib.rst:690 msgid "Differ Example" msgstr "" -#: ../../library/difflib.rst:690 +#: ../../library/difflib.rst:692 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " @@ -784,45 +793,45 @@ msgid "" "objects):" msgstr "" -#: ../../library/difflib.rst:709 +#: ../../library/difflib.rst:711 msgid "Next we instantiate a Differ object:" msgstr "" -#: ../../library/difflib.rst:713 +#: ../../library/difflib.rst:715 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" -#: ../../library/difflib.rst:717 +#: ../../library/difflib.rst:719 msgid "Finally, we compare the two:" msgstr "" -#: ../../library/difflib.rst:721 +#: ../../library/difflib.rst:723 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" -#: ../../library/difflib.rst:736 +#: ../../library/difflib.rst:738 msgid "As a single multi-line string it looks like this:" msgstr "" -#: ../../library/difflib.rst:755 +#: ../../library/difflib.rst:757 msgid "A command-line interface to difflib" msgstr "" -#: ../../library/difflib.rst:757 +#: ../../library/difflib.rst:759 msgid "" "This example shows how to use difflib to create a ``diff``-like utility." msgstr "" -#: ../../library/difflib.rst:762 +#: ../../library/difflib.rst:764 msgid "ndiff example" msgstr "" "ndiff 範例:\n" "\n" "::" -#: ../../library/difflib.rst:764 +#: ../../library/difflib.rst:766 msgid "This example shows how to use :func:`difflib.ndiff`." msgstr "" diff --git a/library/dis.po b/library/dis.po index 149873e707..5b4accee2c 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-18 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,69 +68,83 @@ msgid "" "shown by passing ``adaptive=True``." msgstr "" -#: ../../library/dis.rst:46 +#: ../../library/dis.rst:45 +msgid "" +"The argument of a jump is the offset of the target instruction relative to " +"the instruction that appears immediately after the jump instruction's :" +"opcode:`CACHE` entries." +msgstr "" + +#: ../../library/dis.rst:50 +msgid "" +"As a consequence, the presence of the :opcode:`CACHE` instructions is " +"transparent for forward jumps but needs to be taken into account when " +"reasoning about backward jumps." +msgstr "" + +#: ../../library/dis.rst:54 msgid "Example: Given the function :func:`!myfunc`::" msgstr "" -#: ../../library/dis.rst:51 +#: ../../library/dis.rst:59 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" -#: ../../library/dis.rst:64 +#: ../../library/dis.rst:72 msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:69 +#: ../../library/dis.rst:77 msgid "Command-line interface" msgstr "" -#: ../../library/dis.rst:71 +#: ../../library/dis.rst:79 msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" -#: ../../library/dis.rst:77 +#: ../../library/dis.rst:85 msgid "The following options are accepted:" msgstr "" -#: ../../library/dis.rst:83 +#: ../../library/dis.rst:91 msgid "Display usage and exit." msgstr "" -#: ../../library/dis.rst:85 +#: ../../library/dis.rst:93 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " "stdout. Otherwise, disassembly is performed on compiled source code recieved " "from stdin." msgstr "" -#: ../../library/dis.rst:89 +#: ../../library/dis.rst:97 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:93 +#: ../../library/dis.rst:101 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:100 +#: ../../library/dis.rst:108 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:104 +#: ../../library/dis.rst:112 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:108 ../../library/dis.rst:296 +#: ../../library/dis.rst:116 ../../library/dis.rst:304 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -138,71 +152,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:113 +#: ../../library/dis.rst:121 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:117 +#: ../../library/dis.rst:125 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:120 +#: ../../library/dis.rst:128 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:125 +#: ../../library/dis.rst:133 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:138 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:134 +#: ../../library/dis.rst:142 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:138 +#: ../../library/dis.rst:146 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:143 +#: ../../library/dis.rst:151 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:146 ../../library/dis.rst:186 -#: ../../library/dis.rst:238 +#: ../../library/dis.rst:154 ../../library/dis.rst:194 +#: ../../library/dis.rst:246 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:149 ../../library/dis.rst:241 -#: ../../library/dis.rst:257 ../../library/dis.rst:284 -#: ../../library/dis.rst:305 +#: ../../library/dis.rst:157 ../../library/dis.rst:249 +#: ../../library/dis.rst:265 ../../library/dis.rst:292 +#: ../../library/dis.rst:313 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:152 +#: ../../library/dis.rst:160 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:168 +#: ../../library/dis.rst:176 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:178 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -210,39 +224,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:176 +#: ../../library/dis.rst:184 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:180 +#: ../../library/dis.rst:188 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:192 +#: ../../library/dis.rst:200 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:196 +#: ../../library/dis.rst:204 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:201 ../../library/dis.rst:232 -#: ../../library/dis.rst:254 ../../library/dis.rst:281 +#: ../../library/dis.rst:209 ../../library/dis.rst:240 +#: ../../library/dis.rst:262 ../../library/dis.rst:289 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:215 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -258,127 +272,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:220 ../../library/dis.rst:251 -#: ../../library/dis.rst:278 +#: ../../library/dis.rst:228 ../../library/dis.rst:259 +#: ../../library/dis.rst:286 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:223 +#: ../../library/dis.rst:231 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:226 +#: ../../library/dis.rst:234 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:229 +#: ../../library/dis.rst:237 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:235 +#: ../../library/dis.rst:243 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:255 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:264 +#: ../../library/dis.rst:272 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:267 +#: ../../library/dis.rst:275 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:276 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:269 +#: ../../library/dis.rst:277 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:270 +#: ../../library/dis.rst:278 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:279 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:272 +#: ../../library/dis.rst:280 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:273 +#: ../../library/dis.rst:281 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:275 +#: ../../library/dis.rst:283 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:290 +#: ../../library/dis.rst:298 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:301 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:301 +#: ../../library/dis.rst:309 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:319 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:315 +#: ../../library/dis.rst:323 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:326 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:333 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:331 +#: ../../library/dis.rst:339 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:333 +#: ../../library/dis.rst:341 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -386,118 +400,122 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:348 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:355 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:349 +#: ../../library/dis.rst:357 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:354 +#: ../../library/dis.rst:362 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:358 +#: ../../library/dis.rst:366 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:364 +#: ../../library/dis.rst:372 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:369 +#: ../../library/dis.rst:377 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:374 +#: ../../library/dis.rst:382 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:379 +#: ../../library/dis.rst:387 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:393 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:398 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:395 +#: ../../library/dis.rst:403 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:408 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:407 +#: ../../library/dis.rst:415 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:412 +#: ../../library/dis.rst:420 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:422 +#: ../../library/dis.rst:430 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:425 +#: ../../library/dis.rst:433 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:427 +#: ../../library/dis.rst:435 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:441 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:439 +#: ../../library/dis.rst:447 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:446 +#: ../../library/dis.rst:454 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:455 +#: ../../library/dis.rst:463 +msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." +msgstr "" + +#: ../../library/dis.rst:471 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:466 +#: ../../library/dis.rst:482 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:475 +#: ../../library/dis.rst:491 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -505,91 +523,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:480 +#: ../../library/dis.rst:496 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:484 +#: ../../library/dis.rst:500 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:491 +#: ../../library/dis.rst:507 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:493 +#: ../../library/dis.rst:509 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:499 +#: ../../library/dis.rst:515 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:504 +#: ../../library/dis.rst:520 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:509 +#: ../../library/dis.rst:525 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:514 +#: ../../library/dis.rst:530 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:519 +#: ../../library/dis.rst:535 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:525 +#: ../../library/dis.rst:541 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:527 +#: ../../library/dis.rst:543 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:530 +#: ../../library/dis.rst:546 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:537 +#: ../../library/dis.rst:553 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:549 ../../library/dis.rst:558 -#: ../../library/dis.rst:568 ../../library/dis.rst:576 -#: ../../library/dis.rst:588 ../../library/dis.rst:676 -#: ../../library/dis.rst:686 ../../library/dis.rst:696 -#: ../../library/dis.rst:916 ../../library/dis.rst:927 -#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:565 ../../library/dis.rst:574 +#: ../../library/dis.rst:584 ../../library/dis.rst:592 +#: ../../library/dis.rst:604 ../../library/dis.rst:692 +#: ../../library/dis.rst:702 ../../library/dis.rst:712 +#: ../../library/dis.rst:932 ../../library/dis.rst:943 +#: ../../library/dis.rst:1043 ../../library/dis.rst:1055 +#: ../../library/dis.rst:1067 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:599 +#: ../../library/dis.rst:615 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:619 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -597,39 +615,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:608 +#: ../../library/dis.rst:624 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:611 +#: ../../library/dis.rst:627 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:612 +#: ../../library/dis.rst:628 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:616 +#: ../../library/dis.rst:632 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:622 +#: ../../library/dis.rst:638 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:625 +#: ../../library/dis.rst:641 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:632 +#: ../../library/dis.rst:648 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:640 +#: ../../library/dis.rst:656 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -637,13 +655,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:647 ../../library/dis.rst:752 -#: ../../library/dis.rst:763 +#: ../../library/dis.rst:663 ../../library/dis.rst:768 +#: ../../library/dis.rst:779 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:653 +#: ../../library/dis.rst:669 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -651,35 +669,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:663 +#: ../../library/dis.rst:679 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:672 +#: ../../library/dis.rst:688 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:681 +#: ../../library/dis.rst:697 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:691 +#: ../../library/dis.rst:707 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:702 +#: ../../library/dis.rst:718 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:705 +#: ../../library/dis.rst:721 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:725 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -687,29 +705,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:717 +#: ../../library/dis.rst:733 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:722 +#: ../../library/dis.rst:738 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:729 +#: ../../library/dis.rst:745 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:731 +#: ../../library/dis.rst:747 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:734 +#: ../../library/dis.rst:750 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:740 +#: ../../library/dis.rst:756 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -717,39 +735,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:750 +#: ../../library/dis.rst:766 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:757 +#: ../../library/dis.rst:773 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:768 +#: ../../library/dis.rst:784 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:776 +#: ../../library/dis.rst:792 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:784 +#: ../../library/dis.rst:800 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:787 +#: ../../library/dis.rst:803 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -757,7 +775,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:812 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -765,25 +783,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:819 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:810 +#: ../../library/dis.rst:826 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:818 +#: ../../library/dis.rst:834 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:840 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -792,11 +810,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:835 +#: ../../library/dis.rst:851 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:842 +#: ../../library/dis.rst:858 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -804,7 +822,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:852 +#: ../../library/dis.rst:868 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -813,20 +831,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:862 +#: ../../library/dis.rst:878 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:868 ../../library/dis.rst:1489 +#: ../../library/dis.rst:884 ../../library/dis.rst:1511 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:891 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -834,19 +852,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:898 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:904 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:897 +#: ../../library/dis.rst:913 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -854,11 +872,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:902 +#: ../../library/dis.rst:918 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:904 +#: ../../library/dis.rst:920 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -867,50 +885,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:926 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:922 +#: ../../library/dis.rst:938 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:932 +#: ../../library/dis.rst:948 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:938 +#: ../../library/dis.rst:954 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:943 +#: ../../library/dis.rst:959 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:964 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:953 +#: ../../library/dis.rst:969 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:959 +#: ../../library/dis.rst:975 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:968 +#: ../../library/dis.rst:984 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -919,69 +937,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:995 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:989 +#: ../../library/dis.rst:1005 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:994 +#: ../../library/dis.rst:1010 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:999 +#: ../../library/dis.rst:1015 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1003 +#: ../../library/dis.rst:1019 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1026 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1035 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1048 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1044 +#: ../../library/dis.rst:1060 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1072 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1079 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1086 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1089 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -992,49 +1010,60 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1097 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1104 +msgid "" +"This opcode implements :func:`super`, both in its zero-argument and two-" +"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " +"self).method()``, ``super(cls, self).attr``)." +msgstr "" + +#: ../../library/dis.rst:1108 +msgid "" +"It pops three values from the stack (from top of stack down): - ``self``: " +"the first argument to the current method - ``cls``: the class within which " +"the current method was defined - the global ``super``" +msgstr "" + +#: ../../library/dis.rst:1113 msgid "" -"This opcode implements :func:`super` (e.g. ``super().method()`` and " -"``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " -"``namei`` is shifted left by 2 bits instead of 1, and instead of expecting a " -"single receiver on the stack, it expects three objects (from top of stack " -"down): ``self`` (the first argument to the current method), ``cls`` (the " -"class within which the current method was defined), and the global ``super``." +"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " +"except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1116 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" -"`LOAD_ATTR`." +"`LOAD_ATTR`, which results in pushing ``None`` and the loaded method. When " +"it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1098 +#: ../../library/dis.rst:1120 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1106 +#: ../../library/dis.rst:1128 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1126 +#: ../../library/dis.rst:1148 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1043,68 +1072,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1134 +#: ../../library/dis.rst:1156 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1141 +#: ../../library/dis.rst:1163 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1146 +#: ../../library/dis.rst:1168 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1153 +#: ../../library/dis.rst:1175 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1160 +#: ../../library/dis.rst:1182 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 +#: ../../library/dis.rst:1185 ../../library/dis.rst:1198 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 -#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 +#: ../../library/dis.rst:1190 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1216 ../../library/dis.rst:1230 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1195 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1208 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1211 ../../library/dis.rst:1225 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1222 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1213 +#: ../../library/dis.rst:1235 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1112,83 +1141,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1218 +#: ../../library/dis.rst:1240 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1245 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1253 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1239 +#: ../../library/dis.rst:1261 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1269 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1277 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1282 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1265 +#: ../../library/dis.rst:1287 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1273 +#: ../../library/dis.rst:1295 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1298 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 -#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 +#: ../../library/dis.rst:1301 ../../library/dis.rst:1310 +#: ../../library/dis.rst:1332 ../../library/dis.rst:1343 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1198,94 +1227,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1307 +#: ../../library/dis.rst:1329 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1338 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1349 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1358 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1362 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1341 +#: ../../library/dis.rst:1363 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1347 +#: ../../library/dis.rst:1369 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1374 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 +#: ../../library/dis.rst:1375 ../../library/dis.rst:1381 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 +#: ../../library/dis.rst:1377 ../../library/dis.rst:1384 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1357 +#: ../../library/dis.rst:1379 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1360 +#: ../../library/dis.rst:1382 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1383 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1364 +#: ../../library/dis.rst:1386 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1389 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1398 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1297,70 +1326,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1413 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1409 +#: ../../library/dis.rst:1431 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1434 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1437 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1416 +#: ../../library/dis.rst:1438 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1417 +#: ../../library/dis.rst:1439 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1441 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1444 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1452 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1458 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1368,54 +1397,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1461 +#: ../../library/dis.rst:1483 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1485 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1465 +#: ../../library/dis.rst:1487 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1467 +#: ../../library/dis.rst:1489 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1470 +#: ../../library/dis.rst:1492 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1423,258 +1452,257 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1518 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1500 +#: ../../library/dis.rst:1522 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1524 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1503 +#: ../../library/dis.rst:1525 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1504 +#: ../../library/dis.rst:1526 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1511 +#: ../../library/dis.rst:1533 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1542 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1523 +#: ../../library/dis.rst:1545 msgid "" -"If the call raises :exc:`StopIteration`, pop both items, push the " -"exception's ``value`` attribute, and increment the bytecode counter by " -"*delta*." +"If the call raises :exc:`StopIteration`, pop the top value from the stack, " +"push the exception's ``value`` attribute, and increment the bytecode counter " +"by *delta*." msgstr "" -#: ../../library/dis.rst:1532 +#: ../../library/dis.rst:1554 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1558 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1539 +#: ../../library/dis.rst:1561 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " -"functionality that is necessary but not performance critical." +"functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 +#: ../../library/dis.rst:1577 ../../library/dis.rst:1631 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Description" msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1582 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 +#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "" -"Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " -"``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " -"implement functionality that is necessary but not performance critical." +"Calls an intrinsic function with two arguments. Used to implement " +"functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1636 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1630 +#: ../../library/dis.rst:1656 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1658 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1637 +#: ../../library/dis.rst:1663 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1644 +#: ../../library/dis.rst:1670 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1683,75 +1711,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1679 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1683 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1664 +#: ../../library/dis.rst:1690 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1670 +#: ../../library/dis.rst:1696 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1675 +#: ../../library/dis.rst:1701 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1708 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1710 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1687 +#: ../../library/dis.rst:1713 msgid "" -"The collections now contain pseudo instructions as well. These are opcodes " -"with values ``>= MIN_PSEUDO_OPCODE``." +"The collections now contain pseudo instructions and instrumented " +"instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " +"and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1720 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1725 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1730 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1735 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1742 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1720 +#: ../../library/dis.rst:1747 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1759,34 +1788,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1755 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1733 +#: ../../library/dis.rst:1760 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1738 +#: ../../library/dis.rst:1765 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1770 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1748 +#: ../../library/dis.rst:1775 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1779 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index 60db19b76a..64c365b17f 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -240,42 +240,59 @@ msgstr "" #: ../../library/doctest.rst:280 msgid "" -"In addition, if ``M.__test__`` exists and \"is true\", it must be a dict, " -"and each entry maps a (string) name to a function object, class object, or " -"string. Function and class object docstrings found from ``M.__test__`` are " -"searched, and strings are treated as if they were docstrings. In output, a " -"key ``K`` in ``M.__test__`` appears with name ::" +"In addition, there are cases when you want tests to be part of a module but " +"not part of the help text, which requires that the tests not be included in " +"the docstring. Doctest looks for a module-level variable called ``__test__`` " +"and uses it to locate other tests. If ``M.__test__`` exists and is truthy, " +"it must be a dict, and each entry maps a (string) name to a function object, " +"class object, or string. Function and class object docstrings found from ``M." +"__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." +"__test__.K``." msgstr "" -#: ../../library/doctest.rst:288 +#: ../../library/doctest.rst:289 +msgid "For example, place this block of code at the top of :file:`example.py`:" +msgstr "" + +#: ../../library/doctest.rst:303 +msgid "" +"The value of ``example.__test__[\"numbers\"]`` will be treated as a " +"docstring and all the tests inside it will be run. It is important to note " +"that the value can be mapped to a function, class object, or module; if so, :" +"mod:`!doctest` searches them recursively for docstrings, which are then " +"scanned for tests." +msgstr "" + +#: ../../library/doctest.rst:309 msgid "" "Any classes found are recursively searched similarly, to test docstrings in " "their contained methods and nested classes." msgstr "" -#: ../../library/doctest.rst:295 +#: ../../library/doctest.rst:316 msgid "How are Docstring Examples Recognized?" msgstr "" -#: ../../library/doctest.rst:297 +#: ../../library/doctest.rst:318 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:322 +#: ../../library/doctest.rst:343 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:326 +#: ../../library/doctest.rst:347 msgid "The fine print:" msgstr "" -#: ../../library/doctest.rst:328 +#: ../../library/doctest.rst:349 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 +300,7 @@ msgid "" "line is expected." msgstr "" -#: ../../library/doctest.rst:333 +#: ../../library/doctest.rst:354 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 +315,20 @@ msgid "" "`DocTestParser` class." msgstr "" -#: ../../library/doctest.rst:345 +#: ../../library/doctest.rst:366 msgid "" "Output to stdout is captured, but not output to stderr (exception tracebacks " "are captured via a different means)." msgstr "" -#: ../../library/doctest.rst:348 +#: ../../library/doctest.rst:369 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:358 +#: ../../library/doctest.rst:379 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 +336,21 @@ msgid "" "use a raw string)::" msgstr "" -#: ../../library/doctest.rst:368 +#: ../../library/doctest.rst:389 msgid "The starting column doesn't matter::" msgstr "" -#: ../../library/doctest.rst:375 +#: ../../library/doctest.rst:396 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:382 +#: ../../library/doctest.rst:403 msgid "What's the Execution Context?" msgstr "" -#: ../../library/doctest.rst:384 +#: ../../library/doctest.rst:405 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 +361,17 @@ msgid "" "defined in other docstrings." msgstr "" -#: ../../library/doctest.rst:392 +#: ../../library/doctest.rst:413 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:399 +#: ../../library/doctest.rst:420 msgid "What About Exceptions?" msgstr "" -#: ../../library/doctest.rst:401 +#: ../../library/doctest.rst:422 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 +380,34 @@ msgid "" "it accepts." msgstr "" -#: ../../library/doctest.rst:407 +#: ../../library/doctest.rst:428 msgid "Simple example::" msgstr "" "簡單範例:\n" "\n" "::" -#: ../../library/doctest.rst:414 +#: ../../library/doctest.rst:435 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:417 +#: ../../library/doctest.rst:438 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:424 +#: ../../library/doctest.rst:445 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:428 +#: ../../library/doctest.rst:449 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 +415,20 @@ msgid "" "multi-line detail::" msgstr "" -#: ../../library/doctest.rst:440 +#: ../../library/doctest.rst:461 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:443 +#: ../../library/doctest.rst:464 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:453 +#: ../../library/doctest.rst:474 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 +437,11 @@ msgid "" "transcript of a Monty Python skit." msgstr "" -#: ../../library/doctest.rst:459 +#: ../../library/doctest.rst:480 msgid "Some details you should read once, but won't need to remember:" msgstr "" -#: ../../library/doctest.rst:461 +#: ../../library/doctest.rst:482 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 +451,7 @@ msgid "" "create real problems." msgstr "" -#: ../../library/doctest.rst:468 +#: ../../library/doctest.rst:489 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 +460,14 @@ msgid "" "course this does the right thing for genuine tracebacks." msgstr "" -#: ../../library/doctest.rst:474 +#: ../../library/doctest.rst:495 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:478 +#: ../../library/doctest.rst:499 msgid "" "The interactive shell omits the traceback header line for some :exc:" "`SyntaxError`\\ s. But doctest uses the traceback header line to " @@ -459,13 +476,13 @@ msgid "" "need to manually add the traceback header line to your test example." msgstr "" -#: ../../library/doctest.rst:486 +#: ../../library/doctest.rst:507 msgid "" "For some exceptions, Python displays the position of the error using ``^`` " "markers and tildes::" msgstr "" -#: ../../library/doctest.rst:495 +#: ../../library/doctest.rst:516 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 +490,11 @@ msgid "" "location::" msgstr "" -#: ../../library/doctest.rst:510 +#: ../../library/doctest.rst:531 msgid "Option Flags" msgstr "" -#: ../../library/doctest.rst:512 +#: ../../library/doctest.rst:533 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 +504,17 @@ msgid "" "option." msgstr "" -#: ../../library/doctest.rst:518 +#: ../../library/doctest.rst:539 msgid "The ``-o`` command line option." msgstr "" -#: ../../library/doctest.rst:521 +#: ../../library/doctest.rst:542 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:527 +#: ../../library/doctest.rst:548 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 +526,7 @@ msgid "" "not for several years." msgstr "" -#: ../../library/doctest.rst:539 +#: ../../library/doctest.rst:560 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 +535,7 @@ msgid "" "`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." msgstr "" -#: ../../library/doctest.rst:548 +#: ../../library/doctest.rst:569 msgid "" "When specified, all sequences of whitespace (blanks and newlines) are " "treated as equal. Any sequence of whitespace within the expected output " @@ -528,7 +545,7 @@ msgid "" "across multiple lines in your source." msgstr "" -#: ../../library/doctest.rst:559 +#: ../../library/doctest.rst:580 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -537,14 +554,14 @@ msgid "" "matched too much!\" surprises that ``.*`` is prone to in regular expressions." msgstr "" -#: ../../library/doctest.rst:568 +#: ../../library/doctest.rst:589 msgid "" "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:572 +#: ../../library/doctest.rst:593 msgid "" "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:" @@ -554,20 +571,20 @@ msgid "" "these variations will work with the flag specified:" msgstr "" -#: ../../library/doctest.rst:594 +#: ../../library/doctest.rst:615 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 the " "module name is present or matches exactly." msgstr "" -#: ../../library/doctest.rst:598 +#: ../../library/doctest.rst:619 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -#: ../../library/doctest.rst:605 +#: ../../library/doctest.rst:626 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, " @@ -576,32 +593,32 @@ msgid "" "might depend on resources which would be unavailable to the test driver." msgstr "" -#: ../../library/doctest.rst:611 +#: ../../library/doctest.rst:632 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" -#: ../../library/doctest.rst:616 +#: ../../library/doctest.rst:637 msgid "A bitmask or'ing together all the comparison flags above." msgstr "" -#: ../../library/doctest.rst:618 +#: ../../library/doctest.rst:639 msgid "The second group of options controls how test failures are reported:" msgstr "" -#: ../../library/doctest.rst:623 +#: ../../library/doctest.rst:644 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." msgstr "" -#: ../../library/doctest.rst:629 +#: ../../library/doctest.rst:650 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." msgstr "" -#: ../../library/doctest.rst:635 +#: ../../library/doctest.rst:656 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -611,7 +628,7 @@ msgid "" "mismatching column positions." msgstr "" -#: ../../library/doctest.rst:644 +#: ../../library/doctest.rst:665 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -622,7 +639,7 @@ msgid "" "of failures reported; only the output is suppressed." msgstr "" -#: ../../library/doctest.rst:655 +#: ../../library/doctest.rst:676 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 " @@ -630,23 +647,23 @@ msgid "" "first failure won't even produce debugging output." msgstr "" -#: ../../library/doctest.rst:660 +#: ../../library/doctest.rst:681 msgid "" "The doctest command line accepts the option ``-f`` as a shorthand for ``-o " "FAIL_FAST``." msgstr "" -#: ../../library/doctest.rst:668 +#: ../../library/doctest.rst:689 msgid "A bitmask or'ing together all the reporting flags above." msgstr "" -#: ../../library/doctest.rst:671 +#: ../../library/doctest.rst:692 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:677 +#: ../../library/doctest.rst:698 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 :" @@ -655,35 +672,35 @@ msgid "" "be called using the following idiom::" msgstr "" -#: ../../library/doctest.rst:693 +#: ../../library/doctest.rst:714 msgid "Directives" msgstr "" -#: ../../library/doctest.rst:695 +#: ../../library/doctest.rst:716 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:706 +#: ../../library/doctest.rst:727 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:710 +#: ../../library/doctest.rst:731 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:713 +#: ../../library/doctest.rst:734 msgid "For example, this test passes:" msgstr "" -#: ../../library/doctest.rst:722 +#: ../../library/doctest.rst:743 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 " @@ -691,26 +708,26 @@ msgid "" "a directive to do so:" msgstr "" -#: ../../library/doctest.rst:733 +#: ../../library/doctest.rst:754 msgid "" "Multiple directives can be used on a single physical line, separated by " "commas:" msgstr "" -#: ../../library/doctest.rst:742 +#: ../../library/doctest.rst:763 msgid "" "If multiple directive comments are used for a single example, then they are " "combined:" msgstr "" -#: ../../library/doctest.rst:752 +#: ../../library/doctest.rst:773 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:" msgstr "" -#: ../../library/doctest.rst:763 +#: ../../library/doctest.rst:784 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 " @@ -720,11 +737,11 @@ msgid "" "be useful." msgstr "" -#: ../../library/doctest.rst:773 +#: ../../library/doctest.rst:794 msgid "Warnings" msgstr "" -#: ../../library/doctest.rst:775 +#: ../../library/doctest.rst:796 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 " @@ -734,51 +751,51 @@ msgid "" "test like ::" msgstr "" -#: ../../library/doctest.rst:784 +#: ../../library/doctest.rst:805 msgid "is vulnerable! One workaround is to do ::" msgstr "" -#: ../../library/doctest.rst:789 +#: ../../library/doctest.rst:810 msgid "instead. Another is to do ::" msgstr "" -#: ../../library/doctest.rst:795 +#: ../../library/doctest.rst:816 msgid "There are others, but you get the idea." msgstr "" -#: ../../library/doctest.rst:797 +#: ../../library/doctest.rst:818 msgid "Another bad idea is to print things that embed an object address, like" msgstr "" -#: ../../library/doctest.rst:807 +#: ../../library/doctest.rst:828 msgid "" "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" -#: ../../library/doctest.rst:815 +#: ../../library/doctest.rst:836 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:826 +#: ../../library/doctest.rst:847 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:832 +#: ../../library/doctest.rst:853 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." msgstr "" -#: ../../library/doctest.rst:839 +#: ../../library/doctest.rst:860 msgid "Basic API" msgstr "" -#: ../../library/doctest.rst:841 +#: ../../library/doctest.rst:862 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -786,25 +803,25 @@ msgid "" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -#: ../../library/doctest.rst:849 +#: ../../library/doctest.rst:870 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:852 +#: ../../library/doctest.rst:873 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/doctest.rst:855 +#: ../../library/doctest.rst:876 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" msgstr "" -#: ../../library/doctest.rst:858 +#: ../../library/doctest.rst:879 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -814,20 +831,20 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" -#: ../../library/doctest.rst:865 +#: ../../library/doctest.rst:886 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:869 +#: ../../library/doctest.rst:890 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:872 +#: ../../library/doctest.rst:893 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-" @@ -836,7 +853,7 @@ msgid "" "is an error to specify *package* if *module_relative* is ``False``." msgstr "" -#: ../../library/doctest.rst:878 +#: ../../library/doctest.rst:899 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 " @@ -844,7 +861,7 @@ msgid "" "``None``, a new empty dict is used." msgstr "" -#: ../../library/doctest.rst:883 +#: ../../library/doctest.rst:904 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -857,27 +874,27 @@ msgid "" "tested." msgstr "" -#: ../../library/doctest.rst:892 +#: ../../library/doctest.rst:913 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:896 +#: ../../library/doctest.rst:917 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:900 +#: ../../library/doctest.rst:921 msgid "" "Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " "` of option flags. See section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:904 +#: ../../library/doctest.rst:925 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. " @@ -885,33 +902,33 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:909 ../../library/doctest.rst:1049 +#: ../../library/doctest.rst:930 ../../library/doctest.rst:1070 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:913 ../../library/doctest.rst:1053 +#: ../../library/doctest.rst:934 ../../library/doctest.rst:1074 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." msgstr "" -#: ../../library/doctest.rst:919 +#: ../../library/doctest.rst:940 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:922 +#: ../../library/doctest.rst:943 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:926 +#: ../../library/doctest.rst:947 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 " @@ -919,22 +936,22 @@ msgid "" "are searched directly, as if they were docstrings." msgstr "" -#: ../../library/doctest.rst:931 +#: ../../library/doctest.rst:952 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" -#: ../../library/doctest.rst:933 +#: ../../library/doctest.rst:954 msgid "Return ``(failure_count, test_count)``." msgstr "" -#: ../../library/doctest.rst:935 +#: ../../library/doctest.rst:956 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:938 +#: ../../library/doctest.rst:959 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " @@ -944,39 +961,39 @@ msgid "" "class:`DocTestFinder` constructor defaults to true." msgstr "" -#: ../../library/doctest.rst:945 +#: ../../library/doctest.rst:966 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:952 +#: ../../library/doctest.rst:973 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:955 +#: ../../library/doctest.rst:976 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:957 +#: ../../library/doctest.rst:978 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:960 +#: ../../library/doctest.rst:981 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:963 +#: ../../library/doctest.rst:984 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 " @@ -984,16 +1001,16 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:967 +#: ../../library/doctest.rst:988 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:973 +#: ../../library/doctest.rst:994 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:975 +#: ../../library/doctest.rst:996 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 " @@ -1002,19 +1019,19 @@ msgid "" "discovery, include a :func:`load_tests` function in your test module::" msgstr "" -#: ../../library/doctest.rst:989 +#: ../../library/doctest.rst:1010 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:995 +#: ../../library/doctest.rst:1016 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:998 +#: ../../library/doctest.rst:1019 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 " @@ -1023,21 +1040,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1004 +#: ../../library/doctest.rst:1025 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1006 +#: ../../library/doctest.rst:1027 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1008 +#: ../../library/doctest.rst:1029 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1011 +#: ../../library/doctest.rst:1032 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1048,14 +1065,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1019 +#: ../../library/doctest.rst:1040 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:1023 +#: ../../library/doctest.rst:1044 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-" @@ -1065,7 +1082,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1030 +#: ../../library/doctest.rst:1051 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 " @@ -1073,7 +1090,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1035 +#: ../../library/doctest.rst:1056 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* " @@ -1081,14 +1098,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1040 ../../library/doctest.rst:1074 +#: ../../library/doctest.rst:1061 ../../library/doctest.rst:1095 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:1044 +#: ../../library/doctest.rst:1065 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1096,17 +1113,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:1077 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1062 +#: ../../library/doctest.rst:1083 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1064 +#: ../../library/doctest.rst:1085 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, " @@ -1115,42 +1132,42 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1070 +#: ../../library/doctest.rst:1091 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:1078 +#: ../../library/doctest.rst:1099 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:1081 +#: ../../library/doctest.rst:1102 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:1084 +#: ../../library/doctest.rst:1105 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1087 +#: ../../library/doctest.rst:1108 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1089 +#: ../../library/doctest.rst:1110 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1094 +#: ../../library/doctest.rst:1115 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " @@ -1159,14 +1176,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1100 +#: ../../library/doctest.rst:1121 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:1104 +#: ../../library/doctest.rst:1125 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 :" @@ -1179,23 +1196,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1114 +#: ../../library/doctest.rst:1135 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:1120 +#: ../../library/doctest.rst:1141 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1122 +#: ../../library/doctest.rst:1143 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:1125 +#: ../../library/doctest.rst:1146 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " @@ -1209,17 +1226,17 @@ msgid "" "`doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1136 +#: ../../library/doctest.rst:1157 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:1143 +#: ../../library/doctest.rst:1164 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1145 +#: ../../library/doctest.rst:1166 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 " @@ -1227,85 +1244,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1150 +#: ../../library/doctest.rst:1171 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:1153 +#: ../../library/doctest.rst:1174 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1156 +#: ../../library/doctest.rst:1177 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1159 +#: ../../library/doctest.rst:1180 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1162 +#: ../../library/doctest.rst:1183 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:1166 +#: ../../library/doctest.rst:1187 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1169 +#: ../../library/doctest.rst:1190 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1172 +#: ../../library/doctest.rst:1193 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1175 +#: ../../library/doctest.rst:1196 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1191 +#: ../../library/doctest.rst:1212 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1196 +#: ../../library/doctest.rst:1217 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:1200 +#: ../../library/doctest.rst:1221 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1206 +#: ../../library/doctest.rst:1227 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1212 +#: ../../library/doctest.rst:1233 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 " @@ -1313,57 +1330,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1220 +#: ../../library/doctest.rst:1241 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:1226 +#: ../../library/doctest.rst:1247 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:1233 +#: ../../library/doctest.rst:1254 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:1240 +#: ../../library/doctest.rst:1261 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:1247 +#: ../../library/doctest.rst:1268 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1252 +#: ../../library/doctest.rst:1273 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:1257 +#: ../../library/doctest.rst:1278 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1263 +#: ../../library/doctest.rst:1284 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:1270 +#: ../../library/doctest.rst:1291 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 " @@ -1371,7 +1388,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1278 +#: ../../library/doctest.rst:1299 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 " @@ -1380,20 +1397,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1287 +#: ../../library/doctest.rst:1308 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:1294 +#: ../../library/doctest.rst:1315 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:1300 +#: ../../library/doctest.rst:1321 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 " @@ -1402,11 +1419,11 @@ msgid "" "are set." msgstr "" -#: ../../library/doctest.rst:1309 +#: ../../library/doctest.rst:1330 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1314 +#: ../../library/doctest.rst:1335 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 " @@ -1414,48 +1431,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1319 +#: ../../library/doctest.rst:1340 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:1322 +#: ../../library/doctest.rst:1343 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:1325 +#: ../../library/doctest.rst:1346 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:1328 +#: ../../library/doctest.rst:1349 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:1332 +#: ../../library/doctest.rst:1353 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1337 +#: ../../library/doctest.rst:1358 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:1340 +#: ../../library/doctest.rst:1361 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:1344 +#: ../../library/doctest.rst:1365 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 " @@ -1463,26 +1480,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1369 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1350 +#: ../../library/doctest.rst:1371 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:1354 +#: ../../library/doctest.rst:1375 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1356 +#: ../../library/doctest.rst:1377 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1358 +#: ../../library/doctest.rst:1379 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 " @@ -1491,7 +1508,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1364 +#: ../../library/doctest.rst:1385 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1501,34 +1518,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1375 +#: ../../library/doctest.rst:1396 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1380 +#: ../../library/doctest.rst:1401 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:1384 ../../library/doctest.rst:1452 +#: ../../library/doctest.rst:1405 ../../library/doctest.rst:1473 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1389 +#: ../../library/doctest.rst:1410 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1392 +#: ../../library/doctest.rst:1413 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:1399 +#: ../../library/doctest.rst:1420 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 " @@ -1536,7 +1553,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1406 +#: ../../library/doctest.rst:1427 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 " @@ -1544,17 +1561,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1415 +#: ../../library/doctest.rst:1436 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1420 +#: ../../library/doctest.rst:1441 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1423 +#: ../../library/doctest.rst:1444 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1564,7 +1581,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1429 +#: ../../library/doctest.rst:1450 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 " @@ -1575,14 +1592,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1437 +#: ../../library/doctest.rst:1458 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:1441 +#: ../../library/doctest.rst:1462 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1591,56 +1608,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1447 +#: ../../library/doctest.rst:1468 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:1457 +#: ../../library/doctest.rst:1478 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:1461 +#: ../../library/doctest.rst:1482 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:1468 +#: ../../library/doctest.rst:1489 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:1472 ../../library/doctest.rst:1483 +#: ../../library/doctest.rst:1493 ../../library/doctest.rst:1504 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:1479 +#: ../../library/doctest.rst:1500 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:1490 +#: ../../library/doctest.rst:1511 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:1494 +#: ../../library/doctest.rst:1515 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1648,13 +1665,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1502 +#: ../../library/doctest.rst:1523 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1505 +#: ../../library/doctest.rst:1526 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, " @@ -1662,39 +1679,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1510 +#: ../../library/doctest.rst:1531 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:1514 +#: ../../library/doctest.rst:1535 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:1521 +#: ../../library/doctest.rst:1542 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:1524 +#: ../../library/doctest.rst:1545 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:1531 +#: ../../library/doctest.rst:1552 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1536 +#: ../../library/doctest.rst:1557 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1703,11 +1720,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1543 +#: ../../library/doctest.rst:1564 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1547 +#: ../../library/doctest.rst:1568 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1716,28 +1733,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1556 +#: ../../library/doctest.rst:1577 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:1564 +#: ../../library/doctest.rst:1585 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1566 +#: ../../library/doctest.rst:1587 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1568 +#: ../../library/doctest.rst:1589 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1571 +#: ../../library/doctest.rst:1592 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1745,13 +1762,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1576 +#: ../../library/doctest.rst:1597 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1579 +#: ../../library/doctest.rst:1600 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 " @@ -1759,21 +1776,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1594 +#: ../../library/doctest.rst:1615 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1627 +#: ../../library/doctest.rst:1648 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1633 +#: ../../library/doctest.rst:1654 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1635 +#: ../../library/doctest.rst:1656 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 " @@ -1781,22 +1798,22 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1650 +#: ../../library/doctest.rst:1671 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1660 +#: ../../library/doctest.rst:1681 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:1667 +#: ../../library/doctest.rst:1688 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1669 +#: ../../library/doctest.rst:1690 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 " @@ -1806,17 +1823,17 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" -#: ../../library/doctest.rst:1679 +#: ../../library/doctest.rst:1700 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:1685 +#: ../../library/doctest.rst:1706 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1687 +#: ../../library/doctest.rst:1708 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1824,13 +1841,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1692 +#: ../../library/doctest.rst:1713 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1695 +#: ../../library/doctest.rst:1716 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 " @@ -1842,30 +1859,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1706 +#: ../../library/doctest.rst:1727 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1708 +#: ../../library/doctest.rst:1729 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:1711 +#: ../../library/doctest.rst:1732 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1713 +#: ../../library/doctest.rst:1734 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:1718 +#: ../../library/doctest.rst:1739 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 " @@ -1873,7 +1890,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1726 +#: ../../library/doctest.rst:1747 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1883,89 +1900,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1733 +#: ../../library/doctest.rst:1754 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:1736 +#: ../../library/doctest.rst:1757 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1741 +#: ../../library/doctest.rst:1762 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:1745 +#: ../../library/doctest.rst:1766 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1750 ../../library/doctest.rst:1774 +#: ../../library/doctest.rst:1771 ../../library/doctest.rst:1795 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1755 ../../library/doctest.rst:1779 +#: ../../library/doctest.rst:1776 ../../library/doctest.rst:1800 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1760 +#: ../../library/doctest.rst:1781 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1765 +#: ../../library/doctest.rst:1786 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:1769 +#: ../../library/doctest.rst:1790 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1784 +#: ../../library/doctest.rst:1805 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1791 +#: ../../library/doctest.rst:1812 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1793 +#: ../../library/doctest.rst:1814 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1796 +#: ../../library/doctest.rst:1817 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1798 +#: ../../library/doctest.rst:1819 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1821 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1802 +#: ../../library/doctest.rst:1823 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:1806 +#: ../../library/doctest.rst:1827 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. " @@ -1977,7 +1994,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1814 +#: ../../library/doctest.rst:1835 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 " @@ -1998,13 +2015,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1832 +#: ../../library/doctest.rst:1853 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1835 +#: ../../library/doctest.rst:1856 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2012,7 +2029,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1840 +#: ../../library/doctest.rst:1861 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2020,13 +2037,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1844 +#: ../../library/doctest.rst:1865 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1847 +#: ../../library/doctest.rst:1868 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-" @@ -2034,53 +2051,53 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1869 +#: ../../library/doctest.rst:1890 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1870 +#: ../../library/doctest.rst:1891 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 " "that also makes for a confusing test." msgstr "" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid ">>>" msgstr ">>>" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/doctest.rst:318 ../../library/doctest.rst:556 +#: ../../library/doctest.rst:339 ../../library/doctest.rst:577 msgid "..." msgstr "..." -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "marker" msgstr "marker(標記)" -#: ../../library/doctest.rst:536 +#: ../../library/doctest.rst:557 msgid "" msgstr "" -#: ../../library/doctest.rst:556 ../../library/doctest.rst:686 +#: ../../library/doctest.rst:577 ../../library/doctest.rst:707 msgid "in doctests" msgstr "於 doctests 中" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "- (minus)" msgstr "- (減號)" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 9af25c9797..7a2f9ecf06 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -419,8 +419,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:369 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (defaults to ``None``)." msgstr "" #: ../../library/email.compat32-message.rst:373 diff --git a/library/email.message.po b/library/email.message.po index 9003644575..5809709c83 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -299,8 +299,8 @@ msgstr "" #: ../../library/email.message.rst:249 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (*failobj* defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (*failobj* defaults to ``None``)." msgstr "" #: ../../library/email.message.rst:254 diff --git a/library/enum.po b/library/enum.po index b6f514ad6a..2054456150 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -418,16 +418,15 @@ msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" -#: ../../library/enum.rst:204 +#: ../../library/enum.rst:206 msgid "" -"In Python 3.12 it will be possible to check for member values and not just " -"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " -"used in a containment check." +"Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " +"in a containment check." msgstr "" -"在 Python 3.12 中這可以檢查成員的值,而不只是檢查成員;在此之前,如果用非列舉" -"成員做屬於檢查會引發 ``TypeError``。" +"在 Python 3.12 之前,如果用非列舉成員做屬於檢查 (containment check) 會引發 " +"``TypeError``。" -#: ../../library/enum.rst:210 +#: ../../library/enum.rst:211 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" @@ -435,46 +434,46 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" "員名稱: ::" -#: ../../library/enum.rst:218 +#: ../../library/enum.rst:219 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" -#: ../../library/enum.rst:225 +#: ../../library/enum.rst:226 msgid "Returns each member in *cls* in definition order::" msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" -#: ../../library/enum.rst:232 +#: ../../library/enum.rst:233 msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" -#: ../../library/enum.rst:239 +#: ../../library/enum.rst:240 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:246 +#: ../../library/enum.rst:247 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:252 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:255 +#: ../../library/enum.rst:256 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:262 +#: ../../library/enum.rst:263 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:267 +#: ../../library/enum.rst:268 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:270 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " @@ -484,13 +483,13 @@ msgstr "" "重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" -#: ../../library/enum.rst:276 +#: ../../library/enum.rst:277 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:280 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" @@ -499,7 +498,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:285 +#: ../../library/enum.rst:286 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -511,11 +510,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:306 +#: ../../library/enum.rst:307 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:308 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -523,7 +522,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:309 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -531,23 +530,23 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:310 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:312 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:327 +#: ../../library/enum.rst:328 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:332 +#: ../../library/enum.rst:333 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -555,7 +554,7 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:354 +#: ../../library/enum.rst:355 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -563,7 +562,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:370 +#: ../../library/enum.rst:371 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -571,7 +570,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:385 +#: ../../library/enum.rst:386 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -579,17 +578,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:400 +#: ../../library/enum.rst:401 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:403 +#: ../../library/enum.rst:404 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:408 +#: ../../library/enum.rst:409 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -599,13 +598,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:429 +#: ../../library/enum.rst:430 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:433 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -615,7 +614,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:439 +#: ../../library/enum.rst:440 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -625,7 +624,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:445 +#: ../../library/enum.rst:446 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -636,13 +635,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:452 +#: ../../library/enum.rst:453 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:457 +#: ../../library/enum.rst:458 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -652,7 +651,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:465 +#: ../../library/enum.rst:466 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " @@ -661,43 +660,43 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:472 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:492 +#: ../../library/enum.rst:493 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:502 msgid "Aliases are no longer returned during iteration." msgstr "疊代時不會再回傳別名。" -#: ../../library/enum.rst:505 +#: ../../library/enum.rst:506 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:514 +#: ../../library/enum.rst:515 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:526 +#: ../../library/enum.rst:527 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:533 +#: ../../library/enum.rst:534 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:542 +#: ../../library/enum.rst:543 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:551 +#: ../../library/enum.rst:552 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:563 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -705,17 +704,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:567 +#: ../../library/enum.rst:568 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:570 +#: ../../library/enum.rst:571 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:578 +#: ../../library/enum.rst:579 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -723,38 +722,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:593 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:598 +#: ../../library/enum.rst:599 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:600 +#: ../../library/enum.rst:601 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:602 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:603 +#: ../../library/enum.rst:604 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:610 +#: ../../library/enum.rst:611 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:615 +#: ../../library/enum.rst:616 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -764,7 +763,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:619 +#: ../../library/enum.rst:620 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -773,7 +772,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:626 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -781,15 +780,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:628 +#: ../../library/enum.rst:629 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:629 +#: ../../library/enum.rst:630 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:631 +#: ../../library/enum.rst:632 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -798,7 +797,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:640 +#: ../../library/enum.rst:641 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -806,17 +805,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:645 +#: ../../library/enum.rst:646 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:662 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:676 +#: ../../library/enum.rst:677 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -824,35 +823,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:693 +#: ../../library/enum.rst:694 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:699 +#: ../../library/enum.rst:700 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:704 +#: ../../library/enum.rst:705 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:722 +#: ../../library/enum.rst:723 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:737 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:749 +#: ../../library/enum.rst:750 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -860,11 +859,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:769 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -872,7 +871,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" "對映。只有在類別上可用。" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:772 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -882,26 +881,26 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:777 +#: ../../library/enum.rst:778 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:779 +#: ../../library/enum.rst:780 msgid "``_name_`` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:781 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:783 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:785 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " @@ -910,7 +909,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" @@ -918,20 +917,20 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:789 +#: ../../library/enum.rst:790 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:795 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:798 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -939,19 +938,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:800 +#: ../../library/enum.rst:801 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:801 +#: ../../library/enum.rst:802 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:807 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:811 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -967,27 +966,27 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:819 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:821 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:822 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:823 msgid "used to create the ``SECOND`` enum member;" msgstr "被用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:824 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -995,19 +994,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:829 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:832 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:834 +#: ../../library/enum.rst:835 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1016,7 +1015,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:841 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1025,7 +1024,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:845 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1035,7 +1034,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:854 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1045,7 +1044,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:872 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1054,15 +1053,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:880 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:886 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:892 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1073,19 +1072,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:902 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:909 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:910 +#: ../../library/enum.rst:911 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:912 +#: ../../library/enum.rst:913 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1093,17 +1092,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:915 +#: ../../library/enum.rst:916 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:917 +#: ../../library/enum.rst:918 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:920 +#: ../../library/enum.rst:921 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1111,7 +1110,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:927 +#: ../../library/enum.rst:928 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" diff --git a/library/fcntl.po b/library/fcntl.po index 2a60f76aa3..8487abb927 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -30,18 +30,9 @@ msgid "" "`ioctl(2)` Unix manual pages." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/fcntl.rst:21 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/fcntl.rst:23 msgid "" @@ -122,7 +113,7 @@ msgstr "" msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:96 +#: ../../library/fcntl.rst:85 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -193,7 +184,7 @@ msgstr "" "\n" "::" -#: ../../library/fcntl.rst:147 +#: ../../library/fcntl.rst:136 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -213,7 +204,7 @@ msgstr "" msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:159 +#: ../../library/fcntl.rst:148 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -279,7 +270,7 @@ msgid "" "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:194 +#: ../../library/fcntl.rst:183 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -321,3 +312,11 @@ msgstr "file control(檔案控制)" #: ../../library/fcntl.rst:10 msgid "I/O control" msgstr "I/O control(I/O 控制)" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/functions.po b/library/functions.po index 85c5c1ace1..2b6a0f7429 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1745,18 +1745,18 @@ msgid "" "differently depending on the presence of the second argument. Without a " "second argument, *object* must be a collection object which supports the :" "term:`iterable` protocol (the :meth:`__iter__` method), or it must support " -"the sequence protocol (the :meth:`__getitem__` method with integer arguments " -"starting at ``0``). If it does not support either of those protocols, :exc:" -"`TypeError` is raised. If the second argument, *sentinel*, is given, then " -"*object* must be a callable object. The iterator created in this case will " -"call *object* with no arguments for each call to its :meth:`~iterator." -"__next__` method; if the value returned is equal to *sentinel*, :exc:" -"`StopIteration` will be raised, otherwise the value will be returned." +"the sequence protocol (the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``). If it does not support either of those " +"protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, " +"is given, then *object* must be a callable object. The iterator created in " +"this case will call *object* with no arguments for each call to its :meth:" +"`~iterator.__next__` method; if the value returned is equal to *sentinel*, :" +"exc:`StopIteration` will be raised, otherwise the value will be returned." msgstr "" "回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" "常不同的。如果沒有第二個引數,*object* 必須是支援 :term:`iterable` 協定(有 :" -"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:" -"`__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" +"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:`~object." +"__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" "exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可呼叫的物" "件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator.__next__` 時會不" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" @@ -2509,8 +2509,8 @@ msgstr "" msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" -"`__len__` method and the :meth:`__getitem__` method with integer arguments " -"starting at ``0``)." +"`__len__` method and the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``)." msgstr "" #: ../../library/functions.rst:1572 diff --git a/library/getpass.po b/library/getpass.po index 828e2edc0d..2b69eeadeb 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,15 +88,15 @@ msgstr "回傳使用者的\"登入名稱\"。" #: ../../library/getpass.rst:45 msgid "" "This function checks the environment variables :envvar:`LOGNAME`, :envvar:" -"`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns the " +"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " "value of the first one which is set to a non-empty string. If none are set, " "the login name from the password database is returned on systems which " "support the :mod:`pwd` module, otherwise, an exception is raised." msgstr "" -"此函式會按順序檢查環境變數 :envvar:`LOGNAME`\\ 、\\ :envvar:`USER`\\ 、\\ :" -"envvar:`LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。" -"如果均未設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名" -"稱,否則將引發一個例外。" +"此函式會按順序檢查環境變數 :envvar:`LOGNAME`、:envvar:`USER`、:envvar:`!" +"LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。如果均未" +"設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名稱,否則" +"將引發一個例外。" #: ../../library/getpass.rst:52 msgid "" diff --git a/library/grp.po b/library/grp.po index a216d5d66f..7561672a82 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -28,18 +28,9 @@ msgid "" "all Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/grp.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/grp.rst:15 msgid "" @@ -159,3 +150,11 @@ msgstr ":mod:`spwd` 模組" #: ../../library/grp.rst:68 msgid "An interface to the shadow password database, similar to this." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/inspect.po b/library/inspect.po index 8f55ff930d..b8d5bf3058 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -911,6 +911,12 @@ msgstr "" #: ../../library/inspect.rst:643 msgid "" +"If the passed object has a ``__signature__`` attribute, this function " +"returns it without further computations." +msgstr "" + +#: ../../library/inspect.rst:646 +msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " "automatically un-stringize the annotations using :func:`inspect." @@ -920,7 +926,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:652 +#: ../../library/inspect.rst:655 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -929,39 +935,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:661 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:662 +#: ../../library/inspect.rst:665 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:667 +#: ../../library/inspect.rst:670 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:672 +#: ../../library/inspect.rst:675 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:679 +#: ../../library/inspect.rst:682 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:683 +#: ../../library/inspect.rst:686 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -970,54 +976,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:689 +#: ../../library/inspect.rst:692 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:692 +#: ../../library/inspect.rst:695 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:698 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:700 +#: ../../library/inspect.rst:703 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:704 +#: ../../library/inspect.rst:707 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:708 ../../library/inspect.rst:1034 +#: ../../library/inspect.rst:711 ../../library/inspect.rst:1039 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:715 +#: ../../library/inspect.rst:718 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:720 +#: ../../library/inspect.rst:723 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:726 +#: ../../library/inspect.rst:729 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1025,7 +1031,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:733 +#: ../../library/inspect.rst:736 msgid "" "Create a new Signature instance based on the instance :meth:`replace` was " "invoked on. It is possible to pass different ``parameters`` and/or " @@ -1034,7 +1040,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:751 +#: ../../library/inspect.rst:754 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1042,139 +1048,143 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:756 +#: ../../library/inspect.rst:759 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:765 +#: ../../library/inspect.rst:766 +msgid "Its behavior is otherwise identical to that of :func:`signature`." +msgstr "" + +#: ../../library/inspect.rst:770 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:776 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:774 +#: ../../library/inspect.rst:779 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:779 +#: ../../library/inspect.rst:784 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:784 +#: ../../library/inspect.rst:789 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:794 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:793 +#: ../../library/inspect.rst:798 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:799 +#: ../../library/inspect.rst:804 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:804 +#: ../../library/inspect.rst:809 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:809 +#: ../../library/inspect.rst:814 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:821 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:821 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 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:823 +#: ../../library/inspect.rst:828 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:828 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:828 +#: ../../library/inspect.rst:833 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:828 +#: ../../library/inspect.rst:833 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:833 +#: ../../library/inspect.rst:838 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:833 +#: ../../library/inspect.rst:838 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:838 +#: ../../library/inspect.rst:843 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:843 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:844 +#: ../../library/inspect.rst:849 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:858 +#: ../../library/inspect.rst:863 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:862 +#: ../../library/inspect.rst:867 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:877 +#: ../../library/inspect.rst:882 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1182,94 +1192,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:895 +#: ../../library/inspect.rst:900 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:902 +#: ../../library/inspect.rst:907 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:907 +#: ../../library/inspect.rst:912 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:911 +#: ../../library/inspect.rst:916 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:921 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:921 +#: ../../library/inspect.rst:926 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:927 +#: ../../library/inspect.rst:932 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:937 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:942 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:941 +#: ../../library/inspect.rst:946 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:943 +#: ../../library/inspect.rst:948 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:951 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:964 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:977 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:978 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:979 +#: ../../library/inspect.rst:984 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:983 +#: ../../library/inspect.rst:988 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 " @@ -1280,19 +1290,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:994 +#: ../../library/inspect.rst:999 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:997 +#: ../../library/inspect.rst:1002 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1005 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 " @@ -1307,7 +1317,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1015 +#: ../../library/inspect.rst:1020 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1317,14 +1327,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1022 +#: ../../library/inspect.rst:1027 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:1027 +#: ../../library/inspect.rst:1032 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 " @@ -1332,7 +1342,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1047 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1341,18 +1351,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1049 ../../library/inspect.rst:1059 +#: ../../library/inspect.rst:1054 ../../library/inspect.rst:1064 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1054 +#: ../../library/inspect.rst:1059 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:1064 +#: ../../library/inspect.rst:1069 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 " @@ -1360,7 +1370,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1072 +#: ../../library/inspect.rst:1077 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 " @@ -1373,11 +1383,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1096 +#: ../../library/inspect.rst:1101 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1102 +#: ../../library/inspect.rst:1107 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1389,18 +1399,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1111 +#: ../../library/inspect.rst:1116 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1118 +#: ../../library/inspect.rst:1123 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:1121 +#: ../../library/inspect.rst:1126 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 " @@ -1410,68 +1420,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1128 +#: ../../library/inspect.rst:1133 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1140 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1137 +#: ../../library/inspect.rst:1142 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1145 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:1144 +#: ../../library/inspect.rst:1149 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1151 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:1150 +#: ../../library/inspect.rst:1155 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:1154 +#: ../../library/inspect.rst:1159 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1156 +#: ../../library/inspect.rst:1161 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1158 +#: ../../library/inspect.rst:1163 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1160 +#: ../../library/inspect.rst:1165 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:1163 +#: ../../library/inspect.rst:1168 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()` " @@ -1479,12 +1489,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1172 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1169 +#: ../../library/inspect.rst:1174 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1492,35 +1502,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1174 +#: ../../library/inspect.rst:1179 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1180 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:1178 +#: ../../library/inspect.rst:1183 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:1182 +#: ../../library/inspect.rst:1187 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:1192 +#: ../../library/inspect.rst:1197 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1199 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1528,95 +1538,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1208 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1212 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1217 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1217 +#: ../../library/inspect.rst:1222 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1221 +#: ../../library/inspect.rst:1226 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1226 ../../library/inspect.rst:1265 +#: ../../library/inspect.rst:1231 ../../library/inspect.rst:1270 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1230 +#: ../../library/inspect.rst:1235 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1234 +#: ../../library/inspect.rst:1239 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1242 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1251 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1256 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1256 +#: ../../library/inspect.rst:1261 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1260 +#: ../../library/inspect.rst:1265 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1269 +#: ../../library/inspect.rst:1274 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1274 +#: ../../library/inspect.rst:1279 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1281 +#: ../../library/inspect.rst:1286 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 " @@ -1628,7 +1638,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1289 +#: ../../library/inspect.rst:1294 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 :" @@ -1636,31 +1646,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1301 +#: ../../library/inspect.rst:1306 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:1305 +#: ../../library/inspect.rst:1310 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:1312 +#: ../../library/inspect.rst:1317 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1315 +#: ../../library/inspect.rst:1320 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1320 +#: ../../library/inspect.rst:1325 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1668,19 +1678,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1325 ../../library/inspect.rst:1340 -#: ../../library/inspect.rst:1366 ../../library/inspect.rst:1381 +#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 +#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 -#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 +#: ../../library/inspect.rst:1335 ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1376 ../../library/inspect.rst:1391 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1340 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1688,11 +1698,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1355 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1359 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 " @@ -1700,14 +1710,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1362 +#: ../../library/inspect.rst:1367 msgid "" "Return a list of :class:`FrameInfo` objects 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:1376 +#: ../../library/inspect.rst:1381 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1715,11 +1725,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1390 +#: ../../library/inspect.rst:1395 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1392 +#: ../../library/inspect.rst:1397 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1727,20 +1737,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1397 +#: ../../library/inspect.rst:1402 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:1403 +#: ../../library/inspect.rst:1408 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1406 +#: ../../library/inspect.rst:1411 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 " @@ -1748,31 +1758,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1412 +#: ../../library/inspect.rst:1417 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:1418 +#: ../../library/inspect.rst:1423 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:1422 +#: ../../library/inspect.rst:1427 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:1448 +#: ../../library/inspect.rst:1453 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1455 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1781,32 +1791,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1458 +#: ../../library/inspect.rst:1463 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1465 ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1498 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1467 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1468 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1469 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1465 +#: ../../library/inspect.rst:1470 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1471 +#: ../../library/inspect.rst:1476 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 " @@ -1814,23 +1824,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1483 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1484 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1480 +#: ../../library/inspect.rst:1485 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1486 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1487 +#: ../../library/inspect.rst:1492 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1849,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1500 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1496 +#: ../../library/inspect.rst:1501 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1502 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1503 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1507 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:1508 +#: ../../library/inspect.rst:1513 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. " @@ -1870,14 +1880,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1513 +#: ../../library/inspect.rst:1518 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:1519 +#: ../../library/inspect.rst:1524 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 " @@ -1885,79 +1895,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1528 +#: ../../library/inspect.rst:1533 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1535 +#: ../../library/inspect.rst:1540 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1545 +#: ../../library/inspect.rst:1550 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1547 +#: ../../library/inspect.rst:1552 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1552 +#: ../../library/inspect.rst:1557 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1556 +#: ../../library/inspect.rst:1561 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:1561 +#: ../../library/inspect.rst:1566 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1570 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1569 +#: ../../library/inspect.rst:1574 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1573 +#: ../../library/inspect.rst:1578 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:1578 +#: ../../library/inspect.rst:1583 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:1586 +#: ../../library/inspect.rst:1591 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:1595 +#: ../../library/inspect.rst:1600 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:1602 +#: ../../library/inspect.rst:1607 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1975,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1610 +#: ../../library/inspect.rst:1615 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1619 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1618 +#: ../../library/inspect.rst:1623 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1645 +#: ../../library/inspect.rst:1650 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1647 +#: ../../library/inspect.rst:1652 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1652 +#: ../../library/inspect.rst:1657 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:1658 +#: ../../library/inspect.rst:1663 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 1bae04ba61..c34a10c07c 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+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-" @@ -81,8 +81,8 @@ msgid ":func:`count`" msgstr ":func:`count`" #: ../../library/itertools.rst:44 -msgid "start, [step]" -msgstr "" +msgid "[start[, step]]" +msgstr "[start[, step]]" #: ../../library/itertools.rst:44 msgid "start, start+step, start+2*step, ..." diff --git a/library/locale.po b/library/locale.po index 0afee18ed9..f3252fcd86 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+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-" @@ -679,32 +679,42 @@ msgid "" "conventions." msgstr "" -#: ../../library/locale.rst:469 +#: ../../library/locale.rst:467 +msgid "" +"Locale category for the character type functions. Most importantly, this " +"category defines the text encoding, i.e. how bytes are interpreted as " +"Unicode codepoints. See :pep:`538` and :pep:`540` for how this variable " +"might be automatically coerced to ``C.UTF-8`` to avoid issues created by " +"invalid settings in containers or incompatible settings passed over remote " +"SSH connections." +msgstr "" + +#: ../../library/locale.rst:474 msgid "" -"Locale category for the character type functions. Depending on the settings " -"of this category, the functions of module :mod:`string` dealing with case " -"change their behaviour." +"Python doesn't internally use locale-dependent character transformation " +"functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " +"locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:476 +#: ../../library/locale.rst:481 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:482 +#: ../../library/locale.rst:487 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:488 +#: ../../library/locale.rst:493 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:494 +#: ../../library/locale.rst:499 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -712,13 +722,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:504 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:505 +#: ../../library/locale.rst:510 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -726,7 +736,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:513 +#: ../../library/locale.rst:518 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -736,24 +746,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:522 +#: ../../library/locale.rst:527 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:526 +#: ../../library/locale.rst:531 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:539 +#: ../../library/locale.rst:544 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:541 +#: ../../library/locale.rst:546 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -761,7 +771,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:546 +#: ../../library/locale.rst:551 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -771,7 +781,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:553 +#: ../../library/locale.rst:558 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -779,7 +789,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:563 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -790,14 +800,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:565 +#: ../../library/locale.rst:570 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:574 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -808,11 +818,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:580 +#: ../../library/locale.rst:585 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:582 +#: ../../library/locale.rst:587 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -820,7 +830,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:592 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -830,11 +840,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:598 +#: ../../library/locale.rst:603 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:606 +#: ../../library/locale.rst:611 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`!gettext`, :" @@ -845,7 +855,7 @@ msgid "" "for locating message catalogs." msgstr "" -#: ../../library/locale.rst:613 +#: ../../library/locale.rst:618 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " @@ -855,7 +865,7 @@ msgid "" "their message catalogs." msgstr "" -#: ../../library/locale.rst:19 ../../library/locale.rst:467 +#: ../../library/locale.rst:19 msgid "module" msgstr "module(模組)" @@ -863,6 +873,5 @@ msgstr "module(模組)" msgid "_locale" msgstr "_locale" -#: ../../library/locale.rst:467 -msgid "string" -msgstr "string(字串)" +#~ msgid "string" +#~ msgstr "string(字串)" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 417245ed9d..3df1e532ef 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-03 00:03+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-" @@ -845,19 +845,17 @@ msgid "" "Tries to create a socket and, if it's not a datagram socket, connect it to " "the other end. This method is called during handler initialization, but it's " "not regarded as an error if the other end isn't listening at this point - " -"the method will be called again when emitting an event, if but it's not " -"regarded as an error if the other end isn't listening yet --- the method " -"will be called again when emitting an event, if there is no socket at that " -"point." +"the method will be called again when emitting an event, if there is no " +"socket at that point." msgstr "" -#: ../../library/logging.handlers.rst:667 +#: ../../library/logging.handlers.rst:665 msgid "" "The record is formatted, and then sent to the syslog server. If exception " "information is present, it is *not* sent to the server." msgstr "" -#: ../../library/logging.handlers.rst:670 +#: ../../library/logging.handlers.rst:668 msgid "" "(See: :issue:`12168`.) In earlier versions, the message sent to the syslog " "daemons was always terminated with a NUL byte, because early versions of " @@ -868,7 +866,7 @@ msgid "" "byte on as part of the message." msgstr "" -#: ../../library/logging.handlers.rst:679 +#: ../../library/logging.handlers.rst:677 msgid "" "To enable easier handling of syslog messages in the face of all these " "differing daemon behaviours, the appending of the NUL byte has been made " @@ -878,7 +876,7 @@ msgid "" "*not* append the NUL terminator." msgstr "" -#: ../../library/logging.handlers.rst:686 +#: ../../library/logging.handlers.rst:684 msgid "" "(See: :issue:`12419`.) In earlier versions, there was no facility for an " "\"ident\" or \"tag\" prefix to identify the source of the message. This can " @@ -889,262 +887,262 @@ msgid "" "bytes, and is prepended to the message exactly as is." msgstr "" -#: ../../library/logging.handlers.rst:697 +#: ../../library/logging.handlers.rst:695 msgid "" "Encodes the facility and priority into an integer. You can pass in strings " "or integers - if strings are passed, internal mapping dictionaries are used " "to convert them to integers." msgstr "" -#: ../../library/logging.handlers.rst:701 +#: ../../library/logging.handlers.rst:699 msgid "" "The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and " "mirror the values defined in the ``sys/syslog.h`` header file." msgstr "" -#: ../../library/logging.handlers.rst:704 +#: ../../library/logging.handlers.rst:702 msgid "**Priorities**" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Name (string)" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Symbolic value" msgstr "" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "``alert``" msgstr "``alert``" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "LOG_ALERT" msgstr "LOG_ALERT" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "``crit`` or ``critical``" msgstr "``crit`` 或 ``critical``" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "LOG_CRIT" msgstr "LOG_CRIT" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "``debug``" msgstr "``debug``" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "LOG_DEBUG" msgstr "LOG_DEBUG" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "``emerg`` or ``panic``" msgstr "``emerg`` 或 ``panic``" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "LOG_EMERG" msgstr "LOG_EMERG" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "``err`` or ``error``" msgstr "``err`` 或 ``error``" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "LOG_ERR" msgstr "LOG_ERR" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "``info``" msgstr "``info``" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "LOG_INFO" msgstr "LOG_INFO" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "``notice``" msgstr "``notice``" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "LOG_NOTICE" msgstr "LOG_NOTICE" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "``warn`` or ``warning``" msgstr "``warn`` 或 ``warning``" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "LOG_WARNING" msgstr "LOG_WARNING" -#: ../../library/logging.handlers.rst:726 +#: ../../library/logging.handlers.rst:724 msgid "**Facilities**" msgstr "" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "``auth``" msgstr "``auth``" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "LOG_AUTH" msgstr "LOG_AUTH" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "``authpriv``" msgstr "``authpriv``" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "LOG_AUTHPRIV" msgstr "LOG_AUTHPRIV" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "``cron``" msgstr "``cron``" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "LOG_CRON" msgstr "LOG_CRON" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "``daemon``" msgstr "``daemon``" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "LOG_DAEMON" msgstr "LOG_DAEMON" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "``ftp``" msgstr "``ftp``" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "LOG_FTP" msgstr "LOG_FTP" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "``kern``" msgstr "``kern``" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "LOG_KERN" msgstr "LOG_KERN" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "``lpr``" msgstr "``lpr``" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "LOG_LPR" msgstr "LOG_LPR" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "``mail``" msgstr "``mail``" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "LOG_MAIL" msgstr "LOG_MAIL" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "``news``" msgstr "``news``" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "LOG_NEWS" msgstr "LOG_NEWS" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "``syslog``" msgstr "``syslog``" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "LOG_SYSLOG" msgstr "LOG_SYSLOG" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "``user``" msgstr "``user``" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "LOG_USER" msgstr "LOG_USER" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "``uucp``" msgstr "``uucp``" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "LOG_UUCP" msgstr "LOG_UUCP" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "``local0``" msgstr "``local0``" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "LOG_LOCAL0" msgstr "LOG_LOCAL0" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "``local1``" msgstr "``local1``" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "LOG_LOCAL1" msgstr "LOG_LOCAL1" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "``local2``" msgstr "``local2``" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "LOG_LOCAL2" msgstr "LOG_LOCAL2" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "``local3``" msgstr "``local3``" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "LOG_LOCAL3" msgstr "LOG_LOCAL3" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "``local4``" msgstr "``local4``" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "LOG_LOCAL4" msgstr "LOG_LOCAL4" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "``local5``" msgstr "``local5``" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "LOG_LOCAL5" msgstr "LOG_LOCAL5" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "``local6``" msgstr "``local6``" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "LOG_LOCAL6" msgstr "LOG_LOCAL6" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "``local7``" msgstr "``local7``" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "LOG_LOCAL7" msgstr "LOG_LOCAL7" -#: ../../library/logging.handlers.rst:774 +#: ../../library/logging.handlers.rst:772 msgid "" "Maps a logging level name to a syslog priority name. You may need to " "override this if you are using custom levels, or if the default algorithm is " @@ -1153,11 +1151,11 @@ msgid "" "all other level names to 'warning'." msgstr "" -#: ../../library/logging.handlers.rst:784 +#: ../../library/logging.handlers.rst:782 msgid "NTEventLogHandler" msgstr "NTEventLogHandler" -#: ../../library/logging.handlers.rst:786 +#: ../../library/logging.handlers.rst:784 msgid "" "The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a local Windows NT, Windows " @@ -1165,7 +1163,7 @@ msgid "" "Win32 extensions for Python installed." msgstr "" -#: ../../library/logging.handlers.rst:794 +#: ../../library/logging.handlers.rst:792 msgid "" "Returns a new instance of the :class:`NTEventLogHandler` class. The " "*appname* is used to define the application name as it appears in the event " @@ -1181,7 +1179,7 @@ msgid "" "or ``'Security'``, and defaults to ``'Application'``." msgstr "" -#: ../../library/logging.handlers.rst:810 +#: ../../library/logging.handlers.rst:808 msgid "" "At this point, you can remove the application name from the registry as a " "source of event log entries. However, if you do this, you will not be able " @@ -1190,19 +1188,19 @@ msgid "" "not do this." msgstr "" -#: ../../library/logging.handlers.rst:819 +#: ../../library/logging.handlers.rst:817 msgid "" "Determines the message ID, event category and event type, and then logs the " "message in the NT event log." msgstr "" -#: ../../library/logging.handlers.rst:825 +#: ../../library/logging.handlers.rst:823 msgid "" "Returns the event category for the record. Override this if you want to " "specify your own categories. This version returns 0." msgstr "" -#: ../../library/logging.handlers.rst:831 +#: ../../library/logging.handlers.rst:829 msgid "" "Returns the event type for the record. Override this if you want to specify " "your own types. This version does a mapping using the handler's typemap " @@ -1213,7 +1211,7 @@ msgid "" "the handler's *typemap* attribute." msgstr "" -#: ../../library/logging.handlers.rst:842 +#: ../../library/logging.handlers.rst:840 msgid "" "Returns the message ID for the record. If you are using your own messages, " "you could do this by having the *msg* passed to the logger being an ID " @@ -1222,17 +1220,17 @@ msgid "" "message ID in :file:`win32service.pyd`." msgstr "" -#: ../../library/logging.handlers.rst:851 +#: ../../library/logging.handlers.rst:849 msgid "SMTPHandler" msgstr "SMTPHandler" -#: ../../library/logging.handlers.rst:853 +#: ../../library/logging.handlers.rst:851 msgid "" "The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to an email address via SMTP." msgstr "" -#: ../../library/logging.handlers.rst:859 +#: ../../library/logging.handlers.rst:857 msgid "" "Returns a new instance of the :class:`SMTPHandler` class. The instance is " "initialized with the from and to addresses and subject line of the email. " @@ -1243,7 +1241,7 @@ msgid "" "*credentials* argument." msgstr "" -#: ../../library/logging.handlers.rst:866 +#: ../../library/logging.handlers.rst:864 msgid "" "To specify the use of a secure protocol (TLS), pass in a tuple to the " "*secure* argument. This will only be used when authentication credentials " @@ -1253,31 +1251,31 @@ msgid "" "SMTP.starttls` method.)" msgstr "" -#: ../../library/logging.handlers.rst:873 +#: ../../library/logging.handlers.rst:871 msgid "" "A timeout can be specified for communication with the SMTP server using the " "*timeout* argument." msgstr "" -#: ../../library/logging.handlers.rst:876 +#: ../../library/logging.handlers.rst:874 msgid "The *timeout* argument was added." msgstr "新增 *timeout* 引數。" -#: ../../library/logging.handlers.rst:881 +#: ../../library/logging.handlers.rst:879 msgid "Formats the record and sends it to the specified addressees." msgstr "" -#: ../../library/logging.handlers.rst:886 +#: ../../library/logging.handlers.rst:884 msgid "" "If you want to specify a subject line which is record-dependent, override " "this method." msgstr "" -#: ../../library/logging.handlers.rst:892 +#: ../../library/logging.handlers.rst:890 msgid "MemoryHandler" msgstr "MemoryHandler" -#: ../../library/logging.handlers.rst:894 +#: ../../library/logging.handlers.rst:892 msgid "" "The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` " "module, supports buffering of logging records in memory, periodically " @@ -1285,7 +1283,7 @@ msgid "" "buffer is full, or when an event of a certain severity or greater is seen." msgstr "" -#: ../../library/logging.handlers.rst:899 +#: ../../library/logging.handlers.rst:897 msgid "" ":class:`MemoryHandler` is a subclass of the more general :class:" "`BufferingHandler`, which is an abstract class. This buffers logging records " @@ -1294,32 +1292,32 @@ msgid "" "should, then :meth:`flush` is expected to do the flushing." msgstr "" -#: ../../library/logging.handlers.rst:908 +#: ../../library/logging.handlers.rst:906 msgid "" "Initializes the handler with a buffer of the specified capacity. Here, " "*capacity* means the number of logging records buffered." msgstr "" -#: ../../library/logging.handlers.rst:914 +#: ../../library/logging.handlers.rst:912 msgid "" "Append the record to the buffer. If :meth:`shouldFlush` returns true, call :" "meth:`flush` to process the buffer." msgstr "" -#: ../../library/logging.handlers.rst:920 +#: ../../library/logging.handlers.rst:918 msgid "" "For a :class:`BufferingHandler` instance, flushing means that it sets the " "buffer to an empty list. This method can be overwritten to implement more " "useful flushing behavior." msgstr "" -#: ../../library/logging.handlers.rst:927 +#: ../../library/logging.handlers.rst:925 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:933 +#: ../../library/logging.handlers.rst:931 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1331,15 +1329,15 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:942 +#: ../../library/logging.handlers.rst:940 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:948 +#: ../../library/logging.handlers.rst:946 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:954 +#: ../../library/logging.handlers.rst:952 msgid "" "For a :class:`MemoryHandler` instance, flushing means just sending the " "buffered records to the target, if there is one. The buffer is also cleared " @@ -1347,26 +1345,26 @@ msgid "" "behavior." msgstr "" -#: ../../library/logging.handlers.rst:961 +#: ../../library/logging.handlers.rst:959 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:966 +#: ../../library/logging.handlers.rst:964 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:972 +#: ../../library/logging.handlers.rst:970 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:974 +#: ../../library/logging.handlers.rst:972 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:981 +#: ../../library/logging.handlers.rst:979 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1380,11 +1378,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:992 +#: ../../library/logging.handlers.rst:990 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:997 +#: ../../library/logging.handlers.rst:995 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1393,14 +1391,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:1005 +#: ../../library/logging.handlers.rst:1003 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:1009 +#: ../../library/logging.handlers.rst:1007 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1410,18 +1408,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:1022 +#: ../../library/logging.handlers.rst:1020 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1026 +#: ../../library/logging.handlers.rst:1024 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1030 +#: ../../library/logging.handlers.rst:1028 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1431,7 +1429,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1039 +#: ../../library/logging.handlers.rst:1037 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1441,14 +1439,14 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1046 -#: ../../library/logging.handlers.rst:1135 +#: ../../library/logging.handlers.rst:1044 +#: ../../library/logging.handlers.rst:1133 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1051 +#: ../../library/logging.handlers.rst:1049 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." @@ -1458,13 +1456,13 @@ msgid "" "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1060 +#: ../../library/logging.handlers.rst:1058 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1063 +#: ../../library/logging.handlers.rst:1061 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1474,14 +1472,14 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1071 +#: ../../library/logging.handlers.rst:1069 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1075 +#: ../../library/logging.handlers.rst:1073 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " @@ -1497,25 +1495,25 @@ msgid "" "libraries that you use.)" msgstr "" -#: ../../library/logging.handlers.rst:1091 +#: ../../library/logging.handlers.rst:1089 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1097 +#: ../../library/logging.handlers.rst:1095 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1106 +#: ../../library/logging.handlers.rst:1104 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1110 +#: ../../library/logging.handlers.rst:1108 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1526,7 +1524,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1118 +#: ../../library/logging.handlers.rst:1116 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1536,7 +1534,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1127 +#: ../../library/logging.handlers.rst:1125 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1547,7 +1545,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1138 +#: ../../library/logging.handlers.rst:1136 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1555,82 +1553,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1143 +#: ../../library/logging.handlers.rst:1141 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1148 +#: ../../library/logging.handlers.rst:1146 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1150 +#: ../../library/logging.handlers.rst:1148 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1156 +#: ../../library/logging.handlers.rst:1154 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1158 +#: ../../library/logging.handlers.rst:1156 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1164 +#: ../../library/logging.handlers.rst:1162 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1166 +#: ../../library/logging.handlers.rst:1164 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1172 +#: ../../library/logging.handlers.rst:1170 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1174 +#: ../../library/logging.handlers.rst:1172 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1179 +#: ../../library/logging.handlers.rst:1177 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1181 +#: ../../library/logging.handlers.rst:1179 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1187 +#: ../../library/logging.handlers.rst:1185 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1200 +#: ../../library/logging.handlers.rst:1198 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1201 +#: ../../library/logging.handlers.rst:1199 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/mailbox.po b/library/mailbox.po index a8a1eb86e8..d277e16352 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -202,7 +202,7 @@ msgid "" "Return a representation of the message corresponding to *key*. If no such " "message exists, *default* is returned if the method was called as :meth:" "`get` and a :exc:`KeyError` exception is raised if the method was called as :" -"meth:`__getitem__`. The message is represented as an instance of the " +"meth:`~object.__getitem__`. The message is represented as an instance of the " "appropriate format-specific :class:`Message` subclass unless a custom " "message factory was specified when the :class:`Mailbox` instance was " "initialized." diff --git a/library/mmap.po b/library/mmap.po index a4d3c14a62..418b0e75fc 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -52,10 +52,10 @@ msgid "" "A memory-mapped file is created by the :class:`~mmap.mmap` constructor, " "which is different on Unix and on Windows. In either case you must provide " "a file descriptor for a file opened for update. If you wish to map an " -"existing Python file object, use its :meth:`fileno` method to obtain the " -"correct value for the *fileno* parameter. Otherwise, you can open the file " -"using the :func:`os.open` function, which returns a file descriptor directly " -"(the file still needs to be closed when done)." +"existing Python file object, use its :meth:`~io.IOBase.fileno` method to " +"obtain the correct value for the *fileno* parameter. Otherwise, you can " +"open the file using the :func:`os.open` function, which returns a file " +"descriptor directly (the file still needs to be closed when done)." msgstr "" #: ../../library/mmap.rst:28 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 38134ab93d..ae00e0cc2c 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -2845,8 +2845,9 @@ 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 " "Win32 function ``WaitForMultipleObjects()``) or it can be an object with a :" -"meth:`fileno` method which returns a socket handle or pipe handle. (Note " -"that pipe handles and socket handles are **not** waitable handles.)" +"meth:`~io.IOBase.fileno` method which returns a socket handle or pipe " +"handle. (Note that pipe handles and socket handles are **not** waitable " +"handles.)" msgstr "" #: ../../library/multiprocessing.rst:2581 diff --git a/library/operator.po b/library/operator.po index ed45990e29..20f1745011 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,8 +89,8 @@ msgid "" "`~object.__len__` methods.)" msgstr "" "回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` " -"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` 和 " -":meth:`~object.__len__` method 影響。)" +"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` " +"和 :meth:`~object.__len__` method 影響。)" #: ../../library/operator.rst:69 msgid "" @@ -298,11 +298,11 @@ msgstr "" #: ../../library/operator.rst:308 msgid "" "Return a callable object that fetches *item* from its operand using the " -"operand's :meth:`__getitem__` method. If multiple items are specified, " -"returns a tuple of lookup values. For example:" +"operand's :meth:`~object.__getitem__` method. If multiple items are " +"specified, returns a tuple of lookup values. For example:" msgstr "" -"回傳一個使用運算元的 :meth:`__getitem__` 方法從運算元中獲取 *item* 的可呼叫物" -"件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" +"回傳一個使用運算元的 :meth:`~object.__getitem__` 方法從運算元中獲取 *item* 的" +"可呼叫物件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" #: ../../library/operator.rst:312 msgid "After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``." @@ -318,13 +318,13 @@ msgstr "" #: ../../library/operator.rst:329 msgid "" -"The items can be any type accepted by the operand's :meth:`__getitem__` " -"method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and " -"strings accept an index or a slice:" +"The items can be any type accepted by the operand's :meth:`~object." +"__getitem__` method. Dictionaries accept any :term:`hashable` value. " +"Lists, tuples, and strings accept an index or a slice:" msgstr "" -"傳入的條目可以為運算元的 :meth:`__getitem__` 所接受的任何型別。dictionary(字" -"典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple 和字串接受索引" -"或切片:" +"傳入的條目可以為運算元的 :meth:`~object.__getitem__` 所接受的任何型別。" +"dictionary(字典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple " +"和字串接受索引或切片:" #: ../../library/operator.rst:343 msgid "" diff --git a/library/posix.po b/library/posix.po index 7f86596528..c28cdb16cf 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,11 @@ msgstr "" "該模組提供對由 C 標準和 POSIX 標準(一種偽裝的 Unix 介面)所標準化的作業系統" "功能的存取。" -#: ../../library/posix.rst:16 +#: ../../library/posix.rst:14 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/posix.rst:18 msgid "" "**Do not import this module directly.** Instead, import the module :mod:" "`os`, which provides a *portable* version of this interface. On Unix, the :" @@ -51,7 +55,7 @@ msgstr "" "`posix` *不會有*\\ 性能損失。此外,:mod:`os` 提供了一些額外的功能,例如當 " "``os.environ`` 中的條目更改時自動呼叫 :func:`~os.putenv`。" -#: ../../library/posix.rst:25 +#: ../../library/posix.rst:27 msgid "" "Errors are reported as exceptions; the usual exceptions are given for type " "errors, while errors reported by the system calls raise :exc:`OSError`." @@ -59,11 +63,11 @@ msgstr "" "錯誤會以例外的形式被回報;常見的例外是因為型別錯誤而給出的,而系統呼叫回報的" "錯誤會引發 :exc:`OSError`。" -#: ../../library/posix.rst:32 +#: ../../library/posix.rst:34 msgid "Large File Support" msgstr "對大檔案 (Large File) 的支援" -#: ../../library/posix.rst:40 +#: ../../library/posix.rst:42 msgid "" "Several operating systems (including AIX and Solaris) provide support for " "files that are larger than 2 GiB from a C programming model where :c:expr:" @@ -76,7 +80,7 @@ msgstr "" "大小和偏移量 (offset) 種類定義為 64-bit 值來實作。此類檔案有時被稱為「大檔案 " "(:dfn:`large files`)」。" -#: ../../library/posix.rst:46 +#: ../../library/posix.rst:48 msgid "" "Large file support is enabled in Python when the size of an :c:type:`off_t` " "is larger than a :c:expr:`long` and the :c:expr:`long long` is at least as " @@ -91,18 +95,18 @@ msgstr "" "\n" "::" -#: ../../library/posix.rst:56 +#: ../../library/posix.rst:58 msgid "On large-file-capable Linux systems, this might work::" msgstr "" "在支援大檔案的 Linux 系統上,這可能有效:\n" "\n" "::" -#: ../../library/posix.rst:65 +#: ../../library/posix.rst:67 msgid "Notable Module Contents" msgstr "值得注意的模組內容" -#: ../../library/posix.rst:67 +#: ../../library/posix.rst:69 msgid "" "In addition to many functions described in the :mod:`os` module " "documentation, :mod:`posix` defines the following data item:" @@ -110,7 +114,7 @@ msgstr "" "除了 :mod:`os` 模組說明文件中描述的許多函式外,:mod:`posix` 還定義了以下資料" "項目:" -#: ../../library/posix.rst:72 +#: ../../library/posix.rst:74 msgid "" "A dictionary representing the string environment at the time the interpreter " "was started. Keys and values are bytes on Unix and str on Windows. For " @@ -121,7 +125,7 @@ msgstr "" "str。例如,``environ[b'HOME']``\\ (Windows 上為 ``environ['HOME']``\\ )是你" "的主目錄的路徑名,等同於 C 語言中的 ``getenv(\"HOME\")``。" -#: ../../library/posix.rst:77 +#: ../../library/posix.rst:79 msgid "" "Modifying this dictionary does not affect the string environment passed on " "by :func:`~os.execv`, :func:`~os.popen` or :func:`~os.system`; if you need " @@ -134,11 +138,11 @@ msgstr "" "`~os.execve` 或將變數賦值和匯出陳述句新增到 :func:`~os.system` 或 :func:`~os." "popen` 的指令字串中。" -#: ../../library/posix.rst:83 +#: ../../library/posix.rst:85 msgid "On Unix, keys and values are bytes." msgstr "在 Unix 上,鍵和值是位元組。" -#: ../../library/posix.rst:88 +#: ../../library/posix.rst:90 msgid "" "The :mod:`os` module provides an alternate implementation of ``environ`` " "which updates the environment on modification. Note also that updating :data:" @@ -150,18 +154,18 @@ msgstr "" "新 :data:`os.environ` 將使該字典變成過時的。建議使用 :mod:`os` 模組版本,而不" "是直接存取 :mod:`posix` 模組。" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "module" msgstr "module(模組)" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "os" msgstr "os" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "large files" msgstr "large files(大型檔案)" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "file" msgstr "file(檔案)" diff --git a/library/pty.po b/library/pty.po index cbce70b540..14588f7c4b 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,17 +34,21 @@ msgid "" msgstr "" #: ../../library/pty.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/pty.rst:21 msgid "" "Pseudo-terminal handling is highly platform dependent. This code is mainly " "tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX " "platforms but it's not been thoroughly tested)." msgstr "" -#: ../../library/pty.rst:23 +#: ../../library/pty.rst:25 msgid "The :mod:`pty` module defines the following functions:" msgstr "" -#: ../../library/pty.rst:28 +#: ../../library/pty.rst:30 msgid "" "Fork. Connect the child's controlling terminal to a pseudo-terminal. Return " "value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is " @@ -53,14 +57,14 @@ msgid "" "the child's standard input and output)." msgstr "" -#: ../../library/pty.rst:37 +#: ../../library/pty.rst:39 msgid "" "Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or " "emulation code for generic Unix systems. Return a pair of file descriptors " "``(master, slave)``, for the master and the slave end, respectively." msgstr "" -#: ../../library/pty.rst:44 +#: ../../library/pty.rst:46 msgid "" "Spawn a process, and connect its controlling terminal with the current " "process's standard io. This is often used to baffle programs which insist on " @@ -69,14 +73,14 @@ msgid "" "will return." msgstr "" -#: ../../library/pty.rst:50 +#: ../../library/pty.rst:52 msgid "" "A loop copies STDIN of the current process to the child and data received " "from the child to STDOUT of the current process. It is not signaled to the " "child if STDIN of the current process closes down." msgstr "" -#: ../../library/pty.rst:54 +#: ../../library/pty.rst:56 msgid "" "The functions *master_read* and *stdin_read* are passed a file descriptor " "which they should read from, and they should always return a byte string. In " @@ -84,7 +88,7 @@ msgid "" "array should be returned to signal end of file." msgstr "" -#: ../../library/pty.rst:59 +#: ../../library/pty.rst:61 msgid "" "The default implementation for both functions will read and return up to " "1024 bytes each time the function is called. The *master_read* callback is " @@ -93,7 +97,7 @@ msgid "" "the parent process's standard input." msgstr "" -#: ../../library/pty.rst:65 +#: ../../library/pty.rst:67 msgid "" "Returning an empty byte string from either callback is interpreted as an end-" "of-file (EOF) condition, and that callback will not be called after that. If " @@ -103,35 +107,35 @@ msgid "" "signals EOF the same behavior results (on linux at least)." msgstr "" -#: ../../library/pty.rst:72 +#: ../../library/pty.rst:74 msgid "" "Return the exit status value from :func:`os.waitpid` on the child process." msgstr "" -#: ../../library/pty.rst:74 +#: ../../library/pty.rst:76 msgid "" ":func:`os.waitstatus_to_exitcode` can be used to convert the exit status " "into an exit code." msgstr "" -#: ../../library/pty.rst:77 +#: ../../library/pty.rst:79 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." msgstr "" "引發一個附帶引數 ``argv`` 的\\ :ref:`稽核事件 ` ``pty.spawn``。" -#: ../../library/pty.rst:79 +#: ../../library/pty.rst:81 msgid "" ":func:`spawn` now returns the status value from :func:`os.waitpid` on the " "child process." msgstr "" -#: ../../library/pty.rst:84 +#: ../../library/pty.rst:86 msgid "Example" msgstr "範例" -#: ../../library/pty.rst:88 +#: ../../library/pty.rst:90 msgid "" "The following program acts like the Unix command :manpage:`script(1)`, using " "a pseudo-terminal to record all input and output of a terminal session in a " diff --git a/library/pwd.po b/library/pwd.po index 1ac2d5f4cc..10903ae7c6 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,9 @@ msgid "" msgstr "" "此模組提供對 Unix 使用者帳戶和密碼資料庫的存取介面。它適用於所有 Unix 版本。" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr ":ref:`Availability `:非 Emscripten、非 WASI。" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" -"或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" +#: ../../library/pwd.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/pwd.rst:15 msgid "" @@ -214,3 +205,11 @@ msgstr "module(模組)" #: ../../library/pwd.rst:42 msgid "crypt" msgstr "crypt" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起" +#~ "作用或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" diff --git a/library/resource.po b/library/resource.po index 9b0e297da0..c310598aa7 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,9 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/resource.rst:16 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/resource.rst:18 msgid "" @@ -123,7 +114,7 @@ msgstr "" msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:94 +#: ../../library/resource.rst:83 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." @@ -154,7 +145,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:113 +#: ../../library/resource.rst:102 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." @@ -604,3 +595,11 @@ msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/selectors.po b/library/selectors.po index 71fd2b0f0f..a1f060159a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,8 +43,8 @@ msgid "" "concrete implementations (:class:`KqueueSelector`, :class:" "`EpollSelector`...), that can be used to wait for I/O readiness notification " "on multiple file objects. In the following, \"file object\" refers to any " -"object with a :meth:`fileno()` method, or a raw file descriptor. See :term:" -"`file object`." +"object with a :meth:`~io.IOBase.fileno` method, or a raw file descriptor. " +"See :term:`file object`." msgstr "" #: ../../library/selectors.rst:26 diff --git a/library/socket.po b/library/socket.po index 1c2482488b..585c4b7523 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+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-" @@ -113,8 +113,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1142 -#: ../../library/socket.rst:1184 ../../library/socket.rst:1943 +#: ../../library/socket.rst:66 ../../library/socket.rst:1149 +#: ../../library/socket.rst:1191 ../../library/socket.rst:1950 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -288,8 +288,8 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:583 -#: ../../library/socket.rst:1865 +#: ../../library/socket.rst:171 ../../library/socket.rst:590 +#: ../../library/socket.rst:1872 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -304,7 +304,7 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:656 +#: ../../library/socket.rst:181 ../../library/socket.rst:663 msgid ":ref:`Availability `: Linux >= 3.9" msgstr ":ref:`適用 `:Linux 3.9 以上。" @@ -370,7 +370,7 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:210 ../../library/socket.rst:531 +#: ../../library/socket.rst:210 ../../library/socket.rst:538 msgid ":ref:`Availability `: Linux >= 2.2." msgstr ":ref:`適用 `:Linux >= 2.2。" @@ -382,7 +382,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:217 ../../library/socket.rst:632 +#: ../../library/socket.rst:217 ../../library/socket.rst:639 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux >= 4.7。" @@ -562,7 +562,14 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:362 +#: ../../library/socket.rst:357 +msgid "" +":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " +"addresses for any address family (either IPv4, IPv6, or any other) that can " +"be used." +msgstr "" + +#: ../../library/socket.rst:367 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -570,24 +577,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:370 +#: ../../library/socket.rst:375 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:376 +#: ../../library/socket.rst:381 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:379 +#: ../../library/socket.rst:384 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" -#: ../../library/socket.rst:398 +#: ../../library/socket.rst:405 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -597,41 +604,41 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:412 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:409 +#: ../../library/socket.rst:416 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:413 +#: ../../library/socket.rst:420 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "新增 ``TCP_NOTSENT_LOWAT``。" -#: ../../library/socket.rst:416 +#: ../../library/socket.rst:423 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:419 +#: ../../library/socket.rst:426 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: ../../library/socket.rst:424 +#: ../../library/socket.rst:431 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: ../../library/socket.rst:428 +#: ../../library/socket.rst:435 msgid "" "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " "respectively those constants can be used in the same way that ``SO_MARK`` is " @@ -647,166 +654,166 @@ msgid "" "``IP_DROP_SOURCE_MEMBERSHIP``." msgstr "" -#: ../../library/socket.rst:447 ../../library/socket.rst:528 -#: ../../library/socket.rst:552 +#: ../../library/socket.rst:454 ../../library/socket.rst:535 +#: ../../library/socket.rst:559 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:450 +#: ../../library/socket.rst:457 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" -#: ../../library/socket.rst:454 +#: ../../library/socket.rst:461 msgid "NetBSD support was added." msgstr "" -#: ../../library/socket.rst:460 +#: ../../library/socket.rst:467 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:464 ../../library/socket.rst:499 +#: ../../library/socket.rst:471 ../../library/socket.rst:506 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" -#: ../../library/socket.rst:467 +#: ../../library/socket.rst:474 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:473 +#: ../../library/socket.rst:480 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:477 ../../library/socket.rst:488 +#: ../../library/socket.rst:484 ../../library/socket.rst:495 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:479 +#: ../../library/socket.rst:486 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" -#: ../../library/socket.rst:485 +#: ../../library/socket.rst:492 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:490 +#: ../../library/socket.rst:497 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" -#: ../../library/socket.rst:496 +#: ../../library/socket.rst:503 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:505 +#: ../../library/socket.rst:512 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:508 +#: ../../library/socket.rst:515 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:516 +#: ../../library/socket.rst:523 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:519 +#: ../../library/socket.rst:526 msgid ":ref:`Availability `: FreeBSD >= 14.0." msgstr ":ref:`適用 `:FreeBSD >= 14.0。" -#: ../../library/socket.rst:536 +#: ../../library/socket.rst:543 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " "*proto* for the :const:`AF_PACKET` family in order to capture every packet, " "regardless of protocol." msgstr "" -#: ../../library/socket.rst:540 +#: ../../library/socket.rst:547 msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:542 +#: ../../library/socket.rst:549 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/socket.rst:555 +#: ../../library/socket.rst:562 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" -#: ../../library/socket.rst:565 +#: ../../library/socket.rst:572 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:568 ../../library/socket.rst:1557 +#: ../../library/socket.rst:575 ../../library/socket.rst:1564 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:581 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:581 +#: ../../library/socket.rst:588 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:593 +#: ../../library/socket.rst:600 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:595 +#: ../../library/socket.rst:602 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:601 +#: ../../library/socket.rst:608 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" -#: ../../library/socket.rst:607 +#: ../../library/socket.rst:614 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:613 +#: ../../library/socket.rst:620 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:622 +#: ../../library/socket.rst:629 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:629 +#: ../../library/socket.rst:636 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:645 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -815,49 +822,49 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:647 +#: ../../library/socket.rst:654 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/socket.rst:651 +#: ../../library/socket.rst:658 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:671 +#: ../../library/socket.rst:678 msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:673 ../../library/socket.rst:880 -#: ../../library/socket.rst:1971 +#: ../../library/socket.rst:680 ../../library/socket.rst:887 +#: ../../library/socket.rst:1978 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/socket.rst:684 +#: ../../library/socket.rst:691 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:688 +#: ../../library/socket.rst:695 msgid ":ref:`Availability `: Linux, FreeBSD, macOS." msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" -#: ../../library/socket.rst:694 +#: ../../library/socket.rst:701 msgid "Functions" msgstr "函式" -#: ../../library/socket.rst:697 +#: ../../library/socket.rst:704 msgid "Creating sockets" msgstr "建立 sockets" -#: ../../library/socket.rst:699 +#: ../../library/socket.rst:706 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:704 +#: ../../library/socket.rst:711 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -870,7 +877,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:714 +#: ../../library/socket.rst:721 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -881,12 +888,12 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:723 ../../library/socket.rst:869 -#: ../../library/socket.rst:1376 ../../library/socket.rst:1470 +#: ../../library/socket.rst:730 ../../library/socket.rst:876 +#: ../../library/socket.rst:1383 ../../library/socket.rst:1477 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:736 +#: ../../library/socket.rst:743 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -894,44 +901,44 @@ msgstr "" "引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" "事件 ` ``socket.__new__``。" -#: ../../library/socket.rst:727 +#: ../../library/socket.rst:734 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:731 +#: ../../library/socket.rst:738 msgid "The CAN_BCM protocol was added." msgstr "新增 CAN_BCM 協定。" -#: ../../library/socket.rst:734 ../../library/socket.rst:871 +#: ../../library/socket.rst:741 ../../library/socket.rst:878 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:737 +#: ../../library/socket.rst:744 msgid "The CAN_ISOTP protocol was added." msgstr "新增 CAN_ISOTP 協定。" -#: ../../library/socket.rst:740 +#: ../../library/socket.rst:747 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: ../../library/socket.rst:752 +#: ../../library/socket.rst:759 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:756 +#: ../../library/socket.rst:763 msgid "The CAN_J1939 protocol was added." msgstr "新增 CAN_J1939 協定。" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:766 msgid "The IPPROTO_MPTCP protocol was added." msgstr "新增 IPPROTO_MPTCP 協定。" -#: ../../library/socket.rst:764 +#: ../../library/socket.rst:771 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -940,25 +947,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:769 +#: ../../library/socket.rst:776 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:771 +#: ../../library/socket.rst:778 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:775 +#: ../../library/socket.rst:782 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:778 +#: ../../library/socket.rst:785 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:784 +#: ../../library/socket.rst:791 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -969,21 +976,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:792 +#: ../../library/socket.rst:799 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:797 +#: ../../library/socket.rst:804 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:801 +#: ../../library/socket.rst:808 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -991,21 +998,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:806 +#: ../../library/socket.rst:813 msgid "*source_address* was added." msgstr "新增 *source_address*\\ 。" -#: ../../library/socket.rst:809 +#: ../../library/socket.rst:816 msgid "*all_errors* was added." msgstr "新增 *all_errors*\\ 。" -#: ../../library/socket.rst:815 +#: ../../library/socket.rst:822 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:818 +#: ../../library/socket.rst:825 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -1013,7 +1020,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:823 +#: ../../library/socket.rst:830 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -1026,60 +1033,60 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:845 +#: ../../library/socket.rst:852 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:853 +#: ../../library/socket.rst:860 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:860 +#: ../../library/socket.rst:867 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " -"object's :meth:`fileno` method) and build a socket object from the result. " -"Address family, socket type and protocol number are as for the :func:`." -"socket` function above. The file descriptor should refer to a socket, but " -"this is not checked --- subsequent operations on the object may fail if the " -"file descriptor is invalid. This function is rarely needed, but can be used " -"to get or set socket options on a socket passed to a program as standard " -"input or output (such as a server started by the Unix inet daemon). The " -"socket is assumed to be in blocking mode." +"object's :meth:`~io.IOBase.fileno` method) and build a socket object from " +"the result. Address family, socket type and protocol number are as for the :" +"func:`.socket` function above. The file descriptor should refer to a socket, " +"but this is not checked --- subsequent operations on the object may fail if " +"the file descriptor is invalid. This function is rarely needed, but can be " +"used to get or set socket options on a socket passed to a program as " +"standard input or output (such as a server started by the Unix inet " +"daemon). The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:884 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:887 +#: ../../library/socket.rst:894 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:892 +#: ../../library/socket.rst:899 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:894 +#: ../../library/socket.rst:901 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:899 +#: ../../library/socket.rst:906 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:907 +#: ../../library/socket.rst:914 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1089,7 +1096,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:914 +#: ../../library/socket.rst:921 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -1100,15 +1107,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:929 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:924 +#: ../../library/socket.rst:931 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:926 +#: ../../library/socket.rst:933 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -1120,7 +1127,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:947 +#: ../../library/socket.rst:954 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1128,24 +1135,24 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:938 +#: ../../library/socket.rst:945 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:955 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:951 +#: ../../library/socket.rst:958 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:957 +#: ../../library/socket.rst:964 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1156,7 +1163,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:968 +#: ../../library/socket.rst:975 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1166,7 +1173,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1001 +#: ../../library/socket.rst:992 ../../library/socket.rst:1008 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1174,18 +1181,18 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:976 ../../library/socket.rst:992 -#: ../../library/socket.rst:1005 ../../library/socket.rst:1020 -#: ../../library/socket.rst:1037 ../../library/socket.rst:1048 -#: ../../library/socket.rst:1059 ../../library/socket.rst:1070 -#: ../../library/socket.rst:1394 ../../library/socket.rst:1441 -#: ../../library/socket.rst:1455 ../../library/socket.rst:1475 -#: ../../library/socket.rst:1522 ../../library/socket.rst:1567 -#: ../../library/socket.rst:1949 ../../library/socket.rst:1959 +#: ../../library/socket.rst:983 ../../library/socket.rst:999 +#: ../../library/socket.rst:1012 ../../library/socket.rst:1027 +#: ../../library/socket.rst:1044 ../../library/socket.rst:1055 +#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 +#: ../../library/socket.rst:1401 ../../library/socket.rst:1448 +#: ../../library/socket.rst:1462 ../../library/socket.rst:1482 +#: ../../library/socket.rst:1529 ../../library/socket.rst:1574 +#: ../../library/socket.rst:1956 ../../library/socket.rst:1966 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/socket.rst:981 +#: ../../library/socket.rst:988 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1197,26 +1204,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:997 +#: ../../library/socket.rst:1004 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1011 +#: ../../library/socket.rst:1018 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1002 +#: ../../library/socket.rst:1009 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1010 +#: ../../library/socket.rst:1017 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1227,7 +1234,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1029 +#: ../../library/socket.rst:1036 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1235,7 +1242,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1025 +#: ../../library/socket.rst:1032 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1243,18 +1250,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1030 +#: ../../library/socket.rst:1037 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1033 +#: ../../library/socket.rst:1040 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1046 +#: ../../library/socket.rst:1053 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1262,7 +1269,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1042 +#: ../../library/socket.rst:1049 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1271,14 +1278,14 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1060 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1068 +#: ../../library/socket.rst:1075 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1286,14 +1293,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1071 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1079 +#: ../../library/socket.rst:1086 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1301,40 +1308,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1082 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1089 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1086 ../../library/socket.rst:1104 +#: ../../library/socket.rst:1093 ../../library/socket.rst:1111 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1093 +#: ../../library/socket.rst:1100 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1107 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1118 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1343,26 +1350,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1117 +#: ../../library/socket.rst:1124 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1120 +#: ../../library/socket.rst:1127 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1124 +#: ../../library/socket.rst:1131 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1130 +#: ../../library/socket.rst:1137 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1372,7 +1379,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1137 +#: ../../library/socket.rst:1144 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1380,7 +1387,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1148 +#: ../../library/socket.rst:1155 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1388,7 +1395,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1153 +#: ../../library/socket.rst:1160 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1397,15 +1404,15 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1159 ../../library/socket.rst:1179 +#: ../../library/socket.rst:1166 ../../library/socket.rst:1186 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/socket.rst:1161 ../../library/socket.rst:1181 +#: ../../library/socket.rst:1168 ../../library/socket.rst:1188 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1167 +#: ../../library/socket.rst:1174 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1414,7 +1421,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1181 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1422,7 +1429,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1196 +#: ../../library/socket.rst:1203 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1433,16 +1440,16 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1205 ../../library/socket.rst:1228 +#: ../../library/socket.rst:1212 ../../library/socket.rst:1235 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1207 ../../library/socket.rst:1697 -#: ../../library/socket.rst:1741 ../../library/socket.rst:1849 +#: ../../library/socket.rst:1214 ../../library/socket.rst:1704 +#: ../../library/socket.rst:1748 ../../library/socket.rst:1856 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1214 +#: ../../library/socket.rst:1221 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1452,7 +1459,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1222 +#: ../../library/socket.rst:1229 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1460,31 +1467,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1230 +#: ../../library/socket.rst:1237 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1244 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1244 +#: ../../library/socket.rst:1251 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1252 +#: ../../library/socket.rst:1259 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1273 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1492,114 +1499,114 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1257 ../../library/socket.rst:1695 -#: ../../library/socket.rst:1739 +#: ../../library/socket.rst:1264 ../../library/socket.rst:1702 +#: ../../library/socket.rst:1746 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/socket.rst:1264 +#: ../../library/socket.rst:1271 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1268 ../../library/socket.rst:1295 -#: ../../library/socket.rst:1312 ../../library/socket.rst:1329 -#: ../../library/socket.rst:1343 +#: ../../library/socket.rst:1275 ../../library/socket.rst:1302 +#: ../../library/socket.rst:1319 ../../library/socket.rst:1336 +#: ../../library/socket.rst:1350 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1272 ../../library/socket.rst:1299 -#: ../../library/socket.rst:1316 +#: ../../library/socket.rst:1279 ../../library/socket.rst:1306 +#: ../../library/socket.rst:1323 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1277 +#: ../../library/socket.rst:1284 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1280 +#: ../../library/socket.rst:1287 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1281 +#: ../../library/socket.rst:1288 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1282 +#: ../../library/socket.rst:1289 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1283 +#: ../../library/socket.rst:1290 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1292 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1291 +#: ../../library/socket.rst:1298 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1303 ../../library/socket.rst:1320 +#: ../../library/socket.rst:1310 ../../library/socket.rst:1327 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1308 +#: ../../library/socket.rst:1315 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1325 +#: ../../library/socket.rst:1332 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1331 ../../library/socket.rst:1345 +#: ../../library/socket.rst:1338 ../../library/socket.rst:1352 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1339 +#: ../../library/socket.rst:1346 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1352 +#: ../../library/socket.rst:1359 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1358 +#: ../../library/socket.rst:1365 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1360 +#: ../../library/socket.rst:1367 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1364 +#: ../../library/socket.rst:1371 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1371 +#: ../../library/socket.rst:1378 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1608,27 +1615,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1378 ../../library/socket.rst:1472 +#: ../../library/socket.rst:1385 ../../library/socket.rst:1479 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1381 ../../library/socket.rst:1610 -#: ../../library/socket.rst:1624 ../../library/socket.rst:1701 -#: ../../library/socket.rst:1774 ../../library/socket.rst:1793 -#: ../../library/socket.rst:1810 ../../library/socket.rst:1855 +#: ../../library/socket.rst:1388 ../../library/socket.rst:1617 +#: ../../library/socket.rst:1631 ../../library/socket.rst:1708 +#: ../../library/socket.rst:1781 ../../library/socket.rst:1800 +#: ../../library/socket.rst:1817 ../../library/socket.rst:1862 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1389 +#: ../../library/socket.rst:1396 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1403 +#: ../../library/socket.rst:1410 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1636,7 +1643,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1399 +#: ../../library/socket.rst:1406 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1645,20 +1652,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1405 +#: ../../library/socket.rst:1412 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1409 +#: ../../library/socket.rst:1416 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1415 +#: ../../library/socket.rst:1422 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1666,13 +1673,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1423 +#: ../../library/socket.rst:1430 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1426 +#: ../../library/socket.rst:1433 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1682,7 +1689,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1444 ../../library/socket.rst:1464 +#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1690,7 +1697,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1435 +#: ../../library/socket.rst:1442 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1698,7 +1705,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1453 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1708,38 +1715,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1459 +#: ../../library/socket.rst:1466 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1468 +#: ../../library/socket.rst:1475 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1480 +#: ../../library/socket.rst:1487 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1483 +#: ../../library/socket.rst:1490 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1489 +#: ../../library/socket.rst:1496 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1498 +#: ../../library/socket.rst:1505 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1747,14 +1754,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1506 +#: ../../library/socket.rst:1513 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1513 +#: ../../library/socket.rst:1520 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1766,16 +1773,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1527 +#: ../../library/socket.rst:1534 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1530 +#: ../../library/socket.rst:1537 msgid "This is equivalent to checking ``socket.gettimeout() != 0``." msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" -#: ../../library/socket.rst:1537 +#: ../../library/socket.rst:1544 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1786,30 +1793,30 @@ msgstr "" msgid "platform" msgstr "平台" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1551 msgid "Windows" msgstr "Windows" -#: ../../library/socket.rst:1546 +#: ../../library/socket.rst:1553 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1551 +#: ../../library/socket.rst:1558 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1561 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1562 +#: ../../library/socket.rst:1569 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1817,11 +1824,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1576 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1585 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1830,28 +1837,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1590 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1587 +#: ../../library/socket.rst:1594 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1593 +#: ../../library/socket.rst:1600 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1600 +#: ../../library/socket.rst:1607 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1860,13 +1867,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1607 +#: ../../library/socket.rst:1614 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1618 +#: ../../library/socket.rst:1625 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1876,14 +1883,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1629 +#: ../../library/socket.rst:1636 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1636 +#: ../../library/socket.rst:1643 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1894,7 +1901,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1646 +#: ../../library/socket.rst:1653 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1909,7 +1916,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1660 +#: ../../library/socket.rst:1667 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1922,7 +1929,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1671 +#: ../../library/socket.rst:1678 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1931,7 +1938,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1685 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1940,7 +1947,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1709 +#: ../../library/socket.rst:1716 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1953,7 +1960,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1727 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1961,14 +1968,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1725 +#: ../../library/socket.rst:1732 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1748 +#: ../../library/socket.rst:1755 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1978,7 +1985,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1758 +#: ../../library/socket.rst:1765 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1987,7 +1994,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1774 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1997,7 +2004,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1782 +#: ../../library/socket.rst:1789 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2007,13 +2014,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1789 +#: ../../library/socket.rst:1796 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1809 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2022,7 +2029,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1826 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2030,7 +2037,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1818 +#: ../../library/socket.rst:1825 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2050,18 +2057,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1845 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1854 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2069,14 +2076,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1878 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2090,38 +2097,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1894 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1895 +#: ../../library/socket.rst:1902 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1898 +#: ../../library/socket.rst:1905 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1900 +#: ../../library/socket.rst:1907 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1902 +#: ../../library/socket.rst:1909 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1904 +#: ../../library/socket.rst:1911 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1918 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -2131,19 +2138,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1925 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1927 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1933 +#: ../../library/socket.rst:1940 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -2156,11 +2163,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1946 +#: ../../library/socket.rst:1953 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1954 +#: ../../library/socket.rst:1961 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2168,7 +2175,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1964 +#: ../../library/socket.rst:1971 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2179,48 +2186,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1976 +#: ../../library/socket.rst:1983 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1979 +#: ../../library/socket.rst:1986 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1985 +#: ../../library/socket.rst:1992 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1990 +#: ../../library/socket.rst:1997 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1995 +#: ../../library/socket.rst:2002 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2002 +#: ../../library/socket.rst:2009 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2004 +#: ../../library/socket.rst:2011 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2008 +#: ../../library/socket.rst:2015 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2011 +#: ../../library/socket.rst:2018 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2228,14 +2235,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2016 +#: ../../library/socket.rst:2023 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2021 +#: ../../library/socket.rst:2028 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2244,11 +2251,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2035 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2030 +#: ../../library/socket.rst:2037 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2258,24 +2265,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2038 +#: ../../library/socket.rst:2045 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2040 +#: ../../library/socket.rst:2047 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2051 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2047 +#: ../../library/socket.rst:2054 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2283,11 +2290,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2056 +#: ../../library/socket.rst:2063 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2065 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2300,14 +2307,14 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2068 +#: ../../library/socket.rst:2075 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2099 +#: ../../library/socket.rst:2106 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2317,73 +2324,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2171 +#: ../../library/socket.rst:2178 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2196 +#: ../../library/socket.rst:2203 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2202 +#: ../../library/socket.rst:2209 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2206 +#: ../../library/socket.rst:2213 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2246 +#: ../../library/socket.rst:2253 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2251 +#: ../../library/socket.rst:2258 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2254 +#: ../../library/socket.rst:2261 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2261 +#: ../../library/socket.rst:2268 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2267 +#: ../../library/socket.rst:2274 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2269 +#: ../../library/socket.rst:2276 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2271 +#: ../../library/socket.rst:2278 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2274 +#: ../../library/socket.rst:2281 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2402,18 +2409,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "struct" msgstr "struct" diff --git a/library/sqlite3.po b/library/sqlite3.po index af64d9d6f7..43b1ec9efa 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+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-" @@ -45,27 +44,27 @@ msgstr "" #: ../../library/sqlite3.rst:34 msgid "This document includes four main sections:" -msgstr "" +msgstr "此文件包含四個主要章節:" #: ../../library/sqlite3.rst:36 msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." -msgstr "" +msgstr ":ref:`sqlite3-tutorial` 教導如何使用 :mod:`!sqlite3` 模組。" #: ../../library/sqlite3.rst:37 msgid "" ":ref:`sqlite3-reference` describes the classes and functions this module " "defines." -msgstr "" +msgstr ":ref:`sqlite3-reference` 描述此模組定義的類別與函式。" #: ../../library/sqlite3.rst:39 msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." -msgstr "" +msgstr ":ref:`sqlite3-howtos` 詳細說明如何處理特定工作。" #: ../../library/sqlite3.rst:40 msgid "" ":ref:`sqlite3-explanation` provides in-depth background on transaction " "control." -msgstr "" +msgstr ":ref:`sqlite3-explanation` 深入提供交易 (transaction) 控制的背景。" #: ../../library/sqlite3.rst:47 msgid "https://www.sqlite.org" @@ -87,7 +86,7 @@ msgstr "" #: ../../library/sqlite3.rst:52 msgid ":pep:`249` - Database API Specification 2.0" -msgstr "" +msgstr ":pep:`249` - 資料庫 API 規格 2.0" #: ../../library/sqlite3.rst:53 msgid "PEP written by Marc-André Lemburg." @@ -222,7 +221,7 @@ msgstr "" #: ../../library/sqlite3.rst:236 msgid ":ref:`sqlite3-howtos` for further reading:" -msgstr "" +msgstr "進一步參考 :ref:`sqlite3-howtos`:" #: ../../library/sqlite3.rst:238 msgid ":ref:`sqlite3-placeholders`" @@ -665,7 +664,7 @@ msgstr "" #: ../../library/sqlite3.rst:613 msgid "Connection objects" -msgstr "" +msgstr "Connection 物件" #: ../../library/sqlite3.rst:617 msgid "" @@ -813,8 +812,7 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:782 #: ../../library/sqlite3.rst:845 ../../library/sqlite3.rst:1115 -#: ../../library/sqlite3.rst:1415 ../../library/sqlite3.rst:1552 -#: ../../library/sqlite3.rst:1591 +#: ../../library/sqlite3.rst:1529 ../../library/sqlite3.rst:1568 msgid "Example:" msgstr "範例:" @@ -1116,27 +1114,31 @@ msgid "" "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1128 ../../library/sqlite3.rst:1198 +msgid ":ref:`sqlite3-howto-encoding`" +msgstr ":ref:`sqlite3-howto-encoding`" + +#: ../../library/sqlite3.rst:1133 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1131 +#: ../../library/sqlite3.rst:1135 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1138 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1141 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1143 +#: ../../library/sqlite3.rst:1147 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1144,46 +1146,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1152 +#: ../../library/sqlite3.rst:1156 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1159 +#: ../../library/sqlite3.rst:1163 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1167 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1182 +#: ../../library/sqlite3.rst:1186 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1202 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1196 +#: ../../library/sqlite3.rst:1204 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1201 ../../library/sqlite3.rst:1238 +#: ../../library/sqlite3.rst:1209 ../../library/sqlite3.rst:1246 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1212 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1224 +#: ../../library/sqlite3.rst:1232 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1191,40 +1193,40 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1229 +#: ../../library/sqlite3.rst:1237 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1232 +#: ../../library/sqlite3.rst:1240 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1241 +#: ../../library/sqlite3.rst:1249 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1258 +#: ../../library/sqlite3.rst:1266 msgid "Query a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1260 ../../library/sqlite3.rst:1271 +#: ../../library/sqlite3.rst:1268 ../../library/sqlite3.rst:1279 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: ../../library/sqlite3.rst:1269 +#: ../../library/sqlite3.rst:1277 msgid "Set a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1274 +#: ../../library/sqlite3.rst:1282 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: ../../library/sqlite3.rst:1282 +#: ../../library/sqlite3.rst:1290 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1233,17 +1235,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1288 +#: ../../library/sqlite3.rst:1296 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1304 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1304 +#: ../../library/sqlite3.rst:1312 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1251,96 +1253,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1310 +#: ../../library/sqlite3.rst:1318 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1313 +#: ../../library/sqlite3.rst:1321 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1317 +#: ../../library/sqlite3.rst:1325 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1321 +#: ../../library/sqlite3.rst:1329 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1324 +#: ../../library/sqlite3.rst:1332 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1329 +#: ../../library/sqlite3.rst:1337 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1344 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1347 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1351 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1353 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: ../../library/sqlite3.rst:1348 +#: ../../library/sqlite3.rst:1356 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: ../../library/sqlite3.rst:1352 +#: ../../library/sqlite3.rst:1360 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1362 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1365 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" -#: ../../library/sqlite3.rst:1361 +#: ../../library/sqlite3.rst:1369 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1376 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1379 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1386 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1350,13 +1352,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1386 +#: ../../library/sqlite3.rst:1394 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1391 +#: ../../library/sqlite3.rst:1399 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1364,7 +1366,7 @@ msgid "" "default)." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1406 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1373,30 +1375,33 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1405 ../../library/sqlite3.rst:1718 -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1413 ../../library/sqlite3.rst:1694 +#: ../../library/sqlite3.rst:1717 msgid "See :ref:`sqlite3-howto-row-factory` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" -#: ../../library/sqlite3.rst:1409 +#: ../../library/sqlite3.rst:1417 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " -"the ``TEXT`` data type. By default, this attribute is set to :class:`str`. " -"If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +"the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:1449 +#: ../../library/sqlite3.rst:1422 +msgid "See :ref:`sqlite3-howto-encoding` for more details." +msgstr "更多詳情請見 :ref:`sqlite3-howto-encoding`。" + +#: ../../library/sqlite3.rst:1426 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1456 +#: ../../library/sqlite3.rst:1433 msgid "Cursor objects" -msgstr "" +msgstr "Cursor 物件" -#: ../../library/sqlite3.rst:1458 +#: ../../library/sqlite3.rst:1435 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1404,39 +1409,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1465 +#: ../../library/sqlite3.rst:1442 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1490 +#: ../../library/sqlite3.rst:1467 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1474 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1478 msgid "A single SQL statement." -msgstr "" +msgstr "單一個 SQL 陳述式。" -#: ../../library/sqlite3.rst:1504 +#: ../../library/sqlite3.rst:1481 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1511 +#: ../../library/sqlite3.rst:1488 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1514 +#: ../../library/sqlite3.rst:1491 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1444,7 +1449,7 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: ../../library/sqlite3.rst:1523 +#: ../../library/sqlite3.rst:1500 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" @@ -1452,43 +1457,43 @@ msgid "" "instead." msgstr "" -#: ../../library/sqlite3.rst:1529 +#: ../../library/sqlite3.rst:1506 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1533 +#: ../../library/sqlite3.rst:1510 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1537 +#: ../../library/sqlite3.rst:1514 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1516 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1542 +#: ../../library/sqlite3.rst:1519 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1548 +#: ../../library/sqlite3.rst:1525 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" -#: ../../library/sqlite3.rst:1565 +#: ../../library/sqlite3.rst:1542 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1572 +#: ../../library/sqlite3.rst:1549 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " @@ -1496,7 +1501,7 @@ msgid "" "be raised instead." msgstr "" -#: ../../library/sqlite3.rst:1581 +#: ../../library/sqlite3.rst:1558 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1505,24 +1510,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1589 +#: ../../library/sqlite3.rst:1566 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1583 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1591 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1618 +#: ../../library/sqlite3.rst:1594 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1530,7 +1535,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1624 +#: ../../library/sqlite3.rst:1600 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1538,36 +1543,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1631 +#: ../../library/sqlite3.rst:1607 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1638 +#: ../../library/sqlite3.rst:1614 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1616 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:1645 ../../library/sqlite3.rst:1649 +#: ../../library/sqlite3.rst:1621 ../../library/sqlite3.rst:1625 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1653 +#: ../../library/sqlite3.rst:1629 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:1658 +#: ../../library/sqlite3.rst:1634 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1575,18 +1580,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1672 +#: ../../library/sqlite3.rst:1648 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1676 +#: ../../library/sqlite3.rst:1652 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1680 +#: ../../library/sqlite3.rst:1656 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1596,15 +1601,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1664 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1690 +#: ../../library/sqlite3.rst:1666 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1695 +#: ../../library/sqlite3.rst:1671 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1614,7 +1619,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1706 +#: ../../library/sqlite3.rst:1682 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1623,18 +1628,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1713 +#: ../../library/sqlite3.rst:1689 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1705 msgid "Row objects" -msgstr "" +msgstr "Row 物件" -#: ../../library/sqlite3.rst:1733 +#: ../../library/sqlite3.rst:1709 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1642,28 +1647,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1714 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1745 +#: ../../library/sqlite3.rst:1721 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1725 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1732 msgid "Blob objects" -msgstr "" +msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1738 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1671,24 +1676,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1767 +#: ../../library/sqlite3.rst:1743 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1773 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1799 +#: ../../library/sqlite3.rst:1775 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1805 +#: ../../library/sqlite3.rst:1781 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1696,18 +1701,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1813 +#: ../../library/sqlite3.rst:1789 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1795 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1799 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1715,26 +1720,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1831 +#: ../../library/sqlite3.rst:1807 msgid "PrepareProtocol objects" -msgstr "" +msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1835 +#: ../../library/sqlite3.rst:1811 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1819 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1845 +#: ../../library/sqlite3.rst:1821 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1849 +#: ../../library/sqlite3.rst:1825 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1742,39 +1747,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1856 +#: ../../library/sqlite3.rst:1832 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1860 +#: ../../library/sqlite3.rst:1836 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1865 +#: ../../library/sqlite3.rst:1841 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1872 +#: ../../library/sqlite3.rst:1848 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1879 +#: ../../library/sqlite3.rst:1855 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1886 +#: ../../library/sqlite3.rst:1862 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1782,14 +1787,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1869 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1899 +#: ../../library/sqlite3.rst:1875 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1797,20 +1802,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1883 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:1912 +#: ../../library/sqlite3.rst:1888 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1919 +#: ../../library/sqlite3.rst:1895 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1818,7 +1823,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1902 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1827,78 +1832,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1936 +#: ../../library/sqlite3.rst:1912 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1938 +#: ../../library/sqlite3.rst:1914 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1941 +#: ../../library/sqlite3.rst:1917 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1952 +#: ../../library/sqlite3.rst:1928 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1928 ../../library/sqlite3.rst:1945 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1934 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1945 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1975 +#: ../../library/sqlite3.rst:1951 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1907,47 +1912,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1961 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1965 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1969 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1995 +#: ../../library/sqlite3.rst:1971 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1973 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:1999 +#: ../../library/sqlite3.rst:1975 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:1977 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:2007 +#: ../../library/sqlite3.rst:1983 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1955,38 +1960,38 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:1996 msgid "Command-line interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/sqlite3.rst:2022 +#: ../../library/sqlite3.rst:1998 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2029 +#: ../../library/sqlite3.rst:2005 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2011 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2039 +#: ../../library/sqlite3.rst:2015 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2047 +#: ../../library/sqlite3.rst:2023 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2052 +#: ../../library/sqlite3.rst:2028 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2054 +#: ../../library/sqlite3.rst:2030 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1994,7 +1999,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2067 +#: ../../library/sqlite3.rst:2043 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2002,7 +2007,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2072 +#: ../../library/sqlite3.rst:2048 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2013,24 +2018,24 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2109 +#: ../../library/sqlite3.rst:2085 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2116 +#: ../../library/sqlite3.rst:2092 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2118 +#: ../../library/sqlite3.rst:2094 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:2122 +#: ../../library/sqlite3.rst:2098 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2040,11 +2045,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2134 +#: ../../library/sqlite3.rst:2110 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2136 +#: ../../library/sqlite3.rst:2112 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2054,84 +2059,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2167 +#: ../../library/sqlite3.rst:2143 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2169 +#: ../../library/sqlite3.rst:2145 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2175 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2177 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:2206 +#: ../../library/sqlite3.rst:2182 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:2209 +#: ../../library/sqlite3.rst:2185 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:2214 +#: ../../library/sqlite3.rst:2190 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2223 +#: ../../library/sqlite3.rst:2199 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2227 +#: ../../library/sqlite3.rst:2203 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2228 +#: ../../library/sqlite3.rst:2204 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2229 +#: ../../library/sqlite3.rst:2205 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2209 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2284 +#: ../../library/sqlite3.rst:2260 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2286 +#: ../../library/sqlite3.rst:2262 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2324 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2350 +#: ../../library/sqlite3.rst:2326 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2143,11 +2148,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2391 +#: ../../library/sqlite3.rst:2367 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2393 +#: ../../library/sqlite3.rst:2369 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2159,60 +2164,60 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2404 +#: ../../library/sqlite3.rst:2380 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2409 +#: ../../library/sqlite3.rst:2385 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2443 +#: ../../library/sqlite3.rst:2419 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2445 +#: ../../library/sqlite3.rst:2421 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2447 +#: ../../library/sqlite3.rst:2423 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2456 +#: ../../library/sqlite3.rst:2432 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2466 +#: ../../library/sqlite3.rst:2442 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2480 +#: ../../library/sqlite3.rst:2456 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2489 +#: ../../library/sqlite3.rst:2465 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2491 +#: ../../library/sqlite3.rst:2467 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2496 +#: ../../library/sqlite3.rst:2472 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2220,7 +2225,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2501 +#: ../../library/sqlite3.rst:2477 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2228,11 +2233,11 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2511 +#: ../../library/sqlite3.rst:2487 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2528 +#: ../../library/sqlite3.rst:2504 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -2240,41 +2245,80 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2533 +#: ../../library/sqlite3.rst:2509 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2542 +#: ../../library/sqlite3.rst:2518 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2552 +#: ../../library/sqlite3.rst:2528 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2563 +#: ../../library/sqlite3.rst:2539 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2578 +#: ../../library/sqlite3.rst:2554 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2586 +#: ../../library/sqlite3.rst:2562 +msgid "How to handle non-UTF-8 text encodings" +msgstr "" + +#: ../../library/sqlite3.rst:2564 +msgid "" +"By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " +"the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." +msgstr "" + +#: ../../library/sqlite3.rst:2570 +msgid "" +"Because of SQLite's `flexible typing`_, it is not uncommon to encounter " +"table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " +"even arbitrary data. To demonstrate, let's assume we have a database with " +"ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" +msgstr "" + +#: ../../library/sqlite3.rst:2583 +msgid "" +"For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " +"can use the following technique, borrowed from the :ref:`unicode-howto`:" +msgstr "" + +#: ../../library/sqlite3.rst:2592 +msgid "" +"The :mod:`!sqlite3` module API does not support strings containing " +"surrogates." +msgstr "" + +#: ../../library/sqlite3.rst:2597 +msgid ":ref:`unicode-howto`" +msgstr "" + +#: ../../library/sqlite3.rst:2603 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2592 +#: ../../library/sqlite3.rst:2609 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2594 +#: ../../library/sqlite3.rst:2611 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -2282,24 +2326,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2603 +#: ../../library/sqlite3.rst:2620 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2605 +#: ../../library/sqlite3.rst:2622 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2610 +#: ../../library/sqlite3.rst:2627 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2614 +#: ../../library/sqlite3.rst:2631 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -2308,21 +2352,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2619 +#: ../../library/sqlite3.rst:2636 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2620 +#: ../../library/sqlite3.rst:2637 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2621 +#: ../../library/sqlite3.rst:2638 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2624 +#: ../../library/sqlite3.rst:2641 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -2331,25 +2375,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2632 +#: ../../library/sqlite3.rst:2649 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2641 +#: ../../library/sqlite3.rst:2658 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2645 +#: ../../library/sqlite3.rst:2662 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2649 +#: ../../library/sqlite3.rst:2666 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -2357,7 +2401,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2655 +#: ../../library/sqlite3.rst:2672 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2371,7 +2415,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2668 +#: ../../library/sqlite3.rst:2685 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2381,33 +2425,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2676 +#: ../../library/sqlite3.rst:2693 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2680 +#: ../../library/sqlite3.rst:2697 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2684 +#: ../../library/sqlite3.rst:2701 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1469 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1492 ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1469 ../../library/sqlite3.rst:1470 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1470 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 00d44ff013..1e665b2e7e 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,84 +21,88 @@ msgstr "" msgid ":mod:`sys.monitoring` --- Execution event monitoring" msgstr "" -#: ../../library/sys.monitoring.rst:11 +#: ../../library/sys.monitoring.rst:13 msgid "" -"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +":mod:`sys.monitoring` is a namespace within the :mod:`sys` module, not an " "independent module, so there is no need to ``import sys.monitoring``, simply " "``import sys`` and then use ``sys.monitoring``." msgstr "" -#: ../../library/sys.monitoring.rst:17 +#: ../../library/sys.monitoring.rst:19 msgid "" "This namespace provides access to the functions and constants necessary to " "activate and control event monitoring." msgstr "" -#: ../../library/sys.monitoring.rst:20 +#: ../../library/sys.monitoring.rst:22 msgid "" "As programs execute, events occur that might be of interest to tools that " -"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"monitor execution. The :mod:`sys.monitoring` namespace provides means to " "receive callbacks when events of interest occur." msgstr "" -#: ../../library/sys.monitoring.rst:24 +#: ../../library/sys.monitoring.rst:26 msgid "The monitoring API consists of three components:" msgstr "" -#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 -msgid "Tool identifiers" +#: ../../library/sys.monitoring.rst:28 +msgid "`Tool identifiers`_" msgstr "" -#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 -msgid "Events" +#: ../../library/sys.monitoring.rst:29 +msgid "`Events`_" msgstr "" -#: ../../library/sys.monitoring.rst:28 -msgid "Callbacks" +#: ../../library/sys.monitoring.rst:30 +msgid ":ref:`Callbacks `" msgstr "" #: ../../library/sys.monitoring.rst:33 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:35 msgid "" -"A tool identifier is an integer and associated name. Tool identifiers are " -"used to discourage tools from interfering with each other and to allow " +"A tool identifier is an integer and the associated name. Tool identifiers " +"are used to discourage tools from interfering with each other and to allow " "multiple tools to operate at the same time. Currently tools are completely " "independent and cannot be used to monitor each other. This restriction may " "be lifted in the future." msgstr "" -#: ../../library/sys.monitoring.rst:39 +#: ../../library/sys.monitoring.rst:41 msgid "" "Before registering or activating events, a tool should choose an identifier. " -"Identifiers are integers in the range 0 to 5." +"Identifiers are integers in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:43 +#: ../../library/sys.monitoring.rst:45 msgid "Registering and using tools" msgstr "" -#: ../../library/sys.monitoring.rst:47 +#: ../../library/sys.monitoring.rst:49 msgid "" -"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " -"inclusive. Raises a ``ValueError`` if ``id`` is in use." +"Must be called before *tool_id* can be used. *tool_id* must be in the range " +"0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use." msgstr "" -#: ../../library/sys.monitoring.rst:53 -msgid "Should be called once a tool no longer requires ``id``." +#: ../../library/sys.monitoring.rst:55 +msgid "Should be called once a tool no longer requires *tool_id*." msgstr "" -#: ../../library/sys.monitoring.rst:57 +#: ../../library/sys.monitoring.rst:59 msgid "" -"Returns the name of the tool if ``id`` is in use, otherwise it returns " -"``None``. ``id`` must be in the range 0 to 5 inclusive." +"Returns the name of the tool if *tool_id* is in use, otherwise it returns " +"``None``. *tool_id* must be in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:61 +#: ../../library/sys.monitoring.rst:63 msgid "" "All IDs are treated the same by the VM with regard to events, but the " "following IDs are pre-defined to make co-operation of tools easier::" msgstr "" -#: ../../library/sys.monitoring.rst:69 +#: ../../library/sys.monitoring.rst:71 msgid "" "There is no obligation to set an ID, nor is there anything preventing a tool " "from using an ID even it is already in use. However, tools are encouraged to " @@ -106,312 +110,327 @@ msgid "" msgstr "" #: ../../library/sys.monitoring.rst:76 -msgid "The following events are supported:" +msgid "Events" msgstr "" -#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 -msgid "BRANCH" +#: ../../library/sys.monitoring.rst:78 +msgid "The following events are supported:" msgstr "" -#: ../../library/sys.monitoring.rst:79 +#: ../../library/sys.monitoring.rst:82 msgid "A conditional branch is taken (or not)." msgstr "" -#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 -msgid "CALL" -msgstr "" - -#: ../../library/sys.monitoring.rst:81 +#: ../../library/sys.monitoring.rst:86 msgid "A call in Python code (event occurs before the call)." msgstr "" -#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 -msgid "C_RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:83 +#: ../../library/sys.monitoring.rst:90 msgid "" -"Exception raised from any callable, except Python functions (event occurs " -"after the exit)." -msgstr "" - -#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 -msgid "C_RETURN" +"An exception raised from any callable, except for Python functions (event " +"occurs after the exit)." msgstr "" -#: ../../library/sys.monitoring.rst:85 +#: ../../library/sys.monitoring.rst:94 msgid "" -"Return from any callable, except Python functions (event occurs after the " -"return)." -msgstr "" - -#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 -msgid "EXCEPTION_HANDLED" +"Return from any callable, except for Python functions (event occurs after " +"the return)." msgstr "" -#: ../../library/sys.monitoring.rst:87 +#: ../../library/sys.monitoring.rst:98 msgid "An exception is handled." msgstr "" -#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 -msgid "INSTRUCTION" -msgstr "" - -#: ../../library/sys.monitoring.rst:89 +#: ../../library/sys.monitoring.rst:102 msgid "A VM instruction is about to be executed." msgstr "" -#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 -msgid "JUMP" -msgstr "" - -#: ../../library/sys.monitoring.rst:91 +#: ../../library/sys.monitoring.rst:106 msgid "An unconditional jump in the control flow graph is made." msgstr "" -#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 -msgid "LINE" -msgstr "" - -#: ../../library/sys.monitoring.rst:93 +#: ../../library/sys.monitoring.rst:110 msgid "" "An instruction is about to be executed that has a different line number from " "the preceding instruction." msgstr "" -#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 -msgid "PY_RESUME" -msgstr "" - -#: ../../library/sys.monitoring.rst:95 +#: ../../library/sys.monitoring.rst:114 msgid "" "Resumption of a Python function (for generator and coroutine functions), " -"except for throw() calls." +"except for ``throw()`` calls." msgstr "" -#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 -msgid "PY_RETURN" -msgstr "" - -#: ../../library/sys.monitoring.rst:97 +#: ../../library/sys.monitoring.rst:118 msgid "" "Return from a Python function (occurs immediately before the return, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 -msgid "PY_START" -msgstr "" - -#: ../../library/sys.monitoring.rst:99 +#: ../../library/sys.monitoring.rst:122 msgid "" "Start of a Python function (occurs immediately after the call, the callee's " "frame will be on the stack)" msgstr "" -#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 -msgid "PY_THROW" -msgstr "" - -#: ../../library/sys.monitoring.rst:101 -msgid "A Python function is resumed by a throw() call." -msgstr "" - -#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 -msgid "PY_UNWIND" +#: ../../library/sys.monitoring.rst:126 +msgid "A Python function is resumed by a ``throw()`` call." msgstr "" -#: ../../library/sys.monitoring.rst:103 +#: ../../library/sys.monitoring.rst:130 msgid "Exit from a Python function during exception unwinding." msgstr "" -#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 -msgid "PY_YIELD" -msgstr "" - -#: ../../library/sys.monitoring.rst:105 +#: ../../library/sys.monitoring.rst:134 msgid "" "Yield from a Python function (occurs immediately before the yield, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 -msgid "RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:107 +#: ../../library/sys.monitoring.rst:138 msgid "" -"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +"An exception is raised, except those that cause a :monitoring-event:" +"`STOP_ITERATION` event." msgstr "" -#: ../../library/sys.monitoring.rst:108 -msgid "RERAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:109 +#: ../../library/sys.monitoring.rst:142 msgid "" -"An exception is re-raised, for example at the end of a ``finally`` block." +"An exception is re-raised, for example at the end of a :keyword:`finally` " +"block." msgstr "" -#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 -msgid "STOP_ITERATION" -msgstr "" - -#: ../../library/sys.monitoring.rst:111 +#: ../../library/sys.monitoring.rst:146 msgid "" -"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +"An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " +"event`_." msgstr "" -#: ../../library/sys.monitoring.rst:113 +#: ../../library/sys.monitoring.rst:149 msgid "More events may be added in the future." msgstr "" -#: ../../library/sys.monitoring.rst:115 +#: ../../library/sys.monitoring.rst:151 msgid "" "These events are attributes of the :mod:`!sys.monitoring.events` namespace. " "Each event is represented as a power-of-2 integer constant. To define a set " "of events, simply bitwise or the individual events together. For example, to " -"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " -"``PY_RETURN | PY_START``." +"specify both :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_START` " +"events, use the expression ``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:159 +msgid "An alias for ``0`` so users can do explict comparisions like::" msgstr "" -#: ../../library/sys.monitoring.rst:121 +#: ../../library/sys.monitoring.rst:164 msgid "Events are divided into three groups:" msgstr "" -#: ../../library/sys.monitoring.rst:124 +#: ../../library/sys.monitoring.rst:167 msgid "Local events" msgstr "" -#: ../../library/sys.monitoring.rst:126 +#: ../../library/sys.monitoring.rst:169 msgid "" "Local events are associated with normal execution of the program and happen " "at clearly defined locations. All local events can be disabled. The local " "events are:" msgstr "" -#: ../../library/sys.monitoring.rst:142 +#: ../../library/sys.monitoring.rst:173 +msgid ":monitoring-event:`PY_START`" +msgstr "" + +#: ../../library/sys.monitoring.rst:174 +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +#: ../../library/sys.monitoring.rst:175 +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:176 +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid ":monitoring-event:`CALL`" +msgstr "" + +#: ../../library/sys.monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:179 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:180 +msgid ":monitoring-event:`JUMP`" +msgstr "" + +#: ../../library/sys.monitoring.rst:181 +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +#: ../../library/sys.monitoring.rst:182 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 msgid "Ancillary events" msgstr "" -#: ../../library/sys.monitoring.rst:144 +#: ../../library/sys.monitoring.rst:187 msgid "" "Ancillary events can be monitored like other events, but are controlled by " "another event:" msgstr "" -#: ../../library/sys.monitoring.rst:150 +#: ../../library/sys.monitoring.rst:190 +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " -"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " -"corresponding ``CALL`` event is being monitored." +"The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " +"controlled by the :monitoring-event:`CALL` event. :monitoring-event:" +"`C_RETURN` and :monitoring-event:`C_RAISE` events will only be seen if the " +"corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" -#: ../../library/sys.monitoring.rst:155 +#: ../../library/sys.monitoring.rst:199 msgid "Other events" msgstr "" -#: ../../library/sys.monitoring.rst:157 +#: ../../library/sys.monitoring.rst:201 msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled." msgstr "" -#: ../../library/sys.monitoring.rst:160 +#: ../../library/sys.monitoring.rst:204 msgid "The other events that can be monitored are:" msgstr "" -#: ../../library/sys.monitoring.rst:169 +#: ../../library/sys.monitoring.rst:206 +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +#: ../../library/sys.monitoring.rst:208 +msgid ":monitoring-event:`RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +#: ../../library/sys.monitoring.rst:213 msgid "The STOP_ITERATION event" msgstr "" -#: ../../library/sys.monitoring.rst:171 +#: ../../library/sys.monitoring.rst:215 msgid "" -":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " -"``StopIteration`` exception is raised when returning a value from a " +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :" +"exc:`StopIteration` exception is raised when returning a value from a " "generator or coroutine. However, this is a very inefficient way to return a " "value, so some Python implementations, notably CPython 3.12+, do not raise " "an exception unless it would be visible to other code." msgstr "" -#: ../../library/sys.monitoring.rst:177 +#: ../../library/sys.monitoring.rst:221 msgid "" "To allow tools to monitor for real exceptions without slowing down " -"generators and coroutines, the ``STOP_ITERATION`` event is provided. " -"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +"generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " +"provided. :monitoring-event:`STOP_ITERATION` can be locally disabled, " +"unlike :monitoring-event:`RAISE`." msgstr "" -#: ../../library/sys.monitoring.rst:183 +#: ../../library/sys.monitoring.rst:227 msgid "Turning events on and off" msgstr "" -#: ../../library/sys.monitoring.rst:185 +#: ../../library/sys.monitoring.rst:229 msgid "" -"In order to monitor an event, it must be turned on and a callback " -"registered. Events can be turned on or off by setting the events either " -"globally or for a particular code object." +"In order to monitor an event, it must be turned on and a corresponding " +"callback must be registered. Events can be turned on or off by setting the " +"events either globally or for a particular code object." msgstr "" -#: ../../library/sys.monitoring.rst:191 +#: ../../library/sys.monitoring.rst:236 msgid "Setting events globally" msgstr "" -#: ../../library/sys.monitoring.rst:193 +#: ../../library/sys.monitoring.rst:238 msgid "" "Events can be controlled globally by modifying the set of events being " "monitored." msgstr "" -#: ../../library/sys.monitoring.rst:197 +#: ../../library/sys.monitoring.rst:242 msgid "Returns the ``int`` representing all the active events." msgstr "" -#: ../../library/sys.monitoring.rst:201 +#: ../../library/sys.monitoring.rst:246 msgid "" -"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " -"if ``tool_id`` is not in use." +"Activates all events which are set in *event_set*. Raises a :exc:" +"`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:204 +#: ../../library/sys.monitoring.rst:249 msgid "No events are active by default." msgstr "" -#: ../../library/sys.monitoring.rst:207 +#: ../../library/sys.monitoring.rst:252 msgid "Per code object events" msgstr "" -#: ../../library/sys.monitoring.rst:209 +#: ../../library/sys.monitoring.rst:254 msgid "Events can also be controlled on a per code object basis." msgstr "" -#: ../../library/sys.monitoring.rst:213 -msgid "Returns all the local events for ``code``" +#: ../../library/sys.monitoring.rst:258 +msgid "Returns all the local events for *code*" msgstr "" -#: ../../library/sys.monitoring.rst:217 +#: ../../library/sys.monitoring.rst:262 msgid "" -"Activates all the local events for ``code`` which are set in ``event_set``. " -"Raises a ``ValueError`` if ``tool_id`` is not in use." +"Activates all the local events for *code* which are set in *event_set*. " +"Raises a :exc:`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:220 +#: ../../library/sys.monitoring.rst:265 msgid "" "Local events add to global events, but do not mask them. In other words, all " "global events will trigger for a code object, regardless of the local events." msgstr "" -#: ../../library/sys.monitoring.rst:226 +#: ../../library/sys.monitoring.rst:271 msgid "Disabling events" msgstr "" -#: ../../library/sys.monitoring.rst:228 +#: ../../library/sys.monitoring.rst:275 msgid "" -"Local events can be disabled for a specific code location by returning ``sys." -"monitoring.DISABLE`` from a callback function. This does not change which " -"events are set, or any other code locations for the same event." +"A special value that can be returned from a callback function to disable " +"events for the current code location." msgstr "" -#: ../../library/sys.monitoring.rst:232 +#: ../../library/sys.monitoring.rst:278 +msgid "" +"Local events can be disabled for a specific code location by returning :data:" +"`sys.monitoring.DISABLE` from a callback function. This does not change " +"which events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:282 msgid "" "Disabling events for specific locations is very important for high " "performance monitoring. For example, a program can be run under a debugger " @@ -419,122 +438,105 @@ msgid "" "breakpoints." msgstr "" -#: ../../library/sys.monitoring.rst:239 +#: ../../library/sys.monitoring.rst:289 +msgid "" +"Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " +"for all tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 msgid "Registering callback functions" msgstr "" -#: ../../library/sys.monitoring.rst:241 +#: ../../library/sys.monitoring.rst:298 msgid "To register a callable for events call" msgstr "" -#: ../../library/sys.monitoring.rst:245 -msgid "" -"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +#: ../../library/sys.monitoring.rst:302 +msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" -#: ../../library/sys.monitoring.rst:247 +#: ../../library/sys.monitoring.rst:304 msgid "" -"If another callback was registered for the given ``tool_id`` and ``event``, " -"it is unregistered and returned. Otherwise ``register_callback`` returns " +"If another callback was registered for the given *tool_id* and *event*, it " +"is unregistered and returned. Otherwise :func:`register_callback` returns " "``None``." msgstr "" -#: ../../library/sys.monitoring.rst:252 +#: ../../library/sys.monitoring.rst:309 msgid "" "Functions can be unregistered by calling ``sys.monitoring." "register_callback(tool_id, event, None)``." msgstr "" -#: ../../library/sys.monitoring.rst:255 +#: ../../library/sys.monitoring.rst:312 msgid "Callback functions can be registered and unregistered at any time." msgstr "" -#: ../../library/sys.monitoring.rst:257 +#: ../../library/sys.monitoring.rst:314 msgid "" -"Registering or unregistering a callback function will generate a ``sys." -"audit`` event." +"Registering or unregistering a callback function will generate a :func:`sys." +"audit` event." msgstr "" -#: ../../library/sys.monitoring.rst:261 +#: ../../library/sys.monitoring.rst:318 msgid "Callback function arguments" msgstr "" -#: ../../library/sys.monitoring.rst:263 +#: ../../library/sys.monitoring.rst:322 +msgid "" +"A special value that is passed to a callback function to indicate that there " +"are no arguments to the call." +msgstr "" + +#: ../../library/sys.monitoring.rst:325 msgid "" "When an active event occurs, the registered callback function is called. " "Different events will provide the callback function with different " "arguments, as follows:" msgstr "" -#: ../../library/sys.monitoring.rst:266 -msgid "``PY_START`` and ``PY_RESUME``::" +#: ../../library/sys.monitoring.rst:328 +msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" msgstr "" -#: ../../library/sys.monitoring.rst:270 -msgid "``PY_RETURN`` and ``PY_YIELD``:" +#: ../../library/sys.monitoring.rst:332 +msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" msgstr "" -#: ../../library/sys.monitoring.rst:272 +#: ../../library/sys.monitoring.rst:336 msgid "" -"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " -"Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:274 -msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:" +"`C_RETURN`::" msgstr "" -#: ../../library/sys.monitoring.rst:276 +#: ../../library/sys.monitoring.rst:340 msgid "" -"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " -"object | MISSING) -> DISABLE | Any``" +"If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." msgstr "" -#: ../../library/sys.monitoring.rst:278 -msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." -msgstr "" - -#: ../../library/sys.monitoring.rst:280 -msgid "" -"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " -"and ``STOP_ITERATION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:282 +#: ../../library/sys.monitoring.rst:342 msgid "" -"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " -"DISABLE | Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:284 -msgid "``LINE``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:286 -msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:" +"`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:" +"`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" -#: ../../library/sys.monitoring.rst:288 -msgid "``BRANCH`` and ``JUMP``:" +#: ../../library/sys.monitoring.rst:347 +msgid ":monitoring-event:`LINE`::" msgstr "" -#: ../../library/sys.monitoring.rst:290 -msgid "" -"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " -"DISABLE | Any``" +#: ../../library/sys.monitoring.rst:351 +msgid ":monitoring-event:`BRANCH` and :monitoring-event:`JUMP`::" msgstr "" -#: ../../library/sys.monitoring.rst:292 +#: ../../library/sys.monitoring.rst:355 msgid "" -"Note that the ``destination_offset`` is where the code will next execute. " -"For an untaken branch this will be the offset of the instruction following " -"the branch." +"Note that the *destination_offset* is where the code will next execute. For " +"an untaken branch this will be the offset of the instruction following the " +"branch." msgstr "" -#: ../../library/sys.monitoring.rst:296 -msgid "``INSTRUCTION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:298 -msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +#: ../../library/sys.monitoring.rst:359 +msgid ":monitoring-event:`INSTRUCTION`::" msgstr "" diff --git a/library/sys.po b/library/sys.po index 93f7eb9d6e..e95afb800e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,7 +79,6 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" #: ../../library/sys.rst:49 -#, fuzzy msgid "" "Calling :func:`sys.addaudithook` will itself raise an auditing event named " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -88,9 +87,9 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" "呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys." -"addaudithook`` 的稽核事件。如果任何現有的掛鉤函式引發從 :class:" -"`RuntimeError` 衍生的例外,則不會添加新的掛鉤函式並抑制異常。因此,除非呼叫者" -"控制所有已存在的掛鉤函式,他們不能假設他們的掛鉤函式已被添加。" +"addaudithook`` 的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` " +"衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " +"hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:56 msgid "" @@ -231,27 +230,34 @@ msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。" msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " -"a checkpoint, to recursively debug some other code." +"a checkpoint, to recursively debug or profile some other code." +msgstr "" + +#: ../../library/sys.rst:178 +msgid "" +"Tracing is suspended while calling a tracing function set by :func:" +"`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" +"call_tracing` enables explicit recursion of the tracing function." msgstr "" -#: ../../library/sys.rst:181 +#: ../../library/sys.rst:185 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:186 +#: ../../library/sys.rst:190 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:190 ../../library/sys.rst:206 -#: ../../library/sys.rst:219 +#: ../../library/sys.rst:194 ../../library/sys.rst:210 +#: ../../library/sys.rst:223 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:195 +#: ../../library/sys.rst:199 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -259,7 +265,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:200 +#: ../../library/sys.rst:204 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -268,14 +274,14 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:208 +#: ../../library/sys.rst:212 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys._current_frames``。" -#: ../../library/sys.rst:212 +#: ../../library/sys.rst:216 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -283,11 +289,11 @@ msgid "" "included in the result dictionary." msgstr "" -#: ../../library/sys.rst:217 +#: ../../library/sys.rst:221 msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:221 +#: ../../library/sys.rst:225 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -295,20 +301,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "_current_exceptions``。" -#: ../../library/sys.rst:223 +#: ../../library/sys.rst:227 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" -#: ../../library/sys.rst:229 +#: ../../library/sys.rst:233 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:233 +#: ../../library/sys.rst:237 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -318,7 +324,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:240 +#: ../../library/sys.rst:244 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -332,48 +338,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:252 +#: ../../library/sys.rst:256 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:256 +#: ../../library/sys.rst:260 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:263 +#: ../../library/sys.rst:267 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:266 +#: ../../library/sys.rst:270 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:274 +#: ../../library/sys.rst:278 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:280 +#: ../../library/sys.rst:284 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:972 -#: ../../library/sys.rst:1717 ../../library/sys.rst:1953 +#: ../../library/sys.rst:286 ../../library/sys.rst:976 +#: ../../library/sys.rst:1730 ../../library/sys.rst:1966 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:287 +#: ../../library/sys.rst:291 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -382,7 +388,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:293 +#: ../../library/sys.rst:297 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -390,15 +396,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:297 +#: ../../library/sys.rst:301 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:317 +#: ../../library/sys.rst:321 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:323 +#: ../../library/sys.rst:327 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -407,20 +413,20 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:332 +#: ../../library/sys.rst:336 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:338 +#: ../../library/sys.rst:342 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:346 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -428,19 +434,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:350 +#: ../../library/sys.rst:354 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:352 +#: ../../library/sys.rst:356 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:359 +#: ../../library/sys.rst:363 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -451,12 +457,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:367 +#: ../../library/sys.rst:371 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:369 +#: ../../library/sys.rst:373 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -464,12 +470,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:379 +#: ../../library/sys.rst:383 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:381 +#: ../../library/sys.rst:385 msgid "" "When an exception other than :exc:`SystemExit` is raised and uncaught, the " "interpreter calls ``sys.excepthook`` with three arguments, the exception " @@ -480,7 +486,7 @@ msgid "" "argument function to ``sys.excepthook``." msgstr "" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:392 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -488,7 +494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:390 +#: ../../library/sys.rst:394 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -498,14 +504,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:399 +#: ../../library/sys.rst:403 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:409 +#: ../../library/sys.rst:413 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -514,15 +520,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:415 +#: ../../library/sys.rst:419 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:418 +#: ../../library/sys.rst:422 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:424 +#: ../../library/sys.rst:428 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -530,11 +536,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:429 +#: ../../library/sys.rst:433 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:436 +#: ../../library/sys.rst:440 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -545,13 +551,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:451 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:450 +#: ../../library/sys.rst:454 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -559,7 +565,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:462 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -571,7 +577,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:469 +#: ../../library/sys.rst:473 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -579,7 +585,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:477 +#: ../../library/sys.rst:481 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -587,13 +593,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:485 +#: ../../library/sys.rst:489 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:487 +#: ../../library/sys.rst:491 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -609,7 +615,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:504 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -618,113 +624,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:509 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:517 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:523 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:522 ../../library/sys.rst:525 +#: ../../library/sys.rst:526 ../../library/sys.rst:529 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:532 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:535 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:534 +#: ../../library/sys.rst:538 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:537 +#: ../../library/sys.rst:541 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:540 +#: ../../library/sys.rst:544 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:543 +#: ../../library/sys.rst:547 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:546 +#: ../../library/sys.rst:550 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:549 +#: ../../library/sys.rst:553 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:552 +#: ../../library/sys.rst:556 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:555 +#: ../../library/sys.rst:559 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:558 +#: ../../library/sys.rst:562 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:561 +#: ../../library/sys.rst:565 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:564 +#: ../../library/sys.rst:568 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:567 +#: ../../library/sys.rst:571 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:571 +#: ../../library/sys.rst:575 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:577 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:580 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -732,15 +738,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:600 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -750,161 +756,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:612 +#: ../../library/sys.rst:616 msgid "attribute" msgstr "屬性" -#: ../../library/sys.rst:613 +#: ../../library/sys.rst:617 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:614 +#: ../../library/sys.rst:618 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:621 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:618 +#: ../../library/sys.rst:622 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:624 +#: ../../library/sys.rst:628 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:629 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:633 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:630 +#: ../../library/sys.rst:634 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:638 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:635 +#: ../../library/sys.rst:639 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:638 +#: ../../library/sys.rst:642 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:639 +#: ../../library/sys.rst:643 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:647 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:648 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:652 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:649 +#: ../../library/sys.rst:653 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:651 +#: ../../library/sys.rst:655 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:655 +#: ../../library/sys.rst:659 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:660 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:660 +#: ../../library/sys.rst:664 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:661 +#: ../../library/sys.rst:665 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:668 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:669 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:668 +#: ../../library/sys.rst:672 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:669 +#: ../../library/sys.rst:673 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:677 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:674 +#: ../../library/sys.rst:678 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:675 +#: ../../library/sys.rst:679 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:676 +#: ../../library/sys.rst:680 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:677 +#: ../../library/sys.rst:681 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:683 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:682 +#: ../../library/sys.rst:686 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -912,13 +918,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:699 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:704 +#: ../../library/sys.rst:708 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -928,7 +934,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:717 +#: ../../library/sys.rst:721 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -938,42 +944,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:724 +#: ../../library/sys.rst:728 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:736 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:739 +#: ../../library/sys.rst:743 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:745 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:748 +#: ../../library/sys.rst:752 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:758 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:759 ../../library/sys.rst:1447 +#: ../../library/sys.rst:763 ../../library/sys.rst:1451 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:764 +#: ../../library/sys.rst:768 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:797 +#: ../../library/sys.rst:801 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1028,20 +1034,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:815 +#: ../../library/sys.rst:819 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:822 +#: ../../library/sys.rst:826 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:830 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1050,13 +1056,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:832 +#: ../../library/sys.rst:836 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:842 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1064,46 +1070,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:850 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:851 +#: ../../library/sys.rst:855 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:858 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:861 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:865 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:867 +#: ../../library/sys.rst:871 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:879 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1112,7 +1118,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:880 +#: ../../library/sys.rst:884 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1120,13 +1126,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:884 ../../library/sys.rst:900 +#: ../../library/sys.rst:888 ../../library/sys.rst:904 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:890 +#: ../../library/sys.rst:894 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1135,7 +1141,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:900 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1143,15 +1149,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:914 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:923 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:927 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1159,7 +1165,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:935 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1171,54 +1177,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:946 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:944 +#: ../../library/sys.rst:948 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Constant" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:962 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:966 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1226,24 +1232,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:972 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:978 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:982 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:984 +#: ../../library/sys.rst:988 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1253,71 +1259,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:991 +#: ../../library/sys.rst:995 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:995 ../../library/sys.rst:1649 +#: ../../library/sys.rst:999 ../../library/sys.rst:1662 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1001 +#: ../../library/sys.rst:1005 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1007 ../../library/sys.rst:1670 +#: ../../library/sys.rst:1011 ../../library/sys.rst:1683 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:1013 +#: ../../library/sys.rst:1017 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:1019 +#: ../../library/sys.rst:1023 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1023 +#: ../../library/sys.rst:1027 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1031 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1031 +#: ../../library/sys.rst:1035 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1039 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1043 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1043 +#: ../../library/sys.rst:1047 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1051 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1055 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1057 +#: ../../library/sys.rst:1061 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1325,7 +1331,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1068 +#: ../../library/sys.rst:1072 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1333,25 +1339,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1073 +#: ../../library/sys.rst:1077 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1082 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1082 +#: ../../library/sys.rst:1086 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1086 +#: ../../library/sys.rst:1090 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1363,13 +1369,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1100 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1099 +#: ../../library/sys.rst:1103 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1378,7 +1384,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1106 +#: ../../library/sys.rst:1110 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1388,41 +1394,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1117 +#: ../../library/sys.rst:1121 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1126 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1127 +#: ../../library/sys.rst:1131 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1132 +#: ../../library/sys.rst:1136 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1140 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1145 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1152 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1430,7 +1436,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1154 +#: ../../library/sys.rst:1158 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1164 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1447,13 +1453,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1166 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1171 +#: ../../library/sys.rst:1175 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1465,19 +1471,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1179 +#: ../../library/sys.rst:1183 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1185 +#: ../../library/sys.rst:1189 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1196 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1488,34 +1494,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1206 +#: ../../library/sys.rst:1210 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1216 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1219 +#: ../../library/sys.rst:1223 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1222 +#: ../../library/sys.rst:1226 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1230 +#: ../../library/sys.rst:1234 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1528,27 +1534,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1251 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1250 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1256 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1556,7 +1562,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1264 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1568,78 +1574,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1272 +#: ../../library/sys.rst:1276 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1275 +#: ../../library/sys.rst:1279 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1288 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1292 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1296 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1298 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1300 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1303 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1306 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1312 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1313 +#: ../../library/sys.rst:1317 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1317 ../../library/sys.rst:1328 +#: ../../library/sys.rst:1321 ../../library/sys.rst:1332 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1322 +#: ../../library/sys.rst:1326 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1647,13 +1653,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1337 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1336 +#: ../../library/sys.rst:1340 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1662,75 +1668,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "System" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1367 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1738,7 +1744,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1373 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1746,57 +1752,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1377 +#: ../../library/sys.rst:1381 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1380 +#: ../../library/sys.rst:1384 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1390 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1393 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1397 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1395 +#: ../../library/sys.rst:1399 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1402 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1404 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1412 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1805,14 +1811,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1418 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1433 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1822,7 +1828,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1443 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1833,14 +1839,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1451 +#: ../../library/sys.rst:1455 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1463 +#: ../../library/sys.rst:1467 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1855,7 +1861,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1474 +#: ../../library/sys.rst:1479 +msgid "" +"The same tracing mechanism is used for :func:`!setprofile` as :func:" +"`settrace`. To trace calls with :func:`!setprofile` inside a tracing " +"function (e.g. in a debugger breakpoint), see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1483 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1863,71 +1876,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1479 -msgid "" -"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " -"arguments." -msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" - -#: ../../library/sys.rst:1481 ../../library/sys.rst:1562 +#: ../../library/sys.rst:1488 ../../library/sys.rst:1575 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1485 ../../library/sys.rst:1567 +#: ../../library/sys.rst:1492 ../../library/sys.rst:1580 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1484 +#: ../../library/sys.rst:1491 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1490 ../../library/sys.rst:1582 +#: ../../library/sys.rst:1497 ../../library/sys.rst:1595 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1488 +#: ../../library/sys.rst:1495 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1501 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1500 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1499 +#: ../../library/sys.rst:1507 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1507 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1504 +#: ../../library/sys.rst:1509 +msgid "" +"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " +"arguments." +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" + +#: ../../library/sys.rst:1514 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1508 +#: ../../library/sys.rst:1518 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1935,19 +1948,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1523 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1516 +#: ../../library/sys.rst:1526 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1533 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1958,7 +1971,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1540 +#: ../../library/sys.rst:1550 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1967,7 +1980,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1555 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1975,7 +1988,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1560 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -1983,31 +1996,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1565 msgid "" -"The local trace function should return a reference to itself (or to another " -"function for further tracing in that scope), or ``None`` to turn off tracing " -"in that scope." +"The local trace function should return a reference to itself, or to another " +"function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1568 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1572 +msgid "" +"Tracing is disabled while calling the trace function (e.g. a function set " +"by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1578 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1576 +#: ../../library/sys.rst:1589 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1570 +#: ../../library/sys.rst:1583 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2017,7 +2035,7 @@ msgid "" "const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1592 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2025,22 +2043,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1600 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1585 +#: ../../library/sys.rst:1598 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1608 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1590 +#: ../../library/sys.rst:1603 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2049,13 +2067,13 @@ msgid "" "f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1610 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1600 +#: ../../library/sys.rst:1613 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2069,17 +2087,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1624 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1613 +#: ../../library/sys.rst:1626 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1630 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2087,13 +2105,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1637 msgid "" "``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" "f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1629 +#: ../../library/sys.rst:1642 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2102,7 +2120,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1635 +#: ../../library/sys.rst:1648 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2110,7 +2128,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1650 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2118,20 +2136,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1639 +#: ../../library/sys.rst:1652 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1655 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1654 +#: ../../library/sys.rst:1667 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2140,105 +2158,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1674 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1678 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1675 +#: ../../library/sys.rst:1688 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1678 ../../library/sys.rst:1693 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1691 ../../library/sys.rst:1706 +#: ../../library/sys.rst:1714 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1684 +#: ../../library/sys.rst:1697 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1685 +#: ../../library/sys.rst:1698 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1702 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1704 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1712 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1720 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1724 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1727 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1719 +#: ../../library/sys.rst:1732 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1726 +#: ../../library/sys.rst:1739 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1742 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1744 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1733 +#: ../../library/sys.rst:1746 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1748 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1752 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1755 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2249,14 +2267,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1751 +#: ../../library/sys.rst:1764 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1769 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2265,7 +2283,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:1776 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2274,27 +2292,27 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1782 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1788 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1792 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " "replaced with file-like objects like :class:`io.StringIO` which do not " -"support the :attr:!buffer` attribute." +"support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1802 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2302,7 +2320,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1807 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2310,7 +2328,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1813 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2318,12 +2336,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1821 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1823 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2331,7 +2349,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1828 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2339,62 +2357,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1820 +#: ../../library/sys.rst:1833 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1827 +#: ../../library/sys.rst:1840 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1832 +#: ../../library/sys.rst:1845 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1834 -#, fuzzy +#: ../../library/sys.rst:1847 msgid "``\"nt\"``: Windows threads" -msgstr "``'nt'``: Windows 執行緒" +msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1835 -#, fuzzy +#: ../../library/sys.rst:1848 msgid "``\"pthread\"``: POSIX threads" -msgstr "``'pthread'``: POSIX 執行緒" +msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1849 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1851 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1855 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1844 +#: ../../library/sys.rst:1857 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1845 +#: ../../library/sys.rst:1858 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1846 +#: ../../library/sys.rst:1859 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1863 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1871 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2403,73 +2419,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1866 +#: ../../library/sys.rst:1879 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1881 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1872 +#: ../../library/sys.rst:1885 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1874 +#: ../../library/sys.rst:1887 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1875 +#: ../../library/sys.rst:1888 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1889 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1877 +#: ../../library/sys.rst:1890 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1878 +#: ../../library/sys.rst:1891 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1893 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1884 +#: ../../library/sys.rst:1897 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1889 +#: ../../library/sys.rst:1902 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1906 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1910 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1914 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2478,7 +2494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1916 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2486,7 +2502,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1912 +#: ../../library/sys.rst:1925 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2495,13 +2511,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1921 +#: ../../library/sys.rst:1934 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1940 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2512,18 +2528,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1948 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1940 +#: ../../library/sys.rst:1953 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1947 +#: ../../library/sys.rst:1960 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2532,31 +2548,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1959 +#: ../../library/sys.rst:1972 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1965 +#: ../../library/sys.rst:1978 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1981 +#: ../../library/sys.rst:1994 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1989 +#: ../../library/sys.rst:2002 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1990 +#: ../../library/sys.rst:2003 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2569,59 +2585,59 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profile function" msgstr "" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profiler" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "trace function" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "..." msgstr "..." diff --git a/library/syslog.po b/library/syslog.po index 40ab46dd77..fc9d6e877d 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -30,25 +30,16 @@ msgid "" msgstr "" #: ../../library/syslog.rst:14 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + +#: ../../library/syslog.rst:16 msgid "" "This module wraps the system ``syslog`` family of routines. A pure Python " "library that can speak to a syslog server is available in the :mod:`logging." "handlers` module as :class:`SysLogHandler`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - #: ../../library/syslog.rst:20 msgid "The module defines the following functions:" msgstr "該模組定義了以下函式:" @@ -69,7 +60,7 @@ msgid "" "func:`openlog` will be called with no arguments." msgstr "" -#: ../../library/syslog.rst:47 +#: ../../library/syslog.rst:36 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." @@ -110,7 +101,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:75 +#: ../../library/syslog.rst:64 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." @@ -145,7 +136,7 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:98 +#: ../../library/syslog.rst:87 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." @@ -162,7 +153,7 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:117 +#: ../../library/syslog.rst:106 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." @@ -229,3 +220,11 @@ msgid "" "in logged messages, and write the messages to the destination facility used " "for mail logging::" msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/tempfile.po b/library/tempfile.po index a6b5b3d670..369a47297f 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,12 +290,14 @@ msgstr "新增 *delete_on_close* 參數。" msgid "" "This class operates exactly as :func:`TemporaryFile` does, except that data " "is spooled in memory until the file size exceeds *max_size*, or until the " -"file's :func:`fileno` method is called, at which point the contents are " -"written to disk and operation proceeds as with :func:`TemporaryFile`." +"file's :func:`~io.IOBase.fileno` method is called, at which point the " +"contents are written to disk and operation proceeds as with :func:" +"`TemporaryFile`." msgstr "" "此類別執行的操作與 :func:`TemporaryFile` 完全相同,但會將資料排存 (spool) 於" -"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`fileno` 方法被呼叫為" -"止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` 相同。" +"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`~io.IOBase.fileno` " +"方法被呼叫為止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` " +"相同。" #: ../../library/tempfile.rst:154 msgid "" diff --git a/library/termios.po b/library/termios.po index 481411f60f..9ddcd3bbdb 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -31,13 +31,17 @@ msgid "" msgstr "" #: ../../library/termios.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/termios.rst:21 msgid "" "All functions in this module take a file descriptor *fd* as their first " "argument. This can be an integer file descriptor, such as returned by ``sys." "stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself." msgstr "" -#: ../../library/termios.rst:23 +#: ../../library/termios.rst:25 msgid "" "This module also defines all the constants needed to work with the functions " "provided here; these have the same name as their counterparts in C. Please " @@ -45,11 +49,11 @@ msgid "" "terminal control interfaces." msgstr "" -#: ../../library/termios.rst:28 +#: ../../library/termios.rst:30 msgid "The module defines the following functions:" msgstr "" -#: ../../library/termios.rst:33 +#: ../../library/termios.rst:35 msgid "" "Return a list containing the tty attributes for file descriptor *fd*, as " "follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is " @@ -60,49 +64,60 @@ msgid "" "constants defined in the :mod:`termios` module." msgstr "" -#: ../../library/termios.rst:44 +#: ../../library/termios.rst:46 msgid "" "Set the tty attributes for file descriptor *fd* from the *attributes*, which " "is a list like the one returned by :func:`tcgetattr`. The *when* argument " -"determines when the attributes are changed: :const:`TCSANOW` to change " -"immediately, :const:`TCSADRAIN` to change after transmitting all queued " -"output, or :const:`TCSAFLUSH` to change after transmitting all queued output " -"and discarding all queued input." +"determines when the attributes are changed:" +msgstr "" + +#: ../../library/termios.rst:52 +msgid "Change attributes immediately." +msgstr "" + +#: ../../library/termios.rst:56 +msgid "Change attributes after transmitting all queued output." +msgstr "" + +#: ../../library/termios.rst:60 +msgid "" +"Change attributes after transmitting all queued output and discarding all " +"queued input." msgstr "" -#: ../../library/termios.rst:54 +#: ../../library/termios.rst:66 msgid "" "Send a break on file descriptor *fd*. A zero *duration* sends a break for " "0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning." msgstr "" -#: ../../library/termios.rst:60 +#: ../../library/termios.rst:72 msgid "" "Wait until all output written to file descriptor *fd* has been transmitted." msgstr "" -#: ../../library/termios.rst:65 +#: ../../library/termios.rst:77 msgid "" "Discard queued data on file descriptor *fd*. The *queue* selector specifies " "which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for " "the output queue, or :const:`TCIOFLUSH` for both queues." msgstr "" -#: ../../library/termios.rst:72 +#: ../../library/termios.rst:84 msgid "" "Suspend or resume input or output on file descriptor *fd*. The *action* " "argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart " "output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input." msgstr "" -#: ../../library/termios.rst:79 +#: ../../library/termios.rst:91 msgid "" "Return a tuple ``(ws_row, ws_col)`` containing the tty window size for file " "descriptor *fd*. Requires :const:`termios.TIOCGWINSZ` or :const:`termios." "TIOCGSIZE`." msgstr "" -#: ../../library/termios.rst:88 +#: ../../library/termios.rst:100 msgid "" "Set the tty window size for file descriptor *fd* from *winsize*, which is a " "two-item tuple ``(ws_row, ws_col)`` like the one returned by :func:" @@ -111,19 +126,19 @@ msgid "" "const:`termios.TIOCSSIZE`) to be defined." msgstr "" -#: ../../library/termios.rst:99 +#: ../../library/termios.rst:111 msgid "Module :mod:`tty`" msgstr ":mod:`tty` 模組" -#: ../../library/termios.rst:100 +#: ../../library/termios.rst:112 msgid "Convenience functions for common terminal control operations." msgstr "" -#: ../../library/termios.rst:106 +#: ../../library/termios.rst:118 msgid "Example" msgstr "範例" -#: ../../library/termios.rst:108 +#: ../../library/termios.rst:120 msgid "" "Here's a function that prompts for a password with echoing turned off. Note " "the technique using a separate :func:`tcgetattr` call and a :keyword:" diff --git a/library/test.po b/library/test.po index 42104f34c1..30b923688b 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+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-" @@ -558,115 +558,71 @@ msgid "" msgstr "" #: ../../library/test.rst:503 -msgid "" -"Determine whether *test* matches the patterns set in :func:`set_match_tests`." -msgstr "" - -#: ../../library/test.rst:508 -msgid "" -"Define match patterns on test filenames and test method names for filtering " -"tests." -msgstr "" - -#: ../../library/test.rst:513 -msgid "" -"Execute :class:`unittest.TestCase` subclasses passed to the function. The " -"function scans the classes for methods starting with the prefix ``test_`` " -"and executes the tests individually." -msgstr "" - -#: ../../library/test.rst:517 -msgid "" -"It is also legal to pass strings as parameters; these should be keys in " -"``sys.modules``. Each associated module will be scanned by ``unittest." -"TestLoader.loadTestsFromModule()``. This is usually seen in the following :" -"func:`test_main` function::" -msgstr "" - -#: ../../library/test.rst:525 -msgid "This will run all tests defined in the named module." -msgstr "" - -#: ../../library/test.rst:530 -msgid "" -"Run :func:`doctest.testmod` on the given *module*. Return ``(failure_count, " -"test_count)``." -msgstr "" - -#: ../../library/test.rst:533 -msgid "" -"If *verbosity* is ``None``, :func:`doctest.testmod` is run with verbosity " -"set to :data:`verbose`. Otherwise, it is run with verbosity set to " -"``None``. *optionflags* is passed as ``optionflags`` to :func:`doctest." -"testmod`." -msgstr "" - -#: ../../library/test.rst:541 msgid "Get size of a page in bytes." msgstr "" -#: ../../library/test.rst:548 +#: ../../library/test.rst:510 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:554 +#: ../../library/test.rst:516 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " "them only on the implementations guarded by the arguments. This function " "returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:566 +#: ../../library/test.rst:528 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:572 +#: ../../library/test.rst:534 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:578 +#: ../../library/test.rst:540 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:584 +#: ../../library/test.rst:546 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:590 +#: ../../library/test.rst:552 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:598 +#: ../../library/test.rst:560 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:601 +#: ../../library/test.rst:563 msgid "Example use with output streams::" msgstr "" -#: ../../library/test.rst:609 +#: ../../library/test.rst:571 msgid "Example use with input stream::" msgstr "" -#: ../../library/test.rst:621 +#: ../../library/test.rst:583 msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:626 +#: ../../library/test.rst:588 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -674,115 +630,115 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:634 +#: ../../library/test.rst:596 msgid "" "A context manager that disables the garbage collector on entry. On exit, the " "garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:640 +#: ../../library/test.rst:602 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:642 ../../library/test.rst:660 -#: ../../library/test.rst:895 ../../library/test.rst:1361 +#: ../../library/test.rst:604 ../../library/test.rst:622 +#: ../../library/test.rst:857 ../../library/test.rst:1323 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/test.rst:647 +#: ../../library/test.rst:609 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:652 ../../library/test.rst:670 +#: ../../library/test.rst:614 ../../library/test.rst:632 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:658 +#: ../../library/test.rst:620 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:665 +#: ../../library/test.rst:627 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:676 +#: ../../library/test.rst:638 msgid "" "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys." "stderr`. It can be used to make sure that the logs order is consistent " "before writing into stderr." msgstr "" -#: ../../library/test.rst:685 +#: ../../library/test.rst:647 msgid "" "Print a warning into :data:`sys.__stderr__`. Format the message as: " "``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " "``\"Warning -- \"`` prefix to each line." msgstr "" -#: ../../library/test.rst:694 +#: ../../library/test.rst:656 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:697 +#: ../../library/test.rst:659 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." msgstr "" -#: ../../library/test.rst:700 +#: ../../library/test.rst:662 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:709 +#: ../../library/test.rst:671 msgid "" "Return the size of the :c:type:`PyObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:715 +#: ../../library/test.rst:677 msgid "" "Return the size of the :c:type:`PyVarObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:721 +#: ../../library/test.rst:683 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:727 +#: ../../library/test.rst:689 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:734 +#: ../../library/test.rst:696 msgid "" "A decorator that skips the decorated test on TLS certification validation " "failures." msgstr "" -#: ../../library/test.rst:739 +#: ../../library/test.rst:701 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -790,79 +746,79 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:747 +#: ../../library/test.rst:709 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:753 +#: ../../library/test.rst:715 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " "FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:759 +#: ../../library/test.rst:721 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:765 +#: ../../library/test.rst:727 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:771 +#: ../../library/test.rst:733 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:776 +#: ../../library/test.rst:738 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: ../../library/test.rst:781 +#: ../../library/test.rst:743 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: ../../library/test.rst:786 +#: ../../library/test.rst:748 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: ../../library/test.rst:791 +#: ../../library/test.rst:753 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: ../../library/test.rst:796 +#: ../../library/test.rst:758 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: ../../library/test.rst:801 +#: ../../library/test.rst:763 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:806 +#: ../../library/test.rst:768 msgid "" "Decorator for only running the test if :ref:`Limited C API ` " "is available." msgstr "" -#: ../../library/test.rst:812 +#: ../../library/test.rst:774 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:817 +#: ../../library/test.rst:779 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:823 +#: ../../library/test.rst:785 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:828 +#: ../../library/test.rst:790 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -870,11 +826,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:836 +#: ../../library/test.rst:798 msgid "Decorator for bigmem tests." msgstr "" -#: ../../library/test.rst:838 +#: ../../library/test.rst:800 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -882,7 +838,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:843 +#: ../../library/test.rst:805 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -890,11 +846,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:851 +#: ../../library/test.rst:813 msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:856 +#: ../../library/test.rst:818 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -904,44 +860,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:866 +#: ../../library/test.rst:828 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:871 +#: ../../library/test.rst:833 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:878 +#: ../../library/test.rst:840 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:884 +#: ../../library/test.rst:846 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:887 +#: ../../library/test.rst:849 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:891 +#: ../../library/test.rst:853 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:912 +#: ../../library/test.rst:874 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -950,55 +906,55 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:927 +#: ../../library/test.rst:889 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:931 +#: ../../library/test.rst:893 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: ../../library/test.rst:939 +#: ../../library/test.rst:901 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:947 +#: ../../library/test.rst:909 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:953 +#: ../../library/test.rst:915 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:958 +#: ../../library/test.rst:920 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:966 +#: ../../library/test.rst:928 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:968 +#: ../../library/test.rst:930 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:972 +#: ../../library/test.rst:934 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -1006,7 +962,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:977 +#: ../../library/test.rst:939 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -1014,31 +970,31 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:981 +#: ../../library/test.rst:943 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:984 ../../library/test.rst:1610 +#: ../../library/test.rst:946 ../../library/test.rst:1572 msgid "Example use::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/test.rst:1007 +#: ../../library/test.rst:969 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:1016 +#: ../../library/test.rst:978 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:1023 +#: ../../library/test.rst:985 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -1046,72 +1002,73 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: ../../library/test.rst:1031 +#: ../../library/test.rst:993 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: ../../library/test.rst:1036 +#: ../../library/test.rst:998 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:1039 +#: ../../library/test.rst:1001 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:1042 +#: ../../library/test.rst:1004 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:1046 -msgid "On both platforms, the old value is restored by :meth:`__exit__`." +#: ../../library/test.rst:1008 +msgid "" +"On both platforms, the old value is restored by :meth:`~object.__exit__`." msgstr "" -#: ../../library/test.rst:1051 +#: ../../library/test.rst:1013 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:1056 +#: ../../library/test.rst:1018 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: ../../library/test.rst:1061 +#: ../../library/test.rst:1023 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: ../../library/test.rst:1069 +#: ../../library/test.rst:1031 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:1074 +#: ../../library/test.rst:1036 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:1078 +#: ../../library/test.rst:1040 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: ../../library/test.rst:1084 +#: ../../library/test.rst:1046 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:1091 +#: ../../library/test.rst:1053 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1096 +#: ../../library/test.rst:1058 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1122,7 +1079,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1105 +#: ../../library/test.rst:1067 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1135,7 +1092,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1119 +#: ../../library/test.rst:1081 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1148,7 +1105,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1130 +#: ../../library/test.rst:1092 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1156,58 +1113,58 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1138 +#: ../../library/test.rst:1100 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1144 +#: ../../library/test.rst:1106 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1150 +#: ../../library/test.rst:1112 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1156 +#: ../../library/test.rst:1118 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: ../../library/test.rst:1162 +#: ../../library/test.rst:1124 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: ../../library/test.rst:1167 +#: ../../library/test.rst:1129 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1170 +#: ../../library/test.rst:1132 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1174 +#: ../../library/test.rst:1136 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1178 +#: ../../library/test.rst:1140 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1215,85 +1172,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1186 +#: ../../library/test.rst:1148 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1190 ../../library/test.rst:1206 -#: ../../library/test.rst:1218 +#: ../../library/test.rst:1152 ../../library/test.rst:1168 +#: ../../library/test.rst:1180 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: ../../library/test.rst:1196 +#: ../../library/test.rst:1158 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1200 +#: ../../library/test.rst:1162 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: ../../library/test.rst:1203 +#: ../../library/test.rst:1165 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1212 +#: ../../library/test.rst:1174 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1216 +#: ../../library/test.rst:1178 msgid "See :func:`assert_python_ok` for more options." msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" -#: ../../library/test.rst:1224 +#: ../../library/test.rst:1186 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1226 +#: ../../library/test.rst:1188 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1232 +#: ../../library/test.rst:1194 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1238 +#: ../../library/test.rst:1200 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1245 +#: ../../library/test.rst:1207 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1252 +#: ../../library/test.rst:1214 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1259 +#: ../../library/test.rst:1221 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1302,60 +1259,60 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1267 +#: ../../library/test.rst:1229 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: ../../library/test.rst:1272 +#: ../../library/test.rst:1234 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1277 +#: ../../library/test.rst:1239 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1281 +#: ../../library/test.rst:1243 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1285 +#: ../../library/test.rst:1247 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1290 +#: ../../library/test.rst:1252 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1295 +#: ../../library/test.rst:1257 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1299 +#: ../../library/test.rst:1261 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1304 +#: ../../library/test.rst:1266 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1311 +#: ../../library/test.rst:1273 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1317 +#: ../../library/test.rst:1279 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1322 +#: ../../library/test.rst:1284 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1363,79 +1320,79 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1330 +#: ../../library/test.rst:1292 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1336 +#: ../../library/test.rst:1298 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1341 +#: ../../library/test.rst:1303 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1347 +#: ../../library/test.rst:1309 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1350 +#: ../../library/test.rst:1312 msgid "Attributes set when an exception is caught:" msgstr "" -#: ../../library/test.rst:1352 +#: ../../library/test.rst:1314 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1353 +#: ../../library/test.rst:1315 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1354 +#: ../../library/test.rst:1316 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1355 +#: ../../library/test.rst:1317 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1357 +#: ../../library/test.rst:1319 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1359 +#: ../../library/test.rst:1321 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: ../../library/test.rst:1379 +#: ../../library/test.rst:1341 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: ../../library/test.rst:1384 +#: ../../library/test.rst:1346 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: ../../library/test.rst:1391 +#: ../../library/test.rst:1353 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1396 +#: ../../library/test.rst:1358 msgid "Set to :func:`os.getcwd`." msgstr "" -#: ../../library/test.rst:1401 +#: ../../library/test.rst:1363 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1407 +#: ../../library/test.rst:1369 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1443,25 +1400,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1415 +#: ../../library/test.rst:1377 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1422 +#: ../../library/test.rst:1384 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1429 +#: ../../library/test.rst:1391 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1434 +#: ../../library/test.rst:1396 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1470,75 +1427,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1440 +#: ../../library/test.rst:1402 msgid "Added dictionary interface." msgstr "新增字典介面。" -#: ../../library/test.rst:1446 +#: ../../library/test.rst:1408 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1453 +#: ../../library/test.rst:1415 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1459 +#: ../../library/test.rst:1421 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: ../../library/test.rst:1464 +#: ../../library/test.rst:1426 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1470 +#: ../../library/test.rst:1432 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1476 +#: ../../library/test.rst:1438 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1479 +#: ../../library/test.rst:1441 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1486 +#: ../../library/test.rst:1448 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1491 +#: ../../library/test.rst:1453 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1496 +#: ../../library/test.rst:1458 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1501 +#: ../../library/test.rst:1463 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1507 +#: ../../library/test.rst:1469 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1515 +#: ../../library/test.rst:1477 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1546,21 +1503,21 @@ msgid "" "the files." msgstr "" -#: ../../library/test.rst:1523 +#: ../../library/test.rst:1485 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1528 +#: ../../library/test.rst:1490 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1533 +#: ../../library/test.rst:1495 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1536 +#: ../../library/test.rst:1498 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1568,20 +1525,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1541 +#: ../../library/test.rst:1503 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1548 +#: ../../library/test.rst:1510 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1551 +#: ../../library/test.rst:1513 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1589,34 +1546,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1559 +#: ../../library/test.rst:1521 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1564 +#: ../../library/test.rst:1526 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: ../../library/test.rst:1570 +#: ../../library/test.rst:1532 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: ../../library/test.rst:1575 +#: ../../library/test.rst:1537 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: ../../library/test.rst:1582 +#: ../../library/test.rst:1544 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1588 +#: ../../library/test.rst:1550 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1624,46 +1581,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1593 +#: ../../library/test.rst:1555 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1596 +#: ../../library/test.rst:1558 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1600 +#: ../../library/test.rst:1562 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1604 +#: ../../library/test.rst:1566 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1607 +#: ../../library/test.rst:1569 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1624 +#: ../../library/test.rst:1586 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1628 +#: ../../library/test.rst:1590 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1671,21 +1628,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1638 +#: ../../library/test.rst:1600 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: ../../library/test.rst:1643 +#: ../../library/test.rst:1605 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1649 +#: ../../library/test.rst:1611 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: ../../library/test.rst:1654 +#: ../../library/test.rst:1616 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1693,42 +1650,42 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1662 +#: ../../library/test.rst:1624 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1634 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1674 +#: ../../library/test.rst:1636 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1640 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1684 +#: ../../library/test.rst:1646 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: ../../library/test.rst:1689 +#: ../../library/test.rst:1651 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: ../../library/test.rst:1696 +#: ../../library/test.rst:1658 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1736,14 +1693,14 @@ msgid "" "category=category) `. For example::" msgstr "" -#: ../../library/test.rst:1711 +#: ../../library/test.rst:1673 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1718 +#: ../../library/test.rst:1680 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1755,7 +1712,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1732 +#: ../../library/test.rst:1694 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1764,7 +1721,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1738 +#: ../../library/test.rst:1700 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1776,15 +1733,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1747 +#: ../../library/test.rst:1709 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1751 +#: ../../library/test.rst:1713 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1753 +#: ../../library/test.rst:1715 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1796,39 +1753,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1762 +#: ../../library/test.rst:1724 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1765 +#: ../../library/test.rst:1727 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1772 +#: ../../library/test.rst:1734 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1775 +#: ../../library/test.rst:1737 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1789 +#: ../../library/test.rst:1751 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1792 +#: ../../library/test.rst:1754 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1798 +#: ../../library/test.rst:1760 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/time.po b/library/time.po index 994feb6c80..a1e21ae69a 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-14 15:34+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-" @@ -97,9 +97,9 @@ msgid "" "On the other hand, the precision of :func:`.time` and :func:`sleep` is " "better than their Unix equivalents: times are expressed as floating point " "numbers, :func:`.time` returns the most accurate time available (using Unix :" -"c:func:`gettimeofday` where available), and :func:`sleep` will accept a time " -"with a nonzero fraction (Unix :c:func:`select` is used to implement this, " -"where available)." +"c:func:`!gettimeofday` where available), and :func:`sleep` will accept a " +"time with a nonzero fraction (Unix :c:func:`!select` is used to implement " +"this, where available)." msgstr "" #: ../../library/time.rst:78 @@ -117,68 +117,68 @@ msgstr "關於這些物件的敘述請見 :class:`struct_time`\\ 。" #: ../../library/time.rst:86 msgid "" -"The :class:`struct_time` type was extended to provide the :attr:`tm_gmtoff` " -"and :attr:`tm_zone` attributes when platform supports corresponding ``struct " -"tm`` members." +"The :class:`struct_time` type was extended to provide the :attr:" +"`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when " +"platform supports corresponding ``struct tm`` members." msgstr "" -#: ../../library/time.rst:91 +#: ../../library/time.rst:92 msgid "" -"The :class:`struct_time` attributes :attr:`tm_gmtoff` and :attr:`tm_zone` " -"are now available on all platforms." +"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:" +"`~struct_time.tm_zone` are now available on all platforms." msgstr "" -#: ../../library/time.rst:95 +#: ../../library/time.rst:97 msgid "Use the following functions to convert between time representations:" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "From" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "To" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "Use" msgstr "" -#: ../../library/time.rst:29 ../../library/time.rst:100 -#: ../../library/time.rst:103 ../../library/time.rst:106 -#: ../../library/time.rst:109 +#: ../../library/time.rst:29 ../../library/time.rst:102 +#: ../../library/time.rst:105 ../../library/time.rst:108 +#: ../../library/time.rst:111 msgid "seconds since the epoch" msgstr "" -#: ../../library/time.rst:100 ../../library/time.rst:106 +#: ../../library/time.rst:102 ../../library/time.rst:108 msgid ":class:`struct_time` in UTC" msgstr "" -#: ../../library/time.rst:100 +#: ../../library/time.rst:102 msgid ":func:`gmtime`" msgstr ":func:`gmtime`" -#: ../../library/time.rst:103 ../../library/time.rst:109 +#: ../../library/time.rst:105 ../../library/time.rst:111 msgid ":class:`struct_time` in local time" msgstr "" -#: ../../library/time.rst:103 +#: ../../library/time.rst:105 msgid ":func:`localtime`" msgstr ":func:`localtime`" -#: ../../library/time.rst:106 +#: ../../library/time.rst:108 msgid ":func:`calendar.timegm`" msgstr ":func:`calendar.timegm`" -#: ../../library/time.rst:109 +#: ../../library/time.rst:111 msgid ":func:`mktime`" msgstr ":func:`mktime`" -#: ../../library/time.rst:117 +#: ../../library/time.rst:119 msgid "Functions" msgstr "函式" -#: ../../library/time.rst:121 +#: ../../library/time.rst:123 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string of the following form: ``'Sun " @@ -186,94 +186,94 @@ msgid "" "padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:127 +#: ../../library/time.rst:129 msgid "" "If *t* is not provided, the current time as returned by :func:`localtime` is " "used. Locale information is not used by :func:`asctime`." msgstr "" -#: ../../library/time.rst:132 +#: ../../library/time.rst:134 msgid "" "Unlike the C function of the same name, :func:`asctime` does not add a " "trailing newline." msgstr "" -#: ../../library/time.rst:137 +#: ../../library/time.rst:139 msgid "" "Return the *clk_id* of the thread-specific CPU-time clock for the specified " "*thread_id*." msgstr "" -#: ../../library/time.rst:139 +#: ../../library/time.rst:141 msgid "" "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -#: ../../library/time.rst:144 +#: ../../library/time.rst:146 msgid "" "Passing an invalid or expired *thread_id* may result in undefined behavior, " "such as segmentation fault." msgstr "" -#: ../../library/time.rst:147 +#: ../../library/time.rst:149 msgid ":ref:`Availability `: Unix" msgstr ":ref:`適用 `:Unix" -#: ../../library/time.rst:149 +#: ../../library/time.rst:151 msgid "" "See the man page for :manpage:`pthread_getcpuclockid(3)` for further " "information." msgstr "" -#: ../../library/time.rst:156 +#: ../../library/time.rst:158 msgid "" "Return the resolution (precision) of the specified clock *clk_id*. Refer " "to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:159 ../../library/time.rst:172 -#: ../../library/time.rst:181 ../../library/time.rst:194 -#: ../../library/time.rst:203 ../../library/time.rst:680 -#: ../../library/time.rst:797 ../../library/time.rst:816 -#: ../../library/time.rst:844 ../../library/time.rst:879 +#: ../../library/time.rst:161 ../../library/time.rst:174 +#: ../../library/time.rst:183 ../../library/time.rst:196 +#: ../../library/time.rst:205 ../../library/time.rst:707 +#: ../../library/time.rst:824 ../../library/time.rst:843 +#: ../../library/time.rst:871 ../../library/time.rst:906 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/time.rst:166 +#: ../../library/time.rst:168 msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" "id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:169 +#: ../../library/time.rst:171 msgid "" "Use :func:`clock_gettime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:179 +#: ../../library/time.rst:181 msgid "Similar to :func:`clock_gettime` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:188 +#: ../../library/time.rst:190 msgid "" "Set the time of the specified clock *clk_id*. Currently, :data:" "`CLOCK_REALTIME` is the only accepted value for *clk_id*." msgstr "" -#: ../../library/time.rst:191 +#: ../../library/time.rst:193 msgid "" "Use :func:`clock_settime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:201 +#: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "" -#: ../../library/time.rst:210 +#: ../../library/time.rst:212 msgid "" "Convert a time expressed in seconds since the epoch_ to a string of a form: " "``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field is two " @@ -281,7 +281,7 @@ msgid "" "``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:215 +#: ../../library/time.rst:217 msgid "" "If *secs* is not provided or :const:`None`, the current time as returned by :" "func:`.time` is used. ``ctime(secs)`` is equivalent to " @@ -289,58 +289,58 @@ msgid "" "`ctime`." msgstr "" -#: ../../library/time.rst:223 +#: ../../library/time.rst:225 msgid "" "Get information on the specified clock as a namespace object. Supported " "clock names and the corresponding functions to read their value are:" msgstr "" -#: ../../library/time.rst:227 +#: ../../library/time.rst:229 msgid "``'monotonic'``: :func:`time.monotonic`" msgstr "``'monotonic'``\\ :\\ :func:`time.monotonic`" -#: ../../library/time.rst:228 +#: ../../library/time.rst:230 msgid "``'perf_counter'``: :func:`time.perf_counter`" msgstr "``'perf_counter'``\\ :\\ :func:`time.perf_counter`" -#: ../../library/time.rst:229 +#: ../../library/time.rst:231 msgid "``'process_time'``: :func:`time.process_time`" msgstr "``'process_time'``\\ :\\ :func:`time.process_time`" -#: ../../library/time.rst:230 +#: ../../library/time.rst:232 msgid "``'thread_time'``: :func:`time.thread_time`" msgstr "``'thread_time'``\\ :\\ :func:`time.thread_time`" -#: ../../library/time.rst:231 +#: ../../library/time.rst:233 msgid "``'time'``: :func:`time.time`" msgstr "``'time'``\\ :\\ :func:`time.time`" -#: ../../library/time.rst:233 +#: ../../library/time.rst:235 msgid "The result has the following attributes:" msgstr "" -#: ../../library/time.rst:235 +#: ../../library/time.rst:237 msgid "" "*adjustable*: ``True`` if the clock can be changed automatically (e.g. by a " "NTP daemon) or manually by the system administrator, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:237 +#: ../../library/time.rst:239 msgid "" "*implementation*: The name of the underlying C function used to get the " "clock value. Refer to :ref:`time-clock-id-constants` for possible values." msgstr "" -#: ../../library/time.rst:239 +#: ../../library/time.rst:241 msgid "" "*monotonic*: ``True`` if the clock cannot go backward, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:241 +#: ../../library/time.rst:243 msgid "*resolution*: The resolution of the clock in seconds (:class:`float`)" msgstr "" -#: ../../library/time.rst:248 +#: ../../library/time.rst:250 msgid "" "Convert a time expressed in seconds since the epoch_ to a :class:" "`struct_time` in UTC in which the dst flag is always zero. If *secs* is not " @@ -350,14 +350,14 @@ msgid "" "of this function." msgstr "" -#: ../../library/time.rst:258 +#: ../../library/time.rst:260 msgid "" "Like :func:`gmtime` but converts to local time. If *secs* is not provided " "or :const:`None`, the current time as returned by :func:`.time` is used. " "The dst flag is set to ``1`` when DST applies to the given time." msgstr "" -#: ../../library/time.rst:262 +#: ../../library/time.rst:264 msgid "" ":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is " "outside the range of values supported by the platform C :c:func:`localtime` " @@ -366,7 +366,7 @@ msgid "" "between 1970 and 2038." msgstr "" -#: ../../library/time.rst:271 +#: ../../library/time.rst:273 msgid "" "This is the inverse function of :func:`localtime`. Its argument is the :" "class:`struct_time` or full 9-tuple (since the dst flag is needed; use " @@ -379,7 +379,7 @@ msgid "" "dependent." msgstr "" -#: ../../library/time.rst:283 +#: ../../library/time.rst:285 msgid "" "Return the value (in fractional seconds) of a monotonic clock, i.e. a clock " "that cannot go backwards. The clock is not affected by system clock " @@ -387,25 +387,25 @@ msgid "" "only the difference between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:288 +#: ../../library/time.rst:290 msgid "" "Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:293 +#: ../../library/time.rst:295 msgid "The function is now always available and always system-wide." msgstr "" -#: ../../library/time.rst:296 +#: ../../library/time.rst:298 msgid "On macOS, the function is now system-wide." msgstr "" -#: ../../library/time.rst:302 +#: ../../library/time.rst:304 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:311 +#: ../../library/time.rst:313 msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " @@ -414,21 +414,21 @@ msgid "" "between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:317 +#: ../../library/time.rst:319 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:322 +#: ../../library/time.rst:324 msgid "On Windows, the function is now system-wide." msgstr "" -#: ../../library/time.rst:327 +#: ../../library/time.rst:329 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:339 +#: ../../library/time.rst:341 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -437,36 +437,36 @@ msgid "" "of two calls is valid." msgstr "" -#: ../../library/time.rst:345 +#: ../../library/time.rst:347 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:352 +#: ../../library/time.rst:354 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:358 +#: ../../library/time.rst:360 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating point number to indicate a more precise sleep " "time." msgstr "" -#: ../../library/time.rst:362 +#: ../../library/time.rst:364 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." msgstr "" -#: ../../library/time.rst:365 +#: ../../library/time.rst:367 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "" -#: ../../library/time.rst:368 +#: ../../library/time.rst:370 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -477,36 +477,36 @@ msgid "" "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" -#: ../../library/time.rst:376 +#: ../../library/time.rst:378 msgid "Unix implementation:" msgstr "" -#: ../../library/time.rst:378 +#: ../../library/time.rst:380 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:379 +#: ../../library/time.rst:381 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:380 +#: ../../library/time.rst:382 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "" -#: ../../library/time.rst:382 +#: ../../library/time.rst:384 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." msgstr "" -#: ../../library/time.rst:386 +#: ../../library/time.rst:388 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " "for the rationale)." msgstr "" -#: ../../library/time.rst:397 +#: ../../library/time.rst:399 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -515,267 +515,267 @@ msgid "" "raised if any field in *t* is outside of the allowed range." msgstr "" -#: ../../library/time.rst:403 +#: ../../library/time.rst:405 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." msgstr "" -#: ../../library/time.rst:406 +#: ../../library/time.rst:408 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " "replaced by the indicated characters in the :func:`strftime` result:" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Directive" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Meaning" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "Locale's abbreviated weekday name." msgstr "" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "Locale's full weekday name." msgstr "" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "Locale's abbreviated month name." msgstr "" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "Locale's full month name." msgstr "" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "Day of the month as a decimal number [01,31]." msgstr "" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "Month as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "Minute as a decimal number [00,59]." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "Second as a decimal number [00,61]." msgstr "" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:450 ../../library/time.rst:461 +#: ../../library/time.rst:452 ../../library/time.rst:463 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/time.rst:493 +#: ../../library/time.rst:495 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:496 +#: ../../library/time.rst:498 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/time.rst:500 +#: ../../library/time.rst:504 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: ../../library/time.rst:505 +#: ../../library/time.rst:509 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." msgstr "" -#: ../../library/time.rst:508 +#: ../../library/time.rst:512 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: ../../library/time.rst:515 +#: ../../library/time.rst:519 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -783,7 +783,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: ../../library/time.rst:520 +#: ../../library/time.rst:524 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -791,13 +791,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: ../../library/time.rst:531 +#: ../../library/time.rst:535 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" -#: ../../library/time.rst:535 +#: ../../library/time.rst:539 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -808,11 +808,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: ../../library/time.rst:543 +#: ../../library/time.rst:547 msgid "For example:" msgstr "" -#: ../../library/time.rst:550 +#: ../../library/time.rst:554 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -820,7 +820,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: ../../library/time.rst:555 +#: ../../library/time.rst:559 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -829,7 +829,7 @@ msgid "" "are not documented as supported." msgstr "" -#: ../../library/time.rst:564 +#: ../../library/time.rst:568 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -837,153 +837,109 @@ msgid "" "The following values are present:" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:575 msgid "Index" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:576 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:570 +#: ../../library/time.rst:577 msgid "Values" msgstr "" -#: ../../library/time.rst:572 +#: ../../library/time.rst:579 msgid "0" msgstr "0" -#: ../../library/time.rst:572 -msgid ":attr:`tm_year`" -msgstr ":attr:`tm_year`" - -#: ../../library/time.rst:572 +#: ../../library/time.rst:581 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:574 +#: ../../library/time.rst:583 msgid "1" msgstr "1" -#: ../../library/time.rst:574 -msgid ":attr:`tm_mon`" -msgstr ":attr:`tm_mon`" - -#: ../../library/time.rst:574 +#: ../../library/time.rst:585 msgid "range [1, 12]" msgstr "" -#: ../../library/time.rst:576 +#: ../../library/time.rst:587 msgid "2" msgstr "2" -#: ../../library/time.rst:576 -msgid ":attr:`tm_mday`" -msgstr ":attr:`tm_mday`" - -#: ../../library/time.rst:576 +#: ../../library/time.rst:589 msgid "range [1, 31]" msgstr "" -#: ../../library/time.rst:578 +#: ../../library/time.rst:591 msgid "3" msgstr "3" -#: ../../library/time.rst:578 -msgid ":attr:`tm_hour`" -msgstr ":attr:`tm_hour`" - -#: ../../library/time.rst:578 +#: ../../library/time.rst:593 msgid "range [0, 23]" msgstr "" -#: ../../library/time.rst:580 +#: ../../library/time.rst:595 msgid "4" msgstr "4" -#: ../../library/time.rst:580 -msgid ":attr:`tm_min`" -msgstr ":attr:`tm_min`" - -#: ../../library/time.rst:580 +#: ../../library/time.rst:597 msgid "range [0, 59]" msgstr "" -#: ../../library/time.rst:582 +#: ../../library/time.rst:599 msgid "5" msgstr "5" -#: ../../library/time.rst:582 -msgid ":attr:`tm_sec`" -msgstr ":attr:`tm_sec`" - -#: ../../library/time.rst:582 -msgid "range [0, 61]; see **(2)** in :func:`strftime` description" +#: ../../library/time.rst:601 +msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: ../../library/time.rst:585 +#: ../../library/time.rst:603 msgid "6" msgstr "6" -#: ../../library/time.rst:585 -msgid ":attr:`tm_wday`" -msgstr ":attr:`tm_wday`" - -#: ../../library/time.rst:585 -msgid "range [0, 6], Monday is 0" +#: ../../library/time.rst:605 +msgid "range [0, 6]; Monday is 0" msgstr "" -#: ../../library/time.rst:587 +#: ../../library/time.rst:607 msgid "7" msgstr "7" -#: ../../library/time.rst:587 -msgid ":attr:`tm_yday`" -msgstr ":attr:`tm_yday`" - -#: ../../library/time.rst:587 +#: ../../library/time.rst:609 msgid "range [1, 366]" msgstr "" -#: ../../library/time.rst:589 +#: ../../library/time.rst:611 msgid "8" msgstr "8" -#: ../../library/time.rst:589 -msgid ":attr:`tm_isdst`" -msgstr ":attr:`tm_isdst`" - -#: ../../library/time.rst:589 +#: ../../library/time.rst:613 msgid "0, 1 or -1; see below" msgstr "" -#: ../../library/time.rst:591 ../../library/time.rst:593 +#: ../../library/time.rst:615 ../../library/time.rst:619 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:591 -msgid ":attr:`tm_zone`" -msgstr ":attr:`tm_zone`" - -#: ../../library/time.rst:591 +#: ../../library/time.rst:617 msgid "abbreviation of timezone name" msgstr "" -#: ../../library/time.rst:593 -msgid ":attr:`tm_gmtoff`" -msgstr ":attr:`tm_gmtoff`" - -#: ../../library/time.rst:593 +#: ../../library/time.rst:621 msgid "offset east of UTC in seconds" msgstr "" -#: ../../library/time.rst:596 +#: ../../library/time.rst:623 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: ../../library/time.rst:599 +#: ../../library/time.rst:626 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -991,14 +947,14 @@ msgid "" "filled in." msgstr "" -#: ../../library/time.rst:603 +#: ../../library/time.rst:630 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" "`TypeError` is raised." msgstr "" -#: ../../library/time.rst:609 +#: ../../library/time.rst:636 msgid "" "Return the time in seconds since the epoch_ as a floating point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1007,7 +963,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: ../../library/time.rst:615 +#: ../../library/time.rst:642 msgid "" "Note that even though the time is always returned as a floating point " "number, not all systems provide time with a better precision than 1 second. " @@ -1016,7 +972,7 @@ msgid "" "between the two calls." msgstr "" -#: ../../library/time.rst:621 +#: ../../library/time.rst:648 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1026,19 +982,19 @@ msgid "" "attributes." msgstr "" -#: ../../library/time.rst:628 +#: ../../library/time.rst:655 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: ../../library/time.rst:634 +#: ../../library/time.rst:661 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: ../../library/time.rst:647 +#: ../../library/time.rst:674 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1047,25 +1003,25 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:653 +#: ../../library/time.rst:680 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:656 +#: ../../library/time.rst:683 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" -#: ../../library/time.rst:658 +#: ../../library/time.rst:685 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:665 +#: ../../library/time.rst:692 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:672 +#: ../../library/time.rst:699 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1076,42 +1032,42 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:684 +#: ../../library/time.rst:711 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: ../../library/time.rst:688 +#: ../../library/time.rst:715 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:690 +#: ../../library/time.rst:717 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:695 +#: ../../library/time.rst:722 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:699 +#: ../../library/time.rst:726 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:698 +#: ../../library/time.rst:725 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:705 +#: ../../library/time.rst:732 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:702 +#: ../../library/time.rst:729 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1119,41 +1075,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:727 +#: ../../library/time.rst:754 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:708 +#: ../../library/time.rst:735 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: ../../library/time.rst:713 +#: ../../library/time.rst:740 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:712 +#: ../../library/time.rst:739 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: ../../library/time.rst:717 +#: ../../library/time.rst:744 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:716 +#: ../../library/time.rst:743 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:724 +#: ../../library/time.rst:751 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:720 +#: ../../library/time.rst:747 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1161,13 +1117,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:726 +#: ../../library/time.rst:753 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: ../../library/time.rst:740 +#: ../../library/time.rst:767 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1178,23 +1134,23 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:761 +#: ../../library/time.rst:788 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:763 +#: ../../library/time.rst:790 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:768 +#: ../../library/time.rst:795 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:771 +#: ../../library/time.rst:798 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1202,103 +1158,103 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:776 +#: ../../library/time.rst:803 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" -#: ../../library/time.rst:783 +#: ../../library/time.rst:810 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:787 +#: ../../library/time.rst:814 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" -#: ../../library/time.rst:794 +#: ../../library/time.rst:821 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:804 +#: ../../library/time.rst:831 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:807 +#: ../../library/time.rst:834 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" -#: ../../library/time.rst:814 ../../library/time.rst:823 +#: ../../library/time.rst:841 ../../library/time.rst:850 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:825 +#: ../../library/time.rst:852 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" -#: ../../library/time.rst:831 +#: ../../library/time.rst:858 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:833 +#: ../../library/time.rst:860 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:836 +#: ../../library/time.rst:863 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/time.rst:842 +#: ../../library/time.rst:869 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:851 +#: ../../library/time.rst:878 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:855 +#: ../../library/time.rst:882 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" -#: ../../library/time.rst:862 +#: ../../library/time.rst:889 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:866 +#: ../../library/time.rst:893 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" -#: ../../library/time.rst:870 +#: ../../library/time.rst:897 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:876 +#: ../../library/time.rst:903 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:887 +#: ../../library/time.rst:914 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:891 +#: ../../library/time.rst:918 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1306,68 +1262,68 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:897 +#: ../../library/time.rst:924 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:901 +#: ../../library/time.rst:928 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: ../../library/time.rst:906 +#: ../../library/time.rst:933 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:912 +#: ../../library/time.rst:939 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " "rules in effect at module load time or the last time :func:`tzset` is called " "and may be incorrect for times in the past. It is recommended to use the :" -"attr:`tm_gmtoff` and :attr:`tm_zone` results from :func:`localtime` to " -"obtain timezone information." +"attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" +"func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:926 +#: ../../library/time.rst:953 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:925 +#: ../../library/time.rst:952 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:933 +#: ../../library/time.rst:960 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:934 +#: ../../library/time.rst:961 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1406,23 +1362,56 @@ msgstr "Greenwich Mean Time(格林威治標準時間)" msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" -#: ../../library/time.rst:308 ../../library/time.rst:334 -#: ../../library/time.rst:642 +#: ../../library/time.rst:310 ../../library/time.rst:336 +#: ../../library/time.rst:669 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "datetime format" msgstr "datetime format(日期時間格式)" + +#~ msgid ":attr:`tm_year`" +#~ msgstr ":attr:`tm_year`" + +#~ msgid ":attr:`tm_mon`" +#~ msgstr ":attr:`tm_mon`" + +#~ msgid ":attr:`tm_mday`" +#~ msgstr ":attr:`tm_mday`" + +#~ msgid ":attr:`tm_hour`" +#~ msgstr ":attr:`tm_hour`" + +#~ msgid ":attr:`tm_min`" +#~ msgstr ":attr:`tm_min`" + +#~ msgid ":attr:`tm_sec`" +#~ msgstr ":attr:`tm_sec`" + +#~ msgid ":attr:`tm_wday`" +#~ msgstr ":attr:`tm_wday`" + +#~ msgid ":attr:`tm_yday`" +#~ msgstr ":attr:`tm_yday`" + +#~ msgid ":attr:`tm_isdst`" +#~ msgstr ":attr:`tm_isdst`" + +#~ msgid ":attr:`tm_zone`" +#~ msgstr ":attr:`tm_zone`" + +#~ msgid ":attr:`tm_gmtoff`" +#~ msgstr ":attr:`tm_gmtoff`" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index e773cefb23..8cc691f0de 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-11-02 00:03+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-" @@ -30,23 +30,216 @@ msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`" msgid "" "The :mod:`tkinter.messagebox` module provides a template base class as well " "as a variety of convenience methods for commonly used configurations. The " -"message boxes are modal and will return a subset of (True, False, OK, None, " -"Yes, No) based on the user's selection. Common message box styles and " -"layouts include but are not limited to:" +"message boxes are modal and will return a subset of (``True``, ``False``, " +"``None``, :data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on the " +"user's selection. Common message box styles and layouts include but are not " +"limited to:" msgstr "" -#: ../../library/tkinter.messagebox.rst:22 -msgid "Create a default information message box." +#: ../../library/tkinter.messagebox.rst:23 +msgid "" +"Create a message window with an application-specified message, an icon and a " +"set of buttons. Each of the buttons in the message window is identified by a " +"unique symbolic name (see the *type* options)." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:27 +msgid "The following options are supported:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:33 +msgid "*command*" +msgstr "*command*" + +#: ../../library/tkinter.messagebox.rst:30 +msgid "" +"Specifies the function to invoke when the user closes the dialog. The name " +"of the button clicked by the user to close the dialog is passed as argument. " +"This is only available on macOS." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:39 +msgid "*default*" +msgstr "*default*" + +#: ../../library/tkinter.messagebox.rst:36 +msgid "" +"Gives the :ref:`symbolic name ` of the default button " +"for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this " +"option is not specified, the first button in the dialog will be made the " +"default." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:46 +msgid "*detail*" +msgstr "*detail*" + +#: ../../library/tkinter.messagebox.rst:42 +msgid "" +"Specifies an auxiliary message to the main message given by the *message* " +"option. The message detail will be presented beneath the main message and, " +"where supported by the OS, in a less emphasized font than the main message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:51 +msgid "*icon*" +msgstr "*icon*" + +#: ../../library/tkinter.messagebox.rst:49 +msgid "" +"Specifies an :ref:`icon ` to display. If this option is " +"not specified, then the :data:`INFO` icon will be displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:55 +msgid "*message*" +msgstr "*message*" + +#: ../../library/tkinter.messagebox.rst:54 +msgid "" +"Specifies the message to display in this message box. The default value is " +"an empty string." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:59 +msgid "*parent*" +msgstr "*parent*" + +#: ../../library/tkinter.messagebox.rst:58 +msgid "" +"Makes the specified window the logical parent of the message box. The " +"message box is displayed on top of its parent window." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:64 +msgid "*title*" +msgstr "*title*" + +#: ../../library/tkinter.messagebox.rst:62 +msgid "" +"Specifies a string to display as the title of the message box. This option " +"is ignored on macOS, where platform guidelines forbid the use of a title on " +"this kind of dialog." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:68 +msgid "*type*" +msgstr "*type*" + +#: ../../library/tkinter.messagebox.rst:67 +msgid "" +"Arranges for a :ref:`predefined set of buttons ` to be " +"displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:72 +msgid "" +"Display a message window and wait for the user to select one of the buttons. " +"Then return the symbolic name of the selected button. Keyword arguments can " +"override options specified in the constructor." msgstr "" -#: ../../library/tkinter.messagebox.rst:24 +#: ../../library/tkinter.messagebox.rst:76 msgid "**Information message box**" msgstr "" -#: ../../library/tkinter.messagebox.rst:28 +#: ../../library/tkinter.messagebox.rst:80 +msgid "" +"Creates and displays an information message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:83 msgid "**Warning message boxes**" msgstr "" -#: ../../library/tkinter.messagebox.rst:33 +#: ../../library/tkinter.messagebox.rst:87 +msgid "" +"Creates and displays a warning message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:92 +msgid "" +"Creates and displays an error message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:95 msgid "**Question message boxes**" msgstr "" + +#: ../../library/tkinter.messagebox.rst:99 +msgid "" +"Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns " +"the symbolic name of the selected button." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:104 +msgid "" +"Ask if operation should proceed. Shows buttons :data:`OK` and :data:" +"`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:109 +msgid "" +"Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:" +"`CANCEL`. Return ``True`` if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:114 +msgid "" +"Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` " +"if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:119 +msgid "" +"Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. " +"Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` " +"otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:126 +msgid "Symbolic names of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:145 +msgid "Predefined sets of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:150 +msgid "" +"Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` " +"and :data:`IGNORE`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:157 +msgid "Displays one button whose symbolic name is :data:`OK`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:162 +msgid "" +"Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:168 +msgid "" +"Displays two buttons whose symbolic names are :data:`RETRY` and :data:" +"`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:174 +msgid "" +"Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:180 +msgid "" +"Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :" +"data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:185 +msgid "Icon images:" +msgstr "" diff --git a/library/tty.po b/library/tty.po index 112a009880..4f00be48f5 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,27 +36,31 @@ msgid "" msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" #: ../../library/tty.rst:18 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/tty.rst:20 msgid "" "Because it requires the :mod:`termios` module, it will work only on Unix." msgstr "因為它需要 :mod:`termios` 模組,所以只能在 Unix 上執行。" -#: ../../library/tty.rst:20 +#: ../../library/tty.rst:22 msgid "The :mod:`tty` module defines the following functions:" msgstr ":mod:`tty` 模組定義了以下函式:" -#: ../../library/tty.rst:25 +#: ../../library/tty.rst:27 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in raw mode." msgstr "" -#: ../../library/tty.rst:33 +#: ../../library/tty.rst:35 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in cbreak mode." msgstr "" -#: ../../library/tty.rst:41 +#: ../../library/tty.rst:43 #, fuzzy msgid "" "Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it " @@ -67,11 +71,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:46 ../../library/tty.rst:57 +#: ../../library/tty.rst:48 ../../library/tty.rst:59 msgid "The return value is now the original tty attributes, instead of None." msgstr "" -#: ../../library/tty.rst:52 +#: ../../library/tty.rst:54 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -82,10 +86,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:63 +#: ../../library/tty.rst:65 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:64 +#: ../../library/tty.rst:66 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 59abe80c15..8267d8a0bf 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2888 -#: ../../library/typing.rst:3030 +#: ../../library/typing.rst:271 ../../library/typing.rst:2894 +#: ../../library/typing.rst:3036 msgid "For example:" msgstr "舉例來說:" @@ -471,7 +471,7 @@ msgstr "" #: ../../library/typing.rst:306 msgid "" "``Callable`` cannot express complex signatures such as functions that take a " -"variadic number of arguments, :func:`overloaded functions `, or " +"variadic number of arguments, :ref:`overloaded functions `, or " "functions that have keyword-only parameters. However, these signatures can " "be expressed by defining a :class:`Protocol` class with a :meth:`~object." "__call__` method:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3559 +#: ../../library/typing.rst:341 ../../library/typing.rst:3565 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -598,8 +598,8 @@ msgstr "" #: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " -"single :class:`type variable ` ``T`` . This also makes ``T`` valid " -"as a type within the class body." +"single :ref:`type variable ` ``T`` . This also makes ``T`` valid as " +"a type within the class body." msgstr "" #: ../../library/typing.rst:532 @@ -870,7 +870,7 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 #: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2834 msgid "For example::" msgstr "" "舉例來說:\n" @@ -896,7 +896,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:877 ../../library/typing.rst:1957 +#: ../../library/typing.rst:877 ../../library/typing.rst:1961 msgid "Example:" msgstr "" "舉例來說:\n" @@ -1127,7 +1127,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" @@ -1137,7 +1137,7 @@ msgstr "" msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`。" -#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +#: ../../library/typing.rst:1170 ../../library/typing.rst:1932 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2850 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1434,9 +1434,9 @@ msgstr "" #: ../../library/typing.rst:1485 msgid "" -"For example, using the unpack operator ``*`` on a :class:`type variable " -"tuple ` is equivalent to using ``Unpack`` to mark the type " -"variable tuple as having been unpacked::" +"For example, using the unpack operator ``*`` on a :ref:`type variable tuple " +"` is equivalent to using ``Unpack`` to mark the type variable " +"tuple as having been unpacked::" msgstr "" #: ../../library/typing.rst:1494 @@ -1510,29 +1510,29 @@ msgid "" "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1581 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1583 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1591 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1601 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1607 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 " @@ -1540,13 +1540,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1628 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1631 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1556,92 +1556,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1639 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1654 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1664 +#: ../../library/typing.rst:1666 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1677 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1681 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1685 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1689 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1691 +#: ../../library/typing.rst:1693 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1699 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1701 +#: ../../library/typing.rst:1703 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1709 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1711 +#: ../../library/typing.rst:1713 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1719 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1727 msgid "" -"Type variable tuple. A specialized form of :class:`type variable ` " +"Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1730 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1736 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1744 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1649,7 +1649,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1766 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1659,36 +1659,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1774 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1777 +#: ../../library/typing.rst:1781 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1789 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1805 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1812 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1822 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1697,39 +1697,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1829 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1833 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:1839 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1844 msgid "" -"Parameter specification variable. A specialized version of :class:`type " -"variables `." +"Parameter specification variable. A specialized version of :ref:`type " +"variables `." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1847 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1852 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1857 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1739,7 +1739,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1864 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 " @@ -1747,27 +1747,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1880 +#: ../../library/typing.rst:1884 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:1884 +#: ../../library/typing.rst:1888 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:1886 +#: ../../library/typing.rst:1890 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:1893 +#: ../../library/typing.rst:1897 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1780,11 +1780,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1905 +#: ../../library/typing.rst:1909 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1911 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1793,23 +1793,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1921 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1925 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1931 msgid ":data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1937 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1817,75 +1817,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1942 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1955 +#: ../../library/typing.rst:1959 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1973 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:1979 +#: ../../library/typing.rst:1983 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:1991 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2005 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2023 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2025 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:2027 +#: ../../library/typing.rst:2031 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:2033 ../../library/typing.rst:2110 +#: ../../library/typing.rst:3076 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2039 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:2039 +#: ../../library/typing.rst:2043 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2052 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2050 +#: ../../library/typing.rst:2054 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 " @@ -1894,83 +1894,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2060 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2070 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2076 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2082 +#: ../../library/typing.rst:2086 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2089 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2092 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2096 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2100 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2105 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2103 +#: ../../library/typing.rst:2107 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:2113 +#: ../../library/typing.rst:2117 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2121 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2125 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2129 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2134 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2136 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2142 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2150 +#: ../../library/typing.rst:2154 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1978,21 +1978,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2159 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2165 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2178 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2180 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 " @@ -2001,7 +2001,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2200 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -2012,7 +2012,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2211 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -2020,7 +2020,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2219 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -2030,7 +2030,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2228 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -2039,13 +2039,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2239 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2238 +#: ../../library/typing.rst:2242 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 " @@ -2053,53 +2053,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2254 +#: ../../library/typing.rst:2258 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:2258 +#: ../../library/typing.rst:2262 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2266 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2273 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2274 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::" msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2286 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2297 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2296 +#: ../../library/typing.rst:2300 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2310 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 " @@ -2107,53 +2107,53 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2315 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2330 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:2333 +#: ../../library/typing.rst:2337 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2345 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2356 +#: ../../library/typing.rst:2360 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2366 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2373 +#: ../../library/typing.rst:2377 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:2379 +#: ../../library/typing.rst:2383 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2399 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -2164,21 +2164,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2408 +#: ../../library/typing.rst:2412 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2415 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2414 +#: ../../library/typing.rst:2418 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -2187,7 +2187,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2443 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -2196,133 +2196,133 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2445 +#: ../../library/typing.rst:2449 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2453 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2453 +#: ../../library/typing.rst:2457 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2461 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2459 +#: ../../library/typing.rst:2463 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2468 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2481 +#: ../../library/typing.rst:2485 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2487 +#: ../../library/typing.rst:2491 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2491 +#: ../../library/typing.rst:2495 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2499 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2505 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:2507 +#: ../../library/typing.rst:2511 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2515 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2517 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:2520 +#: ../../library/typing.rst:2524 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2526 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2525 +#: ../../library/typing.rst:2529 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2532 +#: ../../library/typing.rst:2536 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2546 +#: ../../library/typing.rst:2550 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2552 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2563 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2568 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2332,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2576 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2579 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2587 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2585 +#: ../../library/typing.rst:2589 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2595 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2598 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2599 +#: ../../library/typing.rst:2603 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2608 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2616 +#: ../../library/typing.rst:2620 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2619 +#: ../../library/typing.rst:2623 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2393,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2630 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2640 +#: ../../library/typing.rst:2644 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2649 +#: ../../library/typing.rst:2653 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2664 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2804 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2623,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2811 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2819 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2821 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2828 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2830 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:2855 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2658,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2860 +#: ../../library/typing.rst:2866 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2868 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2670,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2874 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2878 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2880 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2886 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2889 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2911 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2913 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2711,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2920 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2927 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2929 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:2934 +#: ../../library/typing.rst:2940 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2938 +#: ../../library/typing.rst:2944 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2948 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2945 +#: ../../library/typing.rst:2951 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2751,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:2957 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:2968 +#: ../../library/typing.rst:2974 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:2973 +#: ../../library/typing.rst:2979 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2773,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2983 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2984 +#: ../../library/typing.rst:2990 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2993 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2794,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 +#: ../../library/typing.rst:2999 ../../library/typing.rst:3022 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3008 +#: ../../library/typing.rst:3014 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3011 +#: ../../library/typing.rst:3017 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2812,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3034 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3049 +#: ../../library/typing.rst:3055 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3051 +#: ../../library/typing.rst:3057 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3056 +#: ../../library/typing.rst:3062 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:3063 +#: ../../library/typing.rst:3069 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3073 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3078 +#: ../../library/typing.rst:3084 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2853,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3085 +#: ../../library/typing.rst:3091 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2861,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3097 +#: ../../library/typing.rst:3103 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3105 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2874,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3106 +#: ../../library/typing.rst:3112 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2882,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3117 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2890,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3122 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3128 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3126 +#: ../../library/typing.rst:3132 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3134 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 +#: ../../library/typing.rst:3138 ../../library/typing.rst:3380 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3137 +#: ../../library/typing.rst:3143 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3143 +#: ../../library/typing.rst:3149 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3151 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3155 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3157 +#: ../../library/typing.rst:3163 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3169 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3171 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3175 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3181 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3183 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3190 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3186 +#: ../../library/typing.rst:3192 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3189 +#: ../../library/typing.rst:3195 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3195 +#: ../../library/typing.rst:3201 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3197 +#: ../../library/typing.rst:3203 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3208 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3209 +#: ../../library/typing.rst:3215 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3213 +#: ../../library/typing.rst:3219 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3217 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3227 +#: ../../library/typing.rst:3233 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3233 +#: ../../library/typing.rst:3239 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3238 +#: ../../library/typing.rst:3244 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3244 +#: ../../library/typing.rst:3250 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3255 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3255 +#: ../../library/typing.rst:3261 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3260 +#: ../../library/typing.rst:3266 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3267 +#: ../../library/typing.rst:3273 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3278 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3276 +#: ../../library/typing.rst:3282 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3285 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3079,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3293 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3288 +#: ../../library/typing.rst:3294 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3294 +#: ../../library/typing.rst:3300 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3296 +#: ../../library/typing.rst:3302 msgid "" "``Text`` 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:3300 +#: ../../library/typing.rst:3306 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:3308 +#: ../../library/typing.rst:3314 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3318 +#: ../../library/typing.rst:3324 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3322 +#: ../../library/typing.rst:3328 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3330 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3330 +#: ../../library/typing.rst:3336 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3334 +#: ../../library/typing.rst:3340 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3338 +#: ../../library/typing.rst:3344 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3342 +#: ../../library/typing.rst:3348 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3348 +#: ../../library/typing.rst:3354 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3350 +#: ../../library/typing.rst:3356 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3356 +#: ../../library/typing.rst:3362 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3358 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3366 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3379 +#: ../../library/typing.rst:3385 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3385 +#: ../../library/typing.rst:3391 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3393 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3393 +#: ../../library/typing.rst:3399 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3395 +#: ../../library/typing.rst:3401 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3402 +#: ../../library/typing.rst:3408 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3410 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3411 +#: ../../library/typing.rst:3417 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3413 +#: ../../library/typing.rst:3419 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3419 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3427 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3433 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3429 +#: ../../library/typing.rst:3435 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3436 +#: ../../library/typing.rst:3442 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3440 +#: ../../library/typing.rst:3446 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3442 +#: ../../library/typing.rst:3448 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3453 +#: ../../library/typing.rst:3459 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3459 +#: ../../library/typing.rst:3465 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3461 +#: ../../library/typing.rst:3467 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3470 +#: ../../library/typing.rst:3476 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:3474 +#: ../../library/typing.rst:3480 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3482 +#: ../../library/typing.rst:3488 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3492 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3499 +#: ../../library/typing.rst:3505 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3503 +#: ../../library/typing.rst:3509 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3509 +#: ../../library/typing.rst:3515 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3513 +#: ../../library/typing.rst:3519 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3525 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3523 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3530 +#: ../../library/typing.rst:3536 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3534 +#: ../../library/typing.rst:3540 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3536 +#: ../../library/typing.rst:3542 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3542 +#: ../../library/typing.rst:3548 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3544 +#: ../../library/typing.rst:3550 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3556 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3558 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3555 +#: ../../library/typing.rst:3561 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3565 +#: ../../library/typing.rst:3571 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3567 +#: ../../library/typing.rst:3573 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3576 +#: ../../library/typing.rst:3582 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:3580 +#: ../../library/typing.rst:3586 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3588 +#: ../../library/typing.rst:3594 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3602 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3608 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3610 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3609 +#: ../../library/typing.rst:3615 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3611 +#: ../../library/typing.rst:3617 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3617 +#: ../../library/typing.rst:3623 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3625 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3625 +#: ../../library/typing.rst:3631 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3629 +#: ../../library/typing.rst:3635 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3634 +#: ../../library/typing.rst:3640 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3641 +#: ../../library/typing.rst:3647 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3652 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3658 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3660 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3471,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3667 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3668 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3669 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3670 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3671 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3672 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3667 +#: ../../library/typing.rst:3673 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3668 +#: ../../library/typing.rst:3674 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3675 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 +#: ../../library/typing.rst:3676 ../../library/typing.rst:3680 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3671 +#: ../../library/typing.rst:3677 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3678 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3679 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3675 +#: ../../library/typing.rst:3681 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3676 +#: ../../library/typing.rst:3682 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3677 +#: ../../library/typing.rst:3683 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3678 +#: ../../library/typing.rst:3684 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3685 ../../library/typing.rst:3689 +#: ../../library/typing.rst:3693 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3680 +#: ../../library/typing.rst:3686 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3681 +#: ../../library/typing.rst:3687 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 +#: ../../library/typing.rst:3688 ../../library/typing.rst:3692 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3684 +#: ../../library/typing.rst:3690 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3685 +#: ../../library/typing.rst:3691 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3688 +#: ../../library/typing.rst:3694 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 17cf967b7f..6b9d6326e3 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-10-10 21:59+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"PO-Revision-Date: 2023-09-09 23:07+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1459,7 +1459,7 @@ msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " "setting, deleting and either iteration or membership test. This corresponds " -"to the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:" +"to the magic methods :meth:`~object.__getitem__`, :meth:`__setitem__`, :meth:" "`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" @@ -2320,8 +2320,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2484 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and has :meth:" -"`__enter__` and :meth:`__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:`~object." +"__enter__` and :meth:`~object.__exit__` called)." msgstr "" #: ../../library/unittest.mock.rst:2488 diff --git a/library/wsgiref.po b/library/wsgiref.po index ff281215b8..0c898ef064 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -246,7 +246,7 @@ msgid "" msgstr "" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/wsgiref.rst:187 @@ -269,13 +269,13 @@ msgstr "" #: ../../library/wsgiref.rst:203 msgid "" ":class:`Headers` objects support typical mapping operations including :meth:" -"`__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:`setdefault`, :meth:" -"`__delitem__` and :meth:`__contains__`. For each of these methods, the key " -"is the header name (treated case-insensitively), and the value is the first " -"value associated with that header name. Setting a header deletes any " -"existing values for that header, then adds a new value at the end of the " -"wrapped header list. Headers' existing order is generally maintained, with " -"new headers added to the end of the wrapped list." +"`~object.__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:" +"`setdefault`, :meth:`__delitem__` and :meth:`__contains__`. For each of " +"these methods, the key is the header name (treated case-insensitively), and " +"the value is the first value associated with that header name. Setting a " +"header deletes any existing values for that header, then adds a new value at " +"the end of the wrapped header list. Headers' existing order is generally " +"maintained, with new headers added to the end of the wrapped list." msgstr "" #: ../../library/wsgiref.rst:212 diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index 818fcc93e9..d8ead6c8c4 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -153,7 +153,7 @@ msgid "DOMEventStream Objects" msgstr "DOMEventStream 物件" #: ../../library/xml.dom.pulldom.rst:117 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/xml.dom.pulldom.rst:122 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 99998e7c40..6985eb992d 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -38,7 +38,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:19 msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." -msgstr "" +msgstr ":mod:`!xml.etree.cElementTree` 模組已被棄用。" #: ../../library/xml.etree.elementtree.rst:25 msgid "" @@ -49,7 +49,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:30 msgid "Tutorial" -msgstr "" +msgstr "教學" #: ../../library/xml.etree.elementtree.rst:32 msgid "" @@ -75,7 +75,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:50 msgid "Parsing XML" -msgstr "" +msgstr "剖析 XML" #: ../../library/xml.etree.elementtree.rst:52 msgid "" @@ -147,14 +147,14 @@ msgid "" "XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:158 +#: ../../library/xml.etree.elementtree.rst:159 msgid "" "The obvious use case is applications that operate in a non-blocking fashion " "where the XML data is being received from a socket or read incrementally " "from some storage device. In such cases, blocking reads are unacceptable." msgstr "" -#: ../../library/xml.etree.elementtree.rst:162 +#: ../../library/xml.etree.elementtree.rst:163 msgid "" "Because it's so flexible, :class:`XMLPullParser` can be inconvenient to use " "for simpler use-cases. If you don't mind your application blocking on " @@ -164,18 +164,18 @@ msgid "" "memory." msgstr "" -#: ../../library/xml.etree.elementtree.rst:169 +#: ../../library/xml.etree.elementtree.rst:170 msgid "Finding interesting elements" msgstr "" -#: ../../library/xml.etree.elementtree.rst:171 +#: ../../library/xml.etree.elementtree.rst:172 msgid "" ":class:`Element` has some useful methods that help iterate recursively over " "all the sub-tree below it (its children, their children, and so on). For " "example, :meth:`Element.iter`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:184 +#: ../../library/xml.etree.elementtree.rst:185 msgid "" ":meth:`Element.findall` finds only elements with a tag which are direct " "children of the current element. :meth:`Element.find` finds the *first* " @@ -183,23 +183,23 @@ msgid "" "text content. :meth:`Element.get` accesses the element's attributes::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:198 +#: ../../library/xml.etree.elementtree.rst:199 msgid "" "More sophisticated specification of which elements to look for is possible " "by using :ref:`XPath `." msgstr "" -#: ../../library/xml.etree.elementtree.rst:202 +#: ../../library/xml.etree.elementtree.rst:203 msgid "Modifying an XML File" -msgstr "" +msgstr "改動 XML 檔案" -#: ../../library/xml.etree.elementtree.rst:204 +#: ../../library/xml.etree.elementtree.rst:205 msgid "" ":class:`ElementTree` provides a simple way to build XML documents and write " "them to files. The :meth:`ElementTree.write` method serves this purpose." msgstr "" -#: ../../library/xml.etree.elementtree.rst:207 +#: ../../library/xml.etree.elementtree.rst:208 msgid "" "Once created, an :class:`Element` object may be manipulated by directly " "changing its fields (such as :attr:`Element.text`), adding and modifying " @@ -207,24 +207,24 @@ msgid "" "example with :meth:`Element.append`)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:212 +#: ../../library/xml.etree.elementtree.rst:213 msgid "" "Let's say we want to add one to each country's rank, and add an ``updated`` " "attribute to the rank element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:222 -#: ../../library/xml.etree.elementtree.rst:266 +#: ../../library/xml.etree.elementtree.rst:223 +#: ../../library/xml.etree.elementtree.rst:267 msgid "Our XML now looks like this:" -msgstr "" +msgstr "XML 現在看起來像這樣:" -#: ../../library/xml.etree.elementtree.rst:250 +#: ../../library/xml.etree.elementtree.rst:251 msgid "" "We can remove elements using :meth:`Element.remove`. Let's say we want to " "remove all countries with a rank higher than 50::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:261 +#: ../../library/xml.etree.elementtree.rst:262 msgid "" "Note that concurrent modification while iterating can lead to problems, just " "like when iterating and modifying Python lists or dicts. Therefore, the " @@ -232,21 +232,21 @@ msgid "" "only then iterates over the list of matches." msgstr "" -#: ../../library/xml.etree.elementtree.rst:288 +#: ../../library/xml.etree.elementtree.rst:289 msgid "Building XML documents" msgstr "" -#: ../../library/xml.etree.elementtree.rst:290 +#: ../../library/xml.etree.elementtree.rst:291 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:301 +#: ../../library/xml.etree.elementtree.rst:302 msgid "Parsing XML with Namespaces" msgstr "" -#: ../../library/xml.etree.elementtree.rst:303 +#: ../../library/xml.etree.elementtree.rst:304 msgid "" "If the XML input has `namespaces `__, tags and attributes with prefixes in the form ``prefix:" @@ -256,34 +256,34 @@ msgid "" "prefixed tags." msgstr "" -#: ../../library/xml.etree.elementtree.rst:311 +#: ../../library/xml.etree.elementtree.rst:312 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:332 +#: ../../library/xml.etree.elementtree.rst:333 msgid "" "One way to search and explore this XML example is to manually add the URI to " "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:343 +#: ../../library/xml.etree.elementtree.rst:344 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:355 +#: ../../library/xml.etree.elementtree.rst:356 msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:369 +#: ../../library/xml.etree.elementtree.rst:370 msgid "XPath support" -msgstr "" +msgstr "XPath 支援" -#: ../../library/xml.etree.elementtree.rst:371 +#: ../../library/xml.etree.elementtree.rst:372 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -291,41 +291,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:377 -#: ../../library/xml.etree.elementtree.rst:769 +#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:772 msgid "Example" msgstr "範例" -#: ../../library/xml.etree.elementtree.rst:379 +#: ../../library/xml.etree.elementtree.rst:380 msgid "" "Here's an example that demonstrates some of the XPath capabilities of the " "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:403 +#: ../../library/xml.etree.elementtree.rst:404 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:410 +#: ../../library/xml.etree.elementtree.rst:411 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Syntax" -msgstr "" +msgstr "語法" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Meaning" -msgstr "" +msgstr "意義" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "``tag``" msgstr "``tag``" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -335,133 +335,133 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:426 +#: ../../library/xml.etree.elementtree.rst:427 msgid "Support for star-wildcards was added." -msgstr "" +msgstr "新增對星號萬用字元的支援。" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "``*``" msgstr "``*``" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "" "Selects all child elements, including comments and processing instructions. " "For example, ``*/egg`` selects all grandchildren named ``egg``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "``.``" msgstr "``.``" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "" "Selects the current node. This is mostly useful at the beginning of the " "path, to indicate that it's a relative path." msgstr "" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "``//``" msgstr "``//``" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "" "Selects all subelements, on all levels beneath the current element. For " "example, ``.//egg`` selects all ``egg`` elements in the entire tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "``..``" msgstr "``..``" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "" "Selects the parent element. Returns ``None`` if the path attempts to reach " "the ancestors of the start element (the element ``find`` was called on)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "``[@attrib]``" msgstr "``[@attrib]``" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "Selects all elements that have the given attribute." -msgstr "" +msgstr "選擇所有具有給定屬性的元素。" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "``[@attrib='value']``" msgstr "``[@attrib='value']``" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "" "Selects all elements for which the given attribute has the given value. The " "value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 msgid "``[@attrib!='value']``" msgstr "``[@attrib!='value']``" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 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:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "``[tag]``" msgstr "``[tag]``" -#: ../../library/xml.etree.elementtree.rst:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 msgid "``[tag='text']``" msgstr "``[tag='text']``" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 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:475 +#: ../../library/xml.etree.elementtree.rst:476 msgid "``[tag!='text']``" msgstr "``[tag!='text']``" -#: ../../library/xml.etree.elementtree.rst:475 +#: ../../library/xml.etree.elementtree.rst:476 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:481 +#: ../../library/xml.etree.elementtree.rst:482 msgid "``[position]``" msgstr "``[position]``" -#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:482 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 " @@ -469,28 +469,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:488 +#: ../../library/xml.etree.elementtree.rst:489 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:493 -#: ../../library/xml.etree.elementtree.rst:821 +#: ../../library/xml.etree.elementtree.rst:494 +#: ../../library/xml.etree.elementtree.rst:824 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:498 -#: ../../library/xml.etree.elementtree.rst:826 +#: ../../library/xml.etree.elementtree.rst:499 +#: ../../library/xml.etree.elementtree.rst:829 msgid "Functions" msgstr "函式" -#: ../../library/xml.etree.elementtree.rst:502 +#: ../../library/xml.etree.elementtree.rst:503 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:504 +#: ../../library/xml.etree.elementtree.rst:505 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 " @@ -499,7 +499,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:510 +#: ../../library/xml.etree.elementtree.rst:511 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 " @@ -508,63 +508,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:517 +#: ../../library/xml.etree.elementtree.rst:518 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:528 +#: ../../library/xml.etree.elementtree.rst:529 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:530 +#: ../../library/xml.etree.elementtree.rst:531 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:531 +#: ../../library/xml.etree.elementtree.rst:532 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:532 -#: ../../library/xml.etree.elementtree.rst:534 +#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:535 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:534 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:535 +#: ../../library/xml.etree.elementtree.rst:536 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:536 -#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:539 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:538 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:539 +#: ../../library/xml.etree.elementtree.rst:540 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:540 +#: ../../library/xml.etree.elementtree.rst:541 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:542 +#: ../../library/xml.etree.elementtree.rst:543 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:550 +#: ../../library/xml.etree.elementtree.rst:551 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -573,7 +573,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:556 +#: ../../library/xml.etree.elementtree.rst:557 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -581,29 +581,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:563 +#: ../../library/xml.etree.elementtree.rst:564 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:566 +#: ../../library/xml.etree.elementtree.rst:567 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:569 +#: ../../library/xml.etree.elementtree.rst:570 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:571 +#: ../../library/xml.etree.elementtree.rst:572 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:578 +#: ../../library/xml.etree.elementtree.rst:579 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. " @@ -611,7 +611,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:586 +#: ../../library/xml.etree.elementtree.rst:587 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 " @@ -619,7 +619,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:596 +#: ../../library/xml.etree.elementtree.rst:597 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 " @@ -629,13 +629,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:608 +#: ../../library/xml.etree.elementtree.rst:609 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:614 +#: ../../library/xml.etree.elementtree.rst:615 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` " @@ -646,11 +646,13 @@ msgid "" "omitted, only ``\"end\"`` events are reported. *parser* is an optional " "parser instance. If not given, the standard :class:`XMLParser` parser is " "used. *parser* must be a subclass of :class:`XMLParser` and can only use " -"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " -"providing ``(event, elem)`` pairs." +"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " +"providing ``(event, elem)`` pairs; it has a ``root`` attribute that " +"references the root element of the resulting XML tree once *source* is fully " +"read." msgstr "" -#: ../../library/xml.etree.elementtree.rst:626 +#: ../../library/xml.etree.elementtree.rst:629 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 " @@ -658,7 +660,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:633 +#: ../../library/xml.etree.elementtree.rst:636 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, " @@ -667,21 +669,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1478 +#: ../../library/xml.etree.elementtree.rst:642 +#: ../../library/xml.etree.elementtree.rst:1481 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:641 +#: ../../library/xml.etree.elementtree.rst:644 msgid "The *parser* argument." msgstr "*parser* 引數。" -#: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:647 +#: ../../library/xml.etree.elementtree.rst:1485 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" -#: ../../library/xml.etree.elementtree.rst:650 +#: ../../library/xml.etree.elementtree.rst:653 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 " @@ -689,7 +691,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:658 +#: ../../library/xml.etree.elementtree.rst:661 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -697,7 +699,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:663 +#: ../../library/xml.etree.elementtree.rst:666 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating comment objects for them. An :class:`ElementTree` will " @@ -705,7 +707,7 @@ msgid "" "the tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:671 +#: ../../library/xml.etree.elementtree.rst:674 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. " @@ -714,13 +716,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:682 +#: ../../library/xml.etree.elementtree.rst:685 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:685 +#: ../../library/xml.etree.elementtree.rst:688 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -729,7 +731,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:696 +#: ../../library/xml.etree.elementtree.rst:699 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -741,24 +743,24 @@ msgid "" "Returns an (optionally) encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:705 -#: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1189 +#: ../../library/xml.etree.elementtree.rst:708 +#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:1192 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" -#: ../../library/xml.etree.elementtree.rst:708 -#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:738 msgid "The *xml_declaration* and *default_namespace* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:714 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:720 +#: ../../library/xml.etree.elementtree.rst:723 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -772,13 +774,13 @@ msgid "" "join(tostringlist(element)) == tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:738 +#: ../../library/xml.etree.elementtree.rst:741 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:745 +#: ../../library/xml.etree.elementtree.rst:748 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 " @@ -786,7 +788,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:753 +#: ../../library/xml.etree.elementtree.rst:756 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 " @@ -795,11 +797,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:763 +#: ../../library/xml.etree.elementtree.rst:766 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:765 +#: ../../library/xml.etree.elementtree.rst:768 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -807,7 +809,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:771 +#: ../../library/xml.etree.elementtree.rst:774 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/" @@ -815,43 +817,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:780 +#: ../../library/xml.etree.elementtree.rst:783 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:782 +#: ../../library/xml.etree.elementtree.rst:785 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:793 +#: ../../library/xml.etree.elementtree.rst:796 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:801 +#: ../../library/xml.etree.elementtree.rst:804 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:803 +#: ../../library/xml.etree.elementtree.rst:806 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:812 +#: ../../library/xml.etree.elementtree.rst:815 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:833 +#: ../../library/xml.etree.elementtree.rst:836 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\". " @@ -862,7 +864,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:845 +#: ../../library/xml.etree.elementtree.rst:848 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +875,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:853 +#: ../../library/xml.etree.elementtree.rst:856 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:858 +#: ../../library/xml.etree.elementtree.rst:861 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:865 +#: ../../library/xml.etree.elementtree.rst:868 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:872 +#: ../../library/xml.etree.elementtree.rst:875 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:878 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +904,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:883 +#: ../../library/xml.etree.elementtree.rst:886 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:893 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +921,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:905 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 " @@ -927,17 +929,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:907 +#: ../../library/xml.etree.elementtree.rst:910 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:913 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:915 +#: ../../library/xml.etree.elementtree.rst:918 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +948,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:924 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:926 +#: ../../library/xml.etree.elementtree.rst:929 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:935 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:937 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:942 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:948 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:954 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:956 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:958 +#: ../../library/xml.etree.elementtree.rst:961 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:968 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:976 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1009,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:982 +#: ../../library/xml.etree.elementtree.rst:985 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1018,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:991 +#: ../../library/xml.etree.elementtree.rst:994 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 " @@ -1027,13 +1029,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1002 +#: ../../library/xml.etree.elementtree.rst:1005 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:1011 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 " @@ -1042,7 +1044,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1019 +#: ../../library/xml.etree.elementtree.rst:1022 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1052,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1030 +#: ../../library/xml.etree.elementtree.rst:1033 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:1041 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:1047 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:1051 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:1056 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1065 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1068 +#: ../../library/xml.etree.elementtree.rst:1071 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1098,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1074 +#: ../../library/xml.etree.elementtree.rst:1077 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 " @@ -1332,11 +1334,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1356 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1358 +#: ../../library/xml.etree.elementtree.rst:1361 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 " @@ -1347,24 +1349,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1366 +#: ../../library/xml.etree.elementtree.rst:1369 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1373 +#: ../../library/xml.etree.elementtree.rst:1376 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:1380 +#: ../../library/xml.etree.elementtree.rst:1383 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1382 +#: ../../library/xml.etree.elementtree.rst:1385 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 " @@ -1375,11 +1377,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1426 +#: ../../library/xml.etree.elementtree.rst:1429 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1430 +#: ../../library/xml.etree.elementtree.rst:1433 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 " @@ -1391,11 +1393,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1441 +#: ../../library/xml.etree.elementtree.rst:1444 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1445 +#: ../../library/xml.etree.elementtree.rst:1448 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1405,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1452 +#: ../../library/xml.etree.elementtree.rst:1455 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 " @@ -1412,25 +1414,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1458 +#: ../../library/xml.etree.elementtree.rst:1461 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1460 +#: ../../library/xml.etree.elementtree.rst:1463 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1462 +#: ../../library/xml.etree.elementtree.rst:1465 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1464 +#: ../../library/xml.etree.elementtree.rst:1467 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 " @@ -1439,7 +1441,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1472 +#: ../../library/xml.etree.elementtree.rst:1475 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 " @@ -1448,11 +1450,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1487 +#: ../../library/xml.etree.elementtree.rst:1490 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1491 +#: ../../library/xml.etree.elementtree.rst:1494 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 " @@ -1460,22 +1462,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1501 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:1503 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1506 +#: ../../library/xml.etree.elementtree.rst:1509 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1507 +#: ../../library/xml.etree.elementtree.rst:1510 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/reference/compound_stmts.po b/reference/compound_stmts.po index 2978dd7513..b235260ac4 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -395,30 +395,31 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:492 -msgid "The context manager's :meth:`__enter__` is loaded for later use." +msgid "" +"The context manager's :meth:`~object.__enter__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:494 -msgid "The context manager's :meth:`__exit__` is loaded for later use." +msgid "The context manager's :meth:`~object.__exit__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:496 -msgid "The context manager's :meth:`__enter__` method is invoked." +msgid "The context manager's :meth:`~object.__enter__` method is invoked." msgstr "" #: ../../reference/compound_stmts.rst:498 msgid "" "If a target was included in the :keyword:`with` statement, the return value " -"from :meth:`__enter__` is assigned to it." +"from :meth:`~object.__enter__` is assigned to it." msgstr "" #: ../../reference/compound_stmts.rst:503 msgid "" -"The :keyword:`with` statement guarantees that if the :meth:`__enter__` " -"method returns without an error, then :meth:`__exit__` will always be " -"called. Thus, if an error occurs during the assignment to the target list, " -"it will be treated the same as an error occurring within the suite would be. " -"See step 7 below." +"The :keyword:`with` statement guarantees that if the :meth:`~object." +"__enter__` method returns without an error, then :meth:`~object.__exit__` " +"will always be called. Thus, if an error occurs during the assignment to the " +"target list, it will be treated the same as an error occurring within the " +"suite would be. See step 7 below." msgstr "" #: ../../reference/compound_stmts.rst:509 @@ -427,25 +428,25 @@ msgstr "" #: ../../reference/compound_stmts.rst:511 msgid "" -"The context manager's :meth:`__exit__` method is invoked. If an exception " -"caused the suite to be exited, its type, value, and traceback are passed as " -"arguments to :meth:`__exit__`. Otherwise, three :const:`None` arguments are " -"supplied." +"The context manager's :meth:`~object.__exit__` method is invoked. If an " +"exception caused the suite to be exited, its type, value, and traceback are " +"passed as arguments to :meth:`~object.__exit__`. Otherwise, three :const:" +"`None` arguments are supplied." msgstr "" #: ../../reference/compound_stmts.rst:516 msgid "" "If the suite was exited due to an exception, and the return value from the :" -"meth:`__exit__` method was false, the exception is reraised. If the return " -"value was true, the exception is suppressed, and execution continues with " -"the statement following the :keyword:`with` statement." +"meth:`~object.__exit__` method was false, the exception is reraised. If the " +"return value was true, the exception is suppressed, and execution continues " +"with the statement following the :keyword:`with` statement." msgstr "" #: ../../reference/compound_stmts.rst:521 msgid "" "If the suite was exited for any reason other than an exception, the return " -"value from :meth:`__exit__` is ignored, and execution proceeds at the normal " -"location for the kind of exit that was taken." +"value from :meth:`~object.__exit__` is ignored, and execution proceeds at " +"the normal location for the kind of exit that was taken." msgstr "" #: ../../reference/compound_stmts.rst:525 @@ -1101,7 +1102,7 @@ msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " "in the mapping, and not created on-the-fly via :meth:`__missing__` or :meth:" -"`__getitem__`." +"`~object.__getitem__`." msgstr "" #: ../../reference/compound_stmts.rst:1063 diff --git a/reference/datamodel.po b/reference/datamodel.po index 984e121885..48ab47c007 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -3270,7 +3270,7 @@ msgstr "" #: ../../reference/datamodel.rst:2942 msgid "" -"Note that :meth:`__exit__` methods should not reraise the passed-in " +"Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" @@ -3593,14 +3593,14 @@ msgstr "" #: ../../reference/datamodel.rst:3260 msgid "" -"Semantically similar to :meth:`__enter__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__enter__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3265 msgid "" -"Semantically similar to :meth:`__exit__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__exit__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3268 diff --git a/reference/expressions.po b/reference/expressions.po index 287b606b1e..a75824076f 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -931,9 +931,9 @@ msgid "" "the last item of ``x``. The resulting value must be a nonnegative integer " "less than the number of items in the sequence, and the subscription selects " "the item whose index is that value (counting from zero). Since the support " -"for negative indices and slicing occurs in the object's :meth:`__getitem__` " -"method, subclasses overriding this method will need to explicitly add that " -"support." +"for negative indices and slicing occurs in the object's :meth:`~object." +"__getitem__` method, subclasses overriding this method will need to " +"explicitly add that support." msgstr "" #: ../../reference/expressions.rst:892 @@ -967,16 +967,16 @@ msgstr "" #: ../../reference/expressions.rst:939 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " -"the same :meth:`__getitem__` method as normal subscription) with a key that " -"is constructed from the slice list, as follows. If the slice list contains " -"at least one comma, the key is a tuple containing the conversion of the " -"slice items; otherwise, the conversion of the lone slice item is the key. " -"The conversion of a slice item that is an expression is that expression. " -"The conversion of a proper slice is a slice object (see section :ref:" -"`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :attr:`~slice." -"step` attributes are the values of the expressions given as lower bound, " -"upper bound and stride, respectively, substituting ``None`` for missing " -"expressions." +"the same :meth:`~object.__getitem__` method as normal subscription) with a " +"key that is constructed from the slice list, as follows. If the slice list " +"contains at least one comma, the key is a tuple containing the conversion of " +"the slice items; otherwise, the conversion of the lone slice item is the " +"key. The conversion of a slice item that is an expression is that " +"expression. The conversion of a proper slice is a slice object (see " +"section :ref:`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :" +"attr:`~slice.step` attributes are the values of the expressions given as " +"lower bound, upper bound and stride, respectively, substituting ``None`` for " +"missing expressions." msgstr "" #: ../../reference/expressions.rst:963 @@ -1794,10 +1794,10 @@ msgstr "" #: ../../reference/expressions.rst:1665 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" -"`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " -"integer index *i* such that ``x is y[i] or x == y[i]``, and no lower integer " -"index raises the :exc:`IndexError` exception. (If any other exception is " -"raised, it is as if :keyword:`in` raised that exception)." +"`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" +"negative integer index *i* such that ``x is y[i] or x == y[i]``, and no " +"lower integer index raises the :exc:`IndexError` exception. (If any other " +"exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" #: ../../reference/expressions.rst:1677 diff --git a/reference/import.po b/reference/import.po index 20cc4973c8..d214c99770 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+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-" @@ -703,8 +703,8 @@ msgstr "" #: ../../reference/import.rst:561 ../../reference/import.rst:582 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of this attribute." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"this attribute." msgstr "" #: ../../reference/import.rst:564 @@ -813,8 +813,8 @@ msgstr "" #: ../../reference/import.rst:652 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of ``__cached__``." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"``__cached__``." msgstr "" #: ../../reference/import.rst:658 diff --git a/reference/introduction.po b/reference/introduction.po index 332705e041..d453a71ed1 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-16 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -156,11 +156,12 @@ msgstr "" #: ../../reference/introduction.rst:93 msgid "" -"The descriptions of lexical analysis and syntax use a modified BNF grammar " -"notation. This uses the following style of definition:" +"The descriptions of lexical analysis and syntax use a modified `Backus–Naur " +"form (BNF) `_ " +"grammar notation. This uses the following style of definition:" msgstr "" -#: ../../reference/introduction.rst:100 +#: ../../reference/introduction.rst:101 msgid "" "The first line says that a ``name`` is an ``lc_letter`` followed by a " "sequence of zero or more ``lc_letter``\\ s and underscores. An " @@ -169,7 +170,7 @@ msgid "" "and grammar rules in this document.)" msgstr "" -#: ../../reference/introduction.rst:105 +#: ../../reference/introduction.rst:106 msgid "" "Each rule begins with a name (which is the name defined by the rule) and ``::" "=``. A vertical bar (``|``) is used to separate alternatives; it is the " @@ -184,7 +185,7 @@ msgid "" "line after the first beginning with a vertical bar." msgstr "" -#: ../../reference/introduction.rst:119 +#: ../../reference/introduction.rst:120 msgid "" "In lexical definitions (as the example above), two more conventions are " "used: Two literal characters separated by three dots mean a choice of any " @@ -194,7 +195,7 @@ msgid "" "'control character' if needed." msgstr "" -#: ../../reference/introduction.rst:126 +#: ../../reference/introduction.rst:127 msgid "" "Even though the notation used is almost the same, there is a big difference " "between the meaning of lexical and syntactic definitions: a lexical " @@ -221,10 +222,10 @@ msgstr "syntax(語法)" msgid "notation" msgstr "notation(標記法)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "lexical definitions" msgstr "lexical definitions(詞法定義)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "ASCII" msgstr "ASCII" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 9979da11cf..75ee915511 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-22 12:58+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -549,10 +549,10 @@ msgstr "" #: ../../tutorial/introduction.rst:430 msgid "" -"You can also add new items at the end of the list, by using the :meth:`~list." +"You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" msgstr "" -"你也可以在 list 的最後加入新元素,透過使用 :meth:`~list.append` *方法* " +"你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " "(method)(我們稍後會看到更多方法的說明):\n" "\n" "::" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index b0fba98274..a3709bd620 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -1082,7 +1082,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:880 msgid "XML Modules" -msgstr "" +msgstr "XML 模組" #: ../../whatsnew/2.0.rst:882 msgid "" @@ -1101,7 +1101,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:896 msgid "SAX2 Support" -msgstr "" +msgstr "SAX2 支援" #: ../../whatsnew/2.0.rst:898 msgid "" @@ -1138,7 +1138,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:940 msgid "DOM Support" -msgstr "" +msgstr "DOM 支援" #: ../../whatsnew/2.0.rst:942 msgid "" @@ -1301,7 +1301,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:1074 msgid "New modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/2.0.rst:1076 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 2108feb605..2875c7f1d3 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -505,31 +505,33 @@ msgstr "" #: ../../whatsnew/2.2.rst:426 msgid "" "In Python versions up to 2.1, the usual way to make ``for item in obj`` work " -"is to define a :meth:`__getitem__` method that looks something like this::" +"is to define a :meth:`~object.__getitem__` method that looks something like " +"this::" msgstr "" #: ../../whatsnew/2.2.rst:432 msgid "" -":meth:`__getitem__` is more properly used to define an indexing operation on " -"an object so that you can write ``obj[5]`` to retrieve the sixth element. " -"It's a bit misleading when you're using this only to support :keyword:`for` " -"loops. Consider some file-like object that wants to be looped over; the " -"*index* parameter is essentially meaningless, as the class probably assumes " -"that a series of :meth:`__getitem__` calls will be made with *index* " -"incrementing by one each time. In other words, the presence of the :meth:" -"`__getitem__` method doesn't mean that using ``file[5]`` to randomly access " -"the sixth element will work, though it really should." +":meth:`~object.__getitem__` is more properly used to define an indexing " +"operation on an object so that you can write ``obj[5]`` to retrieve the " +"sixth element. It's a bit misleading when you're using this only to " +"support :keyword:`for` loops. Consider some file-like object that wants to " +"be looped over; the *index* parameter is essentially meaningless, as the " +"class probably assumes that a series of :meth:`~object.__getitem__` calls " +"will be made with *index* incrementing by one each time. In other words, " +"the presence of the :meth:`~object.__getitem__` method doesn't mean that " +"using ``file[5]`` to randomly access the sixth element will work, though it " +"really should." msgstr "" #: ../../whatsnew/2.2.rst:442 msgid "" -"In Python 2.2, iteration can be implemented separately, and :meth:" -"`__getitem__` methods can be limited to classes that really do support " -"random access. The basic idea of iterators is simple. A new built-in " -"function, ``iter(obj)`` or ``iter(C, sentinel)``, is used to get an " -"iterator. ``iter(obj)`` returns an iterator for the object *obj*, while " -"``iter(C, sentinel)`` returns an iterator that will invoke the callable " -"object *C* until it returns *sentinel* to signal that the iterator is done." +"In Python 2.2, iteration can be implemented separately, and :meth:`~object." +"__getitem__` methods can be limited to classes that really do support random " +"access. The basic idea of iterators is simple. A new built-in function, " +"``iter(obj)`` or ``iter(C, sentinel)``, is used to get an iterator. " +"``iter(obj)`` returns an iterator for the object *obj*, while ``iter(C, " +"sentinel)`` returns an iterator that will invoke the callable object *C* " +"until it returns *sentinel* to signal that the iterator is done." msgstr "" #: ../../whatsnew/2.2.rst:450 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index f542f4b572..e2738a5e26 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -958,8 +958,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:928 msgid "" -"One can also now pass slice objects to the :meth:`__getitem__` methods of " -"the built-in sequences::" +"One can also now pass slice objects to the :meth:`~object.__getitem__` " +"methods of the built-in sequences::" msgstr "" #: ../../whatsnew/2.3.rst:934 @@ -1770,8 +1770,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1598 msgid "" "Adding the mix-in as a superclass provides the full dictionary interface " -"whenever the class defines :meth:`__getitem__`, :meth:`__setitem__`, :meth:" -"`__delitem__`, and :meth:`keys`. For example::" +"whenever the class defines :meth:`~object.__getitem__`, :meth:" +"`__setitem__`, :meth:`__delitem__`, and :meth:`keys`. For example::" msgstr "" #: ../../whatsnew/2.3.rst:1639 diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index f20f05f3ff..94418ebc94 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -689,22 +689,22 @@ msgstr "" #: ../../whatsnew/2.5.rst:577 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:581 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.5.rst:586 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -735,7 +735,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:611 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.5.rst:614 @@ -777,13 +777,13 @@ msgstr "" #: ../../whatsnew/2.5.rst:654 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:658 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``'as VAR'`` clause is present, the " "value is simply discarded." msgstr "" @@ -805,8 +805,8 @@ msgstr "" #: ../../whatsnew/2.5.rst:672 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.5.rst:675 @@ -839,19 +839,19 @@ msgstr "" #: ../../whatsnew/2.5.rst:706 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.5.rst:718 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.5.rst:723 @@ -878,12 +878,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.5.rst:757 @@ -1564,8 +1564,8 @@ msgid "" "`universal newlines` mode. Another new parameter, *openhook*, lets you use " "a function other than :func:`open` to open the input files. Once you're " "iterating over the set of files, the :class:`FileInput` object's new :meth:" -"`fileno` returns the file descriptor for the currently opened file. " -"(Contributed by Georg Brandl.)" +"`~fileinput.fileno` returns the file descriptor for the currently opened " +"file. (Contributed by Georg Brandl.)" msgstr "" #: ../../whatsnew/2.5.rst:1354 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index ac6200eaa8..3343bbc83f 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -332,22 +332,22 @@ msgstr "" #: ../../whatsnew/2.6.rst:271 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods)." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods)." msgstr "" #: ../../whatsnew/2.6.rst:275 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.6.rst:280 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -368,7 +368,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:298 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.6.rst:301 @@ -410,13 +410,13 @@ msgstr "" #: ../../whatsnew/2.6.rst:341 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.6.rst:345 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " "value is simply discarded." msgstr "" @@ -427,21 +427,21 @@ msgstr "" #: ../../whatsnew/2.6.rst:351 msgid "" -"If *BLOCK* raises an exception, the context manager's :meth:`__exit__` " -"method is called with three arguments, the exception details (``type, value, " -"traceback``, the same values returned by :func:`sys.exc_info`, which can " -"also be ``None`` if no exception occurred). The method's return value " -"controls whether an exception is re-raised: any false value re-raises the " -"exception, and ``True`` will result in suppressing it. You'll only rarely " -"want to suppress the exception, because if you do the author of the code " -"containing the ':keyword:`with`' statement will never realize anything went " -"wrong." +"If *BLOCK* raises an exception, the context manager's :meth:`~object." +"__exit__` method is called with three arguments, the exception details " +"(``type, value, traceback``, the same values returned by :func:`sys." +"exc_info`, which can also be ``None`` if no exception occurred). The " +"method's return value controls whether an exception is re-raised: any false " +"value re-raises the exception, and ``True`` will result in suppressing it. " +"You'll only rarely want to suppress the exception, because if you do the " +"author of the code containing the ':keyword:`with`' statement will never " +"realize anything went wrong." msgstr "" #: ../../whatsnew/2.6.rst:360 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.6.rst:363 @@ -474,19 +474,19 @@ msgstr "" #: ../../whatsnew/2.6.rst:394 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.6.rst:406 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.6.rst:411 @@ -512,12 +512,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`!yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`!yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.6.rst:445 @@ -1892,8 +1892,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:1740 msgid "" -"The ``with`` statement now stores the :meth:`__exit__` method on the stack, " -"producing a small speedup. (Implemented by Jeffrey Yasskin.)" +"The ``with`` statement now stores the :meth:`~object.__exit__` method on the " +"stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" #: ../../whatsnew/2.6.rst:1743 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 2b70b2c4ce..779dd14c01 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -966,8 +966,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:932 msgid "" "A new opcode was added to perform the initial setup for :keyword:`with` " -"statements, looking up the :meth:`__enter__` and :meth:`__exit__` methods. " -"(Contributed by Benjamin Peterson.)" +"statements, looking up the :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods. (Contributed by Benjamin Peterson.)" msgstr "" #: ../../whatsnew/2.7.rst:936 @@ -2895,17 +2895,17 @@ msgstr "" #: ../../whatsnew/2.7.rst:2451 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " -"methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's " -"type, and cannot be directly attached to the object's instance. This " -"affects new-style classes (derived from :class:`object`) and C extension " -"types. (:issue:`6101`.)" +"methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " +"to the object's type, and cannot be directly attached to the object's " +"instance. This affects new-style classes (derived from :class:`object`) and " +"C extension types. (:issue:`6101`.)" msgstr "" #: ../../whatsnew/2.7.rst:2457 msgid "" -"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`__exit__` " -"methods was often the string representation of the exception, not an " -"instance. This was fixed in 2.7, so *exc_value* will be an instance as " +"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." +"__exit__` methods was often the string representation of the exception, not " +"an instance. This was fixed in 2.7, so *exc_value* will be an instance as " "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 32a6ae6486..78decf315a 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -796,7 +796,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:572 msgid "Improved Modules" -msgstr "模組改進" +msgstr "改進的模組" #: ../../whatsnew/3.11.rst:577 msgid "asyncio" @@ -3202,11 +3202,11 @@ msgstr ":func:`importlib.resources.path`" #: ../../whatsnew/3.11.rst:1800 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." "getpreferredencoding(False) ` and :func:`locale." "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.13 中移除。請改" +":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index caf6dee4a5..1da29c8b92 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,7 +76,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:90 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" @@ -96,7 +96,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器改進:" #: ../../whatsnew/3.12.rst:100 msgid "" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:113 msgid "The :class:`pathlib.Path` class now supports subclassing" -msgstr "" +msgstr ":class:`pathlib.Path` 類別現在支援子類別化" #: ../../whatsnew/3.12.rst:114 msgid "The :mod:`os` module received several improvements for Windows support" @@ -168,7 +168,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:126 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.12.rst:128 msgid "" @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:134 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.12.rst:136 msgid ":ref:`PEP 697 `, unstable C API tier" @@ -215,10 +215,12 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" +"term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" -msgstr "" +msgstr ":ref:`PEP 698 `、:func:`typing.override` 裝飾器" #: ../../whatsnew/3.12.rst:151 msgid "Important deprecations, removals or restrictions:" @@ -255,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1931 msgid "New Features" msgstr "新增特性" @@ -457,7 +459,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:377 msgid "(Contributed by Mark Shannon in :gh:`103082`.)" -msgstr "" +msgstr "(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" @@ -529,7 +531,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:423 msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" -msgstr "" +msgstr "(由 Carl Meyer 和 Vladimir Matveev 於 :pep:`709` 中貢獻。)" #: ../../whatsnew/3.12.rst:426 msgid "Improved Error Messages" @@ -595,7 +597,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." -msgstr "" +msgstr "詳情請見 :pep:`692`。" #: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" @@ -616,11 +618,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:518 msgid "Example::" -msgstr "" +msgstr "範例: ::" #: ../../whatsnew/3.12.rst:536 msgid "See :pep:`698` for more details." -msgstr "" +msgstr "詳情請見 :pep:`698`。" #: ../../whatsnew/3.12.rst:538 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" @@ -753,7 +755,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:626 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.12.rst:628 msgid "None." @@ -761,7 +763,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.12.rst:635 msgid "array" @@ -886,7 +888,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" -msgstr "" +msgstr "importlib.resources" #: ../../whatsnew/3.12.rst:716 msgid "" @@ -894,25 +896,31 @@ msgid "" "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:719 +msgid "" +"Rename first parameter of :func:`importlib.resources.files` to *anchor*. " +"(Contributed by Jason R. Coombs in :gh:`100598`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:723 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:725 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:729 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:733 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -920,60 +928,62 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:736 +#: ../../whatsnew/3.12.rst:739 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:741 msgid "" "Add :class:`itertools.batched()` for collecting into even-sized tuples where " "the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:746 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:748 msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" +"`100485` 中貢獻。)" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:751 msgid "" "Extend :func:`math.nextafter` to include a *steps* argument for moving up or " "down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:753 +#: ../../whatsnew/3.12.rst:756 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:755 +#: ../../whatsnew/3.12.rst:758 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:762 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:763 +#: ../../whatsnew/3.12.rst:766 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 +#: ../../whatsnew/3.12.rst:770 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -986,27 +996,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:778 +#: ../../whatsnew/3.12.rst:781 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:780 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:783 +#: ../../whatsnew/3.12.rst:786 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:790 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:789 +#: ../../whatsnew/3.12.rst:792 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -1014,14 +1024,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:797 msgid "" "Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " "all file or directory names within them, similar to :func:`os.walk`. " "(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:798 +#: ../../whatsnew/3.12.rst:801 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -1029,13 +1039,13 @@ msgid "" "gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:806 +#: ../../whatsnew/3.12.rst:809 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -1043,38 +1053,40 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:814 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:816 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:819 +#: ../../whatsnew/3.12.rst:822 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:824 msgid "" "Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" "`81620`.)" msgstr "" +"新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" +"貢獻。)" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:827 msgid "" "Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:828 +#: ../../whatsnew/3.12.rst:831 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:830 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -1082,7 +1094,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:836 +#: ../../whatsnew/3.12.rst:839 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -1090,14 +1102,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:845 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:847 +#: ../../whatsnew/3.12.rst:850 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -1105,24 +1117,26 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:852 +#: ../../whatsnew/3.12.rst:855 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1651 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:860 +#: ../../whatsnew/3.12.rst:863 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" +"`77617` 中貢獻。)" -#: ../../whatsnew/3.12.rst:863 +#: ../../whatsnew/3.12.rst:866 msgid "" "Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." "Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " @@ -1130,43 +1144,43 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:873 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:875 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." "setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " "database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:881 +#: ../../whatsnew/3.12.rst:884 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:886 msgid "" "Extend :func:`statistics.correlation` to include as a ``ranked`` method for " "computing the Spearman correlation of ranked data. (Contributed by Raymond " "Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:888 +#: ../../whatsnew/3.12.rst:891 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:893 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:894 +#: ../../whatsnew/3.12.rst:897 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1176,7 +1190,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:903 +#: ../../whatsnew/3.12.rst:906 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1185,14 +1199,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1839 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:913 +#: ../../whatsnew/3.12.rst:916 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1200,27 +1214,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:919 +#: ../../whatsnew/3.12.rst:922 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:924 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:923 +#: ../../whatsnew/3.12.rst:926 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:932 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:931 +#: ../../whatsnew/3.12.rst:934 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1228,11 +1242,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:940 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:942 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1242,11 +1256,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:948 +#: ../../whatsnew/3.12.rst:951 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:950 +#: ../../whatsnew/3.12.rst:953 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1254,22 +1268,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:956 +#: ../../whatsnew/3.12.rst:959 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:961 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:963 +#: ../../whatsnew/3.12.rst:966 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:965 +#: ../../whatsnew/3.12.rst:968 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1282,7 +1296,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:976 +#: ../../whatsnew/3.12.rst:979 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1290,13 +1304,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:998 +#: ../../whatsnew/3.12.rst:1001 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:1001 +#: ../../whatsnew/3.12.rst:1004 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1307,71 +1321,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 +#: ../../whatsnew/3.12.rst:1012 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1017 +#: ../../whatsnew/3.12.rst:1020 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1022 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1692 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:1025 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:1041 +#: ../../whatsnew/3.12.rst:1044 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1047 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:1046 +#: ../../whatsnew/3.12.rst:1049 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1054 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:1053 +#: ../../whatsnew/3.12.rst:1056 msgid "" "Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " "object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " "Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1060 msgid "" "Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:1061 +#: ../../whatsnew/3.12.rst:1064 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1379,13 +1393,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1069 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1072 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1393,18 +1407,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1077 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1083 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1085 msgid "" "Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1412,62 +1426,62 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1090 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1093 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1096 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1099 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1102 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1105 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1108 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1111 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1114 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1117 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1476,48 +1490,48 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1126 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1129 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1131 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1136 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 ../../whatsnew/3.12.rst:2219 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2233 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1145 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1150 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1525,37 +1539,37 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1388 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1389 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1158 ../../whatsnew/3.12.rst:1390 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1160 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1163 ../../whatsnew/3.12.rst:1392 msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1165 msgid "" "The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" "`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" @@ -1563,7 +1577,7 @@ msgid "" "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1571,7 +1585,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1177 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1579,14 +1593,14 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1182 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1183 +#: ../../whatsnew/3.12.rst:1186 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1594,7 +1608,7 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1188 +#: ../../whatsnew/3.12.rst:1191 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1604,47 +1618,47 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1196 +#: ../../whatsnew/3.12.rst:1199 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1199 +#: ../../whatsnew/3.12.rst:1202 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1409 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1410 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1207 ../../whatsnew/3.12.rst:1411 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1209 msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" +msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1211 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1212 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1214 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -1653,7 +1667,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1222 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -1665,14 +1679,14 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1232 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1237 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -1680,11 +1694,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1242 msgid ":mod:`os`:" -msgstr "" +msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1244 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -1693,7 +1707,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1250 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1706,32 +1720,32 @@ msgid "" "longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1257 +#: ../../whatsnew/3.12.rst:1260 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1261 +#: ../../whatsnew/3.12.rst:1264 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " "Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1264 +#: ../../whatsnew/3.12.rst:1267 msgid ":mod:`sqlite3`:" -msgstr "" +msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1266 +#: ../../whatsnew/3.12.rst:1269 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1272 +#: ../../whatsnew/3.12.rst:1275 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1741,38 +1755,38 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1282 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1286 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1290 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1292 msgid "" ":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" "`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " "Waygood in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1296 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1780,7 +1794,7 @@ msgid "" "implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1305 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -1789,21 +1803,21 @@ msgid "" "instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1311 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1313 +#: ../../whatsnew/3.12.rst:1316 msgid "" "Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " "will cease to be set or taken into consideration by the import system in " "Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1320 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1812,7 +1826,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1326 msgid "" "Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" "pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " @@ -1820,276 +1834,289 @@ msgid "" "`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1329 +#: ../../whatsnew/3.12.rst:1332 msgid "Pending Removal in Python 3.13" -msgstr "" +msgstr "Python 3.13 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1334 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1337 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1355 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1356 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1357 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1359 msgid "Other modules:" -msgstr "" +msgstr "其他模組:" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1361 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1363 ../../whatsnew/3.12.rst:1441 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1365 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1363 -msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" -msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" +#: ../../whatsnew/3.12.rst:1366 +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1367 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1368 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1369 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1370 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1371 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1372 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1373 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 +#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2320 msgid "Pending Removal in Python 3.14" -msgstr "" +msgstr "Python 3.14 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1378 msgid "" "The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1381 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1384 msgid ":mod:`ast`:" msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1394 msgid ":class:`!asyncio.MultiLoopChildWatcher`" msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1395 msgid ":class:`!asyncio.FastChildWatcher`" msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1396 msgid ":class:`!asyncio.AbstractChildWatcher`" msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1397 msgid ":class:`!asyncio.SafeChildWatcher`" msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1398 msgid ":func:`!asyncio.set_child_watcher`" msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1399 msgid ":func:`!asyncio.get_child_watcher`," msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1400 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1401 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1403 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1405 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." msgstr "" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1407 msgid ":mod:`importlib.abc`:" msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1413 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1415 msgid ":mod:`pkgutil`:" msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1417 msgid ":func:`!pkgutil.find_loader`" msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1418 msgid ":func:`!pkgutil.get_loader`." msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1417 +#: ../../whatsnew/3.12.rst:1420 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1419 +#: ../../whatsnew/3.12.rst:1422 msgid ":func:`!pty.master_open`" msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1423 msgid ":func:`!pty.slave_open`" msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1425 msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1427 msgid ":mod:`typing`: :class:`!typing.ByteString`" msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1429 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1431 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1433 msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 -msgid "Pending Removal in Future Versions" +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2357 +msgid "Pending Removal in Python 3.15" +msgstr "Python 3.15 中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1438 +msgid "" +"The following APIs have been deprecated and will be removed in Python 3.15." msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1443 +msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" +msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" + +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2375 +msgid "Pending Removal in Future Versions" +msgstr "未來版本中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1449 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1452 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1454 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1456 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2101,54 +2128,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2407 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1470 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1472 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1479 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1481 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1484 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1486 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1488 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1492 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -2157,17 +2184,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1503 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1506 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -2175,7 +2202,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1512 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2185,35 +2212,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1519 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1522 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1510 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1529 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1536 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1538 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2222,11 +2249,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1545 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1533 +#: ../../whatsnew/3.12.rst:1547 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2235,191 +2262,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1554 ../../whatsnew/3.12.rst:1581 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1556 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1559 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1562 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1566 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1555 +#: ../../whatsnew/3.12.rst:1569 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1573 ../../whatsnew/3.12.rst:1581 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1575 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1578 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "Insert ``None`` into ``sys.path_importer_cache``" -msgstr "" +msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "*See below*" msgstr "" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1596 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1611 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1613 msgid "Undocumented functions:" -msgstr "" +msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1615 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1602 +#: ../../whatsnew/3.12.rst:1616 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1617 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1618 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1620 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1622 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1627 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1629 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2428,18 +2455,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1636 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1638 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1642 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2447,27 +2474,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1653 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1656 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1643 +#: ../../whatsnew/3.12.rst:1657 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1659 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1662 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2475,22 +2502,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1667 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1670 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1658 +#: ../../whatsnew/3.12.rst:1672 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1676 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2498,7 +2525,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1682 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2509,189 +2536,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1694 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1698 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1703 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1710 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1709 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1705 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1711 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1706 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1712 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1707 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1713 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1708 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1710 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 -#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 -#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1716 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1711 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1712 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1713 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1714 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1720 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1723 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1726 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1730 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1733 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1736 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1743 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1745 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2700,22 +2727,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1752 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1740 +#: ../../whatsnew/3.12.rst:1754 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1746 +#: ../../whatsnew/3.12.rst:1760 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1762 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2960,84 +2987,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1941 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1943 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1944 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1946 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:1948 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:1949 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1936 +#: ../../whatsnew/3.12.rst:1950 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1952 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1955 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1957 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1960 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1962 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:1970 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1972 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3045,29 +3072,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1977 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1981 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1982 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1983 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1984 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1986 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3078,7 +3105,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1994 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3086,32 +3113,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1999 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2003 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2004 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2005 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2007 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2011 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3119,14 +3146,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2017 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2021 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3135,28 +3162,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2027 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2031 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2036 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2026 +#: ../../whatsnew/3.12.rst:2040 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3166,14 +3193,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2048 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2038 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3181,71 +3208,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2057 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2066 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2067 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2068 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2069 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2070 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2071 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2072 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2073 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2074 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2077 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2076 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2079 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2081 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3253,27 +3280,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2087 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2095 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2098 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2102 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3282,7 +3309,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2109 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3290,13 +3317,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2114 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2118 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3305,7 +3332,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2110 +#: ../../whatsnew/3.12.rst:2124 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3314,13 +3341,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2130 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2134 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3334,7 +3361,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2146 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3342,7 +3369,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2151 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3350,7 +3377,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2156 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3358,7 +3385,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2147 +#: ../../whatsnew/3.12.rst:2161 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3366,25 +3393,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2166 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2169 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2170 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2171 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2173 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3392,14 +3419,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2178 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2168 +#: ../../whatsnew/3.12.rst:2182 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3408,17 +3435,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2175 +#: ../../whatsnew/3.12.rst:2189 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2191 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2179 +#: ../../whatsnew/3.12.rst:2193 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3426,20 +3453,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2198 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2188 +#: ../../whatsnew/3.12.rst:2202 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2205 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3447,14 +3474,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2196 +#: ../../whatsnew/3.12.rst:2210 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2200 +#: ../../whatsnew/3.12.rst:2214 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3465,15 +3492,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2208 +#: ../../whatsnew/3.12.rst:2222 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2223 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2211 +#: ../../whatsnew/3.12.rst:2225 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3482,7 +3509,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2221 +#: ../../whatsnew/3.12.rst:2235 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3491,137 +3518,162 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2226 +#: ../../whatsnew/3.12.rst:2240 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 +#: ../../whatsnew/3.12.rst:2242 ../../whatsnew/3.12.rst:2327 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" -msgstr "" +msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" -msgstr "" +msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" -msgstr "" +msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" -msgstr "" +msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" -msgstr "" +msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" +":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" -msgstr "" +msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" +":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 +#: ../../whatsnew/3.12.rst:2250 ../../whatsnew/3.12.rst:2335 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" +":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 +#: ../../whatsnew/3.12.rst:2251 ../../whatsnew/3.12.rst:2336 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." +"use_environment`" -#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 +#: ../../whatsnew/3.12.rst:2252 ../../whatsnew/3.12.rst:2337 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 +#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" +":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." +"user_site_directory`" -#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 +#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 +#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" +":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " +"和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 +#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" -msgstr "" +msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 +#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 +#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." +"legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 +#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 +#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 +#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." +"filesystem_errors`" -#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 +#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" +"func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2251 +#: ../../whatsnew/3.12.rst:2265 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" +"(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2255 +#: ../../whatsnew/3.12.rst:2269 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2258 +#: ../../whatsnew/3.12.rst:2272 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." -msgstr "" +msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2261 +#: ../../whatsnew/3.12.rst:2275 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2264 +#: ../../whatsnew/3.12.rst:2278 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3629,325 +3681,348 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2266 +#: ../../whatsnew/3.12.rst:2280 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2268 +#: ../../whatsnew/3.12.rst:2282 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" +"`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2271 +#: ../../whatsnew/3.12.rst:2285 msgid "Several items are not exposed from :file:`Python.h`:" -msgstr "" +msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2273 +#: ../../whatsnew/3.12.rst:2287 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" -msgstr "" +msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2274 +#: ../../whatsnew/3.12.rst:2288 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" -msgstr "" +msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2275 +#: ../../whatsnew/3.12.rst:2289 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." -msgstr "" +msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2276 +#: ../../whatsnew/3.12.rst:2290 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" +"`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2278 +#: ../../whatsnew/3.12.rst:2292 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2281 +#: ../../whatsnew/3.12.rst:2295 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2286 +#: ../../whatsnew/3.12.rst:2300 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2289 +#: ../../whatsnew/3.12.rst:2303 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2294 +#: ../../whatsnew/3.12.rst:2308 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" +":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" +"(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2297 +#: ../../whatsnew/3.12.rst:2311 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" +"``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " +"Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2300 +#: ../../whatsnew/3.12.rst:2314 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2308 +#: ../../whatsnew/3.12.rst:2322 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2325 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2336 +#: ../../whatsnew/3.12.rst:2350 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2339 +#: ../../whatsnew/3.12.rst:2353 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2343 -msgid "Pending Removal in Python 3.15" -msgstr "" - -#: ../../whatsnew/3.12.rst:2345 +#: ../../whatsnew/3.12.rst:2359 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2360 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2347 +#: ../../whatsnew/3.12.rst:2361 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2362 msgid "Python initialization functions:" -msgstr "" +msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2364 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" msgstr "" +":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" +"warnings.filters`" -#: ../../whatsnew/3.12.rst:2352 +#: ../../whatsnew/3.12.rst:2366 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" -msgstr "" +msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2367 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" -msgstr "" +msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2354 +#: ../../whatsnew/3.12.rst:2368 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" -msgstr "" +msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2355 +#: ../../whatsnew/3.12.rst:2369 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2356 +#: ../../whatsnew/3.12.rst:2370 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:2371 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" msgstr "" +":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" +"`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2363 +#: ../../whatsnew/3.12.rst:2377 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." -msgstr "" +msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2366 +#: ../../whatsnew/3.12.rst:2380 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2367 +#: ../../whatsnew/3.12.rst:2381 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:2382 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2369 +#: ../../whatsnew/3.12.rst:2383 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2370 +#: ../../whatsnew/3.12.rst:2384 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" +":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2385 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" -msgstr "" +msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2372 +#: ../../whatsnew/3.12.rst:2386 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" msgstr "" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2373 +#: ../../whatsnew/3.12.rst:2387 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2374 +#: ../../whatsnew/3.12.rst:2388 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2375 +#: ../../whatsnew/3.12.rst:2389 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2376 +#: ../../whatsnew/3.12.rst:2390 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2377 +#: ../../whatsnew/3.12.rst:2391 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" -msgstr "" +msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2378 +#: ../../whatsnew/3.12.rst:2392 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" -msgstr "" +msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2379 +#: ../../whatsnew/3.12.rst:2393 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" -msgstr "" +msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2394 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" +":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2396 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2383 +#: ../../whatsnew/3.12.rst:2397 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2385 +#: ../../whatsnew/3.12.rst:2399 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" -msgstr "" +msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2386 +#: ../../whatsnew/3.12.rst:2400 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" -msgstr "" +msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2387 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" -msgstr "" +msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" -msgstr "" +msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2389 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" +":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2390 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" -msgstr "" +msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2395 +#: ../../whatsnew/3.12.rst:2409 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2400 +#: ../../whatsnew/3.12.rst:2414 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2416 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2417 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2418 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2405 +#: ../../whatsnew/3.12.rst:2419 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2406 +#: ../../whatsnew/3.12.rst:2420 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:2421 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2408 +#: ../../whatsnew/3.12.rst:2422 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2409 +#: ../../whatsnew/3.12.rst:2423 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2410 +#: ../../whatsnew/3.12.rst:2424 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2412 +#: ../../whatsnew/3.12.rst:2426 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" +"`85858` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2415 +#: ../../whatsnew/3.12.rst:2429 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" +"移除數個標準函式庫模組與測試中的 ``Jython`` 相容性修補程式。(由 Nikita " +"Sobolev 於 :gh:`99482` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:2432 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" +"移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " +"旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 0914591a50..615ebdc8c2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -39,7 +39,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:60 msgid "New syntax features:" -msgstr "新的語法特徵:" +msgstr "新增語法特性:" #: ../../whatsnew/3.3.rst:62 msgid "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 2c35922a63..75456d370f 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:80 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.4.rst:82 msgid "No new syntax features were added in Python 3.4." @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:132 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.4.rst:134 msgid "" @@ -790,7 +790,7 @@ msgstr "由 Victor Stinner 撰寫 PEP 與實作" #: ../../whatsnew/3.4.rst:589 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.4.rst:593 msgid "abc" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index d09d5e9665..93350b023b 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -49,7 +49,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.5.rst:62 msgid "" @@ -184,7 +184,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:136 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.5.rst:138 msgid "" @@ -829,7 +829,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:724 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.5.rst:727 msgid "typing" @@ -873,7 +873,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:761 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.5.rst:764 msgid "argparse" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 722a05f71c..05160bd208 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -44,7 +44,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.6.rst:62 msgid ":ref:`PEP 498 `, formatted string literals." @@ -162,7 +162,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:130 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.6.rst:132 msgid "" @@ -916,7 +916,7 @@ msgstr "由 Steven D'Aprano 撰寫 PEP 與實作。" #: ../../whatsnew/3.6.rst:792 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.6.rst:795 msgid "array" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 29981b965a..573273daac 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -40,7 +40,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:58 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.7.rst:60 msgid "" @@ -152,7 +152,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:109 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.7.rst:111 msgid ":ref:`PEP 539 `, new C API for thread-local storage" @@ -854,7 +854,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:619 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.7.rst:623 msgid "argparse" @@ -2321,7 +2321,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1645 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.7.rst:1647 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 40a1f64f79..c7518e2e99 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -686,7 +686,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:543 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.8.rst:545 msgid "" @@ -701,7 +701,7 @@ msgstr "(由 Barry Warsaw 和 Jason R. Coombs 在 :issue:`34632` 中貢獻。 #: ../../whatsnew/3.8.rst:568 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.8.rst:571 msgid "ast" @@ -2106,9 +2106,9 @@ msgstr "" #: ../../whatsnew/3.8.rst:1656 msgid "" -"The :meth:`__getitem__` methods of :class:`xml.dom.pulldom.DOMEventStream`, :" -"class:`wsgiref.util.FileWrapper` and :class:`fileinput.FileInput` have been " -"deprecated." +"The :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput` have been deprecated." msgstr "" #: ../../whatsnew/3.8.rst:1660 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 08cc7c79e0..4b22ebcf8a 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" @@ -85,7 +85,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.9.rst:78 msgid "" @@ -428,7 +428,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.9.rst:328 msgid "ast" @@ -1809,7 +1809,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.9.rst:1275 msgid "" From 72726c24edc684cf56326b4f9d66ab132b685ef2 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Sun, 5 Nov 2023 21:24:24 -0600 Subject: [PATCH 101/105] Update `library/typing` (#691) * Update NewType Section * Finish translate this section * Update with reviewer's suggestion * Update Reviewer's Comment Part 2 * Update library/typing.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/typing.po | 86 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/library/typing.po b/library/typing.po index 8267d8a0bf..f31e587f99 100644 --- a/library/typing.po +++ b/library/typing.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-25 00:03+0000\n" -"PO-Revision-Date: 2023-09-05 14:49+0800\n" +"PO-Revision-Date: 2023-11-06 10:51+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.3.1\n" +"X-Generator: Poedit 3.4\n" #: ../../library/typing.rst:3 msgid ":mod:`typing` --- Support for type hints" @@ -33,7 +33,7 @@ msgid "" "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" -"Python 執行環境不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" +"Python runtime 不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" "型別檢查器、IDE、linter 等。" #: ../../library/typing.rst:26 @@ -357,13 +357,15 @@ msgstr "NewType" #: ../../library/typing.rst:179 msgid "Use the :class:`NewType` helper to create distinct types::" -msgstr "" +msgstr "使用 :class:`NewType` 輔助工具 (helper) 建立獨特型別: ::" #: ../../library/typing.rst:186 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" +"若它是原本型別的子類別,靜態型別檢查器會將其視為一個新的型別。這對於幫助擷取" +"邏輯性錯誤非常有用: ::" #: ../../library/typing.rst:198 msgid "" @@ -372,6 +374,9 @@ msgid "" "pass in a ``UserId`` wherever an ``int`` might be expected, but will prevent " "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" +"你依然可以在對於型別 ``UserId`` 的變數中執行所有 ``int`` 的操作。這讓你可以在" +"預期接受 ``int`` 的地方傳遞一個 ``UserId``,還能預防你意外使用無效的方法建立" +"一個 ``UserId``: ::" #: ../../library/typing.rst:206 msgid "" @@ -381,26 +386,33 @@ msgid "" "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 "" +"注意這只會透過靜態型別檢查器強制檢查。在 runtime 中,陳述式 (statement) " +"``Derived = NewType('Derived', Base)`` 會使 ``Derived`` 成為一個 callable(可" +"呼叫物件),會立即回傳任何你傳遞的引數。這意味著 expression (運算式)" +"``Derived(some_value)`` 不會建立一個新的類別或過度引入原有的函式呼叫。" #: ../../library/typing.rst:212 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" +"更精確地說,expression ``some_value is Derived(some_value)`` 在 runtime 永遠" +"為 true。" #: ../../library/typing.rst:215 msgid "It is invalid to create a subtype of ``Derived``::" -msgstr "" +msgstr "這會無法建立一個 ``Derived`` 的子型別: ::" #: ../../library/typing.rst:224 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" +"無論如何,這有辦法基於 '衍生的' ``NewType`` 建立一個 :class:`NewType`: ::" #: ../../library/typing.rst:232 msgid "and typechecking for ``ProUserId`` will work as expected." -msgstr "" +msgstr "以及針對 ``ProUserId`` 的型別檢查會如期運作。" #: ../../library/typing.rst:234 msgid "See :pep:`484` for more details." @@ -413,6 +425,9 @@ msgid "" "checker treat ``Alias`` as being *exactly equivalent* to ``Original`` in all " "cases. This is useful when you want to simplify complex type signatures." msgstr "" +"請記得使用型別別名是宣告兩種型別是互相\\ *相等*\\ 的。使用 ``type Alias = " +"Original`` 則會讓靜態型別檢查器在任何情況之下將 ``Alias`` 視為與 " +"``Original`` \\ *完全相等*\\ 。這當你想把複雜的型別簽名進行簡化時,非常好用。" #: ../../library/typing.rst:243 msgid "" @@ -423,6 +438,11 @@ msgid "" "``Derived`` is expected. This is useful when you want to prevent logic " "errors with minimal runtime cost." msgstr "" +"相反的,``NewType`` 宣告一個型別會是另外一種型別的子類別。使用 ``Derived = " +"NewType('Derived', Original)`` 會使靜態型別檢查器將 ``Derived`` 視為 " +"``Original`` 的子類別,也意味著一個型別為 ``Original`` 的值,不能被使用在任何" +"預期接收到型別 ``Derived`` 的值的區域。這當你想用最小的 runtime 成本預防邏輯" +"性錯誤而言,非常有用。" #: ../../library/typing.rst:252 msgid "" @@ -430,16 +450,18 @@ msgid "" "some additional runtime cost when calling ``NewType`` over a regular " "function." msgstr "" +"現在的 ``NewType`` 比起一個函式更像一個類別。因此,比起一般的函式,呼叫 " +"``NewType`` 需要額外的 runtime 成本。" #: ../../library/typing.rst:257 msgid "" "The performance of calling ``NewType`` has been restored to its level in " "Python 3.9." -msgstr "" +msgstr "呼叫 ``NewType`` 的效能已經恢復與 Python 3.9 相同的水準。" #: ../../library/typing.rst:264 msgid "Annotating callable objects" -msgstr "" +msgstr "註釋 callable 物件" #: ../../library/typing.rst:266 msgid "" @@ -448,6 +470,9 @@ msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" +"函式,或者是其他 :term:`callable` 物件,可以使用 :class:`collections.abc." +"Callable` 或 :data:`typing.Callable` 進行註釋。 ``Callable[[int], str]`` 象徵" +"為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :class:`str`。" #: ../../library/typing.rst:271 ../../library/typing.rst:2894 #: ../../library/typing.rst:3036 @@ -461,12 +486,17 @@ msgid "" "types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " "type must be a single type." msgstr "" +"使用下標語法 (subscription syntax) 時,必須使用到兩個值,分別為引述串列以及回" +"傳類別。引數串列必須為一個型別串列::class:`ParamSpec`、:data:`Concatenate` " +"或是一個刪節號 (ellipsis)。回傳類別必為一個單一類別。" #: ../../library/typing.rst:294 msgid "" "If a literal ellipsis ``...`` is given as the argument list, it indicates " "that a callable with any arbitrary parameter list would be acceptable:" msgstr "" +"若刪節號文字 ``...`` 被當作引數串列給定,其指出一個具任何、任意參數列表的 " +"callable 會被接受: ::" #: ../../library/typing.rst:306 msgid "" @@ -476,6 +506,10 @@ msgid "" "be expressed by defining a :class:`Protocol` class with a :meth:`~object." "__call__` method:" msgstr "" +"``Callable`` 不如有可變數量引數的函式、:func:`overloaded functions " +"`、或是僅限關鍵字參數的函式,可以表示複雜簽名。然而,這些簽名可以透" +"過定義一個具有 :meth:`~object.__call__` 方法的 :class:`Protocol` 類別進行表" +"示:" #: ../../library/typing.rst:333 msgid "" @@ -487,22 +521,32 @@ msgid "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` respectively." msgstr "" +"Callable 物件可以取用其他 callable 當作引數使用,可以透過 :class:`ParamSpec` " +"指出他們的參數型別是個別獨立的。另外,如果這個 callable 從其他 callable 新增" +"或刪除引數時,將會使用到 :data:`Concatenate` 運算子。他們可以分別採用 " +"``Callable[ParamSpecVariable, ReturnType]`` 以及 " +"``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " +"ReturnType]`` 的形式。" #: ../../library/typing.rst:341 ../../library/typing.rst:3565 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" +"``Callable`` 現已支援 :class:`ParamSpec` 以及 :data:`Concatenate`。請參閱 :" +"pep:`612` 閱讀詳細內容。" #: ../../library/typing.rst:346 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" +":class:`ParamSpec` 以及 :class:`Concatenate` 的文件中,提供範例如何在 " +"``Callable`` 中使用。" #: ../../library/typing.rst:352 msgid "Generics" -msgstr "" +msgstr "泛型" #: ../../library/typing.rst:354 msgid "" @@ -510,30 +554,37 @@ msgid "" "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" +"因為關於物件的型別資訊留存在容器之內,且無法使用通用的方式進行靜態推論 " +"(statically inferred),許多標準函式庫的容器類別支援以下標來表示容器內預期的元" +"素。" #: ../../library/typing.rst:371 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" msgstr "" +"泛型函式及類別可以使用\\ :ref:`型別參數語法 (type parameter syntax) ` 進行參數化 (parameterize) : ::" #: ../../library/typing.rst:379 msgid "Or by using the :class:`TypeVar` factory directly::" -msgstr "" +msgstr "或是直接使用 :class:`TypeVar` 工廠 (factory): ::" #: ../../library/typing.rst:389 msgid "Syntactic support for generics is new in Python 3.12." -msgstr "" +msgstr "在 Python 3.12 中,泛型的語法支援是全新功能。" #: ../../library/typing.rst:395 msgid "Annotating tuples" -msgstr "" +msgstr "註釋元組 (tuple)" #: ../../library/typing.rst:397 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" +"在 Python 大多數的容器當中,加註型別系統認為容器內的所有元素會是相同型別。舉" +"例來說: ::" #: ../../library/typing.rst:412 msgid "" @@ -542,6 +593,10 @@ msgid "" "Mapping` only accepts two type arguments: the first indicates the type of " "the keys, and the second indicates the type of the values." msgstr "" +":class:`list` 只接受一個型別引數,所以型別檢查器可能在上述 ``y`` 賦值 " +"(assignment) 觸發錯誤。類似的範例,:class:`~collections.abc.Mapping` 只接受兩" +"個型別引數:第一個引數指出 keys(鍵)的型別;第二個引數指出 values(值)的型" +"別。" #: ../../library/typing.rst:418 msgid "" @@ -550,6 +605,10 @@ msgid "" "For this reason, tuples are special-cased in Python's typing system. :class:" "`tuple` accepts *any number* of type arguments::" msgstr "" +"然而,與其他多數的 Python 容器不同,在慣用的 (idiomatic) Python 程式碼中,元" +"組可以擁有不完全相同型別的元素是相當常見的。為此,元組在 Python 的加註型別系" +"統中是個特例 (special-cased)。:class:`tuple` 接受\\ *任何數量*\\ 的型別引" +"數: ::" #: ../../library/typing.rst:434 msgid "" @@ -558,6 +617,9 @@ msgid "" "use ``tuple[()]``. Using plain ``tuple`` as an annotation is equivalent to " "using ``tuple[Any, ...]``::" msgstr "" +"為了標示一個元組可以為\\ *任意*\\ 長度,且所有元素皆是相同型別 ``T``,請使用 " +"``tuple[T, ...]`` 進行標示。為了標示一個空元組,請使用 ``tuple[()]``。單純使" +"用 ``tuple`` 作為註釋,會與使用 ``tuple[Any, ...]`` 是相等的: ::" #: ../../library/typing.rst:457 msgid "The type of class objects" From 02d46f1e0e281652464a1b126b47a040683ad07c Mon Sep 17 00:00:00 2001 From: neo <71454430+neo-maker-sudo@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:17:05 +0800 Subject: [PATCH 102/105] feat(translate): wsgiref.po (#641) * docs(wsgiref): add partial document translation from english to traditional chinese from rst:87 to rst:845 * docs(wsgiref): modified wsgiref.po for formatting via powrap library * docs(wsgiref): modified format issue at rst:250, rst:260, rst:816, rst:845 * docs(wsgiref): modified sphinx rst syntax issue * docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue * docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue part 2 --------- Co-authored-by: neochang --- library/wsgiref.po | 283 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 257 insertions(+), 26 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 0c898ef064..599513b00f 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -84,7 +84,7 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGI 環境是一個包含 HTTP 請求變" "數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " "WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." "WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" @@ -161,7 +161,7 @@ msgid "" "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" "通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" -"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"式會修改傳入的環境,使其適用於呼叫位於目標 URI 的 WSGI 應用程式。例如,如果" "在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" "於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " "\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" @@ -220,13 +220,15 @@ msgstr "" msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" -msgstr "" +msgstr "除了上述的環境功能外,:mod:`wsgiref.util` 模組還提供以下各類工具:" #: ../../library/wsgiref.rst:152 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." msgstr "" +"如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭," +"則回傳 ``True``。" #: ../../library/wsgiref.rst:158 msgid "" @@ -237,6 +239,10 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" +":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換" +"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選" +"的 *blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生(yield)的" +"位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 msgid "" @@ -244,20 +250,24 @@ msgid "" "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" "`close` method when called." msgstr "" +"如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" +"法,並在呼叫時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`~object.__getitem__` method has been removed." -msgstr "" +msgid "Support for :meth:`__getitem__` method has been removed." +msgstr "已移除對 :meth:`__getitem__` 方法的支援。" #: ../../library/wsgiref.rst:187 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" -msgstr "" +msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具。" #: ../../library/wsgiref.rst:193 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." msgstr "" +"這個模組提供單一類別 :class:`Headers`,用於使用類似對映的介面方便地操作 WSGI " +"回應標頭。" #: ../../library/wsgiref.rst:199 msgid "" @@ -265,6 +275,8 @@ msgid "" "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" +"建立一個類似對映物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" +"value 元組的標頭串列。*headers* 的預設值是一個空串列。" #: ../../library/wsgiref.rst:203 msgid "" @@ -277,6 +289,12 @@ msgid "" "the end of the wrapped header list. Headers' existing order is generally " "maintained, with new headers added to the end of the wrapped list." msgstr "" +":class:`Headers` 物件支援典型對映操作包括 :meth:`__getitem__`、:meth:`get`、:" +"meth:`__setitem__`、:meth:`setdefault`、:meth:`__delitem__` 以及 :meth:" +"`__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不區分大小寫方式處" +"理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值," +"然後將新值添加到包裝的標頭串列末尾。標頭的現有順序通常保持不變,新標頭會添加" +"到包裝串列的末尾。" #: ../../library/wsgiref.rst:212 msgid "" @@ -285,6 +303,9 @@ msgid "" "nonexistent header just returns ``None``, and deleting a nonexistent header " "does nothing." msgstr "" +"不同於字典,當你嘗試取得或刪除包裝的標頭串列不存在的鍵,:class:`Headers` 物件" +"不會引發例外錯誤。取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會" +"有任何效果。" #: ../../library/wsgiref.rst:217 msgid "" @@ -296,6 +317,10 @@ msgid "" "In fact, the :meth:`items` method just returns a copy of the wrapped header " "list." msgstr "" +":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方" +"法。由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同" +"的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" +"標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" #: ../../library/wsgiref.rst:224 msgid "" @@ -305,6 +330,9 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" +"對 :class:`Header` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" +"式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" +"車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" #: ../../library/wsgiref.rst:230 msgid "" @@ -312,10 +340,12 @@ msgid "" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" +"除了對映介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" +"的以及附加 MIME 參數標頭的方法:" #: ../../library/wsgiref.rst:237 msgid "Return a list of all the values for the named header." -msgstr "" +msgstr "回傳指定標頭的所有值的串列。" #: ../../library/wsgiref.rst:239 msgid "" @@ -324,12 +354,16 @@ msgid "" "fields deleted and re-inserted are always appended to the header list. If " "no fields exist with the given name, returns an empty list." msgstr "" +"回傳的串列按照它們在在原始的標頭串列出現的順序或是被添加到此實例的順序進行排" +"序,並且可能包含重複的內容。任何被刪除並重新插入的欄位都會被添加到標頭串列的" +"末尾。如果不存在指定名稱的欄位,則回傳空串列。" #: ../../library/wsgiref.rst:247 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." msgstr "" +"添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" #: ../../library/wsgiref.rst:250 msgid "" @@ -342,18 +376,23 @@ msgid "" "only the parameter name is added. (This is used for MIME parameters without " "a value.) Example usage::" msgstr "" +"*name* 是要添加的標頭欄位。關鍵字引數可使於設定標頭欄位的 MIME 參數。每一個參" +"數必須是字串或是 ``None``。由於破折號在 Python 識別符中是非法的,但是許多 " +"MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。如果參數值是字串," +"則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" +"參數名稱。(這使用於沒有值的 MIME 參數)使用範例: ::" #: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" -msgstr "" +msgstr "上述操作將添加看起來像這樣的標頭: ::" #: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." -msgstr "" +msgstr "*headers* 參數是可選的。" #: ../../library/wsgiref.rst:270 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" -msgstr "" +msgstr ":mod:`wsgiref.simple_server` -- 一個簡單的 WSGI HTTP 伺服器" #: ../../library/wsgiref.rst:276 msgid "" @@ -365,6 +404,11 @@ msgid "" "request. (E.g., using the :func:`shift_path_info` function from :mod:" "`wsgiref.util`.)" msgstr "" +"這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " +"應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" +"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI 應用程式以剖析 " +"``PATH_INFO`` 去選擇為每個請求呼叫哪個應用程式。(例如,使用來自 :mod:" +"`wsgiref.util` 的 :func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 msgid "" @@ -374,6 +418,9 @@ msgid "" "*handler_class*. *app* must be a WSGI application object, as defined by :" "pep:`3333`." msgstr "" +"建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提" +"供 *server_class* 的實例,並將使用指定的 *handler_class* 處理請求。*app* 必須" +"是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" #: ../../library/wsgiref.rst:308 msgid "" @@ -383,6 +430,10 @@ msgid "" "WSGI server (such as :mod:`wsgiref.simple_server`) is able to run a simple " "WSGI application correctly." msgstr "" +"這個函式是一個簡單但完整的 WSGI 應用程式,它回傳一個包含訊息 \"Hello world!" +"\" 和在 *environ* 參數中提供的鍵值對串列的文字頁面。這對於驗證 WSGI 伺服器" +"(例如 :mod:`wsgiref.simple_server`)是否能正確執行簡單的 WSGI 應用程式非常有" +"用。" #: ../../library/wsgiref.rst:317 msgid "" @@ -390,12 +441,17 @@ msgid "" "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" "`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" +"建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, " +"port)`` 元組,而 *RequestHandlerClass* 應該是 :class:`http.server." +"BaseHTTPRequestHandler` 的子類別,將用於處理請求。" #: ../../library/wsgiref.rst:322 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" +"通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可以為你處理所有細" +"節。" #: ../../library/wsgiref.rst:325 msgid "" @@ -403,16 +459,19 @@ msgid "" "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" +":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有" +"方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" +"`WSGIServer` 也提供這些特定於 WSGI 的方法:" #: ../../library/wsgiref.rst:332 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." -msgstr "" +msgstr "將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" #: ../../library/wsgiref.rst:338 msgid "Returns the currently set application callable." -msgstr "" +msgstr "回傳目前設定應用程式的可呼叫物件。" #: ../../library/wsgiref.rst:340 msgid "" @@ -420,6 +479,9 @@ msgid "" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " "exists mainly for the benefit of request handler instances." msgstr "" +"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :" +"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式(handler)實" +"例的好處上。" #: ../../library/wsgiref.rst:347 msgid "" @@ -427,6 +489,9 @@ msgid "" "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" "`WSGIServer` instance)." msgstr "" +"為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` " +"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" +"(handler)。" #: ../../library/wsgiref.rst:350 msgid "" @@ -436,6 +501,9 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" +"你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" +"立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :func:" +"`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -446,12 +514,17 @@ msgid "" "return a new dictionary containing all of the relevant CGI environment " "variables as specified in :pep:`3333`." msgstr "" +"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。預設的實作會" +"複製 :class:`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加" +"從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" +"`3333` 所指定的相關 CGI 環境變數的新字典。" #: ../../library/wsgiref.rst:370 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" +"回傳的物件應該被用作 ``wsgi.errors`` 串流。預設實作只會回傳 ``sys.stderr``。" #: ../../library/wsgiref.rst:376 msgid "" @@ -459,10 +532,12 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" +"處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handler` 類別來建立處置程式" +"(handler)實例來實作實際 WSGI 應用程式介面。" #: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" -msgstr "" +msgstr ":mod:`wsgiref.validate` --- WSGI 符合性檢查" #: ../../library/wsgiref.rst:388 msgid "" @@ -473,6 +548,10 @@ msgid "" "gateway and a WSGI application object, to check both sides for protocol " "conformance." msgstr "" +"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體(middleware)時,使" +"用 :mod:`wsgiref.validate` 來驗證新程式碼的符合性可能會很有用。這個模組提供一" +"個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用" +"程式物件之間的通訊,以檢查雙方協議的符合性。" #: ../../library/wsgiref.rst:395 msgid "" @@ -482,12 +561,17 @@ msgid "" "virtually certain that either the server or application is not 100% " "compliant." msgstr "" +"請注意這個工具並不保證完全符合 :pep:`3333`;這個模組中的錯誤不一定代表不存在" +"錯誤。但是,如果如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 " +"100% 符合標準。" #: ../../library/wsgiref.rst:400 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." msgstr "" +"這個模組基於 Ian Bicking 的 \"Python Paste\" 函式庫的 :mod:`paste.lint` 模" +"組。" #: ../../library/wsgiref.rst:406 msgid "" @@ -496,6 +580,9 @@ msgid "" "will check that both the *application* and the server invoking it are " "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" +"包裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有" +"請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " +"WSGI 規範和 :rfc:`2616`。" #: ../../library/wsgiref.rst:411 msgid "" @@ -507,6 +594,11 @@ msgid "" "occurred, and dump the traceback to ``sys.stderr`` or some other error " "stream." msgstr "" +"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;但請注意,如何處理" +"這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref." +"simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅" +"輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 ``sys.stderr`` 或是其他錯" +"誤串流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -517,10 +609,14 @@ msgid "" "to ``sys.stderr`` (*not* ``wsgi.errors``, unless they happen to be the same " "object)." msgstr "" +"這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" +"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項或 :mod:" +"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``(*not* " +"``wsgi.errors``,除非它們碰巧是相同的物件)。" #: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" -msgstr "" +msgstr ":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" #: ../../library/wsgiref.rst:456 msgid "" @@ -529,6 +625,9 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處理程式(handler)類別。這些基底類別" +"處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" +"輸入、輸出和錯誤串流。" #: ../../library/wsgiref.rst:464 msgid "" @@ -537,6 +636,10 @@ msgid "" "run it as a CGI script. Simply invoke ``CGIHandler().run(app)``, where " "``app`` is the WSGI application object you wish to invoke." msgstr "" +"這是基於 CGI 的呼叫方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` " +"和 ``os.environ``。當你擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是" +"很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望呼叫的 " +"WSGI 應用程式物件。" #: ../../library/wsgiref.rst:469 msgid "" @@ -545,6 +648,9 @@ msgid "" "to true, and always uses :mod:`sys` and :mod:`os` to obtain the necessary " "CGI streams and environment." msgstr "" +"這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," +"``wsgi.multithread``設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" +"且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 串流以及環境。" #: ../../library/wsgiref.rst:477 msgid "" @@ -552,6 +658,9 @@ msgid "" "Microsoft's IIS web server, without having set the config allowPathInfo " "option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7)." msgstr "" +"這是用於在 Microsoft 的 IIS 網頁伺服器上部署時使用的 :class:`CGIHandler` 的一" +"個專門替代選擇,無需設置 config 的 allowPathInfo 選項(IIS>=7),或 metabase " +"的 allowPathInfoForScriptMappings 選項(IIS<7)。" #: ../../library/wsgiref.rst:481 msgid "" @@ -559,6 +668,9 @@ msgid "" "the front, causing problems for WSGI applications that wish to implement " "routing. This handler strips any such duplicated path." msgstr "" +"預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實" +"作路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" +"徑。" #: ../../library/wsgiref.rst:485 msgid "" @@ -570,6 +682,11 @@ msgid "" "IIS<7 is almost never deployed with the fix (Even IIS7 rarely uses it " "because there is still no UI for it.)." msgstr "" +"IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤" +"的問題。幸運的是這個變數很少被使用並且不受 WSGI 保證。然而,在 IIS<7 上,這個" +"設置只能在虛擬主機層級進行,影響所有其他腳本的對映,其中許多在暴露 " +"``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" +"使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" #: ../../library/wsgiref.rst:493 msgid "" @@ -578,6 +695,9 @@ msgid "" "`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " "is the WSGI application object you wish to invoke." msgstr "" +"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處理程式(handler)類" +"別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 ``IISCGIHandler()." +"run(app)`` 來使用,其中 ``app`` 是你希望呼叫的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 msgid "" @@ -587,6 +707,9 @@ msgid "" "multithread`` and ``wsgi.multiprocess`` flags for any applications run by " "the handler instance." msgstr "" +"類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確" +"指定 CGI 環境與 I/O 串流。*multithread* 和 *multiprocess* 值用於設置由處理程" +"式(handler)實例運行的任何應用程式的旗標。" #: ../../library/wsgiref.rst:509 msgid "" @@ -596,6 +719,10 @@ msgid "" "``Status:`` header to send an HTTP status, you probably want to subclass " "this instead of :class:`SimpleHandler`." msgstr "" +"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:" +"`SimpleHandler` 的子類別。如果你正在撰寫一個使用 ``Status:`` 標頭來發送 HTTP " +"狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別" +"來替代 :class:`SimpleHandler`。" #: ../../library/wsgiref.rst:518 msgid "" @@ -603,6 +730,9 @@ msgid "" "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" +"類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正" +"在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替代 :class:" +"`BaseCGIHandler`。" #: ../../library/wsgiref.rst:522 msgid "" @@ -613,12 +743,19 @@ msgid "" "streams are stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, " "and :attr:`environ` attributes." msgstr "" +"這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:" +"`__init__`、:meth:`get_stdin`、:meth:`get_stderr`、:meth:`add_cgi_vars`、:" +"meth:`_write`、和 :meth:`_flush` 方法來明確提供設置環境與串流。提供的環境與串" +"流被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` " +"環境中。" #: ../../library/wsgiref.rst:529 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." msgstr "" +"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊(chunk),像是 :" +"class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 msgid "" @@ -626,16 +763,18 @@ msgid "" "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" +"這是一個運行 WSGI 應用程式的抽象基底類別。每個實例將處理單個 HTTP 請求,儘管" +"原則上你可以建立一個可重用於多個請求的子類別。" #: ../../library/wsgiref.rst:539 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" -msgstr "" +msgstr ":class:`BaseHandler` 實例只有一個供外部使用的方法:" #: ../../library/wsgiref.rst:544 msgid "Run the specified WSGI application, *app*." -msgstr "" +msgstr "運行指定 WSGI 應用程式,*app*。" #: ../../library/wsgiref.rst:546 msgid "" @@ -643,10 +782,12 @@ msgid "" "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" +"此方法在運行應用程式的過程中呼叫了所有其他 :class:`BaseHandler` 的方法,因此" +"這些方法主要存在是為了允許自定義整個過程。" #: ../../library/wsgiref.rst:550 msgid "The following methods MUST be overridden in a subclass:" -msgstr "" +msgstr "以下方法必須在子類別中覆寫:" #: ../../library/wsgiref.rst:555 msgid "" @@ -655,12 +796,17 @@ msgid "" "write and flush operations for greater efficiency when the underlying system " "actually has such a distinction." msgstr "" +"緩衝要傳送給用戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當" +"底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" +"刷新操作。" #: ../../library/wsgiref.rst:563 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" +"強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如果 :" +"meth:`_write` 實際上發送了數據),那麼是可以的。" #: ../../library/wsgiref.rst:569 msgid "" @@ -668,6 +814,8 @@ msgid "" "suitable for use as the ``wsgi.input`` of the request currently being " "processed." msgstr "" +"回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.input``。" #: ../../library/wsgiref.rst:576 msgid "" @@ -675,12 +823,14 @@ msgid "" "suitable for use as the ``wsgi.errors`` of the request currently being " "processed." msgstr "" +"回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.errors``。" #: ../../library/wsgiref.rst:583 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." -msgstr "" +msgstr "將當前請求的 CGI 變數插入到 :attr:`environ` 屬性中。" #: ../../library/wsgiref.rst:585 msgid "" @@ -690,10 +840,13 @@ msgid "" "additional information before attempting to create a customized :class:" "`BaseHandler` subclass." msgstr "" +"以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以" +"被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,你應該" +"參考文件說明和原始碼以獲得更多資訊。" #: ../../library/wsgiref.rst:591 msgid "Attributes and methods for customizing the WSGI environment:" -msgstr "" +msgstr "用於自定義 WSGI 環境的屬性和方法:" #: ../../library/wsgiref.rst:596 msgid "" @@ -701,6 +854,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -708,6 +863,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -715,6 +872,8 @@ msgid "" "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " "to true by default." msgstr "" +"用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," +"但 :class:`CGIHandler` 預設將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -725,6 +884,9 @@ msgid "" "considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" +"預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載入 :mod:" +"`wsgiref.handlers` 時的 `os.environ` 副本,但子類別可以在類別或實例層級建立自" +"己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -734,12 +896,17 @@ msgid "" "for handlers (such as :class:`BaseCGIHandler` and :class:`CGIHandler`) that " "are not HTTP origin servers." msgstr "" +"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置預設的 " +"``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的預設 " +"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例如 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" #: ../../library/wsgiref.rst:633 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." msgstr "" +"將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" #: ../../library/wsgiref.rst:639 msgid "" @@ -748,6 +915,9 @@ msgid "" "util` to guess whether the scheme should be \"http\" or \"https\", based on " "the current request's :attr:`environ` variables." msgstr "" +"回傳用於當前請求的 URL scheme。預設的實作使用 :mod:`wsgiref.util` 中的 :func:" +"`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" +"attr:`environ` 變數。" #: ../../library/wsgiref.rst:647 msgid "" @@ -758,10 +928,15 @@ msgid "" "``SERVER_SOFTWARE`` key if not present, as long as the :attr:`origin_server` " "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" +"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。預設的實作使用上述所有方法" +"和屬性,以及 :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方" +"法以及 :attr:`wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 " +"``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" +"且 :attr:`server_software` 屬性被設置。" #: ../../library/wsgiref.rst:654 msgid "Methods and attributes for customizing exception handling:" -msgstr "" +msgstr "用於自定義例外處理的屬性和方法:" #: ../../library/wsgiref.rst:659 msgid "" @@ -772,18 +947,26 @@ msgid "" "traceback to an administrator, or whatever other action may be deemed " "suitable." msgstr "" +"將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, " +"traceback)`` 元組。預設實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 串流中" +"並刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" +"員,或執行其他被認為合適的操作。" #: ../../library/wsgiref.rst:668 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." msgstr "" +"預設的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," +"則包含所有幀。" #: ../../library/wsgiref.rst:674 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." msgstr "" +"這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給用戶端" +"前如果發生錯誤才會被呼叫。" #: ../../library/wsgiref.rst:677 msgid "" @@ -791,6 +974,8 @@ msgid "" "should pass that information to *start_response* when calling it (as " "described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" +"此方法使用 ``sys.exception()`` 存取當前的錯誤,當呼叫它(如 :pep:`3333` 的 " +"\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。" #: ../../library/wsgiref.rst:681 msgid "" @@ -798,6 +983,8 @@ msgid "" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" +"預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" +"`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" #: ../../library/wsgiref.rst:685 msgid "" @@ -806,12 +993,16 @@ msgid "" "special to enable diagnostic output, which is why the default implementation " "doesn't include any." msgstr "" +"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,你應該需" +"要採取特殊措施才能啟用診斷輸出,這就是預設實作不包括任何診斷資訊的原因。" #: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." msgstr "" +"用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;預設" +"為 500 狀態碼和訊息。" #: ../../library/wsgiref.rst:699 msgid "" @@ -819,6 +1010,9 @@ msgid "" "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " "The default list just sets the content type to ``text/plain``." msgstr "" +"用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, " +"value)`` 元組),如 :pep:`3333` 中所描述。預設串列只設置內容種類為 ``text/" +"plain``。" #: ../../library/wsgiref.rst:706 msgid "" @@ -826,12 +1020,16 @@ msgid "" "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" +"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " +"server error occurred. Please contact the administrator.\"" #: ../../library/wsgiref.rst:710 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" msgstr "" +"用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法" +"和屬性:" #: ../../library/wsgiref.rst:716 msgid "" @@ -839,6 +1037,9 @@ msgid "" "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" +"一個 ``wsgi.file_wrapper`` 工廠函式(factory),與 :class:`wsgiref.types." +"FileWrapper` 相容,或者為 ``None``。這個屬性的預設值是 :class:`wsgiref.util." +"FileWrapper` 類別。" #: ../../library/wsgiref.rst:723 msgid "" @@ -849,10 +1050,14 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程式的回傳值是由 :attr:" +"`wsgi_file_wrapper` 屬性指定的類別實例時才會呼叫此方法。如果它能夠成功傳輸檔" +"案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作只回傳一" +"個 false 值。" #: ../../library/wsgiref.rst:730 msgid "Miscellaneous methods and attributes:" -msgstr "" +msgstr "其他方法和屬性:" #: ../../library/wsgiref.rst:735 msgid "" @@ -861,18 +1066,25 @@ msgid "" "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" +"這個屬性應該被設置為 true 值,如果處理程式(handler)的 :meth:`_write` 和 :" +"meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協議希望 " +"HTTP 狀態在特殊的 ``Status:`` 標頭中。" #: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" +"這個屬性在 :class:`BaseCGIHandler` 預設值為 true,但是在 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" #: ../../library/wsgiref.rst:746 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" +"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給用戶端的回應的 " +"HTTP 版本。預設為 ``\"1.0\"``。" #: ../../library/wsgiref.rst:752 msgid "" @@ -885,6 +1097,12 @@ msgid "" "bytes, but the system encoding used by Python to decode it is anything other " "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" +"從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字" +"串,並回傳一個新字典。這個函式被 :class:`CGIHandler` 和 :class:" +"`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台和使用 Python 3 的網" +"頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 " +"Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼" +"不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" #: ../../library/wsgiref.rst:761 msgid "" @@ -892,42 +1110,50 @@ msgid "" "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" +"如果你自己正在實作 CGI-based 處理程式(handler),你可能想要使用這個函式來替" +"換單純直接從 ``os.environ`` 中複製值。" #: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" -msgstr "" +msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別。" #: ../../library/wsgiref.rst:775 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." -msgstr "" +msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型別檢查的型別。" #: ../../library/wsgiref.rst:783 msgid "" "A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." msgstr "" +"一個描述 `start_response() `_ 可呼叫物件的 :class:`typing.Protocol` (:pep:`3333`)。" #: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." -msgstr "" +msgstr "一個描述 WSGI 環境字典的型別別名。" #: ../../library/wsgiref.rst:793 msgid "A type alias describing a WSGI application callable." -msgstr "" +msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" #: ../../library/wsgiref.rst:797 msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" +"一個描述 `WSGI 輸入串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" +"一個描述 `WSGI 錯誤串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:807 msgid "" @@ -935,6 +1161,9 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" +"一個描述\\ `檔案包裝器 `_\\ 的 :class:`typing.Protocol`。請參閱 :class:" +"`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" #: ../../library/wsgiref.rst:814 msgid "Examples" @@ -942,10 +1171,12 @@ msgstr "範例" #: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" -msgstr "" +msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式: ::" #: ../../library/wsgiref.rst:845 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" msgstr "" +"提供當前目錄的 WSGI 應用程式範例,並接受命令列上的可選目錄和埠號(預設:" +"8000): ::" From 430edde50b362ec6c7694426042b48081ebd6755 Mon Sep 17 00:00:00 2001 From: Becca <61359625+Tzu-Han5667@users.noreply.github.com> Date: Tue, 7 Nov 2023 06:39:39 +0800 Subject: [PATCH 103/105] 1106_stdtypes_3&4 (#697) * 1106_stdtypes_ & * 1106_stdtypes_3&4_v2 * 1106_stdtypes_3&4_v3 * 1106_stdtypes_3&4_v4 * 1107_stdtypes_3&4_v5 * 1107_stdtypes_3&4_v6 --- library/stdtypes.po | 65 +++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index bbf06b1866..a756d68e37 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -114,18 +114,18 @@ msgstr "" #: ../../library/stdtypes.rst:78 msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -msgstr "" +msgstr "Boolean(布林)運算 --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" #: ../../library/stdtypes.rst:82 msgid "These are the Boolean operations, ordered by ascending priority:" -msgstr "" +msgstr "下方為 Boolean 運算,按優先順序排序:" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 #: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 #: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 #: ../../library/stdtypes.rst:1166 msgid "Operation" -msgstr "" +msgstr "運算" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 @@ -146,7 +146,7 @@ msgstr "``x or y``" #: ../../library/stdtypes.rst:87 msgid "if *x* is true, then *x*, else *y*" -msgstr "" +msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 #: ../../library/stdtypes.rst:963 ../../library/stdtypes.rst:966 @@ -161,7 +161,7 @@ msgstr "``x and y``" #: ../../library/stdtypes.rst:90 msgid "if *x* is false, then *x*, else *y*" -msgstr "" +msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 #: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1205 @@ -176,7 +176,7 @@ msgstr "``not x``" #: ../../library/stdtypes.rst:93 msgid "if *x* is false, then ``True``, else ``False``" -msgstr "" +msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:975 #: ../../library/stdtypes.rst:1208 ../../library/stdtypes.rst:2430 @@ -199,22 +199,28 @@ msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is false." msgstr "" +"這是一個短路運算子,所以他只有在第一個變數為假時," +"才會對第二個變數求值。" #: ../../library/stdtypes.rst:109 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is true." msgstr "" +"這是一個短路運算子,所以他只有在第一個變數為真時," +"才會對第二個變數求值。" #: ../../library/stdtypes.rst:113 msgid "" "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` " "is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." msgstr "" +"``not`` 比非 Boolean 運算子有較低的優先權,因此 ``not a == b`` " +"可直譯為 ``not (a == b)``,而 ``a == not b`` 會導致語法錯誤。" #: ../../library/stdtypes.rst:120 msgid "Comparisons" -msgstr "" +msgstr "比較運算" #: ../../library/stdtypes.rst:134 msgid "" @@ -224,16 +230,21 @@ msgid "" "< y and y <= z``, except that *y* is evaluated only once (but in both cases " "*z* is not evaluated at all when ``x < y`` is found to be false)." msgstr "" +"在 Python 裡共有 8 種比較運算。他們的優先順序都相同" +"(皆優先於 Boolean 運算)。比較運算" +"可以任意的串連;例如,``x < y <= z`` 等同於 " +"``x < y and y <= z``,差異只在於前者的 *y* 只有被求值一次(但在這兩個例子" +"中,當 ``x < y`` 為假時,*z* 皆不會被求值)。" #: ../../library/stdtypes.rst:140 msgid "This table summarizes the comparison operations:" -msgstr "" +msgstr "這個表格統整所有比較運算:" #: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2393 #: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3611 #: ../../library/stdtypes.rst:3634 msgid "Meaning" -msgstr "" +msgstr "含義" #: ../../library/stdtypes.rst:145 msgid "``<``" @@ -241,7 +252,7 @@ msgstr "``<``" #: ../../library/stdtypes.rst:145 msgid "strictly less than" -msgstr "" +msgstr "小於" #: ../../library/stdtypes.rst:147 msgid "``<=``" @@ -249,7 +260,7 @@ msgstr "``<=``" #: ../../library/stdtypes.rst:147 msgid "less than or equal" -msgstr "" +msgstr "小於等於" #: ../../library/stdtypes.rst:149 msgid "``>``" @@ -257,7 +268,7 @@ msgstr "``>``" #: ../../library/stdtypes.rst:149 msgid "strictly greater than" -msgstr "" +msgstr "大於" #: ../../library/stdtypes.rst:151 msgid "``>=``" @@ -265,7 +276,7 @@ msgstr "``>=``" #: ../../library/stdtypes.rst:151 msgid "greater than or equal" -msgstr "" +msgstr "大於等於" #: ../../library/stdtypes.rst:153 msgid "``==``" @@ -273,7 +284,7 @@ msgstr "``==``" #: ../../library/stdtypes.rst:153 msgid "equal" -msgstr "" +msgstr "等於" #: ../../library/stdtypes.rst:155 msgid "``!=``" @@ -281,7 +292,7 @@ msgstr "``!=``" #: ../../library/stdtypes.rst:155 msgid "not equal" -msgstr "" +msgstr "不等於" #: ../../library/stdtypes.rst:157 msgid "``is``" @@ -289,7 +300,7 @@ msgstr "``is``" #: ../../library/stdtypes.rst:157 msgid "object identity" -msgstr "" +msgstr "物件識別" #: ../../library/stdtypes.rst:159 msgid "``is not``" @@ -297,7 +308,7 @@ msgstr "``is not``" #: ../../library/stdtypes.rst:159 msgid "negated object identity" -msgstr "" +msgstr "否定的物件識別" #: ../../library/stdtypes.rst:166 msgid "" @@ -308,12 +319,20 @@ msgid "" "example, they raise a :exc:`TypeError` exception when one of the arguments " "is a complex number." msgstr "" +"除了不同的數字型別外,不同型別的物件不能進行相等比較。" +"運算子 ``==`` 總有定義,但在某些物件類型(例如, " +"class 物件)時,運算子會等同於 :keyword:`is`。 其他運算子 ``<``、``<=``、" +"``>`` 及 ``>=`` 皆僅在有意義的部分有所定義;例如," +"當其中一個引數為複數時," +"將引發一個 :exc:`TypeError` 的例外。" #: ../../library/stdtypes.rst:180 msgid "" "Non-identical instances of a class normally compare as non-equal unless the " "class defines the :meth:`~object.__eq__` method." msgstr "" +"一個 class 的非相同實例通常會比較為不相等,除非 " +"class 有定義 :meth:`~object.__eq__` method。" #: ../../library/stdtypes.rst:183 msgid "" @@ -324,6 +343,12 @@ msgid "" "meth:`~object.__eq__` are sufficient, if you want the conventional meanings " "of the comparison operators)." msgstr "" +"一個 class 的實例不可以與其他相同 class 的實例" +"或其他物件的類別進行排序,除非 class 定義足夠的" +" method ,包含 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object." +"__gt__` 及 :meth:`~object.__ge__`\\ (一般來說,使用 :meth:`~object.__lt__` 及 :" +"meth:`~object.__eq__` 就可以滿足" +"常規意義上的比較運算子)。" #: ../../library/stdtypes.rst:190 msgid "" @@ -331,6 +356,9 @@ msgid "" "customized; also they can be applied to any two objects and never raise an " "exception." msgstr "" +"無法自定義 :keyword:`is` 與 :keyword:`is not` 運算子的行為" +";這兩個運算子也可以運用在任意兩個物件且不會導致" +"例外。" #: ../../library/stdtypes.rst:198 msgid "" @@ -338,6 +366,9 @@ msgid "" "keyword:`not in`, are supported by types that are :term:`iterable` or " "implement the :meth:`__contains__` method." msgstr "" +"此外,擁有相同的語法優先序的 :keyword:`in` 及 :keyword:`not in` 兩種運算" +"皆被是 :term:`iterable` 或者" +"有實作 :meth:`__contains__` method 的型別所支援。" #: ../../library/stdtypes.rst:205 msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" From ff8005f8b029df9898f67278e0bc8130697c570e Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:34:22 -0600 Subject: [PATCH 104/105] Update `library/csv` (#692) * Update * Fix error * Update with Reviewer's Commnet --- library/csv.po | 104 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 24 deletions(-) diff --git a/library/csv.po b/library/csv.po index fa84384b89..b011a258fe 100644 --- a/library/csv.po +++ b/library/csv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-09-10 10:26+0800\n" +"PO-Revision-Date: 2023-11-08 15:06+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.3.2\n" +"X-Generator: Poedit 3.4\n" #: ../../library/csv.rst:2 msgid ":mod:`csv` --- CSV File Reading and Writing" @@ -360,7 +360,7 @@ msgid "" msgstr "" "分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參" "數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分" -"隔字符。" +"隔字元。" #: ../../library/csv.rst:286 msgid "" @@ -507,15 +507,21 @@ msgid "" "specify individual formatting parameters, which have the same names as the " "attributes defined below for the :class:`Dialect` class." msgstr "" +"為了讓指定輸入及輸出紀錄的格式更方便,特定的格式化參數會被組成 dialect。一個 " +"dialect 是 :class:`Dialect` class 的子類別,其有一組特定的方法及單獨的 :meth:" +"`validate` 方法。當建立 :class:`reader` 或 :class:`writer` 物件時,程式設計師" +"可以指定一個字串或是一個 :class:`Dialect` 的子類別作為 dialect 參數。此外,或" +"是作為替代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其" +"與 :class:`Dialect` 類別定義的屬性具有相同的名字。" #: ../../library/csv.rst:382 msgid "Dialects support the following attributes:" -msgstr "" +msgstr "Dialect 支援下列屬性:" #: ../../library/csv.rst:387 msgid "" "A one-character string used to separate fields. It defaults to ``','``." -msgstr "" +msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。預設為 ``','``。" #: ../../library/csv.rst:392 msgid "" @@ -524,12 +530,17 @@ msgid "" "const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It " "defaults to :const:`True`." msgstr "" +"控制 *quotechar* 的實例何時出現在欄位之中,並讓它們自己被放在引號之內。當屬性" +"為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會" +"先使用 *escapechar* 作為前綴字。預設為 :const:`True`。" #: ../../library/csv.rst:397 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" +"在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當" +"一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。" #: ../../library/csv.rst:403 msgid "" @@ -539,16 +550,20 @@ msgid "" "from the following character. It defaults to :const:`None`, which disables " "escaping." msgstr "" +"一個會被寫入器使用的單一字元的字串,當 *quoting* 設定為 :const:`QUOTE_NONE` " +"時逸出\\ *分隔符號*\\ ;當 *doublequote* 設定為 :const:`False` 時逸出\\ *引號" +"*\\ 。在讀取時,\\ *逸出字元*\\ 會移除後面的字元以及任何特殊意義。預設為 :" +"const:`None`,表示禁止逸出。" #: ../../library/csv.rst:408 msgid "An empty *escapechar* is not allowed." -msgstr "" +msgstr "*escapechar* 為空是不被接受的。" #: ../../library/csv.rst:413 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." -msgstr "" +msgstr "由 :class:`writer` 產生被用來分行的字串。預設為 ``'\\r\\n'``。" #: ../../library/csv.rst:418 msgid "" @@ -556,6 +571,8 @@ msgid "" "as end-of-line, and ignores *lineterminator*. This behavior may change in " "the future." msgstr "" +":class:`reader`是 hard-coded 辨別 ``'\\r'`` or ``'\\n'`` 作為行尾 (end-of-" +"line),並忽略\\ *分行符號*\\ 。未來可能會改變這個行為。" #: ../../library/csv.rst:425 msgid "" @@ -563,10 +580,12 @@ msgid "" "such as the *delimiter* or *quotechar*, or which contain new-line " "characters. It defaults to ``'\"'``." msgstr "" +"一個單一字元的字串被用於引用包含特殊字元的欄位,像是 *delimiter*、" +"*quotechar* 或是換行字元。預設為 ``'\"'``。" #: ../../library/csv.rst:429 msgid "An empty *quotechar* is not allowed." -msgstr "" +msgstr "*quotechar* 為空是不被允許的。" #: ../../library/csv.rst:434 msgid "" @@ -574,28 +593,36 @@ msgid "" "reader. It can take on any of the :const:`QUOTE_\\*` constants (see " "section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`." msgstr "" +"控制 writer 何時產生引號,以及 reader 如何辨識引號。他可以使用任何 :const:" +"`QUOTE_\\*` 常數(請見段落 :ref:`csv-contents`)且預設為 :const:" +"`QUOTE_MINIMAL`。" #: ../../library/csv.rst:441 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`." msgstr "" +"若為 :const:`True`,在緊接著\\ *分隔符號*\\ 後的空格會被忽略。預設為 :const:" +"`False`。" #: ../../library/csv.rst:447 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" +"若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。" #: ../../library/csv.rst:451 msgid "Reader Objects" -msgstr "" +msgstr "讀取器物件" #: ../../library/csv.rst:453 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" msgstr "" +"讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列" +"公用方法 (public method):" #: ../../library/csv.rst:458 msgid "" @@ -604,34 +631,39 @@ msgid "" "instance), parsed according to the current :class:`Dialect`. Usually you " "should call this as ``next(reader)``." msgstr "" +"回傳一個列表為讀入器的可疊代物件的下一列內容(若該物件是由 :func:`reader` 回" +"傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據當前的 :class:" +"`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。" #: ../../library/csv.rst:464 msgid "Reader objects have the following public attributes:" -msgstr "" +msgstr "讀取器物件有下列公用屬性 (public attributes):" #: ../../library/csv.rst:468 msgid "A read-only description of the dialect in use by the parser." -msgstr "" +msgstr "dialect 的唯讀敘述,會被剖析器使用。" #: ../../library/csv.rst:473 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." -msgstr "" +msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。" #: ../../library/csv.rst:477 msgid "DictReader objects have the following public attribute:" -msgstr "" +msgstr "DictReader 物件有下列公用屬性:" #: ../../library/csv.rst:481 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." msgstr "" +"若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀" +"取之前進行初始化 (initialize)。" #: ../../library/csv.rst:488 msgid "Writer Objects" -msgstr "" +msgstr "寫入器物件" #: ../../library/csv.rst:490 msgid "" @@ -644,6 +676,12 @@ msgid "" "problems for other programs which read CSV files (assuming they support " "complex numbers at all)." msgstr "" +":class:`Writer` 物件(:func:`writer` 函式回傳的 :class:`DictWriter` 實例與物" +"件)有下列公用方法。對於 :class:`Writer` 物件而言,一個\\ *列*\\ 中必須為一個" +"可疊代的字串或是數字;對於 :class:`DictWriter` 物件而言,則必須為一個 " +"dictionary ,且可以對應欄位標題至字串或數字(會先透過 :func:`str` 進行傳" +"遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可" +"能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。" #: ../../library/csv.rst:501 msgid "" @@ -651,10 +689,12 @@ msgid "" "to the current :class:`Dialect`. Return the return value of the call to the " "*write* method of the underlying file object." msgstr "" +"將參數 *row* 寫入至寫入器的檔案物件中,並依照當前的 :class:`Dialect` 進行格式" +"化。回傳下層檔案物件 *write* 方法的回傳值。" #: ../../library/csv.rst:505 msgid "Added support of arbitrary iterables." -msgstr "新增對任意 iterable 的支援。" +msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。" #: ../../library/csv.rst:510 msgid "" @@ -662,18 +702,20 @@ msgid "" "above) to the writer's file object, formatted according to the current " "dialect." msgstr "" +"將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件" +"中,並依照當前的 dialect 進行格式化。" #: ../../library/csv.rst:514 msgid "Writer objects have the following public attribute:" -msgstr "" +msgstr "寫入器物件有下列公用屬性:" #: ../../library/csv.rst:519 msgid "A read-only description of the dialect in use by the writer." -msgstr "" +msgstr "dialect 的唯讀敘述,會被寫入器使用。" #: ../../library/csv.rst:522 msgid "DictWriter objects have the following public method:" -msgstr "" +msgstr "DictWriter 物件有下列公用方法:" #: ../../library/csv.rst:527 msgid "" @@ -681,12 +723,17 @@ msgid "" "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" +"將具欄位標題的一列(於建構函式 (constructor) 中指定的)寫入至寫入器的檔案物件" +"中,並依照當前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` " +"的回傳值。" #: ../../library/csv.rst:532 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." msgstr "" +":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳" +"值。" #: ../../library/csv.rst:540 msgid "Examples" @@ -694,15 +741,15 @@ msgstr "範例" #: ../../library/csv.rst:542 msgid "The simplest example of reading a CSV file::" -msgstr "" +msgstr "最簡單的讀取 CSV 檔案範例: ::" #: ../../library/csv.rst:550 msgid "Reading a file with an alternate format::" -msgstr "" +msgstr "讀取一個其他格式的檔案: ::" #: ../../library/csv.rst:558 msgid "The corresponding simplest possible writing example is::" -msgstr "" +msgstr "相對最簡單、可行的寫入範例為: ::" #: ../../library/csv.rst:565 msgid "" @@ -711,28 +758,33 @@ msgid "" "`locale.getencoding`). To decode a file using a different encoding, use the " "``encoding`` argument of open::" msgstr "" +"當 :func:`open` 被使用於開啟並讀取一個 CSV 檔案,該檔案會預設使用系統預設的編" +"碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼" +"格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::" #: ../../library/csv.rst:576 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." msgstr "" +"同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` " +"引數。" #: ../../library/csv.rst:579 msgid "Registering a new dialect::" -msgstr "" +msgstr "註冊一個新的 dialect : ::" #: ../../library/csv.rst:586 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" -msgstr "" +msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: ::" #: ../../library/csv.rst:598 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" -msgstr "" +msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: ::" #: ../../library/csv.rst:607 msgid "Footnotes" @@ -746,6 +798,10 @@ msgid "" "safe to specify ``newline=''``, since the csv module does its own (:term:" "`universal `) newline handling." msgstr "" +"如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 " +"``\\r\\n`` 行尾 (linending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 " +"(:term:`統一的 `) 換行處理方式,因此指定 ``newline=''`` " +"會永遠是安全的。" #: ../../library/csv.rst:11 msgid "csv" From 2ba9b37a1086dfa0fb81280592b61c5d0d470a47 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4H7FII8\\englam" Date: Sun, 16 Jul 2023 20:04:36 +0800 Subject: [PATCH 105/105] 20230716 pathlib_1162_to_1279 --- library/pathlib.po | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/library/pathlib.po b/library/pathlib.po index 96f16f5065..daad36597e 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-14 22:55+0800\n" "PO-Revision-Date: 2023-07-11 01:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -972,7 +972,7 @@ msgstr "" #: ../../library/pathlib.rst:1201 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -"將指向檔案的二進制內容以一個位元組 (bytes) 物件回傳:\n" +"將指向檔案的二進為內容以一個位元組 (bytes) 物件回傳:\n" "\n" "::" @@ -1115,7 +1115,7 @@ msgid "" "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -"回傳是否此路徑指向與 *other_path* 相同的檔案,*other_path* 可以是路徑 (Path) " +"回傳此路徑是否指向與 *other_path* 相同的檔案,*other_path* 可以是路徑 (Path) " "物件或字串。其語義類似於 :func:`os.path.samefile` 和 :func:`os.path." "samestat`。" @@ -1123,7 +1123,7 @@ msgstr "" msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." -msgstr "" +msgstr "若任何一個檔案因為某些原因無法存取,則引發 :exc:`OSError`。" #: ../../library/pathlib.rst:1376 msgid "" @@ -1131,20 +1131,23 @@ msgid "" "*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 "" +"使這個路徑為一個 *target* 的符號連結。如果在 Windows 的連結目標是資料夾," +"*target_is_directory* 應該為 true(預設為 ``False``\\ )。如果在 POSIX 的連結" +"目標是資料夾,*target_is_directory* 的數值會被省略。" #: ../../library/pathlib.rst:1392 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." -msgstr "" +msgstr "引數的順序 (link, target) 和 :func:`os.symlink` 相反。" #: ../../library/pathlib.rst:1397 msgid "Make this path a hard link to the same file as *target*." -msgstr "" +msgstr "使這個路徑為與 *target* 相同檔案的一個硬連結 (hard link)。" #: ../../library/pathlib.rst:1400 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." -msgstr "" +msgstr "引數的順序 (link, target) 和 :func:`os.link` 相反。" #: ../../library/pathlib.rst:1408 msgid "" @@ -1154,24 +1157,33 @@ msgid "" "its modification time is updated to the current time), otherwise :exc:" "`FileExistsError` is raised." msgstr "" +"根據給定路徑來建立一個檔案。如果 *mode* 有給定,它會與行程的 ``umask`` 值結" +"合,以確定檔案模式和存取旗標。當檔案已經存在時,若 *exist_ok* 為 true 則函式" +"不會失敗(其變更時間會被更新為當下時間),否則 :exc:`FileExistsError` 會被引" +"發。" #: ../../library/pathlib.rst:1417 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" +"移除這個檔案或符號連結。如果路徑指到資料夾,請改用 :func:`Path.rmdir`。" #: ../../library/pathlib.rst:1420 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" +"如果 *missing_ok* 是 false(預設值), :exc:`FileNotFoundError` 會在路徑不存" +"在時被引發。" #: ../../library/pathlib.rst:1423 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" +"如果 *missing_ok* 為 true,:exc:`FileNotFoundError` 例外會被忽略(行為與 " +"POSIX ``rm -f`` 指令相同)。" #: ../../library/pathlib.rst:1426 msgid "The *missing_ok* parameter was added." @@ -1181,23 +1193,25 @@ msgstr "新增 *missing_ok* 參數。" msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" -msgstr "" +msgstr "以位元組模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" #: ../../library/pathlib.rst:1441 msgid "An existing file of the same name is overwritten." -msgstr "" +msgstr "一個名稱相同的已存在檔案會被覆寫。" #: ../../library/pathlib.rst:1448 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" -msgstr "" +msgstr "以文字模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" #: ../../library/pathlib.rst:1457 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" +"一個已經存在、名稱相同的檔案會被覆寫。可選參數和 :func:`open` 的參數有相同意" +"義。" #: ../../library/pathlib.rst:1462 msgid "The *newline* parameter was added." @@ -1291,7 +1305,7 @@ msgstr ":meth:`Path.rmdir`" #: ../../library/pathlib.rst:1489 msgid ":func:`os.remove`, :func:`os.unlink`" -msgstr ":func:`os.remove`, :func:`os.unlink`" +msgstr ":func:`os.remove`、:func:`os.unlink`" #: ../../library/pathlib.rst:1489 msgid ":meth:`Path.unlink`" @@ -1399,7 +1413,7 @@ msgstr ":func:`os.stat`" #: ../../library/pathlib.rst:1503 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" +msgstr ":meth:`Path.stat`、:meth:`Path.owner`、:meth:`Path.group`" #: ../../library/pathlib.rst:1506 msgid ":func:`os.path.isabs`"